1 #include "mind/mind-mindcrafter.h"
2 #include "autopick/autopick.h"
3 #include "core/hp-mp-processor.h"
4 #include "core/player-update-types.h"
5 #include "core/window-redrawer.h"
6 #include "effect/effect-characteristics.h"
7 #include "effect/effect-processor.h"
8 #include "flavor/flag-inscriptions-table.h"
9 #include "flavor/flavor-describer.h"
10 #include "flavor/object-flavor-types.h"
11 #include "floor/floor-object.h"
12 #include "game-option/auto-destruction-options.h"
13 #include "mind/mind-mindcrafter.h"
14 #include "mind/mind-numbers.h"
15 #include "object-enchant/item-feeling.h"
16 #include "object-enchant/special-object-flags.h"
17 #include "object/item-use-flags.h"
18 #include "object/object-mark-types.h"
19 #include "perception/object-perception.h"
20 #include "perception/simple-perception.h"
21 #include "player-info/avatar.h"
22 #include "spell-kind/spells-detection.h"
23 #include "spell-kind/spells-fetcher.h"
24 #include "spell-kind/spells-floor.h"
25 #include "spell-kind/spells-launcher.h"
26 #include "spell-kind/spells-perception.h"
27 #include "spell-kind/spells-sight.h"
28 #include "spell-kind/spells-teleport.h"
29 #include "spell/spell-types.h"
30 #include "spell/spells-status.h"
31 #include "status/bad-status-setter.h"
32 #include "status/buff-setter.h"
33 #include "status/element-resistance.h"
34 #include "status/sight-setter.h"
35 #include "system/object-type-definition.h"
36 #include "target/target-getter.h"
37 #include "util/bit-flags-calculator.h"
38 #include "view/display-messages.h"
41 * @brief 超能力者のサイコメトリー処理/ Forcibly pseudo-identify an object in the inventory (or on the floor)
42 * @param caster_ptr プレーヤーへの参照ポインタ
45 * currently this function allows pseudo-id of any object,
46 * including silly ones like potions & scrolls, which always
47 * get '{average}'. This should be changed, either to stop such
48 * items from being pseudo-id'd, or to allow psychometry to
49 * detect whether the unidentified potion/scroll/etc is
50 * good (Cure Light Wounds, Restore Strength, etc) or
51 * bad (Poison, Weakness etc) or 'useless' (Slime Mold Juice, etc).
53 bool psychometry(player_type *caster_ptr)
55 concptr q = _("どのアイテムを調べますか?", "Meditate on which item? ");
56 concptr s = _("調べるアイテムがありません。", "You have nothing appropriate.");
59 o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), TV_NONE);
63 if (object_is_known(o_ptr)) {
64 msg_print(_("何も新しいことは判らなかった。", "You cannot find out anything more about that."));
68 item_feel_type feel = pseudo_value_check_heavy(o_ptr);
69 GAME_TEXT o_name[MAX_NLEN];
70 describe_flavor(caster_ptr, o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
73 msg_format(_("%sからは特に変わった事は感じとれなかった。", "You do not perceive anything unusual about the %s."), o_name);
78 msg_format("%sは%sという感じがする...", o_name, game_inscriptions[feel]);
80 msg_format("You feel that the %s %s %s...", o_name, ((o_ptr->number == 1) ? "is" : "are"), game_inscriptions[feel]);
83 set_bits(o_ptr->ident, IDENT_SENSE);
84 o_ptr->feeling = feel;
85 set_bits(o_ptr->marked, OM_TOUCHED);
87 set_bits(caster_ptr->update, PU_COMBINE | PU_REORDER);
88 set_bits(caster_ptr->window_flags, PW_INVEN | PW_EQUIP | PW_PLAYER | PW_FLOOR_ITEM_LIST);
91 switch (o_ptr->tval) {
121 autopick_alter_item(caster_ptr, item, (bool)(okay && destroy_feeling));
127 * do_cmd_cast calls this function if the player's class is 'mindcrafter'.
128 * @param spell 発動する特殊技能のID
129 * @return 処理を実行したらTRUE、キャンセルした場合FALSEを返す。
131 bool cast_mindcrafter_spell(player_type *caster_ptr, mind_mindcrafter_type spell)
137 PLAYER_LEVEL plev = caster_ptr->lev;
141 chg_virtue(caster_ptr, V_KNOWLEDGE, 1);
142 chg_virtue(caster_ptr, V_ENLIGHTEN, 1);
143 wiz_lite(caster_ptr, FALSE);
144 } else if (plev > 19)
145 map_area(caster_ptr, DETECT_RAD_MAP);
148 b = detect_monsters_normal(caster_ptr, DETECT_RAD_DEFAULT);
150 b |= detect_monsters_invis(caster_ptr, DETECT_RAD_DEFAULT);
152 b |= detect_traps(caster_ptr, DETECT_RAD_DEFAULT, TRUE);
153 b |= detect_doors(caster_ptr, DETECT_RAD_DEFAULT);
156 b = detect_all(caster_ptr, DETECT_RAD_DEFAULT);
159 if ((plev > 24) && (plev < 40))
160 set_tim_esp(caster_ptr, (TIME_EFFECT)plev, FALSE);
163 msg_print(_("安全な気がする。", "You feel safe."));
167 if (!get_aim_dir(caster_ptr, &dir))
170 if (randint1(100) < plev * 2)
171 fire_beam(caster_ptr, GF_PSI, dir, damroll(3 + ((plev - 1) / 4), (3 + plev / 15)));
173 fire_ball(caster_ptr, GF_PSI, dir, damroll(3 + ((plev - 1) / 4), (3 + plev / 15)), 0);
175 case MINOR_DISPLACEMENT:
176 teleport_player(caster_ptr, 10, TELEPORT_SPONTANEOUS);
178 case MAJOR_DISPLACEMENT:
179 teleport_player(caster_ptr, plev * 5, TELEPORT_SPONTANEOUS);
183 if (!get_aim_dir(caster_ptr, &dir))
186 fire_ball(caster_ptr, GF_DOMINATION, dir, plev, 0);
188 charm_monsters(caster_ptr, plev * 2);
193 if (!get_aim_dir(caster_ptr, &dir))
196 fire_ball(caster_ptr, GF_TELEKINESIS, dir, damroll(8 + ((plev - 5) / 4), 8), (plev > 20 ? (plev - 20) / 8 + 1 : 0));
198 case CHARACTER_ARMOR:
199 set_shield(caster_ptr, (TIME_EFFECT)plev, FALSE);
201 set_oppose_acid(caster_ptr, (TIME_EFFECT)plev, FALSE);
203 set_oppose_fire(caster_ptr, (TIME_EFFECT)plev, FALSE);
205 set_oppose_cold(caster_ptr, (TIME_EFFECT)plev, FALSE);
207 set_oppose_elec(caster_ptr, (TIME_EFFECT)plev, FALSE);
209 set_oppose_pois(caster_ptr, (TIME_EFFECT)plev, FALSE);
214 return psychometry(caster_ptr);
216 return ident_spell(caster_ptr, FALSE, TV_NONE);
218 msg_print(_("精神を捻じ曲げる波動を発生させた!", "Mind-warping forces emanate from your brain!"));
220 project(caster_ptr, 0, 2 + plev / 10, caster_ptr->y, caster_ptr->x, (plev * 3), GF_PSI, PROJECT_KILL);
222 (void)mindblast_monsters(caster_ptr, randint1(plev * ((plev - 5) / 10 + 1)));
225 case ADRENALINE_CHANNELING:
226 set_afraid(caster_ptr, 0);
227 set_stun(caster_ptr, 0);
228 if (!is_fast(caster_ptr) || !is_hero(caster_ptr))
229 hp_player(caster_ptr, plev);
231 t = 10 + randint1((plev * 3) / 2);
232 set_hero(caster_ptr, t, FALSE);
233 (void)set_fast(caster_ptr, t, FALSE);
236 if (!get_aim_dir(caster_ptr, &dir))
239 fetch_item(caster_ptr, dir, plev * 15, FALSE);
242 if (!get_aim_dir(caster_ptr, &dir))
245 dam = damroll(plev / 2, 6);
246 if (fire_ball(caster_ptr, GF_PSI_DRAIN, dir, dam, 0))
247 caster_ptr->energy_need += randint1(150);
251 if (!get_aim_dir(caster_ptr, &dir))
254 fire_beam(caster_ptr, GF_PSY_SPEAR, dir, randint1(plev * 3) + plev * 3);
257 time_walk(caster_ptr);
260 msg_print(_("なに?", "Zap?"));