From e082d496795bd07657a81714bab4a5a63446e397 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期五, 12 四月 2019 16:41:10 +0800
Subject: [PATCH] 6491 子 【2.0】【开发】打宝界面和境界压制调整 / 【2.0】【后端】打宝界面和境界压制调整
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py | 95 ++++++++++++++++++-----------------------------
1 files changed, 36 insertions(+), 59 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py
index bd598f7..505daaf 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py
@@ -1915,7 +1915,15 @@
atkObjType = atkObj.GetGameObjType()
defObjType = defObj.GetGameObjType()
-
+ aRealmLV, dRealmLV = GetPVERealmLVs(atkObj, defObj, atkObjType, defObjType) # 获取境界
+ if defObjType == IPY_GameWorld.gotNPC and ChConfig.IsGameBoss(defObj) and dRealmLV > aRealmLV:
+ if atkObjType == IPY_GameWorld.gotPlayer:
+ GameWorld.DebugLog("BossRealmHint%s-%s"%(dRealmLV, aRealmLV))
+ PlayerControl.NotifyCode(atkObj, 'BossRealmHint', [dRealmLV])
+
+ # 攻击高境界的BOSS 伤害固定为1
+ return 1, ChConfig.Def_HurtType_Normal
+
atkType = GetBattleType(atkObj, curSkill)
happenState = happenState if happenState else SkillShell.GetHappenState(curSkill)
happenState += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_HappenState)
@@ -1942,11 +1950,13 @@
#当攻击方为NPC,防守方为玩家时,计算压制等级 及 压制战力
if atkObjType == IPY_GameWorld.gotNPC and defObjType == IPY_GameWorld.gotPlayer:
- if curSkill and curSkill.GetFuncType() == ChConfig.Def_SkillFuncType_RealmSuppress:
- # 境界压制技能不对高等级境界玩家产生攻击
- aRealmLV, dRealmLV = GetPVERealmLVs(atkObj, defObj, atkObjType, defObjType)
- if aRealmLV <= dRealmLV:
- return 0, ChConfig.Def_HurtType_Immune # 免疫
+ #=======================================================================
+ # if curSkill and curSkill.GetFuncType() == ChConfig.Def_SkillFuncType_RealmSuppress:
+ # # 境界压制技能不对高等级境界玩家产生攻击
+ # aRealmLV, dRealmLV = GetPVERealmLVs(atkObj, defObj, atkObjType, defObjType)
+ # if aRealmLV <= dRealmLV:
+ # return 0, ChConfig.Def_HurtType_Immune # 免疫
+ #=======================================================================
atkIsBoss = 1 if ChConfig.IsGameBoss(atkObj) else 0
if NPCCommon.GetIsLVSuppress(atkObj):
@@ -2144,59 +2154,20 @@
suppressFPFormula = hurtDist[suppressFormulaKeyFP]
suppressValueFP = eval(FormulaControl.GetCompileFormula(suppressFormulaKeyFP, suppressFPFormula))
- # 境界压制百分比
- SuppressValueRealmRate = 10000 # 默认值
- suppressRealm = 0
- if atkObjType == IPY_GameWorld.gotPlayer and defObjType == IPY_GameWorld.gotPlayer:
- RealmGroupList = IpyGameDataPY.GetFuncEvalCfg("RealmGroup", 1)
- aRealmLV, dRealmLV = atkObj.GetOfficialRank(), defObj.GetOfficialRank()
- aRealmGroup, dRealmGroup = 0, 0
- for g, gMaxRealmLV in enumerate(RealmGroupList, 1):
- if aRealmLV and aRealmLV <= gMaxRealmLV and not aRealmGroup:
- aRealmGroup = g
- if dRealmLV and dRealmLV <= gMaxRealmLV and not dRealmGroup:
- dRealmGroup = g
- suppressRealm = aRealmGroup - dRealmGroup
- suppressFormulaKeyRealm = "PVPSuppressValueRealm"
- if suppressFormulaKeyRealm in hurtDist:
- SuppressValueRealmRate = int(eval(FormulaControl.GetCompileFormula(suppressFormulaKeyRealm, hurtDist[suppressFormulaKeyRealm])))
- #GameWorld.DebugLog("境界压制:aRealmLV=%s,dRealmLV=%s,aRealmGroup=%s,dRealmGroup=%s,SuppressValueRealmRate=%s"
- # % (aRealmLV, dRealmLV, aRealmGroup, dRealmGroup, SuppressValueRealmRate))
-
- elif atkObjType == IPY_GameWorld.gotNPC and defObjType == IPY_GameWorld.gotPlayer:
- # EVP 境界压制
- aRealmLV, dRealmLV = GetPVERealmLVs(atkObj, defObj, atkObjType, defObjType)
- if aRealmLV + dRealmLV != 0:
- #有压制
- suppressRealm = aRealmLV - dRealmLV # 存在负数
- suppressRealmHurtPer = GetRealmHurtPer(aRealmLV, dRealmLV, 2) # 境界压制加成百分比,存在负数
- suppressFormulaKeyRealm = "EVPSuppressValueRealm"
- if suppressFormulaKeyRealm in hurtDist:
- SuppressValueRealmRate = int(eval(FormulaControl.GetCompileFormula(suppressFormulaKeyRealm, hurtDist[suppressFormulaKeyRealm])))
-
- elif atkObjType == IPY_GameWorld.gotPlayer and defObjType == IPY_GameWorld.gotNPC:
- # PVE 境界压制
- aRealmLV, dRealmLV = GetPVERealmLVs(atkObj, defObj, atkObjType, defObjType)
- if aRealmLV + dRealmLV != 0:
- #有压制
- suppressRealm = aRealmLV - dRealmLV # 存在负数
- suppressRealmHurtPer = GetRealmHurtPer(aRealmLV, dRealmLV, 3) # 境界压制加成百分比,存在负数
- suppressFormulaKeyRealm = "PVESuppressValueRealm"
- if suppressFormulaKeyRealm in hurtDist:
- SuppressValueRealmRate = int(eval(FormulaControl.GetCompileFormula(suppressFormulaKeyRealm, hurtDist[suppressFormulaKeyRealm])))
+ # 境界压制规则
+ # 1. 其中一方无境界等级则无效, 如普通NPC
+ # 2. 宠物和召唤兽(如水元素)有效, 取主人
+ # 3. 玩家地境界低于BOSS则伤害固定为1 (在函数入口处已处理)
+ # 4. 其他情况统一境界压制 境界差*2%
+ if aRealmLV == 0 or dRealmLV == 0:
+ SuppressValueRealmRate = 10000
+ else:
+ SuppressValueRealmRate = int(eval(FormulaControl.GetCompileFormula("SuppressValueRealm", hurtDist["SuppressValueRealm"])))
# 骑宠争夺最终伤害衰减
if defObjType == IPY_GameWorld.gotNPC and FamilyRobBoss.IsHorsePetRobBoss(defObj.GetNPCID()):
- ownerPlayer = None
- # 召唤兽和宠物需要从人物获取状态
- if atkObj.GetGameObjType() == IPY_GameWorld.gotNPC:
- if atkObj.GetGameNPCObjType() == IPY_GameWorld.gnotPet:
- ownerPlayer = PetControl.GetPetOwner(atkObj)
- elif atkObj.GetGameNPCObjType() == IPY_GameWorld.gnotSummon:
- ownerPlayer = NPCCommon.GetSummonNPCOwner(IPY_GameWorld.gotPlayer, atkObj)
- else:
- ownerPlayer = atkObj
+ ownerPlayer, npcObjType = GetAttackPlayer(atkObj)
if ownerPlayer:
findBuff = SkillCommon.FindBuffByID(ownerPlayer, ChConfig.Def_SkillID_HorsePetRobBossKillCntBuff)[0]
@@ -2261,14 +2232,20 @@
# 获取双方境界值
def GetPVERealmLVs(atkObj, defObj, atkObjType, defObjType):
if atkObjType == IPY_GameWorld.gotNPC:
- aRealmLV = NPCCommon.GetRealmLV(atkObj)
- if aRealmLV == 0:
- # 0代表不要压制
- return 0, 0
+ ownerPlayer, npcObjType = GetAttackPlayer(atkObj)
+ if ownerPlayer:
+ # 召唤兽和宠物取主人境界,可以是攻击方需提取
+ aRealmLV = ownerPlayer.GetOfficialRank()
+ else:
+ aRealmLV = NPCCommon.GetRealmLV(atkObj)
+ if aRealmLV == 0:
+ # 0代表不要压制
+ return 0, 0
else:
aRealmLV = atkObj.GetOfficialRank()
if defObjType == IPY_GameWorld.gotNPC:
+ # 召唤兽和宠物取主人境界,但是宠物和人物召唤兽不可被攻击,故不需要
dRealmLV = NPCCommon.GetRealmLV(defObj)
if dRealmLV == 0:
# 0代表不要压制
--
Gitblit v1.8.0