Experience bonus: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Bale
added code sample
imported>Bale
mNo edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 5: Line 5:
FunctionPage|
FunctionPage|
name={{#var:name}}|
name={{#var:name}}|
function_category=Your Character|


function1={{Function|
function1={{Function|
Line 14: Line 13:
}}|
}}|


function_description=Returns your current combined stat bonuses from equipment and effects (including familiars).|
function_description=Returns your current combined mainstat bonuses from familiar, equipment, monster level and effects. This is the bonus to mainstat, not total experience bonus to all stats so multiply by 2 if you want to know total experience bonus.|


code1={{CodeSample|
code1={{CodeSample|
Line 21: Line 20:
code=
code=
<syntaxhighlight>
<syntaxhighlight>
float gallery_stats = min(numeric_modifier("Combat Rate"), 0) /(-2.0) + 20;
float gallery_stats = min(combat_rate_modifier(), 0) /(-2.0) + 20;
float encounter_stats = numeric_modifier("Experience")/2.0;  // Mainstat experience bonus
float encounter_stats = experience_bonus();  // Mainstat experience bonus


if(numeric_modifier("Monster Level") >= 20)
if(monster_level_adjustment() >= 20)
   encounter_stats = encounter_stats + 15;  // Mainstat bonus for fighting a MechaMech
   encounter_stats = encounter_stats + 15;  // Mainstat bonus for fighting a MechaMech
else
else
Line 38: Line 37:
special=Returns 0 when not logged in.
special=Returns 0 when not logged in.
}}
}}
[[Category:Your Character]]

Latest revision as of 21:36, 21 May 2010

Function Syntax

float experience_bonus()

Returns your current combined mainstat bonuses from familiar, equipment, monster level and effects. This is the bonus to mainstat, not total experience bonus to all stats so multiply by 2 if you want to know total experience bonus.

Code Sample

Evaluate the best choice for the Penultimate Fantasy Airship's "Random Lack of an Encounter".

float gallery_stats = min(combat_rate_modifier(), 0) /(-2.0) + 20;
float encounter_stats = experience_bonus();  // Mainstat experience bonus

if(monster_level_adjustment() >= 20)
   encounter_stats = encounter_stats + 15;   // Mainstat bonus for fighting a MechaMech
else
   encounter_stats = encounter_stats + 12;   // Mainstat bonus for fighting a weak airship monster

if(gallery_stats > encounter_stats)
   print("Best stat gains in the Penultimate Fantasy Airship are from non-combats.");
else
   print("Best stat gains in the Penultimate Fantasy Airship are from monsters.");

Special

Returns 0 when not logged in.