stationbase/stationbase.py

162 lines
4.8 KiB
Python
Raw Normal View History

2021-12-06 21:08:05 -07:00
#!/usr/bin/python3.10
import random
maxRoll = 1000
class Drone:
2021-12-27 18:19:43 -07:00
def __init__(self, money,name, health):
2021-12-06 21:08:05 -07:00
self.money = money
self.name = name
2021-12-27 18:19:43 -07:00
self.health = health
2021-12-06 21:08:05 -07:00
def check_drone():
print("DRONG STATUS")
2021-12-27 18:19:43 -07:00
print("-------------")
print(f"Name: {Drone.name}")
2021-12-06 21:08:05 -07:00
print(f"Credits: {Drone.money}")
print("Station: Ass")
2021-12-17 21:41:49 -07:00
class Player:
2021-12-27 18:19:43 -07:00
def __init__(self, character, name, turns, credits):
2021-12-17 21:41:49 -07:00
self.character = character
self.name = name
self.turns = turns
2021-12-27 18:19:43 -07:00
self.credits = credits
2021-12-17 21:41:49 -07:00
2021-12-06 21:08:05 -07:00
drone = Drone
2021-12-27 18:19:43 -07:00
drone.name = "Klive"
2021-12-06 21:08:05 -07:00
drone.money = 0
2021-12-17 21:41:49 -07:00
player = Player
player.name = "Jake"
2021-12-27 18:19:43 -07:00
player.turns = 100
player.credits = 0
items = {
"Dildo": 3,
"guitar": 10,
"shoe": 90,
"poop": 40
}
def credits_to_player():
if drone.money < 0:
print(f"{drone.name} has less than 0 credits ({drone.money})")
elif drone.money == 0:
print(f"{drone.name} has 0 credits")
else:
print(f"Moving {drone.money} credits to {player.name}")
player.credits += drone.money
drone.money = 0
def battle(drone):
enemy = 100
drone.health = 100
print(f"{drone.name} attacks enemy for 20 damage")
enemy - 20
print(f"Enemy health: {enemy}")
2021-12-17 21:41:49 -07:00
2021-12-06 21:08:05 -07:00
def scan_system():
2021-12-17 21:42:45 -07:00
#temp code for testing
2021-12-06 21:08:05 -07:00
roll = random.randrange(1, maxRoll)
print(roll)
if roll < 20:
2021-12-27 18:19:43 -07:00
print(f"Nothing of value was found...")
2021-12-06 21:08:05 -07:00
elif roll > 20 and roll < 30:
2021-12-27 18:19:43 -07:00
print(f"{drone.name} finds a rock and get 3 credits")
2021-12-06 21:08:05 -07:00
drone.money = drone.money +3
elif roll > 30 and roll < 50:
2021-12-27 18:19:43 -07:00
print(f"{drone.name} finds a gem and make 20 credits")
2021-12-06 21:08:05 -07:00
drone.money = drone.money +20
elif roll > 50 and roll < 60:
2021-12-27 18:19:43 -07:00
print(f"{drone.name} finds nothing of value...")
2021-12-06 21:08:05 -07:00
elif roll > 60 and roll < 80:
2021-12-27 18:19:43 -07:00
print(f"{drone.name} finds a missle shell and make 100 credits!")
2021-12-06 21:08:05 -07:00
drone.money = drone.money +100
elif roll > 80 and roll < 90:
2021-12-27 18:19:43 -07:00
print(f"{drone.name} finds a shoe and make 32 credits!")
2021-12-06 21:08:05 -07:00
elif roll > 90 and roll < 99:
2021-12-27 18:19:43 -07:00
print(f"{drone.name} finds a pebble and make 15 credits")
2021-12-06 21:08:05 -07:00
drone.money = drone.money +15
elif roll == 100:
2021-12-27 18:19:43 -07:00
print(f"{drone.name} finds gold and make 200 credits")
2021-12-06 21:08:05 -07:00
drone.money = drone.money +200
elif roll >= 100 and roll < 300:
2021-12-27 18:19:43 -07:00
print(f"{drone.name} finds nothing")
2021-12-06 21:08:05 -07:00
elif roll >= 300 and roll < 350:
2021-12-27 18:19:43 -07:00
print(f"{drone.name} finds nothing")
2021-12-06 21:08:05 -07:00
elif roll >= 350 and roll < 400:
2021-12-27 18:19:43 -07:00
print(f"{drone.name} finds an apple and sell it for 5 credits")
2021-12-06 21:08:05 -07:00
drone.money = drone.money +5
elif roll >= 400 and roll < 420:
2021-12-27 18:19:43 -07:00
print(f"{drone.name} finds a guitar and sell it for 1.2k credits")
2021-12-06 21:08:05 -07:00
drone.money = drone.money +1200
elif roll >= 420 and roll < 500:
2021-12-27 18:19:43 -07:00
print(f"{drone.name} finds a miniture dildo and sell it for 1 credits")
2021-12-06 21:08:05 -07:00
drone.money = drone.money +1
elif roll >= 500 and roll < 505:
2021-12-27 18:19:43 -07:00
print(f"{drone.name} finds a crashed ship and sell it's scrap for 300k credits")
2021-12-06 21:08:05 -07:00
drone.money = drone.money +300000
elif roll >= 505 and roll < 600:
2021-12-27 18:19:43 -07:00
print(f"{drone.name} finds nothing")
2021-12-06 21:08:05 -07:00
elif roll >= 600 and roll < 700:
2021-12-27 18:19:43 -07:00
if drone.money <= 0:
print(f"{drone.name} was attack by pirates but there was nothing for them to steal.")
else:
print(f"{drone.name} are attacked by a pirate and lose 100 credits")
drone.money = drone.money -100
if drone.money < 0:
drone.money = 0
2021-12-06 21:08:05 -07:00
elif roll >= 700 and roll < 702:
2021-12-27 18:19:43 -07:00
print(f"{drone.name} finds a slave and sell it for 500000")
2021-12-06 21:08:05 -07:00
drone.money = drone.money +500000
elif roll >= 702 and roll < 800:
2021-12-27 18:19:43 -07:00
print(f"{drone.name} finds nothing")
2021-12-06 21:08:05 -07:00
elif roll >= 800 and roll < 900:
2021-12-27 18:19:43 -07:00
print(f"{drone.name} finds nothing")
2021-12-06 21:08:05 -07:00
elif roll >= 900 and roll < 950:
2021-12-27 18:19:43 -07:00
print(f"{drone.name} finds 100 credits")
2021-12-06 21:08:05 -07:00
drone.money = drone.money +100
elif roll >= 950 and roll <=1000:
2021-12-27 18:19:43 -07:00
if drone.money <= 0:
print("There was nothing to lose")
else:
print(f"{drone.name} lose 300 credits")
drone.money = drone.money -300
if drone.money < 0:
drone.money = 0
2021-12-06 21:08:05 -07:00
2021-12-27 18:19:43 -07:00
def help():
2021-12-06 21:08:05 -07:00
print("c) Check Drone")
2021-12-17 21:31:39 -07:00
print("s} Scan System")
2021-12-27 18:19:43 -07:00
print("t) Transfer credits from drone")
2021-12-06 21:08:05 -07:00
while True:
2021-12-27 18:19:43 -07:00
repl = input(f"{player.name} | Turns: {player.turns} | Cedits: {player.credits} >> ")
2021-12-06 21:08:05 -07:00
if repl == "c":
drone.check_drone()
2021-12-17 21:31:39 -07:00
elif repl == "s":
2021-12-18 20:18:56 -07:00
if player.turns > 0:
player.turns = player.turns -1
scan_system()
else:
2021-12-27 18:19:43 -07:00
print("{drone.name} are out of turns")
elif repl == "t":
credits_to_player()
elif repl == "h" or repl == "help":
help()
2021-12-06 21:08:05 -07:00
elif repl == "q":
quit()
else:
print("Not a command, bitch")