boozing.c-Dateireferenz

#include <thing.h>
#include <living.h>
#include <inpc.h>
#include <player/moneyhandler.h>
#include <properties.h>
Include-Abhängigkeitsdiagramm für boozing.c:

gehe zum Quellcode dieser Datei

Makrodefinitionen

#define NEED_PROTOTYPES
#define DRINK_IDS   1
#define DRINK_COST   2
#define DRINK_HEAL   3
#define DRINK_ALC   4
#define DRINK_SAT   5

Funktionen

int Drink ()
void DrinkLoop ()

Makro-Dokumentation

#define DRINK_ALC   4

Definiert in Zeile 22 der Datei boozing.c.

Wird benutzt von Drink().

#define DRINK_COST   2

Definiert in Zeile 20 der Datei boozing.c.

Wird benutzt von Drink().

#define DRINK_HEAL   3

Definiert in Zeile 21 der Datei boozing.c.

Wird benutzt von Drink().

#define DRINK_IDS   1

Definiert in Zeile 19 der Datei boozing.c.

Wird benutzt von Drink().

#define DRINK_SAT   5

Definiert in Zeile 23 der Datei boozing.c.

Wird benutzt von Drink().

#define NEED_PROTOTYPES

Definiert in Zeile 12 der Datei boozing.c.


Dokumentation der Funktionen

int Drink (  ) 

Definiert in Zeile 25 der Datei boozing.c.

Benutzt command, DRINK_ALC, DRINK_COST, DRINK_HEAL, DRINK_IDS, DRINK_SAT, env(), i, mon, P_ALCOHOL, P_DRINK, P_HP, P_I_HATE_ALCOHOL, P_MAX_HP, QueryMoney() und QueryProp().

Wird benutzt von DrinkLoop().

00025             {
00026   mixed drinks;
00027   object env;
00028   int i,max,mon,hdiff;
00029  
00030   if ((mon=QueryMoney())<=0
00031       || !(env=environment())
00032       || !pointerp(drinks=env->query_drink())
00033       || (hdiff=QueryProp(P_MAX_HP)-QueryProp(P_HP))<=0)
00034     return 0;
00035   max=-1;
00036   for (i=sizeof(drinks)-1;i>=0;i--) {
00037     if (drinks[i][DRINK_COST]>mon
00038         || ((drinks[i][DRINK_ALC]>0) &&
00039                     ((drinks[i][DRINK_ALC]+QueryProp(P_ALCOHOL))
00040                      > (100-QueryProp(P_I_HATE_ALCOHOL))))
00041         || drinks[i][DRINK_SAT]+QueryProp(P_DRINK)>100
00042         || drinks[i][DRINK_HEAL]<=0)
00043       continue;
00044     if (max<0
00045         || (drinks[i][DRINK_HEAL]>drinks[max][DRINK_HEAL] &&
00046             drinks[max][DRINK_HEAL]<hdiff)
00047         || (drinks[i][DRINK_HEAL]>=hdiff &&
00048             drinks[i][DRINK_COST]<drinks[max][DRINK_COST]))
00049       max=i;
00050   }
00051   if (max<0) return 0;
00052   command("bestell "+drinks[max][DRINK_IDS][0]);
00053   return 1;
00054 }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

void DrinkLoop (  ) 

Definiert in Zeile 56 der Datei boozing.c.

Benutzt call_out() und Drink().

00056                  {
00057   while (remove_call_out("DrinkLoop")>=0);
00058   if (!Drink())
00059     return;
00060   call_out("DrinkLoop",0);
00061 }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

Erzeugt am Thu Jun 3 14:42:23 2010 für MorgenGrauen Mudlib von  doxygen 1.6.3