| | |
| | | Def_Notify_WorldKey_LoginAwardEndDate = 'LoginAwardEndDate_%s' # 登录领取奖励结束时间,参数为活动类型
|
| | |
|
| | | Def_Notify_WorldKey_RedPacketOutput = 'RedPacketOutput' # 红包产出信息
|
| | | Def_Notify_WorldKey_HurtLog = 'HurtLog' # 战斗伤害日志
|
| | |
|
| | | #运营活动表名定义
|
| | | OperationActionName_ExpRate = "ActExpRate" # 多倍经验活动
|
| | |
| | | atkObj = ElfChangeAttacker(attacker) # Elf灵为替身攻击,要取玩家的属性
|
| | |
|
| | | resultHurtType = HurtType()
|
| | | atkObjType = attacker.GetGameObjType()
|
| | | defObjType = defObj.GetGameObjType()
|
| | | dHP = GameObj.GetHP(defObj) # 防守方当前血量
|
| | | dMaxHP = GameObj.GetMaxHP(defObj) # 防守方最大血量
|
| | |
| | | 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)
|
| | |
| | | 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)
|
| | |
| | | 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):
|
| | | # 伤害值用于血盾抵消
|
New file |
| | |
| | | #!/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) |
| | |
| | | Def_Notify_WorldKey_LoginAwardEndDate = 'LoginAwardEndDate_%s' # 登录领取奖励结束时间,参数为活动类型
|
| | |
|
| | | Def_Notify_WorldKey_RedPacketOutput = 'RedPacketOutput' # 红包产出信息
|
| | | Def_Notify_WorldKey_HurtLog = 'HurtLog' # 战斗伤害日志
|
| | |
|
| | | #运营活动表名定义
|
| | | OperationActionName_ExpRate = "ActExpRate" # 多倍经验活动
|
| | |
| | | # 3 紫色
|
| | | # 4 橙色
|
| | | # 5 红色
|
| | | # 6 粉色#===============================================================================
|
| | | # 6 粉色
|
| | | #===============================================================================
|
| | | Def_Item_Color_White = 1 #白
|
| | | Def_Item_Color_Blue = 2 #蓝
|
| | | Def_Item_Color_Purple = 3 #紫
|
| | |
| | | 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)
|
| | |
|
| | |
| | | # 已广播的不重复
|
| | | GameObj.SetHP(curObj, remainHP, not view)
|
| | |
|
| | | AttackCommon.WriteHurtLog(buffOwner, curObj, curSkill, lostValue, hurtType, "持续掉血")
|
| | | |
| | | if view:
|
| | | #广播伤血类型
|
| | | AttackCommon.ChangeHPView(curObj, buffOwner, skillTypeID, notifyLostValue, hurtType)
|
| | |
| | | AttackCommon.DoLogic_ObjDead(None, curObj, curSkill, tick)
|
| | | return
|
| | |
|
| | |
|
| | | #NPC需要手动添加伤血和仇恨, 因为无调用DoAttack
|
| | | if curObjType == IPY_GameWorld.gotNPC:
|
| | |
|