LuaAPI.wiki
changeset 1411 7c5c8c620a9f
parent 1410 6d356877f1d2
child 1425 640e28c5c860
equal deleted inserted replaced
1410:6d356877f1d2 1411:7c5c8c620a9f
  1248 Toggles vampirism mode for this turn. Set `bool` to `true` to enable (same effect as if the hedgehog has used Vampirism), `false` to disable.
  1248 Toggles vampirism mode for this turn. Set `bool` to `true` to enable (same effect as if the hedgehog has used Vampirism), `false` to disable.
  1249 
  1249 
  1250 ==== `SetLaserSight(bool)` (0.9.24) ====
  1250 ==== `SetLaserSight(bool)` (0.9.24) ====
  1251 Toggles laser sight for this turn. Set `bool` to `true` to enable (same effect as if the hedgehog has used Laser Sight), `false` to disable.
  1251 Toggles laser sight for this turn. Set `bool` to `true` to enable (same effect as if the hedgehog has used Laser Sight), `false` to disable.
  1252 
  1252 
       
  1253 ==== `EnableSwitchHog()` (0.9.25) ====
       
  1254 Enable hog switching mode for the current hedgehog. This function should be called while the hedgehog is standing on solid ground (`GetFlightTime` returns 0).
       
  1255 
       
  1256 Internally, this tries to spawn a `gtSwitcher` gear which, as long it exists, handles the hog switching. You can delete this gear to stop the hog switching prematurely. If there already is a `gtSwitcher` gear, no additional gear is spawned.
       
  1257 
       
  1258 On success, returns the `gtSwitcher` gear being spawned or, if hog switching mode is already active, returns the exsting gear. On failure, returns `nil`.
       
  1259 
  1253 === Randomness ===
  1260 === Randomness ===
  1254 ==== <tt>!GetRandom(number)</tt> ====
  1261 ==== <tt>!GetRandom(number)</tt> ====
  1255 Returns a randomly generated number in the range of 0 to number - 1. This random number uses the game seed, so is synchronised, and thus safe for multiplayer and saved games. Use `GetRandom` for anything that could impact the engine state. For example, a visual gear could simply use Lua’s `math.random`, but adding a regular gear should use `GetRandom`.
  1262 Returns a randomly generated number in the range of 0 to number - 1. This random number uses the game seed, so is synchronised, and thus safe for multiplayer and saved games. Use `GetRandom` for anything that could impact the engine state. For example, a visual gear could simply use Lua’s `math.random`, but adding a regular gear should use `GetRandom`.
  1256 
  1263 
  1257 === Clans and teams ===
  1264 === Clans and teams ===