add quality of life and some shop visuals
This commit is contained in:
@@ -95,8 +95,8 @@ AVAILABLE_UPGRADES = [ # (name, bonus_type, bonus_modifier, price)
|
|||||||
#timing mods - lengthens bars in skill check (multiplicative)
|
#timing mods - lengthens bars in skill check (multiplicative)
|
||||||
("Medium Bobber", "timing", 1.1, 100),
|
("Medium Bobber", "timing", 1.1, 100),
|
||||||
("Large Bobber", "timing", 1.2, 300),
|
("Large Bobber", "timing", 1.2, 300),
|
||||||
("Massive Bobber", "timing", 1.5, 1600),
|
("Huge Bobber", "timing", 1.5, 1600),
|
||||||
("Enourmous Bobber", "timing", 2, 25000),
|
("Massive Bobber", "timing", 2, 25000),
|
||||||
#count mods - lowers number of bars in skill check (subtractive (capped at 1))
|
#count mods - lowers number of bars in skill check (subtractive (capped at 1))
|
||||||
("Shiny Rod", "count", 1, 450),
|
("Shiny Rod", "count", 1, 450),
|
||||||
("Spectral Rod", "count", 1, 1200),
|
("Spectral Rod", "count", 1, 1200),
|
||||||
@@ -158,7 +158,7 @@ def onAppStart(app):
|
|||||||
|
|
||||||
#add all of our shop purchase upgrades
|
#add all of our shop purchase upgrades
|
||||||
startX = 75
|
startX = 75
|
||||||
startY = 100
|
startY = 75
|
||||||
endX = 525
|
endX = 525
|
||||||
endY = 250
|
endY = 250
|
||||||
colInd = 0
|
colInd = 0
|
||||||
@@ -233,7 +233,8 @@ def startSkillCheck(app, creature):
|
|||||||
|
|
||||||
fishingPower = 1 + sum([upgrade[2] for upgrade in AVAILABLE_UPGRADES if (upgrade[0] in app.save["owned_upgrades"] and upgrade[1] == "power")])
|
fishingPower = 1 + sum([upgrade[2] for upgrade in AVAILABLE_UPGRADES if (upgrade[0] in app.save["owned_upgrades"] and upgrade[1] == "power")])
|
||||||
|
|
||||||
app.skillCheckSpeed = difficulty / fishingPower
|
app.skillCheckSpeed = max(difficulty / fishingPower, 5) #this got INCREDIBLY slow with good upgrades
|
||||||
|
|
||||||
numBars = difficulty // 10 - sum([upgrade[2] for upgrade in AVAILABLE_UPGRADES if (upgrade[0] in app.save["owned_upgrades"] and upgrade[1] == "count")])
|
numBars = difficulty // 10 - sum([upgrade[2] for upgrade in AVAILABLE_UPGRADES if (upgrade[0] in app.save["owned_upgrades"] and upgrade[1] == "count")])
|
||||||
numBars = max(numBars, 1)
|
numBars = max(numBars, 1)
|
||||||
|
|
||||||
@@ -314,6 +315,7 @@ def onMousePress(app, mouseX, mouseY):
|
|||||||
app.scene = "idle"
|
app.scene = "idle"
|
||||||
if name.startswith("upgrade-buy:"):
|
if name.startswith("upgrade-buy:"):
|
||||||
print("buying upgrade", name)
|
print("buying upgrade", name)
|
||||||
|
buyUpgrade(app, name.split(":")[1])
|
||||||
|
|
||||||
|
|
||||||
if not interacted and app.scene == "idle":
|
if not interacted and app.scene == "idle":
|
||||||
@@ -368,6 +370,8 @@ def checkSkillHit(app):
|
|||||||
app.hookedFish = None
|
app.hookedFish = None
|
||||||
app.scene = "result"
|
app.scene = "result"
|
||||||
print("failed",targetPos,targetLen,app.skillCheckAngle)
|
print("failed",targetPos,targetLen,app.skillCheckAngle)
|
||||||
|
if len(app.skillCheckBars) < 1: #QOL: dont make them wait on an empty loop
|
||||||
|
finishSkillCheck(app)
|
||||||
|
|
||||||
|
|
||||||
def finishSkillCheck(app):
|
def finishSkillCheck(app):
|
||||||
@@ -412,6 +416,8 @@ def buyUpgrade(app, upgradeId):
|
|||||||
app.save["owned_upgrades"].append(name)
|
app.save["owned_upgrades"].append(name)
|
||||||
app.save["cash"] -= price
|
app.save["cash"] -= price
|
||||||
|
|
||||||
|
writeSave(app.save)
|
||||||
|
|
||||||
|
|
||||||
def buyBaitLicense(app, baitId):
|
def buyBaitLicense(app, baitId):
|
||||||
# Purchase a one-time license for a bait tier. Once owned, the player can
|
# Purchase a one-time license for a bait tier. Once owned, the player can
|
||||||
@@ -427,6 +433,8 @@ def buyBaitLicense(app, baitId):
|
|||||||
app.save["owned_baits"].append(name)
|
app.save["owned_baits"].append(name)
|
||||||
app.save["cash"] -= price
|
app.save["cash"] -= price
|
||||||
|
|
||||||
|
writeSave(app.save)
|
||||||
|
|
||||||
|
|
||||||
def setActiveBait(app, baitId):
|
def setActiveBait(app, baitId):
|
||||||
# Switch the currently-equipped bait to any bait the player already owns a
|
# Switch the currently-equipped bait to any bait the player already owns a
|
||||||
@@ -470,8 +478,9 @@ def redrawAll(app):
|
|||||||
BASE_IMAGE_URL = "https://gitea.lockeshor.com/lockeshor/15112-fishing-miniproject/raw/branch/main/sprites/"
|
BASE_IMAGE_URL = "https://gitea.lockeshor.com/lockeshor/15112-fishing-miniproject/raw/branch/main/sprites/"
|
||||||
|
|
||||||
#REMINDERS:
|
#REMINDERS:
|
||||||
# drawRect(top, left, width, height, fill="color")
|
# drawRect(left, top, width, height, fill="color")
|
||||||
# drawImage(url, )
|
# drawImage(url, )
|
||||||
|
# drawLabel(text, centerX, centerY)
|
||||||
def drawBackground(app):
|
def drawBackground(app):
|
||||||
# Draw the static scene layout from the spec: grass behind, the dock, and
|
# Draw the static scene layout from the spec: grass behind, the dock, and
|
||||||
# the lake occupying the bottom ~1/3 of the screen (blue water, optional
|
# the lake occupying the bottom ~1/3 of the screen (blue water, optional
|
||||||
@@ -530,9 +539,21 @@ def drawShopEntities(app):
|
|||||||
|
|
||||||
#draw upgrade purchases
|
#draw upgrade purchases
|
||||||
for name, sceneFilter, left, right, top, bottom in [interactable for interactable in app.INTERACTABLES if interactable[0].startswith("upgrade-buy:")]:
|
for name, sceneFilter, left, right, top, bottom in [interactable for interactable in app.INTERACTABLES if interactable[0].startswith("upgrade-buy:")]:
|
||||||
print("drawing",name,left,right,top,bottom)
|
#print("drawing",name,left,right,top,bottom)
|
||||||
drawRect(top, left, right - left, bottom - top, fill=None, border='black')
|
displayName = name.split(":")[1]
|
||||||
drawLabel(name, top, left, align="top-left")
|
#bg
|
||||||
|
drawRect(left, top, right - left, bottom - top, fill=('gray' if displayName in app.save["owned_upgrades"] else 'rosyBrown'), border='bisque',borderWidth=4)
|
||||||
|
|
||||||
|
centerY = top+(bottom-top)//2
|
||||||
|
#name
|
||||||
|
|
||||||
|
drawLabel(displayName, left+8, centerY, align="left",size=12)
|
||||||
|
|
||||||
|
#price
|
||||||
|
price = [u for u in AVAILABLE_UPGRADES if u[0] == displayName][0][3]
|
||||||
|
#pricebg
|
||||||
|
drawRect(right-8-40, top + 10, 40, bottom-top-20, fill="gold")
|
||||||
|
drawLabel("$" + str(price), right - 10, centerY, align="right", size = 10)
|
||||||
|
|
||||||
def drawSkillCheck(app):
|
def drawSkillCheck(app):
|
||||||
# Draw the active skill-check overlay: the circle, the target bars placed
|
# Draw the active skill-check overlay: the circle, the target bars placed
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"cash": 86.0, "owned_baits": ["Worms"], "owned_upgrades": [], "current_bait": "Worms", "catch_log": []}
|
{"cash": 904418.0, "owned_baits": ["Worms"], "owned_upgrades": ["Glowing Rod", "Smart Reel", "Clever Reel", "Intelligent Reel", "Genius Reel", "Massive Bobber", "Huge Bobber", "Large Bobber", "Medium Bobber", "Shiny Rod", "Spectral Rod", "Galaxy Rod"], "current_bait": "Worms", "catch_log": []}
|
||||||
@@ -65,3 +65,11 @@ End Time: 11:15pm
|
|||||||
Duration: 30 minutes
|
Duration: 30 minutes
|
||||||
Description: need to take a brief break, just making sure time is accurate
|
Description: need to take a brief break, just making sure time is accurate
|
||||||
###############################################
|
###############################################
|
||||||
|
|
||||||
|
###############################################
|
||||||
|
Date: 08-Oct
|
||||||
|
Start Time: 11:35pm
|
||||||
|
End Time: ?
|
||||||
|
Duration: ? minutes
|
||||||
|
Description:
|
||||||
|
###############################################
|
||||||
Reference in New Issue
Block a user