share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/shadow.lua
changeset 15020 fa597f6e301d
parent 15002 3ed1cbd31754
child 15021 62e3853fa2ed
equal deleted inserted replaced
15019:51fbc0034c6f 15020:fa597f6e301d
   788   stage = interWeakStage
   788   stage = interWeakStage
   789   DismissTeam(weaklingsTeamName)
   789   DismissTeam(weaklingsTeamName)
   790 end
   790 end
   791 
   791 
   792 function CheckRefuse()
   792 function CheckRefuse()
   793   return GetX(dense) > 1400 and StoppedGear(dense)
   793   return GetHealth(dense) and GetX(dense) > 1400 and StoppedGear(dense)
   794 end
   794 end
   795 
   795 
   796 function DoRefuse()
   796 function DoRefuse()
   797   if stage == loseStage then
   797   if stage == loseStage then
   798     return
   798     return
   799   end
   799   end
   800   choice = choiceRefuse
   800   choice = choiceRefuse
   801 end
   801 end
   802 
   802 
   803 function CheckAccept()
   803 function CheckAccept()
       
   804   if not GetHealth(dense) then
       
   805     return false
       
   806   end
   804   if GetX(dense) < 1300 then
   807   if GetX(dense) < 1300 then
   805     -- When close to cyborg, wait for a short time before accepting,
   808     -- When close to cyborg, wait for a short time before accepting,
   806     -- to allow player to attack with melee weapons.
   809     -- to allow player to attack with melee weapons.
   807     checkAcceptTimer = checkAcceptTimer + 1
   810     checkAcceptTimer = checkAcceptTimer + 1
   808     if checkAcceptTimer > 2000 and StoppedGear(dense) then
   811     if checkAcceptTimer > 2000 and StoppedGear(dense) then
   820   end
   823   end
   821   choice = choiceAccept
   824   choice = choiceAccept
   822 end
   825 end
   823 
   826 
   824 function CheckConfront()
   827 function CheckConfront()
   825   return cyborgAttacked and StoppedGear(dense)
   828   return cyborgAttacked and GetHealth(dense) and StoppedGear(dense)
   826 end
   829 end
   827 
   830 
   828 function DoConfront()
   831 function DoConfront()
   829   if stage == loseStage then
   832   if stage == loseStage then
   830     return
   833     return