#include <defines.h>#include <properties.h>#include <language.h>
gehe zum Quellcode dieser Datei
Funktionen | |
| create () | |
| int | pubtest (string arg) |
Variablen | |
| inherit std | thing |
| create | ( | ) |
Definiert in Zeile 9 der Datei pubtool.c.
Benutzt AddCmd(), AddId(), create(), ME, NEUTER, P_AUTOLOADOBJ, P_GENDER, P_LONG, P_NAME, P_NEVERDROP, P_NODROP, P_SHORT, P_VALUE, P_WEIGHT und SetProp().
00010 { 00011 if (!clonep(ME)) 00012 return; 00013 ::create(); 00014 00015 SetProp(P_SHORT,"Ein Pubtool"); 00016 SetProp(P_LONG, 00017 "Das Pubtool berechnet die maximal zulaessige Heilung einer Kneipe.\n"+ 00018 "\n"+ 00019 "Syntax: pubtest <P_ALCOHOL> <P_DRINK> <P_FOOD> <P_VALUE> <Rate> <Delay>\n"+ 00020 "\n"+ 00021 "Wertebereich: >=0 >=0 >=0 >=0 1..20 0..\n"+ 00022 "\n"); 00023 SetProp(P_NAME,"Pubtool"); 00024 SetProp(P_GENDER,NEUTER); 00025 SetProp(P_WEIGHT,0); 00026 SetProp(P_VALUE,0); 00027 SetProp(P_NODROP,"Das Pubtool behaelst Du lieber bei Dir.\n"); 00028 SetProp(P_NEVERDROP,1); 00029 SetProp(P_AUTOLOADOBJ,1); 00030 00031 AddId( "pubtool" ); 00032 00033 AddCmd( "pubtest", "pubtest" ); 00034 }

| int pubtest | ( | string | arg | ) |
Definiert in Zeile 36 der Datei pubtool.c.
Benutzt h, notify_fail(), P_ALCOHOL, P_DRINK, P_FOOD und P_VALUE.
00037 { int v,d,a,f,r,h,y; 00038 00039 notify_fail( 00040 "Syntax: pubtest <P_ALCOHOL> <P_DRINK> <P_FOOD> <P_VALUE> <Rate> <Delay>\n"); 00041 00042 if (!arg || !stringp(arg) || 00043 sscanf(arg,"%d %d %d %d %d %d",a,d,f,v,r,y)!=6) 00044 return 0; 00045 00046 if (v<1 || d<0 || a<0 || f<0 || r<1 || r>20 || y<0) 00047 return 0; 00048 00049 h=call_other("/secure/pubmaster","CalcMax", 00050 ([P_VALUE:v,P_ALCOHOL:a,P_DRINK:d,P_FOOD:f, 00051 "delay":y,"rate":r]),0); 00052 00053 printf("Berechnete Maximalheilung fuer:\n"+ 00054 "P_ALCOHOL = %3d P_DRINK = %3d P_FOOD = %3d \n"+ 00055 "P_VALUE = %3d Rate = %3d Delay = %3d \n"+ 00056 "Ergebnis:\n"+ 00057 "Gesamt: %3d (HP+SP), aufgeteilt z.B. %3d HP und %3d SP.\n", 00058 a,d,f,v,r,y,h,(h/2),(h%2?(h/2)+1:(h/2))); 00059 return 1; 00060 }

1.6.3