LuaAPI.wiki
changeset 824 adfb23d8bc13
parent 823 83dacaa4d7d0
child 826 07f7de5b6325
equal deleted inserted replaced
823:83dacaa4d7d0 824:adfb23d8bc13
   773 
   773 
   774 === <tt>!SetEffect(gearUid, effect, effectState)</tt> ===
   774 === <tt>!SetEffect(gearUid, effect, effectState)</tt> ===
   775 Sets the state for one of the effects <tt>heInvulnerable, heResurrectable, hePoisoned, heResurrected, heFrozen</tt> for the specified hedgehog gear.
   775 Sets the state for one of the effects <tt>heInvulnerable, heResurrectable, hePoisoned, heResurrected, heFrozen</tt> for the specified hedgehog gear.
   776 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.
   776 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.
   777 
   777 
   778 || *`effect`* || *Desription* || *`effectState`* ||
   778 || *`effect`* || *Description* || *`effectState`* ||
   779 || `heInvulnerable` || Wether hog is invulnerable || Any non-zero value turns on invulnerability. `0` turns it off. ||
   779 || `heInvulnerable` || Wether hog is invulnerable || Any non-zero value turns on invulnerability. `0` turns it off. ||
   780 || `hePoisoned` || Poison damage, damages hog each turn. || Amount of damage per turn. Use `0` to disable poisoning. ||
   780 || `hePoisoned` || Poison damage, damages hog each turn. || Amount of damage per turn. Use `0` to disable poisoning. ||
   781 || `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. ||
   781 || `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. ||
   782 || `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. ||
   782 || `heResurrected` || Whether the hedgehog has been resurrected once. This is only a subtle graphical effect. || With a non-zero value, the hedgehog was resurrected, `0` otherwise. ||
   783 || `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. ||
   783 || `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 takes to melt. 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. ||
   784 
   784 
   785 Example (sets all bots poisoned with poison damage of 1):
   785 Example (sets all bots poisoned with poison damage of 1):
   786 
   786 
   787 <code language="lua">    function onGearAdd(gear)
   787 <code language="lua">    function onGearAdd(gear)
   788         if (GetGearType(gear) == gtHedgehog) and (GetHogLevel(gear) > 0) then
   788         if (GetGearType(gear) == gtHedgehog) and (GetHogLevel(gear) > 0) then