X-Git-Url: http://git.localhorst.tv/?p=blobs.git;a=blobdiff_plain;f=src%2Fcreature%2Fcreature.cpp;h=ccd174db221548dfb9a7def3825d54d4b5d13792;hp=d0000107b683e5b454d1864ba65c9c4c6dfe3873;hb=fbbee4cf7bd6f41139c2298c41d29b87401e6cf6;hpb=475f28f06c9e14912bab8119264e247ef466513d diff --git a/src/creature/creature.cpp b/src/creature/creature.cpp index d000010..ccd174d 100644 --- a/src/creature/creature.cpp +++ b/src/creature/creature.cpp @@ -133,7 +133,9 @@ void Creature::Hurt(double amount) noexcept { stats.Damage().Add(amount); if (stats.Damage().Full()) { std::cout << "[" << int(sim.Time()) << "s] " << name << " "; - if (stats.Breath().Full()) { + if (stats.Exhaustion().Full()) { + std::cout << "died of exhaustion"; + } else if (stats.Breath().Full()) { std::cout << "suffocated"; } else if (stats.Thirst().Full()) { std::cout << "died of thirst"; @@ -142,7 +144,34 @@ void Creature::Hurt(double amount) noexcept { } else { std::cout << "succumed to wounds"; } - std::cout << std::endl; + std::cout << " at an age of "; + { + int age = int(Age()); + if (age >= 3600) { + std::cout << (age / 3600) << "h "; + age %= 3600; + } + if (age >= 60) { + std::cout << (age / 60) << "m "; + age %= 60; + } + std::cout << age << 's'; + } + std::cout << " (" << int(Age() / properties.Lifetime() * 100) + << "% of life expectancy of "; + { + int lt = int(properties.Lifetime()); + if (lt >= 3600) { + std::cout << (lt / 3600) << "h "; + lt %= 3600; + } + if (lt >= 60) { + std::cout << (lt / 60) << "m "; + lt %= 60; + } + std::cout << lt << 's'; + } + std::cout << ")" << std::endl; Die(); } } @@ -566,7 +595,7 @@ Memory::~Memory() { void Memory::Tick(double dt) { Situation &s = c.GetSituation(); - if (s.OnSurface()) { + if (s.OnTile()) { TrackStay({ &s.GetPlanet(), s.Surface(), s.SurfacePosition() }, dt); } } @@ -703,6 +732,10 @@ void Steering::DontSeparate() noexcept { separating = false; } +void Steering::ResumeSeparate() noexcept { + separating = false; +} + void Steering::Halt() noexcept { halting = true; seeking = false;