/********************************************************************** * Leprechaun Spells and Abilities **********************************************************************/ void _fanaticism_spell(int cmd, variant *res) { switch (cmd) { case SPELL_NAME: var_set_string(res, "Fanaticism"); break; case SPELL_DESC: var_set_string(res, "Summon many devoted leprechaun servants at chosen foe."); break; case SPELL_CAST: { int x, y, i; var_set_bool(res, FALSE); if (!target_set(TARGET_KILL)) return; x = target_col; y = target_row; for (i = 0; i < 8; i++) summon_named_creature(-1, y, x, MON_LEPRECHAUN_FANATIC, PM_FORCE_PET); var_set_bool(res, TRUE); break; } default: default_spell(cmd, res); break; } }
/* * Look command */ void do_cmd_look(void) { /* Look around */ if (target_set(TARGET_LOOK)) { msg_print("Target Selected."); } }
void _grasp_spell(int cmd, variant *res) { switch (cmd) { case SPELL_NAME: var_set_string(res, "Vampiric Grasp"); break; case SPELL_DESC: var_set_string(res, "Pulls a target creature to you."); break; case SPELL_CAST: { int m_idx; bool fear = FALSE; monster_type *m_ptr; monster_race *r_ptr; char m_name[MAX_NLEN]; var_set_bool(res, FALSE); if (!target_set(TARGET_KILL)) break; if (!cave[target_row][target_col].m_idx) break; if (!player_has_los_bold(target_row, target_col)) break; if (!projectable(py, px, target_row, target_col)) break; var_set_bool(res, TRUE); m_idx = cave[target_row][target_col].m_idx; m_ptr = &m_list[m_idx]; r_ptr = &r_info[m_ptr->r_idx]; monster_desc(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(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE; msg_format("%s is unaffected!", m_name); break; } else if (r_ptr->level > randint1(100)) { if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE; msg_format("%s resists!", m_name); break; } } msg_format("You grasp %s.", m_name); teleport_monster_to(m_idx, py, px, 100, TELEPORT_PASSIVE); mon_take_hit(m_idx, damroll(10, 10), &fear, extract_note_dies(real_r_ptr(m_ptr))); break; } default: default_spell(cmd, res); break; } }
/* * do_cmd_cast calls this function if the player's class * is 'imitator'. */ static bool use_mane(int spell) { int dir; int plev = p_ptr->lev; u32b mode = (PM_ALLOW_GROUP | PM_FORCE_PET); u32b u_mode = 0L; if (randint1(50+plev) < plev/10) u_mode = PM_ALLOW_UNIQUE; /* spell code */ switch (spell) { case MS_SHRIEK: #ifdef JP msg_print("かん高い金切り声をあげた。"); #else msg_print("You make a high pitched shriek."); #endif aggravate_monsters(0); break; case MS_XXX1: break; case MS_DISPEL: { int m_idx; if (!target_set(TARGET_KILL)) return FALSE; m_idx = cave[target_row][target_col].m_idx; if (!m_idx) break; if (!player_has_los_bold(target_row, target_col)) break; if (!projectable(py, px, target_row, target_col)) break; dispel_monster_status(m_idx); break; } case MS_ROCKET: if (!get_aim_dir(&dir)) return FALSE; #ifdef JP else msg_print("ロケットを発射した。"); #else else msg_print("You fire a rocket."); #endif fire_rocket(GF_ROCKET, dir, damage, 2); break; case MS_SHOOT: if (!get_aim_dir(&dir)) return FALSE; #ifdef JP else msg_print("矢を放った。"); #else else msg_print("You fire an arrow.");
/* * Look command */ void do_cmd_look(void) { /* Look around */ if (target_set(TARGET_LOOK)) { #ifdef JP msg_print("ターゲット決定。"); #else msg_print("Target Selected."); #endif } }
/* * Target command */ void do_cmd_target(void) { /* Target set */ if (target_set(TARGET_KILL)) { msg_print("Target Selected."); } /* Target aborted */ else { msg_print("Target Aborted."); } }
bool duelist_issue_challenge(void) { bool result = FALSE; int m_idx = 0; if (target_set(TARGET_MARK)) { msg_flag = FALSE; /* Bug ... we get an extra -more- prompt after target_set() ... */ if (target_who > 0) m_idx = target_who; else m_idx = cave[target_row][target_col].m_idx; } if (m_idx) { if (m_idx == p_ptr->duelist_target_idx) msg_format("%^s has already been challenged.", duelist_current_challenge()); else { /* of course, we must first set the target index before duelist_current_challenge() will return the correct text */ p_ptr->duelist_target_idx = m_idx; msg_format("You challenge %s to a duel!", duelist_current_challenge()); set_monster_csleep(m_idx, 0); set_hostile(&m_list[m_idx]); result = TRUE; } } else if (p_ptr->duelist_target_idx) { p_ptr->duelist_target_idx = 0; msg_print("You cancel your current challenge!"); } p_ptr->redraw |= PR_STATUS; return result; }
static void _summon_commando_team_spell(int cmd, variant *res) { switch (cmd) { case SPELL_NAME: var_set_string(res, "Summon Commando Team"); break; case SPELL_DESC: var_set_string(res, "Summons Grand Master Mystics for assistance."); break; case SPELL_CAST: { int num = 1 + randint1(2); int mode = PM_FORCE_PET; int i, x, y; var_set_bool(res, FALSE); if (p_ptr->shero) mode |= PM_HASTE; if (!target_set(TARGET_KILL)) return; x = target_col; y = target_row; for (i = 0; i < num; i++) { summon_named_creature(-1, y, x, MON_G_MASTER_MYS, mode); } var_set_bool(res, TRUE); break; } default: default_spell(cmd, res); break; } }
/* * Target command */ void do_cmd_target(void) { /* Target set */ if (target_set(TARGET_KILL)) { #ifdef JP msg_print("ターゲット決定。"); #else msg_print("Target Selected."); #endif } /* Target aborted */ else { #ifdef JP msg_print("ターゲット解除。"); #else msg_print("Target Aborted."); #endif } }
int context_menu_player(int mx, int my) { menu_type *m; rect_region r; int selected; char *labels; cave_type *c_ptr = area(p_ptr->px,p_ptr->py); pcave_type *pc_ptr = parea(p_ptr->px,p_ptr->py); feature_type *feat; m = menu_dynamic_new(); if (!m) { return 0; } labels = (char*)string_make(lower_case); m->selections = labels; feat = &(f_info[c_ptr->feat]); menu_dynamic_add_label(m, "Use Item", 'u', 1, labels); /* if player can cast, add casting option */ if (player_is_caster()) { if (player_can_cast()) { menu_dynamic_add_label(m, "Cast", 'm', 2, labels); } else { menu_dynamic_add_label(m, "$Cast", 'm', 2, labels); } } /* if player can use racial powers or mutations, add option */ if (player_has_power()) { if (player_can_use_power()) { menu_dynamic_add_label(m, "Use Power", 'U', 16, labels); } else { menu_dynamic_add_label(m, "$Use Power", 'U', 16, labels); } } /* if player is on stairs add option to use them */ if (feat->flags & FF_EXIT_UP) { menu_dynamic_add_label(m, "Go Up", '<', 11, labels); } if (feat->flags & FF_EXIT_DOWN) { menu_dynamic_add_label(m, "Go Down", '>', 12, labels); } menu_dynamic_add_label(m, "Search", 's', 3, labels); menu_dynamic_add_label(m, "Look", 'l', 6, labels); menu_dynamic_add_label(m, "Rest", 'R', 4, labels); menu_dynamic_add_label(m, "Inventory", 'i', 5, labels); /* if object under player add pickup option */ if (c_ptr->o_idx) { object_type *o_ptr = &(o_list[c_ptr->o_idx]); //if (!squelch_item_ok(o_ptr)) { menu_dynamic_add_label(m, "Floor", 'i', 13, labels); if (inven_carry_okay(o_ptr)) { menu_dynamic_add_label(m, "Pickup", 'g', 14, labels); } else { menu_dynamic_add_label(m, "$Pickup", 'g', 14, labels); } //} } menu_dynamic_add_label(m, "Character", 'C', 7, labels); /* XXX Don't show the keymap line until the keymap list is implemented, to * avoid confusion as to what should be there */ /*menu_dynamic_add(m, "Keymaps", 10);*/ if (!OPT(center_player)) { menu_dynamic_add_label(m, "^Center Map", 'L', 15, labels); } menu_dynamic_add_label(m, "Other", ' ', 9, labels); /* work out display region */ r.width = menu_dynamic_longest_entry(m) + 3 + 2; /* +3 for tag, 2 for pad */ if (mx > Term->wid - r.width - 1) { r.col = Term->wid - r.width - 1; } else { r.col = mx + 1; } r.page_rows = m->count; if (my > Term->hgt - r.page_rows - 1) { if (my - r.page_rows - 1 <= 0) { /* menu has too many items, so put in upper right corner */ r.row = 1; r.col = Term->wid - r.width - 1; } else { r.row = Term->hgt - r.page_rows - 1; } } else { r.row = my + 1; } /* Hack -- no flush needed */ msg_flag = FALSE; screen_save(); button_backup_all(TRUE); menu_layout(m, &r); rect_region_erase_bordered(&r); prtf(0, 0, "($UEnter to select$Y\n$V, $UESC$Y%c$V) Command:", ESCAPE); selected = menu_dynamic_select(m); menu_dynamic_free(m); string_free(labels); button_restore(); screen_load(); switch(selected) { case 1: { /* use an item */ p_ptr->cmd.cmd = 'u'; repeat_check(); do_cmd_use(); } break; case 2: { /* Cast a spell */ p_ptr->cmd.cmd = 'm'; repeat_check(); do_cmd_cast_wrapper(); } break; case 3: { /* search */ p_ptr->cmd.cmd = 's'; repeat_check(); do_cmd_search(); } break; case 4: { /* rest */ p_ptr->cmd.cmd = 'R'; repeat_check(); do_cmd_rest(); } break; case 5: { /* show inventory screen */ Term_keypress('i');//,0); } break; case 6: { /* look mode */ if (target_set(TARGET_LOOK)) { //if (target_set_interactive(TARGET_LOOK, p_ptr->px, p_ptr->py)) { msgf("Target Selected."); } } break; case 7: { /* show character screen */ do_cmd_character(); } break; case 9: { /* show another layer of menu options screen */ int res; while ((res = context_menu_player_2(mx,my)) == 3); if (res == 2) return 3; } break; case 10: { /* show the commands */ int res; while ((res = context_menu_command(mx,my)) == 3); if (res == 2) return 3; } break; case 11: { /* go up stairs */ p_ptr->cmd.cmd = '<'; repeat_check(); do_cmd_go_up(); } break; case 12: { /* go down stairs */ p_ptr->cmd.cmd = '>'; repeat_check(); do_cmd_go_down(); } break; case 13: { if (c_ptr->o_idx) { object_type *o_ptr = &(o_list[c_ptr->o_idx]); /* there is an item on the floor, show the inventory screen starting * from the floor */ if (o_ptr->next_o_idx) { do_cmd_inven_floor(); } else { /* if we only have one item, show the context menu directly */ if (o_ptr->k_idx) { /* Track the object kind */ object_kind_track(o_ptr->k_idx); while (context_menu_object(o_ptr) == 2); } } } } break; case 14: { /* pick the item up */ //cmd_insert(CMD_PICKUP); //cmd_set_arg_item(cmd_get_top(), 0, -1); carry(TRUE); } break; case 15: { /* center the map on the player */ /*panel_center(p_ptr->px, p_ptr->py);*/ do_cmd_center_map(); } break; case 16: { /* use character powers */ p_ptr->cmd.cmd = 'U'; repeat_check(); do_cmd_racial_power(); } break; } return 1; }
/*! * @brief 青魔法の発動 / * do_cmd_cast calls this function if the player's class is 'blue-mage'. * @param spell 発動するモンスター攻撃のID * @param success TRUEは成功時、FALSEは失敗時の処理を行う * @return 処理を実行したらTRUE、キャンセルした場合FALSEを返す。 */ static bool cast_learned_spell(int spell, bool success) { int dir; int plev = pseudo_plev(); int summon_lev = p_ptr->lev * 2 / 3 + randint1(p_ptr->lev/2); int damage = 0; bool pet = success; bool no_trump = FALSE; u32b p_mode, u_mode = 0L, g_mode; if (pet) { p_mode = PM_FORCE_PET; g_mode = 0; } else { p_mode = PM_NO_PET; g_mode = PM_ALLOW_GROUP; } if (!success || (randint1(50+plev) < plev/10)) u_mode = PM_ALLOW_UNIQUE; /* spell code */ switch (spell) { case MS_SHRIEK: msg_print(_("かん高い金切り声をあげた。", "You make a high pitched shriek.")); aggravate_monsters(0); break; case MS_XXX1: break; case MS_DISPEL: { int m_idx; if (!target_set(TARGET_KILL)) return FALSE; m_idx = cave[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; dispel_monster_status(m_idx); break; } case MS_ROCKET: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("ロケットを発射した。", "You fire a rocket.")); damage = monspell_bluemage_damage((MS_ROCKET), plev, DAM_ROLL); fire_rocket(GF_ROCKET, dir, damage, 2); break; case MS_SHOOT: { if (!get_aim_dir(&dir)) return FALSE; msg_print(_("矢を放った。", "You fire an arrow.")); damage = monspell_bluemage_damage((MS_SHOOT), plev, DAM_ROLL); fire_bolt(GF_ARROW, dir, damage); break; } case MS_XXX2: break; case MS_XXX3: break; case MS_XXX4: break; case MS_BR_ACID: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("酸のブレスを吐いた。", "You breathe acid.")); damage = monspell_bluemage_damage((MS_BR_ACID), plev, DAM_ROLL); fire_ball(GF_ACID, dir, damage, (plev > 40 ? -3 : -2)); break; case MS_BR_ELEC: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("稲妻のブレスを吐いた。", "You breathe lightning.")); damage = monspell_bluemage_damage((MS_BR_ELEC), plev, DAM_ROLL); fire_ball(GF_ELEC, dir, damage, (plev > 40 ? -3 : -2)); break; case MS_BR_FIRE: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("火炎のブレスを吐いた。", "You breathe fire.")); damage = monspell_bluemage_damage((MS_BR_FIRE), plev, DAM_ROLL); fire_ball(GF_FIRE, dir, damage, (plev > 40 ? -3 : -2)); break; case MS_BR_COLD: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("冷気のブレスを吐いた。", "You breathe frost.")); damage = monspell_bluemage_damage((MS_BR_COLD), plev, DAM_ROLL); fire_ball(GF_COLD, dir, damage, (plev > 40 ? -3 : -2)); break; case MS_BR_POIS: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("ガスのブレスを吐いた。", "You breathe gas.")); damage = monspell_bluemage_damage((MS_BR_POIS), plev, DAM_ROLL); fire_ball(GF_POIS, dir, damage, (plev > 40 ? -3 : -2)); break; case MS_BR_NETHER: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("地獄のブレスを吐いた。", "You breathe nether.")); damage = monspell_bluemage_damage((MS_BR_NETHER), plev, DAM_ROLL); fire_ball(GF_NETHER, dir, damage, (plev > 40 ? -3 : -2)); break; case MS_BR_LITE: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("閃光のブレスを吐いた。", "You breathe light.")); damage = monspell_bluemage_damage((MS_BR_LITE), plev, DAM_ROLL); fire_ball(GF_LITE, dir, damage, (plev > 40 ? -3 : -2)); break; case MS_BR_DARK: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("暗黒のブレスを吐いた。", "You breathe darkness.")); damage = monspell_bluemage_damage((MS_BR_DARK), plev, DAM_ROLL); fire_ball(GF_DARK, dir, damage, (plev > 40 ? -3 : -2)); break; case MS_BR_CONF: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("混乱のブレスを吐いた。", "You breathe confusion.")); damage = monspell_bluemage_damage((MS_BR_CONF), plev, DAM_ROLL); fire_ball(GF_CONFUSION, dir, damage, (plev > 40 ? -3 : -2)); break; case MS_BR_SOUND: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("轟音のブレスを吐いた。", "You breathe sound.")); damage = monspell_bluemage_damage((MS_BR_SOUND), plev, DAM_ROLL); fire_ball(GF_SOUND, dir, damage, (plev > 40 ? -3 : -2)); break; case MS_BR_CHAOS: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("カオスのブレスを吐いた。", "You breathe chaos.")); damage = monspell_bluemage_damage((MS_BR_CHAOS), plev, DAM_ROLL); fire_ball(GF_CHAOS, dir, damage, (plev > 40 ? -3 : -2)); break; case MS_BR_DISEN: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("劣化のブレスを吐いた。", "You breathe disenchantment.")); damage = monspell_bluemage_damage((MS_BR_DISEN), plev, DAM_ROLL); fire_ball(GF_DISENCHANT, dir, damage, (plev > 40 ? -3 : -2)); break; case MS_BR_NEXUS: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("因果混乱のブレスを吐いた。", "You breathe nexus.")); damage = monspell_bluemage_damage((MS_BR_NEXUS), plev, DAM_ROLL); fire_ball(GF_NEXUS, dir, damage, (plev > 40 ? -3 : -2)); break; case MS_BR_TIME: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("時間逆転のブレスを吐いた。", "You breathe time.")); damage = monspell_bluemage_damage((MS_BR_TIME), plev, DAM_ROLL); fire_ball(GF_TIME, dir, damage, (plev > 40 ? -3 : -2)); break; case MS_BR_INERTIA: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("遅鈍のブレスを吐いた。", "You breathe inertia.")); damage = monspell_bluemage_damage((MS_BR_INERTIA), plev, DAM_ROLL); fire_ball(GF_INERTIAL, dir, damage, (plev > 40 ? -3 : -2)); break; case MS_BR_GRAVITY: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("重力のブレスを吐いた。", "You breathe gravity.")); damage = monspell_bluemage_damage((MS_BR_GRAVITY), plev, DAM_ROLL); fire_ball(GF_GRAVITY, dir, damage, (plev > 40 ? -3 : -2)); break; case MS_BR_SHARDS: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("破片のブレスを吐いた。", "You breathe shards.")); damage = monspell_bluemage_damage((MS_BR_SHARDS), plev, DAM_ROLL); fire_ball(GF_SHARDS, dir, damage, (plev > 40 ? -3 : -2)); break; case MS_BR_PLASMA: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("プラズマのブレスを吐いた。", "You breathe plasma.")); damage = monspell_bluemage_damage((MS_BR_PLASMA), plev, DAM_ROLL); fire_ball(GF_PLASMA, dir, damage, (plev > 40 ? -3 : -2)); break; case MS_BR_FORCE: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("フォースのブレスを吐いた。", "You breathe force.")); damage = monspell_bluemage_damage((MS_BR_FORCE), plev, DAM_ROLL); fire_ball(GF_FORCE, dir, damage, (plev > 40 ? -3 : -2)); break; case MS_BR_MANA: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("魔力のブレスを吐いた。", "You breathe mana.")); damage = monspell_bluemage_damage((MS_BR_MANA), plev, DAM_ROLL); fire_ball(GF_MANA, dir, damage, (plev > 40 ? -3 : -2)); break; case MS_BALL_NUKE: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("放射能球を放った。", "You cast a ball of radiation.")); damage = monspell_bluemage_damage((MS_BALL_NUKE), plev, DAM_ROLL); fire_ball(GF_NUKE, dir, damage, 2); break; case MS_BR_NUKE: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("放射性廃棄物のブレスを吐いた。", "You breathe toxic waste.")); damage = monspell_bluemage_damage((MS_BR_NUKE), plev, DAM_ROLL); fire_ball(GF_NUKE, dir, damage, (plev > 40 ? -3 : -2)); break; case MS_BALL_CHAOS: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("純ログルスを放った。", "You invoke a raw Logrus.")); damage = monspell_bluemage_damage((MS_BALL_CHAOS), plev, DAM_ROLL); fire_ball(GF_CHAOS, dir, damage, 4); break; case MS_BR_DISI: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("分解のブレスを吐いた。", "You breathe disintegration.")); damage = monspell_bluemage_damage((MS_BR_DISI), plev, DAM_ROLL); fire_ball(GF_DISINTEGRATE, dir, damage, (plev > 40 ? -3 : -2)); break; case MS_BALL_ACID: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("アシッド・ボールの呪文を唱えた。", "You cast an acid ball.")); damage = monspell_bluemage_damage((MS_BALL_ACID), plev, DAM_ROLL); fire_ball(GF_ACID, dir, damage, 2); break; case MS_BALL_ELEC: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("サンダー・ボールの呪文を唱えた。", "You cast a lightning ball.")); damage = monspell_bluemage_damage((MS_BALL_ELEC), plev, DAM_ROLL); fire_ball(GF_ELEC, dir, damage, 2); break; case MS_BALL_FIRE: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("ファイア・ボールの呪文を唱えた。", "You cast a fire ball.")); damage = monspell_bluemage_damage((MS_BALL_FIRE), plev, DAM_ROLL); fire_ball(GF_FIRE, dir, damage, 2); break; case MS_BALL_COLD: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("アイス・ボールの呪文を唱えた。", "You cast a frost ball.")); damage = monspell_bluemage_damage((MS_BALL_COLD), plev, DAM_ROLL); fire_ball(GF_COLD, dir, damage, 2); break; case MS_BALL_POIS: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("悪臭雲の呪文を唱えた。", "You cast a stinking cloud.")); damage = monspell_bluemage_damage((MS_BALL_POIS), plev, DAM_ROLL); fire_ball(GF_POIS, dir, damage, 2); break; case MS_BALL_NETHER: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("地獄球の呪文を唱えた。", "You cast a nether ball.")); damage = monspell_bluemage_damage((MS_BALL_NETHER), plev, DAM_ROLL); fire_ball(GF_NETHER, dir, damage, 2); break; case MS_BALL_WATER: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("流れるような身振りをした。", "You gesture fluidly.")); damage = monspell_bluemage_damage((MS_BALL_WATER), plev, DAM_ROLL); fire_ball(GF_WATER, dir, damage, 4); break; case MS_BALL_MANA: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("魔力の嵐の呪文を念じた。", "You invoke a mana storm.")); damage = monspell_bluemage_damage((MS_BALL_MANA), plev, DAM_ROLL); fire_ball(GF_MANA, dir, damage, 4); break; case MS_BALL_DARK: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("暗黒の嵐の呪文を念じた。", "You invoke a darkness storm.")); damage = monspell_bluemage_damage((MS_BALL_DARK), plev, DAM_ROLL); fire_ball(GF_DARK, dir, damage, 4); break; case MS_DRAIN_MANA: if (!get_aim_dir(&dir)) return FALSE; damage = monspell_bluemage_damage((MS_DRAIN_MANA), plev, DAM_ROLL); fire_ball_hide(GF_DRAIN_MANA, dir, damage, 0); break; case MS_MIND_BLAST: if (!get_aim_dir(&dir)) return FALSE; damage = monspell_bluemage_damage((MS_MIND_BLAST), plev, DAM_ROLL); fire_ball_hide(GF_MIND_BLAST, dir, damage, 0); break; case MS_BRAIN_SMASH: if (!get_aim_dir(&dir)) return FALSE; damage = monspell_bluemage_damage((MS_BRAIN_SMASH), plev, DAM_ROLL); fire_ball_hide(GF_BRAIN_SMASH, dir, damage, 0); break; case MS_CAUSE_1: if (!get_aim_dir(&dir)) return FALSE; damage = monspell_bluemage_damage((MS_CAUSE_1), plev, DAM_ROLL); fire_ball_hide(GF_CAUSE_1, dir, damage, 0); break; case MS_CAUSE_2: if (!get_aim_dir(&dir)) return FALSE; damage = monspell_bluemage_damage((MS_CAUSE_2), plev, DAM_ROLL); fire_ball_hide(GF_CAUSE_2, dir, damage, 0); break; case MS_CAUSE_3: if (!get_aim_dir(&dir)) return FALSE; damage = monspell_bluemage_damage((MS_CAUSE_3), plev, DAM_ROLL); fire_ball_hide(GF_CAUSE_3, dir, damage, 0); break; case MS_CAUSE_4: if (!get_aim_dir(&dir)) return FALSE; damage = monspell_bluemage_damage((MS_CAUSE_4), plev, DAM_ROLL); fire_ball_hide(GF_CAUSE_4, dir, damage, 0); break; case MS_BOLT_ACID: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("アシッド・ボルトの呪文を唱えた。", "You cast an acid bolt.")); damage = monspell_bluemage_damage((MS_BOLT_ACID), plev, DAM_ROLL); fire_bolt(GF_ACID, dir, damage); break; case MS_BOLT_ELEC: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("サンダー・ボルトの呪文を唱えた。", "You cast a lightning bolt.")); damage = monspell_bluemage_damage((MS_BOLT_ELEC), plev, DAM_ROLL); fire_bolt(GF_ELEC, dir, damage); break; case MS_BOLT_FIRE: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("ファイア・ボルトの呪文を唱えた。", "You cast a fire bolt.")); damage = monspell_bluemage_damage((MS_BOLT_FIRE), plev, DAM_ROLL); fire_bolt(GF_FIRE, dir, damage); break; case MS_BOLT_COLD: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("アイス・ボルトの呪文を唱えた。", "You cast a frost bolt.")); damage = monspell_bluemage_damage((MS_BOLT_COLD), plev, DAM_ROLL); fire_bolt(GF_COLD, dir, damage); break; case MS_STARBURST: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("スターバーストの呪文を念じた。", "You invoke a starburst.")); damage = monspell_bluemage_damage((MS_STARBURST), plev, DAM_ROLL); fire_ball(GF_LITE, dir, damage, 4); break; case MS_BOLT_NETHER: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("地獄の矢の呪文を唱えた。", "You cast a nether bolt.")); damage = monspell_bluemage_damage((MS_BOLT_NETHER), plev, DAM_ROLL); fire_bolt(GF_NETHER, dir, damage); break; case MS_BOLT_WATER: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("ウォーター・ボルトの呪文を唱えた。", "You cast a water bolt.")); damage = monspell_bluemage_damage((MS_BOLT_WATER), plev, DAM_ROLL); fire_bolt(GF_WATER, dir, damage); break; case MS_BOLT_MANA: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("魔力の矢の呪文を唱えた。", "You cast a mana bolt.")); damage = monspell_bluemage_damage((MS_BOLT_MANA), plev, DAM_ROLL); fire_bolt(GF_MANA, dir, damage); break; case MS_BOLT_PLASMA: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("プラズマ・ボルトの呪文を唱えた。", "You cast a plasma bolt.")); damage = monspell_bluemage_damage((MS_BOLT_PLASMA), plev, DAM_ROLL); fire_bolt(GF_PLASMA, dir, damage); break; case MS_BOLT_ICE: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("極寒の矢の呪文を唱えた。", "You cast a ice bolt.")); damage = monspell_bluemage_damage((MS_BOLT_ICE), plev, DAM_ROLL); fire_bolt(GF_ICE, dir, damage); break; case MS_MAGIC_MISSILE: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("マジック・ミサイルの呪文を唱えた。", "You cast a magic missile.")); damage = monspell_bluemage_damage((MS_MAGIC_MISSILE), plev, DAM_ROLL); fire_bolt(GF_MISSILE, dir, damage); break; case MS_SCARE: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("恐ろしげな幻覚を作り出した。", "You cast a fearful illusion.")); fear_monster(dir, plev+10); break; case MS_BLIND: if (!get_aim_dir(&dir)) return FALSE; confuse_monster(dir, plev * 2); break; case MS_CONF: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("誘惑的な幻覚をつくり出した。", "You cast a mesmerizing illusion.")); confuse_monster(dir, plev * 2); break; case MS_SLOW: if (!get_aim_dir(&dir)) return FALSE; slow_monster(dir, plev); break; case MS_SLEEP: if (!get_aim_dir(&dir)) return FALSE; sleep_monster(dir, plev); break; case MS_SPEED: (void)set_fast(randint1(20 + plev) + plev, FALSE); break; case MS_HAND_DOOM: { if (!get_aim_dir(&dir)) return FALSE; msg_print(_("<破滅の手>を放った!", "You invoke the Hand of Doom!")); fire_ball_hide(GF_HAND_DOOM, dir, plev * 3, 0); break; } case MS_HEAL: msg_print(_("自分の傷に念を集中した。", "You concentrate on your wounds!")); (void)hp_player(plev*4); (void)set_stun(0); (void)set_cut(0); break; case MS_INVULNER: msg_print(_("無傷の球の呪文を唱えた。", "You cast a Globe of Invulnerability.")); (void)set_invuln(randint1(4) + 4, FALSE); break; case MS_BLINK: teleport_player(10, 0L); break; case MS_TELEPORT: 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; /* Redraw map */ p_ptr->redraw |= (PR_MAP); /* Update monsters */ p_ptr->update |= (PU_MONSTERS); /* Window stuff */ p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON); handle_stuff(); break; case MS_SPECIAL: break; case MS_TELE_TO: { monster_type *m_ptr; monster_race *r_ptr; char m_name[80]; if (!target_set(TARGET_KILL)) return FALSE; if (!cave[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]; r_ptr = &r_info[m_ptr->r_idx]; monster_desc(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(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(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE; msg_format(_("%sには耐性がある!", "%s resists!"), m_name); break; } } 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); break; } case MS_TELE_AWAY: if (!get_aim_dir(&dir)) return FALSE; (void)fire_beam(GF_AWAY_ALL, dir, 100); break; case MS_TELE_LEVEL: { int 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); break; } case MS_PSY_SPEAR: if (!get_aim_dir(&dir)) return FALSE; msg_print(_("光の剣を放った。", "You throw a psycho-spear.")); damage = monspell_bluemage_damage((MS_PSY_SPEAR), plev, DAM_ROLL); (void)fire_beam(GF_PSY_SPEAR, dir, damage); break; case MS_DARKNESS: msg_print(_("暗闇の中で手を振った。", "You gesture in shadow.")); (void)unlite_area(10, 3); break; case MS_MAKE_TRAP: if (!target_set(TARGET_KILL)) return FALSE; msg_print(_("呪文を唱えて邪悪に微笑んだ。", "You cast a spell and cackle evilly.")); trap_creation(target_row, target_col); break; case MS_FORGET: msg_print(_("しかし何も起きなかった。", "Nothing happen.")); break; case MS_RAISE_DEAD: msg_print(_("死者復活の呪文を唱えた。", "You cast a animate dead.")); (void)animate_dead(0, p_ptr->y, p_ptr->x); break; case MS_S_KIN: { int k; msg_print(_("援軍を召喚した。", "You summon minions.")); for (k = 0;k < 1; k++) { if (summon_kin_player(summon_lev, p_ptr->y, p_ptr->x, (pet ? PM_FORCE_PET : 0L))) { if (!pet) msg_print(_("召喚された仲間は怒っている!", "Summoned fellows are angry!")); } else { no_trump = TRUE; } } break; } case MS_S_CYBER: { int k; 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 (!pet) msg_print(_("召喚されたサイバーデーモンは怒っている!", "The summoned Cyberdemon are angry!")); } else { no_trump = TRUE; } break; } case MS_S_MONSTER: { 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 (!pet) msg_print(_("召喚されたモンスターは怒っている!", "The summoned monster is angry!")); } else { no_trump = TRUE; } break; } case MS_S_MONSTERS: { 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 (!pet) msg_print(_("召喚されたモンスターは怒っている!", "The summoned monsters are angry!")); } else { no_trump = TRUE; } break; } case MS_S_ANT: { 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))) { if (!pet) msg_print(_("召喚されたアリは怒っている!", "The summoned ants are angry!")); } else { no_trump = TRUE; } break; } case MS_S_SPIDER: { 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 (!pet) msg_print(_("召喚された蜘蛛は怒っている!", "Summoned spiders are angry!")); } else { no_trump = TRUE; } break; } case MS_S_HOUND: { 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 (!pet) msg_print(_("召喚されたハウンドは怒っている!", "Summoned hounds are angry!")); } else { no_trump = TRUE; } break; } case MS_S_HYDRA: { 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 (!pet) msg_print(_("召喚されたヒドラは怒っている!", "Summoned hydras are angry!")); } else { no_trump = TRUE; } break; } case MS_S_ANGEL: { 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 (!pet) msg_print(_("召喚された天使は怒っている!", "Summoned angels are angry!")); } else { no_trump = TRUE; } break; } case MS_S_DEMON: { 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 (!pet) msg_print(_("召喚されたデーモンは怒っている!", "Summoned demons are angry!")); } else { no_trump = TRUE; } break; } case MS_S_UNDEAD: { 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 (!pet) msg_print(_("召喚されたアンデッドは怒っている!", "Summoned undeads are angry!")); } else { no_trump = TRUE; } break; } case MS_S_DRAGON: { 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 (!pet) msg_print(_("召喚されたドラゴンは怒っている!", "Summoned dragons are angry!")); } else { no_trump = TRUE; } break; } case MS_S_HI_UNDEAD: { 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 (!pet) msg_print(_("召喚された上級アンデッドは怒っている!", "Summoned greater undeads are angry!")); } else { no_trump = TRUE; } break; } case MS_S_HI_DRAGON: { 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 (!pet) msg_print(_("召喚された古代ドラゴンは怒っている!", "Summoned ancient dragons are angry!")); } else { no_trump = TRUE; } break; } case MS_S_AMBERITE: { 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 (!pet) msg_print(_("召喚されたアンバーの王族は怒っている!", "Summoned Lords of Amber are angry!")); } else { no_trump = TRUE; } break; } case MS_S_UNIQUE: { 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))) { 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))) { count++; if (!pet) msg_print(_("召喚された上級アンデッドは怒っている!", "Summoned greater undeads are angry!")); } if (!count) { no_trump = TRUE; } break; } default: msg_print("hoge?"); } if (no_trump) { msg_print(_("何も現れなかった。", "No one have appeared.")); } return TRUE; }
/* * do_cmd_cast calls this function if the player's class * is 'imitator'. */ static bool cast_learned_spell(int spell, bool success) { int dir; int plev = pseudo_plev(); int summon_lev = p_ptr->lev * 2 / 3 + randint1(p_ptr->lev/2); int hp = p_ptr->chp; int damage = 0; bool pet = success; bool no_trump = FALSE; u32b p_mode, u_mode = 0L, g_mode; if (pet) { p_mode = PM_FORCE_PET; g_mode = 0; } else { p_mode = PM_NO_PET; g_mode = PM_ALLOW_GROUP; } if (!success || (randint1(50+plev) < plev/10)) u_mode = PM_ALLOW_UNIQUE; /* spell code */ switch (spell) { case MS_SHRIEK: msg_print("You make a high pitched shriek."); aggravate_monsters(0); break; case MS_XXX1: break; case MS_DISPEL: { int m_idx; if (!target_set(TARGET_KILL)) return FALSE; m_idx = cave[target_row][target_col].m_idx; if (!m_idx) break; if (!player_has_los_bold(target_row, target_col)) break; if (!projectable(py, px, target_row, target_col)) break; dispel_monster_status(m_idx); break; } case MS_ROCKET: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You fire a rocket."); damage = hp / 4; fire_rocket(GF_ROCKET, dir, spell_power(damage), 2); break; case MS_SHOOT: { int slot; if (!get_aim_dir(&dir)) return FALSE; msg_print("You fire an arrow."); damage = 1; slot = equip_find_first(object_is_melee_weapon); if (slot) { object_type *o_ptr = equip_obj(slot); damage = damroll(o_ptr->dd, o_ptr->ds)+ o_ptr->to_d; if (damage < 1) damage = 1; } fire_bolt(GF_ARROW, dir, spell_power(damage)); break; } case MS_XXX2: break; case MS_XXX3: break; case MS_BR_STORM: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe storm."); damage = MIN(hp / 3, 300); fire_ball(GF_STORM, dir, spell_power(damage), (plev > 40 ? -3 : -2)); break; case MS_BR_ACID: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe acid."); damage = hp / 3; fire_ball(GF_ACID, dir, spell_power(damage), (plev > 40 ? -3 : -2)); break; case MS_BR_ELEC: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe lightning."); damage = hp / 3; fire_ball(GF_ELEC, dir, spell_power(damage), (plev > 40 ? -3 : -2)); break; case MS_BR_FIRE: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe fire."); damage = hp / 3; fire_ball(GF_FIRE, dir, spell_power(damage), (plev > 40 ? -3 : -2)); break; case MS_BR_COLD: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe frost."); damage = hp / 3; fire_ball(GF_COLD, dir, spell_power(damage), (plev > 40 ? -3 : -2)); break; case MS_BR_POIS: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe gas."); damage = hp / 3; fire_ball(GF_POIS, dir, spell_power(damage), (plev > 40 ? -3 : -2)); break; case MS_BR_NETHER: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe nether."); damage = hp / 6; fire_ball(GF_NETHER, dir, spell_power(damage), (plev > 40 ? -3 : -2)); break; case MS_BR_LITE: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe light."); damage = hp / 6; fire_ball(GF_LITE, dir, spell_power(damage), (plev > 40 ? -3 : -2)); break; case MS_BR_DARK: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe darkness."); damage = hp / 6; fire_ball(GF_DARK, dir, spell_power(damage), (plev > 40 ? -3 : -2)); break; case MS_BR_CONF: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe confusion."); damage = hp / 6; fire_ball(GF_CONFUSION, dir, spell_power(damage), (plev > 40 ? -3 : -2)); break; case MS_BR_SOUND: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe sound."); damage = hp / 6; fire_ball(GF_SOUND, dir, spell_power(damage), (plev > 40 ? -3 : -2)); break; case MS_BR_CHAOS: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe chaos."); damage = hp / 6; fire_ball(GF_CHAOS, dir, spell_power(damage), (plev > 40 ? -3 : -2)); break; case MS_BR_DISEN: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe disenchantment."); damage = hp / 6; fire_ball(GF_DISENCHANT, dir, spell_power(damage), (plev > 40 ? -3 : -2)); break; case MS_BR_NEXUS: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe nexus."); damage = MIN(hp / 3, 250); fire_ball(GF_NEXUS, dir, spell_power(damage), (plev > 40 ? -3 : -2)); break; case MS_BR_TIME: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe time."); damage = MIN(hp / 3, 150); fire_ball(GF_TIME, dir, spell_power(damage), (plev > 40 ? -3 : -2)); break; case MS_BR_INERTIA: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe inertia."); damage = MIN(hp / 6, 200); fire_ball(GF_INERT, dir, spell_power(damage), (plev > 40 ? -3 : -2)); break; case MS_BR_GRAVITY: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe gravity."); damage = MIN(hp / 3, 200); fire_ball(GF_GRAVITY, dir, spell_power(damage), (plev > 40 ? -3 : -2)); break; case MS_BR_SHARDS: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe shards."); damage = hp / 6; fire_ball(GF_SHARDS, dir, spell_power(damage), (plev > 40 ? -3 : -2)); break; case MS_BR_PLASMA: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe plasma."); damage = MIN(hp / 6, 150); fire_ball(GF_PLASMA, dir, spell_power(damage), (plev > 40 ? -3 : -2)); break; case MS_BR_FORCE: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe force."); damage = MIN(hp / 6, 200); fire_ball(GF_FORCE, dir, spell_power(damage), (plev > 40 ? -3 : -2)); break; case MS_BR_MANA: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe mana."); damage = MIN(hp / 3, 250); fire_ball(GF_MANA, dir, spell_power(damage), (plev > 40 ? -3 : -2)); break; case MS_BALL_NUKE: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast a ball of radiation."); damage = plev * 2 + damroll(10, 6); fire_ball(GF_NUKE, dir, spell_power(damage), 2); break; case MS_BR_NUKE: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe toxic waste."); damage = hp / 3; fire_ball(GF_NUKE, dir, spell_power(damage), (plev > 40 ? -3 : -2)); break; case MS_BALL_CHAOS: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You invoke a raw Logrus."); damage = plev * 4 + damroll(10, 10); fire_ball(GF_CHAOS, dir, spell_power(damage), 4); break; case MS_BR_DISI: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe disintegration."); damage = MIN(hp / 6, 150); fire_ball(GF_DISINTEGRATE, dir, spell_power(damage), (plev > 40 ? -3 : -2)); break; case MS_BALL_ACID: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast an acid ball."); damage = randint1(plev * 6) + 15; fire_ball(GF_ACID, dir, spell_power(damage), 2); break; case MS_BALL_ELEC: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast a lightning ball."); damage = randint1(plev * 3) + 8; fire_ball(GF_ELEC, dir, spell_power(damage), 2); break; case MS_BALL_FIRE: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast a fire ball."); damage = randint1(plev * 7) + 10; fire_ball(GF_FIRE, dir, spell_power(damage), 2); break; case MS_BALL_COLD: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast a frost ball."); damage = randint1(plev * 3) + 10; fire_ball(GF_COLD, dir, spell_power(damage), 2); break; case MS_BALL_POIS: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast a stinking cloud."); damage = damroll(12,2); fire_ball(GF_POIS, dir, spell_power(damage), 2); break; case MS_BALL_NETHER: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast a nether ball."); damage = plev * 2 + 50 + damroll(10, 10); fire_ball(GF_NETHER, dir, spell_power(damage), 2); break; case MS_BALL_WATER: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You gesture fluidly."); damage = randint1(plev * 4) + 50; fire_ball(GF_WATER, dir, spell_power(damage), 4); break; case MS_BALL_MANA: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You invoke a mana storm."); damage = plev * 8 + 50 + damroll(10, 10); fire_ball(GF_MANA, dir, spell_power(damage), 4); break; case MS_BALL_DARK: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You invoke a darkness storm."); damage = plev * 8 + 50 + damroll(10, 10); fire_ball(GF_DARK, dir, spell_power(damage), 4); break; case MS_DRAIN_MANA: if (!get_aim_dir(&dir)) return FALSE; fire_ball_hide(GF_DRAIN_MANA, dir, spell_power(randint1(plev)+plev), 0); break; case MS_MIND_BLAST: if (!get_aim_dir(&dir)) return FALSE; damage = damroll(7, 7); fire_ball_hide(GF_MIND_BLAST, dir, spell_power(damage), 0); break; case MS_BRAIN_SMASH: if (!get_aim_dir(&dir)) return FALSE; damage = damroll(12, 12); fire_ball_hide(GF_BRAIN_SMASH, dir, spell_power(damage), 0); break; case MS_CAUSE_1: if (!get_aim_dir(&dir)) return FALSE; damage = damroll(3, 8); fire_ball_hide(GF_CAUSE_1, dir, spell_power(damage), 0); break; case MS_CAUSE_2: if (!get_aim_dir(&dir)) return FALSE; damage = damroll(8, 8); fire_ball_hide(GF_CAUSE_2, dir, spell_power(damage), 0); break; case MS_CAUSE_3: if (!get_aim_dir(&dir)) return FALSE; damage = damroll(10, 15); fire_ball_hide(GF_CAUSE_3, dir, spell_power(damage), 0); break; case MS_CAUSE_4: if (!get_aim_dir(&dir)) return FALSE; damage = damroll(15, 15); fire_ball_hide(GF_CAUSE_4, dir, spell_power(damage), 0); break; case MS_BOLT_ACID: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast an acid bolt."); damage = damroll(7, 8) + plev * 2 / 3; fire_bolt(GF_ACID, dir, spell_power(damage)); break; case MS_BOLT_ELEC: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast a lightning bolt."); damage = damroll(4, 8) + plev * 2 / 3; fire_bolt(GF_ELEC, dir, spell_power(damage)); break; case MS_BOLT_FIRE: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast a fire bolt."); damage = damroll(9, 8) + plev * 2 / 3; fire_bolt(GF_FIRE, dir, spell_power(damage)); break; case MS_BOLT_COLD: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast a frost bolt."); damage = damroll(6, 8) + plev * 2 / 3; fire_bolt(GF_COLD, dir, spell_power(damage)); break; case MS_STARBURST: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You invoke a starburst."); damage = plev * 8 + 50 + damroll(10, 10); fire_ball(GF_LITE, dir, spell_power(damage), 4); break; case MS_BOLT_NETHER: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast a nether bolt."); damage = 30 + damroll(5, 5) + plev * 8 / 3; fire_bolt(GF_NETHER, dir, spell_power(damage)); break; case MS_BOLT_WATER: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast a water bolt."); damage = damroll(10, 10) + plev * 2; fire_bolt(GF_WATER, dir, spell_power(damage)); break; case MS_BOLT_MANA: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast a mana bolt."); damage = randint1(plev * 7) + 50; fire_bolt(GF_MANA, dir, spell_power(damage)); break; case MS_BOLT_PLASMA: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast a plasma bolt."); damage = 10 + damroll(8, 7) + plev * 2; fire_bolt(GF_PLASMA, dir, spell_power(damage)); break; case MS_BOLT_ICE: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast a ice bolt."); damage = damroll(6, 6) + plev * 2; fire_bolt(GF_ICE, dir, spell_power(damage)); break; case MS_MAGIC_MISSILE: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast a magic missile."); damage = damroll(2, 6) + plev * 2 / 3; fire_bolt(GF_MISSILE, dir, spell_power(damage)); break; case MS_SCARE: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast a fearful illusion."); fear_monster(dir, spell_power(plev+10)); break; case MS_BLIND: if (!get_aim_dir(&dir)) return FALSE; confuse_monster(dir, spell_power(plev * 2)); break; case MS_CONF: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast a mesmerizing illusion."); confuse_monster(dir, spell_power(plev * 2)); break; case MS_SLOW: if (!get_aim_dir(&dir)) return FALSE; slow_monster(dir); break; case MS_SLEEP: if (!get_aim_dir(&dir)) return FALSE; sleep_monster(dir, plev*3); break; case MS_SPEED: (void)set_fast(randint1(20 + plev) + plev, FALSE); break; case MS_HAND_DOOM: { if (!get_aim_dir(&dir)) return FALSE; else msg_print("You invoke the Hand of Doom!"); fire_ball_hide(GF_HAND_DOOM, dir, spell_power(plev * 3), 0); break; } case MS_HEAL: msg_print("You concentrate on your wounds!"); (void)hp_player(spell_power(plev*4)); (void)set_stun(0, TRUE); (void)set_cut(0, TRUE); break; case MS_INVULNER: msg_print("You cast a Globe of Invulnerability."); (void)set_invuln(spell_power(randint1(4) + 4), FALSE); break; case MS_BLINK: teleport_player(10, 0L); break; case MS_TELEPORT: 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; /* Redraw map */ p_ptr->redraw |= (PR_MAP | PR_STATUS); /* Update monsters */ p_ptr->update |= (PU_MONSTERS); /* Window stuff */ p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON); handle_stuff(); break; case MS_SPECIAL: break; case MS_TELE_TO: { monster_type *m_ptr; monster_race *r_ptr; char m_name[80]; if (!target_set(TARGET_KILL)) return FALSE; if (!cave[target_row][target_col].m_idx) break; if (!player_has_los_bold(target_row, target_col)) break; if (!projectable(py, px, target_row, target_col)) break; m_ptr = &m_list[cave[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) { if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL)) { if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE; msg_format("%s is unaffected!", m_name); break; } else if (r_ptr->level > randint1(100)) { if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE; msg_format("%s resists!", m_name); break; } } msg_format("You command %s to return.", m_name); teleport_monster_to(cave[target_row][target_col].m_idx, py, px, 100, TELEPORT_PASSIVE); break; } case MS_TELE_AWAY: if (!get_aim_dir(&dir)) return FALSE; (void)fire_beam(GF_AWAY_ALL, dir, spell_power(100)); break; case MS_TELE_LEVEL: { int 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(py, px, 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("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); break; } case MS_PSY_SPEAR: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You throw a psycho-spear."); damage = randint1(plev * 3) + 100; (void)fire_beam(GF_PSY_SPEAR, dir, spell_power(damage)); break; case MS_DARKNESS: msg_print("You gesture in shadow."); (void)unlite_area(10, 3); break; case MS_MAKE_TRAP: if (!target_set(TARGET_KILL)) return FALSE; msg_print("You cast a spell and cackle evilly."); trap_creation(target_row, target_col); break; case MS_FORGET: msg_print("Nothing happen."); break; case MS_RAISE_DEAD: msg_print("You cast a animate dead."); (void)animate_dead(0, py, px); break; case MS_S_KIN: { int k; msg_print("You summon minions."); for (k = 0;k < 1; k++) { if (summon_kin_player(summon_lev, py, px, (pet ? PM_FORCE_PET : 0L))) { if (!pet) msg_print("Summoned fellows are angry!"); } else { no_trump = TRUE; } } break; } case MS_S_CYBER: { int k; msg_print("You summon a Cyberdemon!"); for (k = 0 ;k < 1 ; k++) if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_CYBER, p_mode)) { if (!pet) msg_print("The summoned Cyberdemon are angry!"); } else { no_trump = TRUE; } break; } case MS_S_MONSTER: { int k; msg_print("You summon help."); for (k = 0;k < 1; k++) if (summon_specific((pet ? -1 : 0), py, px, summon_lev, 0, p_mode)) { if (!pet) msg_print("The summoned monster is angry!"); } else { no_trump = TRUE; } break; } case MS_S_MONSTERS: { int k; msg_print("You summon monsters!"); for (k = 0;k < plev / 15 + 2; k++) if(summon_specific((pet ? -1 : 0), py, px, summon_lev, 0, (p_mode | u_mode))) { if (!pet) msg_print("Summoned monsters are angry!"); } else { no_trump = TRUE; } break; } case MS_S_ANT: { int k; msg_print("You summon ants."); for (k = 0;k < 1; k++) if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_ANT, (PM_ALLOW_GROUP | p_mode))) { if (!pet) msg_print("Summoned ants are angry!"); } else { no_trump = TRUE; } break; } case MS_S_SPIDER: { int k; msg_print("You summon spiders."); for (k = 0;k < 1; k++) if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_SPIDER, (PM_ALLOW_GROUP | p_mode))) { if (!pet) msg_print("Summoned spiders are angry!"); } else { no_trump = TRUE; } break; } case MS_S_HOUND: { int k; msg_print("You summon hounds."); for (k = 0;k < 1; k++) if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HOUND, (PM_ALLOW_GROUP | p_mode))) { if (!pet) msg_print("Summoned hounds are angry!"); } else { no_trump = TRUE; } break; } case MS_S_HYDRA: { int k; msg_print("You summon a hydras."); for (k = 0;k < 1; k++) if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HYDRA, (g_mode | p_mode))) { if (!pet) msg_print("Summoned hydras are angry!"); } else { no_trump = TRUE; } break; } case MS_S_ANGEL: { int k; msg_print("You summon an angel!"); for (k = 0;k < 1; k++) if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_ANGEL, (g_mode | p_mode))) { if (!pet) msg_print("Summoned angels are angry!"); } else { no_trump = TRUE; } break; } case MS_S_DEMON: { 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), py, px, summon_lev, SUMMON_DEMON, (g_mode | p_mode))) { if (!pet) msg_print("Summoned demons are angry!"); } else { no_trump = TRUE; } break; } case MS_S_UNDEAD: { int k; msg_print("You summon an undead adversary!"); for (k = 0;k < 1; k++) if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_UNDEAD, (g_mode | p_mode))) { if (!pet) msg_print("Summoned undeads are angry!"); } else { no_trump = TRUE; } break; } case MS_S_DRAGON: { int k; msg_print("You summon a dragon!"); for (k = 0;k < 1; k++) if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_DRAGON, (g_mode | p_mode))) { if (!pet) msg_print("Summoned dragons are angry!"); } else { no_trump = TRUE; } break; } case MS_S_HI_UNDEAD: { int k; msg_print("You summon a greater undead!"); for (k = 0;k < 1; k++) if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HI_UNDEAD, (g_mode | p_mode | u_mode))) { if (!pet) msg_print("Summoned greater undeads are angry!"); } else { no_trump = TRUE; } break; } case MS_S_HI_DRAGON: { int k; msg_print("You summon an ancient dragon!"); for (k = 0;k < 1; k++) if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HI_DRAGON, (g_mode | p_mode | u_mode))) { if (!pet) msg_print("Summoned ancient dragons are angry!"); } else { no_trump = TRUE; } break; } case MS_S_AMBERITE: { int k; msg_print("You summon a Lord of Amber!"); for (k = 0;k < 1; k++) if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_AMBERITE, (g_mode | p_mode | u_mode))) { if (!pet) msg_print("Summoned Lords of Amber are angry!"); } else { no_trump = TRUE; } break; } case MS_S_UNIQUE: { int k, count = 0; msg_print("You summon a special opponent!"); for (k = 0;k < 1; k++) if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_UNIQUE, (g_mode | p_mode | PM_ALLOW_UNIQUE))) { count++; if (!pet) msg_print("Summoned special opponents are angry!"); } for (k = count;k < 1; k++) if (summon_specific((pet ? -1 : 0), py, px, summon_lev, SUMMON_HI_UNDEAD, (g_mode | p_mode | PM_ALLOW_UNIQUE))) { count++; if (!pet) msg_print("Summoned greater undeads are angry!"); } if (!count) { no_trump = TRUE; } break; } default: msg_print("hoge?"); } if (no_trump) { msg_print("No one have appeared."); } return TRUE; }
/* * do_cmd_cast calls this function if the player's class * is 'imitator'. */ static bool use_mane(int spell) { int dir; int plev = p_ptr->lev; u32b mode = (PM_ALLOW_GROUP | PM_FORCE_PET); u32b u_mode = 0L; if (randint1(50+plev) < plev/10) u_mode = PM_ALLOW_UNIQUE; /* spell code */ switch (spell) { case MS_SHRIEK: msg_print("You make a high pitched shriek."); aggravate_monsters(0); break; case MS_XXX1: break; case MS_DISPEL: { int m_idx; if (!target_set(TARGET_KILL)) return FALSE; m_idx = cave[target_row][target_col].m_idx; if (!m_idx) break; if (!player_has_los_bold(target_row, target_col)) break; if (!projectable(py, px, target_row, target_col)) break; dispel_monster_status(m_idx); break; } case MS_ROCKET: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You fire a rocket."); fire_rocket(GF_ROCKET, dir, damage, 2); break; case MS_SHOOT: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You fire an arrow."); fire_bolt(GF_ARROW, dir, damage); break; case MS_XXX2: break; case MS_XXX3: break; case MS_BR_STORM: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe storm."); fire_ball(GF_STORM, dir, damage, (plev > 35 ? -3 : -2)); break; case MS_BR_ACID: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe acid."); fire_ball(GF_ACID, dir, damage, (plev > 35 ? -3 : -2)); break; case MS_BR_ELEC: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe lightning."); fire_ball(GF_ELEC, dir, damage, (plev > 35 ? -3 : -2)); break; case MS_BR_FIRE: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe fire."); fire_ball(GF_FIRE, dir, damage, (plev > 35 ? -3 : -2)); break; case MS_BR_COLD: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe frost."); fire_ball(GF_COLD, dir, damage, (plev > 35 ? -3 : -2)); break; case MS_BR_POIS: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe gas."); fire_ball(GF_POIS, dir, damage, (plev > 35 ? -3 : -2)); break; case MS_BR_NETHER: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe nether."); fire_ball(GF_NETHER, dir, damage, (plev > 35 ? -3 : -2)); break; case MS_BR_LITE: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe light."); fire_ball(GF_LITE, dir, damage, (plev > 35 ? -3 : -2)); break; case MS_BR_DARK: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe darkness."); fire_ball(GF_DARK, dir, damage, (plev > 35 ? -3 : -2)); break; case MS_BR_CONF: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe confusion."); fire_ball(GF_CONFUSION, dir, damage, (plev > 35 ? -3 : -2)); break; case MS_BR_SOUND: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe sound."); fire_ball(GF_SOUND, dir, damage, (plev > 35 ? -3 : -2)); break; case MS_BR_CHAOS: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe chaos."); fire_ball(GF_CHAOS, dir, damage, (plev > 35 ? -3 : -2)); break; case MS_BR_DISEN: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe disenchantment."); fire_ball(GF_DISENCHANT, dir, damage, (plev > 35 ? -3 : -2)); break; case MS_BR_NEXUS: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe nexus."); fire_ball(GF_NEXUS, dir, damage, (plev > 35 ? -3 : -2)); break; case MS_BR_TIME: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe time."); fire_ball(GF_TIME, dir, damage, (plev > 35 ? -3 : -2)); break; case MS_BR_INERTIA: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe inertia."); fire_ball(GF_INERT, dir, damage, (plev > 35 ? -3 : -2)); break; case MS_BR_GRAVITY: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe gravity."); fire_ball(GF_GRAVITY, dir, damage, (plev > 35 ? -3 : -2)); break; case MS_BR_SHARDS: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe shards."); fire_ball(GF_SHARDS, dir, damage, (plev > 35 ? -3 : -2)); break; case MS_BR_PLASMA: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe plasma."); fire_ball(GF_PLASMA, dir, damage, (plev > 35 ? -3 : -2)); break; case MS_BR_FORCE: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe force."); fire_ball(GF_FORCE, dir, damage, (plev > 35 ? -3 : -2)); break; case MS_BR_MANA: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe mana."); fire_ball(GF_MANA, dir, damage, (plev > 35 ? -3 : -2)); break; case MS_BALL_NUKE: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast a ball of radiation."); fire_ball(GF_NUKE, dir, damage, 2); break; case MS_BR_NUKE: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe toxic waste."); fire_ball(GF_NUKE, dir, damage, (plev > 35 ? -3 : -2)); break; case MS_BALL_CHAOS: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You invoke a raw Logrus."); fire_ball(GF_CHAOS, dir, damage, 4); break; case MS_BR_DISI: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You breathe disintegration."); fire_ball(GF_DISINTEGRATE, dir, damage, (plev > 35 ? -3 : -2)); break; case MS_BALL_ACID: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast an acid ball."); fire_ball(GF_ACID, dir, damage, 2); break; case MS_BALL_ELEC: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast a lightning ball."); fire_ball(GF_ELEC, dir, damage, 2); break; case MS_BALL_FIRE: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast a fire ball."); fire_ball(GF_FIRE, dir, damage, 2); break; case MS_BALL_COLD: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast a frost ball."); fire_ball(GF_COLD, dir, damage, 2); break; case MS_BALL_POIS: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast a stinking cloud."); fire_ball(GF_POIS, dir, damage, 2); break; case MS_BALL_NETHER: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast a nether ball."); fire_ball(GF_NETHER, dir, damage, 2); break; case MS_BALL_WATER: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You gesture fluidly."); fire_ball(GF_WATER, dir, damage, 4); break; case MS_BALL_MANA: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You invoke a mana storm."); fire_ball(GF_MANA, dir, damage, 4); break; case MS_BALL_DARK: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You invoke a darkness storm."); fire_ball(GF_DARK, dir, damage, 4); break; case MS_DRAIN_MANA: if (!get_aim_dir(&dir)) return FALSE; fire_ball_hide(GF_DRAIN_MANA, dir, randint1(plev*3)+plev, 0); break; case MS_MIND_BLAST: if (!get_aim_dir(&dir)) return FALSE; fire_ball_hide(GF_MIND_BLAST, dir, damage, 0); break; case MS_BRAIN_SMASH: if (!get_aim_dir(&dir)) return FALSE; fire_ball_hide(GF_BRAIN_SMASH, dir, damage, 0); break; case MS_CAUSE_1: if (!get_aim_dir(&dir)) return FALSE; fire_ball_hide(GF_CAUSE_1, dir, damage, 0); break; case MS_CAUSE_2: if (!get_aim_dir(&dir)) return FALSE; fire_ball_hide(GF_CAUSE_2, dir, damage, 0); break; case MS_CAUSE_3: if (!get_aim_dir(&dir)) return FALSE; fire_ball_hide(GF_CAUSE_3, dir, damage, 0); break; case MS_CAUSE_4: if (!get_aim_dir(&dir)) return FALSE; fire_ball_hide(GF_CAUSE_4, dir, damage, 0); break; case MS_BOLT_ACID: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast an acid bolt."); fire_bolt(GF_ACID, dir, damage); break; case MS_BOLT_ELEC: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast a lightning bolt."); fire_bolt(GF_ELEC, dir, damage); break; case MS_BOLT_FIRE: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast a fire bolt."); fire_bolt(GF_FIRE, dir, damage); break; case MS_BOLT_COLD: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast a frost bolt."); fire_bolt(GF_COLD, dir, damage); break; case MS_STARBURST: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You invoke a starburst."); fire_ball(GF_LITE, dir, damage, 4); break; case MS_BOLT_NETHER: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast a nether bolt."); fire_bolt(GF_NETHER, dir, damage); break; case MS_BOLT_WATER: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast a water bolt."); fire_bolt(GF_WATER, dir, damage); break; case MS_BOLT_MANA: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast a mana bolt."); fire_bolt(GF_MANA, dir, damage); break; case MS_BOLT_PLASMA: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast a plasma bolt."); fire_bolt(GF_PLASMA, dir, damage); break; case MS_BOLT_ICE: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast a ice bolt."); fire_bolt(GF_ICE, dir, damage); break; case MS_MAGIC_MISSILE: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast a magic missile."); fire_bolt(GF_MISSILE, dir, damage); break; case MS_SCARE: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast a fearful illusion."); fear_monster(dir, plev+10); break; case MS_BLIND: if (!get_aim_dir(&dir)) return FALSE; confuse_monster(dir, plev * 2); break; case MS_CONF: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You cast a mesmerizing illusion."); confuse_monster(dir, plev * 2); break; case MS_SLOW: if (!get_aim_dir(&dir)) return FALSE; slow_monster(dir); break; case MS_SLEEP: if (!get_aim_dir(&dir)) return FALSE; sleep_monster(dir, plev*3); break; case MS_SPEED: (void)set_fast(randint1(20 + plev) + plev, FALSE); break; case MS_HAND_DOOM: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You invoke the Hand of Doom!"); fire_ball_hide(GF_HAND_DOOM, dir, 200, 0); break; case MS_HEAL: msg_print("You concentrate on your wounds!"); (void)hp_player(plev*6); (void)set_stun(0, TRUE); (void)set_cut(0, TRUE); break; case MS_INVULNER: msg_print("You cast a Globe of Invulnerability."); (void)set_invuln(randint1(7) + 7, FALSE); break; case MS_BLINK: if (mut_present(MUT_ASTRAL_GUIDE)) energy_use = 30; teleport_player(10, 0L); break; case MS_TELEPORT: if (mut_present(MUT_ASTRAL_GUIDE)) energy_use = 30; teleport_player(plev * 5, 0L); break; case MS_WORLD: world_player = TRUE; if (damage == 1 || damage == 2) msg_print("You yell 'The World! Time has stopped!'"); else if (damage == 3 || damage == 6) msg_print("You yell 'Time!'"); else msg_print("hek!"); msg_print(NULL); 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(); break; case MS_SPECIAL: break; case MS_TELE_TO: { monster_type *m_ptr; monster_race *r_ptr; char m_name[80]; if (!target_set(TARGET_KILL)) return FALSE; if (!cave[target_row][target_col].m_idx) break; if (!player_has_los_bold(target_row, target_col)) break; if (!projectable(py, px, target_row, target_col)) break; m_ptr = &m_list[cave[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) { if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL)) { if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE; msg_format("%s is unaffected!", m_name); break; } else if (r_ptr->level > randint1(100)) { if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE; msg_format("%s resists!", m_name); break; } } msg_format("You command %s to return.", m_name); teleport_monster_to(cave[target_row][target_col].m_idx, py, px, 100, TELEPORT_PASSIVE); break; } case MS_TELE_AWAY: if (!get_aim_dir(&dir)) return FALSE; (void)fire_beam(GF_AWAY_ALL, dir, plev); break; case MS_TELE_LEVEL: { int 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(py, px, 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("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); break; } case MS_PSY_SPEAR: if (!get_aim_dir(&dir)) return FALSE; else msg_print("You throw a psycho-spear."); fire_beam(GF_PSY_SPEAR, dir, damage); break; case MS_DARKNESS: msg_print("You gesture in shadow."); unlite_area(10, 3); break; case MS_MAKE_TRAP: if (!target_set(TARGET_KILL)) return FALSE; msg_print("You cast a spell and cackle evilly."); trap_creation(target_row, target_col); break; case MS_FORGET: msg_print("Nothing happens."); /* TODO: forget_spell(m_idx) ... */ break; case MS_RAISE_DEAD: msg_print("You cast a animate dead."); animate_dead(0, py, px); break; case MS_S_KIN: { int k; if (!target_set(TARGET_KILL)) return FALSE; msg_print("You summon minions."); for (k = 0;k < 4; k++) { (void)summon_kin_player(plev, target_row, target_col, (PM_FORCE_PET | PM_ALLOW_GROUP)); } break; } case MS_S_CYBER: { int k; int max_cyber = (dun_level / 50) + randint1(3); if (!target_set(TARGET_KILL)) return FALSE; msg_print("You summon Cyberdemons!"); if (max_cyber > 4) max_cyber = 4; for (k = 0;k < max_cyber; k++) summon_specific(-1, target_row, target_col, plev, SUMMON_CYBER, mode); break; } case MS_S_MONSTER: { int k; if (!target_set(TARGET_KILL)) return FALSE; msg_print("You summon help."); for (k = 0;k < 1; k++) summon_specific(-1, target_row, target_col, plev, 0, (mode | u_mode)); break; } case MS_S_MONSTERS: { int k; if (!target_set(TARGET_KILL)) return FALSE; msg_print("You summon monsters!"); for (k = 0;k < 6; k++) summon_specific(-1, target_row, target_col, plev, 0, (mode | u_mode)); break; } case MS_S_ANT: { int k; if (!target_set(TARGET_KILL)) return FALSE; msg_print("You summon ants."); for (k = 0;k < 6; k++) summon_specific(-1, target_row, target_col, plev, SUMMON_ANT, mode); break; } case MS_S_SPIDER: { int k; if (!target_set(TARGET_KILL)) return FALSE; msg_print("You summon spiders."); for (k = 0;k < 6; k++) summon_specific(-1, target_row, target_col, plev, SUMMON_SPIDER, mode); break; } case MS_S_HOUND: { int k; if (!target_set(TARGET_KILL)) return FALSE; msg_print("You summon hounds."); for (k = 0;k < 4; k++) summon_specific(-1, target_row, target_col, plev, SUMMON_HOUND, mode); break; } case MS_S_HYDRA: { int k; if (!target_set(TARGET_KILL)) return FALSE; msg_print("You summon hydras."); for (k = 0;k < 4; k++) summon_specific(-1, target_row, target_col, plev, SUMMON_HYDRA, mode); break; } case MS_S_ANGEL: { int k; if (!target_set(TARGET_KILL)) return FALSE; msg_print("You summon angel!"); for (k = 0;k < 1; k++) summon_specific(-1, target_row, target_col, plev, SUMMON_ANGEL, mode); break; } case MS_S_DEMON: { int k; if (!target_set(TARGET_KILL)) return FALSE; msg_print("You summon a demon from the Courts of Chaos!"); for (k = 0;k < 1; k++) summon_specific(-1, target_row, target_col, plev, SUMMON_DEMON, (mode | u_mode)); break; } case MS_S_UNDEAD: { int k; if (!target_set(TARGET_KILL)) return FALSE; msg_print("You summon an undead adversary!"); for (k = 0;k < 1; k++) summon_specific(-1, target_row, target_col, plev, SUMMON_UNDEAD, (mode | u_mode)); break; } case MS_S_DRAGON: { int k; if (!target_set(TARGET_KILL)) return FALSE; msg_print("You summon dragon!"); for (k = 0;k < 1; k++) summon_specific(-1, target_row, target_col, plev, SUMMON_DRAGON, (mode | u_mode)); break; } case MS_S_HI_UNDEAD: { int k; if (!target_set(TARGET_KILL)) return FALSE; msg_print("You summon greater undead!"); for (k = 0;k < 6; k++) summon_specific(-1, target_row, target_col, plev, SUMMON_HI_UNDEAD, (mode | u_mode)); break; } case MS_S_HI_DRAGON: { int k; if (!target_set(TARGET_KILL)) return FALSE; msg_print("You summon ancient dragons!"); for (k = 0;k < 4; k++) summon_specific(-1, target_row, target_col, plev, SUMMON_HI_DRAGON, (mode | u_mode)); break; } case MS_S_AMBERITE: { int k; if (!target_set(TARGET_KILL)) return FALSE; msg_print("You summon Lords of Amber!"); for (k = 0;k < 4; k++) summon_specific(-1, target_row, target_col, plev, SUMMON_AMBERITE, (mode | PM_ALLOW_UNIQUE)); break; } case MS_S_UNIQUE: { int k, count = 0; if (!target_set(TARGET_KILL)) return FALSE; msg_print("You summon special opponents!"); for (k = 0;k < 4; k++) if (summon_specific(-1, target_row, target_col, plev, SUMMON_UNIQUE, (mode | PM_ALLOW_UNIQUE))) count++; for (k = count;k < 4; k++) summon_specific(-1, target_row, target_col, plev, SUMMON_HI_UNDEAD, (mode | u_mode)); break; } default: msg_print("hoge?"); } return TRUE; }