From: deskull Date: Mon, 18 Jan 2021 13:33:37 +0000 (+0900) Subject: Merge remote-tracking branch 'remotes/origin/feature/Fix-Update-Weird-Telepathy'... X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=f23318f007a5f8774824f50097bbbf0512294f92;hp=604f33d6afb88d8db2342539ddcbe9c829f56654;p=hengband%2Fhengband.git Merge remote-tracking branch 'remotes/origin/feature/Fix-Update-Weird-Telepathy' into develop --- diff --git a/src/grid/trap.c b/src/grid/trap.c index 2931e746e..ce82e0fe7 100644 --- a/src/grid/trap.c +++ b/src/grid/trap.c @@ -1,4 +1,4 @@ -#include "grid/trap.h" +#include "grid/trap.h" #include "cmd-io/cmd-dump.h" #include "cmd-io/cmd-save.h" #include "core/disturbance.h" @@ -512,8 +512,8 @@ void hit_trap(player_type *trapped_ptr, bool break_trap) } case TRAP_BLIND: { - hit_trap_set_abnormal_status_p(trapped_ptr, _("黒いガスに包み込まれた!", "A black gas surrounds you!"), (bool)has_resist_blind(trapped_ptr), set_blind, - trapped_ptr->blind + (TIME_EFFECT)randint0(50) + 25); + hit_trap_set_abnormal_status_p(trapped_ptr, _("黒いガスに包み込まれた!", "A black gas surrounds you!"), (has_resist_blind(trapped_ptr) != 0), + set_blind, trapped_ptr->blind + (TIME_EFFECT)randint0(50) + 25); break; } diff --git a/src/monster-attack/monster-attack-player.c b/src/monster-attack/monster-attack-player.c index 94ee4a7b6..316327290 100644 --- a/src/monster-attack/monster-attack-player.c +++ b/src/monster-attack/monster-attack-player.c @@ -473,7 +473,8 @@ bool make_attack_normal(player_type *target_ptr, MONSTER_IDX m_idx) { monap_type tmp_monap; monap_type *monap_ptr = initialize_monap_type(target_ptr, &tmp_monap, m_idx); - check_no_blow(target_ptr, monap_ptr); + if (!check_no_blow(target_ptr, monap_ptr)) + return FALSE; monster_race *r_ptr = &r_info[monap_ptr->m_ptr->r_idx]; monap_ptr->rlev = ((r_ptr->level >= 1) ? r_ptr->level : 1); diff --git a/src/monster-floor/monster-move.c b/src/monster-floor/monster-move.c index 336b6d8b2..f93e89915 100644 --- a/src/monster-floor/monster-move.c +++ b/src/monster-floor/monster-move.c @@ -352,14 +352,6 @@ bool process_monster_movement(player_type *target_ptr, turn_flags *turn_flags_pt monster_race *r_ptr = &r_info[m_ptr->r_idx]; bool can_cross = monster_can_cross_terrain(target_ptr, g_ptr->feat, r_ptr, turn_flags_ptr->is_riding_mon ? CEM_RIDING : 0); - /* Non stupid, non confused pets avoid attacking player */ - if (is_pet(m_ptr) - && !(r_ptr->r_flags2 & RF2_STUPID) - && !m_ptr->mtimed[MTIMED_CONFUSED] - && player_bold(target_ptr, ny, nx)) { - continue; - } - if (!process_wall(target_ptr, turn_flags_ptr, m_ptr, ny, nx, can_cross)) { if (!process_door(target_ptr, turn_flags_ptr, m_ptr, ny, nx)) return FALSE; diff --git a/src/pet/pet-fall-off.c b/src/pet/pet-fall-off.c index 7b57bd598..85b29eea4 100644 --- a/src/pet/pet-fall-off.c +++ b/src/pet/pet-fall-off.c @@ -89,19 +89,19 @@ static bool calc_fall_off_possibility(player_type *creature_ptr, const HIT_POINT */ bool process_fall_off_horse(player_type *creature_ptr, HIT_POINT dam, bool force) { - POSITION sy = 0, sx = 0; + POSITION sy = 0; + POSITION sx = 0; int sn = 0; GAME_TEXT m_name[MAX_NLEN]; monster_type *m_ptr = &creature_ptr->current_floor_ptr->m_list[creature_ptr->riding]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; - if (!creature_ptr->riding) - return FALSE; - if (creature_ptr->wild_mode) + if (!creature_ptr->riding || creature_ptr->wild_mode) return FALSE; if (dam >= 0 || force) { - calc_fall_off_possibility(creature_ptr, dam, force, r_ptr); + if (!calc_fall_off_possibility(creature_ptr, dam, force, r_ptr)) + return FALSE; /* Check around the player */ for (DIRECTION i = 0; i < 8; i++) { diff --git a/src/player/player-status-flags.c b/src/player/player-status-flags.c index 32ed1b9a1..da2164edc 100644 --- a/src/player/player-status-flags.c +++ b/src/player/player-status-flags.c @@ -331,7 +331,7 @@ BIT_FLAGS has_invuln_arrow(player_type *creature_ptr) return result; } -void has_no_flowed(player_type *creature_ptr) +void check_no_flowed(player_type *creature_ptr) { object_type *o_ptr; bool has_sw = FALSE, has_kabe = FALSE; @@ -1698,6 +1698,9 @@ bool has_riding_wield_weapon(player_type *creature_ptr, int i) bool has_not_ninja_weapon(player_type *creature_ptr, int i) { + if (!has_melee_weapon(creature_ptr, INVEN_RARM + i)) { + return FALSE; + } tval_type tval = creature_ptr->inventory_list[INVEN_RARM + i].tval - TV_WEAPON_BEGIN; OBJECT_SUBTYPE_VALUE sval = creature_ptr->inventory_list[INVEN_RARM + i].sval; return creature_ptr->pclass == CLASS_NINJA @@ -1706,6 +1709,9 @@ bool has_not_ninja_weapon(player_type *creature_ptr, int i) bool has_not_monk_weapon(player_type *creature_ptr, int i) { + if (!has_melee_weapon(creature_ptr, INVEN_RARM + i)) { + return FALSE; + } tval_type tval = creature_ptr->inventory_list[INVEN_RARM + i].tval - TV_WEAPON_BEGIN; OBJECT_SUBTYPE_VALUE sval = creature_ptr->inventory_list[INVEN_RARM + i].sval; return ((creature_ptr->pclass == CLASS_MONK) || (creature_ptr->pclass == CLASS_FORCETRAINER)) diff --git a/src/player/player-status-flags.h b/src/player/player-status-flags.h index f19cb5181..d8b086fcf 100644 --- a/src/player/player-status-flags.h +++ b/src/player/player-status-flags.h @@ -44,7 +44,7 @@ BIT_FLAGS has_easy2_weapon(player_type *creature_ptr); BIT_FLAGS has_down_saving(player_type *creature_ptr); BIT_FLAGS has_no_ac(player_type *creature_ptr); BIT_FLAGS has_invuln_arrow(player_type *creature_ptr); -void has_no_flowed(player_type *creature_ptr); +void check_no_flowed(player_type *creature_ptr); BIT_FLAGS has_mighty_throw(player_type *creature_ptr); BIT_FLAGS has_dec_mana(player_type *creature_ptr); BIT_FLAGS has_reflect(player_type *creature_ptr); diff --git a/src/player/player-status.c b/src/player/player-status.c index 5a337d8f7..5cf70be91 100644 --- a/src/player/player-status.c +++ b/src/player/player-status.c @@ -482,6 +482,7 @@ void calc_bonuses(player_type *creature_ptr) return; put_equipment_warning(creature_ptr); + check_no_flowed(creature_ptr); } static void calc_alignment(player_type *creature_ptr)