From: dis- Date: Tue, 9 Nov 2021 11:51:46 +0000 (+0900) Subject: [Refactor] enum spells-typeをenum class AttributeTypeに置換 X-Git-Tag: vmacos3.0.0-alpha52~39^2~2^2 X-Git-Url: http://git.osdn.net/view?p=hengbandforosx%2Fhengbandosx.git;a=commitdiff_plain;h=fc76c7732fe94bba94ddccb5afa2b5391268602b [Refactor] enum spells-typeをenum class AttributeTypeに置換 enum classへの置換と必要なキャストを宣言した。 また、実態として呪文の種類を越えて汎用の属性定義になっているため 実態に合わせて名称を更新した。 --- diff --git a/Hengband/Hengband/Hengband.vcxproj b/Hengband/Hengband/Hengband.vcxproj index b3a3d6ae9..7b8782fcb 100644 --- a/Hengband/Hengband/Hengband.vcxproj +++ b/Hengband/Hengband/Hengband.vcxproj @@ -50,24 +50,24 @@ Application Unicode - v142 + v143 true Application Unicode true - v142 + v143 Application Unicode - v142 + v143 Application Unicode - v142 + v143 true @@ -1817,7 +1817,7 @@ - + diff --git a/Hengband/Hengband/Hengband.vcxproj.filters b/Hengband/Hengband/Hengband.vcxproj.filters index 630f84924..2a392ae08 100644 --- a/Hengband/Hengband/Hengband.vcxproj.filters +++ b/Hengband/Hengband/Hengband.vcxproj.filters @@ -3800,9 +3800,6 @@ player-info - - spell - system @@ -5151,6 +5148,9 @@ load\monster + + effect + diff --git a/src/Makefile.am b/src/Makefile.am index 4507dae8f..e3d2c78df 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -172,6 +172,7 @@ hengband_SOURCES = \ dungeon/quest-completion-checker.cpp dungeon/quest-completion-checker.h \ dungeon/quest-monster-placer.cpp dungeon/quest-monster-placer.h \ \ + effect/attribute-types.h \ effect/effect-feature.cpp effect/effect-feature.h \ effect/effect-item.cpp effect/effect-item.h \ effect/spells-effect-util.cpp effect/spells-effect-util.h \ @@ -788,7 +789,7 @@ hengband_SOURCES = \ spell/spells-staff-only.cpp spell/spells-staff-only.h \ spell/spells-summon.cpp spell/spells-summon.h \ spell/spells-status.cpp spell/spells-status.h \ - spell/spell-types.h spell/spells-util.h \ + spell/spells-util.h \ spell/summon-types.h \ spell/technic-info-table.cpp spell/technic-info-table.h \ \ diff --git a/src/action/activation-execution.cpp b/src/action/activation-execution.cpp index 27d3e691b..3a4146b19 100644 --- a/src/action/activation-execution.cpp +++ b/src/action/activation-execution.cpp @@ -32,7 +32,7 @@ #include "spell-kind/spells-teleport.h" #include "spell-realm/spells-hex.h" #include "spell-realm/spells-song.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "sv-definition/sv-lite-types.h" #include "sv-definition/sv-ring-types.h" #include "system/artifact-type-definition.h" diff --git a/src/action/mutation-execution.cpp b/src/action/mutation-execution.cpp index a61796e9a..0315a9869 100644 --- a/src/action/mutation-execution.cpp +++ b/src/action/mutation-execution.cpp @@ -41,7 +41,7 @@ #include "spell-kind/spells-teleport.h" #include "spell-kind/spells-world.h" #include "spell-realm/spells-sorcery.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell/spells-status.h" #include "spell/summon-types.h" #include "status/element-resistance.h" @@ -72,7 +72,7 @@ bool exe_mutation_power(player_type *player_ptr, MUTA power) stop_mouth(player_ptr); msg_print(_("酸を吐きかけた...", "You spit acid...")); - fire_ball(player_ptr, GF_ACID, dir, lvl, 1 + (lvl / 30)); + fire_ball(player_ptr, AttributeType::ACID, dir, lvl, 1 + (lvl / 30)); return true; case MUTA::BR_FIRE: if (!get_aim_dir(player_ptr, &dir)) @@ -80,7 +80,7 @@ bool exe_mutation_power(player_type *player_ptr, MUTA power) stop_mouth(player_ptr); msg_print(_("あなたは火炎のブレスを吐いた...", "You breathe fire...")); - fire_breath(player_ptr, GF_FIRE, dir, lvl * 2, 1 + (lvl / 20)); + fire_breath(player_ptr, AttributeType::FIRE, dir, lvl * 2, 1 + (lvl / 20)); return true; case MUTA::HYPN_GAZE: if (!get_aim_dir(player_ptr, &dir)) @@ -105,11 +105,11 @@ bool exe_mutation_power(player_type *player_ptr, MUTA power) return false; msg_print(_("集中している...", "You concentrate...")); - fire_bolt(player_ptr, GF_PSI, dir, damroll(3 + ((lvl - 1) / 5), 3)); + fire_bolt(player_ptr, AttributeType::PSI, dir, damroll(3 + ((lvl - 1) / 5), 3)); return true; case MUTA::RADIATION: msg_print(_("体から放射能が発生した!", "Radiation flows from your body!")); - fire_ball(player_ptr, GF_NUKE, 0, (lvl * 2), 3 + (lvl / 20)); + fire_ball(player_ptr, AttributeType::NUKE, 0, (lvl * 2), 3 + (lvl / 20)); return true; case MUTA::VAMPIRISM: vampirism(player_ptr); @@ -139,7 +139,7 @@ bool exe_mutation_power(player_type *player_ptr, MUTA power) return true; case MUTA::SHRIEK: stop_mouth(player_ptr); - (void)fire_ball(player_ptr, GF_SOUND, 0, 2 * lvl, 8); + (void)fire_ball(player_ptr, AttributeType::SOUND, 0, 2 * lvl, 8); (void)aggravate_monsters(player_ptr, 0); return true; case MUTA::ILLUMINE: @@ -225,7 +225,7 @@ bool exe_mutation_power(player_type *player_ptr, MUTA power) if (!get_aim_dir(player_ptr, &dir)) return false; - fire_beam(player_ptr, GF_LITE, dir, 2 * lvl); + fire_beam(player_ptr, AttributeType::LITE, dir, 2 * lvl); return true; case MUTA::RECALL: return recall_player(player_ptr, randint0(21) + 15); @@ -279,7 +279,7 @@ bool exe_mutation_power(player_type *player_ptr, MUTA power) return true; } - fire_bolt(player_ptr, GF_COLD, dir, 2 * lvl); + fire_bolt(player_ptr, AttributeType::COLD, dir, 2 * lvl); return true; } case MUTA::LAUNCHER: { diff --git a/src/blue-magic/blue-magic-ball-bolt.cpp b/src/blue-magic/blue-magic-ball-bolt.cpp index 60503dba0..3036e9eef 100644 --- a/src/blue-magic/blue-magic-ball-bolt.cpp +++ b/src/blue-magic/blue-magic-ball-bolt.cpp @@ -8,7 +8,7 @@ #include "monster-race/race-ability-flags.h" #include "mspell/mspell-damage-calculator.h" #include "spell-kind/spells-launcher.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/player-type-definition.h" #include "target/target-getter.h" #include "view/display-messages.h" @@ -20,7 +20,7 @@ bool cast_blue_ball_acid(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("アシッド・ボールの呪文を唱えた。", "You cast an acid ball.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BA_ACID, bmc_ptr->plev, DAM_ROLL); - fire_ball(player_ptr, GF_ACID, bmc_ptr->dir, bmc_ptr->damage, 2); + fire_ball(player_ptr, AttributeType::ACID, bmc_ptr->dir, bmc_ptr->damage, 2); return true; } @@ -31,7 +31,7 @@ bool cast_blue_ball_elec(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("サンダー・ボールの呪文を唱えた。", "You cast a lightning ball.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BA_ELEC, bmc_ptr->plev, DAM_ROLL); - fire_ball(player_ptr, GF_ELEC, bmc_ptr->dir, bmc_ptr->damage, 2); + fire_ball(player_ptr, AttributeType::ELEC, bmc_ptr->dir, bmc_ptr->damage, 2); return true; } @@ -42,7 +42,7 @@ bool cast_blue_ball_fire(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("ファイア・ボールの呪文を唱えた。", "You cast a fire ball.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BA_FIRE, bmc_ptr->plev, DAM_ROLL); - fire_ball(player_ptr, GF_FIRE, bmc_ptr->dir, bmc_ptr->damage, 2); + fire_ball(player_ptr, AttributeType::FIRE, bmc_ptr->dir, bmc_ptr->damage, 2); return true; } @@ -53,7 +53,7 @@ bool cast_blue_ball_cold(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("アイス・ボールの呪文を唱えた。", "You cast a frost ball.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BA_COLD, bmc_ptr->plev, DAM_ROLL); - fire_ball(player_ptr, GF_COLD, bmc_ptr->dir, bmc_ptr->damage, 2); + fire_ball(player_ptr, AttributeType::COLD, bmc_ptr->dir, bmc_ptr->damage, 2); return true; } @@ -64,7 +64,7 @@ bool cast_blue_ball_pois(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("悪臭雲の呪文を唱えた。", "You cast a stinking cloud.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BA_POIS, bmc_ptr->plev, DAM_ROLL); - fire_ball(player_ptr, GF_POIS, bmc_ptr->dir, bmc_ptr->damage, 2); + fire_ball(player_ptr, AttributeType::POIS, bmc_ptr->dir, bmc_ptr->damage, 2); return true; } @@ -75,7 +75,7 @@ bool cast_blue_ball_nuke(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("放射能球を放った。", "You cast a ball of radiation.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BA_NUKE, bmc_ptr->plev, DAM_ROLL); - fire_ball(player_ptr, GF_NUKE, bmc_ptr->dir, bmc_ptr->damage, 2); + fire_ball(player_ptr, AttributeType::NUKE, bmc_ptr->dir, bmc_ptr->damage, 2); return true; } @@ -86,7 +86,7 @@ bool cast_blue_ball_nether(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("地獄球の呪文を唱えた。", "You cast a nether ball.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BA_NETH, bmc_ptr->plev, DAM_ROLL); - fire_ball(player_ptr, GF_NETHER, bmc_ptr->dir, bmc_ptr->damage, 2); + fire_ball(player_ptr, AttributeType::NETHER, bmc_ptr->dir, bmc_ptr->damage, 2); return true; } @@ -97,7 +97,7 @@ bool cast_blue_ball_chaos(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("純ログルスを放った。", "You invoke a raw Logrus.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BA_CHAO, bmc_ptr->plev, DAM_ROLL); - fire_ball(player_ptr, GF_CHAOS, bmc_ptr->dir, bmc_ptr->damage, 4); + fire_ball(player_ptr, AttributeType::CHAOS, bmc_ptr->dir, bmc_ptr->damage, 4); return true; } @@ -115,7 +115,7 @@ bool cast_blue_ball_water(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("流れるような身振りをした。", "You gesture fluidly.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BA_WATE, bmc_ptr->plev, DAM_ROLL); - fire_ball(player_ptr, GF_WATER, bmc_ptr->dir, bmc_ptr->damage, 4); + fire_ball(player_ptr, AttributeType::WATER, bmc_ptr->dir, bmc_ptr->damage, 4); return true; } @@ -126,7 +126,7 @@ bool cast_blue_ball_star_burst(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("スターバーストの呪文を念じた。", "You invoke a starburst.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BA_LITE, bmc_ptr->plev, DAM_ROLL); - fire_ball(player_ptr, GF_LITE, bmc_ptr->dir, bmc_ptr->damage, 4); + fire_ball(player_ptr, AttributeType::LITE, bmc_ptr->dir, bmc_ptr->damage, 4); return true; } @@ -137,7 +137,7 @@ bool cast_blue_ball_dark_storm(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("暗黒の嵐の呪文を念じた。", "You invoke a darkness storm.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BA_DARK, bmc_ptr->plev, DAM_ROLL); - fire_ball(player_ptr, GF_DARK, bmc_ptr->dir, bmc_ptr->damage, 4); + fire_ball(player_ptr, AttributeType::DARK, bmc_ptr->dir, bmc_ptr->damage, 4); return true; } @@ -148,7 +148,7 @@ bool cast_blue_ball_mana_storm(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("魔力の嵐の呪文を念じた。", "You invoke a mana storm.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BA_MANA, bmc_ptr->plev, DAM_ROLL); - fire_ball(player_ptr, GF_MANA, bmc_ptr->dir, bmc_ptr->damage, 4); + fire_ball(player_ptr, AttributeType::MANA, bmc_ptr->dir, bmc_ptr->damage, 4); return true; } @@ -159,7 +159,7 @@ bool cast_blue_bolt_acid(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("アシッド・ボルトの呪文を唱えた。", "You cast an acid bolt.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BO_ACID, bmc_ptr->plev, DAM_ROLL); - fire_bolt(player_ptr, GF_ACID, bmc_ptr->dir, bmc_ptr->damage); + fire_bolt(player_ptr, AttributeType::ACID, bmc_ptr->dir, bmc_ptr->damage); return true; } @@ -170,7 +170,7 @@ bool cast_blue_bolt_elec(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("サンダー・ボルトの呪文を唱えた。", "You cast a lightning bolt.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BO_ELEC, bmc_ptr->plev, DAM_ROLL); - fire_bolt(player_ptr, GF_ELEC, bmc_ptr->dir, bmc_ptr->damage); + fire_bolt(player_ptr, AttributeType::ELEC, bmc_ptr->dir, bmc_ptr->damage); return true; } @@ -181,7 +181,7 @@ bool cast_blue_bolt_fire(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("ファイア・ボルトの呪文を唱えた。", "You cast a fire bolt.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BO_FIRE, bmc_ptr->plev, DAM_ROLL); - fire_bolt(player_ptr, GF_FIRE, bmc_ptr->dir, bmc_ptr->damage); + fire_bolt(player_ptr, AttributeType::FIRE, bmc_ptr->dir, bmc_ptr->damage); return true; } @@ -192,7 +192,7 @@ bool cast_blue_bolt_cold(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("アイス・ボルトの呪文を唱えた。", "You cast a frost bolt.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BO_COLD, bmc_ptr->plev, DAM_ROLL); - fire_bolt(player_ptr, GF_COLD, bmc_ptr->dir, bmc_ptr->damage); + fire_bolt(player_ptr, AttributeType::COLD, bmc_ptr->dir, bmc_ptr->damage); return true; } @@ -203,7 +203,7 @@ bool cast_blue_bolt_nether(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("地獄の矢の呪文を唱えた。", "You cast a nether bolt.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BO_NETH, bmc_ptr->plev, DAM_ROLL); - fire_bolt(player_ptr, GF_NETHER, bmc_ptr->dir, bmc_ptr->damage); + fire_bolt(player_ptr, AttributeType::NETHER, bmc_ptr->dir, bmc_ptr->damage); return true; } @@ -214,7 +214,7 @@ bool cast_blue_bolt_water(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("ウォーター・ボルトの呪文を唱えた。", "You cast a water bolt.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BO_WATE, bmc_ptr->plev, DAM_ROLL); - fire_bolt(player_ptr, GF_WATER, bmc_ptr->dir, bmc_ptr->damage); + fire_bolt(player_ptr, AttributeType::WATER, bmc_ptr->dir, bmc_ptr->damage); return true; } @@ -225,7 +225,7 @@ bool cast_blue_bolt_mana(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("魔力の矢の呪文を唱えた。", "You cast a mana bolt.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BO_MANA, bmc_ptr->plev, DAM_ROLL); - fire_bolt(player_ptr, GF_MANA, bmc_ptr->dir, bmc_ptr->damage); + fire_bolt(player_ptr, AttributeType::MANA, bmc_ptr->dir, bmc_ptr->damage); return true; } @@ -236,7 +236,7 @@ bool cast_blue_bolt_plasma(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("プラズマ・ボルトの呪文を唱えた。", "You cast a plasma bolt.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BO_PLAS, bmc_ptr->plev, DAM_ROLL); - fire_bolt(player_ptr, GF_PLASMA, bmc_ptr->dir, bmc_ptr->damage); + fire_bolt(player_ptr, AttributeType::PLASMA, bmc_ptr->dir, bmc_ptr->damage); return true; } @@ -247,7 +247,7 @@ bool cast_blue_bolt_icee(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("極寒の矢の呪文を唱えた。", "You cast a ice bolt.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BO_ICEE, bmc_ptr->plev, DAM_ROLL); - fire_bolt(player_ptr, GF_ICE, bmc_ptr->dir, bmc_ptr->damage); + fire_bolt(player_ptr, AttributeType::ICE, bmc_ptr->dir, bmc_ptr->damage); return true; } @@ -258,6 +258,6 @@ bool cast_blue_bolt_missile(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("マジック・ミサイルの呪文を唱えた。", "You cast a magic missile.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::MISSILE, bmc_ptr->plev, DAM_ROLL); - fire_bolt(player_ptr, GF_MISSILE, bmc_ptr->dir, bmc_ptr->damage); + fire_bolt(player_ptr, AttributeType::MISSILE, bmc_ptr->dir, bmc_ptr->damage); return true; } diff --git a/src/blue-magic/blue-magic-breath.cpp b/src/blue-magic/blue-magic-breath.cpp index a6adbb403..ea66cba1a 100644 --- a/src/blue-magic/blue-magic-breath.cpp +++ b/src/blue-magic/blue-magic-breath.cpp @@ -9,7 +9,7 @@ #include "monster-race/race-ability-flags.h" #include "mspell/mspell-damage-calculator.h" #include "spell-kind/spells-launcher.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/player-type-definition.h" #include "target/target-getter.h" #include "view/display-messages.h" @@ -21,7 +21,7 @@ bool cast_blue_breath_acid(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("酸のブレスを吐いた。", "You breathe acid.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BR_ACID, bmc_ptr->plev, DAM_ROLL); - fire_breath(player_ptr, GF_ACID, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::ACID, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); return true; } @@ -32,7 +32,7 @@ bool cast_blue_breath_elec(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("稲妻のブレスを吐いた。", "You breathe lightning.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BR_ELEC, bmc_ptr->plev, DAM_ROLL); - fire_breath(player_ptr, GF_ELEC, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::ELEC, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); return true; } @@ -43,7 +43,7 @@ bool cast_blue_breath_fire(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("火炎のブレスを吐いた。", "You breathe fire.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BR_FIRE, bmc_ptr->plev, DAM_ROLL); - fire_breath(player_ptr, GF_FIRE, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::FIRE, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); return true; } @@ -54,7 +54,7 @@ bool cast_blue_breath_cold(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("冷気のブレスを吐いた。", "You breathe frost.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BR_COLD, bmc_ptr->plev, DAM_ROLL); - fire_breath(player_ptr, GF_COLD, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::COLD, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); return true; } @@ -65,7 +65,7 @@ bool cast_blue_breath_pois(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("ガスのブレスを吐いた。", "You breathe gas.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BR_POIS, bmc_ptr->plev, DAM_ROLL); - fire_breath(player_ptr, GF_POIS, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::POIS, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); return true; } @@ -76,7 +76,7 @@ bool cast_blue_breath_nether(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("地獄のブレスを吐いた。", "You breathe nether.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BR_NETH, bmc_ptr->plev, DAM_ROLL); - fire_breath(player_ptr, GF_NETHER, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::NETHER, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); return true; } @@ -87,7 +87,7 @@ bool cast_blue_breath_lite(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("閃光のブレスを吐いた。", "You breathe light.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BR_LITE, bmc_ptr->plev, DAM_ROLL); - fire_breath(player_ptr, GF_LITE, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::LITE, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); return true; } @@ -98,7 +98,7 @@ bool cast_blue_breath_dark(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("暗黒のブレスを吐いた。", "You breathe darkness.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BR_DARK, bmc_ptr->plev, DAM_ROLL); - fire_breath(player_ptr, GF_DARK, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::DARK, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); return true; } @@ -109,7 +109,7 @@ bool cast_blue_breath_conf(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("混乱のブレスを吐いた。", "You breathe confusion.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BR_CONF, bmc_ptr->plev, DAM_ROLL); - fire_breath(player_ptr, GF_CONFUSION, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::CONFUSION, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); return true; } @@ -120,7 +120,7 @@ bool cast_blue_breath_sound(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("轟音のブレスを吐いた。", "You breathe sound.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BR_SOUN, bmc_ptr->plev, DAM_ROLL); - fire_breath(player_ptr, GF_SOUND, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::SOUND, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); return true; } @@ -131,7 +131,7 @@ bool cast_blue_breath_chaos(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("カオスのブレスを吐いた。", "You breathe chaos.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BR_CHAO, bmc_ptr->plev, DAM_ROLL); - fire_breath(player_ptr, GF_CHAOS, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::CHAOS, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); return true; } @@ -142,7 +142,7 @@ bool cast_blue_breath_disenchant(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("劣化のブレスを吐いた。", "You breathe disenchantment.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BR_DISE, bmc_ptr->plev, DAM_ROLL); - fire_breath(player_ptr, GF_DISENCHANT, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::DISENCHANT, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); return true; } @@ -153,7 +153,7 @@ bool cast_blue_breath_nexus(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("因果混乱のブレスを吐いた。", "You breathe nexus.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BR_NEXU, bmc_ptr->plev, DAM_ROLL); - fire_breath(player_ptr, GF_NEXUS, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::NEXUS, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); return true; } @@ -164,7 +164,7 @@ bool cast_blue_breath_time(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("時間逆転のブレスを吐いた。", "You breathe time.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BR_TIME, bmc_ptr->plev, DAM_ROLL); - fire_breath(player_ptr, GF_TIME, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::TIME, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); return true; } @@ -175,7 +175,7 @@ bool cast_blue_breath_inertia(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("遅鈍のブレスを吐いた。", "You breathe inertia.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BR_INER, bmc_ptr->plev, DAM_ROLL); - fire_breath(player_ptr, GF_INERTIAL, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::INERTIAL, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); return true; } @@ -186,7 +186,7 @@ bool cast_blue_breath_gravity(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("重力のブレスを吐いた。", "You breathe gravity.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BR_GRAV, bmc_ptr->plev, DAM_ROLL); - fire_breath(player_ptr, GF_GRAVITY, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::GRAVITY, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); return true; } @@ -197,7 +197,7 @@ bool cast_blue_breath_shards(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("破片のブレスを吐いた。", "You breathe shards.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BR_SHAR, bmc_ptr->plev, DAM_ROLL); - fire_breath(player_ptr, GF_SHARDS, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::SHARDS, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); return true; } @@ -208,7 +208,7 @@ bool cast_blue_breath_plasma(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("プラズマのブレスを吐いた。", "You breathe plasma.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BR_PLAS, bmc_ptr->plev, DAM_ROLL); - fire_breath(player_ptr, GF_PLASMA, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::PLASMA, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); return true; } @@ -219,7 +219,7 @@ bool cast_blue_breath_force(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("フォースのブレスを吐いた。", "You breathe force.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BR_FORC, bmc_ptr->plev, DAM_ROLL); - fire_breath(player_ptr, GF_FORCE, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::FORCE, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); return true; } @@ -230,7 +230,7 @@ bool cast_blue_breath_mana(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("魔力のブレスを吐いた。", "You breathe mana.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BR_MANA, bmc_ptr->plev, DAM_ROLL); - fire_breath(player_ptr, GF_MANA, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::MANA, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); return true; } @@ -241,7 +241,7 @@ bool cast_blue_breath_nuke(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("放射性廃棄物のブレスを吐いた。", "You breathe toxic waste.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BR_NUKE, bmc_ptr->plev, DAM_ROLL); - fire_breath(player_ptr, GF_NUKE, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::NUKE, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); return true; } @@ -258,6 +258,6 @@ bool cast_blue_breath_disintegration(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("分解のブレスを吐いた。", "You breathe disintegration.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BR_DISI, bmc_ptr->plev, DAM_ROLL); - fire_breath(player_ptr, GF_DISINTEGRATE, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::DISINTEGRATE, bmc_ptr->dir, bmc_ptr->damage, (bmc_ptr->plev > 40 ? 3 : 2)); return true; } diff --git a/src/blue-magic/blue-magic-caster.cpp b/src/blue-magic/blue-magic-caster.cpp index 3e029acd9..25be09fd4 100644 --- a/src/blue-magic/blue-magic-caster.cpp +++ b/src/blue-magic/blue-magic-caster.cpp @@ -27,7 +27,7 @@ #include "spell-kind/spells-sight.h" #include "spell-kind/spells-teleport.h" #include "spell-kind/spells-world.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell/spells-status.h" #include "status/bad-status-setter.h" #include "status/body-improvement.h" @@ -65,7 +65,7 @@ static bool cast_blue_rocket(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("ロケットを発射した。", "You fire a rocket.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::ROCKET, bmc_ptr->plev, DAM_ROLL); - fire_rocket(player_ptr, GF_ROCKET, bmc_ptr->dir, bmc_ptr->damage, 2); + fire_rocket(player_ptr, AttributeType::ROCKET, bmc_ptr->dir, bmc_ptr->damage, 2); return true; } @@ -76,7 +76,7 @@ static bool cast_blue_shoot(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("矢を放った。", "You fire an arrow.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::SHOOT, bmc_ptr->plev, DAM_ROLL); - fire_bolt(player_ptr, GF_ARROW, bmc_ptr->dir, bmc_ptr->damage); + fire_bolt(player_ptr, AttributeType::ARROW, bmc_ptr->dir, bmc_ptr->damage); return true; } @@ -86,7 +86,7 @@ static bool cast_blue_hand_doom(player_type *player_ptr, bmc_type *bmc_ptr) return false; msg_print(_("<破滅の手>を放った!", "You invoke the Hand of Doom!")); - fire_ball_hide(player_ptr, GF_HAND_DOOM, bmc_ptr->dir, bmc_ptr->plev * 3, 0); + fire_ball_hide(player_ptr, AttributeType::HAND_DOOM, bmc_ptr->dir, bmc_ptr->plev * 3, 0); return true; } @@ -143,7 +143,7 @@ static bool cast_blue_teleport_away(player_type *player_ptr, bmc_type *bmc_ptr) if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) return false; - (void)fire_beam(player_ptr, GF_AWAY_ALL, bmc_ptr->dir, 100); + (void)fire_beam(player_ptr, AttributeType::AWAY_ALL, bmc_ptr->dir, 100); return true; } @@ -154,7 +154,7 @@ static bool cast_blue_psy_spear(player_type *player_ptr, bmc_type *bmc_ptr) msg_print(_("光の剣を放った。", "You throw a psycho-spear.")); bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::PSY_SPEAR, bmc_ptr->plev, DAM_ROLL); - (void)fire_beam(player_ptr, GF_PSY_SPEAR, bmc_ptr->dir, bmc_ptr->damage); + (void)fire_beam(player_ptr, AttributeType::PSY_SPEAR, bmc_ptr->dir, bmc_ptr->damage); return true; } diff --git a/src/blue-magic/blue-magic-spirit-curse.cpp b/src/blue-magic/blue-magic-spirit-curse.cpp index 012a9878b..c93796c6a 100644 --- a/src/blue-magic/blue-magic-spirit-curse.cpp +++ b/src/blue-magic/blue-magic-spirit-curse.cpp @@ -9,7 +9,7 @@ #include "monster-race/race-ability-flags.h" #include "mspell/mspell-damage-calculator.h" #include "spell-kind/spells-launcher.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/player-type-definition.h" #include "target/target-getter.h" #include "view/display-messages.h" @@ -20,7 +20,7 @@ bool cast_blue_drain_mana(player_type *player_ptr, bmc_type *bmc_ptr) return false; bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::DRAIN_MANA, bmc_ptr->plev, DAM_ROLL); - fire_ball_hide(player_ptr, GF_DRAIN_MANA, bmc_ptr->dir, bmc_ptr->damage, 0); + fire_ball_hide(player_ptr, AttributeType::DRAIN_MANA, bmc_ptr->dir, bmc_ptr->damage, 0); return true; } @@ -30,7 +30,7 @@ bool cast_blue_mind_blast(player_type *player_ptr, bmc_type *bmc_ptr) return false; bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::MIND_BLAST, bmc_ptr->plev, DAM_ROLL); - fire_ball_hide(player_ptr, GF_MIND_BLAST, bmc_ptr->dir, bmc_ptr->damage, 0); + fire_ball_hide(player_ptr, AttributeType::MIND_BLAST, bmc_ptr->dir, bmc_ptr->damage, 0); return true; } @@ -40,7 +40,7 @@ bool cast_blue_brain_smash(player_type *player_ptr, bmc_type *bmc_ptr) return false; bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::BRAIN_SMASH, bmc_ptr->plev, DAM_ROLL); - fire_ball_hide(player_ptr, GF_BRAIN_SMASH, bmc_ptr->dir, bmc_ptr->damage, 0); + fire_ball_hide(player_ptr, AttributeType::BRAIN_SMASH, bmc_ptr->dir, bmc_ptr->damage, 0); return true; } @@ -50,7 +50,7 @@ bool cast_blue_curse_1(player_type *player_ptr, bmc_type *bmc_ptr) return false; bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::CAUSE_1, bmc_ptr->plev, DAM_ROLL); - fire_ball_hide(player_ptr, GF_CAUSE_1, bmc_ptr->dir, bmc_ptr->damage, 0); + fire_ball_hide(player_ptr, AttributeType::CAUSE_1, bmc_ptr->dir, bmc_ptr->damage, 0); return true; } @@ -60,7 +60,7 @@ bool cast_blue_curse_2(player_type *player_ptr, bmc_type *bmc_ptr) return false; bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::CAUSE_2, bmc_ptr->plev, DAM_ROLL); - fire_ball_hide(player_ptr, GF_CAUSE_2, bmc_ptr->dir, bmc_ptr->damage, 0); + fire_ball_hide(player_ptr, AttributeType::CAUSE_2, bmc_ptr->dir, bmc_ptr->damage, 0); return true; } @@ -70,7 +70,7 @@ bool cast_blue_curse_3(player_type *player_ptr, bmc_type *bmc_ptr) return false; bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::CAUSE_3, bmc_ptr->plev, DAM_ROLL); - fire_ball_hide(player_ptr, GF_CAUSE_3, bmc_ptr->dir, bmc_ptr->damage, 0); + fire_ball_hide(player_ptr, AttributeType::CAUSE_3, bmc_ptr->dir, bmc_ptr->damage, 0); return true; } @@ -80,6 +80,6 @@ bool cast_blue_curse_4(player_type *player_ptr, bmc_type *bmc_ptr) return false; bmc_ptr->damage = monspell_bluemage_damage(player_ptr, RF_ABILITY::CAUSE_4, bmc_ptr->plev, DAM_ROLL); - fire_ball_hide(player_ptr, GF_CAUSE_4, bmc_ptr->dir, bmc_ptr->damage, 0); + fire_ball_hide(player_ptr, AttributeType::CAUSE_4, bmc_ptr->dir, bmc_ptr->damage, 0); return true; } diff --git a/src/cmd-action/cmd-attack.cpp b/src/cmd-action/cmd-attack.cpp index db5525c1f..45cc62743 100644 --- a/src/cmd-action/cmd-attack.cpp +++ b/src/cmd-action/cmd-attack.cpp @@ -44,7 +44,7 @@ #include "player/player-status-flags.h" #include "player/player-status.h" #include "player/special-defense-types.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "status/action-setter.h" #include "system/floor-type-definition.h" #include "system/grid-type-definition.h" @@ -141,7 +141,7 @@ static void natural_attack(player_type *player_ptr, MONSTER_IDX m_idx, MUTA atta switch (attack) { case MUTA::SCOR_TAIL: - project(player_ptr, 0, 0, m_ptr->fy, m_ptr->fx, k, GF_POIS, PROJECT_KILL); + project(player_ptr, 0, 0, m_ptr->fy, m_ptr->fx, k, AttributeType::POIS, PROJECT_KILL); *mdeath = (m_ptr->r_idx == 0); break; case MUTA::HORNS: @@ -149,7 +149,7 @@ static void natural_attack(player_type *player_ptr, MONSTER_IDX m_idx, MUTA atta case MUTA::TRUNK: case MUTA::TENTACLES: default: { - MonsterDamageProcessor mdp(player_ptr, m_idx, k, fear, GF_ATTACK); + MonsterDamageProcessor mdp(player_ptr, m_idx, k, fear, AttributeType::ATTACK); *mdeath = mdp.mon_take_hit(nullptr); break; } diff --git a/src/cmd-action/cmd-mane.cpp b/src/cmd-action/cmd-mane.cpp index e705bb0b4..c693331b1 100644 --- a/src/cmd-action/cmd-mane.cpp +++ b/src/cmd-action/cmd-mane.cpp @@ -47,7 +47,7 @@ #include "spell-kind/spells-sight.h" #include "spell-kind/spells-teleport.h" #include "spell-kind/spells-world.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell/spells-status.h" #include "spell/spells-summon.h" #include "spell/summon-types.h" @@ -351,7 +351,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) return false; else msg_print(_("ロケットを発射した。", "You fire a rocket.")); - fire_rocket(player_ptr, GF_ROCKET, dir, damage, 2); + fire_rocket(player_ptr, AttributeType::ROCKET, dir, damage, 2); break; case RF_ABILITY::SHOOT: @@ -359,7 +359,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) return false; else msg_print(_("矢を放った。", "You fire an arrow.")); - fire_bolt(player_ptr, GF_ARROW, dir, damage); + fire_bolt(player_ptr, AttributeType::ARROW, dir, damage); break; case RF_ABILITY::XXX2: @@ -376,7 +376,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) return false; else msg_print(_("酸のブレスを吐いた。", "You breathe acid.")); - fire_breath(player_ptr, GF_ACID, dir, damage, (plev > 35 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::ACID, dir, damage, (plev > 35 ? 3 : 2)); break; case RF_ABILITY::BR_ELEC: @@ -384,7 +384,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) return false; else msg_print(_("稲妻のブレスを吐いた。", "You breathe lightning.")); - fire_breath(player_ptr, GF_ELEC, dir, damage, (plev > 35 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::ELEC, dir, damage, (plev > 35 ? 3 : 2)); break; case RF_ABILITY::BR_FIRE: @@ -392,7 +392,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) return false; else msg_print(_("火炎のブレスを吐いた。", "You breathe fire.")); - fire_breath(player_ptr, GF_FIRE, dir, damage, (plev > 35 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::FIRE, dir, damage, (plev > 35 ? 3 : 2)); break; case RF_ABILITY::BR_COLD: @@ -400,7 +400,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) return false; else msg_print(_("冷気のブレスを吐いた。", "You breathe frost.")); - fire_breath(player_ptr, GF_COLD, dir, damage, (plev > 35 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::COLD, dir, damage, (plev > 35 ? 3 : 2)); break; case RF_ABILITY::BR_POIS: @@ -408,7 +408,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) return false; else msg_print(_("ガスのブレスを吐いた。", "You breathe gas.")); - fire_breath(player_ptr, GF_POIS, dir, damage, (plev > 35 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::POIS, dir, damage, (plev > 35 ? 3 : 2)); break; case RF_ABILITY::BR_NETH: @@ -416,7 +416,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) return false; else msg_print(_("地獄のブレスを吐いた。", "You breathe nether.")); - fire_breath(player_ptr, GF_NETHER, dir, damage, (plev > 35 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::NETHER, dir, damage, (plev > 35 ? 3 : 2)); break; case RF_ABILITY::BR_LITE: @@ -424,7 +424,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) return false; else msg_print(_("閃光のブレスを吐いた。", "You breathe light.")); - fire_breath(player_ptr, GF_LITE, dir, damage, (plev > 35 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::LITE, dir, damage, (plev > 35 ? 3 : 2)); break; case RF_ABILITY::BR_DARK: @@ -432,7 +432,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) return false; else msg_print(_("暗黒のブレスを吐いた。", "You breathe darkness.")); - fire_breath(player_ptr, GF_DARK, dir, damage, (plev > 35 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::DARK, dir, damage, (plev > 35 ? 3 : 2)); break; case RF_ABILITY::BR_CONF: @@ -440,7 +440,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) return false; else msg_print(_("混乱のブレスを吐いた。", "You breathe confusion.")); - fire_breath(player_ptr, GF_CONFUSION, dir, damage, (plev > 35 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::CONFUSION, dir, damage, (plev > 35 ? 3 : 2)); break; case RF_ABILITY::BR_SOUN: @@ -448,7 +448,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) return false; else msg_print(_("轟音のブレスを吐いた。", "You breathe sound.")); - fire_breath(player_ptr, GF_SOUND, dir, damage, (plev > 35 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::SOUND, dir, damage, (plev > 35 ? 3 : 2)); break; case RF_ABILITY::BR_CHAO: @@ -456,7 +456,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) return false; else msg_print(_("カオスのブレスを吐いた。", "You breathe chaos.")); - fire_breath(player_ptr, GF_CHAOS, dir, damage, (plev > 35 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::CHAOS, dir, damage, (plev > 35 ? 3 : 2)); break; case RF_ABILITY::BR_DISE: @@ -464,7 +464,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) return false; else msg_print(_("劣化のブレスを吐いた。", "You breathe disenchantment.")); - fire_breath(player_ptr, GF_DISENCHANT, dir, damage, (plev > 35 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::DISENCHANT, dir, damage, (plev > 35 ? 3 : 2)); break; case RF_ABILITY::BR_NEXU: @@ -472,7 +472,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) return false; else msg_print(_("因果混乱のブレスを吐いた。", "You breathe nexus.")); - fire_breath(player_ptr, GF_NEXUS, dir, damage, (plev > 35 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::NEXUS, dir, damage, (plev > 35 ? 3 : 2)); break; case RF_ABILITY::BR_TIME: @@ -480,7 +480,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) return false; else msg_print(_("時間逆転のブレスを吐いた。", "You breathe time.")); - fire_breath(player_ptr, GF_TIME, dir, damage, (plev > 35 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::TIME, dir, damage, (plev > 35 ? 3 : 2)); break; case RF_ABILITY::BR_INER: @@ -488,7 +488,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) return false; else msg_print(_("遅鈍のブレスを吐いた。", "You breathe inertia.")); - fire_breath(player_ptr, GF_INERTIAL, dir, damage, (plev > 35 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::INERTIAL, dir, damage, (plev > 35 ? 3 : 2)); break; case RF_ABILITY::BR_GRAV: @@ -496,7 +496,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) return false; else msg_print(_("重力のブレスを吐いた。", "You breathe gravity.")); - fire_breath(player_ptr, GF_GRAVITY, dir, damage, (plev > 35 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::GRAVITY, dir, damage, (plev > 35 ? 3 : 2)); break; case RF_ABILITY::BR_SHAR: @@ -504,7 +504,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) return false; else msg_print(_("破片のブレスを吐いた。", "You breathe shards.")); - fire_breath(player_ptr, GF_SHARDS, dir, damage, (plev > 35 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::SHARDS, dir, damage, (plev > 35 ? 3 : 2)); break; case RF_ABILITY::BR_PLAS: @@ -513,7 +513,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) else msg_print(_("プラズマのブレスを吐いた。", "You breathe plasma.")); - fire_breath(player_ptr, GF_PLASMA, dir, damage, (plev > 35 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::PLASMA, dir, damage, (plev > 35 ? 3 : 2)); break; case RF_ABILITY::BR_FORC: @@ -522,7 +522,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) else msg_print(_("フォースのブレスを吐いた。", "You breathe force.")); - fire_breath(player_ptr, GF_FORCE, dir, damage, (plev > 35 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::FORCE, dir, damage, (plev > 35 ? 3 : 2)); break; case RF_ABILITY::BR_MANA: @@ -531,7 +531,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) else msg_print(_("魔力のブレスを吐いた。", "You breathe mana.")); - fire_breath(player_ptr, GF_MANA, dir, damage, (plev > 35 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::MANA, dir, damage, (plev > 35 ? 3 : 2)); break; case RF_ABILITY::BA_NUKE: @@ -540,7 +540,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) else msg_print(_("放射能球を放った。", "You cast a ball of radiation.")); - fire_ball(player_ptr, GF_NUKE, dir, damage, 2); + fire_ball(player_ptr, AttributeType::NUKE, dir, damage, 2); break; case RF_ABILITY::BR_NUKE: @@ -549,7 +549,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) else msg_print(_("放射性廃棄物のブレスを吐いた。", "You breathe toxic waste.")); - fire_breath(player_ptr, GF_NUKE, dir, damage, (plev > 35 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::NUKE, dir, damage, (plev > 35 ? 3 : 2)); break; case RF_ABILITY::BA_CHAO: @@ -558,7 +558,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) else msg_print(_("純ログルスを放った。", "You invoke a raw Logrus.")); - fire_ball(player_ptr, GF_CHAOS, dir, damage, 4); + fire_ball(player_ptr, AttributeType::CHAOS, dir, damage, 4); break; case RF_ABILITY::BR_DISI: if (!get_aim_dir(player_ptr, &dir)) @@ -566,7 +566,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) else msg_print(_("分解のブレスを吐いた。", "You breathe disintegration.")); - fire_breath(player_ptr, GF_DISINTEGRATE, dir, damage, (plev > 35 ? 3 : 2)); + fire_breath(player_ptr, AttributeType::DISINTEGRATE, dir, damage, (plev > 35 ? 3 : 2)); break; case RF_ABILITY::BA_ACID: if (!get_aim_dir(player_ptr, &dir)) @@ -574,7 +574,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) else msg_print(_("アシッド・ボールの呪文を唱えた。", "You cast an acid ball.")); - fire_ball(player_ptr, GF_ACID, dir, damage, 2); + fire_ball(player_ptr, AttributeType::ACID, dir, damage, 2); break; case RF_ABILITY::BA_ELEC: if (!get_aim_dir(player_ptr, &dir)) @@ -582,7 +582,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) else msg_print(_("サンダー・ボールの呪文を唱えた。", "You cast a lightning ball.")); - fire_ball(player_ptr, GF_ELEC, dir, damage, 2); + fire_ball(player_ptr, AttributeType::ELEC, dir, damage, 2); break; case RF_ABILITY::BA_FIRE: if (!get_aim_dir(player_ptr, &dir)) @@ -590,7 +590,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) else msg_print(_("ファイア・ボールの呪文を唱えた。", "You cast a fire ball.")); - fire_ball(player_ptr, GF_FIRE, dir, damage, 2); + fire_ball(player_ptr, AttributeType::FIRE, dir, damage, 2); break; case RF_ABILITY::BA_COLD: if (!get_aim_dir(player_ptr, &dir)) @@ -598,7 +598,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) else msg_print(_("アイス・ボールの呪文を唱えた。", "You cast a frost ball.")); - fire_ball(player_ptr, GF_COLD, dir, damage, 2); + fire_ball(player_ptr, AttributeType::COLD, dir, damage, 2); break; case RF_ABILITY::BA_POIS: if (!get_aim_dir(player_ptr, &dir)) @@ -606,7 +606,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) else msg_print(_("悪臭雲の呪文を唱えた。", "You cast a stinking cloud.")); - fire_ball(player_ptr, GF_POIS, dir, damage, 2); + fire_ball(player_ptr, AttributeType::POIS, dir, damage, 2); break; case RF_ABILITY::BA_NETH: if (!get_aim_dir(player_ptr, &dir)) @@ -614,7 +614,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) else msg_print(_("地獄球の呪文を唱えた。", "You cast a nether ball.")); - fire_ball(player_ptr, GF_NETHER, dir, damage, 2); + fire_ball(player_ptr, AttributeType::NETHER, dir, damage, 2); break; case RF_ABILITY::BA_WATE: if (!get_aim_dir(player_ptr, &dir)) @@ -622,7 +622,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) else msg_print(_("流れるような身振りをした。", "You gesture fluidly.")); - fire_ball(player_ptr, GF_WATER, dir, damage, 4); + fire_ball(player_ptr, AttributeType::WATER, dir, damage, 4); break; case RF_ABILITY::BA_MANA: if (!get_aim_dir(player_ptr, &dir)) @@ -630,7 +630,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) else msg_print(_("魔力の嵐の呪文を念じた。", "You invoke a mana storm.")); - fire_ball(player_ptr, GF_MANA, dir, damage, 4); + fire_ball(player_ptr, AttributeType::MANA, dir, damage, 4); break; case RF_ABILITY::BA_DARK: if (!get_aim_dir(player_ptr, &dir)) @@ -638,42 +638,42 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) else msg_print(_("暗黒の嵐の呪文を念じた。", "You invoke a darkness storm.")); - fire_ball(player_ptr, GF_DARK, dir, damage, 4); + fire_ball(player_ptr, AttributeType::DARK, dir, damage, 4); break; case RF_ABILITY::DRAIN_MANA: if (!get_aim_dir(player_ptr, &dir)) return false; - fire_ball_hide(player_ptr, GF_DRAIN_MANA, dir, randint1(plev * 3) + plev, 0); + fire_ball_hide(player_ptr, AttributeType::DRAIN_MANA, dir, randint1(plev * 3) + plev, 0); break; case RF_ABILITY::MIND_BLAST: if (!get_aim_dir(player_ptr, &dir)) return false; - fire_ball_hide(player_ptr, GF_MIND_BLAST, dir, damage, 0); + fire_ball_hide(player_ptr, AttributeType::MIND_BLAST, dir, damage, 0); break; case RF_ABILITY::BRAIN_SMASH: if (!get_aim_dir(player_ptr, &dir)) return false; - fire_ball_hide(player_ptr, GF_BRAIN_SMASH, dir, damage, 0); + fire_ball_hide(player_ptr, AttributeType::BRAIN_SMASH, dir, damage, 0); break; case RF_ABILITY::CAUSE_1: if (!get_aim_dir(player_ptr, &dir)) return false; - fire_ball_hide(player_ptr, GF_CAUSE_1, dir, damage, 0); + fire_ball_hide(player_ptr, AttributeType::CAUSE_1, dir, damage, 0); break; case RF_ABILITY::CAUSE_2: if (!get_aim_dir(player_ptr, &dir)) return false; - fire_ball_hide(player_ptr, GF_CAUSE_2, dir, damage, 0); + fire_ball_hide(player_ptr, AttributeType::CAUSE_2, dir, damage, 0); break; case RF_ABILITY::CAUSE_3: if (!get_aim_dir(player_ptr, &dir)) return false; - fire_ball_hide(player_ptr, GF_CAUSE_3, dir, damage, 0); + fire_ball_hide(player_ptr, AttributeType::CAUSE_3, dir, damage, 0); break; case RF_ABILITY::CAUSE_4: if (!get_aim_dir(player_ptr, &dir)) return false; - fire_ball_hide(player_ptr, GF_CAUSE_4, dir, damage, 0); + fire_ball_hide(player_ptr, AttributeType::CAUSE_4, dir, damage, 0); break; case RF_ABILITY::BO_ACID: if (!get_aim_dir(player_ptr, &dir)) @@ -681,7 +681,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) else msg_print(_("アシッド・ボルトの呪文を唱えた。", "You cast an acid bolt.")); - fire_bolt(player_ptr, GF_ACID, dir, damage); + fire_bolt(player_ptr, AttributeType::ACID, dir, damage); break; case RF_ABILITY::BO_ELEC: if (!get_aim_dir(player_ptr, &dir)) @@ -689,7 +689,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) else msg_print(_("サンダー・ボルトの呪文を唱えた。", "You cast a lightning bolt.")); - fire_bolt(player_ptr, GF_ELEC, dir, damage); + fire_bolt(player_ptr, AttributeType::ELEC, dir, damage); break; case RF_ABILITY::BO_FIRE: if (!get_aim_dir(player_ptr, &dir)) @@ -697,7 +697,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) else msg_print(_("ファイア・ボルトの呪文を唱えた。", "You cast a fire bolt.")); - fire_bolt(player_ptr, GF_FIRE, dir, damage); + fire_bolt(player_ptr, AttributeType::FIRE, dir, damage); break; case RF_ABILITY::BO_COLD: if (!get_aim_dir(player_ptr, &dir)) @@ -705,7 +705,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) else msg_print(_("アイス・ボルトの呪文を唱えた。", "You cast a frost bolt.")); - fire_bolt(player_ptr, GF_COLD, dir, damage); + fire_bolt(player_ptr, AttributeType::COLD, dir, damage); break; case RF_ABILITY::BA_LITE: if (!get_aim_dir(player_ptr, &dir)) @@ -713,7 +713,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) else msg_print(_("スターバーストの呪文を念じた。", "You invoke a starburst.")); - fire_ball(player_ptr, GF_LITE, dir, damage, 4); + fire_ball(player_ptr, AttributeType::LITE, dir, damage, 4); break; case RF_ABILITY::BO_NETH: if (!get_aim_dir(player_ptr, &dir)) @@ -721,7 +721,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) else msg_print(_("地獄の矢の呪文を唱えた。", "You cast a nether bolt.")); - fire_bolt(player_ptr, GF_NETHER, dir, damage); + fire_bolt(player_ptr, AttributeType::NETHER, dir, damage); break; case RF_ABILITY::BO_WATE: if (!get_aim_dir(player_ptr, &dir)) @@ -729,7 +729,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) else msg_print(_("ウォーター・ボルトの呪文を唱えた。", "You cast a water bolt.")); - fire_bolt(player_ptr, GF_WATER, dir, damage); + fire_bolt(player_ptr, AttributeType::WATER, dir, damage); break; case RF_ABILITY::BO_MANA: if (!get_aim_dir(player_ptr, &dir)) @@ -737,7 +737,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) else msg_print(_("魔力の矢の呪文を唱えた。", "You cast a mana bolt.")); - fire_bolt(player_ptr, GF_MANA, dir, damage); + fire_bolt(player_ptr, AttributeType::MANA, dir, damage); break; case RF_ABILITY::BO_PLAS: if (!get_aim_dir(player_ptr, &dir)) @@ -745,7 +745,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) else msg_print(_("プラズマ・ボルトの呪文を唱えた。", "You cast a plasma bolt.")); - fire_bolt(player_ptr, GF_PLASMA, dir, damage); + fire_bolt(player_ptr, AttributeType::PLASMA, dir, damage); break; case RF_ABILITY::BO_ICEE: if (!get_aim_dir(player_ptr, &dir)) @@ -753,7 +753,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) else msg_print(_("極寒の矢の呪文を唱えた。", "You cast a ice bolt.")); - fire_bolt(player_ptr, GF_ICE, dir, damage); + fire_bolt(player_ptr, AttributeType::ICE, dir, damage); break; case RF_ABILITY::MISSILE: if (!get_aim_dir(player_ptr, &dir)) @@ -761,7 +761,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) else msg_print(_("マジック・ミサイルの呪文を唱えた。", "You cast a magic missile.")); - fire_bolt(player_ptr, GF_MISSILE, dir, damage); + fire_bolt(player_ptr, AttributeType::MISSILE, dir, damage); break; case RF_ABILITY::SCARE: if (!get_aim_dir(player_ptr, &dir)) @@ -803,7 +803,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) else msg_print(_("<破滅の手>を放った!", "You invoke the Hand of Doom!")); - fire_ball_hide(player_ptr, GF_HAND_DOOM, dir, 200, 0); + fire_ball_hide(player_ptr, AttributeType::HAND_DOOM, dir, 200, 0); break; } case RF_ABILITY::HEAL: { @@ -870,7 +870,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) if (!get_aim_dir(player_ptr, &dir)) return false; - (void)fire_beam(player_ptr, GF_AWAY_ALL, dir, plev); + (void)fire_beam(player_ptr, AttributeType::AWAY_ALL, dir, plev); break; case RF_ABILITY::TELE_LEVEL: @@ -882,7 +882,7 @@ static bool use_mane(player_type *player_ptr, RF_ABILITY spell) return false; else msg_print(_("光の剣を放った。", "You throw a psycho-spear.")); - (void)fire_beam(player_ptr, GF_PSY_SPEAR, dir, damage); + (void)fire_beam(player_ptr, AttributeType::PSY_SPEAR, dir, damage); break; case RF_ABILITY::DARKNESS: diff --git a/src/cmd-action/cmd-mind.cpp b/src/cmd-action/cmd-mind.cpp index fade98890..6fe7a3d08 100644 --- a/src/cmd-action/cmd-mind.cpp +++ b/src/cmd-action/cmd-mind.cpp @@ -40,7 +40,7 @@ #include "player/player-status-table.h" #include "player/player-status.h" #include "spell-kind/spells-teleport.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "status/bad-status-setter.h" #include "status/base-status.h" #include "system/floor-type-definition.h" @@ -223,7 +223,7 @@ static void check_mind_mindcrafter(player_type *player_ptr, cm_type *cm_ptr) } msg_format(_("%sの力が制御できない氾流となって解放された!", "Your mind unleashes its power in an uncontrollable storm!"), cm_ptr->mind_explanation); - project(player_ptr, PROJECT_WHO_UNCTRL_POWER, 2 + cm_ptr->plev / 10, player_ptr->y, player_ptr->x, cm_ptr->plev * 2, GF_MANA, + project(player_ptr, PROJECT_WHO_UNCTRL_POWER, 2 + cm_ptr->plev / 10, player_ptr->y, player_ptr->x, cm_ptr->plev * 2, AttributeType::MANA, PROJECT_JUMP | PROJECT_KILL | PROJECT_GRID | PROJECT_ITEM); player_ptr->csp = std::max(0, player_ptr->csp - cm_ptr->plev * std::max(1, cm_ptr->plev / 10)); } @@ -249,7 +249,7 @@ static void check_mind_mirror_master(player_type *player_ptr, cm_type *cm_ptr) } msg_format(_("%sの力が制御できない氾流となって解放された!", "Your mind unleashes its power in an uncontrollable storm!"), cm_ptr->mind_explanation); - project(player_ptr, PROJECT_WHO_UNCTRL_POWER, 2 + cm_ptr->plev / 10, player_ptr->y, player_ptr->x, cm_ptr->plev * 2, GF_MANA, + project(player_ptr, PROJECT_WHO_UNCTRL_POWER, 2 + cm_ptr->plev / 10, player_ptr->y, player_ptr->x, cm_ptr->plev * 2, AttributeType::MANA, PROJECT_JUMP | PROJECT_KILL | PROJECT_GRID | PROJECT_ITEM); player_ptr->csp = std::max(0, player_ptr->csp - cm_ptr->plev * std::max(1, cm_ptr->plev / 10)); } diff --git a/src/cmd-item/cmd-zaprod.cpp b/src/cmd-item/cmd-zaprod.cpp index fa45bfb54..e40482d25 100644 --- a/src/cmd-item/cmd-zaprod.cpp +++ b/src/cmd-item/cmd-zaprod.cpp @@ -22,7 +22,7 @@ #include "spell-kind/spells-specific-bolt.h" #include "spell-kind/spells-teleport.h" #include "spell-kind/spells-world.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell/spells-status.h" #include "status/action-setter.h" #include "status/buff-setter.h" @@ -190,49 +190,49 @@ int rod_effect(player_type *player_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION dir } case SV_ROD_ACID_BOLT: { - fire_bolt_or_beam(player_ptr, 10, GF_ACID, dir, damroll(6 + lev / 7, 8)); + fire_bolt_or_beam(player_ptr, 10, AttributeType::ACID, dir, damroll(6 + lev / 7, 8)); ident = true; break; } case SV_ROD_ELEC_BOLT: { - fire_bolt_or_beam(player_ptr, 10, GF_ELEC, dir, damroll(4 + lev / 9, 8)); + fire_bolt_or_beam(player_ptr, 10, AttributeType::ELEC, dir, damroll(4 + lev / 9, 8)); ident = true; break; } case SV_ROD_FIRE_BOLT: { - fire_bolt_or_beam(player_ptr, 10, GF_FIRE, dir, damroll(7 + lev / 6, 8)); + fire_bolt_or_beam(player_ptr, 10, AttributeType::FIRE, dir, damroll(7 + lev / 6, 8)); ident = true; break; } case SV_ROD_COLD_BOLT: { - fire_bolt_or_beam(player_ptr, 10, GF_COLD, dir, damroll(5 + lev / 8, 8)); + fire_bolt_or_beam(player_ptr, 10, AttributeType::COLD, dir, damroll(5 + lev / 8, 8)); ident = true; break; } case SV_ROD_ACID_BALL: { - fire_ball(player_ptr, GF_ACID, dir, 60 + lev, rad); + fire_ball(player_ptr, AttributeType::ACID, dir, 60 + lev, rad); ident = true; break; } case SV_ROD_ELEC_BALL: { - fire_ball(player_ptr, GF_ELEC, dir, 40 + lev, rad); + fire_ball(player_ptr, AttributeType::ELEC, dir, 40 + lev, rad); ident = true; break; } case SV_ROD_FIRE_BALL: { - fire_ball(player_ptr, GF_FIRE, dir, 70 + lev, rad); + fire_ball(player_ptr, AttributeType::FIRE, dir, 70 + lev, rad); ident = true; break; } case SV_ROD_COLD_BALL: { - fire_ball(player_ptr, GF_COLD, dir, 50 + lev, rad); + fire_ball(player_ptr, AttributeType::COLD, dir, 50 + lev, rad); ident = true; break; } diff --git a/src/cmd-item/cmd-zapwand.cpp b/src/cmd-item/cmd-zapwand.cpp index 0133d35f9..d3f7c564d 100644 --- a/src/cmd-item/cmd-zapwand.cpp +++ b/src/cmd-item/cmd-zapwand.cpp @@ -29,7 +29,7 @@ #include "spell-kind/spells-neighbor.h" #include "spell-kind/spells-specific-bolt.h" #include "spell-kind/spells-teleport.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell/spells-status.h" #include "status/action-setter.h" #include "status/experience.h" @@ -175,19 +175,19 @@ bool wand_effect(player_type *player_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION d } case SV_WAND_STINKING_CLOUD: { - fire_ball(player_ptr, GF_POIS, dir, 12 + lev / 4, rad); + fire_ball(player_ptr, AttributeType::POIS, dir, 12 + lev / 4, rad); ident = true; break; } case SV_WAND_MAGIC_MISSILE: { - fire_bolt_or_beam(player_ptr, 20, GF_MISSILE, dir, damroll(2 + lev / 10, 6)); + fire_bolt_or_beam(player_ptr, 20, AttributeType::MISSILE, dir, damroll(2 + lev / 10, 6)); ident = true; break; } case SV_WAND_ACID_BOLT: { - fire_bolt_or_beam(player_ptr, 20, GF_ACID, dir, damroll(6 + lev / 7, 8)); + fire_bolt_or_beam(player_ptr, 20, AttributeType::ACID, dir, damroll(6 + lev / 7, 8)); ident = true; break; } @@ -199,37 +199,37 @@ bool wand_effect(player_type *player_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION d } case SV_WAND_FIRE_BOLT: { - fire_bolt_or_beam(player_ptr, 20, GF_FIRE, dir, damroll(7 + lev / 6, 8)); + fire_bolt_or_beam(player_ptr, 20, AttributeType::FIRE, dir, damroll(7 + lev / 6, 8)); ident = true; break; } case SV_WAND_COLD_BOLT: { - fire_bolt_or_beam(player_ptr, 20, GF_COLD, dir, damroll(5 + lev / 8, 8)); + fire_bolt_or_beam(player_ptr, 20, AttributeType::COLD, dir, damroll(5 + lev / 8, 8)); ident = true; break; } case SV_WAND_ACID_BALL: { - fire_ball(player_ptr, GF_ACID, dir, 60 + 3 * lev / 4, rad); + fire_ball(player_ptr, AttributeType::ACID, dir, 60 + 3 * lev / 4, rad); ident = true; break; } case SV_WAND_ELEC_BALL: { - fire_ball(player_ptr, GF_ELEC, dir, 40 + 3 * lev / 4, rad); + fire_ball(player_ptr, AttributeType::ELEC, dir, 40 + 3 * lev / 4, rad); ident = true; break; } case SV_WAND_FIRE_BALL: { - fire_ball(player_ptr, GF_FIRE, dir, 70 + 3 * lev / 4, rad); + fire_ball(player_ptr, AttributeType::FIRE, dir, 70 + 3 * lev / 4, rad); ident = true; break; } case SV_WAND_COLD_BALL: { - fire_ball(player_ptr, GF_COLD, dir, 50 + 3 * lev / 4, rad); + fire_ball(player_ptr, AttributeType::COLD, dir, 50 + 3 * lev / 4, rad); ident = true; break; } @@ -240,41 +240,41 @@ bool wand_effect(player_type *player_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION d } case SV_WAND_DRAGON_FIRE: { - fire_breath(player_ptr, GF_FIRE, dir, (powerful ? 300 : 200), 3); + fire_breath(player_ptr, AttributeType::FIRE, dir, (powerful ? 300 : 200), 3); ident = true; break; } case SV_WAND_DRAGON_COLD: { - fire_breath(player_ptr, GF_COLD, dir, (powerful ? 270 : 180), 3); + fire_breath(player_ptr, AttributeType::COLD, dir, (powerful ? 270 : 180), 3); ident = true; break; } case SV_WAND_DRAGON_BREATH: { HIT_POINT dam; - EFFECT_ID typ; + AttributeType typ; switch (randint1(5)) { case 1: dam = 240; - typ = GF_ACID; + typ = AttributeType::ACID; break; case 2: dam = 210; - typ = GF_ELEC; + typ = AttributeType::ELEC; break; case 3: dam = 240; - typ = GF_FIRE; + typ = AttributeType::FIRE; break; case 4: dam = 210; - typ = GF_COLD; + typ = AttributeType::COLD; break; default: dam = 180; - typ = GF_POIS; + typ = AttributeType::POIS; break; } @@ -288,26 +288,26 @@ bool wand_effect(player_type *player_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION d } case SV_WAND_DISINTEGRATE: { - fire_ball(player_ptr, GF_DISINTEGRATE, dir, 200 + randint1(lev * 2), rad); + fire_ball(player_ptr, AttributeType::DISINTEGRATE, dir, 200 + randint1(lev * 2), rad); ident = true; break; } case SV_WAND_ROCKETS: { msg_print(_("ロケットを発射した!", "You launch a rocket!")); - fire_rocket(player_ptr, GF_ROCKET, dir, 250 + lev * 3, rad); + fire_rocket(player_ptr, AttributeType::ROCKET, dir, 250 + lev * 3, rad); ident = true; break; } case SV_WAND_STRIKING: { - fire_bolt(player_ptr, GF_METEOR, dir, damroll(15 + lev / 3, 13)); + fire_bolt(player_ptr, AttributeType::METEOR, dir, damroll(15 + lev / 3, 13)); ident = true; break; } case SV_WAND_GENOCIDE: { - fire_ball_hide(player_ptr, GF_GENOCIDE, dir, magic ? lev + 50 : 250, 0); + fire_ball_hide(player_ptr, AttributeType::GENOCIDE, dir, magic ? lev + 50 : 250, 0); ident = true; break; } diff --git a/src/combat/aura-counterattack.cpp b/src/combat/aura-counterattack.cpp index c85069e96..3c9c9a76f 100644 --- a/src/combat/aura-counterattack.cpp +++ b/src/combat/aura-counterattack.cpp @@ -21,7 +21,7 @@ #include "realm/realm-hex-numbers.h" #include "spell-kind/spells-teleport.h" #include "spell-realm/spells-hex.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/floor-type-definition.h" #include "system/grid-type-definition.h" #include "system/monster-type-definition.h" @@ -46,7 +46,7 @@ static void aura_fire_by_monster_attack(player_type *player_ptr, monap_type *mon HIT_POINT dam = damroll(2, 6); dam = mon_damage_mod(player_ptr, monap_ptr->m_ptr, dam, false); msg_format(_("%^sは突然熱くなった!", "%^s is suddenly very hot!"), monap_ptr->m_name); - MonsterDamageProcessor mdp(player_ptr, monap_ptr->m_idx, dam, &monap_ptr->fear, GF_FIRE); + MonsterDamageProcessor mdp(player_ptr, monap_ptr->m_idx, dam, &monap_ptr->fear, AttributeType::FIRE); if (mdp.mon_take_hit(_("は灰の山になった。", " turns into a pile of ash."))) { monap_ptr->blinked = false; monap_ptr->alive = false; @@ -69,7 +69,7 @@ static void aura_elec_by_monster_attack(player_type *player_ptr, monap_type *mon HIT_POINT dam = damroll(2, 6); dam = mon_damage_mod(player_ptr, monap_ptr->m_ptr, dam, false); msg_format(_("%^sは電撃をくらった!", "%^s gets zapped!"), monap_ptr->m_name); - MonsterDamageProcessor mdp(player_ptr, monap_ptr->m_idx, dam, &monap_ptr->fear, GF_ELEC); + MonsterDamageProcessor mdp(player_ptr, monap_ptr->m_idx, dam, &monap_ptr->fear, AttributeType::ELEC); if (mdp.mon_take_hit(_("は燃え殻の山になった。", " turns into a pile of cinders."))) { monap_ptr->blinked = false; monap_ptr->alive = false; @@ -92,7 +92,7 @@ static void aura_cold_by_monster_attack(player_type *player_ptr, monap_type *mon HIT_POINT dam = damroll(2, 6); dam = mon_damage_mod(player_ptr, monap_ptr->m_ptr, dam, false); msg_format(_("%^sは冷気をくらった!", "%^s is very cold!"), monap_ptr->m_name); - MonsterDamageProcessor mdp(player_ptr, monap_ptr->m_idx, dam, &monap_ptr->fear, GF_COLD); + MonsterDamageProcessor mdp(player_ptr, monap_ptr->m_idx, dam, &monap_ptr->fear, AttributeType::COLD); if (mdp.mon_take_hit(_("は凍りついた。", " was frozen."))) { monap_ptr->blinked = false; monap_ptr->alive = false; @@ -112,7 +112,7 @@ static void aura_shards_by_monster_attack(player_type *player_ptr, monap_type *m HIT_POINT dam = damroll(2, 6); dam = mon_damage_mod(player_ptr, monap_ptr->m_ptr, dam, false); msg_format(_("%^sは鏡の破片をくらった!", "%^s gets sliced!"), monap_ptr->m_name); - MonsterDamageProcessor mdp(player_ptr, monap_ptr->m_idx, dam, &monap_ptr->fear, GF_SHARDS); + MonsterDamageProcessor mdp(player_ptr, monap_ptr->m_idx, dam, &monap_ptr->fear, AttributeType::SHARDS); if (mdp.mon_take_hit(_("はズタズタになった。", " is torn to pieces."))) { monap_ptr->blinked = false; monap_ptr->alive = false; @@ -142,7 +142,7 @@ static void aura_holy_by_monster_attack(player_type *player_ptr, monap_type *mon HIT_POINT dam = damroll(2, 6); dam = mon_damage_mod(player_ptr, monap_ptr->m_ptr, dam, false); msg_format(_("%^sは聖なるオーラで傷ついた!", "%^s is injured by holy power!"), monap_ptr->m_name); - MonsterDamageProcessor mdp(player_ptr, monap_ptr->m_idx, dam, &monap_ptr->fear, GF_HOLY_FIRE); + MonsterDamageProcessor mdp(player_ptr, monap_ptr->m_idx, dam, &monap_ptr->fear, AttributeType::HOLY_FIRE); if (mdp.mon_take_hit(_("は倒れた。", " is destroyed."))) { monap_ptr->blinked = false; monap_ptr->alive = false; @@ -168,7 +168,7 @@ static void aura_force_by_monster_attack(player_type *player_ptr, monap_type *mo HIT_POINT dam = damroll(2, 6); dam = mon_damage_mod(player_ptr, monap_ptr->m_ptr, dam, false); msg_format(_("%^sが鋭い闘気のオーラで傷ついた!", "%^s is injured by the Force"), monap_ptr->m_name); - MonsterDamageProcessor mdp(player_ptr, monap_ptr->m_idx, dam, &monap_ptr->fear, GF_MANA); + MonsterDamageProcessor mdp(player_ptr, monap_ptr->m_idx, dam, &monap_ptr->fear, AttributeType::MANA); if (mdp.mon_take_hit(_("は倒れた。", " is destroyed."))) { monap_ptr->blinked = false; monap_ptr->alive = false; @@ -201,7 +201,7 @@ static void aura_shadow_by_monster_attack(player_type *player_ptr, monap_type *m dam = mon_damage_mod(player_ptr, monap_ptr->m_ptr, dam, false); msg_format(_("影のオーラが%^sに反撃した!", "Enveloping shadows attack %^s."), monap_ptr->m_name); - MonsterDamageProcessor mdp(player_ptr, monap_ptr->m_idx, dam, &monap_ptr->fear, GF_DARK); + MonsterDamageProcessor mdp(player_ptr, monap_ptr->m_idx, dam, &monap_ptr->fear, AttributeType::DARK); if (mdp.mon_take_hit(_("は倒れた。", " is destroyed."))) { monap_ptr->blinked = false; monap_ptr->alive = false; @@ -209,13 +209,14 @@ static void aura_shadow_by_monster_attack(player_type *player_ptr, monap_type *m } BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL; - EFFECT_ID typ[4][2] = { { INVEN_HEAD, GF_OLD_CONF }, { INVEN_SUB_HAND, GF_OLD_SLEEP }, { INVEN_ARMS, GF_TURN_ALL }, { INVEN_FEET, GF_OLD_SLOW } }; + EFFECT_ID typ[4][2] = { { INVEN_HEAD, (EFFECT_ID)AttributeType::OLD_CONF }, { INVEN_SUB_HAND, (EFFECT_ID)AttributeType::OLD_SLEEP }, + { INVEN_ARMS, (EFFECT_ID)AttributeType::TURN_ALL }, { INVEN_FEET, (EFFECT_ID)AttributeType::OLD_SLOW } }; /* Some cursed armours gives an extra effect */ for (int j = 0; j < 4; j++) { o_armed_ptr = &player_ptr->inventory_list[typ[j][0]]; if ((o_armed_ptr->k_idx) && o_armed_ptr->is_cursed() && o_armed_ptr->is_armour()) - project(player_ptr, 0, 0, monap_ptr->m_ptr->fy, monap_ptr->m_ptr->fx, (player_ptr->lev * 2), typ[j][1], flg); + project(player_ptr, 0, 0, monap_ptr->m_ptr->fy, monap_ptr->m_ptr->fx, (player_ptr->lev * 2), (AttributeType)typ[j][1], flg); } } diff --git a/src/combat/shoot.cpp b/src/combat/shoot.cpp index af388b4a1..9cbe8527b 100644 --- a/src/combat/shoot.cpp +++ b/src/combat/shoot.cpp @@ -53,7 +53,7 @@ #include "player/player-personality-types.h" #include "player/player-skill.h" #include "player/player-status-table.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "sv-definition/sv-bow-types.h" #include "system/artifact-type-definition.h" #include "system/floor-type-definition.h" @@ -75,10 +75,10 @@ * @param arrow_ptr 矢弾のオブジェクト構造体参照ポインタ * @return スナイパーの射撃属性、弓矢の属性を考慮する。デフォルトはGF_PLAYER_SHOOT。 */ -EffectFlags shot_effect_type(player_type *player_ptr, object_type *bow_ptr, object_type *arrow_ptr, SPELL_IDX snipe_type) +AttributeFlags shot_attribute(player_type *player_ptr, object_type *bow_ptr, object_type *arrow_ptr, SPELL_IDX snipe_type) { - EffectFlags effect_flags{}; - effect_flags.set(GF_PLAYER_SHOOT); + AttributeFlags attribute_flags{}; + attribute_flags.set(AttributeType::PLAYER_SHOOT); TrFlags flags{}; auto arrow_flags = object_flags(arrow_ptr); @@ -88,52 +88,52 @@ EffectFlags shot_effect_type(player_type *player_ptr, object_type *bow_ptr, obje static const struct snipe_convert_table_t { SPELL_IDX snipe_type; - spells_type effect_type; + AttributeType attribute; } snipe_convert_table[] = { - { SP_LITE, GF_LITE }, - { SP_FIRE, GF_FIRE }, - { SP_COLD, GF_COLD }, - { SP_ELEC, GF_ELEC }, - { SP_KILL_WALL, GF_KILL_WALL }, - { SP_EVILNESS, GF_HELL_FIRE }, - { SP_HOLYNESS, GF_HOLY_FIRE }, - { SP_FINAL, GF_MANA }, + { SP_LITE, AttributeType::LITE }, + { SP_FIRE, AttributeType::FIRE }, + { SP_COLD, AttributeType::COLD }, + { SP_ELEC, AttributeType::ELEC }, + { SP_KILL_WALL, AttributeType::KILL_WALL }, + { SP_EVILNESS, AttributeType::HELL_FIRE }, + { SP_HOLYNESS, AttributeType::HOLY_FIRE }, + { SP_FINAL, AttributeType::MANA }, }; static const struct brand_convert_table_t { tr_type brand_type; - spells_type effect_type; + AttributeType attribute; } brand_convert_table[] = { - { TR_BRAND_ACID, GF_ACID }, - { TR_BRAND_FIRE, GF_FIRE }, - { TR_BRAND_ELEC, GF_ELEC }, - { TR_BRAND_COLD, GF_COLD }, - { TR_BRAND_POIS, GF_POIS }, - { TR_SLAY_GOOD, GF_HELL_FIRE }, - { TR_KILL_GOOD, GF_HELL_FIRE }, - { TR_SLAY_EVIL, GF_HOLY_FIRE }, - { TR_KILL_EVIL, GF_HOLY_FIRE }, + { TR_BRAND_ACID, AttributeType::ACID }, + { TR_BRAND_FIRE, AttributeType::FIRE }, + { TR_BRAND_ELEC, AttributeType::ELEC }, + { TR_BRAND_COLD, AttributeType::COLD }, + { TR_BRAND_POIS, AttributeType::POIS }, + { TR_SLAY_GOOD, AttributeType::HELL_FIRE }, + { TR_KILL_GOOD, AttributeType::HELL_FIRE }, + { TR_SLAY_EVIL, AttributeType::HOLY_FIRE }, + { TR_KILL_EVIL, AttributeType::HOLY_FIRE }, }; for (size_t i = 0; i < sizeof(snipe_convert_table) / sizeof(snipe_convert_table[0]); ++i) { const struct snipe_convert_table_t *p = &snipe_convert_table[i]; if (snipe_type == p->snipe_type) - effect_flags.set(p->effect_type); + attribute_flags.set(p->attribute); } for (size_t i = 0; i < sizeof(brand_convert_table) / sizeof(brand_convert_table[0]); ++i) { const struct brand_convert_table_t *p = &brand_convert_table[i]; if (flags.has(p->brand_type)) - effect_flags.set(p->effect_type); + attribute_flags.set(p->attribute); } if ((flags.has(TR_FORCE_WEAPON)) && (player_ptr->csp > (player_ptr->msp / 30))) { - effect_flags.set(GF_MANA); + attribute_flags.set(AttributeType::MANA); } - return effect_flags; + return attribute_flags; } /*! @@ -461,8 +461,8 @@ void exe_fire(player_type *player_ptr, INVENTORY_IDX item, object_type *j_ptr, S object_type *q_ptr; object_type *o_ptr; - EffectFlags effect_flags{}; - effect_flags.set(GF_PLAYER_SHOOT); + AttributeFlags attribute_flags{}; + attribute_flags.set(AttributeType::PLAYER_SHOOT); bool hit_body = false; @@ -667,7 +667,7 @@ void exe_fire(player_type *player_ptr, INVENTORY_IDX item, object_type *j_ptr, S /* Sniper */ if (snipe_type == SP_KILL_TRAP) { - project(player_ptr, 0, 0, ny, nx, 0, GF_KILL_TRAP, (PROJECT_JUMP | PROJECT_HIDE | PROJECT_GRID | PROJECT_ITEM)); + project(player_ptr, 0, 0, ny, nx, 0, AttributeType::KILL_TRAP, (PROJECT_JUMP | PROJECT_HIDE | PROJECT_GRID | PROJECT_ITEM)); } /* Sniper */ @@ -761,7 +761,7 @@ void exe_fire(player_type *player_ptr, INVENTORY_IDX item, object_type *j_ptr, S } } else { - effect_flags = shot_effect_type(player_ptr, j_ptr, q_ptr, snipe_type); + attribute_flags = shot_attribute(player_ptr, j_ptr, q_ptr, snipe_type); /* Apply special damage */ tdam = calc_shot_damage_with_slay(player_ptr, j_ptr, q_ptr, tdam, m_ptr, snipe_type); tdam = critical_shot(player_ptr, q_ptr->weight, q_ptr->to_h, j_ptr->to_h, tdam); @@ -783,7 +783,7 @@ void exe_fire(player_type *player_ptr, INVENTORY_IDX item, object_type *j_ptr, S uint16_t flg = (PROJECT_STOP | PROJECT_JUMP | PROJECT_KILL | PROJECT_GRID); sound(SOUND_EXPLODE); /* No explode sound - use breath fire instead */ - project(player_ptr, 0, ((sniper_concent + 1) / 2 + 1), ny, nx, base_dam, GF_MISSILE, flg); + project(player_ptr, 0, ((sniper_concent + 1) / 2 + 1), ny, nx, base_dam, AttributeType::MISSILE, flg); break; } @@ -795,7 +795,7 @@ void exe_fire(player_type *player_ptr, INVENTORY_IDX item, object_type *j_ptr, S } /* Hit the monster, check for death */ - MonsterDamageProcessor mdp(player_ptr, c_mon_ptr->m_idx, tdam, &fear, effect_flags); + MonsterDamageProcessor mdp(player_ptr, c_mon_ptr->m_idx, tdam, &fear, attribute_flags); if (mdp.mon_take_hit(extract_note_dies(real_r_idx(m_ptr)))) { /* Dead monster */ } diff --git a/src/combat/slaying.cpp b/src/combat/slaying.cpp index 21fd29cb4..597d371bc 100644 --- a/src/combat/slaying.cpp +++ b/src/combat/slaying.cpp @@ -14,7 +14,7 @@ #include "realm/realm-hex-numbers.h" #include "specific-object/torch.h" #include "spell-realm/spells-hex.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/monster-race-definition.h" #include "system/monster-type-definition.h" #include "system/object-type-definition.h" @@ -208,28 +208,28 @@ HIT_POINT calc_attack_damage_with_slay(player_type *player_ptr, object_type *o_p return (tdam * mult / 10); } -EffectFlags melee_effect_type(player_type *player_ptr, object_type *o_ptr, combat_options mode) +AttributeFlags melee_attribute(player_type *player_ptr, object_type *o_ptr, combat_options mode) { - EffectFlags effect_flags{}; - effect_flags.set(GF_PLAYER_MELEE); + AttributeFlags attribute_flags{}; + attribute_flags.set(AttributeType::PLAYER_MELEE); if (player_ptr->pclass == PlayerClassType::SAMURAI) { static const struct samurai_convert_table_t { combat_options hissatsu_type; - spells_type effect_type; + AttributeType attribute; } samurai_convert_table[] = { - { HISSATSU_FIRE, GF_FIRE }, - { HISSATSU_COLD, GF_COLD }, - { HISSATSU_ELEC, GF_ELEC }, - { HISSATSU_POISON, GF_POIS }, - { HISSATSU_HAGAN, GF_KILL_WALL }, + { HISSATSU_FIRE, AttributeType::FIRE }, + { HISSATSU_COLD, AttributeType::COLD }, + { HISSATSU_ELEC, AttributeType::ELEC }, + { HISSATSU_POISON, AttributeType::POIS }, + { HISSATSU_HAGAN, AttributeType::KILL_WALL }, }; for (size_t i = 0; i < sizeof(samurai_convert_table) / sizeof(samurai_convert_table[0]); ++i) { const struct samurai_convert_table_t *p = &samurai_convert_table[i]; if (mode == p->hissatsu_type) - effect_flags.set(p->effect_type); + attribute_flags.set(p->attribute); } } @@ -251,30 +251,30 @@ EffectFlags melee_effect_type(player_type *player_ptr, object_type *o_ptr, comba static const struct brand_convert_table_t { tr_type brand_type; - spells_type effect_type; + AttributeType attribute; } brand_convert_table[] = { - { TR_BRAND_ACID, GF_ACID }, - { TR_BRAND_FIRE, GF_FIRE }, - { TR_BRAND_ELEC, GF_ELEC }, - { TR_BRAND_COLD, GF_COLD }, - { TR_BRAND_POIS, GF_POIS }, - { TR_SLAY_GOOD, GF_HELL_FIRE }, - { TR_KILL_GOOD, GF_HELL_FIRE }, - { TR_SLAY_EVIL, GF_HOLY_FIRE }, - { TR_KILL_EVIL, GF_HOLY_FIRE }, + { TR_BRAND_ACID, AttributeType::ACID }, + { TR_BRAND_FIRE, AttributeType::FIRE }, + { TR_BRAND_ELEC, AttributeType::ELEC }, + { TR_BRAND_COLD, AttributeType::COLD }, + { TR_BRAND_POIS, AttributeType::POIS }, + { TR_SLAY_GOOD, AttributeType::HELL_FIRE }, + { TR_KILL_GOOD, AttributeType::HELL_FIRE }, + { TR_SLAY_EVIL, AttributeType::HOLY_FIRE }, + { TR_KILL_EVIL, AttributeType::HOLY_FIRE }, }; for (size_t i = 0; i < sizeof(brand_convert_table) / sizeof(brand_convert_table[0]); ++i) { const struct brand_convert_table_t *p = &brand_convert_table[i]; if (flgs.has(p->brand_type)) - effect_flags.set(p->effect_type); + attribute_flags.set(p->attribute); } if ((flgs.has(TR_FORCE_WEAPON)) && (player_ptr->csp > (o_ptr->dd * o_ptr->ds / 5))) { - effect_flags.set(GF_MANA); + attribute_flags.set(AttributeType::MANA); } - return effect_flags; + return attribute_flags; } diff --git a/src/combat/slaying.h b/src/combat/slaying.h index a0a94227c..1708c5dc2 100644 --- a/src/combat/slaying.h +++ b/src/combat/slaying.h @@ -4,7 +4,7 @@ #include "combat/combat-options-type.h" #include "object-enchant/tr-flags.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" struct monster_type; struct object_type; @@ -12,4 +12,4 @@ struct player_type; MULTIPLY mult_slaying(player_type *player_ptr, MULTIPLY mult, const TrFlags &flgs, monster_type *m_ptr); MULTIPLY mult_brand(player_type *player_ptr, MULTIPLY mult, const TrFlags &flgs, monster_type *m_ptr); HIT_POINT calc_attack_damage_with_slay(player_type *player_ptr, object_type *o_ptr, HIT_POINT tdam, monster_type *m_ptr, combat_options mode, bool thrown); -EffectFlags melee_effect_type(player_type *player_ptr, object_type *o_ptr, combat_options mode); +AttributeFlags melee_attribute(player_type *player_ptr, object_type *o_ptr, combat_options mode); diff --git a/src/effect/attribute-types.h b/src/effect/attribute-types.h new file mode 100644 index 000000000..0814d9f64 --- /dev/null +++ b/src/effect/attribute-types.h @@ -0,0 +1,117 @@ +#pragma once +#include "util/flag-group.h" + +enum class AttributeType : EFFECT_ID +{ + NONE = 0, + ELEC = 1, /*!< 魔法効果: 電撃*/ + POIS = 2, /*!< 魔法効果: 毒*/ + ACID = 3, /*!< 魔法効果: 酸*/ + COLD = 4, /*!< 魔法効果: 冷気*/ + FIRE = 5, /*!< 魔法効果: 火炎*/ + PSY_SPEAR = 9, /*!< 魔法効果: 光の剣*/ + MISSILE = 10, /*!< 魔法効果: 弱魔力*/ + ARROW = 11, /*!< 魔法効果: 射撃*/ + PLASMA = 12, /*!< 魔法効果: プラズマ*/ + WATER = 14, /*!< 魔法効果: 水流*/ + LITE = 15, /*!< 魔法効果: 閃光*/ + DARK = 16, /*!< 魔法効果: 暗黒*/ + LITE_WEAK = 17, /*!< 魔法効果: 弱光*/ + DARK_WEAK = 18, /*!< 魔法効果: 弱暗*/ + SHARDS = 20, /*!< 魔法効果: 破片*/ + SOUND = 21, /*!< 魔法効果: 轟音*/ + CONFUSION = 22, /*!< 魔法効果: æ··ä¹±*/ + FORCE = 23, /*!< 魔法効果: フォース*/ + INERTIAL = 24, /*!< 魔法効果: 遅鈍*/ + MANA = 26, /*!< 魔法効果: 純粋魔力*/ + METEOR = 27, /*!< 魔法効果: 隕石*/ + ICE = 28, /*!< 魔法効果: 極寒*/ + CHAOS = 30, /*!< 魔法効果: カオス*/ + NETHER = 31, /*!< 魔法効果: 地獄*/ + DISENCHANT = 32, /*!< 魔法効果: 劣化*/ + NEXUS = 33, /*!< 魔法効果: 因果混乱*/ + TIME = 34, /*!< 魔法効果: 時間逆転*/ + GRAVITY = 35, /*!< 魔法効果: 重力*/ + KILL_WALL = 40, /*!< 魔法効果: 岩石溶解*/ + KILL_DOOR = 41, /*!< 魔法効果: ドア破壊*/ + KILL_TRAP = 42, /*!< 魔法効果: トラップ破壊*/ + MAKE_WALL = 45, /*!< 魔法効果: 壁生成 (現在未使用)*/ + MAKE_DOOR = 46, /*!< 魔法効果: ドア生成*/ + MAKE_TRAP = 47, /*!< 魔法効果: トラップ生成*/ + MAKE_TREE = 48, /*!< 魔法効果: 森林生成*/ + OLD_CLONE = 51, /*!< 魔法効果: クローン・モンスター*/ + OLD_POLY = 52, /*!< 魔法効果: チェンジ・モンスター*/ + OLD_HEAL = 53, /*!< 魔法効果: 回復モンスター*/ + OLD_SPEED = 54, /*!< 魔法効果: スピード・モンスター*/ + OLD_SLOW = 55, /*!< 魔法効果: スロウ・モンスター*/ + OLD_CONF = 56, /*!< 魔法効果: パニック・モンスター*/ + OLD_SLEEP = 57, /*!< 魔法効果: スリープ・モンスター*/ + HYPODYNAMIA = 58, /*!< 魔法効果: è¡°å¼±*/ + AWAY_UNDEAD = 61, /*!< 魔法効果: アンデッド・アウェイ*/ + AWAY_EVIL = 62, /*!< 魔法効果: 邪悪飛ばし*/ + AWAY_ALL = 63, /*!< 魔法効果: テレポート・アウェイ*/ + TURN_UNDEAD = 64, /*!< 魔法効果: アンデッド恐慌*/ + TURN_EVIL = 65, /*!< 魔法効果: 邪悪恐慌*/ + TURN_ALL = 66, /*!< 魔法効果: モンスター恐慌*/ + DISP_UNDEAD = 67, /*!< 魔法効果: アンデッド退散*/ + DISP_EVIL = 68, /*!< 魔法効果: 邪悪退散*/ + DISP_ALL = 69, /*!< 魔法効果: モンスター退散*/ + DISP_DEMON = 70, /*!< 魔法効果: 悪魔退散*/ + DISP_LIVING = 71, /*!< 魔法効果: 生命退散*/ + ROCKET = 72, /*!< 魔法効果: ロケット*/ + NUKE = 73, /*!< 魔法効果: 放射性廃棄物*/ + MAKE_RUNE_PROTECTION = 74, /*!< 魔法効果: 守りのルーン生成*/ + STASIS = 75, /*!< 魔法効果: モンスター拘束*/ + STONE_WALL = 76, /*!< 魔法効果: 壁生成*/ + DEATH_RAY = 77, /*!< 魔法効果: 死の光線*/ + STUN = 78, /*!< 魔法効果: 朦朧*/ + HOLY_FIRE = 79, /*!< 魔法効果: 聖光*/ + HELL_FIRE = 80, /*!< 魔法効果: 地獄の劫火*/ + DISINTEGRATE = 81, /*!< 魔法効果: 分解*/ + CHARM = 82, /*!< 魔法効果: モンスター魅了*/ + CONTROL_UNDEAD = 83, /*!< 魔法効果: アンデッド支配*/ + CONTROL_ANIMAL = 84, /*!< 魔法効果: 動物支配*/ + PSI = 85, /*!< 魔法効果: サイキック攻撃*/ + PSI_DRAIN = 86, /*!< 魔法効果: 精神吸収*/ + TELEKINESIS = 87, /*!< 魔法効果: テレキシネス*/ + JAM_DOOR = 88, /*!< 魔法効果: 施錠*/ + DOMINATION = 89, /*!< 魔法効果: 精神支配*/ + DISP_GOOD = 90, /*!< 魔法効果: 善良退散*/ + DRAIN_MANA = 91, /*!< 魔法効果: 魔力吸収*/ + MIND_BLAST = 92, /*!< 魔法効果: 精神攻撃*/ + BRAIN_SMASH = 93, /*!< 魔法効果: 脳攻撃*/ + CAUSE_1 = 94, /*!< 魔法効果: 軽傷の呪い*/ + CAUSE_2 = 95, /*!< 魔法効果: 重傷の呪い*/ + CAUSE_3 = 96, /*!< 魔法効果: 致命傷の呪い*/ + CAUSE_4 = 97, /*!< 魔法効果: 秘孔を突く*/ + HAND_DOOM = 98, /*!< 魔法効果: 破滅の手*/ + CAPTURE = 99, /*!< 魔法効果: 捕縛*/ + ANIM_DEAD = 100, /*!< 魔法効果: 死者復活*/ + CHARM_LIVING = 101, /*!< 魔法効果: 生命魅了*/ + IDENTIFY = 102, /*!< 魔法効果: 鑑定*/ + ATTACK = 103, /*!< 魔法効果: 白兵*/ + ENGETSU = 104, /*!< 魔法効果: 円月*/ + GENOCIDE = 105, /*!< 魔法効果: 抹殺*/ + PHOTO = 106, /*!< 魔法効果: 撮影*/ + CONTROL_DEMON = 107, /*!< 魔法効果: 悪魔支配*/ + LAVA_FLOW = 108, /*!< 魔法効果: 溶岩噴出*/ + BLOOD_CURSE = 109, /*!< 魔法効果: 血の呪い*/ + SEEKER = 110, /*!< 魔法効果: シーカーレイ*/ + SUPER_RAY = 111, /*!< 魔法効果: スーパーレイ*/ + STAR_HEAL = 112, /*!< 魔法効果: 星の癒し*/ + WATER_FLOW = 113, /*!< 魔法効果: 流水*/ + CRUSADE = 114, /*!< 魔法効果: 聖戦*/ + STASIS_EVIL = 115, /*!< 魔法効果: 邪悪拘束*/ + WOUNDS = 116, /*!< 魔法効果: 創傷*/ + E_GENOCIDE = 117, /*!< 魔法効果: 元素抹殺 */ + VOID_MAGIC = 118, /*!< 魔法効果: 虚無 */ + ABYSS = 119, /*!< 魔法効果: 深淵 */ + HUNGRY = 120, /*!< 魔法効果: 空腹>*/ + PLAYER_SHOOT = 121, /*!< 属性取得用: プレイヤーの射撃/投擲>*/ + PLAYER_MELEE = 122, /*!< 属性取得用: プレイヤーの近接攻撃>*/ + MAX /*!< 欠番を無視した最大サイズ (直上の値+1) */ +}; + + +/*! 属性フラグATTRIBUTEの集合を表すクラス */ +using AttributeFlags = FlagGroup; diff --git a/src/effect/effect-feature.cpp b/src/effect/effect-feature.cpp index 16c73d7ff..aebb6df59 100644 --- a/src/effect/effect-feature.cpp +++ b/src/effect/effect-feature.cpp @@ -2,6 +2,7 @@ #include "core/player-update-types.h" #include "dungeon/dungeon-flag-types.h" #include "dungeon/dungeon.h" +#include "effect/attribute-types.h" #include "effect/effect-characteristics.h" #include "effect/effect-processor.h" // 暫定、後で消す. #include "floor/cave.h" @@ -16,7 +17,6 @@ #include "monster/monster-update.h" #include "player/special-defense-types.h" #include "room/door-definition.h" -#include "spell/spell-types.h" #include "system/floor-type-definition.h" #include "system/grid-type-definition.h" #include "system/player-type-definition.h" @@ -63,7 +63,7 @@ static bool cave_naked_bold(player_type *player_ptr, POSITION y, POSITION x) * Perhaps we should affect doors? * */ -bool affect_feature(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ) +bool affect_feature(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, AttributeType typ) { floor_type *floor_ptr = player_ptr->current_floor_ptr; grid_type *g_ptr = &floor_ptr->grid_array[y][x]; @@ -78,40 +78,40 @@ bool affect_feature(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITI if (f_ptr->flags.has(FF::TREE)) { concptr message; switch (typ) { - case GF_POIS: - case GF_NUKE: - case GF_DEATH_RAY: + case AttributeType::POIS: + case AttributeType::NUKE: + case AttributeType::DEATH_RAY: message = _("枯れた", "was blasted."); break; - case GF_TIME: + case AttributeType::TIME: message = _("縮んだ", "shrank."); break; - case GF_ACID: + case AttributeType::ACID: message = _("溶けた", "melted."); break; - case GF_COLD: - case GF_ICE: + case AttributeType::COLD: + case AttributeType::ICE: message = _("凍り、砕け散った", "was frozen and smashed."); break; - case GF_FIRE: - case GF_ELEC: - case GF_PLASMA: + case AttributeType::FIRE: + case AttributeType::ELEC: + case AttributeType::PLASMA: message = _("燃えた", "burns up!"); break; - case GF_METEOR: - case GF_CHAOS: - case GF_MANA: - case GF_SEEKER: - case GF_SUPER_RAY: - case GF_SHARDS: - case GF_ROCKET: - case GF_SOUND: - case GF_DISENCHANT: - case GF_FORCE: - case GF_GRAVITY: + case AttributeType::METEOR: + case AttributeType::CHAOS: + case AttributeType::MANA: + case AttributeType::SEEKER: + case AttributeType::SUPER_RAY: + case AttributeType::SHARDS: + case AttributeType::ROCKET: + case AttributeType::SOUND: + case AttributeType::DISENCHANT: + case AttributeType::FORCE: + case AttributeType::GRAVITY: message = _("粉砕された", "was crushed."); break; - case GF_VOID: + case AttributeType::VOID_MAGIC: message = _("消滅した", "vanished."); break; default: @@ -132,39 +132,39 @@ bool affect_feature(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITI /* Analyze the type */ switch (typ) { /* Ignore most effects */ - case GF_CAPTURE: - case GF_HAND_DOOM: - case GF_CAUSE_1: - case GF_CAUSE_2: - case GF_CAUSE_3: - case GF_CAUSE_4: - case GF_MIND_BLAST: - case GF_BRAIN_SMASH: - case GF_DRAIN_MANA: - case GF_PSY_SPEAR: - case GF_FORCE: - case GF_HOLY_FIRE: - case GF_HELL_FIRE: - case GF_PSI: - case GF_PSI_DRAIN: - case GF_TELEKINESIS: - case GF_DOMINATION: - case GF_IDENTIFY: - case GF_ATTACK: - case GF_ACID: - case GF_ELEC: - case GF_COLD: - case GF_ICE: - case GF_FIRE: - case GF_PLASMA: - case GF_METEOR: - case GF_CHAOS: - case GF_MANA: - case GF_SEEKER: - case GF_SUPER_RAY: { + case AttributeType::CAPTURE: + case AttributeType::HAND_DOOM: + case AttributeType::CAUSE_1: + case AttributeType::CAUSE_2: + case AttributeType::CAUSE_3: + case AttributeType::CAUSE_4: + case AttributeType::MIND_BLAST: + case AttributeType::BRAIN_SMASH: + case AttributeType::DRAIN_MANA: + case AttributeType::PSY_SPEAR: + case AttributeType::FORCE: + case AttributeType::HOLY_FIRE: + case AttributeType::HELL_FIRE: + case AttributeType::PSI: + case AttributeType::PSI_DRAIN: + case AttributeType::TELEKINESIS: + case AttributeType::DOMINATION: + case AttributeType::IDENTIFY: + case AttributeType::ATTACK: + case AttributeType::ACID: + case AttributeType::ELEC: + case AttributeType::COLD: + case AttributeType::ICE: + case AttributeType::FIRE: + case AttributeType::PLASMA: + case AttributeType::METEOR: + case AttributeType::CHAOS: + case AttributeType::MANA: + case AttributeType::SEEKER: + case AttributeType::SUPER_RAY: { break; } - case GF_KILL_TRAP: { + case AttributeType::KILL_TRAP: { if (is_hidden_door(player_ptr, g_ptr)) { disclose_grid(player_ptr, y, x); if (known) { @@ -198,7 +198,7 @@ bool affect_feature(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITI obvious = true; break; } - case GF_KILL_DOOR: { + case AttributeType::KILL_DOOR: { if (is_trap(player_ptr, g_ptr->feat) || f_ptr->flags.has(FF::DOOR)) { if (known) { msg_print(_("まばゆい閃光が走った!", "There is a bright flash of light!")); @@ -216,7 +216,7 @@ bool affect_feature(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITI obvious = true; break; } - case GF_JAM_DOOR: { + case AttributeType::JAM_DOOR: { if (f_ptr->flags.has_not(FF::SPIKE)) break; @@ -236,7 +236,7 @@ bool affect_feature(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITI obvious = true; break; } - case GF_KILL_WALL: { + case AttributeType::KILL_WALL: { if (f_ptr->flags.has_not(FF::HURT_ROCK)) break; @@ -249,7 +249,7 @@ bool affect_feature(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITI player_ptr->update |= (PU_FLOW); break; } - case GF_MAKE_DOOR: { + case AttributeType::MAKE_DOOR: { if (!cave_naked_bold(player_ptr, y, x)) break; if (player_bold(player_ptr, y, x)) @@ -259,11 +259,11 @@ bool affect_feature(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITI obvious = true; break; } - case GF_MAKE_TRAP: { + case AttributeType::MAKE_TRAP: { place_trap(player_ptr, y, x); break; } - case GF_MAKE_TREE: { + case AttributeType::MAKE_TREE: { if (!cave_naked_bold(player_ptr, y, x)) break; if (player_bold(player_ptr, y, x)) @@ -273,7 +273,7 @@ bool affect_feature(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITI obvious = true; break; } - case GF_MAKE_RUNE_PROTECTION: { + case AttributeType::MAKE_RUNE_PROTECTION: { if (!cave_naked_bold(player_ptr, y, x)) break; g_ptr->info |= CAVE_OBJECT; @@ -282,7 +282,7 @@ bool affect_feature(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITI lite_spot(player_ptr, y, x); break; } - case GF_STONE_WALL: { + case AttributeType::STONE_WALL: { if (!cave_naked_bold(player_ptr, y, x)) break; if (player_bold(player_ptr, y, x)) @@ -290,7 +290,7 @@ bool affect_feature(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITI cave_set_feat(player_ptr, y, x, feat_granite); break; } - case GF_LAVA_FLOW: { + case AttributeType::LAVA_FLOW: { if (f_ptr->flags.has(FF::PERMANENT)) break; if (dam == 1) { @@ -303,7 +303,7 @@ bool affect_feature(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITI break; } - case GF_WATER_FLOW: { + case AttributeType::WATER_FLOW: { if (f_ptr->flags.has(FF::PERMANENT)) break; if (dam == 1) { @@ -316,8 +316,8 @@ bool affect_feature(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITI break; } - case GF_LITE_WEAK: - case GF_LITE: { + case AttributeType::LITE_WEAK: + case AttributeType::LITE: { if (d_info[player_ptr->dungeon_idx].flags.has(DF::DARKNESS)) break; @@ -337,9 +337,9 @@ bool affect_feature(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITI break; } - case GF_DARK_WEAK: - case GF_DARK: - case GF_ABYSS: { + case AttributeType::DARK_WEAK: + case AttributeType::DARK: + case AttributeType::ABYSS: { bool do_dark = !player_ptr->phase_out && !g_ptr->is_mirror(); if (!do_dark) break; @@ -383,13 +383,13 @@ bool affect_feature(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITI break; } - case GF_SHARDS: - case GF_ROCKET: { + case AttributeType::SHARDS: + case AttributeType::ROCKET: { if (g_ptr->is_mirror()) { msg_print(_("鏡が割れた!", "The mirror was shattered!")); sound(SOUND_GLASS); remove_mirror(player_ptr, y, x); - project(player_ptr, 0, 2, y, x, player_ptr->lev / 2 + 5, GF_SHARDS, + project(player_ptr, 0, 2, y, x, player_ptr->lev / 2 + 5, AttributeType::SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI)); } @@ -405,12 +405,12 @@ bool affect_feature(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITI player_ptr->update |= (PU_FLOW); break; } - case GF_SOUND: { + case AttributeType::SOUND: { if (g_ptr->is_mirror() && player_ptr->lev < 40) { msg_print(_("鏡が割れた!", "The mirror was shattered!")); sound(SOUND_GLASS); remove_mirror(player_ptr, y, x); - project(player_ptr, 0, 2, y, x, player_ptr->lev / 2 + 5, GF_SHARDS, + project(player_ptr, 0, 2, y, x, player_ptr->lev / 2 + 5, AttributeType::SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI)); } @@ -426,7 +426,7 @@ bool affect_feature(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITI player_ptr->update |= (PU_FLOW); break; } - case GF_DISINTEGRATE: { + case AttributeType::DISINTEGRATE: { if (g_ptr->is_mirror() || g_ptr->is_rune_protection() || g_ptr->is_rune_explosion()) remove_mirror(player_ptr, y, x); @@ -437,6 +437,8 @@ bool affect_feature(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITI player_ptr->update |= (PU_FLOW); break; } + default: + break; } lite_spot(player_ptr, y, x); diff --git a/src/effect/effect-feature.h b/src/effect/effect-feature.h index 0eccfce46..05fdb1d96 100644 --- a/src/effect/effect-feature.h +++ b/src/effect/effect-feature.h @@ -1,6 +1,7 @@ #pragma once #include "system/angband.h" +#include "effect/attribute-types.h" struct player_type; -bool affect_feature(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ); +bool affect_feature(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, AttributeType typ); diff --git a/src/effect/effect-item.cpp b/src/effect/effect-item.cpp index 9b845208e..b1f29257d 100644 --- a/src/effect/effect-item.cpp +++ b/src/effect/effect-item.cpp @@ -1,5 +1,6 @@ #include "effect/effect-item.h" #include "autopick/autopick.h" +#include "effect/attribute-types.h" #include "flavor/flavor-describer.h" #include "flavor/object-flavor-types.h" #include "floor/cave.h" @@ -15,7 +16,6 @@ #include "object/object-mark-types.h" #include "perception/object-perception.h" #include "spell-kind/spells-perception.h" -#include "spell/spell-types.h" #include "sv-definition/sv-other-types.h" #include "sv-definition/sv-scroll-types.h" #include "system/floor-type-definition.h" @@ -39,7 +39,7 @@ * @param typ 効果属性 / Type of damage to apply to monsters (and objects) * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE */ -bool affect_item(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ) +bool affect_item(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, AttributeType typ) { grid_type *g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x]; @@ -68,7 +68,7 @@ bool affect_item(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITION auto flags = object_flags(o_ptr); bool is_artifact = o_ptr->is_artifact(); switch (typ) { - case GF_ACID: { + case AttributeType::ACID: { if (BreakerAcid().hates(o_ptr)) { do_kill = true; note_kill = _("融けてしまった!", (plural ? " melt!" : " melts!")); @@ -78,7 +78,7 @@ bool affect_item(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITION break; } - case GF_ELEC: { + case AttributeType::ELEC: { if (BreakerElec().hates(o_ptr)) { do_kill = true; note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!")); @@ -88,7 +88,7 @@ bool affect_item(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITION break; } - case GF_FIRE: { + case AttributeType::FIRE: { if (BreakerFire().hates(o_ptr)) { do_kill = true; note_kill = _("燃えてしまった!", (plural ? " burn up!" : " burns up!")); @@ -98,7 +98,7 @@ bool affect_item(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITION break; } - case GF_COLD: { + case AttributeType::COLD: { if (BreakerCold().hates(o_ptr)) { note_kill = _("砕け散ってしまった!", (plural ? " shatter!" : " shatters!")); do_kill = true; @@ -108,7 +108,7 @@ bool affect_item(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITION break; } - case GF_PLASMA: { + case AttributeType::PLASMA: { if (BreakerFire().hates(o_ptr)) { do_kill = true; note_kill = _("燃えてしまった!", (plural ? " burn up!" : " burns up!")); @@ -126,7 +126,7 @@ bool affect_item(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITION break; } - case GF_METEOR: { + case AttributeType::METEOR: { if (BreakerFire().hates(o_ptr)) { do_kill = true; note_kill = _("燃えてしまった!", (plural ? " burn up!" : " burns up!")); @@ -144,10 +144,10 @@ bool affect_item(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITION break; } - case GF_ICE: - case GF_SHARDS: - case GF_FORCE: - case GF_SOUND: { + case AttributeType::ICE: + case AttributeType::SHARDS: + case AttributeType::FORCE: + case AttributeType::SOUND: { if (BreakerCold().hates(o_ptr)) { note_kill = _("砕け散ってしまった!", (plural ? " shatter!" : " shatters!")); do_kill = true; @@ -155,19 +155,19 @@ bool affect_item(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITION break; } - case GF_MANA: - case GF_SEEKER: - case GF_SUPER_RAY: { + case AttributeType::MANA: + case AttributeType::SEEKER: + case AttributeType::SUPER_RAY: { do_kill = true; note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!")); break; } - case GF_DISINTEGRATE: { + case AttributeType::DISINTEGRATE: { do_kill = true; note_kill = _("蒸発してしまった!", (plural ? " evaporate!" : " evaporates!")); break; } - case GF_CHAOS: { + case AttributeType::CHAOS: { do_kill = true; note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!")); if (flags.has(TR_RES_CHAOS)) @@ -176,8 +176,8 @@ bool affect_item(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITION ignore = true; break; } - case GF_HOLY_FIRE: - case GF_HELL_FIRE: { + case AttributeType::HOLY_FIRE: + case AttributeType::HELL_FIRE: { if (o_ptr->is_cursed()) { do_kill = true; note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!")); @@ -185,18 +185,18 @@ bool affect_item(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITION break; } - case GF_VOID: { + case AttributeType::VOID_MAGIC: { do_kill = true; note_kill = _("消滅してしまった!", (plural ? " vanish!" : " vanishes!")); break; } - case GF_IDENTIFY: { + case AttributeType::IDENTIFY: { identify_item(player_ptr, o_ptr); autopick_alter_item(player_ptr, (-this_o_idx), false); break; } - case GF_KILL_TRAP: - case GF_KILL_DOOR: { + case AttributeType::KILL_TRAP: + case AttributeType::KILL_DOOR: { if (o_ptr->tval != ItemKindType::CHEST) break; if (o_ptr->pval <= 0) @@ -211,7 +211,7 @@ bool affect_item(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITION break; } - case GF_ANIM_DEAD: { + case AttributeType::ANIM_DEAD: { if (o_ptr->tval != ItemKindType::CORPSE) break; @@ -237,6 +237,8 @@ bool affect_item(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITION is_item_affected = true; break; } + default: + break; } if (!do_kill) diff --git a/src/effect/effect-item.h b/src/effect/effect-item.h index eca24cf7a..298a1a932 100644 --- a/src/effect/effect-item.h +++ b/src/effect/effect-item.h @@ -1,6 +1,7 @@ #pragma once #include "system/angband.h" +#include "effect/attribute-types.h" struct player_type; -bool affect_item(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ); +bool affect_item(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, AttributeType typ); diff --git a/src/effect/effect-monster-charm.cpp b/src/effect/effect-monster-charm.cpp index c1c366fd7..e758c8032 100644 --- a/src/effect/effect-monster-charm.cpp +++ b/src/effect/effect-monster-charm.cpp @@ -392,7 +392,7 @@ static void effect_monster_captured(player_type *player_ptr, effect_monster_type } /*! - * @brief モンスターボールで捕らえる効果(GF_CAPTURE) + * @brief モンスターボールで捕らえる効果(CAPTURE) * @param player_ptr プレイヤー情報への参照ポインタ * @param em_ptr 効果情報への参照ポインタ * @return 効果発動結果 diff --git a/src/effect/effect-monster-psi.cpp b/src/effect/effect-monster-psi.cpp index bd1f5a10b..0f8e4375c 100644 --- a/src/effect/effect-monster-psi.cpp +++ b/src/effect/effect-monster-psi.cpp @@ -185,7 +185,7 @@ static void effect_monster_psi_extra_effect(effect_monster_type *em_ptr) } /*! - * @brief モンスターへのPsi攻撃(GF_PSI)の効果を発動する + * @brief モンスターへのPsi攻撃(PSI)の効果を発動する * @param player_ptr プレイヤーへの参照ポインタ * @param em_ptr モンスター効果への参照ポインタ * @return PROICESS_CONTINUE @@ -212,7 +212,7 @@ process_result effect_monster_psi(player_type *player_ptr, effect_monster_type * } /*! - * @brief モンスターのPsi攻撃(GF_PSI_DRAIN)に対する耐性を発動する + * @brief モンスターのPsi攻撃(PSI_DRAIN)に対する耐性を発動する * @param player_ptr プレイヤーへの参照ポインタ * @param em_ptr モンスター効果への参照ポインタ * @details @@ -253,7 +253,7 @@ static void effect_monster_psi_drain_resist(player_type *player_ptr, effect_mons } /*! - * @brief モンスターへのPsi攻撃(GF_PSI_DRAIN)のダメージをMPに変換する + * @brief モンスターへのPsi攻撃(PSI_DRAIN)のダメージをMPに変換する * @param player_ptr プレイヤーへの参照ポインタ * @param em_ptr モンスター効果への参照ポインタ */ @@ -271,7 +271,7 @@ static void effect_monster_psi_drain_change_power(player_type *player_ptr, effec } /*! - * @brief モンスターへのPsi攻撃(GF_PSI_DRAIN)の効果を発動する + * @brief モンスターへのPsi攻撃(PSI_DRAIN)の効果を発動する * @param player_ptr プレイヤーへの参照ポインタ * @param em_ptr モンスター効果への参照ポインタ * @return PROICESS_CONTINUE @@ -292,7 +292,7 @@ process_result effect_monster_psi_drain(player_type *player_ptr, effect_monster_ } /*! - * @brief モンスターへのテレキネシス(GF_TELEKINESIS)の効果を発動する + * @brief モンスターへのテレキネシス(TELEKINESIS)の効果を発動する * @param player_ptr プレイヤーへの参照ポインタ * @param em_ptr モンスター効果への参照ポインタ * @return PROICESS_CONTINUE diff --git a/src/effect/effect-monster-switcher.cpp b/src/effect/effect-monster-switcher.cpp index fa5aee3d7..8218e65da 100644 --- a/src/effect/effect-monster-switcher.cpp +++ b/src/effect/effect-monster-switcher.cpp @@ -30,7 +30,7 @@ #include "monster/monster-status.h" #include "player/player-damage.h" #include "spell-kind/spells-genocide.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/grid-type-definition.h" #include "system/monster-race-definition.h" #include "system/monster-type-definition.h" @@ -296,175 +296,175 @@ process_result effect_monster_wounds(effect_monster_type *em_ptr) */ process_result switch_effects_monster(player_type *player_ptr, effect_monster_type *em_ptr) { - switch (em_ptr->effect_type) { - case GF_PSY_SPEAR: - case GF_MISSILE: - case GF_ARROW: - case GF_MANA: - case GF_METEOR: - case GF_BLOOD_CURSE: - case GF_SEEKER: - case GF_SUPER_RAY: + switch (em_ptr->attribute) { + case AttributeType::PSY_SPEAR: + case AttributeType::MISSILE: + case AttributeType::ARROW: + case AttributeType::MANA: + case AttributeType::METEOR: + case AttributeType::BLOOD_CURSE: + case AttributeType::SEEKER: + case AttributeType::SUPER_RAY: return effect_monster_nothing(em_ptr); - case GF_ACID: + case AttributeType::ACID: return effect_monster_acid(player_ptr, em_ptr); - case GF_ELEC: + case AttributeType::ELEC: return effect_monster_elec(player_ptr, em_ptr); - case GF_FIRE: + case AttributeType::FIRE: return effect_monster_fire(player_ptr, em_ptr); - case GF_COLD: + case AttributeType::COLD: return effect_monster_cold(player_ptr, em_ptr); - case GF_POIS: + case AttributeType::POIS: return effect_monster_pois(player_ptr, em_ptr); - case GF_NUKE: + case AttributeType::NUKE: return effect_monster_nuke(player_ptr, em_ptr); - case GF_HELL_FIRE: + case AttributeType::HELL_FIRE: return effect_monster_hell_fire(player_ptr, em_ptr); - case GF_HOLY_FIRE: + case AttributeType::HOLY_FIRE: return effect_monster_holy_fire(player_ptr, em_ptr); - case GF_PLASMA: + case AttributeType::PLASMA: return effect_monster_plasma(player_ptr, em_ptr); - case GF_NETHER: + case AttributeType::NETHER: return effect_monster_nether(player_ptr, em_ptr); - case GF_WATER: + case AttributeType::WATER: return effect_monster_water(player_ptr, em_ptr); - case GF_CHAOS: + case AttributeType::CHAOS: return effect_monster_chaos(player_ptr, em_ptr); - case GF_SHARDS: + case AttributeType::SHARDS: return effect_monster_shards(player_ptr, em_ptr); - case GF_ROCKET: + case AttributeType::ROCKET: return effect_monster_rocket(player_ptr, em_ptr); - case GF_SOUND: + case AttributeType::SOUND: return effect_monster_sound(player_ptr, em_ptr); - case GF_CONFUSION: + case AttributeType::CONFUSION: return effect_monster_confusion(player_ptr, em_ptr); - case GF_DISENCHANT: + case AttributeType::DISENCHANT: return effect_monster_disenchant(player_ptr, em_ptr); - case GF_NEXUS: + case AttributeType::NEXUS: return effect_monster_nexus(player_ptr, em_ptr); - case GF_FORCE: + case AttributeType::FORCE: return effect_monster_force(player_ptr, em_ptr); - case GF_INERTIAL: + case AttributeType::INERTIAL: return effect_monster_inertial(player_ptr, em_ptr); - case GF_TIME: + case AttributeType::TIME: return effect_monster_time(player_ptr, em_ptr); - case GF_GRAVITY: + case AttributeType::GRAVITY: return effect_monster_gravity(player_ptr, em_ptr); - case GF_DISINTEGRATE: + case AttributeType::DISINTEGRATE: return effect_monster_disintegration(player_ptr, em_ptr); - case GF_PSI: + case AttributeType::PSI: return effect_monster_psi(player_ptr, em_ptr); - case GF_PSI_DRAIN: + case AttributeType::PSI_DRAIN: return effect_monster_psi_drain(player_ptr, em_ptr); - case GF_TELEKINESIS: + case AttributeType::TELEKINESIS: return effect_monster_telekinesis(player_ptr, em_ptr); - case GF_DOMINATION: + case AttributeType::DOMINATION: return effect_monster_domination(player_ptr, em_ptr); - case GF_ICE: + case AttributeType::ICE: return effect_monster_icee_bolt(player_ptr, em_ptr); - case GF_HYPODYNAMIA: + case AttributeType::HYPODYNAMIA: return effect_monster_hypodynamia(player_ptr, em_ptr); - case GF_DEATH_RAY: + case AttributeType::DEATH_RAY: return effect_monster_death_ray(player_ptr, em_ptr); - case GF_OLD_POLY: + case AttributeType::OLD_POLY: return effect_monster_old_poly(em_ptr); - case GF_OLD_CLONE: + case AttributeType::OLD_CLONE: return effect_monster_old_clone(player_ptr, em_ptr); - case GF_STAR_HEAL: + case AttributeType::STAR_HEAL: return effect_monster_star_heal(player_ptr, em_ptr); - case GF_OLD_HEAL: + case AttributeType::OLD_HEAL: return effect_monster_old_heal(player_ptr, em_ptr); - case GF_OLD_SPEED: + case AttributeType::OLD_SPEED: return effect_monster_old_speed(player_ptr, em_ptr); - case GF_OLD_SLOW: + case AttributeType::OLD_SLOW: return effect_monster_old_slow(player_ptr, em_ptr); - case GF_OLD_SLEEP: + case AttributeType::OLD_SLEEP: return effect_monster_old_sleep(player_ptr, em_ptr); - case GF_STASIS_EVIL: + case AttributeType::STASIS_EVIL: return effect_monster_stasis(em_ptr, true); - case GF_STASIS: + case AttributeType::STASIS: return effect_monster_stasis(em_ptr, false); - case GF_CHARM: + case AttributeType::CHARM: return effect_monster_charm(player_ptr, em_ptr); - case GF_CONTROL_UNDEAD: + case AttributeType::CONTROL_UNDEAD: return effect_monster_control_undead(player_ptr, em_ptr); - case GF_CONTROL_DEMON: + case AttributeType::CONTROL_DEMON: return effect_monster_control_demon(player_ptr, em_ptr); - case GF_CONTROL_ANIMAL: + case AttributeType::CONTROL_ANIMAL: return effect_monster_control_animal(player_ptr, em_ptr); - case GF_CHARM_LIVING: + case AttributeType::CHARM_LIVING: return effect_monster_charm_living(player_ptr, em_ptr); - case GF_OLD_CONF: + case AttributeType::OLD_CONF: return effect_monster_old_conf(player_ptr, em_ptr); - case GF_STUN: + case AttributeType::STUN: return effect_monster_stun(em_ptr); - case GF_LITE_WEAK: + case AttributeType::LITE_WEAK: return effect_monster_lite_weak(player_ptr, em_ptr); - case GF_LITE: + case AttributeType::LITE: return effect_monster_lite(player_ptr, em_ptr); - case GF_DARK: + case AttributeType::DARK: return effect_monster_dark(player_ptr, em_ptr); - case GF_KILL_WALL: + case AttributeType::KILL_WALL: return effect_monster_kill_wall(player_ptr, em_ptr); - case GF_AWAY_UNDEAD: + case AttributeType::AWAY_UNDEAD: return effect_monster_away_undead(player_ptr, em_ptr); - case GF_AWAY_EVIL: + case AttributeType::AWAY_EVIL: return effect_monster_away_evil(player_ptr, em_ptr); - case GF_AWAY_ALL: + case AttributeType::AWAY_ALL: return effect_monster_away_all(player_ptr, em_ptr); - case GF_TURN_UNDEAD: + case AttributeType::TURN_UNDEAD: return effect_monster_turn_undead(player_ptr, em_ptr); - case GF_TURN_EVIL: + case AttributeType::TURN_EVIL: return effect_monster_turn_evil(player_ptr, em_ptr); - case GF_TURN_ALL: + case AttributeType::TURN_ALL: return effect_monster_turn_all(em_ptr); - case GF_DISP_UNDEAD: + case AttributeType::DISP_UNDEAD: return effect_monster_disp_undead(player_ptr, em_ptr); - case GF_DISP_EVIL: + case AttributeType::DISP_EVIL: return effect_monster_disp_evil(player_ptr, em_ptr); - case GF_DISP_GOOD: + case AttributeType::DISP_GOOD: return effect_monster_disp_good(player_ptr, em_ptr); - case GF_DISP_LIVING: + case AttributeType::DISP_LIVING: return effect_monster_disp_living(em_ptr); - case GF_DISP_DEMON: + case AttributeType::DISP_DEMON: return effect_monster_disp_demon(player_ptr, em_ptr); - case GF_DISP_ALL: + case AttributeType::DISP_ALL: return effect_monster_disp_all(em_ptr); - case GF_DRAIN_MANA: + case AttributeType::DRAIN_MANA: return effect_monster_drain_mana(player_ptr, em_ptr); - case GF_MIND_BLAST: + case AttributeType::MIND_BLAST: return effect_monster_mind_blast(player_ptr, em_ptr); - case GF_BRAIN_SMASH: + case AttributeType::BRAIN_SMASH: return effect_monster_brain_smash(player_ptr, em_ptr); - case GF_CAUSE_1: + case AttributeType::CAUSE_1: return effect_monster_curse_1(em_ptr); - case GF_CAUSE_2: + case AttributeType::CAUSE_2: return effect_monster_curse_2(em_ptr); - case GF_CAUSE_3: + case AttributeType::CAUSE_3: return effect_monster_curse_3(em_ptr); - case GF_CAUSE_4: + case AttributeType::CAUSE_4: return effect_monster_curse_4(em_ptr); - case GF_HAND_DOOM: + case AttributeType::HAND_DOOM: return effect_monster_hand_doom(em_ptr); - case GF_CAPTURE: + case AttributeType::CAPTURE: return effect_monster_capture(player_ptr, em_ptr); - case GF_ATTACK: + case AttributeType::ATTACK: return (process_result)do_cmd_attack(player_ptr, em_ptr->y, em_ptr->x, i2enum(em_ptr->dam)); - case GF_ENGETSU: + case AttributeType::ENGETSU: return effect_monster_engetsu(player_ptr, em_ptr); - case GF_GENOCIDE: + case AttributeType::GENOCIDE: return effect_monster_genocide(player_ptr, em_ptr); - case GF_PHOTO: + case AttributeType::PHOTO: return effect_monster_photo(player_ptr, em_ptr); - case GF_CRUSADE: + case AttributeType::CRUSADE: return effect_monster_crusade(player_ptr, em_ptr); - case GF_WOUNDS: + case AttributeType::WOUNDS: return effect_monster_wounds(em_ptr); - case GF_E_GENOCIDE: + case AttributeType::E_GENOCIDE: return effect_monster_elemental_genocide(player_ptr, em_ptr); - case GF_VOID: + case AttributeType::VOID_MAGIC: return effect_monster_void(player_ptr, em_ptr); - case GF_ABYSS: + case AttributeType::ABYSS: return effect_monster_abyss(player_ptr, em_ptr); default: { em_ptr->skipped = true; diff --git a/src/effect/effect-monster-util.cpp b/src/effect/effect-monster-util.cpp index e6d3ad81c..4d287a512 100644 --- a/src/effect/effect-monster-util.cpp +++ b/src/effect/effect-monster-util.cpp @@ -24,18 +24,18 @@ * @param y 目標y座標 / Target y location (or location to travel "towards") * @param x 目標x座標 / Target x location (or location to travel "towards") * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player) - * @param effect_type 効果属性 / Type of damage to apply to monsters (and objects) + * @param attribute 効果属性 / Type of damage to apply to monsters (and objects) * @param flag 効果フラグ * @param see_s_msg TRUEならばメッセージを表示する */ -static void substitute_effect_monster(effect_monster_type *em_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID effect_type, BIT_FLAGS flag, bool see_s_msg) +static void substitute_effect_monster(effect_monster_type *em_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, AttributeType attribute, BIT_FLAGS flag, bool see_s_msg) { em_ptr->who = who; em_ptr->r = r; em_ptr->y = y; em_ptr->x = x; em_ptr->dam = dam; - em_ptr->effect_type = effect_type; + em_ptr->attribute = attribute; em_ptr->flag = flag; em_ptr->see_s_msg = see_s_msg; } @@ -50,13 +50,13 @@ static void substitute_effect_monster(effect_monster_type *em_ptr, MONSTER_IDX w * @param y 目標y座標 / Target y location (or location to travel "towards") * @param x 目標x座標 / Target x location (or location to travel "towards") * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player) - * @param effect_type 効果属性 / Type of damage to apply to monsters (and objects) + * @param attribute 効果属性 / Type of damage to apply to monsters (and objects) * @param flag 効果フラグ * @param see_s_msg TRUEならばメッセージを表示する */ -effect_monster_type *initialize_effect_monster(player_type *player_ptr, effect_monster_type *em_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID effect_type, BIT_FLAGS flag, bool see_s_msg) +effect_monster_type *initialize_effect_monster(player_type *player_ptr, effect_monster_type *em_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, AttributeType attribute, BIT_FLAGS flag, bool see_s_msg) { - substitute_effect_monster(em_ptr, who, r, y, x, dam, effect_type, flag, see_s_msg); + substitute_effect_monster(em_ptr, who, r, y, x, dam, attribute, flag, see_s_msg); floor_type *floor_ptr = player_ptr->current_floor_ptr; em_ptr->g_ptr = &floor_ptr->grid_array[em_ptr->y][em_ptr->x]; diff --git a/src/effect/effect-monster-util.h b/src/effect/effect-monster-util.h index dd794d826..fccfc496f 100644 --- a/src/effect/effect-monster-util.h +++ b/src/effect/effect-monster-util.h @@ -1,7 +1,7 @@ #pragma once #include "system/angband.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" struct grid_type;; struct monster_type; @@ -39,11 +39,11 @@ typedef struct effect_monster_type { POSITION y; POSITION x; HIT_POINT dam; - EFFECT_ID effect_type; + AttributeType attribute; BIT_FLAGS flag; bool see_s_msg; } effect_monster_type; struct player_type; effect_monster_type *initialize_effect_monster(player_type *player_ptr, effect_monster_type *em_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, - HIT_POINT dam, EFFECT_ID effect_type, BIT_FLAGS flag, bool see_s_msg); + HIT_POINT dam, AttributeType attribute, BIT_FLAGS flag, bool see_s_msg); diff --git a/src/effect/effect-monster.cpp b/src/effect/effect-monster.cpp index 742f80033..59557248b 100644 --- a/src/effect/effect-monster.cpp +++ b/src/effect/effect-monster.cpp @@ -41,7 +41,7 @@ #include "spell-kind/blood-curse.h" #include "spell-kind/spells-polymorph.h" #include "spell-kind/spells-teleport.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spells-effect-util.h" #include "sv-definition/sv-other-types.h" #include "system/floor-type-definition.h" @@ -72,18 +72,18 @@ static process_result is_affective(player_type *player_ptr, effect_monster_type if (em_ptr->who || em_ptr->g_ptr->m_idx != player_ptr->riding) return PROCESS_TRUE; - switch (em_ptr->effect_type) { - case GF_OLD_HEAL: - case GF_OLD_SPEED: - case GF_STAR_HEAL: + switch (em_ptr->attribute) { + case AttributeType::OLD_HEAL: + case AttributeType::OLD_SPEED: + case AttributeType::STAR_HEAL: return PROCESS_TRUE; - case GF_OLD_SLOW: - case GF_OLD_SLEEP: - case GF_OLD_CLONE: - case GF_OLD_CONF: - case GF_OLD_POLY: - case GF_GENOCIDE: - case GF_E_GENOCIDE: + case AttributeType::OLD_SLOW: + case AttributeType::OLD_SLEEP: + case AttributeType::OLD_CLONE: + case AttributeType::OLD_CONF: + case AttributeType::OLD_POLY: + case AttributeType::GENOCIDE: + case AttributeType::E_GENOCIDE: return PROCESS_CONTINUE; default: break; @@ -124,11 +124,12 @@ static process_result exe_affect_monster_by_effect(player_type *player_ptr, effe return result; } - if (none_bits(em_ptr->r_ptr->flagsr, RFR_RES_ALL) || em_ptr->effect_type == GF_OLD_CLONE || em_ptr->effect_type == GF_STAR_HEAL - || em_ptr->effect_type == GF_OLD_HEAL || em_ptr->effect_type == GF_OLD_SPEED || em_ptr->effect_type == GF_CAPTURE || em_ptr->effect_type == GF_PHOTO) + if (none_bits(em_ptr->r_ptr->flagsr, RFR_RES_ALL) || em_ptr->attribute == AttributeType::OLD_CLONE + || em_ptr->attribute == AttributeType::STAR_HEAL || em_ptr->attribute == AttributeType::OLD_HEAL || em_ptr->attribute == AttributeType::OLD_SPEED + || em_ptr->attribute == AttributeType::CAPTURE || em_ptr->attribute == AttributeType::PHOTO) return switch_effects_monster(player_ptr, em_ptr); - if (any_bits(em_ptr->r_ptr->flagsr, RFR_RES_ALL) && (em_ptr->effect_type == GF_ARROW)) + if (any_bits(em_ptr->r_ptr->flagsr, RFR_RES_ALL) && (em_ptr->attribute == AttributeType::ARROW)) return switch_effects_monster(player_ptr, em_ptr); em_ptr->note = _("には完全な耐性がある!", " is immune."); @@ -136,7 +137,7 @@ static process_result exe_affect_monster_by_effect(player_type *player_ptr, effe if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) em_ptr->r_ptr->r_flagsr |= (RFR_RES_ALL); - if (em_ptr->effect_type == GF_LITE_WEAK || em_ptr->effect_type == GF_KILL_WALL) + if (em_ptr->attribute == AttributeType::LITE_WEAK || em_ptr->attribute == AttributeType::KILL_WALL) em_ptr->skipped = true; return PROCESS_CONTINUE; @@ -161,7 +162,7 @@ static void effect_damage_killed_pet(player_type *player_ptr, effect_monster_typ if (em_ptr->who > 0) monster_gain_exp(player_ptr, em_ptr->who, em_ptr->m_ptr->r_idx); - monster_death(player_ptr, em_ptr->g_ptr->m_idx, false, em_ptr->effect_type); + monster_death(player_ptr, em_ptr->g_ptr->m_idx, false, em_ptr->attribute); delete_monster_idx(player_ptr, em_ptr->g_ptr->m_idx); if (sad) msg_print(_("少し悲しい気分がした。", "You feel sad for a moment.")); @@ -248,7 +249,7 @@ static bool heal_leaper(player_type *player_ptr, effect_monster_type *em_ptr) static bool deal_effect_damage_from_player(player_type *player_ptr, effect_monster_type *em_ptr) { bool fear = false; - MonsterDamageProcessor mdp(player_ptr, em_ptr->g_ptr->m_idx, em_ptr->dam, &fear, em_ptr->effect_type); + MonsterDamageProcessor mdp(player_ptr, em_ptr->g_ptr->m_idx, em_ptr->dam, &fear, em_ptr->attribute); if (mdp.mon_take_hit(em_ptr->note_dies)) return true; @@ -284,7 +285,7 @@ static bool deal_effect_damage_from_player(player_type *player_ptr, effect_monst */ static void deal_effect_damage_to_monster(player_type *player_ptr, effect_monster_type *em_ptr) { - if (em_ptr->effect_type == GF_DRAIN_MANA) + if (em_ptr->attribute == AttributeType::DRAIN_MANA) return; // モンスターによる効果 @@ -327,8 +328,7 @@ static void affected_monster_prevents_bad_status(player_type *player_ptr, effect if ((em_ptr->r_ptr->flags1 & RF1_UNIQUE) || (em_ptr->r_ptr->flags1 & RF1_QUESTOR) || (player_ptr->riding && (em_ptr->g_ptr->m_idx == player_ptr->riding))) em_ptr->do_polymorph = false; - if (((em_ptr->r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (em_ptr->r_ptr->flags7 & RF7_NAZGUL)) && !player_ptr->phase_out && (em_ptr->who > 0) - && (em_ptr->dam > em_ptr->m_ptr->hp)) + if (((em_ptr->r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (em_ptr->r_ptr->flags7 & RF7_NAZGUL)) && !player_ptr->phase_out && (em_ptr->who > 0) && (em_ptr->dam > em_ptr->m_ptr->hp)) em_ptr->dam = em_ptr->m_ptr->hp; } @@ -489,7 +489,7 @@ static void effect_damage_makes_teleport(player_type *player_ptr, effect_monster static void effect_damage_gives_bad_status(player_type *player_ptr, effect_monster_type *em_ptr) { int tmp_damage = em_ptr->dam; - em_ptr->dam = mon_damage_mod(player_ptr, em_ptr->m_ptr, em_ptr->dam, (bool)(em_ptr->effect_type == GF_PSY_SPEAR)); + em_ptr->dam = mon_damage_mod(player_ptr, em_ptr->m_ptr, em_ptr->dam, (bool)(em_ptr->attribute == AttributeType::PSY_SPEAR)); if ((tmp_damage > 0) && (em_ptr->dam == 0) && em_ptr->seen) em_ptr->note = _("はダメージを受けていない。", " is unharmed."); @@ -523,7 +523,7 @@ static void exe_affect_monster_by_damage(player_type *player_ptr, effect_monster affected_monster_prevents_bad_status(player_ptr, em_ptr); effect_damage_gives_bad_status(player_ptr, em_ptr); deal_effect_damage_to_monster(player_ptr, em_ptr); - if ((em_ptr->effect_type == GF_BLOOD_CURSE) && one_in_(4)) + if ((em_ptr->attribute == AttributeType::BLOOD_CURSE) && one_in_(4)) blood_curse_to_enemy(player_ptr, em_ptr->who); } @@ -622,7 +622,7 @@ static void exe_affect_monster_postprocess(player_type *player_ptr, effect_monst * @param y 目標y座標 / Target y location (or location to travel "towards") * @param x 目標x座標 / Target x location (or location to travel "towards") * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player) - * @param effect_type 効果属性 / Type of damage to apply to monsters (and objects) + * @param attribute 効果属性 / Type of damage to apply to monsters (and objects) * @param flag 効果フラグ * @param see_s_msg TRUEならばメッセージを表示する * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE @@ -633,10 +633,10 @@ static void exe_affect_monster_postprocess(player_type *player_ptr, effect_monst * 3.ペット及び撮影による事後効果 */ bool affect_monster( - player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID effect_type, BIT_FLAGS flag, bool see_s_msg) + player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, AttributeType attribute, BIT_FLAGS flag, bool see_s_msg) { effect_monster_type tmp_effect; - effect_monster_type *em_ptr = initialize_effect_monster(player_ptr, &tmp_effect, who, r, y, x, dam, effect_type, flag, see_s_msg); + effect_monster_type *em_ptr = initialize_effect_monster(player_ptr, &tmp_effect, who, r, y, x, dam, attribute, flag, see_s_msg); make_description_of_affecred_monster(player_ptr, em_ptr); diff --git a/src/effect/effect-monster.h b/src/effect/effect-monster.h index 1390c313b..7ff36db2b 100644 --- a/src/effect/effect-monster.h +++ b/src/effect/effect-monster.h @@ -1,7 +1,7 @@ #pragma once #include "system/angband.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" struct player_type; -bool affect_monster(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ, BIT_FLAGS flag, bool see_s_msg); +bool affect_monster(player_type *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, AttributeType typ, BIT_FLAGS flag, bool see_s_msg); diff --git a/src/effect/effect-player-switcher.cpp b/src/effect/effect-player-switcher.cpp index dd32ad007..388d93bd4 100644 --- a/src/effect/effect-player-switcher.cpp +++ b/src/effect/effect-player-switcher.cpp @@ -5,7 +5,7 @@ #include "effect/effect-player-spirit.h" #include "effect/effect-player-util.h" #include "player/player-damage.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/player-type-definition.h" /*! @@ -16,139 +16,139 @@ */ void switch_effects_player(player_type *player_ptr, effect_player_type *ep_ptr) { - switch (ep_ptr->effect_type) { - case GF_ACID: + switch (ep_ptr->attribute) { + case AttributeType::ACID: effect_player_elements(player_ptr, ep_ptr, _("酸で攻撃された!", "You are hit by acid!"), acid_dam); return; - case GF_FIRE: + case AttributeType::FIRE: effect_player_elements(player_ptr, ep_ptr, _("火炎で攻撃された!", "You are hit by fire!"), fire_dam); return; - case GF_COLD: + case AttributeType::COLD: effect_player_elements(player_ptr, ep_ptr, _("冷気で攻撃された!", "You are hit by cold!"), cold_dam); return; - case GF_ELEC: + case AttributeType::ELEC: effect_player_elements(player_ptr, ep_ptr, _("電撃で攻撃された!", "You are hit by lightning!"), elec_dam); return; - case GF_POIS: + case AttributeType::POIS: effect_player_poison(player_ptr, ep_ptr); return; - case GF_NUKE: + case AttributeType::NUKE: effect_player_nuke(player_ptr, ep_ptr); return; - case GF_MISSILE: + case AttributeType::MISSILE: effect_player_missile(player_ptr, ep_ptr); return; - case GF_HOLY_FIRE: + case AttributeType::HOLY_FIRE: effect_player_holy_fire(player_ptr, ep_ptr); return; - case GF_HELL_FIRE: + case AttributeType::HELL_FIRE: effect_player_hell_fire(player_ptr, ep_ptr); return; - case GF_ARROW: + case AttributeType::ARROW: effect_player_arrow(player_ptr, ep_ptr); return; - case GF_PLASMA: + case AttributeType::PLASMA: effect_player_plasma(player_ptr, ep_ptr); return; - case GF_NETHER: + case AttributeType::NETHER: effect_player_nether(player_ptr, ep_ptr); return; - case GF_WATER: + case AttributeType::WATER: effect_player_water(player_ptr, ep_ptr); return; - case GF_CHAOS: + case AttributeType::CHAOS: effect_player_chaos(player_ptr, ep_ptr); return; - case GF_SHARDS: + case AttributeType::SHARDS: effect_player_shards(player_ptr, ep_ptr); return; - case GF_SOUND: + case AttributeType::SOUND: effect_player_sound(player_ptr, ep_ptr); return; - case GF_CONFUSION: + case AttributeType::CONFUSION: effect_player_confusion(player_ptr, ep_ptr); return; - case GF_DISENCHANT: + case AttributeType::DISENCHANT: effect_player_disenchant(player_ptr, ep_ptr); return; - case GF_NEXUS: + case AttributeType::NEXUS: effect_player_nexus(player_ptr, ep_ptr); return; - case GF_FORCE: + case AttributeType::FORCE: effect_player_force(player_ptr, ep_ptr); return; - case GF_ROCKET: + case AttributeType::ROCKET: effect_player_rocket(player_ptr, ep_ptr); return; - case GF_INERTIAL: + case AttributeType::INERTIAL: effect_player_inertial(player_ptr, ep_ptr); return; - case GF_LITE: + case AttributeType::LITE: effect_player_lite(player_ptr, ep_ptr); return; - case GF_DARK: + case AttributeType::DARK: effect_player_dark(player_ptr, ep_ptr); return; - case GF_TIME: + case AttributeType::TIME: effect_player_time(player_ptr, ep_ptr); return; - case GF_GRAVITY: + case AttributeType::GRAVITY: effect_player_gravity(player_ptr, ep_ptr); return; - case GF_DISINTEGRATE: + case AttributeType::DISINTEGRATE: effect_player_disintegration(player_ptr, ep_ptr); return; - case GF_OLD_HEAL: + case AttributeType::OLD_HEAL: effect_player_old_heal(player_ptr, ep_ptr); return; - case GF_OLD_SPEED: + case AttributeType::OLD_SPEED: effect_player_old_speed(player_ptr, ep_ptr); return; - case GF_OLD_SLOW: + case AttributeType::OLD_SLOW: effect_player_old_slow(player_ptr); return; - case GF_OLD_SLEEP: + case AttributeType::OLD_SLEEP: effect_player_old_sleep(player_ptr, ep_ptr); return; - case GF_MANA: - case GF_SEEKER: - case GF_SUPER_RAY: + case AttributeType::MANA: + case AttributeType::SEEKER: + case AttributeType::SUPER_RAY: effect_player_mana(player_ptr, ep_ptr); return; - case GF_PSY_SPEAR: + case AttributeType::PSY_SPEAR: effect_player_psy_spear(player_ptr, ep_ptr); return; - case GF_METEOR: + case AttributeType::METEOR: effect_player_meteor(player_ptr, ep_ptr); return; - case GF_ICE: + case AttributeType::ICE: effect_player_icee(player_ptr, ep_ptr); return; - case GF_DEATH_RAY: + case AttributeType::DEATH_RAY: effect_player_death_ray(player_ptr, ep_ptr); return; - case GF_DRAIN_MANA: + case AttributeType::DRAIN_MANA: effect_player_drain_mana(player_ptr, ep_ptr); return; - case GF_MIND_BLAST: + case AttributeType::MIND_BLAST: effect_player_mind_blast(player_ptr, ep_ptr); return; - case GF_BRAIN_SMASH: + case AttributeType::BRAIN_SMASH: effect_player_brain_smash(player_ptr, ep_ptr); return; - case GF_CAUSE_1: + case AttributeType::CAUSE_1: effect_player_curse_1(player_ptr, ep_ptr); return; - case GF_CAUSE_2: + case AttributeType::CAUSE_2: effect_player_curse_2(player_ptr, ep_ptr); return; - case GF_CAUSE_3: + case AttributeType::CAUSE_3: effect_player_curse_3(player_ptr, ep_ptr); return; - case GF_CAUSE_4: + case AttributeType::CAUSE_4: effect_player_curse_4(player_ptr, ep_ptr); return; - case GF_HAND_DOOM: + case AttributeType::HAND_DOOM: effect_player_hand_doom(player_ptr, ep_ptr); return; default: { diff --git a/src/effect/effect-player-util.h b/src/effect/effect-player-util.h index cfaaccb10..6f89aa7be 100644 --- a/src/effect/effect-player-util.h +++ b/src/effect/effect-player-util.h @@ -1,6 +1,7 @@ #pragma once #include "system/angband.h" +#include "effect/attribute-types.h" struct monster_type; typedef struct effect_player_type { @@ -12,6 +13,6 @@ typedef struct effect_player_type { MONSTER_IDX who; HIT_POINT dam; - EFFECT_ID effect_type; + AttributeType attribute; BIT_FLAGS flag; } effect_player_type; diff --git a/src/effect/effect-player.cpp b/src/effect/effect-player.cpp index daf2be9de..73112fdea 100644 --- a/src/effect/effect-player.cpp +++ b/src/effect/effect-player.cpp @@ -25,7 +25,7 @@ #include "realm/realm-hex-numbers.h" #include "spell-realm/spells-crusade.h" #include "spell-realm/spells-hex.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell/spells-util.h" #include "system/floor-type-definition.h" #include "system/monster-race-definition.h" @@ -41,19 +41,19 @@ * @param ep_ptr 初期化前の構造体 * @param who 魔法を唱えたモンスター (0ならプレイヤー自身) * @param dam 基本威力 - * @param effect_type 効果属性 + * @param attribute 効果属性 * @param flag 効果フラグ * @param monspell 効果元のモンスター魔法ID * @return 初期化後の構造体ポインタ */ -static effect_player_type *initialize_effect_player(effect_player_type *ep_ptr, MONSTER_IDX who, HIT_POINT dam, EFFECT_ID effect_type, BIT_FLAGS flag) +static effect_player_type *initialize_effect_player(effect_player_type *ep_ptr, MONSTER_IDX who, HIT_POINT dam, AttributeType attribute, BIT_FLAGS flag) { ep_ptr->rlev = 0; ep_ptr->m_ptr = nullptr; ep_ptr->get_damage = 0; ep_ptr->who = who; ep_ptr->dam = dam; - ep_ptr->effect_type = effect_type; + ep_ptr->attribute = attribute; ep_ptr->flag = flag; return ep_ptr; } @@ -106,7 +106,7 @@ static bool process_bolt_reflection(player_type *player_ptr, effect_player_type t_x = player_ptr->x - 1 + randint1(3); } - (*project)(player_ptr, 0, 0, t_y, t_x, ep_ptr->dam, ep_ptr->effect_type, (PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE)); + (*project)(player_ptr, 0, 0, t_y, t_x, ep_ptr->dam, ep_ptr->attribute, (PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE)); disturb(player_ptr, true, true); return true; } @@ -183,16 +183,16 @@ static void describe_effect_source(player_type *player_ptr, effect_player_type * * @param y 目標Y座標 / Target y location (or location to travel "towards") * @param x 目標X座標 / Target x location (or location to travel "towards") * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player) - * @param effect_type 効果属性 / Type of damage to apply to monsters (and objects) + * @param attribute 効果属性 / Type of damage to apply to monsters (and objects) * @param flag 効果フラグ * @param monspell 効果元のモンスター魔法ID * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE */ -bool affect_player(MONSTER_IDX who, player_type *player_ptr, concptr who_name, int r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID effect_type, +bool affect_player(MONSTER_IDX who, player_type *player_ptr, concptr who_name, int r, POSITION y, POSITION x, HIT_POINT dam, AttributeType attribute, BIT_FLAGS flag, project_func project) { effect_player_type tmp_effect; - auto *ep_ptr = initialize_effect_player(&tmp_effect, who, dam, effect_type, flag); + auto *ep_ptr = initialize_effect_player(&tmp_effect, who, dam, attribute, flag); auto check_result = check_continue_player_effect(player_ptr, ep_ptr, y, x, project); if (check_result != PROCESS_CONTINUE) { return check_result == PROCESS_TRUE; @@ -211,7 +211,7 @@ bool affect_player(MONSTER_IDX who, player_type *player_ptr, concptr who_name, i GAME_TEXT m_name_self[MAX_MONSTER_NAME]; monster_desc(player_ptr, m_name_self, ep_ptr->m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE); msg_format(_("攻撃が%s自身を傷つけた!", "The attack of %s has wounded %s!"), ep_ptr->m_name, m_name_self); - (*project)(player_ptr, 0, 0, ep_ptr->m_ptr->fy, ep_ptr->m_ptr->fx, ep_ptr->get_damage, GF_MISSILE, PROJECT_KILL); + (*project)(player_ptr, 0, 0, ep_ptr->m_ptr->fy, ep_ptr->m_ptr->fx, ep_ptr->get_damage, AttributeType::MISSILE, PROJECT_KILL); if (player_ptr->tim_eyeeye) { set_tim_eyeeye(player_ptr, player_ptr->tim_eyeeye - 5, true); } diff --git a/src/effect/effect-player.h b/src/effect/effect-player.h index 1d8daa84c..866ce6399 100644 --- a/src/effect/effect-player.h +++ b/src/effect/effect-player.h @@ -1,12 +1,13 @@ #pragma once #include "system/angband.h" +#include "effect/attribute-types.h" struct ProjectResult; struct player_type; using project_func = ProjectResult (*)( - player_type *player_ptr, MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ, BIT_FLAGS flag); + player_type *player_ptr, MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, HIT_POINT dam, AttributeType typ, BIT_FLAGS flag); -bool affect_player(MONSTER_IDX who, player_type *player_ptr, concptr who_name, int r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ, BIT_FLAGS flag, +bool affect_player(MONSTER_IDX who, player_type *player_ptr, concptr who_name, int r, POSITION y, POSITION x, HIT_POINT dam, AttributeType typ, BIT_FLAGS flag, project_func project); diff --git a/src/effect/effect-processor.cpp b/src/effect/effect-processor.cpp index f92a48bcf..0c288d8d2 100644 --- a/src/effect/effect-processor.cpp +++ b/src/effect/effect-processor.cpp @@ -1,5 +1,6 @@ #include "effect/effect-processor.h" #include "core/stuff-handler.h" +#include "effect/attribute-types.h" #include "effect/effect-characteristics.h" #include "effect/effect-feature.h" #include "effect/effect-item.h" @@ -26,7 +27,6 @@ #include "pet/pet-fall-off.h" #include "player/player-status.h" #include "spell/range-calc.h" -#include "spell/spell-types.h" #include "system/floor-type-definition.h" #include "system/grid-type-definition.h" #include "system/monster-race-definition.h" @@ -87,8 +87,8 @@ static void next_mirror(player_type *player_ptr, POSITION *next_y, POSITION *nex * @todo 似たような処理が山ほど並んでいる、何とかならないものか * @todo 引数にそのまま再代入していてカオスすぎる。直すのは簡単ではない */ -ProjectResult project(player_type *player_ptr, const MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, const HIT_POINT dam, const EFFECT_ID typ, - BIT_FLAGS flag) +ProjectResult project(player_type *player_ptr, const MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, const HIT_POINT dam, + const AttributeType typ, BIT_FLAGS flag) { int dist; POSITION y1; @@ -169,23 +169,25 @@ ProjectResult project(player_type *player_ptr, const MONSTER_IDX who, POSITION r } switch (typ) { - case GF_LITE: - case GF_LITE_WEAK: + case AttributeType::LITE: + case AttributeType::LITE_WEAK: if (breath || (flag & PROJECT_BEAM)) flag |= (PROJECT_LOS); break; - case GF_DISINTEGRATE: + case AttributeType::DISINTEGRATE: flag |= (PROJECT_GRID); if (breath || (flag & PROJECT_BEAM)) flag |= (PROJECT_DISI); break; + default: + break; } /* Calculate the projection path */ path_n = projection_path(player_ptr, path_g, (project_length ? project_length : get_max_range(player_ptr)), y1, x1, y2, x2, flag); handle_stuff(player_ptr); - if (typ == GF_SEEKER) { + if (typ == AttributeType::SEEKER) { int j; int last_i = 0; project_m_n = 0; @@ -228,7 +230,7 @@ ProjectResult project(player_type *player_ptr, const MONSTER_IDX who, POSITION r } } - if (affect_item(player_ptr, 0, 0, y, x, dam, GF_SEEKER)) + if (affect_item(player_ptr, 0, 0, y, x, dam, AttributeType::SEEKER)) res.notice = true; if (!player_ptr->current_floor_ptr->grid_array[y][x].is_mirror()) continue; @@ -241,7 +243,7 @@ ProjectResult project(player_type *player_ptr, const MONSTER_IDX who, POSITION r for (j = last_i; j <= i; j++) { y = get_grid_y(path_g[j]); x = get_grid_x(path_g[j]); - if (affect_monster(player_ptr, 0, 0, y, x, dam, GF_SEEKER, flag, true)) + if (affect_monster(player_ptr, 0, 0, y, x, dam, AttributeType::SEEKER, flag, true)) res.notice = true; if (!who && (project_m_n == 1) && !jump && (player_ptr->current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx > 0)) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[player_ptr->current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx]; @@ -252,7 +254,7 @@ ProjectResult project(player_type *player_ptr, const MONSTER_IDX who, POSITION r } } - (void)affect_feature(player_ptr, 0, 0, y, x, dam, GF_SEEKER); + (void)affect_feature(player_ptr, 0, 0, y, x, dam, AttributeType::SEEKER); } last_i = i; @@ -262,7 +264,7 @@ ProjectResult project(player_type *player_ptr, const MONSTER_IDX who, POSITION r POSITION py, px; py = get_grid_y(path_g[i]); px = get_grid_x(path_g[i]); - if (affect_monster(player_ptr, 0, 0, py, px, dam, GF_SEEKER, flag, true)) + if (affect_monster(player_ptr, 0, 0, py, px, dam, AttributeType::SEEKER, flag, true)) res.notice = true; if (!who && (project_m_n == 1) && !jump) { if (player_ptr->current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx > 0) { @@ -276,11 +278,11 @@ ProjectResult project(player_type *player_ptr, const MONSTER_IDX who, POSITION r } } - (void)affect_feature(player_ptr, 0, 0, py, px, dam, GF_SEEKER); + (void)affect_feature(player_ptr, 0, 0, py, px, dam, AttributeType::SEEKER); } return res; - } else if (typ == GF_SUPER_RAY) { + } else if (typ == AttributeType::SUPER_RAY) { int j; int second_step = 0; project_m_n = 0; @@ -325,7 +327,7 @@ ProjectResult project(player_type *player_ptr, const MONSTER_IDX who, POSITION r } } - if (affect_item(player_ptr, 0, 0, y, x, dam, GF_SUPER_RAY)) + if (affect_item(player_ptr, 0, 0, y, x, dam, AttributeType::SUPER_RAY)) res.notice = true; if (!cave_has_flag_bold(player_ptr->current_floor_ptr, y, x, FF::PROJECT)) { if (second_step) @@ -340,25 +342,21 @@ ProjectResult project(player_type *player_ptr, const MONSTER_IDX who, POSITION r for (j = 0; j <= i; j++) { y = get_grid_y(path_g[j]); x = get_grid_x(path_g[j]); - (void)affect_feature(player_ptr, 0, 0, y, x, dam, GF_SUPER_RAY); + (void)affect_feature(player_ptr, 0, 0, y, x, dam, AttributeType::SUPER_RAY); } path_n = i; second_step = i + 1; path_n += projection_path( player_ptr, &(path_g[path_n + 1]), (project_length ? project_length : get_max_range(player_ptr)), y, x, y - 1, x - 1, flag); - path_n - += projection_path(player_ptr, &(path_g[path_n + 1]), (project_length ? project_length : get_max_range(player_ptr)), y, x, y - 1, x, flag); + path_n += projection_path(player_ptr, &(path_g[path_n + 1]), (project_length ? project_length : get_max_range(player_ptr)), y, x, y - 1, x, flag); path_n += projection_path( player_ptr, &(path_g[path_n + 1]), (project_length ? project_length : get_max_range(player_ptr)), y, x, y - 1, x + 1, flag); - path_n - += projection_path(player_ptr, &(path_g[path_n + 1]), (project_length ? project_length : get_max_range(player_ptr)), y, x, y, x - 1, flag); - path_n - += projection_path(player_ptr, &(path_g[path_n + 1]), (project_length ? project_length : get_max_range(player_ptr)), y, x, y, x + 1, flag); + path_n += projection_path(player_ptr, &(path_g[path_n + 1]), (project_length ? project_length : get_max_range(player_ptr)), y, x, y, x - 1, flag); + path_n += projection_path(player_ptr, &(path_g[path_n + 1]), (project_length ? project_length : get_max_range(player_ptr)), y, x, y, x + 1, flag); path_n += projection_path( player_ptr, &(path_g[path_n + 1]), (project_length ? project_length : get_max_range(player_ptr)), y, x, y + 1, x - 1, flag); - path_n - += projection_path(player_ptr, &(path_g[path_n + 1]), (project_length ? project_length : get_max_range(player_ptr)), y, x, y + 1, x, flag); + path_n += projection_path(player_ptr, &(path_g[path_n + 1]), (project_length ? project_length : get_max_range(player_ptr)), y, x, y + 1, x, flag); path_n += projection_path( player_ptr, &(path_g[path_n + 1]), (project_length ? project_length : get_max_range(player_ptr)), y, x, y + 1, x + 1, flag); } @@ -367,7 +365,7 @@ ProjectResult project(player_type *player_ptr, const MONSTER_IDX who, POSITION r for (int i = 0; i < path_n; i++) { POSITION py = get_grid_y(path_g[i]); POSITION px = get_grid_x(path_g[i]); - (void)affect_monster(player_ptr, 0, 0, py, px, dam, GF_SUPER_RAY, flag, true); + (void)affect_monster(player_ptr, 0, 0, py, px, dam, AttributeType::SUPER_RAY, flag, true); if (!who && (project_m_n == 1) && !jump) { if (player_ptr->current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx > 0) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[player_ptr->current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx]; @@ -380,7 +378,7 @@ ProjectResult project(player_type *player_ptr, const MONSTER_IDX who, POSITION r } } - (void)affect_feature(player_ptr, 0, 0, py, px, dam, GF_SUPER_RAY); + (void)affect_feature(player_ptr, 0, 0, py, px, dam, AttributeType::SUPER_RAY); } return res; @@ -485,12 +483,12 @@ ProjectResult project(player_type *player_ptr, const MONSTER_IDX who, POSITION r continue; switch (typ) { - case GF_LITE: - case GF_LITE_WEAK: + case AttributeType::LITE: + case AttributeType::LITE_WEAK: if (!los(player_ptr, by, bx, y, x)) continue; break; - case GF_DISINTEGRATE: + case AttributeType::DISINTEGRATE: if (!in_disintegration_range(player_ptr->current_floor_ptr, by, bx, y, x)) continue; break; @@ -612,9 +610,7 @@ ProjectResult project(player_type *player_ptr, const MONSTER_IDX who, POSITION r if (grids <= 1) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[player_ptr->current_floor_ptr->grid_array[y][x].m_idx]; monster_race *ref_ptr = &r_info[m_ptr->r_idx]; - if ((flag & PROJECT_REFLECTABLE) && player_ptr->current_floor_ptr->grid_array[y][x].m_idx && (ref_ptr->flags2 & RF2_REFLECTING) - && ((player_ptr->current_floor_ptr->grid_array[y][x].m_idx != player_ptr->riding) || !(flag & PROJECT_PLAYER)) && (!who || dist_hack > 1) - && !one_in_(10)) { + if ((flag & PROJECT_REFLECTABLE) && player_ptr->current_floor_ptr->grid_array[y][x].m_idx && (ref_ptr->flags2 & RF2_REFLECTING) && ((player_ptr->current_floor_ptr->grid_array[y][x].m_idx != player_ptr->riding) || !(flag & PROJECT_PLAYER)) && (!who || dist_hack > 1) && !one_in_(10)) { POSITION t_y, t_x; int max_attempts = 10; do { diff --git a/src/effect/effect-processor.h b/src/effect/effect-processor.h index f51aae4c8..8418d3ae2 100644 --- a/src/effect/effect-processor.h +++ b/src/effect/effect-processor.h @@ -1,6 +1,7 @@ #pragma once #include "system/angband.h" +#include "effect/attribute-types.h" //! project() の結果。 struct ProjectResult { @@ -13,5 +14,5 @@ struct ProjectResult { struct effect_player_type; struct player_type; ProjectResult project( - player_type *player_ptr, const MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, const HIT_POINT dam, const EFFECT_ID typ, + player_type *player_ptr, const MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, const HIT_POINT dam, const AttributeType typ, BIT_FLAGS flag); diff --git a/src/floor/object-allocator.h b/src/floor/object-allocator.h index e67a5a107..0e6b54436 100644 --- a/src/floor/object-allocator.h +++ b/src/floor/object-allocator.h @@ -1,6 +1,7 @@ #pragma once #include "system/angband.h" +#include "effect/attribute-types.h" enum dap_type : int; struct player_type; diff --git a/src/grid/grid.cpp b/src/grid/grid.cpp index da936fd44..07424a848 100644 --- a/src/grid/grid.cpp +++ b/src/grid/grid.cpp @@ -45,7 +45,7 @@ #include "player/player-status-flags.h" #include "player/player-status.h" #include "room/rooms-builder.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/floor-type-definition.h" #include "system/grid-type-definition.h" #include "system/monster-race-definition.h" @@ -797,7 +797,7 @@ void cave_alter_feat(player_type *player_ptr, POSITION y, POSITION x, FF action) feature_type *old_f_ptr = &f_info[oldfeat]; if (old_f_ptr->flags.has(FF::GLASS) && w_ptr->character_dungeon) { - project(player_ptr, PROJECT_WHO_GLASS_SHARDS, 1, y, x, std::min(floor_ptr->dun_level, 100) / 4, GF_SHARDS, + project(player_ptr, PROJECT_WHO_GLASS_SHARDS, 1, y, x, std::min(floor_ptr->dun_level, 100) / 4, AttributeType::SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_HIDE | PROJECT_JUMP | PROJECT_NO_HANGEKI)); } } diff --git a/src/grid/trap.cpp b/src/grid/trap.cpp index 17ac55ed7..7f1140936 100644 --- a/src/grid/trap.cpp +++ b/src/grid/trap.cpp @@ -31,7 +31,7 @@ #include "spell-kind/spells-random.h" #include "spell-kind/spells-sight.h" #include "spell-kind/spells-teleport.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell/summon-types.h" #include "status/bad-status-setter.h" #include "status/base-status.h" @@ -539,7 +539,7 @@ void hit_trap(player_type *player_ptr, bool break_trap) case TRAP_TRAPS: { msg_print(_("まばゆい閃光が走った!", "There is a bright flash of light!")); /* Make some new traps */ - project(player_ptr, 0, 1, y, x, 0, GF_MAKE_TRAP, PROJECT_HIDE | PROJECT_JUMP | PROJECT_GRID); + project(player_ptr, 0, 1, y, x, 0, AttributeType::MAKE_TRAP, PROJECT_HIDE | PROJECT_JUMP | PROJECT_GRID); break; } @@ -554,9 +554,9 @@ void hit_trap(player_type *player_ptr, bool break_trap) case TRAP_OPEN: { msg_print(_("大音響と共にまわりの壁が崩れた!", "Suddenly, surrounding walls are opened!")); - (void)project(player_ptr, 0, 3, y, x, 0, GF_DISINTEGRATE, PROJECT_GRID | PROJECT_HIDE); - (void)project(player_ptr, 0, 3, y, x - 4, 0, GF_DISINTEGRATE, PROJECT_GRID | PROJECT_HIDE); - (void)project(player_ptr, 0, 3, y, x + 4, 0, GF_DISINTEGRATE, PROJECT_GRID | PROJECT_HIDE); + (void)project(player_ptr, 0, 3, y, x, 0, AttributeType::DISINTEGRATE, PROJECT_GRID | PROJECT_HIDE); + (void)project(player_ptr, 0, 3, y, x - 4, 0, AttributeType::DISINTEGRATE, PROJECT_GRID | PROJECT_HIDE); + (void)project(player_ptr, 0, 3, y, x + 4, 0, AttributeType::DISINTEGRATE, PROJECT_GRID | PROJECT_HIDE); aggravate_monsters(player_ptr, 0); break; @@ -609,7 +609,7 @@ void hit_trap(player_type *player_ptr, bool break_trap) msg_print(_("突然壁から水が溢れ出した!ピラニアがいる!", "Suddenly, the room is filled with water with piranhas!")); /* Water fills room */ - fire_ball_hide(player_ptr, GF_WATER_FLOW, 0, 1, 10); + fire_ball_hide(player_ptr, AttributeType::WATER_FLOW, 0, 1, 10); /* Summon Piranhas */ num = 1 + player_ptr->current_floor_ptr->dun_level / 20; diff --git a/src/io/gf-descriptions.cpp b/src/io/gf-descriptions.cpp index 42d84dc14..3b79271af 100644 --- a/src/io/gf-descriptions.cpp +++ b/src/io/gf-descriptions.cpp @@ -3,111 +3,111 @@ */ #include "gf-descriptions.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" -const named_num gf_desc[MAX_NAMED_NUM] = -{ - {"GF_ELEC", GF_ELEC }, - {"GF_POIS", GF_POIS }, - {"GF_ACID", GF_ACID }, - {"GF_COLD", GF_COLD }, - {"GF_FIRE", GF_FIRE }, - {"GF_PSY_SPEAR", GF_PSY_SPEAR }, - {"GF_MISSILE", GF_MISSILE }, - {"GF_ARROW", GF_ARROW }, - {"GF_PLASMA", GF_PLASMA }, - {"GF_WATER", GF_WATER }, - {"GF_LITE", GF_LITE }, - {"GF_DARK", GF_DARK }, - {"GF_LITE_WEAK", GF_LITE_WEAK }, - {"GF_DARK_WEAK", GF_DARK_WEAK }, - {"GF_SHARDS", GF_SHARDS }, - {"GF_SOUND", GF_SOUND }, - {"GF_CONFUSION", GF_CONFUSION }, - {"GF_FORCE", GF_FORCE }, - {"GF_INERTIA", GF_INERTIAL }, - {"GF_MANA", GF_MANA }, - {"GF_METEOR", GF_METEOR }, - {"GF_ICE", GF_ICE }, - {"GF_CHAOS", GF_CHAOS }, - {"GF_NETHER", GF_NETHER }, - {"GF_DISENCHANT", GF_DISENCHANT }, - {"GF_NEXUS", GF_NEXUS }, - {"GF_TIME", GF_TIME }, - {"GF_GRAVITY", GF_GRAVITY }, - {"GF_KILL_WALL", GF_KILL_WALL }, - {"GF_KILL_DOOR", GF_KILL_DOOR }, - {"GF_KILL_TRAP", GF_KILL_TRAP }, - {"GF_MAKE_WALL", GF_MAKE_WALL }, - {"GF_MAKE_DOOR", GF_MAKE_DOOR }, - {"GF_MAKE_TRAP", GF_MAKE_TRAP }, - {"GF_MAKE_TREE", GF_MAKE_TREE }, - {"GF_OLD_CLONE", GF_OLD_CLONE }, - {"GF_OLD_POLY", GF_OLD_POLY }, - {"GF_OLD_HEAL", GF_OLD_HEAL }, - {"GF_OLD_SPEED", GF_OLD_SPEED }, - {"GF_OLD_SLOW", GF_OLD_SLOW }, - {"GF_OLD_CONF", GF_OLD_CONF }, - {"GF_OLD_SLEEP", GF_OLD_SLEEP }, - {"GF_HYPODYNAMIA", GF_HYPODYNAMIA }, - {"GF_AWAY_UNDEAD", GF_AWAY_UNDEAD }, - {"GF_AWAY_EVIL", GF_AWAY_EVIL }, - {"GF_AWAY_ALL", GF_AWAY_ALL }, - {"GF_TURN_UNDEAD", GF_TURN_UNDEAD }, - {"GF_TURN_EVIL", GF_TURN_EVIL }, - {"GF_TURN_ALL", GF_TURN_ALL }, - {"GF_DISP_UNDEAD", GF_DISP_UNDEAD }, - {"GF_DISP_EVIL", GF_DISP_EVIL }, - {"GF_DISP_ALL", GF_DISP_ALL }, - {"GF_DISP_DEMON", GF_DISP_DEMON }, - {"GF_DISP_LIVING", GF_DISP_LIVING }, - {"GF_ROCKET", GF_ROCKET }, - {"GF_NUKE", GF_NUKE }, - {"GF_MAKE_RUNE_PROTECTION", GF_MAKE_RUNE_PROTECTION}, - {"GF_STASIS", GF_STASIS }, - {"GF_STONE_WALL", GF_STONE_WALL }, - {"GF_DEATH_RAY", GF_DEATH_RAY }, - {"GF_STUN", GF_STUN }, - {"GF_HOLY_FIRE", GF_HOLY_FIRE }, - {"GF_HELL_FIRE", GF_HELL_FIRE }, - {"GF_DISINTEGRATE", GF_DISINTEGRATE }, - {"GF_CHARM", GF_CHARM }, - {"GF_CONTROL_UNDEAD", GF_CONTROL_UNDEAD }, - {"GF_CONTROL_ANIMAL", GF_CONTROL_ANIMAL }, - {"GF_PSI", GF_PSI }, - {"GF_PSI_DRAIN", GF_PSI_DRAIN }, - {"GF_TELEKINESIS", GF_TELEKINESIS }, - {"GF_JAM_DOOR", GF_JAM_DOOR }, - {"GF_DOMINATION", GF_DOMINATION }, - {"GF_DISP_GOOD", GF_DISP_GOOD }, - {"GF_DRAIN_MANA", GF_DRAIN_MANA }, - {"GF_MIND_BLAST", GF_MIND_BLAST }, - {"GF_BRAIN_SMASH", GF_BRAIN_SMASH }, - {"GF_CAUSE_1", GF_CAUSE_1 }, - {"GF_CAUSE_2", GF_CAUSE_2 }, - {"GF_CAUSE_3", GF_CAUSE_3 }, - {"GF_CAUSE_4", GF_CAUSE_4 }, - {"GF_HAND_DOOM", GF_HAND_DOOM }, - {"GF_CAPTURE", GF_CAPTURE }, - {"GF_ANIM_DEAD", GF_ANIM_DEAD }, - {"GF_CHARM_LIVING", GF_CHARM_LIVING }, - {"GF_IDENTIFY", GF_IDENTIFY }, - {"GF_ATTACK", GF_ATTACK }, - {"GF_ENGETSU", GF_ENGETSU }, - {"GF_GENOCIDE", GF_GENOCIDE }, - {"GF_PHOTO", GF_PHOTO }, - {"GF_CONTROL_DEMON", GF_CONTROL_DEMON }, - {"GF_LAVA_FLOW", GF_LAVA_FLOW }, - {"GF_BLOOD_CURSE", GF_BLOOD_CURSE }, - {"GF_SEEKER", GF_SEEKER }, - {"GF_SUPER_RAY", GF_SUPER_RAY }, - {"GF_STAR_HEAL", GF_STAR_HEAL }, - {"GF_WATER_FLOW", GF_WATER_FLOW }, - {"GF_CRUSADE", GF_CRUSADE }, - {"GF_STASIS_EVIL", GF_STASIS_EVIL }, - {"GF_WOUNDS", GF_WOUNDS }, - {"GF_E_GENOCIDE", GF_E_GENOCIDE }, - {"GF_VOID", GF_VOID }, - {"GF_ABYSS", GF_ABYSS }, - {"GF_HUNGRY", GF_HUNGRY }, +//clang-format off +const named_num gf_desc[MAX_NAMED_NUM] = { + { "GF_ELEC", AttributeType::ELEC }, + { "GF_POIS", AttributeType::POIS }, + { "GF_ACID", AttributeType::ACID }, + { "GF_COLD", AttributeType::COLD }, + { "GF_FIRE", AttributeType::FIRE }, + { "GF_PSY_SPEAR", AttributeType::PSY_SPEAR }, + { "GF_MISSILE", AttributeType::MISSILE }, + { "GF_ARROW", AttributeType::ARROW }, + { "GF_PLASMA", AttributeType::PLASMA }, + { "GF_WATER", AttributeType::WATER }, + { "GF_LITE", AttributeType::LITE }, + { "GF_DARK", AttributeType::DARK }, + { "GF_LITE_WEAK", AttributeType::LITE_WEAK }, + { "GF_DARK_WEAK", AttributeType::DARK_WEAK }, + { "GF_SHARDS", AttributeType::SHARDS }, + { "GF_SOUND", AttributeType::SOUND }, + { "GF_CONFUSION", AttributeType::CONFUSION }, + { "GF_FORCE", AttributeType::FORCE }, + { "GF_INERTIA", AttributeType::INERTIAL }, + { "GF_MANA", AttributeType::MANA }, + { "GF_METEOR", AttributeType::METEOR }, + { "GF_ICE", AttributeType::ICE }, + { "GF_CHAOS", AttributeType::CHAOS }, + { "GF_NETHER", AttributeType::NETHER }, + { "GF_DISENCHANT", AttributeType::DISENCHANT }, + { "GF_NEXUS", AttributeType::NEXUS }, + { "GF_TIME", AttributeType::TIME }, + { "GF_GRAVITY", AttributeType::GRAVITY }, + { "GF_KILL_WALL", AttributeType::KILL_WALL }, + { "GF_KILL_DOOR", AttributeType::KILL_DOOR }, + { "GF_KILL_TRAP", AttributeType::KILL_TRAP }, + { "GF_MAKE_WALL", AttributeType::MAKE_WALL }, + { "GF_MAKE_DOOR", AttributeType::MAKE_DOOR }, + { "GF_MAKE_TRAP", AttributeType::MAKE_TRAP }, + { "GF_MAKE_TREE", AttributeType::MAKE_TREE }, + { "GF_OLD_CLONE", AttributeType::OLD_CLONE }, + { "GF_OLD_POLY", AttributeType::OLD_POLY }, + { "GF_OLD_HEAL", AttributeType::OLD_HEAL }, + { "GF_OLD_SPEED", AttributeType::OLD_SPEED }, + { "GF_OLD_SLOW", AttributeType::OLD_SLOW }, + { "GF_OLD_CONF", AttributeType::OLD_CONF }, + { "GF_OLD_SLEEP", AttributeType::OLD_SLEEP }, + { "GF_HYPODYNAMIA", AttributeType::HYPODYNAMIA }, + { "GF_AWAY_UNDEAD", AttributeType::AWAY_UNDEAD }, + { "GF_AWAY_EVIL", AttributeType::AWAY_EVIL }, + { "GF_AWAY_ALL", AttributeType::AWAY_ALL }, + { "GF_TURN_UNDEAD", AttributeType::TURN_UNDEAD }, + { "GF_TURN_EVIL", AttributeType::TURN_EVIL }, + { "GF_TURN_ALL", AttributeType::TURN_ALL }, + { "GF_DISP_UNDEAD", AttributeType::DISP_UNDEAD }, + { "GF_DISP_EVIL", AttributeType::DISP_EVIL }, + { "GF_DISP_ALL", AttributeType::DISP_ALL }, + { "GF_DISP_DEMON", AttributeType::DISP_DEMON }, + { "GF_DISP_LIVING", AttributeType::DISP_LIVING }, + { "GF_ROCKET", AttributeType::ROCKET }, + { "GF_NUKE", AttributeType::NUKE }, + { "GF_MAKE_RUNE_PROTECTION", AttributeType::MAKE_RUNE_PROTECTION }, + { "GF_STASIS", AttributeType::STASIS }, + { "GF_STONE_WALL", AttributeType::STONE_WALL }, + { "GF_DEATH_RAY", AttributeType::DEATH_RAY }, + { "GF_STUN", AttributeType::STUN }, + { "GF_HOLY_FIRE", AttributeType::HOLY_FIRE }, + { "GF_HELL_FIRE", AttributeType::HELL_FIRE }, + { "GF_DISINTEGRATE", AttributeType::DISINTEGRATE }, + { "GF_CHARM", AttributeType::CHARM }, + { "GF_CONTROL_UNDEAD", AttributeType::CONTROL_UNDEAD }, + { "GF_CONTROL_ANIMAL", AttributeType::CONTROL_ANIMAL }, + { "GF_PSI", AttributeType::PSI }, + { "GF_PSI_DRAIN", AttributeType::PSI_DRAIN }, + { "GF_TELEKINESIS", AttributeType::TELEKINESIS }, + { "GF_JAM_DOOR", AttributeType::JAM_DOOR }, + { "GF_DOMINATION", AttributeType::DOMINATION }, + { "GF_DISP_GOOD", AttributeType::DISP_GOOD }, + { "GF_DRAIN_MANA", AttributeType::DRAIN_MANA }, + { "GF_MIND_BLAST", AttributeType::MIND_BLAST }, + { "GF_BRAIN_SMASH", AttributeType::BRAIN_SMASH }, + { "GF_CAUSE_1", AttributeType::CAUSE_1 }, + { "GF_CAUSE_2", AttributeType::CAUSE_2 }, + { "GF_CAUSE_3", AttributeType::CAUSE_3 }, + { "GF_CAUSE_4", AttributeType::CAUSE_4 }, + { "GF_HAND_DOOM", AttributeType::HAND_DOOM }, + { "GF_CAPTURE", AttributeType::CAPTURE }, + { "GF_ANIM_DEAD", AttributeType::ANIM_DEAD }, + { "GF_CHARM_LIVING", AttributeType::CHARM_LIVING }, + { "GF_IDENTIFY", AttributeType::IDENTIFY }, + { "GF_ATTACK", AttributeType::ATTACK }, + { "GF_ENGETSU", AttributeType::ENGETSU }, + { "GF_GENOCIDE", AttributeType::GENOCIDE }, + { "GF_PHOTO", AttributeType::PHOTO }, + { "GF_CONTROL_DEMON", AttributeType::CONTROL_DEMON }, + { "GF_LAVA_FLOW", AttributeType::LAVA_FLOW }, + { "GF_BLOOD_CURSE", AttributeType::BLOOD_CURSE }, + { "GF_SEEKER", AttributeType::SEEKER }, + { "GF_SUPER_RAY", AttributeType::SUPER_RAY }, + { "GF_STAR_HEAL", AttributeType::STAR_HEAL }, + { "GF_WATER_FLOW", AttributeType::WATER_FLOW }, + { "GF_CRUSADE", AttributeType::CRUSADE }, + { "GF_STASIS_EVIL", AttributeType::STASIS_EVIL }, + { "GF_WOUNDS", AttributeType::WOUNDS }, + { "GF_E_GENOCIDE", AttributeType::E_GENOCIDE }, + { "GF_VOID", AttributeType::VOID_MAGIC }, + { "GF_ABYSS", AttributeType::ABYSS }, + { "GF_HUNGRY", AttributeType::HUNGRY }, }; diff --git a/src/io/gf-descriptions.h b/src/io/gf-descriptions.h index 624d89252..2dba5dc1c 100644 --- a/src/io/gf-descriptions.h +++ b/src/io/gf-descriptions.h @@ -1,13 +1,14 @@ #pragma once #include "system/angband.h" +#include "effect/attribute-types.h" #define MAX_NAMED_NUM 103 typedef struct named_num { concptr name; /* The name of this thing */ - int num; /* A number associated with it */ + AttributeType num; /* A number associated with it */ } named_num; extern const named_num gf_desc[MAX_NAMED_NUM]; diff --git a/src/io/interpret-pref-file.cpp b/src/io/interpret-pref-file.cpp index 536d6a119..90bd894d3 100644 --- a/src/io/interpret-pref-file.cpp +++ b/src/io/interpret-pref-file.cpp @@ -342,7 +342,7 @@ static errr interpret_z_token(char *buf) if (!streq(gf_desc[i].name, buf + 2)) continue; - gf_color[gf_desc[i].num] = (TERM_COLOR)quark_add(t); + gf_color[(int)gf_desc[i].num] = (TERM_COLOR)quark_add(t); return 0; } diff --git a/src/melee/melee-postprocess.cpp b/src/melee/melee-postprocess.cpp index 293862c91..7fa54b756 100644 --- a/src/melee/melee-postprocess.cpp +++ b/src/melee/melee-postprocess.cpp @@ -37,7 +37,7 @@ #include "player-info/class-info.h" #include "player-info/race-types.h" #include "player/player-personality-types.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/floor-type-definition.h" #include "system/monster-race-definition.h" #include "system/monster-type-definition.h" @@ -183,7 +183,7 @@ static bool check_monster_hp(player_type *player_ptr, mam_pp_type *mam_pp_ptr) *(mam_pp_ptr->dead) = true; print_monster_dead_by_monster(player_ptr, mam_pp_ptr); monster_gain_exp(player_ptr, mam_pp_ptr->who, mam_pp_ptr->m_ptr->r_idx); - monster_death(player_ptr, mam_pp_ptr->m_idx, false, GF_NONE); + monster_death(player_ptr, mam_pp_ptr->m_idx, false, AttributeType::NONE); delete_monster_idx(player_ptr, mam_pp_ptr->m_idx); *(mam_pp_ptr->fear) = false; return true; diff --git a/src/melee/melee-spell-flags-checker.cpp b/src/melee/melee-spell-flags-checker.cpp index 9dda097f2..877f2837a 100644 --- a/src/melee/melee-spell-flags-checker.cpp +++ b/src/melee/melee-spell-flags-checker.cpp @@ -19,7 +19,7 @@ #include "mspell/mspell-util.h" #include "pet/pet-util.h" #include "spell-kind/spells-world.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/floor-type-definition.h" #include "system/grid-type-definition.h" #include "system/monster-race-definition.h" @@ -187,19 +187,19 @@ static void check_melee_spell_breath(player_type *player_ptr, melee_spell_type * return; POSITION rad = (ms_ptr->r_ptr->flags2 & RF2_POWERFUL) ? 3 : 2; - if (!breath_direct(player_ptr, ms_ptr->m_ptr->fy, ms_ptr->m_ptr->fx, ms_ptr->t_ptr->fy, ms_ptr->t_ptr->fx, rad, 0, true)) { + if (!breath_direct(player_ptr, ms_ptr->m_ptr->fy, ms_ptr->m_ptr->fx, ms_ptr->t_ptr->fy, ms_ptr->t_ptr->fx, rad, AttributeType::NONE, true)) { ms_ptr->ability_flags.reset(RF_ABILITY_BREATH_MASK); return; } - if (ms_ptr->ability_flags.has(RF_ABILITY::BR_LITE) - && !breath_direct(player_ptr, ms_ptr->m_ptr->fy, ms_ptr->m_ptr->fx, ms_ptr->t_ptr->fy, ms_ptr->t_ptr->fx, rad, GF_LITE, true)) { + if (ms_ptr->ability_flags.has(RF_ABILITY::BR_LITE) && !breath_direct(player_ptr, ms_ptr->m_ptr->fy, ms_ptr->m_ptr->fx, + ms_ptr->t_ptr->fy, ms_ptr->t_ptr->fx, rad, AttributeType::LITE, true)) { ms_ptr->ability_flags.reset(RF_ABILITY::BR_LITE); return; } - if (ms_ptr->ability_flags.has(RF_ABILITY::BR_DISI) - && !breath_direct(player_ptr, ms_ptr->m_ptr->fy, ms_ptr->m_ptr->fx, ms_ptr->t_ptr->fy, ms_ptr->t_ptr->fx, rad, GF_DISINTEGRATE, true)) { + if (ms_ptr->ability_flags.has(RF_ABILITY::BR_DISI) && !breath_direct(player_ptr, ms_ptr->m_ptr->fy, ms_ptr->m_ptr->fx, + ms_ptr->t_ptr->fy, ms_ptr->t_ptr->fx, rad, AttributeType::DISINTEGRATE, true)) { ms_ptr->ability_flags.reset(RF_ABILITY::BR_DISI); } } diff --git a/src/melee/melee-switcher.cpp b/src/melee/melee-switcher.cpp index 6dc8a7d43..2975e61b1 100644 --- a/src/melee/melee-switcher.cpp +++ b/src/melee/melee-switcher.cpp @@ -154,7 +154,7 @@ void decide_monster_attack_effect(player_type *player_ptr, mam_type *mam_ptr) case RaceBlowEffectType::NONE: case RaceBlowEffectType::DR_MANA: mam_ptr->damage = 0; - mam_ptr->pt = GF_NONE; + mam_ptr->pt = AttributeType::NONE; break; case RaceBlowEffectType::SUPERHURT: if ((randint1(mam_ptr->rlev * 2 + 250) > (mam_ptr->ac + 200)) || one_in_(13)) { @@ -169,11 +169,11 @@ void decide_monster_attack_effect(player_type *player_ptr, mam_type *mam_ptr) break; case RaceBlowEffectType::POISON: case RaceBlowEffectType::DISEASE: - mam_ptr->pt = GF_POIS; + mam_ptr->pt = AttributeType::POIS; break; case RaceBlowEffectType::UN_BONUS: case RaceBlowEffectType::UN_POWER: - mam_ptr->pt = GF_DISENCHANT; + mam_ptr->pt = AttributeType::DISENCHANT; break; case RaceBlowEffectType::EAT_ITEM: case RaceBlowEffectType::EAT_GOLD: @@ -193,25 +193,25 @@ void decide_monster_attack_effect(player_type *player_ptr, mam_type *mam_ptr) case RaceBlowEffectType::LOSE_ALL: break; case RaceBlowEffectType::ACID: - mam_ptr->pt = GF_ACID; + mam_ptr->pt = AttributeType::ACID; break; case RaceBlowEffectType::ELEC: - mam_ptr->pt = GF_ELEC; + mam_ptr->pt = AttributeType::ELEC; break; case RaceBlowEffectType::FIRE: - mam_ptr->pt = GF_FIRE; + mam_ptr->pt = AttributeType::FIRE; break; case RaceBlowEffectType::COLD: - mam_ptr->pt = GF_COLD; + mam_ptr->pt = AttributeType::COLD; break; case RaceBlowEffectType::CONFUSE: - mam_ptr->pt = GF_CONFUSION; + mam_ptr->pt = AttributeType::CONFUSION; break; case RaceBlowEffectType::TERRIFY: - mam_ptr->effect_type = BLOW_EFFECT_TYPE_FEAR; + mam_ptr->attribute = BLOW_EFFECT_TYPE_FEAR; break; case RaceBlowEffectType::PARALYZE: - mam_ptr->effect_type = BLOW_EFFECT_TYPE_SLEEP; + mam_ptr->attribute = BLOW_EFFECT_TYPE_SLEEP; break; case RaceBlowEffectType::SHATTER: mam_ptr->damage -= (mam_ptr->damage * ((mam_ptr->ac < 150) ? mam_ptr->ac : 150) / 250); @@ -223,30 +223,30 @@ void decide_monster_attack_effect(player_type *player_ptr, mam_type *mam_ptr) case RaceBlowEffectType::EXP_20: case RaceBlowEffectType::EXP_40: case RaceBlowEffectType::EXP_80: - mam_ptr->pt = GF_NETHER; + mam_ptr->pt = AttributeType::NETHER; break; case RaceBlowEffectType::TIME: - mam_ptr->pt = GF_TIME; + mam_ptr->pt = AttributeType::TIME; break; case RaceBlowEffectType::DR_LIFE: - mam_ptr->pt = GF_HYPODYNAMIA; - mam_ptr->effect_type = BLOW_EFFECT_TYPE_HEAL; + mam_ptr->pt = AttributeType::HYPODYNAMIA; + mam_ptr->attribute = BLOW_EFFECT_TYPE_HEAL; break; case RaceBlowEffectType::INERTIA: - mam_ptr->pt = GF_INERTIAL; + mam_ptr->pt = AttributeType::INERTIAL; break; case RaceBlowEffectType::STUN: - mam_ptr->pt = GF_SOUND; + mam_ptr->pt = AttributeType::SOUND; break; case RaceBlowEffectType::HUNGRY: - mam_ptr->pt = GF_HUNGRY; + mam_ptr->pt = AttributeType::HUNGRY; break; case RaceBlowEffectType::FLAVOR: // フレーバー打撃には何の効果もない。 - mam_ptr->pt = GF_NONE; + mam_ptr->pt = AttributeType::NONE; break; default: - mam_ptr->pt = GF_NONE; + mam_ptr->pt = AttributeType::NONE; break; } } diff --git a/src/melee/melee-util.cpp b/src/melee/melee-util.cpp index 1c1d76502..8bf46d889 100644 --- a/src/melee/melee-util.cpp +++ b/src/melee/melee-util.cpp @@ -9,7 +9,7 @@ mam_type *initialize_mam_type(player_type *player_ptr, mam_type *mam_ptr, MONRACE_IDX m_idx, MONRACE_IDX t_idx) { - mam_ptr->effect_type = 0; + mam_ptr->attribute = 0; mam_ptr->m_idx = m_idx; mam_ptr->t_idx = t_idx; mam_ptr->m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; diff --git a/src/melee/melee-util.h b/src/melee/melee-util.h index fb39c6019..6574d98dc 100644 --- a/src/melee/melee-util.h +++ b/src/melee/melee-util.h @@ -3,12 +3,12 @@ #include "monster-attack/monster-attack-effect.h" #include "monster-attack/monster-attack-types.h" #include "system/angband.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" /* monster-attack-monster type*/ struct monster_type; typedef struct mam_type { - int effect_type; + int attribute; MONRACE_IDX m_idx; MONRACE_IDX t_idx; monster_type *m_ptr; @@ -25,7 +25,7 @@ typedef struct mam_type { bool explode; bool touched; concptr act; - spells_type pt; + AttributeType pt; RaceBlowEffectType effect; ARMOUR_CLASS ac; DEPTH rlev; diff --git a/src/melee/monster-attack-monster.cpp b/src/melee/monster-attack-monster.cpp index 2813bec5f..fd0c11719 100644 --- a/src/melee/monster-attack-monster.cpp +++ b/src/melee/monster-attack-monster.cpp @@ -31,7 +31,7 @@ #include "monster/monster-status.h" #include "spell-kind/spells-teleport.h" #include "spell-realm/spells-hex.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/floor-type-definition.h" #include "system/monster-race-definition.h" #include "system/monster-type-definition.h" @@ -61,13 +61,14 @@ static void heal_monster_by_melee(player_type *player_ptr, mam_type *mam_ptr) static void process_blow_effect(player_type *player_ptr, mam_type *mam_ptr) { monster_race *r_ptr = &r_info[mam_ptr->m_ptr->r_idx]; - switch (mam_ptr->effect_type) { + switch (mam_ptr->attribute) { case BLOW_EFFECT_TYPE_FEAR: - project(player_ptr, mam_ptr->m_idx, 0, mam_ptr->t_ptr->fy, mam_ptr->t_ptr->fx, mam_ptr->damage, GF_TURN_ALL, - PROJECT_KILL | PROJECT_STOP | PROJECT_AIMED); + project(player_ptr, mam_ptr->m_idx, 0, mam_ptr->t_ptr->fy, mam_ptr->t_ptr->fx, mam_ptr->damage, + AttributeType::TURN_ALL, PROJECT_KILL | PROJECT_STOP | PROJECT_AIMED); break; case BLOW_EFFECT_TYPE_SLEEP: - project(player_ptr, mam_ptr->m_idx, 0, mam_ptr->t_ptr->fy, mam_ptr->t_ptr->fx, r_ptr->level, GF_OLD_SLEEP, PROJECT_KILL | PROJECT_STOP | PROJECT_AIMED); + project(player_ptr, mam_ptr->m_idx, 0, mam_ptr->t_ptr->fy, mam_ptr->t_ptr->fx, r_ptr->level, + AttributeType::OLD_SLEEP, PROJECT_KILL | PROJECT_STOP | PROJECT_AIMED); break; case BLOW_EFFECT_TYPE_HEAL: heal_monster_by_melee(player_ptr, mam_ptr); @@ -93,7 +94,7 @@ static void aura_fire_by_melee(player_type *player_ptr, mam_type *mam_ptr) if (mam_ptr->m_ptr->ml && is_original_ap_and_seen(player_ptr, mam_ptr->t_ptr)) tr_ptr->aura_flags.set(MonsterAuraType::FIRE); - project(player_ptr, mam_ptr->t_idx, 0, mam_ptr->m_ptr->fy, mam_ptr->m_ptr->fx, damroll(1 + ((tr_ptr->level) / 26), 1 + ((tr_ptr->level) / 17)), GF_FIRE, + project(player_ptr, mam_ptr->t_idx, 0, mam_ptr->m_ptr->fy, mam_ptr->m_ptr->fx, damroll(1 + ((tr_ptr->level) / 26), 1 + ((tr_ptr->level) / 17)), AttributeType::FIRE, PROJECT_KILL | PROJECT_STOP | PROJECT_AIMED); } @@ -115,7 +116,7 @@ static void aura_cold_by_melee(player_type *player_ptr, mam_type *mam_ptr) if (mam_ptr->m_ptr->ml && is_original_ap_and_seen(player_ptr, mam_ptr->t_ptr)) tr_ptr->aura_flags.set(MonsterAuraType::COLD); - project(player_ptr, mam_ptr->t_idx, 0, mam_ptr->m_ptr->fy, mam_ptr->m_ptr->fx, damroll(1 + ((tr_ptr->level) / 26), 1 + ((tr_ptr->level) / 17)), GF_COLD, + project(player_ptr, mam_ptr->t_idx, 0, mam_ptr->m_ptr->fy, mam_ptr->m_ptr->fx, damroll(1 + ((tr_ptr->level) / 26), 1 + ((tr_ptr->level) / 17)), AttributeType::COLD, PROJECT_KILL | PROJECT_STOP | PROJECT_AIMED); } @@ -137,7 +138,7 @@ static void aura_elec_by_melee(player_type *player_ptr, mam_type *mam_ptr) if (mam_ptr->m_ptr->ml && is_original_ap_and_seen(player_ptr, mam_ptr->t_ptr)) tr_ptr->aura_flags.set(MonsterAuraType::ELEC); - project(player_ptr, mam_ptr->t_idx, 0, mam_ptr->m_ptr->fy, mam_ptr->m_ptr->fx, damroll(1 + ((tr_ptr->level) / 26), 1 + ((tr_ptr->level) / 17)), GF_ELEC, + project(player_ptr, mam_ptr->t_idx, 0, mam_ptr->m_ptr->fy, mam_ptr->m_ptr->fx, damroll(1 + ((tr_ptr->level) / 26), 1 + ((tr_ptr->level) / 17)), AttributeType::ELEC, PROJECT_KILL | PROJECT_STOP | PROJECT_AIMED); } @@ -193,7 +194,7 @@ static void describe_silly_melee(mam_type *mam_ptr) static void process_monster_attack_effect(player_type *player_ptr, mam_type *mam_ptr) { - if (mam_ptr->pt == GF_NONE) + if (mam_ptr->pt == AttributeType::NONE) return; if (!mam_ptr->explode) @@ -222,8 +223,8 @@ static void process_melee(player_type *player_ptr, mam_type *mam_ptr) describe_silly_melee(mam_ptr); mam_ptr->obvious = true; mam_ptr->damage = damroll(mam_ptr->d_dice, mam_ptr->d_side); - mam_ptr->effect_type = BLOW_EFFECT_TYPE_NONE; - mam_ptr->pt = GF_MISSILE; + mam_ptr->attribute = BLOW_EFFECT_TYPE_NONE; + mam_ptr->pt = AttributeType::MISSILE; decide_monster_attack_effect(player_ptr, mam_ptr); process_monster_attack_effect(player_ptr, mam_ptr); } diff --git a/src/mind/mind-elementalist.cpp b/src/mind/mind-elementalist.cpp index 4e9770d76..ddf594579 100644 --- a/src/mind/mind-elementalist.cpp +++ b/src/mind/mind-elementalist.cpp @@ -53,6 +53,7 @@ #include "spell-kind/spells-sight.h" #include "spell-kind/spells-teleport.h" #include "spell-kind/spells-world.h" +#include "effect/attribute-types.h" #include "status/bad-status-setter.h" #include "status/base-status.h" #include "system/floor-type-definition.h" @@ -105,9 +106,9 @@ enum class ElementSpells { */ struct element_type { std::string_view title; //!< 領域名 - std::array type; //!< 属性タイプリスト + std::array type; //!< 属性タイプリスト std::array name; //!< 属性名リスト - std::unordered_map extra; //!< 追加属性タイプ + std::unordered_map extra; //!< 追加属性タイプ }; /*! @@ -131,7 +132,7 @@ static element_type_list element_types = { { ElementRealm::FIRE, { _("炎", "Fire"), - { GF_FIRE, GF_HELL_FIRE, GF_PLASMA }, + { AttributeType::FIRE, AttributeType::HELL_FIRE, AttributeType::PLASMA }, { _("火炎", "Fire"), _("業火", "Hell Fire"), _("プラズマ", "Plasma") }, { }, } @@ -139,15 +140,15 @@ static element_type_list element_types = { { ElementRealm::ICE, { _("æ°·", "Ice"), - { GF_COLD, GF_INERTIAL, GF_TIME }, + { AttributeType::COLD, AttributeType::INERTIAL, AttributeType::TIME }, { _("冷気", "Ice"), _("遅鈍", "Inertia"), _("時間逆転", "Time Stream") }, - { { GF_COLD, GF_ICE} }, + { { AttributeType::COLD, AttributeType::ICE} }, } }, { ElementRealm::SKY, { _("空", "Sky"), - { GF_ELEC, GF_LITE, GF_MANA }, + { AttributeType::ELEC, AttributeType::LITE, AttributeType::MANA }, { _("電撃", "Lightning"), _("光", "Light"), _("魔力", "Mana") }, { }, } @@ -155,7 +156,7 @@ static element_type_list element_types = { { ElementRealm::SEA, { _("æµ·", "Sea"), - { GF_ACID, GF_WATER, GF_DISINTEGRATE }, + { AttributeType::ACID, AttributeType::WATER, AttributeType::DISINTEGRATE }, { _("酸", "Acid"), _("æ°´", "Water"), _("分解", "Disintegration") }, { }, } @@ -163,15 +164,15 @@ static element_type_list element_types = { { ElementRealm::DARKNESS, { _("闇", "Darkness"), - { GF_DARK, GF_NETHER, GF_VOID }, + { AttributeType::DARK, AttributeType::NETHER, AttributeType::VOID_MAGIC }, { _("暗黒", "Darkness"), _("地獄", "Nether"), _("虚無", "void") }, - { { GF_DARK, GF_ABYSS } }, + { { AttributeType::DARK, AttributeType::ABYSS } }, } }, { ElementRealm::CHAOS, { _("混沌", "Chaos"), - { GF_CONFUSION, GF_CHAOS, GF_NEXUS }, + { AttributeType::CONFUSION, AttributeType::CHAOS, AttributeType::NEXUS }, { _("æ··ä¹±", "Confusion"), _("カオス", "Chaos"), _("因果混乱", "Nexus") }, { }, } @@ -179,7 +180,7 @@ static element_type_list element_types = { { ElementRealm::EARTH, { _("地", "Earth"), - { GF_SHARDS, GF_FORCE, GF_METEOR }, + { AttributeType::SHARDS, AttributeType::FORCE, AttributeType::METEOR }, { _("破片", "Shards"), _("フォース", "Force"), _("隕石", "Meteor") }, { }, } @@ -187,7 +188,7 @@ static element_type_list element_types = { { ElementRealm::DEATH, { _("瘴気", "Death"), - { GF_POIS, GF_HYPODYNAMIA, GF_DISENCHANT }, + { AttributeType::POIS, AttributeType::HYPODYNAMIA, AttributeType::DISENCHANT }, { _("毒", "Poison"), _("吸血", "Drain Life"), _("劣化", "Disenchantment") }, { }, } @@ -305,7 +306,7 @@ concptr get_element_title(int realm_idx) * @param realm_idx 領域番号 * @return 領域で使用できる属性リスト */ -static std::array get_element_types(int realm_idx) +static std::array get_element_types(int realm_idx) { auto realm = i2enum(realm_idx); return element_types.at(realm).type; @@ -317,7 +318,7 @@ static std::array get_element_types(int realm_idx) * @param n 属性の何番目か * @return 属性タイプ */ -spells_type get_element_type(int realm_idx, int n) +AttributeType get_element_type(int realm_idx, int n) { return get_element_types(realm_idx)[n]; } @@ -328,7 +329,7 @@ spells_type get_element_type(int realm_idx, int n) * @param n 属性の何番目か * @return 属性タイプ */ -static spells_type get_element_spells_type(player_type *player_ptr, int n) +static AttributeType get_element_spells_type(player_type *player_ptr, int n) { auto realm = element_types.at(i2enum(player_ptr->element)); auto t = realm.type.at(n); @@ -474,7 +475,7 @@ static bool cast_element_spell(player_type *player_ptr, SPELL_IDX spell_idx) { auto spell = i2enum(spell_idx); auto power = element_powers.at(spell); - spells_type typ; + AttributeType typ; DIRECTION dir; PLAYER_LEVEL plev = player_ptr->lev; HIT_POINT dam; @@ -505,7 +506,7 @@ static bool cast_element_spell(player_type *player_ptr, SPELL_IDX spell_idx) dam = damroll(8 + ((plev - 5) / 4), 8); typ = get_element_spells_type(player_ptr, power.elem); if (fire_bolt_or_beam(player_ptr, plev, typ, dir, dam)) { - if (typ == GF_HYPODYNAMIA) { + if (typ == AttributeType::HYPODYNAMIA) { (void)hp_player(player_ptr, dam / 2); } } @@ -535,7 +536,7 @@ static bool cast_element_spell(player_type *player_ptr, SPELL_IDX spell_idx) dam = std::min(150, player_ptr->chp / 2); typ = get_element_spells_type(player_ptr, power.elem); if (fire_breath(player_ptr, typ, dir, dam, 3)) { - if (typ == GF_HYPODYNAMIA) { + if (typ == AttributeType::HYPODYNAMIA) { (void)hp_player(player_ptr, dam / 2); } } @@ -543,7 +544,7 @@ static bool cast_element_spell(player_type *player_ptr, SPELL_IDX spell_idx) case ElementSpells::ANNIHILATE: if (!get_aim_dir(player_ptr, &dir)) return false; - fire_ball_hide(player_ptr, GF_E_GENOCIDE, dir, plev + 50, 0); + fire_ball_hide(player_ptr, AttributeType::E_GENOCIDE, dir, plev + 50, 0); break; case ElementSpells::BOLT_3RD: if (!get_aim_dir(player_ptr, &dir)) @@ -563,7 +564,7 @@ static bool cast_element_spell(player_type *player_ptr, SPELL_IDX spell_idx) dam = 75 + plev * 3 / 2; typ = get_element_spells_type(player_ptr, power.elem); if (fire_ball(player_ptr, typ, dir, dam, 3)) { - if (typ == GF_HYPODYNAMIA) { + if (typ == AttributeType::HYPODYNAMIA) { (void)hp_player(player_ptr, dam / 2); } } @@ -591,7 +592,7 @@ static bool cast_element_spell(player_type *player_ptr, SPELL_IDX spell_idx) dam = 115 + plev * 5 / 2; typ = get_element_spells_type(player_ptr, power.elem); if (fire_ball(player_ptr, typ, dir, dam, 4)) { - if (typ == GF_HYPODYNAMIA) { + if (typ == AttributeType::HYPODYNAMIA) { (void)hp_player(player_ptr, dam / 2); } } @@ -971,38 +972,38 @@ void do_cmd_element_browse(player_type *player_ptr) * @param type 魔法攻撃属性 * @return 効果があるならTRUE、なければFALSE */ -bool is_elemental_genocide_effective(monster_race *r_ptr, spells_type type) +bool is_elemental_genocide_effective(monster_race *r_ptr, AttributeType type) { switch (type) { - case GF_FIRE: + case AttributeType::FIRE: if (any_bits(r_ptr->flagsr, RFR_IM_FIRE)) return false; break; - case GF_COLD: + case AttributeType::COLD: if (any_bits(r_ptr->flagsr, RFR_IM_COLD)) return false; break; - case GF_ELEC: + case AttributeType::ELEC: if (any_bits(r_ptr->flagsr, RFR_IM_ELEC)) return false; break; - case GF_ACID: + case AttributeType::ACID: if (any_bits(r_ptr->flagsr, RFR_IM_ACID)) return false; break; - case GF_DARK: + case AttributeType::DARK: if (any_bits(r_ptr->flagsr, RFR_RES_DARK) || any_bits(r_ptr->r_flags3, RF3_HURT_LITE)) return false; break; - case GF_CONFUSION: + case AttributeType::CONFUSION: if (any_bits(r_ptr->flags3, RF3_NO_CONF)) return false; break; - case GF_SHARDS: + case AttributeType::SHARDS: if (any_bits(r_ptr->flagsr, RFR_RES_SHAR)) return false; break; - case GF_POIS: + case AttributeType::POIS: if (any_bits(r_ptr->flagsr, RFR_IM_POIS)) return false; break; @@ -1305,8 +1306,7 @@ void switch_element_racial(player_type *player_ptr, rc_type *rc_ptr) case ElementRealm::EARTH: rpi = rpi_type(_("地震", "Earthquake")); rpi.info = format("%s%d", KWD_SPHERE, 10); - rpi.text - = _("周囲のダンジョンを揺らし、壁と床をランダムに入れ変える。", "Shakes dungeon structure, and results in random swapping of floors and walls."); + rpi.text = _("周囲のダンジョンを揺らし、壁と床をランダムに入れ変える。", "Shakes dungeon structure, and results in random swapping of floors and walls."); rpi.min_level = 25; rpi.cost = 15; rpi.stat = A_WIS; @@ -1348,8 +1348,8 @@ bool switch_element_execution(player_type *player_ptr) (void)lite_area(player_ptr, damroll(2, plev / 2), plev / 10); break; case ElementRealm::ICE: - (void)project(player_ptr, 0, 5, player_ptr->y, player_ptr->x, 1, GF_COLD, PROJECT_ITEM); - (void)project_all_los(player_ptr, GF_OLD_SLEEP, 20 + plev * 3 / 2); + (void)project(player_ptr, 0, 5, player_ptr->y, player_ptr->x, 1, AttributeType::COLD, PROJECT_ITEM); + (void)project_all_los(player_ptr, AttributeType::OLD_SLEEP, 20 + plev * 3 / 2); break; case ElementRealm::SKY: (void)recharge(player_ptr, 120); diff --git a/src/mind/mind-elementalist.h b/src/mind/mind-elementalist.h index 119532b46..0ec82604a 100644 --- a/src/mind/mind-elementalist.h +++ b/src/mind/mind-elementalist.h @@ -1,7 +1,7 @@ #pragma once #include "system/angband.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" enum class ElementRealm { FIRE = 1, @@ -20,7 +20,7 @@ struct effect_monster_type; struct rc_type; concptr get_element_title(int realm_idx); -spells_type get_element_type(int realm_idx, int n); +AttributeType get_element_type(int realm_idx, int n); concptr get_element_name(int realm_idx, int n); void do_cmd_element(player_type *player_ptr); void do_cmd_element_browse(player_type *player_ptr); diff --git a/src/mind/mind-force-trainer.cpp b/src/mind/mind-force-trainer.cpp index 790d380e7..f0f652a5d 100644 --- a/src/mind/mind-force-trainer.cpp +++ b/src/mind/mind-force-trainer.cpp @@ -25,7 +25,7 @@ #include "player/player-damage.h" #include "spell-kind/spells-launcher.h" #include "spell-kind/spells-lite.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell/summon-types.h" #include "status/temporary-resistance.h" #include "system/floor-type-definition.h" @@ -197,7 +197,7 @@ bool shock_power(player_type *player_ptr) POSITION x = player_ptr->x + ddx[dir]; PLAYER_LEVEL plev = player_ptr->lev; HIT_POINT dam = damroll(8 + ((plev - 5) / 4) + boost / 12, 8); - fire_beam(player_ptr, GF_MISSILE, dir, dam); + fire_beam(player_ptr, AttributeType::MISSILE, dir, dam); if (!player_ptr->current_floor_ptr->grid_array[y][x].m_idx) return true; @@ -265,7 +265,7 @@ bool cast_force_spell(player_type *player_ptr, mind_force_trainer_type spell) if (!get_aim_dir(player_ptr, &dir)) return false; - fire_ball(player_ptr, GF_MISSILE, dir, damroll(3 + ((plev - 1) / 5) + boost / 12, 4), 0); + fire_ball(player_ptr, AttributeType::MISSILE, dir, damroll(3 + ((plev - 1) / 5) + boost / 12, 4), 0); break; case FLASH_LIGHT: (void)lite_area(player_ptr, damroll(2, (plev / 2)), (plev / 10) + 1); @@ -278,7 +278,7 @@ bool cast_force_spell(player_type *player_ptr, mind_force_trainer_type spell) if (!get_aim_dir(player_ptr, &dir)) return false; - fire_beam(player_ptr, GF_MISSILE, dir, damroll(5 + ((plev - 1) / 5) + boost / 10, 5)); + fire_beam(player_ptr, AttributeType::MISSILE, dir, damroll(5 + ((plev - 1) / 5) + boost / 10, 5)); break; case MAGIC_RESISTANCE: set_resist_magic(player_ptr, randint1(20) + 20 + boost / 5, false); @@ -289,7 +289,7 @@ bool cast_force_spell(player_type *player_ptr, mind_force_trainer_type spell) player_ptr->update |= (PU_BONUS); if (randint1(get_current_ki(player_ptr)) > (plev * 4 + 120)) { msg_print(_("気が暴走した!", "The Force exploded!")); - fire_ball(player_ptr, GF_MANA, 0, get_current_ki(player_ptr) / 2, 10); + fire_ball(player_ptr, AttributeType::MANA, 0, get_current_ki(player_ptr) / 2, 10); auto data = PlayerClass(player_ptr).get_specific_data(); take_hit(player_ptr, DAMAGE_LOSELIFE, data->ki / 2, _("気の暴走", "Explosion of the Force")); } else @@ -306,7 +306,7 @@ bool cast_force_spell(player_type *player_ptr, mind_force_trainer_type spell) if (!get_aim_dir(player_ptr, &dir)) return false; - fire_ball(player_ptr, GF_MISSILE, dir, damroll(10, 6) + plev * 3 / 2 + boost * 3 / 5, (plev < 30) ? 2 : 3); + fire_ball(player_ptr, AttributeType::MISSILE, dir, damroll(10, 6) + plev * 3 / 2 + boost * 3 / 5, (plev < 30) ? 2 : 3); break; case DISPEL_MAGIC: { if (!target_set(player_ptr, TARGET_KILL)) @@ -334,13 +334,13 @@ bool cast_force_spell(player_type *player_ptr, mind_force_trainer_type spell) break; } case EXPLODING_FLAME: - fire_ball(player_ptr, GF_FIRE, 0, 200 + (2 * plev) + boost * 2, 10); + fire_ball(player_ptr, AttributeType::FIRE, 0, 200 + (2 * plev) + boost * 2, 10); break; case SUPER_KAMEHAMEHA: if (!get_aim_dir(player_ptr, &dir)) return false; - fire_beam(player_ptr, GF_MANA, dir, damroll(10 + (plev / 2) + boost * 3 / 10, 15)); + fire_beam(player_ptr, AttributeType::MANA, dir, damroll(10 + (plev / 2) + boost * 3 / 10, 15)); break; case LIGHT_SPEED: set_lightspeed(player_ptr, randint1(16) + 16 + boost / 20, false); diff --git a/src/mind/mind-mindcrafter.cpp b/src/mind/mind-mindcrafter.cpp index 421d3ef15..c3b649652 100644 --- a/src/mind/mind-mindcrafter.cpp +++ b/src/mind/mind-mindcrafter.cpp @@ -27,7 +27,7 @@ #include "spell-kind/spells-perception.h" #include "spell-kind/spells-sight.h" #include "spell-kind/spells-teleport.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell/spells-status.h" #include "status/bad-status-setter.h" #include "status/buff-setter.h" @@ -169,9 +169,9 @@ bool cast_mindcrafter_spell(player_type *player_ptr, mind_mindcrafter_type spell return false; if (randint1(100) < plev * 2) - fire_beam(player_ptr, GF_PSI, dir, damroll(3 + ((plev - 1) / 4), (3 + plev / 15))); + fire_beam(player_ptr, AttributeType::PSI, dir, damroll(3 + ((plev - 1) / 4), (3 + plev / 15))); else - fire_ball(player_ptr, GF_PSI, dir, damroll(3 + ((plev - 1) / 4), (3 + plev / 15)), 0); + fire_ball(player_ptr, AttributeType::PSI, dir, damroll(3 + ((plev - 1) / 4), (3 + plev / 15)), 0); break; case MINOR_DISPLACEMENT: teleport_player(player_ptr, 10, TELEPORT_SPONTANEOUS); @@ -184,7 +184,7 @@ bool cast_mindcrafter_spell(player_type *player_ptr, mind_mindcrafter_type spell if (!get_aim_dir(player_ptr, &dir)) return false; - fire_ball(player_ptr, GF_DOMINATION, dir, plev, 0); + fire_ball(player_ptr, AttributeType::DOMINATION, dir, plev, 0); } else { charm_monsters(player_ptr, plev * 2); } @@ -194,7 +194,7 @@ bool cast_mindcrafter_spell(player_type *player_ptr, mind_mindcrafter_type spell if (!get_aim_dir(player_ptr, &dir)) return false; - fire_ball(player_ptr, GF_TELEKINESIS, dir, damroll(8 + ((plev - 5) / 4), 8), (plev > 20 ? (plev - 20) / 8 + 1 : 0)); + fire_ball(player_ptr, AttributeType::TELEKINESIS, dir, damroll(8 + ((plev - 5) / 4), 8), (plev > 20 ? (plev - 20) / 8 + 1 : 0)); break; case CHARACTER_ARMOR: set_shield(player_ptr, (TIME_EFFECT)plev, false); @@ -218,7 +218,7 @@ bool cast_mindcrafter_spell(player_type *player_ptr, mind_mindcrafter_type spell case MIND_WAVE: msg_print(_("精神を捻じ曲げる波動を発生させた!", "Mind-warping forces emanate from your brain!")); if (plev < 25) - project(player_ptr, 0, 2 + plev / 10, player_ptr->y, player_ptr->x, (plev * 3), GF_PSI, PROJECT_KILL); + project(player_ptr, 0, 2 + plev / 10, player_ptr->y, player_ptr->x, (plev * 3), AttributeType::PSI, PROJECT_KILL); else (void)mindblast_monsters(player_ptr, randint1(plev * ((plev - 5) / 10 + 1))); @@ -247,7 +247,7 @@ bool cast_mindcrafter_spell(player_type *player_ptr, mind_mindcrafter_type spell return false; dam = damroll(plev / 2, 6); - if (fire_ball(player_ptr, GF_PSI_DRAIN, dir, dam, 0)) + if (fire_ball(player_ptr, AttributeType::PSI_DRAIN, dir, dam, 0)) player_ptr->energy_need += randint1(150); break; @@ -255,7 +255,7 @@ bool cast_mindcrafter_spell(player_type *player_ptr, mind_mindcrafter_type spell if (!get_aim_dir(player_ptr, &dir)) return false; - fire_beam(player_ptr, GF_PSY_SPEAR, dir, randint1(plev * 3) + plev * 3); + fire_beam(player_ptr, AttributeType::PSY_SPEAR, dir, randint1(plev * 3) + plev * 3); break; case THE_WORLD: time_walk(player_ptr); diff --git a/src/mind/mind-mirror-master.cpp b/src/mind/mind-mirror-master.cpp index 1a3e2cbc1..64e3e1aa3 100644 --- a/src/mind/mind-mirror-master.cpp +++ b/src/mind/mind-mirror-master.cpp @@ -28,7 +28,7 @@ #include "spell-kind/spells-sight.h" #include "spell-kind/spells-teleport.h" #include "spell-kind/spells-world.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "status/body-improvement.h" #include "status/buff-setter.h" #include "status/sight-setter.h" @@ -93,7 +93,7 @@ void remove_all_mirrors(player_type *player_ptr, bool explode) if (!explode) continue; - project(player_ptr, 0, 2, y, x, player_ptr->lev / 2 + 5, GF_SHARDS, + project(player_ptr, 0, 2, y, x, player_ptr->lev / 2 + 5, AttributeType::SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI)); } } @@ -168,7 +168,7 @@ bool binding_field(player_type *player_ptr, HIT_POINT dam) && centersign * ((point_x[2] - x) * (point_y[0] - y) - (point_y[2] - y) * (point_x[0] - x)) >= 0) { if (player_has_los_bold(player_ptr, y, x) && projectable(player_ptr, player_ptr->y, player_ptr->x, y, x)) { if (!(player_ptr->blind) && panel_contains(y, x)) { - uint16_t p = bolt_pict(y, x, y, x, GF_MANA); + uint16_t p = bolt_pict(y, x, y, x, AttributeType::MANA); print_rel(player_ptr, PICT_C(p), PICT_A(p), y, x); move_cursor_relative(y, x); term_fresh(); @@ -185,7 +185,7 @@ bool binding_field(player_type *player_ptr, HIT_POINT dam) && centersign * ((point_x[1] - x) * (point_y[2] - y) - (point_y[1] - y) * (point_x[2] - x)) >= 0 && centersign * ((point_x[2] - x) * (point_y[0] - y) - (point_y[2] - y) * (point_x[0] - x)) >= 0) { if (player_has_los_bold(player_ptr, y, x) && projectable(player_ptr, player_ptr->y, player_ptr->x, y, x)) { - (void)affect_feature(player_ptr, 0, 0, y, x, dam, GF_MANA); + (void)affect_feature(player_ptr, 0, 0, y, x, dam, AttributeType::MANA); } } } @@ -197,7 +197,7 @@ bool binding_field(player_type *player_ptr, HIT_POINT dam) && centersign * ((point_x[1] - x) * (point_y[2] - y) - (point_y[1] - y) * (point_x[2] - x)) >= 0 && centersign * ((point_x[2] - x) * (point_y[0] - y) - (point_y[2] - y) * (point_x[0] - x)) >= 0) { if (player_has_los_bold(player_ptr, y, x) && projectable(player_ptr, player_ptr->y, player_ptr->x, y, x)) { - (void)affect_item(player_ptr, 0, 0, y, x, dam, GF_MANA); + (void)affect_item(player_ptr, 0, 0, y, x, dam, AttributeType::MANA); } } } @@ -209,7 +209,7 @@ bool binding_field(player_type *player_ptr, HIT_POINT dam) && centersign * ((point_x[1] - x) * (point_y[2] - y) - (point_y[1] - y) * (point_x[2] - x)) >= 0 && centersign * ((point_x[2] - x) * (point_y[0] - y) - (point_y[2] - y) * (point_x[0] - x)) >= 0) { if (player_has_los_bold(player_ptr, y, x) && projectable(player_ptr, player_ptr->y, player_ptr->x, y, x)) { - (void)affect_monster(player_ptr, 0, 0, y, x, dam, GF_MANA, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP), true); + (void)affect_monster(player_ptr, 0, 0, y, x, dam, AttributeType::MANA, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP), true); } } } @@ -235,7 +235,7 @@ void seal_of_mirror(player_type *player_ptr, HIT_POINT dam) if (!player_ptr->current_floor_ptr->grid_array[y][x].is_mirror()) continue; - if (!affect_monster(player_ptr, 0, 0, y, x, dam, GF_GENOCIDE, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP), true)) + if (!affect_monster(player_ptr, 0, 0, y, x, dam, AttributeType::GENOCIDE, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP), true)) continue; if (!player_ptr->current_floor_ptr->grid_array[y][x].m_idx) { @@ -443,9 +443,9 @@ bool cast_mirror_spell(player_type *player_ptr, mind_mirror_master_type spell) return false; if (plev > 9 && g_ptr->is_mirror()) - fire_beam(player_ptr, GF_LITE, dir, damroll(3 + ((plev - 1) / 5), 4)); + fire_beam(player_ptr, AttributeType::LITE, dir, damroll(3 + ((plev - 1) / 5), 4)); else - fire_bolt(player_ptr, GF_LITE, dir, damroll(3 + ((plev - 1) / 5), 4)); + fire_bolt(player_ptr, AttributeType::LITE, dir, damroll(3 + ((plev - 1) / 5), 4)); break; case WRAPPED_MIRROR: @@ -464,19 +464,19 @@ bool cast_mirror_spell(player_type *player_ptr, mind_mirror_master_type spell) if (!get_aim_dir(player_ptr, &dir)) return false; - (void)fire_beam(player_ptr, GF_AWAY_ALL, dir, plev); + (void)fire_beam(player_ptr, AttributeType::AWAY_ALL, dir, plev); break; case MIRROR_CRASHING: if (!get_aim_dir(player_ptr, &dir)) return false; - fire_ball(player_ptr, GF_SHARDS, dir, damroll(8 + ((plev - 5) / 4), 8), (plev > 20 ? (plev - 20) / 8 + 1 : 0)); + fire_ball(player_ptr, AttributeType::SHARDS, dir, damroll(8 + ((plev - 5) / 4), 8), (plev > 20 ? (plev - 20) / 8 + 1 : 0)); break; case SLEEPING_MIRROR: for (x = 0; x < player_ptr->current_floor_ptr->width; x++) for (y = 0; y < player_ptr->current_floor_ptr->height; y++) if (player_ptr->current_floor_ptr->grid_array[y][x].is_mirror()) - project(player_ptr, 0, 2, y, x, (HIT_POINT)plev, GF_OLD_SLEEP, + project(player_ptr, 0, 2, y, x, (HIT_POINT)plev, AttributeType::OLD_SLEEP, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI)); break; @@ -484,7 +484,7 @@ bool cast_mirror_spell(player_type *player_ptr, mind_mirror_master_type spell) if (!get_aim_dir(player_ptr, &dir)) return false; - fire_beam(player_ptr, GF_SEEKER, dir, damroll(11 + (plev - 5) / 4, 8)); + fire_beam(player_ptr, AttributeType::SEEKER, dir, damroll(11 + (plev - 5) / 4, 8)); break; case SEALING_MIRROR: seal_of_mirror(player_ptr, plev * 4 + 100); @@ -503,7 +503,7 @@ bool cast_mirror_spell(player_type *player_ptr, mind_mirror_master_type spell) if (!get_aim_dir(player_ptr, &dir)) return false; - fire_beam(player_ptr, GF_SUPER_RAY, dir, 150 + randint1(2 * plev)); + fire_beam(player_ptr, AttributeType::SUPER_RAY, dir, 150 + randint1(2 * plev)); break; case ILLUSION_LIGHT: tmp = g_ptr->is_mirror() ? 4 : 3; diff --git a/src/mind/mind-ninja.cpp b/src/mind/mind-ninja.cpp index 0eaaebbaa..8a21b00e1 100644 --- a/src/mind/mind-ninja.cpp +++ b/src/mind/mind-ninja.cpp @@ -42,7 +42,7 @@ #include "spell-kind/spells-lite.h" #include "spell-kind/spells-perception.h" #include "spell-kind/spells-teleport.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell/spells-status.h" #include "status/action-setter.h" #include "status/body-improvement.h" @@ -409,7 +409,7 @@ bool cast_ninja_spell(player_type *player_ptr, mind_ninja_type spell) set_tim_levitation(player_ptr, randint1(20) + 20, false); break; case HIDE_FLAMES: - fire_ball(player_ptr, GF_FIRE, 0, 50 + plev, plev / 10 + 2); + fire_ball(player_ptr, AttributeType::FIRE, 0, 50 + plev, plev / 10 + 2); teleport_player(player_ptr, 30, TELEPORT_SPONTANEOUS); set_oppose_fire(player_ptr, (TIME_EFFECT)plev, false); break; @@ -446,7 +446,7 @@ bool cast_ninja_spell(player_type *player_ptr, mind_ninja_type spell) if (!get_aim_dir(player_ptr, &dir)) return false; - fire_ball(player_ptr, GF_OLD_CONF, dir, plev * 3, 3); + fire_ball(player_ptr, AttributeType::OLD_CONF, dir, plev * 3, 3); break; case SWAP_POSITION: project_length = -1; @@ -466,15 +466,15 @@ bool cast_ninja_spell(player_type *player_ptr, mind_ninja_type spell) set_oppose_acid(player_ptr, (TIME_EFFECT)plev, false); break; case HIDE_MIST: - fire_ball(player_ptr, GF_POIS, 0, 75 + plev * 2 / 3, plev / 5 + 2); - fire_ball(player_ptr, GF_HYPODYNAMIA, 0, 75 + plev * 2 / 3, plev / 5 + 2); - fire_ball(player_ptr, GF_CONFUSION, 0, 75 + plev * 2 / 3, plev / 5 + 2); + fire_ball(player_ptr, AttributeType::POIS, 0, 75 + plev * 2 / 3, plev / 5 + 2); + fire_ball(player_ptr, AttributeType::HYPODYNAMIA, 0, 75 + plev * 2 / 3, plev / 5 + 2); + fire_ball(player_ptr, AttributeType::CONFUSION, 0, 75 + plev * 2 / 3, plev / 5 + 2); teleport_player(player_ptr, 30, TELEPORT_SPONTANEOUS); break; case PURGATORY_FLAME: { int num = damroll(3, 9); for (int k = 0; k < num; k++) { - EFFECT_ID typ = one_in_(2) ? GF_FIRE : one_in_(3) ? GF_NETHER : GF_PLASMA; + AttributeType typ = one_in_(2) ? AttributeType::FIRE : one_in_(3) ? AttributeType::NETHER : AttributeType::PLASMA; int attempts = 1000; while (attempts--) { scatter(player_ptr, &y, &x, player_ptr->y, player_ptr->x, 4, PROJECT_NONE); diff --git a/src/mind/mind-weaponsmith.cpp b/src/mind/mind-weaponsmith.cpp index 2a02a518f..c78ada078 100644 --- a/src/mind/mind-weaponsmith.cpp +++ b/src/mind/mind-weaponsmith.cpp @@ -467,13 +467,13 @@ static void add_essence(player_type *player_ptr, SmithCategory mode) return; } - const auto effect_flags = Smith::get_effect_tr_flags(effect); + const auto attribute_flags = Smith::get_effect_tr_flags(effect); auto add_essence_count = 1; - if (effect_flags.has_any_of(TR_PVAL_FLAG_MASK)) { + if (attribute_flags.has_any_of(TR_PVAL_FLAG_MASK)) { if (o_ptr->pval < 0) { msg_print(_("このアイテムの能力修正を強化することはできない。", "You cannot increase magic number of this item.")); return; - } else if (effect_flags.has(TR_BLOWS)) { + } else if (attribute_flags.has(TR_BLOWS)) { if ((o_ptr->pval > 1) && !get_check(_("修正値は1になります。よろしいですか?", "The magic number of this weapon will become 1. Are you sure? "))) { return; } diff --git a/src/monster-attack/monster-attack-player.cpp b/src/monster-attack/monster-attack-player.cpp index 822d137c2..1a342568b 100644 --- a/src/monster-attack/monster-attack-player.cpp +++ b/src/monster-attack/monster-attack-player.cpp @@ -243,7 +243,7 @@ static void monster_explode(player_type *player_ptr, monap_type *monap_ptr) } sound(SOUND_EXPLODE); - MonsterDamageProcessor mdp(player_ptr, monap_ptr->m_idx, monap_ptr->m_ptr->hp + 1, &monap_ptr->fear, GF_NONE); + MonsterDamageProcessor mdp(player_ptr, monap_ptr->m_idx, monap_ptr->m_ptr->hp + 1, &monap_ptr->fear, AttributeType::NONE); if (mdp.mon_take_hit(nullptr)) { monap_ptr->blinked = false; monap_ptr->alive = false; diff --git a/src/monster-attack/monster-attack-types.cpp b/src/monster-attack/monster-attack-types.cpp index 388057ff6..c9333fdb1 100644 --- a/src/monster-attack/monster-attack-types.cpp +++ b/src/monster-attack/monster-attack-types.cpp @@ -1,6 +1,6 @@ #include "monster-attack/monster-attack-types.h" #include "monster-attack/monster-attack-effect.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" /*! * @brief モンスターの打撃効力テーブル / @@ -9,188 +9,188 @@ const mbe_info_type mbe_info[static_cast(RaceBlowEffectType::MAX)] = { { 0, - 0, + AttributeType::NONE, }, /* None */ { 60, - GF_MISSILE, + AttributeType::MISSILE, }, /* HURT */ { 5, - GF_POIS, + AttributeType::POIS, }, /* POISON */ { 20, - GF_DISENCHANT, + AttributeType::DISENCHANT, }, /* UN_BONUS */ { 15, - GF_MISSILE, + AttributeType::MISSILE, }, /* UN_POWER */ /* ToDo: Apply the correct effects */ { 5, - GF_MISSILE, + AttributeType::MISSILE, }, /* EAT_GOLD */ { 5, - GF_MISSILE, + AttributeType::MISSILE, }, /* EAT_ITEM */ { 5, - GF_MISSILE, + AttributeType::MISSILE, }, /* EAT_FOOD */ { 5, - GF_MISSILE, + AttributeType::MISSILE, }, /* EAT_LITE */ { 0, - GF_ACID, + AttributeType::ACID, }, /* ACID */ { 10, - GF_ELEC, + AttributeType::ELEC, }, /* ELEC */ { 10, - GF_FIRE, + AttributeType::FIRE, }, /* FIRE */ { 10, - GF_COLD, + AttributeType::COLD, }, /* COLD */ { 2, - GF_MISSILE, + AttributeType::MISSILE, }, /* BLIND */ { 10, - GF_CONFUSION, + AttributeType::CONFUSION, }, /* CONFUSE */ { 10, - GF_MISSILE, + AttributeType::MISSILE, }, /* TERRIFY */ { 2, - GF_MISSILE, + AttributeType::MISSILE, }, /* PARALYZE */ { 0, - GF_MISSILE, + AttributeType::MISSILE, }, /* LOSE_STR */ { 0, - GF_MISSILE, + AttributeType::MISSILE, }, /* LOSE_INT */ { 0, - GF_MISSILE, + AttributeType::MISSILE, }, /* LOSE_WIS */ { 0, - GF_MISSILE, + AttributeType::MISSILE, }, /* LOSE_DEX */ { 0, - GF_MISSILE, + AttributeType::MISSILE, }, /* LOSE_CON */ { 0, - GF_MISSILE, + AttributeType::MISSILE, }, /* LOSE_CHR */ { 2, - GF_MISSILE, + AttributeType::MISSILE, }, /* LOSE_ALL */ { 60, - GF_ROCKET, + AttributeType::ROCKET, }, /* SHATTER */ { 5, - GF_MISSILE, + AttributeType::MISSILE, }, /* EXP_10 */ { 5, - GF_MISSILE, + AttributeType::MISSILE, }, /* EXP_20 */ { 5, - GF_MISSILE, + AttributeType::MISSILE, }, /* EXP_40 */ { 5, - GF_MISSILE, + AttributeType::MISSILE, }, /* EXP_80 */ { 5, - GF_POIS, + AttributeType::POIS, }, /* DISEASE */ { 5, - GF_TIME, + AttributeType::TIME, }, /* TIME */ { 5, - GF_MISSILE, + AttributeType::MISSILE, }, /* EXP_VAMP */ { 5, - GF_MANA, + AttributeType::MANA, }, /* DR_MANA */ { 60, - GF_MISSILE, + AttributeType::MISSILE, }, /* SUPERHURT */ { 5, - GF_MISSILE, + AttributeType::MISSILE, }, /* INERTIA */ { 5, - GF_MISSILE, + AttributeType::MISSILE, }, /* STUN */ { 5, - GF_MISSILE, + AttributeType::MISSILE, }, /* HUNGRY */ { 0, - GF_NONE, + AttributeType::NONE, }, /* FLAVOR */ }; diff --git a/src/monster-attack/monster-attack-types.h b/src/monster-attack/monster-attack-types.h index b16a7abd0..ecacb9e8d 100644 --- a/src/monster-attack/monster-attack-types.h +++ b/src/monster-attack/monster-attack-types.h @@ -2,6 +2,7 @@ #include "monster-attack/monster-attack-effect.h" #include "system/angband.h" +#include "effect/attribute-types.h" /*! * @note モンスターの打撃方法 / New monster blow methods @@ -43,7 +44,7 @@ enum rbm_type { typedef struct mbe_info_type { int power; /* The attack "power" */ - int explode_type; /* Explosion effect */ + AttributeType explode_type; /* Explosion effect */ } mbe_info_type; extern const mbe_info_type mbe_info[static_cast(RaceBlowEffectType::MAX)]; diff --git a/src/monster-floor/monster-death.cpp b/src/monster-floor/monster-death.cpp index 3820d402d..e3e812067 100644 --- a/src/monster-floor/monster-death.cpp +++ b/src/monster-floor/monster-death.cpp @@ -67,7 +67,7 @@ static void on_dead_explosion(player_type *player_ptr, monster_death_type *md_pt continue; BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL; - EFFECT_ID typ = mbe_info[enum2i(md_ptr->r_ptr->blow[i].effect)].explode_type; + AttributeType typ = mbe_info[enum2i(md_ptr->r_ptr->blow[i].effect)].explode_type; DICE_NUMBER d_dice = md_ptr->r_ptr->blow[i].d_dice; DICE_SID d_side = md_ptr->r_ptr->blow[i].d_side; HIT_POINT damage = damroll(d_dice, d_side); @@ -343,13 +343,13 @@ static void on_defeat_last_boss(player_type *player_ptr) * Handle the "death" of a monster. * @param m_idx 死亡したモンスターのID * @param drop_item TRUEならばモンスターのドロップ処理を行う - * @param effect_type ラストアタックの属性 (単一属性) + * @param type ラストアタックの属性 (単一属性) */ -void monster_death(player_type *player_ptr, MONSTER_IDX m_idx, bool drop_item, EFFECT_ID effect_type) +void monster_death(player_type *player_ptr, MONSTER_IDX m_idx, bool drop_item, AttributeType type) { - EffectFlags flags; + AttributeFlags flags; flags.clear(); - flags.set((spells_type)effect_type); + flags.set(type); monster_death(player_ptr, m_idx, drop_item, flags); } @@ -358,7 +358,7 @@ void monster_death(player_type *player_ptr, MONSTER_IDX m_idx, bool drop_item, E * Handle the "death" of a monster. * @param m_idx 死亡したモンスターのID * @param drop_item TRUEならばモンスターのドロップ処理を行う - * @param effect_flags ラストアタックの属性 (複数属性) + * @param attribute_flags ラストアタックの属性 (複数属性) * @details *
  * Disperse treasures centered at the monster location based on the
@@ -370,7 +370,7 @@ void monster_death(player_type *player_ptr, MONSTER_IDX m_idx, bool drop_item, E
  * it drops all of its objects, which may disappear in crowded rooms.
  * 
*/ -void monster_death(player_type *player_ptr, MONSTER_IDX m_idx, bool drop_item, EffectFlags effect_flags) +void monster_death(player_type *player_ptr, MONSTER_IDX m_idx, bool drop_item, AttributeFlags attribute_flags) { monster_death_type tmp_md; monster_death_type *md_ptr = initialize_monster_death_type(player_ptr, &tmp_md, m_idx, drop_item); @@ -402,7 +402,7 @@ void monster_death(player_type *player_ptr, MONSTER_IDX m_idx, bool drop_item, E drop_corpse(player_ptr, md_ptr); monster_drop_carried_objects(player_ptr, md_ptr->m_ptr); decide_drop_quality(md_ptr); - switch_special_death(player_ptr, md_ptr, effect_flags); + switch_special_death(player_ptr, md_ptr, attribute_flags); drop_artifact(player_ptr, md_ptr); int drop_numbers = decide_drop_numbers(player_ptr, md_ptr, drop_item); coin_type = md_ptr->force_coin; diff --git a/src/monster-floor/monster-death.h b/src/monster-floor/monster-death.h index a70bd68b4..28b7835b6 100644 --- a/src/monster-floor/monster-death.h +++ b/src/monster-floor/monster-death.h @@ -2,10 +2,10 @@ #include "system/angband.h" #include "monster-floor/monster-death-util.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" struct player_type; -void monster_death(player_type *player_ptr, MONSTER_IDX m_idx, bool drop_item, EffectFlags effect_flags); -void monster_death(player_type *player_ptr, MONSTER_IDX m_idx, bool drop_item, EFFECT_ID effect_type); +void monster_death(player_type *player_ptr, MONSTER_IDX m_idx, bool drop_item, AttributeFlags attribute_flags); +void monster_death(player_type *player_ptr, MONSTER_IDX m_idx, bool drop_item, AttributeType type); bool drop_single_artifact(player_type *player_ptr, monster_death_type *md_ptr, ARTIFACT_IDX a_idx); concptr extract_note_dies(MONRACE_IDX r_idx); diff --git a/src/monster-floor/monster-move.cpp b/src/monster-floor/monster-move.cpp index 68f2de033..d809fe19f 100644 --- a/src/monster-floor/monster-move.cpp +++ b/src/monster-floor/monster-move.cpp @@ -33,7 +33,7 @@ #include "monster/monster-update.h" #include "pet/pet-util.h" #include "player/player-status-flags.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/floor-type-definition.h" #include "system/grid-type-definition.h" #include "system/monster-race-definition.h" @@ -264,7 +264,7 @@ static bool process_explosive_rune(player_type *player_ptr, turn_flags *turn_fla if (g_ptr->info & CAVE_MARK) { msg_print(_("ルーンが爆発した!", "The rune explodes!")); BIT_FLAGS project_flags = PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI; - project(player_ptr, 0, 2, ny, nx, 2 * (player_ptr->lev + damroll(7, 7)), GF_MANA, project_flags); + project(player_ptr, 0, 2, ny, nx, 2 * (player_ptr->lev + damroll(7, 7)), AttributeType::MANA, project_flags); } } else { msg_print(_("爆発のルーンは解除された。", "An explosive rune was disarmed.")); diff --git a/src/monster-floor/one-monster-placer.cpp b/src/monster-floor/one-monster-placer.cpp index 10b446577..05eecb271 100644 --- a/src/monster-floor/one-monster-placer.cpp +++ b/src/monster-floor/one-monster-placer.cpp @@ -36,7 +36,7 @@ #include "monster/monster-util.h" #include "object/warning.h" #include "player/player-status.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/floor-type-definition.h" #include "system/grid-type-definition.h" #include "system/monster-race-definition.h" @@ -397,7 +397,7 @@ bool place_monster_one(player_type *player_ptr, MONSTER_IDX who, POSITION y, POS if (randint1(BREAK_RUNE_EXPLOSION) > r_ptr->level) { if (any_bits(g_ptr->info, CAVE_MARK)) { msg_print(_("ルーンが爆発した!", "The rune explodes!")); - project(player_ptr, 0, 2, y, x, 2 * (player_ptr->lev + damroll(7, 7)), GF_MANA, + project(player_ptr, 0, 2, y, x, 2 * (player_ptr->lev + damroll(7, 7)), AttributeType::MANA, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI)); } } else { diff --git a/src/monster-floor/quantum-effect.cpp b/src/monster-floor/quantum-effect.cpp index b38d310c9..3c68c43af 100644 --- a/src/monster-floor/quantum-effect.cpp +++ b/src/monster-floor/quantum-effect.cpp @@ -11,7 +11,7 @@ #include "monster/smart-learn-types.h" #include "mspell/assign-monster-spell.h" #include "mspell/mspell.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell-kind/spells-teleport.h" #include "system/floor-type-definition.h" #include "system/monster-race-definition.h" @@ -34,7 +34,7 @@ static void vanish_nonunique(player_type *player_ptr, MONSTER_IDX m_idx, bool se msg_format(_("%sは消え去った!", "%^s disappears!"), m_name); } - monster_death(player_ptr, m_idx, false, GF_NONE); + monster_death(player_ptr, m_idx, false, AttributeType::NONE); delete_monster_idx(player_ptr, m_idx); if (is_pet(m_ptr) && !(m_ptr->ml)) msg_print(_("少しの間悲しい気分になった。", "You feel sad for a moment.")); diff --git a/src/monster-floor/special-death-switcher.cpp b/src/monster-floor/special-death-switcher.cpp index 0059594cf..0ef7b8a2a 100644 --- a/src/monster-floor/special-death-switcher.cpp +++ b/src/monster-floor/special-death-switcher.cpp @@ -30,7 +30,7 @@ #include "object-enchant/apply-magic.h" #include "object-enchant/item-apply-magic.h" #include "object/object-kind-hook.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell/summon-types.h" #include "sv-definition/sv-other-types.h" #include "sv-definition/sv-protector-types.h" @@ -145,7 +145,7 @@ static void on_dead_unmaker(player_type *player_ptr, monster_death_type *md_ptr) msg_format(_("%sは辺りにログルスの残り香を撒き散らした!", "%^s sprinkled the remaining incense from Logrus!"), m_name); } - (void)project(player_ptr, md_ptr->m_idx, 6, md_ptr->md_y, md_ptr->md_x, 100, GF_CHAOS, PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL); + (void)project(player_ptr, md_ptr->m_idx, 6, md_ptr->md_y, md_ptr->md_x, 100, AttributeType::CHAOS, PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL); } static void on_dead_sacred_treasures(player_type *player_ptr, monster_death_type *md_ptr) @@ -236,7 +236,7 @@ static void on_dead_rolento(player_type *player_ptr, monster_death_type *md_ptr) msg_format(_("%sは手榴弾を抱えて自爆した!", "%^s blew himself up with grenades!"), m_name); } - (void)project(player_ptr, md_ptr->m_idx, 3, md_ptr->md_y, md_ptr->md_x, damroll(20, 10), GF_FIRE, PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL); + (void)project(player_ptr, md_ptr->m_idx, 3, md_ptr->md_y, md_ptr->md_x, damroll(20, 10), AttributeType::FIRE, PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL); } static void on_dead_aqua_illusion(player_type *player_ptr, monster_death_type *md_ptr) @@ -533,15 +533,15 @@ static void on_dead_mimics(player_type *player_ptr, monster_death_type *md_ptr) } } -static void on_dead_swordfish(player_type *player_ptr, monster_death_type *md_ptr, EffectFlags effect_flags) +static void on_dead_swordfish(player_type *player_ptr, monster_death_type *md_ptr, AttributeFlags attribute_flags) { - if (effect_flags.has_not(GF_COLD) || !md_ptr->drop_chosen_item || (randint1(100) >= 10)) + if (attribute_flags.has_not(AttributeType::COLD) || !md_ptr->drop_chosen_item || (randint1(100) >= 10)) return; drop_single_artifact(player_ptr, md_ptr, ART_FROZEN_SWORDFISH); } -void switch_special_death(player_type *player_ptr, monster_death_type *md_ptr, EffectFlags effect_flags) +void switch_special_death(player_type *player_ptr, monster_death_type *md_ptr, AttributeFlags attribute_flags) { switch (md_ptr->m_ptr->r_idx) { case MON_PINK_HORROR: @@ -622,7 +622,7 @@ void switch_special_death(player_type *player_ptr, monster_death_type *md_ptr, E on_dead_chest_mimic(player_ptr, md_ptr); break; case MON_SWORDFISH: - on_dead_swordfish(player_ptr, md_ptr, effect_flags); + on_dead_swordfish(player_ptr, md_ptr, attribute_flags); break; default: on_dead_mimics(player_ptr, md_ptr); diff --git a/src/monster-floor/special-death-switcher.h b/src/monster-floor/special-death-switcher.h index 4ae191db3..018dc4847 100644 --- a/src/monster-floor/special-death-switcher.h +++ b/src/monster-floor/special-death-switcher.h @@ -1,7 +1,7 @@ #pragma once #include "system/angband.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" typedef struct monster_death_type monster_death_type; struct player_type; -void switch_special_death(player_type *player_ptr, monster_death_type *md_ptr, EffectFlags effect_flags); +void switch_special_death(player_type *player_ptr, monster_death_type *md_ptr, AttributeFlags attribute_flags); diff --git a/src/monster-race/race-flags3.h b/src/monster-race/race-flags3.h index 7df6be3fb..16358c6ba 100644 --- a/src/monster-race/race-flags3.h +++ b/src/monster-race/race-flags3.h @@ -14,7 +14,7 @@ enum race_flags3 { RF3_XX10 = 0x00000400, /*!< 予約領域。元冷気オーラ */ RF3_NONLIVING = 0x00000800, /*!< モンスター特性: 無生物 / TY: Non-Living (?) */ RF3_HURT_LITE = 0x00001000, /*!< モンスター特性: 通常の光(GF_WEAK_LITE)でダメージを受ける / Hurt by lite */ - RF3_HURT_ROCK = 0x00002000, /*!< モンスター特性: 岩石溶解(GF_KILL_WALL)でダメージを受ける / Hurt by rock remover */ + RF3_HURT_ROCK = 0x00002000, /*!< モンスター特性: 岩石溶解(KILL_WALL)でダメージを受ける / Hurt by rock remover */ RF3_HURT_FIRE = 0x00004000, /*!< モンスター特性: 火炎が弱点 / Hurt badly by fire */ RF3_HURT_COLD = 0x00008000, /*!< モンスター特性: 冷気が弱点 / Hurt badly by cold */ RF3_ANGEL = 0x00010000, /*!< モンスター特性: 天使 / ANGEL */ diff --git a/src/monster/monster-damage.cpp b/src/monster/monster-damage.cpp index a9a763dce..2e6a4e504 100644 --- a/src/monster/monster-damage.cpp +++ b/src/monster/monster-damage.cpp @@ -55,17 +55,17 @@ * @param m_idx ダメージを与えたモンスターのID * @param dam 与えたダメージ量 * @param fear ダメージによってモンスターが恐慌状態に陥ったならばtrue - * @param effect_type 与えたダメージの種類 (単一属性) + * @param attribute 与えたダメージの種類 (単一属性) * @param note モンスターが倒された際の特別なメッセージ述語 */ -MonsterDamageProcessor::MonsterDamageProcessor(player_type *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, EFFECT_ID effect_type) +MonsterDamageProcessor::MonsterDamageProcessor(player_type *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, AttributeType attribute) : player_ptr(player_ptr) , m_idx(m_idx) , dam(dam) , fear(fear) { - this->effect_flags.clear(); - this->effect_flags.set((spells_type)effect_type); + this->attribute_flags.clear(); + this->attribute_flags.set((AttributeType)attribute); } /* @@ -74,15 +74,15 @@ MonsterDamageProcessor::MonsterDamageProcessor(player_type *player_ptr, MONSTER_ * @param m_idx ダメージを与えたモンスターのID * @param dam 与えたダメージ量 * @param fear ダメージによってモンスターが恐慌状態に陥ったならばtrue - * @param effect_flags 与えたダメージの種類 (複数属性) + * @param attribute_flags 与えたダメージの種類 (複数属性) * @param note モンスターが倒された際の特別なメッセージ述語 */ -MonsterDamageProcessor::MonsterDamageProcessor(player_type *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, EffectFlags effect_flags) +MonsterDamageProcessor::MonsterDamageProcessor(player_type *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, AttributeFlags attribute_flags) : player_ptr(player_ptr) , m_idx(m_idx) , dam(dam) , fear(fear) - , effect_flags(effect_flags) + , attribute_flags(attribute_flags) { } @@ -163,7 +163,7 @@ bool MonsterDamageProcessor::process_dead_exp_virtue(concptr note, monster_type sound(SOUND_KILL); this->show_kill_message(note, m_name); this->show_bounty_message(m_name); - monster_death(this->player_ptr, this->m_idx, true, this->effect_flags); + monster_death(this->player_ptr, this->m_idx, true, this->attribute_flags); this->summon_special_unique(); this->get_exp_from_mon(exp_mon, exp_mon->max_maxhp * 2); *this->fear = false; diff --git a/src/monster/monster-damage.h b/src/monster/monster-damage.h index 48c3ad843..0802e02b9 100644 --- a/src/monster/monster-damage.h +++ b/src/monster/monster-damage.h @@ -2,7 +2,7 @@ #include "monster-race/race-indice-types.h" #include "system/angband.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "util/flag-group.h" #include #include @@ -13,8 +13,8 @@ struct player_type; typedef std::vector> combined_uniques; class MonsterDamageProcessor { public: - MonsterDamageProcessor(player_type *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, EFFECT_ID effect_type); - MonsterDamageProcessor(player_type *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, EffectFlags effect_flags); + MonsterDamageProcessor(player_type *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, AttributeType type); + MonsterDamageProcessor(player_type *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, AttributeFlags attribute_flags); virtual ~MonsterDamageProcessor() = default; bool mon_take_hit(concptr note); @@ -23,7 +23,7 @@ private: MONSTER_IDX m_idx; HIT_POINT dam; bool *fear; - EffectFlags effect_flags{}; + AttributeFlags attribute_flags{}; void get_exp_from_mon(monster_type *m_ptr, HIT_POINT exp_dam); bool genocide_chaos_patron(); bool process_dead_exp_virtue(concptr note, monster_type *exp_mon); diff --git a/src/mspell/assign-monster-spell.cpp b/src/mspell/assign-monster-spell.cpp index 16a77ae60..bededa51f 100644 --- a/src/mspell/assign-monster-spell.cpp +++ b/src/mspell/assign-monster-spell.cpp @@ -20,7 +20,7 @@ #include "mspell/mspell-summon.h" #include "mspell/mspell-util.h" #include "mspell/mspell.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/player-type-definition.h" #include "util/enum-converter.h" @@ -36,30 +36,30 @@ static MonsterSpellResult monspell_to_player_impl(player_type *player_ptr, RF_AB case RF_ABILITY::XXX2: break; /* RF4_XXX2 */ case RF_ABILITY::XXX3: break; /* RF4_XXX3 */ case RF_ABILITY::XXX4: break; /* RF4_XXX4 */ - case RF_ABILITY::BR_ACID: return spell_RF4_BREATH(player_ptr, GF_ACID, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_ACID */ - case RF_ABILITY::BR_ELEC: return spell_RF4_BREATH(player_ptr, GF_ELEC, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_ELEC */ - case RF_ABILITY::BR_FIRE: return spell_RF4_BREATH(player_ptr, GF_FIRE, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_FIRE */ - case RF_ABILITY::BR_COLD: return spell_RF4_BREATH(player_ptr, GF_COLD, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_COLD */ - case RF_ABILITY::BR_POIS: return spell_RF4_BREATH(player_ptr, GF_POIS, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_POIS */ - case RF_ABILITY::BR_NETH: return spell_RF4_BREATH(player_ptr, GF_NETHER, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_NETH */ - case RF_ABILITY::BR_LITE: return spell_RF4_BREATH(player_ptr, GF_LITE, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_LITE */ - case RF_ABILITY::BR_DARK: return spell_RF4_BREATH(player_ptr, GF_DARK, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_DARK */ - case RF_ABILITY::BR_CONF: return spell_RF4_BREATH(player_ptr, GF_CONFUSION, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_CONF */ - case RF_ABILITY::BR_SOUN: return spell_RF4_BREATH(player_ptr, GF_SOUND, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_SOUN */ - case RF_ABILITY::BR_CHAO: return spell_RF4_BREATH(player_ptr, GF_CHAOS, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_CHAO */ - case RF_ABILITY::BR_DISE: return spell_RF4_BREATH(player_ptr, GF_DISENCHANT, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_DISE */ - case RF_ABILITY::BR_NEXU: return spell_RF4_BREATH(player_ptr, GF_NEXUS, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_NEXU */ - case RF_ABILITY::BR_TIME: return spell_RF4_BREATH(player_ptr, GF_TIME, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_TIME */ - case RF_ABILITY::BR_INER: return spell_RF4_BREATH(player_ptr, GF_INERTIAL, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_INER */ - case RF_ABILITY::BR_GRAV: return spell_RF4_BREATH(player_ptr, GF_GRAVITY, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_GRAV */ - case RF_ABILITY::BR_SHAR: return spell_RF4_BREATH(player_ptr, GF_SHARDS, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_SHAR */ - case RF_ABILITY::BR_PLAS: return spell_RF4_BREATH(player_ptr, GF_PLASMA, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_PLAS */ - case RF_ABILITY::BR_FORC: return spell_RF4_BREATH(player_ptr, GF_FORCE, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_WALL */ - case RF_ABILITY::BR_MANA: return spell_RF4_BREATH(player_ptr, GF_MANA, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_MANA */ + case RF_ABILITY::BR_ACID: return spell_RF4_BREATH(player_ptr, AttributeType::ACID, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_ACID */ + case RF_ABILITY::BR_ELEC: return spell_RF4_BREATH(player_ptr, AttributeType::ELEC, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_ELEC */ + case RF_ABILITY::BR_FIRE: return spell_RF4_BREATH(player_ptr, AttributeType::FIRE, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_FIRE */ + case RF_ABILITY::BR_COLD: return spell_RF4_BREATH(player_ptr, AttributeType::COLD, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_COLD */ + case RF_ABILITY::BR_POIS: return spell_RF4_BREATH(player_ptr, AttributeType::POIS, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_POIS */ + case RF_ABILITY::BR_NETH: return spell_RF4_BREATH(player_ptr, AttributeType::NETHER, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_NETH */ + case RF_ABILITY::BR_LITE: return spell_RF4_BREATH(player_ptr, AttributeType::LITE, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_LITE */ + case RF_ABILITY::BR_DARK: return spell_RF4_BREATH(player_ptr, AttributeType::DARK, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_DARK */ + case RF_ABILITY::BR_CONF: return spell_RF4_BREATH(player_ptr, AttributeType::CONFUSION, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_CONF */ + case RF_ABILITY::BR_SOUN: return spell_RF4_BREATH(player_ptr, AttributeType::SOUND, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_SOUN */ + case RF_ABILITY::BR_CHAO: return spell_RF4_BREATH(player_ptr, AttributeType::CHAOS, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_CHAO */ + case RF_ABILITY::BR_DISE: return spell_RF4_BREATH(player_ptr, AttributeType::DISENCHANT, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_DISE */ + case RF_ABILITY::BR_NEXU: return spell_RF4_BREATH(player_ptr, AttributeType::NEXUS, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_NEXU */ + case RF_ABILITY::BR_TIME: return spell_RF4_BREATH(player_ptr, AttributeType::TIME, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_TIME */ + case RF_ABILITY::BR_INER: return spell_RF4_BREATH(player_ptr, AttributeType::INERTIAL, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_INER */ + case RF_ABILITY::BR_GRAV: return spell_RF4_BREATH(player_ptr, AttributeType::GRAVITY, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_GRAV */ + case RF_ABILITY::BR_SHAR: return spell_RF4_BREATH(player_ptr, AttributeType::SHARDS, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_SHAR */ + case RF_ABILITY::BR_PLAS: return spell_RF4_BREATH(player_ptr, AttributeType::PLASMA, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_PLAS */ + case RF_ABILITY::BR_FORC: return spell_RF4_BREATH(player_ptr, AttributeType::FORCE, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_WALL */ + case RF_ABILITY::BR_MANA: return spell_RF4_BREATH(player_ptr, AttributeType::MANA, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_MANA */ case RF_ABILITY::BA_NUKE: return spell_RF4_BA_NUKE(player_ptr, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BA_NUKE */ - case RF_ABILITY::BR_NUKE: return spell_RF4_BREATH(player_ptr, GF_NUKE, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_NUKE */ + case RF_ABILITY::BR_NUKE: return spell_RF4_BREATH(player_ptr, AttributeType::NUKE, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_NUKE */ case RF_ABILITY::BA_CHAO: return spell_RF4_BA_CHAO(player_ptr, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BA_CHAO */ - case RF_ABILITY::BR_DISI: return spell_RF4_BREATH(player_ptr, GF_DISINTEGRATE, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_DISI */ + case RF_ABILITY::BR_DISI: return spell_RF4_BREATH(player_ptr, AttributeType::DISINTEGRATE, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF4_BR_DISI */ case RF_ABILITY::BA_ACID: return spell_RF5_BA_ACID(player_ptr, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF5_BA_ACID */ case RF_ABILITY::BA_ELEC: return spell_RF5_BA_ELEC(player_ptr, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF5_BA_ELEC */ case RF_ABILITY::BA_FIRE: return spell_RF5_BA_FIRE(player_ptr, y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF5_BA_FIRE */ @@ -144,30 +144,30 @@ static MonsterSpellResult monspell_to_monster_impl( case RF_ABILITY::XXX2: break; /* RF4_XXX2 */ case RF_ABILITY::XXX3: break; /* RF4_XXX3 */ case RF_ABILITY::XXX4: break; /* RF4_XXX4 */ - case RF_ABILITY::BR_ACID: return spell_RF4_BREATH(player_ptr, GF_ACID, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_ACID */ - case RF_ABILITY::BR_ELEC: return spell_RF4_BREATH(player_ptr, GF_ELEC, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_ELEC */ - case RF_ABILITY::BR_FIRE: return spell_RF4_BREATH(player_ptr, GF_FIRE, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_FIRE */ - case RF_ABILITY::BR_COLD: return spell_RF4_BREATH(player_ptr, GF_COLD, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_COLD */ - case RF_ABILITY::BR_POIS: return spell_RF4_BREATH(player_ptr, GF_POIS, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_POIS */ - case RF_ABILITY::BR_NETH: return spell_RF4_BREATH(player_ptr, GF_NETHER, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_NETH */ - case RF_ABILITY::BR_LITE: return spell_RF4_BREATH(player_ptr, GF_LITE, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_LITE */ - case RF_ABILITY::BR_DARK: return spell_RF4_BREATH(player_ptr, GF_DARK, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_DARK */ - case RF_ABILITY::BR_CONF: return spell_RF4_BREATH(player_ptr, GF_CONFUSION, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_CONF */ - case RF_ABILITY::BR_SOUN: return spell_RF4_BREATH(player_ptr, GF_SOUND, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_SOUN */ - case RF_ABILITY::BR_CHAO: return spell_RF4_BREATH(player_ptr, GF_CHAOS, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_CHAO */ - case RF_ABILITY::BR_DISE: return spell_RF4_BREATH(player_ptr, GF_DISENCHANT, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_DISE */ - case RF_ABILITY::BR_NEXU: return spell_RF4_BREATH(player_ptr, GF_NEXUS, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_NEXU */ - case RF_ABILITY::BR_TIME: return spell_RF4_BREATH(player_ptr, GF_TIME, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_TIME */ - case RF_ABILITY::BR_INER: return spell_RF4_BREATH(player_ptr, GF_INERTIAL, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_INER */ - case RF_ABILITY::BR_GRAV: return spell_RF4_BREATH(player_ptr, GF_GRAVITY, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_GRAV */ - case RF_ABILITY::BR_SHAR: return spell_RF4_BREATH(player_ptr, GF_SHARDS, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_SHAR */ - case RF_ABILITY::BR_PLAS: return spell_RF4_BREATH(player_ptr, GF_PLASMA, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_PLAS */ - case RF_ABILITY::BR_FORC: return spell_RF4_BREATH(player_ptr, GF_FORCE, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_WALL */ - case RF_ABILITY::BR_MANA: return spell_RF4_BREATH(player_ptr, GF_MANA, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_MANA */ + case RF_ABILITY::BR_ACID: return spell_RF4_BREATH(player_ptr, AttributeType::ACID, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_ACID */ + case RF_ABILITY::BR_ELEC: return spell_RF4_BREATH(player_ptr, AttributeType::ELEC, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_ELEC */ + case RF_ABILITY::BR_FIRE: return spell_RF4_BREATH(player_ptr, AttributeType::FIRE, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_FIRE */ + case RF_ABILITY::BR_COLD: return spell_RF4_BREATH(player_ptr, AttributeType::COLD, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_COLD */ + case RF_ABILITY::BR_POIS: return spell_RF4_BREATH(player_ptr, AttributeType::POIS, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_POIS */ + case RF_ABILITY::BR_NETH: return spell_RF4_BREATH(player_ptr, AttributeType::NETHER, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_NETH */ + case RF_ABILITY::BR_LITE: return spell_RF4_BREATH(player_ptr, AttributeType::LITE, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_LITE */ + case RF_ABILITY::BR_DARK: return spell_RF4_BREATH(player_ptr, AttributeType::DARK, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_DARK */ + case RF_ABILITY::BR_CONF: return spell_RF4_BREATH(player_ptr, AttributeType::CONFUSION, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_CONF */ + case RF_ABILITY::BR_SOUN: return spell_RF4_BREATH(player_ptr, AttributeType::SOUND, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_SOUN */ + case RF_ABILITY::BR_CHAO: return spell_RF4_BREATH(player_ptr, AttributeType::CHAOS, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_CHAO */ + case RF_ABILITY::BR_DISE: return spell_RF4_BREATH(player_ptr, AttributeType::DISENCHANT, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_DISE */ + case RF_ABILITY::BR_NEXU: return spell_RF4_BREATH(player_ptr, AttributeType::NEXUS, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_NEXU */ + case RF_ABILITY::BR_TIME: return spell_RF4_BREATH(player_ptr, AttributeType::TIME, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_TIME */ + case RF_ABILITY::BR_INER: return spell_RF4_BREATH(player_ptr, AttributeType::INERTIAL, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_INER */ + case RF_ABILITY::BR_GRAV: return spell_RF4_BREATH(player_ptr, AttributeType::GRAVITY, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_GRAV */ + case RF_ABILITY::BR_SHAR: return spell_RF4_BREATH(player_ptr, AttributeType::SHARDS, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_SHAR */ + case RF_ABILITY::BR_PLAS: return spell_RF4_BREATH(player_ptr, AttributeType::PLASMA, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_PLAS */ + case RF_ABILITY::BR_FORC: return spell_RF4_BREATH(player_ptr, AttributeType::FORCE, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_WALL */ + case RF_ABILITY::BR_MANA: return spell_RF4_BREATH(player_ptr, AttributeType::MANA, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_MANA */ case RF_ABILITY::BA_NUKE: return spell_RF4_BA_NUKE(player_ptr, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BA_NUKE */ - case RF_ABILITY::BR_NUKE: return spell_RF4_BREATH(player_ptr, GF_NUKE, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_NUKE */ + case RF_ABILITY::BR_NUKE: return spell_RF4_BREATH(player_ptr, AttributeType::NUKE, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_NUKE */ case RF_ABILITY::BA_CHAO: return spell_RF4_BA_CHAO(player_ptr, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BA_CHAO */ - case RF_ABILITY::BR_DISI: return spell_RF4_BREATH(player_ptr, GF_DISINTEGRATE, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_DISI */ + case RF_ABILITY::BR_DISI: return spell_RF4_BREATH(player_ptr, AttributeType::DISINTEGRATE, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF4_BR_DISI */ case RF_ABILITY::BA_ACID: return spell_RF5_BA_ACID(player_ptr, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF5_BA_ACID */ case RF_ABILITY::BA_ELEC: return spell_RF5_BA_ELEC(player_ptr, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF5_BA_ELEC */ case RF_ABILITY::BA_FIRE: return spell_RF5_BA_FIRE(player_ptr, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF5_BA_FIRE */ diff --git a/src/mspell/mspell-ball.cpp b/src/mspell/mspell-ball.cpp index 6fda7527c..6fa5428c8 100644 --- a/src/mspell/mspell-ball.cpp +++ b/src/mspell/mspell-ball.cpp @@ -11,7 +11,7 @@ #include "mspell/mspell-damage-calculator.h" #include "mspell/mspell-util.h" #include "mspell/mspell.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/floor-type-definition.h" #include "system/monster-type-definition.h" #include "system/player-type-definition.h" @@ -36,7 +36,7 @@ MonsterSpellResult spell_RF4_BA_NUKE(player_type *player_ptr, POSITION y, POSITI monspell_message(player_ptr, m_idx, t_idx, msg, TARGET_TYPE); const auto dam = monspell_damage(player_ptr, RF_ABILITY::BA_NUKE, m_idx, DAM_ROLL); - const auto proj_res = breath(player_ptr, y, x, m_idx, GF_NUKE, dam, 2, false, TARGET_TYPE); + const auto proj_res = breath(player_ptr, y, x, m_idx, AttributeType::NUKE, dam, 2, false, TARGET_TYPE); if (TARGET_TYPE == MONSTER_TO_PLAYER) update_smart_learn(player_ptr, m_idx, DRS_POIS); @@ -65,7 +65,7 @@ MonsterSpellResult spell_RF4_BA_CHAO(player_type *player_ptr, POSITION y, POSITI monspell_message(player_ptr, m_idx, t_idx, msg, TARGET_TYPE); const auto dam = monspell_damage(player_ptr, RF_ABILITY::BA_CHAO, m_idx, DAM_ROLL); - const auto proj_res = breath(player_ptr, y, x, m_idx, GF_CHAOS, dam, 4, false, TARGET_TYPE); + const auto proj_res = breath(player_ptr, y, x, m_idx, AttributeType::CHAOS, dam, 4, false, TARGET_TYPE); if (TARGET_TYPE == MONSTER_TO_PLAYER) update_smart_learn(player_ptr, m_idx, DRS_CHAOS); @@ -96,7 +96,7 @@ MonsterSpellResult spell_RF5_BA_ACID(player_type *player_ptr, POSITION y, POSITI const auto rad = monster_is_powerful(player_ptr->current_floor_ptr, m_idx) ? 4 : 2; const auto dam = monspell_damage(player_ptr, RF_ABILITY::BA_ACID, m_idx, DAM_ROLL); - const auto proj_res = breath(player_ptr, y, x, m_idx, GF_ACID, dam, rad, false, TARGET_TYPE); + const auto proj_res = breath(player_ptr, y, x, m_idx, AttributeType::ACID, dam, rad, false, TARGET_TYPE); if (TARGET_TYPE == MONSTER_TO_PLAYER) update_smart_learn(player_ptr, m_idx, DRS_ACID); @@ -127,7 +127,7 @@ MonsterSpellResult spell_RF5_BA_ELEC(player_type *player_ptr, POSITION y, POSITI const auto rad = monster_is_powerful(player_ptr->current_floor_ptr, m_idx) ? 4 : 2; const auto dam = monspell_damage(player_ptr, RF_ABILITY::BA_ELEC, m_idx, DAM_ROLL); - const auto proj_res = breath(player_ptr, y, x, m_idx, GF_ELEC, dam, rad, false, TARGET_TYPE); + const auto proj_res = breath(player_ptr, y, x, m_idx, AttributeType::ELEC, dam, rad, false, TARGET_TYPE); if (TARGET_TYPE == MONSTER_TO_PLAYER) update_smart_learn(player_ptr, m_idx, DRS_ELEC); @@ -167,7 +167,7 @@ MonsterSpellResult spell_RF5_BA_FIRE(player_type *player_ptr, POSITION y, POSITI const auto rad = monster_is_powerful(player_ptr->current_floor_ptr, m_idx) ? 4 : 2; const auto dam = monspell_damage(player_ptr, RF_ABILITY::BA_FIRE, m_idx, DAM_ROLL); - const auto proj_res = breath(player_ptr, y, x, m_idx, GF_FIRE, dam, rad, false, TARGET_TYPE); + const auto proj_res = breath(player_ptr, y, x, m_idx, AttributeType::FIRE, dam, rad, false, TARGET_TYPE); if (TARGET_TYPE == MONSTER_TO_PLAYER) update_smart_learn(player_ptr, m_idx, DRS_FIRE); @@ -198,7 +198,7 @@ MonsterSpellResult spell_RF5_BA_COLD(player_type *player_ptr, POSITION y, POSITI const auto rad = monster_is_powerful(player_ptr->current_floor_ptr, m_idx) ? 4 : 2; const auto dam = monspell_damage(player_ptr, RF_ABILITY::BA_COLD, m_idx, DAM_ROLL); - const auto proj_res = breath(player_ptr, y, x, m_idx, GF_COLD, dam, rad, false, TARGET_TYPE); + const auto proj_res = breath(player_ptr, y, x, m_idx, AttributeType::COLD, dam, rad, false, TARGET_TYPE); if (TARGET_TYPE == MONSTER_TO_PLAYER) update_smart_learn(player_ptr, m_idx, DRS_COLD); @@ -227,7 +227,7 @@ MonsterSpellResult spell_RF5_BA_POIS(player_type *player_ptr, POSITION y, POSITI monspell_message(player_ptr, m_idx, t_idx, msg, TARGET_TYPE); const auto dam = monspell_damage(player_ptr, RF_ABILITY::BA_POIS, m_idx, DAM_ROLL); - const auto proj_res = breath(player_ptr, y, x, m_idx, GF_POIS, dam, 2, false, TARGET_TYPE); + const auto proj_res = breath(player_ptr, y, x, m_idx, AttributeType::POIS, dam, 2, false, TARGET_TYPE); if (TARGET_TYPE == MONSTER_TO_PLAYER) update_smart_learn(player_ptr, m_idx, DRS_POIS); @@ -256,7 +256,7 @@ MonsterSpellResult spell_RF5_BA_NETH(player_type *player_ptr, POSITION y, POSITI monspell_message(player_ptr, m_idx, t_idx, msg, TARGET_TYPE); const auto dam = monspell_damage(player_ptr, RF_ABILITY::BA_NETH, m_idx, DAM_ROLL); - const auto proj_res = breath(player_ptr, y, x, m_idx, GF_NETHER, dam, 2, false, TARGET_TYPE); + const auto proj_res = breath(player_ptr, y, x, m_idx, AttributeType::NETHER, dam, 2, false, TARGET_TYPE); if (TARGET_TYPE == MONSTER_TO_PLAYER) update_smart_learn(player_ptr, m_idx, DRS_NETH); @@ -298,7 +298,7 @@ MonsterSpellResult spell_RF5_BA_WATE(player_type *player_ptr, POSITION y, POSITI } const auto dam = monspell_damage(player_ptr, RF_ABILITY::BA_WATE, m_idx, DAM_ROLL); - const auto proj_res = breath(player_ptr, y, x, m_idx, GF_WATER, dam, 4, false, TARGET_TYPE); + const auto proj_res = breath(player_ptr, y, x, m_idx, AttributeType::WATER, dam, 4, false, TARGET_TYPE); auto res = MonsterSpellResult::make_valid(dam); res.learnable = proj_res.affected_player; @@ -325,7 +325,7 @@ MonsterSpellResult spell_RF5_BA_MANA(player_type *player_ptr, POSITION y, POSITI monspell_message(player_ptr, m_idx, t_idx, msg, TARGET_TYPE); const auto dam = monspell_damage(player_ptr, RF_ABILITY::BA_MANA, m_idx, DAM_ROLL); - const auto proj_res = breath(player_ptr, y, x, m_idx, GF_MANA, dam, 4, false, TARGET_TYPE); + const auto proj_res = breath(player_ptr, y, x, m_idx, AttributeType::MANA, dam, 4, false, TARGET_TYPE); auto res = MonsterSpellResult::make_valid(dam); res.learnable = proj_res.affected_player; @@ -353,7 +353,7 @@ MonsterSpellResult spell_RF5_BA_DARK(player_type *player_ptr, POSITION y, POSITI monspell_message(player_ptr, m_idx, t_idx, msg, TARGET_TYPE); const auto dam = monspell_damage(player_ptr, RF_ABILITY::BA_DARK, m_idx, DAM_ROLL); - const auto proj_res = breath(player_ptr, y, x, m_idx, GF_DARK, dam, 4, false, TARGET_TYPE); + const auto proj_res = breath(player_ptr, y, x, m_idx, AttributeType::DARK, dam, 4, false, TARGET_TYPE); if (TARGET_TYPE == MONSTER_TO_PLAYER) update_smart_learn(player_ptr, m_idx, DRS_DARK); @@ -383,7 +383,7 @@ MonsterSpellResult spell_RF5_BA_LITE(player_type *player_ptr, POSITION y, POSITI monspell_message(player_ptr, m_idx, t_idx, msg, TARGET_TYPE); const auto dam = monspell_damage(player_ptr, RF_ABILITY::BA_LITE, m_idx, DAM_ROLL); - const auto proj_res = breath(player_ptr, y, x, m_idx, GF_LITE, dam, 4, false, TARGET_TYPE); + const auto proj_res = breath(player_ptr, y, x, m_idx, AttributeType::LITE, dam, 4, false, TARGET_TYPE); if (TARGET_TYPE == MONSTER_TO_PLAYER) update_smart_learn(player_ptr, m_idx, DRS_LITE); diff --git a/src/mspell/mspell-bolt.cpp b/src/mspell/mspell-bolt.cpp index 38cb52a2c..d25d9a258 100644 --- a/src/mspell/mspell-bolt.cpp +++ b/src/mspell/mspell-bolt.cpp @@ -10,7 +10,7 @@ #include "mspell/mspell-damage-calculator.h" #include "mspell/mspell-util.h" #include "mspell/mspell.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/floor-type-definition.h" #include "system/player-type-definition.h" @@ -38,7 +38,7 @@ MonsterSpellResult spell_RF4_SHOOT(player_type *player_ptr, POSITION y, POSITION } const auto dam = monspell_damage(player_ptr, RF_ABILITY::SHOOT, m_idx, DAM_ROLL); - const auto proj_res = bolt(player_ptr, m_idx, y, x, GF_ARROW, dam, TARGET_TYPE); + const auto proj_res = bolt(player_ptr, m_idx, y, x, AttributeType::ARROW, dam, TARGET_TYPE); auto res = MonsterSpellResult::make_valid(dam); res.learnable = proj_res.affected_player; @@ -66,7 +66,7 @@ MonsterSpellResult spell_RF5_BO_ACID(player_type *player_ptr, POSITION y, POSITI monspell_message(player_ptr, m_idx, t_idx, msg, TARGET_TYPE); const auto dam = monspell_damage(player_ptr, RF_ABILITY::BO_ACID, m_idx, DAM_ROLL); - const auto proj_res = bolt(player_ptr, m_idx, y, x, GF_ACID, dam, TARGET_TYPE); + const auto proj_res = bolt(player_ptr, m_idx, y, x, AttributeType::ACID, dam, TARGET_TYPE); if (TARGET_TYPE == MONSTER_TO_PLAYER) { update_smart_learn(player_ptr, m_idx, DRS_ACID); update_smart_learn(player_ptr, m_idx, DRS_REFLECT); @@ -98,7 +98,7 @@ MonsterSpellResult spell_RF5_BO_ELEC(player_type *player_ptr, POSITION y, POSITI monspell_message(player_ptr, m_idx, t_idx, msg, TARGET_TYPE); const auto dam = monspell_damage(player_ptr, RF_ABILITY::BO_ELEC, m_idx, DAM_ROLL); - const auto proj_res = bolt(player_ptr, m_idx, y, x, GF_ELEC, dam, TARGET_TYPE); + const auto proj_res = bolt(player_ptr, m_idx, y, x, AttributeType::ELEC, dam, TARGET_TYPE); if (TARGET_TYPE == MONSTER_TO_PLAYER) { update_smart_learn(player_ptr, m_idx, DRS_ELEC); update_smart_learn(player_ptr, m_idx, DRS_REFLECT); @@ -130,7 +130,7 @@ MonsterSpellResult spell_RF5_BO_FIRE(player_type *player_ptr, POSITION y, POSITI monspell_message(player_ptr, m_idx, t_idx, msg, TARGET_TYPE); const auto dam = monspell_damage(player_ptr, RF_ABILITY::BO_FIRE, m_idx, DAM_ROLL); - const auto proj_res = bolt(player_ptr, m_idx, y, x, GF_FIRE, dam, TARGET_TYPE); + const auto proj_res = bolt(player_ptr, m_idx, y, x, AttributeType::FIRE, dam, TARGET_TYPE); if (TARGET_TYPE == MONSTER_TO_PLAYER) { update_smart_learn(player_ptr, m_idx, DRS_FIRE); update_smart_learn(player_ptr, m_idx, DRS_REFLECT); @@ -162,7 +162,7 @@ MonsterSpellResult spell_RF5_BO_COLD(player_type *player_ptr, POSITION y, POSITI monspell_message(player_ptr, m_idx, t_idx, msg, TARGET_TYPE); const auto dam = monspell_damage(player_ptr, RF_ABILITY::BO_COLD, m_idx, DAM_ROLL); - const auto proj_res = bolt(player_ptr, m_idx, y, x, GF_COLD, dam, TARGET_TYPE); + const auto proj_res = bolt(player_ptr, m_idx, y, x, AttributeType::COLD, dam, TARGET_TYPE); if (TARGET_TYPE == MONSTER_TO_PLAYER) { update_smart_learn(player_ptr, m_idx, DRS_COLD); update_smart_learn(player_ptr, m_idx, DRS_REFLECT); @@ -193,7 +193,7 @@ MonsterSpellResult spell_RF5_BO_NETH(player_type *player_ptr, POSITION y, POSITI monspell_message(player_ptr, m_idx, t_idx, msg, TARGET_TYPE); const auto dam = monspell_damage(player_ptr, RF_ABILITY::BO_NETH, m_idx, DAM_ROLL); - const auto proj_res = bolt(player_ptr, m_idx, y, x, GF_NETHER, dam, TARGET_TYPE); + const auto proj_res = bolt(player_ptr, m_idx, y, x, AttributeType::NETHER, dam, TARGET_TYPE); if (TARGET_TYPE == MONSTER_TO_PLAYER) { update_smart_learn(player_ptr, m_idx, DRS_NETH); update_smart_learn(player_ptr, m_idx, DRS_REFLECT); @@ -225,7 +225,7 @@ MonsterSpellResult spell_RF5_BO_WATE(player_type *player_ptr, POSITION y, POSITI monspell_message(player_ptr, m_idx, t_idx, msg, TARGET_TYPE); const auto dam = monspell_damage(player_ptr, RF_ABILITY::BO_WATE, m_idx, DAM_ROLL); - const auto proj_res = bolt(player_ptr, m_idx, y, x, GF_WATER, dam, TARGET_TYPE); + const auto proj_res = bolt(player_ptr, m_idx, y, x, AttributeType::WATER, dam, TARGET_TYPE); if (TARGET_TYPE == MONSTER_TO_PLAYER) { update_smart_learn(player_ptr, m_idx, DRS_REFLECT); } @@ -255,7 +255,7 @@ MonsterSpellResult spell_RF5_BO_MANA(player_type *player_ptr, POSITION y, POSITI monspell_message(player_ptr, m_idx, t_idx, msg, TARGET_TYPE); const auto dam = monspell_damage(player_ptr, RF_ABILITY::BO_MANA, m_idx, DAM_ROLL); - const auto proj_res = bolt(player_ptr, m_idx, y, x, GF_MANA, dam, TARGET_TYPE); + const auto proj_res = bolt(player_ptr, m_idx, y, x, AttributeType::MANA, dam, TARGET_TYPE); if (TARGET_TYPE == MONSTER_TO_PLAYER) { update_smart_learn(player_ptr, m_idx, DRS_REFLECT); } @@ -286,7 +286,7 @@ MonsterSpellResult spell_RF5_BO_PLAS(player_type *player_ptr, POSITION y, POSITI monspell_message(player_ptr, m_idx, t_idx, msg, TARGET_TYPE); const auto dam = monspell_damage(player_ptr, RF_ABILITY::BO_PLAS, m_idx, DAM_ROLL); - const auto proj_res = bolt(player_ptr, m_idx, y, x, GF_PLASMA, dam, TARGET_TYPE); + const auto proj_res = bolt(player_ptr, m_idx, y, x, AttributeType::PLASMA, dam, TARGET_TYPE); if (TARGET_TYPE == MONSTER_TO_PLAYER) { update_smart_learn(player_ptr, m_idx, DRS_REFLECT); } @@ -316,7 +316,7 @@ MonsterSpellResult spell_RF5_BO_ICEE(player_type *player_ptr, POSITION y, POSITI monspell_message(player_ptr, m_idx, t_idx, msg, TARGET_TYPE); const auto dam = monspell_damage(player_ptr, RF_ABILITY::BO_ICEE, m_idx, DAM_ROLL); - const auto proj_res = bolt(player_ptr, m_idx, y, x, GF_ICE, dam, TARGET_TYPE); + const auto proj_res = bolt(player_ptr, m_idx, y, x, AttributeType::ICE, dam, TARGET_TYPE); if (TARGET_TYPE == MONSTER_TO_PLAYER) { update_smart_learn(player_ptr, m_idx, DRS_COLD); update_smart_learn(player_ptr, m_idx, DRS_REFLECT); @@ -348,7 +348,7 @@ MonsterSpellResult spell_RF5_MISSILE(player_type *player_ptr, POSITION y, POSITI monspell_message(player_ptr, m_idx, t_idx, msg, TARGET_TYPE); const auto dam = monspell_damage(player_ptr, RF_ABILITY::MISSILE, m_idx, DAM_ROLL); - const auto proj_res = bolt(player_ptr, m_idx, y, x, GF_MISSILE, dam, TARGET_TYPE); + const auto proj_res = bolt(player_ptr, m_idx, y, x, AttributeType::MISSILE, dam, TARGET_TYPE); if (TARGET_TYPE == MONSTER_TO_PLAYER) { update_smart_learn(player_ptr, m_idx, DRS_REFLECT); } diff --git a/src/mspell/mspell-breath.cpp b/src/mspell/mspell-breath.cpp index 8160a6434..9e8a444f4 100644 --- a/src/mspell/mspell-breath.cpp +++ b/src/mspell/mspell-breath.cpp @@ -12,7 +12,7 @@ #include "mspell/mspell-damage-calculator.h" #include "mspell/mspell-util.h" #include "mspell/mspell.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/floor-type-definition.h" #include "system/monster-type-definition.h" #include "system/player-type-definition.h" @@ -24,17 +24,17 @@ * @param GF_TYPE 魔法効果 * @return 表示したらTRUE、しなかったらFALSE */ -static bool spell_RF4_BREATH_special_message(MONSTER_IDX r_idx, int GF_TYPE, concptr m_name) +static bool spell_RF4_BREATH_special_message(MONSTER_IDX r_idx, AttributeType GF_TYPE, concptr m_name) { - if (r_idx == MON_JAIAN && GF_TYPE == GF_SOUND) { + if (r_idx == MON_JAIAN && GF_TYPE == AttributeType::SOUND) { msg_format(_("%^s「ボォエ~~~~~~」", "%^s sings, 'Booooeeeeee'"), m_name); return true; } - if (r_idx == MON_BOTEI && GF_TYPE == GF_SHARDS) { + if (r_idx == MON_BOTEI && GF_TYPE == AttributeType::SHARDS) { msg_format(_("%^s「ボ帝ビルカッター!!!」", "%^s shouts, 'Boty-Build cutter!!!'"), m_name); return true; } - if (r_idx == MON_RAOU &&GF_TYPE == GF_FORCE) { + if (r_idx == MON_RAOU && GF_TYPE == AttributeType::FORCE) { if (one_in_(2)) msg_format(_("%^s「北斗剛掌波!!」", "%^s says, 'Hokuto Goh-Sho-Ha!!'"), m_name); else @@ -56,7 +56,7 @@ static bool spell_RF4_BREATH_special_message(MONSTER_IDX r_idx, int GF_TYPE, con * * プレイヤーに当たったらラーニング可。 */ -MonsterSpellResult spell_RF4_BREATH(player_type *player_ptr, int GF_TYPE, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) +MonsterSpellResult spell_RF4_BREATH(player_type *player_ptr, AttributeType GF_TYPE, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE) { HIT_POINT dam, drs_type = 0; concptr type_s; @@ -72,112 +72,112 @@ MonsterSpellResult spell_RF4_BREATH(player_type *player_ptr, int GF_TYPE, POSITI monster_name(player_ptr, t_idx, t_name); switch (GF_TYPE) { - case GF_ACID: + case AttributeType::ACID: dam = monspell_damage(player_ptr, RF_ABILITY::BR_ACID, m_idx, DAM_ROLL); type_s = _("酸", "acid"); drs_type = DRS_ACID; break; - case GF_ELEC: + case AttributeType::ELEC: dam = monspell_damage(player_ptr, RF_ABILITY::BR_ELEC, m_idx, DAM_ROLL); type_s = _("稲妻", "lightning"); drs_type = DRS_ELEC; break; - case GF_FIRE: + case AttributeType::FIRE: dam = monspell_damage(player_ptr, RF_ABILITY::BR_FIRE, m_idx, DAM_ROLL); type_s = _("火炎", "fire"); drs_type = DRS_FIRE; break; - case GF_COLD: + case AttributeType::COLD: dam = monspell_damage(player_ptr, RF_ABILITY::BR_COLD, m_idx, DAM_ROLL); type_s = _("冷気", "frost"); drs_type = DRS_COLD; break; - case GF_POIS: + case AttributeType::POIS: dam = monspell_damage(player_ptr, RF_ABILITY::BR_POIS, m_idx, DAM_ROLL); type_s = _("ガス", "gas"); drs_type = DRS_POIS; break; - case GF_NETHER: + case AttributeType::NETHER: dam = monspell_damage(player_ptr, RF_ABILITY::BR_NETH, m_idx, DAM_ROLL); type_s = _("地獄", "nether"); drs_type = DRS_NETH; break; - case GF_LITE: + case AttributeType::LITE: dam = monspell_damage(player_ptr, RF_ABILITY::BR_LITE, m_idx, DAM_ROLL); type_s = _("閃光", "light"); drs_type = DRS_LITE; break; - case GF_DARK: + case AttributeType::DARK: dam = monspell_damage(player_ptr, RF_ABILITY::BR_DARK, m_idx, DAM_ROLL); type_s = _("暗黒", "darkness"); drs_type = DRS_DARK; break; - case GF_CONFUSION: + case AttributeType::CONFUSION: dam = monspell_damage(player_ptr, RF_ABILITY::BR_CONF, m_idx, DAM_ROLL); type_s = _("混乱", "confusion"); drs_type = DRS_CONF; break; - case GF_SOUND: + case AttributeType::SOUND: dam = monspell_damage(player_ptr, RF_ABILITY::BR_SOUN, m_idx, DAM_ROLL); type_s = _("轟音", "sound"); drs_type = DRS_SOUND; break; - case GF_CHAOS: + case AttributeType::CHAOS: dam = monspell_damage(player_ptr, RF_ABILITY::BR_CHAO, m_idx, DAM_ROLL); type_s = _("カオス", "chaos"); drs_type = DRS_CHAOS; break; - case GF_DISENCHANT: + case AttributeType::DISENCHANT: dam = monspell_damage(player_ptr, RF_ABILITY::BR_DISE, m_idx, DAM_ROLL); type_s = _("劣化", "disenchantment"); drs_type = DRS_DISEN; break; - case GF_NEXUS: + case AttributeType::NEXUS: dam = monspell_damage(player_ptr, RF_ABILITY::BR_NEXU, m_idx, DAM_ROLL); type_s = _("因果混乱", "nexus"); drs_type = DRS_NEXUS; break; - case GF_TIME: + case AttributeType::TIME: dam = monspell_damage(player_ptr, RF_ABILITY::BR_TIME, m_idx, DAM_ROLL); type_s = _("時間逆転", "time"); smart_learn_aux = false; break; - case GF_INERTIAL: + case AttributeType::INERTIAL: dam = monspell_damage(player_ptr, RF_ABILITY::BR_INER, m_idx, DAM_ROLL); type_s = _("遅鈍", "inertia"); smart_learn_aux = false; break; - case GF_GRAVITY: + case AttributeType::GRAVITY: dam = monspell_damage(player_ptr, RF_ABILITY::BR_GRAV, m_idx, DAM_ROLL); type_s = _("重力", "gravity"); smart_learn_aux = false; break; - case GF_SHARDS: + case AttributeType::SHARDS: dam = monspell_damage(player_ptr, RF_ABILITY::BR_SHAR, m_idx, DAM_ROLL); type_s = _("破片", "shards"); drs_type = DRS_SHARD; break; - case GF_PLASMA: + case AttributeType::PLASMA: dam = monspell_damage(player_ptr, RF_ABILITY::BR_PLAS, m_idx, DAM_ROLL); type_s = _("プラズマ", "plasma"); smart_learn_aux = false; break; - case GF_FORCE: + case AttributeType::FORCE: dam = monspell_damage(player_ptr, RF_ABILITY::BR_FORC, m_idx, DAM_ROLL); type_s = _("フォース", "force"); smart_learn_aux = false; break; - case GF_MANA: + case AttributeType::MANA: dam = monspell_damage(player_ptr, RF_ABILITY::BR_MANA, m_idx, DAM_ROLL); type_s = _("魔力", "mana"); smart_learn_aux = false; break; - case GF_NUKE: + case AttributeType::NUKE: dam = monspell_damage(player_ptr, RF_ABILITY::BR_NUKE, m_idx, DAM_ROLL); type_s = _("放射性廃棄物", "toxic waste"); drs_type = DRS_POIS; break; - case GF_DISINTEGRATE: + case AttributeType::DISINTEGRATE: dam = monspell_damage(player_ptr, RF_ABILITY::BR_DISI, m_idx, DAM_ROLL); type_s = _("分解", "disintegration"); smart_learn_aux = false; diff --git a/src/mspell/mspell-breath.h b/src/mspell/mspell-breath.h index defa07cab..df08b530d 100644 --- a/src/mspell/mspell-breath.h +++ b/src/mspell/mspell-breath.h @@ -1,8 +1,9 @@ #pragma once #include "system/angband.h" +#include "effect/attribute-types.h" struct MonsterSpellResult; struct player_type; -MonsterSpellResult spell_RF4_BREATH(player_type *player_ptr, int GF_TYPE, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); +MonsterSpellResult spell_RF4_BREATH(player_type *player_ptr, AttributeType GF_TYPE, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE); diff --git a/src/mspell/mspell-checker.cpp b/src/mspell/mspell-checker.cpp index aba2c7f09..9dcc26881 100644 --- a/src/mspell/mspell-checker.cpp +++ b/src/mspell/mspell-checker.cpp @@ -16,6 +16,7 @@ #include "dungeon/dungeon-flag-types.h" #include "dungeon/dungeon.h" #include "dungeon/quest.h" +#include "effect/attribute-types.h" #include "effect/effect-characteristics.h" #include "effect/effect-processor.h" #include "floor/cave.h" @@ -46,7 +47,6 @@ #include "spell-kind/spells-world.h" #include "spell-realm/spells-hex.h" #include "spell/range-calc.h" -#include "spell/spell-types.h" #include "system/floor-type-definition.h" #include "system/grid-type-definition.h" #include "system/monster-race-definition.h" @@ -187,7 +187,7 @@ bool clean_shot(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, * @param monspell モンスター魔法のID * @param target_type モンスターからモンスターへ撃つならMONSTER_TO_MONSTER、モンスターからプレイヤーならMONSTER_TO_PLAYER */ -ProjectResult bolt(player_type *player_ptr, MONSTER_IDX m_idx, POSITION y, POSITION x, EFFECT_ID typ, int dam_hp, int target_type) +ProjectResult bolt(player_type *player_ptr, MONSTER_IDX m_idx, POSITION y, POSITION x, AttributeType typ, int dam_hp, int target_type) { BIT_FLAGS flg = 0; switch (target_type) { @@ -199,7 +199,7 @@ ProjectResult bolt(player_type *player_ptr, MONSTER_IDX m_idx, POSITION y, POSIT break; } - if (typ != GF_ARROW) + if (typ != AttributeType::ARROW) flg |= PROJECT_REFLECTABLE; return project(player_ptr, m_idx, 0, y, x, dam_hp, typ, flg); @@ -216,7 +216,7 @@ ProjectResult bolt(player_type *player_ptr, MONSTER_IDX m_idx, POSITION y, POSIT * @param monspell モンスター魔法のID * @param target_type モンスターからモンスターへ撃つならMONSTER_TO_MONSTER、モンスターからプレイヤーならMONSTER_TO_PLAYER */ -ProjectResult beam(player_type *player_ptr, MONSTER_IDX m_idx, POSITION y, POSITION x, EFFECT_ID typ, int dam_hp, int target_type) +ProjectResult beam(player_type *player_ptr, MONSTER_IDX m_idx, POSITION y, POSITION x, AttributeType typ, int dam_hp, int target_type) { BIT_FLAGS flg = 0; switch (target_type) { @@ -245,7 +245,7 @@ ProjectResult beam(player_type *player_ptr, MONSTER_IDX m_idx, POSITION y, POSIT * @param monspell モンスター魔法のID * @param target_type モンスターからモンスターへ撃つならMONSTER_TO_MONSTER、モンスターからプレイヤーならMONSTER_TO_PLAYER */ -ProjectResult breath(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, EFFECT_ID typ, int dam_hp, POSITION rad, bool breath, int target_type) +ProjectResult breath(player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, AttributeType typ, int dam_hp, POSITION rad, bool breath, int target_type) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; @@ -266,19 +266,21 @@ ProjectResult breath(player_type *player_ptr, POSITION y, POSITION x, MONSTER_ID rad = 0 - rad; switch (typ) { - case GF_ROCKET: + case AttributeType::ROCKET: flg |= PROJECT_STOP; break; - case GF_DRAIN_MANA: - case GF_MIND_BLAST: - case GF_BRAIN_SMASH: - case GF_CAUSE_1: - case GF_CAUSE_2: - case GF_CAUSE_3: - case GF_CAUSE_4: - case GF_HAND_DOOM: + case AttributeType::DRAIN_MANA: + case AttributeType::MIND_BLAST: + case AttributeType::BRAIN_SMASH: + case AttributeType::CAUSE_1: + case AttributeType::CAUSE_2: + case AttributeType::CAUSE_3: + case AttributeType::CAUSE_4: + case AttributeType::HAND_DOOM: flg |= (PROJECT_HIDE | PROJECT_AIMED); break; + default: + break; } return project(player_ptr, m_idx, rad, y, x, dam_hp, typ, flg); diff --git a/src/mspell/mspell-checker.h b/src/mspell/mspell-checker.h index d0200f679..04823c2c3 100644 --- a/src/mspell/mspell-checker.h +++ b/src/mspell/mspell-checker.h @@ -1,6 +1,7 @@ #pragma once #include "system/angband.h" +#include "effect/attribute-types.h" struct ProjectResult; enum class RF_ABILITY; @@ -11,7 +12,7 @@ bool clean_shot(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, bool summon_possible(player_type *player_ptr, POSITION y1, POSITION x1); bool raise_possible(player_type *player_ptr, monster_type *m_ptr); bool spell_is_inate(RF_ABILITY spell); -ProjectResult beam(player_type *player_ptr, MONSTER_IDX m_idx, POSITION y, POSITION x, EFFECT_ID typ, int dam_hp, int target_type); -ProjectResult bolt(player_type *player_ptr, MONSTER_IDX m_idx, POSITION y, POSITION x, EFFECT_ID typ, int dam_hp, int target_type); +ProjectResult beam(player_type *player_ptr, MONSTER_IDX m_idx, POSITION y, POSITION x, AttributeType typ, int dam_hp, int target_type); +ProjectResult bolt(player_type *player_ptr, MONSTER_IDX m_idx, POSITION y, POSITION x, AttributeType typ, int dam_hp, int target_type); ProjectResult breath( - player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, EFFECT_ID typ, int dam_hp, POSITION rad, bool breath, int target_type); + player_type *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, AttributeType typ, int dam_hp, POSITION rad, bool breath, int target_type); diff --git a/src/mspell/mspell-curse.cpp b/src/mspell/mspell-curse.cpp index b14cc5888..d935b83b2 100644 --- a/src/mspell/mspell-curse.cpp +++ b/src/mspell/mspell-curse.cpp @@ -8,7 +8,6 @@ #include "mspell/mspell-damage-calculator.h" #include "mspell/mspell-util.h" #include "mspell/mspell.h" -#include "spell/spell-types.h" #include "system/floor-type-definition.h" #include "system/player-type-definition.h" #include "view/display-messages.h" @@ -28,7 +27,7 @@ * @param MS_TYPE 呪文の番号 * @param TARGET_TYPE プレイヤーを対象とする場合MONSTER_TO_PLAYER、モンスターを対象とする場合MONSTER_TO_MONSTER */ -static MonsterSpellResult spell_RF5_CAUSE(player_type *player_ptr, int GF_TYPE, HIT_POINT dam, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, +static MonsterSpellResult spell_RF5_CAUSE(player_type *player_ptr, AttributeType GF_TYPE, HIT_POINT dam, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, concptr msg1, concptr msg2, concptr msg3, int TARGET_TYPE) { auto res = MonsterSpellResult::make_valid(dam); @@ -80,7 +79,7 @@ MonsterSpellResult spell_RF5_CAUSE_1(player_type *player_ptr, POSITION y, POSITI const auto dam = monspell_damage(player_ptr, RF_ABILITY::CAUSE_1, m_idx, DAM_ROLL); - return spell_RF5_CAUSE(player_ptr, GF_CAUSE_1, dam, y, x, m_idx, t_idx, msg1, msg2, msg3, TARGET_TYPE); + return spell_RF5_CAUSE(player_ptr, AttributeType::CAUSE_1, dam, y, x, m_idx, t_idx, msg1, msg2, msg3, TARGET_TYPE); } /*! @@ -102,7 +101,7 @@ MonsterSpellResult spell_RF5_CAUSE_2(player_type *player_ptr, POSITION y, POSITI const auto dam = monspell_damage(player_ptr, RF_ABILITY::CAUSE_2, m_idx, DAM_ROLL); - return spell_RF5_CAUSE(player_ptr, GF_CAUSE_2, dam, y, x, m_idx, t_idx, msg1, msg2, msg3, TARGET_TYPE); + return spell_RF5_CAUSE(player_ptr, AttributeType::CAUSE_2, dam, y, x, m_idx, t_idx, msg1, msg2, msg3, TARGET_TYPE); } /*! @@ -124,7 +123,7 @@ MonsterSpellResult spell_RF5_CAUSE_3(player_type *player_ptr, POSITION y, POSITI const auto dam = monspell_damage(player_ptr, RF_ABILITY::CAUSE_3, m_idx, DAM_ROLL); - return spell_RF5_CAUSE(player_ptr, GF_CAUSE_3, dam, y, x, m_idx, t_idx, msg1, msg2, msg3, TARGET_TYPE); + return spell_RF5_CAUSE(player_ptr, AttributeType::CAUSE_3, dam, y, x, m_idx, t_idx, msg1, msg2, msg3, TARGET_TYPE); } /*! @@ -146,5 +145,5 @@ MonsterSpellResult spell_RF5_CAUSE_4(player_type *player_ptr, POSITION y, POSITI const auto dam = monspell_damage(player_ptr, RF_ABILITY::CAUSE_4, m_idx, DAM_ROLL); - return spell_RF5_CAUSE(player_ptr, GF_CAUSE_4, dam, y, x, m_idx, t_idx, msg1, msg2, msg3, TARGET_TYPE); + return spell_RF5_CAUSE(player_ptr, AttributeType::CAUSE_4, dam, y, x, m_idx, t_idx, msg1, msg2, msg3, TARGET_TYPE); } diff --git a/src/mspell/mspell-floor.cpp b/src/mspell/mspell-floor.cpp index 652b41c3c..c1715b589 100644 --- a/src/mspell/mspell-floor.cpp +++ b/src/mspell/mspell-floor.cpp @@ -34,7 +34,7 @@ #include "spell-kind/spells-teleport.h" #include "spell-kind/spells-world.h" #include "spell-realm/spells-hex.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/floor-type-definition.h" #include "system/monster-race-definition.h" #include "system/monster-type-definition.h" @@ -419,10 +419,10 @@ MonsterSpellResult spell_RF6_DARKNESS(player_type *player_ptr, POSITION y, POSIT } } else if (monster_to_monster) { if (can_use_lite_area) { - (void)project(player_ptr, m_idx, 3, y, x, 0, GF_LITE_WEAK, PROJECT_GRID | PROJECT_KILL); + (void)project(player_ptr, m_idx, 3, y, x, 0, AttributeType::LITE_WEAK, PROJECT_GRID | PROJECT_KILL); lite_room(player_ptr, y, x); } else { - (void)project(player_ptr, m_idx, 3, y, x, 0, GF_DARK_WEAK, PROJECT_GRID | PROJECT_KILL); + (void)project(player_ptr, m_idx, 3, y, x, 0, AttributeType::DARK_WEAK, PROJECT_GRID | PROJECT_KILL); unlite_room(player_ptr, y, x); } } diff --git a/src/mspell/mspell-judgement.cpp b/src/mspell/mspell-judgement.cpp index 1d87985fc..e4fa3beae 100644 --- a/src/mspell/mspell-judgement.cpp +++ b/src/mspell/mspell-judgement.cpp @@ -29,7 +29,7 @@ #include "realm/realm-song-numbers.h" #include "spell-realm/spells-song.h" #include "spell/range-calc.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/floor-type-definition.h" #include "system/grid-type-definition.h" #include "system/monster-race-definition.h" @@ -90,15 +90,15 @@ bool direct_beam(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, * @param is_friend TRUEならば、プレイヤーを巻き込む時にブレスの判定をFALSEにする。 * @return ブレスを直接当てられるならばTRUEを返す */ -bool breath_direct(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, POSITION rad, EFFECT_ID typ, bool is_friend) +bool breath_direct(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, POSITION rad, AttributeType typ, bool is_friend) { BIT_FLAGS flg; switch (typ) { - case GF_LITE: - case GF_LITE_WEAK: + case AttributeType::LITE: + case AttributeType::LITE_WEAK: flg = PROJECT_LOS; break; - case GF_DISINTEGRATE: + case AttributeType::DISINTEGRATE: flg = PROJECT_DISI; break; default: diff --git a/src/mspell/mspell-judgement.h b/src/mspell/mspell-judgement.h index 8e0edfe46..d1c628cad 100644 --- a/src/mspell/mspell-judgement.h +++ b/src/mspell/mspell-judgement.h @@ -1,11 +1,12 @@ #pragma once #include "system/angband.h" +#include "effect/attribute-types.h" struct monster_type; struct player_type; bool direct_beam(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, monster_type *m_ptr); -bool breath_direct(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, POSITION rad, EFFECT_ID typ, bool is_friend); +bool breath_direct(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, POSITION rad, AttributeType typ, bool is_friend); void get_project_point(player_type *player_ptr, POSITION sy, POSITION sx, POSITION *ty, POSITION *tx, BIT_FLAGS flg); bool dispel_check_monster(player_type *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx); bool dispel_check(player_type *player_ptr, MONSTER_IDX m_idx); diff --git a/src/mspell/mspell-particularity.cpp b/src/mspell/mspell-particularity.cpp index 8fec73fef..97b1d3f14 100644 --- a/src/mspell/mspell-particularity.cpp +++ b/src/mspell/mspell-particularity.cpp @@ -17,7 +17,7 @@ #include "mspell/mspell-damage-calculator.h" #include "mspell/mspell-util.h" #include "mspell/mspell.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/player-type-definition.h" /*! @@ -39,7 +39,7 @@ MonsterSpellResult spell_RF4_ROCKET(player_type *player_ptr, POSITION y, POSITIO monspell_message(player_ptr, m_idx, t_idx, msg, TARGET_TYPE); const auto dam = monspell_damage(player_ptr, RF_ABILITY::ROCKET, m_idx, DAM_ROLL); - const auto proj_res = breath(player_ptr, y, x, m_idx, GF_ROCKET, dam, 2, false, TARGET_TYPE); + const auto proj_res = breath(player_ptr, y, x, m_idx, AttributeType::ROCKET, dam, 2, false, TARGET_TYPE); if (TARGET_TYPE == MONSTER_TO_PLAYER) update_smart_learn(player_ptr, m_idx, DRS_SHARD); @@ -70,10 +70,10 @@ MonsterSpellResult spell_RF6_HAND_DOOM(player_type *player_ptr, POSITION y, POSI ProjectResult proj_res; if (TARGET_TYPE == MONSTER_TO_PLAYER) { const auto dam = monspell_damage(player_ptr, RF_ABILITY::HAND_DOOM, m_idx, DAM_ROLL); - proj_res = breath(player_ptr, y, x, m_idx, GF_HAND_DOOM, dam, 0, false, MONSTER_TO_PLAYER); + proj_res = breath(player_ptr, y, x, m_idx, AttributeType::HAND_DOOM, dam, 0, false, MONSTER_TO_PLAYER); } else if (TARGET_TYPE == MONSTER_TO_MONSTER) { const auto dam = 20; /* Dummy power */ - proj_res = breath(player_ptr, y, x, m_idx, GF_HAND_DOOM, dam, 0, false, MONSTER_TO_MONSTER); + proj_res = breath(player_ptr, y, x, m_idx, AttributeType::HAND_DOOM, dam, 0, false, MONSTER_TO_MONSTER); } auto res = MonsterSpellResult::make_valid(); @@ -100,7 +100,7 @@ MonsterSpellResult spell_RF6_PSY_SPEAR(player_type *player_ptr, POSITION y, POSI monspell_message(player_ptr, m_idx, t_idx, msg, TARGET_TYPE); const auto dam = monspell_damage(player_ptr, RF_ABILITY::PSY_SPEAR, m_idx, DAM_ROLL); - const auto proj_res = beam(player_ptr, m_idx, y, x, GF_PSY_SPEAR, dam, MONSTER_TO_PLAYER); + const auto proj_res = beam(player_ptr, m_idx, y, x, AttributeType::PSY_SPEAR, dam, MONSTER_TO_PLAYER); auto res = MonsterSpellResult::make_valid(dam); res.learnable = proj_res.affected_player; diff --git a/src/mspell/mspell-special.cpp b/src/mspell/mspell-special.cpp index 73accd9c1..dbfb931be 100644 --- a/src/mspell/mspell-special.cpp +++ b/src/mspell/mspell-special.cpp @@ -29,7 +29,7 @@ #include "player/player-damage.h" #include "spell-kind/spells-teleport.h" #include "spell-realm/spells-crusade.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/floor-type-definition.h" #include "system/grid-type-definition.h" #include "system/monster-race-definition.h" @@ -197,7 +197,7 @@ static MonsterSpellResult spell_RF6_SPECIAL_B(player_type *player_ptr, POSITION GAME_TEXT m_name_self[MAX_MONSTER_NAME]; monster_desc(player_ptr, m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE); msg_format(_("攻撃が%s自身を傷つけた!", "The attack of %s has wounded %s!"), m_name, m_name_self); - project(player_ptr, 0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL); + project(player_ptr, 0, 0, m_ptr->fy, m_ptr->fx, get_damage, AttributeType::MISSILE, PROJECT_KILL); set_tim_eyeeye(player_ptr, player_ptr->tim_eyeeye - 5, true); } } diff --git a/src/mspell/mspell-status.cpp b/src/mspell/mspell-status.cpp index c12d6c49a..e16a7cb68 100644 --- a/src/mspell/mspell-status.cpp +++ b/src/mspell/mspell-status.cpp @@ -28,7 +28,7 @@ #include "mspell/mspell.h" #include "player/player-personality-types.h" #include "player/player-status-flags.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "status/bad-status-setter.h" #include "status/base-status.h" #include "system/floor-type-definition.h" @@ -147,7 +147,7 @@ MonsterSpellResult spell_RF5_DRAIN_MANA(player_type *player_ptr, POSITION y, POS } const auto dam = monspell_damage(player_ptr, RF_ABILITY::DRAIN_MANA, m_idx, DAM_ROLL); - const auto proj_res = breath(player_ptr, y, x, m_idx, GF_DRAIN_MANA, dam, 0, false, TARGET_TYPE); + const auto proj_res = breath(player_ptr, y, x, m_idx, AttributeType::DRAIN_MANA, dam, 0, false, TARGET_TYPE); if (TARGET_TYPE == MONSTER_TO_PLAYER) update_smart_learn(player_ptr, m_idx, DRS_MANA); @@ -187,7 +187,7 @@ MonsterSpellResult spell_RF5_MIND_BLAST(player_type *player_ptr, POSITION y, POS } const auto dam = monspell_damage(player_ptr, RF_ABILITY::MIND_BLAST, m_idx, DAM_ROLL); - const auto proj_res = breath(player_ptr, y, x, m_idx, GF_MIND_BLAST, dam, 0, false, TARGET_TYPE); + const auto proj_res = breath(player_ptr, y, x, m_idx, AttributeType::MIND_BLAST, dam, 0, false, TARGET_TYPE); auto res = MonsterSpellResult::make_valid(dam); res.learnable = proj_res.affected_player; @@ -225,7 +225,7 @@ MonsterSpellResult spell_RF5_BRAIN_SMASH(player_type *player_ptr, POSITION y, PO } const auto dam = monspell_damage(player_ptr, RF_ABILITY::BRAIN_SMASH, m_idx, DAM_ROLL); - const auto proj_res = breath(player_ptr, y, x, m_idx, GF_BRAIN_SMASH, dam, 0, false, TARGET_TYPE); + const auto proj_res = breath(player_ptr, y, x, m_idx, AttributeType::BRAIN_SMASH, dam, 0, false, TARGET_TYPE); auto res = MonsterSpellResult::make_valid(dam); res.learnable = proj_res.affected_player; diff --git a/src/mspell/mspell-summon.cpp b/src/mspell/mspell-summon.cpp index e3909b2b0..e4375870c 100644 --- a/src/mspell/mspell-summon.cpp +++ b/src/mspell/mspell-summon.cpp @@ -17,7 +17,7 @@ #include "mspell/mspell.h" #include "mspell/specified-summon.h" #include "spell-kind/spells-launcher.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell/spells-summon.h" #include "spell/summon-types.h" #include "system/floor-type-definition.h" diff --git a/src/mspell/specified-summon.cpp b/src/mspell/specified-summon.cpp index 50e0bff0e..18a399a99 100644 --- a/src/mspell/specified-summon.cpp +++ b/src/mspell/specified-summon.cpp @@ -11,7 +11,7 @@ #include "mspell/mspell-checker.h" #include "mspell/mspell-util.h" #include "spell-kind/spells-launcher.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell/summon-types.h" #include "system/monster-race-definition.h" #include "system/player-type-definition.h" @@ -80,9 +80,9 @@ MONSTER_NUMBER summon_guardian(player_type *player_ptr, POSITION y, POSITION x, simple_monspell_message(player_ptr, m_idx, t_idx, msg, TARGET_TYPE); if (mon_to_player) - fire_ball_hide(player_ptr, GF_WATER_FLOW, 0, 3, 8); + fire_ball_hide(player_ptr, AttributeType::WATER_FLOW, 0, 3, 8); else if (mon_to_mon) - project(player_ptr, t_idx, 8, y, x, 3, GF_WATER_FLOW, PROJECT_GRID | PROJECT_HIDE); + project(player_ptr, t_idx, 8, y, x, 3, AttributeType::WATER_FLOW, PROJECT_GRID | PROJECT_HIDE); } int count = 0; diff --git a/src/mutation/mutation-processor.cpp b/src/mutation/mutation-processor.cpp index 77771afb7..d5a3f2f2e 100644 --- a/src/mutation/mutation-processor.cpp +++ b/src/mutation/mutation-processor.cpp @@ -29,7 +29,7 @@ #include "spell-kind/spells-world.h" #include "spell-realm/spells-hex.h" #include "spell-realm/spells-song.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell/summon-types.h" #include "status/bad-status-setter.h" #include "status/base-status.h" @@ -187,7 +187,7 @@ void process_world_aux_mutation(player_type *player_ptr) disturb(player_ptr, false, true); msg_print(_("ブゥーーッ!おっと。", "BRRAAAP! Oops.")); msg_print(nullptr); - fire_ball(player_ptr, GF_POIS, 0, player_ptr->lev, 3); + fire_ball(player_ptr, AttributeType::POIS, 0, player_ptr->lev, 3); } if (player_ptr->muta.has(MUTA::PROD_MANA) && !player_ptr->anti_magic && one_in_(9000)) { @@ -199,7 +199,7 @@ void process_world_aux_mutation(player_type *player_ptr) flush(); msg_print(nullptr); (void)get_hack_dir(player_ptr, &dire); - fire_ball(player_ptr, GF_MANA, dire, player_ptr->lev * 2, 3); + fire_ball(player_ptr, AttributeType::MANA, dire, player_ptr->lev * 2, 3); } if (player_ptr->muta.has(MUTA::ATT_DEMON) && !player_ptr->anti_magic && (randint1(6666) == 666)) { @@ -302,7 +302,7 @@ void process_world_aux_mutation(player_type *player_ptr) disturb(player_ptr, false, true); msg_print(_("周りの空間が歪んでいる気がする!", "You feel the world warping around you!")); msg_print(nullptr); - fire_ball(player_ptr, GF_CHAOS, 0, player_ptr->lev, 8); + fire_ball(player_ptr, AttributeType::CHAOS, 0, player_ptr->lev, 8); } if (player_ptr->muta.has(MUTA::NORMALITY) && one_in_(5000)) { diff --git a/src/object-activation/activation-bolt-ball.cpp b/src/object-activation/activation-bolt-ball.cpp index 6d7eaec2f..b10d043d8 100644 --- a/src/object-activation/activation-bolt-ball.cpp +++ b/src/object-activation/activation-bolt-ball.cpp @@ -7,7 +7,7 @@ #include "hpmp/hp-mp-processor.h" #include "spell-kind/spells-launcher.h" #include "spell-kind/spells-specific-bolt.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/player-type-definition.h" #include "target/target-getter.h" #include "view/display-messages.h" @@ -19,7 +19,7 @@ bool activate_missile_1(player_type *player_ptr) if (!get_aim_dir(player_ptr, &dir)) return false; - (void)fire_bolt(player_ptr, GF_MISSILE, dir, damroll(2, 6)); + (void)fire_bolt(player_ptr, AttributeType::MISSILE, dir, damroll(2, 6)); return true; } @@ -30,7 +30,7 @@ bool activate_missile_2(player_type *player_ptr) if (!get_aim_dir(player_ptr, &dir)) return false; - (void)fire_bolt(player_ptr, GF_ARROW, dir, 150); + (void)fire_bolt(player_ptr, AttributeType::ARROW, dir, 150); return true; } @@ -41,7 +41,7 @@ bool activate_missile_3(player_type *player_ptr) return false; msg_print(_("あなたはエレメントのブレスを吐いた。", "You breathe the elements.")); - fire_breath(player_ptr, GF_MISSILE, dir, 300, 4); + fire_breath(player_ptr, AttributeType::MISSILE, dir, 300, 4); return true; } @@ -52,7 +52,7 @@ bool activate_bolt_acid_1(player_type *player_ptr) if (!get_aim_dir(player_ptr, &dir)) return false; - (void)fire_bolt(player_ptr, GF_ACID, dir, damroll(5, 8)); + (void)fire_bolt(player_ptr, AttributeType::ACID, dir, damroll(5, 8)); return true; } @@ -63,7 +63,7 @@ bool activate_bolt_elec_1(player_type *player_ptr) if (!get_aim_dir(player_ptr, &dir)) return false; - (void)fire_bolt(player_ptr, GF_ELEC, dir, damroll(4, 8)); + (void)fire_bolt(player_ptr, AttributeType::ELEC, dir, damroll(4, 8)); return true; } @@ -74,7 +74,7 @@ bool activate_bolt_fire_1(player_type *player_ptr) if (!get_aim_dir(player_ptr, &dir)) return false; - (void)fire_bolt(player_ptr, GF_FIRE, dir, damroll(9, 8)); + (void)fire_bolt(player_ptr, AttributeType::FIRE, dir, damroll(9, 8)); return true; } @@ -85,7 +85,7 @@ bool activate_bolt_cold_1(player_type *player_ptr) if (!get_aim_dir(player_ptr, &dir)) return false; - (void)fire_bolt(player_ptr, GF_COLD, dir, damroll(6, 8)); + (void)fire_bolt(player_ptr, AttributeType::COLD, dir, damroll(6, 8)); return true; } @@ -144,7 +144,7 @@ bool activate_bolt_mana(player_type *player_ptr, concptr name) if (!get_aim_dir(player_ptr, &dir)) return false; - (void)fire_bolt(player_ptr, GF_ARROW, dir, 150); + (void)fire_bolt(player_ptr, AttributeType::ARROW, dir, 150); return true; } @@ -155,7 +155,7 @@ bool activate_ball_pois_1(player_type *player_ptr) if (!get_aim_dir(player_ptr, &dir)) return false; - (void)fire_ball(player_ptr, GF_POIS, dir, 12, 3); + (void)fire_ball(player_ptr, AttributeType::POIS, dir, 12, 3); return true; } @@ -166,7 +166,7 @@ bool activate_ball_cold_1(player_type *player_ptr) if (!get_aim_dir(player_ptr, &dir)) return false; - (void)fire_ball(player_ptr, GF_COLD, dir, 48, 2); + (void)fire_ball(player_ptr, AttributeType::COLD, dir, 48, 2); return true; } @@ -177,7 +177,7 @@ bool activate_ball_cold_2(player_type *player_ptr) if (!get_aim_dir(player_ptr, &dir)) return false; - (void)fire_ball(player_ptr, GF_COLD, dir, 100, 2); + (void)fire_ball(player_ptr, AttributeType::COLD, dir, 100, 2); return true; } @@ -188,7 +188,7 @@ bool activate_ball_cold_3(player_type *player_ptr) if (!get_aim_dir(player_ptr, &dir)) return false; - (void)fire_ball(player_ptr, GF_COLD, dir, 400, 3); + (void)fire_ball(player_ptr, AttributeType::COLD, dir, 400, 3); return true; } @@ -199,7 +199,7 @@ bool activate_ball_fire_1(player_type *player_ptr) if (!get_aim_dir(player_ptr, &dir)) return false; - (void)fire_ball(player_ptr, GF_FIRE, dir, 72, 2); + (void)fire_ball(player_ptr, AttributeType::FIRE, dir, 72, 2); return true; } @@ -210,7 +210,7 @@ bool activate_ball_fire_2(player_type *player_ptr, concptr name) if (!get_aim_dir(player_ptr, &dir)) return false; - (void)fire_ball(player_ptr, GF_FIRE, dir, 120, 3); + (void)fire_ball(player_ptr, AttributeType::FIRE, dir, 120, 3); return true; } @@ -221,7 +221,7 @@ bool activate_ball_fire_3(player_type *player_ptr) if (!get_aim_dir(player_ptr, &dir)) return false; - (void)fire_ball(player_ptr, GF_FIRE, dir, 300, 3); + (void)fire_ball(player_ptr, AttributeType::FIRE, dir, 300, 3); return true; } @@ -232,7 +232,7 @@ bool activate_ball_fire_4(player_type *player_ptr) if (!get_aim_dir(player_ptr, &dir)) return false; - (void)fire_ball(player_ptr, GF_FIRE, dir, 100, 2); + (void)fire_ball(player_ptr, AttributeType::FIRE, dir, 100, 2); return true; } @@ -243,7 +243,7 @@ bool activate_ball_elec_2(player_type *player_ptr) if (!get_aim_dir(player_ptr, &dir)) return false; - (void)fire_ball(player_ptr, GF_ELEC, dir, 100, 3); + (void)fire_ball(player_ptr, AttributeType::ELEC, dir, 100, 3); return true; } @@ -254,7 +254,7 @@ bool activate_ball_elec_3(player_type *player_ptr) if (!get_aim_dir(player_ptr, &dir)) return false; - (void)fire_ball(player_ptr, GF_ELEC, dir, 500, 3); + (void)fire_ball(player_ptr, AttributeType::ELEC, dir, 500, 3); return true; } @@ -265,7 +265,7 @@ bool activate_ball_acid_1(player_type *player_ptr) if (!get_aim_dir(player_ptr, &dir)) return false; - (void)fire_ball(player_ptr, GF_ACID, dir, 100, 2); + (void)fire_ball(player_ptr, AttributeType::ACID, dir, 100, 2); return true; } @@ -276,7 +276,7 @@ bool activate_ball_nuke_1(player_type *player_ptr) if (!get_aim_dir(player_ptr, &dir)) return false; - (void)fire_ball(player_ptr, GF_NUKE, dir, 100, 2); + (void)fire_ball(player_ptr, AttributeType::NUKE, dir, 100, 2); return true; } @@ -287,7 +287,7 @@ bool activate_rocket(player_type *player_ptr) return false; msg_print(_("ロケットを発射した!", "You launch a rocket!")); - (void)fire_ball(player_ptr, GF_ROCKET, dir, 250 + player_ptr->lev * 3, 2); + (void)fire_ball(player_ptr, AttributeType::ROCKET, dir, 250 + player_ptr->lev * 3, 2); return true; } @@ -298,7 +298,7 @@ bool activate_ball_water(player_type *player_ptr, concptr name) if (!get_aim_dir(player_ptr, &dir)) return false; - (void)fire_ball(player_ptr, GF_WATER, dir, 200, 3); + (void)fire_ball(player_ptr, AttributeType::WATER, dir, 200, 3); return true; } @@ -318,7 +318,7 @@ bool activate_ball_lite(player_type *player_ptr, concptr name) break; } - project(player_ptr, 0, 3, y, x, 150, GF_ELEC, PROJECT_THRU | PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL); + project(player_ptr, 0, 3, y, x, 150, AttributeType::ELEC, PROJECT_THRU | PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL); } return true; @@ -331,7 +331,7 @@ bool activate_ball_dark(player_type *player_ptr, concptr name) if (!get_aim_dir(player_ptr, &dir)) return false; - (void)fire_ball(player_ptr, GF_DARK, dir, 250, 4); + (void)fire_ball(player_ptr, AttributeType::DARK, dir, 250, 4); return true; } @@ -342,6 +342,6 @@ bool activate_ball_mana(player_type *player_ptr, concptr name) if (!get_aim_dir(player_ptr, &dir)) return false; - (void)fire_ball(player_ptr, GF_MANA, dir, 250, 4); + (void)fire_ball(player_ptr, AttributeType::MANA, dir, 250, 4); return true; } diff --git a/src/object-activation/activation-breath.cpp b/src/object-activation/activation-breath.cpp index 238595e60..efafc8ff7 100644 --- a/src/object-activation/activation-breath.cpp +++ b/src/object-activation/activation-breath.cpp @@ -5,7 +5,7 @@ #include "spell-kind/spells-launcher.h" #include "spell-realm/spells-hex.h" #include "spell-realm/spells-song.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "status/element-resistance.h" #include "sv-definition/sv-ring-types.h" #include "system/object-type-definition.h" @@ -29,7 +29,7 @@ bool activate_dragon_breath(player_type *player_ptr, object_type *o_ptr) auto resistance_flags = object_flags(o_ptr); - int type[20]; + AttributeType type[20]; int n = 0; concptr name[20]; for (int i = 0; dragonbreath_info[i].flag != 0; i++) { @@ -62,7 +62,7 @@ bool activate_breath_fire(player_type *player_ptr, object_type *o_ptr) if (!get_aim_dir(player_ptr, &dir)) return false; - fire_breath(player_ptr, GF_FIRE, dir, 200, 2); + fire_breath(player_ptr, AttributeType::FIRE, dir, 200, 2); if ((o_ptr->tval == ItemKindType::RING) && (o_ptr->sval == SV_RING_FLAMES)) (void)set_oppose_fire(player_ptr, randint1(20) + 20, false); @@ -75,7 +75,7 @@ bool activate_breath_cold(player_type *player_ptr, object_type *o_ptr) if (!get_aim_dir(player_ptr, &dir)) return false; - fire_breath(player_ptr, GF_COLD, dir, 200, 2); + fire_breath(player_ptr, AttributeType::COLD, dir, 200, 2); if ((o_ptr->tval == ItemKindType::RING) && (o_ptr->sval == SV_RING_ICE)) (void)set_oppose_cold(player_ptr, randint1(20) + 20, false); diff --git a/src/object-activation/activation-others.cpp b/src/object-activation/activation-others.cpp index 6578acaaf..42ed15e73 100644 --- a/src/object-activation/activation-others.cpp +++ b/src/object-activation/activation-others.cpp @@ -39,7 +39,7 @@ #include "spell-kind/spells-world.h" #include "spell-realm/spells-hex.h" #include "spell-realm/spells-song.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell/spells-status.h" #include "status/bad-status-setter.h" #include "status/body-improvement.h" @@ -190,7 +190,7 @@ bool activate_cure_lw(player_type *player_ptr) bool activate_grand_cross(player_type *player_ptr) { msg_print(_("「闇に還れ!」", "You say, 'Return to darkness!'")); - (void)project(player_ptr, 0, 8, player_ptr->y, player_ptr->x, (randint1(100) + 200) * 2, GF_HOLY_FIRE, PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID); + (void)project(player_ptr, 0, 8, player_ptr->y, player_ptr->x, (randint1(100) + 200) * 2, AttributeType::HOLY_FIRE, PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID); return true; } @@ -277,7 +277,7 @@ bool activate_whirlwind(player_type *player_ptr) bool activate_blinding_light(player_type *player_ptr, concptr name) { msg_format(_("%sが眩しい光で輝いた...", "The %s gleams with blinding light..."), name); - (void)fire_ball(player_ptr, GF_LITE, 0, 300, 6); + (void)fire_ball(player_ptr, AttributeType::LITE, 0, 300, 6); confuse_monsters(player_ptr, 3 * player_ptr->lev / 2); return true; } diff --git a/src/object-activation/activation-resistance.cpp b/src/object-activation/activation-resistance.cpp index eda2a3634..7a63cca95 100644 --- a/src/object-activation/activation-resistance.cpp +++ b/src/object-activation/activation-resistance.cpp @@ -1,7 +1,7 @@ #include "object-activation/activation-resistance.h" #include "hpmp/hp-mp-processor.h" #include "spell-kind/spells-launcher.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "status/bad-status-setter.h" #include "status/buff-setter.h" #include "status/element-resistance.h" @@ -37,7 +37,7 @@ bool activate_acid_ball_and_resistance(player_type *player_ptr, concptr name) if (!get_aim_dir(player_ptr, &dir)) return false; - (void)fire_ball(player_ptr, GF_ACID, dir, 100, 2); + (void)fire_ball(player_ptr, AttributeType::ACID, dir, 100, 2); (void)set_oppose_acid(player_ptr, randint1(20) + 20, false); return true; @@ -57,7 +57,7 @@ bool activate_elec_ball_and_resistance(player_type *player_ptr, concptr name) if (!get_aim_dir(player_ptr, &dir)) return false; - (void)fire_ball(player_ptr, GF_ELEC, dir, 100, 2); + (void)fire_ball(player_ptr, AttributeType::ELEC, dir, 100, 2); (void)set_oppose_elec(player_ptr, randint1(20) + 20, false); return true; @@ -77,7 +77,7 @@ bool activate_fire_ball_and_resistance(player_type *player_ptr, concptr name) if (!get_aim_dir(player_ptr, &dir)) return false; - (void)fire_ball(player_ptr, GF_FIRE, dir, 100, 2); + (void)fire_ball(player_ptr, AttributeType::FIRE, dir, 100, 2); (void)set_oppose_fire(player_ptr, randint1(20) + 20, false); return true; @@ -97,7 +97,7 @@ bool activate_cold_ball_and_resistance(player_type *player_ptr, concptr name) if (!get_aim_dir(player_ptr, &dir)) return false; - (void)fire_ball(player_ptr, GF_COLD, dir, 100, 2); + (void)fire_ball(player_ptr, AttributeType::COLD, dir, 100, 2); (void)set_oppose_cold(player_ptr, randint1(20) + 20, false); return true; @@ -117,7 +117,7 @@ bool activate_pois_ball_and_resistance(player_type *player_ptr, concptr name) if (!get_aim_dir(player_ptr, &dir)) return false; - (void)fire_ball(player_ptr, GF_POIS, dir, 100, 2); + (void)fire_ball(player_ptr, AttributeType::POIS, dir, 100, 2); (void)set_oppose_pois(player_ptr, randint1(20) + 20, false); return true; diff --git a/src/object-activation/activation-teleport.cpp b/src/object-activation/activation-teleport.cpp index ad7ab6f04..a1375c0b9 100644 --- a/src/object-activation/activation-teleport.cpp +++ b/src/object-activation/activation-teleport.cpp @@ -6,7 +6,7 @@ #include "spell-kind/spells-launcher.h" #include "spell-kind/spells-teleport.h" #include "spell-kind/spells-world.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/player-type-definition.h" #include "target/target-getter.h" #include "view/display-messages.h" @@ -17,7 +17,7 @@ bool activate_teleport_away(player_type *player_ptr) if (!get_aim_dir(player_ptr, &dir)) return false; - (void)fire_beam(player_ptr, GF_AWAY_ALL, dir, player_ptr->lev); + (void)fire_beam(player_ptr, AttributeType::AWAY_ALL, dir, player_ptr->lev); return true; } diff --git a/src/object-enchant/dragon-breaths-table.cpp b/src/object-enchant/dragon-breaths-table.cpp index 0542c0639..0a2294177 100644 --- a/src/object-enchant/dragon-breaths-table.cpp +++ b/src/object-enchant/dragon-breaths-table.cpp @@ -1,24 +1,24 @@ #include "object-enchant/dragon-breaths-table.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" /*! * @brief 装備耐性に準じたブレス効果の選択テーブル / * Define flags, effect type, name for dragon breath activation */ const dragonbreath_type dragonbreath_info[] = { - { TR_RES_ACID, GF_ACID, _("酸", "acid") }, - { TR_RES_ELEC, GF_ELEC, _("電撃", "lightning") }, - { TR_RES_FIRE, GF_FIRE, _("火炎", "fire") }, - { TR_RES_COLD, GF_COLD, _("冷気", "cold") }, - { TR_RES_POIS, GF_POIS, _("毒", "poison") }, - { TR_RES_LITE, GF_LITE, _("閃光", "light") }, - { TR_RES_DARK, GF_DARK, _("暗黒", "dark") }, - { TR_RES_SHARDS, GF_SHARDS, _("破片", "shards") }, - { TR_RES_CONF, GF_CONFUSION, _("混乱", "confusion") }, - { TR_RES_SOUND, GF_SOUND, _("轟音", "sound") }, - { TR_RES_NEXUS, GF_NEXUS, _("因果混乱", "nexus") }, - { TR_RES_NETHER, GF_NETHER, _("地獄", "nether") }, - { TR_RES_CHAOS, GF_CHAOS, _("カオス", "chaos") }, - { TR_RES_DISEN, GF_DISENCHANT, _("劣化", "disenchantment") }, - { TR_STR, 0, nullptr } + { TR_RES_ACID, AttributeType::ACID, _("酸", "acid") }, + { TR_RES_ELEC, AttributeType::ELEC, _("電撃", "lightning") }, + { TR_RES_FIRE, AttributeType::FIRE, _("火炎", "fire") }, + { TR_RES_COLD, AttributeType::COLD, _("冷気", "cold") }, + { TR_RES_POIS, AttributeType::POIS, _("毒", "poison") }, + { TR_RES_LITE, AttributeType::LITE, _("閃光", "light") }, + { TR_RES_DARK, AttributeType::DARK, _("暗黒", "dark") }, + { TR_RES_SHARDS, AttributeType::SHARDS, _("破片", "shards") }, + { TR_RES_CONF, AttributeType::CONFUSION, _("混乱", "confusion") }, + { TR_RES_SOUND, AttributeType::SOUND, _("轟音", "sound") }, + { TR_RES_NEXUS, AttributeType::NEXUS, _("因果混乱", "nexus") }, + { TR_RES_NETHER, AttributeType::NETHER, _("地獄", "nether") }, + { TR_RES_CHAOS, AttributeType::CHAOS, _("カオス", "chaos") }, + { TR_RES_DISEN, AttributeType::DISENCHANT, _("劣化", "disenchantment") }, + { TR_STR, AttributeType::NONE, nullptr } }; diff --git a/src/object-enchant/dragon-breaths-table.h b/src/object-enchant/dragon-breaths-table.h index 1e033594e..48ae5ad17 100644 --- a/src/object-enchant/dragon-breaths-table.h +++ b/src/object-enchant/dragon-breaths-table.h @@ -2,10 +2,11 @@ #include "system/angband.h" #include "object-enchant/tr-types.h" +#include "effect/attribute-types.h" typedef struct { tr_type flag; - int type; + AttributeType type; concptr name; } dragonbreath_type; diff --git a/src/object-use/read-execution.cpp b/src/object-use/read-execution.cpp index d4db1e8d6..3788d4147 100644 --- a/src/object-use/read-execution.cpp +++ b/src/object-use/read-execution.cpp @@ -48,7 +48,7 @@ #include "spell-kind/spells-world.h" #include "spell-realm/spells-hex.h" #include "spell-realm/spells-song.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell/spells-object.h" #include "spell/spells-summon.h" #include "spell/summon-types.h" @@ -415,7 +415,7 @@ void ObjectReadEntity::execute(bool known) break; } case SV_SCROLL_FIRE: { - fire_ball(this->player_ptr, GF_FIRE, 0, 666, 4); + fire_ball(this->player_ptr, AttributeType::FIRE, 0, 666, 4); if (!(is_oppose_fire(this->player_ptr) || has_resist_fire(this->player_ptr) || has_immune_fire(this->player_ptr))) take_hit(this->player_ptr, DAMAGE_NOESCAPE, 50 + randint1(50), _("炎の巻物", "a Scroll of Fire")); @@ -423,7 +423,7 @@ void ObjectReadEntity::execute(bool known) break; } case SV_SCROLL_ICE: { - fire_ball(this->player_ptr, GF_ICE, 0, 777, 4); + fire_ball(this->player_ptr, AttributeType::ICE, 0, 777, 4); if (!(is_oppose_cold(this->player_ptr) || has_resist_cold(this->player_ptr) || has_immune_cold(this->player_ptr))) take_hit(this->player_ptr, DAMAGE_NOESCAPE, 100 + randint1(100), _("氷の巻物", "a Scroll of Ice")); @@ -431,7 +431,7 @@ void ObjectReadEntity::execute(bool known) break; } case SV_SCROLL_CHAOS: { - fire_ball(this->player_ptr, GF_CHAOS, 0, 1000, 4); + fire_ball(this->player_ptr, AttributeType::CHAOS, 0, 1000, 4); if (!has_resist_chaos(this->player_ptr)) take_hit(this->player_ptr, DAMAGE_NOESCAPE, 111 + randint1(111), _("ログルスの巻物", "a Scroll of Logrus")); diff --git a/src/object-use/throw-execution.cpp b/src/object-use/throw-execution.cpp index ed4e54ec5..e8dee87ab 100644 --- a/src/object-use/throw-execution.cpp +++ b/src/object-use/throw-execution.cpp @@ -52,7 +52,7 @@ #include "player/player-status-table.h" #include "racial/racial-android.h" #include "specific-object/torch.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/floor-type-definition.h" #include "system/grid-type-definition.h" #include "system/monster-type-definition.h" @@ -435,12 +435,12 @@ void ObjectThrowEntity::attack_racial_power() this->m_ptr->hp - this->tdam, this->m_ptr->maxhp, this->m_ptr->max_maxhp); auto fear = false; - EffectFlags effect_flags{}; - effect_flags.set(GF_PLAYER_SHOOT); + AttributeFlags attribute_flags{}; + attribute_flags.set(AttributeType::PLAYER_SHOOT); if (is_active_torch(this->o_ptr)) - effect_flags.set(GF_FIRE); + attribute_flags.set(AttributeType::FIRE); - MonsterDamageProcessor mdp(this->player_ptr, this->g_ptr->m_idx, this->tdam, &fear, effect_flags); + MonsterDamageProcessor mdp(this->player_ptr, this->g_ptr->m_idx, this->tdam, &fear, attribute_flags); if (mdp.mon_take_hit(extract_note_dies(real_r_idx(this->m_ptr)))) { return; } diff --git a/src/object/object-broken.cpp b/src/object/object-broken.cpp index 634b16ed4..dfdbb57cb 100644 --- a/src/object/object-broken.cpp +++ b/src/object/object-broken.cpp @@ -10,7 +10,7 @@ #include "object-enchant/tr-types.h" #include "object/object-flags.h" #include "object/object-kind.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "sv-definition/sv-potion-types.h" #include "system/object-type-definition.h" #include "system/player-type-definition.h" @@ -249,7 +249,7 @@ bool ObjectBreaker::can_destroy(object_type *o_ptr) const bool potion_smash_effect(player_type *player_ptr, MONSTER_IDX who, POSITION y, POSITION x, KIND_OBJECT_IDX k_idx) { int radius = 2; - int dt = 0; + AttributeType dt = AttributeType::NONE; int dam = 0; bool angry = false; object_kind *k_ptr = &k_info[k_idx]; @@ -299,81 +299,81 @@ bool potion_smash_effect(player_type *player_ptr, MONSTER_IDX who, POSITION y, P /* All of the above potions have no effect when shattered */ return false; case SV_POTION_SLOWNESS: - dt = GF_OLD_SLOW; + dt = AttributeType::OLD_SLOW; dam = 5; angry = true; break; case SV_POTION_POISON: - dt = GF_POIS; + dt = AttributeType::POIS; dam = 3; angry = true; break; case SV_POTION_BLINDNESS: - dt = GF_DARK; + dt = AttributeType::DARK; angry = true; break; case SV_POTION_BOOZE: - dt = GF_OLD_CONF; + dt = AttributeType::OLD_CONF; angry = true; break; case SV_POTION_SLEEP: - dt = GF_OLD_SLEEP; + dt = AttributeType::OLD_SLEEP; angry = true; break; case SV_POTION_RUINATION: case SV_POTION_DETONATIONS: - dt = GF_SHARDS; + dt = AttributeType::SHARDS; dam = damroll(25, 25); angry = true; break; case SV_POTION_DEATH: - dt = GF_DEATH_RAY; + dt = AttributeType::DEATH_RAY; dam = k_ptr->level * 10; angry = true; radius = 1; break; case SV_POTION_SPEED: - dt = GF_OLD_SPEED; + dt = AttributeType::OLD_SPEED; break; case SV_POTION_CURE_LIGHT: - dt = GF_OLD_HEAL; + dt = AttributeType::OLD_HEAL; dam = damroll(2, 3); break; case SV_POTION_CURE_SERIOUS: - dt = GF_OLD_HEAL; + dt = AttributeType::OLD_HEAL; dam = damroll(4, 3); break; case SV_POTION_CURE_CRITICAL: case SV_POTION_CURING: - dt = GF_OLD_HEAL; + dt = AttributeType::OLD_HEAL; dam = damroll(6, 3); break; case SV_POTION_HEALING: - dt = GF_OLD_HEAL; + dt = AttributeType::OLD_HEAL; dam = damroll(10, 10); break; case SV_POTION_RESTORE_EXP: - dt = GF_STAR_HEAL; + dt = AttributeType::STAR_HEAL; dam = 0; radius = 1; break; case SV_POTION_LIFE: - dt = GF_STAR_HEAL; + dt = AttributeType::STAR_HEAL; dam = damroll(50, 50); radius = 1; break; case SV_POTION_STAR_HEALING: - dt = GF_OLD_HEAL; + dt = AttributeType::OLD_HEAL; dam = damroll(50, 50); radius = 1; break; case SV_POTION_RESTORE_MANA: - dt = GF_MANA; + dt = AttributeType::MANA; dam = damroll(10, 10); radius = 1; break; case SV_POTION_POLY_SELF: - dt = GF_NEXUS; + dt = AttributeType::NEXUS; dam = damroll(20, 20); radius = 1; break; diff --git a/src/object/warning.cpp b/src/object/warning.cpp index 12d60102e..aa335e353 100644 --- a/src/object/warning.cpp +++ b/src/object/warning.cpp @@ -4,6 +4,7 @@ #include "core/disturbance.h" #include "dungeon/dungeon-flag-types.h" #include "dungeon/dungeon.h" +#include "effect/attribute-types.h" #include "flavor/flavor-describer.h" #include "flavor/object-flavor-types.h" #include "floor/cave.h" @@ -27,7 +28,6 @@ #include "player/player-status-flags.h" #include "player/player-status-resist.h" #include "player/special-defense-types.h" -#include "spell/spell-types.h" #include "status/element-resistance.h" #include "system/floor-type-definition.h" #include "system/grid-type-definition.h" @@ -77,7 +77,7 @@ object_type *choose_warning_item(player_type *player_ptr) * @param dam 基本ダメージ * @param max 算出した最大ダメージを返すポインタ */ -static void spell_damcalc(player_type *player_ptr, monster_type *m_ptr, EFFECT_ID typ, HIT_POINT dam, int *max) +static void spell_damcalc(player_type *player_ptr, monster_type *m_ptr, AttributeType typ, HIT_POINT dam, int *max) { monster_race *r_ptr = &r_info[m_ptr->r_idx]; int rlev = r_ptr->level; @@ -85,77 +85,77 @@ static void spell_damcalc(player_type *player_ptr, monster_type *m_ptr, EFFECT_I /* Vulnerability, resistance and immunity */ switch (typ) { - case GF_ELEC: + case AttributeType::ELEC: if (has_immune_elec(player_ptr)) { ignore_wraith_form = true; } dam = dam * calc_elec_damage_rate(player_ptr) / 100; break; - case GF_POIS: + case AttributeType::POIS: dam = dam * calc_pois_damage_rate(player_ptr) / 100; break; - case GF_ACID: + case AttributeType::ACID: if (has_immune_acid(player_ptr)) { ignore_wraith_form = true; } dam = dam * calc_acid_damage_rate(player_ptr) / 100; break; - case GF_COLD: - case GF_ICE: + case AttributeType::COLD: + case AttributeType::ICE: if (has_immune_cold(player_ptr)) { ignore_wraith_form = true; } dam = dam * calc_cold_damage_rate(player_ptr) / 100; break; - case GF_FIRE: + case AttributeType::FIRE: if (has_immune_fire(player_ptr)) { ignore_wraith_form = true; } dam = dam * calc_fire_damage_rate(player_ptr) / 100; break; - case GF_PSY_SPEAR: + case AttributeType::PSY_SPEAR: ignore_wraith_form = true; break; - case GF_ARROW: + case AttributeType::ARROW: if (!player_ptr->blind && (has_invuln_arrow(player_ptr))) { dam = 0; ignore_wraith_form = true; } break; - case GF_LITE: + case AttributeType::LITE: dam = dam * calc_lite_damage_rate(player_ptr, CALC_MAX) / 100; break; - case GF_DARK: + case AttributeType::DARK: dam = dam * calc_dark_damage_rate(player_ptr, CALC_MAX) / 100; if (has_immune_dark(player_ptr) || player_ptr->wraith_form) ignore_wraith_form = true; break; - case GF_SHARDS: + case AttributeType::SHARDS: dam = dam * calc_shards_damage_rate(player_ptr, CALC_MAX) / 100; break; - case GF_SOUND: + case AttributeType::SOUND: dam = dam * calc_sound_damage_rate(player_ptr, CALC_MAX) / 100; break; - case GF_CONFUSION: + case AttributeType::CONFUSION: dam = dam * calc_conf_damage_rate(player_ptr, CALC_MAX) / 100; break; - case GF_CHAOS: + case AttributeType::CHAOS: dam = dam * calc_chaos_damage_rate(player_ptr, CALC_MAX) / 100; break; - case GF_NETHER: + case AttributeType::NETHER: dam = dam * calc_nether_damage_rate(player_ptr, CALC_MAX) / 100; if (PlayerRace(player_ptr).equals(PlayerRaceType::SPECTRE)) { ignore_wraith_form = true; @@ -163,46 +163,46 @@ static void spell_damcalc(player_type *player_ptr, monster_type *m_ptr, EFFECT_I } break; - case GF_DISENCHANT: + case AttributeType::DISENCHANT: dam = dam * calc_disenchant_damage_rate(player_ptr, CALC_MAX) / 100; break; - case GF_NEXUS: + case AttributeType::NEXUS: dam = dam * calc_nexus_damage_rate(player_ptr, CALC_MAX) / 100; break; - case GF_TIME: + case AttributeType::TIME: dam = dam * calc_time_damage_rate(player_ptr, CALC_MAX) / 100; break; - case GF_GRAVITY: + case AttributeType::GRAVITY: dam = dam * calc_gravity_damage_rate(player_ptr, CALC_MAX) / 100; break; - case GF_ROCKET: + case AttributeType::ROCKET: dam = dam * calc_rocket_damage_rate(player_ptr, CALC_MAX) / 100; break; - case GF_NUKE: + case AttributeType::NUKE: dam = dam * calc_nuke_damage_rate(player_ptr) / 100; break; - case GF_DEATH_RAY: + case AttributeType::DEATH_RAY: dam = dam * calc_deathray_damage_rate(player_ptr, CALC_MAX) / 100; if (dam == 0) ignore_wraith_form = true; break; - case GF_HOLY_FIRE: + case AttributeType::HOLY_FIRE: dam = dam * calc_holy_fire_damage_rate(player_ptr, CALC_MAX) / 100; break; - case GF_HELL_FIRE: + case AttributeType::HELL_FIRE: dam = dam * calc_hell_fire_damage_rate(player_ptr, CALC_MAX) / 100; break; - case GF_MIND_BLAST: - case GF_BRAIN_SMASH: + case AttributeType::MIND_BLAST: + case AttributeType::BRAIN_SMASH: if (100 + rlev / 2 <= std::max(5, player_ptr->skill_sav)) { dam = 0; ignore_wraith_form = true; @@ -210,10 +210,10 @@ static void spell_damcalc(player_type *player_ptr, monster_type *m_ptr, EFFECT_I break; - case GF_CAUSE_1: - case GF_CAUSE_2: - case GF_CAUSE_3: - case GF_HAND_DOOM: + case AttributeType::CAUSE_1: + case AttributeType::CAUSE_2: + case AttributeType::CAUSE_3: + case AttributeType::HAND_DOOM: if (100 + rlev / 2 <= player_ptr->skill_sav) { dam = 0; ignore_wraith_form = true; @@ -221,13 +221,15 @@ static void spell_damcalc(player_type *player_ptr, monster_type *m_ptr, EFFECT_I break; - case GF_CAUSE_4: + case AttributeType::CAUSE_4: if ((100 + rlev / 2 <= player_ptr->skill_sav) && (m_ptr->r_idx != MON_KENSHIROU)) { dam = 0; ignore_wraith_form = true; } break; + default: + break; } if (player_ptr->wraith_form && !ignore_wraith_form) { @@ -248,7 +250,7 @@ static void spell_damcalc(player_type *player_ptr, monster_type *m_ptr, EFFECT_I * @param m_idx 魔法を行使するモンスターのID * @param max 算出した最大ダメージを返すポインタ */ -static void spell_damcalc_by_spellnum(player_type *player_ptr, RF_ABILITY ms_type, EFFECT_ID typ, MONSTER_IDX m_idx, int *max) +static void spell_damcalc_by_spellnum(player_type *player_ptr, RF_ABILITY ms_type, AttributeType typ, MONSTER_IDX m_idx, int *max) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; HIT_POINT dam = monspell_damage(player_ptr, ms_type, m_idx, DAM_MAX); @@ -289,25 +291,25 @@ static int blow_damcalc(monster_type *m_ptr, player_type *player_ptr, monster_bl break; case RaceBlowEffectType::ACID: - spell_damcalc(player_ptr, m_ptr, GF_ACID, dam, &dummy_max); + spell_damcalc(player_ptr, m_ptr, AttributeType::ACID, dam, &dummy_max); dam = dummy_max; check_wraith_form = false; break; case RaceBlowEffectType::ELEC: - spell_damcalc(player_ptr, m_ptr, GF_ELEC, dam, &dummy_max); + spell_damcalc(player_ptr, m_ptr, AttributeType::ELEC, dam, &dummy_max); dam = dummy_max; check_wraith_form = false; break; case RaceBlowEffectType::FIRE: - spell_damcalc(player_ptr, m_ptr, GF_FIRE, dam, &dummy_max); + spell_damcalc(player_ptr, m_ptr, AttributeType::FIRE, dam, &dummy_max); dam = dummy_max; check_wraith_form = false; break; case RaceBlowEffectType::COLD: - spell_damcalc(player_ptr, m_ptr, GF_COLD, dam, &dummy_max); + spell_damcalc(player_ptr, m_ptr, AttributeType::COLD, dam, &dummy_max); dam = dummy_max; check_wraith_form = false; break; @@ -376,65 +378,65 @@ bool process_warning(player_type *player_ptr, POSITION xx, POSITION yy) if (d_info[player_ptr->dungeon_idx].flags.has_not(DF::NO_MAGIC)) { if (flags.has(RF_ABILITY::BA_CHAO)) - spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BA_CHAO, GF_CHAOS, g_ptr->m_idx, &dam_max0); + spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BA_CHAO, AttributeType::CHAOS, g_ptr->m_idx, &dam_max0); if (flags.has(RF_ABILITY::BA_MANA)) - spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BA_MANA, GF_MANA, g_ptr->m_idx, &dam_max0); + spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BA_MANA, AttributeType::MANA, g_ptr->m_idx, &dam_max0); if (flags.has(RF_ABILITY::BA_DARK)) - spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BA_DARK, GF_DARK, g_ptr->m_idx, &dam_max0); + spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BA_DARK, AttributeType::DARK, g_ptr->m_idx, &dam_max0); if (flags.has(RF_ABILITY::BA_LITE)) - spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BA_LITE, GF_LITE, g_ptr->m_idx, &dam_max0); + spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BA_LITE, AttributeType::LITE, g_ptr->m_idx, &dam_max0); if (flags.has(RF_ABILITY::HAND_DOOM)) - spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::HAND_DOOM, GF_HAND_DOOM, g_ptr->m_idx, &dam_max0); + spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::HAND_DOOM, AttributeType::HAND_DOOM, g_ptr->m_idx, &dam_max0); if (flags.has(RF_ABILITY::PSY_SPEAR)) - spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::PSY_SPEAR, GF_PSY_SPEAR, g_ptr->m_idx, &dam_max0); + spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::PSY_SPEAR, AttributeType::PSY_SPEAR, g_ptr->m_idx, &dam_max0); } if (flags.has(RF_ABILITY::ROCKET)) - spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::ROCKET, GF_ROCKET, g_ptr->m_idx, &dam_max0); + spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::ROCKET, AttributeType::ROCKET, g_ptr->m_idx, &dam_max0); if (flags.has(RF_ABILITY::BR_ACID)) - spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_ACID, GF_ACID, g_ptr->m_idx, &dam_max0); + spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_ACID, AttributeType::ACID, g_ptr->m_idx, &dam_max0); if (flags.has(RF_ABILITY::BR_ELEC)) - spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_ELEC, GF_ELEC, g_ptr->m_idx, &dam_max0); + spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_ELEC, AttributeType::ELEC, g_ptr->m_idx, &dam_max0); if (flags.has(RF_ABILITY::BR_FIRE)) - spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_FIRE, GF_FIRE, g_ptr->m_idx, &dam_max0); + spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_FIRE, AttributeType::FIRE, g_ptr->m_idx, &dam_max0); if (flags.has(RF_ABILITY::BR_COLD)) - spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_COLD, GF_COLD, g_ptr->m_idx, &dam_max0); + spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_COLD, AttributeType::COLD, g_ptr->m_idx, &dam_max0); if (flags.has(RF_ABILITY::BR_POIS)) - spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_POIS, GF_POIS, g_ptr->m_idx, &dam_max0); + spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_POIS, AttributeType::POIS, g_ptr->m_idx, &dam_max0); if (flags.has(RF_ABILITY::BR_NETH)) - spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_NETH, GF_NETHER, g_ptr->m_idx, &dam_max0); + spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_NETH, AttributeType::NETHER, g_ptr->m_idx, &dam_max0); if (flags.has(RF_ABILITY::BR_LITE)) - spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_LITE, GF_LITE, g_ptr->m_idx, &dam_max0); + spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_LITE, AttributeType::LITE, g_ptr->m_idx, &dam_max0); if (flags.has(RF_ABILITY::BR_DARK)) - spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_DARK, GF_DARK, g_ptr->m_idx, &dam_max0); + spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_DARK, AttributeType::DARK, g_ptr->m_idx, &dam_max0); if (flags.has(RF_ABILITY::BR_CONF)) - spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_CONF, GF_CONFUSION, g_ptr->m_idx, &dam_max0); + spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_CONF, AttributeType::CONFUSION, g_ptr->m_idx, &dam_max0); if (flags.has(RF_ABILITY::BR_SOUN)) - spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_SOUN, GF_SOUND, g_ptr->m_idx, &dam_max0); + spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_SOUN, AttributeType::SOUND, g_ptr->m_idx, &dam_max0); if (flags.has(RF_ABILITY::BR_CHAO)) - spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_CHAO, GF_CHAOS, g_ptr->m_idx, &dam_max0); + spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_CHAO, AttributeType::CHAOS, g_ptr->m_idx, &dam_max0); if (flags.has(RF_ABILITY::BR_DISE)) - spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_DISE, GF_DISENCHANT, g_ptr->m_idx, &dam_max0); + spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_DISE, AttributeType::DISENCHANT, g_ptr->m_idx, &dam_max0); if (flags.has(RF_ABILITY::BR_NEXU)) - spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_NEXU, GF_NEXUS, g_ptr->m_idx, &dam_max0); + spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_NEXU, AttributeType::NEXUS, g_ptr->m_idx, &dam_max0); if (flags.has(RF_ABILITY::BR_TIME)) - spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_TIME, GF_TIME, g_ptr->m_idx, &dam_max0); + spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_TIME, AttributeType::TIME, g_ptr->m_idx, &dam_max0); if (flags.has(RF_ABILITY::BR_INER)) - spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_INER, GF_INERTIAL, g_ptr->m_idx, &dam_max0); + spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_INER, AttributeType::INERTIAL, g_ptr->m_idx, &dam_max0); if (flags.has(RF_ABILITY::BR_GRAV)) - spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_GRAV, GF_GRAVITY, g_ptr->m_idx, &dam_max0); + spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_GRAV, AttributeType::GRAVITY, g_ptr->m_idx, &dam_max0); if (flags.has(RF_ABILITY::BR_SHAR)) - spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_SHAR, GF_SHARDS, g_ptr->m_idx, &dam_max0); + spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_SHAR, AttributeType::SHARDS, g_ptr->m_idx, &dam_max0); if (flags.has(RF_ABILITY::BR_PLAS)) - spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_PLAS, GF_PLASMA, g_ptr->m_idx, &dam_max0); + spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_PLAS, AttributeType::PLASMA, g_ptr->m_idx, &dam_max0); if (flags.has(RF_ABILITY::BR_FORC)) - spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_FORC, GF_FORCE, g_ptr->m_idx, &dam_max0); + spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_FORC, AttributeType::FORCE, g_ptr->m_idx, &dam_max0); if (flags.has(RF_ABILITY::BR_MANA)) - spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_MANA, GF_MANA, g_ptr->m_idx, &dam_max0); + spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_MANA, AttributeType::MANA, g_ptr->m_idx, &dam_max0); if (flags.has(RF_ABILITY::BR_NUKE)) - spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_NUKE, GF_NUKE, g_ptr->m_idx, &dam_max0); + spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_NUKE, AttributeType::NUKE, g_ptr->m_idx, &dam_max0); if (flags.has(RF_ABILITY::BR_DISI)) - spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_DISI, GF_DISINTEGRATE, g_ptr->m_idx, &dam_max0); + spell_damcalc_by_spellnum(player_ptr, RF_ABILITY::BR_DISI, AttributeType::DISINTEGRATE, g_ptr->m_idx, &dam_max0); } /* Monster melee attacks */ diff --git a/src/player-attack/player-attack-util.h b/src/player-attack/player-attack-util.h index 3723a2927..c52333c03 100644 --- a/src/player-attack/player-attack-util.h +++ b/src/player-attack/player-attack-util.h @@ -5,7 +5,7 @@ #include "object-enchant/tr-flags.h" #include "system/angband.h" #include "system/system-variables.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" /*! * @brief カオス効果種別 @@ -55,5 +55,5 @@ typedef struct player_attack_type { int drain_result{}; //!< 吸血した累積量 int drain_left{}; //!< 吸血できる残量(最大MAX_VAMPIRIC_DRAIN) bool weak{}; //!< 打撃効果でモンスターが弱くなったかどうか - EffectFlags effect_flags{}; //!< 与えたダメージの種類 + AttributeFlags attribute_flags{}; //!< 与えたダメージの種類 } player_attack_type; diff --git a/src/player-attack/player-attack.cpp b/src/player-attack/player-attack.cpp index ac4030bfc..8663df400 100644 --- a/src/player-attack/player-attack.cpp +++ b/src/player-attack/player-attack.cpp @@ -414,7 +414,7 @@ static void apply_damage_negative_effect(player_attack_type *pa_ptr, bool is_zan */ static bool check_fear_death(player_type *player_ptr, player_attack_type *pa_ptr, const int num, const bool is_lowlevel) { - MonsterDamageProcessor mdp(player_ptr, pa_ptr->m_idx, pa_ptr->attack_damage, pa_ptr->fear, pa_ptr->effect_flags); + MonsterDamageProcessor mdp(player_ptr, pa_ptr->m_idx, pa_ptr->attack_damage, pa_ptr->fear, pa_ptr->attribute_flags); if (!mdp.mon_take_hit(nullptr)) return false; @@ -539,7 +539,7 @@ void exe_player_attack_to_monster(player_type *player_ptr, POSITION y, POSITION if (!process_attack_hit(player_ptr, pa_ptr, chance)) continue; - pa_ptr->effect_flags = melee_effect_type(player_ptr, o_ptr, pa_ptr->mode); + pa_ptr->attribute_flags = melee_attribute(player_ptr, o_ptr, pa_ptr->mode); apply_actual_attack(player_ptr, pa_ptr, &do_quake, is_zantetsu_nullified, is_ej_nullified); calc_drain(pa_ptr); if (check_fear_death(player_ptr, pa_ptr, num, is_lowlevel)) diff --git a/src/player/patron.cpp b/src/player/patron.cpp index cadbd180e..d78a4b5ae 100644 --- a/src/player/patron.cpp +++ b/src/player/patron.cpp @@ -22,7 +22,7 @@ #include "spell-kind/spells-launcher.h" #include "spell-kind/spells-random.h" #include "spell-kind/spells-sight.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell/spells-object.h" #include "spell/spells-status.h" #include "spell/spells-summon.h" @@ -364,7 +364,7 @@ void Patron::gain_level_reward(player_type *player_ptr_, int chosen_reward) msg_format(_("%sの声が響き渡った:", "The voice of %s booms out:"), this->name.c_str()); msg_print(_("「苦しむがよい、無能な愚か者よ!」", "'Suffer, pathetic fool!'")); - fire_ball(player_ptr, GF_DISINTEGRATE, 0, this->player_ptr->lev * 4, 4); + fire_ball(player_ptr, AttributeType::DISINTEGRATE, 0, this->player_ptr->lev * 4, 4); take_hit(player_ptr, DAMAGE_NOESCAPE, this->player_ptr->lev * 4, wrath_reason); reward = _("分解の球が発生した。", "generating disintegration ball"); break; diff --git a/src/player/player-move.cpp b/src/player/player-move.cpp index 9638e4c0b..7edf47893 100644 --- a/src/player/player-move.cpp +++ b/src/player/player-move.cpp @@ -36,7 +36,7 @@ #include "realm/realm-song-numbers.h" #include "spell-kind/spells-floor.h" #include "spell-realm/spells-song.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "status/action-setter.h" #include "system/floor-type-definition.h" #include "system/grid-type-definition.h" @@ -193,7 +193,7 @@ bool move_player_effect(player_type *player_ptr, POSITION ny, POSITION nx, BIT_F if (mpe_mode & MPE_ENERGY_USE) { if (music_singing(player_ptr, MUSIC_WALL)) { - (void)project(player_ptr, 0, 0, player_ptr->y, player_ptr->x, (60 + player_ptr->lev), GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM); + (void)project(player_ptr, 0, 0, player_ptr->y, player_ptr->x, (60 + player_ptr->lev), AttributeType::DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM); if (!player_bold(player_ptr, ny, nx) || player_ptr->is_dead || player_ptr->leaving) return false; } diff --git a/src/racial/racial-android.cpp b/src/racial/racial-android.cpp index a35dc8de6..be0cc49e1 100644 --- a/src/racial/racial-android.cpp +++ b/src/racial/racial-android.cpp @@ -9,7 +9,7 @@ #include "player-info/equipment-info.h" #include "player/player-status.h" #include "spell-kind/spells-launcher.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "sv-definition/sv-armor-types.h" #include "sv-definition/sv-protector-types.h" #include "sv-definition/sv-weapon-types.h" @@ -27,30 +27,30 @@ bool android_inside_weapon(player_type *player_ptr) if (player_ptr->lev < 10) { msg_print(_("レイガンを発射した。", "You fire your ray gun.")); - fire_bolt(player_ptr, GF_MISSILE, dir, (player_ptr->lev + 1) / 2); + fire_bolt(player_ptr, AttributeType::MISSILE, dir, (player_ptr->lev + 1) / 2); return true; } if (player_ptr->lev < 25) { msg_print(_("ブラスターを発射した。", "You fire your blaster.")); - fire_bolt(player_ptr, GF_MISSILE, dir, player_ptr->lev); + fire_bolt(player_ptr, AttributeType::MISSILE, dir, player_ptr->lev); return true; } if (player_ptr->lev < 35) { msg_print(_("バズーカを発射した。", "You fire your bazooka.")); - fire_ball(player_ptr, GF_MISSILE, dir, player_ptr->lev * 2, 2); + fire_ball(player_ptr, AttributeType::MISSILE, dir, player_ptr->lev * 2, 2); return true; } if (player_ptr->lev < 45) { msg_print(_("ビームキャノンを発射した。", "You fire a beam cannon.")); - fire_beam(player_ptr, GF_MISSILE, dir, player_ptr->lev * 2); + fire_beam(player_ptr, AttributeType::MISSILE, dir, player_ptr->lev * 2); return true; } msg_print(_("ロケットを発射した。", "You fire a rocket.")); - fire_rocket(player_ptr, GF_ROCKET, dir, player_ptr->lev * 5, 2); + fire_rocket(player_ptr, AttributeType::ROCKET, dir, player_ptr->lev * 5, 2); return true; } diff --git a/src/racial/racial-balrog.cpp b/src/racial/racial-balrog.cpp index 28fa51e90..5080be1e5 100644 --- a/src/racial/racial-balrog.cpp +++ b/src/racial/racial-balrog.cpp @@ -1,7 +1,7 @@ #include "racial/racial-balrog.h" #include "player/player-status.h" #include "spell-kind/spells-launcher.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/player-type-definition.h" #include "target/target-getter.h" #include "view/display-messages.h" @@ -9,11 +9,11 @@ bool demonic_breath(player_type *player_ptr) { DIRECTION dir; - int type = (one_in_(2) ? GF_NETHER : GF_FIRE); + AttributeType type = (one_in_(2) ? AttributeType::NETHER : AttributeType::FIRE); if (!get_aim_dir(player_ptr, &dir)) return false; stop_mouth(player_ptr); - msg_format(_("あなたは%sのブレスを吐いた。", "You breathe %s."), ((type == GF_NETHER) ? _("地獄", "nether") : _("火炎", "fire"))); + msg_format(_("あなたは%sのブレスを吐いた。", "You breathe %s."), ((type == AttributeType::NETHER) ? _("地獄", "nether") : _("火炎", "fire"))); fire_breath(player_ptr, type, dir, player_ptr->lev * 3, (player_ptr->lev / 15) + 1); return true; } diff --git a/src/racial/racial-draconian.cpp b/src/racial/racial-draconian.cpp index c5b9da5c4..d1efcc26e 100644 --- a/src/racial/racial-draconian.cpp +++ b/src/racial/racial-draconian.cpp @@ -2,12 +2,12 @@ #include "mind/mind-elementalist.h" #include "player/player-status.h" #include "spell-kind/spells-launcher.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/player-type-definition.h" #include "target/target-getter.h" #include "view/display-messages.h" -static void decide_breath_kind(player_type *player_ptr, int *breath_type, concptr *breath_type_description) +static void decide_breath_kind(player_type *player_ptr, AttributeType *breath_type, concptr *breath_type_description) { if (randint1(100) >= player_ptr->lev) return; @@ -21,10 +21,10 @@ static void decide_breath_kind(player_type *player_ptr, int *breath_type, concpt case PlayerClassType::ARCHER: case PlayerClassType::SMITH: if (one_in_(3)) { - *breath_type = GF_MISSILE; + *breath_type = AttributeType::MISSILE; *breath_type_description = _("エレメント", "the elements"); } else { - *breath_type = GF_SHARDS; + *breath_type = AttributeType::SHARDS; *breath_type_description = _("破片", "shards"); } @@ -38,20 +38,20 @@ static void decide_breath_kind(player_type *player_ptr, int *breath_type, concpt case PlayerClassType::BLUE_MAGE: case PlayerClassType::MIRROR_MASTER: if (one_in_(3)) { - *breath_type = GF_MANA; + *breath_type = AttributeType::MANA; *breath_type_description = _("魔力", "mana"); } else { - *breath_type = GF_DISENCHANT; + *breath_type = AttributeType::DISENCHANT; *breath_type_description = _("劣化", "disenchantment"); } break; case PlayerClassType::CHAOS_WARRIOR: if (!one_in_(3)) { - *breath_type = GF_CONFUSION; + *breath_type = AttributeType::CONFUSION; *breath_type_description = _("混乱", "confusion"); } else { - *breath_type = GF_CHAOS; + *breath_type = AttributeType::CHAOS; *breath_type_description = _("カオス", "chaos"); } @@ -60,20 +60,20 @@ static void decide_breath_kind(player_type *player_ptr, int *breath_type, concpt case PlayerClassType::SAMURAI: case PlayerClassType::FORCETRAINER: if (!one_in_(3)) { - *breath_type = GF_CONFUSION; + *breath_type = AttributeType::CONFUSION; *breath_type_description = _("混乱", "confusion"); } else { - *breath_type = GF_SOUND; + *breath_type = AttributeType::SOUND; *breath_type_description = _("轟音", "sound"); } break; case PlayerClassType::MINDCRAFTER: if (!one_in_(3)) { - *breath_type = GF_CONFUSION; + *breath_type = AttributeType::CONFUSION; *breath_type_description = _("混乱", "confusion"); } else { - *breath_type = GF_PSI; + *breath_type = AttributeType::PSI; *breath_type_description = _("精神エネルギー", "mental energy"); } @@ -81,10 +81,10 @@ static void decide_breath_kind(player_type *player_ptr, int *breath_type, concpt case PlayerClassType::PRIEST: case PlayerClassType::PALADIN: if (one_in_(3)) { - *breath_type = GF_HELL_FIRE; + *breath_type = AttributeType::HELL_FIRE; *breath_type_description = _("地獄の劫火", "hellfire"); } else { - *breath_type = GF_HOLY_FIRE; + *breath_type = AttributeType::HOLY_FIRE; *breath_type_description = _("聖なる炎", "holy fire"); } @@ -92,20 +92,20 @@ static void decide_breath_kind(player_type *player_ptr, int *breath_type, concpt case PlayerClassType::ROGUE: case PlayerClassType::NINJA: if (one_in_(3)) { - *breath_type = GF_DARK; + *breath_type = AttributeType::DARK; *breath_type_description = _("暗黒", "darkness"); } else { - *breath_type = GF_POIS; + *breath_type = AttributeType::POIS; *breath_type_description = _("毒", "poison"); } break; case PlayerClassType::BARD: if (!one_in_(3)) { - *breath_type = GF_SOUND; + *breath_type = AttributeType::SOUND; *breath_type_description = _("轟音", "sound"); } else { - *breath_type = GF_CONFUSION; + *breath_type = AttributeType::CONFUSION; *breath_type_description = _("混乱", "confusion"); } @@ -121,8 +121,8 @@ static void decide_breath_kind(player_type *player_ptr, int *breath_type, concpt bool draconian_breath(player_type *player_ptr) { - int breath_type = (one_in_(3) ? GF_COLD : GF_FIRE); - concptr breath_type_description = ((breath_type == GF_COLD) ? _("冷気", "cold") : _("炎", "fire")); + AttributeType breath_type = (one_in_(3) ? AttributeType::COLD : AttributeType::FIRE); + concptr breath_type_description = ((breath_type == AttributeType::COLD) ? _("冷気", "cold") : _("炎", "fire")); DIRECTION dir; if (!get_aim_dir(player_ptr, &dir)) return false; diff --git a/src/racial/racial-switcher.cpp b/src/racial/racial-switcher.cpp index 71f437ff9..1bf00fd4c 100644 --- a/src/racial/racial-switcher.cpp +++ b/src/racial/racial-switcher.cpp @@ -72,7 +72,7 @@ #include "spell-kind/spells-world.h" #include "spell-realm/spells-hex.h" #include "spell-realm/spells-song.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell/spells-status.h" #include "status/action-setter.h" #include "status/bad-status-setter.h" @@ -124,7 +124,7 @@ bool switch_class_racial_execution(player_type *player_ptr, const int32_t comman if (!get_aim_dir(player_ptr, &dir)) return false; - fire_beam(player_ptr, is_good_realm(player_ptr->realm1) ? GF_HOLY_FIRE : GF_HELL_FIRE, dir, player_ptr->lev * 3); + fire_beam(player_ptr, is_good_realm(player_ptr->realm1) ? AttributeType::HOLY_FIRE : AttributeType::HELL_FIRE, dir, player_ptr->lev * 3); return true; case PlayerClassType::WARRIOR_MAGE: if (command == -3) @@ -167,7 +167,7 @@ bool switch_class_racial_execution(player_type *player_ptr, const int32_t comman return false; project_length = 1; - fire_beam(player_ptr, GF_PHOTO, dir, 1); + fire_beam(player_ptr, AttributeType::PHOTO, dir, 1); return true; } @@ -180,12 +180,12 @@ bool switch_class_racial_execution(player_type *player_ptr, const int32_t comman if (!get_aim_dir(player_ptr, &dir)) return false; - (void)fire_ball_hide(player_ptr, GF_CHARM_LIVING, dir, player_ptr->lev, 0); + (void)fire_ball_hide(player_ptr, AttributeType::CHARM_LIVING, dir, player_ptr->lev, 0); return true; } if (command == -4) - project_all_los(player_ptr, GF_CHARM_LIVING, player_ptr->lev); + project_all_los(player_ptr, AttributeType::CHARM_LIVING, player_ptr->lev); return true; case PlayerClassType::ARCHER: @@ -348,7 +348,7 @@ bool switch_race_racial_execution(player_type *player_ptr, const int32_t command return false; msg_print(_("巨大な岩を投げた。", "You throw a huge boulder.")); - (void)fire_bolt(player_ptr, GF_MISSILE, dir, (3 * player_ptr->lev) / 2); + (void)fire_bolt(player_ptr, AttributeType::MISSILE, dir, (3 * player_ptr->lev) / 2); return true; case PlayerRaceType::YEEK: if (!get_aim_dir(player_ptr, &dir)) @@ -365,9 +365,9 @@ bool switch_race_racial_execution(player_type *player_ptr, const int32_t command stop_mouth(player_ptr); msg_print(_("酸を吐いた。", "You spit acid.")); if (player_ptr->lev < 25) - (void)fire_bolt(player_ptr, GF_ACID, dir, player_ptr->lev); + (void)fire_bolt(player_ptr, AttributeType::ACID, dir, player_ptr->lev); else - (void)fire_ball(player_ptr, GF_ACID, dir, player_ptr->lev, 2); + (void)fire_ball(player_ptr, AttributeType::ACID, dir, player_ptr->lev, 2); return true; case PlayerRaceType::KOBOLD: @@ -375,7 +375,7 @@ bool switch_race_racial_execution(player_type *player_ptr, const int32_t command return false; msg_print(_("毒のダーツを投げた。", "You throw a poisoned dart.")); - (void)fire_bolt(player_ptr, GF_POIS, dir, player_ptr->lev); + (void)fire_bolt(player_ptr, AttributeType::POIS, dir, player_ptr->lev); return true; case PlayerRaceType::NIBELUNG: msg_print(_("周囲を調査した。", "You examine your surroundings.")); @@ -388,7 +388,7 @@ bool switch_race_racial_execution(player_type *player_ptr, const int32_t command return false; msg_print(_("マジック・ミサイルを放った。", "You cast a magic missile.")); - (void)fire_bolt_or_beam(player_ptr, 10, GF_MISSILE, dir, damroll(3 + ((player_ptr->lev - 1) / 5), 4)); + (void)fire_bolt_or_beam(player_ptr, 10, AttributeType::MISSILE, dir, damroll(3 + ((player_ptr->lev - 1) / 5), 4)); return true; case PlayerRaceType::DRACONIAN: return draconian_breath(player_ptr); @@ -397,7 +397,7 @@ bool switch_race_racial_execution(player_type *player_ptr, const int32_t command return false; msg_print(_("あなたは集中し、目が赤く輝いた...", "You concentrate and your eyes glow red...")); - (void)fire_bolt(player_ptr, GF_PSI, dir, player_ptr->lev); + (void)fire_bolt(player_ptr, AttributeType::PSI, dir, player_ptr->lev); return true; case PlayerRaceType::IMP: if (!get_aim_dir(player_ptr, &dir)) @@ -405,10 +405,10 @@ bool switch_race_racial_execution(player_type *player_ptr, const int32_t command if (player_ptr->lev >= 30) { msg_print(_("ファイア・ボールを放った。", "You cast a ball of fire.")); - (void)fire_ball(player_ptr, GF_FIRE, dir, player_ptr->lev, 2); + (void)fire_ball(player_ptr, AttributeType::FIRE, dir, player_ptr->lev, 2); } else { msg_print(_("ファイア・ボルトを放った。", "You cast a bolt of fire.")); - (void)fire_bolt(player_ptr, GF_FIRE, dir, player_ptr->lev); + (void)fire_bolt(player_ptr, AttributeType::FIRE, dir, player_ptr->lev); } return true; diff --git a/src/realm/realm-arcane.cpp b/src/realm/realm-arcane.cpp index 72ee8fe94..2c35a01f0 100644 --- a/src/realm/realm-arcane.cpp +++ b/src/realm/realm-arcane.cpp @@ -14,7 +14,7 @@ #include "spell-kind/spells-teleport.h" #include "spell-kind/spells-world.h" #include "spell-realm/spells-arcane.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell/spells-diceroll.h" #include "spell/spells-status.h" #include "spell/summon-types.h" @@ -60,7 +60,7 @@ concptr do_arcane_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTy if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_bolt_or_beam(player_ptr, beam_chance(player_ptr) - 10, GF_ELEC, dir, damroll(dice, sides)); + fire_bolt_or_beam(player_ptr, beam_chance(player_ptr) - 10, AttributeType::ELEC, dir, damroll(dice, sides)); } } break; @@ -538,7 +538,7 @@ concptr do_arcane_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTy if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_beam(player_ptr, GF_AWAY_ALL, dir, power); + fire_beam(player_ptr, AttributeType::AWAY_ALL, dir, power); } } break; @@ -557,23 +557,23 @@ concptr do_arcane_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTy return info_damage(0, 0, dam); if (cast) { - int type; + AttributeType type; if (!get_aim_dir(player_ptr, &dir)) return nullptr; switch (randint1(4)) { case 1: - type = GF_FIRE; + type = AttributeType::FIRE; break; case 2: - type = GF_ELEC; + type = AttributeType::ELEC; break; case 3: - type = GF_COLD; + type = AttributeType::COLD; break; default: - type = GF_ACID; + type = AttributeType::ACID; break; } diff --git a/src/realm/realm-chaos.cpp b/src/realm/realm-chaos.cpp index 76a0ce7c0..aba6809a4 100644 --- a/src/realm/realm-chaos.cpp +++ b/src/realm/realm-chaos.cpp @@ -15,7 +15,7 @@ #include "spell-kind/spells-teleport.h" #include "spell-kind/spells-world.h" #include "spell-realm/spells-chaos.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell/spells-diceroll.h" #include "spell/spells-object.h" #include "spell/spells-status.h" @@ -60,7 +60,7 @@ concptr do_chaos_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_bolt_or_beam(player_ptr, beam_chance(player_ptr) - 10, GF_MISSILE, dir, damroll(dice, sides)); + fire_bolt_or_beam(player_ptr, beam_chance(player_ptr) - 10, AttributeType::MISSILE, dir, damroll(dice, sides)); } } break; @@ -144,10 +144,10 @@ concptr do_chaos_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_ball(player_ptr, GF_MISSILE, dir, damroll(dice, sides) + base, rad); + fire_ball(player_ptr, AttributeType::MISSILE, dir, damroll(dice, sides) + base, rad); /* - * Shouldn't actually use GF_MANA, as + * Shouldn't actually use MANA, as * it will destroy all items on the * floor */ @@ -172,7 +172,7 @@ concptr do_chaos_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_bolt_or_beam(player_ptr, beam_chance(player_ptr), GF_FIRE, dir, damroll(dice, sides)); + fire_bolt_or_beam(player_ptr, beam_chance(player_ptr), AttributeType::FIRE, dir, damroll(dice, sides)); } } break; @@ -194,7 +194,7 @@ concptr do_chaos_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_ball(player_ptr, GF_DISINTEGRATE, dir, damroll(dice, sides), 0); + fire_ball(player_ptr, AttributeType::DISINTEGRATE, dir, damroll(dice, sides), 0); } } break; @@ -254,7 +254,7 @@ concptr do_chaos_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_bolt_or_beam(player_ptr, beam_chance(player_ptr), GF_CHAOS, dir, damroll(dice, sides)); + fire_bolt_or_beam(player_ptr, beam_chance(player_ptr), AttributeType::CHAOS, dir, damroll(dice, sides)); } } break; @@ -274,7 +274,7 @@ concptr do_chaos_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp if (cast) { msg_print(_("ドーン!部屋が揺れた!", "BOOM! Shake the room!")); - project(player_ptr, 0, rad, player_ptr->y, player_ptr->x, dam, GF_SOUND, PROJECT_KILL | PROJECT_ITEM); + project(player_ptr, 0, rad, player_ptr->y, player_ptr->x, dam, AttributeType::SOUND, PROJECT_KILL | PROJECT_ITEM); } } break; @@ -296,7 +296,7 @@ concptr do_chaos_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_beam(player_ptr, GF_MANA, dir, damroll(dice, sides)); + fire_beam(player_ptr, AttributeType::MANA, dir, damroll(dice, sides)); } } break; @@ -318,7 +318,7 @@ concptr do_chaos_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_ball(player_ptr, GF_FIRE, dir, dam, rad); + fire_ball(player_ptr, AttributeType::FIRE, dir, dam, rad); } } break; @@ -339,7 +339,7 @@ concptr do_chaos_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_beam(player_ptr, GF_AWAY_ALL, dir, power); + fire_beam(player_ptr, AttributeType::AWAY_ALL, dir, power); } } break; @@ -377,7 +377,7 @@ concptr do_chaos_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_ball(player_ptr, GF_CHAOS, dir, dam, rad); + fire_ball(player_ptr, AttributeType::CHAOS, dir, dam, rad); } } break; @@ -418,7 +418,7 @@ concptr do_chaos_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp if (cast) { for (dir = 0; dir <= 9; dir++) - fire_beam(player_ptr, GF_ELEC, dir, damroll(dice, sides)); + fire_beam(player_ptr, AttributeType::ELEC, dir, damroll(dice, sides)); } } break; @@ -458,7 +458,7 @@ concptr do_chaos_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_ball(player_ptr, GF_DISINTEGRATE, dir, dam, rad); + fire_ball(player_ptr, AttributeType::DISINTEGRATE, dir, dam, rad); } } break; @@ -500,7 +500,7 @@ concptr do_chaos_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp return nullptr; msg_print(_("ロケット発射!", "You launch a rocket!")); - fire_rocket(player_ptr, GF_ROCKET, dir, dam, rad); + fire_rocket(player_ptr, AttributeType::ROCKET, dir, dam, rad); } } break; @@ -547,7 +547,7 @@ concptr do_chaos_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp if (cast) { if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_beam(player_ptr, GF_GRAVITY, dir, damroll(dice, sides)); + fire_beam(player_ptr, AttributeType::GRAVITY, dir, damroll(dice, sides)); } } break; @@ -585,7 +585,7 @@ concptr do_chaos_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp return info_damage(0, 0, dam / 2); if (cast) { - fire_ball(player_ptr, GF_FIRE, 0, dam, rad); + fire_ball(player_ptr, AttributeType::FIRE, 0, dam, rad); } } break; @@ -637,7 +637,7 @@ concptr do_chaos_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp if (cast) { if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_ball(player_ptr, GF_MANA, dir, dam, rad); + fire_ball(player_ptr, AttributeType::MANA, dir, dam, rad); } } break; @@ -659,7 +659,7 @@ concptr do_chaos_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_ball(player_ptr, GF_CHAOS, dir, dam, rad); + fire_ball(player_ptr, AttributeType::CHAOS, dir, dam, rad); } } break; diff --git a/src/realm/realm-crusade.cpp b/src/realm/realm-crusade.cpp index c9efe36c6..3d6524afa 100644 --- a/src/realm/realm-crusade.cpp +++ b/src/realm/realm-crusade.cpp @@ -17,7 +17,7 @@ #include "spell-kind/spells-sight.h" #include "spell-kind/spells-teleport.h" #include "spell-realm/spells-crusade.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell/spells-diceroll.h" #include "spell/spells-object.h" #include "spell/spells-status.h" @@ -62,7 +62,7 @@ concptr do_crusade_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessT if (cast) { if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_bolt_or_beam(player_ptr, beam_chance(player_ptr) - 10, GF_ELEC, dir, damroll(dice, sides)); + fire_bolt_or_beam(player_ptr, beam_chance(player_ptr) - 10, AttributeType::ELEC, dir, damroll(dice, sides)); } } break; @@ -157,7 +157,7 @@ concptr do_crusade_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessT if (cast) { if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_blast(player_ptr, GF_LITE, dir, dice, sides, 10, 3); + fire_blast(player_ptr, AttributeType::LITE, dir, dice, sides, 10, 3); } } break; @@ -193,7 +193,7 @@ concptr do_crusade_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessT if (cast) { if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_ball(player_ptr, GF_AWAY_EVIL, dir, power, 0); + fire_ball(player_ptr, AttributeType::AWAY_EVIL, dir, power, 0); } } break; @@ -222,7 +222,7 @@ concptr do_crusade_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessT if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_ball(player_ptr, GF_HOLY_FIRE, dir, damroll(dice, sides) + base, rad); + fire_ball(player_ptr, AttributeType::HOLY_FIRE, dir, damroll(dice, sides) + base, rad); } } break; @@ -309,7 +309,7 @@ concptr do_crusade_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessT if (cast) { if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_bolt(player_ptr, GF_ELEC, dir, dam); + fire_bolt(player_ptr, AttributeType::ELEC, dir, dam); } } break; @@ -464,7 +464,7 @@ concptr do_crusade_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessT if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_ball(player_ptr, GF_LITE, dir, dam, rad); + fire_ball(player_ptr, AttributeType::LITE, dir, dam, rad); } } break; @@ -620,7 +620,7 @@ concptr do_crusade_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessT if (info) return format(_("回%d/損%d+%d", "h%d/dm%d+%d"), heal, d_dam, b_dam / 2); if (cast) { - project(player_ptr, 0, 1, player_ptr->y, player_ptr->x, b_dam, GF_HOLY_FIRE, PROJECT_KILL); + project(player_ptr, 0, 1, player_ptr->y, player_ptr->x, b_dam, AttributeType::HOLY_FIRE, PROJECT_KILL); dispel_monsters(player_ptr, d_dam); slow_monsters(player_ptr, plev); stun_monsters(player_ptr, power); diff --git a/src/realm/realm-death.cpp b/src/realm/realm-death.cpp index ddbae16bb..964f0e666 100644 --- a/src/realm/realm-death.cpp +++ b/src/realm/realm-death.cpp @@ -16,7 +16,7 @@ #include "spell-kind/spells-perception.h" #include "spell-kind/spells-sight.h" #include "spell-kind/spells-specific-bolt.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell/spells-diceroll.h" #include "spell/spells-object.h" #include "spell/spells-status.h" @@ -91,20 +91,20 @@ concptr do_death_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp * travel to the monster. */ - fire_ball(player_ptr, GF_HELL_FIRE, dir, damroll(dice, sides), rad); + fire_ball(player_ptr, AttributeType::HELL_FIRE, dir, damroll(dice, sides), rad); if (one_in_(5)) { /* Special effect first */ int effect = randint1(1000); if (effect == 666) - fire_ball_hide(player_ptr, GF_DEATH_RAY, dir, plev * 200, 0); + fire_ball_hide(player_ptr, AttributeType::DEATH_RAY, dir, plev * 200, 0); else if (effect < 500) - fire_ball_hide(player_ptr, GF_TURN_ALL, dir, plev, 0); + fire_ball_hide(player_ptr, AttributeType::TURN_ALL, dir, plev, 0); else if (effect < 800) - fire_ball_hide(player_ptr, GF_OLD_CONF, dir, plev, 0); + fire_ball_hide(player_ptr, AttributeType::OLD_CONF, dir, plev, 0); else - fire_ball_hide(player_ptr, GF_STUN, dir, plev, 0); + fire_ball_hide(player_ptr, AttributeType::STUN, dir, plev, 0); } } } @@ -145,7 +145,7 @@ concptr do_death_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_ball(player_ptr, GF_POIS, dir, dam, rad); + fire_ball(player_ptr, AttributeType::POIS, dir, dam, rad); } } break; @@ -257,7 +257,7 @@ concptr do_death_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_ball(player_ptr, GF_HYPODYNAMIA, dir, damroll(dice, sides) + base, rad); + fire_ball(player_ptr, AttributeType::HYPODYNAMIA, dir, damroll(dice, sides) + base, rad); } } break; @@ -279,7 +279,7 @@ concptr do_death_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_bolt_or_beam(player_ptr, beam_chance(player_ptr), GF_NETHER, dir, damroll(dice, sides)); + fire_bolt_or_beam(player_ptr, beam_chance(player_ptr), AttributeType::NETHER, dir, damroll(dice, sides)); } } break; @@ -298,7 +298,7 @@ concptr do_death_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp return info_damage(0, 0, dam / 2); if (cast) { - project(player_ptr, 0, rad, player_ptr->y, player_ptr->x, dam, GF_POIS, PROJECT_KILL | PROJECT_ITEM); + project(player_ptr, 0, rad, player_ptr->y, player_ptr->x, dam, AttributeType::POIS, PROJECT_KILL | PROJECT_ITEM); } } break; @@ -319,7 +319,7 @@ concptr do_death_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_ball_hide(player_ptr, GF_GENOCIDE, dir, power, 0); + fire_ball_hide(player_ptr, AttributeType::GENOCIDE, dir, power, 0); } } break; @@ -471,7 +471,7 @@ concptr do_death_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_bolt_or_beam(player_ptr, beam_chance(player_ptr), GF_DARK, dir, damroll(dice, sides)); + fire_bolt_or_beam(player_ptr, beam_chance(player_ptr), AttributeType::DARK, dir, damroll(dice, sides)); } } break; @@ -574,7 +574,7 @@ concptr do_death_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_ball(player_ptr, GF_DARK, dir, dam, rad); + fire_ball(player_ptr, AttributeType::DARK, dir, dam, rad); } } break; @@ -692,7 +692,7 @@ concptr do_death_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_ball(player_ptr, GF_HELL_FIRE, dir, dam, rad); + fire_ball(player_ptr, AttributeType::HELL_FIRE, dir, dam, rad); take_hit(player_ptr, DAMAGE_USELIFE, 20 + randint1(30), _("地獄の劫火の呪文を唱えた疲労", "the strain of casting Hellfire")); } } diff --git a/src/realm/realm-demon.cpp b/src/realm/realm-demon.cpp index 00e8760fc..96cf22625 100644 --- a/src/realm/realm-demon.cpp +++ b/src/realm/realm-demon.cpp @@ -12,7 +12,7 @@ #include "spell-kind/spells-pet.h" #include "spell-kind/spells-sight.h" #include "spell-realm/spells-demon.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell/spells-diceroll.h" #include "spell/spells-object.h" #include "spell/spells-status.h" @@ -63,7 +63,7 @@ concptr do_daemon_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTy if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_bolt_or_beam(player_ptr, beam_chance(player_ptr) - 10, GF_MISSILE, dir, damroll(dice, sides)); + fire_bolt_or_beam(player_ptr, beam_chance(player_ptr) - 10, AttributeType::MISSILE, dir, damroll(dice, sides)); } } break; @@ -163,7 +163,7 @@ concptr do_daemon_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTy if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_bolt_or_beam(player_ptr, beam_chance(player_ptr), GF_NETHER, dir, damroll(dice, sides)); + fire_bolt_or_beam(player_ptr, beam_chance(player_ptr), AttributeType::NETHER, dir, damroll(dice, sides)); } } break; @@ -207,7 +207,7 @@ concptr do_daemon_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTy if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_ball(player_ptr, GF_HELL_FIRE, dir, damroll(dice, sides) + base, rad); + fire_ball(player_ptr, AttributeType::HELL_FIRE, dir, damroll(dice, sides) + base, rad); } } break; @@ -286,7 +286,7 @@ concptr do_daemon_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTy if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_bolt_or_beam(player_ptr, beam_chance(player_ptr), GF_PLASMA, dir, damroll(dice, sides)); + fire_bolt_or_beam(player_ptr, beam_chance(player_ptr), AttributeType::PLASMA, dir, damroll(dice, sides)); } } break; @@ -308,7 +308,7 @@ concptr do_daemon_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTy if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_ball(player_ptr, GF_FIRE, dir, dam, rad); + fire_ball(player_ptr, AttributeType::FIRE, dir, dam, rad); } } break; @@ -343,7 +343,7 @@ concptr do_daemon_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTy if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_ball(player_ptr, GF_NETHER, dir, dam, rad); + fire_ball(player_ptr, AttributeType::NETHER, dir, dam, rad); } } break; @@ -421,8 +421,8 @@ concptr do_daemon_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTy return info_damage(0, 0, dam / 2); if (cast) { - fire_ball(player_ptr, GF_FIRE, 0, dam, rad); - fire_ball_hide(player_ptr, GF_LAVA_FLOW, 0, 2 + randint1(2), rad); + fire_ball(player_ptr, AttributeType::FIRE, 0, dam, rad); + fire_ball_hide(player_ptr, AttributeType::LAVA_FLOW, 0, 2 + randint1(2), rad); } } break; @@ -444,7 +444,7 @@ concptr do_daemon_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTy if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_ball(player_ptr, GF_PLASMA, dir, dam, rad); + fire_ball(player_ptr, AttributeType::PLASMA, dir, dam, rad); } } break; @@ -505,7 +505,7 @@ concptr do_daemon_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTy if (cast) { if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_ball(player_ptr, GF_NEXUS, dir, dam, rad); + fire_ball(player_ptr, AttributeType::NEXUS, dir, dam, rad); } } break; @@ -523,7 +523,7 @@ concptr do_daemon_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTy else msg_print(_("<破滅の手>を放った!", "You invoke the Hand of Doom!")); - fire_ball_hide(player_ptr, GF_HAND_DOOM, dir, plev * 2, 0); + fire_ball_hide(player_ptr, AttributeType::HAND_DOOM, dir, plev * 2, 0); } } break; @@ -577,9 +577,9 @@ concptr do_daemon_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTy return format("%s%d+%d", KWD_DAM, dam / 2, dam / 2); if (cast) { - fire_ball(player_ptr, GF_CHAOS, 0, dam, rad); - fire_ball(player_ptr, GF_CONFUSION, 0, dam, rad); - fire_ball(player_ptr, GF_CHARM, 0, power, rad); + fire_ball(player_ptr, AttributeType::CHAOS, 0, dam, rad); + fire_ball(player_ptr, AttributeType::CONFUSION, 0, dam, rad); + fire_ball(player_ptr, AttributeType::CHARM, 0, power, rad); } } break; @@ -629,7 +629,7 @@ concptr do_daemon_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTy if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_ball(player_ptr, GF_NETHER, dir, dam, rad); + fire_ball(player_ptr, AttributeType::NETHER, dir, dam, rad); } } break; @@ -652,7 +652,7 @@ concptr do_daemon_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTy if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_ball_hide(player_ptr, GF_BLOOD_CURSE, dir, dam, rad); + fire_ball_hide(player_ptr, AttributeType::BLOOD_CURSE, dir, dam, rad); take_hit(player_ptr, DAMAGE_USELIFE, 20 + randint1(30), _("血の呪い", "Blood curse")); } } diff --git a/src/realm/realm-hex.cpp b/src/realm/realm-hex.cpp index d6f9ec029..505d23d44 100644 --- a/src/realm/realm-hex.cpp +++ b/src/realm/realm-hex.cpp @@ -38,7 +38,7 @@ #include "spell-kind/spells-sight.h" #include "spell-kind/spells-teleport.h" #include "spell-realm/spells-hex.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell/spells-execution.h" #include "spell/spells-status.h" #include "spell/technic-info-table.h" @@ -147,7 +147,7 @@ concptr do_hex_spell(player_type *player_ptr, spell_hex_type spell, SpellProcess if (info) return info_damage(1, power, 0); if (cast || continuation) { - project_all_los(player_ptr, GF_POIS, randint1(power)); + project_all_los(player_ptr, AttributeType::POIS, randint1(power)); } break; @@ -284,7 +284,7 @@ concptr do_hex_spell(player_type *player_ptr, spell_hex_type spell, SpellProcess if ((spell_hex.get_revenge_turn() == 0) || (power >= 200)) { msg_print(_("我慢が解かれた!", "My patience is at an end!")); if (power) { - project(player_ptr, 0, rad, player_ptr->y, player_ptr->x, power, GF_HELL_FIRE, (PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL)); + project(player_ptr, 0, rad, player_ptr->y, player_ptr->x, power, AttributeType::HELL_FIRE, (PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL)); } if (allow_debug_options) { @@ -355,7 +355,7 @@ concptr do_hex_spell(player_type *player_ptr, spell_hex_type spell, SpellProcess if (info) return info_damage(1, power, 0); if (cast || continuation) { - project_all_los(player_ptr, GF_HYPODYNAMIA, randint1(power)); + project_all_los(player_ptr, AttributeType::HYPODYNAMIA, randint1(power)); } break; @@ -596,7 +596,7 @@ concptr do_hex_spell(player_type *player_ptr, spell_hex_type spell, SpellProcess if (info) return info_damage(1, power, 0); if (cast || continuation) { - project_all_los(player_ptr, GF_PSI_DRAIN, randint1(power)); + project_all_los(player_ptr, AttributeType::PSI_DRAIN, randint1(power)); } break; @@ -855,7 +855,7 @@ concptr do_hex_spell(player_type *player_ptr, spell_hex_type spell, SpellProcess msg_print(_("復讐の時だ!", "Time for revenge!")); } while (!get_aim_dir(player_ptr, &dir)); - fire_ball(player_ptr, GF_HELL_FIRE, dir, power, 1); + fire_ball(player_ptr, AttributeType::HELL_FIRE, dir, power, 1); if (allow_debug_options) { msg_format(_("%d点のダメージを返した。", "You return %d damage."), power); diff --git a/src/realm/realm-hissatsu.cpp b/src/realm/realm-hissatsu.cpp index 8803ddfa5..e885ae275 100644 --- a/src/realm/realm-hissatsu.cpp +++ b/src/realm/realm-hissatsu.cpp @@ -39,7 +39,7 @@ #include "spell-kind/spells-perception.h" #include "spell-kind/spells-sight.h" #include "spell-kind/spells-teleport.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell/technic-info-table.h" #include "status/bad-status-setter.h" #include "system/floor-type-definition.h" @@ -86,7 +86,7 @@ concptr do_hissatsu_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcess if (!get_aim_dir(player_ptr, &dir)) return nullptr; - project_hook(player_ptr, GF_ATTACK, dir, HISSATSU_2, PROJECT_STOP | PROJECT_KILL); + project_hook(player_ptr, AttributeType::ATTACK, dir, HISSATSU_2, PROJECT_STOP | PROJECT_KILL); } break; @@ -679,7 +679,7 @@ concptr do_hissatsu_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcess if (i) total_damage = total_damage * 7 / 10; } - fire_beam(player_ptr, GF_FORCE, dir, total_damage); + fire_beam(player_ptr, AttributeType::FORCE, dir, total_damage); } break; @@ -692,7 +692,7 @@ concptr do_hissatsu_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcess if (cast) { msg_print(_("雄叫びをあげた!", "You roar!")); - project_all_los(player_ptr, GF_SOUND, randint1(plev * 3)); + project_all_los(player_ptr, AttributeType::SOUND, randint1(plev * 3)); aggravate_monsters(player_ptr, 0); } break; @@ -813,7 +813,7 @@ concptr do_hissatsu_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcess if (cast) { msg_print(_("武器を不規則に揺らした...", "You irregularly wave your weapon...")); - project_all_los(player_ptr, GF_ENGETSU, plev * 4); + project_all_los(player_ptr, AttributeType::ENGETSU, plev * 4); } break; @@ -877,7 +877,7 @@ concptr do_hissatsu_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcess msg_print(_("不思議な力がテレポートを防いだ!", "A mysterious force prevents you from teleporting!")); break; } - project(player_ptr, 0, 0, y, x, HISSATSU_ISSEN, GF_ATTACK, PROJECT_BEAM | PROJECT_KILL); + project(player_ptr, 0, 0, y, x, HISSATSU_ISSEN, AttributeType::ATTACK, PROJECT_BEAM | PROJECT_KILL); teleport_player_to(player_ptr, y, x, TELEPORT_SPONTANEOUS); } break; @@ -956,7 +956,7 @@ concptr do_hissatsu_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcess damage *= player_ptr->num_blow[i]; total_damage += (damage / 100); } - project(player_ptr, 0, (cave_has_flag_bold(player_ptr->current_floor_ptr, y, x, FF::PROJECT) ? 5 : 0), y, x, total_damage * 3 / 2, GF_METEOR, + project(player_ptr, 0, (cave_has_flag_bold(player_ptr->current_floor_ptr, y, x, FF::PROJECT) ? 5 : 0), y, x, total_damage * 3 / 2, AttributeType::METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM); } break; diff --git a/src/realm/realm-life.cpp b/src/realm/realm-life.cpp index 40cec5477..a56c3f45a 100644 --- a/src/realm/realm-life.cpp +++ b/src/realm/realm-life.cpp @@ -12,7 +12,7 @@ #include "spell-kind/spells-perception.h" #include "spell-kind/spells-sight.h" #include "spell-kind/spells-world.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell/spells-status.h" #include "status/bad-status-setter.h" #include "status/buff-setter.h" @@ -88,7 +88,7 @@ concptr do_life_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessType if (cast) { if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_ball_hide(player_ptr, GF_WOUNDS, dir, damroll(dice, sides), 0); + fire_ball_hide(player_ptr, AttributeType::WOUNDS, dir, damroll(dice, sides), 0); } } break; @@ -200,7 +200,7 @@ concptr do_life_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessType if (cast) { if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_ball_hide(player_ptr, GF_WOUNDS, dir, damroll(dice, sides), 0); + fire_ball_hide(player_ptr, AttributeType::WOUNDS, dir, damroll(dice, sides), 0); } } break; @@ -379,7 +379,7 @@ concptr do_life_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessType if (cast) { if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_ball_hide(player_ptr, GF_WOUNDS, dir, damroll(dice, sides), 0); + fire_ball_hide(player_ptr, AttributeType::WOUNDS, dir, damroll(dice, sides), 0); } } break; diff --git a/src/realm/realm-nature.cpp b/src/realm/realm-nature.cpp index ebe1e7ea4..37e2bb156 100644 --- a/src/realm/realm-nature.cpp +++ b/src/realm/realm-nature.cpp @@ -27,7 +27,7 @@ #include "spell-kind/spells-perception.h" #include "spell-kind/spells-sight.h" #include "spell-realm/spells-nature.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell/spells-diceroll.h" #include "spell/spells-object.h" #include "spell/spells-status.h" @@ -97,7 +97,7 @@ concptr do_nature_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTy if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_beam(player_ptr, GF_ELEC, dir, damroll(dice, sides)); + fire_beam(player_ptr, AttributeType::ELEC, dir, damroll(dice, sides)); } } break; @@ -272,7 +272,7 @@ concptr do_nature_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTy if (cast) { if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_bolt_or_beam(player_ptr, beam_chance(player_ptr) - 10, GF_COLD, dir, damroll(dice, sides)); + fire_bolt_or_beam(player_ptr, beam_chance(player_ptr) - 10, AttributeType::COLD, dir, damroll(dice, sides)); } } break; @@ -317,7 +317,7 @@ concptr do_nature_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTy if (cast) { if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_bolt_or_beam(player_ptr, beam_chance(player_ptr) - 10, GF_FIRE, dir, damroll(dice, sides)); + fire_bolt_or_beam(player_ptr, beam_chance(player_ptr) - 10, AttributeType::FIRE, dir, damroll(dice, sides)); } } break; @@ -558,7 +558,7 @@ concptr do_nature_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTy if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_ball(player_ptr, GF_COLD, dir, dam, rad); + fire_ball(player_ptr, AttributeType::COLD, dir, dam, rad); } } break; @@ -579,7 +579,7 @@ concptr do_nature_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTy if (cast) { if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_ball(player_ptr, GF_ELEC, dir, dam, rad); + fire_ball(player_ptr, AttributeType::ELEC, dir, dam, rad); break; } } @@ -601,7 +601,7 @@ concptr do_nature_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTy if (cast) { if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_ball(player_ptr, GF_WATER, dir, dam, rad); + fire_ball(player_ptr, AttributeType::WATER, dir, dam, rad); } } break; @@ -621,7 +621,7 @@ concptr do_nature_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTy return info_damage(0, 0, dam / 2); if (cast) { - fire_ball(player_ptr, GF_LITE, 0, dam, rad); + fire_ball(player_ptr, AttributeType::LITE, 0, dam, rad); chg_virtue(player_ptr, V_KNOWLEDGE, 1); chg_virtue(player_ptr, V_ENLIGHTEN, 1); wiz_lite(player_ptr, false); @@ -667,7 +667,7 @@ concptr do_nature_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTy if (cast) { dispel_monsters(player_ptr, d_dam); earthquake(player_ptr, player_ptr->y, player_ptr->x, q_rad, 0); - project(player_ptr, 0, b_rad, player_ptr->y, player_ptr->x, b_dam, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM); + project(player_ptr, 0, b_rad, player_ptr->y, player_ptr->x, b_dam, AttributeType::DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM); } } break; diff --git a/src/realm/realm-song.cpp b/src/realm/realm-song.cpp index 2a6f61b28..5aff33486 100644 --- a/src/realm/realm-song.cpp +++ b/src/realm/realm-song.cpp @@ -19,7 +19,7 @@ #include "spell-kind/spells-sight.h" #include "spell-kind/spells-world.h" #include "spell-realm/spells-song.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell/spells-status.h" #include "status/action-setter.h" #include "status/bad-status-setter.h" @@ -140,7 +140,7 @@ concptr do_music_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_bolt(player_ptr, GF_SOUND, dir, damroll(dice, sides)); + fire_bolt(player_ptr, AttributeType::SOUND, dir, damroll(dice, sides)); } } break; @@ -250,7 +250,7 @@ concptr do_music_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp return info_power(power); if (cont) { - project_all_los(player_ptr, GF_TURN_ALL, power); + project_all_los(player_ptr, AttributeType::TURN_ALL, power); } } @@ -374,7 +374,7 @@ concptr do_music_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp return info_damage(dice, sides, 0); if (cont) { - project_all_los(player_ptr, GF_PSI, damroll(dice, sides)); + project_all_los(player_ptr, AttributeType::PSI, damroll(dice, sides)); } } @@ -406,7 +406,7 @@ concptr do_music_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp * MP不足で鑑定が発動される前に歌が中断してしまうのを防止。 */ if (cont || cast) { - project(player_ptr, 0, rad, player_ptr->y, player_ptr->x, 0, GF_IDENTIFY, PROJECT_ITEM); + project(player_ptr, 0, rad, player_ptr->y, player_ptr->x, 0, AttributeType::IDENTIFY, PROJECT_ITEM); } } @@ -486,7 +486,7 @@ concptr do_music_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp return info_damage(dice, sides, 0); if (cont) { - project_all_los(player_ptr, GF_SOUND, damroll(dice, sides)); + project_all_los(player_ptr, AttributeType::SOUND, damroll(dice, sides)); } } @@ -560,7 +560,7 @@ concptr do_music_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp * MP不足で効果が発動される前に歌が中断してしまうのを防止。 */ if (cont || cast) { - project(player_ptr, 0, 0, player_ptr->y, player_ptr->x, 0, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM | PROJECT_HIDE); + project(player_ptr, 0, 0, player_ptr->y, player_ptr->x, 0, AttributeType::DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM | PROJECT_HIDE); } } break; @@ -648,7 +648,7 @@ concptr do_music_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp if (cast) { msg_print(_("歌が空間を歪めた...", "Reality whirls wildly as you sing a dizzying melody...")); - project(player_ptr, 0, rad, player_ptr->y, player_ptr->x, power, GF_AWAY_ALL, PROJECT_KILL); + project(player_ptr, 0, rad, player_ptr->y, player_ptr->x, power, AttributeType::AWAY_ALL, PROJECT_KILL); } } break; @@ -733,7 +733,7 @@ concptr do_music_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_beam(player_ptr, GF_SOUND, dir, damroll(dice, sides)); + fire_beam(player_ptr, AttributeType::SOUND, dir, damroll(dice, sides)); } } break; @@ -957,7 +957,7 @@ concptr do_music_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_ball(player_ptr, GF_SOUND, dir, damroll(dice, sides), rad); + fire_ball(player_ptr, AttributeType::SOUND, dir, damroll(dice, sides), rad); } } break; diff --git a/src/realm/realm-sorcery.cpp b/src/realm/realm-sorcery.cpp index d573d9268..46f533006 100644 --- a/src/realm/realm-sorcery.cpp +++ b/src/realm/realm-sorcery.cpp @@ -16,7 +16,7 @@ #include "spell-kind/spells-teleport.h" #include "spell-kind/spells-world.h" #include "spell-realm/spells-sorcery.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell/spells-status.h" #include "status/body-improvement.h" #include "status/buff-setter.h" @@ -285,7 +285,7 @@ concptr do_sorcery_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessT if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_beam(player_ptr, GF_AWAY_ALL, dir, power); + fire_beam(player_ptr, AttributeType::AWAY_ALL, dir, power); } } break; diff --git a/src/realm/realm-trump.cpp b/src/realm/realm-trump.cpp index b96a5d4f2..6044350a9 100644 --- a/src/realm/realm-trump.cpp +++ b/src/realm/realm-trump.cpp @@ -15,7 +15,7 @@ #include "spell-kind/spells-world.h" #include "spell-realm/spells-chaos.h" #include "spell-realm/spells-trump.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell/spells-object.h" #include "spell/spells-status.h" #include "spell/spells-summon.h" @@ -166,7 +166,7 @@ concptr do_trump_spell(player_type *player_ptr, SPELL_IDX spell, SpellProcessTyp if (!get_aim_dir(player_ptr, &dir)) return nullptr; - fire_beam(player_ptr, GF_AWAY_ALL, dir, power); + fire_beam(player_ptr, AttributeType::AWAY_ALL, dir, power); } } break; diff --git a/src/specific-object/blade-turner.cpp b/src/specific-object/blade-turner.cpp index e30007971..e176f83d1 100644 --- a/src/specific-object/blade-turner.cpp +++ b/src/specific-object/blade-turner.cpp @@ -1,7 +1,7 @@ #include "specific-object/blade-turner.h" #include "hpmp/hp-mp-processor.h" #include "spell-kind/spells-launcher.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "status/bad-status-setter.h" #include "status/buff-setter.h" #include "status/element-resistance.h" @@ -16,7 +16,7 @@ bool activate_bladeturner(player_type *player_ptr) return false; msg_print(_("あなたはエレメントのブレスを吐いた。", "You breathe the elements.")); - fire_breath(player_ptr, GF_MISSILE, dir, 300, 4); + fire_breath(player_ptr, AttributeType::MISSILE, dir, 300, 4); msg_print(_("鎧が様々な色に輝いた...", "Your armor glows many colours...")); (void)BadStatusSetter(player_ptr).afraidness(0); (void)set_hero(player_ptr, randint1(50) + 50, false); diff --git a/src/specific-object/chest.cpp b/src/specific-object/chest.cpp index 1ea327eb2..a4e0c4678 100644 --- a/src/specific-object/chest.cpp +++ b/src/specific-object/chest.cpp @@ -15,7 +15,7 @@ #include "spell-kind/spells-equipment.h" #include "spell-kind/spells-launcher.h" #include "spell-kind/spells-sight.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell/spells-summon.h" #include "spell/summon-types.h" #include "status/bad-status-setter.h" @@ -223,7 +223,7 @@ void Chest::chest_trap(POSITION y, POSITION x, OBJECT_IDX o_idx) msg_print(_("鳥の群れがあなたを取り巻いた!", "A storm of birds swirls around you!")); for (i = 0; i < randint1(3) + 3; i++) - (void)fire_meteor(this->player_ptr, -1, GF_FORCE, y, x, o_ptr->pval / 5, 7); + (void)fire_meteor(this->player_ptr, -1, AttributeType::FORCE, y, x, o_ptr->pval / 5, 7); for (i = 0; i < randint1(5) + o_ptr->pval / 5; i++) { (void)summon_specific(this->player_ptr, 0, y, x, mon_level, SUMMON_BIRD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)); @@ -236,7 +236,7 @@ void Chest::chest_trap(POSITION y, POSITION x, OBJECT_IDX o_idx) if (one_in_(4)) { msg_print(_("炎と硫黄の雲の中に悪魔が姿を現した!", "Demons materialize in clouds of fire and brimstone!")); for (i = 0; i < randint1(3) + 2; i++) { - (void)fire_meteor(this->player_ptr, -1, GF_FIRE, y, x, 10, 5); + (void)fire_meteor(this->player_ptr, -1, AttributeType::FIRE, y, x, 10, 5); (void)summon_specific(this->player_ptr, 0, y, x, mon_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)); } } @@ -310,7 +310,7 @@ void Chest::chest_trap(POSITION y, POSITION x, OBJECT_IDX o_idx) continue; } - (void)fire_meteor(this->player_ptr, -1, GF_NETHER, y, x, 150, 1); + (void)fire_meteor(this->player_ptr, -1, AttributeType::NETHER, y, x, 150, 1); } } diff --git a/src/specific-object/death-crimson.cpp b/src/specific-object/death-crimson.cpp index acadf35eb..8f6068d4f 100644 --- a/src/specific-object/death-crimson.cpp +++ b/src/specific-object/death-crimson.cpp @@ -3,7 +3,7 @@ #include "effect/effect-characteristics.h" #include "effect/effect-processor.h" #include "floor/geometry.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/object-type-definition.h" #include "system/player-type-definition.h" #include "target/target-checker.h" @@ -45,7 +45,7 @@ static bool fire_crimson(player_type *player_ptr) BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL; for (int i = 0; i < num; i++) - (void)project(player_ptr, 0, player_ptr->lev / 20 + 1, ty, tx, player_ptr->lev * player_ptr->lev * 6 / 50, GF_ROCKET, flg); + (void)project(player_ptr, 0, player_ptr->lev / 20 + 1, ty, tx, player_ptr->lev * player_ptr->lev * 6 / 50, AttributeType::ROCKET, flg); return true; } diff --git a/src/specific-object/monster-ball.cpp b/src/specific-object/monster-ball.cpp index 737d9a868..c642514eb 100644 --- a/src/specific-object/monster-ball.cpp +++ b/src/specific-object/monster-ball.cpp @@ -11,7 +11,7 @@ #include "pet/pet-util.h" #include "racial/racial-android.h" #include "spell-kind/spells-launcher.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/floor-type-definition.h" #include "system/monster-race-definition.h" #include "system/monster-type-definition.h" @@ -71,7 +71,7 @@ static bool set_activation_target(player_type *player_ptr, ae_type *ae_ptr) } target_pet = old_target_pet; - if (!fire_ball(player_ptr, GF_CAPTURE, ae_ptr->dir, 0, 0)) + if (!fire_ball(player_ptr, AttributeType::CAPTURE, ae_ptr->dir, 0, 0)) return true; ae_ptr->o_ptr->pval = (PARAMETER_VALUE)cap_mon; diff --git a/src/specific-object/ring-of-power.cpp b/src/specific-object/ring-of-power.cpp index a68d2c856..1db583f23 100644 --- a/src/specific-object/ring-of-power.cpp +++ b/src/specific-object/ring-of-power.cpp @@ -4,7 +4,7 @@ #include "player/player-status.h" #include "spell-kind/spells-launcher.h" #include "spell-kind/spells-sight.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "status/base-status.h" #include "system/player-type-definition.h" #include "target/target-getter.h" @@ -40,13 +40,13 @@ static void exe_ring_of_power(player_type *player_ptr, DIRECTION dir) case 4: case 5: case 6: - fire_ball(player_ptr, GF_MANA, dir, 600, 3); + fire_ball(player_ptr, AttributeType::MANA, dir, 600, 3); break; case 7: case 8: case 9: case 10: - fire_bolt(player_ptr, GF_MANA, dir, 500); + fire_bolt(player_ptr, AttributeType::MANA, dir, 500); break; default: break; diff --git a/src/spell-kind/blood-curse.cpp b/src/spell-kind/blood-curse.cpp index 0a4cf2e1c..3070651f4 100644 --- a/src/spell-kind/blood-curse.cpp +++ b/src/spell-kind/blood-curse.cpp @@ -6,7 +6,7 @@ #include "spell-kind/earthquake.h" #include "spell-kind/spells-sight.h" #include "spell-kind/spells-teleport.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell/spells-summon.h" #include "spell/summon-types.h" #include "status/base-status.h" @@ -43,7 +43,7 @@ void blood_curse_to_enemy(player_type *player_ptr, MONSTER_IDX m_idx) if (!count) { int extra_dam = damroll(10, 10); msg_print(_("純粋な魔力の次元への扉が開いた!", "A portal opens to a plane of raw mana!")); - project(player_ptr, 0, 8, m_ptr->fy, m_ptr->fx, extra_dam, GF_MANA, curse_flg); + project(player_ptr, 0, 8, m_ptr->fy, m_ptr->fx, extra_dam, AttributeType::MANA, curse_flg); if (!one_in_(6)) break; } @@ -64,7 +64,7 @@ void blood_curse_to_enemy(player_type *player_ptr, MONSTER_IDX m_idx) case 10: case 11: msg_print(_("エネルギーのうねりを感じた!", "You feel a surge of energy!")); - project(player_ptr, 0, 7, m_ptr->fy, m_ptr->fx, 50, GF_DISINTEGRATE, curse_flg); + project(player_ptr, 0, 7, m_ptr->fy, m_ptr->fx, 50, AttributeType::DISINTEGRATE, curse_flg); if (!one_in_(6)) break; /* Fall through */ diff --git a/src/spell-kind/spells-beam.cpp b/src/spell-kind/spells-beam.cpp index de98879d6..083a75c53 100644 --- a/src/spell-kind/spells-beam.cpp +++ b/src/spell-kind/spells-beam.cpp @@ -1,6 +1,6 @@ #include "spell-kind/spells-beam.h" #include "effect/effect-characteristics.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell-kind/spells-launcher.h" #include "system/player-type-definition.h" @@ -14,7 +14,7 @@ bool wall_to_mud(player_type *player_ptr, DIRECTION dir, HIT_POINT dam) { BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL; - return (project_hook(player_ptr, GF_KILL_WALL, dir, dam, flg)); + return (project_hook(player_ptr, AttributeType::KILL_WALL, dir, dam, flg)); } /*! @@ -26,7 +26,7 @@ bool wall_to_mud(player_type *player_ptr, DIRECTION dir, HIT_POINT dam) bool wizard_lock(player_type *player_ptr, DIRECTION dir) { BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL; - return (project_hook(player_ptr, GF_JAM_DOOR, dir, 20 + randint1(30), flg)); + return (project_hook(player_ptr, AttributeType::JAM_DOOR, dir, 20 + randint1(30), flg)); } /*! @@ -38,7 +38,7 @@ bool wizard_lock(player_type *player_ptr, DIRECTION dir) bool destroy_door(player_type *player_ptr, DIRECTION dir) { BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM; - return (project_hook(player_ptr, GF_KILL_DOOR, dir, 0, flg)); + return (project_hook(player_ptr, AttributeType::KILL_DOOR, dir, 0, flg)); } /*! @@ -50,5 +50,5 @@ bool destroy_door(player_type *player_ptr, DIRECTION dir) bool disarm_trap(player_type *player_ptr, DIRECTION dir) { BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM; - return (project_hook(player_ptr, GF_KILL_TRAP, dir, 0, flg)); + return (project_hook(player_ptr, AttributeType::KILL_TRAP, dir, 0, flg)); } diff --git a/src/spell-kind/spells-charm.cpp b/src/spell-kind/spells-charm.cpp index e7a6b7a2f..0e793e231 100644 --- a/src/spell-kind/spells-charm.cpp +++ b/src/spell-kind/spells-charm.cpp @@ -1,7 +1,7 @@ #include "spell-kind/spells-charm.h" #include "effect/effect-characteristics.h" #include "spell-kind/spells-launcher.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/player-type-definition.h" /*! @@ -14,7 +14,7 @@ bool charm_monster(player_type *player_ptr, DIRECTION dir, PLAYER_LEVEL plev) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL; - return (project_hook(player_ptr, GF_CHARM, dir, plev, flg)); + return (project_hook(player_ptr, AttributeType::CHARM, dir, plev, flg)); } /*! @@ -27,7 +27,7 @@ bool charm_monster(player_type *player_ptr, DIRECTION dir, PLAYER_LEVEL plev) bool control_one_undead(player_type *player_ptr, DIRECTION dir, PLAYER_LEVEL plev) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL; - return (project_hook(player_ptr, GF_CONTROL_UNDEAD, dir, plev, flg)); + return (project_hook(player_ptr, AttributeType::CONTROL_UNDEAD, dir, plev, flg)); } /*! @@ -40,7 +40,7 @@ bool control_one_undead(player_type *player_ptr, DIRECTION dir, PLAYER_LEVEL ple bool control_one_demon(player_type *player_ptr, DIRECTION dir, PLAYER_LEVEL plev) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL; - return (project_hook(player_ptr, GF_CONTROL_DEMON, dir, plev, flg)); + return (project_hook(player_ptr, AttributeType::CONTROL_DEMON, dir, plev, flg)); } /*! @@ -53,5 +53,5 @@ bool control_one_demon(player_type *player_ptr, DIRECTION dir, PLAYER_LEVEL plev bool charm_animal(player_type *player_ptr, DIRECTION dir, PLAYER_LEVEL plev) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL; - return (project_hook(player_ptr, GF_CONTROL_ANIMAL, dir, plev, flg)); + return (project_hook(player_ptr, AttributeType::CONTROL_ANIMAL, dir, plev, flg)); } diff --git a/src/spell-kind/spells-floor.cpp b/src/spell-kind/spells-floor.cpp index 7bf32ad63..4f9acace7 100644 --- a/src/spell-kind/spells-floor.cpp +++ b/src/spell-kind/spells-floor.cpp @@ -43,7 +43,7 @@ #include "player/player-status-flags.h" #include "player/special-defense-types.h" #include "spell-kind/spells-teleport.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "status/bad-status-setter.h" #include "system/artifact-type-definition.h" #include "system/floor-type-definition.h" diff --git a/src/spell-kind/spells-launcher.cpp b/src/spell-kind/spells-launcher.cpp index 9daca02c4..0da6f70ac 100644 --- a/src/spell-kind/spells-launcher.cpp +++ b/src/spell-kind/spells-launcher.cpp @@ -2,7 +2,6 @@ #include "effect/effect-characteristics.h" #include "effect/effect-processor.h" #include "floor/geometry.h" -#include "spell/spell-types.h" #include "system/player-type-definition.h" #include "target/target-checker.h" @@ -21,10 +20,10 @@ * Affect grids, objects, and monsters * */ -bool fire_ball(player_type *player_ptr, EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad) +bool fire_ball(player_type *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, POSITION rad) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL; - if (typ == GF_CHARM_LIVING) + if (typ == AttributeType::CHARM_LIVING) flg |= PROJECT_HIDE; POSITION tx = player_ptr->x + 99 * ddx[dir]; @@ -54,7 +53,7 @@ bool fire_ball(player_type *player_ptr, EFFECT_ID typ, DIRECTION dir, HIT_POINT * Affect grids, objects, and monsters * */ -bool fire_breath(player_type *player_ptr, EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad) +bool fire_breath(player_type *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, POSITION rad) { return fire_ball(player_ptr, typ, dir, dam, -rad); } @@ -74,7 +73,7 @@ bool fire_breath(player_type *player_ptr, EFFECT_ID typ, DIRECTION dir, HIT_POIN * Affect grids, objects, and monsters * */ -bool fire_rocket(player_type *player_ptr, EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad) +bool fire_rocket(player_type *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, POSITION rad) { POSITION tx = player_ptr->x + 99 * ddx[dir]; POSITION ty = player_ptr->y + 99 * ddy[dir]; @@ -102,7 +101,7 @@ bool fire_rocket(player_type *player_ptr, EFFECT_ID typ, DIRECTION dir, HIT_POIN * Affect grids, objects, and monsters * */ -bool fire_ball_hide(player_type *player_ptr, EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad) +bool fire_ball_hide(player_type *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, POSITION rad) { POSITION tx = player_ptr->x + 99 * ddx[dir]; POSITION ty = player_ptr->y + 99 * ddy[dir]; @@ -135,7 +134,7 @@ bool fire_ball_hide(player_type *player_ptr, EFFECT_ID typ, DIRECTION dir, HIT_P * Option to hurt the player. * */ -bool fire_meteor(player_type *player_ptr, MONSTER_IDX who, EFFECT_ID typ, POSITION y, POSITION x, HIT_POINT dam, POSITION rad) +bool fire_meteor(player_type *player_ptr, MONSTER_IDX who, AttributeType typ, POSITION y, POSITION x, HIT_POINT dam, POSITION rad) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL; return project(player_ptr, who, rad, y, x, dam, typ, flg).notice; @@ -152,7 +151,7 @@ bool fire_meteor(player_type *player_ptr, MONSTER_IDX who, EFFECT_ID typ, POSITI * @param dev 回数分散 * @return 作用が実際にあった場合TRUEを返す */ -bool fire_blast(player_type *player_ptr, EFFECT_ID typ, DIRECTION dir, DICE_NUMBER dd, DICE_SID ds, int num, int dev) +bool fire_blast(player_type *player_ptr, AttributeType typ, DIRECTION dir, DICE_NUMBER dd, DICE_SID ds, int num, int dev) { POSITION ty, tx, y, x; POSITION ly, lx; @@ -202,10 +201,10 @@ bool fire_blast(player_type *player_ptr, EFFECT_ID typ, DIRECTION dir, DICE_NUMB * Affect monsters and grids (not objects). * */ -bool fire_bolt(player_type *player_ptr, EFFECT_ID typ, DIRECTION dir, HIT_POINT dam) +bool fire_bolt(player_type *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_GRID; - if (typ != GF_ARROW) + if (typ != AttributeType::ARROW) flg |= PROJECT_REFLECTABLE; return (project_hook(player_ptr, typ, dir, dam, flg)); } @@ -223,7 +222,7 @@ bool fire_bolt(player_type *player_ptr, EFFECT_ID typ, DIRECTION dir, HIT_POINT * Affect monsters, grids and objects. * */ -bool fire_beam(player_type *player_ptr, EFFECT_ID typ, DIRECTION dir, HIT_POINT dam) +bool fire_beam(player_type *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam) { BIT_FLAGS flg = PROJECT_BEAM | PROJECT_KILL | PROJECT_GRID | PROJECT_ITEM; return (project_hook(player_ptr, typ, dir, dam, flg)); @@ -243,7 +242,7 @@ bool fire_beam(player_type *player_ptr, EFFECT_ID typ, DIRECTION dir, HIT_POINT * Affect monsters, grids and objects. * */ -bool fire_bolt_or_beam(player_type *player_ptr, PERCENTAGE prob, EFFECT_ID typ, DIRECTION dir, HIT_POINT dam) +bool fire_bolt_or_beam(player_type *player_ptr, PERCENTAGE prob, AttributeType typ, DIRECTION dir, HIT_POINT dam) { if (randint0(100) < prob) { return (fire_beam(player_ptr, typ, dir, dam)); @@ -261,7 +260,7 @@ bool fire_bolt_or_beam(player_type *player_ptr, PERCENTAGE prob, EFFECT_ID typ, * @param flg フラグ * @return 作用が実際にあった場合TRUEを返す */ -bool project_hook(player_type *player_ptr, EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, BIT_FLAGS flg) +bool project_hook(player_type *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, BIT_FLAGS flg) { flg |= (PROJECT_THRU); POSITION tx = player_ptr->x + ddx[dir]; diff --git a/src/spell-kind/spells-launcher.h b/src/spell-kind/spells-launcher.h index a905539cb..bf73d3cbb 100644 --- a/src/spell-kind/spells-launcher.h +++ b/src/spell-kind/spells-launcher.h @@ -1,15 +1,16 @@ #pragma once #include "system/angband.h" +#include "effect/attribute-types.h" struct player_type; -bool fire_ball(player_type *player_ptr, EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad); -bool fire_breath(player_type *player_ptr, EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad); -bool fire_rocket(player_type *player_ptr, EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad); -bool fire_ball_hide(player_type *player_ptr, EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad); -bool fire_meteor(player_type *player_ptr, MONSTER_IDX who, EFFECT_ID typ, POSITION x, POSITION y, HIT_POINT dam, POSITION rad); -bool fire_bolt(player_type *player_ptr, EFFECT_ID typ, DIRECTION dir, HIT_POINT dam); -bool fire_blast(player_type *player_ptr, EFFECT_ID typ, DIRECTION dir, DICE_NUMBER dd, DICE_SID ds, int num, int dev); -bool fire_beam(player_type *player_ptr, EFFECT_ID typ, DIRECTION dir, HIT_POINT dam); -bool fire_bolt_or_beam(player_type *player_ptr, PERCENTAGE prob, EFFECT_ID typ, DIRECTION dir, HIT_POINT dam); -bool project_hook(player_type *player_ptr, EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, BIT_FLAGS flg); +bool fire_ball(player_type *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, POSITION rad); +bool fire_breath(player_type *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, POSITION rad); +bool fire_rocket(player_type *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, POSITION rad); +bool fire_ball_hide(player_type *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, POSITION rad); +bool fire_meteor(player_type *player_ptr, MONSTER_IDX who, AttributeType typ, POSITION x, POSITION y, HIT_POINT dam, POSITION rad); +bool fire_bolt(player_type *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam); +bool fire_blast(player_type *player_ptr, AttributeType typ, DIRECTION dir, DICE_NUMBER dd, DICE_SID ds, int num, int dev); +bool fire_beam(player_type *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam); +bool fire_bolt_or_beam(player_type *player_ptr, PERCENTAGE prob, AttributeType typ, DIRECTION dir, HIT_POINT dam); +bool project_hook(player_type *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, BIT_FLAGS flg); diff --git a/src/spell-kind/spells-lite.cpp b/src/spell-kind/spells-lite.cpp index 839ed483a..6f983314d 100644 --- a/src/spell-kind/spells-lite.cpp +++ b/src/spell-kind/spells-lite.cpp @@ -18,7 +18,7 @@ #include "player/special-defense-types.h" #include "spell-kind/spells-launcher.h" #include "spell-kind/spells-lite.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/floor-type-definition.h" #include "system/grid-type-definition.h" #include "system/monster-race-definition.h" @@ -388,7 +388,7 @@ bool starlight(player_type *player_ptr, bool magic) break; } - project(player_ptr, 0, 0, y, x, damroll(6 + player_ptr->lev / 8, 10), GF_LITE_WEAK, + project(player_ptr, 0, 0, y, x, damroll(6 + player_ptr->lev / 8, 10), AttributeType::LITE_WEAK, (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_KILL | PROJECT_LOS)); } @@ -414,7 +414,7 @@ bool lite_area(player_type *player_ptr, HIT_POINT dam, POSITION rad) } BIT_FLAGS flg = PROJECT_GRID | PROJECT_KILL; - (void)project(player_ptr, 0, rad, player_ptr->y, player_ptr->x, dam, GF_LITE_WEAK, flg); + (void)project(player_ptr, 0, rad, player_ptr->y, player_ptr->x, dam, AttributeType::LITE_WEAK, flg); lite_room(player_ptr, player_ptr->y, player_ptr->x); @@ -435,7 +435,7 @@ bool unlite_area(player_type *player_ptr, HIT_POINT dam, POSITION rad) } BIT_FLAGS flg = PROJECT_GRID | PROJECT_KILL; - (void)project(player_ptr, 0, rad, player_ptr->y, player_ptr->x, dam, GF_DARK_WEAK, flg); + (void)project(player_ptr, 0, rad, player_ptr->y, player_ptr->x, dam, AttributeType::DARK_WEAK, flg); unlite_room(player_ptr, player_ptr->y, player_ptr->x); @@ -452,5 +452,5 @@ bool unlite_area(player_type *player_ptr, HIT_POINT dam, POSITION rad) bool lite_line(player_type *player_ptr, DIRECTION dir, HIT_POINT dam) { BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_KILL; - return (project_hook(player_ptr, GF_LITE_WEAK, dir, dam, flg)); + return (project_hook(player_ptr, AttributeType::LITE_WEAK, dir, dam, flg)); } diff --git a/src/spell-kind/spells-neighbor.cpp b/src/spell-kind/spells-neighbor.cpp index 2889640c1..d4b465b78 100644 --- a/src/spell-kind/spells-neighbor.cpp +++ b/src/spell-kind/spells-neighbor.cpp @@ -8,7 +8,7 @@ #include "grid/feature-flag-types.h" #include "grid/grid.h" #include "spell-kind/earthquake.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/player-type-definition.h" #include "util/bit-flags-calculator.h" @@ -20,7 +20,7 @@ bool door_creation(player_type *player_ptr, POSITION y, POSITION x) { BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE; - return project(player_ptr, 0, 1, y, x, 0, GF_MAKE_DOOR, flg).notice; + return project(player_ptr, 0, 1, y, x, 0, AttributeType::MAKE_DOOR, flg).notice; } /*! @@ -33,7 +33,7 @@ bool door_creation(player_type *player_ptr, POSITION y, POSITION x) bool trap_creation(player_type *player_ptr, POSITION y, POSITION x) { BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE; - return project(player_ptr, 0, 1, y, x, 0, GF_MAKE_TRAP, flg).notice; + return project(player_ptr, 0, 1, y, x, 0, AttributeType::MAKE_TRAP, flg).notice; } /*! @@ -44,7 +44,7 @@ bool trap_creation(player_type *player_ptr, POSITION y, POSITION x) bool tree_creation(player_type *player_ptr, POSITION y, POSITION x) { BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE; - return project(player_ptr, 0, 1, y, x, 0, GF_MAKE_TREE, flg).notice; + return project(player_ptr, 0, 1, y, x, 0, AttributeType::MAKE_TREE, flg).notice; } /*! @@ -55,7 +55,7 @@ bool tree_creation(player_type *player_ptr, POSITION y, POSITION x) bool create_rune_protection_area(player_type *player_ptr, POSITION y, POSITION x) { BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM; - return project(player_ptr, 0, 1, y, x, 0, GF_MAKE_RUNE_PROTECTION, flg).notice; + return project(player_ptr, 0, 1, y, x, 0, AttributeType::MAKE_RUNE_PROTECTION, flg).notice; } /*! @@ -66,7 +66,7 @@ bool create_rune_protection_area(player_type *player_ptr, POSITION y, POSITION x bool wall_stone(player_type *player_ptr) { BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE; - bool dummy = project(player_ptr, 0, 1, player_ptr->y, player_ptr->x, 0, GF_STONE_WALL, flg).notice; + bool dummy = project(player_ptr, 0, 1, player_ptr->y, player_ptr->x, 0, AttributeType::STONE_WALL, flg).notice; player_ptr->update |= (PU_FLOW); player_ptr->redraw |= (PR_MAP); return dummy; @@ -80,7 +80,7 @@ bool wall_stone(player_type *player_ptr) bool destroy_doors_touch(player_type *player_ptr) { BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE; - return project(player_ptr, 0, 1, player_ptr->y, player_ptr->x, 0, GF_KILL_DOOR, flg).notice; + return project(player_ptr, 0, 1, player_ptr->y, player_ptr->x, 0, AttributeType::KILL_DOOR, flg).notice; } /*! @@ -91,7 +91,7 @@ bool destroy_doors_touch(player_type *player_ptr) bool disarm_traps_touch(player_type *player_ptr) { BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE; - return project(player_ptr, 0, 1, player_ptr->y, player_ptr->x, 0, GF_KILL_TRAP, flg).notice; + return project(player_ptr, 0, 1, player_ptr->y, player_ptr->x, 0, AttributeType::KILL_TRAP, flg).notice; } /*! @@ -102,7 +102,7 @@ bool disarm_traps_touch(player_type *player_ptr) bool sleep_monsters_touch(player_type *player_ptr) { BIT_FLAGS flg = PROJECT_KILL | PROJECT_HIDE; - return project(player_ptr, 0, 1, player_ptr->y, player_ptr->x, player_ptr->lev, GF_OLD_SLEEP, flg).notice; + return project(player_ptr, 0, 1, player_ptr->y, player_ptr->x, player_ptr->lev, AttributeType::OLD_SLEEP, flg).notice; } /*! @@ -116,7 +116,7 @@ bool sleep_monsters_touch(player_type *player_ptr) bool animate_dead(player_type *player_ptr, MONSTER_IDX who, POSITION y, POSITION x) { BIT_FLAGS flg = PROJECT_ITEM | PROJECT_HIDE; - return project(player_ptr, who, 5, y, x, 0, GF_ANIM_DEAD, flg).notice; + return project(player_ptr, who, 5, y, x, 0, AttributeType::ANIM_DEAD, flg).notice; } /*! @@ -138,7 +138,7 @@ void wall_breaker(player_type *player_ptr) break; } - project(player_ptr, 0, 0, y, x, 20 + randint1(30), GF_KILL_WALL, (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL)); + project(player_ptr, 0, 0, y, x, 20 + randint1(30), AttributeType::KILL_WALL, (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL)); return; } @@ -156,6 +156,6 @@ void wall_breaker(player_type *player_ptr) break; } - project(player_ptr, 0, 0, y, x, 20 + randint1(30), GF_KILL_WALL, (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL)); + project(player_ptr, 0, 0, y, x, 20 + randint1(30), AttributeType::KILL_WALL, (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL)); } } diff --git a/src/spell-kind/spells-pet.cpp b/src/spell-kind/spells-pet.cpp index 2d36e630a..ced1209f8 100644 --- a/src/spell-kind/spells-pet.cpp +++ b/src/spell-kind/spells-pet.cpp @@ -11,7 +11,7 @@ #include "monster/monster-description-types.h" #include "monster/monster-info.h" #include "monster/smart-learn-types.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/floor-type-definition.h" #include "system/monster-race-definition.h" #include "system/monster-type-definition.h" @@ -59,7 +59,7 @@ void discharge_minion(player_type *player_ptr) dam = (dam - 400) / 2 + 400; if (dam > 800) dam = 800; - project(player_ptr, i, 2 + (r_ptr->level / 20), m_ptr->fy, m_ptr->fx, dam, GF_PLASMA, PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL); + project(player_ptr, i, 2 + (r_ptr->level / 20), m_ptr->fy, m_ptr->fx, dam, AttributeType::PLASMA, PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL); if (record_named_pet && m_ptr->nickname) { GAME_TEXT m_name[MAX_NLEN]; diff --git a/src/spell-kind/spells-random.cpp b/src/spell-kind/spells-random.cpp index 917f4a01b..522e34282 100644 --- a/src/spell-kind/spells-random.cpp +++ b/src/spell-kind/spells-random.cpp @@ -23,7 +23,7 @@ #include "spell-kind/spells-sight.h" #include "spell-kind/spells-specific-bolt.h" #include "spell-kind/spells-teleport.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell/spells-diceroll.h" #include "spell/spells-status.h" #include "spell/spells-summon.h" @@ -42,11 +42,14 @@ */ void call_chaos(player_type *player_ptr) { - int hurt_types[31] = { GF_ELEC, GF_POIS, GF_ACID, GF_COLD, GF_FIRE, GF_MISSILE, GF_ARROW, GF_PLASMA, GF_HOLY_FIRE, GF_WATER, GF_LITE, GF_DARK, GF_FORCE, - GF_INERTIAL, GF_MANA, GF_METEOR, GF_ICE, GF_CHAOS, GF_NETHER, GF_DISENCHANT, GF_SHARDS, GF_SOUND, GF_NEXUS, GF_CONFUSION, GF_TIME, GF_GRAVITY, - GF_ROCKET, GF_NUKE, GF_HELL_FIRE, GF_DISINTEGRATE, GF_PSY_SPEAR }; - - int chaos_type = hurt_types[randint0(31)]; + AttributeType hurt_types[31] = { AttributeType::ELEC, AttributeType::POIS, AttributeType::ACID, AttributeType::COLD, AttributeType::FIRE, + AttributeType::MISSILE, AttributeType::ARROW, AttributeType::PLASMA, AttributeType::HOLY_FIRE, AttributeType::WATER, AttributeType::LITE, + AttributeType::DARK, AttributeType::FORCE, AttributeType::INERTIAL, AttributeType::MANA, AttributeType::METEOR, AttributeType::ICE, + AttributeType::CHAOS, AttributeType::NETHER, AttributeType::DISENCHANT, AttributeType::SHARDS, AttributeType::SOUND, AttributeType::NEXUS, + AttributeType::CONFUSION, AttributeType::TIME, AttributeType::GRAVITY, AttributeType::ROCKET, AttributeType::NUKE, AttributeType::HELL_FIRE, + AttributeType::DISINTEGRATE, AttributeType::PSY_SPEAR }; + + AttributeType chaos_type = hurt_types[randint0(31)]; bool line_chaos = false; if (one_in_(4)) line_chaos = true; @@ -112,7 +115,7 @@ bool activate_ty_curse(player_type *player_ptr, bool stop_ty, int *count) if (!(*count)) { HIT_POINT dam = damroll(10, 10); msg_print(_("純粋な魔力の次元への扉が開いた!", "A portal opens to a plane of raw mana!")); - project(player_ptr, 0, 8, player_ptr->y, player_ptr->x, dam, GF_MANA, flg); + project(player_ptr, 0, 8, player_ptr->y, player_ptr->x, dam, AttributeType::MANA, flg); take_hit(player_ptr, DAMAGE_NOESCAPE, dam, _("純粋な魔力の解放", "released pure mana")); if (!one_in_(6)) break; @@ -133,7 +136,7 @@ bool activate_ty_curse(player_type *player_ptr, bool stop_ty, int *count) msg_print(_("エネルギーのうねりを感じた!", "You feel a surge of energy!")); wall_breaker(player_ptr); if (!randint0(7)) { - project(player_ptr, 0, 7, player_ptr->y, player_ptr->x, 50, GF_KILL_WALL, flg); + project(player_ptr, 0, 7, player_ptr->y, player_ptr->x, 50, AttributeType::KILL_WALL, flg); take_hit(player_ptr, DAMAGE_NOESCAPE, 50, _("エネルギーのうねり", "surge of energy")); } @@ -305,7 +308,7 @@ void wild_magic(player_type *player_ptr, int spell) lose_all_info(player_ptr); break; case 32: - fire_ball(player_ptr, GF_CHAOS, 0, spell + 5, 1 + (spell / 10)); + fire_ball(player_ptr, AttributeType::CHAOS, 0, spell + 5, 1 + (spell / 10)); break; case 33: wall_stone(player_ptr); @@ -388,7 +391,7 @@ void cast_wonder(player_type *player_ptr, DIRECTION dir) } if (die < 36) { - fire_bolt_or_beam(player_ptr, beam_chance(player_ptr) - 10, GF_MISSILE, dir, damroll(3 + ((plev - 1) / 5), 4)); + fire_bolt_or_beam(player_ptr, beam_chance(player_ptr) - 10, AttributeType::MISSILE, dir, damroll(3 + ((plev - 1) / 5), 4)); return; } @@ -398,7 +401,7 @@ void cast_wonder(player_type *player_ptr, DIRECTION dir) } if (die < 46) { - fire_ball(player_ptr, GF_POIS, dir, 20 + (plev / 2), 3); + fire_ball(player_ptr, AttributeType::POIS, dir, 20 + (plev / 2), 3); return; } @@ -408,22 +411,22 @@ void cast_wonder(player_type *player_ptr, DIRECTION dir) } if (die < 56) { - fire_bolt_or_beam(player_ptr, beam_chance(player_ptr) - 10, GF_ELEC, dir, damroll(3 + ((plev - 5) / 4), 8)); + fire_bolt_or_beam(player_ptr, beam_chance(player_ptr) - 10, AttributeType::ELEC, dir, damroll(3 + ((plev - 5) / 4), 8)); return; } if (die < 61) { - fire_bolt_or_beam(player_ptr, beam_chance(player_ptr) - 10, GF_COLD, dir, damroll(5 + ((plev - 5) / 4), 8)); + fire_bolt_or_beam(player_ptr, beam_chance(player_ptr) - 10, AttributeType::COLD, dir, damroll(5 + ((plev - 5) / 4), 8)); return; } if (die < 66) { - fire_bolt_or_beam(player_ptr, beam_chance(player_ptr), GF_ACID, dir, damroll(6 + ((plev - 5) / 4), 8)); + fire_bolt_or_beam(player_ptr, beam_chance(player_ptr), AttributeType::ACID, dir, damroll(6 + ((plev - 5) / 4), 8)); return; } if (die < 71) { - fire_bolt_or_beam(player_ptr, beam_chance(player_ptr), GF_FIRE, dir, damroll(8 + ((plev - 5) / 4), 8)); + fire_bolt_or_beam(player_ptr, beam_chance(player_ptr), AttributeType::FIRE, dir, damroll(8 + ((plev - 5) / 4), 8)); return; } @@ -433,22 +436,22 @@ void cast_wonder(player_type *player_ptr, DIRECTION dir) } if (die < 81) { - fire_ball(player_ptr, GF_ELEC, dir, 30 + plev / 2, 2); + fire_ball(player_ptr, AttributeType::ELEC, dir, 30 + plev / 2, 2); return; } if (die < 86) { - fire_ball(player_ptr, GF_ACID, dir, 40 + plev, 2); + fire_ball(player_ptr, AttributeType::ACID, dir, 40 + plev, 2); return; } if (die < 91) { - fire_ball(player_ptr, GF_ICE, dir, 70 + plev, 3); + fire_ball(player_ptr, AttributeType::ICE, dir, 70 + plev, 3); return; } if (die < 96) { - fire_ball(player_ptr, GF_FIRE, dir, 80 + plev, 3); + fire_ball(player_ptr, AttributeType::FIRE, dir, 80 + plev, 3); return; } diff --git a/src/spell-kind/spells-sight.cpp b/src/spell-kind/spells-sight.cpp index fe0da2735..818a607e3 100644 --- a/src/spell-kind/spells-sight.cpp +++ b/src/spell-kind/spells-sight.cpp @@ -22,7 +22,7 @@ #include "monster/monster-status-setter.h" #include "monster/monster-status.h" #include "monster/smart-learn-types.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/floor-type-definition.h" #include "system/monster-race-definition.h" #include "system/monster-type-definition.h" @@ -44,7 +44,7 @@ * this is done in two passes. -- JDL * */ -bool project_all_los(player_type *player_ptr, EFFECT_ID typ, HIT_POINT dam) +bool project_all_los(player_type *player_ptr, AttributeType typ, HIT_POINT dam) { for (MONSTER_IDX i = 1; i < player_ptr->current_floor_ptr->m_max; i++) { monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[i]; @@ -84,7 +84,7 @@ bool project_all_los(player_type *player_ptr, EFFECT_ID typ, HIT_POINT dam) */ bool speed_monsters(player_type *player_ptr) { - return (project_all_los(player_ptr, GF_OLD_SPEED, player_ptr->lev)); + return (project_all_los(player_ptr, AttributeType::OLD_SPEED, player_ptr->lev)); } /*! @@ -94,7 +94,7 @@ bool speed_monsters(player_type *player_ptr) */ bool slow_monsters(player_type *player_ptr, int power) { - return (project_all_los(player_ptr, GF_OLD_SLOW, power)); + return (project_all_los(player_ptr, AttributeType::OLD_SLOW, power)); } /*! @@ -104,7 +104,7 @@ bool slow_monsters(player_type *player_ptr, int power) */ bool sleep_monsters(player_type *player_ptr, int power) { - return (project_all_los(player_ptr, GF_OLD_SLEEP, power)); + return (project_all_los(player_ptr, AttributeType::OLD_SLEEP, power)); } /*! @@ -114,7 +114,7 @@ bool sleep_monsters(player_type *player_ptr, int power) */ bool banish_evil(player_type *player_ptr, int dist) { - return (project_all_los(player_ptr, GF_AWAY_EVIL, dist)); + return (project_all_los(player_ptr, AttributeType::AWAY_EVIL, dist)); } /*! @@ -123,7 +123,7 @@ bool banish_evil(player_type *player_ptr, int dist) */ bool turn_undead(player_type *player_ptr) { - bool tester = (project_all_los(player_ptr, GF_TURN_UNDEAD, player_ptr->lev)); + bool tester = (project_all_los(player_ptr, AttributeType::TURN_UNDEAD, player_ptr->lev)); if (tester) chg_virtue(player_ptr, V_UNLIFE, -1); return tester; @@ -136,7 +136,7 @@ bool turn_undead(player_type *player_ptr) */ bool dispel_undead(player_type *player_ptr, HIT_POINT dam) { - bool tester = (project_all_los(player_ptr, GF_DISP_UNDEAD, dam)); + bool tester = (project_all_los(player_ptr, AttributeType::DISP_UNDEAD, dam)); if (tester) chg_virtue(player_ptr, V_UNLIFE, -2); return tester; @@ -149,7 +149,7 @@ bool dispel_undead(player_type *player_ptr, HIT_POINT dam) */ bool dispel_evil(player_type *player_ptr, HIT_POINT dam) { - return (project_all_los(player_ptr, GF_DISP_EVIL, dam)); + return (project_all_los(player_ptr, AttributeType::DISP_EVIL, dam)); } /*! @@ -159,7 +159,7 @@ bool dispel_evil(player_type *player_ptr, HIT_POINT dam) */ bool dispel_good(player_type *player_ptr, HIT_POINT dam) { - return (project_all_los(player_ptr, GF_DISP_GOOD, dam)); + return (project_all_los(player_ptr, AttributeType::DISP_GOOD, dam)); } /*! @@ -169,7 +169,7 @@ bool dispel_good(player_type *player_ptr, HIT_POINT dam) */ bool dispel_monsters(player_type *player_ptr, HIT_POINT dam) { - return (project_all_los(player_ptr, GF_DISP_ALL, dam)); + return (project_all_los(player_ptr, AttributeType::DISP_ALL, dam)); } /*! @@ -179,7 +179,7 @@ bool dispel_monsters(player_type *player_ptr, HIT_POINT dam) */ bool dispel_living(player_type *player_ptr, HIT_POINT dam) { - return (project_all_los(player_ptr, GF_DISP_LIVING, dam)); + return (project_all_los(player_ptr, AttributeType::DISP_LIVING, dam)); } /*! @@ -189,7 +189,7 @@ bool dispel_living(player_type *player_ptr, HIT_POINT dam) */ bool dispel_demons(player_type *player_ptr, HIT_POINT dam) { - return (project_all_los(player_ptr, GF_DISP_DEMON, dam)); + return (project_all_los(player_ptr, AttributeType::DISP_DEMON, dam)); } /*! @@ -199,7 +199,7 @@ bool dispel_demons(player_type *player_ptr, HIT_POINT dam) */ bool crusade(player_type *player_ptr) { - return (project_all_los(player_ptr, GF_CRUSADE, player_ptr->lev * 4)); + return (project_all_los(player_ptr, AttributeType::CRUSADE, player_ptr->lev * 4)); } /*! @@ -252,7 +252,7 @@ void aggravate_monsters(player_type *player_ptr, MONSTER_IDX who) */ bool confuse_monsters(player_type *player_ptr, HIT_POINT dam) { - return (project_all_los(player_ptr, GF_OLD_CONF, dam)); + return (project_all_los(player_ptr, AttributeType::OLD_CONF, dam)); } /*! @@ -263,7 +263,7 @@ bool confuse_monsters(player_type *player_ptr, HIT_POINT dam) */ bool charm_monsters(player_type *player_ptr, HIT_POINT dam) { - return (project_all_los(player_ptr, GF_CHARM, dam)); + return (project_all_los(player_ptr, AttributeType::CHARM, dam)); } /*! @@ -274,7 +274,7 @@ bool charm_monsters(player_type *player_ptr, HIT_POINT dam) */ bool charm_animals(player_type *player_ptr, HIT_POINT dam) { - return (project_all_los(player_ptr, GF_CONTROL_ANIMAL, dam)); + return (project_all_los(player_ptr, AttributeType::CONTROL_ANIMAL, dam)); } /*! @@ -285,7 +285,7 @@ bool charm_animals(player_type *player_ptr, HIT_POINT dam) */ bool stun_monsters(player_type *player_ptr, HIT_POINT dam) { - return (project_all_los(player_ptr, GF_STUN, dam)); + return (project_all_los(player_ptr, AttributeType::STUN, dam)); } /*! @@ -296,7 +296,7 @@ bool stun_monsters(player_type *player_ptr, HIT_POINT dam) */ bool stasis_monsters(player_type *player_ptr, HIT_POINT dam) { - return (project_all_los(player_ptr, GF_STASIS, dam)); + return (project_all_los(player_ptr, AttributeType::STASIS, dam)); } /*! @@ -307,7 +307,7 @@ bool stasis_monsters(player_type *player_ptr, HIT_POINT dam) */ bool mindblast_monsters(player_type *player_ptr, HIT_POINT dam) { - return (project_all_los(player_ptr, GF_PSI, dam)); + return (project_all_los(player_ptr, AttributeType::PSI, dam)); } /*! @@ -318,7 +318,7 @@ bool mindblast_monsters(player_type *player_ptr, HIT_POINT dam) */ bool banish_monsters(player_type *player_ptr, int dist) { - return (project_all_los(player_ptr, GF_AWAY_ALL, dist)); + return (project_all_los(player_ptr, AttributeType::AWAY_ALL, dist)); } /*! @@ -329,7 +329,7 @@ bool banish_monsters(player_type *player_ptr, int dist) */ bool turn_evil(player_type *player_ptr, HIT_POINT dam) { - return (project_all_los(player_ptr, GF_TURN_EVIL, dam)); + return (project_all_los(player_ptr, AttributeType::TURN_EVIL, dam)); } /*! @@ -340,7 +340,7 @@ bool turn_evil(player_type *player_ptr, HIT_POINT dam) */ bool turn_monsters(player_type *player_ptr, HIT_POINT dam) { - return (project_all_los(player_ptr, GF_TURN_ALL, dam)); + return (project_all_los(player_ptr, AttributeType::TURN_ALL, dam)); } /*! @@ -350,7 +350,7 @@ bool turn_monsters(player_type *player_ptr, HIT_POINT dam) */ bool deathray_monsters(player_type *player_ptr) { - return (project_all_los(player_ptr, GF_DEATH_RAY, player_ptr->lev * 200)); + return (project_all_los(player_ptr, AttributeType::DEATH_RAY, player_ptr->lev * 200)); } /*! diff --git a/src/spell-kind/spells-sight.h b/src/spell-kind/spells-sight.h index 4482eb1a6..5f55e0576 100644 --- a/src/spell-kind/spells-sight.h +++ b/src/spell-kind/spells-sight.h @@ -1,11 +1,12 @@ #pragma once #include "system/angband.h" +#include "effect/attribute-types.h" struct monster_race; struct monster_type; struct player_type; -bool project_all_los(player_type *player_ptr, EFFECT_ID typ, HIT_POINT dam); +bool project_all_los(player_type *player_ptr, AttributeType typ, HIT_POINT dam); bool speed_monsters(player_type *player_ptr); bool slow_monsters(player_type *player_ptr, int power); bool sleep_monsters(player_type *player_ptr, int power); diff --git a/src/spell-kind/spells-specific-bolt.cpp b/src/spell-kind/spells-specific-bolt.cpp index 92ae7980a..8bcc89b57 100644 --- a/src/spell-kind/spells-specific-bolt.cpp +++ b/src/spell-kind/spells-specific-bolt.cpp @@ -1,7 +1,7 @@ #include "spell-kind/spells-specific-bolt.h" #include "effect/effect-characteristics.h" #include "spell-kind/spells-launcher.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/player-type-definition.h" /*! @@ -14,7 +14,7 @@ bool hypodynamic_bolt(player_type *player_ptr, DIRECTION dir, HIT_POINT dam) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; - return (project_hook(player_ptr, GF_HYPODYNAMIA, dir, dam, flg)); + return (project_hook(player_ptr, AttributeType::HYPODYNAMIA, dir, dam, flg)); } /*! @@ -27,5 +27,5 @@ bool hypodynamic_bolt(player_type *player_ptr, DIRECTION dir, HIT_POINT dam) bool death_ray(player_type *player_ptr, DIRECTION dir, PLAYER_LEVEL plev) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; - return (project_hook(player_ptr, GF_DEATH_RAY, dir, plev * 200, flg)); + return (project_hook(player_ptr, AttributeType::DEATH_RAY, dir, plev * 200, flg)); } diff --git a/src/spell-kind/spells-teleport.cpp b/src/spell-kind/spells-teleport.cpp index b533b9cf7..460cba56b 100644 --- a/src/spell-kind/spells-teleport.cpp +++ b/src/spell-kind/spells-teleport.cpp @@ -32,7 +32,7 @@ #include "player/player-move.h" #include "player/player-status.h" #include "spell-kind/spells-launcher.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/floor-type-definition.h" #include "system/grid-type-definition.h" #include "system/monster-race-definition.h" @@ -108,7 +108,7 @@ bool teleport_swap(player_type *player_ptr, DIRECTION dir) bool teleport_monster(player_type *player_ptr, DIRECTION dir, int distance) { BIT_FLAGS flg = PROJECT_BEAM | PROJECT_KILL; - return (project_hook(player_ptr, GF_AWAY_ALL, dir, distance, flg)); + return (project_hook(player_ptr, AttributeType::AWAY_ALL, dir, distance, flg)); } /*! diff --git a/src/spell-realm/spells-chaos.cpp b/src/spell-realm/spells-chaos.cpp index 88f9a5235..f4fbf2bf8 100644 --- a/src/spell-realm/spells-chaos.cpp +++ b/src/spell-realm/spells-chaos.cpp @@ -16,7 +16,7 @@ #include "player/player-damage.h" #include "spell-kind/spells-floor.h" #include "spell-kind/spells-launcher.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/floor-type-definition.h" #include "system/grid-type-definition.h" #include "system/monster-type-definition.h" @@ -49,17 +49,17 @@ void call_the_void(player_type *player_ptr) if (do_call) { for (int i = 1; i < 10; i++) { if (i - 5) - fire_ball(player_ptr, GF_ROCKET, i, 175, 2); + fire_ball(player_ptr, AttributeType::ROCKET, i, 175, 2); } for (int i = 1; i < 10; i++) { if (i - 5) - fire_ball(player_ptr, GF_MANA, i, 175, 3); + fire_ball(player_ptr, AttributeType::MANA, i, 175, 3); } for (int i = 1; i < 10; i++) { if (i - 5) - fire_ball(player_ptr, GF_NUKE, i, 175, 4); + fire_ball(player_ptr, AttributeType::NUKE, i, 175, 4); } return; @@ -219,6 +219,6 @@ void cast_meteor(player_type *player_ptr, HIT_POINT dam, POSITION rad) if (count > 20) continue; - project(player_ptr, 0, rad, y, x, dam, GF_METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM); + project(player_ptr, 0, rad, y, x, dam, AttributeType::METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM); } } diff --git a/src/spell-realm/spells-crusade.cpp b/src/spell-realm/spells-crusade.cpp index cdb286796..553e22aff 100644 --- a/src/spell-realm/spells-crusade.cpp +++ b/src/spell-realm/spells-crusade.cpp @@ -17,7 +17,7 @@ #include "grid/feature-flag-types.h" #include "spell-realm/spells-crusade.h" #include "spell/range-calc.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/floor-type-definition.h" #include "system/grid-type-definition.h" #include "system/player-type-definition.h" @@ -96,7 +96,7 @@ bool cast_wrath_of_the_god(player_type *player_ptr, HIT_POINT dam, POSITION rad) || !in_disintegration_range(player_ptr->current_floor_ptr, ty, tx, y, x)) continue; - project(player_ptr, 0, rad, y, x, dam, GF_DISINTEGRATE, PROJECT_JUMP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL); + project(player_ptr, 0, rad, y, x, dam, AttributeType::DISINTEGRATE, PROJECT_JUMP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL); } return true; diff --git a/src/spell-realm/spells-hex.cpp b/src/spell-realm/spells-hex.cpp index c3425142e..62d9d39c9 100644 --- a/src/spell-realm/spells-hex.cpp +++ b/src/spell-realm/spells-hex.cpp @@ -16,7 +16,7 @@ #include "spell-realm/spells-crusade.h" #include "spell-realm/spells-song.h" #include "spell/spell-info.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell/spells-execution.h" #include "spell/technic-info-table.h" #include "status/action-setter.h" @@ -363,7 +363,7 @@ void SpellHex::eyes_on_eyes() #endif const auto y = this->monap_ptr->m_ptr->fy; const auto x = this->monap_ptr->m_ptr->fx; - project(this->player_ptr, 0, 0, y, x, this->monap_ptr->get_damage, GF_MISSILE, PROJECT_KILL); + project(this->player_ptr, 0, 0, y, x, this->monap_ptr->get_damage, AttributeType::MISSILE, PROJECT_KILL); if (this->player_ptr->tim_eyeeye) { set_tim_eyeeye(this->player_ptr, this->player_ptr->tim_eyeeye - 5, true); } diff --git a/src/spell/range-calc.cpp b/src/spell/range-calc.cpp index 0f2e39071..36ba247bb 100644 --- a/src/spell/range-calc.cpp +++ b/src/spell/range-calc.cpp @@ -10,7 +10,7 @@ #include "floor/line-of-sight.h" #include "grid/feature.h" #include "grid/grid.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "system/floor-type-definition.h" #include "system/player-type-definition.h" #include "target/projection-path-calculator.h" @@ -21,20 +21,20 @@ */ POSITION dist_to_line(POSITION y, POSITION x, POSITION y1, POSITION x1, POSITION y2, POSITION x2) { - POSITION py = y1 - y; - POSITION px = x1 - x; - POSITION ny = x2 - x1; - POSITION nx = y1 - y2; - POSITION pd = distance(y1, x1, y, x); - POSITION nd = distance(y1, x1, y2, x2); - - if (pd > nd) return distance(y, x, y2, x2); - - nd = ((nd) ? ((py * ny + px * nx) / nd) : 0); - return((nd >= 0) ? nd : 0 - nd); + POSITION py = y1 - y; + POSITION px = x1 - x; + POSITION ny = x2 - x1; + POSITION nx = y1 - y2; + POSITION pd = distance(y1, x1, y, x); + POSITION nd = distance(y1, x1, y2, x2); + + if (pd > nd) + return distance(y, x, y2, x2); + + nd = ((nd) ? ((py * ny + px * nx) / nd) : 0); + return ((nd >= 0) ? nd : 0 - nd); } - /* * * Modified version of los() for calculation of disintegration balls. @@ -42,241 +42,216 @@ POSITION dist_to_line(POSITION y, POSITION x, POSITION y1, POSITION x1, POSITION */ bool in_disintegration_range(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2) { - POSITION delta_y = y2 - y1; - POSITION delta_x = x2 - x1; - POSITION absolute_y = std::abs(delta_y); - POSITION absolute_x = std::abs(delta_x); - if ((absolute_x < 2) && (absolute_y < 2)) return true; - - POSITION scanner_y; - if (!delta_x) - { - /* South -- check for walls */ - if (delta_y > 0) - { - for (scanner_y = y1 + 1; scanner_y < y2; scanner_y++) - { - if (cave_stop_disintegration(floor_ptr, scanner_y, x1)) return false; - } - } - - /* North -- check for walls */ - else - { - for (scanner_y = y1 - 1; scanner_y > y2; scanner_y--) - { - if (cave_stop_disintegration(floor_ptr, scanner_y, x1)) return false; - } - } - - return true; - } - - /* Directly East/West */ - POSITION scanner_x; - if (!delta_y) - { - /* East -- check for walls */ - if (delta_x > 0) - { - for (scanner_x = x1 + 1; scanner_x < x2; scanner_x++) - { - if (cave_stop_disintegration(floor_ptr, y1, scanner_x)) return false; - } - } - - /* West -- check for walls */ - else - { - for (scanner_x = x1 - 1; scanner_x > x2; scanner_x--) - { - if (cave_stop_disintegration(floor_ptr, y1, scanner_x)) return false; - } - } - - return true; - } - - POSITION sign_x = (delta_x < 0) ? -1 : 1; - POSITION sign_y = (delta_y < 0) ? -1 : 1; - if (absolute_x == 1) - { - if (absolute_y == 2) - { - if (!cave_stop_disintegration(floor_ptr, y1 + sign_y, x1)) return true; - } - } - else if (absolute_y == 1) - { - if (absolute_x == 2) - { - if (!cave_stop_disintegration(floor_ptr, y1, x1 + sign_x)) return true; - } - } - - POSITION scale_factor_2 = (absolute_x * absolute_y); - POSITION scale_factor_1 = scale_factor_2 << 1; - POSITION fraction_y; - POSITION m; /* Slope, or 1/Slope, of LOS */ - if (absolute_x >= absolute_y) - { - fraction_y = absolute_y * absolute_y; - m = fraction_y << 1; - scanner_x = x1 + sign_x; - if (fraction_y == scale_factor_2) - { - scanner_y = y1 + sign_y; - fraction_y -= scale_factor_1; - } - else - { - scanner_y = y1; - } - - /* Note (below) the case (qy == f2), where */ - /* the LOS exactly meets the corner of a tile. */ - while (x2 - scanner_x) - { - if (cave_stop_disintegration(floor_ptr, scanner_y, scanner_x)) return false; - - fraction_y += m; - - if (fraction_y < scale_factor_2) - { - scanner_x += sign_x; - } - else if (fraction_y > scale_factor_2) - { - scanner_y += sign_y; - if (cave_stop_disintegration(floor_ptr, scanner_y, scanner_x)) return false; - fraction_y -= scale_factor_1; - scanner_x += sign_x; - } - else - { - scanner_y += sign_y; - fraction_y -= scale_factor_1; - scanner_x += sign_x; - } - } - - return true; - } - - POSITION fraction_x = absolute_x * absolute_x; - m = fraction_x << 1; - scanner_y = y1 + sign_y; - if (fraction_x == scale_factor_2) - { - scanner_x = x1 + sign_x; - fraction_x -= scale_factor_1; - } - else - { - scanner_x = x1; - } - - /* Note (below) the case (qx == f2), where */ - /* the LOS exactly meets the corner of a tile. */ - while (y2 - scanner_y) - { - if (cave_stop_disintegration(floor_ptr, scanner_y, scanner_x)) return false; - - fraction_x += m; - - if (fraction_x < scale_factor_2) - { - scanner_y += sign_y; - } - else if (fraction_x > scale_factor_2) - { - scanner_x += sign_x; - if (cave_stop_disintegration(floor_ptr, scanner_y, scanner_x)) return false; - fraction_x -= scale_factor_1; - scanner_y += sign_y; - } - else - { - scanner_x += sign_x; - fraction_x -= scale_factor_1; - scanner_y += sign_y; - } - } - - return true; + POSITION delta_y = y2 - y1; + POSITION delta_x = x2 - x1; + POSITION absolute_y = std::abs(delta_y); + POSITION absolute_x = std::abs(delta_x); + if ((absolute_x < 2) && (absolute_y < 2)) + return true; + + POSITION scanner_y; + if (!delta_x) { + /* South -- check for walls */ + if (delta_y > 0) { + for (scanner_y = y1 + 1; scanner_y < y2; scanner_y++) { + if (cave_stop_disintegration(floor_ptr, scanner_y, x1)) + return false; + } + } + + /* North -- check for walls */ + else { + for (scanner_y = y1 - 1; scanner_y > y2; scanner_y--) { + if (cave_stop_disintegration(floor_ptr, scanner_y, x1)) + return false; + } + } + + return true; + } + + /* Directly East/West */ + POSITION scanner_x; + if (!delta_y) { + /* East -- check for walls */ + if (delta_x > 0) { + for (scanner_x = x1 + 1; scanner_x < x2; scanner_x++) { + if (cave_stop_disintegration(floor_ptr, y1, scanner_x)) + return false; + } + } + + /* West -- check for walls */ + else { + for (scanner_x = x1 - 1; scanner_x > x2; scanner_x--) { + if (cave_stop_disintegration(floor_ptr, y1, scanner_x)) + return false; + } + } + + return true; + } + + POSITION sign_x = (delta_x < 0) ? -1 : 1; + POSITION sign_y = (delta_y < 0) ? -1 : 1; + if (absolute_x == 1) { + if (absolute_y == 2) { + if (!cave_stop_disintegration(floor_ptr, y1 + sign_y, x1)) + return true; + } + } else if (absolute_y == 1) { + if (absolute_x == 2) { + if (!cave_stop_disintegration(floor_ptr, y1, x1 + sign_x)) + return true; + } + } + + POSITION scale_factor_2 = (absolute_x * absolute_y); + POSITION scale_factor_1 = scale_factor_2 << 1; + POSITION fraction_y; + POSITION m; /* Slope, or 1/Slope, of LOS */ + if (absolute_x >= absolute_y) { + fraction_y = absolute_y * absolute_y; + m = fraction_y << 1; + scanner_x = x1 + sign_x; + if (fraction_y == scale_factor_2) { + scanner_y = y1 + sign_y; + fraction_y -= scale_factor_1; + } else { + scanner_y = y1; + } + + /* Note (below) the case (qy == f2), where */ + /* the LOS exactly meets the corner of a tile. */ + while (x2 - scanner_x) { + if (cave_stop_disintegration(floor_ptr, scanner_y, scanner_x)) + return false; + + fraction_y += m; + + if (fraction_y < scale_factor_2) { + scanner_x += sign_x; + } else if (fraction_y > scale_factor_2) { + scanner_y += sign_y; + if (cave_stop_disintegration(floor_ptr, scanner_y, scanner_x)) + return false; + fraction_y -= scale_factor_1; + scanner_x += sign_x; + } else { + scanner_y += sign_y; + fraction_y -= scale_factor_1; + scanner_x += sign_x; + } + } + + return true; + } + + POSITION fraction_x = absolute_x * absolute_x; + m = fraction_x << 1; + scanner_y = y1 + sign_y; + if (fraction_x == scale_factor_2) { + scanner_x = x1 + sign_x; + fraction_x -= scale_factor_1; + } else { + scanner_x = x1; + } + + /* Note (below) the case (qx == f2), where */ + /* the LOS exactly meets the corner of a tile. */ + while (y2 - scanner_y) { + if (cave_stop_disintegration(floor_ptr, scanner_y, scanner_x)) + return false; + + fraction_x += m; + + if (fraction_x < scale_factor_2) { + scanner_y += sign_y; + } else if (fraction_x > scale_factor_2) { + scanner_x += sign_x; + if (cave_stop_disintegration(floor_ptr, scanner_y, scanner_x)) + return false; + fraction_x -= scale_factor_1; + scanner_y += sign_y; + } else { + scanner_x += sign_x; + fraction_x -= scale_factor_1; + scanner_y += sign_y; + } + } + + return true; } - /* * breath shape */ -void breath_shape(player_type *player_ptr, uint16_t *path_g, int dist, int *pgrids, POSITION *gx, POSITION *gy, POSITION *gm, POSITION *pgm_rad, POSITION rad, POSITION y1, POSITION x1, POSITION y2, POSITION x2, EFFECT_ID typ) +void breath_shape(player_type *player_ptr, uint16_t *path_g, int dist, int *pgrids, POSITION *gx, POSITION *gy, POSITION *gm, POSITION *pgm_rad, POSITION rad, POSITION y1, POSITION x1, POSITION y2, POSITION x2, AttributeType typ) { - POSITION by = y1; - POSITION bx = x1; - int brad = 0; - int brev = rad * rad / dist; - int bdis = 0; - int cdis; - int path_n = 0; - int mdis = distance(y1, x1, y2, x2) + rad; - - floor_type *floor_ptr = player_ptr->current_floor_ptr; - while (bdis <= mdis) - { - if ((0 < dist) && (path_n < dist)) - { - POSITION ny = get_grid_y(path_g[path_n]); - POSITION nx = get_grid_x(path_g[path_n]); - POSITION nd = distance(ny, nx, y1, x1); - - if (bdis >= nd) - { - by = ny; - bx = nx; - path_n++; - } - } - - /* Travel from center outward */ - for (cdis = 0; cdis <= brad; cdis++) - { - for (POSITION y = by - cdis; y <= by + cdis; y++) - { - for (POSITION x = bx - cdis; x <= bx + cdis; x++) - { - if (!in_bounds(floor_ptr, y, x)) continue; - if (distance(y1, x1, y, x) != bdis) continue; - if (distance(by, bx, y, x) != cdis) continue; - - switch (typ) - { - case GF_LITE: - case GF_LITE_WEAK: - /* Lights are stopped by opaque terrains */ - if (!los(player_ptr, by, bx, y, x)) continue; - break; - case GF_DISINTEGRATE: - /* Disintegration are stopped only by perma-walls */ - if (!in_disintegration_range(floor_ptr, by, bx, y, x)) continue; - break; - default: - /* Ball explosions are stopped by walls */ - if (!projectable(player_ptr, by, bx, y, x)) continue; - break; - } - - gy[*pgrids] = y; - gx[*pgrids] = x; - (*pgrids)++; - } - } - } - - gm[bdis + 1] = *pgrids; - brad = rad * (path_n + brev) / (dist + brev); - bdis++; - } - - *pgm_rad = bdis; + POSITION by = y1; + POSITION bx = x1; + int brad = 0; + int brev = rad * rad / dist; + int bdis = 0; + int cdis; + int path_n = 0; + int mdis = distance(y1, x1, y2, x2) + rad; + + floor_type *floor_ptr = player_ptr->current_floor_ptr; + while (bdis <= mdis) { + if ((0 < dist) && (path_n < dist)) { + POSITION ny = get_grid_y(path_g[path_n]); + POSITION nx = get_grid_x(path_g[path_n]); + POSITION nd = distance(ny, nx, y1, x1); + + if (bdis >= nd) { + by = ny; + bx = nx; + path_n++; + } + } + + /* Travel from center outward */ + for (cdis = 0; cdis <= brad; cdis++) { + for (POSITION y = by - cdis; y <= by + cdis; y++) { + for (POSITION x = bx - cdis; x <= bx + cdis; x++) { + if (!in_bounds(floor_ptr, y, x)) + continue; + if (distance(y1, x1, y, x) != bdis) + continue; + if (distance(by, bx, y, x) != cdis) + continue; + + switch (typ) { + case AttributeType::LITE: + case AttributeType::LITE_WEAK: + /* Lights are stopped by opaque terrains */ + if (!los(player_ptr, by, bx, y, x)) + continue; + break; + case AttributeType::DISINTEGRATE: + /* Disintegration are stopped only by perma-walls */ + if (!in_disintegration_range(floor_ptr, by, bx, y, x)) + continue; + break; + default: + /* Ball explosions are stopped by walls */ + if (!projectable(player_ptr, by, bx, y, x)) + continue; + break; + } + + gy[*pgrids] = y; + gx[*pgrids] = x; + (*pgrids)++; + } + } + } + + gm[bdis + 1] = *pgrids; + brad = rad * (path_n + brev) / (dist + brev); + bdis++; + } + + *pgm_rad = bdis; } diff --git a/src/spell/range-calc.h b/src/spell/range-calc.h index ace0ed18b..77b539400 100644 --- a/src/spell/range-calc.h +++ b/src/spell/range-calc.h @@ -1,9 +1,10 @@ #pragma once #include "system/angband.h" +#include "effect/attribute-types.h" struct floor_type; struct player_type; bool in_disintegration_range(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2); -void breath_shape(player_type *player_ptr, uint16_t *path_g, int dist, int *pgrids, POSITION *gx, POSITION *gy, POSITION *gm, POSITION *pgm_rad, POSITION rad, POSITION y1, POSITION x1, POSITION y2, POSITION x2, EFFECT_ID typ); +void breath_shape(player_type *player_ptr, uint16_t *path_g, int dist, int *pgrids, POSITION *gx, POSITION *gy, POSITION *gm, POSITION *pgm_rad, POSITION rad, POSITION y1, POSITION x1, POSITION y2, POSITION x2, AttributeType typ); POSITION dist_to_line(POSITION y, POSITION x, POSITION y1, POSITION x1, POSITION y2, POSITION x2); diff --git a/src/spell/spell-types.h b/src/spell/spell-types.h deleted file mode 100644 index d2fc57db9..000000000 --- a/src/spell/spell-types.h +++ /dev/null @@ -1,117 +0,0 @@ -#pragma once -#include "util/flag-group.h" - -enum spells_type -{ - GF_NONE = 0, - GF_ELEC = 1, /*!< 魔法効果: 電撃*/ - GF_POIS = 2, /*!< 魔法効果: 毒*/ - GF_ACID = 3, /*!< 魔法効果: 酸*/ - GF_COLD = 4, /*!< 魔法効果: 冷気*/ - GF_FIRE = 5, /*!< 魔法効果: 火炎*/ - GF_PSY_SPEAR = 9, /*!< 魔法効果: 光の剣*/ - GF_MISSILE = 10, /*!< 魔法効果: 弱魔力*/ - GF_ARROW = 11, /*!< 魔法効果: 射撃*/ - GF_PLASMA = 12, /*!< 魔法効果: プラズマ*/ - GF_WATER = 14, /*!< 魔法効果: 水流*/ - GF_LITE = 15, /*!< 魔法効果: 閃光*/ - GF_DARK = 16, /*!< 魔法効果: 暗黒*/ - GF_LITE_WEAK = 17, /*!< 魔法効果: 弱光*/ - GF_DARK_WEAK = 18, /*!< 魔法効果: 弱暗*/ - GF_SHARDS = 20, /*!< 魔法効果: 破片*/ - GF_SOUND = 21, /*!< 魔法効果: 轟音*/ - GF_CONFUSION = 22, /*!< 魔法効果: 混乱*/ - GF_FORCE = 23, /*!< 魔法効果: フォース*/ - GF_INERTIAL = 24, /*!< 魔法効果: 遅鈍*/ - GF_MANA = 26, /*!< 魔法効果: 純粋魔力*/ - GF_METEOR = 27, /*!< 魔法効果: 隕石*/ - GF_ICE = 28, /*!< 魔法効果: 極寒*/ - GF_CHAOS = 30, /*!< 魔法効果: カオス*/ - GF_NETHER = 31, /*!< 魔法効果: 地獄*/ - GF_DISENCHANT = 32, /*!< 魔法効果: 劣化*/ - GF_NEXUS = 33, /*!< 魔法効果: 因果混乱*/ - GF_TIME = 34, /*!< 魔法効果: 時間逆転*/ - GF_GRAVITY = 35, /*!< 魔法効果: 重力*/ - GF_KILL_WALL = 40, /*!< 魔法効果: 岩石溶解*/ - GF_KILL_DOOR = 41, /*!< 魔法効果: ドア破壊*/ - GF_KILL_TRAP = 42, /*!< 魔法効果: トラップ破壊*/ - GF_MAKE_WALL = 45, /*!< 魔法効果: 壁生成*/ - GF_MAKE_DOOR = 46, /*!< 魔法効果: ドア生成*/ - GF_MAKE_TRAP = 47, /*!< 魔法効果: トラップ生成*/ - GF_MAKE_TREE = 48, /*!< 魔法効果: 森林生成*/ - GF_OLD_CLONE = 51, /*!< 魔法効果: クローン・モンスター*/ - GF_OLD_POLY = 52, /*!< 魔法効果: チェンジ・モンスター*/ - GF_OLD_HEAL = 53, /*!< 魔法効果: 回復モンスター*/ - GF_OLD_SPEED = 54, /*!< 魔法効果: スピード・モンスター*/ - GF_OLD_SLOW = 55, /*!< 魔法効果: スロウ・モンスター*/ - GF_OLD_CONF = 56, /*!< 魔法効果: パニック・モンスター*/ - GF_OLD_SLEEP = 57, /*!< 魔法効果: スリープ・モンスター*/ - GF_HYPODYNAMIA = 58, /*!< 魔法効果: 衰弱*/ - GF_AWAY_UNDEAD = 61, /*!< 魔法効果: アンデッド・アウェイ*/ - GF_AWAY_EVIL = 62, /*!< 魔法効果: 邪悪飛ばし*/ - GF_AWAY_ALL = 63, /*!< 魔法効果: テレポート・アウェイ*/ - GF_TURN_UNDEAD = 64, /*!< 魔法効果: アンデッド恐慌*/ - GF_TURN_EVIL = 65, /*!< 魔法効果: 邪悪恐慌*/ - GF_TURN_ALL = 66, /*!< 魔法効果: モンスター恐慌*/ - GF_DISP_UNDEAD = 67, /*!< 魔法効果: アンデッド退散*/ - GF_DISP_EVIL = 68, /*!< 魔法効果: 邪悪退散*/ - GF_DISP_ALL = 69, /*!< 魔法効果: モンスター退散*/ - GF_DISP_DEMON = 70, /*!< 魔法効果: 悪魔退散*/ - GF_DISP_LIVING = 71, /*!< 魔法効果: 生命退散*/ - GF_ROCKET = 72, /*!< 魔法効果: ロケット*/ - GF_NUKE = 73, /*!< 魔法効果: 放射性廃棄物*/ - GF_MAKE_RUNE_PROTECTION = 74, /*!< 魔法効果: 守りのルーン生成*/ - GF_STASIS = 75, /*!< 魔法効果: モンスター拘束*/ - GF_STONE_WALL = 76, /*!< 魔法効果: 壁生成*/ - GF_DEATH_RAY = 77, /*!< 魔法効果: 死の光線*/ - GF_STUN = 78, /*!< 魔法効果: 朦朧*/ - GF_HOLY_FIRE = 79, /*!< 魔法効果: 聖光*/ - GF_HELL_FIRE = 80, /*!< 魔法効果: 地獄の劫火*/ - GF_DISINTEGRATE = 81, /*!< 魔法効果: 分解*/ - GF_CHARM = 82, /*!< 魔法効果: モンスター魅了*/ - GF_CONTROL_UNDEAD = 83, /*!< 魔法効果: アンデッド支配*/ - GF_CONTROL_ANIMAL = 84, /*!< 魔法効果: 動物支配*/ - GF_PSI = 85, /*!< 魔法効果: サイキック攻撃*/ - GF_PSI_DRAIN = 86, /*!< 魔法効果: 精神吸収*/ - GF_TELEKINESIS = 87, /*!< 魔法効果: テレキシネス*/ - GF_JAM_DOOR = 88, /*!< 魔法効果: 施錠*/ - GF_DOMINATION = 89, /*!< 魔法効果: 精神支配*/ - GF_DISP_GOOD = 90, /*!< 魔法効果: 善良退散*/ - GF_DRAIN_MANA = 91, /*!< 魔法効果: 魔力吸収*/ - GF_MIND_BLAST = 92, /*!< 魔法効果: 精神攻撃*/ - GF_BRAIN_SMASH = 93, /*!< 魔法効果: 脳攻撃*/ - GF_CAUSE_1 = 94, /*!< 魔法効果: 軽傷の呪い*/ - GF_CAUSE_2 = 95, /*!< 魔法効果: 重傷の呪い*/ - GF_CAUSE_3 = 96, /*!< 魔法効果: 致命傷の呪い*/ - GF_CAUSE_4 = 97, /*!< 魔法効果: 秘孔を突く*/ - GF_HAND_DOOM = 98, /*!< 魔法効果: 破滅の手*/ - GF_CAPTURE = 99, /*!< 魔法効果: 捕縛*/ - GF_ANIM_DEAD = 100, /*!< 魔法効果: 死者復活*/ - GF_CHARM_LIVING = 101, /*!< 魔法効果: 生命魅了*/ - GF_IDENTIFY = 102, /*!< 魔法効果: 鑑定*/ - GF_ATTACK = 103, /*!< 魔法効果: 白兵*/ - GF_ENGETSU = 104, /*!< 魔法効果: 円月*/ - GF_GENOCIDE = 105, /*!< 魔法効果: 抹殺*/ - GF_PHOTO = 106, /*!< 魔法効果: 撮影*/ - GF_CONTROL_DEMON = 107, /*!< 魔法効果: 悪魔支配*/ - GF_LAVA_FLOW = 108, /*!< 魔法効果: 溶岩噴出*/ - GF_BLOOD_CURSE = 109, /*!< 魔法効果: 血の呪い*/ - GF_SEEKER = 110, /*!< 魔法効果: シーカーレイ*/ - GF_SUPER_RAY = 111, /*!< 魔法効果: スーパーレイ*/ - GF_STAR_HEAL = 112, /*!< 魔法効果: 星の癒し*/ - GF_WATER_FLOW = 113, /*!< 魔法効果: 流水*/ - GF_CRUSADE = 114, /*!< 魔法効果: 聖戦*/ - GF_STASIS_EVIL = 115, /*!< 魔法効果: 邪悪拘束*/ - GF_WOUNDS = 116, /*!< 魔法効果: 創傷*/ - GF_E_GENOCIDE = 117, /*!< 魔法効果: 元素抹殺 */ - GF_VOID = 118, /*!< 魔法効果: 虚無 */ - GF_ABYSS = 119, /*!< 魔法効果: 深淵 */ - GF_HUNGRY = 120, /*!< 魔法効果: 空腹>*/ - GF_PLAYER_SHOOT = 121, /*!< 属性取得用: プレイヤーの射撃/投擲>*/ - GF_PLAYER_MELEE = 122, /*!< 属性取得用: プレイヤーの近接攻撃>*/ - MAX_GF = 123, /*!< 欠番を無視した最大サイズ (直上の値+1) */ -}; - - -/*! 属性フラグspell_typesの集合を表すクラス */ -using EffectFlags = FlagGroup; diff --git a/src/spell/spells-staff-only.cpp b/src/spell/spells-staff-only.cpp index 81e0ea8c4..68b7e31fb 100644 --- a/src/spell/spells-staff-only.cpp +++ b/src/spell/spells-staff-only.cpp @@ -4,7 +4,7 @@ #include "hpmp/hp-mp-processor.h" #include "player/player-damage.h" #include "spell-kind/spells-sight.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "status/bad-status-setter.h" #include "status/body-improvement.h" #include "system/player-type-definition.h" @@ -60,7 +60,7 @@ bool cleansing_nova(player_type *player_ptr, bool magic, bool powerful) bool unleash_mana_storm(player_type *player_ptr, bool powerful) { msg_print(_("強力な魔力が敵を引き裂いた!", "Mighty magics rend your enemies!")); - project(player_ptr, 0, (powerful ? 7 : 5), player_ptr->y, player_ptr->x, (randint1(200) + (powerful ? 500 : 300)) * 2, GF_MANA, + project(player_ptr, 0, (powerful ? 7 : 5), player_ptr->y, player_ptr->x, (randint1(200) + (powerful ? 500 : 300)) * 2, AttributeType::MANA, PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID); bool is_special_class = player_ptr->pclass != PlayerClassType::MAGE; diff --git a/src/spell/spells-status.cpp b/src/spell/spells-status.cpp index f63503e89..bbdacf6a1 100644 --- a/src/spell/spells-status.cpp +++ b/src/spell/spells-status.cpp @@ -36,7 +36,7 @@ #include "spell-kind/spells-launcher.h" #include "spell-kind/spells-teleport.h" #include "spell-kind/spells-world.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "status/action-setter.h" #include "status/bad-status-setter.h" #include "status/base-status.h" @@ -66,7 +66,7 @@ bool heal_monster(player_type *player_ptr, DIRECTION dir, HIT_POINT dam) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; - return (project_hook(player_ptr, GF_OLD_HEAL, dir, dam, flg)); + return (project_hook(player_ptr, AttributeType::OLD_HEAL, dir, dam, flg)); } /*! @@ -79,7 +79,7 @@ bool heal_monster(player_type *player_ptr, DIRECTION dir, HIT_POINT dam) bool speed_monster(player_type *player_ptr, DIRECTION dir, int power) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; - return (project_hook(player_ptr, GF_OLD_SPEED, dir, power, flg)); + return (project_hook(player_ptr, AttributeType::OLD_SPEED, dir, power, flg)); } /*! @@ -92,7 +92,7 @@ bool speed_monster(player_type *player_ptr, DIRECTION dir, int power) bool slow_monster(player_type *player_ptr, DIRECTION dir, int power) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; - return (project_hook(player_ptr, GF_OLD_SLOW, dir, power, flg)); + return (project_hook(player_ptr, AttributeType::OLD_SLOW, dir, power, flg)); } /*! @@ -105,7 +105,7 @@ bool slow_monster(player_type *player_ptr, DIRECTION dir, int power) bool sleep_monster(player_type *player_ptr, DIRECTION dir, int power) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; - return (project_hook(player_ptr, GF_OLD_SLEEP, dir, power, flg)); + return (project_hook(player_ptr, AttributeType::OLD_SLEEP, dir, power, flg)); } /*! @@ -117,7 +117,7 @@ bool sleep_monster(player_type *player_ptr, DIRECTION dir, int power) */ bool stasis_monster(player_type *player_ptr, DIRECTION dir) { - return (fire_ball_hide(player_ptr, GF_STASIS, dir, player_ptr->lev * 2, 0)); + return (fire_ball_hide(player_ptr, AttributeType::STASIS, dir, player_ptr->lev * 2, 0)); } /*! @@ -129,7 +129,7 @@ bool stasis_monster(player_type *player_ptr, DIRECTION dir) */ bool stasis_evil(player_type *player_ptr, DIRECTION dir) { - return (fire_ball_hide(player_ptr, GF_STASIS_EVIL, dir, player_ptr->lev * 2, 0)); + return (fire_ball_hide(player_ptr, AttributeType::STASIS_EVIL, dir, player_ptr->lev * 2, 0)); } /*! @@ -142,7 +142,7 @@ bool stasis_evil(player_type *player_ptr, DIRECTION dir) bool confuse_monster(player_type *player_ptr, DIRECTION dir, PLAYER_LEVEL plev) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; - return (project_hook(player_ptr, GF_OLD_CONF, dir, plev, flg)); + return (project_hook(player_ptr, AttributeType::OLD_CONF, dir, plev, flg)); } /*! @@ -155,7 +155,7 @@ bool confuse_monster(player_type *player_ptr, DIRECTION dir, PLAYER_LEVEL plev) bool stun_monster(player_type *player_ptr, DIRECTION dir, PLAYER_LEVEL plev) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; - return (project_hook(player_ptr, GF_STUN, dir, plev, flg)); + return (project_hook(player_ptr, AttributeType::STUN, dir, plev, flg)); } /*! @@ -168,7 +168,7 @@ bool stun_monster(player_type *player_ptr, DIRECTION dir, PLAYER_LEVEL plev) bool poly_monster(player_type *player_ptr, DIRECTION dir, int power) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; - bool tester = (project_hook(player_ptr, GF_OLD_POLY, dir, power, flg)); + bool tester = (project_hook(player_ptr, AttributeType::OLD_POLY, dir, power, flg)); if (tester) chg_virtue(player_ptr, V_CHANCE, 1); return (tester); @@ -183,7 +183,7 @@ bool poly_monster(player_type *player_ptr, DIRECTION dir, int power) bool clone_monster(player_type *player_ptr, DIRECTION dir) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; - return (project_hook(player_ptr, GF_OLD_CLONE, dir, 0, flg)); + return (project_hook(player_ptr, AttributeType::OLD_CLONE, dir, 0, flg)); } /*! @@ -196,7 +196,7 @@ bool clone_monster(player_type *player_ptr, DIRECTION dir) bool fear_monster(player_type *player_ptr, DIRECTION dir, PLAYER_LEVEL plev) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE; - return (project_hook(player_ptr, GF_TURN_ALL, dir, plev, flg)); + return (project_hook(player_ptr, AttributeType::TURN_ALL, dir, plev, flg)); } bool time_walk(player_type *player_ptr) diff --git a/src/spell/spells-summon.cpp b/src/spell/spells-summon.cpp index 9a00a9400..dd264209b 100644 --- a/src/spell/spells-summon.cpp +++ b/src/spell/spells-summon.cpp @@ -22,7 +22,7 @@ #include "spell-kind/spells-lite.h" #include "spell-kind/spells-sight.h" #include "spell-kind/spells-specific-bolt.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #include "spell/spells-diceroll.h" #include "spell/spells-status.h" #include "spell/summon-types.h" @@ -463,31 +463,31 @@ void cast_invoke_spirits(player_type *player_ptr, DIRECTION dir) } else if (die < 31) { poly_monster(player_ptr, dir, plev); } else if (die < 36) { - fire_bolt_or_beam(player_ptr, beam_chance(player_ptr) - 10, GF_MISSILE, dir, damroll(3 + ((plev - 1) / 5), 4)); + fire_bolt_or_beam(player_ptr, beam_chance(player_ptr) - 10, AttributeType::MISSILE, dir, damroll(3 + ((plev - 1) / 5), 4)); } else if (die < 41) { confuse_monster(player_ptr, dir, plev); } else if (die < 46) { - fire_ball(player_ptr, GF_POIS, dir, 20 + (plev / 2), 3); + fire_ball(player_ptr, AttributeType::POIS, dir, 20 + (plev / 2), 3); } else if (die < 51) { (void)lite_line(player_ptr, dir, damroll(6, 8)); } else if (die < 56) { - fire_bolt_or_beam(player_ptr, beam_chance(player_ptr) - 10, GF_ELEC, dir, damroll(3 + ((plev - 5) / 4), 8)); + fire_bolt_or_beam(player_ptr, beam_chance(player_ptr) - 10, AttributeType::ELEC, dir, damroll(3 + ((plev - 5) / 4), 8)); } else if (die < 61) { - fire_bolt_or_beam(player_ptr, beam_chance(player_ptr) - 10, GF_COLD, dir, damroll(5 + ((plev - 5) / 4), 8)); + fire_bolt_or_beam(player_ptr, beam_chance(player_ptr) - 10, AttributeType::COLD, dir, damroll(5 + ((plev - 5) / 4), 8)); } else if (die < 66) { - fire_bolt_or_beam(player_ptr, beam_chance(player_ptr), GF_ACID, dir, damroll(6 + ((plev - 5) / 4), 8)); + fire_bolt_or_beam(player_ptr, beam_chance(player_ptr), AttributeType::ACID, dir, damroll(6 + ((plev - 5) / 4), 8)); } else if (die < 71) { - fire_bolt_or_beam(player_ptr, beam_chance(player_ptr), GF_FIRE, dir, damroll(8 + ((plev - 5) / 4), 8)); + fire_bolt_or_beam(player_ptr, beam_chance(player_ptr), AttributeType::FIRE, dir, damroll(8 + ((plev - 5) / 4), 8)); } else if (die < 76) { hypodynamic_bolt(player_ptr, dir, 75); } else if (die < 81) { - fire_ball(player_ptr, GF_ELEC, dir, 30 + plev / 2, 2); + fire_ball(player_ptr, AttributeType::ELEC, dir, 30 + plev / 2, 2); } else if (die < 86) { - fire_ball(player_ptr, GF_ACID, dir, 40 + plev, 2); + fire_ball(player_ptr, AttributeType::ACID, dir, 40 + plev, 2); } else if (die < 91) { - fire_ball(player_ptr, GF_ICE, dir, 70 + plev, 3); + fire_ball(player_ptr, AttributeType::ICE, dir, 70 + plev, 3); } else if (die < 96) { - fire_ball(player_ptr, GF_FIRE, dir, 80 + plev, 3); + fire_ball(player_ptr, AttributeType::FIRE, dir, 80 + plev, 3); } else if (die < 101) { hypodynamic_bolt(player_ptr, dir, 100 + plev); } else if (die < 104) { diff --git a/src/term/gameterm.cpp b/src/term/gameterm.cpp index 179094b84..18820b4ec 100644 --- a/src/term/gameterm.cpp +++ b/src/term/gameterm.cpp @@ -4,7 +4,7 @@ #include "util/quarks.h" #include "util/string-processor.h" - /* +/* * Convert an "attr"/"char" pair into a "pict" (P) */ #define PICT(A, C) ((((uint16_t)(A)) << 8) | ((byte)(C))) @@ -12,85 +12,80 @@ /* * Standard window names */ -const char angband_term_name[8][16] = -{ - "Hengband", - "Term-1", - "Term-2", - "Term-3", - "Term-4", - "Term-5", - "Term-6", - "Term-7" +const char angband_term_name[8][16] = { + "Hengband", + "Term-1", + "Term-2", + "Term-3", + "Term-4", + "Term-5", + "Term-6", + "Term-7" }; /* * Global table of color definitions */ -byte angband_color_table[256][4] = -{ - {0x00, 0x00, 0x00, 0x00}, /* TERM_DARK */ - {0x00, 0xFF, 0xFF, 0xFF}, /* TERM_WHITE */ - {0x00, 0x80, 0x80, 0x80}, /* TERM_SLATE */ - {0x00, 0xFF, 0x80, 0x00}, /* TERM_ORANGE */ - {0x00, 0xC0, 0x00, 0x00}, /* TERM_RED */ - {0x00, 0x00, 0x80, 0x40}, /* TERM_GREEN */ - {0x00, 0x00, 0x00, 0xFF}, /* TERM_BLUE */ - {0x00, 0x80, 0x40, 0x00}, /* TERM_UMBER */ - {0x00, 0x40, 0x40, 0x40}, /* TERM_L_DARK */ - {0x00, 0xC0, 0xC0, 0xC0}, /* TERM_L_WHITE */ - {0x00, 0xFF, 0x00, 0xFF}, /* TERM_VIOLET */ - {0x00, 0xFF, 0xFF, 0x00}, /* TERM_YELLOW */ - {0x00, 0xFF, 0x00, 0x00}, /* TERM_L_RED */ - {0x00, 0x00, 0xFF, 0x00}, /* TERM_L_GREEN */ - {0x00, 0x00, 0xFF, 0xFF}, /* TERM_L_BLUE */ - {0x00, 0xC0, 0x80, 0x40} /* TERM_L_UMBER */ +byte angband_color_table[256][4] = { + { 0x00, 0x00, 0x00, 0x00 }, /* TERM_DARK */ + { 0x00, 0xFF, 0xFF, 0xFF }, /* TERM_WHITE */ + { 0x00, 0x80, 0x80, 0x80 }, /* TERM_SLATE */ + { 0x00, 0xFF, 0x80, 0x00 }, /* TERM_ORANGE */ + { 0x00, 0xC0, 0x00, 0x00 }, /* TERM_RED */ + { 0x00, 0x00, 0x80, 0x40 }, /* TERM_GREEN */ + { 0x00, 0x00, 0x00, 0xFF }, /* TERM_BLUE */ + { 0x00, 0x80, 0x40, 0x00 }, /* TERM_UMBER */ + { 0x00, 0x40, 0x40, 0x40 }, /* TERM_L_DARK */ + { 0x00, 0xC0, 0xC0, 0xC0 }, /* TERM_L_WHITE */ + { 0x00, 0xFF, 0x00, 0xFF }, /* TERM_VIOLET */ + { 0x00, 0xFF, 0xFF, 0x00 }, /* TERM_YELLOW */ + { 0x00, 0xFF, 0x00, 0x00 }, /* TERM_L_RED */ + { 0x00, 0x00, 0xFF, 0x00 }, /* TERM_L_GREEN */ + { 0x00, 0x00, 0xFF, 0xFF }, /* TERM_L_BLUE */ + { 0x00, 0xC0, 0x80, 0x40 } /* TERM_L_UMBER */ }; /*! * @brief 色名称テーブル / Hack -- the "basic" color names (see "TERM_xxx") */ -const concptr color_names[16] = -{ +const concptr color_names[16] = { #ifdef JP - "黒", - "白", - "青灰色", - "オレンジ", - "赤", - "緑", - "青", - "琥珀色", - "灰色", - "明青灰色", - "紫", - "黄", - "明るい赤", - "明るい緑", - "明るい青", - "明琥珀色", + "黒", + "白", + "青灰色", + "オレンジ", + "赤", + "緑", + "青", + "琥珀色", + "灰色", + "明青灰色", + "紫", + "黄", + "明るい赤", + "明るい緑", + "明るい青", + "明琥珀色", #else - "Dark", - "White", - "Slate", - "Orange", - "Red", - "Green", - "Blue", - "Umber", - "Light Dark", - "Light Slate", - "Violet", - "Yellow", - "Light Red", - "Light Green", - "Light Blue", - "Light Umber", + "Dark", + "White", + "Slate", + "Orange", + "Red", + "Green", + "Blue", + "Umber", + "Light Dark", + "Light Slate", + "Violet", + "Yellow", + "Light Red", + "Light Green", + "Light Blue", + "Light Umber", #endif - }; - /*! * @brief サブウィンドウ名称テーブル * @details @@ -109,244 +104,241 @@ const concptr color_names[16] = * of the main screen into any interested windows. * */ -const concptr window_flag_desc[32] = -{ - _("持ち物/装備一覧", "Display inven/equip"), - _("装備/持ち物一覧", "Display equip/inven"), - _("呪文一覧", "Display spell list"), - _("キャラクタ情報", "Display character"), - _("視界内のモンスター表示", "Display monsters in sight"), - nullptr, - _("メッセージ", "Display messages"), - _("ダンジョン全体図", "Display overhead view"), - _("モンスターの思い出", "Display monster recall"), - _("アイテムの詳細", "Display object recall"), - _("自分の周囲を表示", "Display dungeon view"), - _("記念撮影", "Display snap-shot"), - _("足元/床上のアイテム一覧", "Display items on floor"), - nullptr, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr, - nullptr +const concptr window_flag_desc[32] = { + _("持ち物/装備一覧", "Display inven/equip"), + _("装備/持ち物一覧", "Display equip/inven"), + _("呪文一覧", "Display spell list"), + _("キャラクタ情報", "Display character"), + _("視界内のモンスター表示", "Display monsters in sight"), + nullptr, + _("メッセージ", "Display messages"), + _("ダンジョン全体図", "Display overhead view"), + _("モンスターの思い出", "Display monster recall"), + _("アイテムの詳細", "Display object recall"), + _("自分の周囲を表示", "Display dungeon view"), + _("記念撮影", "Display snap-shot"), + _("足元/床上のアイテム一覧", "Display items on floor"), + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr }; - /*! * @brief シンボル解説テーブル / * The table of "symbol info" -- each entry is a string of the form "X:desc" where "X" is the trigger, and "desc" is the "info". */ -const concptr ident_info[] = -{ +const concptr ident_info[] = { #ifdef JP - " :暗闇", - "!:薬, オイル", - "\":アミュレット, 頸飾り", - "#:壁(隠しドア)/植物/気体", - "$:財宝(金か宝石)", - "%:鉱脈(溶岩か石英)", - "&:箱", - "':開いたドア", - "(:軟らかい防具", - "):盾", - "*:財宝を含んだ鉱脈または球形の怪物", - "+:閉じたドア", - ",:食べ物, おばけキノコ", - "-:魔法棒, ロッド", - ".:床", - "/:竿状武器(アックス/パイク/等)", - "0:博物館の入口", - "1:雑貨屋の入口", - "2:防具屋の入口", - "3:武器専門店の入口", - "4:寺院の入口", - "5:錬金術の店の入口", - "6:魔法の店の入口", - "7:ブラックマーケットの入口", - "8:我が家の入口", - "9:書店の入口", - "::岩石", - ";:守りのルーン/爆発のルーン", - "<:上り階段", - "=:指輪", - ">:下り階段", - "?:巻物", - "@:プレイヤー", - "A:天使", - "B:鳥", - "C:犬", - "D:古代ドラゴン/ワイアーム", - "E:エレメンタル", - "F:トンボ", - "G:ゴースト", - "H:雑種", - "I:昆虫", - "J:ヘビ", - "K:キラー・ビートル", - "L:リッチ", - "M:多首の爬虫類", - "N:謎の生物", - "O:オーガ", - "P:巨大人間型生物", - "Q:クイルスルグ(脈打つ肉塊)", - "R:爬虫類/両生類", - "S:蜘蛛/サソリ/ダニ", - "T:トロル", - "U:上級デーモン", - "V:バンパイア", - "W:ワイト/レイス/等", - "X:ゾーン/ザレン/等", - "Y:イエティ", - "Z:ハウンド", - "[:堅いアーマー", - "\\:鈍器(メイス/ムチ/等)", - "]:種々の防具", - "^:トラップ", - "_:杖", - "`:人形,彫像", - "a:アリ", - "b:コウモリ", - "c:ムカデ", - "d:ドラゴン", - "e:目玉", - "f:ネコ", - "g:ゴーレム", - "h:ホビット/エルフ/ドワーフ", - "i:ベトベト", - "j:ゼリー", - "k:コボルド", - "l:水棲生物", - "m:モルド", - "n:ナーガ", - "o:オーク", - "p:人間", - "q:四足獣", - "r:ネズミ", - "s:スケルトン", - "t:町の人", - "u:下級デーモン", - "v:ボルテックス", - "w:イモムシ/大群", - /* "x:unused", */ - "y:イーク", - "z:ゾンビ/ミイラ", - "{:飛び道具の弾(矢/弾)", - "|:刀剣類(ソード/ダガー/等)", - "}:飛び道具(弓/クロスボウ/スリング)", - "~:水/溶岩流(種々のアイテム)", + " :暗闇", + "!:薬, オイル", + "\":アミュレット, 頸飾り", + "#:壁(隠しドア)/植物/気体", + "$:財宝(金か宝石)", + "%:鉱脈(溶岩か石英)", + "&:箱", + "':開いたドア", + "(:軟らかい防具", + "):盾", + "*:財宝を含んだ鉱脈または球形の怪物", + "+:閉じたドア", + ",:食べ物, おばけキノコ", + "-:魔法棒, ロッド", + ".:床", + "/:竿状武器(アックス/パイク/等)", + "0:博物館の入口", + "1:雑貨屋の入口", + "2:防具屋の入口", + "3:武器専門店の入口", + "4:寺院の入口", + "5:錬金術の店の入口", + "6:魔法の店の入口", + "7:ブラックマーケットの入口", + "8:我が家の入口", + "9:書店の入口", + "::岩石", + ";:守りのルーン/爆発のルーン", + "<:上り階段", + "=:指輪", + ">:下り階段", + "?:巻物", + "@:プレイヤー", + "A:天使", + "B:鳥", + "C:犬", + "D:古代ドラゴン/ワイアーム", + "E:エレメンタル", + "F:トンボ", + "G:ゴースト", + "H:雑種", + "I:昆虫", + "J:ヘビ", + "K:キラー・ビートル", + "L:リッチ", + "M:多首の爬虫類", + "N:謎の生物", + "O:オーガ", + "P:巨大人間型生物", + "Q:クイルスルグ(脈打つ肉塊)", + "R:爬虫類/両生類", + "S:蜘蛛/サソリ/ダニ", + "T:トロル", + "U:上級デーモン", + "V:バンパイア", + "W:ワイト/レイス/等", + "X:ゾーン/ザレン/等", + "Y:イエティ", + "Z:ハウンド", + "[:堅いアーマー", + "\\:鈍器(メイス/ムチ/等)", + "]:種々の防具", + "^:トラップ", + "_:杖", + "`:人形,彫像", + "a:アリ", + "b:コウモリ", + "c:ムカデ", + "d:ドラゴン", + "e:目玉", + "f:ネコ", + "g:ゴーレム", + "h:ホビット/エルフ/ドワーフ", + "i:ベトベト", + "j:ゼリー", + "k:コボルド", + "l:水棲生物", + "m:モルド", + "n:ナーガ", + "o:オーク", + "p:人間", + "q:四足獣", + "r:ネズミ", + "s:スケルトン", + "t:町の人", + "u:下級デーモン", + "v:ボルテックス", + "w:イモムシ/大群", + /* "x:unused", */ + "y:イーク", + "z:ゾンビ/ミイラ", + "{:飛び道具の弾(矢/弾)", + "|:刀剣類(ソード/ダガー/等)", + "}:飛び道具(弓/クロスボウ/スリング)", + "~:水/溶岩流(種々のアイテム)", #else - " :A dark grid", - "!:A potion (or oil)", - "\":An amulet (or necklace)", - "#:A wall (or secret door) / a plant / a gas", - "$:Treasure (gold or gems)", - "%:A vein (magma or quartz)", - "&:A chest", - "':An open door", - "(:Soft armor", - "):A shield", - "*:A vein with treasure or a ball monster", - "+:A closed door", - ",:Food (or mushroom patch)", - "-:A wand (or rod)", - ".:Floor", - "/:A polearm (Axe/Pike/etc)", - "0:Entrance to the Museum", - "1:Entrance to the General Store", - "2:Entrance to the Armoury", - "3:Entrance to the Weaponsmith's Shop", - "4:Entrance to the Temple", - "5:Entrance to the Alchemy Shop", - "6:Entrance to the Magic Shop", - "7:Entrance to the Black Market", - "8:Entrance to your home", - "9:Entrance to the Bookstore", - "::Rubble", - ";:A rune of protection / an explosive rune", - "<:An up staircase", - "=:A ring", - ">:A down staircase", - "?:A scroll", - "@:You", - "A:Angel", - "B:Bird", - "C:Canine", - "D:Ancient Dragon/Wyrm", - "E:Elemental", - "F:Dragon Fly", - "G:Ghost", - "H:Hybrid", - "I:Insect", - "J:Snake", - "K:Killer Beetle", - "L:Lich", - "M:Multi-Headed Reptile", - "N:Mystery Living", - "O:Ogre", - "P:Giant Humanoid", - "Q:Quylthulg (Pulsing Flesh Mound)", - "R:Reptile/Amphibian", - "S:Spider/Scorpion/Tick", - "T:Troll", - "U:Major Demon", - "V:Vampire", - "W:Wight/Wraith/etc", - "X:Xorn/Xaren/etc", - "Y:Yeti", - "Z:Zephyr Hound", - "[:Hard armor", - "\\:A hafted weapon (mace/whip/etc)", - "]:Misc. armor", - "^:A trap", - "_:A staff", - "`:A figurine or statue", - "a:Ant", - "b:Bat", - "c:Centipede", - "d:Dragon", - "e:Floating Eye", - "f:Feline", - "g:Golem", - "h:Hobbit/Elf/Dwarf", - "i:Icky Thing", - "j:Jelly", - "k:Kobold", - "l:Aquatic monster", - "m:Mold", - "n:Naga", - "o:Orc", - "p:Person/Human", - "q:Quadruped", - "r:Rodent", - "s:Skeleton", - "t:Townsperson", - "u:Minor Demon", - "v:Vortex", - "w:Worm/Worm-Mass", - /* "x:unused", */ - "y:Yeek", - "z:Zombie/Mummy", - "{:A missile (arrow/bolt/shot)", - "|:An edged weapon (sword/dagger/etc)", - "}:A launcher (bow/crossbow/sling)", - "~:Fluid terrain (or miscellaneous item)", + " :A dark grid", + "!:A potion (or oil)", + "\":An amulet (or necklace)", + "#:A wall (or secret door) / a plant / a gas", + "$:Treasure (gold or gems)", + "%:A vein (magma or quartz)", + "&:A chest", + "':An open door", + "(:Soft armor", + "):A shield", + "*:A vein with treasure or a ball monster", + "+:A closed door", + ",:Food (or mushroom patch)", + "-:A wand (or rod)", + ".:Floor", + "/:A polearm (Axe/Pike/etc)", + "0:Entrance to the Museum", + "1:Entrance to the General Store", + "2:Entrance to the Armoury", + "3:Entrance to the Weaponsmith's Shop", + "4:Entrance to the Temple", + "5:Entrance to the Alchemy Shop", + "6:Entrance to the Magic Shop", + "7:Entrance to the Black Market", + "8:Entrance to your home", + "9:Entrance to the Bookstore", + "::Rubble", + ";:A rune of protection / an explosive rune", + "<:An up staircase", + "=:A ring", + ">:A down staircase", + "?:A scroll", + "@:You", + "A:Angel", + "B:Bird", + "C:Canine", + "D:Ancient Dragon/Wyrm", + "E:Elemental", + "F:Dragon Fly", + "G:Ghost", + "H:Hybrid", + "I:Insect", + "J:Snake", + "K:Killer Beetle", + "L:Lich", + "M:Multi-Headed Reptile", + "N:Mystery Living", + "O:Ogre", + "P:Giant Humanoid", + "Q:Quylthulg (Pulsing Flesh Mound)", + "R:Reptile/Amphibian", + "S:Spider/Scorpion/Tick", + "T:Troll", + "U:Major Demon", + "V:Vampire", + "W:Wight/Wraith/etc", + "X:Xorn/Xaren/etc", + "Y:Yeti", + "Z:Zephyr Hound", + "[:Hard armor", + "\\:A hafted weapon (mace/whip/etc)", + "]:Misc. armor", + "^:A trap", + "_:A staff", + "`:A figurine or statue", + "a:Ant", + "b:Bat", + "c:Centipede", + "d:Dragon", + "e:Floating Eye", + "f:Feline", + "g:Golem", + "h:Hobbit/Elf/Dwarf", + "i:Icky Thing", + "j:Jelly", + "k:Kobold", + "l:Aquatic monster", + "m:Mold", + "n:Naga", + "o:Orc", + "p:Person/Human", + "q:Quadruped", + "r:Rodent", + "s:Skeleton", + "t:Townsperson", + "u:Minor Demon", + "v:Vortex", + "w:Worm/Worm-Mass", + /* "x:unused", */ + "y:Yeek", + "z:Zombie/Mummy", + "{:A missile (arrow/bolt/shot)", + "|:An edged weapon (sword/dagger/etc)", + "}:A launcher (bow/crossbow/sling)", + "~:Fluid terrain (or miscellaneous item)", #endif - nullptr + nullptr }; /* @@ -376,7 +368,7 @@ TERM_COLOR tval_to_attr[128]; /* * Default spell color table (quark index) */ -TERM_COLOR gf_color[MAX_GF]; +TERM_COLOR gf_color[(int)AttributeType::MAX]; /*! * @brief 万色表現用にランダムな色を選択する関数 / @@ -386,130 +378,185 @@ TERM_COLOR gf_color[MAX_GF]; */ static TERM_COLOR mh_attr(int max) { - switch (randint1(max)) - { - case 1: return (TERM_RED); - case 2: return (TERM_GREEN); - case 3: return (TERM_BLUE); - case 4: return (TERM_YELLOW); - case 5: return (TERM_ORANGE); - case 6: return (TERM_VIOLET); - case 7: return (TERM_L_RED); - case 8: return (TERM_L_GREEN); - case 9: return (TERM_L_BLUE); - case 10: return (TERM_UMBER); - case 11: return (TERM_L_UMBER); - case 12: return (TERM_SLATE); - case 13: return (TERM_WHITE); - case 14: return (TERM_L_WHITE); - case 15: return (TERM_L_DARK); - } - - return (TERM_WHITE); + switch (randint1(max)) { + case 1: + return (TERM_RED); + case 2: + return (TERM_GREEN); + case 3: + return (TERM_BLUE); + case 4: + return (TERM_YELLOW); + case 5: + return (TERM_ORANGE); + case 6: + return (TERM_VIOLET); + case 7: + return (TERM_L_RED); + case 8: + return (TERM_L_GREEN); + case 9: + return (TERM_L_BLUE); + case 10: + return (TERM_UMBER); + case 11: + return (TERM_L_UMBER); + case 12: + return (TERM_SLATE); + case 13: + return (TERM_WHITE); + case 14: + return (TERM_L_WHITE); + case 15: + return (TERM_L_DARK); + } + + return (TERM_WHITE); } - /*! * @brief 魔法属性に応じたエフェクトの色を返す / * Return a color to use for the bolt/ball spells * @param type 魔法属性 * @return 対応する色ID */ -static TERM_COLOR spell_color(EFFECT_ID type) +static TERM_COLOR spell_color(AttributeType type) { - /* Check if A.B.'s new graphics should be used (rr9) */ - if (streq(ANGBAND_GRAF, "new") || streq(ANGBAND_GRAF, "ne2")) - { - /* Analyze */ - switch (type) - { - case GF_PSY_SPEAR: return (0x06); - case GF_MISSILE: return (0x0F); - case GF_ACID: return (0x04); - case GF_ELEC: return (0x02); - case GF_FIRE: return (0x00); - case GF_COLD: return (0x01); - case GF_POIS: return (0x03); - case GF_HOLY_FIRE: return (0x00); - case GF_HELL_FIRE: return (0x00); - case GF_MANA: return (0x0E); - /* by henkma */ - case GF_SEEKER: return (0x0E); - case GF_SUPER_RAY: return (0x0E); - - case GF_ARROW: return (0x0F); - case GF_WATER: return (0x04); - case GF_NETHER: return (0x07); - case GF_CHAOS: return (mh_attr(15)); - case GF_DISENCHANT: return (0x05); - case GF_NEXUS: return (0x0C); - case GF_CONFUSION: return (mh_attr(4)); - case GF_SOUND: return (0x09); - case GF_SHARDS: return (0x08); - case GF_FORCE: return (0x09); - case GF_INERTIAL: return (0x09); - case GF_GRAVITY: return (0x09); - case GF_TIME: return (0x09); - case GF_LITE_WEAK: return (0x06); - case GF_LITE: return (0x06); - case GF_DARK_WEAK: return (0x07); - case GF_DARK: return (0x07); - case GF_PLASMA: return (0x0B); - case GF_METEOR: return (0x00); - case GF_ICE: return (0x01); - case GF_ROCKET: return (0x0F); - case GF_DEATH_RAY: return (0x07); - case GF_NUKE: return (mh_attr(2)); - case GF_DISINTEGRATE: return (0x05); - case GF_PSI: - case GF_PSI_DRAIN: - case GF_TELEKINESIS: - case GF_DOMINATION: - case GF_DRAIN_MANA: - case GF_MIND_BLAST: - case GF_BRAIN_SMASH: - return (0x09); - case GF_CAUSE_1: - case GF_CAUSE_2: - case GF_CAUSE_3: - case GF_CAUSE_4: return (0x0E); - case GF_HAND_DOOM: return (0x07); - case GF_CAPTURE: return (0x0E); - case GF_IDENTIFY: return (0x01); - case GF_ATTACK: return (0x0F); - case GF_PHOTO: return (0x06); - } - } - /* Normal tiles or ASCII */ - else - { - TERM_COLOR a; - SYMBOL_CODE c; - - /* Lookup the default colors for this type */ - concptr s = quark_str(gf_color[type]); - - if (!s) return (TERM_WHITE); - - /* Pick a random color */ - c = s[randint0(strlen(s))]; - - /* Lookup this color */ - a = angband_strchr(color_char, c) - color_char; - - /* Invalid color (note check for < 0 removed, gave a silly + /* Check if A.B.'s new graphics should be used (rr9) */ + if (streq(ANGBAND_GRAF, "new") || streq(ANGBAND_GRAF, "ne2")) { + /* Analyze */ + switch (type) { + case AttributeType::PSY_SPEAR: + return (0x06); + case AttributeType::MISSILE: + return (0x0F); + case AttributeType::ACID: + return (0x04); + case AttributeType::ELEC: + return (0x02); + case AttributeType::FIRE: + return (0x00); + case AttributeType::COLD: + return (0x01); + case AttributeType::POIS: + return (0x03); + case AttributeType::HOLY_FIRE: + return (0x00); + case AttributeType::HELL_FIRE: + return (0x00); + case AttributeType::MANA: + return (0x0E); + /* by henkma */ + case AttributeType::SEEKER: + return (0x0E); + case AttributeType::SUPER_RAY: + return (0x0E); + + case AttributeType::ARROW: + return (0x0F); + case AttributeType::WATER: + return (0x04); + case AttributeType::NETHER: + return (0x07); + case AttributeType::CHAOS: + return (mh_attr(15)); + case AttributeType::DISENCHANT: + return (0x05); + case AttributeType::NEXUS: + return (0x0C); + case AttributeType::CONFUSION: + return (mh_attr(4)); + case AttributeType::SOUND: + return (0x09); + case AttributeType::SHARDS: + return (0x08); + case AttributeType::FORCE: + return (0x09); + case AttributeType::INERTIAL: + return (0x09); + case AttributeType::GRAVITY: + return (0x09); + case AttributeType::TIME: + return (0x09); + case AttributeType::LITE_WEAK: + return (0x06); + case AttributeType::LITE: + return (0x06); + case AttributeType::DARK_WEAK: + return (0x07); + case AttributeType::DARK: + return (0x07); + case AttributeType::PLASMA: + return (0x0B); + case AttributeType::METEOR: + return (0x00); + case AttributeType::ICE: + return (0x01); + case AttributeType::ROCKET: + return (0x0F); + case AttributeType::DEATH_RAY: + return (0x07); + case AttributeType::NUKE: + return (mh_attr(2)); + case AttributeType::DISINTEGRATE: + return (0x05); + case AttributeType::PSI: /* fall through */ + case AttributeType::PSI_DRAIN: /* fall through */ + case AttributeType::TELEKINESIS: /* fall through */ + case AttributeType::DOMINATION: /* fall through */ + case AttributeType::DRAIN_MANA: /* fall through */ + case AttributeType::MIND_BLAST: /* fall through */ + case AttributeType::BRAIN_SMASH: + return (0x09); + case AttributeType::CAUSE_1: /* fall through */ + case AttributeType::CAUSE_2: /* fall through */ + case AttributeType::CAUSE_3: /* fall through */ + case AttributeType::CAUSE_4: + return (0x0E); + case AttributeType::HAND_DOOM: + return (0x07); + case AttributeType::CAPTURE: + return (0x0E); + case AttributeType::IDENTIFY: + return (0x01); + case AttributeType::ATTACK: + return (0x0F); + case AttributeType::PHOTO: + return (0x06); + default: + break; + } + } + /* Normal tiles or ASCII */ + else { + TERM_COLOR a; + SYMBOL_CODE c; + + /* Lookup the default colors for this type */ + concptr s = quark_str(gf_color[(int)type]); + + if (!s) + return (TERM_WHITE); + + /* Pick a random color */ + c = s[randint0(strlen(s))]; + + /* Lookup this color */ + a = angband_strchr(color_char, c) - color_char; + + /* Invalid color (note check for < 0 removed, gave a silly * warning because bytes are always >= 0 -- RG) */ - if (a > 15) return (TERM_WHITE); + if (a > 15) + return (TERM_WHITE); - /* Use this color */ - return (a); - } + /* Use this color */ + return (a); + } - /* Standard "color" */ - return (TERM_WHITE); + /* Standard "color" */ + return (TERM_WHITE); } - /*! * @brief 始点から終点にかけた方向毎にボルトのキャラクタを返す / * Find the attr/char pair to use for a spell effect @@ -525,47 +572,50 @@ static TERM_COLOR spell_color(EFFECT_ID type) * If the distance is not "one", we (may) return "*". * */ -uint16_t bolt_pict(POSITION y, POSITION x, POSITION ny, POSITION nx, EFFECT_ID typ) +uint16_t bolt_pict(POSITION y, POSITION x, POSITION ny, POSITION nx, AttributeType typ) { - int base; + int base; - byte k; + byte k; - TERM_COLOR a; - SYMBOL_CODE c; + TERM_COLOR a; + SYMBOL_CODE c; - /* No motion (*) */ - if ((ny == y) && (nx == x)) base = 0x30; + /* No motion (*) */ + if ((ny == y) && (nx == x)) + base = 0x30; - /* Vertical (|) */ - else if (nx == x) base = 0x40; + /* Vertical (|) */ + else if (nx == x) + base = 0x40; - /* Horizontal (-) */ - else if (ny == y) base = 0x50; + /* Horizontal (-) */ + else if (ny == y) + base = 0x50; - /* Diagonal (/) */ - else if ((ny - y) == (x - nx)) base = 0x60; + /* Diagonal (/) */ + else if ((ny - y) == (x - nx)) + base = 0x60; - /* Diagonal (\) */ - else if ((ny - y) == (nx - x)) base = 0x70; + /* Diagonal (\) */ + else if ((ny - y) == (nx - x)) + base = 0x70; - /* Weird (*) */ - else base = 0x30; + /* Weird (*) */ + else + base = 0x30; - /* Basic spell color */ - k = spell_color(typ); + /* Basic spell color */ + k = spell_color(typ); - /* Obtain attr/char */ - a = misc_to_attr[base + k]; - c = misc_to_char[base + k]; + /* Obtain attr/char */ + a = misc_to_attr[base + k]; + c = misc_to_char[base + k]; - /* Create pict */ - return (PICT(a, c)); + /* Create pict */ + return (PICT(a, c)); } - - - /*! * @brief シンボル1文字をカラーIDに変更する / * Convert a "color letter" into an "actual" color @@ -575,28 +625,41 @@ uint16_t bolt_pict(POSITION y, POSITION x, POSITION ny, POSITION nx, EFFECT_ID t */ TERM_COLOR color_char_to_attr(SYMBOL_CODE c) { - switch (c) - { - case 'd': return (TERM_DARK); - case 'w': return (TERM_WHITE); - case 's': return (TERM_SLATE); - case 'o': return (TERM_ORANGE); - case 'r': return (TERM_RED); - case 'g': return (TERM_GREEN); - case 'b': return (TERM_BLUE); - case 'u': return (TERM_UMBER); - - case 'D': return (TERM_L_DARK); - case 'W': return (TERM_L_WHITE); - case 'v': return (TERM_VIOLET); - case 'y': return (TERM_YELLOW); - case 'R': return (TERM_L_RED); - case 'G': return (TERM_L_GREEN); - case 'B': return (TERM_L_BLUE); - case 'U': return (TERM_L_UMBER); - } - - return (255); + switch (c) { + case 'd': + return (TERM_DARK); + case 'w': + return (TERM_WHITE); + case 's': + return (TERM_SLATE); + case 'o': + return (TERM_ORANGE); + case 'r': + return (TERM_RED); + case 'g': + return (TERM_GREEN); + case 'b': + return (TERM_BLUE); + case 'u': + return (TERM_UMBER); + + case 'D': + return (TERM_L_DARK); + case 'W': + return (TERM_L_WHITE); + case 'v': + return (TERM_VIOLET); + case 'y': + return (TERM_YELLOW); + case 'R': + return (TERM_L_RED); + case 'G': + return (TERM_L_GREEN); + case 'B': + return (TERM_L_BLUE); + case 'U': + return (TERM_L_UMBER); + } + + return (255); } - - diff --git a/src/term/gameterm.h b/src/term/gameterm.h index 6f79ce90f..eb6db17ba 100644 --- a/src/term/gameterm.h +++ b/src/term/gameterm.h @@ -1,7 +1,7 @@ #pragma once #include "system/angband.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" /* * Convert a "pict" (P) into an "attr" (A) @@ -28,7 +28,7 @@ extern TERM_COLOR tval_to_attr[128]; extern const char angband_term_name[8][16]; extern byte angband_color_table[256][4]; -extern TERM_COLOR gf_color[MAX_GF]; +extern TERM_COLOR gf_color[(int)AttributeType::MAX]; extern TERM_COLOR color_char_to_attr(SYMBOL_CODE c); -uint16_t bolt_pict(POSITION y, POSITION x, POSITION ny, POSITION nx, EFFECT_ID typ); +uint16_t bolt_pict(POSITION y, POSITION x, POSITION ny, POSITION nx, AttributeType typ); diff --git a/src/wizard/cmd-wizard.cpp b/src/wizard/cmd-wizard.cpp index 3979f2ce5..87b236b69 100644 --- a/src/wizard/cmd-wizard.cpp +++ b/src/wizard/cmd-wizard.cpp @@ -185,7 +185,7 @@ bool exe_cmd_debug(player_type *player_ptr, char cmd) wiz_jump_to_dungeon(player_ptr); break; case 'k': - wiz_kill_me(player_ptr, 0, command_arg); + wiz_kill_me(player_ptr, 0, (AttributeType)command_arg); break; case 'm': map_area(player_ptr, DETECT_RAD_ALL * 3); @@ -244,7 +244,7 @@ bool exe_cmd_debug(player_type *player_ptr, char cmd) wiz_kill_enemy(player_ptr); break; case 'Y': - wiz_kill_enemy(player_ptr, 0, command_arg); + wiz_kill_enemy(player_ptr, 0, (AttributeType)command_arg); break; case 'z': wiz_zap_surrounding_monsters(player_ptr); diff --git a/src/wizard/wizard-spells.cpp b/src/wizard/wizard-spells.cpp index e92cb49ab..0492fec6e 100644 --- a/src/wizard/wizard-spells.cpp +++ b/src/wizard/wizard-spells.cpp @@ -226,7 +226,7 @@ void wiz_summon_pet(player_type *player_ptr, MONRACE_IDX r_idx) * @param effect_idx 属性ID * @details デフォルトは100万・GF_ARROW(射撃)。RES_ALL持ちも一撃で殺せる。 */ -void wiz_kill_enemy(player_type *player_ptr, HIT_POINT dam, EFFECT_ID effect_idx) +void wiz_kill_enemy(player_type *player_ptr, HIT_POINT dam, AttributeType effect_idx) { if (dam <= 0) { char tmp[80] = ""; @@ -237,19 +237,21 @@ void wiz_kill_enemy(player_type *player_ptr, HIT_POINT dam, EFFECT_ID effect_idx dam = (HIT_POINT)atoi(tmp_val); } + int max = (int)AttributeType::MAX; + int idx = (int)effect_idx; - if (effect_idx <= GF_NONE) { + if (idx <= 0) { char tmp[80] = ""; - sprintf(tmp, "Effect ID (1-%d): ", MAX_GF - 1); + sprintf(tmp, "Effect ID (1-%d): ", max - 1); char tmp_val[10] = ""; if (!get_string(tmp, tmp_val, 3)) return; - effect_idx = (EFFECT_ID)atoi(tmp_val); + effect_idx = (AttributeType)atoi(tmp_val); } - if (effect_idx <= GF_NONE || effect_idx >= MAX_GF) { - msg_format(_("番号は1から%dの間で指定して下さい。", "ID must be between 1 to %d."), MAX_GF - 1); + if (idx <= 0 || idx >= max) { + msg_format(_("番号は1から%dの間で指定して下さい。", "ID must be between 1 to %d."), max - 1); return; } @@ -266,7 +268,7 @@ void wiz_kill_enemy(player_type *player_ptr, HIT_POINT dam, EFFECT_ID effect_idx * @param dam ダメージ量 * @param effect_idx 属性ID */ -void wiz_kill_me(player_type *player_ptr, HIT_POINT dam, EFFECT_ID effect_idx) +void wiz_kill_me(player_type *player_ptr, HIT_POINT dam, AttributeType effect_idx) { if (dam <= 0) { char tmp[80] = ""; @@ -277,19 +279,21 @@ void wiz_kill_me(player_type *player_ptr, HIT_POINT dam, EFFECT_ID effect_idx) dam = (HIT_POINT)atoi(tmp_val); } + int max = (int)AttributeType::MAX; + int idx = (int)effect_idx; - if (effect_idx <= GF_NONE) { + if (idx <= 0) { char tmp[80] = ""; - sprintf(tmp, "Effect ID (1-%d): ", MAX_GF - 1); + sprintf(tmp, "Effect ID (1-%d): ", max - 1); char tmp_val[10] = "1"; if (!get_string(tmp, tmp_val, 3)) return; - effect_idx = (EFFECT_ID)atoi(tmp_val); + effect_idx = (AttributeType)atoi(tmp_val); } - if (effect_idx <= GF_NONE || effect_idx >= MAX_GF) { - msg_format(_("番号は1から%dの間で指定して下さい。", "ID must be between 1 to %d."), MAX_GF - 1); + if (idx <= 0 || idx >= max) { + msg_format(_("番号は1から%dの間で指定して下さい。", "ID must be between 1 to %d."), max - 1); return; } diff --git a/src/wizard/wizard-spells.h b/src/wizard/wizard-spells.h index 18fc75aac..903e275cd 100644 --- a/src/wizard/wizard-spells.h +++ b/src/wizard/wizard-spells.h @@ -1,7 +1,7 @@ #pragma once #include "system/angband.h" -#include "spell/spell-types.h" +#include "effect/attribute-types.h" #define SPELL_MAX 5 @@ -47,5 +47,5 @@ void wiz_fillup_all_smith_essences(player_type *player_ptr); void wiz_summon_random_enemy(player_type *player_ptr, int num); void wiz_summon_specific_enemy(player_type *player_ptr, MONRACE_IDX r_idx); void wiz_summon_pet(player_type *player_ptr, MONRACE_IDX r_idx); -void wiz_kill_enemy(player_type *player_ptr, HIT_POINT dam = 1000000, EFFECT_ID effect_idx = GF_ARROW); -void wiz_kill_me(player_type *player_ptr, HIT_POINT dam, EFFECT_ID effect_idx); +void wiz_kill_enemy(player_type *player_ptr, HIT_POINT dam = 1000000, AttributeType effect_idx = AttributeType::ARROW); +void wiz_kill_me(player_type *player_ptr, HIT_POINT dam, AttributeType effect_idx);