Added a Character.AddDamage override method that does damage to a specific limb instead of the limb closest to the source of the damage. Projectiles and melee weapons now always do damage to the limb they hit, even if the center point of some other limb happens to be closer.
Also refactored the IDamageable interface to make more sense; now the attacker has to be a character instead of an IDamageable and damageable classes don't need to have an AiTarget. Closes #69
This commit is contained in:
@@ -245,7 +245,6 @@ namespace Barotrauma.Items.Components
|
||||
item.Move(-submarine.Position);
|
||||
item.Submarine = submarine;
|
||||
item.body.Submarine = submarine;
|
||||
//item.FindHull();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -253,7 +252,7 @@ namespace Barotrauma.Items.Components
|
||||
Structure structure;
|
||||
if ((limb = (target.Body.UserData as Limb)) != null)
|
||||
{
|
||||
attackResult = attack.DoDamage(User, limb.character, item.WorldPosition, 1.0f);
|
||||
attackResult = attack.DoDamageToLimb(User, limb, item.WorldPosition, 1.0f);
|
||||
}
|
||||
else if ((structure = (target.Body.UserData as Structure)) != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user