diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-12-28 14:09:26 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-12-28 14:09:26 +0000 |
commit | 90d0e8c3f9d3fdcd0aa0ef1a479ad178ca3ad7e2 (patch) | |
tree | 0b0c8adc8bd00bc67b00f9e76e5db073339792e0 /crawl-ref/source/transfor.cc | |
parent | 971e4ca792042d987cd898ae8144f849da188f2f (diff) | |
download | crawl-ref-90d0e8c3f9d3fdcd0aa0ef1a479ad178ca3ad7e2.tar.gz crawl-ref-90d0e8c3f9d3fdcd0aa0ef1a479ad178ca3ad7e2.zip |
Fix 2471146: equipment being melded due to mutations.
Fix 2426301: melding not working properly for Merfolk transformation.
Colour melded equipment darkgrey on the % screen.
Disallow Merfolk slipping out of their boots if doing so would kill the
player due to stat loss. (Falling into water when flying will still kill
them.) When this is the case, deep water is regarded as unsafe for
travel.
TODO: Ending a transformation should likewise be impossible if doing so
would cause stat loss due to unmelding of items.
Add a stat_colour option to highlight the stats when they're below a
given threshold. By default, lightred at 1, red at 2-3. You could argue
for setting the default to 7 but that would mean colouring almost all
stats for each beginning character. (FR 2022232)
Tidy up the stat colouring methods.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8004 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/transfor.cc')
-rw-r--r-- | crawl-ref/source/transfor.cc | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/crawl-ref/source/transfor.cc b/crawl-ref/source/transfor.cc index f891c90804..43fea5e51e 100644 --- a/crawl-ref/source/transfor.cc +++ b/crawl-ref/source/transfor.cc @@ -90,7 +90,7 @@ static void _init_equipment_removal(std::set<equipment_type> &rem_stuff, } } -bool remove_equipment(std::set<equipment_type> removed) +bool remove_equipment(std::set<equipment_type> removed, bool meld) { if (removed.find(EQ_WEAPON) != removed.end() && you.equip[EQ_WEAPON] != -1) @@ -109,8 +109,11 @@ bool remove_equipment(std::set<equipment_type> removed) if (e == EQ_WEAPON || you.equip[e] == -1) continue; - mprf("%s melds into your body.", - you.inv[you.equip[e]].name(DESC_CAP_YOUR).c_str()); + if (meld) + { + mprf("%s melds into your body.", + you.inv[you.equip[e]].name(DESC_CAP_YOUR).c_str()); + } if (e == EQ_LEFT_RING || e == EQ_RIGHT_RING || e == EQ_AMULET) { @@ -121,6 +124,14 @@ bool remove_equipment(std::set<equipment_type> removed) { unwear_armour( you.equip[e] ); } + + if (!meld) + { + mprf("%s falls away!", + you.inv[you.equip[e]].name(DESC_CAP_YOUR).c_str()); + + you.equip[e] = -1; + } } return (true); @@ -197,11 +208,18 @@ static bool _unmeld_equipment(std::set<equipment_type> melded) return (true); } -bool remove_one_equip(equipment_type eq) +bool unmeld_one_equip(equipment_type eq) +{ + std::set<equipment_type> e; + e.insert(eq); + return _unmeld_equipment(e); +} + +bool remove_one_equip(equipment_type eq, bool meld) { std::set<equipment_type> r; r.insert(eq); - return remove_equipment(r); + return remove_equipment(r, meld); } static bool _tran_may_meld_cursed(int transformation) |