SupaLidlGame/State/NPC/Doc/DocAttackState.cs

39 lines
1004 B
C#
Raw Permalink Normal View History

2023-07-13 23:46:58 -07:00
using Godot;
2023-08-03 16:17:34 -07:00
using SupaLidlGame.Extensions;
2023-07-13 23:46:58 -07:00
namespace SupaLidlGame.State.NPC.Doc;
public abstract partial class DocAttackState : NPCState
2023-07-13 23:46:58 -07:00
{
public abstract double Duration { get; set; }
2023-07-13 23:46:58 -07:00
public abstract double AttackDuration { get; set; }
2023-07-13 23:46:58 -07:00
public abstract PackedScene Projectile { get; set; }
2023-07-13 23:46:58 -07:00
2023-07-18 00:57:28 -07:00
public abstract DocChooseAttackState ChooseAttackState { get; set; }
2023-07-13 23:46:58 -07:00
2023-07-23 23:39:20 -07:00
protected Scenes.Map _map;
protected Utils.World _world;
protected Characters.Doc _doc;
protected double _currentDuration = 0;
protected double _currentAttackDuration = 0;
public override void _Ready()
{
_doc = NPC as Characters.Doc;
}
public override NPCState Enter(IState<NPCState> previousState)
{
2023-08-03 16:17:34 -07:00
//_map = this.GetAncestor<Scenes.Map>();
_world = this.GetWorld();
_map = _world.CurrentMap;
2023-07-23 23:39:20 -07:00
_currentDuration = Duration;
_currentAttackDuration = AttackDuration;
return null;
}
protected abstract void Attack();
2023-07-13 23:46:58 -07:00
}