diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-28 18:41:59 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-28 18:41:59 +0000 |
commit | b5c11dcb1ca01733d1b930d0aeb69233b076e4c8 (patch) | |
tree | 17baf260f6ed3a8e17e5afe335ab24546a38a225 | |
parent | a9e0fe45374071b19bb4888f8163e6ae0079ac80 (diff) | |
download | crawl-ref-b5c11dcb1ca01733d1b930d0aeb69233b076e4c8.tar.gz crawl-ref-b5c11dcb1ca01733d1b930d0aeb69233b076e4c8.zip |
Fixed transform hitpoint calculation bugs (syllogism).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.3@2643 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/source/skills2.cc | 31 | ||||
-rw-r--r-- | crawl-ref/source/transfor.cc | 4 |
2 files changed, 19 insertions, 16 deletions
diff --git a/crawl-ref/source/skills2.cc b/crawl-ref/source/skills2.cc index d0e17e2840..cc9e8f8e8d 100644 --- a/crawl-ref/source/skills2.cc +++ b/crawl-ref/source/skills2.cc @@ -2185,21 +2185,24 @@ int calc_hp(bool real_hp) hitp /= 10; } - // some transformations give you extra hp - switch (you.attribute[ATTR_TRANSFORMATION] && !real_hp) + if (!real_hp) { - case TRAN_STATUE: - hitp *= 15; - hitp /= 10; - break; - case TRAN_ICE_BEAST: - hitp *= 12; - hitp /= 10; - break; - case TRAN_DRAGON: - hitp *= 16; - hitp /= 10; - break; + // some transformations give you extra hp + switch (you.attribute[ATTR_TRANSFORMATION]) + { + case TRAN_STATUE: + hitp *= 15; + hitp /= 10; + break; + case TRAN_ICE_BEAST: + hitp *= 12; + hitp /= 10; + break; + case TRAN_DRAGON: + hitp *= 16; + hitp /= 10; + break; + } } // frail and robust mutations diff --git a/crawl-ref/source/transfor.cc b/crawl-ref/source/transfor.cc index bed7d87ef8..b49013bacf 100644 --- a/crawl-ref/source/transfor.cc +++ b/crawl-ref/source/transfor.cc @@ -566,8 +566,7 @@ void untransform(void) if (you.species == SP_NAGA || you.species == SP_CENTAUR) remove_one_equip(EQ_BOOTS); - calc_hp(); - if (hp_downscale != 10) + if (hp_downscale != 10 && you.hp != you.hp_max) { you.hp = you.hp * 10 / hp_downscale; if (you.hp < 1) @@ -575,6 +574,7 @@ void untransform(void) else if (you.hp > you.hp_max) you.hp = you.hp_max; } + calc_hp(); } // end untransform() // XXX: This whole system is a mess as it still relies on special |