Difference between revisions of "Effect modifier"

From Kolmafia
Jump to navigation Jump to search
imported>Bale
(Created page with '{{ #vardefine:name|effect_modifier}}{{ #vardefine:return_type|effect}}{{ FunctionPage| name={{#var:name}}| function_category=Modifier Functions| function1={{Function| name={{#v…')
 
imported>Bale
m
Line 5: Line 5:
 
FunctionPage|
 
FunctionPage|
 
name={{#var:name}}|
 
name={{#var:name}}|
function_category=Modifier Functions|
 
  
 
function1={{Function|
 
function1={{Function|
Line 41: Line 40:
 
more_info= See [http://kolmafia.us/showthread.php?802 this thread] for details.|
 
more_info= See [http://kolmafia.us/showthread.php?802 this thread] for details.|
 
}}
 
}}
 +
 +
[[Category:Modifier Functions]]

Revision as of 05:24, 22 May 2010

Function Syntax

effect effect_modifier(string check_me ,string modifier_name )

effect effect_modifier(item check_me ,string modifier_name )

Returns an effect if check_me is effect specific. modifier_name is the modifier to check for.

Code Sample

Prints a list of all items that have intrinsic effects

effect eff;
foreach doodad in $items[] {
   eff = effect_modifier( doodad , "Intrinsic Effect" );
   if(eff != $effect[none])
      print(doodad +" grants "+ eff);
}

More Information

See this thread for details.