feat: eat to heal

This commit is contained in:
str1k3r committed 2026-09-27 10:26:56 -04:00
1 parent 7d592c43ca
commit 9bcb6f8a3d
7 files changed
+36 -21

No files matched your search

+1 -14
View File
@@ -98,20 +98,7 @@ void CakeTile::attack(Level *level, int x, int y, int z, shared_ptr<Player> play
void CakeTile::eat(Level *level, int x, int y, int z, shared_ptr<Player> player)
{
if (player->canEat(false))
{
player->getFoodData()->eat(2, FoodConstants::FOOD_SATURATION_POOR);
int d = level->getData(x, y, z) + 1;
if (d >= 6)
{
level->setTile(x, y, z, 0);
} else
{
level->setData(x, y, z, d);
level->setTileDirty(x, y, z);
}
}
player->heal(1.5);
}
bool CakeTile::mayPlace(Level *level, int x, int y, int z)