• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision04eb611277312f8e9747b607d22643c660ac1392 (tree)
Time2017-08-22 00:01:15
AuthorDeskull <desull@user...>
CommiterDeskull

Log Message

#37359 (2.2.0.48) ランダム・アーティファクトの*スレイ*による生成強化とそれに伴う対邪などの極端な汎用最終ダメージの抑止を追加。(pekiman氏による) / Boost generation power of random artifact by KILL_* flag and suppress extreme versatile damage by kill evil flag and so on.(by pekiman)

Change Summary

Incremental Difference

--- a/src/artifact.c
+++ b/src/artifact.c
@@ -1347,11 +1347,25 @@ static void random_slay(object_type *o_ptr)
13471347 {
13481348 case 1:
13491349 case 2:
1350- add_flag(o_ptr->art_flags, TR_SLAY_ANIMAL);
1350+ if (one_in_(4))
1351+ {
1352+ add_flag(o_ptr->art_flags, TR_KILL_ANIMAL);
1353+ }
1354+ else
1355+ {
1356+ add_flag(o_ptr->art_flags, TR_SLAY_ANIMAL);
1357+ }
13511358 break;
13521359 case 3:
13531360 case 4:
1354- add_flag(o_ptr->art_flags, TR_SLAY_EVIL);
1361+ if (one_in_(4))
1362+ {
1363+ add_flag(o_ptr->art_flags, TR_KILL_EVIL);
1364+ }
1365+ else
1366+ {
1367+ add_flag(o_ptr->art_flags, TR_SLAY_EVIL);
1368+ }
13551369 if (!artifact_bias && one_in_(2))
13561370 artifact_bias = BIAS_LAW;
13571371 else if (!artifact_bias && one_in_(9))
@@ -1359,27 +1373,62 @@ static void random_slay(object_type *o_ptr)
13591373 break;
13601374 case 5:
13611375 case 6:
1362- add_flag(o_ptr->art_flags, TR_SLAY_UNDEAD);
1376+ if (one_in_(4))
1377+ {
1378+ add_flag(o_ptr->art_flags, TR_KILL_UNDEAD);
1379+ }
1380+ else
1381+ {
1382+ add_flag(o_ptr->art_flags, TR_SLAY_UNDEAD);
1383+ }
13631384 if (!artifact_bias && one_in_(9))
13641385 artifact_bias = BIAS_PRIESTLY;
13651386 break;
13661387 case 7:
13671388 case 8:
1368- add_flag(o_ptr->art_flags, TR_SLAY_DEMON);
1389+ if (one_in_(4))
1390+ {
1391+ add_flag(o_ptr->art_flags, TR_KILL_DEMON);
1392+ }
1393+ else
1394+ {
1395+ add_flag(o_ptr->art_flags, TR_SLAY_DEMON);
1396+ }
13691397 if (!artifact_bias && one_in_(9))
13701398 artifact_bias = BIAS_PRIESTLY;
13711399 break;
13721400 case 9:
13731401 case 10:
1374- add_flag(o_ptr->art_flags, TR_SLAY_ORC);
1402+ if (one_in_(4))
1403+ {
1404+ add_flag(o_ptr->art_flags, TR_KILL_ORC);
1405+ }
1406+ else
1407+ {
1408+ add_flag(o_ptr->art_flags, TR_SLAY_ORC);
1409+ }
13751410 break;
13761411 case 11:
13771412 case 12:
1378- add_flag(o_ptr->art_flags, TR_SLAY_TROLL);
1413+ if (one_in_(4))
1414+ {
1415+ add_flag(o_ptr->art_flags, TR_KILL_TROLL);
1416+ }
1417+ else
1418+ {
1419+ add_flag(o_ptr->art_flags, TR_SLAY_TROLL);
1420+ }
13791421 break;
13801422 case 13:
13811423 case 14:
1382- add_flag(o_ptr->art_flags, TR_SLAY_GIANT);
1424+ if (one_in_(4))
1425+ {
1426+ add_flag(o_ptr->art_flags, TR_KILL_GIANT);
1427+ }
1428+ else
1429+ {
1430+ add_flag(o_ptr->art_flags, TR_SLAY_GIANT);
1431+ }
13831432 break;
13841433 case 15:
13851434 case 16:
@@ -1448,7 +1497,14 @@ static void random_slay(object_type *o_ptr)
14481497 break;
14491498 case 33:
14501499 case 34:
1451- add_flag(o_ptr->art_flags, TR_SLAY_HUMAN);
1500+ if (one_in_(4))
1501+ {
1502+ add_flag(o_ptr->art_flags, TR_KILL_HUMAN);
1503+ }
1504+ else
1505+ {
1506+ add_flag(o_ptr->art_flags, TR_SLAY_HUMAN);
1507+ }
14521508 break;
14531509 default:
14541510 add_flag(o_ptr->art_flags, TR_CHAOTIC);
@@ -1902,6 +1958,7 @@ bool create_artifact(object_type *o_ptr, bool a_scroll)
19021958 o_ptr->pval = 4;
19031959 }
19041960
1961+
19051962 /* give it some plusses... */
19061963 if (object_is_armour(o_ptr))
19071964 o_ptr->to_a += randint1(o_ptr->to_a > 19 ? 1 : 20 - o_ptr->to_a);
@@ -1989,6 +2046,20 @@ bool create_artifact(object_type *o_ptr, bool a_scroll)
19892046 else power_level = 3;
19902047 }
19912048
2049+ /*平均対邪ダメージが一定以上なら11/12でダメージ抑制処理を行う*/
2050+ if(suppression_evil_dam(o_ptr) && !one_in_(12) && object_is_weapon)
2051+ {
2052+ msg_format("抑制処理");
2053+ do
2054+ {
2055+ if (weakening_artifact(o_ptr) == 0)
2056+ {
2057+ break;
2058+ }
2059+
2060+ } while (suppression_evil_dam(o_ptr));
2061+ }
2062+
19922063 if (a_scroll)
19932064 {
19942065 char dummy_name[80] = "";
@@ -2045,7 +2116,7 @@ bool create_artifact(object_type *o_ptr, bool a_scroll)
20452116 object_desc(o_name, o_ptr, 0);
20462117
20472118 #ifdef JP
2048- msg_format("パワー %d で 価値%ld のランダムアーティファクト生成 バイアスは「%s」:", max_powers, total_flags, artifact_bias_name[artifact_bias]);
2119+ msg_format("パワー %d で 価値%ld のランダムアーティファクト生成 バイアスは「%s」対邪%d:", max_powers, total_flags, artifact_bias_name[artifact_bias], calc_arm_avgdamage(o_ptr));
20492120 #else
20502121 msg_format("Random artifact generated '%s'. (Power:%d, Value:%ld) :", artifact_bias_name[artifact_bias], max_powers, total_flags);
20512122 #endif
@@ -3788,7 +3859,6 @@ void random_artifact_resistance(object_type * o_ptr, artifact_type *a_ptr)
37883859 * @attention この処理はdrop_near()内で普通の固定アーティファクトが重ならない性質に依存する.
37893860 * 仮に2個以上存在可能かつ装備品以外の固定アーティファクトが作成されれば
37903861 * drop_near()関数の返り値は信用できなくなる.
3791-
37923862 */
37933863 bool create_named_art(int a_idx, int y, int x)
37943864 {
@@ -3839,3 +3909,128 @@ bool create_named_art(int a_idx, int y, int x)
38393909 /* Drop the artifact from heaven */
38403910 return drop_near(q_ptr, -1, y, x) ? TRUE : FALSE;
38413911 }
3912+/*対邪平均ダメージの計算処理*/
3913+int calc_arm_avgdamage(object_type *o_ptr)
3914+{
3915+ u32b flgs[TR_FLAG_SIZE];
3916+ object_flags(o_ptr, flgs);
3917+
3918+ int dam = 0;
3919+ dam = (o_ptr->dd * o_ptr->ds + o_ptr->dd) / 2;
3920+
3921+ if(cheat_xtra) msg_format("素平均%d ", dam);
3922+ if (have_flag(flgs, TR_KILL_EVIL))
3923+ {
3924+
3925+ if (have_flag(flgs,TR_FORCE_WEAPON))
3926+ {
3927+ dam = dam * 1.5 + (o_ptr->dd * o_ptr->ds + o_ptr->dd);
3928+ }
3929+ else
3930+ {
3931+ dam = dam * 3.5;
3932+ }
3933+ if (cheat_xtra) msg_format("X邪計算後%d ", dam);
3934+ }
3935+ else if (!have_flag(flgs, TR_KILL_EVIL) && have_flag(flgs, TR_SLAY_EVIL))
3936+ {
3937+
3938+ if (have_flag(flgs, TR_FORCE_WEAPON))
3939+ {
3940+ dam = dam * 1.5 + (o_ptr->dd * o_ptr->ds + o_ptr->dd);
3941+ }
3942+ else
3943+ {
3944+ dam = dam * 2;
3945+ }
3946+ if (cheat_xtra) msg_format("/邪計算後%d ", dam);
3947+ }
3948+
3949+
3950+ if (have_flag(flgs, TR_VORPAL))
3951+ {
3952+ dam = dam * 1.21;
3953+ if (cheat_xtra) msg_format("/切計算後%d ", dam);
3954+ }
3955+
3956+ dam = dam + o_ptr->to_d;
3957+ if (cheat_xtra) msg_format("最終対邪%d ", dam);
3958+ return(dam);
3959+}
3960+
3961+int suppression_evil_dam(object_type *o_ptr)
3962+{
3963+ int num = 0;
3964+ u32b flgs[TR_FLAG_SIZE];
3965+ object_flags(o_ptr, flgs);
3966+
3967+ if (o_ptr->art_flags, TR_VAMPIRIC)
3968+ {
3969+ if(have_flag(flgs, TR_BLOWS) && (o_ptr->pval == 1) && (calc_arm_avgdamage(o_ptr) > 52))
3970+ {
3971+ num = 1;
3972+ }
3973+ else if(have_flag(flgs, TR_BLOWS) && (o_ptr->pval == 2) && (calc_arm_avgdamage(o_ptr) > 43))
3974+ {
3975+ num = 1;
3976+ }
3977+ else if( have_flag(flgs, TR_BLOWS) && (o_ptr->pval == 3) && (calc_arm_avgdamage(o_ptr) > 33))
3978+ {
3979+ num = 1;
3980+ }
3981+ else if (calc_arm_avgdamage(o_ptr) > 63)
3982+ {
3983+ num = 1;
3984+ }
3985+ }
3986+ else
3987+ {
3988+ if (have_flag(flgs, TR_BLOWS) && (o_ptr->pval == 1) && (calc_arm_avgdamage(o_ptr) > 65))
3989+ {
3990+ num = 1;
3991+ }
3992+ else if (have_flag(flgs, TR_BLOWS) && (o_ptr->pval == 2) && (calc_arm_avgdamage(o_ptr) > 52))
3993+ {
3994+ num = 1;
3995+ }
3996+ else if (have_flag(flgs, TR_BLOWS) && (o_ptr->pval == 3) && (calc_arm_avgdamage(o_ptr) > 40))
3997+ {
3998+ num = 1;
3999+ }
4000+ else if (calc_arm_avgdamage(o_ptr) > 75)
4001+ {
4002+ num = 1;
4003+ }
4004+ }
4005+ return(num);
4006+}
4007+
4008+int weakening_artifact(object_type *o_ptr)
4009+{
4010+ int k_idx = lookup_kind(o_ptr->sval, o_ptr->tval);
4011+ object_kind *k_ptr = &k_info[k_idx];
4012+
4013+ if ((k_info[k_idx].dd > o_ptr->dd) || (k_info[k_idx].ds > o_ptr->ds))
4014+ {
4015+ if (o_ptr->dd > o_ptr->ds)
4016+ {
4017+ o_ptr->dd--;
4018+ }
4019+ else
4020+ {
4021+ o_ptr->ds--;
4022+ }
4023+ return 1;
4024+ }
4025+
4026+ if (o_ptr->to_d > 11)
4027+ {
4028+ o_ptr->to_d = o_ptr->to_d - damroll(1, 6);
4029+ if (o_ptr->to_d < 10)
4030+ {
4031+ o_ptr->to_d = 10;
4032+ }
4033+ return 1;
4034+ }
4035+ return 0;
4036+}
\ No newline at end of file
--- a/src/defines.h
+++ b/src/defines.h
@@ -53,7 +53,7 @@
5353 #define FAKE_VER_MAJOR 12 /*!< ゲームのバージョン番号定義(メジャー番号 + 10) */
5454 #define FAKE_VER_MINOR 2 /*!< ゲームのバージョン番号定義(マイナー番号) */
5555 #define FAKE_VER_PATCH 0 /*!< ゲームのバージョン番号定義(パッチ番号) */
56-#define FAKE_VER_EXTRA 47 /*!< ゲームのバージョン番号定義(エクストラ番号) */
56+#define FAKE_VER_EXTRA 48 /*!< ゲームのバージョン番号定義(エクストラ番号) */
5757
5858
5959 /*!
Show on old repository browser