* @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(SPELL_IDX *sn, cptr prompt, OBJECT_SUBTYPE_VALUE sval, bool learned, REALM_IDX use_realm)
{
int i;
- int spell = -1;
+ SPELL_IDX spell = -1;
int num = 0;
int ask = TRUE;
- int need_mana;
- byte spells[64];
+ MANA_POINT need_mana;
+ SPELL_IDX spells[64];
bool flag, redraw, okay;
char choice;
const magic_type *s_ptr;
char out_val[160];
cptr p;
+ COMMAND_CODE code;
#ifdef JP
char jverb_buf[128];
#endif
#ifdef ALLOW_REPEAT /* TNB */
/* Get the spell, if available */
- if (repeat_pull(sn))
+ if (repeat_pull(&code))
{
+ *sn = (SPELL_IDX)code;
/* Verify the spell */
if (spell_okay(*sn, learned, FALSE, use_realm))
{
ask = (isupper(choice));
/* Lowercase */
- if (ask) choice = tolower(choice);
+ if (ask) choice = (char)tolower(choice);
/* Extract request */
i = (islower(choice) ? A2I(choice) : -1);
#ifdef ALLOW_REPEAT /* TNB */
- repeat_push(*sn);
+ repeat_push((COMMAND_CODE)spell);
#endif /* ALLOW_REPEAT -- TNB */
if (o_ptr->k_idx && check_book_realm(o_ptr->tval, o_ptr->sval)) return FALSE;
}
- for (i = cave[py][px].o_idx; i; i = o_ptr->next_o_idx)
+ for (i = cave[p_ptr->y][p_ptr->x].o_idx; i; i = o_ptr->next_o_idx)
{
o_ptr = &o_list[i];
if (o_ptr->k_idx && (o_ptr->marked & OM_FOUND) && check_book_realm(o_ptr->tval, o_ptr->sval)) return FALSE;
*/
static void confirm_use_force(bool browse_only)
{
- int item;
char which;
+ COMMAND_CODE code;
#ifdef ALLOW_REPEAT
/* Get the item index */
- if (repeat_pull(&item) && (item == INVEN_FORCE))
+ if (repeat_pull(&code) && (code == INVEN_FORCE))
{
browse_only ? do_cmd_mind_browse() : do_cmd_mind();
return;
*/
void do_cmd_browse(void)
{
- int item, sval, use_realm = 0, j, line;
- int spell = -1;
- int num = 0;
+ OBJECT_IDX item;
+ OBJECT_SUBTYPE_VALUE sval;
+ REALM_IDX use_realm = 0;
+ int j, line;
+ SPELL_IDX spell = -1;
+ int num = 0;
- byte spells[64];
- char temp[62*4];
+ SPELL_IDX spells[64];
+ char temp[62*4];
object_type *o_ptr;
* @param next_realm 変更先の魔法領域ID
* @return なし
*/
-static void change_realm2(int next_realm)
+static void change_realm2(CHARACTER_IDX next_realm)
{
int i, j = 0;
char tmp[80];
*/
void do_cmd_study(void)
{
- int i, item, sval;
+ int i;
+ OBJECT_IDX item;
+ OBJECT_SUBTYPE_VALUE sval;
int increment = 0;
bool learned = FALSE;
/* Spells of realm2 will have an increment of +32 */
- int spell = -1;
+ SPELL_IDX spell = -1;
cptr p = spell_category_name(mp_ptr->spell_book);
}
/* Take a turn */
- energy_use = 100;
+ p_ptr->energy_use = 100;
switch (mp_ptr->spell_book)
{
static void wild_magic(int spell)
{
int counter = 0;
- int type = SUMMON_BIZARRE1 + randint0(6);
+ int type = SUMMON_MOLD + randint0(6);
- if (type < SUMMON_BIZARRE1) type = SUMMON_BIZARRE1;
- else if (type > SUMMON_BIZARRE6) type = SUMMON_BIZARRE6;
+ if (type < SUMMON_MOLD) type = SUMMON_MOLD;
+ else if (type > SUMMON_MIMIC) type = SUMMON_MIMIC;
switch (randint1(spell) + randint1(8) + 1)
{
break;
case 19:
case 20:
- trap_creation(py, px);
+ trap_creation(p_ptr->y, p_ptr->x);
break;
case 21:
case 22:
aggravate_monsters(0);
break;
case 26:
- earthquake(py, px, 5);
+ earthquake(p_ptr->y, p_ptr->x, 5);
break;
case 27:
case 28:
case 35:
while (counter++ < 8)
{
- (void)summon_specific(0, py, px, (dun_level * 3) / 2, type, (PM_ALLOW_GROUP | PM_NO_PET));
+ (void)summon_specific(0, p_ptr->y, p_ptr->x, (dun_level * 3) / 2, type, (PM_ALLOW_GROUP | PM_NO_PET));
}
break;
case 36:
case 37:
- activate_hi_summon(py, px, FALSE);
+ activate_hi_summon(p_ptr->y, p_ptr->x, FALSE);
break;
case 38:
- (void)summon_cyber(-1, py, px);
+ (void)summon_cyber(-1, p_ptr->y, p_ptr->x);
break;
default:
{
*/
void do_cmd_cast(void)
{
- int item, sval, spell, realm;
+ OBJECT_IDX item;
+ OBJECT_SUBTYPE_VALUE sval;
+ SPELL_IDX spell;
+ REALM_IDX realm;
int chance;
int increment = 0;
- int use_realm;
- int need_mana;
+ REALM_IDX use_realm;
+ MANA_POINT need_mana;
cptr prayer;
-
object_type *o_ptr;
-
const magic_type *s_ptr;
-
cptr q, s;
bool over_exerted = FALSE;
/* Ask for a spell */
#ifdef JP
- if (!get_spell(&spell,
- ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "詠唱する" : (mp_ptr->spell_book == TV_MUSIC_BOOK) ? "歌う" : "唱える"),
- sval, TRUE, realm))
+ if (!get_spell(&spell, ((mp_ptr->spell_book == TV_LIFE_BOOK) ? "詠唱する" : (mp_ptr->spell_book == TV_MUSIC_BOOK) ? "歌う" : "唱える"),
+ sval, TRUE, realm))
{
if (spell == -2) msg_format("その本には知っている%sがない。", prayer);
return;
}
/* Take a turn */
- energy_use = 100;
+ p_ptr->energy_use = 100;
/* Over-exert the player */
int calculate_upkeep(void)
{
s32b old_friend_align = friend_align;
- int m_idx;
+ MONSTER_IDX m_idx;
bool have_a_unique = FALSE;
s32b total_friend_levels = 0;
{
monster_type *m_ptr;
bool all_pets = FALSE;
- int pet_ctr, i;
+ MONSTER_IDX pet_ctr;
+ int i;
int Dismissed = 0;
- u16b *who;
+ MONSTER_IDX *who;
u16b dummy_why;
int max_pet = 0;
- int cu, cv;
+ bool_hack cu, cv;
cu = Term->scr->cu;
cv = Term->scr->cv;
Term->scr->cv = 1;
/* Allocate the "who" array */
- C_MAKE(who, max_m_idx, u16b);
+ C_MAKE(who, max_m_idx, MONSTER_IDX);
/* Process the monsters (backwards) */
for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
Term->scr->cv = cv;
Term_fresh();
- C_KILL(who, max_m_idx, u16b);
+ C_KILL(who, max_m_idx, MONSTER_IDX);
#ifdef JP
msg_format("%d 体のペットを放しました。", Dismissed);
{
bool p_can_enter;
bool old_character_xtra = character_xtra;
- int old_riding = p_ptr->riding;
+ MONSTER_IDX old_riding = p_ptr->riding;
bool old_riding_ryoute = p_ptr->riding_ryoute;
bool old_old_riding_ryoute = p_ptr->old_riding_ryoute;
bool old_pf_ryoute = (p_ptr->pet_extra_flags & PF_RYOUTE) ? TRUE : FALSE;
* @param force TRUEならば強制的に落馬する
* @return 実際に落馬したらTRUEを返す
*/
-bool rakuba(int dam, bool force)
+bool rakuba(HIT_POINT dam, bool force)
{
int i, y, x, oy, ox;
int sn = 0, sy = 0, sx = 0;
cave_type *c_ptr;
/* Access the location */
- y = py + ddy_ddd[i];
- x = px + ddx_ddd[i];
+ y = p_ptr->y + ddy_ddd[i];
+ x = p_ptr->x + ddx_ddd[i];
c_ptr = &cave[y][x];
return FALSE;
}
- oy = py;
- ox = px;
+ oy = p_ptr->y;
+ ox = p_ptr->x;
- py = sy;
- px = sx;
+ p_ptr->y = sy;
+ p_ptr->x = sx;
/* Redraw the old spot */
lite_spot(oy, ox);
/* Redraw the new spot */
- lite_spot(py, px);
+ lite_spot(p_ptr->y, p_ptr->x);
/* Check for new panel */
verify_panel();
/* Move the player */
if (sy && !p_ptr->is_dead)
- (void)move_player_effect(py, px, MPE_DONT_PICKUP | MPE_DONT_SWAP_MON);
+ (void)move_player_effect(p_ptr->y, p_ptr->x, MPE_DONT_PICKUP | MPE_DONT_SWAP_MON);
return fall_dam;
}
monster_type *m_ptr;
if (!get_rep_dir2(&dir)) return FALSE;
- y = py + ddy[dir];
- x = px + ddx[dir];
+ y = p_ptr->y + ddy[dir];
+ x = p_ptr->x + ddx[dir];
c_ptr = &cave[y][x];
if (p_ptr->special_defense & KATA_MUSOU) set_action(ACTION_NONE);
return FALSE;
}
- if (!pattern_seq(py, px, y, x)) return FALSE;
+ if (!pattern_seq(p_ptr->y, p_ptr->x, y, x)) return FALSE;
if (c_ptr->m_idx)
{
/* Take a turn */
- energy_use = 100;
+ p_ptr->energy_use = 100;
/* Message */
msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
return FALSE;
}
- if (!pattern_seq(py, px, y, x)) return FALSE;
+ if (!pattern_seq(p_ptr->y, p_ptr->x, y, x)) return FALSE;
if (!player_can_ride_aux(c_ptr, TRUE))
{
if (r_info[m_ptr->r_idx].level > randint1((p_ptr->skill_exp[GINOU_RIDING] / 50 + p_ptr->lev / 2 + 20)))
{
msg_print(_("うまく乗れなかった。", "You failed to ride."));
- energy_use = 100;
+ p_ptr->energy_use = 100;
return FALSE;
}
if (p_ptr->riding == p_ptr->health_who) health_track(0);
}
- energy_use = 100;
+ p_ptr->energy_use = 100;
/* Mega-Hack -- Forget the view and lite */
p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
m_ptr->nickname = quark_add(out_val);
if (record_named_pet)
{
- char m_name[80];
-
monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_NAME, m_name);
}
{
if (record_named_pet && old_name)
{
- char m_name[80];
-
monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_UNNAME, m_name);
}
*/
void do_cmd_pet(void)
{
- int i = 0;
+ COMMAND_CODE i = 0;
int num;
int powers[36];
cptr power_desc[36];
int pet_ctr;
monster_type *m_ptr;
- int mode = 0;
+ PET_COMMAND_IDX mode = 0;
char buf[160];
char target_buf[160];
if (!redraw || use_menu)
{
byte y = 1, x = 0;
- int ctr = 0;
+ PET_COMMAND_IDX ctr = 0;
/* Show list */
redraw = TRUE;
ask = (isupper(choice));
/* Lowercase */
- if (ask) choice = tolower(choice);
+ if (ask) choice = (char)tolower(choice);
/* Extract request */
i = (islower(choice) ? A2I(choice) : -1);
/* Abort if needed */
if (!flag)
{
- energy_use = 0;
+ p_ptr->energy_use = 0;
return;
}