1 #include "mind/mind-mindcrafter.h"
2 #include "autopick/autopick.h"
3 #include "core/player-update-types.h"
4 #include "core/window-redrawer.h"
5 #include "effect/effect-characteristics.h"
6 #include "effect/effect-processor.h"
7 #include "flavor/flag-inscriptions-table.h"
8 #include "flavor/flavor-describer.h"
9 #include "flavor/object-flavor-types.h"
10 #include "floor/floor-object.h"
11 #include "game-option/auto-destruction-options.h"
12 #include "hpmp/hp-mp-processor.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 "player/player-status.h"
23 #include "spell-kind/spells-detection.h"
24 #include "spell-kind/spells-fetcher.h"
25 #include "spell-kind/spells-floor.h"
26 #include "spell-kind/spells-launcher.h"
27 #include "spell-kind/spells-perception.h"
28 #include "spell-kind/spells-sight.h"
29 #include "spell-kind/spells-teleport.h"
30 #include "spell/spell-types.h"
31 #include "spell/spells-status.h"
32 #include "status/bad-status-setter.h"
33 #include "status/buff-setter.h"
34 #include "status/element-resistance.h"
35 #include "status/sight-setter.h"
36 #include "system/object-type-definition.h"
37 #include "system/player-type-definition.h"
38 #include "target/target-getter.h"
39 #include "util/bit-flags-calculator.h"
40 #include "view/display-messages.h"
43 * @brief 超能力者のサイコメトリー処理/ Forcibly pseudo-identify an object in the inventory (or on the floor)
44 * @param caster_ptr プレーヤーへの参照ポインタ
46 * currently this function allows pseudo-id of any object,
47 * including silly ones like potions & scrolls, which always
48 * get '{average}'. This should be changed, either to stop such
49 * items from being pseudo-id'd, or to allow psychometry to
50 * detect whether the unidentified potion/scroll/etc is
51 * good (Cure Light Wounds, Restore Strength, etc) or
52 * bad (Poison, Weakness etc) or 'useless' (Slime Mold Juice, etc).
54 bool psychometry(player_type *caster_ptr)
56 concptr q = _("どのアイテムを調べますか?", "Meditate on which item? ");
57 concptr s = _("調べるアイテムがありません。", "You have nothing appropriate.");
60 o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), TV_NONE);
64 if (object_is_known(o_ptr)) {
65 msg_print(_("何も新しいことは判らなかった。", "You cannot find out anything more about that."));
69 item_feel_type feel = pseudo_value_check_heavy(o_ptr);
70 GAME_TEXT o_name[MAX_NLEN];
71 describe_flavor(caster_ptr, o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
74 msg_format(_("%sからは特に変わった事は感じとれなかった。", "You do not perceive anything unusual about the %s."), o_name);
79 msg_format("%sは%sという感じがする...", o_name, game_inscriptions[feel]);
81 msg_format("You feel that the %s %s %s...", o_name, ((o_ptr->number == 1) ? "is" : "are"), game_inscriptions[feel]);
84 set_bits(o_ptr->ident, IDENT_SENSE);
85 o_ptr->feeling = feel;
86 set_bits(o_ptr->marked, OM_TOUCHED);
88 set_bits(caster_ptr->update, PU_COMBINE | PU_REORDER);
89 set_bits(caster_ptr->window_flags, PW_INVEN | PW_EQUIP | PW_PLAYER | PW_FLOOR_ITEM_LIST);
92 switch (o_ptr->tval) {
122 autopick_alter_item(caster_ptr, item, (bool)(okay && destroy_feeling));
128 * do_cmd_cast calls this function if the player's class is 'mindcrafter'.
129 * @param spell 発動する特殊技能のID
130 * @return 処理を実行したらTRUE、キャンセルした場合FALSEを返す。
132 bool cast_mindcrafter_spell(player_type *caster_ptr, mind_mindcrafter_type spell)
138 PLAYER_LEVEL plev = caster_ptr->lev;
142 chg_virtue(caster_ptr, V_KNOWLEDGE, 1);
143 chg_virtue(caster_ptr, V_ENLIGHTEN, 1);
144 wiz_lite(caster_ptr, FALSE);
145 } else if (plev > 19)
146 map_area(caster_ptr, DETECT_RAD_MAP);
149 b = detect_monsters_normal(caster_ptr, DETECT_RAD_DEFAULT);
151 b |= detect_monsters_invis(caster_ptr, DETECT_RAD_DEFAULT);
153 b |= detect_traps(caster_ptr, DETECT_RAD_DEFAULT, TRUE);
154 b |= detect_doors(caster_ptr, DETECT_RAD_DEFAULT);
157 b = detect_all(caster_ptr, DETECT_RAD_DEFAULT);
160 if ((plev > 24) && (plev < 40))
161 set_tim_esp(caster_ptr, (TIME_EFFECT)plev, FALSE);
164 msg_print(_("安全な気がする。", "You feel safe."));
168 if (!get_aim_dir(caster_ptr, &dir))
171 if (randint1(100) < plev * 2)
172 fire_beam(caster_ptr, GF_PSI, dir, damroll(3 + ((plev - 1) / 4), (3 + plev / 15)));
174 fire_ball(caster_ptr, GF_PSI, dir, damroll(3 + ((plev - 1) / 4), (3 + plev / 15)), 0);
176 case MINOR_DISPLACEMENT:
177 teleport_player(caster_ptr, 10, TELEPORT_SPONTANEOUS);
179 case MAJOR_DISPLACEMENT:
180 teleport_player(caster_ptr, plev * 5, TELEPORT_SPONTANEOUS);
184 if (!get_aim_dir(caster_ptr, &dir))
187 fire_ball(caster_ptr, GF_DOMINATION, dir, plev, 0);
189 charm_monsters(caster_ptr, plev * 2);
194 if (!get_aim_dir(caster_ptr, &dir))
197 fire_ball(caster_ptr, GF_TELEKINESIS, dir, damroll(8 + ((plev - 5) / 4), 8), (plev > 20 ? (plev - 20) / 8 + 1 : 0));
199 case CHARACTER_ARMOR:
200 set_shield(caster_ptr, (TIME_EFFECT)plev, FALSE);
202 set_oppose_acid(caster_ptr, (TIME_EFFECT)plev, FALSE);
204 set_oppose_fire(caster_ptr, (TIME_EFFECT)plev, FALSE);
206 set_oppose_cold(caster_ptr, (TIME_EFFECT)plev, FALSE);
208 set_oppose_elec(caster_ptr, (TIME_EFFECT)plev, FALSE);
210 set_oppose_pois(caster_ptr, (TIME_EFFECT)plev, FALSE);
215 return psychometry(caster_ptr);
217 return ident_spell(caster_ptr, FALSE, TV_NONE);
219 msg_print(_("精神を捻じ曲げる波動を発生させた!", "Mind-warping forces emanate from your brain!"));
221 project(caster_ptr, 0, 2 + plev / 10, caster_ptr->y, caster_ptr->x, (plev * 3), GF_PSI, PROJECT_KILL);
223 (void)mindblast_monsters(caster_ptr, randint1(plev * ((plev - 5) / 10 + 1)));
226 case ADRENALINE_CHANNELING:
227 set_afraid(caster_ptr, 0);
228 set_stun(caster_ptr, 0);
229 if (!is_fast(caster_ptr) || !is_hero(caster_ptr))
230 hp_player(caster_ptr, plev);
232 t = 10 + randint1((plev * 3) / 2);
233 set_hero(caster_ptr, t, FALSE);
234 (void)set_fast(caster_ptr, t, FALSE);
237 if (!get_aim_dir(caster_ptr, &dir))
240 fetch_item(caster_ptr, dir, plev * 15, FALSE);
243 if (!get_aim_dir(caster_ptr, &dir))
246 dam = damroll(plev / 2, 6);
247 if (fire_ball(caster_ptr, GF_PSI_DRAIN, dir, dam, 0))
248 caster_ptr->energy_need += randint1(150);
252 if (!get_aim_dir(caster_ptr, &dir))
255 fire_beam(caster_ptr, GF_PSY_SPEAR, dir, randint1(plev * 3) + plev * 3);
258 time_walk(caster_ptr);
261 msg_print(_("なに?", "Zap?"));