From c5ee27ec7f3f12f40e1871e612b9a77bf122e3cd Mon Sep 17 00:00:00 2001 From: HumanoidSandvichDispenser Date: Thu, 3 Aug 2023 15:09:10 -0700 Subject: [PATCH] doc can not attack during intro --- Characters/Doc.tscn | 2 ++ State/NPC/Doc/DocIntroState.cs | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/Characters/Doc.tscn b/Characters/Doc.tscn index d504080..a1b40e7 100644 --- a/Characters/Doc.tscn +++ b/Characters/Doc.tscn @@ -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")] diff --git a/State/NPC/Doc/DocIntroState.cs b/State/NPC/Doc/DocIntroState.cs index 6e9a3c8..b7f56ec 100644 --- a/State/NPC/Doc/DocIntroState.cs +++ b/State/NPC/Doc/DocIntroState.cs @@ -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 nextState) + { + _doc.CanAttack = true; + base.Exit(nextState); + } + public override NPCState Process(double delta) { if ((_currentDuration -= delta) <= 0)