Elemental resistance: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Grotfang
No edit summary
imported>Grotfang
No edit summary
Line 12: Line 12:
return_also={{#var:return_also}}|
return_also={{#var:return_also}}|
parameter1={{Param|element|}}|
parameter1={{Param|element|}}|
p1desc=The parameter of element is invoked using $element. Valid elements are hot ($element[hot]), cold, stench, spooky, sleaze.
parameter2={{Param|monster|}}|
p1desc=The parameter of element is invoked using $element. Valid elements are hot ($element[hot]), cold, stench, spooky, sleaze.|
p2desc=The parameter of monster is invoked using $monster.
}}|
}}|



Revision as of 22:51, 28 February 2010



Function Syntax

float elemental_resistance(element ,monster )

  • The parameter of element is invoked using $element. Valid elements are hot ($element[hot]), cold, stench, spooky, sleaze.
  • The parameter of monster is invoked using $monster.

Returns your current resistance for a specified element in the form of a floating point integer.

Code Samples

Checks that you have a resistance greater than 20 for the element "hot".

boolean hot_check() {
   if(elemental_resistance($element[hot]) > 20) {
      return true;
   }
   return false;
}

Special

When not logged in the function returns 0 (needs spading).