Difference between revisions of "Inebriety limit"

From Kolmafia
Jump to navigation Jump to search
imported>Efilnikufecin
imported>Zarqon
(corrected old info and added not logged in info)
Line 1: Line 1:
 
[[int]] [[inebriety_limit()]]
 
[[int]] [[inebriety_limit()]]
  
This function returns the minimum drunkenness at which the logged-in character will become falling-down drink as an [[int]].  For characters without a Liver of Steel, this value will be 15.  For those characters with a Liver of Steel, this value is 20.
+
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.
  
An example:
+
This example drinks you silly on St. Sneaky Pete's Day:
  
 
<code>
 
<code>
Line 9: Line 9:
 
   [[item]] FavoredDrink = $[[item]][grogtini];
 
   [[item]] FavoredDrink = $[[item]][grogtini];
 
   while([[my_inebriety()]] < [[inebriety_limit()]]) {
 
   while([[my_inebriety()]] < [[inebriety_limit()]]) {
     [[drink]](1,FavoredDrink);
+
     [[overdrink]](1,FavoredDrink);
 
   }
 
   }
 
   int cirrosis = [[inebriety_limit()]] + 10 - [[my_inebriety()]];
 
   int cirrosis = [[inebriety_limit()]] + 10 - [[my_inebriety()]];
   [[drink]](cirrosis,$item[green beer]);
+
   [[overdrink]](cirrosis,$item[green beer]);
 
   if([[inebriety_limit()]] < 16) {
 
   if([[inebriety_limit()]] < 16) {
 
     print("Not ... drunk ... enough.  Need ... ! ... potion");
 
     print("Not ... drunk ... enough.  Need ... ! ... potion");
Line 20: Line 20:
 
[[Category:Your Character | Inebriety limit()]]
 
[[Category:Your Character | Inebriety limit()]]
 
[[Category:Ash Functions |Inebriety limit()]]
 
[[Category:Ash Functions |Inebriety limit()]]
 +
 +
When not logged in, this function returns 14.

Revision as of 05:18, 29 January 2009

int inebriety_limit()

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.

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

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

When not logged in, this function returns 14.