OSDN Git Service

[Refactor] #37353 PROJECT_* 定義を新規ファイル projection.h へ移動。 / Move PROJECT_* definition...
[hengband/hengband.git] / src / melee1.c
index e4cacd5..13b90f1 100644 (file)
@@ -16,6 +16,7 @@
 #include "player-damage.h"
 #include "monsterrace-hook.h"
 #include "melee.h"
+#include "projection.h"
 
 
 
@@ -1440,8 +1441,8 @@ bool py_attack(POSITION y, POSITION x, BIT_FLAGS mode)
 
                if (cur < max)
                {
-                       int ridinglevel = r_info[m_list[p_ptr->riding].r_idx].level;
-                       int targetlevel = r_ptr->level;
+                       DEPTH ridinglevel = r_info[m_list[p_ptr->riding].r_idx].level;
+                       DEPTH targetlevel = r_ptr->level;
                        int inc = 0;
 
                        if ((cur / 200 - 5) < targetlevel)
@@ -1457,7 +1458,6 @@ bool py_attack(POSITION y, POSITION x, BIT_FLAGS mode)
                        }
 
                        p_ptr->skill_exp[GINOU_RIDING] = MIN(max, cur + inc);
-
                        p_ptr->update |= (PU_BONUS);
                }
        }
@@ -3204,6 +3204,33 @@ bool make_attack_normal(MONSTER_IDX m_idx)
 #endif
 
                                }
+
+                               /* Gain shield experience */
+                               if (object_is_armour(&inventory[INVEN_RARM]) || object_is_armour(&inventory[INVEN_LARM]))
+                               {
+                                       int cur = p_ptr->skill_exp[GINOU_SHIELD];
+                                       int max = s_info[p_ptr->pclass].s_max[GINOU_SHIELD];
+
+                                       if (cur < max)
+                                       {
+                                               DEPTH targetlevel = r_ptr->level;
+                                               int inc = 0;
+
+
+                                               /* Extra experience */
+                                               if ((cur / 100) < targetlevel)
+                                               {
+                                                       if ((cur / 100 + 15) < targetlevel)
+                                                               inc += 1 + (targetlevel - (cur / 100 + 15));
+                                                       else
+                                                               inc += 1;
+                                               }
+
+                                               p_ptr->skill_exp[GINOU_SHIELD] = MIN(max, cur + inc);
+                                               p_ptr->update |= (PU_BONUS);
+                                       }
+                               }
+
                                damage = 0;
 
                                break;