Difference between revisions of "Change mcd"

From Kolmafia
Jump to navigation Jump to search
imported>Grotfang
m (moved Change mcd() to Change mcd: Conformity)
imported>Grotfang
(Conform to template)
Line 1: Line 1:
[[boolean]] '''[[change_mcd()|change_mcd]]( [[int]] level )'''
+
{{#vardefine:name|change_mcd}}
 +
{{#vardefine:return_type|boolean}}
  
Attempts to change your mind-control device (MCD) to the specified level, returning ''true'' if successful.  Attempting to change the MCD to an impossible number will generate this [[abort error]]: "The dial only goes from 0 to 10." (11 for mysticality signs)
+
{{FunctionPage|
 +
name={{#var:name}}|
 +
function_category=Your Character|
  
The following function attempts to set your MCD to the maximum, returning ''true'' if successful.
+
function1={{Function|
 +
name={{#var:name}}|
 +
aggregate={{#var:aggregate}}|
 +
return_type={{#var:return_type}}|
 +
return_also={{#var:return_also}}|
 +
parameter1={{Param|int|mcd_value}}|
 +
p1desc=Enter an integer between 0 and 10 (11 if myst sign) to change your sign-specific mind control device to (the device that alters monster level).
 +
}}|
  
<code>
+
function_description=Attempts to change your mind-control device (MCD) to the specified level, returning true if successful.  Attempting to change the MCD to an impossible number will generate this abort error: "The dial only goes from 0 to 10." (11 for mysticality signs).|
  boolean mcd_max() {
 
    [[int]] maxmcd = 10;
 
    if ([[in_mysticality_sign()]]) maxmcd = 11;
 
    if ([[current_mcd()]] == maxmcd) return true;
 
    [[print()|print]]("Adjusting MCD to "+maxmcd+"...","olive");
 
    return [[change_mcd()|change_mcd]](maxmcd);
 
  }
 
</code>
 
[[Category:Your Character | Change mcd()]]
 
[[Category:Ash Functions | Change mcd()]]
 
  
When not logged in, this function returns ''false''.
+
code1={{CodeSample|
 +
title=Code Samples|
 +
description=The following function attempts to set your MCD to the maximum.|
 +
code=
 +
<syntaxhighlight>
 +
boolean mcd_max() {
 +
  int maxmcd = 10;
 +
  if(in_mysticality_sign()) {
 +
      maxmcd = 11;
 +
  }
 +
  if(current_mcd() == maxmcd) {
 +
      return true;
 +
  }
 +
  return change_mcd(maxmcd);
 +
}
 +
</syntaxhighlight>
 +
}}|
 +
 
 +
see_also={{SeeAlso|current_mcd|in_mysticality_sign}}|
 +
special=When not logged in, this function returns false.
 +
}}

Revision as of 12:43, 1 March 2010



Function Syntax

boolean change_mcd(int mcd_value )

  • Enter an integer between 0 and 10 (11 if myst sign) to change your sign-specific mind control device to (the device that alters monster level).

Attempts to change your mind-control device (MCD) to the specified level, returning true if successful. Attempting to change the MCD to an impossible number will generate this abort error: "The dial only goes from 0 to 10." (11 for mysticality signs).

Code Samples

The following function attempts to set your MCD to the maximum.

boolean mcd_max() {
   int maxmcd = 10;
   if(in_mysticality_sign()) {
      maxmcd = 11;
   }
   if(current_mcd() == maxmcd) {
      return true;
   }
   return change_mcd(maxmcd);
}

See Also

current_mcd() | in_mysticality_sign()

Special

When not logged in, this function returns false.