変愚蛮怒のメインリポジトリです
Revision | 90bcae69618175dc57385f436a6bc9869ad6d251 (tree) |
---|---|
Time | 2018-12-15 19:01:52 |
Author | Deskull <deskull@user...> |
Commiter | Deskull |
[Feature] #38796 マーフォークが地形と浮遊状態に応じて加減速する仕様を追加。 / Speed of Merfolk changes by levitation and land feature.
@@ -1149,11 +1149,8 @@ bool rakuba(HIT_POINT dam, bool force) | ||
1149 | 1149 | calc_bonuses(); |
1150 | 1150 | |
1151 | 1151 | p_ptr->update |= (PU_BONUS); |
1152 | - | |
1153 | 1152 | p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS); |
1154 | - | |
1155 | 1153 | p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON); |
1156 | - | |
1157 | 1154 | p_ptr->redraw |= (PR_EXTRA); |
1158 | 1155 | |
1159 | 1156 | /* Update health track of mount */ |
@@ -826,16 +826,17 @@ bool player_can_enter(s16b feature, u16b mode) | ||
826 | 826 | */ |
827 | 827 | bool move_player_effect(POSITION ny, POSITION nx, BIT_FLAGS mpe_mode) |
828 | 828 | { |
829 | + POSITION oy = p_ptr->y; | |
830 | + POSITION ox = p_ptr->x; | |
829 | 831 | cave_type *c_ptr = &cave[ny][nx]; |
832 | + cave_type *oc_ptr = &cave[oy][ox]; | |
830 | 833 | feature_type *f_ptr = &f_info[c_ptr->feat]; |
834 | + feature_type *of_ptr = &f_info[oc_ptr->feat]; | |
831 | 835 | |
832 | 836 | if (!(mpe_mode & MPE_STAYING)) |
833 | 837 | { |
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; | |
839 | 840 | |
840 | 841 | /* Move the player */ |
841 | 842 | p_ptr->y = ny; |
@@ -885,7 +886,6 @@ bool move_player_effect(POSITION ny, POSITION nx, BIT_FLAGS mpe_mode) | ||
885 | 886 | } |
886 | 887 | |
887 | 888 | p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_DISTANCE); |
888 | - | |
889 | 889 | p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON); |
890 | 890 | |
891 | 891 | /* Remove "unsafe" flag */ |
@@ -908,6 +908,15 @@ bool move_player_effect(POSITION ny, POSITION nx, BIT_FLAGS mpe_mode) | ||
908 | 908 | msg_print(_("ここでは素早く動けない。", "You cannot run in here.")); |
909 | 909 | set_action(ACTION_NONE); |
910 | 910 | } |
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 | + } | |
911 | 920 | } |
912 | 921 | |
913 | 922 | if (mpe_mode & MPE_ENERGY_USE) |
@@ -3153,22 +3153,22 @@ s16b calc_num_fire(object_type *o_ptr) | ||
3153 | 3153 | */ |
3154 | 3154 | void calc_bonuses(void) |
3155 | 3155 | { |
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; | |
3162 | 3162 | 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; | |
3166 | 3166 | #if 0 |
3167 | - bool have_dd_s = FALSE, have_dd_t = FALSE; | |
3167 | + bool have_dd_s = FALSE, have_dd_t = FALSE; | |
3168 | 3168 | #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; | |
3172 | 3172 | OBJECT_IDX this_o_idx, next_o_idx = 0; |
3173 | 3173 | const player_race *tmp_rp_ptr; |
3174 | 3174 |
@@ -3189,9 +3189,12 @@ void calc_bonuses(void) | ||
3189 | 3189 | bool old_see_inv = p_ptr->see_inv; |
3190 | 3190 | bool old_mighty_throw = p_ptr->mighty_throw; |
3191 | 3191 | |
3192 | + /* Current feature under player. */ | |
3193 | + feature_type *f_ptr = &f_info[cave[p_ptr->y][p_ptr->x].feat]; | |
3194 | + | |
3192 | 3195 | /* 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; | |
3195 | 3198 | |
3196 | 3199 | |
3197 | 3200 | /* Clear extra blows/shots */ |
@@ -3773,6 +3776,15 @@ void calc_bonuses(void) | ||
3773 | 3776 | break; |
3774 | 3777 | case RACE_MERFOLK: |
3775 | 3778 | 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; | |
3776 | 3788 | default: |
3777 | 3789 | /* Do nothing */ |
3778 | 3790 | ; |