#!/usr/bin/python
|
# -*- coding: GBK -*-
|
#-------------------------------------------------------------------------------
|
#
|
##@package Skill.GameSkills.SkillModule_49
|
#
|
# @todo:»»Ñª¹¥»÷
|
# @author hxp
|
# @date 2024-04-02
|
# @version 1.0
|
#
|
# ÏêϸÃèÊö: ÏûºÄ×ÔÉíx%µ±Ç°ÉúÃüÖµ£¬¿Û³ýµÐ·½µÈ¶îÉúÃüÖµ£¬×î¸ß²»³¬¹ý×ÔÉíx%¹¥»÷¡£
|
# Ч¹û1£º AÖµ-ÏûºÄѪÁ¿°Ù·Ö±È£¬BÖµ-×î¸ß²»³¬¹ý¹¥»÷°Ù·Ö±È
|
#
|
#-------------------------------------------------------------------------------
|
#"""Version = 2024-04-02 19:00"""
|
#-------------------------------------------------------------------------------
|
|
import ChConfig
|
import SkillCommon
|
import BaseAttack
|
import GameWorld
|
import GameObj
|
|
def UseSkill(attacker, defender, curSkill, tagRoundPosX, tagRoundPosY, isEnhanceSkill, tick):
|
if not defender:
|
return
|
|
curHP = GameObj.GetHP(attacker)
|
tagHP = GameObj.GetHP(defender)
|
if curHP <= 1 or tagHP <= 0:
|
return
|
|
skillEffect = curSkill.GetEffect(0)
|
lostHPPer = skillEffect.GetEffectValue(0)
|
maxAtkPer = skillEffect.GetEffectValue(1)
|
|
maxHP = GameObj.GetMaxHP(attacker)
|
maxAtk = attacker.GetMaxAtk()
|
|
hpHurtValue = int(maxHP * lostHPPer / float(ChConfig.Def_MaxRateValue))
|
atkHurtValue = int(maxAtk * maxAtkPer / float(ChConfig.Def_MaxRateValue))
|
|
hurtValue = min(hpHurtValue, atkHurtValue, tagHP, curHP - 1) # ÖÁÉÙ±£Áô1µÎѪ
|
|
GameWorld.DebugLog(" »»Ñª: atkID=%s,defID=%s,skillID=%s,hurtValue=%s,hpHurtValue=%s,atkHurtValue=%s,curHP=%s,tagHP=%s"
|
% (attacker.GetID(), defender.GetID(), curSkill.GetSkillID(), hurtValue, hpHurtValue, atkHurtValue, curHP, tagHP))
|
lostHP = SkillCommon.SkillLostHP(defender, curSkill, attacker, hurtValue, tick, isDoAttackResult=False, skillAffect=False)
|
if lostHP:
|
SkillCommon.SkillLostHP(attacker, curSkill, attacker, hurtValue, tick, isDoAttackResult=False, skillAffect=False)
|
return BaseAttack.DoSkillEx_AttackSucess(attacker, defender, curSkill, tick, isEnhanceSkill)
|