Experience bonus: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>StDoodle
mNo edit summary
imported>Bale
added code sample
Line 16: Line 16:
function_description=Returns your current combined stat bonuses from equipment and effects (including familiars).|
function_description=Returns your current combined stat bonuses from equipment and effects (including familiars).|


needscode=yes|
code1={{CodeSample|
title=Code Sample|
description=Evaluate the best choice for the Penultimate Fantasy Airship's "Random Lack of an Encounter".|
code=
<syntaxhighlight>
float gallery_stats = min(numeric_modifier("Combat Rate"), 0) /(-2.0) + 20;
float encounter_stats = numeric_modifier("Experience")/2.0;  // Mainstat experience bonus
 
if(numeric_modifier("Monster Level") >= 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.");
</syntaxhighlight>
}}|


special=Returns 0 when not logged in.
special=Returns 0 when not logged in.
}}
}}

Revision as of 10:09, 10 March 2010

Function Syntax

float experience_bonus()

Returns your current combined stat bonuses from equipment and effects (including familiars).

Code Sample

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

float gallery_stats = min(numeric_modifier("Combat Rate"), 0) /(-2.0) + 20;
float encounter_stats = numeric_modifier("Experience")/2.0;  // Mainstat experience bonus

if(numeric_modifier("Monster Level") >= 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.