]> git.localhorst.tv Git - blobs.git/commitdiff
fix that pesky suffocation problem
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Mon, 4 Dec 2017 13:53:39 +0000 (14:53 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Mon, 4 Dec 2017 13:53:39 +0000 (14:53 +0100)
the good new is, they no longer suffocate due to exhaustion
the bad new is, they no longer suffocate at all

src/creature/creature.cpp
src/creature/goal.cpp

index 667dc1740bdfa4fa37227b5ba74396a61dc9de2b..39b96b22cafda71e9cfdae849e5cb50234319ffa 100644 (file)
@@ -437,7 +437,6 @@ void Creature::TickStats(double dt) {
        for (auto &s : stats.stat) {
                s.Add(s.gain * dt);
        }
-       stats.Breath().Add(stats.Breath().gain * stats.Exhaustion().value * dt);
        // TODO: damage values depending on properties
        if (stats.Breath().Full()) {
                constexpr double dps = 1.0 / 4.0;
index 61ecb3778a5b874c9b61e4e6fd93b2d107bdf941..bcb1682be1bca9514d81a2cbb3fdf3f985fa84f1 100644 (file)
@@ -40,7 +40,7 @@ void BlobBackgroundTask::Tick(double dt) {
                // TODO: derive breathing ability
                int gas = Assets().data.resources["air"].id;
                // TODO: check if in compatible atmosphere
-               double amount = GetCreature().GetStats().Breath().gain * -(1.5 + 0.5 * GetCreature().ExhaustionFactor());
+               double amount = GetCreature().GetStats().Breath().gain * -(1.0 + GetCreature().ExhaustionFactor());
                GetCreature().GetStats().Breath().Add(amount * dt);
                // maintain ~1% gas composition
                double gas_amount = GetCreature().GetComposition().Get(gas);