Permalink
Browse files

Major cleanup of sensing and id-by-use, changing sensing to mean know…

…ing the number of flags on an item.
  • Loading branch information...
1 parent 34b5d4f commit 5e82e576bc1e34dff004cb3b8e9f6fcb733a1c75 @eddiegrove committed Jun 18, 2011
View
@@ -219,7 +219,7 @@ bool py_attack_real(int y, int x, bool *fear) {
}
/* Learn by use for other equipped items */
- wieldeds_notice_on_attack();
+ wieldeds_notice_offweapon_attack_plusses();
/* Apply the player damage bonuses */
dmg += p_ptr->state.to_d;
View
@@ -323,11 +323,7 @@ static void py_pickup_aux(int o_idx, bool domsg)
p_ptr->notice |= PN_SQUELCH;
/* Automatically sense artifacts */
- object_sense_artifact(o_ptr);
-
- /* Log artifacts if found */
- if (o_ptr->artifact)
- history_add_artifact(o_ptr->artifact, object_is_known(o_ptr), TRUE);
+ object_notice_artifact(o_ptr);
/* Optionally, display a message */
if (domsg && !quiver_slot)
View
@@ -121,6 +121,8 @@ void textui_cmd_destroy(void)
menu_type *m;
region r;
int selected;
+ byte value;
+ int type;
/* Get an item */
const char *q = "Ignore which item? ";
@@ -158,21 +160,18 @@ void textui_cmd_destroy(void)
}
/* Quality squelching */
- if (object_was_sensed(o_ptr) || object_was_worn(o_ptr) ||
- object_is_known_not_artifact(o_ptr)) {
- byte value = squelch_level_of(o_ptr);
- int type = squelch_type_of(o_ptr);
+ value = squelch_level_of(o_ptr);
+ type = squelch_type_of(o_ptr);
- if (object_is_jewelry(o_ptr) &&
- squelch_level_of(o_ptr) != SQUELCH_BAD)
- value = SQUELCH_MAX;
+ if (object_is_jewelry(o_ptr) &&
+ squelch_level_of(o_ptr) != SQUELCH_BAD)
+ value = SQUELCH_MAX;
- if (value != SQUELCH_MAX && type != TYPE_MAX) {
- strnfmt(out_val, sizeof out_val, "All %s %s",
- quality_values[value].name, quality_choices[type].name);
+ if (value != SQUELCH_MAX && type != TYPE_MAX) {
+ strnfmt(out_val, sizeof out_val, "All %s %s",
+ quality_values[value].name, quality_choices[type].name);
- menu_dynamic_add(m, out_val, IGNORE_THIS_QUALITY);
- }
+ menu_dynamic_add(m, out_val, IGNORE_THIS_QUALITY);
}
/* work out display region */
View
@@ -950,4 +950,17 @@ enum
MON_TMD_MAX
};
+/**
+ * Whether to give the player access to the exact number of object flags
+ * after an object has been pseudoed.
+ */
+#define SENSING_REVEALS_FLAG_COUNT TRUE
+
+/*
+ * Iterators for *_info arrays
+ */
+#define for_each_kind(k) for (k = &k_info[0]; k < &k_info[z_info->k_max]; k++) if (k->alloc_prob)
+#define for_each_ego(e) for (e = &e_info[0]; e < &e_info[z_info->e_max]; e++) if (e->rarity)
+#define for_each_artifact(a) for (a = &a_info[0]; a < &a_info[z_info->a_max]; a++) if (a->alloc_prob)
+
#endif /* !INCLUDED_DEFINES_H */
View
@@ -75,7 +75,6 @@ bool check_hit(int power, int level)
ac = p_ptr->state.ac + p_ptr->state.to_a;
/* if the monster checks vs ac, the player learns ac bonuses */
- /* XXX Eddie should you only learn +ac on miss, -ac on hit? who knows */
object_notice_on_defend();
/* Check if the player was hit */
View
@@ -3127,7 +3127,6 @@ void flush_all_monster_messages(void)
size_mon_hist = 0;
}
-/* XXX Eddie This is ghastly. The monster should have known_flags similar to in the object_type structure. */
typedef struct {
int idx;
int flag;
Oops, something went wrong.

0 comments on commit 5e82e57

Please sign in to comment.