• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revisionaa94ea6c3ee6e01a7bd899b606ac20dbc1cb8273 (tree)
Time2019-03-14 14:44:08
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #37353 can_player_destroy_object() to object-hook.c.

Change Summary

Incremental Difference

--- a/src/externs.h
+++ b/src/externs.h
@@ -745,7 +745,6 @@ extern byte value_check_aux1(object_type *o_ptr);
745745 extern byte value_check_aux2(object_type *o_ptr);
746746 extern PRICE object_value(object_type *o_ptr);
747747 extern PRICE object_value_real(object_type *o_ptr);
748-extern bool can_player_destroy_object(object_type *o_ptr);
749748 extern void distribute_charges(object_type *o_ptr, object_type *q_ptr, int amt);
750749 extern void reduce_charges(object_type *o_ptr, int amt);
751750 extern int object_similar_part(object_type *o_ptr, object_type *j_ptr);
--- a/src/object-hook.c
+++ b/src/object-hook.c
@@ -911,3 +911,37 @@ bool object_can_refill_torch(object_type *o_ptr)
911911 return (FALSE);
912912 }
913913
914+
915+/*!
916+ * @brief 破壊可能なアイテムかを返す /
917+ * Determines whether an object can be destroyed, and makes fake inscription.
918+ * @param o_ptr 破壊可能かを確認したいオブジェクトの構造体参照ポインタ
919+ * @return オブジェクトが破壊可能ならばTRUEを返す
920+ */
921+bool can_player_destroy_object(object_type *o_ptr)
922+{
923+ /* Artifacts cannot be destroyed */
924+ if (!object_is_artifact(o_ptr)) return TRUE;
925+
926+ /* If object is unidentified, makes fake inscription */
927+ if (!object_is_known(o_ptr))
928+ {
929+ byte feel = FEEL_SPECIAL;
930+
931+ /* Hack -- Handle icky artifacts */
932+ if (object_is_cursed(o_ptr) || object_is_broken(o_ptr)) feel = FEEL_TERRIBLE;
933+
934+ /* Hack -- inscribe the artifact */
935+ o_ptr->feeling = feel;
936+
937+ /* We have "felt" it (again) */
938+ o_ptr->ident |= (IDENT_SENSE);
939+ p_ptr->update |= (PU_COMBINE);
940+ p_ptr->window |= (PW_INVEN | PW_EQUIP);
941+
942+ return FALSE;
943+ }
944+
945+ /* Identified artifact -- Nothing to do */
946+ return FALSE;
947+}
--- a/src/object-hook.h
+++ b/src/object-hook.h
@@ -48,3 +48,4 @@ extern bool object_is_random_artifact(object_type *o_ptr);
4848 extern bool object_is_nameless(object_type *o_ptr);
4949 extern bool object_allow_two_hands_wielding(object_type *o_ptr);
5050 extern bool object_can_refill_torch(object_type *o_ptr);
51+extern bool can_player_destroy_object(object_type *o_ptr);
--- a/src/object2.c
+++ b/src/object2.c
@@ -1429,40 +1429,6 @@ PRICE object_value(object_type *o_ptr)
14291429
14301430
14311431
1432-/*!
1433- * @brief 破壊可能なアイテムかを返す /
1434- * Determines whether an object can be destroyed, and makes fake inscription.
1435- * @param o_ptr 破壊可能かを確認したいオブジェクトの構造体参照ポインタ
1436- * @return オブジェクトが破壊可能ならばTRUEを返す
1437- */
1438-bool can_player_destroy_object(object_type *o_ptr)
1439-{
1440- /* Artifacts cannot be destroyed */
1441- if (!object_is_artifact(o_ptr)) return TRUE;
1442-
1443- /* If object is unidentified, makes fake inscription */
1444- if (!object_is_known(o_ptr))
1445- {
1446- byte feel = FEEL_SPECIAL;
1447-
1448- /* Hack -- Handle icky artifacts */
1449- if (object_is_cursed(o_ptr) || object_is_broken(o_ptr)) feel = FEEL_TERRIBLE;
1450-
1451- /* Hack -- inscribe the artifact */
1452- o_ptr->feeling = feel;
1453-
1454- /* We have "felt" it (again) */
1455- o_ptr->ident |= (IDENT_SENSE);
1456- p_ptr->update |= (PU_COMBINE);
1457- p_ptr->window |= (PW_INVEN | PW_EQUIP);
1458-
1459- return FALSE;
1460- }
1461-
1462- /* Identified artifact -- Nothing to do */
1463- return FALSE;
1464-}
1465-
14661432
14671433 /*!
14681434 * @brief 魔法棒やロッドのスロット分割時に使用回数を分配する /
Show on old repository browser