Merge pull request #123 from Crystalwarrior/syringeGun

Syringe gun + projectile tweaks + several status effects/item components tweaks
This commit is contained in:
Joonas Rikkonen
2017-12-12 20:12:28 +02:00
committed by GitHub
9 changed files with 70 additions and 7 deletions
@@ -265,7 +265,7 @@ namespace Barotrauma
{
SerializableProperty property;
if (!target.SerializableProperties.TryGetValue(propertyNames[i], out property)) continue;
if (target == null || target.SerializableProperties == null || !target.SerializableProperties.TryGetValue(propertyNames[i], out property)) continue;
if (duration > 0.0f)
{
@@ -114,6 +114,18 @@ namespace Barotrauma
NewMessage("The code words are: " + traitorManager.codeWords + ", response: " + traitorManager.codeResponse + ".", Color.Cyan);
}));
commands.Add(new Command("itemlist", "itemlist: List all the item prefabs available for spawning.", (string[] args) =>
{
NewMessage("***************", Color.Cyan);
foreach (MapEntityPrefab ep in MapEntityPrefab.List)
{
var itemPrefab = ep as ItemPrefab;
if (itemPrefab == null || itemPrefab.Name == null) continue;
NewMessage("- " + itemPrefab.Name, Color.Cyan);
}
NewMessage("***************", Color.Cyan);
}));
commands.Add(new Command("createfilelist", "", (string[] args) =>
{
UpdaterUtil.SaveFileList("filelist.xml");
@@ -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
}
}