From 04eb611277312f8e9747b607d22643c660ac1392 Mon Sep 17 00:00:00 2001 From: Deskull Date: Mon, 21 Aug 2017 23:59:30 +0900 Subject: [PATCH] =?utf8?q?#37359=20(2.2.0.48)=20=E3=83=A9=E3=83=B3?= =?utf8?q?=E3=83=80=E3=83=A0=E3=83=BB=E3=82=A2=E3=83=BC=E3=83=86=E3=82=A3?= =?utf8?q?=E3=83=95=E3=82=A1=E3=82=AF=E3=83=88=E3=81=AE=EF=BC=8A=E3=82=B9?= =?utf8?q?=E3=83=AC=E3=82=A4=EF=BC=8A=E3=81=AB=E3=82=88=E3=82=8B=E7=94=9F?= =?utf8?q?=E6=88=90=E5=BC=B7=E5=8C=96=E3=81=A8=E3=81=9D=E3=82=8C=E3=81=AB?= =?utf8?q?=E4=BC=B4=E3=81=86=E5=AF=BE=E9=82=AA=E3=81=AA=E3=81=A9=E3=81=AE?= =?utf8?q?=E6=A5=B5=E7=AB=AF=E3=81=AA=E6=B1=8E=E7=94=A8=E6=9C=80=E7=B5=82?= =?utf8?q?=E3=83=80=E3=83=A1=E3=83=BC=E3=82=B8=E3=81=AE=E6=8A=91=E6=AD=A2?= =?utf8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=E3=80=82(pekiman=E6=B0=8F=E3=81=AB?= =?utf8?q?=E3=82=88=E3=82=8B)=20/=20Boost=20generation=20power=20of=20rand?= =?utf8?q?om=20artifact=20by=20KILL=5F*=20flag=20and=20suppress=20extreme?= =?utf8?q?=20versatile=20damage=20by=20kill=20evil=20flag=20and=20so=20on.?= =?utf8?q?(by=20pekiman)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/artifact.c | 215 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--- src/defines.h | 2 +- 2 files changed, 206 insertions(+), 11 deletions(-) diff --git a/src/artifact.c b/src/artifact.c index 6b7abbd7e..6ffd032c8 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -1347,11 +1347,25 @@ static void random_slay(object_type *o_ptr) { case 1: case 2: - add_flag(o_ptr->art_flags, TR_SLAY_ANIMAL); + if (one_in_(4)) + { + add_flag(o_ptr->art_flags, TR_KILL_ANIMAL); + } + else + { + add_flag(o_ptr->art_flags, TR_SLAY_ANIMAL); + } break; case 3: case 4: - add_flag(o_ptr->art_flags, TR_SLAY_EVIL); + if (one_in_(4)) + { + add_flag(o_ptr->art_flags, TR_KILL_EVIL); + } + else + { + add_flag(o_ptr->art_flags, TR_SLAY_EVIL); + } if (!artifact_bias && one_in_(2)) artifact_bias = BIAS_LAW; else if (!artifact_bias && one_in_(9)) @@ -1359,27 +1373,62 @@ static void random_slay(object_type *o_ptr) break; case 5: case 6: - add_flag(o_ptr->art_flags, TR_SLAY_UNDEAD); + if (one_in_(4)) + { + add_flag(o_ptr->art_flags, TR_KILL_UNDEAD); + } + else + { + add_flag(o_ptr->art_flags, TR_SLAY_UNDEAD); + } if (!artifact_bias && one_in_(9)) artifact_bias = BIAS_PRIESTLY; break; case 7: case 8: - add_flag(o_ptr->art_flags, TR_SLAY_DEMON); + if (one_in_(4)) + { + add_flag(o_ptr->art_flags, TR_KILL_DEMON); + } + else + { + add_flag(o_ptr->art_flags, TR_SLAY_DEMON); + } if (!artifact_bias && one_in_(9)) artifact_bias = BIAS_PRIESTLY; break; case 9: case 10: - add_flag(o_ptr->art_flags, TR_SLAY_ORC); + if (one_in_(4)) + { + add_flag(o_ptr->art_flags, TR_KILL_ORC); + } + else + { + add_flag(o_ptr->art_flags, TR_SLAY_ORC); + } break; case 11: case 12: - add_flag(o_ptr->art_flags, TR_SLAY_TROLL); + if (one_in_(4)) + { + add_flag(o_ptr->art_flags, TR_KILL_TROLL); + } + else + { + add_flag(o_ptr->art_flags, TR_SLAY_TROLL); + } break; case 13: case 14: - add_flag(o_ptr->art_flags, TR_SLAY_GIANT); + if (one_in_(4)) + { + add_flag(o_ptr->art_flags, TR_KILL_GIANT); + } + else + { + add_flag(o_ptr->art_flags, TR_SLAY_GIANT); + } break; case 15: case 16: @@ -1448,7 +1497,14 @@ static void random_slay(object_type *o_ptr) break; case 33: case 34: - add_flag(o_ptr->art_flags, TR_SLAY_HUMAN); + if (one_in_(4)) + { + add_flag(o_ptr->art_flags, TR_KILL_HUMAN); + } + else + { + add_flag(o_ptr->art_flags, TR_SLAY_HUMAN); + } break; default: add_flag(o_ptr->art_flags, TR_CHAOTIC); @@ -1902,6 +1958,7 @@ bool create_artifact(object_type *o_ptr, bool a_scroll) o_ptr->pval = 4; } + /* give it some plusses... */ if (object_is_armour(o_ptr)) 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) else power_level = 3; } + /*平均対邪ダメージが一定以上なら11/12でダメージ抑制処理を行う*/ + if(suppression_evil_dam(o_ptr) && !one_in_(12) && object_is_weapon) + { + msg_format("抑制処理"); + do + { + if (weakening_artifact(o_ptr) == 0) + { + break; + } + + } while (suppression_evil_dam(o_ptr)); + } + if (a_scroll) { char dummy_name[80] = ""; @@ -2045,7 +2116,7 @@ bool create_artifact(object_type *o_ptr, bool a_scroll) object_desc(o_name, o_ptr, 0); #ifdef JP - msg_format("パワー %d で 価値%ld のランダムアーティファクト生成 バイアスは「%s」:", max_powers, total_flags, artifact_bias_name[artifact_bias]); + msg_format("パワー %d で 価値%ld のランダムアーティファクト生成 バイアスは「%s」対邪%d:", max_powers, total_flags, artifact_bias_name[artifact_bias], calc_arm_avgdamage(o_ptr)); #else msg_format("Random artifact generated '%s'. (Power:%d, Value:%ld) :", artifact_bias_name[artifact_bias], max_powers, total_flags); #endif @@ -3788,7 +3859,6 @@ void random_artifact_resistance(object_type * o_ptr, artifact_type *a_ptr) * @attention この処理はdrop_near()内で普通の固定アーティファクトが重ならない性質に依存する. * 仮に2個以上存在可能かつ装備品以外の固定アーティファクトが作成されれば * drop_near()関数の返り値は信用できなくなる. - */ bool create_named_art(int a_idx, int y, int x) { @@ -3839,3 +3909,128 @@ bool create_named_art(int a_idx, int y, int x) /* Drop the artifact from heaven */ return drop_near(q_ptr, -1, y, x) ? TRUE : FALSE; } +/*対邪平均ダメージの計算処理*/ +int calc_arm_avgdamage(object_type *o_ptr) +{ + u32b flgs[TR_FLAG_SIZE]; + object_flags(o_ptr, flgs); + + int dam = 0; + dam = (o_ptr->dd * o_ptr->ds + o_ptr->dd) / 2; + + if(cheat_xtra) msg_format("素平均%d ", dam); + if (have_flag(flgs, TR_KILL_EVIL)) + { + + if (have_flag(flgs,TR_FORCE_WEAPON)) + { + dam = dam * 1.5 + (o_ptr->dd * o_ptr->ds + o_ptr->dd); + } + else + { + dam = dam * 3.5; + } + if (cheat_xtra) msg_format("X邪計算後%d ", dam); + } + else if (!have_flag(flgs, TR_KILL_EVIL) && have_flag(flgs, TR_SLAY_EVIL)) + { + + if (have_flag(flgs, TR_FORCE_WEAPON)) + { + dam = dam * 1.5 + (o_ptr->dd * o_ptr->ds + o_ptr->dd); + } + else + { + dam = dam * 2; + } + if (cheat_xtra) msg_format("/邪計算後%d ", dam); + } + + + if (have_flag(flgs, TR_VORPAL)) + { + dam = dam * 1.21; + if (cheat_xtra) msg_format("/切計算後%d ", dam); + } + + dam = dam + o_ptr->to_d; + if (cheat_xtra) msg_format("最終対邪%d ", dam); + return(dam); +} + +int suppression_evil_dam(object_type *o_ptr) +{ + int num = 0; + u32b flgs[TR_FLAG_SIZE]; + object_flags(o_ptr, flgs); + + if (o_ptr->art_flags, TR_VAMPIRIC) + { + if(have_flag(flgs, TR_BLOWS) && (o_ptr->pval == 1) && (calc_arm_avgdamage(o_ptr) > 52)) + { + num = 1; + } + else if(have_flag(flgs, TR_BLOWS) && (o_ptr->pval == 2) && (calc_arm_avgdamage(o_ptr) > 43)) + { + num = 1; + } + else if( have_flag(flgs, TR_BLOWS) && (o_ptr->pval == 3) && (calc_arm_avgdamage(o_ptr) > 33)) + { + num = 1; + } + else if (calc_arm_avgdamage(o_ptr) > 63) + { + num = 1; + } + } + else + { + if (have_flag(flgs, TR_BLOWS) && (o_ptr->pval == 1) && (calc_arm_avgdamage(o_ptr) > 65)) + { + num = 1; + } + else if (have_flag(flgs, TR_BLOWS) && (o_ptr->pval == 2) && (calc_arm_avgdamage(o_ptr) > 52)) + { + num = 1; + } + else if (have_flag(flgs, TR_BLOWS) && (o_ptr->pval == 3) && (calc_arm_avgdamage(o_ptr) > 40)) + { + num = 1; + } + else if (calc_arm_avgdamage(o_ptr) > 75) + { + num = 1; + } + } + return(num); +} + +int weakening_artifact(object_type *o_ptr) +{ + int k_idx = lookup_kind(o_ptr->sval, o_ptr->tval); + object_kind *k_ptr = &k_info[k_idx]; + + if ((k_info[k_idx].dd > o_ptr->dd) || (k_info[k_idx].ds > o_ptr->ds)) + { + if (o_ptr->dd > o_ptr->ds) + { + o_ptr->dd--; + } + else + { + o_ptr->ds--; + } + return 1; + } + + if (o_ptr->to_d > 11) + { + o_ptr->to_d = o_ptr->to_d - damroll(1, 6); + if (o_ptr->to_d < 10) + { + o_ptr->to_d = 10; + } + return 1; + } + return 0; +} \ No newline at end of file diff --git a/src/defines.h b/src/defines.h index e62255e69..de0a253eb 100644 --- a/src/defines.h +++ b/src/defines.h @@ -53,7 +53,7 @@ #define FAKE_VER_MAJOR 12 /*!< ゲームのバージョン番号定義(メジャー番号 + 10) */ #define FAKE_VER_MINOR 2 /*!< ゲームのバージョン番号定義(マイナー番号) */ #define FAKE_VER_PATCH 0 /*!< ゲームのバージョン番号定義(パッチ番号) */ -#define FAKE_VER_EXTRA 47 /*!< ゲームのバージョン番号定義(エクストラ番号) */ +#define FAKE_VER_EXTRA 48 /*!< ゲームのバージョン番号定義(エクストラ番号) */ /*! -- 2.11.0