hxp
2024-09-18 d0d6f28bee730ee64bf46adffa4f768d6af6ac0c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package Skill.GameBuffs.BuffProcess_1308
#
# @todo:³Ö¼Ì»ØÑª´¥·¢µÄbuffÂß¼­ÊµÏÖ
# @author hxp
# @date 2024-03-28
# @version 1.0
#
# ÏêϸÃèÊö: ³Ö¼Ì»ØÑª´¥·¢µÄbuffÂß¼­ÊµÏÖ
# Ð§¹û1£º    AÖµ-°Ù·Ö±È£»BÖµ-¸½¼ÓÖµ£»CÖµ-»Ö¸´ÀàÐÍ£¨Í¬ÊÍ·Å·½Ê½8µÄ»Ö¸´ÀàÐÍ£©
# Ð§¹û2£º    Ò»°ã´îÅäЧ¹ûID 9999 ´¦Àí¼ä¸ôʹÓÃ
#
#-------------------------------------------------------------------------------
#"""Version = 2024-03-28 18:30"""
#-------------------------------------------------------------------------------
 
import ChConfig
import GameWorld
import SkillCommon
import SkillShell
import GameObj
 
def ProcessBuff(defender, curBuff, curEffect, processBuffTick, tick):
    if curBuff.GetValue2() == 0:
        return
    curBuff.SetValue2(max(curBuff.GetValue2() - 1, 0))
    
    curBuffSkillID = curBuff.GetSkill().GetSkillTypeID()
    singleAddHP = curBuff.GetValue() + curBuff.GetValue1() * ChConfig.Def_PerPointValue
    
    SkillCommon.SkillAddHP(defender, curBuffSkillID, singleAddHP)
    return
 
# ÏûʧǰÈçÓÐδִÐдÎÊýÔò²¹ÉÏ
#  @param defender ³ÐÊÜÕß
def OnBuffDisappear(defender, curSkill, curBuff, curEffect, tick):
    count = curBuff.GetValue2()
    #ÎÞÊ£Óà
    if count <= 0:
        return
    
    #ÒѾ­ËÀÍö²»´¥·¢
    if GameObj.GetHP(defender) <= 0:
        return
    
    singleAddHP = curBuff.GetValue() + curBuff.GetValue1() * ChConfig.Def_PerPointValue
    SkillCommon.SkillAddHP(defender, curSkill.GetSkillTypeID(), singleAddHP * count)
    return
 
def CalcBuffValue(attacker, defender, curSkill, changeBuffValueDict):
    curEffect = curSkill.GetEffect(0)
    cureType = curEffect.GetEffectValue(2)
    cureHP = SkillCommon.GetCureHP(attacker, defender, curSkill, cureType, largeNum=True) # Ö§³Ö³¬20E
    
    buffTime = curSkill.GetLastTime() 
    buffTick = SkillShell.GetProcessBuffTick(curSkill, defender)
    count = int(buffTime / buffTick)
    
    GameWorld.DebugLog("BuffProcess_1308.CalcBuffValue: cureHP=%s,count=%s,atkID=%s,defID=%s" % (cureHP, count, attacker.GetID(), defender.GetID()))
    return [cureHP % ChConfig.Def_PerPointValue, cureHP / ChConfig.Def_PerPointValue, count]