Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- import time
- import random
- import math
- from random import randint
- global sucrate
- global stage
- global alist
- global stagen
- global sucratelist
- global namemis
- global anumber
- global achoose
- global cash
- global cost
- global destl
- global mistot
- global miswin
- global mislose
- global shiphis
- global loan
- global wagelist
- global classlist
- global joblist
- global achieve
- global orbit
- global dock
- global moon
- global mars
- global date
- global hiredate
- global alive
- alive = []
- hiredate = []
- orbit = 0
- dock = 0
- moon = 0
- mars = 0
- date = 1
- achieve = []
- joblist = []
- classlist = []
- wagelist = []
- destl = [5,7,10,20]
- cost = 0
- namemis = ''
- sucratelist = []
- stagen = 2
- alist = []
- dtag = []
- sucrate = 0
- stage = 1
- anumber = 0
- achoose = 0
- loan = 0
- cash = 8000+loan
- mistot = 0
- miswin = 0
- mislose = 0
- shiphis = []
- def Opening():
- print('')
- print('##################')
- print('# Alexis DeSilva #')
- print('# Presents... #')
- print('#Text Into Space!#')
- print('##################')
- Menu()
- def Menu():
- print('')
- print('Day '+str(date))
- print('')
- print('1. Hire Astronauts')
- print('2. Train Astronauts')
- print('3. Work on Spaceship')
- print('4. List of Crew')
- print('5. Statistics')
- print('6. Take Out Loan')
- print('7. Exit Game')
- print('')
- choice = input('Input: ')
- if choice == '1':
- print('')
- Astroname()
- elif choice == '2':
- print('')
- Train()
- elif choice == '3':
- print('')
- AddSuccess()
- elif choice == '4':
- print('')
- AstroList()
- elif choice == '5':
- print('')
- Stat()
- elif choice == '6':
- print('')
- Loan()
- elif choice == '7':
- print('')
- sys.exit
- else:
- print('INVALID BUTTON')
- Menu()
- def Astroname():
- global cash
- global anumber
- global wagelist
- global joblist
- global hiredate
- jobclass = [0,1,2,3]
- class0job = ['Janitor','Construction','Waiter','Cashier','Frycook']
- class1job = ['Teacher','Accountant','Chef','Actor','Sports Player']
- class2job = ['Pilot','Soldier','Engineer','Scientist']
- chosenclass = 0
- prefix = ['Al','Ald','An','Bar','Bart','Bur','Cal','Chad','Cor','Dan','Der','Dud','Ed','El','En','Er','Fer','Fred','Fil','Gene','Geof','Gus','Had','Hal','Han','Jeb','Joe','Jon','Kel','Kir','Ken','Lan','Lem','Lu','Mac','Mel','Mil','Ned','Neil','New','Ob','Or','Pat','Pil','Phil','Ray','Rib','Rod','Sam','Sean','Sid','Son','Tom','Thom','Wehr','Wil']
- suffix =['ald','bal','bald','bart','bas','berry','bo','bree','cal','can','cas','cott','dan','do','don','dorf','drin','dun','emy','emone','ely','frey','frod','gan','gard','gee','hat','ing','kin','lie','lo','lorf','mal','man','mon','mund','nand','nie','oly','rey','rick','rim','rod','sby','sel','son','sted','ster','ton','top','trey','van','well','wig','win','wise','zer','zon','zor']
- customname = ['Alexis','Kurt','Danny','Scott','Harv','Rick','Chris','Jebediah','Bob','Bill','Molly']
- customnot = randint(0,100)
- if customnot <= 10:
- name = random.choice(customname)
- else:
- name = random.choice(prefix) + random.choice(suffix)
- if name in alist:
- Astroname()
- else:
- print('')
- print(str(name))
- randomclass = randint(1,100)
- if randomclass <= 33:
- chosenclass = 0
- elif randomclass <= 66:
- chosenclass = 1
- elif randomclass <= 99:
- chosenclass = 2
- else:
- chosenclass = 3
- if chosenclass == 0:
- wagewant = randint(25,100)
- job = random.choice(class0job)
- print('Last Job: ' + str(job))
- print('Wanted Wage: ' + str(wagewant))
- elif chosenclass == 1:
- wagewant = randint(75,175)
- job = random.choice(class1job)
- print('Last Job: ' + str(job))
- print('Wanted Wage: ' + str(wagewant))
- elif chosenclass == 2:
- wagewant = randint(150,250)
- job = random.choice(class2job)
- print('Last Job: ' + str(job))
- print('Wanted Wage: ' + str(wagewant))
- else:
- wagewant = randint(400,500)
- job = 'Astronaut'
- print('Last Job: ' + str(job))
- print('Wanted Wage: ' + str(wagewant))
- print('')
- print('Do you want this astronaut? 1 = Yes, 0 = No')
- keepno = input('Input: ')
- if keepno == '1':
- if cash >= 250:
- print('Astronaut Hired!')
- classlist.append(chosenclass)
- joblist.append(job)
- wagelist.append(wagewant)
- alist.append(name)
- alive.append(name)
- hiredate.append(date)
- dtag.append(0)
- achieve.append('Awards: Hired')
- cash -= 250
- anumber += 1
- Menu()
- else:
- print('Could not afford astronaut!')
- Menu()
- elif keepno == '0':
- print('Astronaut Rejected...')
- print('')
- time.sleep(.5)
- print('Look for more crew? 1 = Yes, 0 = No')
- choice = input('Input: ')
- if choice == '1':
- Astroname()
- elif choice == '0':
- Menu()
- else:
- print('INVALID BUTTON: RETURNING TO MENU')
- Menu()
- else:
- print('INVALID BUTTON: ASTRONAUT REJECTED')
- Astroname()
- Menu()
- def AddSuccess():
- global date
- global stage
- global stagen
- global sucrate
- global stagelist
- global sucratelist
- global namemis
- global cash
- global cost
- global destl
- if stage == 1:
- if sucrate == 0:
- namemis = input('Name Your Mission: ')
- print('Where will you go?')
- print('5. Orbit')
- print('7. Docking')
- print('10. Moon')
- print('20. Mars')
- dest = int(input('Destination: '))
- if dest in destl:
- stagen = dest+1
- else:
- print('')
- print('Invalid Number')
- print('')
- AddSuccess()
- print('')
- else:
- print('')
- else:
- print('')
- print(str(namemis) + ': ' + str(stagen-1) + ' stages')
- print('')
- if stage == stagen:
- print('Mission Designed!')
- else:
- print('Stage ' + str(stage) + ' Success Rate: ' + str(sucrate))
- print('Current Funds: ' + str(cash))
- print('1. Round of Research')
- if stagen >= stage + 1:
- print('2. Next Stage')
- else:
- print('2. LAUNCH')
- print('3. Return to Menu')
- choice = input('Input: ')
- if choice == '1':
- if stagen <= stage:
- print('CANNOT RESEARCH')
- AddSuccess()
- else:
- money = randint(95,150)
- wage = sum(wagelist)
- costtot = money+(wage)
- if cash >= costtot:
- cash -= costtot
- sucrate += randint(5,13)
- cost += money
- date += randint(3,7)
- if sucrate >= 100:
- sucrate = 100
- print('Reached Max Success!')
- else:
- print('Success Rate: ' + str(sucrate))
- else:
- print('Cannot Afford This!')
- elif choice == '2':
- if stagen >= stage + 1:
- stage += 1
- sucratelist.append(sucrate)
- sucrate = 0
- date += randint(1,3)
- print('Next Stage!')
- else:
- AstroChoose()
- elif choice == '3':
- Menu()
- else:
- print('INVALID BUTTON')
- AddSuccess()
- def AstroList():
- print('Alive Roster:')
- print('')
- print("\n".join([x for x in alive]))
- print('')
- print('K.I.A:')
- print('')
- print("\n".join([x for x in alist if x not in alive]))
- print('')
- input('Press ENTER to leave')
- Menu()
- def AstroChoose():
- global achoose
- alive2 = [item for item in alive]
- print('')
- print('Choose an Astronaut!')
- print("\n".join([x for x in alive2]))
- achoose = input('Astronaut: ')
- while achoose in alist:
- if achoose not in alive:
- print(str(achoose) + ' has died before!')
- Menu()
- else:
- print('')
- print(str(achoose) + ' has been chosen to fly ' + str(namemis) + '!')
- print('')
- LaunchCheck()
- else:
- print('Not Valid Astronaut!')
- Menu()
- def LaunchCheck():
- global mistot
- global miswin
- global mislose
- global dtag
- global achoose
- global stagen
- global sucrate
- global stage
- global sucratelist
- global wagelist
- global namemis
- global cash
- global cost
- global anumber
- global shiphis
- global loan
- global orbit
- global dock
- global moon
- global mars
- global date
- global alive
- date += randint(7,21)
- inprogstage = 2
- succ = 0
- mistot += 1
- while inprogstage <= stagen:
- findlist = alist.index(achoose)
- modifyfind = classlist[findlist]
- if modifyfind == 0:
- modify = -5
- elif modifyfind == 1:
- modify = 0
- elif modifyfind == 2:
- modify = 5
- else:
- modify = 10
- progstagesuc = (randint(0,99)+modify)
- if progstagesuc >= sucratelist[succ]:
- time.sleep(5)
- mislose += 1
- print('Mission Failure')
- wagelist.pop(findlist)
- shiphis.append(str(namemis) + ' - Stages: ' + str(stagen-1) + ' - Pilot: ' + str(achoose) + ' - Failure')
- time.sleep(2)
- print('')
- cash -= math.floor(100*((randint(5,10)/10)+1))
- anumber -= 1
- print(str(achoose) + ' died on stage ' + str(inprogstage-2) + ' at ' + str(sucratelist[succ]) + ' percent odds...')
- print('')
- input('Press ENTER to do a new Mission')
- dtag[findlist]=date
- alive.remove(achoose)
- namemis = ''
- sucratelist = []
- stagen = randint(4,8)
- sucrate = 0
- stage = 1
- Menu()
- else:
- succ += 1
- inprogstage += 1
- time.sleep(5)
- miswin += 1
- print('Mission Success!')
- shiphis.append(str(namemis) + ' - Stages: ' + str(stagen-1) + ' - Pilot: ' + str(achoose) + ' - Success')
- time.sleep(2)
- if stagen-1 != 7:
- if stagen-1 == 5:
- print(str(achoose)+' went to orbit!')
- if orbit == 0:
- orbit += 1
- findlist = alist.index(achoose)
- achieve[findlist]=str(achieve[findlist] + ', First to Orbit')
- else:
- orbit += 0
- elif stagen-1 == 10:
- print(str(achoose)+' went to the Moon!')
- if moon == 0:
- moon += 1
- findlist = alist.index(achoose)
- achieve[findlist]=str(achieve[findlist] + ', First to the Moon')
- else:
- moon += 0
- else:
- print(str(achoose)+' went to Mars!')
- if mars == 0:
- mars += 1
- findlist = alist.index(achoose)
- achieve[findlist]=str(achieve[findlist] + ', First to Mars')
- else:
- mars += 0
- else:
- print(str(achoose)+' docked to a space station!')
- if dock == 0:
- dock += 1
- findlist = alist.index(achoose)
- achieve[findlist]=str(achieve[findlist] + ', First to Dock')
- else:
- dock += 0
- print('')
- input('Press ENTER to do a new Mission')
- cash += math.ceil((cost*((stagen/10)+1.2)-(math.floor(loan*.2))))
- loan -= (math.floor(loan*.20))
- cost = 0
- namemis = ''
- sucratelist = []
- sucrate = 0
- stage = 1
- Menu()
- def Stat():
- global cash
- global mistot
- global miswin
- global mislose
- print('')
- print('Cash: ' + str(cash))
- print('')
- print('You have flown ' + str(mistot) + ' missions:')
- print(str(miswin) + ' were successful...')
- print(str(mislose) + ' are tragedies...')
- print('')
- print('1. Ship History')
- print('2. View Contracts')
- print('3. View Astronaut Records')
- print('4. Exit to Menu')
- choice = input('Input: ')
- if choice == '1':
- ShipShow()
- elif choice == '2':
- Contracts()
- elif choice == '3':
- indivrec()
- elif choice == '4':
- Menu()
- else:
- print('INVALID BUTTON')
- Stat()
- def ShipShow():
- print('Ships:')
- print('')
- print("\n".join([x for x in shiphis]))
- print('')
- input('Press ENTER to leave')
- Stat()
- def Loan():
- global loan
- global cash
- loanimm = 0
- print('')
- print('How much do you want to loan (in thousands)?')
- loanimm = (int(input('Input: '))*1000)
- loan += loanimm
- cash += loanimm
- Menu()
- def Contracts():
- print('')
- a = anumber-1
- while a >= 0:
- print(str(alist[a])+' - Class '+str(classlist[a])+' - Former Job: '+str(joblist[a])+' - Wage: '+str(wagelist[a]))
- a -= 1
- print('')
- input('Press RETURN to return to Statistics!')
- Stat()
- def Train():
- global cash
- global classlist
- global wagelist
- global date
- print('')
- print('Choose Astronaut')
- print('')
- a = anumber-1
- while a >= 0:
- print(str(alist[a])+' - Class '+str(classlist[a])+' - Former Job: '+str(joblist[a])+' - Wage: '+str(wagelist[a]))
- a -= 1
- atchoose = input('Astronaut: ')
- while atchoose in alist:
- if atchoose not in alive:
- print(str(atchoose) + ' has died before!')
- Menu()
- else:
- print('')
- findlist = alist.index(atchoose)
- atclass = classlist[findlist]
- print('Cost: ' + str((int(atclass)+1)*1000))
- print('1. Train')
- print('2. Cancel')
- traino = input('Input ')
- if traino == '1':
- if int(classlist[findlist]) >= 3:
- print('')
- print('Cannot Train: Max Class')
- Menu()
- else:
- if cash >= int((int(atclass)+1)*1000):
- classlist[findlist]=(classlist[findlist])+1
- wagelist[findlist] += 75
- cash -= int((int(atclass)+1)*1000)
- print('')
- date += randint(7,10)
- print('Astronaut Trained!')
- Menu()
- else:
- print('Not enough money!')
- Menu()
- else:
- Menu()
- else:
- print('Not Valid Astronaut!')
- Train()
- def indivrec():
- print('')
- print('Choose Astronaut')
- print('')
- print("\n".join([x for x in alist]))
- print('')
- rchoose = input('Astronaut: ')
- while rchoose in alist:
- print('|~~~~~~~~~~')
- print('|Record of '+str(rchoose)+':')
- print('|~~~~~~~~~~')
- findlist = alist.index(rchoose)
- print('|Hired on Day '+str(hiredate[findlist]))
- if dtag[findlist]<=0:
- print('|Status: Active')
- print('|Wage: '+str(wagelist[findlist]))
- print('|Class: '+str(classlist[findlist]))
- else:
- print('|Status: K.I.A. on Day: '+ str(dtag[findlist]))
- print('|Wage: N/A')
- print('|Was Class: '+str(classlist[findlist]))
- print('|Former Job: '+str(joblist[findlist]))
- print('|'+str(achieve[findlist]))
- print('|~~~~~~~~~')
- input('Return to Menu')
- Menu()
- else:
- print('Not Valid Astronaut!')
- Menu()
- Opening()
- input('')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement