it is not possible to extend enums/bitsets in script; fixed ":=" syntax for enums...
[k8-i-v-a-n.git] / src / game / ivandef.h.old
blobed39b9134e5a56d3e9d7ad948fe1fb7700a3072a
1 /*
2  *
3  *  Iter Vehemens ad Necem (IVAN)
4  *  Copyright (C) Timo Kiviluoto
5  *  Released under the GNU General
6  *  Public License
7  *
8  *  See LICENSING which should be included
9  *  along with this file for more details
10  *
11  */
12 #ifndef __IVANDEF_H__
13 #define __IVANDEF_H__
16  * Global defines for the project IVAN.
17  * This file is created to decrease the need of including headers in
18  * other headers just for the sake of some silly macros, because it
19  * decreases compilation efficiency and may cause cross-including
20  *
21  * List of macros that should be gathered here:
22  * 1. all numeric defines used in multiple .cpp or .h files
23  *    except those #defined in balance.h and confdef.h
24  * 2. all inline functions used in multiple .cpp or .h files
25  *    and independent enough (do not require other headers)
26  * 3. class construction macros used in multiple .h files
27  */
29 #include "ivancommon.h"
31 #include "v2.h"
32 #include "festring.h"
34 #define IVAN_VERSION "0.666.2"
36 class item;
37 class material;
38 class character;
40 typedef const item citem;
41 typedef const material cmaterial;
42 typedef const character ccharacter;
44 struct databasebase
46   int Config;
47   feuLong CommonFlags;
48   feuLong NameFlags;
49   festring CfgStrName;
52 template <class type, class base, class prototype>
53 class sysbase : public base
55  public:
56   typedef sysbase<type, base, prototype> mybase;
57   static type* Spawn(int Config = 0, int SpecialFlags = 0)
58   {
59     type* T = new type;
60     T->Initialize(Config, SpecialFlags);
61     return T;
62   }
64   virtual ~sysbase () {}
66   static type* Clone(const type* T) { return new type(*T); }
67   virtual const prototype* FindProtoType() const { return &ProtoType; }
68   static const prototype ProtoType;
71 template <class type, class base, class prototype>
72 class simplesysbase : public base
74  public:
75   typedef simplesysbase<type, base, prototype> mybase;
76   static type* Spawn() { return new type; }
78   virtual ~simplesysbase () {}
80   virtual const prototype* GetProtoType() const { return &ProtoType; }
81   static const prototype ProtoType;
84 #define SYSTEM_SPECIALIZATIONS(name)\
85 name##prototype** name##_ProtoData;\
86 valuemap name##_CodeNameMap;\
87 int name##_ProtoSize;\
89 template<> name##prototype**& protocontainer<name>::GetProtoData()\
90 { return name##_ProtoData; }\
91 template<> valuemap& protocontainer<name>::GetCodeNameMap()\
92 { return name##_CodeNameMap; }\
93 template<> int& protocontainer<name>::GetSizeRef()\
94 { return name##_ProtoSize; }
96 #define EXTENDED_SYSTEM_SPECIALIZATIONS(name)\
97 SYSTEM_SPECIALIZATIONS(name)\
98 databasecreator<name>::databasemembermap name##_DataBaseMemberMap;\
99 template<> databasecreator<name>::databasemembermap&\
100 databasecreator<name>::GetDataBaseMemberMap()\
101 { return name##_DataBaseMemberMap; }\
102 const name##prototype name::ProtoType
104 #define DATA_BASE_VALUE(type, data) type Get##data() const { return DataBase->data; }
105 #define DATA_BASE_VALUE_WITH_PARAMETER(type, data, param) type Get##data(param) const { return DataBase->data; }
106 #define DATA_BASE_TRUTH(data) truth data() const { return DataBase->data; }
107 #define DATA_BASE_TRUTH_WITH_PARAMETER(data, param) truth data(param) const { return DataBase->data; }
109 #define HAS_HIT 0
110 #define HAS_BLOCKED 1
111 #define HAS_DODGED 2
112 #define HAS_DIED 3
113 #define DID_NO_DAMAGE 4
114 #define HAS_FAILED 5
116 #define OVER_FED_LEVEL 175000
117 #define BLOATED_LEVEL 150000
118 #define SATIATED_LEVEL 100000
119 #define NOT_HUNGER_LEVEL 30000
120 #define HUNGER_LEVEL 20000
121 #define VERY_HUNGER_LEVEL 10000
123 #define OVER_LOADED 0
124 #define STRESSED 1
125 #define BURDENED 2
126 #define UNBURDENED 3
128 #define STARVING 0
129 #define VERY_HUNGRY 1
130 #define HUNGRY 2
131 #define NOT_HUNGRY 3
132 #define SATIATED 4
133 #define BLOATED 5
134 #define OVER_FED 6
136 #define STATES 25
138 #define POLYMORPHED (1 << 0)
139 #define HASTE (1 << 1)
140 #define SLOW (1 << 2)
141 #define POLYMORPH_CONTROL (1 << 3)
142 #define LIFE_SAVED (1 << 4)
143 #define LYCANTHROPY (1 << 5)
144 #define INVISIBLE (1 << 6)
145 #define INFRA_VISION (1 << 7)
146 #define ESP (1 << 8)
147 #define POISONED (1 << 9)
148 #define TELEPORT (1 << 10)
149 #define POLYMORPH (1 << 11)
150 #define TELEPORT_CONTROL (1 << 12)
151 #define PANIC (1 << 13)
152 #define CONFUSED (1 << 14)
153 #define PARASITIZED (1 << 15)
154 #define SEARCHING (1 << 16)
155 #define GAS_IMMUNITY (1 << 17)
156 #define LEVITATION (1 << 18)
157 #define LEPROSY (1 << 19)
158 #define HICCUPS (1 << 20)
159 #define VAMPIRISM (1 << 21)
160 #define DETECTING (1 << 22)
161 #define ETHEREAL_MOVING (1 << 23)
162 #define FEARLESS (1 << 24)
164 #define THROW_ITEM_TYPES 5
165 /*ThrowFlags */
166 #define THROW_BONE (1 << 0)
167 #define THROW_POTION (1 << 1)
168 #define THROW_AXE (1 << 2)
169 #define THROW_GAS_GRENADE (1 << 3)
170 #define THROW_WAND (1 << 4)
172 #define TORSO 1
173 #define HEAD 2
174 #define RIGHT_ARM 4
175 #define LEFT_ARM 8
176 #define ARMS 12
177 #define GROIN 16
178 #define RIGHT_LEG 32
179 #define LEFT_LEG 64
180 #define LEGS 96
181 #define OTHER 128
182 #define ALL 255
184 #define PHYSICAL_DAMAGE 1
185 #define SOUND 2
186 #define ACID 4
187 #define FIRE 8
188 #define ELECTRICITY 16
189 #define ENERGY 32
190 #define POISON 64
191 #define DRAIN 128
192 #define MUSTARD_GAS_DAMAGE 256
193 #define PSI 512
194 #define THROW 32768
197 #define UNDEFINED 0
198 #define MALE 1
199 #define FEMALE 2
200 #define TRANSSEXUAL 3
202 #define ALL_BODYPART_FLAGS 0x7F
204 /* The maximum bodyparts a character can have */
206 #define MAX_BODYPARTS 7
207 #define HUMANOID_BODYPARTS 7
209 #define TORSO_INDEX 0
210 #define HEAD_INDEX 1
211 #define RIGHT_ARM_INDEX 2
212 #define LEFT_ARM_INDEX 3
213 #define GROIN_INDEX 4
214 #define RIGHT_LEG_INDEX 5
215 #define LEFT_LEG_INDEX 6
217 #define NONE_INDEX MAX_BODYPARTS
219 #define DIRECTION_COMMAND_KEYS 8
220 #define EXTENDED_DIRECTION_COMMAND_KEYS 9
221 #define YOURSELF 8
222 #define RANDOM_DIR 9
224 #ifndef LIGHT_BORDER
225 #define LIGHT_BORDER 80
226 #endif
228 #define ALPP 0
229 #define ALP 1
230 #define AL 2
231 #define ALM 3
232 #define ANP 4
233 #define AN 5
234 #define ANM 6
235 #define ACP 7
236 #define AC 8
237 #define ACM 9
238 #define ACMM 10
240 #define UNARTICLED 0
241 #define PLURAL 1
242 #define ARTICLE_BIT 2
243 #define DEFINITE 2
244 #define INDEFINE_BIT 4
245 #define INDEFINITE 6
246 #define STRIPPED 8
248 #define TRANSPARENT_COLOR 0xF81F // pink
250 #define RAW_TYPES 7
252 #define GR_GLTERRAIN 0
253 #define GR_OLTERRAIN 1
254 #define GR_ITEM 2
255 #define GR_CHARACTER 3
256 #define GR_HUMANOID 4
257 #define GR_EFFECT 5
258 #define GR_CURSOR 6
260 #define GRAPHIC_TYPES 4
262 #define GR_WTERRAIN 0
263 #define GR_FOW 1
264 #define GR_SYMBOL 2
265 #define GR_SMILEY 3
267 /* SpecialFlags for graphics system. No one knows what "ST_" means... */
269 #define ST_NORMAL 0
270 #define ST_RIGHT_ARM 8
271 #define ST_LEFT_ARM 16
272 #define ST_GROIN 24
273 #define ST_RIGHT_LEG 32
274 #define ST_LEFT_LEG 40
275 #define ST_OTHER_BODYPART 48
276 #define ST_WIELDED 56
277 #define ST_CLOAK 64
278 #define ST_LIGHTNING 128
279 #define ST_DISALLOW_R_COLORS 256
280 #define ST_FLAME_1 512
281 #define ST_FLAME_2 1024
282 #define ST_FLAME_3 2048
283 #define ST_FLAME_4 4096
284 #define ST_FLAMES (ST_FLAME_1|ST_FLAME_2|ST_FLAME_3|ST_FLAME_4)
285 #define ST_FLAME_SHIFT 9
287 #define WOBBLE 1
288 #define WOBBLE_HORIZONTALLY_BIT 2
289 #define WOBBLE_VERTICALLY WOBBLE
290 #define WOBBLE_HORIZONTALLY (WOBBLE|WOBBLE_HORIZONTALLY_BIT)
291 #define WOBBLE_SPEED_SHIFT 2
292 #define WOBBLE_SPEED_RANGE (3 << WOBBLE_SPEED_SHIFT)
293 #define WOBBLE_FREQ_SHIFT 4
294 #define WOBBLE_FREQ_RANGE (3 << WOBBLE_FREQ_SHIFT)
296 cv2 SILHOUETTE_SIZE(48, 64);
298 #define ITEM_CATEGORIES 18
300 #define ANY_CATEGORY 0x7FFFFFFF
301 #define HELMET (1 << 0)
302 #define AMULET (1 << 1)
303 #define CLOAK (1 << 2)
304 #define BODY_ARMOR (1 << 3)
305 #define WEAPON (1 << 4)
306 #define SHIELD (1 << 5)
307 #define RING (1 << 6)
308 #define GAUNTLET (1 << 7)
309 #define BELT (1 << 8)
310 #define BOOT (1 << 9)
311 #define FOOD (1 << 10)
312 #define POTION (1 << 11)
313 #define SCROLL (1 << 12)
314 #define BOOK (1 << 13)
315 #define WAND (1 << 14)
316 #define TOOL (1 << 15)
317 #define VALUABLE (1 << 16)
318 #define MISC (1 << 17)
320 #define GOOD 1
321 #define NEUTRAL 2
322 #define EVIL 3
323 // new
324 #define TOPPLED 4
326 /* ConsumeTypes */
328 #define CT_FRUIT 1
329 #define CT_MEAT 2
330 #define CT_METAL 4
331 #define CT_MINERAL 8
332 #define CT_LIQUID 16
333 #define CT_BONE 32
334 #define CT_PROCESSED 64
335 #define CT_MISC_ORGANIC 128
336 #define CT_PLASTIC 256
337 #define CT_GAS 512
339 /* Possible square positions for item. The first four are used for items
340    on walls */
342 #define LEFT 0
343 #define DOWN 1
344 #define UP 2
345 #define RIGHT 3
346 #define CENTER 4 // item on ground
348 #define HOSTILE 1
349 #define UNCARING 2
350 #define FRIEND 4
352 #define MARTIAL_SKILL_CATEGORIES 3
353 #define WEAPON_SKILL_CATEGORIES 11
355 #define UNARMED 0
356 #define KICK 1
357 #define BITE 2
358 #define UNCATEGORIZED 3
359 #define SMALL_SWORDS 4
360 #define LARGE_SWORDS 5
361 #define BLUNT_WEAPONS 6
362 #define AXES 7
363 #define POLE_ARMS 8
364 #define WHIPS 9
365 #define SHIELDS 10
367 #define LOCKED 1
369 #define EFFECT_NOTHING 0
370 #define EFFECT_POISON 1
371 #define EFFECT_DARKNESS 2
372 #define EFFECT_OMMEL_URINE 3
373 #define EFFECT_PEPSI 4
374 #define EFFECT_KOBOLD_FLESH 5
375 #define EFFECT_HEAL 6
376 #define EFFECT_LYCANTHROPY 7
377 #define EFFECT_SCHOOL_FOOD 8
378 #define EFFECT_ANTIDOTE 9
379 #define EFFECT_CONFUSE 10
380 #define EFFECT_POLYMORPH 11
381 #define EFFECT_ESP 12
382 #define EFFECT_SKUNK_SMELL 13
383 #define EFFECT_MAGIC_MUSHROOM 14
384 #define EFFECT_TRAIN_PERCEPTION 15
385 #define EFFECT_HOLY_BANANA 16
386 #define EFFECT_EVIL_WONDER_STAFF_VAPOUR 17
387 #define EFFECT_GOOD_WONDER_STAFF_VAPOUR 18
388 #define EFFECT_PEA_SOUP 19
389 #define EFFECT_BLACK_UNICORN_FLESH 20
390 #define EFFECT_GRAY_UNICORN_FLESH 21
391 #define EFFECT_WHITE_UNICORN_FLESH 22
392 #define EFFECT_TELEPORT_CONTROL 23
393 #define EFFECT_MUSHROOM 24
394 #define EFFECT_OMMEL_CERUMEN 25
395 #define EFFECT_OMMEL_SWEAT 26
396 #define EFFECT_OMMEL_TEARS 27
397 #define EFFECT_OMMEL_SNOT 28
398 #define EFFECT_OMMEL_BONE 29
399 #define EFFECT_MUSTARD_GAS 30
400 #define EFFECT_MUSTARD_GAS_LIQUID 31
401 // new; wtf is EFFECT_PANIC?
402 #define EFFECT_PANIC 32
403 #define EFFECT_TELEPORT 33
404 #define EFFECT_VAMPIRISM 34
405 #define EFFECT_DETECTING 35
406 #define EFFECT_HOLY_MANGO 36
408 /* CEM = Consume End Message */
410 #define CEM_NOTHING 0
411 #define CEM_SCHOOL_FOOD 1
412 #define CEM_BONE 2
413 #define CEM_FROG_FLESH 3
414 #define CEM_OMMEL 4
415 #define CEM_PEPSI 5
416 #define CEM_KOBOLD_FLESH 6
417 #define CEM_HEALING_LIQUID 7
418 #define CEM_ANTIDOTE 8
419 #define CEM_ESP 9
420 #define CEM_HOLY_BANANA 10
421 #define CEM_PEA_SOUP 11
422 #define CEM_BLACK_UNICORN_FLESH 12
423 #define CEM_GRAY_UNICORN_FLESH 13
424 #define CEM_WHITE_UNICORN_FLESH 14
425 #define CEM_OMMEL_BONE 15
426 // new
427 #define CEM_LIQUID_HORROR 16
428 #define CEM_HOLY_MANGO 17
429 // alien mod
430 #define CEM_ALIEN_FLESH 18
432 /* HM = Hit Message */
434 #define HM_NOTHING 0
435 #define HM_SCHOOL_FOOD 1
436 #define HM_FROG_FLESH 2
437 #define HM_OMMEL 3
438 #define HM_PEPSI 4
439 #define HM_KOBOLD_FLESH 5
440 #define HM_HEALING_LIQUID 6
441 #define HM_ANTIDOTE 7
442 #define HM_CONFUSE 8
443 #define HM_HOLY_BANANA 9
444 #define HM_HOLY_MANGO 10
445 // alien mod
446 #define HM_ALIEN_FLESH 11
448 #define UNARMED_ATTACK 0
449 #define WEAPON_ATTACK 1
450 #define KICK_ATTACK 2
451 #define BITE_ATTACK 3
452 #define THROW_ATTACK 4
454 #define USE_ARMS 1
455 #define USE_LEGS 2
456 #define USE_HEAD 4
458 #define ATTRIBUTES 11
459 #define BASE_ATTRIBUTES 7
461 #define ENDURANCE 0
462 #define PERCEPTION 1
463 #define INTELLIGENCE 2
464 #define WISDOM 3
465 #define WILL_POWER 4
466 #define CHARISMA 5
467 #define MANA 6
469 #define ARM_STRENGTH 7
470 #define LEG_STRENGTH 8
471 #define DEXTERITY 9
472 #define AGILITY 10
474 #define F_ENDURANCE (1 << ENDURANCE)
475 #define F_PERCEPTION (1 << PERCEPTION)
476 #define F_INTELLIGENCE (1 << INTELLIGENCE)
477 #define F_WISDOM (1 << WISDOM)
478 #define F_WILL_POWER (1 << WILL_POWER)
479 #define F_CHARISMA (1 << CHARISMA)
480 #define F_MANA (1 << MANA)
482 #define F_ARM_STRENGTH (1 << ARM_STRENGTH)
483 #define F_LEG_STRENGTH (1 << LEG_STRENGTH)
484 #define F_DEXTERITY (1 << DEXTERITY)
485 #define F_AGILITY (1 << AGILITY)
487 #define NO 0
488 #define YES 1
489 #define REQUIRES_ANSWER -1
491 #define DIR_ERROR 0xFF
493 #define MAX_EQUIPMENT_SLOTS 13
495 #define HELMET_INDEX 0
496 #define AMULET_INDEX 1
497 #define CLOAK_INDEX 2
498 #define BODY_ARMOR_INDEX 3
499 #define BELT_INDEX 4
500 #define RIGHT_WIELDED_INDEX 5
501 #define LEFT_WIELDED_INDEX 6
502 #define RIGHT_RING_INDEX 7
503 #define LEFT_RING_INDEX 8
504 #define RIGHT_GAUNTLET_INDEX 9
505 #define LEFT_GAUNTLET_INDEX 10
506 #define RIGHT_BOOT_INDEX 11
507 #define LEFT_BOOT_INDEX 12
509 #define WORLD_MAP 255
511 #define DEFAULT_TEAM 0xFF
513 /* Hard-coded teams */
514 #define PLAYER_TEAM 0
515 #define MONSTER_TEAM 1
516 #define ATTNAM_TEAM 2
517 #define SUMO_TEAM 3
518 #define VALPURUS_ANGEL_TEAM 4
519 #define GC_SHOPKEEPER_TEAM 5
520 #define IVAN_TEAM 6
521 #define NEW_ATTNAM_TEAM 7
522 #define COLONIST_TEAM 8
523 #define TOURIST_GUIDE_TEAM 9
524 #define TOURIST_TEAM 10
525 #define BETRAYED_TEAM 11
526 #define MONDEDR_TEAM 12
527 #define KHARAZ_ARAD_TEAM 13
528 #define FORESTMAN_TEAM 14
529 #define SOLICITUS_TEAM 15
530 #define MORBE_TEAM 16
531 #define XINROCH_TOMB_ENTRY_TEAM 17
532 #define XINROCH_TOMB_NECRO_TEAM 18
533 #define XINROCH_TOMB_KAMIKAZE_DWARF_TEAM 19
534 #define PRISONER_TEAM 20
535 #define NO_TEAM 0xFFFF
537 #define LOAD 1
538 #define NO_PIC_UPDATE 2
539 #define NO_EQUIPMENT_PIC_UPDATE (NO_PIC_UPDATE << 1)
540 #define NO_MATERIALS 8
541 #define NO_EQUIPMENT 16
542 #define NO_SIGNALS 32
544 #define NOT_WALKABLE 1
545 #define HAS_CHARACTER 2
546 #define IN_ROOM 4
547 #define NOT_IN_ROOM 8
548 #define ATTACHABLE (16|NOT_IN_ROOM) /* overrides IN_ROOM */
549 #define HAS_NO_OTERRAIN 32
551 #define DEFAULT_ATTACHED_AREA 0xFE
552 #define DEFAULT_ATTACHED_ENTRY 0xFE
553 #define NO_ENTRY 0
555 #define RANDOM 0
556 #define ELPURI_CAVE 1
557 #define ATTNAM 2
558 #define NEW_ATTNAM 3
559 #define UNDER_WATER_TUNNEL 4
560 #define MONDEDR 5
561 #define MUNTUO 6
562 #define DRAGON_TOWER 7
563 #define DARK_FOREST 8
564 #define XINROCH_TOMB 9
565 // alien mod
566 #define ALIEN_VESSEL 10
568 #define KHARAZ_ARAD_SHOP 127
569 #define UNDER_WATER_TUNNEL_EXIT 128
571 //#define VESANA_LEVEL 2
572 //#define CRYSTAL_LEVEL 3
573 //#define SPIDER_LEVEL 4
574 //#define ENNER_BEAST_LEVEL 4
575 #define ZOMBIE_LEVEL 5
576 //#define IVAN_LEVEL 7
577 #define DARK_LEVEL 8
578 #define OREE_LAIR 12
580 // alien mod
581 //#define ALIENQUEEN_LEVEL 6
583 //#define DUAL_ENNER_BEAST_LEVEL 5
584 //#define NECRO_CHAMBER_LEVEL 6
586 /* stack::DrawContents flags */
588 #define NO_SELECT 1       // only show items
589 #define NO_MULTI_SELECT 2     // select only one item
590 #define NO_SPECIAL_INFO 4     // show only name and amount
591 #define REMEMBER_SELECTED 8   // if DrawContents will be called multiple times,
592             // remember the selected item
593 #define NONE_AS_CHOICE 16     // "none" is a choice, for instance when wielding
594 #define SELECT_PAIR 32        // if NO_MULTI_SELECT is on, selects a pair if
595             // appropriate
597 #define RECTANGLE 1
598 #define ROUND_CORNERS 2
599 #define MAZE_ROOM 3
601 /* Gods, 0 == none */
603 #define GODS 15
605 #define VALPURUS 1
606 #define LEGIFER 2
607 #define ATAVUS 3
608 #define DULCIS 4
609 #define SEGES 5
610 #define SOPHOS 6
611 #define TERRA 7
612 #define SILVA 7
613 #define LORICATUS 8
614 #define MELLIS 9
615 #define CLEPTIA 10
616 #define NEFAS 11
617 #define SCABIES 12
618 #define INFUSCOR 13
619 #define CRUENTUS 14
620 #define MORTIFER 15
621 #define ATHEIST 16
622 #define SOLICITU 17
624 #define MAX_PRICE  (2147483647)
626 #define PERMANENT 0xFFFF
628 #define MISSED 0
629 #define HIT 1
630 #define CATCHED 2
632 #define BEAM_EFFECTS 13
634 #define BEAM_POLYMORPH 0
635 #define BEAM_STRIKE 1
636 #define BEAM_FIRE_BALL 2
637 #define BEAM_TELEPORT 3
638 #define BEAM_HASTE 4
639 #define BEAM_SLOW 5
640 #define BEAM_RESURRECT 6
641 #define BEAM_INVISIBILITY 7
642 #define BEAM_DUPLICATE 8
643 #define BEAM_LIGHTNING 9
644 #define BEAM_DOOR_CREATION 10
645 #define BEAM_ACID_RAIN 11
646 #define BEAM_NECROMANCY 12
648 #define BEAM_STYLES 3
650 #define PARTICLE_BEAM 0
651 #define LIGHTNING_BEAM 1
652 #define SHIELD_BEAM 2
654 #define RANDOM_COLOR 0x10000
656 /* Entry indices, not actual config defines */
658 #define STAIRS_UP 100
659 #define STAIRS_DOWN 200
660 #define WAYPOINT_DEEPER 1100
661 #define WAYPOINT_SHALLOWER 1200
662 //#define FOUNTAIN 0xFFFF  // in confdef.h
664 #define NO_LIMIT 0xFFFF
666 #define ALL_ITEMS 0xFFFF
668 /* StateData flags */
670 #define NO_FLAGS 0
671 #define SECRET 1
672 #define DUR_TEMPORARY 2
673 #define DUR_PERMANENT 4
674 #define DUR_FLAGS (2|4)
675 #define SRC_FOUNTAIN 8
676 #define SRC_MUSHROOM 16
677 #define SRC_MAGIC_MUSHROOM 32
678 #define SRC_CONFUSE_READ 64
679 #define SRC_EVIL 128
680 #define SRC_GOOD 256
681 #define SRC_FLAGS (8|16|32|64|128|256)
682 #define RANDOMIZABLE (DUR_FLAGS|SRC_FLAGS)
684 #define MAP_HIDDEN 0
685 #define SHOW_MAP_IN_TRUE_LIGHT 1
686 #define SHOW_MAP_IN_UNIFORM_LIGHT 2
688 #define DIM_LUMINANCE 0x6E6E6E
690 #define SUPER  64
691 #define BROKEN 128
692 #define WINDOW 1024
694 /* item flags */
696 #define CANNIBALIZED 4
697 #define SQUARE_POSITION_BITS (16|32|64)
698 #define SQUARE_POSITION_SHIFT 4
700 /* bodypart flags */
702 #define UNIQUE 128
703 #define BADLY_HURT 256
704 #define STUCK 512
705 #define BODYPART_SPARKLE_SHIFT 9
707 #define NO_BROKEN 1
708 #define IGNORE_BROKEN_PRICE 2
710 #define MAX_SQUARES_UNDER 16
711 #define MAX_NEIGHBOUR_SQUARES 20
713 #define N_LOCK_ID 1024
714 #define S_LOCK_ID 16384
715 #define LOCK_DELTA 1024
717 #define LOCK_BITS 0xFC00
719 #define BROKEN_LOCK S_LOCK_ID
721 /* Normal lock types, which can be randomized */
723 #define ROUND_LOCK (N_LOCK_ID + LOCK_DELTA * 1)
724 #define SQUARE_LOCK (N_LOCK_ID + LOCK_DELTA * 2)
725 #define TRIANGULAR_LOCK (N_LOCK_ID + LOCK_DELTA * 3)
727 /* Special lock types, which must be generated in the script */
729 #define HEXAGONAL_LOCK (S_LOCK_ID + LOCK_DELTA * 1)
730 #define OCTAGONAL_LOCK (S_LOCK_ID + LOCK_DELTA * 2)
731 #define HEART_SHAPED_LOCK (S_LOCK_ID + LOCK_DELTA * 3)
732 #define PENTAGONAL_LOCK (S_LOCK_ID + LOCK_DELTA * 4)
734 #define DESERT 1
735 #define JUNGLE 2
736 #define STEPPE 3
737 #define LEAFY_FOREST 4
738 #define EVERGREEN_FOREST 5
739 #define TUNDRA 6
740 #define GLACIER 7
742 #define NO_MOVE 0
743 #define WALK 1
744 #define SWIM 2
745 #define FLY  4
746 #define ETHEREAL 8
747 #define ANY_MOVE 15
749 #define KEY_UP_INDEX 1
750 #define KEY_LEFT_INDEX 3
751 #define KEY_RIGHT_INDEX 4
752 #define KEY_DOWN_INDEX 6
754 #define NO_ACTION 0
755 #define SUCCESS 1
756 #define BLOCKED 2
758 #define STACK_SLOT 1
759 #define CHARACTER_SLOT 2
760 #define GEAR_SLOT 3
762 #define NOT_RUSTED 0
763 #define SLIGHTLY_RUSTED 1
764 #define RUSTED 2
765 #define VERY_RUSTED 3
767 #define HUMAN_BODY_ARMOR_PIXELS 68
769 #define ARMOR_OUTLINE_PRIORITY ((7 << 4) + 7)
770 #define CLOAK_PRIORITY ((8 << 4) + 7)
772 #define BODY_ARMOR_PARTS 6
774 #define SUMO_ROOM_POS v2(25, 35)
775 #define SUMO_ARENA_POS v2(19, 12)
777 #define MAX_RAIN_DROPS 32
779 #define WON 0
780 #define LOST 1
781 #define DISQUALIFIED 2
783 #define EMITTER_IDENTIFIER_BITS 0xFFFF
784 #define EMITTER_SQUARE_PART_BITS 0xF000000
785 #define EMITTER_SHADOW_BITS 0xF0000000
786 #define EMITTER_SQUARE_PART_SHIFT 24
787 #define EMITTER_SHADOW_SHIFT 28
789 #define RE_SUN_EMITATED 0x200000
790 #define ID_X_COORDINATE 0x400000
791 #define ID_BEGIN 0x800000
793 #define FORCE_ADD 0x400000
794 #define SECONDARY_SUN_LIGHT 0x800000
796 /* square & lsquare flags */
798 #define ALLOW_EMITATION_CONTINUE 1
799 #define FREEZED 2 /* also a stack flag */
800 #define INSIDE 4
801 #define NEW_DRAW_REQUEST 8
802 #define STRONG_BIT 16
803 #define STRONG_NEW_DRAW_REQUEST (NEW_DRAW_REQUEST|STRONG_BIT)
804 #define DESCRIPTION_CHANGE 32
805 #define MEMORIZED_UPDATE_REQUEST 128
806 #define IN_SQUARE_STACK 256
807 #define CHECK_SUN_LIGHT_NEEDED 512
808 #define IS_TRANSPARENT 1024
809 #define PERFECTLY_QUADRI_HANDLED 2048
811 /* Slows down protosystem::BalancedCreateItem() but makes it produce more
812    accurate results */
814 #define BALANCED_CREATE_ITEM_ITERATIONS 100
816 #define CONFIG_TABLE_SIZE 256
818 #define SPARKLE_POS_X_ERROR 128
820 #define SKIN_COLOR 1
821 #define CAP_COLOR 2
822 #define HAIR_COLOR 4
823 #define EYE_COLOR 8
824 #define TORSO_MAIN_COLOR 16
825 #define BELT_COLOR 32
826 #define BOOT_COLOR 64
827 #define TORSO_SPECIAL_COLOR 128
828 #define ARM_MAIN_COLOR 256
829 #define GAUNTLET_COLOR 512
830 #define ARM_SPECIAL_COLOR 1024
831 #define LEG_MAIN_COLOR 2048
832 #define LEG_SPECIAL_COLOR 4096
833 #define CLOTH_COLOR (CAP_COLOR\
834         |TORSO_MAIN_COLOR\
835         |ARM_MAIN_COLOR\
836         |GAUNTLET_COLOR\
837         |LEG_MAIN_COLOR)
839 /* contentscript<character> flags */
841 #define IS_LEADER 1
842 #define IS_MASTER 2
844 /* stack flags */
846 /* If set, all items are always considered visible, so CanBeSeenBy calls
847    become unneeded */
849 #define HIDDEN 1
851 /* All costly updates (like emitation's) are avoided if this is set.
852    Allows much faster removing and adding items, but make sure the stack is
853    returned to the original state (excluding item order) before switching
854    this off. Note: also an lsquare flag */
856 #define FREEZED 2
858 /* End stack Flags */
860 #define SUN_BEAM_DIRECTIONS 48
862 /* Square part flags */
864 #define SP_TOP_LEFT 1
865 #define SP_TOP_RIGHT 2
866 #define SP_BOTTOM_LEFT 4
867 #define SP_BOTTOM_RIGHT 8
868 #define SP_TOP (SP_TOP_LEFT|SP_TOP_RIGHT)
869 #define SP_LEFT (SP_TOP_LEFT|SP_BOTTOM_LEFT)
870 #define SP_RIGHT (SP_TOP_RIGHT|SP_BOTTOM_RIGHT)
871 #define SP_BOTTOM (SP_BOTTOM_LEFT|SP_BOTTOM_RIGHT)
873 #define CONDITION_COLORS 5
875 #define NATURAL_MATERIAL_FORM 0x7FFF
877 #define EXP_DIVISOR 2e-8
878 #define EXP_MULTIPLIER 5e+7
879 #define MIN_EXP 5e+7
880 #define MAX_EXP 5e+10
882 #define HAS_BEEN_GENERATED 1
883 #define HAS_BEEN_SEEN 2
885 #define DEPENDS_ON_ATTRIBUTES 0xFFFF
887 /* Tiredness states */
889 #define FAINTING 0
890 #define EXHAUSTED 1
891 #define UNTIRED 2
893 #define DEFAULT_GENERATION_DANGER 0.05
894 #define ANGEL_GENERATION_DANGER 0.10
896 /* Duplication flags */
898 #define MIRROR_IMAGE 1
899 #define IGNORE_PROHIBITIONS 2
900 #define CHANGE_TEAM 4
901 #define LE_BASE_SHIFT 3
902 #define LE_BASE_RANGE 0x7FFF
903 #define LE_RAND_SHIFT 18
904 #define LE_RAND_RANGE 0x3FFF
906 /* action flags */
908 #define IN_DND_MODE 1
909 #define TERMINATING 2
911 /* fluid flags */
913 #define HAS_BODY_ARMOR_PICTURES 1
914 #define FLUID_INSIDE 2
916 #define COMMAND_FLAGS 4
917 #define ALL_COMMAND_FLAGS (1|2|4|8)
919 #define FOLLOW_LEADER 1
920 #define FLEE_FROM_ENEMIES 2
921 #define DONT_CHANGE_EQUIPMENT 4
922 #define DONT_CONSUME_ANYTHING_VALUABLE 8
924 #define CHAT_MENU_ENTRIES 5
925 #define ALL_MANAGEMENT_FLAGS (1|2|4|8|16)
927 #define CHANGE_EQUIPMENT 1
928 #define TAKE_ITEMS 2
929 #define GIVE_ITEMS 4
930 #define ISSUE_COMMANDS 8
931 #define CHAT_IDLY 16
933 #define NO_PARAMETERS 0xFF
935 #define CURSOR_TYPES 4
937 #define DARK_CURSOR 0
938 #define RED_CURSOR 1
939 #define BLUE_CURSOR 2
940 #define YELLOW_CURSOR 3
941 #define CURSOR_FLASH 0x2000
942 #define CURSOR_TARGET 0x4000
943 #define CURSOR_BIG 0x8000
944 #define CURSOR_FLAGS (CURSOR_BIG|CURSOR_FLASH|CURSOR_TARGET)
946 #define GRAY_FRACTAL 0
947 #define RED_FRACTAL 1
948 #define GREEN_FRACTAL 2
949 #define BLUE_FRACTAL 3
950 #define YELLOW_FRACTAL 4
952 #define DAMAGE_TYPES 3
954 #define BLUNT 1
955 #define SLASH 2
956 #define PIERCE 4
958 #define SILHOUETTE_TYPES 2
960 #define SILHOUETTE_NORMAL 0
961 #define SILHOUETTE_INTER_LACED 1
963 #define WARNED 1
964 #define HAS_CAUSED_PANIC 2
966 /* MaxHP calculation flags */
968 #define MAY_CHANGE_HPS 1
969 #define CHECK_USABILITY 2
971 #define ITEM_TRAP 0x8000
972 #define FLUID_TRAP 0x10000
974 /* Death flags */
976 #define FORCE_MSG 1
977 #define FORCE_DEATH 2
978 #define DISALLOW_CORPSE 4
979 #define DISALLOW_MSG 8
980 #define IGNORE_UNCONSCIOUSNESS 16
981 #define IGNORE_TRAPS 32
982 #define FORBID_REINCARNATION 64
984 /* character flags */
986 #define C_PLAYER 4
987 #define C_INITIALIZING 8
988 #define C_POLYMORPHED 16
989 #define C_IN_NO_MSG_MODE 32
990 #define C_PICTURE_UPDATES_FORBIDDEN 64
992 /*************************/
993 /* Common DataBase flags */
994 /*************************/
996 /* CommonFlags */
997 #define IS_ABSTRACT 1
998 #define HAS_SECONDARY_MATERIAL 2
999 #define CREATE_DIVINE_CONFIGURATIONS 4
1000 #define CAN_BE_WISHED 8
1001 #define CAN_BE_DESTROYED 16
1002 #define IS_VALUABLE 32
1003 #define CAN_BE_MIRRORED 64
1005 /* NameFlags */
1006 #define USE_AN 1
1007 #define USE_ADJECTIVE_AN 2
1008 #define NO_ARTICLE 4 // for instance "Petrus's wive number 4"
1009 #define FORCE_THE 8
1010 #define SHOW_MATERIAL 16 // only works for terrains
1012 /* Spatial Flags (unused for now) */
1013 #define MF_OBJECT  256
1014 #define MF_FLOOR   512
1015 #define MF_CEIL    1024
1016 #define MF_WALL    2048
1017 #define MF_ONFLOOR 4096
1018 #define MF_LOWWALL 8192
1019 #define MF_TABLE   16384
1020 #define MF_WINDOW  128
1021 #define MF_LARGE   64
1022 #define MF_STAIR   32
1024 /****************************/
1025 /* Character DataBase flags */
1026 /****************************/
1028 /* CommonFlags */
1029 /* NameFlags */
1031 /* BodyFlags */
1032 #define HAS_HEAD
1033 #define HAS_EYES
1034 #define HAS_A_LEG
1035 #define SPILLS_BLOOD
1036 #define SWEATS
1037 #define USES_NUTRITION
1038 #define ALWAYS_USE_MATERIAL_ATTRIBUTES
1039 #define IS_ENORMOUS
1040 #define IS_EXTRA_FRAGILE
1041 #define IS_PLANT
1042 #define IS_ROOTED
1044 /* AbilityFlags */
1045 #define CAN_USE_EQUIPMENT
1046 #define CAN_KICK
1047 #define CAN_TALK
1048 #define CAN_READ
1049 #define CAN_OPEN
1050 #define CAN_ZAP
1051 #define CAN_THROW
1052 #define CAN_APPLY
1053 #define CAN_HEAR
1055 /* CopyrightFlags */
1056 #define IS_UNIQUE
1057 #define CAN_BE_GENERATED
1058 #define CAN_BE_NAMED
1060 /* EffectFlags; */
1061 #define BODY_PARTS_DISAPPEAR_WHEN_SEVERED
1062 #define DESTROYS_WALLS
1063 #define BITE_CAPTURES_BODY_PART
1065 /* ImmunityFlags */
1066 #define IMMUNITY_POLYMORPH
1067 #define IMMUNITY_CHARM
1068 #define IMMUNITY_CLONING
1069 #define IMMUNITY_CONFUSE
1070 #define IMMUNITY_LEPROSY
1071 #define IMMUNITY_ITEM_TELEPORT
1072 #define IMMUNITY_STICKINESS
1073 #define IMMUNITY_CHOKING
1074 #define IMMUNITY_UNCONSCIOUSNESS
1076 /* MiscFlags */
1077 #define CREATE_GOLEM_MATERIAL_CONFIGURATIONS 2
1078 #define IGNORE_DANGER 4
1079 #define AUTOMATICALLY_SEEN 8
1080 #define WILL_CARRY_ITEMS 16
1081 #define IS_EXTRA_COWARD 32
1083 /***********************/
1084 /* Item DataBase flags */
1085 /***********************/
1087 /* CommonFlags */
1088 /* NameFlags */
1089 /* AttributeAffectFlags */
1091 /* GenerationFlags*/
1092 #define CREATE_LOCK_CONFIGURATIONS 2
1093 #define CAN_BE_AUTO_INITIALIZED 4 // used only in WMode
1094 #define CAN_BE_GENERATED_IN_CONTAINER 8
1095 #define CAN_BE_SPAWNED_BY_POLYMORPH 16
1097 /* InteractionFlags */
1098 #define MATERIAL_CAN_BE_CHANGED
1099 #define CAN_BE_POLYMORPHED
1100 #define CAN_BE_CLONED
1101 #define CAN_BE_ENCHANTED
1102 #define CAN_BE_BROKEN
1103 #define AFFECTS_CARRYING_CAPACITY
1105 /* CategoryFlags */
1106 #define IS_QUEST_ITEM
1107 #define CAN_BE_USED_BY_SMITH
1108 #define IS_KAMIKAZE_WEAPON
1109 #define IS_TWO_HANDED
1110 #define IS_GOOD_WITH_PLANTS
1112 /* MiscFlags */
1113 #define HANDLE_IN_PAIRS
1114 #define PRICE_IS_PROPORTIONAL_TO_ENCHANTMENT
1115 #define FLEXIBILITY_IS_ESSENTIAL
1116 #define HAS_NORMAL_PICTURE_DIRECTION
1117 #define CAN_BE_PILED
1118 #define CAN_BE_PICKED_UP
1119 #define ALLOW_EQUIP
1121 /**************************/
1122 /* Terrain DataBase flags */
1123 /**************************/
1125 /* CommonFlags */
1126 /* NameFlags */
1128 /* OLTerrainFlags */
1129 #define CREATE_LOCK_CONFIGURATIONS 2
1130 #define CREATE_WINDOW_CONFIGURATIONS 4
1131 #define IS_UP_LINK
1132 #define IS_WALL
1133 #define USE_BORDER_TILES
1134 #define IS_ALWAYS_TRANSPARENT
1135 #define SHOW_THINGS_UNDER
1136 #define IS_SAFE_TO_CREATE_DOOR
1138 /***************************/
1139 /* Material DataBase flags */
1140 /***************************/
1142 /* CommonFlags */
1143 /* NameFlags (only USE_AN) */
1145 /* CategoryFlags */
1146 #define IS_METAL 1
1147 #define IS_BLOOD 2
1148 #define CAN_BE_TAILORED 4
1149 #define IS_SPARKLING 8
1150 #define IS_SCARY 16
1151 #define IS_GOLEM_MATERIAL 32
1152 #define IS_BEVERAGE 64
1154 /* BodyFlags */
1155 #define IS_ALIVE 1
1156 #define IS_WARM 2
1157 #define CAN_HAVE_PARASITE 4
1158 #define USE_MATERIAL_ATTRIBUTES 8
1159 #define CAN_REGENERATE 16
1160 #define IS_WARM_BLOODED 32
1162 /* InteractionFlags */
1163 #define CAN_BURN 1
1164 #define CAN_EXPLODE 2
1165 #define CAN_DISSOLVE 4
1166 #define AFFECT_INSIDE 8
1167 #define EFFECT_IS_GOOD 16
1168 #define IS_AFFECTED_BY_MUSTARD_GAS 32
1170 /*************************/
1171 /* End of DataBase flags */
1172 /*************************/
1174 #define TILE_SIZE 16
1175 cv2 TILE_V2(TILE_SIZE, TILE_SIZE);
1177 #define SQUARE_INDEX_MASK 0xFFFF
1178 #define ALLOW_ANIMATE 0x10000
1179 #define ALLOW_ALPHA 0x20000
1181 #define TALENTS 4
1183 #define TALENT_STRONG 0
1184 #define TALENT_FAST_N_ACCURATE 1
1185 #define TALENT_HEALTHY 2
1186 #define TALENT_CLEVER 3
1188 #define BORDER_PARTNER_ANIMATED (16 << 24)
1190 /* room flags */
1192 #define NO_MONSTER_GENERATION 1
1194 #define NO_TAMING -1
1196 #define SADIST_HIT 1
1198 #define EQUIPMENT_DATAS 13
1200 #define SPECIAL_CONFIGURATION_GENERATION_LEVELS 2
1202 #endif