blob: ecbc926b78adf8b834153e2495016875bc433b5e [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);
Arathornb3051452021-05-13 21:13:03 +020033 return 0;
MG Mud User88f12472016-06-24 23:31:02 +020034}
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}