diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-12-04 17:24:52 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-12-04 17:24:52 +0000 |
commit | cdab703a671fabd21a015d23a5dc8a3ed5e10b36 (patch) | |
tree | 8fb64601c35b90df902bddf7f3bb63db807a393e /crawl-ref/source/itemprop.cc | |
parent | ba7c629689d1042cf8cb4d94de535025154bc0ea (diff) | |
download | crawl-ref-cdab703a671fabd21a015d23a5dc8a3ed5e10b36.tar.gz crawl-ref-cdab703a671fabd21a015d23a5dc8a3ed5e10b36.zip |
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
Diffstat (limited to 'crawl-ref/source/itemprop.cc')
-rw-r--r-- | crawl-ref/source/itemprop.cc | 15 |
1 files changed, 13 insertions, 2 deletions
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 ) |