/* File: types.h */
-/* Purpose: global type declarations */
-
/*
- * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
+ * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
*
- * This software may be copied and distributed for educational, research, and
- * not for profit purposes provided that this copyright and statement are
- * included in all such copies.
+ * This software may be copied and distributed for educational, research,
+ * and not for profit purposes provided that this copyright and statement
+ * are included in all such copies. Other copyrights may also apply.
*/
+/* Purpose: global type declarations */
+
/*
* This file should ONLY be included by "angband.h"
*/
-#ifdef USE_SCRIPT
-
-#include "Python.h"
-
-#endif /* USE_SCRIPT */
-
/*
* Note that "char" may or may not be signed, and that "signed char"
* may or may not work on all machines. So always use "s16b" or "s32b"
/*
- * Template file header information (see "init.c"). 16 bytes.
- *
- * Note that the sizes of many of the "arrays" are between 32768 and
- * 65535, and so we must use "unsigned" values to hold the "sizes" of
- * these arrays below. Normally, I try to avoid using unsigned values,
- * since they can cause all sorts of bizarre problems, but I have no
- * choice here, at least, until the "race" array is split into "normal"
- * and "unique" monsters, which may or may not actually help.
- *
- * Note that, on some machines, for example, the Macintosh, the standard
- * "read()" and "write()" functions cannot handle more than 32767 bytes
- * at one time, so we need replacement functions, see "util.c" for details.
- *
- * Note that, on some machines, for example, the Macintosh, the standard
- * "malloc()" function cannot handle more than 32767 bytes at one time,
- * but we may assume that the "ralloc()" function can handle up to 65535
- * butes at one time. We should not, however, assume that the "ralloc()"
- * function can handle more than 65536 bytes at a time, since this might
- * result in segmentation problems on certain older machines, and in fact,
- * we should not assume that it can handle exactly 65536 bytes at a time,
- * since the internal functions may use an unsigned short to specify size.
- *
- * In general, these problems occur only on machines (such as most personal
- * computers) which use 2 byte "int" values, and which use "int" for the
- * arguments to the relevent functions.
- */
-
-typedef struct header header;
-
-struct header
-{
- byte v_major; /* Version -- major */
- byte v_minor; /* Version -- minor */
- byte v_patch; /* Version -- patch */
- byte v_extra; /* Version -- extra */
-
-
- u16b info_num; /* Number of "info" records */
-
- u16b info_len; /* Size of each "info" record */
-
-
- u32b head_size; /* Size of the "header" in bytes */
-
- u32b info_size; /* Size of the "info" array in bytes */
-
- u32b name_size; /* Size of the "name" array in bytes */
-
-#ifdef JP
- u32b E_name_size; /* Size of the "English-name" array in bytes */
-#endif
- u32b text_size; /* Size of the "text" array in bytes */
-};
-
-
-
-/*
* Information about terrain "features"
*/
struct feature_type
{
u32b name; /* Name (offset) */
-#ifdef JP
- u32b E_name; /* ±Ñ¸ì̾ (offset) */
-#endif
u32b text; /* Text (offset) */
byte mimic; /* Feature to mimic */
struct object_kind
{
u32b name; /* Name (offset) */
-#ifdef JP
- u32b E_name; /* ±Ñ¸ì̾ (offset) */
-#endif
u32b text; /* Text (offset) */
byte tval; /* Object type */
s32b cost; /* Object "base cost" */
- u32b flags1; /* Flags, set 1 */
- u32b flags2; /* Flags, set 2 */
- u32b flags3; /* Flags, set 3 */
+ u32b flags[TR_FLAG_SIZE]; /* Flags */
+
+ u32b gen_flags; /* flags for generate */
byte locale[4]; /* Allocation level(s) */
byte chance[4]; /* Allocation chance(s) */
struct artifact_type
{
u32b name; /* Name (offset) */
-#ifdef JP
- u32b E_name; /* ±Ñ¸ì̾ (offset) */
-#endif
u32b text; /* Text (offset) */
byte tval; /* Artifact type */
s32b cost; /* Artifact "cost" */
- u32b flags1; /* Artifact Flags, set 1 */
- u32b flags2; /* Artifact Flags, set 2 */
- u32b flags3; /* Artifact Flags, set 3 */
+ u32b flags[TR_FLAG_SIZE]; /* Artifact Flags */
+
+ u32b gen_flags; /* flags for generate */
byte level; /* Artifact level */
byte rarity; /* Artifact rarity */
byte cur_num; /* Number created (0 or 1) */
byte max_num; /* Unused (should be "1") */
+
+ s16b floor_id; /* Leaved on this location last time */
};
struct ego_item_type
{
u32b name; /* Name (offset) */
-#ifdef JP
- u32b E_name; /* Name (offset) */
-#endif
u32b text; /* Text (offset) */
byte slot; /* Standard slot value */
s32b cost; /* Ego-item "cost" */
- u32b flags1; /* Ego-Item Flags, set 1 */
- u32b flags2; /* Ego-Item Flags, set 2 */
- u32b flags3; /* Ego-Item Flags, set 3 */
+ u32b flags[TR_FLAG_SIZE]; /* Ego-Item Flags */
+
+ u32b gen_flags; /* flags for generate */
};
};
+typedef struct mbe_info_type mbe_info_type;
+
+struct mbe_info_type
+{
+ int power; /* The attack "power" */
+ int explode_type; /* Explosion effect */
+};
+
/*
* Monster "race" information, including racial memories
{
u32b name; /* Name (offset) */
#ifdef JP
- u32b E_name; /* ±Ñ¸ì̾ (offset) */
+ u32b E_name; /* ±Ñ¸ì̾ (offset) */
#endif
u32b text; /* Text (offset) */
s16b extra; /* Unused (for now) */
- byte freq_inate; /* Inate spell frequency */
- byte freq_spell; /* Other spell frequency */
+ byte freq_spell; /* Spell frequency */
u32b flags1; /* Flags 1 (general) */
u32b flags2; /* Flags 2 (abilities) */
u32b flags7; /* Flags 7 (movement related abilities) */
u32b flags8; /* Flags 8 (wilderness info) */
u32b flags9; /* Flags 9 (drops info) */
+ u32b flagsr; /* Flags R (resistances info) */
monster_blow blow[4]; /* Up to four blows per round */
byte cur_num; /* Monster population on current level */
+ s16b floor_id; /* Location of unique monster */
+
s16b r_sights; /* Count sightings of this monster */
s16b r_deaths; /* Count deaths from this monster */
byte r_drop_gold; /* Max number of gold dropped at once */
byte r_drop_item; /* Max number of item dropped at once */
- byte r_cast_inate; /* Max number of inate spells seen */
byte r_cast_spell; /* Max number of other spells seen */
byte r_blows[4]; /* Number of times each blow type was seen */
u32b r_flags4; /* Observed racial flags */
u32b r_flags5; /* Observed racial flags */
u32b r_flags6; /* Observed racial flags */
- u32b r_flags7; /* Observed racial flags */
+ /* u32b r_flags7; */ /* Observed racial flags */
+ u32b r_flagsr; /* Observed racial resistance flags */
};
byte name1; /* Artifact type, if any */
byte name2; /* Ego-Item type, if any */
- byte xtra1; /* Extra info type */
+ byte xtra1; /* Extra info type (now unused) */
byte xtra2; /* Extra info index */
byte xtra3; /* Extra info */
s16b xtra4; /* Extra info */
byte feeling; /* Game generated inscription number (eg, pseudo-id) */
- u32b art_flags1; /* Flags, set 1 Alas, these were necessary */
- u32b art_flags2; /* Flags, set 2 for the random artifacts of*/
- u32b art_flags3; /* Flags, set 3 Zangband */
+ u32b art_flags[TR_FLAG_SIZE]; /* Extra Flags for ego and artifacts */
+
+ u32b curse_flags; /* Flags for curse */
s16b next_o_idx; /* Next object in stack (if any) */
s16b held_m_idx; /* Monster holding us (if any) */
-#ifdef USE_SCRIPT
- PyObject *python;
-#endif /* USE_SCRIPT */
-
#ifdef SCRIPT_OBJ_KIND
char *name;
struct monster_type
{
- s16b r_idx; /* Monster race index */
+ s16b r_idx; /* Monster race index */
+ s16b ap_r_idx; /* Monster race appearance index */
+ byte sub_align; /* Sub-alignment for a neutral monster */
- byte fy; /* Y location on map */
- byte fx; /* X location on map */
+ byte fy; /* Y location on map */
+ byte fx; /* X location on map */
- s16b hp; /* Current Hit points */
- s16b maxhp; /* Max Hit points */
- s16b max_maxhp; /* Max Max Hit points */
+ s16b hp; /* Current Hit points */
+ s16b maxhp; /* Max Hit points */
+ s16b max_maxhp; /* Max Max Hit points */
s16b csleep; /* Inactive counter */
- byte mspeed; /* Monster "speed" */
- s16b energy; /* Monster "energy" */
+ byte mspeed; /* Monster "speed" */
+ s16b energy_need; /* Monster "energy" */
byte fast; /* Monster is stunned */
byte slow; /* Monster is stunned */
byte monfear; /* Monster is afraid */
byte invulner; /* Monster is temporarily invulnerable */
- byte cdis; /* Current dis from player */
+ byte cdis; /* Current dis from player */
- byte mflag; /* Extra monster flags */
- byte mflag2; /* Extra monster flags */
+ byte mflag; /* Extra monster flags */
+ byte mflag2; /* Extra monster flags */
- bool ml; /* Monster is "visible" */
+ bool ml; /* Monster is "visible" */
s16b hold_o_idx; /* Object being held (if any) */
struct alloc_entry
{
-#ifdef USE_SCRIPT
- PyObject *python;
-#endif /* USE_SCRIPT */
-
s16b index; /* The actual index */
byte level; /* Base dungeon level */
byte hitdie; /* Hit dice (sides) */
u16b expfact; /* Experience factor
- * Note: was byte, causing overflow for Amberite
- * characters (such as Amberite Paladins)
- */
+ * Note: was byte, causing overflow for Amberite
+ * characters (such as Amberite Paladins)
+ */
s16b age; /* Characters age */
s16b ht; /* Height */
s16b stat_max_max[6]; /* Maximal "maximal" stat values */
s16b stat_cur[6]; /* Current "natural" stat values */
+ s16b learned_spells;
+ s16b add_spells;
+
u32b count;
- s16b fast; /* Timed -- Fast */
- s16b slow; /* Timed -- Slow */
- s16b blind; /* Timed -- Blindness */
+ s16b fast; /* Timed -- Fast */
+ s16b slow; /* Timed -- Slow */
+ s16b blind; /* Timed -- Blindness */
s16b paralyzed; /* Timed -- Paralysis */
s16b confused; /* Timed -- Confusion */
s16b afraid; /* Timed -- Fear */
- s16b image; /* Timed -- Hallucination */
+ s16b image; /* Timed -- Hallucination */
s16b poisoned; /* Timed -- Poisoned */
- s16b cut; /* Timed -- Cut */
- s16b stun; /* Timed -- Stun */
+ s16b cut; /* Timed -- Cut */
+ s16b stun; /* Timed -- Stun */
s16b protevil; /* Timed -- Protection */
s16b invuln; /* Timed -- Invulnerable */
s16b ult_res; /* Timed -- Ultimate Resistance */
- s16b hero; /* Timed -- Heroism */
- s16b shero; /* Timed -- Super Heroism */
+ s16b hero; /* Timed -- Heroism */
+ s16b shero; /* Timed -- Super Heroism */
s16b shield; /* Timed -- Shield Spell */
s16b blessed; /* Timed -- Blessed */
s16b tim_invis; /* Timed -- See Invisible */
byte mimic_form;
s16b tim_mimic;
s16b tim_sh_fire;
+ s16b tim_sh_holy;
+ s16b tim_eyeeye;
- /* for mirror master */
+ /* for mirror master */
s16b tim_reflect; /* Timed -- Reflect */
s16b multishadow; /* Timed -- Multi-shadow */
s16b dustrobe; /* Timed -- Robe of dust */
s16b virtues[8];
s16b vir_types[8];
- s16b word_recall; /* Word of recall counter */
- byte recall_dungeon;
+ s16b word_recall; /* Word of recall counter */
+ s16b alter_reality; /* Alter reality counter */
+ byte recall_dungeon; /* Dungeon set to be recalled */
+
+ s16b energy_need; /* Energy needed for next move */
+
+ s16b food; /* Current nutrition */
+
+ u32b special_attack; /* Special attack capacity -LM- */
+ u32b special_defense; /* Special block capacity -LM- */
+ byte action; /* Currently action */
+
+ u32b spell_learned1; /* bit mask of spells learned */
+ u32b spell_learned2; /* bit mask of spells learned */
+ u32b spell_worked1; /* bit mask of spells tried and worked */
+ u32b spell_worked2; /* bit mask of spells tried and worked */
+ u32b spell_forgotten1; /* bit mask of spells learned but forgotten */
+ u32b spell_forgotten2; /* bit mask of spells learned but forgotten */
+ byte spell_order[64]; /* order spells learned/remembered/forgotten */
+
+ s16b spell_exp[64]; /* Proficiency of spells */
+ s16b weapon_exp[5][64]; /* Proficiency of weapons */
+ s16b skill_exp[10]; /* Proficiency of misc. skill */
+
+ s32b magic_num1[108]; /* Array for non-spellbook type magic */
+ byte magic_num2[108]; /* Flags for non-spellbook type magics */
+
+ s16b mane_spell[MAX_MANE];
+ s16b mane_dam[MAX_MANE];
+ s16b mane_num;
+
+ s16b player_hp[PY_MAX_LEVEL];
+ char died_from[80]; /* What killed the player */
+ char history[4][60]; /* Textual "history" for the Player */
+
+ u16b total_winner; /* Total winner */
+ u16b panic_save; /* Panic save */
+
+ u16b noscore; /* Cheating flags */
+
+ bool wait_report_score; /* Waiting to report score */
+ bool is_dead; /* Player is dead */
+
+ bool wizard; /* Player is in wizard mode */
+
+ s16b riding; /* Riding on a monster of this index */
+ byte knowledge; /* Knowledge about yourself */
+ s32b visit; /* Visited towns */
+
+ byte start_race; /* Race at birth */
+ s32b old_race1; /* Record of race changes */
+ s32b old_race2; /* Record of race changes */
+ s16b old_realm; /* Record of realm changes */
+
+ s16b pet_follow_distance; /* Length of the imaginary "leash" for pets */
+ s16b pet_extra_flags; /* Various flags for controling pets */
+
+ s16b today_mon; /* Wanted monster */
+
+ bool dtrap; /* Whether you are on trap-safe grids */
+ s16b floor_id; /* Current floor location */
- s16b energy; /* Current energy */
+ /*** Temporary fields ***/
- s16b food; /* Current nutrition */
+ bool playing; /* True if player is playing */
+ bool leaving; /* True if player is leaving */
- u32b total_weight; /* Total weight being carried */
+ byte exit_bldg; /* Goal obtained in arena? -KMW- */
+ byte leftbldg; /* did we just leave a special area? -KMW- */
- u32b special_attack; /* Special attack capacity -LM- */
- u32b special_defense; /* Special block capacity -LM- */
- byte action; /* Currently action */
+ bool leaving_dungeon; /* True if player is leaving the dungeon */
+ bool teleport_town;
+ bool enter_dungeon; /* Just enter the dungeon */
- s16b health_who; /* Health bar trackee */
+ s16b health_who; /* Health bar trackee */
s16b monster_race_idx; /* Monster race trackee */
s16b object_kind_idx; /* Object kind trackee */
s16b new_spells; /* Number of spells available */
-
s16b old_spells;
- s16b learned_spells;
- s16b add_spells;
+
+ s16b old_food_aux; /* Old value of food */
bool old_cumber_armor;
bool old_cumber_glove;
bool old_monlite;
s16b old_lite; /* Old radius of lite (if any) */
- s16b old_view; /* Old radius of view (if any) */
-
- s16b old_food_aux; /* Old value of food */
-
bool cumber_armor; /* Mana draining armor */
bool cumber_glove; /* Mana draining gloves */
s16b stat_use[6]; /* Current modified stats */
s16b stat_top[6]; /* Maximal modified stats */
+ bool sutemi;
+ bool counter;
+
+ s32b align; /* Good/evil/neutral */
+ s16b run_py;
+ s16b run_px;
+
+
+ /*** Extracted fields ***/
+
+ u32b total_weight; /* Total weight being carried */
+
s16b stat_add[6]; /* Modifiers to stat values */
s16b stat_ind[6]; /* Indexes into stat tables */
bool sustain_con; /* Keep constitution */
bool sustain_chr; /* Keep charisma */
- bool aggravate; /* Aggravate monsters */
- bool teleport; /* Random teleporting */
- bool sutemi;
- bool counter;
-
- bool exp_drain; /* Experience draining */
+ u32b cursed; /* Player is cursed */
- bool can_swim; /* No damage falling */
- bool ffall; /* No damage falling */
- bool lite; /* Permanent light */
+ bool can_swim; /* No damage falling */
+ bool ffall; /* No damage falling */
+ bool lite; /* Permanent light */
bool free_act; /* Never paralyzed */
bool see_inv; /* Can see invisible */
bool regenerate; /* Regenerate hit pts */
bool hold_life; /* Resist life draining */
+
bool telepathy; /* Telepathy */
+ bool esp_animal;
+ bool esp_undead;
+ bool esp_demon;
+ bool esp_orc;
+ bool esp_troll;
+ bool esp_giant;
+ bool esp_dragon;
+ bool esp_human;
+ bool esp_evil;
+ bool esp_good;
+ bool esp_nonliving;
+ bool esp_unique;
+
bool slow_digest; /* Slower digestion */
bool bless_blade; /* Blessed blade */
bool xtra_might; /* Extra might bow */
bool heavy_spell;
bool warning;
bool mighty_throw;
+ bool see_nocto; /* Noctovision */
+
+ s16b to_dd[2]; /* Extra dice/sides */
+ s16b to_ds[2];
s16b dis_to_h[2]; /* Known bonus to hit (wield) */
s16b dis_to_h_b; /* Known bonus to hit (bow) */
s16b to_d_m; /* Bonus to dam (misc) */
s16b to_a; /* Bonus to ac */
+ s16b to_m_chance; /* Minusses to cast chance */
+
bool ryoute;
bool migite;
bool hidarite;
byte tval_ammo; /* Correct ammo tval */
- s16b pspeed; /* Current speed */
+ byte pspeed; /* Current speed */
+};
- /*** Pet commands ***/
- s16b pet_follow_distance; /* Length of the imaginary "leash" for pets */
- s16b pet_extra_flags; /* Length of the imaginary "leash" for pets */
- /*** Temporary fields ***/
- byte exit_bldg; /* Goal obtained in arena? -KMW- */
- byte leftbldg; /* did we just leave a special area? -KMW- */
- bool leaving; /* True if player is leaving */
+/*
+ * A structure to hold "rolled" information
+ */
+typedef struct birther birther;
- bool leaving_dungeon; /* True if player is leaving the dungeon */
- bool teleport_town;
+struct birther
+{
+ byte psex; /* Sex index */
+ byte prace; /* Race index */
+ byte pclass; /* Class index */
+ byte pseikaku; /* Seikaku index */
+ byte realm1; /* First magic realm */
+ byte realm2; /* Second magic realm */
- s32b align; /* Good/evil/neutral */
- s16b today_mon;
+ s16b age;
+ s16b ht;
+ s16b wt;
+ s16b sc;
+
+ s32b au;
+
+ s16b stat_max[6]; /* Current "maximal" stat values */
+ s16b stat_max_max[6]; /* Maximal "maximal" stat values */
+ s16b player_hp[PY_MAX_LEVEL];
- s16b riding;
- byte knowledge;
- s32b visit;
+ s16b chaos_patron;
- s32b magic_num1[108];
- byte magic_num2[108];
+ s16b vir_types[8];
- byte start_race;
- s32b old_race1;
- s32b old_race2;
- s16b old_realm;
+ char history[4][60];
- s16b run_py;
- s16b run_px;
+ byte quests;
+ bool quick_ok;
};
int mana_cost;
int fail;
cptr name;
-#ifdef JP
- cptr E_name;
-#endif
};
typedef struct mind_power mind_power;
int manefail;
int use_stat;
cptr name;
-#ifdef JP
- cptr E_name;
-#endif
};
s16b actions[8]; /* action codes */
s16b action_restr[8]; /* action restrictions */
-#ifdef USE_SCRIPT
- char act_script[8][128]; /* Scripts for the building */
-#endif /* USE_SCRIPT */
-
s16b member_class[MAX_CLASS]; /* which classes are part of guild */
s16b member_race[MAX_RACES]; /* which classes are part of guild */
s16b member_realm[MAX_MAGIC+1]; /* which realms are part of guild */
u32b mflags7;
u32b mflags8;
u32b mflags9;
+ u32b mflagsr;
char r_char[5]; /* Monster race allowed */
int final_object; /* The object you'll find at the bottom */
};
+/*
+ * A structure type for entry of auto-picker/destroyer
+ */
+typedef struct {
+ cptr name; /* Items which have 'name' as part of its name match */
+ cptr insc; /* Items will be auto-inscribed as 'insc' */
+ u32b flag[2]; /* Misc. keyword to be matched */
+ byte action; /* Auto-pickup or Destroy or Leave items */
+ byte dice; /* Weapons which have more than 'dice' dice match */
+ byte bonus; /* Items which have more than 'bonus' magical bonus match */
+} autopick_type;
+
+
+/*
+ * A structure type for the saved floor
+ */
+typedef struct
+{
+ s16b floor_id; /* No recycle until 65536 IDs are all used */
+ byte savefile_id; /* ID for savefile (from 0 to MAX_SAVED_FLOOR) */
+ s16b dun_level;
+ s32b last_visit; /* Time count of last visit. 0 for new floor. */
+ u32b visit_mark; /* Older has always smaller mark. */
+ s16b upper_floor_id; /* a floor connected with level teleportation */
+ s16b lower_floor_id; /* a floor connected with level tel. and trap door */
+} saved_floor_type;
+/*
+ * A structure type for terrain template of saving dungeon floor
+ */
+typedef struct
+{
+ u16b info;
+ byte feat;
+ byte mimic;
+ s16b special;
+ u16b occurrence;
+} cave_template_type;
+
+
+/*
+ * A structure type for arena entry
+ */
+typedef struct
+{
+ s16b r_idx; /* Monster (0 means victory prizing) */
+ byte tval; /* tval of prize (0 means no prize) */
+ byte sval; /* sval of prize */
+} arena_type;