From 2e5c80c5f2690bb4ef929c6c1a6d0c309afe55e5 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Thu, 30 Aug 2007 14:40:48 +0000 Subject: Several bugfixes. In no particular order: + Beogh shouldn't care about you attacking non-orc friends. + Mummies don't get "Food" listed as ability costs. + corrected order of invis flickering + modified (and tidied) you_can_wear checks and output + added ']' command to list currently worn equipment (inv) + wielded cursed items can no longer be fired + Wanderers no longer get inappropriate armour + Fixed "bad item" message for confirm-inscribed items + copied "Discharge" to "Static Discharge" in spells.txt (Maybe we should remove the first, but I was unsure about that, so I left it for now.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2035 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/player.cc | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'crawl-ref/source/player.cc') diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 0aa2a822bf..1222f79510 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -433,10 +433,11 @@ bool player_genus(unsigned char which_genus, unsigned char species) // use (usually wear) a given piece of equipment // Note that EQ_BODY_ARMOUR and EQ_HELMET only check // the ill-fitting variant (i.e. not caps and robes) -// Centaurs and Naga are ignored for now, seeing how -// Boots are changed to Barding in the % screen. +// If special_armour is set to true, special cases +// such as bardings, light armour and caps are +// considered. Otherwise these simply return false. // ------------------------------------------------- -bool you_can_wear(int eq) +bool you_can_wear(int eq, bool special_armour) { // these can be used by all if (eq == EQ_LEFT_RING || eq == EQ_RIGHT_RING || eq == EQ_AMULET @@ -452,8 +453,12 @@ bool you_can_wear(int eq) if (you.is_undead) return true; -// if (eq == EQ_BOOTS && (you.species == SP_NAGA || you.species == SP_CENTAUR)) -// return false; + // anyone can wear caps/hats and robes + if (special_armour && (eq == EQ_HELMET || eq == EQ_BODY_ARMOUR)) + return true; + + if (eq == EQ_BOOTS && (you.species == SP_NAGA || you.species == SP_CENTAUR)) + return (special_armour); // of the remaining items, these races can't wear anything if (you.species == SP_TROLL || you.species == SP_SPRIGGAN @@ -467,6 +472,9 @@ bool you_can_wear(int eq) return false; } + if (you.species == SP_MINOTAUR && eq == EQ_HELMET) + return false; + // else no problems return true; } @@ -5246,8 +5254,12 @@ void player::attacking(actor *other) if (other && other->atype() == ACT_MONSTER) { const monsters *mons = dynamic_cast(other); - if (mons_friendly(mons)) + if (mons_friendly(mons) + && (you.religion != GOD_BEOGH // Beogh only cares about orcs + || ::mons_species(mons->type) == MONS_ORC)) + { did_god_conduct(DID_ATTACK_FRIEND, 5); + } else pet_target = monster_index(mons); } -- cgit v1.2.3-54-g00ecf