1 #include "system/angband.h"
2 #include "inventory/simple-appraiser.h"
3 #include "object/object-flavor.h"
4 #include "player/avatar.h"
5 #include "object/object-hook.h"
6 #include "object/object-kind.h"
7 #include "player/player-move.h"
8 #include "player-inventory.h"
9 #include "autopick/autopick.h"
12 * @brief 擬似鑑定を実際に行い判定を反映する
13 * @param slot 擬似鑑定を行うプレイヤーの所持リストID
14 * @param creature_ptr プレーヤーへの参照ポインタ
15 * @param heavy 重度の擬似鑑定を行うならばTRUE
18 static void sense_inventory_aux(player_type* creature_ptr, INVENTORY_IDX slot, bool heavy)
21 object_type* o_ptr = &creature_ptr->inventory_list[slot];
22 GAME_TEXT o_name[MAX_NLEN];
23 if (o_ptr->ident & (IDENT_SENSE))
25 if (object_is_known(o_ptr))
28 feel = (heavy ? value_check_aux1(o_ptr) : value_check_aux2(o_ptr));
32 if ((creature_ptr->muta3 & MUT3_BAD_LUCK) && !randint0(13)) {
38 case FEEL_WORTHLESS: {
39 feel = FEEL_EXCELLENT;
44 feel = randint0(3) ? FEEL_GOOD : FEEL_AVERAGE;
50 feel = randint0(2) ? FEEL_CURSED : FEEL_GOOD;
55 feel = randint0(3) ? FEEL_CURSED : FEEL_AVERAGE;
60 case FEEL_EXCELLENT: {
61 feel = FEEL_WORTHLESS;
72 disturb(creature_ptr, FALSE, FALSE);
74 object_desc(creature_ptr, o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
75 if (slot >= INVEN_RARM) {
77 msg_format("%s%s(%c)は%sという感じがする...",
78 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...",
81 o_name, index_to_label(slot), describe_use(creature_ptr, slot),
82 ((o_ptr->number == 1) ? "is" : "are"),
83 game_inscriptions[feel]);
88 msg_format("ザックの中の%s(%c)は%sという感じがする...",
89 o_name, index_to_label(slot), game_inscriptions[feel]);
91 msg_format("You feel the %s (%c) in your pack %s %s...",
92 o_name, index_to_label(slot),
93 ((o_ptr->number == 1) ? "is" : "are"),
94 game_inscriptions[feel]);
98 o_ptr->ident |= (IDENT_SENSE);
99 o_ptr->feeling = feel;
101 autopick_alter_item(creature_ptr, slot, destroy_feeling);
102 creature_ptr->update |= (PU_COMBINE | PU_REORDER);
103 creature_ptr->window |= (PW_INVEN | PW_EQUIP);
107 * @brief 1プレイヤーターン毎に武器、防具の擬似鑑定が行われるかを判定する。
110 * Sense the inventory\n
112 * Class 0 = Warrior --> fast and heavy\n
113 * Class 1 = Mage --> slow and light\n
114 * Class 2 = Priest --> fast but light\n
115 * Class 3 = Rogue --> okay and heavy\n
116 * Class 4 = Ranger --> slow but heavy (changed!)\n
117 * Class 5 = Paladin --> slow but heavy\n
119 void sense_inventory1(player_type* creature_ptr)
121 PLAYER_LEVEL plev = creature_ptr->lev;
124 if (creature_ptr->confused)
127 switch (creature_ptr->pclass) {
131 case CLASS_CAVALRY: {
132 if (0 != randint0(9000L / (plev * plev + 40)))
139 if (0 != randint0(6000L / (plev * plev + 50)))
146 case CLASS_HIGH_MAGE:
148 case CLASS_MAGIC_EATER: {
149 if (0 != randint0(240000L / (plev + 5)))
156 if (0 != randint0(10000L / (plev * plev + 40)))
163 if (0 != randint0(20000L / (plev * plev + 40)))
170 if (0 != randint0(95000L / (plev * plev + 40)))
178 if (0 != randint0(77777L / (plev * plev + 40)))
184 case CLASS_WARRIOR_MAGE:
185 case CLASS_RED_MAGE: {
186 if (0 != randint0(75000L / (plev * plev + 40)))
191 case CLASS_MINDCRAFTER:
193 case CLASS_BLUE_MAGE:
194 case CLASS_MIRROR_MASTER: {
195 if (0 != randint0(55000L / (plev * plev + 40)))
200 case CLASS_CHAOS_WARRIOR: {
201 if (0 != randint0(80000L / (plev * plev + 40)))
208 case CLASS_FORCETRAINER: {
209 if (0 != randint0(20000L / (plev * plev + 40)))
214 case CLASS_TOURIST: {
215 if (0 != randint0(20000L / ((plev + 50) * (plev + 50))))
221 case CLASS_BEASTMASTER: {
222 if (0 != randint0(65000L / (plev * plev + 40)))
227 case CLASS_BERSERKER: {
233 if (compare_virtue(creature_ptr, V_KNOWLEDGE, 100, VIRTUE_LARGE))
236 for (INVENTORY_IDX i = 0; i < INVEN_TOTAL; i++) {
239 o_ptr = &creature_ptr->inventory_list[i];
244 switch (o_ptr->tval) {
270 if ((i < INVEN_RARM) && (0 != randint0(5)))
273 if ((creature_ptr->muta3 & MUT3_GOOD_LUCK) && !randint0(13)) {
277 sense_inventory_aux(creature_ptr, i, heavy);
282 * @brief 1プレイヤーターン毎に武器、防具以外の擬似鑑定が行われるかを判定する。
285 void sense_inventory2(player_type* creature_ptr)
287 PLAYER_LEVEL plev = creature_ptr->lev;
290 if (creature_ptr->confused)
293 switch (creature_ptr->pclass) {
298 case CLASS_BERSERKER:
304 case CLASS_CHAOS_WARRIOR:
306 case CLASS_BEASTMASTER:
308 if (0 != randint0(240000L / (plev + 5)))
314 case CLASS_WARRIOR_MAGE:
317 if (0 != randint0(95000L / (plev * plev + 40)))
325 case CLASS_FORCETRAINER:
326 case CLASS_MINDCRAFTER: {
327 if (0 != randint0(20000L / (plev * plev + 40)))
333 case CLASS_HIGH_MAGE:
335 case CLASS_MAGIC_EATER:
336 case CLASS_MIRROR_MASTER:
337 case CLASS_BLUE_MAGE: {
338 if (0 != randint0(9000L / (plev * plev + 40)))
343 case CLASS_TOURIST: {
344 if (0 != randint0(20000L / ((plev + 50) * (plev + 50))))
351 for (INVENTORY_IDX i = 0; i < INVEN_TOTAL; i++) {
353 o_ptr = &creature_ptr->inventory_list[i];
357 switch (o_ptr->tval) {
369 if ((i < INVEN_RARM) && (0 != randint0(5)))
372 sense_inventory_aux(creature_ptr, i, TRUE);