#include <thing/description.h>#include <thing/material.h>#include <thing/lighttypes.h>#include <exploration.h>#include <class.h>#include <thing/properties.h>#include <thing/language.h>
gehe zum Quellcode dieser Datei
Makrodefinitionen | |
| #define | NEED_PROTOTYPES |
Funktionen | |
| public mixed | short () |
| public varargs string | long (int mode) |
| protected void | create () |
| protected void | create_super () |
| static void | GiveEP (int type, string key) |
| void | __reload_explore () |
| public string | description_id () |
| int | match_item (string str, string *ids) |
| varargs int | id (string str, int lvl) |
| int | match_ids (string *list) |
| void | AddId (mixed str) |
| void | RemoveId (mixed str) |
| static mixed | _set_ids (mixed ids) |
| void | AddAdjective (mixed str) |
| void | RemoveAdjective (mixed str) |
| static mixed | _set_adjectives (mixed adjectives) |
| private string | depointer_adj (mixed adj, int casus, int demon) |
| varargs string | name (int casus, int demon) |
| varargs string | Name (int casus, int demon) |
| static mixed | _set_name_adj (mixed adjectives) |
| void | AddDetail (mixed keys, mixed descr) |
| varargs void | RemoveDetail (mixed keys) |
| void | AddSpecialDetail (mixed keys, string functionname) |
| void | RemoveSpecialDetail (mixed keys) |
| void | AddReadDetail (mixed keys, mixed descr) |
| varargs void | RemoveReadDetail (mixed keys) |
| void | AddSounds (mixed keys, mixed descr) |
| varargs void | RemoveSounds (mixed keys) |
| void | AddSmells (mixed keys, mixed descr) |
| varargs void | RemoveSmells (mixed keys) |
| varargs mixed | GetDetail (mixed key, mixed race, int sense) |
| int | lies (string str) |
| void | read (string str) |
| private int | _closures (mixed x, mapping details, int yes) |
| static mapping | _query_details () |
| static mapping | _query_special_details () |
| static mapping | _query_read_details () |
| static mapping | _query_sound_details () |
| static mapping | _query_smell_details () |
| static int | _query_total_light () |
| static int | _set_light (int light) |
| public void | AddClass (mixed str) |
| void | RemoveClass (mixed str) |
| int | is_class_member (mixed str) |
| static mixed | _set_class (mixed classes) |
| static mapping | _set_material (mixed mat) |
| static mapping | _query_material () |
| int | QueryMaterial (string mat) |
| int | QueryMaterialGroup (string matgroup) |
| string | MaterialList (int casus, mixed idinf) |
| varargs int | CheckLightType (int lighttype, int mode) |
| static int | _set_size (int sz) |
| static int | _query_clone_time () |
Variablen | |
| private nosave mixed * | explore |
| #define NEED_PROTOTYPES |
Definiert in Zeile 19 der Datei description.c.
| void __reload_explore | ( | ) |
| private int _closures | ( | mixed | x, | |
| mapping | details, | |||
| int | yes | |||
| ) |
Definiert in Zeile 727 der Datei description.c.
00728 { 00729 return yes ? closurep(details[x]) : !closurep(details[x]); 00730 }
| static int _query_clone_time | ( | ) | [static] |
Definiert in Zeile 946 der Datei description.c.
| static mapping _query_details | ( | ) | [static] |
Definiert in Zeile 732 der Datei description.c.
| static mapping _query_material | ( | ) | [static] |
Definiert in Zeile 874 der Datei description.c.
00875 { 00876 mixed res; 00877 00878 if ( !mappingp(res = Query(P_MATERIAL, F_VALUE)) ) 00879 return ([MAT_MISC:100]); 00880 00881 return res; 00882 }
| static mapping _query_read_details | ( | ) | [static] |
Definiert in Zeile 744 der Datei description.c.
00744 { 00745 return deep_copy(Query(P_READ_DETAILS, F_VALUE)); 00746 }
| static mapping _query_smell_details | ( | ) | [static] |
Definiert in Zeile 752 der Datei description.c.
| static mapping _query_sound_details | ( | ) | [static] |
Definiert in Zeile 748 der Datei description.c.
| static mapping _query_special_details | ( | ) | [static] |
Definiert in Zeile 738 der Datei description.c.
| static int _query_total_light | ( | ) | [static] |
Definiert in Zeile 758 der Datei description.c.
| static mixed _set_adjectives | ( | mixed | adjectives | ) | [static] |
Definiert in Zeile 263 der Datei description.c.
Benutzt AddAdjective(), F_VALUE, P_ADJECTIVES, Query() und Set().
00264 { 00265 Set( P_ADJECTIVES,({}), F_VALUE); 00266 AddAdjective(adjectives); 00267 return Query(P_ADJECTIVES, F_VALUE); 00268 }

| static mixed _set_class | ( | mixed | classes | ) | [static] |
| static mixed _set_ids | ( | mixed | ids | ) | [static] |
| static int _set_light | ( | int | light | ) | [static] |
Definiert in Zeile 760 der Datei description.c.
00761 { 00762 object env; 00763 00764 env = this_object(); 00765 00766 while ( objectp(env = environment(env)) ) 00767 // Ja. Man ruft die _set_xxx()-Funktionen eigentlich nicht direkt auf. 00768 // Aber das Lichtsystem ist schon *so* rechenintensiv und gerade der 00769 // P_LAST_CONTENT_CHANGE-Cache wird *so* oft benoetigt, dass es mir 00770 // da um jedes bisschen Rechenzeit geht. 00771 // Der Zweck heiligt ja bekanntlich die Mittel. ;-) 00772 // 00773 // Tiamak 00774 env->_set_last_content_change(); 00775 00776 return Set( P_LIGHT, light, F_VALUE); 00777 }
| static mapping _set_material | ( | mixed | mat | ) | [static] |
Definiert in Zeile 855 der Datei description.c.
00856 { 00857 int i, sz; 00858 mapping mats; 00859 00860 if (mappingp(mat)) mats = mat; 00861 else 00862 { 00863 mats = ([]); 00864 00865 if ( stringp(mat)) mats[mat]=100; 00866 else if ( pointerp(mat)&&sz=sizeof(mat) ) 00867 for ( i = sz; i--; ) mats[mat[i]] += 100 / sz; 00868 } 00869 00870 return Set( P_MATERIAL, mats, F_VALUE ); 00871 }
| static mixed _set_name_adj | ( | mixed | adjectives | ) | [static] |
Definiert in Zeile 446 der Datei description.c.
00447 { 00448 if (!adjectives) 00449 adjectives=({}); 00450 // In Array umwandeln 00451 else if ( !pointerp(adjectives)) 00452 adjectives = ({ to_string(adjectives) }); 00453 return Set( P_NAME_ADJ, adjectives ); 00454 }
| static int _set_size | ( | int | sz | ) | [static] |
Definiert in Zeile 936 der Datei description.c.
00936 { 00937 //Groesse muss > 0 sein, alles andere ist unsinnig! (0 und neg. Groessen 00938 //haben keine phys. Relevanz und machen u.U. Probleme mit Objekten, die 00939 //Schaden in Abhaengigkeit der Groesse machen) 00940 if (sz>0) 00941 Set(P_SIZE,sz,F_VALUE); 00942 return(Query(P_SIZE,F_VALUE)); 00943 }
| void AddAdjective | ( | mixed | str | ) |
Definiert in Zeile 244 der Datei description.c.
Benutzt F_VALUE, P_ADJECTIVES, Query() und Set().
Wird benutzt von _set_adjectives(), _set_autoloadobj(), create() und move().
00245 { 00246 if (stringp(str)) str = ({ str }); 00247 if (pointerp(str)) 00248 // Doppelte eliminieren 00249 Set( P_ADJECTIVES, Query(P_ADJECTIVES, F_VALUE)-str+str, F_VALUE ); 00250 return; 00251 }


| public void AddClass | ( | mixed | str | ) |
Definiert in Zeile 784 der Datei description.c.
00785 { 00786 if (!stringp(str) && !pointerp(str)) return; 00787 if (stringp(str)) 00788 str = ({ str }); 00789 // Aliase aufloesen und implizite Klassen addieren. 00790 str = (string*)CLASSDB->AddImplicitClasses(str); 00791 // Summe mit alten Klassen bilden und Doppelte eliminieren 00792 str = str + Query(P_CLASS, F_VALUE); 00793 Set( P_CLASS, m_indices(mkmapping(str)), F_VALUE); 00794 00795 return; 00796 }
| void AddDetail | ( | mixed | keys, | |
| mixed | descr | |||
| ) |
Definiert in Zeile 461 der Datei description.c.
00462 { 00463 int i; 00464 mapping details; 00465 00466 details = Query(P_DETAILS, F_VALUE); 00467 00468 if (!pointerp(keys)) 00469 details[lower_case((string)keys)]=descr; 00470 else 00471 { 00472 i=sizeof(keys); 00473 while(i--) details[lower_case((string)keys[i])]= descr; 00474 } 00475 00476 // Set( P_DETAILS, details ); ueberfluessig, weil Mapping 00477 return; 00478 }
| void AddId | ( | mixed | str | ) |
Definiert in Zeile 217 der Datei description.c.
Benutzt F_VALUE, P_IDS, Query() und Set().
Wird benutzt von _set_armour_type(), _set_ids(), create(), drink_this(), eat_this(), geschmack(), Identify(), liste(), MakeDrink(), set_furzer() und setup().
00218 { 00219 if (stringp(str)) str = ({ str }); 00220 if (pointerp(str)) 00221 // Doppelte eliminieren 00222 Set( P_IDS, Query(P_IDS, F_VALUE)-str+str, F_VALUE); 00223 return; 00224 }


| void AddReadDetail | ( | mixed | keys, | |
| mixed | descr | |||
| ) |
Definiert in Zeile 533 der Datei description.c.
Wird benutzt von create().
00534 { 00535 int i; 00536 mapping details; 00537 00538 details = Query(P_READ_DETAILS, F_VALUE); 00539 00540 if (!pointerp(keys)) 00541 details[(string)keys]=descr; 00542 else 00543 { 00544 i=sizeof(keys); 00545 while(i--) details[lower_case((string)keys[i])]=descr; 00546 } 00547 00548 // Set(P_READ_DETAILS,details); ueberfluessig, weil Mapping 00549 return; 00550 }

| void AddSmells | ( | mixed | keys, | |
| mixed | descr | |||
| ) |
Definiert in Zeile 611 der Datei description.c.
Wird benutzt von create().
00612 { 00613 int i; 00614 mapping details; 00615 00616 details = Query(P_SMELLS, F_VALUE); 00617 00618 if (!pointerp(keys)) 00619 details[(string)keys]=descr; 00620 else 00621 { 00622 i=sizeof(keys); 00623 while(i--) details[lower_case((string)keys[i])]=descr; 00624 } 00625 00626 // Set(P_SMELLS,details); ueberfluessig, weil Mapping 00627 return; 00628 }

| void AddSounds | ( | mixed | keys, | |
| mixed | descr | |||
| ) |
Definiert in Zeile 572 der Datei description.c.
Wird benutzt von create().
00573 { 00574 int i; 00575 mapping details; 00576 00577 details = Query(P_SOUNDS, F_VALUE); 00578 00579 if (!pointerp(keys)) 00580 details[(string)keys]=descr; 00581 else 00582 { 00583 i=sizeof(keys); 00584 while(i--) details[lower_case((string)keys[i])]=descr; 00585 } 00586 00587 // Set(P_SOUNDS,details); ueberfluessig, weil Mapping 00588 return; 00589 }

| void AddSpecialDetail | ( | mixed | keys, | |
| string | functionname | |||
| ) |
Definiert in Zeile 501 der Datei description.c.
Wird benutzt von create().
00502 { 00503 closure cl; 00504 00505 // Absichern! Sonst koennte jeder interne Funktionen aufrufen 00506 if (extern_call() && 00507 (geteuid(previous_object()) != geteuid() || process_call()) && 00508 !(object_name(previous_object()) == "/obj/doormaster" && 00509 functionname == "special_detail_doors") ) 00510 raise_error( "Illegal use of AddSpecialDetail!\n" ); 00511 00512 // Closure generieren 00513 if ( !stringp(functionname)|| 00514 !(cl = symbol_function( functionname, this_object())) ) 00515 return; 00516 00517 // Detail hinzufuegen 00518 AddDetail( keys, cl ); 00519 return; 00520 }

| varargs int CheckLightType | ( | int | lighttype, | |
| int | mode | |||
| ) |
Definiert in Zeile 910 der Datei description.c.
00911 { 00912 switch (mode) { 00913 case LT_CHECK_ALL: 00914 // Wahr, wenn alle Lichttypen die abgefragt werden 00915 // auch gesetzt sind. Es koennen aber auch mehr ge- 00916 // setzt sein 00917 return ((QueryProp(P_LIGHT_TYPE)&lighttype)==lighttype); 00918 case LT_CHECK_MATCH: 00919 // Wahr wenn die uebergebenen Lichttypen genau dem 00920 // im Objekt gesetzten Wert entsprechen 00921 return (QueryProp(P_LIGHT_TYPE)==lighttype); 00922 case LT_CHECK_NONE: 00923 // Es wird geprueft, ob keiner der angegeben Licht- 00924 // typen im Objekt gesetzt ist. 00925 return ((~QueryProp(P_LIGHT_TYPE)&lighttype)==lighttype); 00926 case LT_CHECK_ANY: 00927 default: 00928 // Wahr wenn mindestens einer der uebergebene Licht- 00929 // typen im Objekt gesetzt ist. Es muessen nicht alle 00930 // Typen, die uebergeben sind, gesetzt sein. 00931 return ((QueryProp(P_LIGHT_TYPE)&lighttype)!=0); 00932 } 00933 return(0); //non-void funktion, Zesstra (impliziten Standard ergaenzt) 00934 }
| protected void create | ( | ) |
Definiert in Zeile 38 der Datei description.c.
Benutzt EPMASTER, explore, F_MODE_AS, F_VALUE, LT_MISC, NOSETMETHOD, P_ADJECTIVES, P_CLASS, P_CLONE_TIME, P_CLONER, P_DETAILS, P_IDS, P_LIGHT, P_LIGHT_TYPE, P_LONG, P_NAME, P_NAME_ADJ, P_READ_DETAILS, P_SHORT, P_SMELLS, P_SOUNDS, SECURED, Set() und SetProp().
00039 { 00040 string poid, tpid; 00041 object tp; 00042 00043 SetProp( P_NAME, "Ding" ); 00044 SetProp( P_SHORT, "Nichts besonderes" ); 00045 SetProp( P_LONG, 0 ); 00046 00047 Set( P_ADJECTIVES, ({}) ); 00048 Set( P_NAME_ADJ, ({}) ); 00049 Set( P_IDS, ({}) ); 00050 Set( P_CLASS, ({}) ); 00051 Set( P_LIGHT, 0 ); 00052 Set( P_LIGHT_TYPE, LT_MISC); 00053 00054 Set( P_READ_DETAILS, ([]), F_VALUE); 00055 Set( P_READ_DETAILS, SECURED|NOSETMETHOD, F_MODE_AS); 00056 00057 Set( P_DETAILS, ([]), F_VALUE); 00058 Set( P_DETAILS, SECURED|NOSETMETHOD, F_MODE_AS ); 00059 00060 Set( P_SMELLS, ([]), F_VALUE); 00061 Set( P_SMELLS, SECURED|NOSETMETHOD, F_MODE_AS ); 00062 00063 Set( P_SOUNDS, ([]), F_VALUE); 00064 Set( P_SOUNDS, SECURED|NOSETMETHOD, F_MODE_AS ); 00065 00066 // Aenderungen an dieser Prop sind tabu. 00067 Set( P_CLONE_TIME, NOSETMETHOD|SECURED, F_MODE_AS ); 00068 00069 // Id des Cloners und des Besitzers kommen nach P_CLONER 00070 if (objectp( tp=this_interactive()||this_player() )) 00071 { 00072 tpid=geteuid(tp); 00073 if (!(tpid=geteuid(tp))) tpid=getuid(tp); 00074 } 00075 else 00076 tpid="UNKNOWN"; 00077 00078 if (previous_object()) 00079 { 00080 if (!(poid = geteuid(previous_object()))) 00081 poid = getuid(previous_object()); 00082 } 00083 else 00084 poid="UNKNOWN"; 00085 00086 Set( P_CLONER, (poid != tpid ? poid+":"+tpid: tpid) ); 00087 Set( P_CLONER, NOSETMETHOD|SECURED, F_MODE_AS ); 00088 00089 // Gibt es FPs ? 00090 explore = (mixed *)EPMASTER->QueryExplore(); 00091 00092 // call_other, weil Npcs und Spieler kein AddCmd besitzen 00093 this_object()->AddCmd(({"lies","lese","les"}),"lies"); 00094 return; 00095 }

| protected void create_super | ( | ) |
Definiert in Zeile 97 der Datei description.c.
Benutzt set_next_reset().
00097 { 00098 set_next_reset(-1); 00099 }

| private string depointer_adj | ( | mixed | adj, | |
| int | casus, | |||
| int | demon | |||
| ) |
Definiert in Zeile 278 der Datei description.c.
Benutzt msg().
00278 { 00279 string msg; 00280 int start; 00281 string res,a; 00282 adj = map( adj, #'DeclAdj, casus, demon ); 00283 start = 1; 00284 res = ""; 00285 foreach( a: adj ) { 00286 res += (start ? "" : ", ") + a[0..<2]; 00287 start = 0; 00288 } 00289 return res + " "; 00290 }

| public string description_id | ( | ) |
Definiert in Zeile 135 der Datei description.c.
| varargs mixed GetDetail | ( | mixed | key, | |
| mixed | race, | |||
| int | sense | |||
| ) |
Definiert in Zeile 651 der Datei description.c.
00652 { 00653 mixed detail; 00654 00655 if (stringp(race)) race = lower_case(race); 00656 00657 switch(sense) 00658 { 00659 case SENSE_SMELL: detail=Query(P_SMELLS, F_VALUE)[key]; 00660 sense=EP_SMELL; break; 00661 case SENSE_SOUND: detail=Query(P_SOUNDS, F_VALUE)[key]; 00662 sense=EP_SOUND; break; 00663 default: detail=Query(P_DETAILS, F_VALUE)[key]; 00664 sense=EP_DETAIL; break; 00665 } 00666 00667 if (!stringp(detail)) 00668 { 00669 if (closurep(detail)) 00670 detail = (string)funcall(detail,key); 00671 else if (mappingp(detail)) 00672 detail = (string)(detail[race]||detail[0]); 00673 else if (pointerp(detail)) 00674 detail = (string)(detail[random(sizeof(detail))]); 00675 } 00676 00677 // FP vergeben (so vorhanden ;-) ) 00678 if (detail) GiveEP(sense,key); 00679 00680 return detail; 00681 }
| static void GiveEP | ( | int | type, | |
| string | key | |||
| ) | [static] |
Definiert in Zeile 106 der Datei description.c.
Wird benutzt von _cl(), _normalfunction() und frage().
00107 { 00108 //Abbruch, wenn vergebendes Objekt schon zerstoert ist. ACHTUNG: Auch 00109 //diese Abfrage wuerde kein FP vergeben werden, wenn sich das Objekt im 00110 //vergebenden Kommando zerstoert, da der Driver call_other() von zerstoerten 00111 //Objekten ignoriert! 00112 if (!objectp(this_object())) return; 00113 if (this_player()) this_player()->countCmds( type, key ); 00114 00115 if (explore&&!extern_call()&& 00116 (explore[0] == type) && (member(explore[1], key) >= 0) ) 00117 EPMASTER->GiveExplorationPoint(key); 00118 return; 00119 }

| varargs int id | ( | string | str, | |
| int | lvl | |||
| ) |
Definiert in Zeile 172 der Datei description.c.
Benutzt count, ids, match_item(), P_IDS und QueryProp().
00173 { 00174 string str2, tmp; 00175 int count; 00176 mixed ids; 00177 00178 // Kein Argument? Dann passt es nicht ... 00179 if (!stringp(str)) return 0; 00180 00181 // Keine IDs? Auch nicht gut ... 00182 if (!pointerp(ids=QueryProp(P_IDS))) return 0; 00183 if (!sizeof(ids)) return 0; 00184 00185 ids += ({ ("\n" + object_name()), 00186 ("\n" + explode(object_name(),"#")[0]) }); 00187 00188 // Id passt? Alles klar :-) 00189 if (match_item( str, ids )) return 1; 00190 00191 // Die id hat eine Zahl drin. Wenn Zahl die Rohid passt, 00192 // dann gucken, ob man selber das nte Element ist. 00193 if (sscanf( str, "%s %d%s", str2, count, tmp)<2) return 0; 00194 if (count<1) return 0; 00195 if (strlen(tmp)) return 0; 00196 if (!match_item( str2, ids )) return 0; 00197 if (!environment()) return 0; 00198 return present(str2,count,environment())==this_object(); 00199 }

| int is_class_member | ( | mixed | str | ) |
Definiert in Zeile 817 der Datei description.c.
00818 { 00819 mixed cl, cl2; 00820 int i; 00821 00822 // Keine Klasse, keine Mitgliedschaft ... 00823 if (!str || (!stringp(str) && !pointerp(str)) || str=="") 00824 return 0; 00825 00826 // Es sollte schon ein Array sein 00827 if (stringp(str)) 00828 str = ({ str }); 00829 00830 // Klassen und Ids ins Array 00831 // TODO: Pruefen, ob das Einschliessen von IDs unbedingt hart-kodiert sein 00832 // TODO::muss. 00833 if (!pointerp(cl=QueryProp(P_IDS))) cl=({}); 00834 if (pointerp(cl2=QueryProp(P_CLASS))) cl+=cl2; 00835 00836 // .. und testen 00837 foreach(string cls : str) 00838 if (member(cl,cls) > -1 ) return 1; 00839 00840 return 0; 00841 }
| int lies | ( | string | str | ) |
Definiert in Zeile 684 der Datei description.c.
00685 { 00686 mixed detail; 00687 00688 _notify_fail( "Was moechtest Du lesen?\n" ); 00689 00690 // Nur mit Argument und Spieler 00691 if (!str||!this_player()) return 0; 00692 00693 // Nur wenn man etwas sieht ... 00694 if (this_player()->CannotSee()) return 1; 00695 00696 // Objekt muss angesprochen sein und P_READ_MSG definieren 00697 if (id(str)&&(detail=QueryProp(P_READ_MSG))) 00698 { 00699 this_player()->More(process_string(detail)); 00700 return 1; 00701 } 00702 00703 // Vielleicht ein Detail? 00704 if (detail=QueryProp(P_READ_DETAILS)[str]) 00705 { 00706 this_player()->More( process_string(detail) ); 00707 GiveEP(EP_RDET,str); 00708 return 1; 00709 } 00710 return 0; 00711 }
| public varargs string long | ( | int | mode | ) |
Definiert in Zeile 428 der Datei description.c.
00429 { 00430 return process_string( QueryProp(P_LONG) ); 00431 }
| int match_ids | ( | string * | list | ) |
Definiert in Zeile 202 der Datei description.c.
Benutzt P_IDS und QueryProp().
00203 { 00204 string *ids; 00205 00206 // Ungueltige Parameter? Weg hier ... 00207 if (!pointerp(list)) return 0; 00208 if (!pointerp(ids=QueryProp(P_IDS))) return 0; 00209 00210 ids += ({ ("\n" + object_name()), 00211 ("\n" + explode(object_name(),"#")[0]) }); 00212 00213 return sizeof( list & ids ); 00214 }

| int match_item | ( | string | str, | |
| string * | ids | |||
| ) |
Definiert in Zeile 141 der Datei description.c.
Benutzt i, len, P_ADJECTIVES und QueryProp().
Wird benutzt von id().
00142 { 00143 string *obj,*ads; 00144 int len, i; 00145 00146 // Parameter falsch? Passt nicht ... 00147 if(!str) return 0; 00148 if(!pointerp(ids)) return 0; 00149 if(!sizeof(ids)) return 0; 00150 00151 // Ist schon so dabei? Na Klasse :-) 00152 if(member(ids,str)>-1) return 1; 00153 00154 // Keine Adjektive vorhanden ... passt nicht. 00155 if (!(ads=QueryProp(P_ADJECTIVES))) return 0; 00156 if (!sizeof(ads)) return 0; 00157 00158 // Nur ein Wort? Dann passt es nicht 00159 obj=explode(str," "); 00160 if (!(len=sizeof(obj)-1)) return 0; 00161 00162 // Adjektive stehen am Anfang. Sobald es nicht mehr passt, 00163 // muss es das Objektiv sein. 00164 while(i<len&&member(ads,obj[i])>-1) i++; 00165 00166 return (member(ids,implode(obj[i..len]," "))>-1); 00167 }


| string MaterialList | ( | int | casus, | |
| mixed | idinf | |||
| ) |
Definiert in Zeile 903 der Datei description.c.
00904 { 00905 return (string)call_other( MATERIALDB, "ConvMaterialList", 00906 QueryProp(P_MATERIAL), casus, idinf ); 00907 }
| varargs string Name | ( | int | casus, | |
| int | demon | |||
| ) |
Definiert in Zeile 422 der Datei description.c.
00423 { 00424 return capitalize(name( casus, demon )||""); 00425 }
| varargs string name | ( | int | casus, | |
| int | demon | |||
| ) |
Definiert in Zeile 293 der Datei description.c.
00294 { 00295 mixed sh, adj; 00296 int art, plural; 00297 00298 art = QueryProp(P_ARTICLE); 00299 00300 // RAW: direkt zurueckgeben ohne Verarbeitung 00301 if (casus == RAW ) 00302 { 00303 if(pointerp(QueryProp(P_NAME))) 00304 return QueryProp(P_NAME)[WER]; 00305 return QueryProp(P_NAME); 00306 } 00307 00308 // Unsichtbar: Etwas 00309 if (QueryProp(P_INVIS)) 00310 return ({ "etwas", "von etwas", "etwas", "etwas" })[casus]; 00311 00312 // Kein Name? Schade ... 00313 if (!(sh=QueryProp(P_NAME)) || 00314 (stringp(sh) && !strlen(sh))) return 0; 00315 00316 // P_NAME pruefen. 00317 if (pointerp(sh) && sizeof(sh) != 4) 00318 raise_error(sprintf("Ungueltige Arraygroesse in P_NAME: %d\n", 00319 sizeof(sh))); 00320 00321 // Plural .. Namen verwursten 00322 if (plural = QueryProp(P_PLURAL)) 00323 { 00324 // Selber Artikel suchen ist nicht ... 00325 if (demon==2||!art) demon = 0; 00326 00327 // falls P_NAME ein Array mit Faellen enthaelt, den richtigen 00328 // extrahieren... 00329 if (pointerp(sh)) { 00330 sh = sh[casus]; 00331 } 00332 else { 00333 // sonst versuchen, zu deklinieren. 00334 int last = sh[<1]; 00335 if (casus == WEM&&last!='s'&&last!='n') sh = sh + "n"; 00336 } 00337 00338 // Sind Adjektive vorhanden? 00339 if ( pointerp(adj = QueryProp(P_NAME_ADJ)) && sizeof(adj)) 00340 adj = depointer_adj(adj,casus,demon); 00341 if (!stringp(adj)) adj = ""; 00342 00343 return sprintf("%s%s%s%s",QueryArticle(casus,demon,0),adj, 00344 (plural < 2 ? "":(plural < 8 ? 00345 ({ "zwei ", "drei ", "vier ", "fuenf ", "sechs ", 00346 "sieben " })[plural-2] : to_string(plural)+" ")),sh); 00347 } 00348 00349 // Name ist Pointer: Einfach den richtigen auswaehlen 00350 if (pointerp(sh)) 00351 sh = sh[casus]; 00352 00353 // Ansonsten doch wieder verwursten ... 00354 else if (stringp(sh)) 00355 { 00356 int last = sh[<1]; 00357 00358 switch(casus) 00359 { 00360 case WEM: 00361 case WEN: 00362 if ( art && last=='e'&&QueryProp(P_GENDER) == MALE) 00363 sh = (string)sh + "n"; 00364 break; 00365 00366 case WESSEN: 00367 if( !art ) 00368 { 00369 switch(last) 00370 { 00371 case 'x': 00372 case 's': 00373 case 'z': 00374 sh = (string)sh + "'"; 00375 break; 00376 00377 default: 00378 sh = (string)sh + "s"; 00379 } 00380 } 00381 else 00382 { 00383 switch(last) 00384 { 00385 default: 00386 if (QueryProp(P_GENDER)!=FEMALE) 00387 sh=(string)sh+"s"; 00388 break; 00389 case 'e': 00390 if (QueryProp(P_GENDER)==MALE) 00391 sh=(string)sh+"n"; 00392 case 'x': 00393 case 's': 00394 case 'z': 00395 break; 00396 } /* switch (last) */ 00397 } /* if( !art ) else */ 00398 } /* switch( casus ) */ 00399 } /* pointerp(sh) */ 00400 00401 // RAW? Dann mal zurueck 00402 if (demon == RAW) return (string)sh; 00403 00404 // Selber Artikel suchen ... 00405 if (demon==2) 00406 { 00407 if (art) 00408 demon = SuggestArticle(); 00409 else 00410 demon=0; // Kein Artikel: egal (SuggestArticle ist zeitaufwendig) 00411 } 00412 00413 if (pointerp(adj = QueryProp(P_NAME_ADJ)) && sizeof(adj)) 00414 adj = depointer_adj(adj,casus,demon); 00415 00416 if (!stringp(adj)) adj = ""; 00417 00418 return QueryArticle( casus, demon )+adj+sh; 00419 }
| int QueryMaterial | ( | string | mat | ) |
Definiert in Zeile 885 der Datei description.c.
00886 { 00887 mapping mats; 00888 00889 if ( !mappingp(mats = QueryProp(P_MATERIAL)) ) 00890 return 0; 00891 00892 return mats[mat]; 00893 }
| int QueryMaterialGroup | ( | string | matgroup | ) |
Definiert in Zeile 896 der Datei description.c.
00897 { 00898 return (int)call_other( MATERIALDB, "MaterialGroup", 00899 QueryProp(P_MATERIAL), matgroup ); 00900 }
| void read | ( | string | str | ) |
Definiert in Zeile 714 der Datei description.c.
00714 { lies(str); }
| void RemoveAdjective | ( | mixed | str | ) |
Definiert in Zeile 254 der Datei description.c.
Benutzt F_VALUE, P_ADJECTIVES, Query() und Set().
00255 { 00256 if (stringp(str)) str = ({ str }); 00257 if (pointerp(str)) 00258 Set( P_ADJECTIVES, Query(P_ADJECTIVES, F_VALUE) - str, F_VALUE ); 00259 return; 00260 }

| void RemoveClass | ( | mixed | str | ) |
Definiert in Zeile 799 der Datei description.c.
00800 { 00801 if (!stringp(str) && !pointerp(str)) 00802 return; 00803 if (stringp(str)) 00804 str = ({ str }); 00805 00806 // Aliase aufloesen und implizite Klassen addieren. 00807 str = (string*)CLASSDB->AddImplicitClasses(str); 00808 00809 // Und alle - inklusive impliziter Klassen - entfernen 00810 // TODO: Pruefen, ob dies die richtige Entscheidung ist. 00811 Set( P_CLASS, Query(P_CLASS, F_VALUE)-str, F_VALUE); 00812 00813 return; 00814 }
| varargs void RemoveDetail | ( | mixed | keys | ) |
Definiert in Zeile 481 der Datei description.c.
00482 { 00483 int i; 00484 mapping details; 00485 00486 details = Query(P_DETAILS), F_VALUE; 00487 00488 // Alle loeschen geht direkt ... 00489 if (!keys ) 00490 Set(P_DETAILS, ([]), F_VALUE); 00491 else if (!pointerp(keys)) 00492 details-=([(string)keys]); 00493 else 00494 details-=mkmapping(keys); 00495 00496 // Set( P_DETAILS, details ); ueberfluessig, weil Mapping 00497 return; 00498 }
| void RemoveId | ( | mixed | str | ) |
Definiert in Zeile 227 der Datei description.c.
Benutzt F_VALUE, P_IDS, Query() und Set().
Wird benutzt von MakeDrink().
00228 { 00229 if (stringp(str)) str = ({ str }); 00230 if (pointerp(str)) 00231 Set(P_IDS,Query(P_IDS, F_VALUE)-str, F_VALUE); 00232 return; 00233 }


| varargs void RemoveReadDetail | ( | mixed | keys | ) |
Definiert in Zeile 553 der Datei description.c.
00554 { 00555 int i; 00556 mapping details; 00557 00558 details = Query(P_READ_DETAILS, F_VALUE); 00559 00560 if (!keys) 00561 Set(P_READ_DETAILS, ([]), F_VALUE); 00562 else if (!pointerp(keys)) 00563 details-=([(string)keys]); 00564 else 00565 details-= mkmapping(keys); 00566 00567 // Set(P_READ_DETAILS,details); ueberfluessig, weil Mapping 00568 return; 00569 }
| varargs void RemoveSmells | ( | mixed | keys | ) |
Definiert in Zeile 631 der Datei description.c.
00632 { 00633 int i; 00634 mapping details; 00635 00636 details = Query(P_SMELLS, F_VALUE); 00637 00638 if (!keys) 00639 Set(P_SMELLS, ([]), F_VALUE); 00640 else if (!pointerp(keys)) 00641 details-=([(string)keys]); 00642 else 00643 details-= mkmapping(keys); 00644 00645 // Set(P_SMELLS,details); ueberfluessig, weil Mapping 00646 return; 00647 }
| varargs void RemoveSounds | ( | mixed | keys | ) |
Definiert in Zeile 592 der Datei description.c.
00593 { 00594 int i; 00595 mapping details; 00596 00597 details = Query(P_SOUNDS), F_VALUE; 00598 00599 if (!keys) 00600 Set(P_SOUNDS, ([]), F_VALUE); 00601 else if (!pointerp(keys)) 00602 details-=([(string)keys]); 00603 else 00604 details-= mkmapping(keys); 00605 00606 // Set(P_SOUNDS,details); ueberfluessig, weil Mapping 00607 return; 00608 }
| void RemoveSpecialDetail | ( | mixed | keys | ) |
Definiert in Zeile 523 der Datei description.c.
00524 { 00525 // RemoveSpecialDetail(0) wuerde sonst ALLE Details (auch die 00526 // 'normalen') loeschen 00527 if (pointerp(keys)||stringp(keys)) 00528 RemoveDetail(keys); 00529 return; 00530 }
| public mixed short | ( | ) |
Definiert in Zeile 434 der Datei description.c.
00435 { 00436 string sh; 00437 00438 // Unsichtbar? Dann gibts nichts zu sehen ... 00439 if (QueryProp(P_INVIS)||!(sh=QueryProp(P_SHORT))) 00440 return 0; 00441 00442 return process_string(sh)+".\n"; 00443 }
| private nosave mixed* explore |
Definiert in Zeile 27 der Datei description.c.
Wird benutzt von __reload_explore(), create() und GiveEP().
1.6.3