From e6525c83826d150eb2a283ce5bf23218cb75f82e Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Tue, 13 Nov 2007 15:57:55 +0000 Subject: * Add Cannibalism to list of forbidded actions for good gods. * Add simple warning message (god "did not appreciate that!") when using unID'd items that would otherwise be penalized. * Change protection from harm to be independent of prayer. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2849 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/itemname.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'crawl-ref/source/itemname.cc') diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc index 26210874c8..eaacf8c987 100644 --- a/crawl-ref/source/itemname.cc +++ b/crawl-ref/source/itemname.cc @@ -1605,6 +1605,15 @@ bool item_type_known( const item_def& item ) return false; } +bool item_type_known(const object_class_type base_type, const int sub_type) +{ + const item_type_id_type idt = objtype_to_idtype(base_type); + if ( idt != NUM_IDTYPE && sub_type < 50 ) + return ( type_ids[idt][sub_type] == ID_KNOWN_TYPE ); + else + return false; +} + bool item_type_tried( const item_def& item ) { if ( item_type_known(item) ) -- cgit v1.2.3-54-g00ecf