Fullness limit: Difference between revisions
Jump to navigation
Jump to search
imported>ZammyWarrior New page: Will return your maximum fullness level. <pre>if(my_fulness() < fulness_limit()) if(fulness_limit()== 15) eat(3, $item[hot hi mein]); else if(fulness_limit() == 20) eat(4, $it... |
imported>PhilmASTErpLus Unwrapped overflowing long code is long. |
||
(10 intermediate revisions by 7 users not shown) | |||
Line 1: | Line 1: | ||
{{ | |||
#vardefine:name|fullness_limit}}{{ | |||
#vardefine:return_type|int}}{{ | |||
< | FunctionPage| | ||
name={{#var:name}}| | |||
function1={{Function| | |||
name={{#var:name}}| | |||
aggregate={{#var:aggregate}}| | |||
return_type={{#var:return_type}}| | |||
return_also={{#var:return_also}} | |||
}}| | |||
function_description=Returns the logged-in character's maximum fullness level as an int. For most characters, the returned value will be 15. On the Feast of Boris this number is raised by 15. The number is also raised by 5 for characters with Stomach of Steel.| | |||
code1={{CodeSample| | |||
title=Code Samples| | |||
description=This example calculates how many hot hi meins it can eat and then eats them.| | |||
code= | |||
<syntaxhighlight> | |||
if (my_fullness() + 5 <= fullness_limit()) | |||
{ | |||
eat(floor((fullness_limit() - my_fullness()) / 5) , $item[hot hi mein]); | |||
// We're using floor() here because if (fullness_limit() - my_fullness())/5 returns, say, 2.6, | |||
//we only want it to consume 2. | |||
// Also, eat() takes an integer, not a float, as a parameter. | |||
} | |||
</syntaxhighlight> | |||
}}| | |||
see_also={{SeeAlso|my_fullness|eat}}| | |||
special=When not logged in, this function returns 15. | |||
}} | |||
[[Category:Your Character]] |
Latest revision as of 20:02, 16 September 2010
Function Syntax
int fullness_limit()
Returns the logged-in character's maximum fullness level as an int. For most characters, the returned value will be 15. On the Feast of Boris this number is raised by 15. The number is also raised by 5 for characters with Stomach of Steel.
Code Samples
This example calculates how many hot hi meins it can eat and then eats them.
if (my_fullness() + 5 <= fullness_limit())
{
eat(floor((fullness_limit() - my_fullness()) / 5) , $item[hot hi mein]);
// We're using floor() here because if (fullness_limit() - my_fullness())/5 returns, say, 2.6,
//we only want it to consume 2.
// Also, eat() takes an integer, not a float, as a parameter.
}
See Also
Special
When not logged in, this function returns 15.