LuaEvents.wiki
changeset 1921 e65b834f2dd9
parent 1888 b57907ed3131
child 1948 e62b8461ec01
equal deleted inserted replaced
1920:fea4b9719045 1921:e65b834f2dd9
    80 This function is useful to add custom crate drops as well.
    80 This function is useful to add custom crate drops as well.
    81 
    81 
    82 === <tt>onSuddenDeath()</tt> ===
    82 === <tt>onSuddenDeath()</tt> ===
    83 This function is called on the start of Sudden Death.
    83 This function is called on the start of Sudden Death.
    84 
    84 
    85 === <tt>onGameResult(winningClan)</tt> (0.9.25) ===
    85 === <tt>onGameResult(winningClan)</tt> (1.0.0) ===
    86 This function calls when the game ends with a winner or in a draw. If a clan wins, `winningClan` is the clan ID of the winning clan. If the game ends in a draw, `winningClan` is set to -1.
    86 This function calls when the game ends with a winner or in a draw. If a clan wins, `winningClan` is the clan ID of the winning clan. If the game ends in a draw, `winningClan` is set to -1.
    87 
    87 
    88 === <tt>onAchievementsDeclaration()</tt> ===
    88 === <tt>onAchievementsDeclaration()</tt> ===
    89 This function is called after the stats for the stats screen (after the game) have been generated. You are supposed to call `DeclareAchievement` here.
    89 This function is called after the stats for the stats screen (after the game) have been generated. You are supposed to call `DeclareAchievement` here.
    90 
    90 
    91 === <tt>onHogAttack(ammoType)</tt> ===
    91 === <tt>onHogAttack(ammoType)</tt> ===
    92 This function is called when a hedgehog attacks. Beginning with 0.9.21, the parameter `ammoType` is provided. It contains the ammo type of the weapon used for the attack. 
    92 This function is called when a hedgehog attacks. Beginning with 0.9.21, the parameter `ammoType` is provided. It contains the ammo type of the weapon used for the attack. 
       
    93 
       
    94 Note: If you want to detect when a turn was skipped, use `onSkipTurn()`. There is no guarantee that `onHogAttack(amSkip)` is called in such an event.
       
    95 
       
    96 === <tt>onHogSwitch(oldHog)</tt> (1.0.0) ===
       
    97 Called when hogs have been switched using the “switch hedgehog” utility. `oldHog` is the gear ID of the previous hedgehog and the current hedgehog gear ID is stored in `CurrentHedgehog`.
    93 
    98 
    94 Note: If you want to detect when a turn was skipped, use `onSkipTurn()`. There is no guarantee that `onHogAttack(amSkip)` is called in such an event.
    99 Note: If you want to detect when a turn was skipped, use `onSkipTurn()`. There is no guarantee that `onHogAttack(amSkip)` is called in such an event.
    95 
   100 
    96 === <tt>onUsedAmmo(ammoType)</tt> ===
   101 === <tt>onUsedAmmo(ammoType)</tt> ===
    97 Called after a weapon has been used completely, with `ammoType` as the used ammo type.
   102 Called after a weapon has been used completely, with `ammoType` as the used ammo type.