blob: 90c3aef750fc3ff3f086e1c5276594ca347d15eb [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001// MorgenGrauen MUDlib
2//
3// living/description.c -- description for living objects
4//
5// $Id: description.c 7340 2009-11-19 21:44:51Z Zesstra $
6#pragma strong_types
7#pragma save_types
8#pragma range_check
9#pragma no_clone
MG Mud User88f12472016-06-24 23:31:02 +020010
11#define NEED_PROTOTYPES
12#include <living/description.h>
13#include <living/skills.h>
14#undef NEED_PROTOTYPES
15
16#include <player/viewcmd.h>
17#include <new_skills.h>
18#include <container.h>
19#include <player/base.h>
20#include <wizlevels.h>
21
22inherit "/std/container/light";
23
24protected void create() {
25 ::create();
26 SetProp(P_LIGHT_TRANSPARENCY, 0);
27}
28
29static int _query_player_light()
30{
31 if (environment())
32 return environment()->QueryProp(P_INT_LIGHT) + QueryProp(P_LIGHT_MODIFIER);
33}
34
35varargs int CannotSee(int silent)
36{
Zesstra0d7c3212019-11-23 21:48:58 +010037 string|int is_blind = QueryProp(P_BLIND);
Zesstra9d711582018-11-14 22:56:57 +010038 if (is_blind &&
39 (!IS_LEARNER(this_object()) || !Query(P_WANTS_TO_LEARN)))
40 {
MG Mud User88f12472016-06-24 23:31:02 +020041 if (!silent) {
42 if (stringp(is_blind))
43 tell_object(this_object(), is_blind);
44 else tell_object(this_object(), "Du bist blind!\n");
45 }
46 return 2;
47 }
48 if (UseSkill(SK_NIGHTVISION)<=0 &&
49 environment() && QueryProp(P_PLAYER_LIGHT)<=0 &&
50 (!IS_LEARNER(this_object()) || !Query(P_WANTS_TO_LEARN)))
51 {
52 if (!silent) tell_object(this_object(), "Es ist zu dunkel!\n");
53 return 1;
54 }
55 return 0;
56}