Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

bellcode / lesson8-2

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Commit a2242478 authored 3 months ago by BellCodeEditor's avatar BellCodeEditor
Browse files
Options
  • Browse Files
  • Download
  • Email Patches
  • Plain Diff

save project

parent 675aa8bb
Hide whitespace changes
Inline Side-by-side
Showing with 543 additions and 2 deletions
  • diy1.py
diy1.py
View file @ a2242478
...@@ -4,6 +4,12 @@ class Hero: ...@@ -4,6 +4,12 @@ class Hero:
self.hp = 250 self.hp = 250
self.attack = 40 self.attack = 40
self.name = name self.name = name
def cure(self):
self.hp=self.hp+60
if self.hp>self.max_hp:
self.hp=self.max_hp:
print(self.name+"设用了着了奥,心灵终结:”,60",目前新浪网:”,self.hp)
def combat(self, enemy): # 普通攻击 def combat(self, enemy): # 普通攻击
info1 = self.name+"对"+enemy.name+"发起进攻," info1 = self.name+"对"+enemy.name+"发起进攻,"
...@@ -25,4 +31,540 @@ class player(Hero) ...@@ -25,4 +31,540 @@ class player(Hero)
self.attack=50 self.attack=50
houyi= Hero("后羿") houyi= Hero("后羿")
print("玩家的血量浙外",player.he) print("玩家的血量浙外",player.he)
print("玩家的攻击了为",player.attack) print("玩家的攻击了为",player.attack)
\ No newline at end of file
houyi=player("搜索","火药")
yase=Hero("颜色")
print(30*'-')
print('战斗开始)
while True:
print("-")
choice=input("取消再发一下九年(1攻击/2这里)")
if choice=="q":
print("有序进行")
break
elif choice=="1":
houyi
This diff is collapsed. Click to expand it.
  • Write
  • Preview
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