HUMAN: its bedtime its mostly done, ill run prompt 5 tomorrow to fix up some gameplay and luck
This commit is contained in:
@@ -61,8 +61,7 @@ def loadSave(path="save.json"):
|
||||
"cash": 0,
|
||||
"owned_baits": ["Worms"],
|
||||
"owned_upgrades": [],
|
||||
"current_bait": "Worms",
|
||||
"catch_log": []
|
||||
"current_bait": "Worms"
|
||||
}
|
||||
try:
|
||||
with open(path, "r") as f:
|
||||
@@ -371,6 +370,7 @@ def onKeyPress(app, key):
|
||||
if key == "m":
|
||||
app.save["cash"] = 1000000
|
||||
if key == "escape":
|
||||
writeSave(app.save)
|
||||
os._exit(0) #suggested by AI, instantly exits without hanging like sys.exit(0)
|
||||
if key == "r":
|
||||
#reset save
|
||||
@@ -463,7 +463,10 @@ def buyBaitLicense(app, baitId):
|
||||
name, max_difficulty, price, img_file = bait
|
||||
|
||||
print("attempting buy",bait)
|
||||
if name in app.save["owned_baits"]: return False
|
||||
if name in app.save["owned_baits"]:
|
||||
setActiveBait(app, name)
|
||||
print("activated bait", name)
|
||||
return False
|
||||
if price > app.save["cash"]: return False
|
||||
print("success!")
|
||||
|
||||
@@ -478,7 +481,7 @@ def setActiveBait(app, baitId):
|
||||
# license for. Free action. Updates app state so the next cast's creature
|
||||
# pool reflects the new bait. Reject the switch if the bait isn't owned.
|
||||
bait = [b for b in AVAILABLE_BAITS if b[0] == baitId][0] #find the specified upgrade
|
||||
name, max_difficulty, price = bait
|
||||
name, max_difficulty, price, img_url = bait
|
||||
|
||||
if name in app.save["owned_baits"]:
|
||||
app.save["current_bait"] = name
|
||||
@@ -509,6 +512,7 @@ def redrawAll(app):
|
||||
drawSkillCheck(app)
|
||||
if app.scene == "result":
|
||||
drawCatchDisplay(app)
|
||||
drawHud(app)
|
||||
|
||||
if app.debug:
|
||||
drawDebug(app)
|
||||
@@ -606,7 +610,7 @@ def drawShopEntities(app):
|
||||
|
||||
|
||||
#Image creds: ALL ICONS FROM https://www.flaticon.com
|
||||
drawImage(BASE_IMAGE_URL + "bait-icons/" + img_file, left + (right-left) / 2, top + (bottom-top) / 2 - 10, width=80,height=80,align="center")
|
||||
drawImage(BASE_IMAGE_URL + "bait-icons/" + img_file, left + (right-left) / 2, top + (bottom-top) / 2 - 10, width=50,height=50,align="center")
|
||||
|
||||
def drawSkillCheck(app):
|
||||
# Draw the active skill-check overlay: the circle, the target bars placed
|
||||
@@ -696,7 +700,10 @@ def drawHud(app):
|
||||
# every scene so the player always sees their core stats.
|
||||
|
||||
#I dont really need this unless I decide to add alert/tutorial messages
|
||||
pass
|
||||
#but i can draw the current bait in the corner
|
||||
img_file = [b[3] for b in AVAILABLE_BAITS if b[0] == app.save["current_bait"]][0]
|
||||
drawRect(app.width - 75, app.height - 75, 70, 70, fill='saddleBrown', border="black")
|
||||
drawImage(BASE_IMAGE_URL + "bait-icons/" + img_file, app.width - 10, app.height - 10, width=60,height=60,align="bottom-right")
|
||||
|
||||
def drawDebug(app):
|
||||
debugStr = f"""\
|
||||
@@ -704,6 +711,7 @@ def drawDebug(app):
|
||||
Scene: {app.scene}
|
||||
fishingTimer: {rounded(app.fishingTimer)}
|
||||
hookedFish: {app.hookedFish["name"] if app.hookedFish else "N/A"} @ {app.hookedFish["difficulty"] if app.hookedFish else "N/A"} difficulty
|
||||
activeBait: {app.save["current_bait"]}
|
||||
"""
|
||||
debugLines = debugStr.splitlines()
|
||||
size = 16
|
||||
|
||||
Reference in New Issue
Block a user