OSDN Git Service

Merge remote-tracking branch 'remotes/origin/feature/Fix-Update-Weird-Telepathy'...
authordeskull <deskull@users.sourceforge.jp>
Mon, 18 Jan 2021 13:33:37 +0000 (22:33 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Mon, 18 Jan 2021 13:33:37 +0000 (22:33 +0900)
src/grid/trap.c
src/monster-attack/monster-attack-player.c
src/monster-floor/monster-move.c
src/pet/pet-fall-off.c
src/player/player-status-flags.c
src/player/player-status-flags.h
src/player/player-status.c

index 2931e74..ce82e0f 100644 (file)
@@ -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;
     }
 
index 94ee4a7..3163272 100644 (file)
@@ -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);
index 336b6d8..f93e899 100644 (file)
@@ -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;
index 7b57bd5..85b29ee 100644 (file)
@@ -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++) {
index 32ed1b9..da2164e 100644 (file)
@@ -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))
index f19cb51..d8b086f 100644 (file)
@@ -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);
index 5a337d8..5cf70be 100644 (file)
@@ -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)