Commit 61d66642 by BellCodeEditor

save project

parent e8409af1
Showing with 24 additions and 3 deletions
import turtle
pen=turtle.Pen()
pen.speed(100)
pen.fillcolor("red")
pen.begin_fill()
for i in range(85):
pen.forward(320)
pen.left(140)
pen.left(14)
pen.end_fill()
turtle.done()
\ No newline at end of file
print('-'*30) print('-'*30)
print(' 战斗开始') print(' 战斗开始')
print('-'*30) print('-'*30)
...@@ -13,3 +14,8 @@ while True: ...@@ -13,3 +14,8 @@ while True:
print("2==开始治疗") print("2==开始治疗")
else: else:
print("请选择技能:1攻击/2治疗") print("请选择技能:1攻击/2治疗")
b=random.randint(1,3)
if a==1:
yase.combat(houyi)
elif a==2:
yase.cure()
\ No newline at end of file
...@@ -40,11 +40,11 @@ class Player(Hero): ...@@ -40,11 +40,11 @@ class Player(Hero):
print('-'*30) print('-'*30)
print(' 战斗开始') print(' 战斗开始')
def cure(self): def cure(self):
c=random.randint(35,50) blood=random.randint(30,50)
self.hp+=c self.hp=self.hp+blood
if self.hp>self.max_hp: if self.hp>self.max_hp:
self.hp=self.max_hp self.hp=self.max_hp
print(self.name+"使用了治疗,血量增加:",str(c),",目前的血量为:",self.hp) print(self.name+"使用了治疗,血量增加:",blood,",目前的血量为:",self.hp)
houyi = Player("射手", "后羿") houyi = Player("射手", "后羿")
yase = Hero("垭瑟") yase = Hero("垭瑟")
......
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