hch
2019-03-07 fe674f04c89b254f798282792be11e140d33489d
6130 【工具】【内网】伤害输出测试,内网
5个文件已修改
1个文件已添加
76 ■■■■■ 已修改文件
ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/HurtLog.py 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/BuffProcess_1033.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillCommon.py 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
@@ -214,6 +214,7 @@
Def_Notify_WorldKey_LoginAwardEndDate = 'LoginAwardEndDate_%s'   # 登录领取奖励结束时间,参数为活动类型
Def_Notify_WorldKey_RedPacketOutput = 'RedPacketOutput'  # 红包产出信息
Def_Notify_WorldKey_HurtLog = 'HurtLog'  # 战斗伤害日志
#运营活动表名定义
OperationActionName_ExpRate = "ActExpRate" # 多倍经验活动
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py
@@ -1604,6 +1604,7 @@
    atkObj = ElfChangeAttacker(attacker)  # Elf灵为替身攻击,要取玩家的属性
    
    resultHurtType = HurtType()
    atkObjType = attacker.GetGameObjType()
    defObjType = defObj.GetGameObjType()
    dHP = GameObj.GetHP(defObj)                # 防守方当前血量
    dMaxHP = GameObj.GetMaxHP(defObj)          # 防守方最大血量
@@ -1628,12 +1629,14 @@
            hurtValue = clientValue
        else:
            # 外挂最高伤害基本防范
            GameWorld.DebugAnswer(atkObj, "%s----客户端伤害 %s 服务端最高伤害 %s"%(atkObj.GetID(), [clientValue, hurtType], hurtValue))
            GameWorld.DebugLog(atkObj, "%s----客户端伤害 %s 服务端最高伤害 %s"%(atkObj.GetID(), [clientValue, hurtType], hurtValue))
            hurtValue = int(hurtValue*0.8)
        #GameWorld.DebugAnswer(atkObj, "客户端伤害 %s 服务端伤害 %s"%([defObj.GetID(), clientValue, hurtType], hurtValue))
    else:
        hurtValue, hurtType = CalcHurtHP(atkObj, defObj, curSkill, atkSkillValue, atkSkillPer, tick, orgAtkObj=attacker)
    WriteHurtLog(attacker, defObj, curSkill, hurtValue, hurtType, "公式层")
    
    # 优先处理神兵护盾
    hurtValue = CalcAtkProDef(atkObj, defObj, hurtValue, curSkill, tick)
@@ -1751,7 +1754,9 @@
    resultHurtType.LostHP = lostValue
    if defObjType == IPY_GameWorld.gotPlayer:
        FBLogic.OnFBLostHP(defObj, lostValue)
    WriteHurtLog(attacker, defObj, curSkill, resultHurtType.LostHP, resultHurtType.HurtType, "最终扣血")
    #攻击触发事件, 该代码应该放在DoAttack函数中处理逻辑比较清晰,也不会破坏GetHurtHP函数
    #因为DoAttack修改点比较多,暂不迁移,相关攻击事件逻辑,就往此函数中添加
    AttackEventTrigger(atkObj, defObj, curSkill, resultHurtType, tick)
@@ -1763,6 +1768,38 @@
    return resultHurtType
# GM 命令  HurtLog 查看战斗伤害日志
def WriteHurtLog(attacker, defObj, curSkill, hurtValue, hurtType, msg):
    logLevel = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_HurtLog)
    if not logLevel:
        return
    if logLevel == 1:
        # 只看玩家伤害
        if not attacker:
            return
        if attacker.GetGameObjType() != IPY_GameWorld.gotPlayer:
            return
        msg = "玩家" + msg
    attackerID = attacker.GetID() if attacker else 0
    defenderID = defObj.GetID() if defObj else 0
    skillID = curSkill.GetSkillID() if curSkill else 0
    skillName = curSkill.GetSkillName()  if curSkill else ""
    attackerName = attacker.GetName() if attacker else ""
    defenderName = defObj.GetName() if defObj else ""
    if attacker and attacker.GetGameObjType() == IPY_GameWorld.gotPlayer:
        attackerName = attackerName.decode("utf8").encode('gbk')
    if defObj and defObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
        defenderName = defenderName.decode("utf8").encode('gbk')
    GameWorld.DebugLog("攻击伤害-%s:(%s %s)攻击(%s %s), 技能ID:(%s %s), 伤害值:%s, 伤害类型:%s "%(
                        msg, attackerID, attackerName, defenderID, defenderName,
                        skillID, skillName, hurtValue, hurtType))
# 血盾支持多个同时存在
def CalcBloodShield(atkObj, defObj, hurtValue):
    # 伤害值用于血盾抵消
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/HurtLog.py
New file
@@ -0,0 +1,25 @@
#!/usr/bin/python
# -*- coding: GBK -*-
#
##@package
#
# @todo: 开启伤害输出日志
#
# @author: Alee
# @date 2019-3-6 下午05:21:33
# @version 1.0
#
# @note:
#
#---------------------------------------------------------------------
import GameWorld
import ShareDefine
def OnExec(curPlayer, cmdList):
    if not cmdList:
        logLevel = 1
    else:
        logLevel = int(cmdList[0])
    GameWorld.DebugAnswer(curPlayer, "开启战斗日志,1为玩家攻击伤害 2为所有伤害")
    GameWorld.GetGameWorld().SetGameWorldDict(ShareDefine.Def_Notify_WorldKey_HurtLog, logLevel)
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
@@ -214,6 +214,7 @@
Def_Notify_WorldKey_LoginAwardEndDate = 'LoginAwardEndDate_%s'   # 登录领取奖励结束时间,参数为活动类型
Def_Notify_WorldKey_RedPacketOutput = 'RedPacketOutput'  # 红包产出信息
Def_Notify_WorldKey_HurtLog = 'HurtLog'  # 战斗伤害日志
#运营活动表名定义
OperationActionName_ExpRate = "ActExpRate" # 多倍经验活动
@@ -658,7 +659,8 @@
# 3 紫色
# 4 橙色
# 5 红色
# 6 粉色#===============================================================================
# 6 粉色
#===============================================================================
Def_Item_Color_White = 1     #白
Def_Item_Color_Blue = 2      #蓝
Def_Item_Color_Purple = 3    #紫
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/BuffProcess_1033.py
@@ -43,7 +43,7 @@
    hurtPer = FindBuffPer(defender, curBuff)    # 找到另外一个buff对中毒的伤害加成
    
    singleDecHP = int((hurtPer + ChConfig.Def_MaxRateValue)*1.0/ChConfig.Def_MaxRateValue*singleDecHP)
    GameWorld.DebugLog("1033---------%s-%s-%s-%s"%(curBuff.GetValue(), layer, hurtPer, singleDecHP ) )
    #GameWorld.DebugLog("1033---------%s-%s-%s-%s"%(curBuff.GetValue(), layer, hurtPer, singleDecHP ) )
    #buff拥有者
    buffOwner = SkillCommon.GetBuffOwner(curBuff)
    
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameSkills/SkillCommon.py
@@ -1295,6 +1295,8 @@
            # 已广播的不重复
            GameObj.SetHP(curObj, remainHP, not view)
    
    AttackCommon.WriteHurtLog(buffOwner, curObj, curSkill, lostValue, hurtType, "持续掉血")
    if view:
        #广播伤血类型
        AttackCommon.ChangeHPView(curObj, buffOwner, skillTypeID, notifyLostValue, hurtType)
@@ -1309,6 +1311,7 @@
        AttackCommon.DoLogic_ObjDead(None, curObj, curSkill, tick)
        return
        
    #NPC需要手动添加伤血和仇恨, 因为无调用DoAttack
    if curObjType == IPY_GameWorld.gotNPC: