*/
#include "angband.h"
+#include "spells-summon.h"
+#include "projection.h"
+#include "avatar.h"
+#include "spells-status.h"
+#include "cmd-spell.h"
+#include "player-status.h"
#define pseudo_plev() (((p_ptr->lev + 40) * (p_ptr->lev + 40) - 1550) / 130) /*!< モンスター魔法をプレイヤーが使用する場合の換算レベル */
* @param tmp 返すメッセージを格納する配列
* @return なし
*/
-void set_bluemage_damage(int SPELL_NUM, PLAYER_LEVEL plev, cptr msg, char* tmp)
+void set_bluemage_damage(int SPELL_NUM, PLAYER_LEVEL plev, concptr msg, char* tmp)
{
int base_damage = monspell_bluemage_damage(SPELL_NUM, plev, BASE_DAM);
int dice_num = monspell_bluemage_damage(SPELL_NUM, plev, DICE_NUM);
int dice_div = monspell_bluemage_damage(SPELL_NUM, plev, DICE_DIV);
char dmg_str[80];
dice_to_string(base_damage, dice_num, dice_side, dice_mult, dice_div, dmg_str);
- sprintf(tmp, msg, dmg_str);
+ sprintf(tmp, " %s %s", msg, dmg_str);
}
/*!
{
PLAYER_LEVEL plev = pseudo_plev();
-#ifdef JP
- cptr s_dam = " 損傷:%s";
- cptr s_dur = "期間:";
- cptr s_range = "範囲:";
- cptr s_heal = " 回復:%s";
-#else
- cptr s_dam = " dam %s";
- cptr s_dur = "dur ";
- cptr s_range = "range ";
- cptr s_heal = " heal %s";
-#endif
-
strcpy(p, "");
switch (power)
case MS_BALL_MANA:
case MS_BALL_DARK:
case MS_STARBURST:
- set_bluemage_damage((power), plev, s_dam, p); break;
+ set_bluemage_damage((power), plev, KWD_DAM, p); break;
case MS_DISPEL:
break;
case MS_ROCKET:
case MS_BALL_POIS:
case MS_BALL_NETHER:
case MS_BALL_WATER:
- set_bluemage_damage((power), plev, s_dam, p); break;
+ set_bluemage_damage((power), plev, KWD_DAM, p); break;
case MS_DRAIN_MANA:
- set_bluemage_damage((power), plev, s_heal, p); break;
+ set_bluemage_damage((power), plev, KWD_HEAL, p); break;
case MS_MIND_BLAST:
case MS_BRAIN_SMASH:
case MS_CAUSE_1:
case MS_BOLT_PLASMA:
case MS_BOLT_ICE:
case MS_MAGIC_MISSILE:
- set_bluemage_damage((power), plev, s_dam, p); break;
+ set_bluemage_damage((power), plev, KWD_DAM, p); break;
case MS_SPEED:
- sprintf(p, " %sd%d+%d", s_dur, 20+plev, plev);
+ sprintf(p, " %sd%d+%d", KWD_DURATION, 20+plev, plev);
break;
case MS_HEAL:
- set_bluemage_damage((power), plev, s_heal, p); break;
+ set_bluemage_damage((power), plev, KWD_HEAL, p); break;
case MS_INVULNER:
- sprintf(p, " %sd7+7", s_dur);
+ sprintf(p, " %sd7+7", KWD_DURATION);
break;
case MS_BLINK:
- sprintf(p, " %s10", s_range);
+ sprintf(p, " %s10", KWD_SPHERE);
break;
case MS_TELEPORT:
- sprintf(p, " %s%d", s_range, plev * 5);
+ sprintf(p, " %s%d", KWD_SPHERE, plev * 5);
break;
case MS_PSY_SPEAR:
- set_bluemage_damage((power), plev, s_dam, p); break;
+ set_bluemage_damage((power), plev, KWD_DAM, p); break;
break;
case MS_RAISE_DEAD:
- sprintf(p, " %s5", s_range);
+ sprintf(p, " %s5", KWD_SPHERE);
break;
default:
break;
* when you run it. It's probably easy to fix but I haven't tried,\n
* sorry.\n
*/
-static int get_learned_power(SPELL_IDX *sn)
+static bool get_learned_power(SPELL_IDX *sn)
{
int i = 0;
int num = 0;
- int y = 1;
- int x = 18;
+ TERM_LEN y = 1;
+ TERM_LEN x = 18;
PERCENTAGE minfail = 0;
PLAYER_LEVEL plev = p_ptr->lev;
PERCENTAGE chance = 0;
char choice;
char out_val[160];
char comment[80];
- s32b f4 = 0, f5 = 0, f6 = 0;
- cptr p = _("魔法", "magic");
+ BIT_FLAGS f4 = 0L, f5 = 0L, f6 = 0L;
+ concptr p = _("魔法", "magic");
COMMAND_CODE code;
monster_power spell;
bool flag, redraw;
if (repeat_pull(&code))
{
- /* Success */
+ *sn = (SPELL_IDX)code;
return (TRUE);
}
- *sn = (SPELL_IDX)code;
if (use_menu)
{
while(!mode)
{
-#ifdef JP
- prt(format(" %s ボルト", (menu_line == 1) ? "》" : " "), 2, 14);
- prt(format(" %s ボール", (menu_line == 2) ? "》" : " "), 3, 14);
- prt(format(" %s ブレス", (menu_line == 3) ? "》" : " "), 4, 14);
- prt(format(" %s 召喚", (menu_line == 4) ? "》" : " "), 5, 14);
- prt(format(" %s その他", (menu_line == 5) ? "》" : " "), 6, 14);
- prt("どの種類の魔法を使いますか?", 0, 0);
-#else
- prt(format(" %s bolt", (menu_line == 1) ? "> " : " "), 2, 14);
- prt(format(" %s ball", (menu_line == 2) ? "> " : " "), 3, 14);
- prt(format(" %s breath", (menu_line == 3) ? "> " : " "), 4, 14);
- prt(format(" %s sommoning", (menu_line == 4) ? "> " : " "), 5, 14);
- prt(format(" %s others", (menu_line == 5) ? "> " : " "), 6, 14);
- prt("use which type of magic? ", 0, 0);
-#endif
+ prt(format(_(" %s ボルト", " %s bolt"), (menu_line == 1) ? _("》", "> ") : " "), 2, 14);
+ prt(format(_(" %s ボール", " %s ball"), (menu_line == 2) ? _("》", "> ") : " "), 3, 14);
+ prt(format(_(" %s ブレス", " %s breath"), (menu_line == 3) ? _("》", "> ") : " "), 4, 14);
+ prt(format(_(" %s 召喚", " %s sommoning"), (menu_line == 4) ? _("》", "> ") : " "), 5, 14);
+ prt(format(_(" %s その他", " %s others"), (menu_line == 5) ? _("》", "> ") : " "), 6, 14);
+ prt(_("どの種類の魔法を使いますか?", "use which type of magic? "), 0, 0);
+
choice = inkey();
switch(choice)
{
}
/* Build a prompt (accept all spells) */
- (void)strnfmt(out_val, 78,
- _("(%c-%c, '*'で一覧, ESC) どの%sを唱えますか?", "(%c-%c, *=List, ESC=exit) Use which %s? "),
- I2A(0), I2A(num - 1), p);
+ (void)strnfmt(out_val, 78, _("(%c-%c, '*'で一覧, ESC) どの%sを唱えますか?", "(%c-%c, *=List, ESC=exit) Use which %s? "),
+ I2A(0), I2A(num - 1), p);
if (use_menu) screen_save();
/* Show list */
redraw = TRUE;
-
- /* Save the screen */
if (!use_menu) screen_save();
/* Display a list of spells */
{
/* Hide list */
redraw = FALSE;
-
- /* Restore the screen */
screen_load();
}
/* Stop the loop */
flag = TRUE;
}
-
- /* Restore the screen */
if (redraw) screen_load();
p_ptr->window |= (PW_SPELL);
MONSTER_IDX m_idx;
if (!target_set(TARGET_KILL)) return FALSE;
- m_idx = cave[target_row][target_col].m_idx;
+ m_idx = current_floor_ptr->grid_array[target_row][target_col].m_idx;
if (!m_idx) break;
if (!player_has_los_bold(target_row, target_col)) break;
if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break;
teleport_player(plev * 5, 0L);
break;
case MS_WORLD:
- world_player = TRUE;
- msg_print(_("「時よ!」", "'Time!'"));
- msg_print(NULL);
-
- /* Hack */
- p_ptr->energy_need -= 1000 + (100 + randint1(200)+200)*TURNS_PER_TICK/10;
-
- p_ptr->redraw |= (PR_MAP);
- p_ptr->update |= (PU_MONSTERS);
-
- p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
-
- handle_stuff();
+ (void)time_walk(p_ptr);
break;
case MS_SPECIAL:
break;
{
monster_type *m_ptr;
monster_race *r_ptr;
- char m_name[80];
+ GAME_TEXT m_name[MAX_NLEN];
if (!target_set(TARGET_KILL)) return FALSE;
- if (!cave[target_row][target_col].m_idx) break;
+ if (!current_floor_ptr->grid_array[target_row][target_col].m_idx) break;
if (!player_has_los_bold(target_row, target_col)) break;
if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break;
- m_ptr = &m_list[cave[target_row][target_col].m_idx];
+ m_ptr = &m_list[current_floor_ptr->grid_array[target_row][target_col].m_idx];
r_ptr = &r_info[m_ptr->r_idx];
monster_desc(m_name, m_ptr, 0);
if (r_ptr->flagsr & RFR_RES_TELE)
}
}
msg_format(_("%sを引き戻した。", "You command %s to return."), m_name);
- teleport_monster_to(cave[target_row][target_col].m_idx, p_ptr->y, p_ptr->x, 100, TELEPORT_PASSIVE);
+ teleport_monster_to(current_floor_ptr->grid_array[target_row][target_col].m_idx, p_ptr->y, p_ptr->x, 100, TELEPORT_PASSIVE);
break;
}
case MS_TELE_AWAY:
(void)fire_beam(GF_AWAY_ALL, dir, 100);
break;
- case MS_TELE_LEVEL:
- {
- MONSTER_IDX target_m_idx;
- monster_type *m_ptr;
- monster_race *r_ptr;
- char m_name[80];
- if (!target_set(TARGET_KILL)) return FALSE;
- target_m_idx = cave[target_row][target_col].m_idx;
- if (!target_m_idx) break;
- if (!player_has_los_bold(target_row, target_col)) break;
- if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break;
- m_ptr = &m_list[target_m_idx];
- r_ptr = &r_info[m_ptr->r_idx];
- monster_desc(m_name, m_ptr, 0);
- msg_format(_("%^sの足を指さした。", "You gesture at %^s's feet."), m_name);
-
- if ((r_ptr->flagsr & (RFR_EFF_RES_NEXU_MASK | RFR_RES_TELE)) ||
- (r_ptr->flags1 & RF1_QUESTOR) || (r_ptr->level + randint1(50) > plev + randint1(60)))
- {
- msg_format(_("しかし効果がなかった!", "%^s is unaffected!"), m_name);
- }
- else teleport_level(target_m_idx);
+ case MS_TELE_LEVEL:
+ return teleport_level_other(p_ptr);
break;
- }
+
case MS_PSY_SPEAR:
if (!get_aim_dir(&dir)) return FALSE;
msg_print(_("サイバーデーモンを召喚した!", "You summon a Cyberdemon!"));
for (k = 0 ;k < 1 ; k++)
- if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_CYBER, p_mode))
+ if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_CYBER, p_mode, '\0'))
{
if (!pet)
msg_print(_("召喚されたサイバーデーモンは怒っている!", "The summoned Cyberdemon are angry!"));
int k;
msg_print(_("仲間を召喚した。", "You summon help."));
for (k = 0;k < 1; k++)
- if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, 0, p_mode))
+ if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, 0, p_mode, '\0'))
{
if (!pet)
msg_print(_("召喚されたモンスターは怒っている!", "The summoned monster is angry!"));
int k;
msg_print(_("モンスターを召喚した!", "You summon monsters!"));
for (k = 0;k < plev / 15 + 2; k++)
- if(summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, 0, (p_mode | u_mode)))
+ if(summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, 0, (p_mode | u_mode), '\0'))
{
if (!pet)
msg_print(_("召喚されたモンスターは怒っている!", "The summoned monsters are angry!"));
{
int k;
msg_print(_("アリを召喚した。", "You summon ants."));
- for (k = 0;k < 1; k++)
- if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_ANT, (PM_ALLOW_GROUP | p_mode)))
+ for (k = 0; k < 1; k++)
+ if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_ANT, (PM_ALLOW_GROUP | p_mode), '\0'))
{
if (!pet)
msg_print(_("召喚されたアリは怒っている!", "The summoned ants are angry!"));
int k;
msg_print(_("蜘蛛を召喚した。", "You summon spiders."));
for (k = 0;k < 1; k++)
- if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_SPIDER, (PM_ALLOW_GROUP | p_mode)))
+ if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_SPIDER, (PM_ALLOW_GROUP | p_mode), '\0'))
{
if (!pet)
msg_print(_("召喚された蜘蛛は怒っている!", "Summoned spiders are angry!"));
int k;
msg_print(_("ハウンドを召喚した。", "You summon hounds."));
for (k = 0;k < 1; k++)
- if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_HOUND, (PM_ALLOW_GROUP | p_mode)))
+ if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_HOUND, (PM_ALLOW_GROUP | p_mode), '\0'))
{
if (!pet)
msg_print(_("召喚されたハウンドは怒っている!", "Summoned hounds are angry!"));
int k;
msg_print(_("ヒドラを召喚した。", "You summon a hydras."));
for (k = 0;k < 1; k++)
- if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_HYDRA, (g_mode | p_mode)))
+ if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_HYDRA, (g_mode | p_mode), '\0'))
{
if (!pet)
msg_print(_("召喚されたヒドラは怒っている!", "Summoned hydras are angry!"));
int k;
msg_print(_("天使を召喚した!", "You summon an angel!"));
for (k = 0;k < 1; k++)
- if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_ANGEL, (g_mode | p_mode)))
+ if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_ANGEL, (g_mode | p_mode), '\0'))
{
if (!pet)
msg_print(_("召喚された天使は怒っている!", "Summoned angels are angry!"));
int k;
msg_print(_("混沌の宮廷から悪魔を召喚した!", "You summon a demon from the Courts of Chaos!"));
for (k = 0;k < 1; k++)
- if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_DEMON, (g_mode | p_mode)))
+ if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_DEMON, (g_mode | p_mode), '\0'))
{
if (!pet)
msg_print(_("召喚されたデーモンは怒っている!", "Summoned demons are angry!"));
int k;
msg_print(_("アンデッドの強敵を召喚した!", "You summon an undead adversary!"));
for (k = 0;k < 1; k++)
- if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_UNDEAD, (g_mode | p_mode)))
+ if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_UNDEAD, (g_mode | p_mode), '\0'))
{
if (!pet)
msg_print(_("召喚されたアンデッドは怒っている!", "Summoned undeads are angry!"));
int k;
msg_print(_("ドラゴンを召喚した!", "You summon a dragon!"));
for (k = 0;k < 1; k++)
- if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_DRAGON, (g_mode | p_mode)))
+ if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_DRAGON, (g_mode | p_mode), '\0'))
{
if (!pet)
msg_print(_("召喚されたドラゴンは怒っている!", "Summoned dragons are angry!"));
int k;
msg_print(_("強力なアンデッドを召喚した!", "You summon a greater undead!"));
for (k = 0;k < 1; k++)
- if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_HI_UNDEAD, (g_mode | p_mode | u_mode)))
+ if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_HI_UNDEAD, (g_mode | p_mode | u_mode), '\0'))
{
if (!pet)
msg_print(_("召喚された上級アンデッドは怒っている!", "Summoned greater undeads are angry!"));
int k;
msg_print(_("古代ドラゴンを召喚した!", "You summon an ancient dragon!"));
for (k = 0;k < 1; k++)
- if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_HI_DRAGON, (g_mode | p_mode | u_mode)))
+ if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_HI_DRAGON, (g_mode | p_mode | u_mode), '\0'))
{
if (!pet)
msg_print(_("召喚された古代ドラゴンは怒っている!", "Summoned ancient dragons are angry!"));
int k;
msg_print(_("アンバーの王族を召喚した!", "You summon a Lord of Amber!"));
for (k = 0;k < 1; k++)
- if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_AMBERITES, (g_mode | p_mode | u_mode)))
+ if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_AMBERITES, (g_mode | p_mode | u_mode), '\0'))
{
if (!pet)
msg_print(_("召喚されたアンバーの王族は怒っている!", "Summoned Lords of Amber are angry!"));
int k, count = 0;
msg_print(_("特別な強敵を召喚した!", "You summon a special opponent!"));
for (k = 0;k < 1; k++)
- if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_UNIQUE, (g_mode | p_mode | PM_ALLOW_UNIQUE)))
+ if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_UNIQUE, (g_mode | p_mode | PM_ALLOW_UNIQUE), '\0'))
{
count++;
if (!pet)
msg_print(_("召喚されたユニーク・モンスターは怒っている!", "Summoned special opponents are angry!"));
}
for (k = count;k < 1; k++)
- if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_HI_UNDEAD, (g_mode | p_mode | PM_ALLOW_UNIQUE)))
+ if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, summon_lev, SUMMON_HI_UNDEAD, (g_mode | p_mode | PM_ALLOW_UNIQUE), '\0'))
{
count++;
if (!pet)
bool cast;
MANA_POINT need_mana;
-
- /* not if confused */
- if (p_ptr->confused)
- {
- msg_print(_("混乱していて唱えられない!", "You are too confused!"));
- return TRUE;
- }
+ if (cmd_limit_confused(p_ptr)) return FALSE;
/* get power */
if (!get_learned_power(&n)) return FALSE;
}
}
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);
p_ptr->redraw |= (PR_MANA);
- p_ptr->window |= (PW_PLAYER);
- p_ptr->window |= (PW_SPELL);
+ p_ptr->window |= (PW_PLAYER | PW_SPELL);
return TRUE;
}
*/
/*
*/
-void set_rf_masks(s32b *f4, s32b *f5, s32b *f6, BIT_FLAGS mode)
+void set_rf_masks(BIT_FLAGS *f4, BIT_FLAGS *f5, BIT_FLAGS *f6, BIT_FLAGS mode)
{
switch (mode)
{