blob: 4225d882c332085a40a50f807a89ec2ddd8da497 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001inherit "/std/thing";
2#include <properties.h>
3#include <new_skills.h>
4#include <sensitive.h>
5
6private action_puste(string str);
7private int counter;
8
9void create() {
10 if (!clonep(this_object())) return;
11 ::create();
12 counter = 2+random(4);
13
14 SetProp(P_NAME, "Pusteblume");
15 SetProp(P_SHORT, "Eine kleine Pustblume");
16 SetProp(P_LONG, break_string(
17 "Eine abgebluehte Pflanze, die jetzt wie ein kleiner, weisser Ball "
18 "aussieht. Die fiedrigen Samen fliegen bestimmt prima.", 78));
19 AddDetail("samen", "Er sieht sehr fein und leicht aus.\n");
20 SetProp(P_GENDER,FEMALE);
21 SetProp(P_MATERIAL, MAT_MISC_PLANT);
22 SetProp(P_NOBUY, 1);
23 SetProp(P_VALUE, random(10));
24
25 SetProp(P_INFO, "Starker Wind taete ihr nicht gut.\n");
26
27 AddId(({"blume", "pusteblume", "loewenzahn"}));
28 SetProp(P_COMBATCMDS,(["puste loewenzahn":
29 ([C_HEAL: 5])]));
30
31 SetProp(P_SENSITIVE,({({SENSITIVE_ATTACK, DT_AIR, 20}),
32 ({SENSITIVE_INVENTORY, DT_AIR, 20})}));
33
34 AddCmd("puste&@ID", #'action_puste, "Puste wen oder was (an)?");
35}
36
37private action_puste(string str) {
38 if(environment()!=this_player()) {
39 notify_fail("Dazu solltest du "+name(WEN,1)+" haben.\n");
40 return 0;
41 }
42 if (this_player()->QueryProp(P_ATTACK_BUSY)) {
43 write("Du hast dafuer momentan einfach nicht mehr die Puste.\n");
44 return 1;
45 }
46 this_player()->SetProp(P_ATTACK_BUSY, 1);
47
48 if(counter<0) {
49 write(break_string("Du pustest sinnlos auf "+name(WEN, 2)+".", 78));
50 say(break_string(this_player()->Name(WER)+
51 " pustet wie daemlich gegen "+name(WEN, 0)+".", 78));
52 return 1;
53 } else {
54 write(break_string(
55 "Du pustest "+name(WEN, 2)+" vorsichtig an, einige Samen "
56 "loesen sich und fliegen taumelnd in deinem Atem davon."+
57 (counter<0?" Es bleibt nur noch ein nutzloser Strunk.":""), 78));
58 say(break_string(
59 this_player()->Name(WER)+" pustet sachte gegen "+name(WEN, 0)+" und "
60 "du schaust verzueckt den davonfliegenden Samen nach.", 78));
61 }
62
63 object who = this_player()->QueryEnemy();
64
65 if(objectp(who)) {
66 if(!interactive(this_player())) {
67 who->ModifySkillAttribute(SA_SPEED, 80+random(10), 6);
68 this_player()->heal_self(5);
69 } else
70 who->ModifySkillAttribute(SA_SPEED, 90+random(10), 4);
71 }
72
73 counter--;
74 if(counter<0) {
75 call_out(#'remove, 10+random(60));
76 AddId("strunk");
77 SetProp(P_NAME, "Strunk");
78 SetProp(P_SHORT, "Der Strunk einer Pusteblume");
79 SetProp(P_LONG, "Ein haesslicher, leerer Strunk.\n");
80 SetProp(P_GENDER, MALE);
81 }
82 return 1;
83}
84
85private void notify_env_destroy() {
86 object ob = environment();
87 while(ob && !living(ob)) ob = environment(ob);
88 if(objectp(ob))
89 tell_object(ob, "Der Wind zerblaest "+name(WEN, 2)+".\n");
90 remove(1);
91}
92
93varargs void trigger_sensitive_attack() {
94 notify_env_destroy();
95}
96
97varargs void trigger_sensitive_inv() {
98 notify_env_destroy();
99}
100
101varargs int remove(int silent) {
102 if(!silent && living(environment()))
103 tell_object(environment(), "Du wirfst "+name(WEN, 2)+" weg.\n");
104 return ::remove(silent);
105}