Added a fully functional syringe gun! Accepts syringes as ammo. Has custom sprite and sound.

Made syringes have a "projectile" component for syringe guns
Adds several missing signal components to the fabricator, as well as medical syringe to medical fabricator
Adds support for status effects applied to characters from onImpact
Removed "contained.Condition = 0.0f;" in Projectile.cs due to it limiting the possibilities of the .xml content creation
Added a couple null checks in StatusEffect.cs due to crashes caused by the new projectile changes - might need to debug further, perhaps there's a root cause?
Added itemlist console command
This commit is contained in:
Alex Noir
2017-12-10 22:17:14 +03:00
parent db7d5539e0
commit a2a4225598
9 changed files with 69 additions and 7 deletions
@@ -237,6 +237,7 @@ namespace Barotrauma.Items.Components
}
AttackResult attackResult = new AttackResult();
Character character = null;
if (attack != null)
{
var submarine = target.Body.UserData as Submarine;
@@ -248,11 +249,13 @@ namespace Barotrauma.Items.Components
return true;
}
Limb limb;
Limb limb = target.Body.UserData as Limb;
Structure structure;
if ((limb = (target.Body.UserData as Limb)) != null)
if (limb != null)
{
attackResult = attack.DoDamageToLimb(User, limb, item.WorldPosition, 1.0f);
if (limb.character != null)
character = limb.character;
}
else if ((structure = (target.Body.UserData as Structure)) != null)
{
@@ -260,8 +263,8 @@ namespace Barotrauma.Items.Components
}
}
ApplyStatusEffects(ActionType.OnUse, 1.0f);
ApplyStatusEffects(ActionType.OnImpact, 1.0f);
ApplyStatusEffects(ActionType.OnUse, 1.0f, character);
ApplyStatusEffects(ActionType.OnImpact, 1.0f, character);
IsActive = false;
@@ -306,7 +309,7 @@ namespace Barotrauma.Items.Components
{
contained.SetTransform(item.SimPosition, contained.body.Rotation);
}
contained.Condition = 0.0f;
//contained.Condition = 0.0f; //Let the freaking .xml handle it jeez
}
}