Difference between pages "To coinmaster" and "My companion"

From Kolmafia
(Difference between pages)
Jump to navigation Jump to search
imported>Lostcalpolydude
(The code sample didn't work. A new one is needed.)
 
imported>Bale
(see also)
 
Line 1: Line 1:
 
{{
 
{{
#vardefine:name|to_coinmaster}}{{
+
#vardefine:name|my_companion}}{{
#vardefine:return_type|coinmaster}}{{
+
#vardefine:return_type|string}}{{
  
 
FunctionPage|
 
FunctionPage|
Line 9: Line 9:
 
name={{#var:name}}|
 
name={{#var:name}}|
 
aggregate={{#var:aggregate}}|
 
aggregate={{#var:aggregate}}|
return_type=boolean|
+
return_type={{#var:return_type}}|
return_also={{#var:return_also}}|
+
return_also={{#var:return_also}}
parameter1={{Param|string|store}}|
 
p1desc={{pspan|store}} is hopefully the name of a coinmaster|
 
 
}}|
 
}}|
  
needscode=yes|
+
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.|
  
see_also={{SeeAlso|visit|is_accessible|buys_item|sells_item}}|
+
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>
 +
}}|
 +
see_also={{SeeAlso|my_familiar|my_thrall}}|
 
}}
 
}}
  
[[Category:Item Management]]
+
[[Category:Your Character]]

Latest revision as of 08:49, 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 );
   }
}

See Also

my_familiar() | my_thrall()