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 "view/display-messages.h"
40 * @brief 超能力者のサイコメトリー処理/ Forcibly pseudo-identify an object in the inventory (or on the floor)
41 * @param caster_ptr プレーヤーへの参照ポインタ
44 * currently this function allows pseudo-id of any object,
45 * including silly ones like potions & scrolls, which always
46 * get '{average}'. This should be changed, either to stop such
47 * items from being pseudo-id'd, or to allow psychometry to
48 * detect whether the unidentified potion/scroll/etc is
49 * good (Cure Light Wounds, Restore Strength, etc) or
50 * bad (Poison, Weakness etc) or 'useless' (Slime Mold Juice, etc).
52 bool psychometry(player_type *caster_ptr)
54 concptr q = _("どのアイテムを調べますか?", "Meditate on which item? ");
55 concptr s = _("調べるアイテムがありません。", "You have nothing appropriate.");
58 o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
62 if (object_is_known(o_ptr)) {
63 msg_print(_("何も新しいことは判らなかった。", "You cannot find out anything more about that."));
67 item_feel_type feel = pseudo_value_check_heavy(o_ptr);
68 GAME_TEXT o_name[MAX_NLEN];
69 describe_flavor(caster_ptr, o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
72 msg_format(_("%sからは特に変わった事は感じとれなかった。", "You do not perceive anything unusual about the %s."), o_name);
77 msg_format("%sは%sという感じがする...", o_name, game_inscriptions[feel]);
79 msg_format("You feel that the %s %s %s...", o_name, ((o_ptr->number == 1) ? "is" : "are"), game_inscriptions[feel]);
82 o_ptr->ident |= (IDENT_SENSE);
83 o_ptr->feeling = feel;
84 o_ptr->marked |= OM_TOUCHED;
86 caster_ptr->update |= (PU_COMBINE | PU_REORDER);
87 caster_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
90 switch (o_ptr->tval) {
117 autopick_alter_item(caster_ptr, item, (bool)(okay && destroy_feeling));
123 * do_cmd_cast calls this function if the player's class is 'mindcrafter'.
124 * @param spell 発動する特殊技能のID
125 * @return 処理を実行したらTRUE、キャンセルした場合FALSEを返す。
127 bool cast_mindcrafter_spell(player_type *caster_ptr, mind_mindcrafter_type spell)
132 PLAYER_LEVEL plev = caster_ptr->lev;
136 chg_virtue(caster_ptr, V_KNOWLEDGE, 1);
137 chg_virtue(caster_ptr, V_ENLIGHTEN, 1);
138 wiz_lite(caster_ptr, FALSE);
139 } else if (plev > 19)
140 map_area(caster_ptr, DETECT_RAD_MAP);
143 b = detect_monsters_normal(caster_ptr, DETECT_RAD_DEFAULT);
145 b |= detect_monsters_invis(caster_ptr, DETECT_RAD_DEFAULT);
147 b |= detect_traps(caster_ptr, DETECT_RAD_DEFAULT, TRUE);
148 b |= detect_doors(caster_ptr, DETECT_RAD_DEFAULT);
151 b = detect_all(caster_ptr, DETECT_RAD_DEFAULT);
154 if ((plev > 24) && (plev < 40))
155 set_tim_esp(caster_ptr, (TIME_EFFECT)plev, FALSE);
158 msg_print(_("安全な気がする。", "You feel safe."));
162 if (!get_aim_dir(caster_ptr, &dir))
165 if (randint1(100) < plev * 2)
166 fire_beam(caster_ptr, GF_PSI, dir, damroll(3 + ((plev - 1) / 4), (3 + plev / 15)));
168 fire_ball(caster_ptr, GF_PSI, dir, damroll(3 + ((plev - 1) / 4), (3 + plev / 15)), 0);
170 case MINOR_DISPLACEMENT:
171 teleport_player(caster_ptr, 10, TELEPORT_SPONTANEOUS);
173 case MAJOR_DISPLACEMENT:
174 teleport_player(caster_ptr, plev * 5, TELEPORT_SPONTANEOUS);
178 if (!get_aim_dir(caster_ptr, &dir))
181 fire_ball(caster_ptr, GF_DOMINATION, dir, plev, 0);
183 charm_monsters(caster_ptr, plev * 2);
188 if (!get_aim_dir(caster_ptr, &dir))
191 fire_ball(caster_ptr, GF_TELEKINESIS, dir, damroll(8 + ((plev - 5) / 4), 8), (plev > 20 ? (plev - 20) / 8 + 1 : 0));
193 case CHARACTER_ARMOR:
194 set_shield(caster_ptr, (TIME_EFFECT)plev, FALSE);
196 set_oppose_acid(caster_ptr, (TIME_EFFECT)plev, FALSE);
198 set_oppose_fire(caster_ptr, (TIME_EFFECT)plev, FALSE);
200 set_oppose_cold(caster_ptr, (TIME_EFFECT)plev, FALSE);
202 set_oppose_elec(caster_ptr, (TIME_EFFECT)plev, FALSE);
204 set_oppose_pois(caster_ptr, (TIME_EFFECT)plev, FALSE);
209 return psychometry(caster_ptr);
211 return ident_spell(caster_ptr, FALSE, 0);
213 msg_print(_("精神を捻じ曲げる波動を発生させた!", "Mind-warping forces emanate from your brain!"));
215 project(caster_ptr, 0, 2 + plev / 10, caster_ptr->y, caster_ptr->x, (plev * 3), GF_PSI, PROJECT_KILL, -1);
217 (void)mindblast_monsters(caster_ptr, randint1(plev * ((plev - 5) / 10 + 1)));
220 case ADRENALINE_CHANNELING:
221 set_afraid(caster_ptr, 0);
222 set_stun(caster_ptr, 0);
223 if (!is_fast(caster_ptr) || !is_hero(caster_ptr))
224 hp_player(caster_ptr, plev);
226 t = 10 + randint1((plev * 3) / 2);
227 set_hero(caster_ptr, t, FALSE);
228 (void)set_fast(caster_ptr, t, FALSE);
231 if (!get_aim_dir(caster_ptr, &dir))
234 fetch_item(caster_ptr, dir, plev * 15, FALSE);
237 if (!get_aim_dir(caster_ptr, &dir))
240 b = damroll(plev / 2, 6);
241 if (fire_ball(caster_ptr, GF_PSI_DRAIN, dir, b, 0))
242 caster_ptr->energy_need += randint1(150);
246 if (!get_aim_dir(caster_ptr, &dir))
249 fire_beam(caster_ptr, GF_PSY_SPEAR, dir, randint1(plev * 3) + plev * 3);
252 time_walk(caster_ptr);
255 msg_print(_("なに?", "Zap?"));