2023-05-15 00:20:17 -07:00
|
|
|
using Godot;
|
|
|
|
|
2023-06-03 18:21:46 -07:00
|
|
|
namespace SupaLidlGame.Items.Weapons;
|
2023-05-15 00:20:17 -07:00
|
|
|
|
2023-06-03 18:21:46 -07:00
|
|
|
public abstract partial class Ranged : Weapon
|
|
|
|
{
|
|
|
|
[Export]
|
|
|
|
public float AngleDeviation { get; set; }
|
2023-05-15 00:20:17 -07:00
|
|
|
|
2023-06-03 18:21:46 -07:00
|
|
|
[Export]
|
|
|
|
public float ChargeTime { get; set; }
|
2023-05-15 00:20:17 -07:00
|
|
|
|
2023-06-03 18:21:46 -07:00
|
|
|
[Export]
|
|
|
|
public State.Weapon.WeaponStateMachine StateMachine { get; set; }
|
2023-05-26 22:28:08 -07:00
|
|
|
|
2023-06-03 18:21:46 -07:00
|
|
|
public override bool IsUsing => StateMachine.CurrentState
|
|
|
|
is State.Weapon.RangedFireState;
|
2023-05-15 00:20:17 -07:00
|
|
|
|
2023-06-03 18:21:46 -07:00
|
|
|
public bool IsChargeable => ChargeTime > 0;
|
2023-05-15 00:20:17 -07:00
|
|
|
|
2023-06-03 18:21:46 -07:00
|
|
|
public bool IsCharging { get; protected set; }
|
2023-05-15 00:20:17 -07:00
|
|
|
|
2023-06-03 18:21:46 -07:00
|
|
|
public override void Use()
|
|
|
|
{
|
|
|
|
StateMachine.Use();
|
|
|
|
base.Use();
|
|
|
|
}
|
2023-05-15 00:20:17 -07:00
|
|
|
|
2023-06-03 18:21:46 -07:00
|
|
|
public override void Deuse()
|
|
|
|
{
|
|
|
|
StateMachine.Deuse();
|
|
|
|
base.Deuse();
|
|
|
|
}
|
2023-05-15 00:20:17 -07:00
|
|
|
|
2023-06-03 18:21:46 -07:00
|
|
|
public override void _Process(double delta)
|
|
|
|
{
|
|
|
|
StateMachine.Process(delta);
|
|
|
|
base._Process(delta);
|
2023-05-15 00:20:17 -07:00
|
|
|
}
|
2023-06-03 18:21:46 -07:00
|
|
|
|
|
|
|
public abstract void Attack();
|
2023-05-15 00:20:17 -07:00
|
|
|
}
|