Commit 196106ce by BellCodeEditor

auto save

parent e47cb26d
Showing with 39 additions and 0 deletions
import random
class Hero(a):
def __init__(self,name):
self.name=name
self.dj=1
self.hp=250
self.gjl=40
self.maxhp=self.hp
def gj(self,name):
name.hp=name.hp-self.gj
def zl(self):
self.hp=self.hp+50
if self.hp>=self.maxhp
self.hp=self.maxhp
elif a=="2":
class Player(hero):
def __init__(self,name):
super().__init__(name)
self.hp=200
self.gj=70
yase=Hero("亚瑟")
houyi=Player("后羿")
while True:
a=input("请输入,1为攻击,2为治疗")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment