Railguns cannot be fired without aiming. Closes #364
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
|
||||
<Sprite texture ="railgunetc.png" depth="0.8" sourcerect="182,0,61,97"/>
|
||||
|
||||
<Controller UserPos="-35.0, -50.0" direction ="Right" canbeselected="true">
|
||||
<Controller UserPos="-35.0, -50.0" direction ="Right" canbeselected="true" requireaimtouse="true">
|
||||
<limbposition limb="Head" position="-5,-62"/>
|
||||
<limbposition limb="Torso" position="-5,-108"/>
|
||||
<limbposition limb="LeftHand" position="43,-85"/>
|
||||
|
||||
@@ -39,6 +39,12 @@ namespace Barotrauma.Items.Components
|
||||
set { userPos = value; }
|
||||
}
|
||||
|
||||
[Serialize(false, true)]
|
||||
public bool RequireAimToUse
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public Controller(Item item, XElement element)
|
||||
: base(item, element)
|
||||
{
|
||||
@@ -160,6 +166,8 @@ namespace Barotrauma.Items.Components
|
||||
return false;
|
||||
}
|
||||
|
||||
if (RequireAimToUse && !activator.IsKeyDown(InputType.Aim)) return false;
|
||||
|
||||
item.SendSignal(0, "1", "trigger_out", character);
|
||||
|
||||
ApplyStatusEffects(ActionType.OnUse, 1.0f, activator);
|
||||
|
||||
Reference in New Issue
Block a user