• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revision047f9b8adf0b82a73a780be4e39e9fbe17039ecb (tree)
Time2019-03-13 23:38:27
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #37353 a_m_aux_1() を apply_magic_weapon() に改名。 / Rename a_m_aux_1() to apply_magic_weapon().

Change Summary

Incremental Difference

--- a/src/object-boost.h
+++ b/src/object-boost.h
@@ -1,3 +1,4 @@
11 #pragma once
22 extern int m_bonus(int max, DEPTH level);
3+extern void apply_magic_weapon(object_type *o_ptr, DEPTH level, int power);
34
--- a/src/object2.c
+++ b/src/object2.c
@@ -2062,7 +2062,7 @@ static byte get_random_ego(byte slot, bool good)
20622062 * Hack -- note special base damage dice boosting\n
20632063 * Hack -- note special processing for weapon/digger\n
20642064 */
2065-static void a_m_aux_1(object_type *o_ptr, DEPTH level, int power)
2065+void apply_magic_weapon(object_type *o_ptr, DEPTH level, int power)
20662066 {
20672067 HIT_PROB tohit1 = randint1(5) + (HIT_PROB)m_bonus(5, level);
20682068 HIT_POINT todam1 = randint1(5) + (HIT_POINT)m_bonus(5, level);
@@ -2072,8 +2072,8 @@ static void a_m_aux_1(object_type *o_ptr, DEPTH level, int power)
20722072
20732073 if ((o_ptr->tval == TV_BOLT) || (o_ptr->tval == TV_ARROW) || (o_ptr->tval == TV_SHOT))
20742074 {
2075- tohit2 = (tohit2+1)/2;
2076- todam2 = (todam2+1)/2;
2075+ tohit2 = (tohit2 + 1) / 2;
2076+ todam2 = (todam2 + 1) / 2;
20772077 }
20782078
20792079 /* Good */
@@ -2144,7 +2144,6 @@ static void a_m_aux_1(object_type *o_ptr, DEPTH level, int power)
21442144 break;
21452145 }
21462146
2147-
21482147 case TV_HAFTED:
21492148 case TV_POLEARM:
21502149 case TV_SWORD:
@@ -2198,16 +2197,14 @@ static void a_m_aux_1(object_type *o_ptr, DEPTH level, int power)
21982197 do
21992198 {
22002199 o_ptr->dd++;
2201- }
2202- while (one_in_(o_ptr->dd));
2203-
2200+ } while (one_in_(o_ptr->dd));
2201+
22042202 do
22052203 {
22062204 o_ptr->ds++;
2207- }
2208- while (one_in_(o_ptr->ds));
2205+ } while (one_in_(o_ptr->ds));
22092206 }
2210-
2207+
22112208 if (one_in_(5))
22122209 {
22132210 add_flag(o_ptr->art_flags, TR_BRAND_POIS);
@@ -2245,15 +2242,15 @@ static void a_m_aux_1(object_type *o_ptr, DEPTH level, int power)
22452242 add_flag(o_ptr->art_flags, TR_SLAY_HUMAN);
22462243 break;
22472244 case EGO_DEMON:
2248-
2249- if(one_in_(3)) o_ptr->curse_flags |= (TRC_HEAVY_CURSE);
2250- one_in_(3) ?
2245+
2246+ if (one_in_(3)) o_ptr->curse_flags |= (TRC_HEAVY_CURSE);
2247+ one_in_(3) ?
22512248 add_flag(o_ptr->art_flags, TR_DRAIN_EXP) :
22522249 one_in_(2) ?
2253- add_flag(o_ptr->art_flags, TR_DRAIN_HP) :
2254- add_flag(o_ptr->art_flags, TR_DRAIN_MANA);
2255-
2256-
2250+ add_flag(o_ptr->art_flags, TR_DRAIN_HP) :
2251+ add_flag(o_ptr->art_flags, TR_DRAIN_MANA);
2252+
2253+
22572254 if (one_in_(3)) add_flag(o_ptr->art_flags, TR_CHAOTIC);
22582255 if (one_in_(4)) add_flag(o_ptr->art_flags, TR_BLOWS);
22592256 if (one_in_(5)) add_flag(o_ptr->art_flags, TR_ADD_H_CURSE);
@@ -2277,7 +2274,7 @@ static void a_m_aux_1(object_type *o_ptr, DEPTH level, int power)
22772274 /* Roll for ego-item */
22782275 if (randint0(MAX_DEPTH) < level)
22792276 {
2280- while(1)
2277+ while (1)
22812278 {
22822279 o_ptr->name2 = get_random_ego(INVEN_RARM, FALSE);
22832280 if (o_ptr->name2 == EGO_WEIRD && o_ptr->tval != TV_SWORD)
@@ -2367,6 +2364,7 @@ static void a_m_aux_1(object_type *o_ptr, DEPTH level, int power)
23672364 }
23682365 }
23692366
2367+
23702368 /*!
23712369 * @brief ドラゴン装備にランダムな耐性を与える
23722370 * @param o_ptr 強化を与えたいオブジェクトの構造体参照ポインタ
@@ -4180,19 +4178,19 @@ void apply_magic(object_type *o_ptr, DEPTH lev, BIT_FLAGS mode)
41804178 case TV_ARROW:
41814179 case TV_BOLT:
41824180 {
4183- if (power) a_m_aux_1(o_ptr, lev, power);
4181+ if (power) apply_magic_weapon(o_ptr, lev, power);
41844182 break;
41854183 }
41864184
41874185 case TV_POLEARM:
41884186 {
4189- if (power && !(o_ptr->sval == SV_DEATH_SCYTHE)) a_m_aux_1(o_ptr, lev, power);
4187+ if (power && !(o_ptr->sval == SV_DEATH_SCYTHE)) apply_magic_weapon(o_ptr, lev, power);
41904188 break;
41914189 }
41924190
41934191 case TV_SWORD:
41944192 {
4195- if (power && !(o_ptr->sval == SV_DOKUBARI)) a_m_aux_1(o_ptr, lev, power);
4193+ if (power && !(o_ptr->sval == SV_DOKUBARI)) apply_magic_weapon(o_ptr, lev, power);
41964194 break;
41974195 }
41984196
Show on old repository browser