repl.it
@noobAtProgram/

Blind Man

Python

No description

fork
loading
Files
  • main.py
  • save.txt
  • world.txt
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
#Texto


import random
from time import sleep as s





#Defines a weapon
class Weapon:
  def __init__(self, name, damage, back_time, hit_percent):
    self.name = name
    self.damage = damage
    self.wait = back_time
    self.hitmiss = hit_percent

  #Running weapon function
  def run(self, enemy_health):
    hit = False
    prob = random.randint(1, 100)
    if prob < self.hitmiss:
      hit = True
    if hit == True:
      enemy_health = enemy_health - self.damage
      return enemy_health
    else:
      return enemy_health



#Defines an item (consumable)
class Item:
  def __init__(self, name, health_restore, mana_restore, agil_restore, sneak_restore, def_restore, attack_restore):
    self.health = health_restore
    self.mana = mana_restore
    self.agility = agil_restore
    self.sneak = sneak_restore
    self.defense = def_restore
    self.attack = attack_restore
  #Runs the item function restoring the different bars
  def run(self, health, tot_health, mana, tot_mana, agility, tot_agility, sneak, tot_sneak, defense, tot_defense, attack, tot_attack):
    health += self.health
    if health > tot_health:
      health = tot_health
    mana += self.mana
    if mana > tot_mana:
      mana = tot_mana
    agility += self.agility
    if agility > tot_agility:
      agility = tot_agility
    sneak += self.sneak
    if sneak > tot_sneak:
      sneak = tot_sneak
    defense += self.defense
    if defense > tot_defense:
      defense = tot_defense
    attack += self.attack
    if attack > tot_attack:
      attack = tot_attack
    return [health, mana, agility, sneak, defense, attack]



#Defines a class as in a person to choose from
class Class:
  def __init__(self, health, mana, agility, sneak, defense, attack):
    self.health = health
    self.mana = mana
    self.agility = agility
    self.sneak = sneak
    self.defense = defense
    self.attack = attack
  def addon(self, health, mana, agility, sneak, defense, attack):
    self.health += health
    self.mana += mana
    self.agility += agility
    self.sneak += sneak
    self.defense += defense
    self.attack += attack

  #Lol no run function here!

#Put all bars in a list to make a list for bars in the now, not total
#Ex. Dwarf = Class(yadayadayada)
#now_health = dwarf.health
#[].append(now_health)
#Everything starts out /10



#Defines a crystal (different from consumable. Increases your total bars)

class Crystal:
  #put stuff here
  def __init__(self, pHealth, pMana, pAgil, pSneak, pDefense, pAttack):
    self.health = pHealth
    self.mana = pMana
    self.agility = pAgil
    self.sneak = pSneak
    self.defense = pDefense
    self.attack = pAttack
  #No run function


Dwarf = Class(10, 5, 3, 2, 10, 7)
Mage = Class(10, 9, 6, 5, 5, 4)
Warrior = Class(10, 1, 5, 4, 5, 10)
Elf = Class(10, 7, 7, 7, 3, 4)
Assassin = Class(10, 4, 8, 10, 4, 4)

def intro():
  print("Welcome Texto...")
  s(2)
  print("Wake up...")
  s(1.5)
  print("You are our last hope...")
  s(1.5)
  print("...")
  s(1.5)
  print("Texto, wake up!")
  s(1.5)
  print("The world needs a new hero...")
  s(1.5)
  print("Only you can help us...")
  s(1.5)
  print("You are the only one left...")
  s(1.5)
  print("...who can hear me...")
  s(1.5)
  print("...your helper...")
  s(1.5)
  print("...you have become blind...")
  s(1.5)
  print("...because of the great sorcerer...")
  s(1.5)
  print("...who took over this world...")
  s(1.5)
  print("And I am your headset...")
  s(1.5)
  print("...so I can help you...")



commands = {

'help': 1,
'w': 2,
'a': 3,
's': 4,
'd': 5,
'f': 2,
'l': 3,
'b': 4,
'r': 5,
'forward': 2,
'left': 3,
'backward': 4,
'right': 5,
'fight': 6,
'use': 7,
'inventory': 8,
'i': 8,
'take': 9,
'q': 10,
'quit': 10
}


intro()

Fetching token
?