#include "realm/realm-sorcery.h"
+#include "avatar/avatar.h"
#include "cmd-action/cmd-spell.h"
#include "core/asking-player.h"
#include "player-info/self-info.h"
-#include "player-info/avatar.h"
#include "spell-kind/magic-item-recharger.h"
#include "spell-kind/spells-charm.h"
#include "spell-kind/spells-detection.h"
#include "spell-kind/spells-teleport.h"
#include "spell-kind/spells-world.h"
#include "spell-realm/spells-sorcery.h"
-#include "spell/spell-types.h"
+#include "effect/attribute-types.h"
#include "spell/spells-status.h"
#include "status/body-improvement.h"
#include "status/buff-setter.h"
/*!
* @brief 仙術領域魔法の各処理を行う
- * @param caster_ptr プレーヤーへの参照ポインタ
+ * @param player_ptr プレイヤーへの参照ポインタ
* @param spell 魔法ID
- * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
- * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
+ * @param mode 処理内容 (SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO / SpellProcessType::CAST)
+ * @return SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO 時には文字列ポインタを返す。SpellProcessType::CAST時はnullptr文字列を返す。
*/
-concptr do_sorcery_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type mode)
+concptr do_sorcery_spell(PlayerType *player_ptr, SPELL_IDX spell, SpellProcessType mode)
{
- bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
- bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
- bool info = (mode == SPELL_INFO) ? TRUE : FALSE;
- bool cast = (mode == SPELL_CAST) ? TRUE : FALSE;
+ bool name = mode == SpellProcessType::NAME;
+ bool desc = mode == SpellProcessType::DESCRIPTION;
+ bool info = mode == SpellProcessType::INFO;
+ bool cast = mode == SpellProcessType::CAST;
DIRECTION dir;
- PLAYER_LEVEL plev = caster_ptr->lev;
+ PLAYER_LEVEL plev = player_ptr->lev;
switch (spell) {
case 0:
return info_radius(rad);
if (cast) {
- detect_monsters_normal(caster_ptr, rad);
+ detect_monsters_normal(player_ptr, rad);
}
}
break;
return info_range(range);
if (cast) {
- teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
+ teleport_player(player_ptr, range, TELEPORT_SPONTANEOUS);
}
}
break;
return info_radius(rad);
if (cast) {
- detect_traps(caster_ptr, rad, TRUE);
- detect_doors(caster_ptr, rad);
- detect_stairs(caster_ptr, rad);
+ detect_traps(player_ptr, rad, true);
+ detect_doors(player_ptr, rad);
+ detect_stairs(player_ptr, rad);
}
}
break;
return info_damage(dice, sides, 0);
if (cast) {
- lite_area(caster_ptr, damroll(dice, sides), rad);
+ lite_area(player_ptr, damroll(dice, sides), rad);
}
}
break;
return info_power(power);
if (cast) {
- if (!get_aim_dir(caster_ptr, &dir))
- return NULL;
+ if (!get_aim_dir(player_ptr, &dir))
+ return nullptr;
- confuse_monster(caster_ptr, dir, power);
+ confuse_monster(player_ptr, dir, power);
}
}
break;
return info_range(range);
if (cast) {
- teleport_player(caster_ptr, range, TELEPORT_SPONTANEOUS);
+ teleport_player(player_ptr, range, TELEPORT_SPONTANEOUS);
}
}
break;
return info_power(power);
if (cast) {
- if (!get_aim_dir(caster_ptr, &dir))
- return NULL;
+ if (!get_aim_dir(player_ptr, &dir))
+ return nullptr;
- sleep_monster(caster_ptr, dir, plev);
+ sleep_monster(player_ptr, dir, plev);
}
}
break;
return info_power(power);
if (cast) {
- if (!recharge(caster_ptr, power))
- return NULL;
+ if (!recharge(player_ptr, power))
+ return nullptr;
}
}
break;
return info_radius(rad);
if (cast) {
- map_area(caster_ptr, rad);
+ map_area(player_ptr, rad);
}
}
break;
{
if (cast) {
- if (!ident_spell(caster_ptr, FALSE, TV_NONE))
- return NULL;
+ if (!ident_spell(player_ptr, false))
+ return nullptr;
}
}
break;
return info_power(power);
if (cast) {
- if (!get_aim_dir(caster_ptr, &dir))
- return NULL;
+ if (!get_aim_dir(player_ptr, &dir))
+ return nullptr;
- slow_monster(caster_ptr, dir, plev);
+ slow_monster(player_ptr, dir, plev);
}
}
break;
return info_power(power);
if (cast) {
- sleep_monsters(caster_ptr, plev);
+ sleep_monsters(player_ptr, plev);
}
}
break;
return info_power(power);
if (cast) {
- if (!get_aim_dir(caster_ptr, &dir))
- return NULL;
+ if (!get_aim_dir(player_ptr, &dir))
+ return nullptr;
- fire_beam(caster_ptr, GF_AWAY_ALL, dir, power);
+ fire_beam(player_ptr, AttributeType::AWAY_ALL, dir, power);
}
}
break;
return info_duration(base, sides);
if (cast) {
- set_fast(caster_ptr, randint1(sides) + base, FALSE);
+ set_fast(player_ptr, randint1(sides) + base, false);
}
}
break;
return info_radius(rad);
if (cast) {
- detect_all(caster_ptr, rad);
+ detect_all(player_ptr, rad);
}
}
break;
{
if (cast) {
- if (!identify_fully(caster_ptr, FALSE, TV_NONE))
- return NULL;
+ if (!identify_fully(player_ptr, false))
+ return nullptr;
}
}
break;
return info_radius(rad);
if (cast) {
- detect_objects_normal(caster_ptr, rad);
- detect_treasure(caster_ptr, rad);
- detect_objects_gold(caster_ptr, rad);
+ detect_objects_normal(player_ptr, rad);
+ detect_treasure(player_ptr, rad);
+ detect_objects_gold(player_ptr, rad);
}
}
break;
return info_power(power);
if (cast) {
- if (!get_aim_dir(caster_ptr, &dir))
- return NULL;
+ if (!get_aim_dir(player_ptr, &dir))
+ return nullptr;
- charm_monster(caster_ptr, dir, plev);
+ charm_monster(player_ptr, dir, plev);
}
}
break;
return info_duration(base, sides);
if (cast) {
- set_tim_esp(caster_ptr, randint1(sides) + base, FALSE);
+ set_tim_esp(player_ptr, randint1(sides) + base, false);
}
}
break;
{
if (cast) {
- if (!tele_town(caster_ptr))
- return NULL;
+ if (!tele_town(player_ptr))
+ return nullptr;
}
}
break;
{
if (cast) {
- self_knowledge(caster_ptr);
+ self_knowledge(player_ptr);
}
}
break;
{
if (cast) {
if (!get_check(_("本当に他の階にテレポートしますか?", "Are you sure? (Teleport Level)")))
- return NULL;
- teleport_level(caster_ptr, 0);
+ return nullptr;
+ teleport_level(player_ptr, 0);
}
}
break;
return info_delay(base, sides);
if (cast) {
- if (!recall_player(caster_ptr, randint0(21) + 15))
- return NULL;
+ if (!recall_player(player_ptr, randint0(21) + 15))
+ return nullptr;
}
}
break;
if (cast) {
msg_print(_("次元の扉が開いた。目的地を選んで下さい。", "You open a dimensional gate. Choose a destination."));
- if (!dimension_door(caster_ptr))
- return NULL;
+ if (!dimension_door(player_ptr))
+ return nullptr;
}
}
break;
{
if (cast) {
- probing(caster_ptr);
+ probing(player_ptr);
}
}
break;
return info_damage(dice, sides, base);
if (cast) {
- create_rune_explosion(caster_ptr, caster_ptr->y, caster_ptr->x);
+ create_rune_explosion(player_ptr, player_ptr->y, player_ptr->x);
}
}
break;
return info_weight(weight);
if (cast) {
- if (!get_aim_dir(caster_ptr, &dir))
- return NULL;
+ if (!get_aim_dir(player_ptr, &dir))
+ return nullptr;
- fetch_item(caster_ptr, dir, weight, FALSE);
+ fetch_item(player_ptr, dir, weight, false);
}
}
break;
return info_duration(base, sides);
if (cast) {
- chg_virtue(caster_ptr, V_KNOWLEDGE, 1);
- chg_virtue(caster_ptr, V_ENLIGHTEN, 1);
+ chg_virtue(player_ptr, V_KNOWLEDGE, 1);
+ chg_virtue(player_ptr, V_ENLIGHTEN, 1);
- wiz_lite(caster_ptr, FALSE);
+ wiz_lite(player_ptr, false);
- if (!caster_ptr->telepathy) {
- set_tim_esp(caster_ptr, randint1(sides) + base, FALSE);
+ if (!player_ptr->telepathy) {
+ set_tim_esp(player_ptr, randint1(sides) + base, false);
}
}
}
return info_power(power);
if (cast) {
- charm_monsters(caster_ptr, power);
+ charm_monsters(player_ptr, power);
}
}
break;
{
if (cast) {
- if (!alchemy(caster_ptr))
- return NULL;
+ if (!alchemy(player_ptr))
+ return nullptr;
}
}
break;
return info_power(power);
if (cast) {
- banish_monsters(caster_ptr, power);
+ banish_monsters(player_ptr, power);
}
}
break;
return info_duration(base, base);
if (cast) {
- set_invuln(caster_ptr, randint1(base) + base, FALSE);
+ set_invuln(player_ptr, randint1(base) + base, false);
}
}
break;