3 * Iter Vehemens ad Necem (IVAN)
4 * Copyright (C) Timo Kiviluoto
5 * Released under the GNU General
8 * See LICENSING which should be included
9 * along with this file for more details
17 * Global defines for the project IVAN.
18 * This file is created to decrease the need of including headers in
19 * other headers just for the sake of some silly macros, because it
20 * decreases compilation efficiency and may cause cross-including
22 * List of macros that should be gathered here:
23 * 1. all numeric defines used in multiple .cpp or .h files
24 * except those #defined in balance.h and confdef.h
25 * 2. all inline functions used in multiple .cpp or .h files
26 * and independent enough (do not require other headers)
27 * 3. class construction macros used in multiple .h files
32 #define IVAN_VERSION "0.666.0"
38 typedef const item citem
;
39 typedef const material cmaterial
;
40 typedef const character ccharacter
;
49 template <class type
, class base
, class prototype
>
50 class sysbase
: public base
53 typedef sysbase
<type
, base
, prototype
> mybase
;
54 static type
* Spawn(int Config
= 0, int SpecialFlags
= 0)
57 T
->Initialize(Config
, SpecialFlags
);
60 static type
* Clone(const type
* T
) { return new type(*T
); }
61 virtual const prototype
* FindProtoType() const { return &ProtoType
; }
62 static const prototype ProtoType
;
65 template <class type
, class base
, class prototype
>
66 class simplesysbase
: public base
69 typedef simplesysbase
<type
, base
, prototype
> mybase
;
70 static type
* Spawn() { return new type
; }
71 virtual const prototype
* GetProtoType() const { return &ProtoType
; }
72 static const prototype ProtoType
;
75 #define SYSTEM_SPECIALIZATIONS(name)\
76 name##prototype** name##_ProtoData;\
77 valuemap name##_CodeNameMap;\
78 int name##_ProtoSize;\
80 template<> name##prototype**& protocontainer<name>::GetProtoData()\
81 { return name##_ProtoData; }\
82 template<> valuemap& protocontainer<name>::GetCodeNameMap()\
83 { return name##_CodeNameMap; }\
84 template<> int& protocontainer<name>::GetSizeRef()\
85 { return name##_ProtoSize; }
87 #define EXTENDED_SYSTEM_SPECIALIZATIONS(name)\
88 SYSTEM_SPECIALIZATIONS(name)\
89 databasecreator<name>::databasemembermap name##_DataBaseMemberMap;\
90 template<> databasecreator<name>::databasemembermap&\
91 databasecreator<name>::GetDataBaseMemberMap()\
92 { return name##_DataBaseMemberMap; }\
93 const name##prototype name::ProtoType
95 #define DATA_BASE_VALUE(type, data) type Get##data() const { return DataBase->data; }
96 #define DATA_BASE_VALUE_WITH_PARAMETER(type, data, param) type Get##data(param) const { return DataBase->data; }
97 #define DATA_BASE_TRUTH(data) truth data() const { return DataBase->data; }
98 #define DATA_BASE_TRUTH_WITH_PARAMETER(data, param) truth data(param) const { return DataBase->data; }
101 #define HAS_BLOCKED 1
104 #define DID_NO_DAMAGE 4
107 #define OVER_FED_LEVEL 175000
108 #define BLOATED_LEVEL 150000
109 #define SATIATED_LEVEL 100000
110 #define NOT_HUNGER_LEVEL 30000
111 #define HUNGER_LEVEL 20000
112 #define VERY_HUNGER_LEVEL 10000
114 #define OVER_LOADED 0
120 #define VERY_HUNGRY 1
129 #define POLYMORPHED (1 << 0)
130 #define HASTE (1 << 1)
131 #define SLOW (1 << 2)
132 #define POLYMORPH_CONTROL (1 << 3)
133 #define LIFE_SAVED (1 << 4)
134 #define LYCANTHROPY (1 << 5)
135 #define INVISIBLE (1 << 6)
136 #define INFRA_VISION (1 << 7)
138 #define POISONED (1 << 9)
139 #define TELEPORT (1 << 10)
140 #define POLYMORPH (1 << 11)
141 #define TELEPORT_CONTROL (1 << 12)
142 #define PANIC (1 << 13)
143 #define CONFUSED (1 << 14)
144 #define PARASITIZED (1 << 15)
145 #define SEARCHING (1 << 16)
146 #define GAS_IMMUNITY (1 << 17)
147 #define LEVITATION (1 << 18)
148 #define LEPROSY (1 << 19)
149 #define HICCUPS (1 << 20)
150 #define VAMPIRISM (1 << 21)
151 #define DETECTING (1 << 22)
153 #define THROW_ITEM_TYPES 5
155 #define THROW_BONE (1 << 0)
156 #define THROW_POTION (1 << 1)
157 #define THROW_AXE (1 << 2)
158 #define THROW_GAS_GRENADE (1 << 3)
159 #define THROW_WAND (1 << 4)
173 #define PHYSICAL_DAMAGE 1
177 #define ELECTRICITY 16
181 #define MUSTARD_GAS_DAMAGE 256
189 #define TRANSSEXUAL 3
191 #define ALL_BODYPART_FLAGS 0x7F
193 /* The maximum bodyparts a character can have */
195 #define MAX_BODYPARTS 7
196 #define HUMANOID_BODYPARTS 7
198 #define TORSO_INDEX 0
200 #define RIGHT_ARM_INDEX 2
201 #define LEFT_ARM_INDEX 3
202 #define GROIN_INDEX 4
203 #define RIGHT_LEG_INDEX 5
204 #define LEFT_LEG_INDEX 6
206 #define NONE_INDEX MAX_BODYPARTS
208 #define DIRECTION_COMMAND_KEYS 8
209 #define EXTENDED_DIRECTION_COMMAND_KEYS 9
214 #define LIGHT_BORDER 80
231 #define ARTICLE_BIT 2
233 #define INDEFINE_BIT 4
237 #define TRANSPARENT_COLOR 0xF81F // pink
241 #define GR_GLTERRAIN 0
242 #define GR_OLTERRAIN 1
244 #define GR_CHARACTER 3
245 #define GR_HUMANOID 4
249 #define GRAPHIC_TYPES 4
251 #define GR_WTERRAIN 0
256 /* SpecialFlags for graphics system. No one knows what "ST_" means... */
259 #define ST_RIGHT_ARM 8
260 #define ST_LEFT_ARM 16
262 #define ST_RIGHT_LEG 32
263 #define ST_LEFT_LEG 40
264 #define ST_OTHER_BODYPART 48
265 #define ST_WIELDED 56
267 #define ST_LIGHTNING 128
268 #define ST_DISALLOW_R_COLORS 256
269 #define ST_FLAME_1 512
270 #define ST_FLAME_2 1024
271 #define ST_FLAME_3 2048
272 #define ST_FLAME_4 4096
273 #define ST_FLAMES (ST_FLAME_1|ST_FLAME_2|ST_FLAME_3|ST_FLAME_4)
274 #define ST_FLAME_SHIFT 9
277 #define WOBBLE_HORIZONTALLY_BIT 2
278 #define WOBBLE_VERTICALLY WOBBLE
279 #define WOBBLE_HORIZONTALLY (WOBBLE|WOBBLE_HORIZONTALLY_BIT)
280 #define WOBBLE_SPEED_SHIFT 2
281 #define WOBBLE_SPEED_RANGE (3 << WOBBLE_SPEED_SHIFT)
282 #define WOBBLE_FREQ_SHIFT 4
283 #define WOBBLE_FREQ_RANGE (3 << WOBBLE_FREQ_SHIFT)
285 cv2
SILHOUETTE_SIZE(48, 64);
287 #define ITEM_CATEGORIES 18
289 #define ANY_CATEGORY 0x7FFFFFFF
290 #define HELMET (1 << 0)
291 #define AMULET (1 << 1)
292 #define CLOAK (1 << 2)
293 #define BODY_ARMOR (1 << 3)
294 #define WEAPON (1 << 4)
295 #define SHIELD (1 << 5)
296 #define RING (1 << 6)
297 #define GAUNTLET (1 << 7)
298 #define BELT (1 << 8)
299 #define BOOT (1 << 9)
300 #define FOOD (1 << 10)
301 #define POTION (1 << 11)
302 #define SCROLL (1 << 12)
303 #define BOOK (1 << 13)
304 #define WAND (1 << 14)
305 #define TOOL (1 << 15)
306 #define VALUABLE (1 << 16)
307 #define MISC (1 << 17)
323 #define CT_PROCESSED 64
324 #define CT_MISC_ORGANIC 128
325 #define CT_PLASTIC 256
328 /* Possible square positions for item. The first four are used for items
335 #define CENTER 4 // item on ground
341 #define MARTIAL_SKILL_CATEGORIES 3
342 #define WEAPON_SKILL_CATEGORIES 11
347 #define UNCATEGORIZED 3
348 #define SMALL_SWORDS 4
349 #define LARGE_SWORDS 5
350 #define BLUNT_WEAPONS 6
358 #define EFFECT_NOTHING 0
359 #define EFFECT_POISON 1
360 #define EFFECT_DARKNESS 2
361 #define EFFECT_OMMEL_URINE 3
362 #define EFFECT_PEPSI 4
363 #define EFFECT_KOBOLD_FLESH 5
364 #define EFFECT_HEAL 6
365 #define EFFECT_LYCANTHROPY 7
366 #define EFFECT_SCHOOL_FOOD 8
367 #define EFFECT_ANTIDOTE 9
368 #define EFFECT_CONFUSE 10
369 #define EFFECT_POLYMORPH 11
370 #define EFFECT_ESP 12
371 #define EFFECT_SKUNK_SMELL 13
372 #define EFFECT_MAGIC_MUSHROOM 14
373 #define EFFECT_TRAIN_PERCEPTION 15
374 #define EFFECT_HOLY_BANANA 16
375 #define EFFECT_EVIL_WONDER_STAFF_VAPOUR 17
376 #define EFFECT_GOOD_WONDER_STAFF_VAPOUR 18
377 #define EFFECT_PEA_SOUP 19
378 #define EFFECT_BLACK_UNICORN_FLESH 20
379 #define EFFECT_GRAY_UNICORN_FLESH 21
380 #define EFFECT_WHITE_UNICORN_FLESH 22
381 #define EFFECT_TELEPORT_CONTROL 23
382 #define EFFECT_MUSHROOM 24
383 #define EFFECT_OMMEL_CERUMEN 25
384 #define EFFECT_OMMEL_SWEAT 26
385 #define EFFECT_OMMEL_TEARS 27
386 #define EFFECT_OMMEL_SNOT 28
387 #define EFFECT_OMMEL_BONE 29
388 #define EFFECT_MUSTARD_GAS 30
389 #define EFFECT_MUSTARD_GAS_LIQUID 31
390 // new; wtf is EFFECT_PANIC?
391 #define EFFECT_PANIC 32
392 #define EFFECT_TELEPORT 33
393 #define EFFECT_VAMPIRISM 34
394 #define EFFECT_DETECTING 35
395 #define EFFECT_HOLY_MANGO 36
397 /* CEM = Consume End Message */
399 #define CEM_NOTHING 0
400 #define CEM_SCHOOL_FOOD 1
402 #define CEM_FROG_FLESH 3
405 #define CEM_KOBOLD_FLESH 6
406 #define CEM_HEALING_LIQUID 7
407 #define CEM_ANTIDOTE 8
409 #define CEM_HOLY_BANANA 10
410 #define CEM_PEA_SOUP 11
411 #define CEM_BLACK_UNICORN_FLESH 12
412 #define CEM_GRAY_UNICORN_FLESH 13
413 #define CEM_WHITE_UNICORN_FLESH 14
414 #define CEM_OMMEL_BONE 15
416 #define CEM_LIQUID_HORROR 16
417 #define CEM_HOLY_MANGO 17
419 /* HM = Hit Message */
422 #define HM_SCHOOL_FOOD 1
423 #define HM_FROG_FLESH 2
426 #define HM_KOBOLD_FLESH 5
427 #define HM_HEALING_LIQUID 6
428 #define HM_ANTIDOTE 7
430 #define HM_HOLY_BANANA 9
431 #define HM_HOLY_MANGO 10
433 #define UNARMED_ATTACK 0
434 #define WEAPON_ATTACK 1
435 #define KICK_ATTACK 2
436 #define BITE_ATTACK 3
437 #define THROW_ATTACK 4
443 #define ATTRIBUTES 11
444 #define BASE_ATTRIBUTES 7
448 #define INTELLIGENCE 2
454 #define ARM_STRENGTH 7
455 #define LEG_STRENGTH 8
459 #define F_ENDURANCE (1 << ENDURANCE)
460 #define F_PERCEPTION (1 << PERCEPTION)
461 #define F_INTELLIGENCE (1 << INTELLIGENCE)
462 #define F_WISDOM (1 << WISDOM)
463 #define F_WILL_POWER (1 << WILL_POWER)
464 #define F_CHARISMA (1 << CHARISMA)
465 #define F_MANA (1 << MANA)
467 #define F_ARM_STRENGTH (1 << ARM_STRENGTH)
468 #define F_LEG_STRENGTH (1 << LEG_STRENGTH)
469 #define F_DEXTERITY (1 << DEXTERITY)
470 #define F_AGILITY (1 << AGILITY)
474 #define REQUIRES_ANSWER -1
476 #define DIR_ERROR 0xFF
478 #define MAX_EQUIPMENT_SLOTS 13
480 #define HELMET_INDEX 0
481 #define AMULET_INDEX 1
482 #define CLOAK_INDEX 2
483 #define BODY_ARMOR_INDEX 3
485 #define RIGHT_WIELDED_INDEX 5
486 #define LEFT_WIELDED_INDEX 6
487 #define RIGHT_RING_INDEX 7
488 #define LEFT_RING_INDEX 8
489 #define RIGHT_GAUNTLET_INDEX 9
490 #define LEFT_GAUNTLET_INDEX 10
491 #define RIGHT_BOOT_INDEX 11
492 #define LEFT_BOOT_INDEX 12
494 #define WORLD_MAP 255
496 #define DEFAULT_TEAM 0xFF
498 /* Hard-coded teams */
500 #define PLAYER_TEAM 0
501 #define MONSTER_TEAM 1
502 #define ATTNAM_TEAM 2
504 #define VALPURUS_ANGEL_TEAM 4
505 #define GC_SHOPKEEPER_TEAM 5
507 #define NEW_ATTNAM_TEAM 7
508 #define COLONIST_TEAM 8
509 #define TOURIST_GUIDE_TEAM 9
510 #define TOURIST_TEAM 10
511 #define BETRAYED_TEAM 11
512 #define MONDEDR_TEAM 12
513 #define KHARAZ_ARAD_TEAM 13
514 #define FORESTMAN_TEAM 14
515 #define SOLICITUS_TEAM 15
516 #define MORBE_TEAM 16
517 #define NO_TEAM 0xFFFF
520 #define NO_PIC_UPDATE 2
521 #define NO_EQUIPMENT_PIC_UPDATE (NO_PIC_UPDATE << 1)
522 #define NO_MATERIALS 8
523 #define NO_EQUIPMENT 16
524 #define NO_SIGNALS 32
526 #define NOT_WALKABLE 1
527 #define HAS_CHARACTER 2
529 #define NOT_IN_ROOM 8
530 #define ATTACHABLE (16|NOT_IN_ROOM) /* overrides IN_ROOM */
531 #define HAS_NO_OTERRAIN 32
533 #define DEFAULT_ATTACHED_AREA 0xFE
534 #define DEFAULT_ATTACHED_ENTRY 0xFE
538 #define ELPURI_CAVE 1
541 #define UNDER_WATER_TUNNEL 4
544 #define DRAGON_TOWER 7
545 #define DARK_FOREST 8
546 #define XINROCH_TOMB 9
547 #define KHARAZ_ARAD_SHOP 127
548 #define UNDER_WATER_TUNNEL_EXIT 128
550 #define VESANA_LEVEL 2
551 #define CRYSTAL_LEVEL 3
552 #define SPIDER_LEVEL 4
553 #define ENNER_BEAST_LEVEL 4
554 #define ZOMBIE_LEVEL 5
559 /* stack::DrawContents flags */
561 #define NO_SELECT 1 // only show items
562 #define NO_MULTI_SELECT 2 // select only one item
563 #define NO_SPECIAL_INFO 4 // show only name and amount
564 #define REMEMBER_SELECTED 8 // if DrawContents will be called multiple times,
565 // remember the selected item
566 #define NONE_AS_CHOICE 16 // "none" is a choice, for instance when wielding
567 #define SELECT_PAIR 32 // if NO_MULTI_SELECT is on, selects a pair if
571 #define ROUND_CORNERS 2
573 /* Gods, 0 == none */
596 #define MAX_PRICE (2147483647)
598 #define PERMANENT 0xFFFF
604 #define BEAM_EFFECTS 13
606 #define BEAM_POLYMORPH 0
607 #define BEAM_STRIKE 1
608 #define BEAM_FIRE_BALL 2
609 #define BEAM_TELEPORT 3
612 #define BEAM_RESURRECT 6
613 #define BEAM_INVISIBILITY 7
614 #define BEAM_DUPLICATE 8
615 #define BEAM_LIGHTNING 9
616 #define BEAM_DOOR_CREATION 10
617 #define BEAM_ACID_RAIN 11
618 #define BEAM_NECROMANCY 12
620 #define BEAM_STYLES 3
622 #define PARTICLE_BEAM 0
623 #define LIGHTNING_BEAM 1
624 #define SHIELD_BEAM 2
626 #define RANDOM_COLOR 0x10000
628 /* Entry indices, not actual config defines */
630 #define STAIRS_UP 100
631 #define STAIRS_DOWN 200
632 #define WAYPOINT_DEEPER 1100
633 #define WAYPOINT_SHALLOWER 1200
634 #define FOUNTAIN 0xFFFF
636 #define NO_LIMIT 0xFFFF
638 #define ALL_ITEMS 0xFFFF
640 /* StateData flags */
644 #define DUR_TEMPORARY 2
645 #define DUR_PERMANENT 4
646 #define DUR_FLAGS (2|4)
647 #define SRC_FOUNTAIN 8
648 #define SRC_MUSHROOM 16
649 #define SRC_MAGIC_MUSHROOM 32
650 #define SRC_CONFUSE_READ 64
653 #define SRC_FLAGS (8|16|32|64|128|256)
654 #define RANDOMIZABLE (DUR_FLAGS|SRC_FLAGS)
657 #define SHOW_MAP_IN_TRUE_LIGHT 1
658 #define SHOW_MAP_IN_UNIFORM_LIGHT 2
660 #define DIM_LUMINANCE 0x6E6E6E
668 #define CANNIBALIZED 4
669 #define SQUARE_POSITION_BITS (16|32|64)
670 #define SQUARE_POSITION_SHIFT 4
675 #define BADLY_HURT 256
677 #define BODYPART_SPARKLE_SHIFT 9
680 #define IGNORE_BROKEN_PRICE 2
682 #define MAX_SQUARES_UNDER 16
683 #define MAX_NEIGHBOUR_SQUARES 20
685 #define N_LOCK_ID 1024
686 #define S_LOCK_ID 16384
687 #define LOCK_DELTA 1024
689 #define LOCK_BITS 0xFC00
691 #define BROKEN_LOCK S_LOCK_ID
693 /* Normal lock types, which can be randomized */
695 #define ROUND_LOCK (N_LOCK_ID + LOCK_DELTA * 1)
696 #define SQUARE_LOCK (N_LOCK_ID + LOCK_DELTA * 2)
697 #define TRIANGULAR_LOCK (N_LOCK_ID + LOCK_DELTA * 3)
699 /* Special lock types, which must be generated in the script */
701 #define HEXAGONAL_LOCK (S_LOCK_ID + LOCK_DELTA * 1)
702 #define OCTAGONAL_LOCK (S_LOCK_ID + LOCK_DELTA * 2)
703 #define HEART_SHAPED_LOCK (S_LOCK_ID + LOCK_DELTA * 3)
704 #define PENTAGONAL_LOCK (S_LOCK_ID + LOCK_DELTA * 4)
709 #define LEAFY_FOREST 4
710 #define EVERGREEN_FOREST 5
721 #define KEY_UP_INDEX 1
722 #define KEY_LEFT_INDEX 3
723 #define KEY_RIGHT_INDEX 4
724 #define KEY_DOWN_INDEX 6
731 #define CHARACTER_SLOT 2
735 #define SLIGHTLY_RUSTED 1
737 #define VERY_RUSTED 3
739 #define HUMAN_BODY_ARMOR_PIXELS 68
741 #define ARMOR_OUTLINE_PRIORITY ((7 << 4) + 7)
742 #define CLOAK_PRIORITY ((8 << 4) + 7)
744 #define BODY_ARMOR_PARTS 6
746 #define SUMO_ROOM_POS v2(25, 35)
747 #define SUMO_ARENA_POS v2(19, 12)
749 #define MAX_RAIN_DROPS 32
753 #define DISQUALIFIED 2
755 #define EMITTER_IDENTIFIER_BITS 0xFFFF
756 #define EMITTER_SQUARE_PART_BITS 0xF000000
757 #define EMITTER_SHADOW_BITS 0xF0000000
758 #define EMITTER_SQUARE_PART_SHIFT 24
759 #define EMITTER_SHADOW_SHIFT 28
761 #define RE_SUN_EMITATED 0x200000
762 #define ID_X_COORDINATE 0x400000
763 #define ID_BEGIN 0x800000
765 #define FORCE_ADD 0x400000
766 #define SECONDARY_SUN_LIGHT 0x800000
768 /* square & lsquare flags */
770 #define ALLOW_EMITATION_CONTINUE 1
771 #define FREEZED 2 /* also a stack flag */
773 #define NEW_DRAW_REQUEST 8
774 #define STRONG_BIT 16
775 #define STRONG_NEW_DRAW_REQUEST (NEW_DRAW_REQUEST|STRONG_BIT)
776 #define DESCRIPTION_CHANGE 32
777 #define MEMORIZED_UPDATE_REQUEST 128
778 #define IN_SQUARE_STACK 256
779 #define CHECK_SUN_LIGHT_NEEDED 512
780 #define IS_TRANSPARENT 1024
781 #define PERFECTLY_QUADRI_HANDLED 2048
783 /* Slows down protosystem::BalancedCreateItem() but makes it produce more
786 #define BALANCED_CREATE_ITEM_ITERATIONS 100
788 #define CONFIG_TABLE_SIZE 256
790 #define SPARKLE_POS_X_ERROR 128
796 #define TORSO_MAIN_COLOR 16
797 #define BELT_COLOR 32
798 #define BOOT_COLOR 64
799 #define TORSO_SPECIAL_COLOR 128
800 #define ARM_MAIN_COLOR 256
801 #define GAUNTLET_COLOR 512
802 #define ARM_SPECIAL_COLOR 1024
803 #define LEG_MAIN_COLOR 2048
804 #define LEG_SPECIAL_COLOR 4096
805 #define CLOTH_COLOR (CAP_COLOR\
811 /* contentscript<character> flags */
818 /* If set, all items are always considered visible, so CanBeSeenBy calls
823 /* All costly updates (like emitation's) are avoided if this is set.
824 Allows much faster removing and adding items, but make sure the stack is
825 returned to the original state (excluding item order) before switching
826 this off. Note: also an lsquare flag */
830 /* End stack Flags */
832 #define SUN_BEAM_DIRECTIONS 48
834 /* Square part flags */
836 #define SP_TOP_LEFT 1
837 #define SP_TOP_RIGHT 2
838 #define SP_BOTTOM_LEFT 4
839 #define SP_BOTTOM_RIGHT 8
840 #define SP_TOP (SP_TOP_LEFT|SP_TOP_RIGHT)
841 #define SP_LEFT (SP_TOP_LEFT|SP_BOTTOM_LEFT)
842 #define SP_RIGHT (SP_TOP_RIGHT|SP_BOTTOM_RIGHT)
843 #define SP_BOTTOM (SP_BOTTOM_LEFT|SP_BOTTOM_RIGHT)
845 #define CONDITION_COLORS 5
847 #define NATURAL_MATERIAL_FORM 0x7FFF
849 #define EXP_DIVISOR 2e-8
850 #define EXP_MULTIPLIER 5e+7
852 #define MAX_EXP 5e+10
854 #define HAS_BEEN_GENERATED 1
855 #define HAS_BEEN_SEEN 2
857 #define DEPENDS_ON_ATTRIBUTES 0xFFFF
859 /* Tiredness states */
865 #define DEFAULT_GENERATION_DANGER 0.05
866 #define ANGEL_GENERATION_DANGER 0.10
868 /* Duplication flags */
870 #define MIRROR_IMAGE 1
871 #define IGNORE_PROHIBITIONS 2
872 #define CHANGE_TEAM 4
873 #define LE_BASE_SHIFT 3
874 #define LE_BASE_RANGE 0x7FFF
875 #define LE_RAND_SHIFT 18
876 #define LE_RAND_RANGE 0x3FFF
880 #define IN_DND_MODE 1
881 #define TERMINATING 2
885 #define HAS_BODY_ARMOR_PICTURES 1
886 #define FLUID_INSIDE 2
888 #define COMMAND_FLAGS 4
889 #define ALL_COMMAND_FLAGS (1|2|4|8)
891 #define FOLLOW_LEADER 1
892 #define FLEE_FROM_ENEMIES 2
893 #define DONT_CHANGE_EQUIPMENT 4
894 #define DONT_CONSUME_ANYTHING_VALUABLE 8
896 #define CHAT_MENU_ENTRIES 5
897 #define ALL_MANAGEMENT_FLAGS (1|2|4|8|16)
899 #define CHANGE_EQUIPMENT 1
902 #define ISSUE_COMMANDS 8
905 #define NO_PARAMETERS 0xFF
907 #define CURSOR_TYPES 4
909 #define DARK_CURSOR 0
911 #define BLUE_CURSOR 2
912 #define YELLOW_CURSOR 3
913 #define CURSOR_FLASH 0x2000
914 #define CURSOR_TARGET 0x4000
915 #define CURSOR_BIG 0x8000
916 #define CURSOR_FLAGS (CURSOR_BIG|CURSOR_FLASH|CURSOR_TARGET)
918 #define GRAY_FRACTAL 0
919 #define RED_FRACTAL 1
920 #define GREEN_FRACTAL 2
921 #define BLUE_FRACTAL 3
922 #define YELLOW_FRACTAL 4
924 #define DAMAGE_TYPES 3
930 #define SILHOUETTE_TYPES 2
932 #define SILHOUETTE_NORMAL 0
933 #define SILHOUETTE_INTER_LACED 1
936 #define HAS_CAUSED_PANIC 2
938 /* MaxHP calculation flags */
940 #define MAY_CHANGE_HPS 1
941 #define CHECK_USABILITY 2
943 #define ITEM_TRAP 0x8000
944 #define FLUID_TRAP 0x10000
949 #define FORCE_DEATH 2
950 #define DISALLOW_CORPSE 4
951 #define DISALLOW_MSG 8
952 #define IGNORE_UNCONSCIOUSNESS 16
953 #define IGNORE_TRAPS 32
954 #define FORBID_REINCARNATION 64
956 /* character flags */
959 #define C_INITIALIZING 8
960 #define C_POLYMORPHED 16
961 #define C_IN_NO_MSG_MODE 32
962 #define C_PICTURE_UPDATES_FORBIDDEN 64
964 /*************************/
965 /* Common DataBase flags */
966 /*************************/
969 #define IS_ABSTRACT 1
970 #define HAS_SECONDARY_MATERIAL 2
971 #define CREATE_DIVINE_CONFIGURATIONS 4
972 #define CAN_BE_WISHED 8
973 #define CAN_BE_DESTROYED 16
974 #define IS_VALUABLE 32
975 #define CAN_BE_MIRRORED 64
979 #define USE_ADJECTIVE_AN 2
980 #define NO_ARTICLE 4 // for instance "Petrus's wive number 4"
982 #define SHOW_MATERIAL 16 // only works for terrains
984 /* Spatial Flags (unused for now) */
985 #define MF_OBJECT 256
989 #define MF_ONFLOOR 4096
990 #define MF_LOWWALL 8192
991 #define MF_TABLE 16384
992 #define MF_WINDOW 128
996 /****************************/
997 /* Character DataBase flags */
998 /****************************/
1007 #define SPILLS_BLOOD
1009 #define USES_NUTRITION
1010 #define ALWAYS_USE_MATERIAL_ATTRIBUTES
1012 #define IS_EXTRA_FRAGILE
1017 #define CAN_USE_EQUIPMENT
1027 /* CopyrightFlags */
1029 #define CAN_BE_GENERATED
1030 #define CAN_BE_NAMED
1033 #define BODY_PARTS_DISAPPEAR_WHEN_SEVERED
1034 #define DESTROYS_WALLS
1035 #define BITE_CAPTURES_BODY_PART
1038 #define IMMUNITY_POLYMORPH
1039 #define IMMUNITY_CHARM
1040 #define IMMUNITY_CLONING
1041 #define IMMUNITY_CONFUSE
1042 #define IMMUNITY_LEPROSY
1043 #define IMMUNITY_ITEM_TELEPORT
1044 #define IMMUNITY_STICKINESS
1045 #define IMMUNITY_CHOKING
1046 #define IMMUNITY_UNCONSCIOUSNESS
1049 #define CREATE_GOLEM_MATERIAL_CONFIGURATIONS 2
1050 #define IGNORE_DANGER 4
1051 #define AUTOMATICALLY_SEEN 8
1052 #define WILL_CARRY_ITEMS 16
1053 #define IS_EXTRA_COWARD 32
1055 /***********************/
1056 /* Item DataBase flags */
1057 /***********************/
1061 /* AttributeAffectFlags */
1063 /* GenerationFlags*/
1064 #define CREATE_LOCK_CONFIGURATIONS 2
1065 #define CAN_BE_AUTO_INITIALIZED 4 // used only in WMode
1066 #define CAN_BE_GENERATED_IN_CONTAINER 8
1067 #define CAN_BE_SPAWNED_BY_POLYMORPH 16
1069 /* InteractionFlags */
1070 #define MATERIAL_CAN_BE_CHANGED
1071 #define CAN_BE_POLYMORPHED
1072 #define CAN_BE_CLONED
1073 #define CAN_BE_ENCHANTED
1074 #define CAN_BE_BROKEN
1075 #define AFFECTS_CARRYING_CAPACITY
1078 #define IS_QUEST_ITEM
1079 #define CAN_BE_USED_BY_SMITH
1080 #define IS_KAMIKAZE_WEAPON
1081 #define IS_TWO_HANDED
1082 #define IS_GOOD_WITH_PLANTS
1085 #define HANDLE_IN_PAIRS
1086 #define PRICE_IS_PROPORTIONAL_TO_ENCHANTMENT
1087 #define FLEXIBILITY_IS_ESSENTIAL
1088 #define HAS_NORMAL_PICTURE_DIRECTION
1089 #define CAN_BE_PILED
1090 #define CAN_BE_PICKED_UP
1093 /**************************/
1094 /* Terrain DataBase flags */
1095 /**************************/
1100 /* OLTerrainFlags */
1101 #define CREATE_LOCK_CONFIGURATIONS 2
1102 #define CREATE_WINDOW_CONFIGURATIONS 4
1105 #define USE_BORDER_TILES
1106 #define IS_ALWAYS_TRANSPARENT
1107 #define SHOW_THINGS_UNDER
1108 #define IS_SAFE_TO_CREATE_DOOR
1110 /***************************/
1111 /* Material DataBase flags */
1112 /***************************/
1115 /* NameFlags (only USE_AN) */
1120 #define CAN_BE_TAILORED 4
1121 #define IS_SPARKLING 8
1123 #define IS_GOLEM_MATERIAL 32
1124 #define IS_BEVERAGE 64
1129 #define CAN_HAVE_PARASITE 4
1130 #define USE_MATERIAL_ATTRIBUTES 8
1131 #define CAN_REGENERATE 16
1133 /* InteractionFlags */
1135 #define CAN_EXPLODE 2
1136 #define CAN_DISSOLVE 4
1137 #define AFFECT_INSIDE 8
1138 #define EFFECT_IS_GOOD 16
1139 #define IS_AFFECTED_BY_MUSTARD_GAS 32
1141 /*************************/
1142 /* End of DataBase flags */
1143 /*************************/
1145 #define TILE_SIZE 16
1146 cv2
TILE_V2(TILE_SIZE
, TILE_SIZE
);
1148 #define SQUARE_INDEX_MASK 0xFFFF
1149 #define ALLOW_ANIMATE 0x10000
1150 #define ALLOW_ALPHA 0x20000
1154 #define TALENT_STRONG 0
1155 #define TALENT_FAST_N_ACCURATE 1
1156 #define TALENT_HEALTHY 2
1157 #define TALENT_CLEVER 3
1159 #define BORDER_PARTNER_ANIMATED (16 << 24)
1163 #define NO_MONSTER_GENERATION 1
1165 #define NO_TAMING -1
1167 #define SADIST_HIT 1
1169 #define EQUIPMENT_DATAS 13
1171 #define SPECIAL_CONFIGURATION_GENERATION_LEVELS 2