repl.it
@KianAlford/

RPG adventure-1

Python

this is a full RPG in all text. work in progress.

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import random
import sys
health = 100
sleep = [1 , 2]
encounter = [1 , 2 , 3]
flee_chance = [1 , 2]
X = 1

Character_name = input('What is your name? ')
print('Welcome ' + Character_name + ' to the RPG.')
Help = input('(type help to look at the list of commands.)')
print(Character_name + ' finds a long deep cave.')

if Help == 'help':
  print('[quit, help, status, explore, flee, attack]')

while X == 1:
  Command = input('What does ' + Character_name + ' do? ')
  if Help == 'help':
    print('[quit, help, status, explore, flee, attack]')
  if Command == 'quit':
    print('ok goodbye ' + Character_name + '. We hope to see you again.')
  elif Command == 'status':
    print(Character_name + '\'s health is' + health)
  elif Command == 'explore':
    Encounter = random.choice(encounter)
    if Encounter == 1:
      print(Character_name + ' explores a path in the cave finding nothing.')

    while Encounter == 2:
      creatures = ['wolf' , 'goblin' , 'wyvern']
      Creatures = random.choice(creatures)
      print(Character_name + ' explores a path finding a ' + Creatures)
      attack_avoid = input('what does ' + Character_name + ' do. They can flee or attack. ')
      while attack_avoid == 'flee':
        Flee = random.choice(flee_chance)
        if Flee == 1:
          print('The ' + Creatures + ' follow you. ')
          attack_avoid = input('what does ' + Character_name + ' do. They can flee or attack. ')
        elif Flee == 2:
          print(Character_name + ' avoids the ' + Creatures + '.')
          break
      while attack_avoid == 'attack':
        creature_health = 50
        miss_hit = [1 , 2]
        Miss_Hit = random.choice(miss_hit)
        if Miss_Hit == 1:
          damage = [1 , 2]
          Damage = random.choice(damage)
          if Damage == 1:
            print(Character_name + ' hits the ' + Creatures + ' killing it')
            print('this makes ' + Character_name + ' health increase.')
            break
          elif Damage == 2:
            print(Character_name + ' hits the ' + Creatures + '.')
            print('This does not kill the ' + Creatures + '.')
        while Miss_Hit == 2:
          print(Character_name + ' misses.')
          Health = health - 100
          print('the ' + Creatures + ' attacks ' + Character_name + ' putting him at ' + str(Health) + '.')
          attack_avoid = input('what does ' + Character_name + ' do. They can flee or attack. ')
          while Health == 0:
            print('YOU DIED')
            Reset = input('would you like to reset ' + Character_name)
            if Reset == 'yes':
              break
            elif Reset == 'no':
              sys.exit()
          while Health > 0:
            break
Fetching token
?