equal
deleted
inserted
replaced
69 crate = nil |
69 crate = nil |
70 |
70 |
71 startAnim = {} |
71 startAnim = {} |
72 |
72 |
73 gearDead = {} |
73 gearDead = {} |
|
74 hogDead = {} |
74 --------------------------Anim skip functions-------------------------- |
75 --------------------------Anim skip functions-------------------------- |
75 function SkipStartAnim() |
76 function SkipStartAnim() |
76 SetGearMessage(CurrentHedgehog, 0) |
77 SetGearMessage(CurrentHedgehog, 0) |
77 AnimSwitchHog(natives[1]) |
78 AnimSwitchHog(natives[1]) |
78 end |
79 end |
378 end |
379 end |
379 ExecuteAfterAnimations() |
380 ExecuteAfterAnimations() |
380 CheckEvents() |
381 CheckEvents() |
381 end |
382 end |
382 |
383 |
|
384 function onGearAdd(gear) |
|
385 if GetGearType(gear) == gtHedgehog then |
|
386 hogDead[gear] = false |
|
387 end |
|
388 end |
|
389 |
383 function onGearDelete(gear) |
390 function onGearDelete(gear) |
384 gearDead[gear] = true |
391 gearDead[gear] = true |
|
392 if GetGearType(gear) == gtHedgehog then |
|
393 hogDead[gear] = true |
|
394 end |
385 end |
395 end |
386 |
396 |
387 function onAmmoStoreInit() |
397 function onAmmoStoreInit() |
388 SetAmmo(amAirAttack, 9, 0, 0, 0) |
398 SetAmmo(amAirAttack, 9, 0, 0, 0) |
389 SetAmmo(amBaseballBat, 9, 0, 0, 0) |
399 SetAmmo(amBaseballBat, 9, 0, 0, 0) |
419 SetAmmo(amTeleport, 9, 0, 0, 0) |
429 SetAmmo(amTeleport, 9, 0, 0, 0) |
420 SetAmmo(amWatermelon, 9, 0, 0, 0) |
430 SetAmmo(amWatermelon, 9, 0, 0, 0) |
421 SetAmmo(amWhip, 9, 0, 0, 0) |
431 SetAmmo(amWhip, 9, 0, 0, 0) |
422 end |
432 end |
423 |
433 |
|
434 function IsEveryoneExceptTraitorDead() |
|
435 for id, isDead in pairs(hogDead) do |
|
436 if id ~= traitor and not isDead then |
|
437 return false |
|
438 end |
|
439 end |
|
440 return true |
|
441 end |
|
442 |
424 function onNewTurn() |
443 function onNewTurn() |
425 if AnimInProgress() then |
444 if AnimInProgress() then |
426 TurnTimeLeft = -1 |
445 TurnTimeLeft = -1 |
427 return |
446 return |
428 end |
447 end |
429 if CurrentHedgehog == traitor then |
448 -- Don't allow player to play with traitor, except when it is the final hog left |
|
449 if CurrentHedgehog == traitor and not IsEveryoneExceptTraitorDead() then |
430 EndTurn(true) |
450 EndTurn(true) |
431 else |
451 else |
432 TurnTimeLeft = -1 |
452 TurnTimeLeft = -1 |
433 end |
453 end |
434 end |
454 end |