import random
import copy
f = "Выбирайте только 1 или 2"
print("\x1b[30mДОБРО ПОЖАЛОВАТЬ!\x1b[0m")
print("\x1b[31m", f, "\x1b[0m")
print("\x1b[32m", f, "\x1b[0m")
print("\x1b[33m", f, "\x1b[0m")
print("\x1b[34m", f, "\x1b[0m")
print("\x1b[90m", f, "\x1b[0m")
print("\x1b[91m", f, "\x1b[0m")
print("\x1b[0m", f, "\x1b[0m")
print("\x1b[4m", f, "\x1b[0m")
print("\x1b[3m", f, "\x1b[0m")
print("\x1b[1m", f, "\x1b[0m")
print("\x1b[97m", f, "\x1b[0m")
print("\x1b[96m", f, "\x1b[0m")
print("\x1b[95m", f, "\x1b[0m")
print("\x1b[92m", f, "\x1b[0m")
print("\x1b[93m", f, "\x1b[0m")
x = 0
y = 0
i = '\033[92m|\033[0m'
i_2 = '\033[92m-\033[0m'
at_noDEF = None
Name_1 = "sasha"
Name_2 = "Pahaa" # Имя 2 соперника
Pl_input = None # Введеное значение
AT = [0,0,0,5,2] # Атакуещие характеристики (мин урон,макс урон,точность атаки в %,критический удар,коэф крит удара)
AT_DF = (0,0) # шанс повредить броню (% на -1 DEF, % на -2 DEF)
DEF = [0] # (броня уменьшает урон на то значение что имеет, % шанса разрушить 1 броню врагу,% шанса разрушить 2 брони)
AGI = [0,0,2] # уклон (шанс уклона в %,шанс в % контроатаковать если уклон удался, коэф контр)
AT_1 = [0,0,0,5,2] # у второго персонажа
AT_DF_1 = (0,0) # у второго персонажа
DEF_1 = [0] # у второго персонажа
AGI_1 = [0,0,2] # у второго персонажа
LIFE_1 = 0 # у второго персонажа
LIFE = 0 # жизнь
at = 0 # единоразовый урон
Energy = [0,0,0] # энергия игрока 1, прибавка манны за ход, максимальное количество энергии
Energy_1 = [0,0,0] # энергия игрока 2, прибавка манны за ход,максимальное количество энергии
rand_AT = [0,0,0,0,0] # рандом
rand_DEF = [0] # рандом
rand_AGI = [0,0,0] # рандом
rand_LIFE = 0 # рандом
rand_Energy = [0,0,0] # рандом
player_inoy = None
copy_pl1 = copy.copy(LIFE)
copy_pl2 = copy.copy(LIFE_1)
player_1 = [Name_1,Name_2,AT,AT_DF,DEF,AGI,LIFE,Energy,copy_pl1]# - Игрок 1
player_2 = [Name_2,Name_1,AT_1,AT_DF_1,DEF_1,AGI_1,LIFE_1,Energy_1,copy_pl2]# - Игрок 2
warrior = [player_1,player_2]
print("\x1b[96m", player_1[0], "\x1b[0m")
print("\x1b[93m", player_2[0], "\x1b[0m")
def Player_input_class():
for player in warrior:
if player==player_1:
print("\x1b[96m", player_1[0], "\x1b[0m","вам необходимо настроить своего бойца")
print("\x1b[93m",player_2[0],"\x1b[0mне должен видеть что вы ему приготовили")
print("\x1b[96m", player_1[0], "\x1b[0m","Вы готовы?")
if player==player_2:
print("\x1b[93m", player_2[0], "\x1b[0m","вам необходимо настроить своего бойца")
print("\x1b[96m",player_1[0],"\x1b[0mне должен видеть что вы ему приготовили")
print("\x1b[93m", player_2[0], "\x1b[0m","Вы готовы?")
while True:
try:
Pl_input = int(input("1 - да 2 - незнаю....:"))
if Pl_input == 1:
class_game (player)
random_point(player)
weapon(player)
bron(player)
info(player)
while True:
try:
Pl_input = int(input("1 - оставить 2 - переделать все с самого начала:"))
if Pl_input == 1:
print("\n"*60)
break
elif Pl_input == 2:
break
else:
print ("нажмите 1 или 2")
except ValueError:
print("нажмите 1 или 2")
if Pl_input== 1:
break
player[2][0]=0
player[2][1]=0
player[2][2]=0
player[2][3]=5
player[2][4]=2
player[4][0]=0
player[5][0]=0
player[5][1]=0
player[5][2]=2
player[6]=0
player[7][0]=0
player[7][1]=0
player[7][2]=0
else:
print ("подумайте еще немного")
except ValueError:
print("подумайте еще немного")
def bron(player):
print ("","",i_2*65,"\n",i,"\x1b[31m № БРОНИ \x1b[0m",i, "ЖИЗ","",i,"УКЛ",i,"ЗАЩ",i,"кКР","",i,"кКА",i)
print ("","",i_2*65,"\n",i,"\x1b[31mНАЖМИТЕ 1\x1b[0m",i, " 50 ","",i," 4% ",i," 10 ",i," 1 ","",i," 1 ",i)
print ("","",i_2*65,"\n",i,"\x1b[31mНАЖМИТЕ 2\x1b[0m",i, " 50 ","",i," 7% ",i," 5 ",i," 0.7 ","",i," 0.7 ",i)
print ("","",i_2*65,"\n",i,"\x1b[31mНАЖМИТЕ 3\x1b[0m",i, " 100 ","",i," 2% ",i," 5 ",i," 0.7 ","",i," 0.7 ",i)
print ("","",i_2*65,"\n",i,"\x1b[31mНАЖМИТЕ 4\x1b[0m",i, " 50 ","",i," 2% ",i," 20 ",i," 0.7 ","",i," 0.7 ",i)
print ("","",i_2*65,"\n",i,"\x1b[31mНАЖМИТЕ 5\x1b[0m",i, " -25 ","",i," 10% ",i," -5 ",i," 0.5 ","",i," 0.5 ",i)
print ("","",i_2*65,"\n",i,"\x1b[31mНАЖМИТЕ 6\x1b[0m",i, " 200 ","",i," -2% ",i," -5 ",i," 0.5 ","",i," 0.5 ",i)
print ("","",i_2*65,"\n",i,"\x1b[31mНАЖМИТЕ 7\x1b[0m",i, " -25 ","",i," -2% ",i," 30 ",i," 0.5 ","",i," 0.5 ",i,"\n","","",i_2*65)
print("\n","Выберете броню")
while True:
try:
info(player)
Pl_input_class_game = int(input("1 - 7 :"))
if Pl_input_class_game<1:
print ("ведите значение от 1 до 7")
elif Pl_input_class_game>7:
print ("ведите значение от 1 до 7")
elif Pl_input_class_game == 1:
player[6]=player[6]+50
player[5][0]=player[5][0]+4
player[4][0]=player[4][0]+10
player[2][4]=player[2][4]+1
player[5][2]=player[5][2]+1
break
elif Pl_input_class_game == 2:
player[6]=player[6]+50
player[5][0]=player[5][0]+7
player[4][0]=player[4][0]+5
player[2][4]=player[2][4]+0.7
player[5][2]=player[5][2]+0.7
break
elif Pl_input_class_game == 3:
player[6]=player[6]+100
player[5][0]=player[5][0]+2
player[4][0]=player[4][0]+5
player[2][4]=player[2][4]+0.7
player[5][2]=player[5][2]+0.7
break
elif Pl_input_class_game == 4:
player[6]=player[6]+50
player[5][0]=player[5][0]+2
player[4][0]=player[4][0]+20
player[2][4]=player[2][4]+0.7
player[5][2]=player[5][2]+0.7
break
elif Pl_input_class_game == 5:
player[6]=player[6]-25
player[5][0]=player[5][0]+10
player[4][0]=player[4][0]-5
player[2][4]=player[2][4]+0.5
player[5][2]=player[5][2]+0.5
break
elif Pl_input_class_game == 6:
player[6]=player[6]+200
player[5][0]=player[5][0]-2
player[4][0]=player[4][0]-5
player[2][4]=player[2][4]+0.5
player[5][2]=player[5][2]+0.5
break
elif Pl_input_class_game == 7:
player[6]=player[6]-25
player[5][0]=player[5][0]-2
player[4][0]=player[4][0]+30
player[2][4]=player[2][4]+0.5
player[5][2]=player[5][2]+0.5
break
except ValueError:
print("введите значение от 1 до 7")
def weapon(player):
input("нажмите Enter")
print ("","",i_2*65,"\n",i,"\x1b[31m№ ОРУЖИЯ\x1b[0m",i, "МИН","",i,"МАК",i,"ТОЧ",i,"КРТ","",i,"кАТ",i)
print ("","",i_2*65,"\n",i,"\x1b[31mНАЖМИТЕ 1\x1b[0m",i, " 50 ","",i," 100 ",i," 95% ",i," 10% ","",i," 20% ",i)
print ("","",i_2*65,"\n",i,"\x1b[31mНАЖМИТЕ 2\x1b[0m",i, " 1 ","",i," 150 ",i," 95% ",i," 10% ","",i," 20% ",i)
print ("","",i_2*65,"\n",i,"\x1b[31mНАЖМИТЕ 3\x1b[0m",i, " 75 ","",i," 75 ",i," 95% ",i," 10% ","",i," 20% ",i)
print ("","",i_2*65,"\n",i,"\x1b[31mНАЖМИТЕ 4\x1b[0m",i, " 70 ","",i," 140 ",i," 75% ",i," 10% ","",i," 20% ",i)
print ("","",i_2*65,"\n",i,"\x1b[31mНАЖМИТЕ 5\x1b[0m",i, " 10 ","",i," 210 ",i," 75% ",i," 10% ","",i," 20% ",i)
print ("","",i_2*65,"\n",i,"\x1b[31mНАЖМИТЕ 6\x1b[0m",i, " 105 ","",i," 105 ",i," 75% ",i," 10% ","",i," 20% ",i)
print ("","",i_2*65,"\n",i,"\x1b[31mНАЖМИТЕ 7\x1b[0m",i, " 90 ","",i," 180 ",i," 55% ",i," 10% ","",i," 20% ",i)
print ("","",i_2*65,"\n",i,"\x1b[31mНАЖМИТЕ 8\x1b[0m",i, " 20 ","",i," 270 ",i," 55% ",i," 10% ","",i," 20% ",i)
print ("","",i_2*65,"\n",i,"\x1b[31mНАЖМИТЕ 9\x1b[0m",i, " 135 ","",i," 135 ",i," 55% ",i," 10% ","",i," 20% ",i)
print ("","",i_2*65,"\n",i,"\x1b[31mНАЖМИТЕ 10\x1b[0m",i," 40 ","",i," 85 ",i," 95% ",i," 20% ","",i," 40% ",i)
print ("","",i_2*65,"\n",i,"\x1b[31mНАЖМИТЕ 11\x1b[0m",i," 1 ","",i," 130 ",i," 95% ",i," 20% ","",i," 40% ",i)
print ("","",i_2*65,"\n",i,"\x1b[31mНАЖМИТЕ 12\x1b[0m",i," 62 ","",i," 62 ",i," 95% ",i," 20% ","",i," 40% ",i)
print ("","",i_2*65,"\n",i,"\x1b[31mНАЖМИТЕ 13\x1b[0m",i," 58 ","",i," 121 ",i," 75% ",i," 20% ","",i," 40% ",i)
print ("","",i_2*65,"\n",i,"\x1b[31mНАЖМИТЕ 14\x1b[0m",i," 4 ","",i," 184 ",i," 75% ",i," 20% ","",i," 40% ",i)
print ("","",i_2*65,"\n",i,"\x1b[31mНАЖМИТЕ 15\x1b[0m",i," 89 ","",i," 89 ",i," 75% ",i," 20% ","",i," 40% ",i)
print ("","",i_2*65,"\n",i,"\x1b[31mНАЖМИТЕ 16\x1b[0m",i," 76 ","",i," 157 ",i," 55% ",i," 20% ","",i," 40% ",i)
print ("","",i_2*65,"\n",i,"\x1b[31mНАЖМИТЕ 17\x1b[0m",i," 13 ","",i," 238 ",i," 55% ",i," 20% ","",i," 40% ",i)
print ("","",i_2*65,"\n",i,"\x1b[31mНАЖМИТЕ 18\x1b[0m",i,"121 ","",i," 121 ",i," 55% ",i," 20% ","",i," 40% ",i,"\n","","",i_2*65)
print("\n","Выберете оружие")
while True:
try:
info(player)
Pl_input_class_game = int(input("1 - 18 :"))
if Pl_input_class_game<1:
print ("ведите значение от 1 до 18")
elif Pl_input_class_game>18:
print ("ведите значение от 1 до 18")
elif Pl_input_class_game == 1:
player[2][0]=player[2][0]+50
player[2][1]=player[2][1]+100
player[2][2]=player[2][2]+95
player[2][3]=player[2][3]+10
player[5][1]=player[5][1]+20
break
elif Pl_input_class_game == 2:
player[2][0]=player[2][0]+1
player[2][1]=player[2][1]+150
player[2][2]=player[2][2]+95
player[2][3]=player[2][3]+10
player[5][1]=player[5][1]+20
break
elif Pl_input_class_game == 3:
player[2][0]=player[2][0]+75
player[2][1]=player[2][1]+75
player[2][2]=player[2][2]+95
player[2][3]=player[2][3]+10
player[5][1]=player[5][1]+20
break
elif Pl_input_class_game == 4:
player[2][0]=player[2][0]+70
player[2][1]=player[2][1]+140
player[2][2]=player[2][2]+75
player[2][3]=player[2][3]+10
player[5][1]=player[5][1]+20
break
elif Pl_input_class_game == 5:
player[2][0]=player[2][0]+10
player[2][1]=player[2][1]+210
player[2][2]=player[2][2]+75
player[2][3]=player[2][3]+10
player[5][1]=player[5][1]+20
break
elif Pl_input_class_game == 6:
player[2][0]=player[2][0]+105
player[2][1]=player[2][1]+105
player[2][2]=player[2][2]+75
player[2][3]=player[2][3]+10
player[5][1]=player[5][1]+20
break
elif Pl_input_class_game == 7:
player[2][0]=player[2][0]+90
player[2][1]=player[2][1]+180
player[2][2]=player[2][2]+55
player[2][3]=player[2][3]+10
player[5][1]=player[5][1]+20
break
elif Pl_input_class_game == 8:
player[2][0]=player[2][0]+20
player[2][1]=player[2][1]+270
player[2][2]=player[2][2]+55
player[2][3]=player[2][3]+10
player[5][1]=player[5][1]+20
break
elif Pl_input_class_game == 9:
player[2][0]=player[2][0]+135
player[2][1]=player[2][1]+135
player[2][2]=player[2][2]+55
player[2][3]=player[2][3]+10
player[5][1]=player[5][1]+20
break
elif Pl_input_class_game == 10:
player[2][0]=player[2][0]+40
player[2][1]=player[2][1]+85
player[2][2]=player[2][2]+95
player[2][3]=player[2][3]+20
player[5][1]=player[5][1]+40
break
elif Pl_input_class_game == 11:
player[2][0]=player[2][0]+1
player[2][1]=player[2][1]+130
player[2][2]=player[2][2]+95
player[2][3]=player[2][3]+20
player[5][1]=player[5][1]+40
break
elif Pl_input_class_game == 12:
player[2][0]=player[2][0]+62
player[2][1]=player[2][1]+62
player[2][2]=player[2][2]+95
player[2][3]=player[2][3]+20
player[5][1]=player[5][1]+40
break
elif Pl_input_class_game == 13:
player[2][0]=player[2][0]+58
player[2][1]=player[2][1]+121
player[2][2]=player[2][2]+75
player[2][3]=player[2][3]+20
player[5][1]=player[5][1]+40
break
elif Pl_input_class_game == 14:
player[2][0]=player[2][0]+4
player[2][1]=player[2][1]+184
player[2][2]=player[2][2]+75
player[2][3]=player[2][3]+20
player[5][1]=player[5][1]+40
break
elif Pl_input_class_game == 15:
player[2][0]=player[2][0]+89
player[2][1]=player[2][1]+89
player[2][2]=player[2][2]+75
player[2][3]=player[2][3]+20
player[5][1]=player[5][1]+40
break
elif Pl_input_class_game == 16:
player[2][0]=player[2][0]+76
player[2][1]=player[2][1]+157
player[2][2]=player[2][2]+55
player[2][3]=player[2][3]+20
player[5][1]=player[5][1]+40
break
elif Pl_input_class_game == 1:
player[2][0]=player[2][0]+13
player[2][1]=player[2][1]+238
player[2][2]=player[2][2]+55
player[2][3]=player[2][3]+20
player[5][1]=player[5][1]+40
break
elif Pl_input_class_game == 1:
player[2][0]=player[2][0]+121
player[2][1]=player[2][1]+121
player[2][2]=player[2][2]+55
player[2][3]=player[2][3]+20
player[5][1]=player[5][1]+40
break
except ValueError:
print("введите значение от 1 до 18")
def random_point(player):
x=3
info(player)
while x>0:
if player==player_1:
print("\x1b[96m", player_1[0], "\x1b[0m","прокрутите рандомные доп.характеристики")
print("\x1b[96m", player_1[0], "\x1b[0m","у вас осталось","\x1b[92m", x, "\x1b[0m","попытка(и)")
if player==player_2:
print("\x1b[93m", player_2[0], "\x1b[0m","прокрутите рандомные доп.характеристики")
print("\x1b[93m", player_2[0], "\x1b[0m","у вас осталось","\x1b[92m", x, "\x1b[0m","попытка(и)")
try:
Pl_input_random = int(input("крутим? 1 - да 2 - нет : "))
if Pl_input_random > 2:
print (" введите значение от 1 до 2: ")
elif Pl_input_random < 1:
print (" введите значение от 1 до 2: ")
except ValueError:
print(" введите целое числовое значение")
if Pl_input_random==1:
rand_AT[0]=random.randint(1, 5)
rand_AT[1]=random.randint(5, 10)
rand_LIFE=random.randint(10, 100)
rand_AT[2]=random.randint(1, 10)
rand_AT[3]=random.randint(0, 10)
rand_AT[4]=(random.randint(0, 10)/10)
rand_AGI[0]=random.randint(0, 10)
rand_AGI[1]=random.randint(0, 10)
rand_AGI[2]=(random.randint(0, 10)/10)
rand_DEF[0]=random.randint(0, 10)
rand_Energy[0]=random.randint(0, 10)
rand_Energy[2]=rand_Energy[0]
rand_Energy[1]=random.randint(0, 1)
if player==player_1:
print ("","",i_2*130,"\n",i,"\x1b[96m", player[0], "\x1b[0m",i,'Жс'"\x1b[92m", rand_LIFE, "\x1b[0m","",i,"ат",rand_AT[0],'-',rand_AT[1],i,"т",
rand_AT[2],'%',i,"кр",rand_AT[3],"%(к.",rand_AT[4],")",i,"зщ",rand_DEF[0],"",i,"ук",rand_AGI[0],"%",i,"ка",rand_AGI[1],"%(к.",rand_AGI[2],")",i,"ϟ ",rand_Energy[0],"/",rand_Energy[2],"+",rand_Energy[1],"/х",i,"\n",i_2*130)
if player==player_2:
print ("","",i_2*130,"\n",i,"\x1b[93m", player[0], "\x1b[0m",i,'Жс'"\x1b[92m", rand_LIFE, "\x1b[0m","",i,"ат",rand_AT[0],'-',rand_AT[1],i,"т",
rand_AT[2],'%',i,"кр",rand_AT[3],"%(к.",rand_AT[4],")",i,"зщ",rand_DEF[0],"",i,"ук",rand_AGI[0],"%",i,"ка",rand_AGI[1],"%(к.",rand_AGI[2],")",i,"ϟ ",rand_Energy[0],"/",rand_Energy[2],"+",rand_Energy[1],"/х",i,"\n",i_2*130)
try:
Pl_input_random = int(input("1 - оставляем 2 - крутим дальше : "))
if Pl_input_random > 2:
print (" введите значение от 1 до 2: ")
elif Pl_input_random < 1:
print (" введите значение от 1 до 2: ")
except ValueError:
print(" введите целое числовое значение")
if Pl_input_random ==1:
player[2][0]=player[2][0]+rand_AT[0]
player[2][1]=player[2][1]+rand_AT[1]
player[6]=player[6]+rand_LIFE
player[2][2]=player[2][2]+rand_AT[2]
player[2][3]=player[2][3]+rand_AT[3]
player[2][4]=player[2][4]+rand_AT[4]
player[5][0]=player[5][0]+rand_AGI[0]
player[5][1]=player[5][1]+rand_AGI[1]
player[5][2]=player[5][2]+rand_AGI[2]
player[4][0]=player[4][0]+rand_DEF[0]
player[7][0]=rand_Energy[0]+player[7][0]
player[7][2]=rand_Energy[2]+player[7][2]
player[7][1]=rand_Energy[1]+player[7][1]
break
else:
x=x-1
if x==0:
player[2][0]=player[2][0]+rand_AT[0]
player[2][1]=player[2][1]+rand_AT[1]
player[6]=player[6]+rand_LIFE
player[2][2]=player[2][2]+rand_AT[2]
player[2][3]=player[2][3]+rand_AT[3]
player[2][4]=player[2][4]+rand_AT[4]
player[5][0]=player[5][0]+rand_AGI[0]
player[5][1]=player[5][1]+rand_AGI[1]
player[5][2]=player[5][2]+rand_AGI[2]
player[4][0]=player[4][0]+rand_DEF[0]
player[7][0]=rand_Energy[0]+player[7][0]
player[7][2]=rand_Energy[2]+player[7][2]
player[7][1]=rand_Energy[1]+player[7][1]
info(player)
def class_game (player):
print ("","",i_2*110,"\n",i,"\x1b[31m№ПОЗИЦИИ\x1b[0m",i, " КЛАСС ","",i,"АТАКА",i,"ЗАЩИТА",i," ЖС ","",i,"УКЛОН",i," ЭНЕРГИЯ ",i)
print ("","",i_2*110,"\n",i,"\x1b[31mНАЖМИТЕ 1\x1b[0m",i," Берсерк","",i," +50 ",i," +20 ",i," 1300 ","",i," 40% ",i,"100%+10/ход ",i)
print ("","",i_2*110,"\n",i,"\x1b[31mНАЖМИТЕ 2\x1b[0m",i," Рыцарь ","",i," +30 ",i," +50 ",i," 1400 ","",i," 10% ",i,"120%+12/ход ",i)
print ("","",i_2*110,"\n",i,"\x1b[31mНАЖМИТЕ 3\x1b[0m",i," Мечник ","",i," +40 ",i," +10 ",i," 1500 ","",i," 20% ",i,"130%+13/ход ",i)
print ("","",i_2*110,"\n",i,"\x1b[31mНАЖМИТЕ 4\x1b[0m",i," Ассасин","",i," +20 ",i," +30 ",i," 1100 ","",i," 50% ",i,"140%+14/ход ",i)
print ("","",i_2*110,"\n",i,"\x1b[31mНАЖМИТЕ 5\x1b[0m",i," Ученый ","",i," +10 ",i," +40 ",i," 1200 ","",i," 30% ",i,"150%+15/ход ",i)
print ("","",i_2*110,"\n",i,"\x1b[31mНАЖМИТЕ 6\x1b[0m",i," ГБХмен ","",i," +10 ",i," +10 ",i," 1100 ","",i," 10% ",i,"100%+10/ход ",i,"\n","",i_2*110)
print("\n","Выберете класс за который хотите играть")
while True:
try:
Pl_input_class_game = int(input("1 - 6 :"))
if Pl_input_class_game<1:
print ("ведите значение от 1 до 6")
elif Pl_input_class_game>6:
print ("ведите значение от 1 до 6")
elif Pl_input_class_game == 1:
player[2][0]=50
player[2][1]=50
player[4][0]=20
player[6]=1300
player[5][0]=40
player[7][0]=100
player[7][1]=10
player[7][2]=100
break
elif Pl_input_class_game == 2:
player[2][0]=30
player[2][1]=30
player[4][0]=50
player[6]=1400
player[5][0]=10
player[7][0]=120
player[7][1]=12
player[7][2]=120
break
elif Pl_input_class_game == 3:
player[2][0]=40
player[2][1]=40
player[4][0]=10
player[6]=1500
player[5][0]=20
player[7][0]=130
player[7][1]=13
player[7][2]=130
break
elif Pl_input_class_game == 4:
player[2][0]=20
player[2][1]=20
player[4][0]=30
player[6]=1100
player[5][0]=50
player[7][0]=140
player[7][1]=14
player[7][2]=140
break
elif Pl_input_class_game == 5:
player[2][0]=10
player[2][1]=10
player[4][0]=40
player[6]=1200
player[5][0]=30
player[7][0]=150
player[7][1]=15
player[7][2]=150
break
elif Pl_input_class_game == 6:
player[2][0]=10
player[2][1]=10
player[4][0]=10
player[6]=1100
player[5][0]=10
player[7][0]=110
player[7][1]=11
player[7][2]=110
break
except ValueError:
print("введите значение от 1 до 6")
def info(player):
print("ваши характеристики:")
if player==player_1:
print ("","",i_2*130,"\n",i,"\x1b[96m", player[0], "\x1b[0m",i,'Жс'"\x1b[92m", player[6], "\x1b[0m","",i,"ат",player[2][0],'-',player[2][1],i,"т",
player[2][2],'%',i,"кр",player[2][3],"%(*",player[2][4],")",i,"зщ",player[4][0],"",i,"ук",player[5][0],"%",i,"ка",player[5][1],"%(*",player[5][2],")",i,"ϟ ",player[7][0],"/",player[7][2],"+",player[7][1],"/х",i,"\n",i_2*130)
if player==player_2:
print ("","",i_2*130,"\n",i,"\x1b[93m", player[0], "\x1b[0m",i,'Жс'"\x1b[92m", player[6], "\x1b[0m","",i,"ат",player[2][0],'-',player[2][1],i,"т",
player[2][2],'%',i,"кр",player[2][3],"%(*",player[2][4],")",i,"зщ",player[4][0],"",i,"ук",player[5][0],"%",i,"ка",player[5][1],"%(*",player[5][2],")",i,"ϟ ",player[7][0],"/",player[7][2],"+",player[7][1],"/х",i,"\n",i_2*130)
def Player_input_name(): # Проверка на корректность вводимого значения
for player in warrior:
while True:
if player==player_1:
print("введите имя","\x1b[96mпервого игрока\x1b[0m")
elif player==player_2:
print("введите имя","\x1b[93mвторого игрока\x1b[0m")
player[0]=str(input(" вы ввели : "))
if len(player[0]) > 5:
print ("введите имя от 2 до 5 символов. ")
elif len(player[0]) < 2:
print ("введите имя от 2 до 5 символов. ")
else:
if player==player_1:
print("ваше имя ","\x1b[96m", player[0], "\x1b[0m","?")
else:
print("ваше имя ","\x1b[93m", player[0], "\x1b[0m","?")
try:
Pl_input = int(input("1 - да 2 - нет: "))
if Pl_input > 3:
print ("введите только 1 - да или 2 - нет: ")
elif Pl_input < 1:
print ("введите только 1 - да или 2 - нет: ")
else:
break
except ValueError:
print ("введите только 1 - да или 2 - нет: ")
def color_life_player_1(): # - цветная таблица
for pl in warrior:
print ("","",i_2*130,"\n",i,pl[0],i,'Жс'"\x1b[92m", pl[6], "\x1b[0m","",i,"ат",pl[2][0],'-',pl[2][1],i,"т",
pl[2][2],'%',i,"кр",pl[2][3],"%",i,"зщ",pl[4][0],"",i,"ук",pl[5][0],"%",i,"ка",pl[5][1],"%",i,"ϟ ",pl[7][0],"/",pl[7][2],"+",pl[7][1],"/х",i)
def test():
if player==player_1:
print(" \x1b[96m", player_1[0], "\x1b[0m"," (точ =",player_1[2][2],"%) промахнулся и не смог попасть по \x1b[93m", player_2[0], "\x1b[0m")
else:
print(" \x1b[93m", player_2[0], "\x1b[0m"," (точ =",player_2[2][2],"%) промахнулся и не смог попасть по \x1b[96m", player_1[0], "\x1b[0m")
def test_2(ran_2): # цвет на урон
if player==player_1:
print(" (точ =",player_1[2][2],"%)\x1b[96m", player_1[0], "\x1b[0m","ударил на\x1b[31m", ran_2, "\x1b[0mединиц(ы) урона по \x1b[93m", player_2[0], "\x1b[0m")
else:
print(" (точ =",player_2[2][2],"%)\x1b[93m", player_2[0], "\x1b[0m","ударил на\x1b[31m", ran_2, "\x1b[0mединиц(ы) урона по \x1b[96m", player_1[0], "\x1b[0m")
def test_3(at_noDEF,at): # цвет на броню
if player==player_1:
print(" благодаря броне\x1b[93m", player_2[0], "\x1b[0mурон уменьшен до\x1b[31m", at_noDEF, "\x1b[0m-(броня =\x1b[34m", player_2[4][0],
"\x1b[0m",") =","\x1b[31m", at, "\x1b[0mединиц(ы)")
else:
print(" благодаря броне\x1b[96m", player_1[0], "\x1b[0mурон уменьшен до\x1b[31m", at_noDEF, "\x1b[0m-(броня =\x1b[34m", player_1[4][0],
"\x1b[0m",") =","\x1b[31m", at, "\x1b[0mединиц(ы)")
def test_4(): # ????
if player==player_1:
print(" (укл =",player_inoy[5][0],"%)\x1b[93m", player_2[0], "\x1b[0m"," не смог увернутся")
else:
print(" (укл =",player_inoy[5][0],"%)\x1b[96m", player_1[0], "\x1b[0m"," не смог увернутся")
def test_5(): # Промах цвет
if player==player_1:
print(" \x1b[93m", player_2[0], "\x1b[0m"," (точ =",player_2[2][2],"%) промахнулся и не смог попасть по \x1b[93m", player_1[0], "\x1b[0m")
else:
print(" \x1b[96m", player_1[0], "\x1b[0m"," (точ =",player_1[2][2],"%) промахнулся и не смог попасть по \x1b[96m", player_2[0], "\x1b[0m")
def ataka(player,player_inoy,at): # функция просчитывает поведение атаки
ran_1 = random.randint(0, 100) # рандомное число от 0 до 100
if ran_1 > player[2][2]:
test()
at = 0
return at # Возвращаем урон = 0
else:
ran_2 = random.randint(player[2][0], player[2][1]) # Рассчитываем урон от минимального до максимального
test_2(ran_2) # Показываем удар
if agi () == True: # Проверка на уклон соперника
at_noDEF = ran_2 # Если уклон не удался то проходит урон
ran_3 = random.randint(0, 100)
if ran_3<=player[2][3]:
at_noDEF = at_noDEF*player[2][4]
print(" (крт =",player[2][3],"%)\x1b[31mКРИТ!!!\x1b[0m","(\x1b[31m",ran_2,"\x1b[0m*",player[2][4],"коэф =","\x1b[31m",at_noDEF,"\x1b[0m",')')
at = at_noDEF - player_inoy[4][0]
test_3(at_noDEF,at)
return at
else:
if player_inoy[4][0]>at_noDEF:
at=0
test_3(at_noDEF,at)
return at
else:
at = at_noDEF - player_inoy[4][0]
test_3(at_noDEF,at)
return at
else:
at = 0
return at # Возвращаем урон ra_2
def agi (): # Проверяем смог ли увернутся атакуемый игрок
ran_1 = random.randint(0, 100) # рандомное число от 0 до 100
if ran_1 > player_inoy[5][0]: # сама проверка
test_4() # не фартануло
return True
else:
if player==player_1:
print(" (укл =",player_2[5][0],"%) но\x1b[93m", player_2[0],"\x1b[0m","смог увернутся") # смог!
else:
print(" (укл =",player_1[5][0],"%) но\x1b[96m", player_1[0],"\x1b[0m","смог увернутся")
agi_at()
return False
def agi_at (): # Проверка на контроатаку атакующего игрока в случае успеха
ran_1 = random.randint(0, 100) # рандомное число от 0 до 100
if ran_1 <= player_inoy[5][1]: # сама проверка
ran_2 = (random.randint(player_inoy[2][0], player_inoy[2][1]))*player_inoy[5][2] # контраатака помноженная на коэфицент
at_contr = ran_2
ran_3 = random.randint(0, 100)
if ran_3 > player_inoy[2][2]:
if player==player_1:
print(" (точ =",player_2[2][2],"%) и даже контратаковал","\x1b[96m", player_1[0],"\x1b[0m","но промахнулся")
else:
print(" (точ =",player_1[2][2],"%) и даже контратаковал","\x1b[93m", player_2[0],"\x1b[0m","но промахнулся")
else:
if player==player_1:
print(" и удачно контратаковал\x1b[96m", player_1[0],"\x1b'\x1b[0mна\x1b'\x1b[31m", at_contr, "\x1b[0mединиц(ы) урона.")
else:
print(" и удачно контратаковал\x1b[93m", player_2[0],"\x1b'\x1b[31m", at_contr, "\x1b[0mединиц(ы) урона.")
if player==player_1:
if player[4][0]>at_contr:
at_contr = 0
print(" благодаря броне","\x1b[96m", player[0], "\x1b[0m"," урон уменьшен на ","\x1b[31m", ran_2, "\x1b[0m","-(броня =\x1b[34m", player_inoy[4][0],
"\x1b[0m",") =","\x1b[31m", at_contr, "\x1b[0mединиц(ы)")
else:
at_contr = at_contr - player[4][0]
print(" благодаря броне","\x1b[96m", player[0], "\x1b[0m"," урон уменьшен на ","\x1b[31m", ran_2, "\x1b[0m","-(броня =\x1b[34m", player_inoy[4][0],
"\x1b[0m",") =","\x1b[31m", at_contr, "\x1b[0mединиц(ы)")
player[6] = player[6] - at_contr
else:
if player[4][0]>at_contr:
at_contr = 0
print(" благодаря броне","\x1b[93m", player[0], "\x1b[0m"," урон уменьшен на ","\x1b[31m", ran_2, "\x1b[0m","-(броня =\x1b[34m", player_inoy[4][0],
"\x1b[0m",") =","\x1b[31m", at_contr, "\x1b[0mединиц(ы)")
else:
at_contr = at_contr - player[4][0]
print(" благодаря броне","\x1b[93m", player[0], "\x1b[0m"," урон уменьшен на ","\x1b[31m", ran_2, "\x1b[0m","-(броня =\x1b[34m", player_inoy[4][0],
"\x1b[0m",") =","\x1b[31m", at_contr, "\x1b[0mединиц(ы)")
player[6] = player[6] - at_contr
def life (player):
if player[6] <= 0:
print(player[0],'\033[91m получил смертельную рану...жизни достигли нуля. Покойся с миром\033[0m')
def Player_input(Pl_input): # Проверка на корректность вводимого значения
while True:
try:
Pl_input = int(input(" Вы ввели : "))
if Pl_input > 3:
print (" введите значение от 1 до 3: ")
elif Pl_input < 1:
print (" введите значение от 1 до 3: ")
else:
return Pl_input
except ValueError:
print(" введите целое числовое значение")
def proverka_x(x):
if player==player_1:
if x==1:
player[5][0]=player[5][0]/1.3
player[5][1]=player[5][1]/1.3
player[4][0]=player[4][0]/1.3
x=x-1
return x
return x
def proverka_y(y):
if player==player_2:
if y==1:
player[5][0]=player[5][0]/1.3
player[5][1]=player[5][1]/1.3
player[4][0]=player[4][0]/1.3
y=y-1
return y
return y
def stroka_2(x,y):
if x ==1:
print ("","",i,player[0],i,'Жс', player[6],"",i,"ат",player[2][0],'-',player[2][1],i,"т",
player[2][2],'%',i,"кр",player[2][3],"%",i,"зщ",player[4][0],"",i,"ук",player[5][0],"%",i,"ка",player[5][1],"%",i,"ϟ ",player[7][0],"/",player[7][2],"+",player[7][1],i,"\n",i_2*130)
return
if y ==1:
print ("","",i,player[0],i,'Жс', player[6],"",i,"ат",player[2][0],'-',player[2][1],i,"т",
player[2][2],'%',i,"кр",player[2][3],"%",i,"зщ",player[4][0],"",i,"ук",player[5][0],"%",i,"ка",player[5][1],"%",i,"ϟ ",player[7][0],"/",player[7][2],"+",player[7][1],i,"\n",i_2*130)
return
print("~"*130)
print("*"*50,"\x1b[31mДОБРО ПОЖАЛОВАТЬ!\x1b[0m","*"*50)
print("~"*130)
Player_input_name()
Player_input_class()
while True:
for player in warrior:
x = proverka_x(x)
y = proverka_y(y)
stroka_2(x,y)
player_inoy = warrior[(warrior.index(player))-1]
if player==player_1:
print(' Игрок ',"\x1b[96m", player_1[0], "\x1b[0m","выберите действие")
else:
print(' Игрок ',"\x1b[93m", player_2[0], "\x1b[0m","выберите действие")
print(" \x1b[31m1 - Атаковать\x1b[0m"," \x1b[34m2 - защищаться (увел. уклон,контр.ат,броню на 30%)\x1b[0m"," \x1b[95m3 - предмет/умение\x1b[0m")
inp = Player_input(Pl_input)
if inp == 1:
at = ataka(player,player_inoy,at)
Damage = player_inoy[6]-at
player_inoy[6] = Damage
color_life_player_1()
print ("","",i_2*130)
life(player)
if x or y==1:
print("\n"," "*45,"\x1b[31mХарактеристики вернулись к базовым значениям!\x1b[0m")
print("","",i_2*130,"\n",'',i,player_inoy[0],i,'Жс', player_inoy[6],"",i,"ат",player_inoy[2][0],'-',player_inoy[2][1],i,"т",
player_inoy[2][2],'%',i,"кр",player_inoy[2][3],"%",i,"зщ",player_inoy[4][0]/1.3,"",i,"ук",player_inoy[5][0]/1.3,"%",i,"ка",player_inoy[5][1]/1.3,"%",i,"ϟ ",player_inoy[7][0],"/",player_inoy[7][2],"+",player_inoy[7][1],i,"\n",i_2*130)
elif inp == 2:
print("\n"," "*45,"\x1b[92mХарактеристики увеличены!\x1b[0m")
print ("","",i_2*130,"\n",'',i,player[0],i,'Жс', player[6],"",i,"ат",player[2][0],'-',player[2][1],i,"т",
player[2][2],'%',i,"кр",player[2][3],"%",i,"зщ",player[4][0],"+\x1b[92m", (player[4][0]*0.3), "\x1b[0m","",i,"ук",player[5][0],"% +\x1b[92m", (player[5][0]*0.3), "\x1b[0m",i,"ка",player[5][0],"% +\x1b[92m", (player[5][1]*0.3), "\x1b[0m",i,"ϟ ",player[7][0],"/",player[7][2],"+",player[7][1],i,"\n",i_2*130)
player[5][0]=player[5][0]*1.3
player[5][1]=player[5][1]*1.3
player[4][0]=player[4][0]*1.3
if player==player_1:
x=1
if player==player_2:
y=1
else:
print(ataka(player,player_inoy,at))