#include <properties.h>#include <moving.h>#include <defines.h>#include <language.h>#include <transport.h>
gehe zum Quellcode dieser Datei
Funktionen | |
| string | _query_short () |
| mixed | _query_transparent () |
| mixed * | _set_route (mixed *r) |
| mixed * | _query_route () |
| void | Halt () |
| varargs void | Start (int pos) |
| void | SetTravelCmds () |
| mixed | HasRoute (mixed dest) |
| public varargs void | AddRoute (string room, int stay, int next, string code, mixed dest, string deststr) |
| varargs void | AddMsg (string msg, int next) |
| void | AddFun (string fun, int next) |
| string | QueryArrived () |
| mixed * | QueryPosition () |
| object * | QueryPassengers () |
| varargs string * | QueryHarbours (int textflag) |
| void | RemoveRoute () |
| varargs int | Enter (object who) |
| varargs int | Leave (object who) |
| static int | GoInside (string str) |
| static int | GoOutside (string str) |
| static int | GoInAndOutside (string str) |
| void | create () |
| static varargs void | disconnect (int change, int change_time) |
| static varargs void | connect (string room, string code) |
| int | clean_up (int arg) |
| void | changeHp () |
| void | __restart (string funname) |
Variablen | |
| inherit std thing | moving |
| inherit std | room |
| nosave mixed * | route |
| nosave int | rpos |
| nosave string | roomCode |
| void __restart | ( | string | funname | ) |
Definiert in Zeile 437 der Datei transport.c.
00438 { 00439 if (!funname || funname == "" || (funname != "changeHp" && 00440 funname != "disconnect")) 00441 return; 00442 while(remove_call_out(funname) != -1); 00443 call_out(funname,funname == "changeHp"?15:5); 00444 }
| mixed* _query_route | ( | ) |
| string _query_short | ( | ) |
| mixed _query_transparent | ( | ) |
Definiert in Zeile 53 der Datei transport.c.
Benutzt P_TRANSPARENT, Query() und roomCode.
00054 { 00055 if (roomCode) return Query(P_TRANSPARENT); 00056 return 0; 00057 }

| mixed* _set_route | ( | mixed * | r | ) |
| void AddFun | ( | string | fun, | |
| int | next | |||
| ) |
| varargs void AddMsg | ( | string | msg, | |
| int | next | |||
| ) |
| public varargs void AddRoute | ( | string | room, | |
| int | stay, | |||
| int | next, | |||
| string | code, | |||
| mixed | dest, | |||
| string | deststr | |||
| ) |
Definiert in Zeile 115 der Datei transport.c.
Benutzt HP_ROOM, i, ob(), P_NO_TRAVELING, QueryProp(), route und TRAVELD.
00117 { 00118 object ob; 00119 int i; 00120 if (!pointerp(dest)) 00121 { 00122 if (stringp(dest)) 00123 dest = ({ dest }); 00124 else 00125 dest = map(filter(explode(code," "),lambda( ({'x}), 00126 ({ #'==, 'x, ({#'capitalize, 'x}) }) ) ),#'lower_case); 00127 } 00128 route += ({ ({ HP_ROOM, room, stay, next, code, dest, deststr }) }); 00129 00130 if(!QueryProp(P_NO_TRAVELING)) 00131 { 00132 TRAVELD->AddHarbour(object_name(this_object()),room); 00133 } 00134 }

| void changeHp | ( | ) |
Definiert in Zeile 417 der Datei transport.c.
00418 { 00419 if (++rpos == sizeof(route)) rpos = 0; 00420 if (route[rpos][0] == HP_MSG) 00421 { 00422 call_out("changeHp",route[rpos][2]); 00423 tell_room(this_object(),route[rpos][1]); 00424 } 00425 else if (route[rpos][0] == HP_FUN) 00426 { 00427 call_out("changeHp",route[rpos][2]); 00428 call_other(this_object(),route[rpos][1]); 00429 } 00430 else 00431 { 00432 call_out("disconnect",route[rpos][2],1,route[rpos][3]); 00433 connect(route[rpos][1],route[rpos][4]); 00434 } 00435 }
| int clean_up | ( | int | arg | ) |
Definiert in Zeile 415 der Datei transport.c.
| static varargs void connect | ( | string | room, | |
| string | code | |||
| ) | [static] |
Definiert in Zeile 347 der Datei transport.c.
00348 { 00349 mixed *arrivemsg, *t; 00350 object *trav, ob; 00351 string *trs, *msgs; 00352 int i; 00353 00354 if (roomCode) disconnect(); 00355 00356 roomCode = code?code:""; 00357 00358 if (catch(move(room,M_SILENT|M_NOCHECK);publish)) 00359 { 00360 roomCode = 0; 00361 return; 00362 } 00363 00364 arrivemsg = QueryProp(P_ARRIVEMSG); 00365 00366 if (pointerp(arrivemsg)) 00367 { 00368 tell_room(this_object(),process_string(arrivemsg[0])); 00369 tell_room(room,process_string(arrivemsg[1])); 00370 } 00371 00372 trav = filter(all_inventory(this_object()),#'living); 00373 00374 i = sizeof(trav); 00375 while(i--) 00376 { 00377 if (pointerp(t = trav[i]->QueryProp(P_TRAVEL_INFO))&& 00378 t[0]==this_object()&&t[2]==room) 00379 { 00380 if (trav[i]->InFight()) 00381 tell_object(trav[i],break_string("Du solltest Deinen Kampf " 00382 "schnell beenden,denn eigentlich wolltest Du hier " 00383 "aussteigen.",78)); 00384 else 00385 Leave(trav[i]); 00386 if (environment(trav[i])!=this_object()) 00387 trav[i]->SetProp(P_TRAVEL_INFO,0); 00388 } 00389 } 00390 trav = filter(all_inventory(find_object(room))-trav,#'living); 00391 i=sizeof(trav); 00392 while(i--) 00393 { 00394 if (objectp(trav[i]) && pointerp(t = trav[i]->QueryProp(P_TRAVEL_INFO))&& 00395 t[0] == environment(trav[i]) && t[1] == this_object()) 00396 { 00397 if ( trav[i]->InFight() ) 00398 tell_object(trav[i], 00399 break_string("Du solltest Deinen Kampf schnell beenden, denn " 00400 "eigentlich wolltest Du mit "+name(WEM,1)+ 00401 " reisen.",78)); 00402 else 00403 Enter(trav[i]); 00404 if (environment(trav[i]) == this_object()) 00405 { 00406 t[0] = this_object(); 00407 trav[i]->SetProp(P_TRAVEL_INFO,t); 00408 } 00409 } 00410 } 00411 }
| void create | ( | ) |
Definiert in Zeile 314 der Datei transport.c.
00315 { 00316 ::create(); 00317 00318 route = ({}); 00319 00320 SetProp(P_LEAVEFAIL,"Das ist momentan viel zu gefaehrlich"); 00321 SetProp(P_ENTERFAIL,"Dort ist kein Platz mehr fuer Dich"); 00322 SetProp(P_TRANSPARENT,1); 00323 00324 AddId("Transporter"); 00325 00326 call_out("SetTravelCmds",1); 00327 }
| static varargs void disconnect | ( | int | change, | |
| int | change_time | |||
| ) | [static] |
Definiert in Zeile 329 der Datei transport.c.
00330 { 00331 object room; 00332 mixed *departmsg; 00333 00334 departmsg = QueryProp(P_DEPARTMSG); 00335 00336 if ((room = environment()) && pointerp(departmsg)) 00337 { 00338 tell_room(this_object(),process_string(departmsg[0])); 00339 tell_room(room,process_string(departmsg[1])); 00340 } 00341 00342 roomCode = 0; 00343 00344 if (change) call_out("changeHp",change_time); 00345 }
| varargs int Enter | ( | object | who | ) |
Definiert in Zeile 196 der Datei transport.c.
00197 { 00198 string *emsg; 00199 mixed efail; 00200 00201 if (!objectp(who)) who = this_player(); 00202 if (environment(who) == this_object()) 00203 { 00204 tell_object(who,"Da bist Du doch bereits, schon vergessen?\n"); 00205 return 1; 00206 } 00207 if (!QueryArrived()) return 0; 00208 if (QueryProp(P_MAX_PASSENGERS) && 00209 (sizeof(QueryPassengers()) >= QueryProp(P_MAX_PASSENGERS))) 00210 { 00211 if (pointerp(efail=QueryProp(P_ENTERFAIL))) 00212 { 00213 if (sizeof(efail) == 2) 00214 tell_room(this_object(),who->Name(WER,2)+" "+process_string(efail[1])+ 00215 ".\n",({who})); 00216 tell_object(who,process_string(efail[0])+".\n"); 00217 } 00218 else if (stringp(efail)) 00219 tell_object(who,process_string(efail)+".\n"); 00220 else if (closurep(efail)) funcall(efail); 00221 return 1; 00222 } 00223 00224 tell_object(who,"Du betrittst "+name(WEN,1)+".\n"); 00225 if (pointerp(emsg=QueryProp(P_ENTERMSG)) && sizeof(emsg) == 2) 00226 return who->move(this_object(),M_GO,"",process_string(emsg[0]), 00227 process_string(emsg[1])); 00228 return who->move(this_object(),M_GO, 00229 name(WEN,1),"betritt","kommt herein"); 00230 }
| static int GoInAndOutside | ( | string | str | ) | [static] |
Definiert in Zeile 301 der Datei transport.c.
00302 { 00303 string to; 00304 00305 _notify_fail("Was moechtest Du denn genau?\n"); 00306 if (!strlen(str)) return 0; 00307 if ((sscanf(str,"auf %s",to) == 1 || sscanf(str,"in %s",to) == 1) && id(to)) 00308 return Enter(),1; 00309 if ((sscanf(str,"von %s",to) == 1 || sscanf(str,"aus %s",to) == 1) && id(to)) 00310 return Leave(),1; 00311 return 0; 00312 }
| static int GoInside | ( | string | str | ) | [static] |
Definiert in Zeile 281 der Datei transport.c.
00282 { 00283 _notify_fail("Was moechtest Du denn genau?\n"); 00284 if (stringp(str) && id(str)) { 00285 Enter(); 00286 return 1; 00287 } 00288 return 0; 00289 }
| static int GoOutside | ( | string | str | ) | [static] |
Definiert in Zeile 291 der Datei transport.c.
00292 { 00293 _notify_fail("Was moechtest Du denn genau?\n"); 00294 if (stringp(str) && id(str)) { 00295 Leave(); 00296 return 1; 00297 } 00298 return 0; 00299 }
| void Halt | ( | ) |
Definiert in Zeile 66 der Datei transport.c.
Wird benutzt von Start().
00067 { 00068 while (remove_call_out( "changeHp" )>-1); 00069 while (remove_call_out( "disconnect" )>-1); 00070 }

| mixed HasRoute | ( | mixed | dest | ) |
Definiert in Zeile 90 der Datei transport.c.
Benutzt HP_ROOM, i, ob(), P_HARBOUR, route und rpos.
Wird benutzt von reise().
00091 { 00092 int i,s,z; 00093 string str; 00094 object ob; 00095 mixed harb; 00096 00097 s = sizeof(route); 00098 00099 for (i = rpos;i <= rpos+s-1;i++) 00100 { 00101 if (route[i%s][0] == HP_ROOM) 00102 { 00103 if (member(route[i%s][5],dest) != -1 && 00104 objectp(ob=load_object(route[i%s][1])) && 00105 pointerp(harb=ob->QueryProp(P_HARBOUR)) && 00106 sizeof(harb)) 00107 { 00108 return ({ route[i%s][1], harb[0] }); 00109 } 00110 } 00111 } 00112 return 0; 00113 }


| varargs int Leave | ( | object | who | ) |
Definiert in Zeile 232 der Datei transport.c.
00233 { 00234 string *lmsg; 00235 mixed lfail; 00236 00237 if (!objectp(who)) who = this_player(); 00238 if (environment(who) != this_object()) 00239 { 00240 if (QueryArrived()) 00241 { 00242 tell_object(who,"Dafuer muesstest Du erstmal dort sein.\n"); 00243 return 1; 00244 } 00245 return 0; 00246 } 00247 if (!QueryArrived()) 00248 { 00249 if (lfail=QueryProp(P_LEAVEFAIL)) 00250 { 00251 if (pointerp(lfail) && sizeof(lfail)) 00252 { 00253 if (sizeof(lfail) == 2) 00254 tell_room(this_object(),who->Name(WER,2)+" "+process_string( 00255 lfail[1])+".\n",({who})); 00256 tell_object(who,process_string(lfail[0])+".\n"); 00257 } 00258 else if (stringp(lfail)) 00259 tell_object(who,process_string(lfail)+".\n"); 00260 else if (closurep(lfail)) funcall(lfail); 00261 return 1; 00262 } 00263 tell_object(who,"Fehler beim Verlassen des Transporters.\n" 00264 "Bitte zustaendigen Magier verstaendigen.\n"); 00265 return 1; 00266 } 00267 00268 if (who->QueryProp(P_TRAVEL_INFO)) who->SetProp(P_TRAVEL_INFO,0); 00269 tell_object(who,"Du verlaesst "+name(WEN,1)+".\n"); 00270 if (pointerp(lmsg=QueryProp(P_LEAVEMSG)) && sizeof(lmsg) == 2) 00271 return who->move(environment(),M_GO,"",process_string(lmsg[0]), 00272 process_string(lmsg[1])); 00273 return who->move(environment(),M_GO, 00274 name(WEN,1),"verlaesst","kommt herein"); 00275 }
| string QueryArrived | ( | ) |
| varargs string* QueryHarbours | ( | int | textflag | ) |
Definiert in Zeile 155 der Datei transport.c.
00156 { 00157 int i,j,k; 00158 string *ret, *s, h, *h2; 00159 00160 ret = ({}); 00161 00162 if (textflag) 00163 { 00164 j=sizeof(route); 00165 for (i=0;i<j;i++) 00166 if (route[i][0] == HP_ROOM) 00167 { 00168 s = route[i][1]->QueryProp(P_HARBOUR); 00169 if (pointerp(s) && sizeof(s)) 00170 { 00171 h2 = explode(s[1]," "); 00172 k=sizeof(h2); 00173 while(k--) h2[k]=capitalize(h2[k]); 00174 ret+=({ implode(h2," ") }); 00175 } 00176 00177 } 00178 } 00179 else 00180 { 00181 i=sizeof(route); 00182 while(i--) if (route[i][0] == HP_ROOM) ret += ({route[i][1]}); 00183 } 00184 return ret; 00185 }
| object* QueryPassengers | ( | ) |
Definiert in Zeile 150 der Datei transport.c.
| mixed* QueryPosition | ( | ) |
| void RemoveRoute | ( | ) |
| void SetTravelCmds | ( | ) |
Definiert in Zeile 79 der Datei transport.c.
Benutzt AddCmd(), P_ENTERCMDS, P_LEAVECMDS, P_TRAVEL_CMDS und QueryProp().
00080 { 00081 if (pointerp(QueryProp(P_LEAVECMDS))) 00082 AddCmd(QueryProp(P_LEAVECMDS),"GoOutside"); 00083 if (pointerp(QueryProp(P_ENTERCMDS))) 00084 AddCmd(QueryProp(P_ENTERCMDS),"GoInside"); 00085 if (pointerp(QueryProp(P_TRAVEL_CMDS))) 00086 AddCmd(QueryProp(P_TRAVEL_CMDS),"GoInAndOutside"); 00087 return; 00088 }

| varargs void Start | ( | int | pos | ) |
Definiert in Zeile 72 der Datei transport.c.
Benutzt call_out(), Halt(), route und rpos.
00073 { 00074 Halt(); 00075 rpos = (pos >= sizeof(route))?-1:pos-1; 00076 call_out("changeHp",0); 00077 }

Definiert in Zeile 12 der Datei transport.c.
| inherit std room |
Definiert in Zeile 13 der Datei transport.c.
| nosave string roomCode |
Definiert in Zeile 41 der Datei transport.c.
Wird benutzt von _query_short(), _query_transparent() und QueryArrived().
| nosave mixed* route |
Definiert in Zeile 39 der Datei transport.c.
Wird benutzt von _query_route(), _set_route(), AddFun(), AddMsg(), AddRoute(), HasRoute(), QueryPosition() und Start().
| nosave int rpos |
Definiert in Zeile 40 der Datei transport.c.
Wird benutzt von HasRoute(), QueryPosition() und Start().
1.6.3