Commit 4e6f1fe0 by BellCodeEditor

save project

parent 3f5289d0
Showing with 19 additions and 8 deletions
...@@ -3,17 +3,28 @@ class Hero: ...@@ -3,17 +3,28 @@ class Hero:
self.level=1 self.level=1
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
wudi=Hero("无敌",99999999999999999999999,9999999999999999999999999999999999999999999) wudi=Hero("无敌",99999999999999999999999999999999999999999999999999999,9999999999999999999999999999999999999999999)
yase=Hero("亚瑟",300,20) yase=Hero("亚瑟",300,20)
print("亚瑟的血量为",yase.attack)
def upgrad_yase(): def upgrad_yase():
yase.level=self.level*2 yase.level=yase.level*2
yase.hp=self.hp*2 yase.hp=yase.hp*2
yase.attack=self.attack*2 yase.attack=yase.attack*2
def upgrad_wudi(): def upgrad_wudi():
wudi.level=self.level*2 wudi.level=wudi.level*2
wudi.hp=self.hp*2 wudi.hp=wudi.hp*2
wudi.attack=self.attack*2 wudi.attack=wudi.attack*2
input_name=input("你要升级哪个英雄?无敌\亚瑟")
if input_name=="无敌":
upgrad_wudi()
print("无敌的血量为",wudi.attack)
if input_name=="亚瑟":
upgrad_yase()
print("亚瑟的血量为",wudi.attack)
......
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