+/*対邪平均ダメージの計算処理*/
+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