Difference between pages "Get path variables" and "Total free rests"
(Difference between pages)
Jump to navigation
Jump to search
imported>Wrldwzrd89 m (Sentences should end with periods.) |
imported>Fluxxdog (Creation) |
||
Line 1: | Line 1: | ||
{{ | {{ | ||
− | #vardefine:name| | + | #vardefine:name|total_free_rests}}{{ |
− | #vardefine:return_type| | + | #vardefine:return_type|int}} |
− | + | ==Function Syntax== | |
− | name= | + | {{Function| |
+ | name=total_free_rests| | ||
+ | return_type=int| | ||
+ | }}This function will the total number of free rests available to your character. These rest can come from multiple sourses, such as skills or familiars.<br> | ||
+ | This can be compared against the preference ''timesRested'' to see how many free rests you have remaining.| | ||
− | + | {{CodeSample| | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
title=Code Sample| | title=Code Sample| | ||
− | description= | + | description=Show how many free rests you have remaining.| |
− | code=<syntaxhighlight> | + | code= |
− | + | <syntaxhighlight> | |
− | + | int rests_used=get_property("timesRested").to_int(); | |
− | + | int rests_left=total_free_rests()-rests_used; | |
− | + | print("You have "+rests_left+" remaining"); | |
− | + | </syntaxhighlight> | |
− | </syntaxhighlight> | ||
− | |||
− | |||
− | |||
}} | }} | ||
− | |||
− |
Revision as of 18:24, 26 November 2014
Function Syntax
int total_free_rests()
This function will the total number of free rests available to your character. These rest can come from multiple sourses, such as skills or familiars.
This can be compared against the preference timesRested to see how many free rests you have remaining.|
Code Sample
Show how many free rests you have remaining.
int rests_used=get_property("timesRested").to_int();
int rests_left=total_free_rests()-rests_used;
print("You have "+rests_left+" remaining");