#!/usr/bin/python # -*- coding: GBK -*- # ##@package # # @todo: ׯÉÕ£¨Á÷ÅÉרÓ㬶îÍ⹫ʽ£©, ³ÖÐø¹ý³ÌÖпÉÄܻᱻ¸Ä±äÉ˺¦»òÕß³ÖÐøÊ±³¤£¬ÎÞ·¨ÓôÎÊý¿ØÖÆ£¬Î޲㼶¸ÅÄî # ÈôͬÀàÐÍbuff´æÔÚ²»¹ÜµÈ¼¶¸ßµÍ£¬Ö»¸øÔ­buff³äÄÜÖ»¸Ä±äÖµ»òʱ¼ä # ²»Í¬ÊÍ·ÅÕ߿ɹ²´æ¶à¸öׯÉÕ # @author: Alee # @date 2019-4-28 ÏÂÎç04:12:17 # @version 1.0 # # @note: # #--------------------------------------------------------------------- #µ¼Èë import SkillCommon import GameWorld import ChConfig import AttackCommon import PlayerControl import PassiveBuffEffMng import GameObj import BuffSkill #--------------------------------------------------------------------- #È«¾Ö±äÁ¿ #--------------------------------------------------------------------- #--------------------------------------------------------------------- #Âß¼­ÊµÏÖ ## ³ÖÐøÐÔBuff´¦Àí # @param defender ³ÐÊÜÕß # @param curBuff µ±Ç°Buff # @param curEffect BuffЧ¹û # @param tick µ±Ç°Ê±¼ä # @return None # @remarks º¯ÊýÏêϸ˵Ã÷. def ProcessBuff(defender, curBuff, curEffect, processBuffTick, tick): #µ¥´ÎÉ˺¦ singleDecHP = curBuff.GetValue() buffOwner = SkillCommon.GetBuffOwner(curBuff) curBuffSkillID = curBuff.GetSkill().GetSkillTypeID() SkillCommon.SkillLostHP(defender, curBuffSkillID, buffOwner, singleDecHP, tick, hurtType=ChConfig.Def_HurtType_Bleed) if buffOwner and GameObj.GetHP(buffOwner) > 0: # ´Ë´¦ÔÝÎÞ·¨Óñ»¶¯Ð§¹ûʵÏÖ buffManager = defender.GetProcessDeBuffState() burnToHPEffect, plusValue, skillID = BuffSkill.FindBuffEffectByOwnertID(buffManager, ChConfig.Def_Skill_Effect_BurnToAddHP, buffOwner.GetID(), buffOwner.GetGameObjType()) if burnToHPEffect: addHP = singleDecHP*burnToHPEffect.GetEffectValue(0)/ChConfig.Def_MaxRateValue SkillCommon.SkillAddHP(buffOwner, curBuffSkillID, buffOwner, addHP, tick, hurtType=ChConfig.Def_HurtTYpe_Recovery) return # ׯÉÕµÄÌØÕ÷ΪÑÓ³¤buffʱ¼ä£¬ÖØËãÉ˺¦ def CalcBuffValue(attacker, defender, curSkill, changeBuffValueDict): curEffect = curSkill.GetEffect(0) skillPer = curEffect.GetEffectValue(0) skillPer += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(attacker, defender, curSkill, ChConfig.TriggerType_BurnPer) skillPer += PassiveBuffEffMng.GetValueByPassiveBuffTriggerType(attacker, defender, curSkill, ChConfig.TriggerType_BurnPer) skillEnhance = curEffect.GetEffectValue(1) + PlayerControl.GetBurnValue(attacker) skillPer = skillPer*1.0/ChConfig.Def_MaxRateValue # ׯÉÕÌØÊ⹫ʽ hurtValue, hurtType = AttackCommon.CalcHurtHP(attacker, defender, curSkill, 0, 0, GameWorld.GetGameWorld().GetTick(), ChConfig.Def_Skill_HappenState_HitOn, hurtFormulaKey="Burn", burnValue=skillEnhance, burnPer=skillPer) return [hurtValue] def OnBuffDisappear(defender, curSkill, curBuff, curEffect, tick): #ÒѾ­ËÀÍö²»´¥·¢ if GameObj.GetHP(defender) <= 0: return # ÔÚ·ÀÓùÕßÉíÉÏͬʱȡÏûͬһ¸öÊÍ·ÅÕßµÄÏà¹Øbuff defender.SetDict(ChConfig.Def_PlayerKey_BurnOwnerID, curBuff.GetOwnerID()) PassiveBuffEffMng.GetValueByPassiveBuffTriggerType(defender, None, None, ChConfig.TriggerType_BurnDisappear) defender.SetDict(ChConfig.Def_PlayerKey_BurnOwnerID, 0) return