X-Git-Url: http://git.localhorst.tv/?p=blobs.git;a=blobdiff_plain;f=src%2Fcreature%2FCreature.hpp;h=d3cd86c462a7d8f22933ab2b8a0da41673a0ce25;hp=f36a2db1f1172770855a9eebdfc6554202689b6f;hb=6c1097479fd1ea41f0f76b91e67613822acf2e90;hpb=2ab70a92ae39cebc6166ef15545ebcbd31a31c38 diff --git a/src/creature/Creature.hpp b/src/creature/Creature.hpp index f36a2db..d3cd86c 100644 --- a/src/creature/Creature.hpp +++ b/src/creature/Creature.hpp @@ -58,7 +58,7 @@ public: const Genome::Properties &GetProperties() const noexcept { return properties; } const Genome::PropertySet &CurProps() const noexcept { return properties.props[cur_prop]; } - const Genome::PropertySet &NextProps() const noexcept { return properties.props[cur_prop + 1]; } + const Genome::PropertySet &NextProps() const noexcept { return properties.props[std::min(5, cur_prop + 1)]; } void BaseColor(const glm::dvec3 &c) noexcept { base_color = c; } const glm::dvec3 &BaseColor() const noexcept { return base_color; } @@ -68,13 +68,14 @@ public: void Mass(double m) noexcept { mass = m; size = std::cbrt(mass / density); } double Mass() const noexcept { return mass; } - void Grow(double amount) noexcept; + void Ingest(int res, double amount) noexcept; void Density(double d) noexcept { density = d; size = std::cbrt(mass / density); } double Density() const noexcept { return density; } double Size() const noexcept; double Age() const noexcept; + std::string AgeName() const; double AgeLerp(double from, double to) const noexcept; // change of giving birth per tick double Fertility() const noexcept;