OSDN Git Service

[Refactor] #37353 blows_table を melee.c/h へ移動.
authordeskull <deskull@users.sourceforge.jp>
Sat, 4 May 2019 10:25:07 +0000 (19:25 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sat, 4 May 2019 10:39:51 +0000 (19:39 +0900)
src/externs.h
src/melee.h
src/melee1.c
src/player-status.c
src/tables.c

index 2494136..8287f9f 100644 (file)
@@ -67,7 +67,6 @@ extern const byte adj_dex_safe[];
 extern const byte adj_con_fix[];
 extern const byte adj_con_mhp[];
 extern const byte adj_chr_chm[];
-extern const byte blows_table[12][12];
 extern const byte extract_energy[200];
 
 extern const u32b fake_spell_flags[4];
index 6738211..17171b3 100644 (file)
@@ -38,6 +38,8 @@ extern const concptr silly_attacks[MAX_SILLY_ATTACK];
 extern const concptr silly_attacks2[MAX_SILLY_ATTACK];
 #endif
 
+extern const byte blows_table[12][12];
+
 /* For Monk martial arts */
 typedef struct martial_arts martial_arts;
 struct martial_arts
index bc6f3a4..57ac7f6 100644 (file)
@@ -324,6 +324,75 @@ const int monk_ave_damage[PY_MAX_LEVEL + 1][3] =
   {4486, 5636, 1702},
 };
 
+
+/*!
+ * @brief
+ * 腕力、器用さに応じた攻撃回数テーブル /
+ * This table is used to help calculate the number of blows the player can
+ * make in a single round of attacks (one player current_world_ptr->game_turn) with a normal weapon.
+ * @details
+ * <pre>
+ * This number ranges from a single blow/round for weak players to up to six
+ * blows/round for powerful warriors.
+ *
+ * Note that certain artifacts and ego-items give "bonus" blows/round.
+ *
+ * First, from the player class, we extract some values:
+ *
+ * Warrior       num = 6; mul = 5; div = MAX(70, weapon_weight);
+ * Berserker     num = 6; mul = 7; div = MAX(70, weapon_weight);
+ * Mage          num = 3; mul = 2; div = MAX(100, weapon_weight);
+ * Priest        num = 5; mul = 3; div = MAX(100, weapon_weight);
+ * Mindcrafter   num = 5; mul = 3; div = MAX(100, weapon_weight);
+ * Rogue         num = 5; mul = 3; div = MAX(40, weapon_weight);
+ * Ranger        num = 5; mul = 4; div = MAX(70, weapon_weight);
+ * Paladin       num = 5; mul = 4; div = MAX(70, weapon_weight);
+ * Weaponsmith   num = 5; mul = 5; div = MAX(150, weapon_weight);
+ * Warrior-Mage  num = 5; mul = 3; div = MAX(70, weapon_weight);
+ * Chaos Warrior num = 5; mul = 4; div = MAX(70, weapon_weight);
+ * Monk          num = 5; mul = 3; div = MAX(60, weapon_weight);
+ * Tourist       num = 4; mul = 3; div = MAX(100, weapon_weight);
+ * Imitator      num = 5; mul = 4; div = MAX(70, weapon_weight);
+ * Beastmaster   num = 5; mul = 3; div = MAX(70, weapon_weight);
+ * Cavalry(Ride) num = 5; mul = 4; div = MAX(70, weapon_weight);
+ * Cavalry(Walk) num = 5; mul = 3; div = MAX(100, weapon_weight);
+ * Sorcerer      num = 1; mul = 1; div = MAX(1, weapon_weight);
+ * Archer        num = 4; mul = 2; div = MAX(70, weapon_weight);
+ * Magic eater   num = 4; mul = 2; div = MAX(70, weapon_weight);
+ * ForceTrainer  num = 4; mul = 2; div = MAX(60, weapon_weight);
+ * Mirror Master num = 3; mul = 3; div = MAX(100, weapon_weight);
+ * Ninja         num = 4; mul = 1; div = MAX(20, weapon_weight);
+ *
+ * To get "P", we look up the relevant "adj_str_blow[]" (see above),
+ * multiply it by "mul", and then divide it by "div".
+ * Increase P by 1 if you wield a weapon two-handed.
+ * Decrease P by 1 if you are a Ninja.
+ *
+ * To get "D", we look up the relevant "adj_dex_blow[]" (see above),
+ *
+ * The player gets "blows_table[P][D]" blows/round, as shown below,
+ * up to a maximum of "num" blows/round, plus any "bonus" blows/round.
+ * </pre>
+ */
+const byte blows_table[12][12] =
+{
+       /* P/D */
+       /*      0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11+ */
+       /*      3   10   15  /10  /40  /60  /80 /100 /120 /140 /160 /180  */
+       /* 0 */{        1,   1,   1,   1,   1,   2,   2,   2,   2,   3,   3,   4 },
+       /* 1 */{        1,   1,   1,   2,   2,   2,   3,   3,   3,   4,   4,   4 },
+       /* 2 */{        1,   1,   2,   2,   3,   3,   4,   4,   4,   5,   5,   5 },
+       /* 3 */{        1,   1,   2,   3,   3,   4,   4,   4,   5,   5,   5,   5 },
+       /* 4 */{        1,   1,   2,   3,   3,   4,   4,   5,   5,   5,   5,   5 },
+       /* 5 */{        1,   1,   2,   3,   4,   4,   4,   5,   5,   5,   5,   6 },
+       /* 6 */{        1,   1,   2,   3,   4,   4,   4,   5,   5,   5,   5,   6 },
+       /* 7 */{        1,   2,   2,   3,   4,   4,   4,   5,   5,   5,   5,   6 },
+       /* 8 */{        1,   2,   3,   3,   4,   4,   4,   5,   5,   5,   6,   6 },
+       /* 9 */{        1,   2,   3,   4,   4,   4,   5,   5,   5,   5,   6,   6 },
+       /* 10*/{        2,   2,   3,   4,   4,   4,   5,   5,   5,   6,   6,   6 },
+       /*11+*/{        2,   2,   3,   4,   4,   4,   5,   5,   6,   6,   6,   6 },
+};
+
  /*!
  * @brief プレイヤーからモンスターへの打撃命中判定 /
  * Determine if the player "hits" a monster (normal combat).
index a714010..3b8a8db 100644 (file)
@@ -30,6 +30,7 @@
 #include "monsterrace.h"
 #include "autopick.h"
 #include "cmd-dump.h"
+#include "melee.h"
 
 /*!
  * @var horror_desc
index 1bfdfc6..2e0a570 100644 (file)
@@ -1133,77 +1133,6 @@ const byte adj_chr_chm[] =
        85      /* 18/220+ */
 };
 
-
-/*!
- * @brief
- * 腕力、器用さに応じた攻撃回数テーブル /
- * This table is used to help calculate the number of blows the player can
- * make in a single round of attacks (one player current_world_ptr->game_turn) with a normal weapon.
- * @details
- * <pre>
- * This number ranges from a single blow/round for weak players to up to six
- * blows/round for powerful warriors.
- *
- * Note that certain artifacts and ego-items give "bonus" blows/round.
- *
- * First, from the player class, we extract some values:
- *
- * Warrior       num = 6; mul = 5; div = MAX(70, weapon_weight);
- * Berserker     num = 6; mul = 7; div = MAX(70, weapon_weight);
- * Mage          num = 3; mul = 2; div = MAX(100, weapon_weight);
- * Priest        num = 5; mul = 3; div = MAX(100, weapon_weight);
- * Mindcrafter   num = 5; mul = 3; div = MAX(100, weapon_weight);
- * Rogue         num = 5; mul = 3; div = MAX(40, weapon_weight);
- * Ranger        num = 5; mul = 4; div = MAX(70, weapon_weight);
- * Paladin       num = 5; mul = 4; div = MAX(70, weapon_weight);
- * Weaponsmith   num = 5; mul = 5; div = MAX(150, weapon_weight);
- * Warrior-Mage  num = 5; mul = 3; div = MAX(70, weapon_weight);
- * Chaos Warrior num = 5; mul = 4; div = MAX(70, weapon_weight);
- * Monk          num = 5; mul = 3; div = MAX(60, weapon_weight);
- * Tourist       num = 4; mul = 3; div = MAX(100, weapon_weight);
- * Imitator      num = 5; mul = 4; div = MAX(70, weapon_weight);
- * Beastmaster   num = 5; mul = 3; div = MAX(70, weapon_weight);
- * Cavalry(Ride) num = 5; mul = 4; div = MAX(70, weapon_weight);
- * Cavalry(Walk) num = 5; mul = 3; div = MAX(100, weapon_weight);
- * Sorcerer      num = 1; mul = 1; div = MAX(1, weapon_weight);
- * Archer        num = 4; mul = 2; div = MAX(70, weapon_weight);
- * Magic eater   num = 4; mul = 2; div = MAX(70, weapon_weight);
- * ForceTrainer  num = 4; mul = 2; div = MAX(60, weapon_weight);
- * Mirror Master num = 3; mul = 3; div = MAX(100, weapon_weight);
- * Ninja         num = 4; mul = 1; div = MAX(20, weapon_weight);
- *
- * To get "P", we look up the relevant "adj_str_blow[]" (see above),
- * multiply it by "mul", and then divide it by "div".
- * Increase P by 1 if you wield a weapon two-handed.
- * Decrease P by 1 if you are a Ninja.
- *
- * To get "D", we look up the relevant "adj_dex_blow[]" (see above),
- *
- * The player gets "blows_table[P][D]" blows/round, as shown below,
- * up to a maximum of "num" blows/round, plus any "bonus" blows/round.
- * </pre>
- */
-const byte blows_table[12][12] =
-{
-       /* P/D */
-       /*      0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11+ */
-       /*      3   10   15  /10  /40  /60  /80 /100 /120 /140 /160 /180  */
-/* 0 */{       1,   1,   1,   1,   1,   2,   2,   2,   2,   3,   3,   4 },
-/* 1 */{       1,   1,   1,   2,   2,   2,   3,   3,   3,   4,   4,   4 },
-/* 2 */{       1,   1,   2,   2,   3,   3,   4,   4,   4,   5,   5,   5 },
-/* 3 */{       1,   1,   2,   3,   3,   4,   4,   4,   5,   5,   5,   5 },
-/* 4 */{       1,   1,   2,   3,   3,   4,   4,   5,   5,   5,   5,   5 },
-/* 5 */{       1,   1,   2,   3,   4,   4,   4,   5,   5,   5,   5,   6 },
-/* 6 */{       1,   1,   2,   3,   4,   4,   4,   5,   5,   5,   5,   6 },
-/* 7 */{       1,   2,   2,   3,   4,   4,   4,   5,   5,   5,   5,   6 },
-/* 8 */{       1,   2,   3,   3,   4,   4,   4,   5,   5,   5,   6,   6 },
-/* 9 */{       1,   2,   3,   4,   4,   4,   5,   5,   5,   5,   6,   6 },
-/* 10*/{       2,   2,   3,   4,   4,   4,   5,   5,   5,   6,   6,   6 },
-/*11+*/{       2,   2,   3,   4,   4,   4,   5,   5,   6,   6,   6,   6 },
-
-};
-
-
 /*!
  * @brief 加速値による実質速度修正倍率テーブル /
  * This table allows quick conversion from "speed" to "energy"