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 | 112 +++++++++++++++++++++++++++++--------------------------- 1 files changed, 58 insertions(+), 54 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 8b36283..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 @@ -60,6 +56,8 @@ import PlayerFlashSale import PlayerWing import ChEquip +import PlayerYinji +import PlayerActivity #--------------------------------------------------------------------- #--------------------------------------------------------------------- @@ -565,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: @@ -600,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 @@ -622,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 @@ -681,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 @@ -849,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) + #=========================================================================== #--------------------------------------------------------------------- @@ -1081,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): @@ -1125,7 +1123,7 @@ # 没有空位,玩家主动取下,计算属性时无效化 # 过期属性时效需刷属性 return True - + result = ItemControler.PlayerItemControler(curPlayer).UnEquipItem(equipIndex, spaceIndex) if not result: # 过期属性时效需刷属性 @@ -1242,6 +1240,8 @@ #回血回魔状态处理 ProcessHPMPState(curPlayer, tick) + PlayerYinji.ProcessPlayerYinji(curPlayer, tick) + #刷新组队状态 #ProcessTeamState(curPlayer, tick) @@ -1275,6 +1275,8 @@ ProcessAreaExp(curPlayer, tick) #神秘商店刷新 FunctionNPCCommon.CheckMysticalShopRefresh(curPlayer, tick) + #活跃放置 + PlayerActivity.ProcessActivityPlace(curPlayer) #跨服数据同步,放最后 CrossPlayerData.ProcessCrossPlayer(curPlayer, tick) return @@ -1560,6 +1562,8 @@ 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: @@ -1579,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