Initiative modifier: Difference between revisions
Jump to navigation
Jump to search
imported>Grotfang A second, more detailed and useful example |
imported>Grotfang mNo edit summary |
||
Line 1: | Line 1: | ||
[[initiative_modifier()]] | [[float]] [[initiative_modifier()]] | ||
Returns your current percentage initiative modifier in the form of a float. | Returns your current percentage initiative modifier in the form of a float. |
Revision as of 15:20, 22 February 2010
Returns your current percentage initiative modifier in the form of a float.
The following function will return false if you have a negative initiative modifier.
boolean positive_initiative()
{
if( initiative_modifier() < 0 )
return false;
else
return true;
}
The following function is a little more involved and uses your initiative result to determine whether it will adventure in the sewers (where a +60% initiative guarantees getting the jump). There is also a check for my_familiar(). The function will return true if it's a success, false otherwise.
boolean first_yellow_ray()
{
if( initiative_modifier() >= 60 )
{
if( my_familiar() == $familiar[he-boulder] )
{
adventure( 1 , $location[A Maze of Sewer Tunnels] );
return true;
}
else
print( "You should use the He-Boulder for this" );
}
else
print( "Your initiative is too low" );
return false;
}
When not logged in the function returns 0 (needs spading).