57 Delay = 500 |
59 Delay = 500 |
58 SuddenDeathTurns = 99999 -- "disable" sudden death |
60 SuddenDeathTurns = 99999 -- "disable" sudden death |
59 end |
61 end |
60 |
62 |
61 function onGameStart() |
63 function onGameStart() |
62 ShowMission(loc(caption), loc(subcaption), loc(goal), -amBaseballBat, 0); |
64 ShowMission(loc(caption), loc(subcaption), loc(goal), -amBaseballBat, 0) |
|
65 started = true |
63 end |
66 end |
64 |
67 |
65 function onGameTick() |
68 function onGameTick() |
66 if ball ~= nil and GetFollowGear() ~= nil then FollowGear(ball) end |
69 if ball ~= nil and GetFollowGear() ~= nil then FollowGear(ball) end |
67 end |
70 end |
82 end |
85 end |
83 end |
86 end |
84 end |
87 end |
85 |
88 |
86 function onGearDelete(gear) |
89 function onGearDelete(gear) |
|
90 if not started then |
|
91 return |
87 if gear == ball then |
92 if gear == ball then |
88 ball = nil |
93 ball = nil |
89 elseif (GetGearType(gear) == gtHedgehog) and CurrentHedgehog ~= nil then |
94 elseif (GetGearType(gear) == gtHedgehog) and CurrentHedgehog ~= nil then |
90 local clan = GetHogClan(CurrentHedgehog) |
95 local clan = GetHogClan(CurrentHedgehog) |
91 local s |
96 local s |
92 if GetHogClan(CurrentHedgehog) ~= GetHogClan(gear) then |
97 if clan ~= nil then |
93 score[clan] = score[clan] + 1 |
98 if GetHogClan(CurrentHedgehog) ~= GetHogClan(gear) then |
94 s = string.format(loc(scored), GetHogName(gear), clan + 1) |
99 score[clan] = score[clan] + 1 |
95 else |
100 s = string.format(loc(scored), GetHogName(gear), clan + 1) |
96 score[clan] = score[clan] - 1 |
101 else |
97 s = string.format(loc(failed), GetHogName(gear), clan + 1) |
102 score[clan] = score[clan] - 1 |
|
103 s = string.format(loc(failed), GetHogName(gear), clan + 1) |
|
104 end |
|
105 s = s .. " " .. score[0] |
|
106 for i = 1, ClansCount - 1 do s = s .. " - " .. score[i] end |
|
107 ShowMission(loc(caption), loc(subcaption), s, -amBaseballBat, 0) |
98 end |
108 end |
99 s = s .. " " .. score[0] |
|
100 for i = 1, ClansCount - 1 do s = s .. " - " .. score[i] end |
|
101 ShowMission(loc(caption), loc(subcaption), s, -amBaseballBat, 0) |
|
102 end |
109 end |
103 end |
110 end |