MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame^] | 1 | // MorgenGrauen MUDlib |
| 2 | // |
| 3 | // zeitungsautomat.c -- Zeitungsautomat in der Abenteurergilde |
| 4 | // |
| 5 | // $Id: zeitungsautomat.c 6437 2007-08-18 22:58:58Z Zesstra $ |
| 6 | // |
| 7 | |
| 8 | inherit "/std/thing"; |
| 9 | |
| 10 | #include <properties.h> |
| 11 | #include <language.h> |
| 12 | #include <moving.h> |
| 13 | #include <defines.h> |
| 14 | #include <www.h> |
| 15 | |
| 16 | #define ZEITUNG "/obj/mpa" |
| 17 | |
| 18 | void create() |
| 19 | { |
| 20 | if (!clonep(this_object())) return; |
| 21 | ::create(); |
| 22 | SetProp(P_SHORT,"Eine Zeitung"); |
| 23 | SetProp(P_LONG, |
| 24 | "Hier stehen immer die neuesten Nachrichten und Geruechte drin.\n"); |
| 25 | SetProp(P_NAME,"Zeitung"); |
| 26 | AddId(({"zeitung","mpa","servicepaket"})); |
| 27 | SetProp(P_GENDER,FEMALE); |
| 28 | SetProp(P_NOGET,1); |
| 29 | SetProp(P_PICK_MSG, NO_PNG_MSG); |
| 30 | SetProp(P_ARTICLE,1); |
| 31 | SetProp(P_WWWINFO, "Man kann die MPA auch <A HREF=\"http://" |
| 32 | +SERVER+MUDWWW + "?" +REQ + "=" + R_NEWS + "\">lesen</A>"); |
| 33 | } |
| 34 | |
| 35 | int get(object targ) { |
| 36 | int res; |
| 37 | |
| 38 | if (!objectp(targ) || !interactive(targ)) |
| 39 | return ME_CANT_BE_TAKEN; |
| 40 | |
| 41 | if (present_clone(ZEITUNG, targ)) { |
| 42 | tell_object(targ, "Du hast doch bereits eine Zeitung.\n"); |
| 43 | return ME_CANT_BE_TAKEN; |
| 44 | } |
| 45 | |
| 46 | object zeitung=clone_object("/obj/mpa"); |
| 47 | if ((res=zeitung->move(targ,M_GET)) == MOVE_OK) { |
| 48 | tell_object(targ, "Du nimmst die Zeitung. Sofort erscheint auf " |
| 49 | "unerklaerliche Weise eine neue.\n"); |
| 50 | tell_room(environment(targ), break_string( |
| 51 | targ->name(WER) + " nimmt die Zeitung. Sofort erscheint auf " |
| 52 | "unerklaerliche Weise eine neue.\n",78),({targ})); |
| 53 | } |
| 54 | else { |
| 55 | tell_object(targ, "Du kannst die Zeitung leider nicht mehr tragen.\n"); |
| 56 | zeitung->remove(1); |
| 57 | } |
| 58 | |
| 59 | return res; |
| 60 | } |
| 61 | |
| 62 | varargs int move(object target, mixed method) |
| 63 | { |
| 64 | if (method&M_GET && living(target)) |
| 65 | return get(target); |
| 66 | |
| 67 | return ::move(target,method); |
| 68 | } |
| 69 | |