Made the damage range of limb attacks configurable (instead of having it always be half of the distance at which the attack activates) and tweaked the damage ranges of all the creature attacks

This commit is contained in:
Joonas Rikkonen
2017-11-01 20:42:17 +02:00
parent f8258450a1
commit 69d0fac69d
16 changed files with 29 additions and 26 deletions

View File

@@ -31,7 +31,7 @@
<lighttexture texture="Content/Characters/Carrier/carrier.png" sourcerect="392,0,307,778" origin="0.5, 0.45"/>
</lightsource>
<attack range="400" duration="0.08" damage="100" stun="5" force="20" damagetype="blunt" targetforce="100"/>
<attack range="400" damagerange="250" duration="0.08" damage="100" stun="5" force="20" damagetype="blunt" targetforce="100"/>
</limb>
<limb id = "1" width="50" height="240" flip="true">

View File

@@ -31,7 +31,7 @@
<!-- lower yaw -->
<limb id = "1" radius="70" height="100">
<sprite texture="Content/Characters/Charybdis/charybdis.png" sourcerect="416,0,192,256" depth="0.025" origin="0.65,0.5"/>
<attack range="500" duration="0.5" damage="5.00" bleedingdamage="50" structuredamage="500" damagetype="slash" torque="200" force="50" targetforce="-50" severlimbsprobability="1.0"/>
<attack range="500" damagerange="250" duration="0.5" damage="5.00" bleedingdamage="50" structuredamage="500" damagetype="slash" torque="200" force="50" targetforce="-50" severlimbsprobability="1.0"/>
</limb>
<!-- front fins -->

View File

@@ -33,7 +33,7 @@
<!-- lower yaw -->
<limb id = "1" radius="20" height="240">
<sprite texture="Content/Characters/Coelanth/coelanth.png" sourcerect="425,1,101,309" depth="0.025" origin="0.5,0.5"/>
<attack range="300" duration="0.5" damage="200" bleedingdamage="50" structuredamage="150" damagetype="slash" torque="100" targetforce="-50" severlimbsprobability="0.8"/>
<attack range="300" damagerange="200" duration="0.5" damage="200" bleedingdamage="50" structuredamage="150" damagetype="slash" torque="100" targetforce="-50" severlimbsprobability="0.8"/>
</limb>
<!-- body -->

View File

@@ -46,7 +46,7 @@
<limb id = "3" width="13" height="45" ignorecollisions="true" flip="true">
<sprite texture="Content/Characters/Crawler/crawler.png" sourcerect="65,131,36,50" depth="0.15" origin="0.4,0.5"/>
<attack range="120" duration="0.5" damage="30" stun="0.1" bleedingdamage="3" structuredamage="50"
<attack range="120" damagerange="60" duration="0.5" damage="30" stun="0.1" bleedingdamage="3" structuredamage="50"
damagetype="slash" targetforce="-30" severlimbsprobability="0.5"
force="5" applyforceonlimbs="0" torque="-20" />
</limb>

View File

@@ -15,10 +15,10 @@
<ragdoll waveamplitude="100.0" wavelength="1000" speed="2.0" scale ="2.0" flip="false" canentersubmarine="false">
<collider radius="300"/>
<collider radius="300" height="400"/>
<!-- head -->
<limb id = "0" radius="300" type="Head" steerforce="3.0">
<limb id = "0" radius="250" type="Head" steerforce="3.0">
<sprite texture="Content/Characters/Endworm/endworm.png" sourcerect="0,478,720,546" depth="0.05"/>
</limb>
@@ -54,12 +54,12 @@
<limb id = "8" width="50" height="320">
<sprite texture="Content/Characters/Endworm/endworm.png" sourcerect="755,552,137,470" depth="0.08" origin="0.5,0.5"/>
<attack range="800" duration="0.5" damage="30" stun="5.0" torque="-100" structuredamage="500" damagetype="slash"/>
<attack range="1400" damagerange="1300" duration="0.5" damage="30" stun="5.0" force="100" torque="-100" structuredamage="500" damagetype="slash"/>
</limb>
<limb id = "9" width="50" height="320">
<sprite texture="Content/Characters/Endworm/endworm.png" sourcerect="892,552,137,470" depth="0.08" origin="0.6,0.5"/>
<attack range="800" duration="0.5" damage="30" stun="5.0" torque="100" structuredamage="500" damagetype="slash"/>
<attack range="1400" damagerange="1300" duration="0.5" damage="30" stun="5.0" force="100" torque="100" structuredamage="500" damagetype="slash"/>
</limb>

View File

@@ -20,7 +20,7 @@
<!-- head -->
<limb id = "0" radius="65" type="Head" steerforce="3.0">
<sprite texture="Content/Characters/Fractalguardian/fractalguardian.png" sourcerect="0,0,129,128" depth="0.04"/>
<attack type="Hit" range="120" duration="0.2" damage="50" stun="2" force="10" damagetype="blunt" targetforce="80"/>
<attack type="Hit" range="120" damagerange="70" duration="0.2" damage="50" stun="2" force="10" damagetype="blunt" targetforce="80"/>
</limb>
<!-- body -->
@@ -39,12 +39,12 @@
<limb id = "4" width="30" height="239">
<sprite texture="Content/Characters/Fractalguardian/fractalguardian.png" sourcerect="183,0,53,238" depth="0.05" origin="0.5,0.5"/>
<attack range="150" duration="0.5" damage="30" stun="1.0" torque="-150" damagetype="slash"/>
<attack range="150" damagerange="120" duration="0.5" damage="30" stun="1.0" torque="-150" damagetype="slash"/>
</limb>
<limb id = "5" width="30" height="239">
<sprite texture="Content/Characters/Fractalguardian/fractalguardian.png" sourcerect="236,0,53,238" size="-1,1" depth="0.05" origin="0.5,0.5"/>
<attack range="150" duration="0.5" damage="30" stun="1.0" torque="150" damagetype="slash"/>
<attack range="150" damagerange="120" duration="0.5" damage="30" stun="1.0" torque="150" damagetype="slash"/>
</limb>

View File

@@ -21,7 +21,7 @@
<!-- head -->
<limb id = "0" radius="80" height="30" type="Head" steerforce="3.0">
<sprite texture="Content/Characters/Fractalguardian/fractalguardian.png" sourcerect="299,0,171,208" depth="0.05"/>
<attack type="Hit" range="120" duration="0.2" damage="50" stun="2" force="10" damagetype="blunt" targetforce="100"/>
<attack type="Hit" range="120" damagerange="60" duration="0.2" damage="50" stun="2" force="10" damagetype="blunt" targetforce="100"/>
</limb>
@@ -30,7 +30,7 @@
</limb>
<limb id = "2" width="30" height="175">
<sprite texture="Content/Characters/Fractalguardian/fractalguardian.png" sourcerect="131,0,36,175" depth="0.1" origin="0.5,0.5"/>
<attack range="150" duration="0.5" damage="30" stun="1.0" torque="150" damagetype="slash"/>
<attack range="150" damagerange="75" duration="0.5" damage="30" stun="1.0" torque="150" damagetype="slash"/>
</limb>
<limb id = "3" width="30" height="178">
@@ -39,7 +39,7 @@
<limb id = "4" width="30" height="175">
<sprite texture="Content/Characters/Fractalguardian/fractalguardian.png" sourcerect="131,0,36,175" depth="0.1" origin="0.5,0.5"/>
<attack range="150" duration="0.5" damage="30" stun="1.0" torque="-150" damagetype="slash"/>
<attack range="150" damagerange="75" duration="0.5" damage="30" stun="1.0" torque="-150" damagetype="slash"/>
</limb>
<!-- head to body -->

View File

@@ -84,7 +84,7 @@
<limb id = "13" width="10" height="30" mass = "6" attackpriority="2" flip="true" pullpos="0.0,25.0">
<sprite texture="Content/Characters/Husk/DivingSuit.png" sourcerect="110,76,18,52" depth="0.5" origin="0.5,0.5"/>
<attack range="70" duration="0.1" bleedingdamage="3" damage="10" stun="0.5" damagetype="slash" targetforce="10"
<attack range="70" damagerange="35" duration="0.1" bleedingdamage="3" damage="10" stun="0.5" damagetype="slash" targetforce="10"
force="5" applyforceonlimbs="1" torque="-10">
<StatusEffect type="OnUse" target="Character" HuskInfectionState="0.01" disabledeltatime="true"/>
<StatusEffect type="OnUse" target="This" Health="20.0" disabledeltatime="true"/>

View File

@@ -3,7 +3,7 @@
<!-- spike/tentacle thingy -->
<limb id = "13" width="10" height="30" mass = "6" attackpriority="2" flip="true" pullpos="0.0,25.0">
<sprite texture="Content/Characters/Husk/DivingSuit.png" sourcerect="110,76,18,52" depth="0.5" origin="0.5,0.5"/>
<attack range="70" duration="0.1" bleedingdamage="0.5" damage="10" stun="0.5" torque="-50" damagetype="slash" targetforce="10">
<attack range="70" damagerange="35" duration="0.1" bleedingdamage="0.5" damage="10" stun="0.5" torque="-50" damagetype="slash" targetforce="10">
<StatusEffect type="OnUse" target="Character" HuskInfectionState="0.01"/>
<StatusEffect type="OnUse" target="This" Health="10.0" disabledeltatime="true"/>
</attack>

View File

@@ -35,7 +35,7 @@
<!-- spike/tentacle thingy -->
<limb id = "13" width="10" height="30" mass = "6" attackpriority="2" flip="true" pullpos="0.0,25.0">
<sprite texture="Content/Characters/Husk/DivingSuit.png" sourcerect="110,76,18,52" depth="0.05" origin="0.5,0.5"/>
<attack range="70" duration="0.2" bleedingdamage="0.5" damage="10" stun="0.5" damagetype="slash" targetforce="10"
<attack range="70" damagerange="35" duration="0.2" bleedingdamage="0.5" damage="10" stun="0.5" damagetype="slash" targetforce="10"
force="5" applyforceonlimbs="1" torque="-10">
<StatusEffect type="OnUse" target="Character" HuskInfectionState="0.01" disabledeltatime="true"/>
<StatusEffect type="OnUse" target="This" Health="1.0" disabledeltatime="true"/>

View File

@@ -14,7 +14,7 @@
attackpriorityrooms="50.0"
attackpriorityweaker="60"
attackprioritystronger="-70"
eatpriority="65"
eatpriority="45"
attackcooldown="1.0"
sight="0.5"
hearing="1.0"
@@ -63,7 +63,7 @@
<!-- ""claw" -->
<limb id = "6" width="15" height="63" mass = "4" flip="true" pullpos="0.0,30.0" refjoint="0">
<sprite texture="Content/Characters/Mantis/mantis.png" sourcerect="228,1,28,76" depth="0.01" origin="0.5,0.5"/>
<attack range="200" duration="0.25" damage="50" stun="0.1" bleedingdamage="5" structuredamage="50" damagetype="slash" targetforce="-100" severlimbsprobability="0.8"
<attack range="200" damagerange="100" duration="0.25" damage="50" stun="0.1" bleedingdamage="5" structuredamage="50" damagetype="slash" targetforce="-100" severlimbsprobability="0.8"
torque="-20" force="10" applyforceonlimbs="0,1,6"/>
<sound file ="Content/Sounds/stepMetal.ogg"/>
</limb>

View File

@@ -21,7 +21,7 @@
<!-- head -->
<limb id = "0" radius="230" height="500" type="Head" steerforce="1.0" flip="true" armorsector="0.0,180.0" armorvalue="100.0">
<sprite texture="Content/Characters/Moloch/moloch.png" sourcerect="0,0,628,1024" depth="0.02" origin ="0.4,0.5"/>
<attack range="700" duration="0.05" damage="200" stun="5" force="20" damagetype="blunt" targetforce="100"/>
<attack range="700" damagerange="350" duration="0.05" damage="200" stun="5" force="20" damagetype="blunt" targetforce="100"/>
</limb>
<limb id = "1" width="50" height="440" flip="true">

View File

@@ -9,9 +9,9 @@
combatstrength="400"
attackpriorityhumans="100.0"
attackpriorityrooms="50.0"
attackpriorityweaker="50"
attackpriorityweaker="45"
attackprioritystronger="-30"
eatpriority="55"
eatpriority="40"
sight="0.5"
hearing="1.0"/>
@@ -34,7 +34,7 @@
<limb id = "1" width="16" height="103">
<sprite texture="Content/Characters/Tigerthresher/tigerthresher.png" sourcerect="391,169,28,110" depth="0.025" origin="0.5,0.5"/>
<damagedsprite texture="Content/Characters/Tigerthresher/damagedtigerthresher.png" sourcerect="391,169,28,110" origin="0.5,0.5"/>
<attack range="300" duration="0.5" damage="150" bleedingdamage="10" structuredamage="200" damagetype="slash" force="80" torque="80" targetforce="-50" severlimbsprobability="0.8"/>
<attack range="300" damagerange="150" duration="0.5" damage="150" bleedingdamage="10" structuredamage="200" damagetype="slash" force="80" torque="80" targetforce="-50" severlimbsprobability="0.8"/>
</limb>
<!-- body front -->

View File

@@ -27,7 +27,7 @@
<!-- head -->
<limb id = "0" type="Head" width="350" height="320" steerforce="1.0" flip="true" armorsector="0.0,360.0" armorvalue="100.0">
<sprite texture="Content/Characters/Watcher/watcher.png" sourcerect="0,0,369,348" depth="0.02" origin ="0.5,0.6"/>
<attack range="250" duration="0.05" damage="200" stun="5" force="20" damagetype="blunt" targetforce="100"/>
<attack range="250" damagerange="170" duration="0.05" damage="200" stun="5" force="20" damagetype="blunt" targetforce="100"/>
</limb>
<limb id = "1" radius="50" height="120" flip="true">

View File

@@ -32,6 +32,7 @@ namespace Barotrauma
partial class Attack
{
public readonly float Range;
public readonly float DamageRange;
public readonly float Duration;
public readonly DamageType DamageType;
@@ -78,6 +79,7 @@ namespace Barotrauma
public Attack(float damage, float structureDamage, float bleedingDamage, float range = 0.0f)
{
Range = range;
DamageRange = range;
this.damage = damage;
this.structureDamage = structureDamage;
this.bleedingDamage = bleedingDamage;
@@ -93,7 +95,7 @@ namespace Barotrauma
{
DamageType = DamageType.None;
}
damage = element.GetAttributeFloat("damage", 0.0f);
structureDamage = element.GetAttributeFloat("structuredamage", 0.0f);
bleedingDamage = element.GetAttributeFloat("bleedingdamage", 0.0f);
@@ -106,6 +108,7 @@ namespace Barotrauma
Torque = element.GetAttributeFloat("torque", 0.0f);
Range = element.GetAttributeFloat("range", 0.0f);
DamageRange = element.GetAttributeFloat("damagerange", Range);
Duration = element.GetAttributeFloat("duration", 0.0f);
priority = element.GetAttributeFloat("priority", 1.0f);

View File

@@ -471,7 +471,7 @@ namespace Barotrauma
body.ApplyTorque(Mass * character.AnimController.Dir * attack.Torque);
if (dist < attack.Range * 0.5f)
if (dist < attack.DamageRange)
{
if (AttackTimer >= attack.Duration && damageTarget != null)
{