Difference between revisions of "Monster level adjustment"

From Kolmafia
Jump to navigation Jump to search
imported>Grotfang
imported>Grotfang
Line 1: Line 1:
'''monster_level_adjustment()'''
+
{{#vardefine:name|monster_level_adjustment}}
 +
{{#vardefine:return_type|int}}
  
Returns your current +ML, including your mind-control device if applicable.
+
{{FunctionPage|
 +
name={{#var:name}}|
 +
function_category=Your Character|
  
Example:
+
function1={{Function|
<code>
+
name={{#var:name}}|
  [[comments|# Function that tries to figure out if it's better to use Volley or Brero]]
+
aggregate={{#var:aggregate}}|
  [[comments|# for a certain area's ML (assuming that your volley and 'brero are both 20 lbs.)]]
+
return_type={{#var:return_type}}|
 
+
return_also={{#var:return_also}}
  [[boolean]] better_to_use_brero([[int]] ml_being_tested) {
+
}}|
    [[return]] ((ml_being_tested + [[monster_level_adjustment()]]) >= 85);
+
 
  }
+
function_description=Returns the cumulative total of all monster level adjustments from equipment, effects and area modifiers.|
</code>
+
 
 +
code1={{CodeSample|
 +
title=Code Samples|
 +
description=Checks to see if you should use a level 20 sombrero for a monster of level 60.|
 +
code=
 +
<syntaxhighlight>
 +
boolean better_to_use_brero() {
 +
  int test = 60 + monster_level_adjustment();
 +
  if(test >= 85) {
 +
      return true;
 +
  }
 +
  return false;
 +
}
 +
</syntaxhighlight>
 +
}}|
 +
 
 +
see_also={{SeeAlso|current_mcd|change_mcd}}|
 +
special=Return 0 when not logged in.|
 +
}}

Revision as of 00:01, 1 March 2010



Function Syntax

int monster_level_adjustment()

Returns the cumulative total of all monster level adjustments from equipment, effects and area modifiers.

Code Samples

Checks to see if you should use a level 20 sombrero for a monster of level 60.

boolean better_to_use_brero() {
   int test = 60 + monster_level_adjustment();
   if(test >= 85) {
      return true;
   }
   return false;
}

See Also

current_mcd() | change_mcd()

Special

Return 0 when not logged in.