|
|

楼主 |
发表于 2014-9-2 20:00:30
|
显示全部楼层
- import random as r
- import time as t
- class Bk:
- list1= []
- e = 0
- attack=40
- hp=650
- atttime=1.5
- """
- def skill(self):
- while self.e<10:
- self.e +=1
- self.list1.append(r.randint(1,3))
- if self.list1[-1] ==1:
- #技能为攻击的两倍
- t.sleep(1.5)
- """
- def skill2(self):
- TK.hp -= 30
- class TK:
- list1= []
- e = 0
- attack=30
- hp=600
- atttime=1
- list1= []
- BK = Bk()
- TK = TK()
- def c():
- BK.hp = BK.hp-TK.attack
- if BK.hp > 0:
- print('TK砍了BK一刀,BK血量减少%d,还剩%d的血' % (TK.attack,BK.hp))
- list1.append(r.randint(1,3))
- if list1[-1]==1:
- BK.skill2()
- print('BK发动技能!!反弹了TK的伤害!TK减血%d,TK还剩%d的血'% (TK.attack,TK.hp))
- if TK.hp > 0:
- TK.hp = TK.hp-BK.attack
- print('BK揍了TK一拳,TK减血%d,TK还剩%d的血'% (BK.attack,TK.hp))
- if BK.hp < 0:
- print('BK死球!!!!!!!')
- return
- if TK.hp<=0:
- print('TK死球!!!!!!!')
- return
- c()
- c()
复制代码 想写那个攻击间隔。。
|
|