LuaAPI.wiki
changeset 1649 c22e796992aa
parent 1648 77f8cfe4ee8d
child 1650 11fce1b6d39b
equal deleted inserted replaced
1648:77f8cfe4ee8d 1649:c22e796992aa
    91 || `ReadyTimeLeft` || Remaining ready time in millseconds, 0 if turn in progress. To set this value, use `SetReadyTimeLeft` ||
    91 || `ReadyTimeLeft` || Remaining ready time in millseconds, 0 if turn in progress. To set this value, use `SetReadyTimeLeft` ||
    92 || `GameTime` || Number of total game ticks ||
    92 || `GameTime` || Number of total game ticks ||
    93 || `TotalRounds` || Number of rounds that have passed. Equals `-1` if game has not started yet or hogs are still being placed. This variable is buggy in 0.9.23 and earlier! ||
    93 || `TotalRounds` || Number of rounds that have passed. Equals `-1` if game has not started yet or hogs are still being placed. This variable is buggy in 0.9.23 and earlier! ||
    94 || `CurrentHedgehog` || The hedgehog gear that is currently in play ||
    94 || `CurrentHedgehog` || The hedgehog gear that is currently in play ||
    95 || `AmmoTypeMax` || Maximum ammo type ID (useful to iterate through all ammo types, starting by 0) ||
    95 || `AmmoTypeMax` || Maximum ammo type ID (useful to iterate through all ammo types, starting by 0) ||
       
    96 || `MAX_HOG_HEALTH` || Maximum possible hedgehog health ||
       
    97 || `MAX_TURN_TIME` || Maximum possible turn time in milliseconds ||
       
    98 || `INTERFACE` || Type of the game interface: "desktop" for desktop, "touch" for touchscreen ||
    96 
    99 
    97 === !GameFlags ===
   100 === !GameFlags ===
    98 The !GameFlags are used to store simple boolean settings of the game.
   101 The !GameFlags are used to store simple boolean settings of the game.
    99 You can read/modify them using the [LuaAPI#GameFlags_functions GameFlags-Functions].
   102 You can read/modify them using the [LuaAPI#GameFlags_functions GameFlags-Functions].
   100 
   103 
  1081 || `EXPLAutoSound` || Plays an appropriate sound ||
  1084 || `EXPLAutoSound` || Plays an appropriate sound ||
  1082 || `EXPLNoDamage` || Deal no damage to gears ||
  1085 || `EXPLNoDamage` || Deal no damage to gears ||
  1083 || `EXPLDoNotTouchHH` || Do not push hedgehogs ||
  1086 || `EXPLDoNotTouchHH` || Do not push hedgehogs ||
  1084 || `EXPLDoNotTouchAny` || Do not push any gears ||
  1087 || `EXPLDoNotTouchAny` || Do not push any gears ||
  1085 || `EXPLDontDraw` || Do not destroy land ||
  1088 || `EXPLDontDraw` || Do not destroy land ||
       
  1089 || `EXPLForceDraw` || Destroy land, even if `gfSolidLand` is active ||
  1086 || `EXPLNoGfx` || Do not show an explosion animation and do not shake the screen ||
  1090 || `EXPLNoGfx` || Do not show an explosion animation and do not shake the screen ||
  1087 || `EXPLPoisoned` || Poison all hedgehogs in explosion radius ||
  1091 || `EXPLPoisoned` || Poison all hedgehogs in explosion radius ||
  1088 
  1092 
  1089 `options` is assumed to be `EXPLAutoSound` by default. Set `options` to 0 to disable all flags.
  1093 `options` is assumed to be `EXPLAutoSound` by default. Set `options` to 0 to disable all flags.
  1090 
  1094 
  1422 <code language="lua">
  1426 <code language="lua">
  1423 AddCaption("Hello, world!")
  1427 AddCaption("Hello, world!")
  1424 </code>
  1428 </code>
  1425 
  1429 
  1426 === <tt>!AddCaption(text, color, captiongroup)</tt> ===
  1430 === <tt>!AddCaption(text, color, captiongroup)</tt> ===
  1427 Display an event text in the upper part of the screen with the specified RGBA [LuaAPI#Color color] and caption group. Although an RBGA color is used, Hedgewars does not actually support transparent or semi-transparent captions, so the fourth byte is ignored. We recommend you to always specify a full opacity (`FF` in hexadecimal) for the caption.
  1431 Display an event text in the upper part of the screen with the specified RGBA text [LuaAPI#Color color] and caption group. Although an RBGA color is used, Hedgewars does not actually support transparent or semi-transparent captions, so the fourth byte is ignored. We recommend you to always specify a full opacity (`FF` in hexadecimal) for the caption.
  1428 
  1432 
  1429 || *`captiongroup`* || *Meaning* ||
  1433 || *`captiongroup`* || *Meaning* ||
  1430 || `capgrpGameState` || Used for important global game events, like Sudden Death ||
  1434 || `capgrpGameState` || Used for important global game events, like Sudden Death ||
  1431 || `capgrpAmmoinfo` || Used for new weapon crates and some other events ||
  1435 || `capgrpAmmoinfo` || Used for new weapon crates and some other events ||
  1432 || `capgrpVolume` || Used for “local” changes of client settings that don't affect gameplay, like volume change, auto camera on/off, etc. ||
  1436 || `capgrpVolume` || Used for “local” changes of client settings that don't affect gameplay, like volume change, auto camera on/off, etc. ||
  1433 || `capgrpMessage` || Generic message ||
  1437 || `capgrpMessage` || Generic message ||
  1434 || `capgrpMessage2` || Generic message ||
  1438 || `capgrpMessage2` || Generic message ||
  1435 || `capgrpAmmostate` || Used to show information about weapon state, i.e. bounce level, timer, remaining shots, etc. ||
  1439 || `capgrpAmmostate` || Used to show information about weapon state, i.e. bounce level, timer, remaining shots, etc. ||
       
  1440 
       
  1441 The color can be specified in RGBA format, but you can (but don't have to) use one of the following built-in text color.
       
  1442 
       
  1443 || *Built-in color* || *Meaning* ||
       
  1444 || `capcolDefault` || Default caption color ||
       
  1445 || `capcolSetting` || Notification related to a local client setting (audio volume, auto camera on/off) ||
  1436 
  1446 
  1437 Example:
  1447 Example:
  1438 <code language="lua">
  1448 <code language="lua">
  1439 AddCaption("Melon bomb rain in 2 rounds!", 0xFF0000FF, capgrpGameState)
  1449 AddCaption("Melon bomb rain in 2 rounds!", 0xFF0000FF, capgrpGameState)
  1440 -- Green example message.
  1450 -- Green example message.