OSDN Git Service

2chで作られた武器匠でACの評価を表示するパッチを改良して導入。
authormogami <mogami@0568b783-4c39-0410-ac80-bf13821ea2a2>
Fri, 8 Nov 2002 08:03:38 +0000 (08:03 +0000)
committermogami <mogami@0568b783-4c39-0410-ac80-bf13821ea2a2>
Fri, 8 Nov 2002 08:03:38 +0000 (08:03 +0000)
lib/edit/t0000002_j.txt
lib/edit/t0000003_j.txt
lib/edit/t0000004_j.txt
lib/edit/t_lite_j.txt
src/bldg.c
src/defines.h

index f42c880..351c736 100644 (file)
@@ -321,9 +321,13 @@ B:$6:N:Weaponmaster:Suiyan:Human
 B:6:N:Éð´ï¾¢:¿å°Ã:¿Í´Ö
 B:$6:A:0:Compare weapons:1000:1000:c:21:0
 B:6:A:0:Éð´ï¤òÈæ³Ó¤¹¤ë:1000:1000:c:21:0
+B:$6:A:1:Evaluate AC:1000:1000:a:46:0
+B:6:A:1:Ëɸæ¤Ë¤Ä¤¤¤ÆÄ´¤Ù¤ë:1000:1000:a:46:0
 ?:[IOR [EQU $QUEST5 3] [EQU $QUEST5 4] ]
 B:$6:A:0:Compare weapons:150:150:c:21:0
 B:6:A:0:Éð´ï¤òÈæ³Ó¤¹¤ë:150:150:c:21:0
+B:$6:A:1:Evaluate AC:150:150:a:46:0
+B:6:A:1:Ëɸæ¤Ë¤Ä¤¤¤ÆÄ´¤Ù¤ë:150:150:a:46:0
 ?:1
 
 B:$7:N:Fighters Hall:Barak:Human
index e96b9f1..cbd3584 100644 (file)
@@ -276,6 +276,8 @@ B:$6:N:Weaponmaster:Garad-Dural:Dwarf
 B:6:N:Éð´ï¾¢:¥¬¥é¥É=¥É¥¥¥é¥ë:¥É¥ï¡¼¥Õ
 B:$6:A:0:Compare weapons:200:200:c:21:0
 B:6:A:0:Éð´ï¤òÈæ³Ó¤¹¤ë:200:200:c:21:0
+B:$6:A:1:Evaluate AC:200:200:a:46:0
+B:6:A:1:Ëɸæ¤Ë¤Ä¤¤¤ÆÄ´¤Ù¤ë:200:200:a:46:0
 
 B:$7:N:Fighters Hall:Hjolgar:Barbarian
 B:7:N:Àï»Î¤Î½¸²ñ½ê:¥Ò¥ç¥ë¥¬¡¼:ÌîÈÚ¿Í
index 976eb83..19c7378 100644 (file)
@@ -183,6 +183,8 @@ B:$6:N:Weaponmaster:Rodonwin:Human
 B:6:N:Éð´ï¾¢:¥í¥É¥¦¥£¥ó:¿Í´Ö
 B:$6:A:0:Compare weapons:400:400:c:21:0
 B:6:A:0:Éð´ï¤òÈæ³Ó¤¹¤ë:400:400:c:21:0
+B:$6:A:1:Evaluate AC:400:400:a:46:0
+B:6:A:1:Ëɸæ¤Ë¤Ä¤¤¤ÆÄ´¤Ù¤ë:400:400:a:46:0
 
 B:$7:N:Fighters Hall:Gharz:Golem
 B:7:N:Àï»Î¤Î½¸²ñ½ê:¥¬¡¼¥Ä:¥´¡¼¥ì¥à
index c1b0201..f5072d5 100644 (file)
@@ -568,9 +568,13 @@ B:$5:N:Weaponmaster:Suiyan:Human
 B:5:N:Éð´ï¾¢:¿å°Ã:¿Í´Ö
 B:$5:A:0:Compare weapons:1000:1000:c:21:0
 B:5:A:0:Éð´ï¤òÈæ³Ó¤¹¤ë:1000:1000:c:21:0
+B:$6:A:1:Evaluate AC:1000:1000:a:46:0
+B:6:A:1:Ëɸæ¤Ë¤Ä¤¤¤ÆÄ´¤Ù¤ë:1000:1000:a:46:0
 ?:[IOR [EQU $QUEST5 3] [EQU $QUEST5 4] ]
 B:$5:A:0:Compare weapons:150:150:c:21:0
 B:5:A:0:Éð´ï¤òÈæ³Ó¤¹¤ë:150:150:c:21:0
+B:$6:A:1:Evaluate AC:150:150:a:46:0
+B:6:A:1:Ëɸæ¤Ë¤Ä¤¤¤ÆÄ´¤Ù¤ë:150:150:a:46:0
 ?:1
 
 B:$6:N:Fighters Hall:Barak:Human
index c07ef6a..7ff0ac6 100644 (file)
@@ -3389,6 +3389,112 @@ msg_print("
 
 
 /*
+ * 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)
@@ -4370,6 +4476,9 @@ msg_print("
        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)
index 51d9cab..86bacb7 100644 (file)
@@ -4321,7 +4321,8 @@ extern int PlayerUID;
 #define BACT_POKER                  43
 #define BACT_IDENT_ONE              44
 #define BACT_RECHARGE_ALL           45
-#define MAX_BACT                    46
+#define BACT_EVAL_AC               46
+#define MAX_BACT                    47
 
 /*
  * Quest status