#include "blue-magic/blue-magic-ball-bolt.h"
#include "blue-magic/blue-magic-util.h"
+#include "effect/attribute-types.h"
#include "monster-race/race-ability-flags.h"
#include "mspell/mspell-damage-calculator.h"
#include "spell-kind/spells-launcher.h"
-#include "effect/attribute-types.h"
#include "system/player-type-definition.h"
#include "target/target-getter.h"
#include "view/display-messages.h"
bool cast_blue_ball_acid(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("アシッド・ボールの呪文を唱えた。", "You cast an acid ball."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BA_ACID, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_ball_elec(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("サンダー・ボールの呪文を唱えた。", "You cast a lightning ball."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BA_ELEC, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_ball_fire(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("ファイア・ボールの呪文を唱えた。", "You cast a fire ball."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BA_FIRE, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_ball_cold(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("アイス・ボールの呪文を唱えた。", "You cast a frost ball."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BA_COLD, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_ball_pois(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("悪臭雲の呪文を唱えた。", "You cast a stinking cloud."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BA_POIS, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_ball_nuke(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("放射能球を放った。", "You cast a ball of radiation."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BA_NUKE, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_ball_nether(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("地獄球の呪文を唱えた。", "You cast a nether ball."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BA_NETH, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_ball_chaos(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("純ログルスを放った。", "You invoke a raw Logrus."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BA_CHAO, bmc_ptr->plev, DAM_ROLL);
*/
bool cast_blue_ball_water(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("流れるような身振りをした。", "You gesture fluidly."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BA_WATE, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_ball_star_burst(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("スターバーストの呪文を念じた。", "You invoke a starburst."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BA_LITE, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_ball_dark_storm(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("暗黒の嵐の呪文を念じた。", "You invoke a darkness storm."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BA_DARK, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_ball_mana_storm(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("魔力の嵐の呪文を念じた。", "You invoke a mana storm."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BA_MANA, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_ball_void(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("虚無の嵐の呪文を念じた。", "You invoke a void storm."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BA_VOID, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_ball_abyss(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("深淵の嵐の呪文を念じた。", "You invoke a abyss storm."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BA_ABYSS, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_bolt_acid(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("アシッド・ボルトの呪文を唱えた。", "You cast an acid bolt."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BO_ACID, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_bolt_elec(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("サンダー・ボルトの呪文を唱えた。", "You cast a lightning bolt."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BO_ELEC, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_bolt_fire(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("ファイア・ボルトの呪文を唱えた。", "You cast a fire bolt."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BO_FIRE, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_bolt_cold(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("アイス・ボルトの呪文を唱えた。", "You cast a frost bolt."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BO_COLD, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_bolt_nether(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("地獄の矢の呪文を唱えた。", "You cast a nether bolt."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BO_NETH, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_bolt_water(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("ウォーター・ボルトの呪文を唱えた。", "You cast a water bolt."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BO_WATE, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_bolt_mana(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("魔力の矢の呪文を唱えた。", "You cast a mana bolt."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BO_MANA, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_bolt_plasma(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("プラズマ・ボルトの呪文を唱えた。", "You cast a plasma bolt."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BO_PLAS, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_bolt_icee(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("極寒の矢の呪文を唱えた。", "You cast a ice bolt."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BO_ICEE, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_bolt_missile(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("マジック・ミサイルの呪文を唱えた。", "You cast a magic missile."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::MISSILE, bmc_ptr->plev, DAM_ROLL);
#include "blue-magic/blue-magic-breath.h"
#include "blue-magic/blue-magic-util.h"
+#include "effect/attribute-types.h"
#include "mind/mind-blue-mage.h"
#include "monster-race/race-ability-flags.h"
#include "mspell/mspell-damage-calculator.h"
#include "spell-kind/spells-launcher.h"
-#include "effect/attribute-types.h"
#include "system/player-type-definition.h"
#include "target/target-getter.h"
#include "view/display-messages.h"
bool cast_blue_breath_acid(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("酸のブレスを吐いた。", "You breathe acid."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BR_ACID, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_breath_elec(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("稲妻のブレスを吐いた。", "You breathe lightning."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BR_ELEC, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_breath_fire(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("火炎のブレスを吐いた。", "You breathe fire."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BR_FIRE, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_breath_cold(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("冷気のブレスを吐いた。", "You breathe frost."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BR_COLD, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_breath_pois(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("ガスのブレスを吐いた。", "You breathe gas."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BR_POIS, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_breath_nether(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("地獄のブレスを吐いた。", "You breathe nether."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BR_NETH, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_breath_lite(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("閃光のブレスを吐いた。", "You breathe light."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BR_LITE, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_breath_dark(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("暗黒のブレスを吐いた。", "You breathe darkness."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BR_DARK, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_breath_conf(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("混乱のブレスを吐いた。", "You breathe confusion."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BR_CONF, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_breath_sound(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("轟音のブレスを吐いた。", "You breathe sound."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BR_SOUN, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_breath_chaos(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("カオスのブレスを吐いた。", "You breathe chaos."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BR_CHAO, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_breath_disenchant(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("劣化のブレスを吐いた。", "You breathe disenchantment."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BR_DISE, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_breath_nexus(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("因果混乱のブレスを吐いた。", "You breathe nexus."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BR_NEXU, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_breath_time(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("時間逆転のブレスを吐いた。", "You breathe time."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BR_TIME, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_breath_inertia(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("遅鈍のブレスを吐いた。", "You breathe inertia."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BR_INER, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_breath_gravity(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("重力のブレスを吐いた。", "You breathe gravity."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BR_GRAV, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_breath_shards(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("破片のブレスを吐いた。", "You breathe shards."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BR_SHAR, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_breath_plasma(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("プラズマのブレスを吐いた。", "You breathe plasma."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BR_PLAS, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_breath_force(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("フォースのブレスを吐いた。", "You breathe force."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BR_FORC, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_breath_mana(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("魔力のブレスを吐いた。", "You breathe mana."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BR_MANA, bmc_ptr->plev, DAM_ROLL);
bool cast_blue_breath_nuke(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("放射性廃棄物のブレスを吐いた。", "You breathe toxic waste."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BR_NUKE, bmc_ptr->plev, DAM_ROLL);
*/
bool cast_blue_breath_disintegration(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("分解のブレスを吐いた。", "You breathe disintegration."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BR_DISI, bmc_ptr->plev, DAM_ROLL);
*/
bool cast_blue_breath_void(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("虚無のブレスを吐いた。", "You breathe void."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BR_VOID, bmc_ptr->plev, DAM_ROLL);
*/
bool cast_blue_breath_abyss(PlayerType *player_ptr, bmc_type *bmc_ptr)
{
- if (!get_aim_dir(player_ptr, &bmc_ptr->dir))
+ if (!get_aim_dir(player_ptr, &bmc_ptr->dir)) {
return false;
+ }
msg_print(_("深淵のブレスを吐いた。", "You breathe abyss."));
bmc_ptr->damage = monspell_bluemage_damage(player_ptr, MonsterAbilityType::BR_ABYSS, bmc_ptr->plev, DAM_ROLL);
const auto power_int = enum2i(power);
- if ((power_int > 2 && power_int < 41) || (power_int > 41 && power_int < 59) || (power == MonsterAbilityType::PSY_SPEAR)
- || (power == MonsterAbilityType::BO_VOID) || (power == MonsterAbilityType::BO_ABYSS) || (power == MonsterAbilityType::BA_VOID) || (power == MonsterAbilityType::BA_ABYSS) || (power == MonsterAbilityType::BR_VOID) || (power == MonsterAbilityType::BR_ABYSS))
+ if ((power_int > 2 && power_int < 41) || (power_int > 41 && power_int < 59) || (power == MonsterAbilityType::PSY_SPEAR) || (power == MonsterAbilityType::BO_VOID) || (power == MonsterAbilityType::BO_ABYSS) || (power == MonsterAbilityType::BA_VOID) || (power == MonsterAbilityType::BA_ABYSS) || (power == MonsterAbilityType::BR_VOID) || (power == MonsterAbilityType::BR_ABYSS)) {
sprintf(p, " %s%d", KWD_DAM, (int)dam);
- else {
+ } else {
switch (power) {
case MonsterAbilityType::DRAIN_MANA:
sprintf(p, " %sd%d+%d", KWD_HEAL, plev * 3, plev);
choice = always_show_list ? ESCAPE : 1;
while (!flag) {
- if (choice == ESCAPE)
+ if (choice == ESCAPE) {
choice = ' ';
- else if (!get_com(out_val, &choice, true))
+ } else if (!get_com(out_val, &choice, true)) {
break;
+ }
/* Request redraw */
if ((choice == ' ') || (choice == '*') || (choice == '?')) {
chance = spell.manefail;
/* Reduce failure rate by "effective" level adjustment */
- if (plev > spell.level)
+ if (plev > spell.level) {
chance -= 3 * (plev - spell.level);
+ }
/* Reduce failure rate by INT/WIS adjustment */
chance -= 3 * (adj_mag_stat[player_ptr->stat_index[spell.use_stat]] + adj_mag_stat[player_ptr->stat_index[A_DEX]] - 2) / 2;
- if (spell.manedam)
+ if (spell.manedam) {
chance = chance * (baigaesi ? mane.damage * 2 : mane.damage) / spell.manedam;
+ }
chance += player_ptr->to_m_chance;
ask = isupper(choice);
/* Lowercase */
- if (ask)
+ if (ask) {
choice = (char)tolower(choice);
+ }
/* Extract request */
i = (islower(choice) ? A2I(choice) : -1);
(void)strnfmt(tmp_val, 78, _("%sをまねますか?", "Use %s? "), spell.name);
/* Belay that order */
- if (!get_check(tmp_val))
+ if (!get_check(tmp_val)) {
continue;
+ }
}
/* Stop the loop */
flag = true;
}
- if (redraw)
+ if (redraw) {
screen_load();
+ }
player_ptr->window_flags |= (PW_SPELL);
handle_stuff(player_ptr);
/* Abort if needed */
- if (!flag)
+ if (!flag) {
return false;
+ }
/* Save the choice */
(*sn) = i;
BIT_FLAGS mode = (PM_ALLOW_GROUP | PM_FORCE_PET);
BIT_FLAGS u_mode = 0L;
- if (randint1(50 + plev) < plev / 10)
+ if (randint1(50 + plev) < plev / 10) {
u_mode = PM_ALLOW_UNIQUE;
+ }
/* spell code */
switch (spell) {
case MonsterAbilityType::DISPEL: {
MONSTER_IDX m_idx;
- if (!target_set(player_ptr, TARGET_KILL))
+ if (!target_set(player_ptr, TARGET_KILL)) {
return false;
+ }
m_idx = player_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx;
- if (!m_idx)
+ if (!m_idx) {
break;
- if (!player_has_los_bold(player_ptr, target_row, target_col))
+ }
+ if (!player_has_los_bold(player_ptr, target_row, target_col)) {
break;
- if (!projectable(player_ptr, player_ptr->y, player_ptr->x, target_row, target_col))
+ }
+ if (!projectable(player_ptr, player_ptr->y, player_ptr->x, target_row, target_col)) {
break;
+ }
dispel_monster_status(player_ptr, m_idx);
break;
}
case MonsterAbilityType::ROCKET:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("ロケットを発射した。", "You fire a rocket."));
+ }
fire_rocket(player_ptr, AttributeType::ROCKET, dir, damage, 2);
break;
case MonsterAbilityType::SHOOT:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("矢を放った。", "You fire an arrow."));
+ }
fire_bolt(player_ptr, AttributeType::MONSTER_SHOOT, dir, damage);
break;
break;
case MonsterAbilityType::BR_ACID:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("酸のブレスを吐いた。", "You breathe acid."));
+ }
fire_breath(player_ptr, AttributeType::ACID, dir, damage, (plev > 35 ? 3 : 2));
break;
case MonsterAbilityType::BR_ELEC:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("稲妻のブレスを吐いた。", "You breathe lightning."));
+ }
fire_breath(player_ptr, AttributeType::ELEC, dir, damage, (plev > 35 ? 3 : 2));
break;
case MonsterAbilityType::BR_FIRE:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("火炎のブレスを吐いた。", "You breathe fire."));
+ }
fire_breath(player_ptr, AttributeType::FIRE, dir, damage, (plev > 35 ? 3 : 2));
break;
case MonsterAbilityType::BR_COLD:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("冷気のブレスを吐いた。", "You breathe frost."));
+ }
fire_breath(player_ptr, AttributeType::COLD, dir, damage, (plev > 35 ? 3 : 2));
break;
case MonsterAbilityType::BR_POIS:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("ガスのブレスを吐いた。", "You breathe gas."));
+ }
fire_breath(player_ptr, AttributeType::POIS, dir, damage, (plev > 35 ? 3 : 2));
break;
case MonsterAbilityType::BR_NETH:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("地獄のブレスを吐いた。", "You breathe nether."));
+ }
fire_breath(player_ptr, AttributeType::NETHER, dir, damage, (plev > 35 ? 3 : 2));
break;
case MonsterAbilityType::BR_LITE:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("閃光のブレスを吐いた。", "You breathe light."));
+ }
fire_breath(player_ptr, AttributeType::LITE, dir, damage, (plev > 35 ? 3 : 2));
break;
case MonsterAbilityType::BR_DARK:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("暗黒のブレスを吐いた。", "You breathe darkness."));
+ }
fire_breath(player_ptr, AttributeType::DARK, dir, damage, (plev > 35 ? 3 : 2));
break;
case MonsterAbilityType::BR_CONF:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("混乱のブレスを吐いた。", "You breathe confusion."));
+ }
fire_breath(player_ptr, AttributeType::CONFUSION, dir, damage, (plev > 35 ? 3 : 2));
break;
case MonsterAbilityType::BR_SOUN:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("轟音のブレスを吐いた。", "You breathe sound."));
+ }
fire_breath(player_ptr, AttributeType::SOUND, dir, damage, (plev > 35 ? 3 : 2));
break;
case MonsterAbilityType::BR_CHAO:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("カオスのブレスを吐いた。", "You breathe chaos."));
+ }
fire_breath(player_ptr, AttributeType::CHAOS, dir, damage, (plev > 35 ? 3 : 2));
break;
case MonsterAbilityType::BR_DISE:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("劣化のブレスを吐いた。", "You breathe disenchantment."));
+ }
fire_breath(player_ptr, AttributeType::DISENCHANT, dir, damage, (plev > 35 ? 3 : 2));
break;
case MonsterAbilityType::BR_NEXU:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("因果混乱のブレスを吐いた。", "You breathe nexus."));
+ }
fire_breath(player_ptr, AttributeType::NEXUS, dir, damage, (plev > 35 ? 3 : 2));
break;
case MonsterAbilityType::BR_TIME:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("時間逆転のブレスを吐いた。", "You breathe time."));
+ }
fire_breath(player_ptr, AttributeType::TIME, dir, damage, (plev > 35 ? 3 : 2));
break;
case MonsterAbilityType::BR_INER:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("遅鈍のブレスを吐いた。", "You breathe inertia."));
+ }
fire_breath(player_ptr, AttributeType::INERTIAL, dir, damage, (plev > 35 ? 3 : 2));
break;
case MonsterAbilityType::BR_GRAV:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("重力のブレスを吐いた。", "You breathe gravity."));
+ }
fire_breath(player_ptr, AttributeType::GRAVITY, dir, damage, (plev > 35 ? 3 : 2));
break;
case MonsterAbilityType::BR_SHAR:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("破片のブレスを吐いた。", "You breathe shards."));
+ }
fire_breath(player_ptr, AttributeType::SHARDS, dir, damage, (plev > 35 ? 3 : 2));
break;
case MonsterAbilityType::BR_PLAS:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("プラズマのブレスを吐いた。", "You breathe plasma."));
-
+ }
fire_breath(player_ptr, AttributeType::PLASMA, dir, damage, (plev > 35 ? 3 : 2));
break;
case MonsterAbilityType::BR_FORC:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("フォースのブレスを吐いた。", "You breathe force."));
-
+ }
fire_breath(player_ptr, AttributeType::FORCE, dir, damage, (plev > 35 ? 3 : 2));
break;
case MonsterAbilityType::BR_MANA:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("魔力のブレスを吐いた。", "You breathe mana."));
-
+ }
fire_breath(player_ptr, AttributeType::MANA, dir, damage, (plev > 35 ? 3 : 2));
break;
case MonsterAbilityType::BA_NUKE:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("放射能球を放った。", "You cast a ball of radiation."));
-
+ }
fire_ball(player_ptr, AttributeType::NUKE, dir, damage, 2);
break;
case MonsterAbilityType::BR_NUKE:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("放射性廃棄物のブレスを吐いた。", "You breathe toxic waste."));
+ }
fire_breath(player_ptr, AttributeType::NUKE, dir, damage, (plev > 35 ? 3 : 2));
break;
case MonsterAbilityType::BA_CHAO:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("純ログルスを放った。", "You invoke a raw Logrus."));
+ }
fire_ball(player_ptr, AttributeType::CHAOS, dir, damage, 4);
break;
case MonsterAbilityType::BR_DISI:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("分解のブレスを吐いた。", "You breathe disintegration."));
+ }
fire_breath(player_ptr, AttributeType::DISINTEGRATE, dir, damage, (plev > 35 ? 3 : 2));
break;
case MonsterAbilityType::BR_VOID:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("虚無のブレスを吐いた。", "You breathe void."));
+ }
fire_breath(player_ptr, AttributeType::VOID_MAGIC, dir, damage, (plev > 35 ? 3 : 2));
break;
case MonsterAbilityType::BR_ABYSS:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("深淵のブレスを吐いた。", "You breathe abyss."));
+ }
fire_breath(player_ptr, AttributeType::ABYSS, dir, damage, (plev > 35 ? 3 : 2));
break;
case MonsterAbilityType::BA_ACID:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("アシッド・ボールの呪文を唱えた。", "You cast an acid ball."));
+ }
fire_ball(player_ptr, AttributeType::ACID, dir, damage, 2);
break;
case MonsterAbilityType::BA_ELEC:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("サンダー・ボールの呪文を唱えた。", "You cast a lightning ball."));
+ }
fire_ball(player_ptr, AttributeType::ELEC, dir, damage, 2);
break;
case MonsterAbilityType::BA_FIRE:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("ファイア・ボールの呪文を唱えた。", "You cast a fire ball."));
+ }
fire_ball(player_ptr, AttributeType::FIRE, dir, damage, 2);
break;
case MonsterAbilityType::BA_COLD:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("アイス・ボールの呪文を唱えた。", "You cast a frost ball."));
+ }
fire_ball(player_ptr, AttributeType::COLD, dir, damage, 2);
break;
case MonsterAbilityType::BA_POIS:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("悪臭雲の呪文を唱えた。", "You cast a stinking cloud."));
+ }
fire_ball(player_ptr, AttributeType::POIS, dir, damage, 2);
break;
case MonsterAbilityType::BA_NETH:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("地獄球の呪文を唱えた。", "You cast a nether ball."));
+ }
fire_ball(player_ptr, AttributeType::NETHER, dir, damage, 2);
break;
case MonsterAbilityType::BA_WATE:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("流れるような身振りをした。", "You gesture fluidly."));
+ }
fire_ball(player_ptr, AttributeType::WATER, dir, damage, 4);
break;
case MonsterAbilityType::BA_MANA:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("魔力の嵐の呪文を念じた。", "You invoke a mana storm."));
+ }
fire_ball(player_ptr, AttributeType::MANA, dir, damage, 4);
break;
case MonsterAbilityType::BA_DARK:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("暗黒の嵐の呪文を念じた。", "You invoke a darkness storm."));
+ }
fire_ball(player_ptr, AttributeType::DARK, dir, damage, 4);
break;
case MonsterAbilityType::BA_VOID:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("虚無の嵐の呪文を念じた。", "You cast a void ball."));
+ }
fire_ball(player_ptr, AttributeType::VOID_MAGIC, dir, damage, 4);
break;
case MonsterAbilityType::BA_ABYSS:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("深淵の嵐の呪文を念じた。", "You cast a abyss ball."));
+ }
fire_ball(player_ptr, AttributeType::ABYSS, dir, damage, 4);
break;
case MonsterAbilityType::DRAIN_MANA:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
+ }
fire_ball_hide(player_ptr, AttributeType::DRAIN_MANA, dir, randint1(plev * 3) + plev, 0);
break;
case MonsterAbilityType::MIND_BLAST:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
+ }
fire_ball_hide(player_ptr, AttributeType::MIND_BLAST, dir, damage, 0);
break;
case MonsterAbilityType::BRAIN_SMASH:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
+ }
fire_ball_hide(player_ptr, AttributeType::BRAIN_SMASH, dir, damage, 0);
break;
case MonsterAbilityType::CAUSE_1:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
+ }
fire_ball_hide(player_ptr, AttributeType::CAUSE_1, dir, damage, 0);
break;
case MonsterAbilityType::CAUSE_2:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
+ }
fire_ball_hide(player_ptr, AttributeType::CAUSE_2, dir, damage, 0);
break;
case MonsterAbilityType::CAUSE_3:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
+ }
fire_ball_hide(player_ptr, AttributeType::CAUSE_3, dir, damage, 0);
break;
case MonsterAbilityType::CAUSE_4:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
+ }
fire_ball_hide(player_ptr, AttributeType::CAUSE_4, dir, damage, 0);
break;
case MonsterAbilityType::BO_ACID:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("アシッド・ボルトの呪文を唱えた。", "You cast an acid bolt."));
+ }
fire_bolt(player_ptr, AttributeType::ACID, dir, damage);
break;
case MonsterAbilityType::BO_ELEC:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("サンダー・ボルトの呪文を唱えた。", "You cast a lightning bolt."));
+ }
fire_bolt(player_ptr, AttributeType::ELEC, dir, damage);
break;
case MonsterAbilityType::BO_FIRE:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("ファイア・ボルトの呪文を唱えた。", "You cast a fire bolt."));
+ }
fire_bolt(player_ptr, AttributeType::FIRE, dir, damage);
break;
case MonsterAbilityType::BO_COLD:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("アイス・ボルトの呪文を唱えた。", "You cast a frost bolt."));
+ }
fire_bolt(player_ptr, AttributeType::COLD, dir, damage);
break;
case MonsterAbilityType::BA_LITE:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("スターバーストの呪文を念じた。", "You invoke a starburst."));
+ }
fire_ball(player_ptr, AttributeType::LITE, dir, damage, 4);
break;
case MonsterAbilityType::BO_NETH:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("地獄の矢の呪文を唱えた。", "You cast a nether bolt."));
+ }
fire_bolt(player_ptr, AttributeType::NETHER, dir, damage);
break;
case MonsterAbilityType::BO_WATE:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("ウォーター・ボルトの呪文を唱えた。", "You cast a water bolt."));
+ }
fire_bolt(player_ptr, AttributeType::WATER, dir, damage);
break;
case MonsterAbilityType::BO_MANA:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("魔力の矢の呪文を唱えた。", "You cast a mana bolt."));
+ }
fire_bolt(player_ptr, AttributeType::MANA, dir, damage);
break;
case MonsterAbilityType::BO_PLAS:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("プラズマ・ボルトの呪文を唱えた。", "You cast a plasma bolt."));
+ }
fire_bolt(player_ptr, AttributeType::PLASMA, dir, damage);
break;
case MonsterAbilityType::BO_ICEE:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("極寒の矢の呪文を唱えた。", "You cast a ice bolt."));
+ }
fire_bolt(player_ptr, AttributeType::ICE, dir, damage);
break;
case MonsterAbilityType::BO_VOID:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("虚無の矢の呪文を唱えた。", "You cast a void bolt."));
+ }
fire_bolt(player_ptr, AttributeType::VOID_MAGIC, dir, damage);
break;
case MonsterAbilityType::BO_ABYSS:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("深淵の矢の呪文を唱えた。", "You cast a abyss bolt."));
+ }
fire_bolt(player_ptr, AttributeType::ABYSS, dir, damage);
break;
case MonsterAbilityType::MISSILE:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("マジック・ミサイルの呪文を唱えた。", "You cast a magic missile."));
+ }
fire_bolt(player_ptr, AttributeType::MISSILE, dir, damage);
break;
case MonsterAbilityType::SCARE:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("恐ろしげな幻覚を作り出した。", "You cast a fearful illusion."));
+ }
fear_monster(player_ptr, dir, plev + 10);
break;
case MonsterAbilityType::BLIND:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
+ }
confuse_monster(player_ptr, dir, plev * 2);
break;
case MonsterAbilityType::CONF:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("誘惑的な幻覚をつくり出した。", "You cast a mesmerizing illusion."));
+ }
confuse_monster(player_ptr, dir, plev * 2);
break;
case MonsterAbilityType::SLOW:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
+ }
slow_monster(player_ptr, dir, plev);
break;
case MonsterAbilityType::HOLD:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
+ }
sleep_monster(player_ptr, dir, plev);
break;
case MonsterAbilityType::HASTE:
(void)set_fast(player_ptr, randint1(20 + plev) + plev, false);
break;
case MonsterAbilityType::HAND_DOOM: {
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("<破滅の手>を放った!", "You invoke the Hand of Doom!"));
+ }
fire_ball_hide(player_ptr, AttributeType::HAND_DOOM, dir, 200, 0);
break;
monster_race *r_ptr;
GAME_TEXT m_name[MAX_NLEN];
- if (!target_set(player_ptr, TARGET_KILL))
+ if (!target_set(player_ptr, TARGET_KILL)) {
return false;
- if (!player_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx)
+ }
+ if (!player_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx) {
break;
- if (!player_has_los_bold(player_ptr, target_row, target_col))
+ }
+ if (!player_has_los_bold(player_ptr, target_row, target_col)) {
break;
- if (!projectable(player_ptr, player_ptr->y, player_ptr->x, target_row, target_col))
+ }
+ if (!projectable(player_ptr, player_ptr->y, player_ptr->x, target_row, target_col)) {
break;
+ }
m_ptr = &player_ptr->current_floor_ptr->m_list[player_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx];
r_ptr = &r_info[m_ptr->r_idx];
monster_desc(player_ptr, m_name, m_ptr, 0);
if (r_ptr->flagsr & RFR_RES_TELE) {
if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL)) {
- if (is_original_ap_and_seen(player_ptr, m_ptr))
+ if (is_original_ap_and_seen(player_ptr, m_ptr)) {
r_ptr->r_flagsr |= RFR_RES_TELE;
+ }
msg_format(_("%sには効果がなかった!", "%s is unaffected!"), m_name);
break;
} else if (r_ptr->level > randint1(100)) {
- if (is_original_ap_and_seen(player_ptr, m_ptr))
+ if (is_original_ap_and_seen(player_ptr, m_ptr)) {
r_ptr->r_flagsr |= RFR_RES_TELE;
+ }
msg_format(_("%sには耐性がある!", "%s resists!"), m_name);
break;
break;
}
case MonsterAbilityType::TELE_AWAY:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
+ }
(void)fire_beam(player_ptr, AttributeType::AWAY_ALL, dir, plev);
break;
break;
case MonsterAbilityType::PSY_SPEAR:
- if (!get_aim_dir(player_ptr, &dir))
+ if (!get_aim_dir(player_ptr, &dir)) {
return false;
- else
+ } else {
msg_print(_("光の剣を放った。", "You throw a psycho-spear."));
+ }
(void)fire_beam(player_ptr, AttributeType::PSY_SPEAR, dir, damage);
break;
break;
case MonsterAbilityType::TRAPS:
- if (!target_set(player_ptr, TARGET_KILL))
+ if (!target_set(player_ptr, TARGET_KILL)) {
return false;
+ }
msg_print(_("呪文を唱えて邪悪に微笑んだ。", "You cast a spell and cackle evilly."));
trap_creation(player_ptr, target_row, target_col);
break;
break;
case MonsterAbilityType::S_KIN: {
int k;
- if (!target_set(player_ptr, TARGET_KILL))
+ if (!target_set(player_ptr, TARGET_KILL)) {
return false;
+ }
msg_print(_("援軍を召喚した。", "You summon minions."));
for (k = 0; k < 4; k++) {
case MonsterAbilityType::S_CYBER: {
int k;
int max_cyber = (player_ptr->current_floor_ptr->dun_level / 50) + randint1(3);
- if (!target_set(player_ptr, TARGET_KILL))
+ if (!target_set(player_ptr, TARGET_KILL)) {
return false;
+ }
msg_print(_("サイバーデーモンを召喚した!", "You summon Cyberdemons!"));
- if (max_cyber > 4)
+ if (max_cyber > 4) {
max_cyber = 4;
- for (k = 0; k < max_cyber; k++)
+ }
+ for (k = 0; k < max_cyber; k++) {
summon_specific(player_ptr, -1, target_row, target_col, plev, SUMMON_CYBER, mode);
+ }
break;
}
case MonsterAbilityType::S_MONSTER: {
int k;
- if (!target_set(player_ptr, TARGET_KILL))
+ if (!target_set(player_ptr, TARGET_KILL)) {
return false;
+ }
msg_print(_("仲間を召喚した。", "You summon help."));
- for (k = 0; k < 1; k++)
+ for (k = 0; k < 1; k++) {
summon_specific(player_ptr, -1, target_row, target_col, plev, SUMMON_NONE, (mode | u_mode));
+ }
break;
}
case MonsterAbilityType::S_MONSTERS: {
int k;
- if (!target_set(player_ptr, TARGET_KILL))
+ if (!target_set(player_ptr, TARGET_KILL)) {
return false;
+ }
msg_print(_("モンスターを召喚した!", "You summon monsters!"));
- for (k = 0; k < 6; k++)
+ for (k = 0; k < 6; k++) {
summon_specific(player_ptr, -1, target_row, target_col, plev, SUMMON_NONE, (mode | u_mode));
+ }
break;
}
case MonsterAbilityType::S_ANT: {
int k;
- if (!target_set(player_ptr, TARGET_KILL))
+ if (!target_set(player_ptr, TARGET_KILL)) {
return false;
+ }
msg_print(_("アリを召喚した。", "You summon ants."));
- for (k = 0; k < 6; k++)
+ for (k = 0; k < 6; k++) {
summon_specific(player_ptr, -1, target_row, target_col, plev, SUMMON_ANT, mode);
+ }
break;
}
case MonsterAbilityType::S_SPIDER: {
int k;
- if (!target_set(player_ptr, TARGET_KILL))
+ if (!target_set(player_ptr, TARGET_KILL)) {
return false;
+ }
msg_print(_("蜘蛛を召喚した。", "You summon spiders."));
- for (k = 0; k < 6; k++)
+ for (k = 0; k < 6; k++) {
summon_specific(player_ptr, -1, target_row, target_col, plev, SUMMON_SPIDER, mode);
+ }
break;
}
case MonsterAbilityType::S_HOUND: {
int k;
- if (!target_set(player_ptr, TARGET_KILL))
+ if (!target_set(player_ptr, TARGET_KILL)) {
return false;
+ }
msg_print(_("ハウンドを召喚した。", "You summon hounds."));
- for (k = 0; k < 4; k++)
+ for (k = 0; k < 4; k++) {
summon_specific(player_ptr, -1, target_row, target_col, plev, SUMMON_HOUND, mode);
+ }
break;
}
case MonsterAbilityType::S_HYDRA: {
int k;
- if (!target_set(player_ptr, TARGET_KILL))
+ if (!target_set(player_ptr, TARGET_KILL)) {
return false;
+ }
msg_print(_("ヒドラを召喚した。", "You summon hydras."));
- for (k = 0; k < 4; k++)
+ for (k = 0; k < 4; k++) {
summon_specific(player_ptr, -1, target_row, target_col, plev, SUMMON_HYDRA, mode);
+ }
break;
}
case MonsterAbilityType::S_ANGEL: {
int k;
- if (!target_set(player_ptr, TARGET_KILL))
+ if (!target_set(player_ptr, TARGET_KILL)) {
return false;
+ }
msg_print(_("天使を召喚した!", "You summon an angel!"));
- for (k = 0; k < 1; k++)
+ for (k = 0; k < 1; k++) {
summon_specific(player_ptr, -1, target_row, target_col, plev, SUMMON_ANGEL, mode);
+ }
break;
}
case MonsterAbilityType::S_DEMON: {
int k;
- if (!target_set(player_ptr, TARGET_KILL))
+ if (!target_set(player_ptr, TARGET_KILL)) {
return false;
+ }
msg_print(_("混沌の宮廷から悪魔を召喚した!", "You summon a demon from the Courts of Chaos!"));
- for (k = 0; k < 1; k++)
+ for (k = 0; k < 1; k++) {
summon_specific(player_ptr, -1, target_row, target_col, plev, SUMMON_DEMON, (mode | u_mode));
+ }
break;
}
case MonsterAbilityType::S_UNDEAD: {
int k;
- if (!target_set(player_ptr, TARGET_KILL))
+ if (!target_set(player_ptr, TARGET_KILL)) {
return false;
+ }
msg_print(_("アンデッドの強敵を召喚した!", "You summon an undead adversary!"));
- for (k = 0; k < 1; k++)
+ for (k = 0; k < 1; k++) {
summon_specific(player_ptr, -1, target_row, target_col, plev, SUMMON_UNDEAD, (mode | u_mode));
+ }
break;
}
case MonsterAbilityType::S_DRAGON: {
int k;
- if (!target_set(player_ptr, TARGET_KILL))
+ if (!target_set(player_ptr, TARGET_KILL)) {
return false;
+ }
msg_print(_("ドラゴンを召喚した!", "You summon a dragon!"));
- for (k = 0; k < 1; k++)
+ for (k = 0; k < 1; k++) {
summon_specific(player_ptr, -1, target_row, target_col, plev, SUMMON_DRAGON, (mode | u_mode));
+ }
break;
}
case MonsterAbilityType::S_HI_UNDEAD: {
int k;
- if (!target_set(player_ptr, TARGET_KILL))
+ if (!target_set(player_ptr, TARGET_KILL)) {
return false;
+ }
msg_print(_("強力なアンデッドを召喚した!", "You summon greater undead!"));
- for (k = 0; k < 6; k++)
+ for (k = 0; k < 6; k++) {
summon_specific(player_ptr, -1, target_row, target_col, plev, SUMMON_HI_UNDEAD, (mode | u_mode));
+ }
break;
}
case MonsterAbilityType::S_HI_DRAGON: {
int k;
- if (!target_set(player_ptr, TARGET_KILL))
+ if (!target_set(player_ptr, TARGET_KILL)) {
return false;
+ }
msg_print(_("古代ドラゴンを召喚した!", "You summon ancient dragons!"));
- for (k = 0; k < 4; k++)
+ for (k = 0; k < 4; k++) {
summon_specific(player_ptr, -1, target_row, target_col, plev, SUMMON_HI_DRAGON, (mode | u_mode));
+ }
break;
}
case MonsterAbilityType::S_AMBERITES: {
int k;
- if (!target_set(player_ptr, TARGET_KILL))
+ if (!target_set(player_ptr, TARGET_KILL)) {
return false;
+ }
msg_print(_("アンバーの王族を召喚した!", "You summon Lords of Amber!"));
- for (k = 0; k < 4; k++)
+ for (k = 0; k < 4; k++) {
summon_specific(player_ptr, -1, target_row, target_col, plev, SUMMON_AMBERITES, (mode | PM_ALLOW_UNIQUE));
+ }
break;
}
case MonsterAbilityType::S_UNIQUE: {
int k, count = 0;
- if (!target_set(player_ptr, TARGET_KILL))
+ if (!target_set(player_ptr, TARGET_KILL)) {
return false;
+ }
msg_print(_("特別な強敵を召喚した!", "You summon special opponents!"));
- for (k = 0; k < 4; k++)
- if (summon_specific(player_ptr, -1, target_row, target_col, plev, SUMMON_UNIQUE, (mode | PM_ALLOW_UNIQUE)))
+ for (k = 0; k < 4; k++) {
+ if (summon_specific(player_ptr, -1, target_row, target_col, plev, SUMMON_UNIQUE, (mode | PM_ALLOW_UNIQUE))) {
count++;
- for (k = count; k < 4; k++)
+ }
+ }
+ for (k = count; k < 4; k++) {
summon_specific(player_ptr, -1, target_row, target_col, plev, SUMMON_HI_UNDEAD, (mode | u_mode));
+ }
break;
}
default:
monster_power spell;
bool cast;
- if (cmd_limit_confused(player_ptr))
+ if (cmd_limit_confused(player_ptr)) {
return false;
+ }
auto mane_data = PlayerClass(player_ptr).get_specific_data<mane_data_type>();
return false;
}
- if (!get_mane_power(player_ptr, &n, baigaesi))
+ if (!get_mane_power(player_ptr, &n, baigaesi)) {
return false;
+ }
spell = monster_powers.at(mane_data->mane_list[n].spell);
chance = spell.manefail;
/* Reduce failure rate by "effective" level adjustment */
- if (plev > spell.level)
+ if (plev > spell.level) {
chance -= 3 * (plev - spell.level);
+ }
/* Reduce failure rate by 1 stat and DEX adjustment */
chance -= 3 * (adj_mag_stat[player_ptr->stat_index[spell.use_stat]] + adj_mag_stat[player_ptr->stat_index[A_DEX]] - 2) / 2;
- if (spell.manedam)
+ if (spell.manedam) {
chance = chance * damage / spell.manedam;
+ }
chance += player_ptr->to_m_chance;
minfail = adj_mag_fail[player_ptr->stat_index[spell.use_stat]];
/* Minimum failure rate */
- if (chance < minfail)
+ if (chance < minfail) {
chance = minfail;
+ }
auto player_stun = player_ptr->effects()->stun();
chance += player_stun->get_magic_chance_penalty();
/* Failed spell */
if (randint0(100) < chance) {
- if (flush_failure)
+ if (flush_failure) {
flush();
+ }
msg_print(_("ものまねに失敗した!", "You failed to concentrate hard enough!"));
sound(SOUND_FAIL);
} else {
sound(SOUND_ZAP);
cast = use_mane(player_ptr, mane_data->mane_list[n].spell);
- if (!cast)
+ if (!cast) {
return false;
+ }
}
mane_data->mane_list.erase(std::next(mane_data->mane_list.begin(), n));
cave_set_feat(player_ptr, y, x, one_in_(3) ? feat_brake : feat_grass);
/* Observe */
- if (g_ptr->is_mark())
+ if (g_ptr->is_mark()) {
obvious = true;
+ }
}
}
}
}
- if (player_ptr->blind || !player_has_los_bold(player_ptr, y, x))
+ if (player_ptr->blind || !player_has_los_bold(player_ptr, y, x)) {
break;
+ }
g_ptr->info &= ~(CAVE_UNSAFE);
lite_spot(player_ptr, y, x);
cave_alter_feat(player_ptr, y, x, FloorFeatureType::TUNNEL);
}
- if (player_ptr->blind || !player_has_los_bold(player_ptr, y, x))
+ if (player_ptr->blind || !player_has_los_bold(player_ptr, y, x)) {
break;
+ }
g_ptr->info &= ~(CAVE_UNSAFE);
lite_spot(player_ptr, y, x);
break;
}
case AttributeType::JAM_DOOR: {
- if (f_ptr->flags.has_not(FloorFeatureType::SPIKE))
+ if (f_ptr->flags.has_not(FloorFeatureType::SPIKE)) {
break;
+ }
int16_t old_mimic = g_ptr->mimic;
feature_type *mimic_f_ptr = &f_info[g_ptr->get_feat_mimic()];
note_spot(player_ptr, y, x);
lite_spot(player_ptr, y, x);
- if (!known || mimic_f_ptr->flags.has_not(FloorFeatureType::OPEN))
+ if (!known || mimic_f_ptr->flags.has_not(FloorFeatureType::OPEN)) {
break;
+ }
msg_format(_("%sに何かがつっかえて開かなくなった。", "The %s seems stuck."), mimic_f_ptr->name.c_str());
obvious = true;
break;
}
case AttributeType::KILL_WALL: {
- if (f_ptr->flags.has_not(FloorFeatureType::HURT_ROCK))
+ if (f_ptr->flags.has_not(FloorFeatureType::HURT_ROCK)) {
break;
+ }
if (known && g_ptr->is_mark()) {
msg_format(_("%sが溶けて泥になった!", "The %s turns into mud!"), f_info[g_ptr->get_feat_mimic()].name.c_str());
break;
}
case AttributeType::MAKE_DOOR: {
- if (!cave_naked_bold(player_ptr, y, x))
+ if (!cave_naked_bold(player_ptr, y, x)) {
break;
- if (player_bold(player_ptr, y, x))
+ }
+ if (player_bold(player_ptr, y, x)) {
break;
+ }
cave_set_feat(player_ptr, y, x, feat_door[DOOR_DOOR].closed);
- if (g_ptr->is_mark())
+ if (g_ptr->is_mark()) {
obvious = true;
+ }
break;
}
case AttributeType::MAKE_TRAP: {
break;
}
case AttributeType::MAKE_TREE: {
- if (!cave_naked_bold(player_ptr, y, x))
+ if (!cave_naked_bold(player_ptr, y, x)) {
break;
- if (player_bold(player_ptr, y, x))
+ }
+ if (player_bold(player_ptr, y, x)) {
break;
+ }
cave_set_feat(player_ptr, y, x, feat_tree);
- if (g_ptr->is_mark())
+ if (g_ptr->is_mark()) {
obvious = true;
+ }
break;
}
case AttributeType::MAKE_RUNE_PROTECTION: {
- if (!cave_naked_bold(player_ptr, y, x))
+ if (!cave_naked_bold(player_ptr, y, x)) {
break;
+ }
g_ptr->info |= CAVE_OBJECT;
g_ptr->mimic = feat_rune_protection;
note_spot(player_ptr, y, x);
break;
}
case AttributeType::STONE_WALL: {
- if (!cave_naked_bold(player_ptr, y, x))
+ if (!cave_naked_bold(player_ptr, y, x)) {
break;
- if (player_bold(player_ptr, y, x))
+ }
+ if (player_bold(player_ptr, y, x)) {
break;
+ }
cave_set_feat(player_ptr, y, x, feat_granite);
break;
}
case AttributeType::LAVA_FLOW: {
- if (f_ptr->flags.has(FloorFeatureType::PERMANENT))
+ if (f_ptr->flags.has(FloorFeatureType::PERMANENT)) {
break;
+ }
if (dam == 1) {
- if (f_ptr->flags.has_not(FloorFeatureType::FLOOR))
+ if (f_ptr->flags.has_not(FloorFeatureType::FLOOR)) {
break;
+ }
cave_set_feat(player_ptr, y, x, feat_shallow_lava);
} else if (dam) {
cave_set_feat(player_ptr, y, x, feat_deep_lava);
break;
}
case AttributeType::WATER_FLOW: {
- if (f_ptr->flags.has(FloorFeatureType::PERMANENT))
+ if (f_ptr->flags.has(FloorFeatureType::PERMANENT)) {
break;
+ }
if (dam == 1) {
- if (f_ptr->flags.has_not(FloorFeatureType::FLOOR))
+ if (f_ptr->flags.has_not(FloorFeatureType::FLOOR)) {
break;
+ }
cave_set_feat(player_ptr, y, x, feat_shallow_water);
} else if (dam) {
cave_set_feat(player_ptr, y, x, feat_deep_water);
}
case AttributeType::LITE_WEAK:
case AttributeType::LITE: {
- if (d_info[player_ptr->dungeon_idx].flags.has(DungeonFeatureType::DARKNESS))
+ if (d_info[player_ptr->dungeon_idx].flags.has(DungeonFeatureType::DARKNESS)) {
break;
+ }
g_ptr->info |= (CAVE_GLOW);
note_spot(player_ptr, y, x);
lite_spot(player_ptr, y, x);
update_local_illumination(player_ptr, y, x);
- if (player_can_see_bold(player_ptr, y, x))
+ if (player_can_see_bold(player_ptr, y, x)) {
obvious = true;
- if (g_ptr->m_idx)
+ }
+ if (g_ptr->m_idx) {
update_monster(player_ptr, g_ptr->m_idx, false);
+ }
if (player_bold(player_ptr, y, x)) {
set_superstealth(player_ptr, false);
case AttributeType::DARK:
case AttributeType::ABYSS: {
bool do_dark = !player_ptr->phase_out && !g_ptr->is_mirror();
- if (!do_dark)
+ if (!do_dark) {
break;
+ }
if ((floor_ptr->dun_level > 0) || !is_daytime()) {
for (int j = 0; j < 9; j++) {
int by = y + ddy_ddd[j];
int bx = x + ddx_ddd[j];
- if (!in_bounds2(floor_ptr, by, bx))
+ if (!in_bounds2(floor_ptr, by, bx)) {
continue;
+ }
grid_type *cc_ptr = &floor_ptr->grid_array[by][bx];
if (f_info[cc_ptr->get_feat_mimic()].flags.has(FloorFeatureType::GLOW)) {
}
}
- if (!do_dark)
+ if (!do_dark) {
break;
+ }
}
g_ptr->info &= ~(CAVE_GLOW);
update_local_illumination(player_ptr, y, x);
- if (player_can_see_bold(player_ptr, y, x))
+ if (player_can_see_bold(player_ptr, y, x)) {
obvious = true;
- if (g_ptr->m_idx)
+ }
+ if (g_ptr->m_idx) {
update_monster(player_ptr, g_ptr->m_idx, false);
+ }
break;
}
(PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI));
}
- if (f_ptr->flags.has_not(FloorFeatureType::GLASS) || f_ptr->flags.has(FloorFeatureType::PERMANENT) || (dam < 50))
+ if (f_ptr->flags.has_not(FloorFeatureType::GLASS) || f_ptr->flags.has(FloorFeatureType::PERMANENT) || (dam < 50)) {
break;
+ }
if (known && (g_ptr->is_mark())) {
msg_format(_("%sが割れた!", "The %s crumbled!"), f_info[g_ptr->get_feat_mimic()].name.c_str());
(PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI));
}
- if (f_ptr->flags.has_not(FloorFeatureType::GLASS) || f_ptr->flags.has(FloorFeatureType::PERMANENT) || (dam < 200))
+ if (f_ptr->flags.has_not(FloorFeatureType::GLASS) || f_ptr->flags.has(FloorFeatureType::PERMANENT) || (dam < 200)) {
break;
+ }
if (known && (g_ptr->is_mark())) {
msg_format(_("%sが割れた!", "The %s crumbled!"), f_info[g_ptr->get_feat_mimic()].name.c_str());
break;
}
case AttributeType::DISINTEGRATE: {
- if (g_ptr->is_mirror() || g_ptr->is_rune_protection() || g_ptr->is_rune_explosion())
+ if (g_ptr->is_mirror() || g_ptr->is_rune_protection() || g_ptr->is_rune_explosion()) {
remove_mirror(player_ptr, y, x);
+ }
- if (f_ptr->flags.has_not(FloorFeatureType::HURT_DISI) || f_ptr->flags.has(FloorFeatureType::PERMANENT))
+ if (f_ptr->flags.has_not(FloorFeatureType::HURT_DISI) || f_ptr->flags.has(FloorFeatureType::PERMANENT)) {
break;
+ }
cave_alter_feat(player_ptr, y, x, FloorFeatureType::HURT_DISI);
player_ptr->update |= (PU_FLOW);
*/
process_result effect_monster_nothing(effect_monster_type *em_ptr)
{
- if (em_ptr->seen)
+ if (em_ptr->seen) {
em_ptr->obvious = true;
+ }
return PROCESS_CONTINUE;
}
process_result effect_monster_acid(PlayerType *player_ptr, effect_monster_type *em_ptr)
{
- if (em_ptr->seen)
+ if (em_ptr->seen) {
em_ptr->obvious = true;
+ }
- if ((em_ptr->r_ptr->flagsr & RFR_IM_ACID) == 0)
+ if ((em_ptr->r_ptr->flagsr & RFR_IM_ACID) == 0) {
return PROCESS_CONTINUE;
+ }
em_ptr->note = _("にはかなり耐性がある!", " resists a lot.");
em_ptr->dam /= 9;
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
em_ptr->r_ptr->r_flagsr |= (RFR_IM_ACID);
+ }
return PROCESS_CONTINUE;
}
process_result effect_monster_elec(PlayerType *player_ptr, effect_monster_type *em_ptr)
{
- if (em_ptr->seen)
+ if (em_ptr->seen) {
em_ptr->obvious = true;
+ }
- if ((em_ptr->r_ptr->flagsr & RFR_IM_ELEC) == 0)
+ if ((em_ptr->r_ptr->flagsr & RFR_IM_ELEC) == 0) {
return PROCESS_CONTINUE;
+ }
em_ptr->note = _("にはかなり耐性がある!", " resists a lot.");
em_ptr->dam /= 9;
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
em_ptr->r_ptr->r_flagsr |= (RFR_IM_ELEC);
+ }
return PROCESS_CONTINUE;
}
process_result effect_monster_fire(PlayerType *player_ptr, effect_monster_type *em_ptr)
{
- if (em_ptr->seen)
+ if (em_ptr->seen) {
em_ptr->obvious = true;
+ }
if (em_ptr->r_ptr->flagsr & RFR_IM_FIRE) {
em_ptr->note = _("にはかなり耐性がある!", " resists a lot.");
em_ptr->dam /= 9;
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
em_ptr->r_ptr->r_flagsr |= (RFR_IM_FIRE);
+ }
return PROCESS_CONTINUE;
}
- if ((em_ptr->r_ptr->flags3 & (RF3_HURT_FIRE)) == 0)
+ if ((em_ptr->r_ptr->flags3 & (RF3_HURT_FIRE)) == 0) {
return PROCESS_CONTINUE;
+ }
em_ptr->note = _("はひどい痛手をうけた。", " is hit hard.");
em_ptr->dam *= 2;
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
em_ptr->r_ptr->r_flags3 |= (RF3_HURT_FIRE);
+ }
return PROCESS_CONTINUE;
}
process_result effect_monster_cold(PlayerType *player_ptr, effect_monster_type *em_ptr)
{
- if (em_ptr->seen)
+ if (em_ptr->seen) {
em_ptr->obvious = true;
+ }
if (em_ptr->r_ptr->flagsr & RFR_IM_COLD) {
em_ptr->note = _("にはかなり耐性がある!", " resists a lot.");
em_ptr->dam /= 9;
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
em_ptr->r_ptr->r_flagsr |= (RFR_IM_COLD);
+ }
return PROCESS_CONTINUE;
}
- if ((em_ptr->r_ptr->flags3 & (RF3_HURT_COLD)) == 0)
+ if ((em_ptr->r_ptr->flags3 & (RF3_HURT_COLD)) == 0) {
return PROCESS_CONTINUE;
+ }
em_ptr->note = _("はひどい痛手をうけた。", " is hit hard.");
em_ptr->dam *= 2;
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
em_ptr->r_ptr->r_flags3 |= (RF3_HURT_COLD);
+ }
return PROCESS_CONTINUE;
}
process_result effect_monster_pois(PlayerType *player_ptr, effect_monster_type *em_ptr)
{
- if (em_ptr->seen)
+ if (em_ptr->seen) {
em_ptr->obvious = true;
+ }
- if ((em_ptr->r_ptr->flagsr & RFR_IM_POIS) == 0)
+ if ((em_ptr->r_ptr->flagsr & RFR_IM_POIS) == 0) {
return PROCESS_CONTINUE;
+ }
em_ptr->note = _("にはかなり耐性がある!", " resists a lot.");
em_ptr->dam /= 9;
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
em_ptr->r_ptr->r_flagsr |= (RFR_IM_POIS);
+ }
return PROCESS_CONTINUE;
}
process_result effect_monster_nuke(PlayerType *player_ptr, effect_monster_type *em_ptr)
{
- if (em_ptr->seen)
+ if (em_ptr->seen) {
em_ptr->obvious = true;
+ }
if (em_ptr->r_ptr->flagsr & RFR_IM_POIS) {
em_ptr->note = _("には耐性がある。", " resists.");
em_ptr->dam *= 3;
em_ptr->dam /= randint1(6) + 6;
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
em_ptr->r_ptr->r_flagsr |= (RFR_IM_POIS);
+ }
return PROCESS_CONTINUE;
}
- if (one_in_(3))
+ if (one_in_(3)) {
em_ptr->do_polymorph = true;
+ }
return PROCESS_CONTINUE;
}
process_result effect_monster_hell_fire(PlayerType *player_ptr, effect_monster_type *em_ptr)
{
- if (em_ptr->seen)
+ if (em_ptr->seen) {
em_ptr->obvious = true;
+ }
- if ((em_ptr->r_ptr->flags3 & RF3_GOOD) == 0)
+ if ((em_ptr->r_ptr->flags3 & RF3_GOOD) == 0) {
return PROCESS_CONTINUE;
+ }
em_ptr->note = _("はひどい痛手をうけた。", " is hit hard.");
em_ptr->dam *= 2;
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
em_ptr->r_ptr->r_flags3 |= RF3_GOOD;
+ }
return PROCESS_CONTINUE;
}
process_result effect_monster_holy_fire(PlayerType *player_ptr, effect_monster_type *em_ptr)
{
- if (em_ptr->seen)
+ if (em_ptr->seen) {
em_ptr->obvious = true;
+ }
if (any_bits(em_ptr->r_ptr->flags3, RF3_GOOD)) {
em_ptr->note = _("には完全な耐性がある!", " is immune.");
em_ptr->dam = 0;
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
set_bits(em_ptr->r_ptr->r_flags3, RF3_GOOD);
+ }
return PROCESS_CONTINUE;
}
if (any_bits(em_ptr->r_ptr->flags3, RF3_EVIL)) {
em_ptr->dam *= 2;
em_ptr->note = _("はひどい痛手をうけた。", " is hit hard.");
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
set_bits(em_ptr->r_ptr->r_flags3, RF3_EVIL);
+ }
return PROCESS_CONTINUE;
}
process_result effect_monster_plasma(PlayerType *player_ptr, effect_monster_type *em_ptr)
{
- if (em_ptr->seen)
+ if (em_ptr->seen) {
em_ptr->obvious = true;
+ }
- if ((em_ptr->r_ptr->flagsr & RFR_RES_PLAS) == 0)
+ if ((em_ptr->r_ptr->flagsr & RFR_RES_PLAS) == 0) {
return PROCESS_CONTINUE;
+ }
em_ptr->note = _("には耐性がある。", " resists.");
em_ptr->dam *= 3;
em_ptr->dam /= randint1(6) + 6;
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
em_ptr->r_ptr->r_flagsr |= (RFR_RES_PLAS);
+ }
return PROCESS_CONTINUE;
}
static bool effect_monster_nether_resist(PlayerType *player_ptr, effect_monster_type *em_ptr)
{
- if ((em_ptr->r_ptr->flagsr & RFR_RES_NETH) == 0)
+ if ((em_ptr->r_ptr->flagsr & RFR_RES_NETH) == 0) {
return false;
+ }
if (em_ptr->r_ptr->flags3 & RF3_UNDEAD) {
em_ptr->note = _("には完全な耐性がある!", " is immune.");
em_ptr->dam = 0;
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
em_ptr->r_ptr->r_flags3 |= (RF3_UNDEAD);
+ }
} else {
em_ptr->note = _("には耐性がある。", " resists.");
em_ptr->dam *= 3;
em_ptr->dam /= randint1(6) + 6;
}
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
em_ptr->r_ptr->r_flagsr |= (RFR_RES_NETH);
+ }
return true;
}
process_result effect_monster_nether(PlayerType *player_ptr, effect_monster_type *em_ptr)
{
- if (em_ptr->seen)
+ if (em_ptr->seen) {
em_ptr->obvious = true;
+ }
- if (effect_monster_nether_resist(player_ptr, em_ptr) || ((em_ptr->r_ptr->flags3 & RF3_EVIL) == 0))
+ if (effect_monster_nether_resist(player_ptr, em_ptr) || ((em_ptr->r_ptr->flags3 & RF3_EVIL) == 0)) {
return PROCESS_CONTINUE;
+ }
em_ptr->note = _("はいくらか耐性を示した。", " resists somewhat.");
em_ptr->dam /= 2;
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
em_ptr->r_ptr->r_flags3 |= (RF3_EVIL);
+ }
return PROCESS_CONTINUE;
}
process_result effect_monster_water(PlayerType *player_ptr, effect_monster_type *em_ptr)
{
- if (em_ptr->seen)
+ if (em_ptr->seen) {
em_ptr->obvious = true;
+ }
- if ((em_ptr->r_ptr->flagsr & RFR_RES_WATE) == 0)
+ if ((em_ptr->r_ptr->flagsr & RFR_RES_WATE) == 0) {
return PROCESS_CONTINUE;
+ }
if ((em_ptr->m_ptr->r_idx == MON_WATER_ELEM) || (em_ptr->m_ptr->r_idx == MON_UNMAKER)) {
em_ptr->note = _("には完全な耐性がある!", " is immune.");
em_ptr->dam /= randint1(6) + 6;
}
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
em_ptr->r_ptr->r_flagsr |= (RFR_RES_WATE);
+ }
return PROCESS_CONTINUE;
}
process_result effect_monster_chaos(PlayerType *player_ptr, effect_monster_type *em_ptr)
{
- if (em_ptr->seen)
+ if (em_ptr->seen) {
em_ptr->obvious = true;
+ }
if (em_ptr->r_ptr->flagsr & RFR_RES_CHAO) {
em_ptr->note = _("には耐性がある。", " resists.");
em_ptr->dam *= 3;
em_ptr->dam /= randint1(6) + 6;
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
em_ptr->r_ptr->r_flagsr |= (RFR_RES_CHAO);
+ }
} else if ((em_ptr->r_ptr->flags3 & RF3_DEMON) && one_in_(3)) {
em_ptr->note = _("はいくらか耐性を示した。", " resists somewhat.");
em_ptr->dam *= 3;
em_ptr->dam /= randint1(6) + 6;
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
em_ptr->r_ptr->r_flags3 |= (RF3_DEMON);
+ }
} else {
em_ptr->do_polymorph = true;
em_ptr->do_conf = (5 + randint1(11) + em_ptr->r) / (em_ptr->r + 1);
process_result effect_monster_shards(PlayerType *player_ptr, effect_monster_type *em_ptr)
{
- if (em_ptr->seen)
+ if (em_ptr->seen) {
em_ptr->obvious = true;
+ }
- if ((em_ptr->r_ptr->flagsr & RFR_RES_SHAR) == 0)
+ if ((em_ptr->r_ptr->flagsr & RFR_RES_SHAR) == 0) {
return PROCESS_CONTINUE;
+ }
em_ptr->note = _("には耐性がある。", " resists.");
em_ptr->dam *= 3;
em_ptr->dam /= randint1(6) + 6;
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
em_ptr->r_ptr->r_flagsr |= (RFR_RES_SHAR);
+ }
return PROCESS_CONTINUE;
}
process_result effect_monster_rocket(PlayerType *player_ptr, effect_monster_type *em_ptr)
{
- if (em_ptr->seen)
+ if (em_ptr->seen) {
em_ptr->obvious = true;
+ }
- if ((em_ptr->r_ptr->flagsr & RFR_RES_SHAR) == 0)
+ if ((em_ptr->r_ptr->flagsr & RFR_RES_SHAR) == 0) {
return PROCESS_CONTINUE;
+ }
em_ptr->note = _("はいくらか耐性を示した。", " resists somewhat.");
em_ptr->dam /= 2;
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
em_ptr->r_ptr->r_flagsr |= (RFR_RES_SHAR);
+ }
return PROCESS_CONTINUE;
}
process_result effect_monster_sound(PlayerType *player_ptr, effect_monster_type *em_ptr)
{
- if (em_ptr->seen)
+ if (em_ptr->seen) {
em_ptr->obvious = true;
+ }
if ((em_ptr->r_ptr->flagsr & RFR_RES_SOUN) == 0) {
em_ptr->do_stun = (10 + randint1(15) + em_ptr->r) / (em_ptr->r + 1);
em_ptr->note = _("には耐性がある。", " resists.");
em_ptr->dam *= 2;
em_ptr->dam /= randint1(6) + 6;
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
em_ptr->r_ptr->r_flagsr |= (RFR_RES_SOUN);
+ }
return PROCESS_CONTINUE;
}
process_result effect_monster_confusion(PlayerType *player_ptr, effect_monster_type *em_ptr)
{
- if (em_ptr->seen)
+ if (em_ptr->seen) {
em_ptr->obvious = true;
+ }
if ((em_ptr->r_ptr->flags3 & RF3_NO_CONF) == 0) {
em_ptr->do_conf = (10 + randint1(15) + em_ptr->r) / (em_ptr->r + 1);
em_ptr->note = _("には耐性がある。", " resists.");
em_ptr->dam *= 3;
em_ptr->dam /= randint1(6) + 6;
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
em_ptr->r_ptr->r_flags3 |= (RF3_NO_CONF);
+ }
return PROCESS_CONTINUE;
}
process_result effect_monster_disenchant(PlayerType *player_ptr, effect_monster_type *em_ptr)
{
- if (em_ptr->seen)
+ if (em_ptr->seen) {
em_ptr->obvious = true;
+ }
- if ((em_ptr->r_ptr->flagsr & RFR_RES_DISE) == 0)
+ if ((em_ptr->r_ptr->flagsr & RFR_RES_DISE) == 0) {
return PROCESS_CONTINUE;
+ }
em_ptr->note = _("には耐性がある。", " resists.");
em_ptr->dam *= 3;
em_ptr->dam /= randint1(6) + 6;
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
em_ptr->r_ptr->r_flagsr |= (RFR_RES_DISE);
+ }
return PROCESS_CONTINUE;
}
process_result effect_monster_nexus(PlayerType *player_ptr, effect_monster_type *em_ptr)
{
- if (em_ptr->seen)
+ if (em_ptr->seen) {
em_ptr->obvious = true;
+ }
- if ((em_ptr->r_ptr->flagsr & RFR_RES_NEXU) == 0)
+ if ((em_ptr->r_ptr->flagsr & RFR_RES_NEXU) == 0) {
return PROCESS_CONTINUE;
+ }
em_ptr->note = _("には耐性がある。", " resists.");
em_ptr->dam *= 3;
em_ptr->dam /= randint1(6) + 6;
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
em_ptr->r_ptr->r_flagsr |= (RFR_RES_NEXU);
+ }
return PROCESS_CONTINUE;
}
process_result effect_monster_force(PlayerType *player_ptr, effect_monster_type *em_ptr)
{
- if (em_ptr->seen)
+ if (em_ptr->seen) {
em_ptr->obvious = true;
+ }
if ((em_ptr->r_ptr->flagsr & RFR_RES_WALL) == 0) {
em_ptr->do_stun = (randint1(15) + em_ptr->r) / (em_ptr->r + 1);
em_ptr->note = _("には耐性がある。", " resists.");
em_ptr->dam *= 3;
em_ptr->dam /= randint1(6) + 6;
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
em_ptr->r_ptr->r_flagsr |= (RFR_RES_WALL);
+ }
return PROCESS_CONTINUE;
}
// Powerful monsters can resists and normal monsters slow down.
process_result effect_monster_inertial(PlayerType *player_ptr, effect_monster_type *em_ptr)
{
- if (em_ptr->seen)
+ if (em_ptr->seen) {
em_ptr->obvious = true;
+ }
if (em_ptr->r_ptr->flagsr & RFR_RES_INER) {
em_ptr->note = _("には耐性がある。", " resists.");
em_ptr->dam *= 3;
em_ptr->dam /= randint1(6) + 6;
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
em_ptr->r_ptr->r_flagsr |= (RFR_RES_INER);
+ }
return PROCESS_CONTINUE;
}
return PROCESS_CONTINUE;
}
- if (set_monster_slow(player_ptr, em_ptr->g_ptr->m_idx, monster_slow_remaining(em_ptr->m_ptr) + 50))
+ if (set_monster_slow(player_ptr, em_ptr->g_ptr->m_idx, monster_slow_remaining(em_ptr->m_ptr) + 50)) {
em_ptr->note = _("の動きが遅くなった。", " starts moving slower.");
+ }
return PROCESS_CONTINUE;
}
process_result effect_monster_time(PlayerType *player_ptr, effect_monster_type *em_ptr)
{
- if (em_ptr->seen)
+ if (em_ptr->seen) {
em_ptr->obvious = true;
+ }
if ((em_ptr->r_ptr->flagsr & RFR_RES_TIME) == 0) {
em_ptr->do_time = (em_ptr->dam + 1) / 2;
em_ptr->note = _("には耐性がある。", " resists.");
em_ptr->dam *= 3;
em_ptr->dam /= randint1(6) + 6;
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
em_ptr->r_ptr->r_flagsr |= (RFR_RES_TIME);
+ }
return PROCESS_CONTINUE;
}
static bool effect_monster_gravity_resist_teleport(PlayerType *player_ptr, effect_monster_type *em_ptr)
{
- if (em_ptr->seen)
+ if (em_ptr->seen) {
em_ptr->obvious = true;
+ }
- if ((em_ptr->r_ptr->flagsr & RFR_RES_TELE) == 0)
+ if ((em_ptr->r_ptr->flagsr & RFR_RES_TELE) == 0) {
return false;
+ }
if (em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) {
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
em_ptr->r_ptr->r_flagsr |= RFR_RES_TELE;
+ }
em_ptr->note = _("には効果がなかった。", " is unaffected!");
return true;
}
- if (em_ptr->r_ptr->level <= randint1(100))
+ if (em_ptr->r_ptr->level <= randint1(100)) {
return false;
+ }
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
em_ptr->r_ptr->r_flagsr |= RFR_RES_TELE;
+ }
em_ptr->note = _("には耐性がある!", " resists!");
return true;
static void effect_monster_gravity_slow(PlayerType *player_ptr, effect_monster_type *em_ptr)
{
- if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) || (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
+ if ((em_ptr->r_ptr->flags1 & (RF1_UNIQUE)) || (em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10)) {
em_ptr->obvious = false;
+ }
- if (set_monster_slow(player_ptr, em_ptr->g_ptr->m_idx, monster_slow_remaining(em_ptr->m_ptr) + 50))
+ if (set_monster_slow(player_ptr, em_ptr->g_ptr->m_idx, monster_slow_remaining(em_ptr->m_ptr) + 50)) {
em_ptr->note = _("の動きが遅くなった。", " starts moving slower.");
+ }
}
static void effect_monster_gravity_stun(effect_monster_type *em_ptr)
process_result effect_monster_gravity(PlayerType *player_ptr, effect_monster_type *em_ptr)
{
em_ptr->do_dist = effect_monster_gravity_resist_teleport(player_ptr, em_ptr) ? 0 : 10;
- if (player_ptr->riding && (em_ptr->g_ptr->m_idx == player_ptr->riding))
+ if (player_ptr->riding && (em_ptr->g_ptr->m_idx == player_ptr->riding)) {
em_ptr->do_dist = 0;
+ }
if (em_ptr->r_ptr->flagsr & RFR_RES_GRAV) {
em_ptr->note = _("には耐性がある!", " resists!");
em_ptr->dam *= 3;
em_ptr->dam /= randint1(6) + 6;
em_ptr->do_dist = 0;
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
em_ptr->r_ptr->r_flagsr |= (RFR_RES_GRAV);
+ }
return PROCESS_CONTINUE;
}
process_result effect_monster_disintegration(PlayerType *player_ptr, effect_monster_type *em_ptr)
{
- if (em_ptr->seen)
+ if (em_ptr->seen) {
em_ptr->obvious = true;
+ }
- if ((em_ptr->r_ptr->flags3 & RF3_HURT_ROCK) == 0)
+ if ((em_ptr->r_ptr->flags3 & RF3_HURT_ROCK) == 0) {
return PROCESS_CONTINUE;
+ }
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
em_ptr->r_ptr->r_flags3 |= (RF3_HURT_ROCK);
+ }
em_ptr->note = _("の皮膚がただれた!", " loses some skin!");
em_ptr->note_dies = _("は蒸発した!", " evaporates!");
process_result effect_monster_icee_bolt(PlayerType *player_ptr, effect_monster_type *em_ptr)
{
- if (em_ptr->seen)
+ if (em_ptr->seen) {
em_ptr->obvious = true;
+ }
em_ptr->do_stun = (randint1(15) + 1) / (em_ptr->r + 1);
if (em_ptr->r_ptr->flagsr & RFR_IM_COLD) {
em_ptr->note = _("にはかなり耐性がある!", " resists a lot.");
em_ptr->dam /= 9;
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
em_ptr->r_ptr->r_flagsr |= (RFR_IM_COLD);
+ }
} else if (em_ptr->r_ptr->flags3 & (RF3_HURT_COLD)) {
em_ptr->note = _("はひどい痛手をうけた。", " is hit hard.");
em_ptr->dam *= 2;
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
em_ptr->r_ptr->r_flags3 |= (RF3_HURT_COLD);
+ }
}
return PROCESS_CONTINUE;
*/
process_result effect_monster_void(PlayerType *player_ptr, effect_monster_type *em_ptr)
{
- if (em_ptr->seen)
+ if (em_ptr->seen) {
em_ptr->obvious = true;
+ }
if (any_bits(em_ptr->r_ptr->flags2, RF2_QUANTUM)) {
em_ptr->note = _("の存在確率が減少した。", "'s wave function is reduced.");
em_ptr->note_dies = _("は観測されなくなった。", "'s wave function collapses.");
em_ptr->dam *= 2;
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
set_bits(em_ptr->r_ptr->r_flags2, RF2_QUANTUM);
+ }
} else if (any_bits(em_ptr->r_ptr->flags2, RF2_PASS_WALL)) {
em_ptr->note = _("の存在が薄れていく。", "is fading out.");
em_ptr->note_dies = _("は消えてしまった。", "has disappeared.");
em_ptr->dam *= 3;
em_ptr->dam /= 2;
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
set_bits(em_ptr->r_ptr->r_flags2, RF2_PASS_WALL);
+ }
} else if (any_bits(em_ptr->r_ptr->flagsr, RFR_RES_TELE | RFR_RES_WALL | RFR_RES_GRAV)) {
em_ptr->note = _("には耐性がある!", " resists!");
em_ptr->dam *= 3;
em_ptr->dam /= randint1(6) + 6;
if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
- if (any_bits(em_ptr->r_ptr->flagsr, RFR_RES_TELE))
+ if (any_bits(em_ptr->r_ptr->flagsr, RFR_RES_TELE)) {
set_bits(em_ptr->r_ptr->r_flagsr, RFR_RES_TELE);
- if (any_bits(em_ptr->r_ptr->flagsr, RFR_RES_WALL))
+ }
+ if (any_bits(em_ptr->r_ptr->flagsr, RFR_RES_WALL)) {
set_bits(em_ptr->r_ptr->r_flagsr, RFR_RES_WALL);
- if (any_bits(em_ptr->r_ptr->flagsr, RFR_RES_GRAV))
+ }
+ if (any_bits(em_ptr->r_ptr->flagsr, RFR_RES_GRAV)) {
set_bits(em_ptr->r_ptr->r_flagsr, RFR_RES_GRAV);
+ }
}
- } else
+ } else {
em_ptr->note_dies = _("は消滅してしまった。", "has vanished.");
+ }
return PROCESS_CONTINUE;
}
*/
process_result effect_monster_abyss(PlayerType *player_ptr, effect_monster_type *em_ptr)
{
- if (em_ptr->seen)
+ if (em_ptr->seen) {
em_ptr->obvious = true;
+ }
BIT_FLAGS dark = RF7_SELF_DARK_1 | RF7_SELF_DARK_2 | RF7_HAS_DARK_1 | RF7_HAS_DARK_2;
em_ptr->note = _("には耐性がある!", " resists!");
em_ptr->dam *= 3;
em_ptr->dam /= (randint1(4) + 5);
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
em_ptr->r_ptr->r_flagsr |= (RFR_RES_DARK);
+ }
} else if (!any_bits(em_ptr->r_ptr->flags7, RF7_CAN_FLY)) {
if (any_bits(em_ptr->r_ptr->flagsr, RFR_RES_TELE)) {
em_ptr->dam *= 5;
em_ptr->dam /= 4;
- if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr))
+ if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
set_bits(em_ptr->r_ptr->r_flagsr, RFR_RES_TELE);
+ }
}
em_ptr->note = _("は深淵に囚われていく。", " is trapped in the abyss.");
em_ptr->note_dies = _("は深淵に堕ちてしまった。", " has fallen into the abyss.");
- if (one_in_(3) && set_monster_slow(player_ptr, em_ptr->g_ptr->m_idx, monster_slow_remaining(em_ptr->m_ptr) + 50))
+ if (one_in_(3) && set_monster_slow(player_ptr, em_ptr->g_ptr->m_idx, monster_slow_remaining(em_ptr->m_ptr) + 50)) {
em_ptr->note = _("の動きが遅くなった。", " starts moving slower.");
+ }
}
- if (any_bits(em_ptr->r_ptr->flags2, RF2_ELDRITCH_HORROR) || any_bits(em_ptr->r_ptr->flags2, RF2_EMPTY_MIND))
+ if (any_bits(em_ptr->r_ptr->flags2, RF2_ELDRITCH_HORROR) || any_bits(em_ptr->r_ptr->flags2, RF2_EMPTY_MIND)) {
return PROCESS_CONTINUE;
+ }
if (one_in_(3)) {
- if (one_in_(2))
+ if (one_in_(2)) {
em_ptr->do_conf = (10 + randint1(15) + em_ptr->r) / (em_ptr->r + 1);
- else
+ } else {
em_ptr->do_fear = (10 + randint1(15) + em_ptr->r) / (em_ptr->r + 1);
+ }
}
return PROCESS_CONTINUE;
void add_cheat_remove_flags_others(PlayerType *player_ptr, msr_type *msr_ptr)
{
- if (has_resist_neth(player_ptr))
+ if (has_resist_neth(player_ptr)) {
msr_ptr->smart.set(MonsterSmartLearnType::RES_NETH);
+ }
- if (has_resist_lite(player_ptr))
+ if (has_resist_lite(player_ptr)) {
msr_ptr->smart.set(MonsterSmartLearnType::RES_LITE);
+ }
- if (has_resist_dark(player_ptr))
+ if (has_resist_dark(player_ptr)) {
msr_ptr->smart.set(MonsterSmartLearnType::RES_DARK);
+ }
- if (has_resist_fear(player_ptr))
+ if (has_resist_fear(player_ptr)) {
msr_ptr->smart.set(MonsterSmartLearnType::RES_FEAR);
+ }
- if (has_resist_conf(player_ptr))
+ if (has_resist_conf(player_ptr)) {
msr_ptr->smart.set(MonsterSmartLearnType::RES_CONF);
+ }
- if (has_resist_chaos(player_ptr))
+ if (has_resist_chaos(player_ptr)) {
msr_ptr->smart.set(MonsterSmartLearnType::RES_CHAOS);
+ }
- if (has_resist_disen(player_ptr))
+ if (has_resist_disen(player_ptr)) {
msr_ptr->smart.set(MonsterSmartLearnType::RES_DISEN);
+ }
- if (has_resist_blind(player_ptr))
+ if (has_resist_blind(player_ptr)) {
msr_ptr->smart.set(MonsterSmartLearnType::RES_BLIND);
+ }
- if (has_resist_nexus(player_ptr))
+ if (has_resist_nexus(player_ptr)) {
msr_ptr->smart.set(MonsterSmartLearnType::RES_NEXUS);
+ }
- if (has_resist_sound(player_ptr))
+ if (has_resist_sound(player_ptr)) {
msr_ptr->smart.set(MonsterSmartLearnType::RES_SOUND);
+ }
- if (has_resist_shard(player_ptr))
+ if (has_resist_shard(player_ptr)) {
msr_ptr->smart.set(MonsterSmartLearnType::RES_SHARD);
+ }
- if (has_reflect(player_ptr))
+ if (has_reflect(player_ptr)) {
msr_ptr->smart.set(MonsterSmartLearnType::IMM_REFLECT);
+ }
- if (player_ptr->free_act)
+ if (player_ptr->free_act) {
msr_ptr->smart.set(MonsterSmartLearnType::IMM_FREE);
+ }
- if (!player_ptr->msp)
+ if (!player_ptr->msp) {
msr_ptr->smart.set(MonsterSmartLearnType::IMM_MANA);
+ }
}
static void check_nether_resistance(PlayerType *player_ptr, msr_type *msr_ptr)
{
- if (msr_ptr->smart.has_not(MonsterSmartLearnType::RES_NETH))
+ if (msr_ptr->smart.has_not(MonsterSmartLearnType::RES_NETH)) {
return;
+ }
if (PlayerRace(player_ptr).equals(PlayerRaceType::SPECTRE)) {
msr_ptr->ability_flags.reset(MonsterAbilityType::BR_NETH);
return;
}
- if (int_outof(msr_ptr->r_ptr, 20))
+ if (int_outof(msr_ptr->r_ptr, 20)) {
msr_ptr->ability_flags.reset(MonsterAbilityType::BR_NETH);
+ }
- if (int_outof(msr_ptr->r_ptr, 50))
+ if (int_outof(msr_ptr->r_ptr, 50)) {
msr_ptr->ability_flags.reset(MonsterAbilityType::BA_NETH);
+ }
- if (int_outof(msr_ptr->r_ptr, 50))
+ if (int_outof(msr_ptr->r_ptr, 50)) {
msr_ptr->ability_flags.reset(MonsterAbilityType::BO_NETH);
+ }
}
static void check_lite_resistance(msr_type *msr_ptr)
{
- if (msr_ptr->smart.has_not(MonsterSmartLearnType::RES_LITE))
+ if (msr_ptr->smart.has_not(MonsterSmartLearnType::RES_LITE)) {
return;
+ }
- if (int_outof(msr_ptr->r_ptr, 50))
+ if (int_outof(msr_ptr->r_ptr, 50)) {
msr_ptr->ability_flags.reset(MonsterAbilityType::BR_LITE);
+ }
- if (int_outof(msr_ptr->r_ptr, 50))
+ if (int_outof(msr_ptr->r_ptr, 50)) {
msr_ptr->ability_flags.reset(MonsterAbilityType::BA_LITE);
+ }
}
static void check_dark_resistance(PlayerType *player_ptr, msr_type *msr_ptr)
{
- if (msr_ptr->smart.has_not(MonsterSmartLearnType::RES_DARK))
+ if (msr_ptr->smart.has_not(MonsterSmartLearnType::RES_DARK)) {
return;
+ }
if (PlayerRace(player_ptr).tr_flags().has(TR_IM_DARK)) {
msr_ptr->ability_flags.reset(MonsterAbilityType::BR_DARK);
return;
}
- if (int_outof(msr_ptr->r_ptr, 50))
+ if (int_outof(msr_ptr->r_ptr, 50)) {
msr_ptr->ability_flags.reset(MonsterAbilityType::BR_DARK);
+ }
- if (int_outof(msr_ptr->r_ptr, 50))
+ if (int_outof(msr_ptr->r_ptr, 50)) {
msr_ptr->ability_flags.reset(MonsterAbilityType::BA_DARK);
+ }
}
static void check_conf_resistance(msr_type *msr_ptr)
{
- if (msr_ptr->smart.has_not(MonsterSmartLearnType::RES_CONF))
+ if (msr_ptr->smart.has_not(MonsterSmartLearnType::RES_CONF)) {
return;
+ }
msr_ptr->ability_flags.reset(MonsterAbilityType::CONF);
- if (int_outof(msr_ptr->r_ptr, 50))
+ if (int_outof(msr_ptr->r_ptr, 50)) {
msr_ptr->ability_flags.reset(MonsterAbilityType::BR_CONF);
+ }
}
static void check_chaos_resistance(msr_type *msr_ptr)
{
- if (msr_ptr->smart.has_not(MonsterSmartLearnType::RES_CHAOS))
+ if (msr_ptr->smart.has_not(MonsterSmartLearnType::RES_CHAOS)) {
return;
+ }
- if (int_outof(msr_ptr->r_ptr, 20))
+ if (int_outof(msr_ptr->r_ptr, 20)) {
msr_ptr->ability_flags.reset(MonsterAbilityType::BR_CHAO);
+ }
- if (int_outof(msr_ptr->r_ptr, 50))
+ if (int_outof(msr_ptr->r_ptr, 50)) {
msr_ptr->ability_flags.reset(MonsterAbilityType::BA_CHAO);
+ }
}
static void check_nexus_resistance(msr_type *msr_ptr)
{
- if (msr_ptr->smart.has_not(MonsterSmartLearnType::RES_NEXUS))
+ if (msr_ptr->smart.has_not(MonsterSmartLearnType::RES_NEXUS)) {
return;
+ }
- if (int_outof(msr_ptr->r_ptr, 50))
+ if (int_outof(msr_ptr->r_ptr, 50)) {
msr_ptr->ability_flags.reset(MonsterAbilityType::BR_NEXU);
+ }
msr_ptr->ability_flags.reset(MonsterAbilityType::TELE_LEVEL);
}
static void check_reflection(msr_type *msr_ptr)
{
- if (msr_ptr->smart.has_not(MonsterSmartLearnType::IMM_REFLECT))
+ if (msr_ptr->smart.has_not(MonsterSmartLearnType::IMM_REFLECT)) {
return;
+ }
- if (int_outof(msr_ptr->r_ptr, 150))
+ if (int_outof(msr_ptr->r_ptr, 150)) {
msr_ptr->ability_flags.reset(MonsterAbilityType::BO_COLD);
+ }
- if (int_outof(msr_ptr->r_ptr, 150))
+ if (int_outof(msr_ptr->r_ptr, 150)) {
msr_ptr->ability_flags.reset(MonsterAbilityType::BO_FIRE);
+ }
- if (int_outof(msr_ptr->r_ptr, 150))
+ if (int_outof(msr_ptr->r_ptr, 150)) {
msr_ptr->ability_flags.reset(MonsterAbilityType::BO_ACID);
+ }
- if (int_outof(msr_ptr->r_ptr, 150))
+ if (int_outof(msr_ptr->r_ptr, 150)) {
msr_ptr->ability_flags.reset(MonsterAbilityType::BO_ELEC);
+ }
- if (int_outof(msr_ptr->r_ptr, 150))
+ if (int_outof(msr_ptr->r_ptr, 150)) {
msr_ptr->ability_flags.reset(MonsterAbilityType::BO_NETH);
+ }
- if (int_outof(msr_ptr->r_ptr, 150))
+ if (int_outof(msr_ptr->r_ptr, 150)) {
msr_ptr->ability_flags.reset(MonsterAbilityType::BO_WATE);
+ }
- if (int_outof(msr_ptr->r_ptr, 150))
+ if (int_outof(msr_ptr->r_ptr, 150)) {
msr_ptr->ability_flags.reset(MonsterAbilityType::BO_MANA);
+ }
- if (int_outof(msr_ptr->r_ptr, 150))
+ if (int_outof(msr_ptr->r_ptr, 150)) {
msr_ptr->ability_flags.reset(MonsterAbilityType::BO_PLAS);
+ }
- if (int_outof(msr_ptr->r_ptr, 150))
+ if (int_outof(msr_ptr->r_ptr, 150)) {
msr_ptr->ability_flags.reset(MonsterAbilityType::BO_ICEE);
+ }
- if (int_outof(msr_ptr->r_ptr, 150))
+ if (int_outof(msr_ptr->r_ptr, 150)) {
msr_ptr->ability_flags.reset(MonsterAbilityType::BO_VOID);
+ }
- if (int_outof(msr_ptr->r_ptr, 150))
+ if (int_outof(msr_ptr->r_ptr, 150)) {
msr_ptr->ability_flags.reset(MonsterAbilityType::BO_ABYSS);
+ }
- if (int_outof(msr_ptr->r_ptr, 150))
+ if (int_outof(msr_ptr->r_ptr, 150)) {
msr_ptr->ability_flags.reset(MonsterAbilityType::MISSILE);
+ }
}
void check_high_resistances(PlayerType *player_ptr, msr_type *msr_ptr)
check_nether_resistance(player_ptr, msr_ptr);
check_lite_resistance(msr_ptr);
check_dark_resistance(player_ptr, msr_ptr);
- if (msr_ptr->smart.has(MonsterSmartLearnType::RES_FEAR))
+ if (msr_ptr->smart.has(MonsterSmartLearnType::RES_FEAR)) {
msr_ptr->ability_flags.reset(MonsterAbilityType::SCARE);
+ }
check_conf_resistance(msr_ptr);
check_chaos_resistance(msr_ptr);
- if (msr_ptr->smart.has(MonsterSmartLearnType::RES_DISEN) && int_outof(msr_ptr->r_ptr, 40))
+ if (msr_ptr->smart.has(MonsterSmartLearnType::RES_DISEN) && int_outof(msr_ptr->r_ptr, 40)) {
msr_ptr->ability_flags.reset(MonsterAbilityType::BR_DISE);
+ }
- if (msr_ptr->smart.has(MonsterSmartLearnType::RES_BLIND))
+ if (msr_ptr->smart.has(MonsterSmartLearnType::RES_BLIND)) {
msr_ptr->ability_flags.reset(MonsterAbilityType::BLIND);
+ }
check_nexus_resistance(msr_ptr);
- if (msr_ptr->smart.has(MonsterSmartLearnType::RES_SOUND) && int_outof(msr_ptr->r_ptr, 50))
+ if (msr_ptr->smart.has(MonsterSmartLearnType::RES_SOUND) && int_outof(msr_ptr->r_ptr, 50)) {
msr_ptr->ability_flags.reset(MonsterAbilityType::BR_SOUN);
+ }
- if (msr_ptr->smart.has(MonsterSmartLearnType::RES_SHARD) && int_outof(msr_ptr->r_ptr, 40))
+ if (msr_ptr->smart.has(MonsterSmartLearnType::RES_SHARD) && int_outof(msr_ptr->r_ptr, 40)) {
msr_ptr->ability_flags.reset(MonsterAbilityType::BR_SHAR);
+ }
check_reflection(msr_ptr);
if (msr_ptr->smart.has(MonsterSmartLearnType::IMM_FREE)) {
msr_ptr->ability_flags.reset(MonsterAbilityType::SLOW);
}
- if (msr_ptr->smart.has(MonsterSmartLearnType::IMM_MANA))
+ if (msr_ptr->smart.has(MonsterSmartLearnType::IMM_MANA)) {
msr_ptr->ability_flags.reset(MonsterAbilityType::DRAIN_MANA);
+ }
}
#include "mspell/mspell-ball.h"
+#include "effect/attribute-types.h"
#include "effect/effect-processor.h"
#include "main/sound-of-music.h"
#include "mind/drs-types.h"
#include "mspell/mspell-damage-calculator.h"
#include "mspell/mspell-result.h"
#include "mspell/mspell-util.h"
-#include "mspell/mspell-result.h"
-#include "effect/attribute-types.h"
#include "system/floor-type-definition.h"
#include "system/monster-type-definition.h"
#include "system/player-type-definition.h"
const auto dam = monspell_damage(player_ptr, MonsterAbilityType::BA_NUKE, m_idx, DAM_ROLL);
const auto proj_res = breath(player_ptr, y, x, m_idx, AttributeType::NUKE, dam, 2, false, TARGET_TYPE);
- if (TARGET_TYPE == MONSTER_TO_PLAYER)
+ if (TARGET_TYPE == MONSTER_TO_PLAYER) {
update_smart_learn(player_ptr, m_idx, DRS_POIS);
+ }
auto res = MonsterSpellResult::make_valid(dam);
res.learnable = proj_res.affected_player;
const auto dam = monspell_damage(player_ptr, MonsterAbilityType::BA_CHAO, m_idx, DAM_ROLL);
const auto proj_res = breath(player_ptr, y, x, m_idx, AttributeType::CHAOS, dam, 4, false, TARGET_TYPE);
- if (TARGET_TYPE == MONSTER_TO_PLAYER)
+ if (TARGET_TYPE == MONSTER_TO_PLAYER) {
update_smart_learn(player_ptr, m_idx, DRS_CHAOS);
+ }
auto res = MonsterSpellResult::make_valid(dam);
res.learnable = proj_res.affected_player;
const auto rad = monster_is_powerful(player_ptr->current_floor_ptr, m_idx) ? 4 : 2;
const auto dam = monspell_damage(player_ptr, MonsterAbilityType::BA_ACID, m_idx, DAM_ROLL);
const auto proj_res = breath(player_ptr, y, x, m_idx, AttributeType::ACID, dam, rad, false, TARGET_TYPE);
- if (TARGET_TYPE == MONSTER_TO_PLAYER)
+ if (TARGET_TYPE == MONSTER_TO_PLAYER) {
update_smart_learn(player_ptr, m_idx, DRS_ACID);
+ }
auto res = MonsterSpellResult::make_valid(dam);
res.learnable = proj_res.affected_player;
const auto rad = monster_is_powerful(player_ptr->current_floor_ptr, m_idx) ? 4 : 2;
const auto dam = monspell_damage(player_ptr, MonsterAbilityType::BA_ELEC, m_idx, DAM_ROLL);
const auto proj_res = breath(player_ptr, y, x, m_idx, AttributeType::ELEC, dam, rad, false, TARGET_TYPE);
- if (TARGET_TYPE == MONSTER_TO_PLAYER)
+ if (TARGET_TYPE == MONSTER_TO_PLAYER) {
update_smart_learn(player_ptr, m_idx, DRS_ELEC);
+ }
auto res = MonsterSpellResult::make_valid(dam);
res.learnable = proj_res.affected_player;
const auto rad = monster_is_powerful(player_ptr->current_floor_ptr, m_idx) ? 4 : 2;
const auto dam = monspell_damage(player_ptr, MonsterAbilityType::BA_FIRE, m_idx, DAM_ROLL);
const auto proj_res = breath(player_ptr, y, x, m_idx, AttributeType::FIRE, dam, rad, false, TARGET_TYPE);
- if (TARGET_TYPE == MONSTER_TO_PLAYER)
+ if (TARGET_TYPE == MONSTER_TO_PLAYER) {
update_smart_learn(player_ptr, m_idx, DRS_FIRE);
+ }
auto res = MonsterSpellResult::make_valid(dam);
res.learnable = proj_res.affected_player;
const auto rad = monster_is_powerful(player_ptr->current_floor_ptr, m_idx) ? 4 : 2;
const auto dam = monspell_damage(player_ptr, MonsterAbilityType::BA_COLD, m_idx, DAM_ROLL);
const auto proj_res = breath(player_ptr, y, x, m_idx, AttributeType::COLD, dam, rad, false, TARGET_TYPE);
- if (TARGET_TYPE == MONSTER_TO_PLAYER)
+ if (TARGET_TYPE == MONSTER_TO_PLAYER) {
update_smart_learn(player_ptr, m_idx, DRS_COLD);
+ }
auto res = MonsterSpellResult::make_valid(dam);
res.learnable = proj_res.affected_player;
const auto dam = monspell_damage(player_ptr, MonsterAbilityType::BA_POIS, m_idx, DAM_ROLL);
const auto proj_res = breath(player_ptr, y, x, m_idx, AttributeType::POIS, dam, 2, false, TARGET_TYPE);
- if (TARGET_TYPE == MONSTER_TO_PLAYER)
+ if (TARGET_TYPE == MONSTER_TO_PLAYER) {
update_smart_learn(player_ptr, m_idx, DRS_POIS);
+ }
auto res = MonsterSpellResult::make_valid(dam);
res.learnable = proj_res.affected_player;
const auto dam = monspell_damage(player_ptr, MonsterAbilityType::BA_NETH, m_idx, DAM_ROLL);
const auto proj_res = breath(player_ptr, y, x, m_idx, AttributeType::NETHER, dam, 2, false, TARGET_TYPE);
- if (TARGET_TYPE == MONSTER_TO_PLAYER)
+ if (TARGET_TYPE == MONSTER_TO_PLAYER) {
update_smart_learn(player_ptr, m_idx, DRS_NETH);
+ }
auto res = MonsterSpellResult::make_valid(dam);
res.learnable = proj_res.affected_player;
const auto dam = monspell_damage(player_ptr, MonsterAbilityType::BA_DARK, m_idx, DAM_ROLL);
const auto proj_res = breath(player_ptr, y, x, m_idx, AttributeType::DARK, dam, 4, false, TARGET_TYPE);
- if (TARGET_TYPE == MONSTER_TO_PLAYER)
+ if (TARGET_TYPE == MONSTER_TO_PLAYER) {
update_smart_learn(player_ptr, m_idx, DRS_DARK);
+ }
auto res = MonsterSpellResult::make_valid(dam);
res.learnable = proj_res.affected_player;
const auto dam = monspell_damage(player_ptr, MonsterAbilityType::BA_LITE, m_idx, DAM_ROLL);
const auto proj_res = breath(player_ptr, y, x, m_idx, AttributeType::LITE, dam, 4, false, TARGET_TYPE);
- if (TARGET_TYPE == MONSTER_TO_PLAYER)
+ if (TARGET_TYPE == MONSTER_TO_PLAYER) {
update_smart_learn(player_ptr, m_idx, DRS_LITE);
+ }
auto res = MonsterSpellResult::make_valid(dam);
res.learnable = proj_res.affected_player;
const auto dam = monspell_damage(player_ptr, MonsterAbilityType::BA_ABYSS, m_idx, DAM_ROLL);
const auto proj_res = breath(player_ptr, y, x, m_idx, AttributeType::ABYSS, dam, 4, false, TARGET_TYPE);
- if (TARGET_TYPE == MONSTER_TO_PLAYER)
+ if (TARGET_TYPE == MONSTER_TO_PLAYER) {
update_smart_learn(player_ptr, m_idx, DRS_DARK);
+ }
auto res = MonsterSpellResult::make_valid(dam);
res.learnable = proj_res.affected_player;
static bool spell_attack(MonsterAbilityType spell)
{
/* All RF4 spells hurt (except for shriek and dispel) */
- if (spell_in_between(spell, MonsterAbilityType::ROCKET, MonsterAbilityType::BR_DISI))
+ if (spell_in_between(spell, MonsterAbilityType::ROCKET, MonsterAbilityType::BR_DISI)) {
return true;
- if (spell_in_between(spell, MonsterAbilityType::BR_VOID, MonsterAbilityType::BR_ABYSS))
+ }
+ if (spell_in_between(spell, MonsterAbilityType::BR_VOID, MonsterAbilityType::BR_ABYSS)) {
return true;
+ }
/* Various "ball" spells */
- if (spell_in_between(spell, MonsterAbilityType::BA_ACID, MonsterAbilityType::BA_DARK))
+ if (spell_in_between(spell, MonsterAbilityType::BA_ACID, MonsterAbilityType::BA_DARK)) {
return true;
- if (spell_in_between(spell, MonsterAbilityType::BA_VOID, MonsterAbilityType::BA_ABYSS))
+ }
+ if (spell_in_between(spell, MonsterAbilityType::BA_VOID, MonsterAbilityType::BA_ABYSS)) {
return true;
+ }
/* "Cause wounds" and "bolt" spells */
- if (spell_in_between(spell, MonsterAbilityType::CAUSE_1, MonsterAbilityType::MISSILE))
+ if (spell_in_between(spell, MonsterAbilityType::CAUSE_1, MonsterAbilityType::MISSILE)) {
return true;
- if (spell_in_between(spell, MonsterAbilityType::BO_VOID, MonsterAbilityType::BO_ABYSS))
+ }
+ if (spell_in_between(spell, MonsterAbilityType::BO_VOID, MonsterAbilityType::BO_ABYSS)) {
return true;
+ }
/* Hand of Doom */
- if (spell == MonsterAbilityType::HAND_DOOM)
+ if (spell == MonsterAbilityType::HAND_DOOM) {
return true;
+ }
/* Psycho-Spear */
- if (spell == MonsterAbilityType::PSY_SPEAR)
+ if (spell == MonsterAbilityType::PSY_SPEAR) {
return true;
+ }
/* Doesn't hurt */
return false;
static bool spell_escape(MonsterAbilityType spell)
{
/* Blink or Teleport */
- if (spell == MonsterAbilityType::BLINK || spell == MonsterAbilityType::TPORT)
+ if (spell == MonsterAbilityType::BLINK || spell == MonsterAbilityType::TPORT) {
return true;
+ }
/* Teleport the player away */
- if (spell == MonsterAbilityType::TELE_AWAY || spell == MonsterAbilityType::TELE_LEVEL)
+ if (spell == MonsterAbilityType::TELE_AWAY || spell == MonsterAbilityType::TELE_LEVEL) {
return true;
+ }
/* Isn't good for escaping */
return false;
static bool spell_annoy(MonsterAbilityType spell)
{
/* Shriek */
- if (spell == MonsterAbilityType::SHRIEK)
+ if (spell == MonsterAbilityType::SHRIEK) {
return true;
+ }
/* Brain smash, et al (added curses) */
- if (spell_in_between(spell, MonsterAbilityType::DRAIN_MANA, MonsterAbilityType::CAUSE_4))
+ if (spell_in_between(spell, MonsterAbilityType::DRAIN_MANA, MonsterAbilityType::CAUSE_4)) {
return true;
+ }
/* Scare, confuse, blind, slow, paralyze */
- if (spell_in_between(spell, MonsterAbilityType::SCARE, MonsterAbilityType::HOLD))
+ if (spell_in_between(spell, MonsterAbilityType::SCARE, MonsterAbilityType::HOLD)) {
return true;
+ }
/* Teleport to */
- if (spell == MonsterAbilityType::TELE_TO)
+ if (spell == MonsterAbilityType::TELE_TO) {
return true;
+ }
/* Teleport level */
- if (spell == MonsterAbilityType::TELE_LEVEL)
+ if (spell == MonsterAbilityType::TELE_LEVEL) {
return true;
+ }
/* Darkness, make traps, cause amnesia */
- if (spell_in_between(spell, MonsterAbilityType::TRAPS, MonsterAbilityType::RAISE_DEAD))
+ if (spell_in_between(spell, MonsterAbilityType::TRAPS, MonsterAbilityType::RAISE_DEAD)) {
return true;
+ }
/* Doesn't annoy */
return false;
*/
static bool spell_special(PlayerType *player_ptr, MonsterAbilityType spell)
{
- if (player_ptr->phase_out)
+ if (player_ptr->phase_out) {
return false;
+ }
return spell == MonsterAbilityType::SPECIAL;
}
monster_type *m_ptr = &player_ptr->current_floor_ptr->m_list[msa_ptr->m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
- if (r_ptr->behavior_flags.has(MonsterBehaviorType::STUPID))
+ if (r_ptr->flags2 & RF2_STUPID) {
return (msa_ptr->mspells[randint0(msa_ptr->mspells.size())]);
+ }
for (size_t i = 0; i < msa_ptr->mspells.size(); i++) {
- if (spell_escape(msa_ptr->mspells[i]))
+ if (spell_escape(msa_ptr->mspells[i])) {
escape.push_back(msa_ptr->mspells[i]);
+ }
- if (spell_attack(msa_ptr->mspells[i]))
+ if (spell_attack(msa_ptr->mspells[i])) {
attack.push_back(msa_ptr->mspells[i]);
+ }
- if (spell_summon(msa_ptr->mspells[i]))
+ if (spell_summon(msa_ptr->mspells[i])) {
summon.push_back(msa_ptr->mspells[i]);
+ }
- if (spell_tactic(msa_ptr->mspells[i]))
+ if (spell_tactic(msa_ptr->mspells[i])) {
tactic.push_back(msa_ptr->mspells[i]);
+ }
- if (spell_annoy(msa_ptr->mspells[i]))
+ if (spell_annoy(msa_ptr->mspells[i])) {
annoy.push_back(msa_ptr->mspells[i]);
+ }
- if (spell_invulner(msa_ptr->mspells[i]))
+ if (spell_invulner(msa_ptr->mspells[i])) {
invul.push_back(msa_ptr->mspells[i]);
+ }
- if (spell_haste(msa_ptr->mspells[i]))
+ if (spell_haste(msa_ptr->mspells[i])) {
haste.push_back(msa_ptr->mspells[i]);
+ }
- if (spell_world(msa_ptr->mspells[i]))
+ if (spell_world(msa_ptr->mspells[i])) {
world.push_back(msa_ptr->mspells[i]);
+ }
- if (spell_special(player_ptr, msa_ptr->mspells[i]))
+ if (spell_special(player_ptr, msa_ptr->mspells[i])) {
special.push_back(msa_ptr->mspells[i]);
+ }
- if (spell_psy_spe(msa_ptr->mspells[i]))
+ if (spell_psy_spe(msa_ptr->mspells[i])) {
psy_spe.push_back(msa_ptr->mspells[i]);
+ }
- if (spell_raise(msa_ptr->mspells[i]))
+ if (spell_raise(msa_ptr->mspells[i])) {
raise.push_back(msa_ptr->mspells[i]);
+ }
- if (spell_heal(msa_ptr->mspells[i]))
+ if (spell_heal(msa_ptr->mspells[i])) {
heal.push_back(msa_ptr->mspells[i]);
+ }
- if (spell_dispel(msa_ptr->mspells[i]))
+ if (spell_dispel(msa_ptr->mspells[i])) {
dispel.push_back(msa_ptr->mspells[i]);
+ }
}
- if (!world.empty() && (randint0(100) < 15) && !w_ptr->timewalk_m_idx)
+ if (!world.empty() && (randint0(100) < 15) && !w_ptr->timewalk_m_idx) {
return (world[randint0(world.size())]);
+ }
if (!special.empty()) {
bool success = false;
switch (m_ptr->r_idx) {
case MON_BANOR:
case MON_LUPART:
- if ((m_ptr->hp < m_ptr->maxhp / 2) && r_info[MON_BANOR].max_num && r_info[MON_LUPART].max_num)
+ if ((m_ptr->hp < m_ptr->maxhp / 2) && r_info[MON_BANOR].max_num && r_info[MON_LUPART].max_num) {
success = true;
+ }
break;
default:
break;
}
- if (success)
+ if (success) {
return (special[randint0(special.size())]);
+ }
}
if (m_ptr->hp < m_ptr->maxhp / 3 && one_in_(2)) {
- if (!heal.empty())
+ if (!heal.empty()) {
return (heal[randint0(heal.size())]);
+ }
}
if (((m_ptr->hp < m_ptr->maxhp / 3) || monster_fear_remaining(m_ptr)) && one_in_(2)) {
- if (!escape.empty())
+ if (!escape.empty()) {
return (escape[randint0(escape.size())]);
+ }
}
if (!special.empty()) {
case MON_LUPART:
break;
case MON_BANORLUPART:
- if (randint0(100) < 70)
+ if (randint0(100) < 70) {
success = true;
+ }
break;
case MON_ROLENTO:
- if (randint0(100) < 40)
+ if (randint0(100) < 40) {
success = true;
+ }
break;
default:
- if (randint0(100) < 50)
+ if (randint0(100) < 50) {
success = true;
+ }
break;
}
- if (success)
+ if (success) {
return (special[randint0(special.size())]);
+ }
}
if ((distance(player_ptr->y, player_ptr->x, m_ptr->fy, m_ptr->fx) < 4) && (!attack.empty() || r_ptr->ability_flags.has(MonsterAbilityType::TRAPS)) && (randint0(100) < 75) && !w_ptr->timewalk_m_idx) {
- if (!tactic.empty())
+ if (!tactic.empty()) {
return (tactic[randint0(tactic.size())]);
+ }
}
- if (!summon.empty() && (randint0(100) < 40))
+ if (!summon.empty() && (randint0(100) < 40)) {
return (summon[randint0(summon.size())]);
+ }
if (!dispel.empty() && one_in_(2)) {
if (dispel_check(player_ptr, msa_ptr->m_idx)) {
}
}
- if (!raise.empty() && (randint0(100) < 40))
+ if (!raise.empty() && (randint0(100) < 40)) {
return (raise[randint0(raise.size())]);
+ }
if (is_invuln(player_ptr)) {
if (!psy_spe.empty() && (randint0(100) < 50)) {
return (attack[randint0(attack.size())]);
}
- if (!tactic.empty() && (randint0(100) < 50) && !w_ptr->timewalk_m_idx)
+ if (!tactic.empty() && (randint0(100) < 50) && !w_ptr->timewalk_m_idx) {
return (tactic[randint0(tactic.size())]);
+ }
- if (!invul.empty() && !m_ptr->mtimed[MTIMED_INVULNER] && (randint0(100) < 50))
+ if (!invul.empty() && !m_ptr->mtimed[MTIMED_INVULNER] && (randint0(100) < 50)) {
return (invul[randint0(invul.size())]);
+ }
if ((m_ptr->hp < m_ptr->maxhp * 3 / 4) && (randint0(100) < 25)) {
- if (!heal.empty())
+ if (!heal.empty()) {
return (heal[randint0(heal.size())]);
+ }
}
- if (!haste.empty() && (randint0(100) < 20) && !monster_fast_remaining(m_ptr))
+ if (!haste.empty() && (randint0(100) < 20) && !monster_fast_remaining(m_ptr)) {
return (haste[randint0(haste.size())]);
+ }
- if (!annoy.empty() && (randint0(100) < 80))
+ if (!annoy.empty() && (randint0(100) < 80)) {
return (annoy[randint0(annoy.size())]);
+ }
return MonsterAbilityType::MAX;
}
int choices[INVEN_TOTAL - INVEN_MAIN_HAND];
/* Paranoia -- Player has no warning ability */
- if (!player_ptr->warning)
+ if (!player_ptr->warning) {
return nullptr;
+ }
/* Search Inventory */
int number = 0;
case AttributeType::DARK:
dam = dam * calc_dark_damage_rate(player_ptr, CALC_MAX) / 100;
- if (has_immune_dark(player_ptr) || player_ptr->wraith_form)
+ if (has_immune_dark(player_ptr) || player_ptr->wraith_form) {
ignore_wraith_form = true;
+ }
break;
case AttributeType::SHARDS:
case AttributeType::DEATH_RAY:
dam = dam * calc_deathray_damage_rate(player_ptr, CALC_MAX) / 100;
- if (dam == 0)
+ if (dam == 0) {
ignore_wraith_form = true;
+ }
break;
case AttributeType::HOLY_FIRE:
if (player_ptr->wraith_form && !ignore_wraith_form) {
dam /= 2;
- if (!dam)
+ if (!dam) {
dam = 1;
+ }
}
- if (dam > *max)
+ if (dam > *max) {
*max = dam;
+ }
}
/*!
if (check_wraith_form && player_ptr->wraith_form) {
dam /= 2;
- if (!dam)
+ if (!dam) {
dam = 1;
+ }
}
return dam;
monster_type *m_ptr;
monster_race *r_ptr;
- if (!in_bounds(player_ptr->current_floor_ptr, my, mx) || (distance(my, mx, yy, xx) > WARNING_AWARE_RANGE))
+ if (!in_bounds(player_ptr->current_floor_ptr, my, mx) || (distance(my, mx, yy, xx) > WARNING_AWARE_RANGE)) {
continue;
+ }
g_ptr = &player_ptr->current_floor_ptr->grid_array[my][mx];
- if (!g_ptr->m_idx)
+ if (!g_ptr->m_idx) {
continue;
+ }
m_ptr = &player_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
- if (monster_csleep_remaining(m_ptr))
+ if (monster_csleep_remaining(m_ptr)) {
continue;
- if (!is_hostile(m_ptr))
+ }
+ if (!is_hostile(m_ptr)) {
continue;
+ }
r_ptr = &r_info[m_ptr->r_idx];
const auto flags = r_ptr->ability_flags;
if (d_info[player_ptr->dungeon_idx].flags.has_not(DungeonFeatureType::NO_MAGIC)) {
- if (flags.has(MonsterAbilityType::BA_CHAO))
+ if (flags.has(MonsterAbilityType::BA_CHAO)) {
spell_damcalc_by_spellnum(player_ptr, MonsterAbilityType::BA_CHAO, AttributeType::CHAOS, g_ptr->m_idx, &dam_max0);
- if (flags.has(MonsterAbilityType::BA_MANA))
+ }
+ if (flags.has(MonsterAbilityType::BA_MANA)) {
spell_damcalc_by_spellnum(player_ptr, MonsterAbilityType::BA_MANA, AttributeType::MANA, g_ptr->m_idx, &dam_max0);
- if (flags.has(MonsterAbilityType::BA_DARK))
+ }
+ if (flags.has(MonsterAbilityType::BA_DARK)) {
spell_damcalc_by_spellnum(player_ptr, MonsterAbilityType::BA_DARK, AttributeType::DARK, g_ptr->m_idx, &dam_max0);
- if (flags.has(MonsterAbilityType::BA_LITE))
+ }
+ if (flags.has(MonsterAbilityType::BA_LITE)) {
spell_damcalc_by_spellnum(player_ptr, MonsterAbilityType::BA_LITE, AttributeType::LITE, g_ptr->m_idx, &dam_max0);
- if (flags.has(MonsterAbilityType::HAND_DOOM))
+ }
+ if (flags.has(MonsterAbilityType::HAND_DOOM)) {
spell_damcalc_by_spellnum(player_ptr, MonsterAbilityType::HAND_DOOM, AttributeType::HAND_DOOM, g_ptr->m_idx, &dam_max0);
- if (flags.has(MonsterAbilityType::PSY_SPEAR))
+ }
+ if (flags.has(MonsterAbilityType::PSY_SPEAR)) {
spell_damcalc_by_spellnum(player_ptr, MonsterAbilityType::PSY_SPEAR, AttributeType::PSY_SPEAR, g_ptr->m_idx, &dam_max0);
- if (flags.has(MonsterAbilityType::BA_VOID))
+ }
+ if (flags.has(MonsterAbilityType::BA_VOID)) {
spell_damcalc_by_spellnum(player_ptr, MonsterAbilityType::BA_VOID, AttributeType::VOID_MAGIC, g_ptr->m_idx, &dam_max0);
- if (flags.has(MonsterAbilityType::BA_ABYSS))
+ }
+ if (flags.has(MonsterAbilityType::BA_ABYSS)) {
spell_damcalc_by_spellnum(player_ptr, MonsterAbilityType::BA_ABYSS, AttributeType::ABYSS, g_ptr->m_idx, &dam_max0);
+ }
}
- if (flags.has(MonsterAbilityType::ROCKET))
+ if (flags.has(MonsterAbilityType::ROCKET)) {
spell_damcalc_by_spellnum(player_ptr, MonsterAbilityType::ROCKET, AttributeType::ROCKET, g_ptr->m_idx, &dam_max0);
- if (flags.has(MonsterAbilityType::BR_ACID))
+ }
+ if (flags.has(MonsterAbilityType::BR_ACID)) {
spell_damcalc_by_spellnum(player_ptr, MonsterAbilityType::BR_ACID, AttributeType::ACID, g_ptr->m_idx, &dam_max0);
- if (flags.has(MonsterAbilityType::BR_ELEC))
+ }
+ if (flags.has(MonsterAbilityType::BR_ELEC)) {
spell_damcalc_by_spellnum(player_ptr, MonsterAbilityType::BR_ELEC, AttributeType::ELEC, g_ptr->m_idx, &dam_max0);
- if (flags.has(MonsterAbilityType::BR_FIRE))
+ }
+ if (flags.has(MonsterAbilityType::BR_FIRE)) {
spell_damcalc_by_spellnum(player_ptr, MonsterAbilityType::BR_FIRE, AttributeType::FIRE, g_ptr->m_idx, &dam_max0);
- if (flags.has(MonsterAbilityType::BR_COLD))
+ }
+ if (flags.has(MonsterAbilityType::BR_COLD)) {
spell_damcalc_by_spellnum(player_ptr, MonsterAbilityType::BR_COLD, AttributeType::COLD, g_ptr->m_idx, &dam_max0);
- if (flags.has(MonsterAbilityType::BR_POIS))
+ }
+ if (flags.has(MonsterAbilityType::BR_POIS)) {
spell_damcalc_by_spellnum(player_ptr, MonsterAbilityType::BR_POIS, AttributeType::POIS, g_ptr->m_idx, &dam_max0);
- if (flags.has(MonsterAbilityType::BR_NETH))
+ }
+ if (flags.has(MonsterAbilityType::BR_NETH)) {
spell_damcalc_by_spellnum(player_ptr, MonsterAbilityType::BR_NETH, AttributeType::NETHER, g_ptr->m_idx, &dam_max0);
- if (flags.has(MonsterAbilityType::BR_LITE))
+ }
+ if (flags.has(MonsterAbilityType::BR_LITE)) {
spell_damcalc_by_spellnum(player_ptr, MonsterAbilityType::BR_LITE, AttributeType::LITE, g_ptr->m_idx, &dam_max0);
- if (flags.has(MonsterAbilityType::BR_DARK))
+ }
+ if (flags.has(MonsterAbilityType::BR_DARK)) {
spell_damcalc_by_spellnum(player_ptr, MonsterAbilityType::BR_DARK, AttributeType::DARK, g_ptr->m_idx, &dam_max0);
- if (flags.has(MonsterAbilityType::BR_CONF))
+ }
+ if (flags.has(MonsterAbilityType::BR_CONF)) {
spell_damcalc_by_spellnum(player_ptr, MonsterAbilityType::BR_CONF, AttributeType::CONFUSION, g_ptr->m_idx, &dam_max0);
- if (flags.has(MonsterAbilityType::BR_SOUN))
+ }
+ if (flags.has(MonsterAbilityType::BR_SOUN)) {
spell_damcalc_by_spellnum(player_ptr, MonsterAbilityType::BR_SOUN, AttributeType::SOUND, g_ptr->m_idx, &dam_max0);
- if (flags.has(MonsterAbilityType::BR_CHAO))
+ }
+ if (flags.has(MonsterAbilityType::BR_CHAO)) {
spell_damcalc_by_spellnum(player_ptr, MonsterAbilityType::BR_CHAO, AttributeType::CHAOS, g_ptr->m_idx, &dam_max0);
- if (flags.has(MonsterAbilityType::BR_DISE))
+ }
+ if (flags.has(MonsterAbilityType::BR_DISE)) {
spell_damcalc_by_spellnum(player_ptr, MonsterAbilityType::BR_DISE, AttributeType::DISENCHANT, g_ptr->m_idx, &dam_max0);
- if (flags.has(MonsterAbilityType::BR_NEXU))
+ }
+ if (flags.has(MonsterAbilityType::BR_NEXU)) {
spell_damcalc_by_spellnum(player_ptr, MonsterAbilityType::BR_NEXU, AttributeType::NEXUS, g_ptr->m_idx, &dam_max0);
- if (flags.has(MonsterAbilityType::BR_TIME))
+ }
+ if (flags.has(MonsterAbilityType::BR_TIME)) {
spell_damcalc_by_spellnum(player_ptr, MonsterAbilityType::BR_TIME, AttributeType::TIME, g_ptr->m_idx, &dam_max0);
- if (flags.has(MonsterAbilityType::BR_INER))
+ }
+ if (flags.has(MonsterAbilityType::BR_INER)) {
spell_damcalc_by_spellnum(player_ptr, MonsterAbilityType::BR_INER, AttributeType::INERTIAL, g_ptr->m_idx, &dam_max0);
- if (flags.has(MonsterAbilityType::BR_GRAV))
+ }
+ if (flags.has(MonsterAbilityType::BR_GRAV)) {
spell_damcalc_by_spellnum(player_ptr, MonsterAbilityType::BR_GRAV, AttributeType::GRAVITY, g_ptr->m_idx, &dam_max0);
- if (flags.has(MonsterAbilityType::BR_SHAR))
+ }
+ if (flags.has(MonsterAbilityType::BR_SHAR)) {
spell_damcalc_by_spellnum(player_ptr, MonsterAbilityType::BR_SHAR, AttributeType::SHARDS, g_ptr->m_idx, &dam_max0);
- if (flags.has(MonsterAbilityType::BR_PLAS))
+ }
+ if (flags.has(MonsterAbilityType::BR_PLAS)) {
spell_damcalc_by_spellnum(player_ptr, MonsterAbilityType::BR_PLAS, AttributeType::PLASMA, g_ptr->m_idx, &dam_max0);
- if (flags.has(MonsterAbilityType::BR_FORC))
+ }
+ if (flags.has(MonsterAbilityType::BR_FORC)) {
spell_damcalc_by_spellnum(player_ptr, MonsterAbilityType::BR_FORC, AttributeType::FORCE, g_ptr->m_idx, &dam_max0);
- if (flags.has(MonsterAbilityType::BR_MANA))
+ }
+ if (flags.has(MonsterAbilityType::BR_MANA)) {
spell_damcalc_by_spellnum(player_ptr, MonsterAbilityType::BR_MANA, AttributeType::MANA, g_ptr->m_idx, &dam_max0);
- if (flags.has(MonsterAbilityType::BR_NUKE))
+ }
+ if (flags.has(MonsterAbilityType::BR_NUKE)) {
spell_damcalc_by_spellnum(player_ptr, MonsterAbilityType::BR_NUKE, AttributeType::NUKE, g_ptr->m_idx, &dam_max0);
- if (flags.has(MonsterAbilityType::BR_DISI))
+ }
+ if (flags.has(MonsterAbilityType::BR_DISI)) {
spell_damcalc_by_spellnum(player_ptr, MonsterAbilityType::BR_DISI, AttributeType::DISINTEGRATE, g_ptr->m_idx, &dam_max0);
- if (flags.has(MonsterAbilityType::BR_VOID))
+ }
+ if (flags.has(MonsterAbilityType::BR_VOID)) {
spell_damcalc_by_spellnum(player_ptr, MonsterAbilityType::BR_VOID, AttributeType::VOID_MAGIC, g_ptr->m_idx, &dam_max0);
- if (flags.has(MonsterAbilityType::BR_ABYSS))
+ }
+ if (flags.has(MonsterAbilityType::BR_ABYSS)) {
spell_damcalc_by_spellnum(player_ptr, MonsterAbilityType::BR_ABYSS, AttributeType::ABYSS, g_ptr->m_idx, &dam_max0);
+ }
}
-
/* Monster melee attacks */
if (r_ptr->behavior_flags.has(MonsterBehaviorType::NEVER_BLOW) || d_info[player_ptr->dungeon_idx].flags.has(DungeonFeatureType::NO_MELEE)) {
dam_max += dam_max0;
int dam_melee = 0;
for (int m = 0; m < 4; m++) {
/* Skip non-attacks */
- if (r_ptr->blow[m].method == RaceBlowMethodType::NONE || (r_ptr->blow[m].method == RaceBlowMethodType::SHOOT))
+ if (r_ptr->blow[m].method == RaceBlowMethodType::NONE || (r_ptr->blow[m].method == RaceBlowMethodType::SHOOT)) {
continue;
+ }
/* Extract the attack info */
dam_melee += blow_damcalc(m_ptr, player_ptr, &r_ptr->blow[m]);
- if (r_ptr->blow[m].method == RaceBlowMethodType::EXPLODE)
+ if (r_ptr->blow[m].method == RaceBlowMethodType::EXPLODE) {
break;
+ }
}
- if (dam_melee > dam_max0)
+ if (dam_melee > dam_max0) {
dam_max0 = dam_melee;
+ }
dam_max += dam_max0;
}
}
if (dam_max > player_ptr->chp / 2) {
object_type *o_ptr = choose_warning_item(player_ptr);
- if (o_ptr)
+ if (o_ptr) {
describe_flavor(player_ptr, o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
- else
+ } else {
strcpy(o_name, _("体", "body")); /* Warning ability without item */
+ }
msg_format(_("%sが鋭く震えた!", "Your %s pulsates sharply!"), o_name);
disturb(player_ptr, false, true);
return get_check(_("本当にこのまま進むか?", "Really want to go ahead? "));
}
- } else
+ } else {
old_damage = old_damage / 2;
+ }
g_ptr = &player_ptr->current_floor_ptr->grid_array[yy][xx];
bool is_warning = (!easy_disarm && is_trap(player_ptr, g_ptr->feat)) || (g_ptr->mimic && is_trap(player_ptr, g_ptr->feat));
is_warning &= !one_in_(13);
- if (!is_warning)
+ if (!is_warning) {
return true;
+ }
object_type *o_ptr = choose_warning_item(player_ptr);
- if (o_ptr != nullptr)
+ if (o_ptr != nullptr) {
describe_flavor(player_ptr, o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
- else
+ } else {
strcpy(o_name, _("体", "body")); /* Warning ability without item */
+ }
msg_format(_("%sが鋭く震えた!", "Your %s pulsates sharply!"), o_name);
disturb(player_ptr, false, true);
return get_check(_("本当にこのまま進むか?", "Really want to go ahead? "));