LuaAPI.wiki
changeset 1270 2c4320387c2f
parent 1269 347b7c9acf0a
child 1271 006fe546bd26
equal deleted inserted replaced
1269:347b7c9acf0a 1270:2c4320387c2f
   988 Returns current wind, expressed as a floating point number between -100 to 100 inclusive. Note there may be rounding errors.
   988 Returns current wind, expressed as a floating point number between -100 to 100 inclusive. Note there may be rounding errors.
   989 
   989 
   990 ==== <tt>!SetMaxBuildDistance(distInPx)</tt> ====
   990 ==== <tt>!SetMaxBuildDistance(distInPx)</tt> ====
   991 Sets the maximum building distance for of girders and rubber bands in pixels to `distInPx`. If `distInPx` is `0`, the limit is disabled. If called without arguments, the distance will be reset to the default value.
   991 Sets the maximum building distance for of girders and rubber bands in pixels to `distInPx`. If `distInPx` is `0`, the limit is disabled. If called without arguments, the distance will be reset to the default value.
   992 
   992 
       
   993 ==== `Explode(x, y, radius[, options])` (0.9.24) ====
       
   994 Cause an explosion or erase land, push or damage gears.
       
   995 
       
   996 By default, causes an explosion at the coordinates `(x, y)` with the given `radius`. Explosions destroy land, and damage and push gears in its radius. Assuming 100% damage, the explosion damage at the center equals the explosion radius.
       
   997 
       
   998 `options` is a bitmask which can be used to tweak how the explosion behaves:
       
   999 
       
  1000 || *Flag* || *Meaning* ||
       
  1001 || `EXPLAutoSound` || Plays an appropriate sound ||
       
  1002 || `EXPLNoDamage` || Deal no damage to gears ||
       
  1003 || `EXPLDoNotTouchHH` || Do not push hedgehogs ||
       
  1004 || `EXPLDoNotTouchAny` || Do not push any gears ||
       
  1005 || `EXPLDontDraw` || Do not destroy land ||
       
  1006 || `EXPLNoGfx` || Do not show an explosion animation and do not shake the screen ||
       
  1007 || `EXPLPoisoned` || Poison all hedgehogs in explosion radius ||
       
  1008 
       
  1009 `options` is assumed to be `EXPLAutoSound` by default. Set `options` to 0 to disable all flags.
       
  1010 
       
  1011 Examples:
       
  1012 <code language="lua">
       
  1013 -- Simple explosion at (100, 50) with radius 50
       
  1014 Explode(100, 50, 50)
       
  1015 
       
  1016 -- Simlpe explosion without sound
       
  1017 Explode(100, 50, 50, 0)
       
  1018 
       
  1019 -- Fake explosion which only cause a push but deals no damage to gears an terrain
       
  1020 Explode(500, 1000, 50, EXPLAutoSound + EXPLNoDamage + EXPLDontDraw)
       
  1021 
       
  1022 -- Erase land without side effects:
       
  1023 Explode(500, 100, 100, EXPLNoDamage + EXPLDoNotTouchAny + EXPLNoGfx)
       
  1024 </code>
       
  1025 
   993 ==== `SkipTurn()` (0.9.24) ====
  1026 ==== `SkipTurn()` (0.9.24) ====
   994 Forces the current hedgehog to skip its turn.
  1027 Forces the current hedgehog to skip its turn.
   995 
  1028 
   996 ==== `EndTurn([noTaunts])` (0.9.23) ====
  1029 ==== `EndTurn([noTaunts])` (0.9.23) ====
   997 Ends the current turn.
  1030 Ends the current turn.