roll back name change from "Aim" to "SecondaryUse"

Expand SecondaryUse to have similar properties to normal Use so it can apply SecondaryUse-related status effects
Make Throwable great again
This commit is contained in:
Alex Noir
2017-12-10 15:00:52 +03:00
parent 1d6d1a066f
commit 231a38f71d
9 changed files with 41 additions and 22 deletions
@@ -27,18 +27,13 @@ namespace Barotrauma.Items.Components
public override bool Use(float deltaTime, Character character = null)
{
if (character == null) return false;
if (!character.IsKeyDown(InputType.Aim) || throwing) return false;
throwing = true;
IsActive = true;
return true;
return true; //We do the actual throwing in Aim because Use might be used by chems
}
public override void Aim(float deltaTime, Character character = null)
public override bool SecondaryUse(float deltaTime, Character character = null)
{
if (throwing) return;
if (!throwing) return false; //This should only be triggered
return true;
}
public override void Drop(Character dropper)
@@ -103,7 +98,7 @@ namespace Barotrauma.Items.Components
Limb rightHand = ac.GetLimb(LimbType.RightHand);
item.body.AngularVelocity = rightHand.body.AngularVelocity;
ApplyStatusEffects(ActionType.OnSecondaryUse, deltaTime, picker); //Stun grenades, flares, etc. all have their throw-related things handled in "onSecondaryUse"
throwing = false;
}
}