/*
+ * Evaluate AC
+ *
+ * AC¤«¤é²óÈòΨ¡¢¥À¥á¡¼¥¸¸º¾¯Î¨¤ò·×»»¤·É½¼¨¤¹¤ë
+ * Calculate and display the dodge-rate and the protection-rate
+ * based on AC
+ */
+static bool eval_ac(int iAC)
+{
+#ifdef JP
+ const char memo[] =
+ "¥À¥á¡¼¥¸·Ú¸ºÎ¨¤È¤Ï¡¢Å¨¤Î¹¶·â¤¬Åö¤¿¤Ã¤¿»þ¤½¤Î¥À¥á¡¼¥¸¤ò\n"
+ "²¿¥Ñ¡¼¥»¥ó¥È·Ú¸º¤¹¤ë¤«¤ò¼¨¤·¤Þ¤¹¡£\n"
+ "¥À¥á¡¼¥¸·Ú¸º¤ÏÄ̾ï¤ÎľÀܹ¶·â(¼ïÎब¡Ö¹¶·â¤¹¤ë¡×¤È¡ÖÊ´ºÕ¤¹¤ë¡×¤Îʪ)\n"
+ "¤ËÂФ·¤Æ¤Î¤ß¸ú²Ì¤¬¤¢¤ê¤Þ¤¹¡£\n \n"
+ "Ũ¤Î¥ì¥Ù¥ë¤È¤Ï¡¢¤½¤ÎŨ¤¬Ä̾ﲿ³¬¤Ë¸½¤ì¤ë¤«¤ò¼¨¤·¤Þ¤¹¡£\n \n"
+ "²óÈòΨ¤ÏŨ¤ÎľÀܹ¶·â¤ò²¿¥Ñ¡¼¥»¥ó¥È¤Î³ÎΨ¤ÇÈò¤±¤ë¤«¤ò¼¨¤·¡¢\n"
+ "Ũ¤Î¥ì¥Ù¥ë¤È¤¢¤Ê¤¿¤ÎAC¤Ë¤è¤Ã¤Æ·èÄꤵ¤ì¤Þ¤¹¡£\n \n"
+ "¥À¥á¡¼¥¸´üÂÔÃͤȤϡ¢Å¨¤Î£±£°£°¥Ý¥¤¥ó¥È¤ÎÄ̾ﹶ·â¤ËÂФ·¡¢\n"
+ "²óÈòΨ¤È¥À¥á¡¼¥¸·Ú¸ºÎ¨¤ò¹Íθ¤·¤¿¥À¥á¡¼¥¸¤Î´üÂÔÃͤò¼¨¤·¤Þ¤¹¡£\n";
+#else
+ const char memo[] =
+ "'Protection Rate' means how much damage is reduced by your armor.\n"
+ "Note that the Protection rate is effective only against normal "
+ "'attack' and 'shatter' type melee attacks, "
+ "and has no effect against any other types such as 'poison'.\n \n"
+ "'Dodge Rate' indicates the success rate on dodging the "
+ "monster's melee attacks. "
+ "It is depend on the level of the monster and your AC.\n \n"
+ "'Average Damage' indicates the expected amount of damage "
+ "when you are attacked by normal melee attacks with power=100.";
+#endif
+
+ int protection;
+ int col, row = 2;
+ int lvl, i;
+ char buf[80*20], *t;
+
+ /* AC lower than zero has no effect */
+ if (iAC < 0) iAC = 0;
+
+ /* ¥À¥á¡¼¥¸·Ú¸ºÎ¨¤ò·×»» */
+ protection = 100 * MIN(iAC, 150) / 250;
+
+ screen_save();
+ clear_bldg(0, 22);
+
+#ifdef JP
+ put_str(format("¤¢¤Ê¤¿¤Î¸½ºß¤ÎAC: %3d", iAC), row++, 0);
+ put_str(format("¥À¥á¡¼¥¸·Ú¸ºÎ¨ : %3d%%", protection), row++, 0);
+ row++;
+
+ put_str("Ũ¤Î¥ì¥Ù¥ë :", row + 0, 0);
+ put_str("²óÈòΨ :", row + 1, 0);
+ put_str("¥À¥á¡¼¥¸´üÂÔÃÍ :", row + 2, 0);
+#else
+ put_str(format("Your current AC : %3d", iAC), row++, 0);
+ put_str(format("Protection rate : %3d%%", protection), row++, 0);
+ row++;
+
+ put_str("Level of Monster:", row + 0, 0);
+ put_str("Dodge Rate :", row + 1, 0);
+ put_str("Average Damage :", row + 2, 0);
+#endif
+
+ for (col = 17 + 1, lvl = 0; lvl <= 100; lvl += 10, col += 5)
+ {
+ int quality = 60 + lvl * 3; /* attack quality with power 60 */
+ int dodge; /* ²óÈòΨ(%) */
+ int average; /* ¥À¥á¡¼¥¸´üÂÔÃÍ */
+ float rateA,rateR=0.0;
+ float damage;
+ char tmp_str[100];
+
+ put_str(format("%3d", lvl), row + 0, col);
+
+ /* ²óÈòΨ¤ò·×»» */
+ dodge = 5 + (MIN(100, 100 * (iAC * 3 / 4) / quality) * 9 + 5) / 10;
+ put_str(format("%3d%%", dodge), row + 1, col);
+
+ /* 100ÅÀ¤Î¹¶·â¤ËÂФ·¤Æ¤Î¥À¥á¡¼¥¸´üÂÔÃͤò·×»» */
+ average = (100 - dodge) * (100 - protection) / 100;
+ put_str(format("%3d", average), row + 2, col);
+ }
+
+ /* Display note */
+ roff_to_buf(memo, 70, buf);
+ for (t = buf; t[0]; t += strlen(t) + 1)
+ put_str(t, (row++) + 4, 4);
+
+#ifdef JP
+ prt("¸½ºß¤Î¤¢¤Ê¤¿¤ÎÁõÈ÷¤«¤é¤¹¤ë¤È¡¢¤¢¤Ê¤¿¤ÎËɸæÎϤÏ"
+ "¤³¤ì¤¯¤é¤¤¤Ç¤¹:", 0, 0);
+#else
+ prt("Defense abilities from your current Armor Class are evaluated below.", 0, 0);
+#endif
+
+ flush();
+ (void)inkey();
+ screen_load();
+
+ /* Done */
+ return (TRUE);
+}
+
+
+/*
* Enchant item
*/
static bool enchant_item(int cost, int to_hit, int to_dam, int to_ac)
case BACT_TELE_TOWN:
paid = tele_town();
break;
+ case BACT_EVAL_AC:
+ paid = eval_ac(p_ptr->dis_ac + p_ptr->dis_to_a);
+ break;
}
if (paid)