share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/shadow.lua
changeset 14882 421eed52a8e1
parent 14665 aa4f99b96c6d
child 14903 4596357d002d
--- a/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/shadow.lua	Sat May 04 19:07:58 2019 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/shadow.lua	Sat May 04 21:03:26 2019 +0200
@@ -127,6 +127,7 @@
 lastEnemyHog = 0
 stage = 0
 choice = 0
+checkAcceptTimer = 0
 
 brainiacDead = false
 cyborgHidden = false
@@ -800,7 +801,17 @@
 end
 
 function CheckAccept()
-  return GetX(dense) < 1300 and StoppedGear(dense)
+  if GetX(dense) < 1300 then
+    -- When close to cyborg, wait for a short time before accepting,
+    -- to allow player to attack with melee weapons.
+    checkAcceptTimer = checkAcceptTimer + 1
+    if checkAcceptTimer > 2000 and StoppedGear(dense) then
+      return true
+    end
+  else
+    checkAcceptTimer = 0
+  end
+  return false
 end
 
 function DoAccept()