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
|
|
|
|
{
|
2023-08-15 21:49:33 -07:00
|
|
|
[Export]
|
|
|
|
public float CharacterRecoil { get; set; } = 0;
|
|
|
|
|
2023-06-03 18:21:46 -07:00
|
|
|
[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-08-08 00:54:00 -07:00
|
|
|
public override bool IsUsingPrimary => StateMachine.CurrentState
|
2023-09-10 17:08:14 -07:00
|
|
|
is State.Weapon.RangedFireState or State.Weapon.RangedChargeState;
|
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-09-10 17:08:14 -07:00
|
|
|
|
|
|
|
public virtual void Attack(float velocityModifier) => Attack();
|
2023-05-15 00:20:17 -07:00
|
|
|
}
|