diff --git a/README.md b/README.md index abe8273..2031f02 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 c95116c..c12ba3d 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() @@ -260,3 +259,34 @@ def set_morph(morph_name: str = None): print(f"\n✨ Your ball python's morph is now: {selected_morph}!") print(f" {morphs[choice]['desc']}") print("šŸ Your python looks beautiful!\n") + +ENCOURAGEMENT_PHRASES = [ + "You're doing sssso great! Keep up the good work!", + "Every sssstudy ssssession makes you sssmarter!", + "Don't give up! Jussst a little more effort!", + "I believe in you! You've got thisss!", + "Sssslithering sssuccess is just around the corner!", + "Sssstay focused! You're on a roll!", + "Look at you, being sssso productive!", + "Your dedication is insssspiring!", + "Jussst think of all the coinsss you'll earn!", + "Keep going! Your future ssself will thank you.", +] + +def get_encouragement() -> str: + """ + Returns a random encouraging phrase from the pet. + + The phrase is personalized with the pet's name if it has one. + + Returns: + A string containing a formatted encouragement message. + """ + state = load_state() + # Get the pet's name, or use the default + pet_name = state.get("name", "Guido") + + # Pick a random phrase from the list + phrase = random.choice(ENCOURAGEMENT_PHRASES) + + return f"šŸ {pet_name} says: \"{phrase}\""