67 clantimes[i] = 0 |
68 clantimes[i] = 0 |
68 end |
69 end |
69 end |
70 end |
70 |
71 |
71 function onAmmoStoreInit() |
72 function onAmmoStoreInit() |
72 SetAmmo(amRope, 9, 2, 0) |
73 SetAmmo(amRope, 9, 1, 0) |
|
74 SetAmmo(amSkip, 9, 1, 0) |
73 end |
75 end |
74 |
76 |
75 function onGameTick() |
77 function onGameTick() |
76 if startTime == 0 and TurnTimeLeft < maxtime then |
78 if startTime == 0 and TurnTimeLeft < maxtime then |
77 startTime = GameTime |
79 startTime = GameTime |
78 end |
80 end |
79 if CurrentHedgehog ~= nil and TurnTimeLeft == 0 then |
81 if CurrentHedgehog ~= nil and TurnTimeLeft == 1 then |
80 SetHealth(CurrentHedgehog, 0) |
82 SetHealth(CurrentHedgehog, 0) |
81 x, y = GetGearPosition(CurrentHedgehog) |
83 x, y = GetGearPosition(CurrentHedgehog) |
82 AddGear(x, y, gtShell, 0, 0, 0, 0) |
84 AddGear(x, y, gtShell, 0, 0, 0, 0) |
83 worsttime = 99999 |
85 worsttime = 99999 |
84 worsthog = nil |
86 worsthog = nil |
85 elseif TurnTimeLeft == maxtime-1 and CurrentHedgehog ~= nil then |
87 elseif TurnTimeLeft == maxtime-1 and CurrentHedgehog ~= nil then |
86 if lasthog ~= nil then |
88 if lasthog ~= nil then |
87 SetGearPosition(lasthog, p , 0) |
89 SetGearPosition(lasthog, p , 0) |
88 end |
90 end |
89 reached = false |
91 reached = false |
90 SetGearVelocity(CurrentHedgehog, 1, 0) |
92 SetGearVelocity(CurrentHedgehog, 1, 0) |
91 SetGearPosition(CurrentHedgehog, start_area[1] + start_area[3] / 2, start_area[2] + start_area[4] / 2) |
93 SetGearPosition(CurrentHedgehog, start_area[1] + start_area[3] / 2, start_area[2] + start_area[4] / 2) |
92 ParseCommand("setweap " .. string.char(amRope)) |
94 ParseCommand("setweap " .. string.char(amRope)) |
112 local hscore = "| |" |
114 local hscore = "| |" |
113 local clan = GetHogClan(CurrentHedgehog) |
115 local clan = GetHogClan(CurrentHedgehog) |
114 if ttime < clantimes[clan] or clantimes[clan] == 0 then |
116 if ttime < clantimes[clan] or clantimes[clan] == 0 then |
115 clantimes[clan] = ttime |
117 clantimes[clan] = ttime |
116 end |
118 end |
|
119 local teamname = GetHogTeamName(CurrentHedgehog) |
|
120 if bestTimes[teamname] == nil or bestTimes[teamname] > ttime then |
|
121 bestTimes[teamname] = ttime |
|
122 end |
117 if ttime < besttime then |
123 if ttime < besttime then |
118 besttime = ttime |
124 besttime = ttime |
119 besthog = CurrentHedgehog |
125 besthog = CurrentHedgehog |
120 besthogteam = GetHogTeamName(besthog) |
|
121 hscore = hscore .. loc("NEW fastest lap: ") |
126 hscore = hscore .. loc("NEW fastest lap: ") |
122 else |
127 else |
123 hscore = hscore .. loc("Fastest lap: ") |
128 hscore = hscore .. loc("Fastest lap: ") |
124 end |
129 end |
125 if ttime > worsttime then |
130 if ttime > worsttime then |