OSDN Git Service

can_player_destroy_object()のextern宣言がなかったのを修正。ついでに
[hengband/hengband.git] / src / object2.c
index 024e4fb..04386dc 100644 (file)
@@ -1423,6 +1423,39 @@ s32b object_value(object_type *o_ptr)
 
 
 /*
+ * Determines whether an object can be destroyed, and makes fake inscription.
+ */
+bool can_player_destroy_object(object_type *o_ptr)
+{
+       /* Artifacts cannot be destroyed */
+       if (artifact_p(o_ptr) || o_ptr->art_name)
+       {
+               byte feel = FEEL_SPECIAL;
+
+               /* Hack -- Handle icky artifacts */
+               if (cursed_p(o_ptr) || broken_p(o_ptr)) feel = FEEL_TERRIBLE;
+
+               /* Hack -- inscribe the artifact */
+               o_ptr->feeling = feel;
+
+               /* We have "felt" it (again) */
+               o_ptr->ident |= (IDENT_SENSE);
+
+               /* Combine the pack */
+               p_ptr->notice |= (PN_COMBINE);
+
+               /* Window stuff */
+               p_ptr->window |= (PW_INVEN | PW_EQUIP);
+
+               /* Done */
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+
+/*
  * Distribute charges of rods or wands.
  *
  * o_ptr = source item