summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/transfor.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-11 20:36:46 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-11 20:36:46 +0000
commitf5ce15870a0d4ae042a704065df4d0cdbbda0506 (patch)
tree3b8b31a38729b64be106930df581aef7197c6202 /crawl-ref/source/transfor.cc
parent50a255f8eaad1124e731f6fb1de417baaa133a80 (diff)
downloadcrawl-ref-f5ce15870a0d4ae042a704065df4d0cdbbda0506.tar.gz
crawl-ref-f5ce15870a0d4ae042a704065df4d0cdbbda0506.zip
Fix [2586695]: you can no longer throw items (including via Portal
Projectile) if you can't wield weapons. Don't allow base-shape breath attacks when shapechanged, except for Nagas in spider form. Fix [2589913]: melded shields counted for heavy armour penalties. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9026 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/transfor.cc')
-rw-r--r--crawl-ref/source/transfor.cc44
1 files changed, 19 insertions, 25 deletions
diff --git a/crawl-ref/source/transfor.cc b/crawl-ref/source/transfor.cc
index dda95d8e45..331d11c0b9 100644
--- a/crawl-ref/source/transfor.cc
+++ b/crawl-ref/source/transfor.cc
@@ -294,7 +294,8 @@ bool check_transformation_stat_loss(const std::set<equipment_type> &remove,
if (you.duration[DUR_MIGHT])
prop_str += 5;
- if (prop_str >= you.strength || prop_int >= you.intel
+ if (prop_str >= you.strength
+ || prop_int >= you.intel
|| prop_dex >= you.dex)
{
if (!quiet)
@@ -313,41 +314,33 @@ bool check_transformation_stat_loss(const std::set<equipment_type> &remove,
if (you.equip[e] == -1)
continue;
+ const item_def& item = you.inv[you.equip[e]];
+
// Wielding a stat-boosting non-weapon/non-staff won't hinder
// transformations.
- if (e == EQ_WEAPON)
+ if (e == EQ_WEAPON
+ && item.base_type != OBJ_WEAPONS && item.base_type != OBJ_STAVES)
{
- const item_def item = you.inv[ you.equip[e] ];
- if (item.base_type != OBJ_WEAPONS && item.base_type != OBJ_STAVES)
- continue;
+ continue;
}
- item_def item = you.inv[you.equip[e]];
+ // Currently, the only nonartefacts which have stat-changing
+ // effects are rings.
if (item.base_type == OBJ_JEWELLERY)
{
- if (!item_ident( item, ISFLAG_KNOW_PLUSES ))
+ if (!item_ident(item, ISFLAG_KNOW_PLUSES))
continue;
switch (item.sub_type)
{
- case RING_STRENGTH:
- if (item.plus != 0)
- prop_str += item.plus;
- break;
- case RING_DEXTERITY:
- if (item.plus != 0)
- prop_dex += item.plus;
- break;
- case RING_INTELLIGENCE:
- if (item.plus != 0)
- prop_int += item.plus;
- break;
- default:
- break;
+ case RING_STRENGTH: prop_str += item.plus; break;
+ case RING_DEXTERITY: prop_dex += item.plus; break;
+ case RING_INTELLIGENCE: prop_int += item.plus; break;
+ default: break;
}
}
- if (is_random_artefact( item ))
+ if (is_random_artefact(item))
{
prop_str += randart_known_wpn_property(item, RAP_STRENGTH);
prop_int += randart_known_wpn_property(item, RAP_INTELLIGENCE);
@@ -358,7 +351,8 @@ bool check_transformation_stat_loss(const std::set<equipment_type> &remove,
// out while worn, if at any point in the order of checking this list
// (which is the same order as when removing items) one of your stats
// would reach 0, return true.
- if (prop_str >= you.strength || prop_int >= you.intel
+ if (prop_str >= you.strength
+ || prop_int >= you.intel
|| prop_dex >= you.dex)
{
if (!quiet)
@@ -838,8 +832,8 @@ void untransform(void)
default_rem + ARRAYSZ(default_rem));
_init_equipment_removal(melded, old_form);
- you.attribute[ ATTR_TRANSFORMATION ] = TRAN_NONE;
- you.duration[ DUR_TRANSFORMATION ] = 0;
+ you.attribute[ATTR_TRANSFORMATION] = TRAN_NONE;
+ you.duration[DUR_TRANSFORMATION] = 0;
int hp_downscale = 10;