Difference between pages "Soulsauce cost" and "My companion"

From Kolmafia
(Difference between pages)
Jump to navigation Jump to search
imported>Darzil
(Created page with "{{ #vardefine:name|soulsauce_cost}}{{ #vardefine:return_type|int}}{{ FunctionPage| name={{#var:name}}| function1={{Function| name={{#var:name}}| aggregate={{#var:aggregate}...")
 
imported>Bale
(r11965)
 
Line 1: Line 1:
 
{{
 
{{
#vardefine:name|soulsauce_cost}}{{
+
#vardefine:name|my_companion}}{{
#vardefine:return_type|int}}{{
+
#vardefine:return_type|string}}{{
  
 
FunctionPage|
 
FunctionPage|
 
 
name={{#var:name}}|
 
name={{#var:name}}|
  
Line 11: Line 10:
 
aggregate={{#var:aggregate}}|
 
aggregate={{#var:aggregate}}|
 
return_type={{#var:return_type}}|
 
return_type={{#var:return_type}}|
return_also={{#var:return_also}}|
+
return_also={{#var:return_also}}
parameter1={{Param|skill|use_me}}|
 
p1desc={{Pspan|use_me}} is the skill to check the cost of|
 
 
}}|
 
}}|
  
function_description=Returns the Soulsauce cost for the next cast of the given skill {{pspan|use_me}}.
+
function_description=If your current path is Avatar of Jarlsberg this returns your current companion. If you have no current companion or you are not Jarlsberg's Avatar, then this returns an empty string.|
 +
 
 +
code1={{CodeSample|
 +
title=Code Samples|
 +
description=Determines Item Drop bonus granted by from Companion.|
 +
code=
 +
<syntaxhighlight>
 +
if( my_path() == "Avatar of Jarlsberg" ) {
 +
  if( my_companion() != "Eggman" )
 +
      print( "You need to equip the Eggman for item drops." );
 +
  else {
 +
      int drop = 50;
 +
      if( have_skill($skill[Working Lunch]) )
 +
        drop += 25;
 +
      print( "The item drop bonus from the Eggman is " + drop );
 +
  }
 +
}
 +
</syntaxhighlight>
 +
}}|
  
 
}}
 
}}
  
[[Category:Skills and Effects]]
+
[[Category:Your Character]]

Revision as of 08:47, 8 November 2014

Function Syntax

string my_companion()

If your current path is Avatar of Jarlsberg this returns your current companion. If you have no current companion or you are not Jarlsberg's Avatar, then this returns an empty string.

Code Samples

Determines Item Drop bonus granted by from Companion.

if( my_path() == "Avatar of Jarlsberg" ) {
   if( my_companion() != "Eggman" )
      print( "You need to equip the Eggman for item drops." );
   else {
      int drop = 50;
      if( have_skill($skill[Working Lunch]) )
         drop += 25;
      print( "The item drop bonus from the Eggman is " + drop );
   }
}