blob: 9f1b10443ffc4e26071a914f2a82763906c73a7b [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
10#pragma pedantic
11
12#define NEED_PROTOTYPES
13#include <living/description.h>
14#include <living/skills.h>
15#undef NEED_PROTOTYPES
16
17#include <player/viewcmd.h>
18#include <new_skills.h>
19#include <container.h>
20#include <player/base.h>
21#include <wizlevels.h>
22
23inherit "/std/container/light";
24
25protected void create() {
26 ::create();
27 SetProp(P_LIGHT_TRANSPARENCY, 0);
28}
29
30static int _query_player_light()
31{
32 if (environment())
33 return environment()->QueryProp(P_INT_LIGHT) + QueryProp(P_LIGHT_MODIFIER);
34}
35
36varargs int CannotSee(int silent)
37{
Zesstra0d7c3212019-11-23 21:48:58 +010038 string|int is_blind = QueryProp(P_BLIND);
Zesstra9d711582018-11-14 22:56:57 +010039 if (is_blind &&
40 (!IS_LEARNER(this_object()) || !Query(P_WANTS_TO_LEARN)))
41 {
MG Mud User88f12472016-06-24 23:31:02 +020042 if (!silent) {
43 if (stringp(is_blind))
44 tell_object(this_object(), is_blind);
45 else tell_object(this_object(), "Du bist blind!\n");
46 }
47 return 2;
48 }
49 if (UseSkill(SK_NIGHTVISION)<=0 &&
50 environment() && QueryProp(P_PLAYER_LIGHT)<=0 &&
51 (!IS_LEARNER(this_object()) || !Query(P_WANTS_TO_LEARN)))
52 {
53 if (!silent) tell_object(this_object(), "Es ist zu dunkel!\n");
54 return 1;
55 }
56 return 0;
57}