import random
import copy
Name_1=""
Name_2=""
x = 0
y = 0
i = '\033[92m|\033[0m'
i_2 = '\033[92m-\033[0m'
at_noDEF = None
Pl_input = None # Введеное значение
AT = [0,0,0,5,1] # Атакуещие характеристики (мин урон,макс урон,точность атаки в %,критический удар,коэф крит удара)
AT_DF = (0,0) # шанс повредить броню (% на -1 DEF, % на -2 DEF)
DEF = [10] # (броня уменьшает урон на то значение что имеет, % шанса разрушить 1 броню врагу,% шанса разрушить 2 брони)
AGI = [0,0,1] # уклон (шанс уклона в %,шанс в % контроатаковать если уклон удался, коэф контр)
AT_1 = [0,0,0,5,1] # у второго персонажа
AT_DF_1 = (0,0) # у второго персонажа
DEF_1 = [10] # у второго персонажа
AGI_1 = [0,0,1] # у второго персонажа
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*115,"\n",i,"\x1b[34mНАЖМИТЕ 1\x1b[0m",i, "ЖИЗ 50 ","",i,"УКЛ 4% ",i,"ЗАЩ 10 ",i,"коэф.КР 1 ","",i,"коэф.КА 1 ",i)
print ("","",i_2*115,"\n",i,"\x1b[34mНАЖМИТЕ 2\x1b[0m",i, "ЖИЗ 50 ","",i,"УКЛ 7% ",i,"ЗАЩ 5 ",i,"коэф.КР 0.7 ","",i,"коэф.КА 0.7 ",i)
print ("","",i_2*115,"\n",i,"\x1b[34mНАЖМИТЕ 3\x1b[0m",i, "ЖИЗ 100 ","",i,"УКЛ 2% ",i,"ЗАЩ 5 ",i,"коэф.КР 0.7 ","",i,"коэф.КА 0.7 ",i)
print ("","",i_2*115,"\n",i,"\x1b[34mНАЖМИТЕ 4\x1b[0m",i, "ЖИЗ 50 ","",i,"УКЛ 2% ",i,"ЗАЩ 20 ",i,"коэф.КР 0.7 ","",i,"коэф.КА 0.7 ",i)
print ("","",i_2*115,"\n",i,"\x1b[34mНАЖМИТЕ 5\x1b[0m",i, "ЖИЗ -25 ","",i,"УКЛ 10% ",i,"ЗАЩ -5 ",i,"коэф.КР 0.5 ","",i,"коэф.КА 0.5 ",i)
print ("","",i_2*115,"\n",i,"\x1b[34mНАЖМИТЕ 6\x1b[0m",i, "ЖИЗ 200 ","",i,"УКЛ -2% ",i,"ЗАЩ -5 ",i,"коэф.КР 0.5 ","",i,"коэф.КА 0.5 ",i)
print ("","",i_2*115,"\n",i,"\x1b[34mНАЖМИТЕ 7\x1b[0m",i, "ЖИЗ -25 ","",i,"УКЛ -2% ",i,"ЗАЩ 30 ",i,"коэф.КР 0.5 ","",i,"коэф.КА 0.5 ",i,"\n","","",i_2*115)
print("\n","Выберете ","\x1b[34mБРОНЮ\x1b[0m")
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*115,"\n",i,"\x1b[31mНАЖМИТЕ 1\x1b[0m",i, "МИН.ур 50 ","",i,"МАК.ур 100 ",i,"ТОЧ 95% ",i,"КРТ 10% ","",i,"КА 20% ",i)
print ("","",i_2*115,"\n",i,"\x1b[31mНАЖМИТЕ 2\x1b[0m",i, "МИН.ур 1 ","",i,"МАК.ур 150 ",i,"ТОЧ 95% ",i,"КРТ 10% ","",i,"КА 20% ",i)
print ("","",i_2*115,"\n",i,"\x1b[31mНАЖМИТЕ 3\x1b[0m",i, "МИН.ур 75 ","",i,"МАК.ур 75 ",i,"ТОЧ 95% ",i,"КРТ 10% ","",i,"КА 20% ",i)
print ("","",i_2*115,"\n",i,"\x1b[31mНАЖМИТЕ 4\x1b[0m",i, "МИН.ур 70 ","",i,"МАК.ур 140 ",i,"ТОЧ 75% ",i,"КРТ 10% ","",i,"КА 20% ",i)
print ("","",i_2*115,"\n",i,"\x1b[31mНАЖМИТЕ 5\x1b[0m",i, "МИН.ур 10 ","",i,"МАК.ур 210 ",i,"ТОЧ 75% ",i,"КРТ 10% ","",i,"КА 20% ",i)
print ("","",i_2*115,"\n",i,"\x1b[31mНАЖМИТЕ 6\x1b[0m",i, "МИН.ур 105 ","",i,"МАК.ур 105 ",i,"ТОЧ 75% ",i,"КРТ 10% ","",i,"КА 20% ",i)
print ("","",i_2*115,"\n",i,"\x1b[31mНАЖМИТЕ 7\x1b[0m",i, "МИН.ур 90 ","",i,"МАК.ур 180 ",i,"ТОЧ 55% ",i,"КРТ 10% ","",i,"КА 20% ",i)
print ("","",i_2*115,"\n",i,"\x1b[31mНАЖМИТЕ 8\x1b[0m",i, "МИН.ур 20 ","",i,"МАК.ур 270 ",i,"ТОЧ 55% ",i,"КРТ 10% ","",i,"КА 20% ",i)
print ("","",i_2*115,"\n",i,"\x1b[31mНАЖМИТЕ 9\x1b[0m",i, "МИН.ур 135 ","",i,"МАК.ур 135 ",i,"ТОЧ 55% ",i,"КРТ 10% ","",i,"КА 20% ",i)
print ("","",i_2*115,"\n",i,"\x1b[31mНАЖМИТЕ 10\x1b[0m",i,"МИН.ур 40 ","",i,"МАК.ур 85 ",i,"ТОЧ 95% ",i,"КРТ 20% ","",i,"КА 40% ",i)
print ("","",i_2*115,"\n",i,"\x1b[31mНАЖМИТЕ 11\x1b[0m",i,"МИН.ур 1 ","",i,"МАК.ур 130 ",i,"ТОЧ 95% ",i,"КРТ 20% ","",i,"КА 40% ",i)
print ("","",i_2*115,"\n",i,"\x1b[31mНАЖМИТЕ 12\x1b[0m",i,"МИН.ур 62 ","",i,"МАК.ур 62 ",i,"ТОЧ 95% ",i,"КРТ 20% ","",i,"КА 40% ",i)
print ("","",i_2*115,"\n",i,"\x1b[31mНАЖМИТЕ 13\x1b[0m",i,"МИН.ур 58 ","",i,"МАК.ур 121 ",i,"ТОЧ 75% ",i,"КРТ 20% ","",i,"КА 40% ",i)
print ("","",i_2*115,"\n",i,"\x1b[31mНАЖМИТЕ 14\x1b[0m",i,"МИН.ур 4 ","",i,"МАК.ур 184 ",i,"ТОЧ 75% ",i,"КРТ 20% ","",i,"КА 40% ",i)
print ("","",i_2*115,"\n",i,"\x1b[31mНАЖМИТЕ 15\x1b[0m",i,"МИН.ур 89 ","",i,"МАК.ур 89 ",i,"ТОЧ 75% ",i,"КРТ 20% ","",i,"КА 40% ",i)
print ("","",i_2*115,"\n",i,"\x1b[31mНАЖМИТЕ 16\x1b[0m",i,"МИН.ур 76 ","",i,"МАК.ур 157 ",i,"ТОЧ 55% ",i,"КРТ 20% ","",i,"КА 40% ",i)
print ("","",i_2*115,"\n",i,"\x1b[31mНАЖМИТЕ 17\x1b[0m",i,"МИН.ур 13 ","",i,"МАК.ур 238 ",i,"ТОЧ 55% ",i,"КРТ 20% ","",i,"КА 40% ",i)
print ("","",i_2*115,"\n",i,"\x1b[31mНАЖМИТЕ 18\x1b[0m",i,"МИН.ур 121 ","",i,"МАК.ур 121 ",i,"ТОЧ 55% ",i,"КРТ 20% ","",i,"КА 40% ",i,"\n","","",i_2*115)
print("\n","Выберете ","\x1b[31mОРУЖИЕ\x1b[0m")
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","попытка(и)")
input("нажмите Enter")
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*115,"\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*115)
if player==player_2:
print ("","",i_2*115,"\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*115)
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*115,"\n",i,"\x1b[33mНАЖМИТЕ 1\x1b[0m",i," Берсерк","",i,"АТ +50",i,"ЗАЩ +20",i,"ЖС 1300","",i,"УКЛ 40%",i,"ЭНЕРГИЯ 100%+10/ход ",i)
print ("","",i_2*115,"\n",i,"\x1b[33mНАЖМИТЕ 2\x1b[0m",i," Рыцарь ","",i,"АТ +30",i,"ЗАЩ +50",i,"ЖС 1400","",i,"УКЛ 10%",i,"ЭНЕРГИЯ 120%+12/ход ",i)
print ("","",i_2*115,"\n",i,"\x1b[33mНАЖМИТЕ 3\x1b[0m",i," Мечник ","",i,"АТ +40",i,"ЗАЩ +10",i,"ЖС 1500","",i,"УКЛ 20%",i,"ЭНЕРГИЯ 130%+13/ход ",i)
print ("","",i_2*115,"\n",i,"\x1b[33mНАЖМИТЕ 4\x1b[0m",i," Ассасин","",i,"АТ +20",i,"ЗАЩ +30",i,"ЖС 1100","",i,"УКЛ 50%",i,"ЭНЕРГИЯ 140%+14/ход ",i)
print ("","",i_2*115,"\n",i,"\x1b[33mНАЖМИТЕ 5\x1b[0m",i," Ученый ","",i,"АТ +10",i,"ЗАЩ +40",i,"ЖС 1200","",i,"УКЛ 30%",i,"ЭНЕРГИЯ 150%+15/ход ",i)
print ("","",i_2*115,"\n",i,"\x1b[33mНАЖМИТЕ 6\x1b[0m",i," ГБХмен ","",i,"АТ +10",i,"ЗАЩ +10",i,"ЖС 1100","",i,"УКЛ 10%",i,"ЭНЕРГИЯ 100%+10/ход ",i,"\n","",i_2*115)
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*115,"\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*115)
if player==player_2:
print ("","",i_2*115,"\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*115)
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:
if pl[6]>((pl[8])/1.5):
print ("","",i_2*115,"\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][0],"%",i,"ϟ ",pl[7][0],"/",pl[7][2],"+",pl[7][1],"/х",i)
elif pl[6]>((pl[8])/3):
print ("","",i_2*115,"\n",i,pl[0],i,'Жс'"\x1b[33m", 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][0],"%",i,"ϟ ",pl[7][0],"/",pl[7][2],"+",pl[7][1],"/х",i)
else:
print ("","",i_2*115,"\n",i,pl[0],i,'Жс'"\x1b[31m", 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][0],"%",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 (player,player_inoy) == True: # Проверка на уклон соперника
at_noDEF = ran_2 # Если уклон не удался то проходит урон
ran_3 = random.randint(0, 100)
if ran_3<=player[2][3]:
at_noDEF = round(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 (player,player_inoy): # Проверяем смог ли увернутся атакуемый игрок
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(player,player_inoy)
return False
def agi_at (player,player_inoy): # Проверка на контроатаку атакующего игрока в случае успеха
ran_1 = random.randint(0, 100) # рандомное число от 0 до 100
if ran_1 <= player_inoy[5][1]: # сама проверка
ran_2 = round((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[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[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[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[4][0],
"\x1b[0m",") =","\x1b[31m", at_contr, "\x1b[0mединиц(ы)")
player[6] = player[6] - at_contr
def life (player,player_inoy):
if player[6] <= 0:
input("нажмите Enter")
print("\n"*60)
print(" "*57,"END")
print("\n"*4)
if player==player_1:
print("\x1b[96m", player_1[0], "\x1b[0m","\x1b[31m получил смертельную рану, покойся с миром ....\x1b[0m")
elif player==player_2:
print("\x1b[93m", player_2[0], "\x1b[0m","\x1b[31m получил смертельную рану, покойся с миром ....\x1b[0m")
color_life_player_1()
print("","",i_2*115)
if player_inoy[6] <= 0:
input("нажмите Enter")
print("\n"*60)
print(" "*57,"END")
print("\n"*4)
if player==player_1:
print("\x1b[93m", player_2[0], "\x1b[0m","\x1b[31m получил смертельную рану, покойся с миром ....\x1b[0m")
elif player==player_2:
print("\x1b[96m", player_1[0], "\x1b[0m","\x1b[31m получил смертельную рану, покойся с миром ....\x1b[0m")
color_life_player_1()
print("","",i_2*130)
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]=round(player[5][0]/1.3)
player[5][1]=round(player[5][1]/1.3)
player[4][0]=round(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]=round(player[5][0]/1.3)
player[5][1]=round(player[5][1]/1.3)
player[4][0]=round(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("~"*115)
print("*"*50,"\x1b[31mДОБРО ПОЖАЛОВАТЬ!\x1b[0m","*"*50)
print("~"*115)
Player_input_name()
Player_input_class()
while True:
if player_1[6] <= 0:
break
if player_2[6] <= 0:
break
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_inoy[7][0]<player_inoy[7][2]:
player_inoy[7][0]=player_inoy[7][0]+player_inoy[7][1]
if player_inoy[7][0]>player_inoy[7][2]:
player_inoy[7][0]=player_inoy[7][2]
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")
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()
life(player,player_inoy)
if player[6] <= 0:
break
print ("","",i_2*115)
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,"зщ",round(player_inoy[4][0]/1.3),"",i,"ук",round(player_inoy[5][0]/1.3),"%",i,"ка",round(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:
life(player,player_inoy)
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",round(player[4][0]*0.3), "\x1b[0m","",i,"ук",player[5][0],"% +\x1b[92m",round(player[5][0]*0.3), "\x1b[0m",i,"ка",player[5][0],"% +\x1b[92m",round(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]=round(player[5][0]*1.3)
player[5][1]=round(player[5][1]*1.3)
player[4][0]=round(player[4][0]*1.3)
if player==player_1:
x=1
if player==player_2:
y=1
else:
print(ataka(player,player_inoy,at))