summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan O'Rear <stefanor@cox.net>2009-12-27 23:41:17 -0800
committerStefan O'Rear <stefanor@cox.net>2009-12-27 23:41:17 -0800
commit02962c9ca97ca896e2d7be0e891f800efbbd9368 (patch)
tree30cd70ab2bb93edbc1f793b7b9dfdaf536395479
parentcc6a658772e7c26cf2dedceb7028601c9863268f (diff)
downloadcrawl-ref-02962c9ca97ca896e2d7be0e891f800efbbd9368.tar.gz
crawl-ref-02962c9ca97ca896e2d7be0e891f800efbbd9368.zip
Forms never lower weight cap
I'm just building the bikeshed - somebody else needs to paint this stupid thing.
-rw-r--r--crawl-ref/source/actor.cc4
-rw-r--r--crawl-ref/source/actor.h2
-rw-r--r--crawl-ref/source/monster.cc2
-rw-r--r--crawl-ref/source/monster.h2
-rw-r--r--crawl-ref/source/player.cc13
-rw-r--r--crawl-ref/source/player.h2
6 files changed, 16 insertions, 9 deletions
diff --git a/crawl-ref/source/actor.cc b/crawl-ref/source/actor.cc
index 3cdeeb9c50..62a8d87cf6 100644
--- a/crawl-ref/source/actor.cc
+++ b/crawl-ref/source/actor.cc
@@ -161,9 +161,9 @@ void actor::shield_block_succeeded(actor *foe)
}
}
-int actor::body_weight() const
+int actor::body_weight(bool base) const
{
- switch (body_size(PSIZE_BODY))
+ switch (body_size(PSIZE_BODY, base))
{
case SIZE_TINY:
return (150);
diff --git a/crawl-ref/source/actor.h b/crawl-ref/source/actor.h
index b29e826307..a6d4899bbb 100644
--- a/crawl-ref/source/actor.h
+++ b/crawl-ref/source/actor.h
@@ -63,7 +63,7 @@ public:
virtual size_type body_size(size_part_type psize = PSIZE_TORSO,
bool base = false) const = 0;
- virtual int body_weight() const;
+ virtual int body_weight(bool base = false) const;
virtual int total_weight() const = 0;
virtual int damage_brand(int which_attack = -1) = 0;
diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc
index 5285da7795..862aa075c4 100644
--- a/crawl-ref/source/monster.cc
+++ b/crawl-ref/source/monster.cc
@@ -316,7 +316,7 @@ size_type monsters::body_size(size_part_type /* psize */, bool /* base */) const
return (ret);
}
-int monsters::body_weight() const
+int monsters::body_weight(bool /*base*/) const
{
int mclass = type;
diff --git a/crawl-ref/source/monster.h b/crawl-ref/source/monster.h
index 400ad01769..524c48b4d4 100644
--- a/crawl-ref/source/monster.h
+++ b/crawl-ref/source/monster.h
@@ -221,7 +221,7 @@ public:
bool can_pass_through_feat(dungeon_feature_type grid) const;
bool is_habitable_feat(dungeon_feature_type actual_grid) const;
size_type body_size(size_part_type psize = PSIZE_TORSO, bool base = false) const;
- int body_weight() const;
+ int body_weight(bool base = false) const;
int total_weight() const;
int damage_brand(int which_attack = -1);
int damage_type(int which_attack = -1);
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 04c1498297..7ba87a20ff 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -2379,7 +2379,11 @@ int player_sust_abil(bool calc_unid)
int carrying_capacity(burden_state_type bs)
{
- int cap = (2 * you.body_weight()) + (you.strength * 300)
+ // Yuck. We need this for gameplay - it nerfs small forms too much
+ // otherwise - but there's no good way to rationalize here... --sorear
+ int used_weight = std::max(you.body_weight(), you.body_weight(true));
+
+ int cap = (2 * used_weight) + (you.strength * 300)
+ (you.airborne() ? 1000 : 0);
// We are nice to the lighter species in that strength adds absolutely
// instead of relatively to body weight. --dpeg
@@ -5593,9 +5597,12 @@ size_type player::body_size(size_part_type psize, bool base) const
}
}
-int player::body_weight() const
+int player::body_weight(bool base) const
{
- int weight = actor::body_weight();
+ int weight = actor::body_weight(base);
+
+ if (base)
+ return (weight);
switch (attribute[ATTR_TRANSFORMATION])
{
diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h
index a02e5f5c4c..ee34bd703e 100644
--- a/crawl-ref/source/player.h
+++ b/crawl-ref/source/player.h
@@ -383,7 +383,7 @@ public:
bool can_pass_through_feat(dungeon_feature_type grid) const;
bool is_habitable_feat(dungeon_feature_type actual_grid) const;
size_type body_size(size_part_type psize = PSIZE_TORSO, bool base = false) const;
- int body_weight() const;
+ int body_weight(bool base = false) const;
int total_weight() const;
int damage_brand(int which_attack = -1);
int damage_type(int which_attack = -1);