Spaces:
Sleeping
Sleeping
Deploy Myco from CI
Browse files- ui/renderers.py +39 -39
ui/renderers.py
CHANGED
|
@@ -321,47 +321,47 @@ def forest_scene(
|
|
| 321 |
reward_text = "Search a clearing to score spores."
|
| 322 |
state_cls = "state-waiting"
|
| 323 |
|
| 324 |
-
else:
|
| 325 |
-
mushroom_name = current.get("name", "Mystery mushroom")
|
| 326 |
-
rarity = current.get("rarity", "Common").lower()
|
| 327 |
-
|
| 328 |
-
# Mushroom sprite by rarity
|
| 329 |
-
if rarity == "legendary":
|
| 330 |
-
sprite = "ππ"
|
| 331 |
-
elif rarity == "rare":
|
| 332 |
-
sprite = "ππ"
|
| 333 |
-
elif current.get("poison") == "Yes":
|
| 334 |
-
sprite = "β οΈπ"
|
| 335 |
else:
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 364 |
|
|
|
|
|
|
|
|
|
|
| 365 |
|
| 366 |
# Unique key forces browser to re-run CSS animations on every render
|
| 367 |
import time
|
|
|
|
| 321 |
reward_text = "Search a clearing to score spores."
|
| 322 |
state_cls = "state-waiting"
|
| 323 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 324 |
else:
|
| 325 |
+
mushroom_name = current.get("name", "Mystery mushroom")
|
| 326 |
+
rarity = current.get("rarity", "Common").lower()
|
| 327 |
+
|
| 328 |
+
# Mushroom sprite by rarity
|
| 329 |
+
if rarity == "legendary":
|
| 330 |
+
sprite = "ππ"
|
| 331 |
+
elif rarity == "rare":
|
| 332 |
+
sprite = "ππ"
|
| 333 |
+
elif current.get("poison") == "Yes":
|
| 334 |
+
sprite = "β οΈπ"
|
| 335 |
+
else:
|
| 336 |
+
sprite = "πβπ«"
|
| 337 |
+
|
| 338 |
+
game_over = current.get("game_over") == "Yes"
|
| 339 |
+
studied = current.get("studied") == "Yes"
|
| 340 |
+
|
| 341 |
+
event_label = f"{current.get('event_emoji','β¨')} {current.get('event_title','Strange Omen')}"
|
| 342 |
+
encounter = current.get("encounter", "The forest waits for Myco's reaction.")
|
| 343 |
+
mystery_label = current.get("mystery_title", "The Wrong Memory")
|
| 344 |
+
score_total = current.get("score_total", "0")
|
| 345 |
+
health = current.get("health", "3")
|
| 346 |
+
reward_text = current.get("reward_text", "Decide whether to risk the pickup.")
|
| 347 |
+
state_cls = _scene_state_class(current)
|
| 348 |
+
|
| 349 |
+
status = f"π A {rarity} {mushroom_name} bursts through the moss!"
|
| 350 |
+
|
| 351 |
+
if game_over:
|
| 352 |
+
status = f"π GAME OVER: {mushroom_name} was poisonous!"
|
| 353 |
+
|
| 354 |
+
if studied:
|
| 355 |
+
omen = "π New field note unlocked. Myco scribbles furiously in the MycoDex."
|
| 356 |
+
else:
|
| 357 |
+
omen = "π Myco tilts its cap. Something about this mushroom feels important..."
|
| 358 |
+
|
| 359 |
+
if current.get("picked") == "Yes":
|
| 360 |
+
omen = "π Collected! Myco proudly stuffs the discovery into the MycoDex."
|
| 361 |
|
| 362 |
+
if game_over:
|
| 363 |
+
omen = "π΅ Myco collapses dramatically. Search another clearing to begin again."
|
| 364 |
+
|
| 365 |
|
| 366 |
# Unique key forces browser to re-run CSS animations on every render
|
| 367 |
import time
|