To be honest, it's a random text-based RPG game—and definitely, its system isn't inspired by Undertale XD. Anyway, here is the code: (assume this is the code I'm going to write:
import random
def name():
d = 0
c = 0
dmm = 120
dm = 100
a = input("if you want to figth the monstar preas 1")
while True:
if a == "1" or a == "١":
print ("1-fighting")
print ("2-Escape")
print ("3-speech")
print ("4-forgives")
b = input ("Write any of the numbers provided.")
if b == "1":
dmm -= random.randint(10,29)
dm -= random.randint(10,24)
c+=1
print ("youer health is", dm)
print ("monstar health is", dmm)
if dmm <= 0:
print ("you win")
break
elif dm <= 0:
print ("you lose ")
break
elif b =="2":
if c >= 3:
print ("you wan and escep")
break
elif c < 3:
print ("you cant escep")
elif b == "3":
print ("you talk to the monstar")
d += 1
elif b=="4":
if d >= 3:
print ("you wan and escap")
break
elif d < 3: print ("you cant escape")
else:
print("Bro, there is no option for ", a)
b = input ("preas 2 to reastr")
name()
name()
Want to add to the discussion?
Post a comment!