OSDN Git Service

[Fix] #41264 WIP,calc_to_damage()再整理中.
[hengband/hengband.git] / src / player / player-status.c
index 4e863f3..9da4d6b 100644 (file)
@@ -346,8 +346,6 @@ void calc_bonuses(player_type *creature_ptr)
     ARMOUR_CLASS old_dis_ac = creature_ptr->dis_ac;
     ARMOUR_CLASS old_dis_to_a = creature_ptr->dis_to_a;
 
-    creature_ptr->pass_wall = has_pass_wall(creature_ptr);
-    creature_ptr->kill_wall = has_kill_wall(creature_ptr);
     creature_ptr->xtra_might = has_xtra_might(creature_ptr);
     creature_ptr->esp_evil = has_esp_evil(creature_ptr);
     creature_ptr->esp_animal = has_esp_animal(creature_ptr);
@@ -368,25 +366,15 @@ void calc_bonuses(player_type *creature_ptr)
     creature_ptr->yoiyami = has_no_ac(creature_ptr);
     creature_ptr->mighty_throw = has_mighty_throw(creature_ptr);
     creature_ptr->dec_mana = has_dec_mana(creature_ptr);
-    creature_ptr->reflect = has_reflect(creature_ptr);
     creature_ptr->see_nocto = has_see_nocto(creature_ptr);
     creature_ptr->warning = has_warning(creature_ptr);
     creature_ptr->anti_magic = has_anti_magic(creature_ptr);
     creature_ptr->anti_tele = has_anti_tele(creature_ptr);
-    creature_ptr->sh_fire = has_sh_fire(creature_ptr);
-    creature_ptr->sh_elec = has_sh_elec(creature_ptr);
-    creature_ptr->sh_cold = has_sh_cold(creature_ptr);
     creature_ptr->easy_spell = has_easy_spell(creature_ptr);
     creature_ptr->heavy_spell = has_heavy_spell(creature_ptr);
     creature_ptr->hold_exp = has_hold_exp(creature_ptr);
     creature_ptr->see_inv = has_see_inv(creature_ptr);
     creature_ptr->free_act = has_free_act(creature_ptr);
-    creature_ptr->sustain_str = has_sustain_str(creature_ptr);
-    creature_ptr->sustain_int = has_sustain_int(creature_ptr);
-    creature_ptr->sustain_wis = has_sustain_wis(creature_ptr);
-    creature_ptr->sustain_dex = has_sustain_dex(creature_ptr);
-    creature_ptr->sustain_con = has_sustain_con(creature_ptr);
-    creature_ptr->sustain_chr = has_sustain_chr(creature_ptr);
     creature_ptr->levitation = has_levitation(creature_ptr);
     has_can_swim(creature_ptr);
     creature_ptr->slow_digest = has_slow_digest(creature_ptr);
@@ -394,25 +382,6 @@ void calc_bonuses(player_type *creature_ptr)
     has_curses(creature_ptr);
     creature_ptr->impact = has_impact(creature_ptr);
     has_extra_blow(creature_ptr);
-    creature_ptr->resist_acid = has_resist_acid(creature_ptr);
-    creature_ptr->resist_elec = has_resist_elec(creature_ptr);
-    creature_ptr->resist_fire = has_resist_fire(creature_ptr);
-    creature_ptr->resist_cold = has_resist_cold(creature_ptr);
-    creature_ptr->resist_pois = has_resist_pois(creature_ptr);
-    creature_ptr->resist_conf = has_resist_conf(creature_ptr);
-    creature_ptr->resist_sound = has_resist_sound(creature_ptr);
-    creature_ptr->resist_lite = has_resist_lite(creature_ptr);
-    creature_ptr->resist_dark = has_resist_dark(creature_ptr);
-    creature_ptr->resist_chaos = has_resist_chaos(creature_ptr);
-    creature_ptr->resist_disen = has_resist_disen(creature_ptr);
-    creature_ptr->resist_shard = has_resist_shard(creature_ptr);
-    creature_ptr->resist_nexus = has_resist_nexus(creature_ptr);
-    creature_ptr->resist_blind = has_resist_blind(creature_ptr);
-    creature_ptr->resist_neth = has_resist_neth(creature_ptr);
-    creature_ptr->resist_time = has_resist_time(creature_ptr);
-    creature_ptr->resist_fear = has_resist_fear(creature_ptr);
-    creature_ptr->resist_time = has_resist_time(creature_ptr);
-    creature_ptr->resist_water = has_resist_water(creature_ptr);
 
     creature_ptr->lite = has_lite(creature_ptr);
 
@@ -513,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)
@@ -1290,7 +1260,7 @@ static ACTION_SKILL_POWER calc_stealth(player_type *creature_ptr)
         if (hex_spelling_any(creature_ptr))
             pow -= (1 + casting_hex_num(creature_ptr));
     }
-    if ((is_specific_player_race(creature_ptr, RACE_S_FAIRY)) && (creature_ptr->pseikaku != PERSONALITY_SEXY) && (creature_ptr->cursed & TRC_AGGRAVATE)) {
+    if (player_aggravate_state(creature_ptr) == AGGRAVATE_S_FAIRY) {
         pow = MIN(pow - 3, (pow + 2) / 2);
     }
 
@@ -1298,11 +1268,13 @@ static ACTION_SKILL_POWER calc_stealth(player_type *creature_ptr)
         pow -= 7;
     }
 
-    if (creature_ptr->pclass == CLASS_NINJA && heavy_armor(creature_ptr)) {
-        pow -= (creature_ptr->lev) / 10;
-    } else if ((!creature_ptr->inventory_list[INVEN_RARM].k_idx || has_right_hand_weapon(creature_ptr))
-        && (!creature_ptr->inventory_list[INVEN_LARM].k_idx || has_left_hand_weapon(creature_ptr))) {
-        pow += (creature_ptr->lev) / 10;
+    if (creature_ptr->pclass == CLASS_NINJA) {
+        if (heavy_armor(creature_ptr)) {
+            pow -= (creature_ptr->lev) / 10;
+        } else if ((!creature_ptr->inventory_list[INVEN_RARM].k_idx || has_right_hand_weapon(creature_ptr))
+            && (!creature_ptr->inventory_list[INVEN_LARM].k_idx || has_left_hand_weapon(creature_ptr))) {
+            pow += (creature_ptr->lev) / 10;
+        }
     }
 
     if (is_time_limit_stealth(creature_ptr))
@@ -1687,14 +1659,12 @@ static s16b calc_num_blow(player_type *creature_ptr, int i)
 {
     object_type *o_ptr;
     BIT_FLAGS flgs[TR_FLAG_SIZE];
-    s16b num_blow = 0;
+    s16b num_blow = 1;
 
     o_ptr = &creature_ptr->inventory_list[INVEN_RARM + i];
     object_flags(creature_ptr, o_ptr, flgs);
     creature_ptr->heavy_wield[i] = FALSE;
-    if (!has_melee_weapon(creature_ptr, INVEN_RARM + i)) {
-        num_blow = 1;
-    } else {
+    if (has_melee_weapon(creature_ptr, INVEN_RARM + i)) {
         if (calc_weapon_weight_limit(creature_ptr) < o_ptr->weight / 10) {
             creature_ptr->heavy_wield[i] = TRUE;
         }
@@ -2999,14 +2969,9 @@ static s16b calc_to_damage(player_type *creature_ptr, INVENTORY_IDX slot, bool i
                 bonus_to_d = (o_ptr->to_d + 1) / 2;
         }
 
-        if ((i == INVEN_LEFT || i == INVEN_RIGHT) && !has_two_handed_weapons(creature_ptr)) {
+        if ((i == INVEN_LEFT || i == INVEN_RIGHT) && has_two_handed_weapons(creature_ptr)) {
             damage += (s16b)bonus_to_d;
-        } else if (has_right_hand_weapon(creature_ptr) && has_left_hand_weapon(creature_ptr)) {
-            if (id == 0)
-                damage += (bonus_to_d > 0) ? (bonus_to_d + 1) / 2 : bonus_to_d;
-            if (id == 1)
-                damage += (bonus_to_d > 0) ? bonus_to_d / 2 : bonus_to_d;
-        } else if (id == get_default_hand(creature_ptr)) {
+        } else if ((has_right_hand_weapon(creature_ptr) && id == 0 && i == INVEN_RIGHT)) {// || (has_left_hand_weapon(creature_ptr) && id == 1 && i == INVEN_LEFT)) {
             damage += (s16b)bonus_to_d;
         }
     }