• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revision90bcae69618175dc57385f436a6bc9869ad6d251 (tree)
Time2018-12-15 19:01:52
AuthorDeskull <deskull@user...>
CommiterDeskull

Log Message

[Feature] #38796 マーフォークが地形と浮遊状態に応じて加減速する仕様を追加。 / Speed of Merfolk changes by levitation and land feature.

Change Summary

Incremental Difference

--- a/src/cmd-pet.c
+++ b/src/cmd-pet.c
@@ -1149,11 +1149,8 @@ bool rakuba(HIT_POINT dam, bool force)
11491149 calc_bonuses();
11501150
11511151 p_ptr->update |= (PU_BONUS);
1152-
11531152 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS);
1154-
11551153 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1156-
11571154 p_ptr->redraw |= (PR_EXTRA);
11581155
11591156 /* Update health track of mount */
--- a/src/cmd1.c
+++ b/src/cmd1.c
@@ -826,16 +826,17 @@ bool player_can_enter(s16b feature, u16b mode)
826826 */
827827 bool move_player_effect(POSITION ny, POSITION nx, BIT_FLAGS mpe_mode)
828828 {
829+ POSITION oy = p_ptr->y;
830+ POSITION ox = p_ptr->x;
829831 cave_type *c_ptr = &cave[ny][nx];
832+ cave_type *oc_ptr = &cave[oy][ox];
830833 feature_type *f_ptr = &f_info[c_ptr->feat];
834+ feature_type *of_ptr = &f_info[oc_ptr->feat];
831835
832836 if (!(mpe_mode & MPE_STAYING))
833837 {
834- POSITION oy = p_ptr->y;
835- POSITION ox = p_ptr->x;
836- cave_type *oc_ptr = &cave[oy][ox];
837- IDX om_idx = oc_ptr->m_idx;
838- IDX nm_idx = c_ptr->m_idx;
838+ MONSTER_IDX om_idx = oc_ptr->m_idx;
839+ MONSTER_IDX nm_idx = c_ptr->m_idx;
839840
840841 /* Move the player */
841842 p_ptr->y = ny;
@@ -885,7 +886,6 @@ bool move_player_effect(POSITION ny, POSITION nx, BIT_FLAGS mpe_mode)
885886 }
886887
887888 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_DISTANCE);
888-
889889 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
890890
891891 /* Remove "unsafe" flag */
@@ -908,6 +908,15 @@ bool move_player_effect(POSITION ny, POSITION nx, BIT_FLAGS mpe_mode)
908908 msg_print(_("ここでは素早く動けない。", "You cannot run in here."));
909909 set_action(ACTION_NONE);
910910 }
911+
912+ if (p_ptr->prace == RACE_MERFOLK)
913+ {
914+ if(have_flag(f_ptr->flags, FF_WATER) ^ have_flag(of_ptr->flags, FF_WATER))
915+ {
916+ p_ptr->update |= PU_BONUS;
917+ update_stuff();
918+ }
919+ }
911920 }
912921
913922 if (mpe_mode & MPE_ENERGY_USE)
--- a/src/xtra1.c
+++ b/src/xtra1.c
@@ -3153,22 +3153,22 @@ s16b calc_num_fire(object_type *o_ptr)
31533153 */
31543154 void calc_bonuses(void)
31553155 {
3156- int i, j, hold, neutral[2];
3157- int new_speed;
3158- int default_hand = 0;
3159- int empty_hands_status = empty_hands(TRUE);
3160- int extra_blows[2];
3161- object_type *o_ptr;
3156+ int i, j, hold, neutral[2];
3157+ int new_speed;
3158+ int default_hand = 0;
3159+ int empty_hands_status = empty_hands(TRUE);
3160+ int extra_blows[2];
3161+ object_type *o_ptr;
31623162 BIT_FLAGS flgs[TR_FLAG_SIZE];
3163- bool omoi = FALSE;
3164- bool yoiyami = FALSE;
3165- bool down_saving = FALSE;
3163+ bool omoi = FALSE;
3164+ bool yoiyami = FALSE;
3165+ bool down_saving = FALSE;
31663166 #if 0
3167- bool have_dd_s = FALSE, have_dd_t = FALSE;
3167+ bool have_dd_s = FALSE, have_dd_t = FALSE;
31683168 #endif
3169- bool have_sw = FALSE, have_kabe = FALSE;
3170- bool easy_2weapon = FALSE;
3171- bool riding_levitation = FALSE;
3169+ bool have_sw = FALSE, have_kabe = FALSE;
3170+ bool easy_2weapon = FALSE;
3171+ bool riding_levitation = FALSE;
31723172 OBJECT_IDX this_o_idx, next_o_idx = 0;
31733173 const player_race *tmp_rp_ptr;
31743174
@@ -3189,9 +3189,12 @@ void calc_bonuses(void)
31893189 bool old_see_inv = p_ptr->see_inv;
31903190 bool old_mighty_throw = p_ptr->mighty_throw;
31913191
3192+ /* Current feature under player. */
3193+ feature_type *f_ptr = &f_info[cave[p_ptr->y][p_ptr->x].feat];
3194+
31923195 /* Save the old armor class */
3193- s16b old_dis_ac = p_ptr->dis_ac;
3194- s16b old_dis_to_a = p_ptr->dis_to_a;
3196+ ARMOUR_CLASS old_dis_ac = p_ptr->dis_ac;
3197+ ARMOUR_CLASS old_dis_to_a = p_ptr->dis_to_a;
31953198
31963199
31973200 /* Clear extra blows/shots */
@@ -3773,6 +3776,15 @@ void calc_bonuses(void)
37733776 break;
37743777 case RACE_MERFOLK:
37753778 p_ptr->resist_water = TRUE;
3779+ if(have_flag(f_ptr->flags, FF_WATER))
3780+ {
3781+ new_speed += (2 + p_ptr->lev / 10);
3782+ }
3783+ else if(!p_ptr->levitation)
3784+ {
3785+ new_speed -= 2;
3786+ }
3787+ break;
37763788 default:
37773789 /* Do nothing */
37783790 ;
Show on old repository browser