LuaAPI.wiki
changeset 373 0f9322acd00a
parent 369 cbde2d9686a5
child 379 3552b458f1ea
equal deleted inserted replaced
372:3ba6ae9321df 373:0f9322acd00a
   350 </blockquote>
   350 </blockquote>
   351 === <tt>!GetEffect(gearUid, effect)</tt> ===
   351 === <tt>!GetEffect(gearUid, effect)</tt> ===
   352 
   352 
   353 <blockquote>Returns the state of given effect for the given hedgehog gear.  
   353 <blockquote>Returns the state of given effect for the given hedgehog gear.  
   354 </blockquote>
   354 </blockquote>
       
   355 
       
   356 see !SetEffect for further details
   355 === <tt>!GetHogHat(gearUid)</tt> ===
   357 === <tt>!GetHogHat(gearUid)</tt> ===
   356 
   358 
   357 <blockquote>Returns the hat of the specified hedgehog gear
   359 <blockquote>Returns the hat of the specified hedgehog gear
   358 </blockquote>
   360 </blockquote>
   359 === <tt>!GetAmmoCount(gearUid, ammoType) (0.9.16)</tt> ===
   361 === <tt>!GetAmmoCount(gearUid, ammoType) (0.9.16)</tt> ===
   530     end</code>
   532     end</code>
   531 
   533 
   532 
   534 
   533 
   535 
   534 </blockquote>
   536 </blockquote>
   535 === <tt>!SetEffect(gearUid, effect, true/false)</tt> ===
   537 === <tt>!SetEffect(gearUid, effect, effectState)</tt> ===
   536 
   538 
   537 <blockquote>Enables (true) or disables (false) one of the effects <tt>heInvulnerable, heResurrectable, hePoisoned</tt> for the specified hedgehog gear.
   539 <blockquote>Sets the state for one of the effects <tt>heInvulnerable, heResurrectable, hePoisoned, heResurrected, heFrozen</tt> for the specified hedgehog gear.
       
   540 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.
   538 </blockquote>
   541 </blockquote>
   539 Example: (sets all bots poisoned)
   542 Example: (sets all bots poisoned)
   540 
   543 
   541 <code lang="lua">    function onGearAdd(gear)
   544 <code lang="lua">    function onGearAdd(gear)
   542         if (GetGearType(gear) == gtHedgehog) and (GetBotLevel(gear) > 0) then
   545         if (GetGearType(gear) == gtHedgehog) and (GetBotLevel(gear) > 0) then
   543             SetEffect(gear, hePoisoned, true)
   546             SetEffect(gear, hePoisoned, 1)
   544         end
   547         end
   545     end</code>
   548     end</code>
       
   549 
       
   550 Note: prior to the ice-gun release, 0.9.19 (commit 10a0a31804f3 ) effectState was of boolean type (true = effect enabled, false = effect disabled)
   546 
   551 
   547 === <tt>CopyPV(gearUid, gearUid)</tt> ===
   552 === <tt>CopyPV(gearUid, gearUid)</tt> ===
   548 
   553 
   549 <blockquote>This sets the position and velocity of the second gear to the first one.
   554 <blockquote>This sets the position and velocity of the second gear to the first one.
   550 </blockquote>
   555 </blockquote>