hxp
2018-11-28 5695662b3131c45271dac81da7f45391570d8b4a
4762 【后端】优化机器人攻击顺序,防止动作一致;
3个文件已修改
15 ■■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBHelpBattle.py 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AIType_20.py 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -2962,6 +2962,10 @@
Def_NPC_Dict_SpeedPer = "SpeedPer" # 移动速度变更百分比
# 延迟攻击时长, 毫秒
Def_NPC_Dict_AtkDelayTick = "AtkDelayTick" # 延迟攻击时长
Def_NPC_Dict_AtkStartTick = "AtkStartTick" # 开始攻击tick
#玩家状态定义,不能超过31个,如超过,需扩展多个key支持
Def_PlayerStateList = (
    Def_PlayerState_Normal, # 无 0
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBHelpBattle.py
@@ -226,6 +226,7 @@
        objID = helpBattleNPC.GetID()
        GameWorld.Log("召唤助战成功: calledPlayerID=%s,objID=%s,fightPower=%s" % (calledPlayerID, objID, fightPower), playerID)
        gameFB.SetGameFBDict(ChConfig.Def_FB_HelpBattleFBObjID % calledPlayerID, objID)
        helpBattleNPC.SetDict(ChConfig.Def_NPC_Dict_AtkDelayTick, calledCount * 1000) # 按转换顺序每个延长1秒攻击,防止动作一致
        calledCount += 1
        # 设置助战属性
        npcControl = NPCCommon.NPCControl(helpBattleNPC)
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AIType_20.py
@@ -99,6 +99,16 @@
        curNPC.ResetPos(resultPos.GetPosX(), resultPos.GetPosY())
        tagDist = GameWorld.GetDist(curNPC.GetPosX(), curNPC.GetPosY(), curTag.GetPosX(), curTag.GetPosY())
        
    delayTick = curNPC.GetDictByKey(ChConfig.Def_NPC_Dict_AtkDelayTick)
    if delayTick:
        startAtkTick = curNPC.GetDictByKey(ChConfig.Def_NPC_Dict_AtkStartTick)
        if not startAtkTick:
            curNPC.SetDict(ChConfig.Def_NPC_Dict_AtkStartTick, tick)
            startAtkTick = tick
        if tick - startAtkTick < delayTick:
            GameWorld.DebugLog("未到攻击时间,暂不处理!objID=%s" % curNPC.GetID())
            return
    #---优先释放技能---
    if AICommon.DoAutoUseSkill(curNPC, curTag, tagDist, tick):
        return