From c9f2150adf55d0464352ac53fabaaecc572b7a37 Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期二, 14 一月 2020 14:10:48 +0800 Subject: [PATCH] 4662 【主干】boss之家内不能换层 --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerState.py | 135 +++++++++++++++++++++++++-------------------- 1 files changed, 75 insertions(+), 60 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerState.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerState.py index 981b4d0..b1a1c7d 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerState.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerState.py @@ -31,13 +31,9 @@ import ItemCommon import OperControlManager import ShareDefine -import PlayerProduce import PlayerAutoCheckOnline import PlayerGameWallow import ReadChConfig -import ChPyNetSendPack -import NetPackCommon -import DataRecordPack import PlayerViewCacheTube import PlayerDienstgrad import PlayerVip @@ -54,12 +50,14 @@ import PlayerSuccess import CrossPlayerData import PassiveBuffEffMng -import PlayerFamilyRedPacket +import FunctionNPCCommon import FormulaControl import PlayerGoldGift import PlayerFlashSale import PlayerWing import ChEquip +import PlayerYinji +import PlayerActivity #--------------------------------------------------------------------- #--------------------------------------------------------------------- @@ -137,7 +135,9 @@ if not __DoClientUseSkillEx(curPlayer, useSkillData, tick): SkillShell.AttackFailNotify(curPlayer, useSkillData) GameWorld.DebugLog("----攻击失败 可能是技能CD %s"%skillTypeID) - + # 根据策划需求 以客户端动作为标准,不可攻击状态也进入CD + BaseAttack.Sync_AttackResult(curPlayer, useSkillData) + if useSkillData and useSkillData.GetSkillID() != ChConfig.Def_SkillID_Somersault: # 跟随玩家同频率攻击 PetControl.PetFight(curPlayer, tick) @@ -563,11 +563,6 @@ elif prepareState == IPY_GameWorld.pstMissionCollecting: #任务采集 PlayerMissionCollect.EndMissionCollect(curPlayer, tick) - - elif prepareState == ShareDefine.Def_PstProduce: - #生产采集(进入生产采集状态,不再重置玩家状态) - PlayerProduce.OnProduceEnd(curPlayer, tick) - return elif prepareState == ShareDefine.Def_PstTrans: @@ -598,7 +593,7 @@ return FBLogic.OnCollecting(curPlayer, tick) npcID = curNPC.GetNPCID() - collectNPCIpyData = IpyGameDataPY.GetIpyGameData("CollectNPC", npcID) + collectNPCIpyData = IpyGameDataPY.GetIpyGameDataNotLog("CollectNPC", npcID) if collectNPCIpyData: DoCollectingLostHP(curPlayer, collectNPCIpyData, tick, False) return @@ -620,7 +615,7 @@ curPlayer.SetDict(ChConfig.Def_PlayerKey_CollectLostHPTick, tick) lostValue = int(GameObj.GetMaxHP(curPlayer) * lostHPPer / 100.0) * lostTime skillTypeID, buffOwner = 0, None - SkillCommon.SkillLostHP(curPlayer, skillTypeID, buffOwner, lostValue, tick) + SkillCommon.SkillLostHP(curPlayer, skillTypeID, buffOwner, lostValue, tick, skillAffect=False) GameWorld.DebugLog("采集掉血: npcID=%s,lostHPPer=%s,lostTime=%s,lostValue=%s" % (collectNPCIpyData.GetNPCID(), lostHPPer, lostTime, lostValue)) return @@ -679,14 +674,14 @@ # @remarks 刷新以单位时间(分钟)消耗耐久的物品 def ProcessRefreshTimeItem(curPlayer, tick): reFlash = False - + #2分钟遍历一次,时效道具时间到不消失, if tick - curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_EquipTime) \ - < ChConfig.TYPE_Player_Tick_Time[ChConfig.TYPE_Player_Tick_TimeItem] : + < ChConfig.TYPE_Player_Tick_Time[ChConfig.TYPE_Player_Tick_TimeItem]: return reFlash #耐久减少值/分钟 reFlash = ProcessTimeEquip(curPlayer, tick) - + return reFlash @@ -847,31 +842,34 @@ # @return None # @remarks 玩家自动回复XP值 def ProcessAddXP(curPlayer, tick): - #开放等级增加多少XP值, 最大XP值 - openLV, addXPValue, maxXPValue = ReadChConfig.GetEvalChConfig('PlayerXP') - #还没到开放等级 - if openLV > curPlayer.GetLV(): - return - lastTick = curPlayer.GetTickByType(ChConfig.TYPE_Player_Tick_AddXPTick) - if not CommonCheckTick(curPlayer, tick, ChConfig.TYPE_Player_Tick_AddXPTick): - #首次登陆,将当前的XP值记录到字典中 - if lastTick <= 0: - curPlayer.SetDict(ChConfig.Def_PlayerKey_RecordXPValue, curPlayer.GetXP()) - return - - #从字典中获取当前的XP值 - curXPValue = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_RecordXPValue) - #当前XP值已经是最大值了,不做处理 - if curXPValue == maxXPValue: - return - xpRestorePer = PlayerControl.GetXPRestorePer(curPlayer) - addXPValue = int(addXPValue * xpRestorePer/float(ChConfig.Def_MaxRateValue)) - nextXPValue = min(curXPValue + addXPValue, maxXPValue) - curPlayer.SetDict(ChConfig.Def_PlayerKey_RecordXPValue, nextXPValue) - #已经达到最大的XP值了,通知客户端 - if nextXPValue == maxXPValue: - #这里进行设置的时候,将会通知客户端 - curPlayer.SetXP(nextXPValue) + return + #=========================================================================== + # #开放等级增加多少XP值, 最大XP值 + # openLV, addXPValue, maxXPValue = ReadChConfig.GetEvalChConfig('PlayerXP') + # #还没到开放等级 + # if openLV > curPlayer.GetLV(): + # return + # lastTick = curPlayer.GetTickByType(ChConfig.TYPE_Player_Tick_AddXPTick) + # if not CommonCheckTick(curPlayer, tick, ChConfig.TYPE_Player_Tick_AddXPTick): + # #首次登陆,将当前的XP值记录到字典中 + # if lastTick <= 0: + # curPlayer.SetDict(ChConfig.Def_PlayerKey_RecordXPValue, curPlayer.GetXP()) + # return + # + # #从字典中获取当前的XP值 + # curXPValue = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_RecordXPValue) + # #当前XP值已经是最大值了,不做处理 + # if curXPValue == maxXPValue: + # return + # xpRestorePer = PlayerControl.GetXPRestorePer(curPlayer) + # addXPValue = int(addXPValue * xpRestorePer/float(ChConfig.Def_MaxRateValue)) + # nextXPValue = min(curXPValue + addXPValue, maxXPValue) + # curPlayer.SetDict(ChConfig.Def_PlayerKey_RecordXPValue, nextXPValue) + # #已经达到最大的XP值了,通知客户端 + # if nextXPValue == maxXPValue: + # #这里进行设置的时候,将会通知客户端 + # curPlayer.SetXP(nextXPValue) + #=========================================================================== #--------------------------------------------------------------------- @@ -1079,34 +1077,36 @@ def ProcessTimeEquip(curPlayer, tick): itemManager = curPlayer.GetItemManager() hasItemClear = False - + + classLV = 0 # 只处理非境界装备的时效物品 curPack = itemManager.GetPack(IPY_GameWorld.rptEquip) - for i in range(0, curPack.GetCount()): - curItem = curPack.GetAt(i) + for equipPlace in ChConfig.EquipPlace_LingQi: + ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classLV, equipPlace) + if not ipyData: + continue + index = ipyData.GetGridIndex() + curItem = curPack.GetAt(index) #异常物品 if not ItemCommon.CheckItemCanUse(curItem): continue - + if curItem.GetEndureReduceType() not in [ChConfig.Def_EquipReduceType_RTimeItem, - ChConfig.Def_EquipReduceType_Time]: + ChConfig.Def_EquipReduceType_Time]: continue - + #处理现实时间物品逻辑 - if __DoLogic_ProcessTimeEquip(curPlayer, curItem, i): + if __DoLogic_ProcessTimeEquip(curPlayer, curItem, index): hasItemClear = True - if hasItemClear: #装备重刷属性 - PlayerWing.CalcWingAttr(curPlayer) - ChEquip.RefreshPlayerEquipAttribute(curPlayer) - - + ChEquip.RefreshPlayerLingQiEquipAttr(curPlayer) + # 进行更新时效道具刷新时间 curPlayer.SetDict(ChConfig.Def_PlayerKey_EquipTime, tick) - return hasItemClear + #--------------------------------------------------------------------- ## 装备有效时间到了需要脱下,有效时间物品改成不消失,但是无使用效果 可出售和续费 def __DoLogic_ProcessTimeEquip(curPlayer, curItem, equipIndex): @@ -1123,14 +1123,14 @@ # 没有空位,玩家主动取下,计算属性时无效化 # 过期属性时效需刷属性 return True - + result = ItemControler.PlayerItemControler(curPlayer).UnEquipItem(equipIndex, spaceIndex) if not result: # 过期属性时效需刷属性 return True equipID = result[0] equipPlace = result[1] - if equipPlace == ShareDefine.retGuard: + if equipPlace in [ShareDefine.retGuard1, ShareDefine.retGuard2]: PlayerControl.NotifyCode(curPlayer, 'Guardian_Timeout', [equipID, spaceIndex]) elif equipPlace == ShareDefine.retWing: PlayerControl.NotifyCode(curPlayer, 'WingTiyan_Timeout') @@ -1143,9 +1143,6 @@ PlayerControl.NotifyCode(curPlayer, 'FirstGoldWPOver') PlayerGoldGift.FirstGoldTryItemOutTime(curPlayer) - # 广播卸装 - if equipIndex in ChConfig.Def_SyncEquipStateByIndex: - curPlayer.Sync_UnEquipItem(equipID, equipPlace) return True #--------------------------------------------------------------------- ##全局定时器调用, 刷新玩家状态 @@ -1243,6 +1240,8 @@ #回血回魔状态处理 ProcessHPMPState(curPlayer, tick) + PlayerYinji.ProcessPlayerYinji(curPlayer, tick) + #刷新组队状态 #ProcessTeamState(curPlayer, tick) @@ -1274,6 +1273,10 @@ PlayerFlashSale.ProcessFlashSaleMail(curPlayer, tick) #地图经验 ProcessAreaExp(curPlayer, tick) + #神秘商店刷新 + FunctionNPCCommon.CheckMysticalShopRefresh(curPlayer, tick) + #活跃放置 + PlayerActivity.ProcessActivityPlace(curPlayer) #跨服数据同步,放最后 CrossPlayerData.ProcessCrossPlayer(curPlayer, tick) return @@ -1493,6 +1496,14 @@ ProcessProDef(curPlayer, tick) return +def Sync_PKBossState(curPlayer): + psState = 1 if curPlayer.GetDictByKey(ChConfig.Def_PDict_PKStateTick) else 0 + curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_PKState, psState, False) + + bossState = 1 if curPlayer.GetDictByKey(ChConfig.Def_PDict_BossStateTick) else 0 + curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_BossState, bossState, False) + return + # 脱离PK战斗 X秒后按比例恢复 def ProcessProDef(curPlayer, tick): if PlayerControl.GetProDefHPPer(curPlayer) == 0: @@ -1547,8 +1558,12 @@ ##给场景经验 if GameWorld.IsCrossServer(): return + if curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene): + return crossMapID = PlayerControl.GetCrossMapID(curPlayer) mapID = crossMapID if crossMapID else GameWorld.GetMap().GetMapID() + if not FBLogic.OnCanGetAreaExp(curPlayer, mapID): + return neutralMapExpAwardDict = IpyGameDataPY.GetFuncEvalCfg('NeutralMapExpAward', 1, {}) expAwardInfo = GameWorld.GetDictValueByKey(neutralMapExpAwardDict, mapID) if not expAwardInfo: @@ -1568,5 +1583,5 @@ reLV = curPlayer.GetLV() worldLV = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_WorldAverageLv) addExp = eval(FormulaControl.GetCompileFormula('NeutralMapExpAward%s'%mapID, expFormula)) - PlayerControl.PlayerControl(curPlayer).AddExp(addExp) + PlayerControl.PlayerControl(curPlayer).AddExp(addExp, ShareDefine.Def_ViewExpType_SysEx) return -- Gitblit v1.8.0