cosmetix
[k8-i-v-a-n.git] / src / game / ivandef.h
blob579f887542d30991246936a44f4cd39271b2c6be
1 /*
3 * Iter Vehemens ad Necem (IVAN)
4 * Copyright (C) Timo Kiviluoto
5 * Released under the GNU General
6 * Public License
8 * See LICENSING which should be included
9 * along with this file for more details
13 #ifndef __IVANDEF_H__
14 #define __IVANDEF_H__
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
30 #include "v2.h"
32 #define IVAN_VERSION "0.666.0"
34 class item;
35 class material;
36 class character;
38 typedef const item citem;
39 typedef const material cmaterial;
40 typedef const character ccharacter;
42 struct databasebase
44 int Config;
45 feuLong CommonFlags;
46 feuLong NameFlags;
49 template <class type, class base, class prototype>
50 class sysbase : public base
52 public:
53 typedef sysbase<type, base, prototype> mybase;
54 static type* Spawn(int Config = 0, int SpecialFlags = 0)
56 type* T = new type;
57 T->Initialize(Config, SpecialFlags);
58 return T;
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
68 public:
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; }
100 #define HAS_HIT 0
101 #define HAS_BLOCKED 1
102 #define HAS_DODGED 2
103 #define HAS_DIED 3
104 #define DID_NO_DAMAGE 4
105 #define HAS_FAILED 5
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
115 #define STRESSED 1
116 #define BURDENED 2
117 #define UNBURDENED 3
119 #define STARVING 0
120 #define VERY_HUNGRY 1
121 #define HUNGRY 2
122 #define NOT_HUNGRY 3
123 #define SATIATED 4
124 #define BLOATED 5
125 #define OVER_FED 6
127 #define STATES 23
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)
137 #define ESP (1 << 8)
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
154 /*ThrowFlags */
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)
161 #define TORSO 1
162 #define HEAD 2
163 #define RIGHT_ARM 4
164 #define LEFT_ARM 8
165 #define ARMS 12
166 #define GROIN 16
167 #define RIGHT_LEG 32
168 #define LEFT_LEG 64
169 #define LEGS 96
170 #define OTHER 128
171 #define ALL 255
173 #define PHYSICAL_DAMAGE 1
174 #define SOUND 2
175 #define ACID 4
176 #define FIRE 8
177 #define ELECTRICITY 16
178 #define ENERGY 32
179 #define POISON 64
180 #define DRAIN 128
181 #define MUSTARD_GAS_DAMAGE 256
182 #define PSI 512
183 #define THROW 32768
186 #define UNDEFINED 0
187 #define MALE 1
188 #define FEMALE 2
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
199 #define HEAD_INDEX 1
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
210 #define YOURSELF 8
211 #define RANDOM_DIR 9
213 #ifndef LIGHT_BORDER
214 #define LIGHT_BORDER 80
215 #endif
217 #define ALPP 0
218 #define ALP 1
219 #define AL 2
220 #define ALM 3
221 #define ANP 4
222 #define AN 5
223 #define ANM 6
224 #define ACP 7
225 #define AC 8
226 #define ACM 9
227 #define ACMM 10
229 #define UNARTICLED 0
230 #define PLURAL 1
231 #define ARTICLE_BIT 2
232 #define DEFINITE 2
233 #define INDEFINE_BIT 4
234 #define INDEFINITE 6
235 #define STRIPPED 8
237 #define TRANSPARENT_COLOR 0xF81F // pink
239 #define RAW_TYPES 7
241 #define GR_GLTERRAIN 0
242 #define GR_OLTERRAIN 1
243 #define GR_ITEM 2
244 #define GR_CHARACTER 3
245 #define GR_HUMANOID 4
246 #define GR_EFFECT 5
247 #define GR_CURSOR 6
249 #define GRAPHIC_TYPES 4
251 #define GR_WTERRAIN 0
252 #define GR_FOW 1
253 #define GR_SYMBOL 2
254 #define GR_SMILEY 3
256 /* SpecialFlags for graphics system. No one knows what "ST_" means... */
258 #define ST_NORMAL 0
259 #define ST_RIGHT_ARM 8
260 #define ST_LEFT_ARM 16
261 #define ST_GROIN 24
262 #define ST_RIGHT_LEG 32
263 #define ST_LEFT_LEG 40
264 #define ST_OTHER_BODYPART 48
265 #define ST_WIELDED 56
266 #define ST_CLOAK 64
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
276 #define WOBBLE 1
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)
309 #define GOOD 1
310 #define NEUTRAL 2
311 #define EVIL 3
312 // new
313 #define TOPPLED 4
315 /* ConsumeTypes */
317 #define CT_FRUIT 1
318 #define CT_MEAT 2
319 #define CT_METAL 4
320 #define CT_MINERAL 8
321 #define CT_LIQUID 16
322 #define CT_BONE 32
323 #define CT_PROCESSED 64
324 #define CT_MISC_ORGANIC 128
325 #define CT_PLASTIC 256
326 #define CT_GAS 512
328 /* Possible square positions for item. The first four are used for items
329 on walls */
331 #define LEFT 0
332 #define DOWN 1
333 #define UP 2
334 #define RIGHT 3
335 #define CENTER 4 // item on ground
337 #define HOSTILE 1
338 #define UNCARING 2
339 #define FRIEND 4
341 #define MARTIAL_SKILL_CATEGORIES 3
342 #define WEAPON_SKILL_CATEGORIES 11
344 #define UNARMED 0
345 #define KICK 1
346 #define BITE 2
347 #define UNCATEGORIZED 3
348 #define SMALL_SWORDS 4
349 #define LARGE_SWORDS 5
350 #define BLUNT_WEAPONS 6
351 #define AXES 7
352 #define POLE_ARMS 8
353 #define WHIPS 9
354 #define SHIELDS 10
356 #define LOCKED 1
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
401 #define CEM_BONE 2
402 #define CEM_FROG_FLESH 3
403 #define CEM_OMMEL 4
404 #define CEM_PEPSI 5
405 #define CEM_KOBOLD_FLESH 6
406 #define CEM_HEALING_LIQUID 7
407 #define CEM_ANTIDOTE 8
408 #define CEM_ESP 9
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
415 // new
416 #define CEM_LIQUID_HORROR 16
417 #define CEM_HOLY_MANGO 17
419 /* HM = Hit Message */
421 #define HM_NOTHING 0
422 #define HM_SCHOOL_FOOD 1
423 #define HM_FROG_FLESH 2
424 #define HM_OMMEL 3
425 #define HM_PEPSI 4
426 #define HM_KOBOLD_FLESH 5
427 #define HM_HEALING_LIQUID 6
428 #define HM_ANTIDOTE 7
429 #define HM_CONFUSE 8
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
439 #define USE_ARMS 1
440 #define USE_LEGS 2
441 #define USE_HEAD 4
443 #define ATTRIBUTES 11
444 #define BASE_ATTRIBUTES 7
446 #define ENDURANCE 0
447 #define PERCEPTION 1
448 #define INTELLIGENCE 2
449 #define WISDOM 3
450 #define WILL_POWER 4
451 #define CHARISMA 5
452 #define MANA 6
454 #define ARM_STRENGTH 7
455 #define LEG_STRENGTH 8
456 #define DEXTERITY 9
457 #define AGILITY 10
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)
472 #define NO 0
473 #define YES 1
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
484 #define BELT_INDEX 4
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
503 #define SUMO_TEAM 3
504 #define VALPURUS_ANGEL_TEAM 4
505 #define GC_SHOPKEEPER_TEAM 5
506 #define IVAN_TEAM 6
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
519 #define LOAD 1
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
528 #define IN_ROOM 4
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
535 #define NO_ENTRY 0
537 #define RANDOM 0
538 #define ELPURI_CAVE 1
539 #define ATTNAM 2
540 #define NEW_ATTNAM 3
541 #define UNDER_WATER_TUNNEL 4
542 #define MONDEDR 5
543 #define MUNTUO 6
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
555 #define IVAN_LEVEL 7
556 #define DARK_LEVEL 8
557 #define OREE_LAIR 12
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
568 // appropriate
570 #define RECTANGLE 1
571 #define ROUND_CORNERS 2
573 /* Gods, 0 == none */
575 #define GODS 15
577 #define VALPURUS 1
578 #define LEGIFER 2
579 #define ATAVUS 3
580 #define DULCIS 4
581 #define SEGES 5
582 #define SOPHOS 6
583 #define TERRA 7
584 #define SILVA 7
585 #define LORICATUS 8
586 #define MELLIS 9
587 #define CLEPTIA 10
588 #define NEFAS 11
589 #define SCABIES 12
590 #define INFUSCOR 13
591 #define CRUENTUS 14
592 #define MORTIFER 15
593 #define ATHEIST 16
594 #define SOLICITU 17
596 #define MAX_PRICE (2147483647)
598 #define PERMANENT 0xFFFF
600 #define MISSED 0
601 #define HIT 1
602 #define CATCHED 2
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
610 #define BEAM_HASTE 4
611 #define BEAM_SLOW 5
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 */
642 #define NO_FLAGS 0
643 #define SECRET 1
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
651 #define SRC_EVIL 128
652 #define SRC_GOOD 256
653 #define SRC_FLAGS (8|16|32|64|128|256)
654 #define RANDOMIZABLE (DUR_FLAGS|SRC_FLAGS)
656 #define MAP_HIDDEN 0
657 #define SHOW_MAP_IN_TRUE_LIGHT 1
658 #define SHOW_MAP_IN_UNIFORM_LIGHT 2
660 #define DIM_LUMINANCE 0x6E6E6E
662 #define SUPER 64
663 #define BROKEN 128
664 #define WINDOW 1024
666 /* item flags */
668 #define CANNIBALIZED 4
669 #define SQUARE_POSITION_BITS (16|32|64)
670 #define SQUARE_POSITION_SHIFT 4
672 /* bodypart flags */
674 #define UNIQUE 128
675 #define BADLY_HURT 256
676 #define STUCK 512
677 #define BODYPART_SPARKLE_SHIFT 9
679 #define NO_BROKEN 1
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)
706 #define DESERT 1
707 #define JUNGLE 2
708 #define STEPPE 3
709 #define LEAFY_FOREST 4
710 #define EVERGREEN_FOREST 5
711 #define TUNDRA 6
712 #define GLACIER 7
714 #define NO_MOVE 0
715 #define WALK 1
716 #define SWIM 2
717 #define FLY 4
718 #define ETHEREAL 8
719 #define ANY_MOVE 15
721 #define KEY_UP_INDEX 1
722 #define KEY_LEFT_INDEX 3
723 #define KEY_RIGHT_INDEX 4
724 #define KEY_DOWN_INDEX 6
726 #define NO_ACTION 0
727 #define SUCCESS 1
728 #define BLOCKED 2
730 #define STACK_SLOT 1
731 #define CHARACTER_SLOT 2
732 #define GEAR_SLOT 3
734 #define NOT_RUSTED 0
735 #define SLIGHTLY_RUSTED 1
736 #define RUSTED 2
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
751 #define WON 0
752 #define LOST 1
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 */
772 #define INSIDE 4
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
784 accurate results */
786 #define BALANCED_CREATE_ITEM_ITERATIONS 100
788 #define CONFIG_TABLE_SIZE 256
790 #define SPARKLE_POS_X_ERROR 128
792 #define SKIN_COLOR 1
793 #define CAP_COLOR 2
794 #define HAIR_COLOR 4
795 #define EYE_COLOR 8
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\
806 |TORSO_MAIN_COLOR\
807 |ARM_MAIN_COLOR\
808 |GAUNTLET_COLOR\
809 |LEG_MAIN_COLOR)
811 /* contentscript<character> flags */
813 #define IS_LEADER 1
814 #define IS_MASTER 2
816 /* stack flags */
818 /* If set, all items are always considered visible, so CanBeSeenBy calls
819 become unneeded */
821 #define HIDDEN 1
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 */
828 #define FREEZED 2
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
851 #define MIN_EXP 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 */
861 #define FAINTING 0
862 #define EXHAUSTED 1
863 #define UNTIRED 2
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
878 /* action flags */
880 #define IN_DND_MODE 1
881 #define TERMINATING 2
883 /* fluid flags */
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
900 #define TAKE_ITEMS 2
901 #define GIVE_ITEMS 4
902 #define ISSUE_COMMANDS 8
903 #define CHAT_IDLY 16
905 #define NO_PARAMETERS 0xFF
907 #define CURSOR_TYPES 4
909 #define DARK_CURSOR 0
910 #define RED_CURSOR 1
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
926 #define BLUNT 1
927 #define SLASH 2
928 #define PIERCE 4
930 #define SILHOUETTE_TYPES 2
932 #define SILHOUETTE_NORMAL 0
933 #define SILHOUETTE_INTER_LACED 1
935 #define WARNED 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
946 /* Death flags */
948 #define FORCE_MSG 1
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 */
958 #define C_PLAYER 4
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 /*************************/
968 /* CommonFlags */
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
977 /* NameFlags */
978 #define USE_AN 1
979 #define USE_ADJECTIVE_AN 2
980 #define NO_ARTICLE 4 // for instance "Petrus's wive number 4"
981 #define FORCE_THE 8
982 #define SHOW_MATERIAL 16 // only works for terrains
984 /* Spatial Flags (unused for now) */
985 #define MF_OBJECT 256
986 #define MF_FLOOR 512
987 #define MF_CEIL 1024
988 #define MF_WALL 2048
989 #define MF_ONFLOOR 4096
990 #define MF_LOWWALL 8192
991 #define MF_TABLE 16384
992 #define MF_WINDOW 128
993 #define MF_LARGE 64
994 #define MF_STAIR 32
996 /****************************/
997 /* Character DataBase flags */
998 /****************************/
1000 /* CommonFlags */
1001 /* NameFlags */
1003 /* BodyFlags */
1004 #define HAS_HEAD
1005 #define HAS_EYES
1006 #define HAS_A_LEG
1007 #define SPILLS_BLOOD
1008 #define SWEATS
1009 #define USES_NUTRITION
1010 #define ALWAYS_USE_MATERIAL_ATTRIBUTES
1011 #define IS_ENORMOUS
1012 #define IS_EXTRA_FRAGILE
1013 #define IS_PLANT
1014 #define IS_ROOTED
1016 /* AbilityFlags */
1017 #define CAN_USE_EQUIPMENT
1018 #define CAN_KICK
1019 #define CAN_TALK
1020 #define CAN_READ
1021 #define CAN_OPEN
1022 #define CAN_ZAP
1023 #define CAN_THROW
1024 #define CAN_APPLY
1025 #define CAN_HEAR
1027 /* CopyrightFlags */
1028 #define IS_UNIQUE
1029 #define CAN_BE_GENERATED
1030 #define CAN_BE_NAMED
1032 /* EffectFlags; */
1033 #define BODY_PARTS_DISAPPEAR_WHEN_SEVERED
1034 #define DESTROYS_WALLS
1035 #define BITE_CAPTURES_BODY_PART
1037 /* ImmunityFlags */
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
1048 /* MiscFlags */
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 /***********************/
1059 /* CommonFlags */
1060 /* NameFlags */
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
1077 /* CategoryFlags */
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
1084 /* MiscFlags */
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
1091 #define ALLOW_EQUIP
1093 /**************************/
1094 /* Terrain DataBase flags */
1095 /**************************/
1097 /* CommonFlags */
1098 /* NameFlags */
1100 /* OLTerrainFlags */
1101 #define CREATE_LOCK_CONFIGURATIONS 2
1102 #define CREATE_WINDOW_CONFIGURATIONS 4
1103 #define IS_UP_LINK
1104 #define IS_WALL
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 /***************************/
1114 /* CommonFlags */
1115 /* NameFlags (only USE_AN) */
1117 /* CategoryFlags */
1118 #define IS_METAL 1
1119 #define IS_BLOOD 2
1120 #define CAN_BE_TAILORED 4
1121 #define IS_SPARKLING 8
1122 #define IS_SCARY 16
1123 #define IS_GOLEM_MATERIAL 32
1124 #define IS_BEVERAGE 64
1126 /* BodyFlags */
1127 #define IS_ALIVE 1
1128 #define IS_WARM 2
1129 #define CAN_HAVE_PARASITE 4
1130 #define USE_MATERIAL_ATTRIBUTES 8
1131 #define CAN_REGENERATE 16
1133 /* InteractionFlags */
1134 #define CAN_BURN 1
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
1152 #define TALENTS 4
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)
1161 /* room flags */
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
1173 #endif