Witam próbowałem zrobić walke pokemonów tekstowo ale jak chce wrócić do początku akcji to wartość która ustawiłem Hp po użyciu potki wraca do ustawienia z rozpoczęcia a gdybym ją ustawił przed def pokazuje że nie jest zdefiniowana oto kod:
import time
A = "Attack"
B = "Bag"
print("As you walk through the grass you hear something")
time.sleep(3)
print("Argh! The wild pokemon ecountered")
time.sleep(2)
print("The wild magnemite has appeard")
time.sleep(2)
print("You send charmander!")
time.sleep(1)
def Cha():
chaHp = 1
Cha()
def Poczatek(ChaHp):
PotionIlO = 1
CharMAXHP = 25
CharSPAT = 41
CharDEF = 20
CharSPDEF = 19
CharSPEED = 23
CharLVL = 7
CharEXP = 0
Scratch = "fizyczny", 20
Ember = "Specjalny", 35
MagHp = 18
MagMAXHP = 18
MagSPAT = 35
MagDEf = 32
MagSPDEF = 27
MagSPEED = 17
MagLVL = 5
ThunderShock = "Special", 25
if CharEXP >= 10:
CharLVL + 1
print("Magnemite LVL:", MagLVL)
print(MagHp, "/", MagMAXHP)
print("")
print("")
print("Charmander LVL:", CharLVL)
print(ChaHp,"/",CharMAXHP)
print("")
print("")
time.sleep(1)
print("what action will you chose?")
print(A, B)
Akcja = input(str)
if Akcja == "Bag":
print("")
print("potion X ",PotionIlO)
print("Will you use potion?")
print("Yes/No")
PotionODP = input(str)
if PotionODP == "Yes":
if PotionIlO >= 1:
ChaHp = ChaHp + 20
PotionIlO - 1
print("Charmander is healed")
print("")
print("Charmander HP:", ChaHp, "/", CharMAXHP)
if ChaHp >= CharMAXHP:
ChaHp = CharMAXHP
if PotionIlO <= 0:
PotionIlO = 0
print("")
print("You dont have any potions left")
print("")
Poczatek()
if Akcja == "Attack":
print("")
print("")
print("Ember"), print("Scratch")
Poczatek()
jak źle zrobiłem posta to przepraszam jestem tu pierwszy raz
Hp
, co to "potka"?