From 30414416d011ed83d9e7c8b753a56ac7096e6775 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Mon, 12 Feb 2007 07:40:59 +0000 Subject: Break up you_attack() into a slew of smaller functions. The functions are still fairly tangled, but they're better than the old monster. The idea is to also put monster-vs-player and monster-vs-monster into the melee_attack framework so that refactoring combat code with elements of 4.1 becomes easier. This is a big refactoring, so it's likely to be buggy. Some of the combat diagnostics - notably the damage rolls - are also AWOL. Will fix going forward. Note: The combat code is still classic b26. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@950 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/randart.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'crawl-ref/source/randart.cc') diff --git a/crawl-ref/source/randart.cc b/crawl-ref/source/randart.cc index 7a33cd310b..11ba9180c6 100644 --- a/crawl-ref/source/randart.cc +++ b/crawl-ref/source/randart.cc @@ -674,6 +674,11 @@ char does_unrandart_exist(int whun) return (unrandart_exist[whun]); } +bool is_artefact( const item_def &item ) +{ + return (is_random_artefact(item) || is_fixed_artefact(item)); +} + // returns true is item is a pure randart or an unrandart bool is_random_artefact( const item_def &item ) { @@ -745,7 +750,7 @@ static long calc_seed( const item_def &item ) } void randart_wpn_properties( const item_def &item, - FixedVector< char, RA_PROPERTIES > &proprt ) + randart_properties_t &proprt ) { ASSERT( is_random_artefact( item ) ); @@ -1213,9 +1218,9 @@ finished_curses: } -int randart_wpn_property( const item_def &item, char prop ) +int randart_wpn_property( const item_def &item, int prop ) { - FixedVector< char, RA_PROPERTIES > proprt; + randart_properties_t proprt; randart_wpn_properties( item, proprt ); -- cgit v1.2.3-54-g00ecf