OSDN Git Service

Add a function 'object_is_random_artifact()'
authorhabu <habu@0568b783-4c39-0410-ac80-bf13821ea2a2>
Mon, 4 Feb 2013 10:21:00 +0000 (10:21 +0000)
committerhabu <habu@0568b783-4c39-0410-ac80-bf13821ea2a2>
Mon, 4 Feb 2013 10:21:00 +0000 (10:21 +0000)
src/externs.h
src/obj_kind.c

index dc46928..2840615 100644 (file)
@@ -1676,6 +1676,7 @@ extern bool object_allow_enchant_weapon(object_type *o_ptr);
 extern bool object_allow_enchant_melee_weapon(object_type *o_ptr);
 extern bool object_is_smith(object_type *o_ptr);
 extern bool object_is_artifact(object_type *o_ptr);
+extern bool object_is_random_artifact(object_type *o_ptr);
 extern bool object_is_nameless(object_type *o_ptr);
 extern bool object_allow_two_hands_wielding(object_type *o_ptr);
 
index d51b58d..3beb7e3 100644 (file)
@@ -307,6 +307,17 @@ bool object_is_artifact(object_type *o_ptr)
 
 
 /*
+ * Check if an object is random artifact
+ */
+bool object_is_random_artifact(object_type *o_ptr)
+{
+       if (object_is_artifact(o_ptr) && !object_is_fixed_artifact(o_ptr)) return TRUE;
+
+       return FALSE;
+}
+
+
+/*
  * Check if an object is neither artifact, ego, nor 'smith' object
  */
 bool object_is_nameless(object_type *o_ptr)