blob: b46a59cd4c29aa68ac369d28e224a0b0a714f2c8 [file] [log] [blame]
Christian Georg Beckera38b32f2017-03-07 23:12:05 +01001#pragma strong_types, save_types, rtt_checks, pedantic
2inherit "std/npc";
3
4#include <properties.h>
5
6protected void create() {
7 if (!clonep(this_object())) return;
8 ::create();
9
10 SetProp(P_SHORT, "Ein Beobachter");
11 SetProp(P_LONG, break_string(
12 "Der Beobachter hoert und sieht zu.", 78));
13 SetProp(P_NAME, "Beobachter");
14 SetProp(P_GENDER, MALE);
15 AddId("beobachter");
16
17 SetProp(P_RACE, "Beobachter");
18 SetProp(P_XP, 0);
19 SetProp(P_BODY, 50);
20}
21
22private string buf = "";
23
24void empty_buffer() {
25 tell_room(environment(),
26 "\nDer Zuhoerer murmelt: 'Folgendes habe ich gesehen'\n***\n"+
27 buf+
28 "***\n",
29 ({this_object()}));
30 buf = "";
31}
32
33public varargs int ReceiveMsg(string msg, int msg_typ, string msg_action,
34 string msg_prefix, mixed origin) {
35 if (msg_typ & MSG_DONT_WRAP)
36 buf+=sprintf("%s%s", msg_prefix||"", msg);
37 else
38 buf+=sprintf("%s%s\n", msg_prefix||"", msg);
39 if(find_call_out("empty_buffer")<0)
40 call_out("empty_buffer", 1);
41}
42
43void catch_tell(string msg) {
44 buf+=msg;
45 if(find_call_out("empty_buffer")<0)
46 call_out("empty_buffer", 1);
47}