Difference between revisions of "Elemental resistance"

From Kolmafia
Jump to navigation Jump to search
imported>Heeheehee
((clarification))
imported>Fredg1
m (adding slime)
 
(One intermediate revision by one other user not shown)
Line 5: Line 5:
 
FunctionPage|
 
FunctionPage|
 
name={{#var:name}}|
 
name={{#var:name}}|
function_category=Your Character|
 
  
 
function1={{Function|
 
function1={{Function|
Line 13: 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.
+
p1desc=The parameter of element is invoked using $element. Valid elements are hot ($element[hot]), cold, stench, spooky, sleaze, slime.
 
}}|
 
}}|
  
Line 34: Line 33:
 
special=When not logged in the function returns 0.0
 
special=When not logged in the function returns 0.0
 
}}
 
}}
 +
 +
[[Category:Your Character]]

Latest revision as of 22:45, 12 June 2019

Function Syntax

float elemental_resistance(element )

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

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

Code Samples

Checks that your current hot resistance reduces damage by more than 20 percent.

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

Special

When not logged in the function returns 0.0