From cdab703a671fabd21a015d23a5dc8a3ed5e10b36 Mon Sep 17 00:00:00 2001 From: dolorous Date: Tue, 4 Dec 2007 17:24:52 +0000 Subject: Allow racial javelins. Javelins can now be elven and orcish, since dwarves don't make polearms, and are made so 25% of the time, the same as for spears. Since they have no associated launcher, the usual bonuses for throwing racial gear apply to them, in spite of their being missiles thrown by hand. Also, disable branded javelins for now, as branding for thrown missiles in general isn't implemented. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2997 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/itemprop.cc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/itemprop.cc') diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc index 2bb580de93..69da6bcc42 100644 --- a/crawl-ref/source/itemprop.cc +++ b/crawl-ref/source/itemprop.cc @@ -709,8 +709,11 @@ void set_equip_race( item_def &item, unsigned long flags ) } break; case OBJ_MISSILES: - if (item.sub_type == MI_ARROW) + if (item.sub_type == MI_ARROW + || item.sub_type == MI_JAVELIN) + { return; + } break; default: break; @@ -1855,7 +1858,15 @@ const char * ammo_name( const item_def &bow ) { ASSERT( is_range_weapon( bow ) ); return ammo_name(fires_ammo_type( bow )); -} +} + +// returns true if item has an associated launcher +bool has_launcher( const item_def &wpn ) +{ + return (wpn.sub_type != MI_LARGE_ROCK && + wpn.sub_type != MI_JAVELIN && + wpn.sub_type != MI_THROWING_NET); +} // returns true if item can be reasonably thrown without a launcher bool is_throwable( const item_def &wpn, size_type bodysize ) -- cgit v1.2.3-54-g00ecf