Difference between revisions of "Elemental resistance"

From Kolmafia
Jump to navigation Jump to search
imported>Grotfang
imported>Grotfang
(Conform to template)
Line 1: Line 1:
[[float]] [[elemental_resistance()]]
+
{{#vardefine:name|elemental_resistance}}
 +
{{#vardefine:return_type|float}}
  
Returns your current resistance for a specified element in the form of a float.
+
{{FunctionPage|
 +
name={{#var:name}}|
 +
function_category=Your Character|
  
The following [[function]] returns true if you have a resistance greater than 20 for the element "hot".
+
function1={{Function|
 +
name={{#var:name}}|
 +
aggregate={{#var:aggregate}}|
 +
return_type={{#var:return_type}}|
 +
return_also={{#var:return_also}}|
 +
parameter1={{Param|element|$element[] can be hot, cold, stench, sleaze, spooky.}}|
 +
p1desc=Y
 +
}}|
  
<code>
+
function_description=Returns your current resistance for a specified element in the form of a floating point integer.|
  [[boolean]] hot_check() {
 
    if( '''elemental_resistance( $element[hot] )''' > 20 )
 
        return true;
 
    else
 
        return false;
 
  }
 
</code>
 
[[Category:Your Character | elemental_resistance()]]
 
[[Category:Ash Functions | elemental_resistance()]]
 
  
When not logged in the function returns 0 (needs spading).
+
code1={{CodeSample|
 +
title=Code Samples|
 +
description=Checks that you have a resistance greater than 20 for the element "hot".|
 +
code=
 +
<syntaxhighlight>
 +
boolean hot_check() {
 +
  if(elemental_resistance($element[hot]) > 20) {
 +
      return true;
 +
  }
 +
  return false;
 +
}
 +
</syntaxhighlight>
 +
}}|
 +
 
 +
special=When not logged in the function returns 0 (needs spading).
 +
}}

Revision as of 22:34, 28 February 2010



Function Syntax

float elemental_resistance(element $element[] can be hot, cold, stench, sleaze, spooky. )

  • Y

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).