#include <properties.h>#include <language.h>
gehe zum Quellcode dieser Datei
Funktionen | |
| _query_long () | |
| _query_short () | |
| void | create () |
| static int | cm_stopf (string str) |
| static int | cm_smoke (string str) |
| int | smoke2 (object pl) |
| int | smoke3 (object pl) |
Variablen | |
| inherit std | thing |
| int | tm |
| int | gestopft = 0 |
| int | rauchen = 0 |
| string | des |
| string _query_long | ( | ) |
Definiert in Zeile 15 der Datei pfeifchen.c.
Wird benutzt von _query_long(), lies() und long().
00015 { 00016 string s; 00017 s="Ein einfaches Holzpfeifchen: Ohne Verzierungen oder besondere " 00018 "Extras, sondern schlicht und stabil genug fuer ein Abenteurerleben. " 00019 "Es eignet sich hervorragend dazu, einmal zu entspannen und guten " 00020 "Tabak zu geniessen"; 00021 if(gestopft) s+=". Das Pfeifchen ist gestopft"; 00022 if(rauchen) s+=" und angezuendet."; 00023 else s+="."; 00024 return(break_string(s,78)); 00025 }

| static string _query_short | ( | ) |
Definiert in Zeile 27 der Datei pfeifchen.c.
Wird benutzt von _query_short(), name() und short().
00027 { 00028 if(rauchen) return "Ein Pfeifchen (angezuendet)"; 00029 if(gestopft) return "Ein Pfeifchen (gestopft)"; 00030 else return "Ein Pfeifchen"; 00031 }

| static int cm_smoke | ( | string | str | ) | [static] |
Definiert in Zeile 97 der Datei pfeifchen.c.
Benutzt _notify_fail(), break_string(), call_out(), des, gestopft, Name(), ob(), rauchen und tm.
00097 { 00098 object ob; 00099 00100 _notify_fail("Was moechtest Du rauchen?\n"); 00101 if(!str) return 0; 00102 if(!id(str)) return 0; 00103 if(rauchen){ 00104 write("Das machst Du doch bereits, nicht so hektisch.\n"); 00105 return 1; 00106 } 00107 if(!gestopft){ 00108 write("Vielleicht solltest Du Dein Pfeifchen erst mal stopfen?\n"); 00109 return 1; 00110 } 00111 if(tm > time()){ 00112 write("Nana, ein Pfeifchen geniesst man. Sei mal nicht so hektisch.\n"); 00113 return 1; 00114 } 00115 tm = time()+20; 00116 rauchen = 1; 00117 tell_room(environment(this_player()),this_player()->Name()+" raucht in " 00118 +"Ruhe ein Pfeifchen.\n",({this_player()})); 00119 write("Du rauchst in Ruhe Dein Pfeifchen.\n"); 00120 write(break_string(des,78)); 00121 if(find_call_out("smoke2")==-1) 00122 call_out("smoke2",20,getuid(this_player())); 00123 return 1; 00124 }

| static int cm_stopf | ( | string | str | ) | [static] |
Definiert in Zeile 49 der Datei pfeifchen.c.
Benutzt _notify_fail(), break_string(), des, gestopft, Name(), ob(), P_AMOUNT, rauchen und WEM.
00049 { 00050 string s1,s2; 00051 object ob; 00052 _notify_fail("Syntax: stopfe pfeifchen mit <was>\n"); 00053 if(!str) return 0; 00054 if(sscanf(str,"%s mit %s",s1,s2)==2){ 00055 if(id(s1)){ 00056 if(!ob=present(s2,this_player())){ 00057 write("So etwas hast Du doch gar nicht bei Dir.\n"); 00058 return 1; 00059 } 00060 if((ob->id("tabak")) || (ob->QueryMaterial(MAT_CANNABIS)>50)){ 00061 if(rauchen){ 00062 write(break_string("Du rauchst Dein Pfeifchen doch gerade. Damit " 00063 "musst Du schon warten, bis Du fertig bist.",78)); 00064 return 1; 00065 } 00066 if(gestopft){ 00067 write(break_string("Du hast Dein Pfeifchen bereits gestopft. Es " 00068 "liesse sich nun vortrefflich rauchen.",78)); 00069 return 1; 00070 } 00071 else{ 00072 write(break_string("Du stopfst Dein Pfeifchen mit "+ 00073 ob->name(WEM,1)+ 00074 " und freust Dich schon darauf, es zu rauchen.",78)); 00075 tell_room(environment(this_player()),this_player()->Name()+ 00076 " stopft ein Pfeifchen.\n",({this_player()})); 00077 if(!ob->GetSmokeDescription()) des="Es scheint sich um keinen " 00078 "besonders guten Tabak zu handeln. Nun, ja. Besser als nichts " 00079 "immerhin."; 00080 else des=ob->GetSmokeDescription(); 00081 if(!ob->QueryProp(P_AMOUNT)) 00082 ob->remove(); 00083 else 00084 ob->AddAmount(-1); 00085 gestopft = 1; 00086 return 1; 00087 } 00088 } 00089 write(break_string("Das laesst sich aber schlecht rauchen, such " 00090 "Dir lieber einen ordentlichen Tabak.",78)); 00091 return 1; 00092 } 00093 } 00094 return(0); //non-void Funktion, Zesstra 00095 }

| void create | ( | ) |
Definiert in Zeile 33 der Datei pfeifchen.c.
Benutzt AddCmd(), AddId(), create(), NEUTER, P_GENDER, P_MATERIAL, P_NAME, P_NEVERDROP, P_NODROP, P_VALUE, P_WEIGHT, SetProp() und tm.
00033 { 00034 if(!clonep(this_object()))return ; 00035 thing::create(); 00036 tm=0; 00037 SetProp(P_GENDER,NEUTER); 00038 SetProp(P_NAME,"Pfeifchen"); 00039 SetProp(P_WEIGHT,10); 00040 SetProp(P_VALUE,0); 00041 AddId(({"pfeifchen","holzpfeifchen"})); 00042 SetProp(P_NODROP,1); 00043 SetProp(P_NEVERDROP,1); 00044 SetProp(P_MATERIAL,MAT_IRON_WOOD); 00045 AddCmd(({"rauch","rauche"}),"cm_smoke"); 00046 AddCmd(({"stopf","stopfe"}),"cm_stopf"); 00047 }

| int smoke2 | ( | object | pl | ) |
Definiert in Zeile 126 der Datei pfeifchen.c.
Benutzt call_out(), find_player(), ob() und rauchen.
00126 { 00127 object ob; 00128 if(!rauchen) return 0; 00129 if(!ob=find_player(pl)) return 0; 00130 if(environment()!=ob) return 0; 00131 tell_object(ob,"Genuesslich pustest Du ein paar Rauchkringel in die Luft.\n"); 00132 tell_room(environment(ob),ob->Name()+" pustet genuesslich ein paar " 00133 +"Rauchkringel in die Luft.\n",({ob})); 00134 if(find_call_out("smoke3")==-1) 00135 call_out("smoke3",20,getuid(environment())); 00136 return 1; 00137 }

| int smoke3 | ( | object | pl | ) |
Definiert in Zeile 139 der Datei pfeifchen.c.
Benutzt break_string(), find_player(), gestopft, ob(), P_GENDER und rauchen.
00139 { 00140 object ob; 00141 if(!rauchen) return 0; 00142 if(!ob=find_player(pl)) return 0; 00143 if(environment()!=ob) return 0; 00144 tell_object(ob,break_string("Genuesslich pustest Du ein paar Rauchkringel " 00145 "in die Luft, rauchst Dein Pfeifchen auf und klopfst es aus.",78)); 00146 tell_room(environment(ob),break_string(ob->Name()+" pustet genuesslich ein " 00147 "paar Rauchkringel in die Luft, beendet das Rauchpaeuschen und klopft " 00148 +(ob->QueryProp(P_GENDER)==1?"sein":"ihr")+" Pfeifchen aus.",78),({ob})); 00149 rauchen = 0; 00150 gestopft = 0; 00151 return 1; 00152 }

| string des |
Definiert in Zeile 13 der Datei pfeifchen.c.
Wird benutzt von cm_smoke() und cm_stopf().
| int gestopft = 0 |
Definiert in Zeile 10 der Datei pfeifchen.c.
Wird benutzt von _query_long(), _query_short(), cm_smoke(), cm_stopf() und smoke3().
| int rauchen = 0 |
Definiert in Zeile 11 der Datei pfeifchen.c.
Wird benutzt von _query_long(), _query_short(), cm_smoke(), cm_stopf(), smoke2() und smoke3().
| inherit std thing |
Definiert in Zeile 4 der Datei pfeifchen.c.
| int tm |
Definiert in Zeile 9 der Datei pfeifchen.c.
Wird benutzt von cm_smoke() und create().
1.6.3