blob: 664fb9b90e199924cc97fdec4ae05988b85e5bf7 [file] [log] [blame]
Bugfixb1d9b4d2021-09-14 20:07:04 +02001#pragma strict_types, save_types, pedantic, range_check
2#pragma no_clone
3
Bugfixb1d9b4d2021-09-14 20:07:04 +02004#include <thing/language.h>
Zesstra77b32572022-09-21 23:27:23 +02005#include <living/comm.h>
Bugfixb1d9b4d2021-09-14 20:07:04 +02006
7// Per Default nur an alle Items im Inventar weiterleiten.
Zesstra77b32572022-09-21 23:27:23 +02008public varargs void ReceiveMsg(string msg, int msg_type, string msg_action,
Bugfixb1d9b4d2021-09-14 20:07:04 +02009 string msg_prefix, object origin)
10{
Zesstra77b32572022-09-21 23:27:23 +020011 all_inventory()->ReceiveMsg(msg, msg_type, msg_action,
12 msg_prefix, origin || previous_object());
Bugfixb1d9b4d2021-09-14 20:07:04 +020013}
14
15// Wrapper fuer ReceiveMsg()
16
Zesstra77b32572022-09-21 23:27:23 +020017public void ReceiveMultiSense(struct wave_s *msgs, string action=0,
18 int commontypes=0)
Bugfixb1d9b4d2021-09-14 20:07:04 +020019{
Zesstra77b32572022-09-21 23:27:23 +020020 all_inventory()->ReceiveMultisense(msgs, action, commontypes);
Bugfixb1d9b4d2021-09-14 20:07:04 +020021}
22
Zesstra77b32572022-09-21 23:27:23 +020023public void ReceiveSay(string msg,
24 string prefix = ({string})previous_object().Name(WER, 1) + " sagt: ",
25 struct wave_s *alt =
26 ({(<wave_s>
27 msg: "@WER1 bewegt die Lippen, Du hoerst jedoch nichts.",
28 type: MT_LOOK)})
29 )
Bugfixb1d9b4d2021-09-14 20:07:04 +020030{
Zesstra77b32572022-09-21 23:27:23 +020031 // Nachricht in struct konvertieren, ans Anfang vom Array stellen
32 alt = ({(<wave_s> msg: msg, prefix: prefix, type: MT_LISTEN)}) + alt;
33 // Rest macht ReceiveMultiSense()
34 ReceiveMultiSense(alt, MA_SAY, MSG_BS_LEAVE_LFS);
Bugfixb1d9b4d2021-09-14 20:07:04 +020035}
Zesstra77b32572022-09-21 23:27:23 +020036