HUMAN: LAST COMMIT BEFORE AI REBALANCE (for rollback)
This commit is contained in:
@@ -222,18 +222,22 @@ def pickRandomCreature(app):
|
||||
# real chance (per the spec's "skewed toward easier but still fun" goal).
|
||||
# Returns the chosen creature record (one entry from app.creatures).
|
||||
max_difficulty = [bait[1] for bait in AVAILABLE_BAITS if bait[0] == app.save["current_bait"]][0]
|
||||
print("max difficulty:", max_difficulty)
|
||||
|
||||
#here we take the root of the difficulty to represent the weight of that fish, this makes higher difficulty fish easier to catch once unlocked
|
||||
k = 0.5
|
||||
#invert the difficulty and add one so it avoids zero
|
||||
possibilities = [(creature["name"], (max_difficulty - creature["difficulty"] + 1) ** k) for creature in app.creatures if creature["difficulty"] <= max_difficulty]
|
||||
print("possibilities:",possibilities)
|
||||
total = sum([c[1] for c in possibilities])
|
||||
print("total:",total)
|
||||
|
||||
#now pick randomly
|
||||
roll = random.random() * (total) # a value between 0 and total
|
||||
|
||||
caughtName = "Aubrey Fish"
|
||||
for possibleCatch in possibilities:
|
||||
print("possible catch:",possibleCatch)
|
||||
roll -= possibleCatch[1]
|
||||
if (roll < 0):
|
||||
caughtName = possibleCatch[0]
|
||||
@@ -375,6 +379,8 @@ def onKeyPress(app, key):
|
||||
if key == "r":
|
||||
#reset save
|
||||
app.save = loadSave("thisisntarealsavefile.stupid")
|
||||
if key == "f":
|
||||
app.fishingTimer = 30
|
||||
|
||||
#added by AI, but simply allows me to trigger a breakpoint manually to check state of app and variables
|
||||
#after some debate, this was the best option over something more complex
|
||||
@@ -602,7 +608,7 @@ def drawShopEntities(app):
|
||||
for name, sceneFilter, left, right, top, bottom in [interactable for interactable in app.INTERACTABLES if interactable[0].startswith("bait-buy:")]:
|
||||
displayName = name.split(":")[1]
|
||||
|
||||
drawRect(left, top, right - left, bottom - top, fill=('gray' if displayName in app.save["owned_baits"] else 'rosyBrown'), border='bisque',borderWidth=4)
|
||||
drawRect(left, top, right - left, bottom - top, fill=('gray' if displayName in app.save["owned_baits"] else 'rosyBrown'), border=('green' if displayName == app.save["current_bait"] else'bisque'),borderWidth=4)
|
||||
|
||||
drawLabel(displayName, left + (right-left) / 2, bottom - 20, align="center")
|
||||
|
||||
@@ -712,6 +718,8 @@ def drawDebug(app):
|
||||
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"]}
|
||||
Angle: {rounded(app.skillCheckAngle)}
|
||||
NextBar: {app.skillCheckBars[0] if len(app.skillCheckBars) > 0 else "N/A"}
|
||||
"""
|
||||
debugLines = debugStr.splitlines()
|
||||
size = 16
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"cash": 947510.0, "owned_baits": ["Worms", "Prawns", "Tuna", "Bass"], "owned_upgrades": ["Massive Bobber", "Huge Bobber", "Large Bobber", "Medium Bobber", "Glowing Rod"], "current_bait": "Tuna", "catch_log": []}
|
||||
{"cash": 906146.0, "owned_baits": ["Worms", "Prawns", "Tuna", "Bass"], "owned_upgrades": ["Massive Bobber", "Huge Bobber", "Large Bobber", "Medium Bobber", "Galaxy Rod", "Glowing Rod", "Spectral Rod", "Shiny Rod"], "current_bait": "Tuna"}
|
||||
Reference in New Issue
Block a user