184 |
184 |
185 -- check for death has to go first |
185 -- check for death has to go first |
186 AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0) |
186 AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0) |
187 AddEvent(onProfessorDeath, {professor.gear}, professorDeath, {professor.gear}, 0) |
187 AddEvent(onProfessorDeath, {professor.gear}, professorDeath, {professor.gear}, 0) |
188 AddEvent(onMinionsDeath, {professor.gear}, minionsDeath, {professor.gear}, 0) |
188 AddEvent(onMinionsDeath, {professor.gear}, minionsDeath, {professor.gear}, 0) |
189 AddEvent(onBattleZone, {hero.gear}, battleZone, {hero.gear}, 0) |
|
190 AddEvent(onProfessorHit, {professor.gear}, professorHit, {professor.gear}, 1) |
189 AddEvent(onProfessorHit, {professor.gear}, professorHit, {professor.gear}, 1) |
191 |
190 |
192 if checkPointReached == 1 then |
191 if checkPointReached == 1 then |
193 AddAmmo(hero.gear, amRope, 2) |
192 AddAmmo(hero.gear, amRope, 2) |
194 SpawnAmmoCrate(bazookaX, weaponsY, amBazooka) |
193 SpawnAmmoCrate(bazookaX, weaponsY, amBazooka) |
207 GameFlags = bor(GameFlags,gfDisableWind) |
206 GameFlags = bor(GameFlags,gfDisableWind) |
208 weaponsAcquired = true |
207 weaponsAcquired = true |
209 TurnTimeLeft = 0 |
208 TurnTimeLeft = 0 |
210 AddAnim(dialog02) |
209 AddAnim(dialog02) |
211 end |
210 end |
|
211 -- this event check goes here to be executed after the onWeaponsPlatform check |
|
212 AddEvent(onBattleZone, {hero.gear}, battleZone, {hero.gear}, 0) |
212 |
213 |
213 SendHealthStatsOff() |
214 SendHealthStatsOff() |
214 end |
215 end |
215 |
216 |
216 function onAmmoStoreInit() |
217 function onAmmoStoreInit() |
265 end |
266 end |
266 |
267 |
267 -------------- EVENTS ------------------ |
268 -------------- EVENTS ------------------ |
268 |
269 |
269 function onWeaponsPlatform(gear) |
270 function onWeaponsPlatform(gear) |
270 if not hero.dead and GetX(gear) > bazookaX-200 and GetX(gear) < deserteagleX+400 |
271 if not hero.dead and (GetAmmoCount(hero.gear, amBazooka) > 0 or GetAmmoCount(hero.gear, amParachute) > 0 or |
271 and GetY(gear) < weaponsY+150 and StoppedGear(gear) then |
272 GetAmmoCount(hero.gear, amGrenade) > 0 or GetAmmoCount(hero.gear, amDEagle) > 0) and StoppedGear(hero.gear) then |
272 return true |
273 return true |
273 end |
274 end |
274 return false |
275 return false |
275 end |
276 end |
276 |
277 |
321 SaveCampaignVar("HeroHealth",GetHealth(hero.gear)) |
322 SaveCampaignVar("HeroHealth",GetHealth(hero.gear)) |
322 TurnTimeLeft = 0 |
323 TurnTimeLeft = 0 |
323 weaponsAqcuired = true |
324 weaponsAqcuired = true |
324 SetWind(60) |
325 SetWind(60) |
325 GameFlags = bor(GameFlags,gfDisableWind) |
326 GameFlags = bor(GameFlags,gfDisableWind) |
326 AddAnim(dialog02) |
327 AddAmmo(hero.gear, amRope, 0) |
|
328 if GetX(hero.gear) < 1900 then |
|
329 AddAnim(dialog02) |
|
330 end |
327 end |
331 end |
328 |
332 |
329 function heroDeath(gear) |
333 function heroDeath(gear) |
330 SendStat('siGameResult', loc("Hog Solo lost, try again!")) --1 |
334 SendStat('siGameResult', loc("Hog Solo lost, try again!")) --1 |
331 SendStat('siCustomAchievement', loc("You have to get the weapons and rescue the PAotH researchers")) --11 |
335 SendStat('siCustomAchievement', loc("You have to get the weapons and rescue the PAotH researchers")) --11 |