MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame^] | 1 | // 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 | |
| 23 | inherit "/std/container/light"; |
| 24 | |
| 25 | protected void create() { |
| 26 | ::create(); |
| 27 | SetProp(P_LIGHT_TRANSPARENCY, 0); |
| 28 | } |
| 29 | |
| 30 | static int _query_player_light() |
| 31 | { |
| 32 | if (environment()) |
| 33 | return environment()->QueryProp(P_INT_LIGHT) + QueryProp(P_LIGHT_MODIFIER); |
| 34 | } |
| 35 | |
| 36 | varargs int CannotSee(int silent) |
| 37 | { |
| 38 | string is_blind; |
| 39 | if (is_blind = QueryProp(P_BLIND)) { |
| 40 | if (!silent) { |
| 41 | if (stringp(is_blind)) |
| 42 | tell_object(this_object(), is_blind); |
| 43 | else tell_object(this_object(), "Du bist blind!\n"); |
| 44 | } |
| 45 | return 2; |
| 46 | } |
| 47 | if (UseSkill(SK_NIGHTVISION)<=0 && |
| 48 | environment() && QueryProp(P_PLAYER_LIGHT)<=0 && |
| 49 | (!IS_LEARNER(this_object()) || !Query(P_WANTS_TO_LEARN))) |
| 50 | { |
| 51 | if (!silent) tell_object(this_object(), "Es ist zu dunkel!\n"); |
| 52 | return 1; |
| 53 | } |
| 54 | return 0; |
| 55 | } |