xdh
2018-10-09 302d2582109d6cdc666306b560f4a842995085de
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerDogz.py
@@ -29,6 +29,8 @@
import SkillCommon
import SkillShell
import time
'''
神兽编号: 1~20,上线后不可修改
神兽装备位: 101~105 物品表中的装备位配置
@@ -39,6 +41,8 @@
'''
DogzEquipCount = 5 # 神兽装备位数量,固定5个,策划说打死也不改
g_helpBattleNotifyTimeDict = {} # 助战广播时间记录 {神兽ID:广播time, ...}
def GetDogzEquipPlaceIndex(equipPlace):
    ## 获取神兽装备位对应的索引
@@ -235,6 +239,8 @@
#    BYTE        BatteState;    //助战状态,0-召回,1-助战
#};
def OnDogzBattleStateChange(index, clientData, tick):
    global g_helpBattleNotifyTimeDict
    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
    playerID = curPlayer.GetPlayerID()
    dogzID = clientData.DogzID
@@ -283,6 +289,14 @@
    SetDogzIsHelpFight(curPlayer, dogzID, isFight)
    RefreshDogzAttr(curPlayer)
    PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState()
    if isFight and ipyData.GetHelpBattleNotify():
        curTime = int(time.time())
        notifyKey, notifyParamList, notifyCD = ipyData.GetHelpBattleNotify()
        lastNotifyTime = g_helpBattleNotifyTimeDict.get(dogzID, 0)
        if curTime - lastNotifyTime >= notifyCD * 60:
            PlayerControl.WorldNotify(0, notifyKey, notifyParamList)
            g_helpBattleNotifyTimeDict[dogzID] = curTime
    return
@@ -564,6 +578,7 @@
    PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_DogzBattleSkill, skillAttrList)
    return
# 助战神兽技能属性,必须在 SetDogzIsHelpFight后调用
def CalcDogzBattleSkillAttr(curPlayer):
    skillAttrList = [{} for _ in range(4)]
@@ -585,6 +600,26 @@
            curEffect = curSkill.GetEffect(effectIndex)
            SkillShell.CalcBuffEffAttr(curPlayer, curEffect, skillAttrList)
            
    # Def_SkillType_AttrSkillNoLearn 非学习属性技能 叠加属性计算
    ipyDataMgr = IpyGameDataPY.IPY_Data()
    for i in xrange(ipyDataMgr.GetDogzCount()):
        ipyData = ipyDataMgr.GetDogzByIndex(i)
        if not GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_DogzFightState, i):
            #未助战
            continue
        for skillID in ipyData.GetHelpBattleSkills():
            skillData = GameWorld.GetGameData().GetSkillBySkillID(skillID)
            if not skillData:
                continue
            # 同技能类型ID可多个叠加的属性时直接取表
            if skillData.GetSkillType() != ChConfig.Def_SkillType_AttrSkillNoLearn:
                continue
            for effectIndex in xrange(skillData.GetEffectCount()):
                curEffect = skillData.GetEffect(effectIndex)
                SkillShell.CalcBuffEffAttr(curPlayer, curEffect, skillAttrList)
    
    #GameWorld.DebugLog("神兽技能属性: skillFPEx=%s, %s" % ( skillFPEx, skillAttrList))
    return skillAttrList