Inebriety limit: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>StDoodle
m moved Inebriety limit() to Inebriety limit: standards
imported>Bale
mNo edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{#vardefine:name|inebriety_limit}}
{{
{{#vardefine:return_type|int}}
#vardefine:name|inebriety_limit}}{{
#vardefine:return_type|int}}{{


{{FunctionPage|
FunctionPage|
name={{#var:name}}|
name={{#var:name}}|
function_category=Your Character|


function1={{Function|
function1={{Function|
Line 26: Line 26:
       overdrink(1 , favored_drink);
       overdrink(1 , favored_drink);
   }
   }
   int cirrosis = inebriety_limit() + 10 - my_inebriety();
   int cirrhosis = inebriety_limit() + 10 - my_inebriety();
   overdrink(cirrosis , $item[green beer]);
   overdrink(cirrhosis , $item[green beer]);
   if (inebriety_limit() < 16) {
   if (inebriety_limit() < 16) {
       print("Not... drunk... enough. Need... !... potion.");
       print("Not... drunk... enough. Need... !... potion.");
Line 37: Line 37:
special=When not logged in, this function returns 14.
special=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.