#include <wizlevels.h>#include <magier.h>#include <thing/properties.h>#include <thing/moving.h>#include <player.h>
gehe zum Quellcode dieser Datei
Makrodefinitionen | |
| #define | NEED_PROTOTYPES |
Funktionen | |
| static private mixed | verfolger () |
| static int | _move_base (object target, object old_room, string cmd) |
| static int | _in_room (string str) |
| static int | _at_player (string dest) |
| static object | find_living_nr (string str) |
| static int | _goto (string dest) |
| static int | _home () |
| static int | _go_wiz_home (string str) |
| static mixed * | _query_localcmds () |
| static int _at_player | ( | string | dest | ) | [static] |
Definiert in Zeile 89 der Datei moving.c.
Benutzt _move_base(), _notify_fail(), _unparsed_args(), find_living(), match_living(), move_object(), ob() und USAGE.
00090 { 00091 object ob,old_room; 00092 mixed tmp; 00093 string cmd; 00094 00095 if (!strlen(dest=_unparsed_args()) || 00096 !strlen(dest=regreplace(dest,"^ *","",1)) || 00097 sscanf(dest, "%s %s", dest, cmd) != 2) 00098 return USAGE("at <lebewesen> <befehl>\n"); 00099 if (!(ob=find_living(dest))) 00100 { 00101 tmp=match_living(dest,1); 00102 if (stringp(tmp)) ob = find_living(tmp); 00103 } 00104 if (!ob||!(ob=environment(ob))) 00105 return _notify_fail(sprintf("at: Lebewesen \'%s\' nicht gefunden.\n", 00106 dest)),0; 00107 old_room=environment(); 00108 move_object(ob); 00109 return _move_base(ob,old_room,cmd); 00110 }

| static int _go_wiz_home | ( | string | str | ) | [static] |
Definiert in Zeile 187 der Datei moving.c.
00188 { 00189 _notify_fail("Syntax: '+magiername'\n"); 00190 if(strlen(query_verb())>1) str=query_verb()[1..]; 00191 if(!strlen(str)) return 0; 00192 if(query_verb()[0]!='+') return 0; 00193 str=(old_explode(str," ")-({0}))[0]; 00194 if(!strlen(str)) return 0; 00195 str=lower_case(str); 00196 if (str=="merlin") 00197 { 00198 move("/secure/merlin",M_TPORT|M_NOCHECK); 00199 return 1; 00200 } 00201 if ((!call_other(master(),"get_userinfo",str))|| 00202 !IS_LEARNER(str)) 00203 { 00204 printf("Es gibt keinen Magier namens %s.\n", 00205 capitalize(str)); 00206 return 1; 00207 } 00208 if (file_size("/players/"+str+"/workroom.c")<1) 00209 { 00210 printf("%s hat keinen Workroom.\n",capitalize(str)); 00211 return 1; 00212 } 00213 if (catch(call_other("/players/"+str+"/workroom","???"))) 00214 { 00215 printf("Der Workroom von %s hat Fehler.\n",capitalize(str)); 00216 return 1; 00217 } 00218 move("/players/"+str+"/workroom",M_TPORT|M_NOCHECK); 00219 return 1; 00220 }
| static int _goto | ( | string | dest | ) | [static] |
Definiert in Zeile 128 der Datei moving.c.
00128 { 00129 mixed target; 00130 string target2,err; 00131 00132 if (!strlen(dest=_unparsed_args())) 00133 return USAGE("goto [lebewesen|filename]\n"); 00134 if (!((target=find_living_nr(dest)) && (target=environment(target)))) 00135 { 00136 target2=target=(mixed)call_other(master(),"_get_path",dest,getuid()); 00137 if (!find_object(target)) 00138 { 00139 if (target2[<1]=='.') target2+="c"; 00140 if (target2[<2..<1]!=".c") target2+=".c"; 00141 notify_fail(sprintf("goto: Datei %O nicht vorhanden.\n",target)); 00142 if (!(file_size(target2)>-1|| 00143 file_size(implode(explode(target,"/")[0..<2],"/")+ 00144 "/virtual_compiler.c")>-1)||(err=catch(call_other(target,"?")))) 00145 { 00146 if (err) 00147 notify_fail(sprintf("goto: Fehler beim Teleport nach %O:\n%s\n", 00148 dest,implode(explode(err,"\n")," "))); 00149 target=match_living(dest,1); 00150 if (!(stringp(target)&&(target=find_living(target))&& 00151 (target=environment(target)))) 00152 return 0; 00153 } 00154 } 00155 } 00156 if (verfolger()) _verfolge(""); 00157 if (move(target,M_TPORT|M_NOCHECK)<0) 00158 printf("Bewegung fehlgeschlagen!\n"); 00159 return 1; 00160 }
| static int _home | ( | ) | [static] |
Definiert in Zeile 166 der Datei moving.c.
00167 { 00168 string dest; 00169 if (verfolger()) _verfolge(""); 00170 dest="/players/" + getuid() + "/workroom"; 00171 if (file_size(dest+".c")<1||catch(call_other(dest,"???"))) 00172 { 00173 printf("Fehler beim Laden Deines Workrooms.\n" 00174 "Gehe zum Magiertreff.\n"); 00175 dest="/secure/merlin"; 00176 } 00177 00178 if (move(dest,M_TPORT|M_NOCHECK)<0) 00179 printf("Bewegung fehlgeschlagen!\n"); 00180 return 1; 00181 }
| static int _in_room | ( | string | str | ) | [static] |
Definiert in Zeile 65 der Datei moving.c.
Benutzt _move_base(), _unparsed_args(), err, master, move_object(), room und USAGE.
00066 { 00067 string room;int size; 00068 object old_room; 00069 string cmd,err; 00070 00071 if (!strlen(str=_unparsed_args()) || 00072 !strlen(str=regreplace(str,"^ *","",1)) || 00073 sscanf(str, "%s %s", room, cmd) != 2) 00074 return USAGE("in <raum> <befehl>\n"); 00075 old_room = environment(); 00076 room=(string)call_other(master(),"_get_path",room,getuid()); 00077 if (err=catch(move_object(room))) 00078 { 00079 if (catch(size=file_size(room+".c"))||size<1) 00080 printf("%s: %s.c: Datei nicht vorhanden.\n",query_verb(),room); 00081 else 00082 printf("%s: Bewegung nach %s hat nicht funktioniert: %s\n", 00083 query_verb(),room,err); 00084 return 1; 00085 } 00086 return _move_base(find_object(room),old_room,cmd); 00087 }

| static int _move_base | ( | object | target, | |
| object | old_room, | |||
| string | cmd | |||
| ) | [static] |
Definiert in Zeile 33 der Datei moving.c.
Benutzt __set_environment(), command, IS_ARCH und move_object().
Wird benutzt von _at_player() und _in_room().
00034 { 00035 if (environment()!=target) 00036 if (IS_ARCH(this_object())) 00037 { 00038 __set_environment(this_object(),target); 00039 printf("%s: Bewegung hat nicht geklappt. Versuche es mit " 00040 "set_environment... %s.\n.",query_verb(), 00041 environment()==target?"hat geklappt":"erfolglos"); 00042 } 00043 else 00044 printf("%s: Bewegung hat nicht geklappt.\n",query_verb()); 00045 if (environment()!=target) return 1; 00046 command(cmd); 00047 if (old_room) move_object(old_room); 00048 else 00049 return printf("%s: Ursprungsraum wurde zerstoert.\n",query_verb()),1; 00050 if (environment()!=old_room) 00051 { 00052 if (IS_ARCH(this_object())) 00053 { 00054 __set_environment(this_object(),old_room); 00055 printf("%s: Zurueckbewegen hat nicht geklappt. Versuche es mit " 00056 "set_environment ... %s.\n",query_verb(), 00057 environment()==old_room?"hat geklappt":"erfolglos"); 00058 } 00059 else 00060 printf("at: Zurueckbewegen hat nicht geklappt.\n"); 00061 } 00062 return 1; 00063 }


| static mixed* _query_localcmds | ( | ) | [static] |
Definiert in Zeile 223 der Datei moving.c.
00224 { 00225 return 00226 ({({"goto","_goto",0,LEARNER_LVL}), 00227 ({"in","_in_room",0,LEARNER_LVL}), 00228 ({"at","_at_player",0,LEARNER_LVL}), 00229 ({"home","_home",0,WIZARD_LVL}), 00230 ({"+","_go_wiz_home",1,LEARNER_LVL})}); 00231 }
| static object find_living_nr | ( | string | str | ) | [static] |
Definiert in Zeile 116 der Datei moving.c.
Benutzt check, find_living(), find_livings() und name.
00117 { string name,check; 00118 int nr; 00119 object*livings; 00120 if(sscanf(str,"%s %d%s",name,nr,check)<2||strlen(check)) 00121 return find_living(str); 00122 if(!sizeof(livings=filter((find_livings(name)||({})),#'environment)) 00123 ||nr<1||sizeof(livings)<nr) 00124 return 0; 00125 return livings[nr-1]; 00126 }

| static private mixed verfolger | ( | ) | [static] |
Definiert in Zeile 21 der Datei moving.c.
Benutzt P_PURSUERS und QueryProp().
00022 { 00023 mixed *pur; 00024 00025 if (!pointerp(pur=QueryProp(P_PURSUERS))) return 0; 00026 else return pur[0]; 00027 }

1.6.3