#include "angband.h"
+#include "util.h"
+
#include "cmd-spell.h"
#include "mutation.h"
#include "spells.h"
#include "spells-summon.h"
#include "spells-status.h"
+#include "spells-object.h"
+#include "player-effects.h"
+#include "player-class.h"
+#include "targeting.h"
/*!
* @brief トランプ領域魔法の各処理を行う
+* @param caster_ptr プレーヤーへの参照ポインタ
* @param spell 魔法ID
* @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
* @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
*/
-concptr do_trump_spell(SPELL_IDX spell, BIT_FLAGS mode)
+concptr do_trump_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
{
bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
bool fail = (mode == SPELL_FAIL) ? TRUE : FALSE;
DIRECTION dir;
- PLAYER_LEVEL plev = p_ptr->lev;
+ PLAYER_LEVEL plev = caster_ptr->lev;
switch (spell)
{
case 0:
if (name) return _("ショート・テレポート", "Phase Door");
- if (desc) return _("近距離のテレポートをする。", "Teleport short distance.");
+ if (desc) return _("近距離のテレポートをする。", "Teleports you a short distance.");
{
POSITION range = 10;
if (cast)
{
- teleport_player(range, 0L);
+ teleport_player(caster_ptr, range, 0L);
}
}
break;
if (cast || fail)
{
msg_print(_("あなたは蜘蛛のカードに集中する...", "You concentrate on the trump of an spider..."));
- if (trump_summoning(1, !fail, p_ptr->y, p_ptr->x, 0, SUMMON_SPIDER, PM_ALLOW_GROUP))
+ if (trump_summoning(caster_ptr, 1, !fail, caster_ptr->y, caster_ptr->x, 0, SUMMON_SPIDER, PM_ALLOW_GROUP))
{
if (fail)
{
if (cast)
{
- cast_shuffle();
+ cast_shuffle(caster_ptr);
}
}
break;
{
if (cast)
{
- if (!reset_recall()) return NULL;
+ if (!reset_recall(caster_ptr)) return NULL;
}
}
break;
case 4:
if (name) return _("テレポート", "Teleport");
- if (desc) return _("遠距離のテレポートをする。", "Teleport long distance.");
+ if (desc) return _("遠距離のテレポートをする。", "Teleports you a long distance.");
{
POSITION range = plev * 4;
if (cast)
{
- teleport_player(range, 0L);
+ teleport_player(caster_ptr, range, 0L);
}
}
break;
if (cast)
{
- set_tim_esp(randint1(sides) + base, FALSE);
+ set_tim_esp(caster_ptr, randint1(sides) + base, FALSE);
}
}
break;
if (cast)
{
- if (!get_aim_dir(&dir)) return NULL;
+ if (!get_aim_dir(caster_ptr, &dir)) return NULL;
- fire_beam(GF_AWAY_ALL, dir, power);
+ fire_beam(caster_ptr, GF_AWAY_ALL, dir, power);
}
}
break;
{
int type = (!fail ? SUMMON_ANIMAL_RANGER : SUMMON_ANIMAL);
msg_print(_("あなたは動物のカードに集中する...", "You concentrate on the trump of an animal..."));
- if (trump_summoning(1, !fail, p_ptr->y, p_ptr->x, 0, type, 0L))
+ if (trump_summoning(caster_ptr, 1, !fail, caster_ptr->y, caster_ptr->x, 0, type, 0L))
{
if (fail)
{
if (cast)
{
- if (!get_aim_dir(&dir)) return NULL;
+ if (!get_aim_dir(caster_ptr, &dir)) return NULL;
- fetch(dir, weight, FALSE);
+ fetch(caster_ptr, dir, weight, FALSE);
}
}
break;
if (cast)
{
- if (!target_set(TARGET_KILL)) return NULL;
+ if (!target_set(caster_ptr, TARGET_KILL)) return NULL;
x = target_col;
y = target_row;
}
else
{
/* Summons near player when failed */
- x = p_ptr->x;
- y = p_ptr->y;
+ x = caster_ptr->x;
+ y = caster_ptr->y;
}
- if (p_ptr->pclass == CLASS_BEASTMASTER)
+ if (caster_ptr->pclass == CLASS_BEASTMASTER)
type = SUMMON_KAMIKAZE_LIVING;
else
type = SUMMON_KAMIKAZE;
msg_print(_("あなたはカミカゼのカードに集中する...", "You concentrate on several trumps at once..."));
- if (trump_summoning(2 + randint0(plev / 7), !fail, y, x, 0, type, 0L))
+ if (trump_summoning(caster_ptr, 2 + randint0(plev / 7), !fail, y, x, 0, type, 0L))
{
if (fail)
{
{
int summon_lev = plev * 2 / 3 + randint1(plev / 2);
- if (trump_summoning(1, !fail, p_ptr->y, p_ptr->x, (summon_lev * 3 / 2), SUMMON_PHANTOM, 0L))
+ if (trump_summoning(caster_ptr, 1, !fail, caster_ptr->y, caster_ptr->x, (summon_lev * 3 / 2), SUMMON_PHANTOM, 0L))
{
msg_print(_("御用でございますか、御主人様?", "'Your wish, master?'"));
}
bool old_target_pet = target_pet;
target_pet = TRUE;
- result = get_aim_dir(&dir);
+ result = get_aim_dir(caster_ptr, &dir);
/* Restore target_pet option */
target_pet = old_target_pet;
if (!result) return NULL;
- speed_monster(dir, plev);
+ speed_monster(caster_ptr, dir, plev);
}
}
break;
case 12:
if (name) return _("テレポート・レベル", "Teleport Level");
- if (desc) return _("瞬時に上か下の階にテレポートする。", "Teleport to up or down stairs in a moment.");
+ if (desc) return _("瞬時に上か下の階にテレポートする。", "Instantly teleports you up or down a level.");
{
if (cast)
{
if (!get_check(_("本当に他の階にテレポートしますか?", "Are you sure? (Teleport Level)"))) return NULL;
- teleport_level(0);
+ teleport_level(caster_ptr, 0);
}
}
break;
case 13:
if (name) return _("次元の扉", "Dimension Door");
- if (desc) return _("短距離内の指定した場所にテレポートする。", "Teleport to given location.");
+ if (desc) return _("短距離内の指定した場所にテレポートする。", "Teleports you to a given location.");
{
POSITION range = plev / 2 + 10;
if (cast)
{
msg_print(_("次元の扉が開いた。目的地を選んで下さい。", "You open a dimensional gate. Choose a destination."));
- if (!dimension_door()) return NULL;
+ if (!dimension_door(caster_ptr)) return NULL;
}
}
break;
case 14:
if (name) return _("帰還の呪文", "Word of Recall");
if (desc) return _("地上にいるときはダンジョンの最深階へ、ダンジョンにいるときは地上へと移動する。",
- "Recalls player from dungeon to town, or from town to the deepest level of dungeon.");
+ "Recalls player from dungeon to town or from town to the deepest level of dungeon.");
{
int base = 15;
if (cast)
{
- if (!recall_player(p_ptr, randint0(21) + 15)) return NULL;
+ if (!recall_player(caster_ptr, randint0(21) + 15)) return NULL;
}
}
break;
if (cast)
{
- banish_monsters(power);
+ banish_monsters(caster_ptr, power);
}
}
break;
/* HACK -- No range limit */
project_length = -1;
- result = get_aim_dir(&dir);
+ result = get_aim_dir(caster_ptr, &dir);
/* Restore range to default */
project_length = 0;
if (!result) return NULL;
- teleport_swap(dir);
+ teleport_swap(caster_ptr, dir);
}
}
break;
if (cast || fail)
{
msg_print(_("あなたはアンデッドのカードに集中する...", "You concentrate on the trump of an undead creature..."));
- if (trump_summoning(1, !fail, p_ptr->y, p_ptr->x, 0, SUMMON_UNDEAD, 0L))
+ if (trump_summoning(caster_ptr, 1, !fail, caster_ptr->y, caster_ptr->x, 0, SUMMON_UNDEAD, 0L))
{
if (fail)
{
break;
case 18:
- if (name) return _("爬虫類のカード", "Trump Reptiles");
+ if (name) return _("爬虫類のカード", "Trump Reptile");
if (desc) return _("1体のヒドラを召喚する。", "Summons a hydra.");
{
if (cast || fail)
{
msg_print(_("あなたは爬虫類のカードに集中する...", "You concentrate on the trump of a reptile..."));
- if (trump_summoning(1, !fail, p_ptr->y, p_ptr->x, 0, SUMMON_HYDRA, 0L))
+ if (trump_summoning(caster_ptr, 1, !fail, caster_ptr->y, caster_ptr->x, 0, SUMMON_HYDRA, 0L))
{
if (fail)
{
{
int type;
msg_print(_("あなたはモンスターのカードに集中する...", "You concentrate on several trumps at once..."));
- if (p_ptr->pclass == CLASS_BEASTMASTER)
+ if (caster_ptr->pclass == CLASS_BEASTMASTER)
type = SUMMON_LIVING;
else
type = 0;
- if (trump_summoning((1 + (plev - 15) / 10), !fail, p_ptr->y, p_ptr->x, 0, type, 0L))
+ if (trump_summoning(caster_ptr, (1 + (plev - 15) / 10), !fail, caster_ptr->y, caster_ptr->x, 0, type, 0L))
{
if (fail)
{
if (cast || fail)
{
msg_print(_("あなたはハウンドのカードに集中する...", "You concentrate on the trump of a hound..."));
- if (trump_summoning(1, !fail, p_ptr->y, p_ptr->x, 0, SUMMON_HOUND, PM_ALLOW_GROUP))
+ if (trump_summoning(caster_ptr, 1, !fail, caster_ptr->y, caster_ptr->x, 0, SUMMON_HOUND, PM_ALLOW_GROUP))
{
if (fail)
{
{
if (cast)
{
- brand_weapon(5);
+ brand_weapon(caster_ptr, 5);
}
}
break;
if (name) return _("人間トランプ", "Living Trump");
if (desc) return _("ランダムにテレポートする突然変異か、自分の意思でテレポートする突然変異が身につく。",
"Gives mutation which makes you teleport randomly or makes you able to teleport at will.");
- if (cast) become_living_trump(p_ptr);
+ if (cast) become_living_trump(caster_ptr);
break;
case 23:
if (cast || fail)
{
msg_print(_("あなたはサイバーデーモンのカードに集中する...", "You concentrate on the trump of a Cyberdemon..."));
- if (trump_summoning(1, !fail, p_ptr->y, p_ptr->x, 0, SUMMON_CYBER, 0L))
+ if (trump_summoning(caster_ptr, 1, !fail, caster_ptr->y, caster_ptr->x, 0, SUMMON_CYBER, 0L))
{
if (fail)
{
if (cast)
{
- detect_all(rad);
+ detect_all(caster_ptr, rad);
}
}
break;
{
if (cast)
{
- if (!identify_fully(FALSE)) return NULL;
+ if (!identify_fully(caster_ptr, FALSE, 0)) return NULL;
}
}
break;
case 26:
if (name) return _("回復モンスター", "Heal Monster");
- if (desc) return _("モンスター1体の体力を回復させる。", "Heal a monster.");
+ if (desc) return _("モンスター1体の体力を回復させる。", "Heals a monster.");
{
int heal = plev * 10 + 200;
bool old_target_pet = target_pet;
target_pet = TRUE;
- result = get_aim_dir(&dir);
+ result = get_aim_dir(caster_ptr, &dir);
/* Restore target_pet option */
target_pet = old_target_pet;
if (!result) return NULL;
- heal_monster(dir, heal);
+ heal_monster(caster_ptr, dir, heal);
}
}
break;
if (cast || fail)
{
msg_print(_("あなたはドラゴンのカードに集中する...", "You concentrate on the trump of a dragon..."));
- if (trump_summoning(1, !fail, p_ptr->y, p_ptr->x, 0, SUMMON_DRAGON, 0L))
+ if (trump_summoning(caster_ptr, 1, !fail, caster_ptr->y, caster_ptr->x, 0, SUMMON_DRAGON, 0L))
{
if (fail)
{
case 28:
if (name) return _("隕石のカード", "Trump Meteor");
- if (desc) return _("自分の周辺に隕石を落とす。", "Makes meteor balls fall down to nearby random locations.");
+ if (desc) return _("自分の周辺に隕石を落とす。", "Causes meteorites to fall down on nearby random locations.");
{
HIT_POINT dam = plev * 2;
if (cast)
{
- cast_meteor(dam, rad);
+ cast_meteor(caster_ptr, dam, rad);
}
}
break;
if (cast || fail)
{
msg_print(_("あなたはデーモンのカードに集中する...", "You concentrate on the trump of a demon..."));
- if (trump_summoning(1, !fail, p_ptr->y, p_ptr->x, 0, SUMMON_DEMON, 0L))
+ if (trump_summoning(caster_ptr, 1, !fail, caster_ptr->y, caster_ptr->x, 0, SUMMON_DEMON, 0L))
{
if (fail)
{
{
msg_print(_("あなたは強力なアンデッドのカードに集中する...", "You concentrate on the trump of a greater undead being..."));
/* May allow unique depend on level and dice roll */
- if (trump_summoning(1, !fail, p_ptr->y, p_ptr->x, 0, SUMMON_HI_UNDEAD, PM_ALLOW_UNIQUE))
+ if (trump_summoning(caster_ptr, 1, !fail, caster_ptr->y, caster_ptr->x, 0, SUMMON_HI_UNDEAD, PM_ALLOW_UNIQUE))
{
if (fail)
{
{
int type;
- if (p_ptr->pclass == CLASS_BEASTMASTER)
+ if (caster_ptr->pclass == CLASS_BEASTMASTER)
type = SUMMON_HI_DRAGON_LIVING;
else
type = SUMMON_HI_DRAGON;
msg_print(_("あなたは古代ドラゴンのカードに集中する...", "You concentrate on the trump of an ancient dragon..."));
/* May allow unique depend on level and dice roll */
- if (trump_summoning(1, !fail, p_ptr->y, p_ptr->x, 0, type, PM_ALLOW_UNIQUE))
+ if (trump_summoning(caster_ptr, 1, !fail, caster_ptr->y, caster_ptr->x, 0, type, PM_ALLOW_UNIQUE))
{
if (fail)
{