Difference between revisions of "Initiative modifier"
Jump to navigation
Jump to search
imported>Grotfang m (moved Initiative modifier() to Initiative modifier: Conformity) |
imported>Grotfang (Conform to template) |
||
Line 1: | Line 1: | ||
− | + | {{#vardefine:name|initiative_modifier}} | |
− | + | {{#vardefine:return_type|float}} | |
− | Returns your current percentage initiative modifier in the form of a float | + | {{FunctionPage| |
− | + | name={{#var:name}}| | |
− | + | function_category=Your Character| | |
− | + | function1={{Function| | |
− | < | + | name={{#var:name}}| |
− | + | aggregate={{#var:aggregate}}| | |
− | + | return_type={{#var:return_type}}| | |
− | if( | + | return_also={{#var:return_also}} |
+ | }}| | ||
+ | function_description=Returns your current percentage initiative modifier in the form of a float| | ||
+ | code1={{CodeSample| | ||
+ | title=Positive Initiative Checker| | ||
+ | description=Returns false if you have a negative initiative modifier| | ||
+ | code= | ||
+ | <syntaxhighlight> | ||
+ | boolean positive_initiative() | ||
+ | { | ||
+ | if( initiative_modifier() < 0 ) | ||
return false; | return false; | ||
else | else | ||
return true; | return true; | ||
− | + | } | |
− | </ | + | </syntaxhighlight> |
− | + | }}| | |
− | + | code2={{CodeSample| | |
− | + | title=Yellow Ray Checker| | |
− | < | + | description=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.| |
− | + | code= | |
− | + | <syntaxhighlight> | |
+ | boolean first_yellow_ray() | ||
+ | { | ||
if( '''initiative_modifier()''' >= 60 ) | if( '''initiative_modifier()''' >= 60 ) | ||
{ | { | ||
Line 33: | Line 45: | ||
print( "Your initiative is too low" ); | print( "Your initiative is too low" ); | ||
return false; | return false; | ||
− | + | } | |
− | </ | + | </syntaxhighlight> |
− | + | }}| | |
− | + | see_also={{SeeAlso|my_familiar}}| | |
− | + | cli_equiv=LIST_CLI_EQUIVALENT_INFO| | |
− | + | more_info=A_LINE_TO_NOTIFY_OF_EXTERNAL_INFO| | |
− | When not logged in the function returns 0 (needs spading). | + | special=When not logged in the function returns 0 (needs spading). |
+ | }} |
Revision as of 18:45, 28 February 2010
Function Syntax
float initiative_modifier()
Returns your current percentage initiative modifier in the form of a float
Positive Initiative Checker
Returns false if you have a negative initiative modifier
boolean positive_initiative()
{
if( initiative_modifier() < 0 )
return false;
else
return true;
}
Yellow Ray Checker
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;
}
CLI Equivalent
LIST_CLI_EQUIVALENT_INFO
See Also
More Information
A_LINE_TO_NOTIFY_OF_EXTERNAL_INFO
Special
When not logged in the function returns 0 (needs spading).