#!/usr/bin/python
|
# -*- coding: GBK -*-
|
#
|
# @todo: ±ôËÀʱ´¥·¢¼¼ÄÜ
|
#
|
# @author: Alee
|
# @date 2018-1-9 ÏÂÎç09:39:37
|
# @version 1.0
|
#
|
# @note:
|
#
|
#---------------------------------------------------------------------
|
|
import ChConfig
|
import GameWorld
|
import GameObj
|
import SkillCommon
|
import IPY_GameWorld
|
|
def CheckCanHappen(attacker, defender, effect, curSkill):
|
if attacker.GetPlayerAction() == IPY_GameWorld.paDie:
|
# µ±Ç°ÒѾ±»´¦ÀíΪËÀÍö£¬ÄÇô¾Í²»´¥·¢
|
return False
|
|
if attacker.GetDictByKey("zhansha") and effect.GetEffectValue(2):
|
# նɱ²»´¥·¢µÄ±êÖ¾
|
return False
|
|
result = GameWorld.CanHappen(effect.GetEffectValue(0))
|
if result:
|
GameObj.SetHP(attacker, 1) # ΪÁ˱ÜÃâÉúÃüΪ0ʱ£¬ÆÁ±Î¹ý¶àÂß¼
|
# Ìáǰ´¥·¢CD£¬ ²»È»Íâ²ãÎÞ·¨´¥·¢¼¼Äܵϰ¾Í²»½øÈëCD£¬ ÈçºÍƽģʽ
|
if curSkill.GetCoolDownTime():
|
SkillCommon.SetSkillRemainTime(curSkill, 0, GameWorld.GetGameWorld().GetTick(), attacker)
|
return True
|
|
if effect.GetEffectValue(1):
|
#²»ËÀѪÁ¿1£¬µ«²»´¥·¢¼¼ÄÜ
|
if GameWorld.CanHappen(effect.GetEffectValue(1)):
|
GameObj.SetHP(attacker, 1)
|
# Ìáǰ´¥·¢CD£¬ ²»È»Íâ²ãÎÞ·¨´¥·¢¼¼Äܵϰ¾Í²»½øÈëCD£¬ ÈçºÍƽģʽ
|
if curSkill.GetCoolDownTime():
|
SkillCommon.SetSkillRemainTime(curSkill, 0, GameWorld.GetGameWorld().GetTick(), attacker)
|
return False
|
|
return False
|