#!/usr/bin/python  
 | 
# -*- coding: GBK -*-  
 | 
#-------------------------------------------------------------------------------  
 | 
#  
 | 
##@package Skill.GameSkills.SkillModule_51  
 | 
#  
 | 
# @todo:´ò³öÄ¿±êxxÊôÐÔµÄX%É˺¦£¬µ¥Ìå¹¥»÷   
 | 
# @author hxp  
 | 
# @date 2024-04-07  
 | 
# @version 1.0  
 | 
#  
 | 
# ÏêϸÃèÊö:   
 | 
#    Ð§¹û1£ºAÖµ-°Ù·Ö±È BÖµ-Ä¿±êÊôÐÔË÷Òý  
 | 
#    Ð§¹û2£ºAÖµ-²»³¬¹ý×ÔÉí°Ù·Ö±È,0²»ÏÞÖÆ BÖµ-×ÔÉíÊôÐÔË÷Òý  
 | 
#  
 | 
#-------------------------------------------------------------------------------  
 | 
#"""Version = 2024-04-07 18:00"""  
 | 
#-------------------------------------------------------------------------------  
 | 
  
 | 
import ChConfig  
 | 
import SkillCommon  
 | 
import EffGetSet  
 | 
import GameWorld  
 | 
  
 | 
def UseSkill(attacker, defender, curSkill, tagRoundPosX, tagRoundPosY, isEnhanceSkill, tick):  
 | 
    if not defender:  
 | 
        return  
 | 
      
 | 
    tagEffect = curSkill.GetEffect(0)  
 | 
    skillPer = tagEffect.GetEffectValue(0) / float(ChConfig.Def_MaxRateValue)  
 | 
    tagAttrIndex = tagEffect.GetEffectValue(1)  
 | 
      
 | 
    tagAttrValue = EffGetSet.GetValueByEffIndex(defender, tagAttrIndex)  
 | 
    hurtValue = int(tagAttrValue * skillPer)  
 | 
    #GameWorld.DebugLog("´ò³öÄ¿±êxxÊôÐÔµÄxxÉ˺¦! atkID=%s,defID=%s,tagAttrIndex=%s,tagAttrValue=%s,skillPer=%s,hurtValue=%s"   
 | 
    #                   % (attacker.GetID(), defender.GetID(), tagAttrIndex, tagAttrValue, skillPer, hurtValue))  
 | 
      
 | 
    selfEffect = curSkill.GetEffect(1)  
 | 
    selfPer = selfEffect.GetEffectValue(0) / float(ChConfig.Def_MaxRateValue)  
 | 
    selfAttrIndex = selfEffect.GetEffectValue(1)  
 | 
    if selfPer:  
 | 
        selfAttrValue = EffGetSet.GetValueByEffIndex(attacker, selfAttrIndex)  
 | 
        hurtValueMax = int(selfAttrValue * selfPer)  
 | 
        hurtValue = min(hurtValue, hurtValueMax)  
 | 
        #GameWorld.DebugLog("    ×î¸ß²»³¬¹ý×ÔÉíÊôÐÔ! selfAttrIndex=%s,selfAttrValue=%s,selfPer=%s,hurtValueMax=%s"   
 | 
        #                   % (selfAttrIndex, selfAttrValue, selfPer, hurtValueMax))  
 | 
          
 | 
    return SkillCommon.SkillLostHP(defender, curSkill, attacker, hurtValue, tick)  
 |