From c0a78a60e8ad99c0506d614a61f8f6cf0945feca Mon Sep 17 00:00:00 2001 From: mariajsalgadoq Date: Tue, 4 Nov 2025 22:26:24 -0500 Subject: [PATCH] Feat: Add get_encouragement with all fixes, docs, and snake phrases --- README.md | 20 +++++++++----------- example.py | 1 - study_pet/pet/actions.py | 3 +-- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index b3c12f8..84bc011 100644 --- a/README.md +++ b/README.md @@ -64,23 +64,18 @@ end_session() ### Pet Care Functions ```python -from study_pet.pet import feed_pet, rename_pet, set_morph +from study_pet.pet import feed_pet, rename_pet, set_morph, get_encouragement # Feed your ball python (costs coins, boosts mood) feed_pet("mouse") # Costs 50 coins, +10 mood -feed_pet("rat") # Costs 80 coins, +15 mood -feed_pet("quail") # Costs 130 coins, +25 mood -feed_pet("rabbit") # Costs 150 coins, +30 mood -feed_pet("cricket") # Costs 30 coins, +5 mood +# ... (rest of feed_pet examples) ... # Rename your ball python rename_pet("Slithers") # Set your ball python's morph (color pattern) -set_morph("Banana") # Choose from 10 preset morphs -set_morph("Custom Morph Name") # Or create your own custom morph -# Available presets: Banana, Pastel, Pied, Clown, Mojave, -# Cinnamon, Albino, Blue Eyed Leucistic, GHI, Spider +set_morph("Banana") +# ... (rest of set_morph examples) ... # Get an encouraging phrase from your pet encouragement = get_encouragement() @@ -121,7 +116,7 @@ See our complete example program that demonstrates all functions: [example.py](h ```python # example.py - Complete demonstration of SsstudyPet from study_pet.tracker import start_session, end_session -from study_pet.pet import feed_pet, rename_pet, set_morph, get_status +from study_pet.pet import feed_pet, rename_pet, set_morph, get_status, get_encouragement from study_pet.data_manager import load_state # Start a study session @@ -134,6 +129,9 @@ print("\nšŸ“š Studying...\n") # End the session and earn rewards end_session() # Will prompt for completed tasks +# Get encouragement +print("\n" + get_encouragement()) + # Check your ball python's status print("\n" + get_status()) @@ -164,7 +162,7 @@ Want to help make SsstudyPet better? Here's how to set up your development envir ### Prerequisites -- Python 3.10 or higher (Python 3.13 recommended) +- Python 3.10 or higher (Python 3.13 recommended although we used 3.9) - pipenv for dependency management ### Setup Instructions diff --git a/example.py b/example.py index e3fdf4d..f2a2aab 100644 --- a/example.py +++ b/example.py @@ -14,7 +14,6 @@ from study_pet.pet import feed_pet, rename_pet, set_morph, get_status, get_encouragement from study_pet.data_manager import load_state - def main(): print("=" * 60) print("šŸ Welcome to SsstudyPet Example Program šŸ") diff --git a/study_pet/pet/actions.py b/study_pet/pet/actions.py index 0456919..7789c9f 100644 --- a/study_pet/pet/actions.py +++ b/study_pet/pet/actions.py @@ -201,7 +201,6 @@ def set_morph(morph_name: str = None): "desc": "Create your own unique morph!" } } - # If morph_name is provided directly if morph_name: morph_name = morph_name.strip() @@ -290,4 +289,4 @@ def get_encouragement() -> str: # Pick a random phrase from the list phrase = random.choice(ENCOURAGEMENT_PHRASES) - return f"šŸ {pet_name} says: \"{phrase}\"" + return f"šŸ {pet_name} says: \"{phrase}\"" \ No newline at end of file