Skip to content

Add clinic healing feature #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 21, 2025
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ side quest. Accept the job, bring the papers to the Library, and earn $50.
You can also deposit or withdraw cash at the bank. Any money left in the bank
earns 1% interest each day.

The **Clinic** now offers medical treatment. Press **H** inside to fully heal
and restore energy for $20.

Jobs now offer promotions based on your stats and the experience you build.
The office rewards
intelligence and charisma while dealing drugs in the park relies on strength
Expand Down Expand Up @@ -200,6 +203,7 @@ starts. Press **F1** at any time for a quick reminder of the controls.
- **P** at the library: Solve puzzle
- **P** at the farm: Plant seed
- **H** at the farm: Harvest crops
- **H** in the Clinic: Heal for $20
- **Shift**: Ride skateboard (if owned)
- **T**: Skip 3 in-game hours
- **L**: View quest log
Expand Down
17 changes: 15 additions & 2 deletions game.py
Original file line number Diff line number Diff line change
Expand Up @@ -1384,6 +1384,19 @@ def main():
elif in_building == "clinic" and event.key == pygame.K_e:
shop_message = work_job(player, "clinic")
shop_message_timer = 60
elif in_building == "clinic" and event.key == pygame.K_h:
if player.money >= 20 and (
player.health < 100 or player.energy < 100
):
player.money -= 20
player.health = 100
player.energy = 100
shop_message = "Treatment complete"
elif player.money < 20:
shop_message = "Need $20"
else:
shop_message = "Already healthy"
shop_message_timer = 60

dx = dy = 0
keys = pygame.key.get_pressed()
Expand Down Expand Up @@ -1687,7 +1700,7 @@ def main():
msg = f"[E] to Deal drugs (+${pay}, -20 energy)"
elif near_building.btype == "clinic":
pay = job_pay(player, "clinic")
msg = f"[E] to Work here (+${pay}, -20 energy)"
msg = f"[E] to Work here (+${pay}, -20 energy) [H] heal for $20"
elif near_building.btype == "home":
msg = "[E] to enter home"
elif near_building.btype == "shop":
Expand Down Expand Up @@ -1743,7 +1756,7 @@ def main():
txt = f"[E] Deal (+${pay}) [Q] Leave"
elif in_building == "clinic":
pay = job_pay(player, "clinic")
txt = f"[E] Work (+${pay}) [Q] Leave"
txt = f"[E] Work (+${pay}) H:Heal $20 [Q] Leave"
elif in_building == "home":
txt = "[E] Sleep [1-9] Buy upgrade [Q] Leave"
elif in_building == "shop":
Expand Down