Food & Drink #13

Closed
opened 2025-08-13 19:47:46 -07:00 by oakbrad · 1 comment
oakbrad commented 2025-08-13 19:47:46 -07:00 (Migrated from github.com)

I've currently defined a minimum viable Food typeclass and a eat/drink command

class Food(DefaultObject):
    """
    Base food class.
    """
    def at_object_creation(self):
        super().at_object_creation()
        self.db.solid = True # False if liquid
        self.db.calories = self.db.calories or 0
        self.db.hydration = self.db.hydration or 0 # water content
        self.db.taste = self.db.taste or "Tastes like nothing much."
        self.db.freshness = self.db.freshness or 0 # hours, 0 never expires
        self.db.decay_rate = 0.01 # TODO: decrement freshness on a regular interval?
        self.locks.add("read:all();get:all()")
        self.tags.add("food")
        self.cmdset.add_default(FoodCmdSet, persistent=True)

eat command should do the math necessary (add to character hydration/hunger), print the taste description, then delete the object. Simple

I've currently defined a minimum viable Food typeclass and a `eat`/`drink` command ``` class Food(DefaultObject): """ Base food class. """ def at_object_creation(self): super().at_object_creation() self.db.solid = True # False if liquid self.db.calories = self.db.calories or 0 self.db.hydration = self.db.hydration or 0 # water content self.db.taste = self.db.taste or "Tastes like nothing much." self.db.freshness = self.db.freshness or 0 # hours, 0 never expires self.db.decay_rate = 0.01 # TODO: decrement freshness on a regular interval? self.locks.add("read:all();get:all()") self.tags.add("food") self.cmdset.add_default(FoodCmdSet, persistent=True) ``` `eat` command should do the math necessary (add to character hydration/hunger), print the taste description, then delete the object. Simple
oakbrad commented 2025-09-11 19:09:32 -07:00 (Migrated from github.com)

I've got the very basics of this up. When I add characters, will need to come back and add the calories/hydration logic.

I've got the very basics of this up. When I add characters, will need to come back and add the calories/hydration logic.
Sign in to join this conversation.
No description provided.