From: Deskull Date: Sat, 8 Sep 2018 15:22:18 +0000 (+0900) Subject: [Refactor] #37353 ゲームバランス定数を gamevalue.h へ整理。 / Move constant value in game to gameva... X-Git-Url: http://git.osdn.net/view?p=hengband%2Fhengband.git;a=commitdiff_plain;h=d002d68c80e01d6dfb488610529c7b26c12ff71c [Refactor] #37353 ゲームバランス定数を gamevalue.h へ整理。 / Move constant value in game to gamevalue.h. --- diff --git a/Hengband_vcs2015/Hengband/Hengband.vcxproj b/Hengband_vcs2015/Hengband/Hengband.vcxproj index 2793217b1..4b208a976 100644 --- a/Hengband_vcs2015/Hengband/Hengband.vcxproj +++ b/Hengband_vcs2015/Hengband/Hengband.vcxproj @@ -223,6 +223,7 @@ + diff --git a/Hengband_vcs2015/Hengband/Hengband.vcxproj.filters b/Hengband_vcs2015/Hengband/Hengband.vcxproj.filters index 70401f87a..f342be124 100644 --- a/Hengband_vcs2015/Hengband/Hengband.vcxproj.filters +++ b/Hengband_vcs2015/Hengband/Hengband.vcxproj.filters @@ -328,6 +328,9 @@ Header + + Header + diff --git a/src/angband.h b/src/angband.h index b5623f088..742242fa9 100644 --- a/src/angband.h +++ b/src/angband.h @@ -43,6 +43,7 @@ * Now, include the define's, the type's, and the extern's */ #include "defines.h" +#include "gamevalue.h" #include "types.h" #include "externs.h" diff --git a/src/artifact.c b/src/artifact.c index b63b8cc82..3f8f3efc0 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -17,21 +17,6 @@ static int suppression_evil_dam(object_type *o_ptr); static int weakening_artifact(object_type *o_ptr); -/* Chance of using syllables to form the name instead of the "template" files */ -#define SINDARIN_NAME 10 /*!< ランダムアーティファクトにシンダリン銘をつける確率 */ -#define TABLE_NAME 20 /*!< ランダムアーティファクトに漢字銘をつける確率(正確には TABLE_NAME - SINDARIN_NAME %)となる */ -#define A_CURSED 13 /*!< 1/nの確率で生成の巻物以外のランダムアーティファクトが呪いつきになる。 */ -#define WEIRD_LUCK 12 /*!< 1/nの確率でrandom_resistance()の処理中バイアス外の耐性がつき、create_artifactで4を超えるpvalが許可される。*/ -#define BIAS_LUCK 20 /*!< 1/nの確率でrandom_resistance()で付加する元素耐性が免疫になる */ -#define IM_LUCK 7 /*!< 1/nの確率でrandom_resistance()で複数免疫の除去処理が免除される */ - -/*! @note - * Bias luck needs to be higher than weird luck, - * since it is usually tested several times... - */ - -#define ACTIVATION_CHANCE 3 /*!< 1/nの確率でランダムアーティファクトに発動が付加される。ただし防具はさらに1/2 */ - /*! * @brief 対象のオブジェクトにランダムな上位耐性を一つ付加する。/ Choose one random high resistance diff --git a/src/cmd1.c b/src/cmd1.c index ee3358e66..82bbf4203 100644 --- a/src/cmd1.c +++ b/src/cmd1.c @@ -141,7 +141,6 @@ #include "angband.h" -#define MAX_VAMPIRIC_DRAIN 50 /*!< 吸血処理の最大回復HP */ /*! diff --git a/src/dungeon.c b/src/dungeon.c index f24b3f4d0..ccd704acb 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -20,9 +20,6 @@ #include "cmd-zaprod.h" #include "cmd-zapwand.h" -#define TY_CURSE_CHANCE 200 /*!<太古の怨念の1ターン毎の発動確率(1/n)*/ -#define CHAINSWORD_NOISE 100 /*!<チェンソーの1ターン毎の発動確率(1/n)*/ - static bool load = TRUE; /*!<ロード処理中の分岐フラグ*/ static int wild_regen = 20; /*!<広域マップ移動時の自然回復処理カウンタ(広域マップ1マス毎に20回処理を基本とする)*/ diff --git a/src/gamevalue.h b/src/gamevalue.h index a14b50943..d3c34b97f 100644 --- a/src/gamevalue.h +++ b/src/gamevalue.h @@ -49,4 +49,84 @@ */ #define MAX_REPRO 100 +#define MAX_VAMPIRIC_DRAIN 50 /*!< ‹zŒŒˆ—‚̍őå‰ñ•œHP */ +/* +* Dungeon generation values +*/ +#define DUN_UNUSUAL 250 /*!< ’ʏí‚Å‚Í‚È‚¢•”‰®‚ª¶¬‚³‚ê‚éŠî–{Šm—¦(ƒŒƒxƒ‹/’萔) / Level/chance of unusual room (was 200) */ +#define DUN_DEST 18 /*!< ”j‰ó’nŒ`‚ªƒtƒƒA‚É”­¶‚·‚éŠî–{Šm—¦(1/’萔) / 1/chance of having a destroyed level */ +#define SMALL_LEVEL 3 /*!< ¬‚³‚¢ƒtƒƒA‚̐¶¬‚³‚ê‚éŠî–{Šm—¦(1/’萔) / 1/chance of smaller size (3) */ +#define EMPTY_LEVEL 24 /*!< ƒAƒŠ[ƒiƒŒƒxƒ‹(ŠO•Ç‚Ì‚È‚¢ƒtƒƒA)‚̐¶¬‚³‚ê‚éŠî–{Šm—¦(1/’萔) / 1/chance of being 'empty' (15) */ +#define LAKE_LEVEL 24 /*!< ì‚âŒÎ‚Ì‚ ‚éƒtƒƒA‚̐¶¬‚³‚ê‚éŠm—¦(1/’萔) / 1/chance of being a lake on the level */ +#define DARK_EMPTY 5 /*!< ƒtƒƒA‘S‘Ì‚ªˆÃ‚¢‰Â”\«‚ÌŠî–{Šm—¦(1/’萔) / 1/chance of arena level NOT being lit (2) */ +#define DUN_CAVERN 20 /*!< “´ŒAó‚̃_ƒ“ƒWƒ‡ƒ“‚ª¶¬‚³‚ê‚éŠî–{Šm—¦(1/’萔) / 1/chance of having a cavern level */ + +/* + * Dungeon tunnel generation values + */ +#define DUN_TUN_RND_MIN 5 /* Chance of random direction (was 10) */ +#define DUN_TUN_RND_MAX 20 +#define DUN_TUN_CHG_MIN 20 /* Chance of changing direction (was 30) */ +#define DUN_TUN_CHG_MAX 60 +#define DUN_TUN_CON_MIN 10 /* Chance of extra tunneling (was 15) */ +#define DUN_TUN_CON_MAX 40 +#define DUN_TUN_PEN_MIN 30 /* Chance of doors at room entrances (was 25) */ +#define DUN_TUN_PEN_MAX 70 +#define DUN_TUN_JCT_MIN 60 /* Chance of doors at tunnel junctions (was 90) */ +#define DUN_TUN_JCT_MAX 90 + +/* + * Dungeon streamer generation values + */ +#define DUN_STR_DEN 5 /* Density of streamers */ +#define DUN_STR_RNG 5 /* Width of streamers */ +#define DUN_STR_MAG 6 /* Number of magma streamers */ +#define DUN_STR_MC 30 /* 1/chance of treasure per magma */ +#define DUN_STR_QUA 4 /* Number of quartz streamers */ +#define DUN_STR_QC 15 /* 1/chance of treasure per quartz */ +#define DUN_STR_WLW 1 /* Width of lava & water streamers -KMW- */ +#define DUN_STR_DWLW 8 /* Density of water & lava streams -KMW- */ + +#define DUN_MOS_DEN 2 /* Density of moss streamers */ +#define DUN_MOS_RNG 10 /* Width of moss streamers */ +#define DUN_STR_MOS 2 /* Number of moss streamers */ +#define DUN_WAT_DEN 15 /* Density of rivers */ +#define DUN_WAT_RNG 2 /* Width of rivers */ +#define DUN_STR_WAT 3 /* Max number of rivers */ +#define DUN_WAT_CHG 50 /* 1 in 50 chance of junction in river */ + +/* + * Dungeon treausre allocation values + */ +#define DUN_AMT_ROOM 9 /* Amount of objects for rooms */ +#define DUN_AMT_ITEM 3 /* Amount of objects for rooms/corridors */ +#define DUN_AMT_GOLD 3 /* Amount of treasure for rooms/corridors */ +#define DUN_AMT_INVIS 3 /* Amount of invisible walls for rooms/corridors */ + + /* Chance of using syllables to form the name instead of the "template" files */ +#define SINDARIN_NAME 10 /*!< ƒ‰ƒ“ƒ_ƒ€ƒA[ƒeƒBƒtƒ@ƒNƒg‚ɃVƒ“ƒ_ƒŠƒ“–Á‚ð‚‚¯‚éŠm—¦ */ +#define TABLE_NAME 20 /*!< ƒ‰ƒ“ƒ_ƒ€ƒA[ƒeƒBƒtƒ@ƒNƒg‚ÉŠ¿Žš–Á‚ð‚‚¯‚éŠm—¦(³Šm‚É‚Í TABLE_NAME - SINDARIN_NAME %)‚Æ‚È‚é */ +#define A_CURSED 13 /*!< 1/n‚ÌŠm—¦‚Ő¶¬‚ÌŠª•¨ˆÈŠO‚̃‰ƒ“ƒ_ƒ€ƒA[ƒeƒBƒtƒ@ƒNƒg‚ªŽô‚¢‚‚«‚É‚È‚éB */ +#define WEIRD_LUCK 12 /*!< 1/n‚ÌŠm—¦‚Årandom_resistance()‚̏ˆ—’†ƒoƒCƒAƒXŠO‚̑ϐ«‚ª‚‚«Acreate_artifact‚Å4‚ð’´‚¦‚épval‚ª‹–‰Â‚³‚ê‚éB*/ +#define BIAS_LUCK 20 /*!< 1/n‚ÌŠm—¦‚Årandom_resistance()‚Å•t‰Á‚·‚錳‘f‘ϐ«‚ª–Ɖu‚É‚È‚é */ +#define IM_LUCK 7 /*!< 1/n‚ÌŠm—¦‚Årandom_resistance()‚Å•¡”–Ɖu‚̏œ‹Žˆ—‚ª–Əœ‚³‚ê‚é */ + + /*! @note + * Bias luck needs to be higher than weird luck, + * since it is usually tested several times... + */ + +#define ACTIVATION_CHANCE 3 /*!< 1/n‚ÌŠm—¦‚щƒ“ƒ_ƒ€ƒA[ƒeƒBƒtƒ@ƒNƒg‚É”­“®‚ª•t‰Á‚³‚ê‚éB‚½‚¾‚µ–h‹ï‚Í‚³‚ç‚É1/2 */ + +#define TY_CURSE_CHANCE 200 /*!<‘¾ŒÃ‚̉…”O‚Ì1ƒ^[ƒ“–ˆ‚Ì”­“®Šm—¦(1/n)*/ +#define CHAINSWORD_NOISE 100 /*!<ƒ`ƒFƒ“ƒ\[‚Ì1ƒ^[ƒ“–ˆ‚Ì”­“®Šm—¦(1/n)*/ + +#define SPEAK_CHANCE 8 +#define GRINDNOISE 20 +#define CYBERNOISE 20 + +#define GROUP_MAX 32 /*!< place_monster_group() ŠÖ”‚É‚æ‚郂ƒ“ƒXƒ^[‚ÌGROUP¶¬Žž‚Ì”z’uÅ‘吔 / Maximum size of a group of monsters */ + + /* ToDo: Make this global */ +#define HURT_CHANCE 16 /*!< ‘®«UŒ‚‚ðŽó‚¯‚½Û‚É”\—Í’l’ቺ‚ð‹N‚±‚·Šm—¦(1/X) / 1/x chance of reducing stats (for elemental attacks) */ diff --git a/src/generate.h b/src/generate.h index 32bc28a78..81476347c 100644 --- a/src/generate.h +++ b/src/generate.h @@ -10,30 +10,6 @@ #define SAFE_MAX_ATTEMPTS 5000 /*!< 生成処理基本試行回数 */ -/* - * Dungeon generation values - */ -#define DUN_UNUSUAL 250 /*!< 通常ではない部屋が生成される基本確率(レベル/定数) / Level/chance of unusual room (was 200) */ -#define DUN_DEST 18 /*!< 破壊地形がフロアに発生する基本確率(1/定数) / 1/chance of having a destroyed level */ -#define SMALL_LEVEL 3 /*!< 小さいフロアの生成される基本確率(1/定数) / 1/chance of smaller size (3) */ -#define EMPTY_LEVEL 24 /*!< アリーナレベル(外壁のないフロア)の生成される基本確率(1/定数) / 1/chance of being 'empty' (15) */ -#define LAKE_LEVEL 24 /*!< 川や湖のあるフロアの生成される確率(1/定数) / 1/chance of being a lake on the level */ -#define DARK_EMPTY 5 /*!< フロア全体が暗い可能性の基本確率(1/定数) / 1/chance of arena level NOT being lit (2) */ -#define DUN_CAVERN 20 /*!< 洞窟状のダンジョンが生成される基本確率(1/定数) / 1/chance of having a cavern level */ - -/* - * Dungeon tunnel generation values - */ -#define DUN_TUN_RND_MIN 5 /* Chance of random direction (was 10) */ -#define DUN_TUN_RND_MAX 20 -#define DUN_TUN_CHG_MIN 20 /* Chance of changing direction (was 30) */ -#define DUN_TUN_CHG_MAX 60 -#define DUN_TUN_CON_MIN 10 /* Chance of extra tunneling (was 15) */ -#define DUN_TUN_CON_MAX 40 -#define DUN_TUN_PEN_MIN 30 /* Chance of doors at room entrances (was 25) */ -#define DUN_TUN_PEN_MAX 70 -#define DUN_TUN_JCT_MIN 60 /* Chance of doors at tunnel junctions (was 90) */ -#define DUN_TUN_JCT_MAX 90 extern int dun_tun_rnd; /*!< ダンジョンの通路方向を掻き回す頻度(一回の試行ごとに%で判定している) */ @@ -41,33 +17,6 @@ extern int dun_tun_chg; /*!< ダンジョンの通路をクランクさせる頻 extern int dun_tun_con; /*!< ダンジョンの通路を継続して引き延ばす頻度(一回の試行ごとに%で判定している) */ extern int dun_tun_pen; /*!< ダンジョンの部屋入口にドアを設置する頻度(一回の試行ごとに%で判定している) */ extern int dun_tun_jct; /*!< ダンジョンの通路交差地点付近にドアを設置する頻度(一回の試行ごとに%で判定している) */ -/* - * Dungeon streamer generation values - */ -#define DUN_STR_DEN 5 /* Density of streamers */ -#define DUN_STR_RNG 5 /* Width of streamers */ -#define DUN_STR_MAG 6 /* Number of magma streamers */ -#define DUN_STR_MC 30 /* 1/chance of treasure per magma */ -#define DUN_STR_QUA 4 /* Number of quartz streamers */ -#define DUN_STR_QC 15 /* 1/chance of treasure per quartz */ -#define DUN_STR_WLW 1 /* Width of lava & water streamers -KMW- */ -#define DUN_STR_DWLW 8 /* Density of water & lava streams -KMW- */ - -#define DUN_MOS_DEN 2 /* Density of moss streamers */ -#define DUN_MOS_RNG 10 /* Width of moss streamers */ -#define DUN_STR_MOS 2 /* Number of moss streamers */ -#define DUN_WAT_DEN 15 /* Density of rivers */ -#define DUN_WAT_RNG 2 /* Width of rivers */ -#define DUN_STR_WAT 3 /* Max number of rivers */ -#define DUN_WAT_CHG 50 /* 1 in 50 chance of junction in river */ - -/* - * Dungeon treausre allocation values - */ -#define DUN_AMT_ROOM 9 /* Amount of objects for rooms */ -#define DUN_AMT_ITEM 3 /* Amount of objects for rooms/corridors */ -#define DUN_AMT_GOLD 3 /* Amount of treasure for rooms/corridors */ -#define DUN_AMT_INVIS 3 /* Amount of invisible walls for rooms/corridors */ /* * Hack -- Dungeon allocation "places" diff --git a/src/melee2.c b/src/melee2.c index 3e2272002..f7b0d3672 100644 --- a/src/melee2.c +++ b/src/melee2.c @@ -15,9 +15,6 @@ #include "angband.h" -#define SPEAK_CHANCE 8 -#define GRINDNOISE 20 -#define CYBERNOISE 20 /*! * @brief モンスターが敵に接近するための方向を決める / diff --git a/src/monster2.c b/src/monster2.c index f5d71f1d8..a772745bb 100644 --- a/src/monster2.c +++ b/src/monster2.c @@ -3463,8 +3463,6 @@ static bool mon_scatter(MONRACE_IDX r_idx, POSITION *yp, POSITION *xp, POSITION return TRUE; } -#define GROUP_MAX 32 /*!< place_monster_group() 関数によるモンスターのGROUP生成時の配置最大数 / Maximum size of a group of monsters */ - /*! * @brief モンスターを目標地点に集団生成する / Attempt to place a "group" of monsters around the given location * @param who 召喚主のモンスター情報ID diff --git a/src/object2.c b/src/object2.c index 16475bfd0..b80014378 100644 --- a/src/object2.c +++ b/src/object2.c @@ -3123,7 +3123,7 @@ static void a_m_aux_2(object_type *o_ptr, int level, int power) o_ptr->to_d -= 6; o_ptr->to_h -= 6; break; - case EGO_NAZGUL: + case EGO_NAZGUL: o_ptr->to_d -= 3; o_ptr->to_h -= 3; if (one_in_(3)) add_flag(o_ptr->art_flags, TR_COWARDICE); diff --git a/src/spells1.c b/src/spells1.c index db223d221..50e789ceb 100644 --- a/src/spells1.c +++ b/src/spells1.c @@ -13,8 +13,6 @@ #include "angband.h" -/* ToDo: Make this global */ -#define HURT_CHANCE 16 /*!< 属性攻撃を受けた際に能力値低下を起こす確率(1/X) / 1/x chance of reducing stats (for elemental attacks) */ static int rakubadam_m; /*!< 振り落とされた際のダメージ量 */ static int rakubadam_p; /*!< 落馬した際のダメージ量 */ diff --git a/src/spells3.c b/src/spells3.c index d8dce01db..586a853cd 100644 --- a/src/spells3.c +++ b/src/spells3.c @@ -16,9 +16,6 @@ /*! テレポート先探索の試行数 / Maximum number of tries for teleporting */ #define MAX_TRIES 100 -/*! 能力値現象の基本確率(1 / HURT_CHANCE) / 1/x chance of reducing stats (for elemental attacks) */ -#define HURT_CHANCE 16 - /*! * @brief 指定されたマスがモンスターのテレポート可能先かどうかを判定する。 * @param m_idx モンスターID