doc can not attack during intro

godot-4.1.1
John Montagu, the 4th Earl of Sandvich 2023-08-03 15:09:10 -07:00
parent 071c3b71d0
commit c5ee27ec7f
Signed by: sandvich
GPG Key ID: 9A39BE37E602B22D
2 changed files with 9 additions and 0 deletions

View File

@ -599,6 +599,7 @@ InitialState = NodePath("Telegraph")
[node name="Intro" type="Node" parent="BossStateMachine" node_paths=PackedStringArray("NextState", "NPC")]
script = ExtResource("11_lt771")
NextState = NodePath("../Telegraph")
Duration = 3.0
NPC = NodePath("../..")
[node name="Telegraph" type="Node" parent="BossStateMachine" node_paths=PackedStringArray("TelegraphAnimationPlayer", "AttackState", "NPC")]
@ -637,6 +638,7 @@ NPC = NodePath("../..")
[node name="LanceIntro" type="Node" parent="BossStateMachine" node_paths=PackedStringArray("NextState", "NPC")]
script = ExtResource("11_lt771")
NextState = NodePath("../Lance")
Duration = 3.0
NPC = NodePath("../..")
[node name="Lance" type="Node" parent="BossStateMachine" node_paths=PackedStringArray("ExitState", "NPC")]

View File

@ -23,9 +23,16 @@ public partial class DocIntroState : NPCState
{
_currentDuration = Duration;
_doc.MiscAnimation.Play("intro");
_doc.CanAttack = false;
return null;
}
public override void Exit(IState<NPCState> nextState)
{
_doc.CanAttack = true;
base.Exit(nextState);
}
public override NPCState Process(double delta)
{
if ((_currentDuration -= delta) <= 0)