LuaAPI: Explain the different hedgehog effects
authorWuzzy
Tue, 29 Mar 2016 17:35:16 +0100
changeset 823 83dacaa4d7d0
parent 822 a946cbc1e636
child 824 adfb23d8bc13
LuaAPI: Explain the different hedgehog effects
LuaAPI.wiki
--- a/LuaAPI.wiki	Mon Mar 28 21:25:36 2016 +0100
+++ b/LuaAPI.wiki	Tue Mar 29 17:35:16 2016 +0100
@@ -775,7 +775,14 @@
 Sets the state for one of the effects <tt>heInvulnerable, heResurrectable, hePoisoned, heResurrected, heFrozen</tt> for the specified hedgehog gear.
 A value of 0 usually means the effect is disabled, values other than that indicate that it is enabled and in some cases specify e.g. the remaining time of that effect.
 
-Example (sets all bots poisoned):
+|| *`effect`* || *Desription* || *`effectState`* ||
+|| `heInvulnerable` || Wether hog is invulnerable || Any non-zero value turns on invulnerability. `0` turns it off. ||
+|| `hePoisoned` || Poison damage, damages hog each turn. || Amount of damage per turn. Use `0` to disable poisoning. ||
+|| `heResurrectable` || Whether to resurrect the hog on death || With a non-zero value, the hedgehog will be resurrected and teleported to a random location on death. `0` disables this. ||
+|| `heResurrected` || Whether the hedgehog has been resurrected once. This is only a graphical effect. || With a non-zero value, the hedgehog was resurrected, `0` otherwise. ||
+|| `heFroze` || Freeze level. Frozen hedgehogs skip turn, are heavy and take half damage || The number denotes “how frozen” the hedgehog is, i.e. how long it. The freezer sets this to `199999` initially. The value will be reduced by `50000` each round. If `0`, hedgehog is not frozen. The value will also be used for some other things by the engine, like animation, etc. ||
+
+Example (sets all bots poisoned with poison damage of 1):
 
 <code language="lua">    function onGearAdd(gear)
         if (GetGearType(gear) == gtHedgehog) and (GetHogLevel(gear) > 0) then
@@ -783,7 +790,7 @@
         end
     end</code>
 
-*Note*: prior to the ice-gun release, 0.9.19 (commit r10a0a31804f3) `effectState` was of boolean type (`true` = effect enabled, `false` = effect disabled)
+*Historic note*: prior to the ice-gun release, 0.9.19 (commit r10a0a31804f3) `effectState` was of boolean type (`true` = effect enabled, `false` = effect disabled)
 
 === <tt>CopyPV(gearUid, gearUid)</tt> ===
 This sets the position and velocity of the second gear to the first one.