Initiative modifier: Difference between revisions
Jump to navigation
Jump to search
imported>Grotfang mNo edit summary |
imported>Bale mNo edit summary |
||
(6 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{#vardefine:name|initiative_modifier}} | {{ | ||
{{#vardefine:return_type|float}} | #vardefine:name|initiative_modifier}}{{ | ||
{{FunctionPage| | #vardefine:return_type|float}}{{ | ||
FunctionPage| | |||
name={{#var:name}}| | name={{#var:name}}| | ||
function1={{Function| | function1={{Function| | ||
name={{#var:name}}| | name={{#var:name}}| | ||
Line 16: | Line 17: | ||
code= | code= | ||
<syntaxhighlight> | <syntaxhighlight> | ||
boolean positive_initiative() | boolean positive_initiative() { | ||
{ | if(initiative_modifier() < 0){ | ||
if(initiative_modifier() < 0) | |||
return false; | return false; | ||
} | } | ||
Line 25: | Line 24: | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
}} | }} | ||
{{CodeSample| | |||
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().| | 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().| | ||
code= | code= | ||
<syntaxhighlight> | <syntaxhighlight> | ||
boolean first_yellow_ray() | boolean first_yellow_ray() { | ||
{ | if(initiative_modifier() >= 60) { | ||
if(initiative_modifier() >= 60) | if(my_familiar() == $familiar[he-boulder]) { | ||
if(my_familiar() == $familiar[he-boulder]) | |||
adventure(1 , $location[A Maze of Sewer Tunnels]); | adventure(1 , $location[A Maze of Sewer Tunnels]); | ||
return true; | return true; | ||
} | } | ||
else | else { | ||
print("You should use the He-Boulder for this"); | print("You should use the He-Boulder for this"); | ||
} | } | ||
} | } | ||
else | else { | ||
print("Your initiative is too low"); | print("Your initiative is too low"); | ||
} | } | ||
Line 53: | Line 47: | ||
}}| | }}| | ||
see_also={{SeeAlso|my_familiar}}| | see_also={{SeeAlso|my_familiar}}| | ||
special=When not logged in the function returns 0 | special=When not logged in the function returns 0.0 | ||
}} | }} | ||
[[Category:Your Character]] |
Latest revision as of 21:36, 21 May 2010
Function Syntax
float initiative_modifier()
Returns your current percentage initiative modifier in the form of a float.
Code Samples
Checks to see whether your initiative modifier is positive.
boolean positive_initiative() {
if(initiative_modifier() < 0){
return false;
}
return true;
}
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().
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;
}
See Also
Special
When not logged in the function returns 0.0