LuaAPI.wiki
changeset 1112 f8b1be6befc7
parent 1111 f6d0d5772a6c
child 1155 90bf2e940925
equal deleted inserted replaced
1111:f6d0d5772a6c 1112:f8b1be6befc7
    85 || `CursorY` || The Y position of the cursor if the player is choosing a target. Otherwise, this is `-2147483648` ||
    85 || `CursorY` || The Y position of the cursor if the player is choosing a target. Otherwise, this is `-2147483648` ||
    86 || `WaterLine` || The y position of the water, used to determine at which position stuff drowns. Use `SetWaterLine` to change. ||
    86 || `WaterLine` || The y position of the water, used to determine at which position stuff drowns. Use `SetWaterLine` to change. ||
    87 || `ClansCount` || Number of clans in the game (teams with the same color belong to one clan) ||
    87 || `ClansCount` || Number of clans in the game (teams with the same color belong to one clan) ||
    88 || `TeamsCount` || Number of teams in the game ||
    88 || `TeamsCount` || Number of teams in the game ||
    89 || `TurnTimeLeft` || Number of game ticks (milliseconds) left until the current turn ends. You can change this variable directly. ||
    89 || `TurnTimeLeft` || Number of game ticks (milliseconds) left until the current turn ends. You can change this variable directly. ||
       
    90 || `ReadyTimeLeft` || Remaining ready time in millseconds, 0 if turn in progress. Can be set in onNewTurn. In other places, it should only be read, not written. ||
    90 || `GameTime` || Number of total game ticks ||
    91 || `GameTime` || Number of total game ticks ||
    91 || `TotalRounds` || Number of rounds that have passed ||
    92 || `TotalRounds` || Number of rounds that have passed ||
    92 || `CurrentHedgehog` || The hedgehog gear that is currently in play ||
    93 || `CurrentHedgehog` || The hedgehog gear that is currently in play ||
       
    94 || `AmmoTypeMax` || Maximum ammo type ID (useful to iterate through all ammo types, starting by 0)
    93 
    95 
    94 === !GameFlags ===
    96 === !GameFlags ===
    95 The !GameFlags are used to store simple boolean settings of the game.
    97 The !GameFlags are used to store simple boolean settings of the game.
    96 You can read/modify them using the [LuaAPI#GameFlags_functions GameFlags-Functions].
    98 You can read/modify them using the [LuaAPI#GameFlags_functions GameFlags-Functions].
    97 
    99 
   213 
   215 
   214 === <tt>onGameTick20()</tt> ===
   216 === <tt>onGameTick20()</tt> ===
   215 This function is called every 20 game ticks, which equals 50 times a second. It reduces Lua overhead for simple monitoring that doesn’t need to happen every single tick.
   217 This function is called every 20 game ticks, which equals 50 times a second. It reduces Lua overhead for simple monitoring that doesn’t need to happen every single tick.
   216 
   218 
   217 === <tt>onNewTurn()</tt> ===
   219 === <tt>onNewTurn()</tt> ===
   218 This function calls at the start of every turn.
   220 This function calls at the start of every turn. You can set `ReadyTimeLeft` here to change the ready time for this turn. (See also: `Ready`)
   219 
   221 
   220 === <tt>onSuddenDeath()</tt> (0.9.22) ===
   222 === <tt>onSuddenDeath()</tt> (0.9.22) ===
   221 This function is called on the start of Sudden Death.
   223 This function is called on the start of Sudden Death.
   222 
   224 
   223 === <tt>onGearAdd(gearUid)</tt> ===
   225 === <tt>onGearAdd(gearUid)</tt> ===