Difference between pages "Steal" and "Stat modifier"
(Difference between pages)
Jump to navigation
Jump to search
imported>Bale (this was missing) |
imported>Bale m |
||
Line 1: | Line 1: | ||
{{ | {{ | ||
− | #vardefine:name| | + | #vardefine:name|stat_modifier}}{{ |
− | #vardefine:return_type| | + | #vardefine:return_type|stat}}{{ |
FunctionPage| | FunctionPage| | ||
name={{#var:name}}| | name={{#var:name}}| | ||
− | |||
function1={{Function| | function1={{Function| | ||
Line 12: | Line 11: | ||
return_type={{#var:return_type}}| | return_type={{#var:return_type}}| | ||
return_also={{#var:return_also}}| | return_also={{#var:return_also}}| | ||
+ | parameter1={{Param|item|check_me}}| | ||
+ | parameter2={{Param|string|modifier_name}}| | ||
}}| | }}| | ||
− | function_description= | + | function2={{Function| |
+ | name={{#var:name}}| | ||
+ | aggregate={{#var:aggregate}}| | ||
+ | return_type={{#var:return_type}}| | ||
+ | return_also={{#var:return_also}}| | ||
+ | parameter1={{Param|string|check_me}}| | ||
+ | parameter2={{Param|string|modifier_name}}| | ||
+ | }}| | ||
+ | function_description=Returns a stat if {{pspan|check_me}} is stat specific.| | ||
− | + | code1={{CodeSample| | |
+ | title=Code Sample| | ||
+ | description=Prints the stats which are equalized by the effects of various equalizing potions.| | ||
+ | code= | ||
+ | <syntaxhighlight> | ||
+ | stat st; | ||
+ | foreach eff in $effects[] { | ||
+ | st = stat_modifier( eff , "Equalize" ); | ||
+ | if(st != $stat[none]) | ||
+ | print(eff +" equalizes all stats to "+ st); | ||
+ | } | ||
+ | </syntaxhighlight>}}| | ||
− | + | ||
− | + | more_info= See [http://kolmafia.us/showthread.php?802 this thread] for details.| | |
− | more_info= See [ | ||
− | |||
}} | }} | ||
+ | |||
+ | [[Category:Modifier Functions]] |
Latest revision as of 05:25, 22 May 2010
Function Syntax
stat stat_modifier(item check_me ,string modifier_name )
stat stat_modifier(string check_me ,string modifier_name )
Returns a stat if check_me is stat specific.
Code Sample
Prints the stats which are equalized by the effects of various equalizing potions.
stat st;
foreach eff in $effects[] {
st = stat_modifier( eff , "Equalize" );
if(st != $stat[none])
print(eff +" equalizes all stats to "+ st);
}
More Information
See this thread for details.