From 21633503720673ff5d9074a3126e9ed652178594 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 13 十月 2025 15:17:47 +0800
Subject: [PATCH] 129 【战斗】战斗系统-服务端(优化战斗结算时机,修复某个阵营全部被击杀后在某些情况下不会马上结算的bug;)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py | 274 ++++++++----------------------------------------------
1 files changed, 41 insertions(+), 233 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py
index 2208fd5..84f9426 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py
@@ -32,7 +32,6 @@
import DataRecordPack
#import ChItem
import ShareDefine
-import PlayerGreatMaster
import PlayerHorse
import GameObj
import random
@@ -46,7 +45,7 @@
import FBCommon
import IpyGameDataPY
import PyGameData
-import EventShell
+import TurnAttack
#---------------------------------------------------------------------
GameWorld.ImportAll("Script\\Skill\\" , "GameSkills")
GameWorld.ImportAll("Script\\Skill\\" , "GameBuffs")
@@ -636,42 +635,6 @@
return True
-
-##弓和弩普攻技能
-# @param curPlayer 玩家实例
-# @param skillID 技能ID
-# @return 特别的普攻ID
-#===============================================================================
-# def GetBowNormalAttackID(curPlayer, skillID):
-# #刷新人物攻击距离
-# playerEquip = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
-# #获得当前人物使用的武器
-# curUseWeapon = playerEquip.GetAt(ShareDefine.retWeapon)
-# curUseWeapon2 = playerEquip.GetAt(ShareDefine.retWeapon2)
-# #空手
-# if curUseWeapon.IsEmpty() and curUseWeapon2.IsEmpty():
-# return skillID
-#
-# if curUseWeapon.GetType() in [ChConfig.Def_ItemType_Crossbow, ChConfig.Def_ItemType_Bow]:
-# curEffect = ItemCommon.GetItemEffectByEffectID(curUseWeapon, ChConfig.Def_Effect_WeaponAttack)
-# if curEffect == None:
-# GameWorld.DebugAnswer(curPlayer, '没有物品效果ID %s'%ChConfig.Def_Effect_WeaponAttack)
-# return skillID
-#
-# return curEffect.GetEffectValue(0)
-#
-# if curUseWeapon2.GetType() in [ChConfig.Def_ItemType_Crossbow, ChConfig.Def_ItemType_Bow]:
-# curEffect = ItemCommon.GetItemEffectByEffectID(curUseWeapon2, ChConfig.Def_Effect_WeaponAttack)
-# if curEffect == None:
-# GameWorld.DebugAnswer(curPlayer, '没有物品效果ID %s'%ChConfig.Def_Effect_WeaponAttack)
-# return skillID
-#
-# return curEffect.GetEffectValue(0)
-#
-# return skillID
-#===============================================================================
-
-
#===============================================================================
# //B4 02 对象击退 #tagCMNPCBeatBack
#
@@ -745,29 +708,29 @@
continue
npcObj.StopMove()
npcObj.ChangePos(npcPos.PosX, npcPos.PosY)
- BeatBackMove(curPlayer, npcObj)
+ #BeatBackMove(curPlayer, npcObj)
return
-# 针对NPC被推出远距离一直卡墙角问题,法宝挑战副本特殊处理为超过4米 NPC自动回退一些
-def BeatBackMove(curPlayer, npcObj):
- if GameWorld.GetMap().GetMapID() != ChConfig.Def_FBMapID_MagicWeapon:
- return
- if npcObj.GetCurAction() == IPY_GameWorld.laNPCSkillWarning:
- return
-
- posMap = npcObj.GetRefreshPosAt(npcObj.GetCurRefreshPointIndex())
- if not posMap:
- return
- #范围校验
- posMapX = posMap.GetPosX()
- posMapY = posMap.GetPosY()
- if GameWorld.GetDist(npcObj.GetPosX(), npcObj.GetPosY(), posMapX, posMapY) < 8:
- # 单次位移不超过5米
- return
- npcControl = NPCCommon.NPCControl(npcObj)
- moveDestX, moveDestY = npcControl.GetMoveNearPosEx(posMapX, posMapY, 5)
- npcObj.Move(moveDestX, moveDestY)
- return
+## 针对NPC被推出远距离一直卡墙角问题,法宝挑战副本特殊处理为超过4米 NPC自动回退一些
+#def BeatBackMove(curPlayer, npcObj):
+# if GameWorld.GetMap().GetMapID() != ChConfig.Def_FBMapID_MagicWeapon:
+# return
+# if npcObj.GetCurAction() == IPY_GameWorld.laNPCSkillWarning:
+# return
+#
+# posMap = npcObj.GetRefreshPosAt(npcObj.GetCurRefreshPointIndex())
+# if not posMap:
+# return
+# #范围校验
+# posMapX = posMap.GetPosX()
+# posMapY = posMap.GetPosY()
+# if GameWorld.GetDist(npcObj.GetPosX(), npcObj.GetPosY(), posMapX, posMapY) < 8:
+# # 单次位移不超过5米
+# return
+# npcControl = NPCCommon.NPCControl(npcObj)
+# moveDestX, moveDestY = npcControl.GetMoveNearPosEx(posMapX, posMapY, 5)
+# npcObj.Move(moveDestX, moveDestY)
+# return
#===============================================================================
# //B4 03 吸引NPC仇恨 #tagNPCAttention
@@ -1389,10 +1352,6 @@
if GameObj.GetHP(curPlayer) <= 0:
return
- if curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene):
- #GameWorld.DebugLog("自定义场景中,不检查!")
- return True
-
#===========================================================================
# if curPlayer.IsMoving():
# GameWorld.DebugLog("移动中不可使用技能")
@@ -1898,7 +1857,6 @@
#获得技能等级
curSkillLV = curSkill.GetSkillLV()
DataRecordPack.DR_LearnORUPSkill(curPlayer, curSkillID, curSkillLV)
- EventShell.EventRespons_SkillUp(curPlayer, curSkill.GetFuncType(), curSkillLV)
GameWorld.Log("升级技能名 = %s 成功, 当前等级 = %s"%(curSkill.GetSkillName(), curSkill.GetSkillLV()), curPlayer.GetPlayerID())
return True
@@ -1928,9 +1886,9 @@
# if not PlayerHorse.CheckLearnHorseSkill(curPlayer, curSkillTypeID):
# return False
#天赋技学习点数判断
- if upSkill.GetFuncType() == ChConfig.Def_SkillFuncType_GiftSkill:
- if not PlayerGreatMaster.GetGreatMasterFreeSkillPoint(curPlayer):
- return False
+ #if upSkill.GetFuncType() == ChConfig.Def_SkillFuncType_GiftSkill:
+ # if not PlayerGreatMaster.GetGreatMasterFreeSkillPoint(curPlayer):
+ # return False
#经验检测
skillLvUpNeedExp = upSkill.GetLVUpCostExp()
@@ -1995,8 +1953,8 @@
#GeRen_jin_474794 <n color="255,255,0" BKCOLOR="0,0,0">您消耗了经验值:</n><n color="0,190,255" BKCOLOR="0,0,0">{%S1%}</n>
PlayerControl.NotifyCode(curPlayer, "GeRen_jin_474794", [skillLvUpNeedExp])
- if upSkill.GetFuncType() == ChConfig.Def_SkillFuncType_GiftSkill:
- PlayerGreatMaster.AddGreatMasterSkillPointByLV(curPlayer, -1)
+ #if upSkill.GetFuncType() == ChConfig.Def_SkillFuncType_GiftSkill:
+ # PlayerGreatMaster.AddGreatMasterSkillPointByLV(curPlayer, -1)
return True
#---------------------------------------------------------------------
##检测学习技能需求条件
@@ -2071,11 +2029,11 @@
needBaseAttrID, needBaseAttrValue = GetSkillUpNeedAttr(stateSkillLV)
if needBaseAttrID and needBaseAttrValue:
baseAttrDict = {
- ShareDefine.Def_Effect_Metal:PlayerControl.GetMetal(curPlayer),
- ShareDefine.Def_Effect_Wood:PlayerControl.GetWood(curPlayer),
- ShareDefine.Def_Effect_Water:PlayerControl.GetWater(curPlayer),
- ShareDefine.Def_Effect_Fire:PlayerControl.GetFire(curPlayer),
- ShareDefine.Def_Effect_Earth:PlayerControl.GetEarth(curPlayer),
+ #ShareDefine.Def_Effect_Metal:PlayerControl.GetMetal(curPlayer),
+ #ShareDefine.Def_Effect_Wood:PlayerControl.GetWood(curPlayer),
+ #ShareDefine.Def_Effect_Water:PlayerControl.GetWater(curPlayer),
+ #ShareDefine.Def_Effect_Fire:PlayerControl.GetFire(curPlayer),
+ #ShareDefine.Def_Effect_Earth:PlayerControl.GetEarth(curPlayer),
}
if needBaseAttrID not in baseAttrDict:
GameWorld.ErrLog(' 技能升级属性点条件配置错误,curSkillTypeID=%s,needBaseAttrID=%s'%(curSkillTypeID, needBaseAttrID))
@@ -2132,7 +2090,6 @@
skillElementType = GetSkillElementType(nextSkill)
#可升级则激活升一级
- EventShell.EventRespons_ElementSkill(curPlayer, mainSkillID, skillElementType, updSelectSkillLV)
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SkillElementLV % selectSkillID, updSelectSkillLV)
if curElementSkillID == selectSkillID:
#正在使用的专精技能,则立即生效
@@ -2209,11 +2166,11 @@
if skillTypeID not in PyGameData.g_elemntSkillDict:
return isNotify, hasChangeLV
baseAttrDict = {
- ShareDefine.Def_Effect_Metal:PlayerControl.GetMetal(curPlayer),
- ShareDefine.Def_Effect_Wood:PlayerControl.GetWood(curPlayer),
- ShareDefine.Def_Effect_Water:PlayerControl.GetWater(curPlayer),
- ShareDefine.Def_Effect_Fire:PlayerControl.GetFire(curPlayer),
- ShareDefine.Def_Effect_Earth:PlayerControl.GetEarth(curPlayer),
+ #ShareDefine.Def_Effect_Metal:PlayerControl.GetMetal(curPlayer),
+ #ShareDefine.Def_Effect_Wood:PlayerControl.GetWood(curPlayer),
+ #ShareDefine.Def_Effect_Water:PlayerControl.GetWater(curPlayer),
+ #ShareDefine.Def_Effect_Fire:PlayerControl.GetFire(curPlayer),
+ #ShareDefine.Def_Effect_Earth:PlayerControl.GetEarth(curPlayer),
}
activeSkillLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SkillElementLV % skillTypeID)
limitInfoList = PyGameData.g_elemntSkillDict[skillTypeID]
@@ -2462,32 +2419,6 @@
continue
callBuffProcessFunc(curObj, curBuff, curEffect, processBuffTick, tick)
-
- #执行ProcessBuff中设定的玩家字典
- __DoProcessBuff_PlayerKey(curObj, tick)
-
-#---------------------------------------------------------------------
-##执行ProcessBuff中设定的玩家字典
-# @param curObj 对象
-# @param tick 时间戳
-# @return 返回值无意义
-# @remarks 执行ProcessBuff中设定的玩家字典
-def __DoProcessBuff_PlayerKey(curObj, tick):
-#===============================================================================
-# if curObj.GetDictByKey(ChConfig.Def_Player_ProBuff_TruckSpeedUp):
-# skillID = curObj.GetDictByKey(ChConfig.Def_Player_ProBuff_TruckSpeedUp)
-# #本来buff类型是11, 但是骠车没有物品buff, 所以改为8
-# buffType = IPY_GameWorld.bfAura
-# #给自己的镖车加buff
-# curSkill = GameWorld.GetGameData().GetSkillBySkillID(skillID)
-# if not curSkill:
-# GameWorld.Log('###镖车Buff技能ID异常 = %s'%(skillID))
-# return
-#
-# BuffSkill.DoAddBuff(curObj.GetTruck() , buffType, curSkill, tick, 0, curObj)
-# curObj.SetDict(ChConfig.Def_Player_ProBuff_TruckSpeedUp , 0)
-#===============================================================================
- return
#---------------------------------------------------------------------
##持续性buff的伤害效果
@@ -2658,8 +2589,8 @@
# @remarks 刷新玩家场景状态
def ProcessPlayerAreaState(curPlayer):
#初始化所有的场景buff状态
- playerControl = PlayerControl.PlayerControl(curPlayer)
- playerControl.InitMapBuffState()
+ #playerControl = PlayerControl.PlayerControl(curPlayer)
+ #playerControl.InitMapBuffState()
buffManager = curPlayer.GetMapBuff()
@@ -2685,89 +2616,6 @@
callFunc(curPlayer, curEffect)
return
-#---------------------------------------------------------------------
-##添加装备触发的Buff
-# @param curPlayer 玩家实例
-# @param curEquip 装备实例
-# @return 返回值无意义
-# @remarks 添加装备触发的Buff
-def RefreshSkillBuffByEquip(curPlayer, curEquip) :
- #一般装备新增Buff
- __DoEquip_AddBuff(curPlayer, curEquip)
- return
-
-#---------------------------------------------------------------------
-##添加装备触发的Buff, 一般装备新增Buff
-# @param curPlayer 玩家实例
-# @param curEquip 装备实例
-# @return 返回值无意义
-# @remarks 添加装备触发的Buff, 一般装备新增Buff
-def __DoEquip_AddBuff(curPlayer, curEquip):
- gameData = GameWorld.GetGameData()
- playerVehicle = curPlayer.GetPlayerVehicle()
- houseState = curPlayer.GetPlayerRidehorseState()
-
- for index in range(0 , curEquip.GetAddSkillCount()):
- curSkillID = curEquip.GetAddSkill(index)
-
- if curSkillID == 0:
- continue
-
- #通过技能ID获得使用技能
- curSkill = gameData.GetSkillBySkillID(curSkillID)
-
- if curSkill == None :
- GameWorld.Log("装备触发技能,物品表错误 curSkillID = %s"%(curSkillID) , curPlayer.GetPlayerID())
- continue
-
- #骑马触发技能
- houseSkill = ChConfig.Def_Skill_TypeID_Speed
- curSkillType = curSkill.GetSkillTypeID()
-
- if not SkillCommon.IsBuff(curSkill):
- continue
-
- if curSkillType in houseSkill:
- #不使用,不添加buff
- if playerVehicle != IPY_GameWorld.pvHorse :
- continue
-
- if curSkillType == houseSkill[0] and houseState != IPY_GameWorld.prsNormal :
- continue
-
- if curSkillType == houseSkill[1] and houseState != IPY_GameWorld.prsRun :
- continue
-
- #添加Buff
- BuffSkill.AddBuffNoRefreshState(curPlayer, IPY_GameWorld.bfEquipBuff, curSkill, 0, [], buffOwner = curPlayer)
-
- return
-#---------------------------------------------------------------------
-##刷新buff的效果
-# @param buffState Buff管理器
-# @param sameEffectCanWork 是否可以叠加相同效果, <sameEffectCanWork> : 效果是否可以叠加, 默认为否
-# @return 返回值无意义
-# @remarks 刷新buff的效果 (参数 -> buff管理器,是否叠加)
-def __RefreshSkillBuffEffect(buffState, sameEffectCanWork = False):
- return
- #===========================================================================
- # buffState.ClearEffects()
- # for buffIndex in range(0, buffState.GetBuffCount()):
- # curBuff = buffState.GetBuff(buffIndex)
- # buffValue = curBuff.GetValue()
- # curSkill = curBuff.GetSkill()
- # skillID = curSkill.GetSkillID()
- # if skillID == 0:
- # continue
- #
- # for effectIndex in range(0, curSkill.GetEffectCount()):
- # curEffect = curSkill.GetEffect(effectIndex)
- # effectID = curEffect.GetEffectID()
- # if effectID == 0:
- # continue
- #
- # buffState.AddEffect(curEffect, buffValue, skillID, curBuff.GetOwnerID(), curBuff.GetOwnerType())
- #===========================================================================
#---------------------------------------------------------------------
##计算效果值
@@ -2871,35 +2719,6 @@
return ChConfig.Def_CalcAttrIndexDict[(isBaseEff, calcType)]
-
-##刷新玩家所有影响属性的Buff,添加时只重计算同类型BUFF,删除时刷新所有类型BUFF
-# @param curPlayer 玩家实例
-# @param buffType buff类型 -1代表全部刷性
-# @return 返回值无意义
-def RefreshPlayerBuffOnAttrAddEffect(curPlayer, buffType=-1):
- return
-#===============================================================================
-# GameWorld.DebugLog("Start RefreshPlayerBuffOnAttrAddEffect!!!")
-#
-# #[[BuffState, CanPileup]]
-# if buffType == -1:
-# buffRefreshList = [
-# [curPlayer.GetBuffState(), False], [curPlayer.GetDeBuffState(), False],
-# [curPlayer.GetAura(), False], [curPlayer.GetIncBuff(), True],
-# [curPlayer.GetPassiveBuf(), True], [curPlayer.GetEquipBuff(), True],
-# ]
-# else:
-# #只重计算改变的BUFF, 这里不防范非属性类型BUFF外层过滤
-# buffManagerInfo = SkillCommon.GetBuffManagerByBuffType(curPlayer, buffType)
-# buffRefreshList = [[buffManagerInfo[0], buffManagerInfo[2]]]
-#
-# #执行刷新逻辑
-# __DoRefreshBuff(buffRefreshList)
-#
-# return
-#===============================================================================
-
-
# 通过技能ID删除buff对应的效果ID
def ClearBuffEffectBySkillID(curObj, skillID, ownerID, ownerType):
curSkill = GameWorld.GetGameData().GetSkillBySkillID(skillID)
@@ -3000,18 +2819,6 @@
for i in effectIndexList:
buffState.DeleteEffectByIndex(i)
-
-
-##刷新管理器中的Buff
-# @param buffRefreshList Buff刷新列表[[BuffState, CanPileup]]
-# @return 返回值无意义
-# @remarks 按照叠加规则, 刷新指定管理中的Buff
-def __DoRefreshBuff(buffRefreshList):
- for buffState, canPileUp in buffRefreshList:
- __RefreshSkillBuffEffect(buffState, canPileUp)
-
- return
-
##计算行为BUFF对人物行为状态的改变
# @param curPlayer 玩家实例
@@ -3682,7 +3489,8 @@
#调用攻击惩罚逻辑
BaseAttack.DoLogic_AttackResult(attacker, defender, None, tick)
-
+ #TurnAttack.OnTurnfightAttackResult(attacker, defender, curSkill)
+
return
#---------------------------------------------------------------------
##释放普通技能
--
Gitblit v1.8.0