Bugfix | b1d9b4d | 2021-09-14 20:07:04 +0200 | [diff] [blame] | 1 | #pragma strict_types, save_types, pedantic, range_check |
| 2 | #pragma no_clone |
| 3 | |
Bugfix | b1d9b4d | 2021-09-14 20:07:04 +0200 | [diff] [blame] | 4 | #include <thing/language.h> |
Zesstra | 77b3257 | 2022-09-21 23:27:23 +0200 | [diff] [blame^] | 5 | #include <living/comm.h> |
Bugfix | b1d9b4d | 2021-09-14 20:07:04 +0200 | [diff] [blame] | 6 | |
| 7 | // Per Default nur an alle Items im Inventar weiterleiten. |
Zesstra | 77b3257 | 2022-09-21 23:27:23 +0200 | [diff] [blame^] | 8 | public varargs void ReceiveMsg(string msg, int msg_type, string msg_action, |
Bugfix | b1d9b4d | 2021-09-14 20:07:04 +0200 | [diff] [blame] | 9 | string msg_prefix, object origin) |
| 10 | { |
Zesstra | 77b3257 | 2022-09-21 23:27:23 +0200 | [diff] [blame^] | 11 | all_inventory()->ReceiveMsg(msg, msg_type, msg_action, |
| 12 | msg_prefix, origin || previous_object()); |
Bugfix | b1d9b4d | 2021-09-14 20:07:04 +0200 | [diff] [blame] | 13 | } |
| 14 | |
| 15 | // Wrapper fuer ReceiveMsg() |
| 16 | |
Zesstra | 77b3257 | 2022-09-21 23:27:23 +0200 | [diff] [blame^] | 17 | public void ReceiveMultiSense(struct wave_s *msgs, string action=0, |
| 18 | int commontypes=0) |
Bugfix | b1d9b4d | 2021-09-14 20:07:04 +0200 | [diff] [blame] | 19 | { |
Zesstra | 77b3257 | 2022-09-21 23:27:23 +0200 | [diff] [blame^] | 20 | all_inventory()->ReceiveMultisense(msgs, action, commontypes); |
Bugfix | b1d9b4d | 2021-09-14 20:07:04 +0200 | [diff] [blame] | 21 | } |
| 22 | |
Zesstra | 77b3257 | 2022-09-21 23:27:23 +0200 | [diff] [blame^] | 23 | public 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 | ) |
Bugfix | b1d9b4d | 2021-09-14 20:07:04 +0200 | [diff] [blame] | 30 | { |
Zesstra | 77b3257 | 2022-09-21 23:27:23 +0200 | [diff] [blame^] | 31 | // 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); |
Bugfix | b1d9b4d | 2021-09-14 20:07:04 +0200 | [diff] [blame] | 35 | } |
Zesstra | 77b3257 | 2022-09-21 23:27:23 +0200 | [diff] [blame^] | 36 | |