Difference between revisions of "Inebriety limit"

From Kolmafia
Jump to navigation Jump to search
imported>Zarqon
m (more links)
imported>Bale
m
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[int]] [[inebriety_limit()]]
+
{{
 +
#vardefine:name|inebriety_limit}}{{
 +
#vardefine:return_type|int}}{{
  
This function returns the maximum safe drunkenness of a character before the character becomes falling-down drunk as an [[int]].  For characters without a Liver of Steel, this value is 14.  For those characters with a Liver of Steel, this value is 19.
+
FunctionPage|
 +
name={{#var:name}}|
  
This example drinks you silly on St. Sneaky Pete's Day:
+
function1={{Function|
 +
name={{#var:name}}|
 +
aggregate={{#var:aggregate}}|
 +
return_type={{#var:return_type}}|
 +
return_also={{#var:return_also}}|
 +
}}|
  
<code>
+
function_description=Returns the maximum safe drunkenness of a character before becoming falling-down drunk.</p>
[[void]] get_sneaky() {
+
<p>For characters without Liver of Steel, this value is 14. With Liver of Steel, the value is 19.|
   [[item]] FavoredDrink = $[[item]][grogtini];
+
 
   while ([[my_inebriety()]] < [[inebriety_limit()]]) {
+
code1={{CodeSample|
    [[overdrink()|overdrink]](1,FavoredDrink);
+
title=Code Sample|
 +
description=This example drinks you silly on St. Sneaky Pete's Day:|
 +
code=
 +
<syntaxhighlight>
 +
void get_sneaky() {
 +
   item favored_drink = $item[grogtini];
 +
   while (my_inebriety() < inebriety_limit()) {
 +
      overdrink(1 , favored_drink);
 
   }
 
   }
   [[int]] cirrosis = [[inebriety_limit()]] + 10 - [[my_inebriety()]];
+
   int cirrhosis = inebriety_limit() + 10 - my_inebriety();
   [[overdrink()|overdrink]](cirrosis,$item[green beer]);
+
   overdrink(cirrhosis , $item[green beer]);
   if ([[inebriety_limit()]] < 16) {
+
   if (inebriety_limit() < 16) {
    [[print()|print]]("Not ... drunk ... enough. Need ... ! ... potion");
+
      print("Not... drunk... enough. Need... !... potion.");
 
   }
 
   }
}  
+
}
</code>
+
</syntaxhighlight>}}|
[[Category:Your Character | Inebriety limit()]]
+
 
[[Category:Ash Functions |Inebriety limit()]]
+
see_also={{SeeAlso|my_inebriety}}|
 +
special=When not logged in, this function returns 14.
 +
}}
  
When not logged in, this function returns 14.
+
[[Category:Your Character]]

Latest revision as of 21:40, 21 May 2010

Function Syntax

int inebriety_limit()

Returns the maximum safe drunkenness of a character before becoming falling-down drunk.

For characters without Liver of Steel, this value is 14. With Liver of Steel, the value is 19.

Code Sample

This example drinks you silly on St. Sneaky Pete's Day:

void get_sneaky() {
   item favored_drink = $item[grogtini];
   while (my_inebriety() < inebriety_limit()) {
      overdrink(1 , favored_drink);
   }
   int cirrhosis = inebriety_limit() + 10 - my_inebriety();
   overdrink(cirrhosis , $item[green beer]);
   if (inebriety_limit() < 16) {
      print("Not... drunk... enough. Need... !... potion.");
   }
}

See Also

my_inebriety()

Special

When not logged in, this function returns 14.