Compare commits

..

No commits in common. "2637c09810ae0c2357ab1418b057d113940eaab8" and "c48724c3b494b204dcf20eb41e1fee68906bbb11" have entirely different histories.

185
game.py
View file

@ -20,9 +20,7 @@ def rreplace(s: str, old: str, new: str, occurrence: int) -> str:
cur.hide() cur.hide()
clear() clear()
print( print("Loading Loge City v 0.0.1...")
"Loading Loge City v 0.0.16..."
) # Finally remebered to bump this... I think v16 is right?
sleep(1) sleep(1)
flushPrint("Checking system compatibility...") flushPrint("Checking system compatibility...")
sleep(1) sleep(1)
@ -89,7 +87,6 @@ else:
"racScore": 0, "racScore": 0,
"richScore": 0, "richScore": 0,
"rare": {}, "rare": {},
"upgrades": {},
}, },
) )
uData = db.get(un) uData = db.get(un)
@ -102,14 +99,12 @@ if uData["logins"] == 1:
else: else:
print(f"Welcome back to Loge City {un}, we hope you are enjoying your stay.") print(f"Welcome back to Loge City {un}, we hope you are enjoying your stay.")
sleep(2) sleep(2)
# LTOP - jump point for me
while 1: while 1:
studsAtTop = uData["studs"]
go = menu( go = menu(
{ {
"Stats": 1, "Stats": 1,
"Gamble": 2, "Gamble": 2,
"Upgrades": 3, "Research": 3,
"Vehicle Shop": 4, "Vehicle Shop": 4,
"Rare Parts Shop": 5, "Rare Parts Shop": 5,
"Energy Tank Shop": 6, "Energy Tank Shop": 6,
@ -181,10 +176,7 @@ while 1:
Energy Tanks: {uData["energyTanks"]} Energy Tanks: {uData["energyTanks"]}
Misc Scores: Misc Scores:
Raccoon: {uData["racScore"]} Raccoon: {uData["racScore"]}
Rich: {uData["richScore"]} Rich: {uData["richScore"]}"""
Upgrades:
Luck: {uData["upgrades"].get("luck", 0)}%
Stud Multipiler: {uData["upgrades"].get("studX", 1)}x"""
) )
if uData["debug"] or uData["permissionLevel"] >= 50: if uData["debug"] or uData["permissionLevel"] >= 50:
print( print(
@ -204,8 +196,6 @@ while 1:
betHigh = 0 if type(bet) != int else bet betHigh = 0 if type(bet) != int else bet
winnings = 0 winnings = 0
betLow = -2 * bet if betHigh else 0 betLow = -2 * bet if betHigh else 0
if betLow:
betLow = min(betLow + (uData["upgrades"].get("luck") * 5), 0)
while betHigh: while betHigh:
winnings = randint(betLow, betHigh) winnings = randint(betLow, betHigh)
if multipleOf(winnings): if multipleOf(winnings):
@ -218,59 +208,21 @@ while 1:
print("You won nothing. (You kept your bet though)") print("You won nothing. (You kept your bet though)")
elif winnings == betLow: elif winnings == betLow:
print("You lost your bet!") print("You lost your bet!")
uData["studsLost"] += abs(winnings)
elif winnings >= 0: elif winnings >= 0:
print(f"You won {winnings} studs!") print(f"You won {winnings} studs!")
uData["studsGained"] += winnings
elif winnings <= 0: elif winnings <= 0:
print(f"You lost {abs(winnings)} studs!") print(f"You lost {abs(winnings)} studs!")
uData["studsLost"] += abs(winnings)
else: else:
print("This should be impossible. Cue the panic attacks.") print("This should be impossible. Cue the panic attacks.")
else: else:
print("You don't have enough studs to bet that much.") print("You don't have enough studs to bet that much.")
sleep(5) sleep(5)
case 3: case 3:
prices = { print("TODO: Research Menu")
"studX": 2000000 sleep(1)
* pow(10, (uData["upgrades"].get("studX", 1) * 10) - 10),
"houseL": 199 + pow(53 * uData["houseLevel"], uData["houseLevel"]),
"luck": 500 * pow(10, uData["upgrades"].get("luck", 0) * 2),
}
sel = menu(
{
f"Stud multiplier {uData['upgrades'].get('studX', 1)}x -> {uData['upgrades'].get('studX', 1) + 0.1}x ({prices['studX']} studs)": "studX",
f"House level {uData['houseLevel']} -> {uData['houseLevel'] + 1} ({prices['houseL']} studs)": "houseL",
f"Luck (Affects betting) {uData['upgrades'].get('luck', 0)}% -> {uData['upgrades'].get('luck', 0) + 1}% ({prices['luck']} studs)": "luck",
"Exit": "E",
},
"What do you want to upgrade?",
)
match sel:
case "studX":
if uData["studs"] >= prices[sel]:
uData["studs"] -= prices[sel]
uData["upgrades"][sel] = uData["upgrades"].get(sel, 1) + 0.1
print(
f"You've upgraded your stud multipler to {uData['upgrades'][sel]}x!"
)
case "houseL":
if uData["studs"] >= prices[sel]:
uData["studs"] -= prices[sel]
uData["houseLevel"] += 1
print(
f"You've upgraded your house to level {uData['houseLevel']}!"
)
case "luck":
if uData["studs"] >= prices[sel]:
uData["studs"] -= prices[sel]
uData["upgrades"][sel] = uData["upgrades"].get(sel, 0) + 1
print(
f"You've upgraded your luck to {uData['upgrades'][sel]}%!"
)
case "E":
pass
case _:
print("Firepup forgot to add a menu option, smh")
sleep(2)
sleep(2)
case 4: case 4:
sel = menu( sel = menu(
{ {
@ -303,6 +255,7 @@ while 1:
if sel <= uData["studs"] and "bike" not in uData["vehicles"]: if sel <= uData["studs"] and "bike" not in uData["vehicles"]:
uData["vehicles"].append("bike") uData["vehicles"].append("bike")
uData["studs"] -= sel uData["studs"] -= sel
uData["studsLost"] += sel
print("You purchased a bike!") print("You purchased a bike!")
elif "bike" in uData["vehicles"]: elif "bike" in uData["vehicles"]:
print("Sorry, you already have a bike!") print("Sorry, you already have a bike!")
@ -312,6 +265,7 @@ while 1:
if sel <= uData["studs"] and "4-wheeler" not in uData["vehicles"]: if sel <= uData["studs"] and "4-wheeler" not in uData["vehicles"]:
uData["vehicles"].append("4-wheeler") uData["vehicles"].append("4-wheeler")
uData["studs"] -= sel uData["studs"] -= sel
uData["studsLost"] += sel
print("You purchased a 4-wheeler!") print("You purchased a 4-wheeler!")
elif "4-wheeler" in uData["vehicles"]: elif "4-wheeler" in uData["vehicles"]:
print("Sorry, you already have a 4-wheeler!") print("Sorry, you already have a 4-wheeler!")
@ -324,6 +278,7 @@ while 1:
): ):
uData["vehicles"].append("old rusty car") uData["vehicles"].append("old rusty car")
uData["studs"] -= sel uData["studs"] -= sel
uData["studsLost"] += sel
print("You purchased an old rusty car!") print("You purchased an old rusty car!")
elif "old rusty car" in uData["vehicles"]: elif "old rusty car" in uData["vehicles"]:
print("Sorry, you already have an old rusty car!") print("Sorry, you already have an old rusty car!")
@ -333,6 +288,7 @@ while 1:
if sel <= uData["studs"] and "car" not in uData["vehicles"]: if sel <= uData["studs"] and "car" not in uData["vehicles"]:
uData["vehicles"].append("car") uData["vehicles"].append("car")
uData["studs"] -= sel uData["studs"] -= sel
uData["studsLost"] += sel
print("You purchased a car!") print("You purchased a car!")
elif "car" in uData["vehicles"]: elif "car" in uData["vehicles"]:
print("Sorry, you already have a car!") print("Sorry, you already have a car!")
@ -342,6 +298,7 @@ while 1:
if sel <= uData["studs"] and "minivan" not in uData["vehicles"]: if sel <= uData["studs"] and "minivan" not in uData["vehicles"]:
uData["vehicles"].append("minivan") uData["vehicles"].append("minivan")
uData["studs"] -= sel uData["studs"] -= sel
uData["studsLost"] += sel
print("You purchased a minivan!") print("You purchased a minivan!")
elif "minivan" in uData["vehicles"]: elif "minivan" in uData["vehicles"]:
print("Sorry, you already have a minivan!") print("Sorry, you already have a minivan!")
@ -351,6 +308,7 @@ while 1:
if sel <= uData["studs"] and "van" not in uData["vehicles"]: if sel <= uData["studs"] and "van" not in uData["vehicles"]:
uData["vehicles"].append("van") uData["vehicles"].append("van")
uData["studs"] -= sel uData["studs"] -= sel
uData["studsLost"] += sel
print("You purchased a van!") print("You purchased a van!")
elif "van" in uData["vehicles"]: elif "van" in uData["vehicles"]:
print("Sorry, you already have a van!") print("Sorry, you already have a van!")
@ -360,6 +318,7 @@ while 1:
if sel <= uData["studs"] and "truck" not in uData["vehicles"]: if sel <= uData["studs"] and "truck" not in uData["vehicles"]:
uData["vehicles"].append("truck") uData["vehicles"].append("truck")
uData["studs"] -= sel uData["studs"] -= sel
uData["studsLost"] += sel
print("You purchased a truck!") print("You purchased a truck!")
elif "truck" in uData["vehicles"]: elif "truck" in uData["vehicles"]:
print("Sorry, you already have a truck!") print("Sorry, you already have a truck!")
@ -369,6 +328,7 @@ while 1:
if sel <= uData["studs"] and "food truck" not in uData["vehicles"]: if sel <= uData["studs"] and "food truck" not in uData["vehicles"]:
uData["vehicles"].append("food truck") uData["vehicles"].append("food truck")
uData["studs"] -= sel uData["studs"] -= sel
uData["studsLost"] += sel
print("You purchased a food truck!") print("You purchased a food truck!")
elif "food truck" in uData["vehicles"]: elif "food truck" in uData["vehicles"]:
print("Sorry, you already have a food truck!") print("Sorry, you already have a food truck!")
@ -378,6 +338,7 @@ while 1:
if sel <= uData["studs"] and "semi-truck" not in uData["vehicles"]: if sel <= uData["studs"] and "semi-truck" not in uData["vehicles"]:
uData["vehicles"].append("semi-truck") uData["vehicles"].append("semi-truck")
uData["studs"] -= sel uData["studs"] -= sel
uData["studsLost"] += sel
print("You purchased a semi-truck!") print("You purchased a semi-truck!")
elif "semi-truck" in uData["vehicles"]: elif "semi-truck" in uData["vehicles"]:
print("Sorry, you already have a semi-truck!") print("Sorry, you already have a semi-truck!")
@ -387,6 +348,7 @@ while 1:
if sel <= uData["studs"] and "hover bike" not in uData["vehicles"]: if sel <= uData["studs"] and "hover bike" not in uData["vehicles"]:
uData["vehicles"].append("hover bike") uData["vehicles"].append("hover bike")
uData["studs"] -= sel uData["studs"] -= sel
uData["studsLost"] += sel
print("You purchased a hover bike!") print("You purchased a hover bike!")
elif "hover bike" in uData["vehicles"]: elif "hover bike" in uData["vehicles"]:
print("Sorry, you already have a hover bike!") print("Sorry, you already have a hover bike!")
@ -396,6 +358,7 @@ while 1:
if sel <= uData["studs"] and "hover car" not in uData["vehicles"]: if sel <= uData["studs"] and "hover car" not in uData["vehicles"]:
uData["vehicles"].append("hover car") uData["vehicles"].append("hover car")
uData["studs"] -= sel uData["studs"] -= sel
uData["studsLost"] += sel
print("You purchased a hover car!") print("You purchased a hover car!")
elif "hover car" in uData["vehicles"]: elif "hover car" in uData["vehicles"]:
print("Sorry, you already have a hover car!") print("Sorry, you already have a hover car!")
@ -405,6 +368,7 @@ while 1:
if sel <= uData["studs"] and "hover truck" not in uData["vehicles"]: if sel <= uData["studs"] and "hover truck" not in uData["vehicles"]:
uData["vehicles"].append("hover truck") uData["vehicles"].append("hover truck")
uData["studs"] -= sel uData["studs"] -= sel
uData["studsLost"] += sel
print("You purchased a hover truck!") print("You purchased a hover truck!")
elif "hover truck" in uData["vehicles"]: elif "hover truck" in uData["vehicles"]:
print("Sorry, you already have a hover truck!") print("Sorry, you already have a hover truck!")
@ -417,6 +381,7 @@ while 1:
): ):
uData["vehicles"].append("hover semi-truck") uData["vehicles"].append("hover semi-truck")
uData["studs"] -= sel uData["studs"] -= sel
uData["studsLost"] += sel
print("You purchased a hover semi-truck!") print("You purchased a hover semi-truck!")
elif "hover semi-truck" in uData["vehicles"]: elif "hover semi-truck" in uData["vehicles"]:
print("Sorry, you already have a hover semi-truck!") print("Sorry, you already have a hover semi-truck!")
@ -426,6 +391,7 @@ while 1:
if sel <= uData["studs"] and "pod racer" not in uData["vehicles"]: if sel <= uData["studs"] and "pod racer" not in uData["vehicles"]:
uData["vehicles"].append("pod racer") uData["vehicles"].append("pod racer")
uData["studs"] -= sel uData["studs"] -= sel
uData["studsLost"] += sel
print("You purchased a pod racer!") print("You purchased a pod racer!")
elif "pod racer" in uData["vehicles"]: elif "pod racer" in uData["vehicles"]:
print("Sorry, you already have a pod racer!") print("Sorry, you already have a pod racer!")
@ -435,6 +401,7 @@ while 1:
if sel <= uData["studs"] and "rocketship" not in uData["vehicles"]: if sel <= uData["studs"] and "rocketship" not in uData["vehicles"]:
uData["vehicles"].append("rocketship") uData["vehicles"].append("rocketship")
uData["studs"] -= sel uData["studs"] -= sel
uData["studsLost"] += sel
print("You purchased a rocketship!") print("You purchased a rocketship!")
elif "rocketship" in uData["vehicles"]: elif "rocketship" in uData["vehicles"]:
print("Sorry, you already have a rocketship!") print("Sorry, you already have a rocketship!")
@ -444,6 +411,7 @@ while 1:
if sel <= uData["studs"] and "spaceship" not in uData["vehicles"]: if sel <= uData["studs"] and "spaceship" not in uData["vehicles"]:
uData["vehicles"].append("spaceship") uData["vehicles"].append("spaceship")
uData["studs"] -= sel uData["studs"] -= sel
uData["studsLost"] += sel
print("You purchased a spaceship!") print("You purchased a spaceship!")
elif "spaceship" in uData["vehicles"]: elif "spaceship" in uData["vehicles"]:
print("Sorry, you already have a spaceship!") print("Sorry, you already have a spaceship!")
@ -456,6 +424,7 @@ while 1:
): ):
uData["vehicles"].append("spaceship with a hyperdrive") uData["vehicles"].append("spaceship with a hyperdrive")
uData["studs"] -= sel uData["studs"] -= sel
uData["studsLost"] += sel
print("You purchased a spaceship with a hyperdrive!") print("You purchased a spaceship with a hyperdrive!")
elif "spaceship with a hyperdrive" in uData["vehicles"]: elif "spaceship with a hyperdrive" in uData["vehicles"]:
print("Sorry, you already have a spaceship with a hyperdrive!") print("Sorry, you already have a spaceship with a hyperdrive!")
@ -465,6 +434,7 @@ while 1:
if sel <= uData["studs"] and "yacht" not in uData["vehicles"]: if sel <= uData["studs"] and "yacht" not in uData["vehicles"]:
uData["vehicles"].append("yacht") uData["vehicles"].append("yacht")
uData["studs"] -= sel uData["studs"] -= sel
uData["studsLost"] += sel
print("You purchased a yacht!") print("You purchased a yacht!")
elif "yacht" in uData["vehicles"]: elif "yacht" in uData["vehicles"]:
print("Sorry, you already have a yacht!") print("Sorry, you already have a yacht!")
@ -474,6 +444,7 @@ while 1:
if sel <= uData["studs"] and "space yacht" not in uData["vehicles"]: if sel <= uData["studs"] and "space yacht" not in uData["vehicles"]:
uData["vehicles"].append("space yacht") uData["vehicles"].append("space yacht")
uData["studs"] -= sel uData["studs"] -= sel
uData["studsLost"] += sel
print("You purchased a space yacht!") print("You purchased a space yacht!")
elif "space yacht" in uData["vehicles"]: elif "space yacht" in uData["vehicles"]:
print("Sorry, you already have a space yacht!") print("Sorry, you already have a space yacht!")
@ -483,6 +454,7 @@ while 1:
if sel <= uData["studs"] and "teleporter" not in uData["vehicles"]: if sel <= uData["studs"] and "teleporter" not in uData["vehicles"]:
uData["vehicles"].append("teleporter") uData["vehicles"].append("teleporter")
uData["studs"] -= sel uData["studs"] -= sel
uData["studsLost"] += sel
print("You purchased a teleporter!") print("You purchased a teleporter!")
elif "teleporter" in uData["vehicles"]: elif "teleporter" in uData["vehicles"]:
print("Sorry, you already have a teleporter!") print("Sorry, you already have a teleporter!")
@ -517,6 +489,7 @@ while 1:
case 250: case 250:
if sel <= uData["studs"]: if sel <= uData["studs"]:
uData["studs"] -= sel uData["studs"] -= sel
uData["studsLost"] += sel
uData["richScore"] += 1 uData["richScore"] += 1
if "gold bar" in uData["rare"]: if "gold bar" in uData["rare"]:
uData["rare"]["gold bar"] += 1 uData["rare"]["gold bar"] += 1
@ -528,6 +501,7 @@ while 1:
case 500: case 500:
if sel <= uData["studs"]: if sel <= uData["studs"]:
uData["studs"] -= sel uData["studs"] -= sel
uData["studsLost"] += sel
uData["richScore"] += 2 uData["richScore"] += 2
if "golden cup" in uData["rare"]: if "golden cup" in uData["rare"]:
uData["rare"]["golden cup"] += 1 uData["rare"]["golden cup"] += 1
@ -539,6 +513,7 @@ while 1:
case 1000: case 1000:
if sel <= uData["studs"]: if sel <= uData["studs"]:
uData["studs"] -= sel uData["studs"] -= sel
uData["studsLost"] += sel
uData["richScore"] += 5 uData["richScore"] += 5
if "golden plate" in uData["rare"]: if "golden plate" in uData["rare"]:
uData["rare"]["golden plate"] += 1 uData["rare"]["golden plate"] += 1
@ -550,6 +525,7 @@ while 1:
case 5000: case 5000:
if sel <= uData["studs"]: if sel <= uData["studs"]:
uData["studs"] -= sel uData["studs"] -= sel
uData["studsLost"] += sel
uData["richScore"] += 10 uData["richScore"] += 10
if "golden table" in uData["rare"]: if "golden table" in uData["rare"]:
uData["rare"]["golden table"] += 1 uData["rare"]["golden table"] += 1
@ -561,6 +537,7 @@ while 1:
case 250000: case 250000:
if sel <= uData["studs"]: if sel <= uData["studs"]:
uData["studs"] -= sel uData["studs"] -= sel
uData["studsLost"] += sel
uData["richScore"] += 20 uData["richScore"] += 20
if "crystal" in uData["rare"]: if "crystal" in uData["rare"]:
uData["rare"]["crystal"] += 1 uData["rare"]["crystal"] += 1
@ -572,6 +549,7 @@ while 1:
case 500000: case 500000:
if sel <= uData["studs"]: if sel <= uData["studs"]:
uData["studs"] -= sel uData["studs"] -= sel
uData["studsLost"] += sel
uData["richScore"] += 25 uData["richScore"] += 25
if "crystal cup" in uData["rare"]: if "crystal cup" in uData["rare"]:
uData["rare"]["crystal cup"] += 1 uData["rare"]["crystal cup"] += 1
@ -583,6 +561,7 @@ while 1:
case 1000000: case 1000000:
if sel <= uData["studs"]: if sel <= uData["studs"]:
uData["studs"] -= sel uData["studs"] -= sel
uData["studsLost"] += sel
uData["richScore"] += 50 uData["richScore"] += 50
if "crystal plate" in uData["rare"]: if "crystal plate" in uData["rare"]:
uData["rare"]["crystal plate"] += 1 uData["rare"]["crystal plate"] += 1
@ -594,6 +573,7 @@ while 1:
case 5000000: case 5000000:
if sel <= uData["studs"]: if sel <= uData["studs"]:
uData["studs"] -= sel uData["studs"] -= sel
uData["studsLost"] += sel
uData["richScore"] += 75 uData["richScore"] += 75
if "crystal table" in uData["rare"]: if "crystal table" in uData["rare"]:
uData["rare"]["crystal table"] += 1 uData["rare"]["crystal table"] += 1
@ -605,6 +585,7 @@ while 1:
case 10000000: case 10000000:
if sel <= uData["studs"]: if sel <= uData["studs"]:
uData["studs"] -= sel uData["studs"] -= sel
uData["studsLost"] += sel
uData["richScore"] += 100 uData["richScore"] += 100
if "double studded 1x1 plate" in uData["rare"]: if "double studded 1x1 plate" in uData["rare"]:
uData["rare"]["double studded 1x1 plate"] += 1 uData["rare"]["double studded 1x1 plate"] += 1
@ -616,6 +597,7 @@ while 1:
case 50000000: case 50000000:
if sel <= uData["studs"]: if sel <= uData["studs"]:
uData["studs"] -= sel uData["studs"] -= sel
uData["studsLost"] += sel
uData["richScore"] += 125 uData["richScore"] += 125
if "double studded 2x2 plate" in uData["rare"]: if "double studded 2x2 plate" in uData["rare"]:
uData["rare"]["double studded 2x2 plate"] += 1 uData["rare"]["double studded 2x2 plate"] += 1
@ -627,6 +609,7 @@ while 1:
case 100000000: case 100000000:
if sel <= uData["studs"]: if sel <= uData["studs"]:
uData["studs"] -= sel uData["studs"] -= sel
uData["studsLost"] += sel
uData["richScore"] += 150 uData["richScore"] += 150
if "hinge joint" in uData["rare"]: if "hinge joint" in uData["rare"]:
uData["rare"]["hinge joint"] += 1 uData["rare"]["hinge joint"] += 1
@ -638,6 +621,7 @@ while 1:
case 500000000: case 500000000:
if sel <= uData["studs"]: if sel <= uData["studs"]:
uData["studs"] -= sel uData["studs"] -= sel
uData["studsLost"] += sel
uData["richScore"] += 200 uData["richScore"] += 200
if "vault door" in uData["rare"]: if "vault door" in uData["rare"]:
uData["rare"]["vault door"] += 1 uData["rare"]["vault door"] += 1
@ -674,6 +658,7 @@ while 1:
case 1: case 1:
if price1 <= uData["studs"]: if price1 <= uData["studs"]:
uData["studs"] -= price1 uData["studs"] -= price1
uData["studsLost"] += price1
uData["energyTanks"] += 1 uData["energyTanks"] += 1
print("You bought a single energy tank!") print("You bought a single energy tank!")
else: else:
@ -682,6 +667,7 @@ while 1:
case 5: case 5:
if price5 <= uData["studs"]: if price5 <= uData["studs"]:
uData["studs"] -= price5 uData["studs"] -= price5
uData["studsLost"] += price5
uData["energyTanks"] += 5 uData["energyTanks"] += 5
print("You bought 5 energy tanks!") print("You bought 5 energy tanks!")
else: else:
@ -690,6 +676,7 @@ while 1:
case 10: case 10:
if price10 <= uData["studs"]: if price10 <= uData["studs"]:
uData["studs"] -= price10 uData["studs"] -= price10
uData["studsLost"] += price10
uData["energyTanks"] += 10 uData["energyTanks"] += 10
print("You bought 10 energy tanks!") print("You bought 10 energy tanks!")
else: else:
@ -721,15 +708,7 @@ while 1:
}, },
"What would you like to order?", "What would you like to order?",
) )
# Bugfix: rich and raccoon would always go up even if you failed to buy the item thing, price, message, weird = ("Nothing", 0, "You bought nothing", True)
thing, price, message, weird, rich, rac = (
"Nothing",
0,
"You bought nothing",
True,
0,
0,
)
match sel: match sel:
case 1: case 1:
thing, price, message, weird = ("a pizza", 5, "delicious!", False) thing, price, message, weird = ("a pizza", 5, "delicious!", False)
@ -755,7 +734,7 @@ while 1:
thing = "a can of blueberry" thing = "a can of blueberry"
case 9: case 9:
thing = "a can of rain water" thing = "a can of rain water"
price, message, Weird = ( price, message, weird = (
10, 10,
"tastes just like you remember it!", "tastes just like you remember it!",
False, False,
@ -775,8 +754,7 @@ while 1:
False, False,
) )
case 5: case 5:
# Bugfix here down: Don't redundantly set `weird` to `True` again thing, price, message, weird = (
thing, price, message, rac = (
" trash", " trash",
200, 200,
( (
@ -784,51 +762,58 @@ while 1:
if uData["racScore"] < 10 if uData["racScore"] < 10
else "You eagerly consume the trash pile! (+1 raccoon score)" else "You eagerly consume the trash pile! (+1 raccoon score)"
), ),
1, True,
) )
uData["racScore"] += 1
case 6: case 6:
thing, price, message = ( thing, price, message, weird = (
" money", " money",
500, 500,
"You literally just eat money. Disgusting.", "You literally just eat money. Disgusting.",
True,
) )
case 7: case 7:
thing, price, message, rich = ( thing, price, message, weird = (
'a "tip"', 'a "tip"',
1000, 1000,
'You just give the cashier 1000 studs as a "tip". (+1 rich)', 'You just give the cashier 1000 studs as a "tip". (+1 rich)',
1, True,
) )
uData["richScore"] += 1
case 8: case 8:
thing, price, message, rich = ( thing, price, message, weird = (
"a golden pizza", "a golden pizza",
5000, 5000,
"You add the golden pizza to your home. You can't eat it after all. (+1 rich)", "You add the golden pizza to your home. You can't eat it after all. (+1 rich)",
1, True,
) )
uData["richScore"] += 1
case 9: case 9:
thing, price, message, rich = ( thing, price, message, weird = (
"liquid gold", "liquid gold",
10000, 10000,
"You chug the liquid gold. You are in severe pain for at least 20 minutes. (+2 rich)", "You chug the liquid gold. You are in severe pain for at least 20 minutes. (+2 rich)",
2, True,
) )
uData["richScore"] += 2
case 10: case 10:
thing, price, message, rich = ( thing, price, message, weird = (
"golden tacos", "golden tacos",
20000, 20000,
"You add the golden tacos to your home. The box was too poor for them. (+5 rich)", "You add the golden tacos to your home. The box was too poor for them. (+5 rich)",
5, True,
) )
uData["richScore"] += 5
case 11: case 11:
thing, price, message, rich = ( thing, price, message, weird = (
"golden doughnuts", "golden doughnuts",
50000, 50000,
"You add the golden doughtnuts to your home. Very sophisticated! (+15 rich)", "You add the golden doughtnuts to your home. Very sophisticated! (+15 rich)",
15, True,
) )
uData["richScore"] += 15
case 12: case 12:
thing, price, message, rich, rac = ( thing, price, message, weird = (
"golden trash", "golden trash",
200000, 200000,
( (
@ -836,23 +821,26 @@ while 1:
if uData["racScore"] < 20 if uData["racScore"] < 20
else "You eagerly consume the golden trash pile! (+20 rich, +5 raccoon)" else "You eagerly consume the golden trash pile! (+20 rich, +5 raccoon)"
), ),
20, True,
5,
) )
uData["richScore"] += 20
uData["racScore"] += 5
case 13: case 13:
thing, price, message, rich = ( thing, price, message, weird = (
"5 cubic meters of gold", "5 cubic meters of gold",
500000, 500000,
"You EAT 5 cubic meters of gold. I don't even know how you managed that. (+25 rich)", "You EAT 5 cubic meters of gold. I don't even know how you managed that. (+25 rich)",
25, True,
) )
uData["richScore"] += 25
case 14: case 14:
thing, price, message, rich = ( thing, price, message, weird = (
'a hefty "tip"', 'a hefty "tip"',
1000000, 1000000,
'You "tip" the cashier a million studs. That\'s just not a tip man. (+30 rich)', 'You "tip" the cashier a million studs. That\'s just not a tip man. (+30 rich)',
30, True,
) )
uData["richScore"] += 30 # Bugfix: Missing rich score increment
case "E": case "E":
pass pass
case _: case _:
@ -860,8 +848,7 @@ while 1:
sleep(5) sleep(5)
if price > 0 and price <= uData["studs"]: if price > 0 and price <= uData["studs"]:
uData["studs"] -= price uData["studs"] -= price
uData["richScore"] += rich uData["studsLost"] += price
uData["racScore"] += rac
if not weird: if not weird:
print( print(
f"You {'eat' if sel!=2 else 'drink'} your {thing[2:]}... {message}" f"You {'eat' if sel!=2 else 'drink'} your {thing[2:]}... {message}"
@ -887,7 +874,6 @@ while 1:
"racScore": 0, "racScore": 0,
"richScore": 0, "richScore": 0,
"rare": {}, "rare": {},
"upgrades": {},
} }
fixed = False fixed = False
for key in migrations: for key in migrations:
@ -959,25 +945,6 @@ while 1:
) )
sleep(60) sleep(60)
clear() clear()
# Apply stud multipliers to any earned money after the everything else runs
newStuds = studsAtTop - uData["studs"]
if newStuds > 0:
uData["studs"] += newStuds * uData["upgrades"].get("studX", 1)
# If we're gonna have weird stud multipliers, we've gotta round those back to standard increments, and normal rounding isn't enough, since I want the studs to be locked to increments of 5.
if uData["studs"] % 1:
uData["studs"] = round(uData["studs"])
if uData["studs"] % 5:
if (uData["studs"] + (uData["studs"] % 5)) < (
uData["studs"] + (5 - (uData["studs"] % 5))
):
uData["studs"] -= uData["studs"] % 5
else:
uData["studs"] += 5 - (uData["studs"] % 5)
studsDiff = studsAtTop - uData["studs"]
if studsAtTop > 0:
uData["studsGained"] += studsDiff
else: # Yes, this could be caused if studsDiff is 0. However that's not a concern since it'll just subtract 0.
uData["studsLost"] -= studsDiff
if uData["studs"] > uData["highestStuds"]: if uData["studs"] > uData["highestStuds"]:
uData["highestStuds"] = uData["studs"] uData["highestStuds"] = uData["studs"]
db.set( db.set(