1 #include "perception/simple-perception.h"
2 #include "autopick/autopick.h"
3 #include "inventory/player-inventory.h"
4 #include "object-enchant/item-feeling.h"
5 #include "perception/object-perception.h"
6 #include "object/object-flavor.h"
7 #include "object/object2.h"
8 #include "object-enchant/special-object-flags.h"
9 #include "player/avatar.h"
10 #include "player/player-move.h"
13 * @brief 擬似鑑定を実際に行い判定を反映する
14 * @param slot 擬似鑑定を行うプレイヤーの所持リストID
15 * @param creature_ptr プレーヤーへの参照ポインタ
16 * @param heavy 重度の擬似鑑定を行うならばTRUE
19 static void sense_inventory_aux(player_type *creature_ptr, INVENTORY_IDX slot, bool heavy)
22 object_type *o_ptr = &creature_ptr->inventory_list[slot];
23 GAME_TEXT o_name[MAX_NLEN];
24 if (o_ptr->ident & (IDENT_SENSE))
26 if (object_is_known(o_ptr))
29 feel = (heavy ? value_check_aux1(o_ptr) : value_check_aux2(o_ptr));
33 if ((creature_ptr->muta3 & MUT3_BAD_LUCK) && !randint0(13)) {
39 case FEEL_WORTHLESS: {
40 feel = FEEL_EXCELLENT;
45 feel = randint0(3) ? FEEL_GOOD : FEEL_AVERAGE;
51 feel = randint0(2) ? FEEL_CURSED : FEEL_GOOD;
56 feel = randint0(3) ? FEEL_CURSED : FEEL_AVERAGE;
61 case FEEL_EXCELLENT: {
62 feel = FEEL_WORTHLESS;
73 disturb(creature_ptr, FALSE, FALSE);
75 object_desc(creature_ptr, o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
76 if (slot >= INVEN_RARM) {
78 msg_format("%s%s(%c)は%sという感じがする...", describe_use(creature_ptr, slot), o_name, index_to_label(slot), game_inscriptions[feel]);
80 msg_format("You feel the %s (%c) you are %s %s %s...", o_name, index_to_label(slot), describe_use(creature_ptr, slot),
81 ((o_ptr->number == 1) ? "is" : "are"), game_inscriptions[feel]);
86 msg_format("ザックの中の%s(%c)は%sという感じがする...", o_name, index_to_label(slot), game_inscriptions[feel]);
88 msg_format("You feel the %s (%c) in your pack %s %s...", o_name, index_to_label(slot), ((o_ptr->number == 1) ? "is" : "are"), game_inscriptions[feel]);
92 o_ptr->ident |= (IDENT_SENSE);
93 o_ptr->feeling = feel;
95 autopick_alter_item(creature_ptr, slot, destroy_feeling);
96 creature_ptr->update |= (PU_COMBINE | PU_REORDER);
97 creature_ptr->window |= (PW_INVEN | PW_EQUIP);
101 * @brief 1プレイヤーターン毎に武器、防具の擬似鑑定が行われるかを判定する。
104 * Sense the inventory\n
106 * Class 0 = Warrior --> fast and heavy\n
107 * Class 1 = Mage --> slow and light\n
108 * Class 2 = Priest --> fast but light\n
109 * Class 3 = Rogue --> okay and heavy\n
110 * Class 4 = Ranger --> slow but heavy (changed!)\n
111 * Class 5 = Paladin --> slow but heavy\n
113 void sense_inventory1(player_type *creature_ptr)
115 PLAYER_LEVEL plev = creature_ptr->lev;
118 if (creature_ptr->confused)
121 switch (creature_ptr->pclass) {
125 case CLASS_CAVALRY: {
126 if (0 != randint0(9000L / (plev * plev + 40)))
133 if (0 != randint0(6000L / (plev * plev + 50)))
140 case CLASS_HIGH_MAGE:
142 case CLASS_MAGIC_EATER: {
143 if (0 != randint0(240000L / (plev + 5)))
150 if (0 != randint0(10000L / (plev * plev + 40)))
157 if (0 != randint0(20000L / (plev * plev + 40)))
164 if (0 != randint0(95000L / (plev * plev + 40)))
172 if (0 != randint0(77777L / (plev * plev + 40)))
178 case CLASS_WARRIOR_MAGE:
179 case CLASS_RED_MAGE: {
180 if (0 != randint0(75000L / (plev * plev + 40)))
185 case CLASS_MINDCRAFTER:
187 case CLASS_BLUE_MAGE:
188 case CLASS_MIRROR_MASTER: {
189 if (0 != randint0(55000L / (plev * plev + 40)))
194 case CLASS_CHAOS_WARRIOR: {
195 if (0 != randint0(80000L / (plev * plev + 40)))
202 case CLASS_FORCETRAINER: {
203 if (0 != randint0(20000L / (plev * plev + 40)))
208 case CLASS_TOURIST: {
209 if (0 != randint0(20000L / ((plev + 50) * (plev + 50))))
215 case CLASS_BEASTMASTER: {
216 if (0 != randint0(65000L / (plev * plev + 40)))
221 case CLASS_BERSERKER: {
227 if (compare_virtue(creature_ptr, V_KNOWLEDGE, 100, VIRTUE_LARGE))
230 for (INVENTORY_IDX i = 0; i < INVEN_TOTAL; i++) {
233 o_ptr = &creature_ptr->inventory_list[i];
238 switch (o_ptr->tval) {
264 if ((i < INVEN_RARM) && (0 != randint0(5)))
267 if ((creature_ptr->muta3 & MUT3_GOOD_LUCK) && !randint0(13)) {
271 sense_inventory_aux(creature_ptr, i, heavy);
276 * @brief 1プレイヤーターン毎に武器、防具以外の擬似鑑定が行われるかを判定する。
279 void sense_inventory2(player_type *creature_ptr)
281 PLAYER_LEVEL plev = creature_ptr->lev;
284 if (creature_ptr->confused)
287 switch (creature_ptr->pclass) {
292 case CLASS_BERSERKER:
298 case CLASS_CHAOS_WARRIOR:
300 case CLASS_BEASTMASTER:
302 if (0 != randint0(240000L / (plev + 5)))
308 case CLASS_WARRIOR_MAGE:
311 if (0 != randint0(95000L / (plev * plev + 40)))
319 case CLASS_FORCETRAINER:
320 case CLASS_MINDCRAFTER: {
321 if (0 != randint0(20000L / (plev * plev + 40)))
327 case CLASS_HIGH_MAGE:
329 case CLASS_MAGIC_EATER:
330 case CLASS_MIRROR_MASTER:
331 case CLASS_BLUE_MAGE: {
332 if (0 != randint0(9000L / (plev * plev + 40)))
337 case CLASS_TOURIST: {
338 if (0 != randint0(20000L / ((plev + 50) * (plev + 50))))
345 for (INVENTORY_IDX i = 0; i < INVEN_TOTAL; i++) {
347 o_ptr = &creature_ptr->inventory_list[i];
351 switch (o_ptr->tval) {
363 if ((i < INVEN_RARM) && (0 != randint0(5)))
366 sense_inventory_aux(creature_ptr, i, TRUE);