Skip to content

Instantly share code, notes, and snippets.

@dildev
Created January 29, 2016 04:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dildev/db1cdd0866d2b42cea6f to your computer and use it in GitHub Desktop.
Save dildev/db1cdd0866d2b42cea6f to your computer and use it in GitHub Desktop.
import time
def displayIntro():
print('"silence fills the empty grave, now that i am gone')
time.sleep(1)
print('but my mind is not at rest, for questions linger on')
time.sleep(1)
print('i will ask...')
time.sleep(1)
print('\t...and you will answer"')
time.sleep(2)
print('')
print('"Alright. Shoot."')
time.sleep(3)
print('')
print('The Gravemind wants all the intel on Earth\'s defenses.')
print('Encrypt your files to hold him off.')
print('')
print('You have discovered a way to stop the Flood.')
print('Infiltrate the Gravemind\'s systems to get a message to John.')
print('')
print('The situation has put an exorbant amount of pressure on you.')
print('Analyze. Take a breath of information. Hold off rampancy.')
print('')
print('')
#Describe to the player the actions available.
def displayOptions():
print('These are the actions you may use to combat the Gravemind.')
print('Encrypt, Infiltrate, Analyze')
print('')
time.sleep(2)
#Begin the game
def gamePlay(): #Make this a descriptor so that it can be place in the "while" loop at the end
eStat = 7
iStat = 0
aStat = 7
print('Encryption Status ' + str(eStat))
print('Infiltrate Status ' + str(iStat))
print('Analyze Status ' + str(aStat))
print('')
while eStat > 0 or iStat < 7 or aStat > 0 : #define the terms for win or lose
#Ask the player to chose an action
action = ''
while action != 'Encrypt' and action != 'Infiltrate' and action != 'Analyze':
print('What action do you take?')
print('')
action = input()
#What are the results of the actions?
if action == 'Encrypt':
eStat = eStat+2.5
aStat = aStat-1
print('You increase the encryption on your files.')
time.sleep(1)
print('That monster isn\'t getting any intel from you.')
time.sleep(2)
elif action == 'Infiltrate': #else if
iStat = iStat+1
aStat = aStat-1
print('You probe the systems.')
time.sleep(1)
print('You\'re one step closer to getting that message to John.')
time.sleep(2)
else:
aStat = aStat + 1
print('You take in more information.')
time.sleep(1)
print('It\'s like take a breath of fresh air. You hold off rampancy.')
time.sleep(2)
print('')
print('The Gravemind attacks your systems')
eStat = eStat - 1
time.sleep(1)
print('')
print('Encryption Status ' + str(eStat))
print('Infiltrate Status ' + str(iStat))
print('Analyze Status ' + str(aStat))
print('')
time.sleep(2)
if iStat == 8:
break
if eStat <= 0:
break
if aStat == 0:
break
#Determine the conditions, did the player win?
if iStat == 8 and eStat > 0 and aStat > 0:
print('You have withstood and outsmarted the Gravemind.')
time.sleep(1)
print('John has gotten the message.')
if eStat <= 0:
print('Despite your efforts, the Gravemind has broken through your firewalls.')
time.sleep(1)
print('Earth is at its mercy. John is at its mercy.')
if aStat == 0:
print('Too late you notice the encroaching rampancy.')
time.sleep(1)
print('It has claimed you.')
#Do they want to play again?
playAgain = 'yes'
while playAgain == 'yes' or playAgain == 'y':
displayIntro()
displayOptions()
gamePlay()
print('')
print('Do you want to play again? (yes or no)')
print('')
playAgain = input()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment