MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame^] | 1 | // tragbare Seher-FAQ, gibt es im Seherladen zu kaufen bzw. automatisch zur Seherwerdung |
| 2 | // Rikus@mg.mud.de |
| 3 | |
| 4 | inherit "std/thing"; |
| 5 | |
| 6 | #include <properties.h> |
| 7 | #include <wizlevels.h> |
| 8 | #include "../haus.h" |
| 9 | |
| 10 | #define FAQ(f) (SPECIALPATH+"faq/"+(f)) |
| 11 | |
| 12 | static string *seite; |
| 13 | |
| 14 | mapping synonym = ([]); |
| 15 | |
| 16 | create() |
| 17 | { |
| 18 | // if (!clonep(this_object())) return; |
| 19 | ::create(); |
| 20 | SetProp(P_SHORT,"Die SeherFAQ"); |
| 21 | SetProp(P_NAME,"SeherFAQ"); |
| 22 | SetProp(P_GENDER,FEMALE); |
| 23 | SetProp(P_LONG,"Dies ist die SeherFAQ. Wenn Du weitere Fragen oder "+ |
| 24 | "Anregungen zu dieser FAQ\nhast, sei so nett und schicke Sting "+ |
| 25 | "einen kurzen Brief. Zum Inhalt der FAQ\nkommst Du mit "+ |
| 26 | ">lies inhalt<\n"); |
| 27 | SetProp(P_WEIGHT,100); |
| 28 | SetProp(P_VALUE,1000); |
| 29 | AddId(({"faq","seherfaq"})); |
| 30 | AddCmd("lies","lesen"); |
| 31 | restore_object(FAQ("faq")); |
| 32 | seite = get_dir(FAQ("*"))-({".","..","faq.o"}); |
| 33 | } |
| 34 | |
| 35 | init() |
| 36 | { |
| 37 | object o; |
| 38 | ::init(); |
| 39 | if ((o=environment()) && query_once_interactive(o) && !IS_SEER(o)) |
| 40 | call_out("wech",0); |
| 41 | } |
| 42 | |
| 43 | wech() |
| 44 | { |
| 45 | write("Die Seher-FAQ lacht Dich aus und loest sich in Wohlgefallen auf.\n"); |
| 46 | remove(); |
| 47 | } |
| 48 | |
| 49 | int lesen(string str) |
| 50 | { |
| 51 | if (!str || str == "") { |
| 52 | notify_fail("Was willst Du denn lesen?\n"); |
| 53 | return 0; |
| 54 | } |
| 55 | if (environment()!=this_player()) |
| 56 | { |
| 57 | notify_fail("Du musst die FAQ schon erst nehmen!\n"); |
| 58 | return 0; |
| 59 | } |
| 60 | str = lower_case(this_player()->_unparsed_args()); |
| 61 | if (member(seite,str)<0) { |
| 62 | if (!member(synonym,str)) { |
| 63 | notify_fail("Diese Seite gibt es nicht...\n"); |
| 64 | return 0; |
| 65 | } |
| 66 | else |
| 67 | str = synonym[str]; |
| 68 | } |
| 69 | this_player()->More(FAQ(str),1); |
| 70 | return 1; |
| 71 | } |
| 72 | |
| 73 | string _query_extralook() |
| 74 | { |
| 75 | object o; |
| 76 | if ((o=environment()) && (o->QueryProp(P_GENDER)==FEMALE)) |
| 77 | return "Mit ihrer Seher-FAQ outet sie sich als Wurstseherin.\n"; |
| 78 | return "Mit seiner Seher-FAQ outet er sich als Wurstseher.\n"; |
| 79 | } |