{
if ((r_ptr->level + 10) > p_ptr->lev)
{
- int tval = inventory[INVEN_RARM+hand].tval - TV_WEAPON_BEGIN;
- int sval = inventory[INVEN_RARM+hand].sval;
+ OBJECT_TYPE_VALUE tval = inventory[INVEN_RARM+hand].tval - TV_WEAPON_BEGIN;
+ OBJECT_SUBTYPE_VALUE sval = inventory[INVEN_RARM+hand].sval;
int now_exp = p_ptr->weapon_exp[tval][sval];
if (now_exp < s_info[p_ptr->pclass].w_max[tval][sval])
{
int now_exp = p_ptr->weapon_exp[0][j_ptr->sval];
if (now_exp < s_info[p_ptr->pclass].w_max[0][j_ptr->sval])
{
- int amount = 0;
+ SUB_EXP amount = 0;
if (now_exp < WEAPON_EXP_BEGINNER) amount = 80;
else if (now_exp < WEAPON_EXP_SKILLED) amount = 25;
else if ((now_exp < WEAPON_EXP_EXPERT) && (p_ptr->lev > 19)) amount = 10;
case '4':
{
static cptr choice_msg = _("モンスターの[色/文字]を変更します", "Change monster attr/chars");
- static int r = 0;
+ static IDX r = 0;
prt(format(_("コマンド: %s", "Command: %s"), choice_msg), 15, 0);
*/
static int collect_features(int grp_cur, IDX *feat_idx, BIT_FLAGS8 mode)
{
- int i, feat_cnt = 0;
+ IDX i;
+ int feat_cnt = 0;
/* Unused; There is a single group. */
(void)grp_cur;
* @param tval 魔法書のtval
* @return 領域魔法の技能名称を保管した文字列ポインタ
*/
-cptr spell_category_name(int tval)
+cptr spell_category_name(OBJECT_TYPE_VALUE tval)
{
switch (tval)
{
* The "known" should be TRUE for cast/pray, FALSE for study
* </pre>
*/
-static int get_spell(int *sn, cptr prompt, int sval, bool learned, int use_realm)
+static int get_spell(int *sn, cptr prompt, OBJECT_SUBTYPE_VALUE sval, bool learned, int use_realm)
{
int i;
int spell = -1;
* @param known 判明済ならばTRUE
* @return 発動により効果内容が確定したならばTRUEを返す
*/
-static int staff_effect(int sval, bool *use_charge, bool powerful, bool magic, bool known)
+static int staff_effect(OBJECT_SUBTYPE_VALUE sval, bool *use_charge, bool powerful, bool magic, bool known)
{
int k;
int ident = FALSE;
* @param magic 魔道具術上の処理ならばTRUE
* @return 発動により効果内容が確定したならばTRUEを返す
*/
-static int wand_effect(int sval, int dir, bool powerful, bool magic)
+static int wand_effect(OBJECT_SUBTYPE_VALUE sval, int dir, bool powerful, bool magic)
{
int ident = FALSE;
int lev = powerful ? p_ptr->lev * 2 : p_ptr->lev;
* @param magic 魔道具術上の処理ならばTRUE
* @return 発動により効果内容が確定したならばTRUEを返す
*/
-static int rod_effect(int sval, int dir, bool *use_charge, bool powerful, bool magic)
+static int rod_effect(OBJECT_SUBTYPE_VALUE sval, int dir, bool *use_charge, bool powerful, bool magic)
{
int ident = FALSE;
int lev = powerful ? p_ptr->lev * 2 : p_ptr->lev;
extern void do_cmd_time(void);
/* cmd5.c */
-extern cptr spell_category_name(int tval);
+extern cptr spell_category_name(OBJECT_TYPE_VALUE tval);
extern void do_cmd_browse(void);
extern void do_cmd_study(void);
extern void do_cmd_cast(void);
extern void change_race(CHARACTER_IDX new_race, cptr effect_msg);
extern HIT_POINT mon_damage_mod(monster_type *m_ptr, HIT_POINT dam, bool is_psy_spear);
extern s16b gain_energy(void);
-extern s16b bow_energy(int sval);
-extern int bow_tmul(int sval);
+extern s16b bow_energy(OBJECT_SUBTYPE_VALUE sval);
+extern int bow_tmul(OBJECT_SUBTYPE_VALUE sval);
extern cptr your_alignment(void);
extern int weapon_exp_level(int weapon_exp);
extern int riding_exp_level(int riding_exp);
rd_s16b(&o_ptr->ac);
- rd_byte(&o_ptr->dd);
- rd_byte(&o_ptr->ds);
+ rd_byte(&tmp8u);
+ o_ptr->dd = tmp8u;
+ rd_byte(&tmp8u);
+ o_ptr->ds = tmp8u;
rd_byte(&o_ptr->ident);
if (flags & SAVE_ITEM_AC) rd_s16b(&o_ptr->ac);
else o_ptr->ac = 0;
- if (flags & SAVE_ITEM_DD) rd_byte(&o_ptr->dd);
+ if (flags & SAVE_ITEM_DD)
+ {
+ rd_byte(&tmp8u);
+ o_ptr->dd = tmp8u;
+ }
else o_ptr->dd = 0;
- if (flags & SAVE_ITEM_DS) rd_byte(&o_ptr->ds);
+ if (flags & SAVE_ITEM_DS)
+ {
+ rd_byte(&tmp8u);
+ o_ptr->ds = tmp8u;
+ }
else o_ptr->ds = 0;
if (flags & SAVE_ITEM_IDENT) rd_byte(&o_ptr->ident);
byte tmp8u;
u16b tmp16u;
+ s16b tmp16s;
u32b tmp32u;
#ifdef VERIFY_CHECKSUMS
quest_type* const q_ptr = &quest[i];
rd_s16b(&q_ptr->status);
- rd_s16b(&q_ptr->level);
+ rd_s16b(&tmp16s);
+ q_ptr->level = tmp16s;
if (z_older_than(11, 0, 6))
{
int i, item;
int dec = 4;
bool observe = FALSE;
- int old_ds, old_dd, old_to_h, old_to_d, old_ac, old_to_a, old_pval, old_name2, old_timeout;
+ int old_ds, old_dd, old_to_h, old_to_d, old_ac, old_to_a, old_pval, old_name2;
+ TIME_EFFECT old_timeout;
u32b old_flgs[TR_FLAG_SIZE], new_flgs[TR_FLAG_SIZE];
object_type *o_ptr;
cptr q, s;
for (i = 0; essence_info[i].add_name; i++)
{
essence_type *es_ptr = &essence_info[i];
- int pval = 0;
+ PARAMETER_VALUE pval = 0;
if (es_ptr->add < TR_FLAG_MAX && is_pval_flag(es_ptr->add) && old_pval)
pval = (have_flag(new_flgs, es_ptr->add)) ? old_pval - o_ptr->pval : old_pval;
{
char tmp[80];
char tmp_val[160];
- int pval;
- int limit = MIN(5, p_ptr->magic_num1[es_ptr->essence]/es_ptr->value);
+ PARAMETER_VALUE pval;
+ PARAMETER_VALUE limit = MIN(5, p_ptr->magic_num1[es_ptr->essence]/es_ptr->value);
sprintf(tmp, _("いくつ付加しますか? (1-%d): ", "Enchant how many? (1-%d): "), limit);
strcpy(tmp_val, "1");
if (!get_string(tmp, tmp_val, 1)) return;
- pval = atoi(tmp_val);
+ pval = (PARAMETER_VALUE)atoi(tmp_val);
if (pval > limit) pval = limit;
else if (pval < 1) pval = 1;
o_ptr->pval += pval;
bool gain_magic(void)
{
int item;
- int pval;
+ PARAMETER_VALUE pval;
int ext = 0;
cptr q, s;
object_type *o_ptr;
POSITION cdis; /* Current dis from player */
- BIT_FLAGS mflag; /* Extra monster flags */
- BIT_FLAGS mflag2; /* Extra monster flags */
+ BIT_FLAGS8 mflag; /* Extra monster flags */
+ BIT_FLAGS8 mflag2; /* Extra monster flags */
bool ml; /* Monster is "visible" */
{
int i, num, max_num;
int col, row;
- int tval;
+ OBJECT_TYPE_VALUE tval;
cptr tval_desc;
char ch;
int extra_shots = 0;
int i;
int num = 0;
- int tval_ammo = bow_tval_ammo(o_ptr);
+ OBJECT_TYPE_VALUE tval_ammo = bow_tval_ammo(o_ptr);
object_type *q_ptr;
u32b flgs[TR_FLAG_SIZE];
{
if (buki_motteruka(INVEN_RARM+i))
{
- int tval = inventory[INVEN_RARM+i].tval - TV_WEAPON_BEGIN;
- int sval = inventory[INVEN_RARM+i].sval;
+ OBJECT_TYPE_VALUE tval = inventory[INVEN_RARM+i].tval - TV_WEAPON_BEGIN;
+ OBJECT_SUBTYPE_VALUE sval = inventory[INVEN_RARM+i].sval;
p_ptr->to_h[i] += (p_ptr->weapon_exp[tval][sval] - WEAPON_EXP_BEGINNER) / 200;
p_ptr->dis_to_h[i] += (p_ptr->weapon_exp[tval][sval] - WEAPON_EXP_BEGINNER) / 200;
/*
* Return bow energy
*/
-s16b bow_energy(int sval)
+s16b bow_energy(OBJECT_SUBTYPE_VALUE sval)
{
int energy = 100;
/*
* Return bow tmul
*/
-int bow_tmul(int sval)
+int bow_tmul(OBJECT_SUBTYPE_VALUE sval)
{
int tmul = 0;