extern bool save_floor(saved_floor_type *sf_ptr, u32b mode);
/* spells1.c */
-extern bool in_disintegration_range(int y1, int x1, int y2, int x2);
+extern bool in_disintegration_range(POSITION y1, POSITION x1, POSITION y2, POSITION x2);
extern void breath_shape(u16b *path_g, int dist, int *pgrids, byte *gx, byte *gy, byte *gm, int *pgm_rad, int rad, int y1, int x1, int y2, int x2, int typ);
extern int take_hit(int damage_type, int damage, cptr kb_str, int monspell);
-extern u16b bolt_pict(int y, int x, int ny, int nx, int typ);
-extern sint project_path(u16b *gp, int range, int y1, int x1, int y2, int x2, int flg);
+extern u16b bolt_pict(POSITION y, POSITION x, POSITION ny, POSITION nx, int typ);
+extern sint project_path(u16b *gp, POSITION range, POSITION y1, POSITION x1, POSITION y2, POSITION x2, int flg);
extern int dist_to_line(int y, int x, int y1, int x1, int y2, int x2);
extern bool project(int who, int rad, int y, int x, HIT_POINT dam, int typ, int flg, int monspell);
extern int project_length;
extern bool recharge(int num);
extern bool bless_weapon(void);
extern bool pulish_shield(void);
-extern bool potion_smash_effect(int who, int y, int x, int k_idx);
+extern bool potion_smash_effect(int who, POSITION y, POSITION x, int k_idx);
extern void display_spell_list(void);
extern s16b experience_of_spell(int spell, int realm);
extern int mod_need_mana(int need_mana, int spell, int realm);
*/
bool build_tunnel2(POSITION x1, POSITION y1, POSITION x2, POSITION y2, int type, int cutoff)
{
- int x3, y3, dx, dy; // TODO: いずれpositon型に変える
+ POSITION x3, y3, dx, dy;
int changex, changey;
int length;
int i;
rd_byte(&p_ptr->exit_bldg);
rd_byte(&tmp8u);
- rd_s16b(&p_ptr->oldpx);
- rd_s16b(&p_ptr->oldpy);
+ rd_s16b(&tmp16s);
+ p_ptr->oldpx = (POSITION)tmp16s;
+ rd_s16b(&tmp16s);
+ p_ptr->oldpy = (POSITION)tmp16s;
+
if (z_older_than(10, 3, 13) && !dun_level && !p_ptr->inside_arena) {p_ptr->oldpy = 33;p_ptr->oldpx = 131;}
/* Was p_ptr->rewards[MAX_BACT] */
int old_ds, old_dd, old_to_h, old_to_d, old_ac, old_to_a, old_pval, old_name2, old_timeout;
u32b old_flgs[TR_FLAG_SIZE], new_flgs[TR_FLAG_SIZE];
object_type *o_ptr;
- cptr q, s;
- byte iy, ix, marked, number;
+ cptr q, s;
+ POSITION iy, ix;
+ byte_hack marked, number;
s16b next_o_idx, weight;
for (i = 0; i < sizeof(drain_value) / sizeof(int); i++)
wr_s16b(o_ptr->k_idx);
/* Location */
- wr_byte(o_ptr->iy);
- wr_byte(o_ptr->ix);
+ wr_byte((byte_hack)o_ptr->iy);
+ wr_byte((byte_hack)o_ptr->ix);
if (flags & SAVE_ITEM_PVAL) wr_s16b(o_ptr->pval);
/*** Write only un-obvious elements ***/
wr_s16b(m_ptr->r_idx);
- wr_byte(m_ptr->fy);
- wr_byte(m_ptr->fx);
+ wr_byte((byte_hack)m_ptr->fy);
+ wr_byte((byte_hack)m_ptr->fx);
wr_s16b(m_ptr->hp);
wr_s16b(m_ptr->maxhp);
wr_s16b(m_ptr->max_maxhp);
wr_byte(p_ptr->exit_bldg);
wr_byte(0); /* Unused */
- wr_s16b(p_ptr->oldpx);
- wr_s16b(p_ptr->oldpy);
+ wr_s16b((s16b)p_ptr->oldpx);
+ wr_s16b((s16b)p_ptr->oldpy);
/* Was number of p_ptr->rewards[] */
wr_s16b(0);
* If the distance is not "one", we (may) return "*".
* </pre>
*/
-u16b bolt_pict(int y, int x, int ny, int nx, int typ)
+u16b bolt_pict(POSITION y, POSITION x, POSITION ny, POSITION nx, int typ)
{
int base;
* by "update_view_los()", and very different from the one used by "los()".
* </pre>
*/
-sint project_path(u16b *gp, int range, int y1, int x1, int y2, int x2, int flg)
+sint project_path(u16b *gp, POSITION range, POSITION y1, POSITION x1, POSITION y2, POSITION x2, int flg)
{
int y, x;
* We return "TRUE" if any "obvious" effects were observed. XXX XXX Actually,
* we just assume that the effects were obvious, for historical reasons.
*/
-static bool project_p(int who, cptr who_name, int r, int y, int x, int dam, int typ, int flg, int monspell)
+static bool project_p(int who, cptr who_name, int r, POSITION y, POSITION x, int dam, int typ, int flg, int monspell)
{
int k = 0;
int rlev = 0;
if ((p_ptr->reflect || ((p_ptr->special_defense & KATA_FUUJIN) && !p_ptr->blind)) && (flg & PROJECT_REFLECTABLE) && !one_in_(10))
{
- byte t_y, t_x;
+ POSITION t_y, t_x;
int max_attempts = 10;
- if (blind)
- msg_print(_("何かが跳ね返った!", "Something bounces!"));
+ if (blind)
+ msg_print(_("何かが跳ね返った!", "Something bounces!"));
else if (p_ptr->special_defense & KATA_FUUJIN)
- msg_print(_("風の如く武器を振るって弾き返した!", "The attack bounces!"));
+ msg_print(_("風の如く武器を振るって弾き返した!", "The attack bounces!"));
else
- msg_print(_("攻撃が跳ね返った!", "The attack bounces!"));
+ msg_print(_("攻撃が跳ね返った!", "The attack bounces!"));
/* Choose 'new' target */
* Modified version of los() for calculation of disintegration balls.
* Disintegration effects are stopped by permanent walls.
*/
-bool in_disintegration_range(int y1, int x1, int y2, int x2)
+bool in_disintegration_range(POSITION y1, POSITION x1, POSITION y2, POSITION x2)
{
/* Delta */
- int dx, dy;
+ POSITION dx, dy;
/* Absolute */
- int ax, ay;
+ POSITION ax, ay;
/* Signs */
- int sx, sy;
+ POSITION sx, sy;
/* Fractions */
- int qx, qy;
+ POSITION qx, qy;
/* Scanners */
- int tx, ty;
+ POSITION tx, ty;
/* Scale factors */
- int f1, f2;
+ POSITION f1, f2;
/* Slope, or 1/Slope, of LOS */
- int m;
+ POSITION m;
/* Extract the offset */
/* Oops */
msg_print(_("まばゆい閃光が走った!", "There is a bright flash of light!"));
{
- byte iy = o_ptr->iy; /* Y-position on map, or zero */
- byte ix = o_ptr->ix; /* X-position on map, or zero */
+ POSITION iy = o_ptr->iy; /* Y-position on map, or zero */
+ POSITION ix = o_ptr->ix; /* X-position on map, or zero */
s16b next_o_idx = o_ptr->next_o_idx; /* Next object in stack (if any) */
byte marked = o_ptr->marked; /* Object is marked */
s16b weight = o_ptr->number * o_ptr->weight;
* o_ptr --- pointer to the potion object.
* </pre>
*/
-bool potion_smash_effect(int who, int y, int x, int k_idx)
+bool potion_smash_effect(int who, POSITION y, POSITION x, int k_idx)
{
int radius = 2;
int dt = 0;
struct player_type
{
- s16b oldpy; /* Previous player location -KMW- */
- s16b oldpx; /* Previous player location -KMW- */
+ POSITION oldpy; /* Previous player location -KMW- */
+ POSITION oldpx; /* Previous player location -KMW- */
CHARACTER_IDX psex; /* Sex index */
CHARACTER_IDX prace; /* Race index */