diff options
author | Adam Borowski <kilobyte@angband.pl> | 2009-12-11 11:08:59 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2009-12-11 11:08:59 +0100 |
commit | 54c2ea1ac1ceb7926f2d489e1cbcc7e9a28f990a (patch) | |
tree | 493d2b959580683b31e88af7d8a0afb34d23be00 /crawl-ref | |
parent | b87399f832fec14917a0155bacb13b026efd9c2a (diff) | |
download | crawl-ref-54c2ea1ac1ceb7926f2d489e1cbcc7e9a28f990a.tar.gz crawl-ref-54c2ea1ac1ceb7926f2d489e1cbcc7e9a28f990a.zip |
Use AT_ not AF_ for WEAP_ONLY, so statues won't use bows like a cudgel.
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/fight.cc | 11 | ||||
-rw-r--r-- | crawl-ref/source/mon-data.h | 4 | ||||
-rw-r--r-- | crawl-ref/source/mon-util.cc | 8 | ||||
-rw-r--r-- | crawl-ref/source/mon-util.h | 7 | ||||
-rw-r--r-- | crawl-ref/source/monster.cc | 2 |
5 files changed, 17 insertions, 15 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 063fd8c9f8..79adf9c3dc 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -5227,8 +5227,17 @@ void melee_attack::mons_perform_attack_rounds() init_attack(); - const mon_attack_def attk = mons_attack_spec(attacker_as_monster(), + mon_attack_def attk = mons_attack_spec(attacker_as_monster(), attack_number); + if (attk.type == AT_WEAP_ONLY) + { + int weap = attacker_as_monster()->inv[MSLOT_WEAPON]; + if (weap == NON_ITEM) + attk.type = AT_NONE; + else if (is_range_weapon(mitm[weap])) + attk.type = AT_SHOOT; + } + if (attk.type == AT_NONE) { // Make sure the monster uses up some energy, even diff --git a/crawl-ref/source/mon-data.h b/crawl-ref/source/mon-data.h index 73dde6150e..725036019e 100644 --- a/crawl-ref/source/mon-data.h +++ b/crawl-ref/source/mon-data.h @@ -4173,10 +4173,10 @@ static monsterentry mondata[] = { { MONS_STATUE, '8', LIGHTGREY, "statue", - M_STATIONARY | M_SPEAKS, + M_STATIONARY | M_SPEAKS | M_ARCHER, MR_RES_POISON | MR_RES_FIRE | MR_RES_COLD | MR_RES_ELEC, 0, 10, MONS_CLAY_GOLEM, MONS_STATUE, MH_NONLIVING, MAG_IMMUNE, - { {AT_HIT, AF_WEAP_ONLY, 20}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK }, + { {AT_WEAP_ONLY, AF_PLAIN, 20}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK }, { 8, 0, 0, 70 }, 12, 1, MST_NO_SPELLS, CE_NOCORPSE, Z_NOZOMBIE, S_SILENT, I_HIGH, HT_LAND, FL_NONE, 10, DEFAULT_ENERGY, diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index e86602e9c9..d5b4a54201 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -1081,14 +1081,6 @@ mon_attack_def mons_attack_spec(const monsters *mon, int attk_number) attk.flavour = RANDOM_ELEMENT(flavours); } - if (attk.flavour == AF_WEAP_ONLY) - { - if (mon->inv[MSLOT_WEAPON] != NON_ITEM) // not mon->weapon() ! - attk.flavour = AF_PLAIN; - else - return (mon_attack_def::attk(0, AT_NONE)); - } - // Slime creature attacks are multiplied by the number merged. if (mon->type == MONS_SLIME_CREATURE && mon->number > 1) attk.damage *= mon->number; diff --git a/crawl-ref/source/mon-util.h b/crawl-ref/source/mon-util.h index a79260d378..bb36b38df7 100644 --- a/crawl-ref/source/mon-util.h +++ b/crawl-ref/source/mon-util.h @@ -53,7 +53,9 @@ enum mon_attack_type AT_GORE, AT_SHOOT, // Attack representing missile damage for M_ARCHER. - AT_RANDOM // Anything but AT_SHOOT. + AT_WEAP_ONLY, // Ranged weap: shoot point-blank like AT_SHOOT, melee weap: + // use it, no weapon: stand there doing nothing. + AT_RANDOM // Anything but AT_SHOOT and AT_WEAP_ONLY. }; enum mon_attack_flavour @@ -85,8 +87,7 @@ enum mon_attack_flavour AF_NAPALM, AF_CHAOS, AF_STEAL, - AF_STEAL_FOOD, - AF_WEAP_ONLY // AF_PLAIN if wielding a weapon, nothing if not + AF_STEAL_FOOD }; // Non-spell "summoning" types to give to monsters::mark_summoned(), or diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc index 19872b3b9a..889500bc25 100644 --- a/crawl-ref/source/monster.cc +++ b/crawl-ref/source/monster.cc @@ -489,7 +489,7 @@ static int _mons_offhand_weapon_index(const monsters *m) item_def *monsters::weapon(int which_attack) { const mon_attack_def attk = mons_attack_spec(this, which_attack); - if (attk.type != AT_HIT) + if (attk.type != AT_HIT && attk.type != AT_WEAP_ONLY) return (NULL); // Even/odd attacks use main/offhand weapon. |