From 90bcae69618175dc57385f436a6bc9869ad6d251 Mon Sep 17 00:00:00 2001 From: Deskull Date: Sat, 15 Dec 2018 19:01:52 +0900 Subject: [PATCH] =?utf8?q?[Feature]=20#38796=20=E3=83=9E=E3=83=BC=E3=83=95?= =?utf8?q?=E3=82=A9=E3=83=BC=E3=82=AF=E3=81=8C=E5=9C=B0=E5=BD=A2=E3=81=A8?= =?utf8?q?=E6=B5=AE=E9=81=8A=E7=8A=B6=E6=85=8B=E3=81=AB=E5=BF=9C=E3=81=98?= =?utf8?q?=E3=81=A6=E5=8A=A0=E6=B8=9B=E9=80=9F=E3=81=99=E3=82=8B=E4=BB=95?= =?utf8?q?=E6=A7=98=E3=82=92=E8=BF=BD=E5=8A=A0=E3=80=82=20/=20Speed=20of?= =?utf8?q?=20Merfolk=20changes=20by=20levitation=20and=20land=20feature.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/cmd-pet.c | 3 --- src/cmd1.c | 21 +++++++++++++++------ src/xtra1.c | 42 +++++++++++++++++++++++++++--------------- 3 files changed, 42 insertions(+), 24 deletions(-) diff --git a/src/cmd-pet.c b/src/cmd-pet.c index 7dfd6ff7c..4643b7fe7 100644 --- a/src/cmd-pet.c +++ b/src/cmd-pet.c @@ -1149,11 +1149,8 @@ bool rakuba(HIT_POINT dam, bool force) calc_bonuses(); p_ptr->update |= (PU_BONUS); - p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS); - p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON); - p_ptr->redraw |= (PR_EXTRA); /* Update health track of mount */ diff --git a/src/cmd1.c b/src/cmd1.c index 5efc9be34..c78e626ec 100644 --- a/src/cmd1.c +++ b/src/cmd1.c @@ -826,16 +826,17 @@ bool player_can_enter(s16b feature, u16b mode) */ bool move_player_effect(POSITION ny, POSITION nx, BIT_FLAGS mpe_mode) { + POSITION oy = p_ptr->y; + POSITION ox = p_ptr->x; cave_type *c_ptr = &cave[ny][nx]; + cave_type *oc_ptr = &cave[oy][ox]; feature_type *f_ptr = &f_info[c_ptr->feat]; + feature_type *of_ptr = &f_info[oc_ptr->feat]; if (!(mpe_mode & MPE_STAYING)) { - POSITION oy = p_ptr->y; - POSITION ox = p_ptr->x; - cave_type *oc_ptr = &cave[oy][ox]; - IDX om_idx = oc_ptr->m_idx; - IDX nm_idx = c_ptr->m_idx; + MONSTER_IDX om_idx = oc_ptr->m_idx; + MONSTER_IDX nm_idx = c_ptr->m_idx; /* Move the player */ p_ptr->y = ny; @@ -885,7 +886,6 @@ bool move_player_effect(POSITION ny, POSITION nx, BIT_FLAGS mpe_mode) } p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_DISTANCE); - p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON); /* Remove "unsafe" flag */ @@ -908,6 +908,15 @@ bool move_player_effect(POSITION ny, POSITION nx, BIT_FLAGS mpe_mode) msg_print(_("ここでは素早く動けない。", "You cannot run in here.")); set_action(ACTION_NONE); } + + if (p_ptr->prace == RACE_MERFOLK) + { + if(have_flag(f_ptr->flags, FF_WATER) ^ have_flag(of_ptr->flags, FF_WATER)) + { + p_ptr->update |= PU_BONUS; + update_stuff(); + } + } } if (mpe_mode & MPE_ENERGY_USE) diff --git a/src/xtra1.c b/src/xtra1.c index 3e60f3b43..2065f3925 100644 --- a/src/xtra1.c +++ b/src/xtra1.c @@ -3153,22 +3153,22 @@ s16b calc_num_fire(object_type *o_ptr) */ void calc_bonuses(void) { - int i, j, hold, neutral[2]; - int new_speed; - int default_hand = 0; - int empty_hands_status = empty_hands(TRUE); - int extra_blows[2]; - object_type *o_ptr; + int i, j, hold, neutral[2]; + int new_speed; + int default_hand = 0; + int empty_hands_status = empty_hands(TRUE); + int extra_blows[2]; + object_type *o_ptr; BIT_FLAGS flgs[TR_FLAG_SIZE]; - bool omoi = FALSE; - bool yoiyami = FALSE; - bool down_saving = FALSE; + bool omoi = FALSE; + bool yoiyami = FALSE; + bool down_saving = FALSE; #if 0 - bool have_dd_s = FALSE, have_dd_t = FALSE; + bool have_dd_s = FALSE, have_dd_t = FALSE; #endif - bool have_sw = FALSE, have_kabe = FALSE; - bool easy_2weapon = FALSE; - bool riding_levitation = FALSE; + bool have_sw = FALSE, have_kabe = FALSE; + bool easy_2weapon = FALSE; + bool riding_levitation = FALSE; OBJECT_IDX this_o_idx, next_o_idx = 0; const player_race *tmp_rp_ptr; @@ -3189,9 +3189,12 @@ void calc_bonuses(void) bool old_see_inv = p_ptr->see_inv; bool old_mighty_throw = p_ptr->mighty_throw; + /* Current feature under player. */ + feature_type *f_ptr = &f_info[cave[p_ptr->y][p_ptr->x].feat]; + /* Save the old armor class */ - s16b old_dis_ac = p_ptr->dis_ac; - s16b old_dis_to_a = p_ptr->dis_to_a; + ARMOUR_CLASS old_dis_ac = p_ptr->dis_ac; + ARMOUR_CLASS old_dis_to_a = p_ptr->dis_to_a; /* Clear extra blows/shots */ @@ -3773,6 +3776,15 @@ void calc_bonuses(void) break; case RACE_MERFOLK: p_ptr->resist_water = TRUE; + if(have_flag(f_ptr->flags, FF_WATER)) + { + new_speed += (2 + p_ptr->lev / 10); + } + else if(!p_ptr->levitation) + { + new_speed -= 2; + } + break; default: /* Do nothing */ ; -- 2.11.0