blob: c7c8292d3e65483b4da04a5ad82c78686ba81e5a [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001// MorgenGrauen MUDlib
2//
3// death_room_vc.c -- Das Standardobjekt fuer den VC-Todesraum
4//
5// $Id: death_room_vc.c 8988 2014-12-31 13:10:19Z Zesstra $
6
7
8#pragma strict_types
9
10#include <defines.h>
11#include <properties.h>
12#include <moving.h>
13#include <language.h>
14#include <wizlevels.h>
15#include <daemon.h>
16#include <new_skills.h>
17
18inherit "/std/room";
19
20public int no_attack();
21public int no_poison(int val);
22
23public void create()
24{
25 if (IS_BLUE(this_object())) return;
26 ::create();
27
28 SetProp( P_GENDER, MALE );
29 SetProp( P_ARTICLE, 0 );
30 SetProp( P_LIGHT,1 );
31 SetProp( P_NO_TPORT, NO_TPORT_OUT );
32 SetProp( P_LOG_FILE, "TOD/Todesraum" );
33 SetProp( P_INT_SHORT, "Arbeitszimmer des Todes" );
34 SetProp( P_INT_LONG, break_string(
35 "Ein dunkler Raum, erleuchtet von dunklem Licht, das sich der "
36 "Dunkelheit nicht so sehr zu widersetzen scheint, indem es "
37 "leuchtet, als dass es der dunkelste Punkt in einer weniger "
38 "dunklen Umgebung ist. Im seltsamen Licht erkennst Du einen "+
39 "zentral aufgestellten Schreibtisch, der mit Diagrammen und "
40 "Buechern bedeckt ist. Die Waende verschwinden hinter Regalen, "
41 "die gefuellt sind mit in Leder gebundenen, dunklen Waelzern, "
42 "von denen geheimnisvolle Runen leuchten.\nTod.", 78, 0, 1 ) );
43 previous_object()->CustomizeObject();
44 call_other("/room/death/death_room","???");
45}
46
47void test_remove()
48{
49 if (!sizeof(all_inventory(this_object())&users()))
50 if (!this_object()->remove()) destruct(this_object());
51}
52
53public void reset()
54{
55 ::reset();
56 test_remove();
57 return;
58}
59
Arathorn306aa032018-08-29 22:18:28 +020060public varargs void exit(object liv, object dest)
MG Mud User88f12472016-06-24 23:31:02 +020061{
62 call_out("test_remove",2);
63 return;
64}
65
66
67static void deep_destruct( object ob )
68{
Zesstra4bbc6c62019-01-07 21:06:49 +010069 if ( objectp(ob) && environment(ob) == this_object() )
70 filter(deep_inventory(ob) + ({ ob }), #'destruct);
MG Mud User88f12472016-06-24 23:31:02 +020071}
72
Arathorn306aa032018-08-29 22:18:28 +020073public varargs void init(object oldenv)
MG Mud User88f12472016-06-24 23:31:02 +020074{
75 string prayroom;
76 int res;
77
Arathorn306aa032018-08-29 22:18:28 +020078 ::init(oldenv);
MG Mud User88f12472016-06-24 23:31:02 +020079 if ( !query_once_interactive(this_player()) ){
80 call_out( "deep_destruct", 0, this_player() );
81 return;
82 }
83
84 if ( !(prayroom = (string) this_player()->QueryPrayRoom()) )
85 prayroom = "/room/pray_room";
86
87 if ( !this_player()->QueryProp(P_GHOST) )
88 {
89 if ( IS_WIZARD(this_player()) &&
90 this_player()->QueryProp(P_WANTS_TO_LEARN) )
91 {
92 if ( !this_player()->QueryProp(P_INVIS) )
93 tell_room( this_object(),
94 "Der Tod sagt: WAS WILLST DU HIER, "+
95 upperstring((string) this_player()->name())+"?\n"+
96 "Der Tod sagt: DU BIST UNSTERBLICH, DU HAST HIER "
97 "NICHTS ZU SUCHEN!\n\n" );
98 }
99 else
100 {
101 write("Der Tod sagt: WAS TUST DU HIER? DEINE ZEIT IST NOCH "
102 "NICHT REIF!\n\n");
103
104 if ( catch(res = (int) this_player()->move( prayroom,M_GO|M_SILENT|M_NOCHECK ))
105 || res < 1 && environment(this_player()) == this_object() )
106 this_player()->move( "/room/pray_room", M_GO|M_SILENT|M_NOCHECK );
107 }
108 return;
109 }
110
111 if ( !IS_DEPUTY(this_player()) ){
112 add_action( "filter_ldfied", "", 1 );
113 this_player()->Set( P_TMP_MOVE_HOOK,
114 ({ time()+31536000,
115 find_object("/room/death/death_room"),
116 "hier_geblieben" }) );
117 }
118
119 this_player()->Set( P_NO_ATTACK, #'no_attack, F_QUERY_METHOD );
120 this_player()->Set( P_POISON, #'no_poison, F_SET_METHOD );
121
122 "/room/death/death_room"->add_player(this_player());
123}
124
125// public, da command_me() sonst buggt (Wurzels Speedy o.ae.)
126public int filter_ldfied( string str )
127{
128 // Description: Filter out relevant commands.
129 string verb;
130
131 verb=query_verb();
132
133 if ( (verb == "schlafe" || verb == "schlaf") && str == "ein" ){
134 write("DU KANNST DEM TOD NICHT ENTRINNEN!\n");
135 return 0;
136 }
137
138 if ( verb == "typo" || verb == "fehler" || verb == "bug" || verb == "idee" )
139 return 0;
140
141 write( "Dein Koerper gehorcht Dir nicht !\n" );
142 return 1;
143}
144
145public int no_attack()
146{
147 int i;
148
149 // Spieler haengt noch in der Todessequenz
150 if( present(previous_object()) )
151 return 1;
152 else
153 previous_object()->Set( P_NO_ATTACK, 0, F_QUERY_METHOD );
154
155 return 0;
156}
157
158public int no_poison(int val)
159{
160 if ( val != 0 )
161 {
162 catch( raise_error("Poisoning dead players is illegal. Calling object "
163 "was "+object_name(previous_object(1))+"\n");publish );
164 }
165 return 0;
166}
167