# HG changeset patch
# User Wuzzy
# Date 1521747641 0
# Node ID 2c4320387c2facf40294262634ce693d03177e72
# Parent 347b7c9acf0ae86024d66fc7c20839c542ef92ff
LuaAPI: Explode()
diff -r 347b7c9acf0a -r 2c4320387c2f LuaAPI.wiki
--- a/LuaAPI.wiki Thu Mar 22 17:03:33 2018 +0000
+++ b/LuaAPI.wiki Thu Mar 22 19:40:41 2018 +0000
@@ -990,6 +990,39 @@
==== !SetMaxBuildDistance(distInPx) ====
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.
+==== `Explode(x, y, radius[, options])` (0.9.24) ====
+Cause an explosion or erase land, push or damage gears.
+
+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.
+
+`options` is a bitmask which can be used to tweak how the explosion behaves:
+
+|| *Flag* || *Meaning* ||
+|| `EXPLAutoSound` || Plays an appropriate sound ||
+|| `EXPLNoDamage` || Deal no damage to gears ||
+|| `EXPLDoNotTouchHH` || Do not push hedgehogs ||
+|| `EXPLDoNotTouchAny` || Do not push any gears ||
+|| `EXPLDontDraw` || Do not destroy land ||
+|| `EXPLNoGfx` || Do not show an explosion animation and do not shake the screen ||
+|| `EXPLPoisoned` || Poison all hedgehogs in explosion radius ||
+
+`options` is assumed to be `EXPLAutoSound` by default. Set `options` to 0 to disable all flags.
+
+Examples:
+
+-- Simple explosion at (100, 50) with radius 50
+Explode(100, 50, 50)
+
+-- Simlpe explosion without sound
+Explode(100, 50, 50, 0)
+
+-- Fake explosion which only cause a push but deals no damage to gears an terrain
+Explode(500, 1000, 50, EXPLAutoSound + EXPLNoDamage + EXPLDontDraw)
+
+-- Erase land without side effects:
+Explode(500, 100, 100, EXPLNoDamage + EXPLDoNotTouchAny + EXPLNoGfx)
+
+
==== `SkipTurn()` (0.9.24) ====
Forces the current hedgehog to skip its turn.