MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame^] | 1 | /* |
| 2 | Beispiel fuer eine Banane, die in einem Haps weg ist, |
| 3 | aber eine Schale hat, die uebrig bleibt und genau wie die |
| 4 | komplette Banane vergammelt und vergeht. |
| 5 | */ |
| 6 | |
| 7 | #include <food.h> |
| 8 | |
| 9 | inherit "/std/food"; |
| 10 | |
| 11 | string _query_long() { |
| 12 | string m = "Du haeltst "; |
| 13 | if (is_not_empty()) { |
| 14 | m += "eine Banane in der Hand."; |
| 15 | if (!is_bad()) |
| 16 | m += " Sie ist schoen gelb und ohne braune Flecken."; |
| 17 | else |
| 18 | m += " Sie ist total braun und schon ganz matschig."; |
| 19 | |
| 20 | } else { |
| 21 | m += "eine Bananenschale in der Hand."; |
| 22 | if (is_bad()) |
| 23 | m += " Sie ist ganz verschimmelt."; |
| 24 | } |
| 25 | return break_string(m); |
| 26 | } |
| 27 | |
| 28 | void create() { |
| 29 | if (!clonep(this_object())) { |
| 30 | set_next_reset(-1); |
| 31 | return; |
| 32 | } |
| 33 | ::create(); |
| 34 | |
| 35 | SetProp(P_SHORT,"Eine schoene reife Banane"); |
| 36 | SetProp(P_NAME, "Banane"); |
| 37 | SetProp(P_GENDER,FEMALE); |
| 38 | SetProp(P_VALUE,20); // ohne Schale |
| 39 | SetProp(P_WEIGHT,50); // ohne Schale |
| 40 | // SetProp(P_POTION,1); // ist eh Standard |
| 41 | SetProp(P_CONSUME_MSG, |
| 42 | "@WER2 schaelt eine Banane und isst sie genuesslich."); |
| 43 | SetProp(P_EATER_MSG, |
| 44 | "Du schaelst eine Banane und isst sie genuesslich."); |
| 45 | SetProp(P_BAD_MSG, |
| 46 | "Die Banane wird ganz matschig und schlecht."); |
| 47 | SetProp(P_REMOVE_MSG, |
| 48 | "Die Banane ist so verschimmelt, dass Du sie entsorgst."); |
| 49 | SetProp(P_EMPTY_MSG, |
| 50 | "Aber das ist doch nur eine BananenSCHALE, die willst Du nicht essen!"); |
| 51 | |
| 52 | SetProp(P_MATERIAL,([MAT_MISC_PLANT:100])); |
| 53 | |
| 54 | SetProp(P_EMPTY_PROPS, ([ |
| 55 | P_SHORT:"Eine Bananenschale", |
| 56 | P_NAME:"Bananenschale", |
| 57 | P_EMPTY_IDS:({"schale","bananenschale","banane"}), |
| 58 | P_VALUE:5, // Wert der Bananenschale |
| 59 | P_WEIGHT:5 // Gewicht der Bananenschale |
| 60 | ])); |
| 61 | |
| 62 | //SetProp(P_RESET_LIFETIME,1); // ist eh Standard |
| 63 | SetProp(P_DESTROY_BAD,300); // verdorbene Bananen verschwinden nach 5 Min |
| 64 | |
| 65 | SetProp(P_FOOD,50); // Fuellgrad der Banane |
| 66 | SetProp(P_HP,5); |
| 67 | SetProp(P_SP,5); |
| 68 | |
| 69 | AddId(({"banane"})); |
| 70 | |
| 71 | } |
| 72 | |
| 73 | // Der Behaelter vergammelt auch |
| 74 | public int make_destroy() { |
| 75 | if (!::make_destroy()) { |
| 76 | return remove(1); |
| 77 | } |
| 78 | return 1; |
| 79 | } |
| 80 | |
| 81 | public int make_empty() { |
| 82 | SetProp(P_BAD_MSG, |
| 83 | "Die Bananenschale wird ganz schimmlig."); |
| 84 | SetProp(P_REMOVE_MSG, |
| 85 | "Die Bananenschale zersetzt sich vollstaendig."); |
| 86 | return ::make_empty(); |
| 87 | } |
| 88 | |
| 89 | // parent methode immer aufrufen und pruefen!! |
| 90 | void make_bad() { |
| 91 | if (!::make_bad()) { |
| 92 | if (is_not_empty()) { |
| 93 | SetProp(P_SHORT,"Eine matschige Banane"); |
| 94 | AddAdjective(({"matschige","matschigen"})); |
| 95 | SetProp(P_EATER_MSG,"Du lutschst die matschige Banane aus ihrer" |
| 96 | "Schale. Baeh, die schmeckt ueberhaupt nicht mehr."); |
| 97 | SetProp(P_CONSUME_MSG, |
| 98 | "@WER2 lutscht eine matschige Banane aus ihrer Schale."); |
| 99 | // Die Schale ist dann natuerlich auch vergammelt |
| 100 | SetProp(P_EMPTY_PROPS, ([ |
| 101 | P_SHORT:"Eine verschimmelte Bananenschale", |
| 102 | P_NAME:"Bananenschale", |
| 103 | P_EMPTY_IDS:({"schale","bananenschale","banane"}), |
| 104 | P_EMPTY_ADJ:({"verschimmelte","verschimmelten"}), |
| 105 | P_VALUE:5, // Wert der Bananenschale |
| 106 | P_WEIGHT:5 // Gewicht der Bananenschale |
| 107 | ])); |
| 108 | } else { |
| 109 | message(P_BAD_MSG); |
| 110 | SetProp(P_SHORT,"Eine verschimmelte Bananenschale"); |
| 111 | AddAdjective(({"verschimmelte","verschimmelten"})); |
| 112 | } |
| 113 | } |
| 114 | } |