Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand All @@ -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())

Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 🐍")
Expand Down
32 changes: 31 additions & 1 deletion study_pet/pet/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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}\""