Commit 6bbab646 by BellCodeEditor

save project

parent e22f9abc
Showing with 52 additions and 1 deletions
import time as t
import random as r
class My:
def __init__(self,name,atk,hp):
self.name=name
self.hp=hp
self.atk=atk
self.level=1
self.jy=0
def up(self):
if self.level<=3:
self.hp+=5
self.atk+=2
elif self.level>3 and self.level<=6:
self.hp+=8
self.atk+=4
elif self.level>6 and self.level<=10:
self.hp+=10
self.atk+=6
elif self.level>10 and self.level<=15:
self.hp+=13
self.atk+=8
elif self.level>15 and self.level<=20:
self.hp+=15
self.atk+=10
self.level+=1
class Mon:
def __init__(self,hp,name,atk,level,jy,wp):
self.name=name
self.hp=hp
self.akt=atk
self.level=level
self.jy=jy
self.wp=wp
wj=My("曾小白",2,50)
where=["迷雾林","野林","坠龙谷","荒地","村庄","野林","野林","荒地","村庄","荒地","村庄","迷雾林","灵池","灵池"]
print("-"*5+"人物初始信息"+"-"*5)
print("姓名:"+wj.name)
print("气血:"+str(wj.hp))
print("攻击:"+str(wj.atk))
print("等级:"+str(wj.level))
print("经验:"+str(wj.jy))
print("-"*7+"开始冒险"+"-"*7)
while wj.hp>0:
i=r.choice(where)
print("你来到了"+i)
import random
list=["石头","剪刀","布"]
computer=random.choice(list)
print("电脑出的是:"+computer)
wanjia=input("请出拳:石头\剪刀\布") wanjia=input("请出拳:石头\剪刀\布")
print("玩家出的是:"+wanjia) print("玩家出的是:"+wanjia)
\ No newline at end of file
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