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
@@ -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);
@@ -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)
{