Auswahl für Upgrades + Kaufsystem (mit Linus)
This commit is contained in:
BIN
Game/__pycache__/game.cpython-313.pyc
Normal file
BIN
Game/__pycache__/game.cpython-313.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
14
Game/game.py
14
Game/game.py
@@ -3,29 +3,29 @@ import random
|
||||
|
||||
propability = 40
|
||||
coins_per_head = 0.5
|
||||
coins = 5
|
||||
#wealth = 5000
|
||||
heads_amount = 1
|
||||
multiplier = 0.5
|
||||
|
||||
def coin_flip(propability, coins, coins_per_head, heads_amount, multiplier):
|
||||
def coin_flip(propability, wealth, coins_per_head, heads_amount, multiplier):
|
||||
while True:
|
||||
result = random.randint(0, 100)
|
||||
if result in range(0,propability):
|
||||
print(f'Kopf ({heads_amount}x)')
|
||||
heads_amount += 1 #Anzahl an hintereinander geworfenen "Köpfen"
|
||||
if heads_amount >=3:
|
||||
heads_per_head += multiplier #Coin-Boost für mehrfaches werfen von Kopf hintereinander
|
||||
coins_per_head += multiplier #Coin-Boost für mehrfaches werfen von Kopf hintereinander
|
||||
else:
|
||||
coins_per_head = 0.5
|
||||
coins += coins_per_head
|
||||
wealth += coins_per_head
|
||||
print('')
|
||||
print(f'Du hast {coins} Coins (+ {coins_per_head})')
|
||||
print(f'Du hast {wealth} Coins (+ {coins_per_head})')
|
||||
input()
|
||||
elif result in range(propability,100):
|
||||
print('Zahl')
|
||||
coins_amount = 1
|
||||
heads_amount = 1
|
||||
input()
|
||||
|
||||
|
||||
coin_flip(propability, coins, coins_per_head, heads_amount, multiplier)
|
||||
coin_flip(propability, wealth, coins_per_head, heads_amount, multiplier)
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
from upgrades import coin_multiplier, lucky_coin, flip_chance
|
||||
from game import wealth, coin_flip(propability, wealth, coins_per_head, heads_amount, multiplier)
|
||||
|
||||
|
||||
base_lvl_coin_multiplier = coin_multiplier(0.5, 10)
|
||||
base_lvl_flip_chance = flip_chance(10, 0)
|
||||
@@ -32,23 +34,46 @@ def lvl_up_lucky_coin():
|
||||
print(f" LC Cost: {base_lvl_lucky_coin.cost}")
|
||||
print(f" LC Chance: {base_lvl_lucky_coin.chance}")
|
||||
|
||||
def homepage_upgrades():
|
||||
def homepage_upgrades(wealth):
|
||||
while True:
|
||||
answer = input(' Flip Chance: [1]\n Lucky Coin: [2]\n Multiplier: [3]')
|
||||
answer = input(' Flip Chance: [1]\n Lucky Coin: [2]\n Multiplier: [3]\n Zum Game: [4]')
|
||||
try:
|
||||
answer = int(answer)
|
||||
if answer == 1:
|
||||
if wealth >= base_lvl_flip_chance.cost:
|
||||
lvl_up_flip_chance()
|
||||
wealth -= base_lvl_flip_chance.cost
|
||||
print('Erfolgreich geupgradet. Du hast',wealth, "Coins")
|
||||
break
|
||||
else:
|
||||
print('Du bist zu arm')
|
||||
|
||||
elif answer == 2:
|
||||
if wealth >= base_lvl_lucky_coin.cost:
|
||||
lvl_up_lucky_coin()
|
||||
wealth -= base_lvl_lucky_coin.cost
|
||||
print('Erfolgreich geupgradet. Du hast',wealth, "Coins")
|
||||
break
|
||||
else:
|
||||
print('Du bist zu arm')
|
||||
|
||||
elif answer == 3:
|
||||
if wealth >= base_lvl_coin_multiplier.cost:
|
||||
lvl_up_multiplier()
|
||||
wealth -= base_lvl_coin_multiplier.cost
|
||||
print('Erfolgreich geupgradet. Du hast',wealth, "Coins")
|
||||
break
|
||||
elif answer not in (1, 2, 3):
|
||||
print('Bitte 1, 2 oder 3!')
|
||||
else:
|
||||
print('Du bist zu arm')
|
||||
elif answer == 4:
|
||||
coin_flip(propability, wealth, coins_per_head, heads_amount, multiplier)
|
||||
|
||||
|
||||
|
||||
elif answer not in (1, 2, 3, 4):
|
||||
print('Bitte 1, 2, 3 oder 4!')
|
||||
|
||||
except ValueError:
|
||||
print('Nur Zahlen')
|
||||
|
||||
homepage_upgrades()
|
||||
homepage_upgrades(wealth)
|
||||
Reference in New Issue
Block a user