From dbf479ac2d1d2a1587fd9a984ac84a16ad0bb3d6 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 07 一月 2026 12:04:02 +0800
Subject: [PATCH] 271 【内政】古宝系统-服务端(增加特殊效果类型3~6;新增特权效果支持,增加特权效果类型1、2;)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTravel.py | 6 +++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MainLevelBoss.py | 3 +
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Zhanchui.py | 8 ++++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGubao.py | 49 +++++++++++++++++++-----
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py | 10 ++++-
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py | 10 ++++
PySysDB/PySysDBPY.h | 4 ++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldInvest.py | 17 ++++++++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Tianzi.py | 2 +
9 files changed, 96 insertions(+), 13 deletions(-)
diff --git a/PySysDB/PySysDBPY.h b/PySysDB/PySysDBPY.h
index dcb842c..9e2be1a 100644
--- a/PySysDB/PySysDBPY.h
+++ b/PySysDB/PySysDBPY.h
@@ -942,6 +942,10 @@
BYTE SpecAttrID; //特殊属性ID
DWORD SpecAttrValue; //特殊属性初始值
DWORD SpecAttrPerStarAdd; //特殊属性每星成长
+ BYTE PowerType; //特权效果类型
+ DWORD PowerTypeValue; //特权类型值
+ DWORD PowerValue; //特权初始值
+ DWORD PowerPerStarAdd; //特权每星值成长
};
//古宝共鸣属性表
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MainLevelBoss.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MainLevelBoss.py
index 06f3eef..277db19 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MainLevelBoss.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MainLevelBoss.py
@@ -16,6 +16,7 @@
#-------------------------------------------------------------------------------
import GameWorld
+import PlayerGubao
import IpyGameDataPY
import PlayerControl
import ItemControler
@@ -129,4 +130,6 @@
GameWorld.DebugLog("未通关的刷怪进度设置为下一关的第1波: updNowValue=%s" % updNowValue, playerID)
GameWorld.DebugLog("updPassValue=%s,updNowValue=%s" % (updPassValue, updNowValue), playerID)
ItemControler.GivePlayerItemOrMail(curPlayer, itemList, event=["MainLevelBoss", False, {}], isNotifyAward=False)
+
+ PlayerGubao.AddGubaoSpecEffLayer(curPlayer, PlayerGubao.GubaoEffType_MainLevelBoss, 1)
return
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Tianzi.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Tianzi.py
index e757c36..8369bd8 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Tianzi.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Tianzi.py
@@ -26,6 +26,7 @@
import DataRecordPack
import NetPackCommon
import IpyGameDataPY
+import PlayerGubao
import ShareDefine
import PlayerTask
import PlayerMail
@@ -261,6 +262,7 @@
def __onFBTianzi(curPlayer):
PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_FBTianzi)
PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_OSAFBTianzi, 1)
+ PlayerGubao.AddGubaoSpecEffLayer(curPlayer, PlayerGubao.GubaoEffType_Tianzi, 1)
return
def SyncTianziInfo(curPlayer, lineID=None, bossID=None):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Zhanchui.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Zhanchui.py
index 7a42828..7a2442a 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Zhanchui.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_Zhanchui.py
@@ -16,6 +16,7 @@
#-------------------------------------------------------------------------------
import GameWorld
+import PlayerGubao
import ItemControler
import PlayerBeauty
import FBCommon
@@ -58,6 +59,7 @@
PlayerTask.UpdTaskValue(curPlayer, ChConfig.TaskType_FBZhanchui)
#PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_OSAFBZhanchui, 1)
+ __onFBAward(curPlayer)
return
def OnPlayerFBSweepAsk(curPlayer, mapID, lineID, sweepCnt, dataEx):
@@ -90,4 +92,10 @@
FBCommon.NotifyFBOver(curPlayer, mapID, lineID, isPass, overDict)
PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_OSAFBZhanchui, 1)
+ __onFBAward(curPlayer)
return True
+
+def __onFBAward(curPlayer):
+ ## 过关、扫荡都算
+ PlayerGubao.AddGubaoSpecEffLayer(curPlayer, PlayerGubao.GubaoEffType_Zhanchui, 1)
+ return
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
index ad79630..bb942f6 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -790,6 +790,10 @@
("BYTE", "SpecAttrID", 0),
("DWORD", "SpecAttrValue", 0),
("DWORD", "SpecAttrPerStarAdd", 0),
+ ("BYTE", "PowerType", 0),
+ ("DWORD", "PowerTypeValue", 0),
+ ("DWORD", "PowerValue", 0),
+ ("DWORD", "PowerPerStarAdd", 0),
),
"GubaoResonanceAttr":(
@@ -3353,7 +3357,11 @@
def GetSpecEffLayerMax(self): return self.attrTuple[8] # 特殊效果最大层数 BYTE
def GetSpecAttrID(self): return self.attrTuple[9] # 特殊属性ID BYTE
def GetSpecAttrValue(self): return self.attrTuple[10] # 特殊属性初始值 DWORD
- def GetSpecAttrPerStarAdd(self): return self.attrTuple[11] # 特殊属性每星成长 DWORD
+ def GetSpecAttrPerStarAdd(self): return self.attrTuple[11] # 特殊属性每星成长 DWORD
+ def GetPowerType(self): return self.attrTuple[12] # 特权效果类型 BYTE
+ def GetPowerTypeValue(self): return self.attrTuple[13] # 特权类型值 DWORD
+ def GetPowerValue(self): return self.attrTuple[14] # 特权初始值 DWORD
+ def GetPowerPerStarAdd(self): return self.attrTuple[15] # 特权每星值成长 DWORD
# 古宝共鸣属性表
class IPY_GubaoResonanceAttr():
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldInvest.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldInvest.py
index afa61f1..0baf95c 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldInvest.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldInvest.py
@@ -21,6 +21,7 @@
import ChPyNetSendPack
import ItemControler
import PlayerControl
+import PlayerGubao
import PlayerMail
import ChConfig
@@ -264,6 +265,22 @@
if not rewardItemList:
return
+ if investType == ChConfig.InvestType_Month:
+ # 古宝月卡奖励双倍特权
+ exItemList = []
+ gubaoExSign = 10 # 标记古宝额外奖励
+ for itemInfo in rewardItemList:
+ itemID, itemCount = itemInfo[:2]
+ addPer = PlayerGubao.GetGubaoPowerValue(curPlayer, PlayerGubao.GubaoPowerType_InvestMonthAwardPer, itemID)
+ if not addPer:
+ continue
+ countEx = int(itemCount * addPer / 100.0)
+ if not countEx:
+ continue
+ exItemList.append([itemID, countEx, gubaoExSign])
+ if exItemList:
+ rewardItemList += exItemList
+
if rewardIndex == 0:
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_InvestRewardTime % (investType), int(time.time()))
GameWorld.DebugLog("更新领奖:investType=%s,rewardItemList=%s" % (investType, rewardItemList))
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGubao.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGubao.py
index 1114e28..3b63218 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGubao.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGubao.py
@@ -26,8 +26,17 @@
import PlayerOnline
import ChConfig
+# 特殊效果类型
GubaoEffType_GoldRush = 1 # 参与淘金
GubaoEffType_Arena = 2 # 参与演武场
+GubaoEffType_Tianzi = 3 # 每参加1次天子的考验
+GubaoEffType_MainLevelBoss = 4 # 每击败1只主线BOSS
+GubaoEffType_Zhanchui = 5 # 每完成1次白骨盈野
+GubaoEffType_Travel = 6 # 每游历1次(消耗体力)
+
+# 特权效果类型
+GubaoPowerType_TravelMultiRate = 1 # 游历双倍奖励概率
+GubaoPowerType_InvestMonthAwardPer = 2 # 月卡领取额外奖励
def GetGubaoInfo(curPlayer, gubaoID):
info = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GubaoInfo % gubaoID)
@@ -247,6 +256,7 @@
playerID = curPlayer.GetPlayerID()
attrDict = {}
+ powerDict = {}
gubaoStarDict = {}
ipyDataMgr = IpyGameDataPY.IPY_Data()
@@ -271,12 +281,12 @@
perStarAdd = BaseAttrPerStarAddList[bIndex]
attrValue = baseValue + perStarAdd * star
attrDict[attrID] = attrDict.get(attrID, 0) + attrValue
- GameWorld.DebugLog("古宝基础属性! gubaoID=%s,star=%s,addAttr=%s,v:%s,perStar:%s,%s"
- % (gubaoID, star, BaseAttrIDList, BaseAttrValueList, BaseAttrPerStarAddList, attrDict), playerID)
+ #GameWorld.DebugLog("古宝基础属性! gubaoID=%s,star=%s,addAttr=%s,v:%s,perStar:%s,%s"
+ # % (gubaoID, star, BaseAttrIDList, BaseAttrValueList, BaseAttrPerStarAddList, attrDict), playerID)
# 特殊属性
attrID = ipyData.GetSpecAttrID()
- effType = ipyData.GetSpecEffType()
+ #effType = ipyData.GetSpecEffType()
layerMax = ipyData.GetSpecEffLayerMax()
SpecAttrValue = ipyData.GetSpecAttrValue()
SpecAttrPerStarAdd = ipyData.GetSpecAttrPerStarAdd()
@@ -292,9 +302,19 @@
layer, layerMax = 1, 1 # 无层级限制的默认1层
attrValue = int((SpecAttrValue + SpecAttrPerStarAdd * star + specLVAttr / float(layerMax)) * layer)
attrDict[attrID] = attrDict.get(attrID, 0) + attrValue
- GameWorld.DebugLog("古宝特殊属性! gubaoID=%s,quality=%s,lv=%s,star=%s,effType=%s,layer=%s/%s,attrID=%s,v=%s,perStar=%s,specLVAttr=%s,attrValue=%s,%s"
- % (gubaoID, quality, lv, star, effType, layer, layerMax, attrID, SpecAttrValue, SpecAttrPerStarAdd, specLVAttr, attrValue, attrDict), playerID)
+ #GameWorld.DebugLog("古宝特殊属性! gubaoID=%s,quality=%s,lv=%s,star=%s,effType=%s,layer=%s/%s,attrID=%s,v=%s,perStar=%s,specLVAttr=%s,attrValue=%s,%s"
+ # % (gubaoID, quality, lv, star, effType, layer, layerMax, attrID, SpecAttrValue, SpecAttrPerStarAdd, specLVAttr, attrValue, attrDict), playerID)
+ # 特权
+ powerType = ipyData.GetPowerType()
+ if powerType:
+ powerTypeValue = ipyData.GetPowerTypeValue()
+ powerValue = ipyData.GetPowerValue()
+ powerPerStarAdd = ipyData.GetPowerPerStarAdd()
+ powerValueTotal = powerValue + powerPerStarAdd * star
+ powerKey = (powerType, powerTypeValue)
+ powerDict[powerKey] = powerDict.get(powerKey, 0) + powerValueTotal
+
# 共鸣
for index in range(ipyDataMgr.GetGubaoResonanceCount()):
ipyData = ipyDataMgr.GetGubaoResonanceByIndex(index)
@@ -317,7 +337,7 @@
resonanceAttrIpyData = attrIpyData
if not resonanceAttrIpyData:
- GameWorld.DebugLog("没有古宝共鸣属性! resonanceID=%s,minStar=%s,starList=%s" % (resonanceID, minStar, starList), playerID)
+ #GameWorld.DebugLog("没有古宝共鸣属性! resonanceID=%s,minStar=%s,starList=%s" % (resonanceID, minStar, starList), playerID)
continue
resonanceAttrIDList = resonanceAttrIpyData.GetResonanceAttrIDList()
@@ -325,15 +345,24 @@
for i, attrID in enumerate(resonanceAttrIDList):
attrValue = resonanceAttrValueList[i]
attrDict[attrID] = attrDict.get(attrID, 0) + attrValue
- GameWorld.DebugLog("古宝共鸣: resonanceID=%s,resonanceStar=%s,starList=%s,addAttr=%s,%s,%s"
- % (resonanceID, resonanceAttrIpyData.GetResonanceStar(), starList,
- resonanceAttrIDList, resonanceAttrValueList, attrDict), playerID)
+ #GameWorld.DebugLog("古宝共鸣: resonanceID=%s,resonanceStar=%s,starList=%s,addAttr=%s,%s,%s"
+ # % (resonanceID, resonanceAttrIpyData.GetResonanceStar(), starList,
+ # resonanceAttrIDList, resonanceAttrValueList, attrDict), playerID)
# 保存计算值
GameWorld.DebugLog("古宝属性: %s" % attrDict, playerID)
- PlayerOnline.GetOnlinePlayer(curPlayer).SetCalcAttr(ChConfig.Def_CalcAttr_Gubao, attrDict)
+ GameWorld.DebugLog("古宝特权: %s" % powerDict, playerID)
+ PlayerOnline.GetOnlinePlayer(curPlayer).SetCalcAttr(ChConfig.Def_CalcAttr_Gubao, attrDict, powerDict)
return
+def GetGubaoPowerValue(curPlayer, powerType, powerTypeValue=0):
+ ## 获取古宝特权值
+ powerDict = PlayerOnline.GetOnlinePlayer(curPlayer).GetCalcSpecInfo(ChConfig.Def_CalcAttr_Gubao)
+ powerKey = (powerType, powerTypeValue)
+ if powerKey not in powerDict:
+ return 0
+ return powerDict[powerKey]
+
def AddGubaoSpecEffLayer(curPlayer, effType, addLayer):
## 增加古宝特殊效果属性层级
gubaoIDList = []
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py
index df14000..622f31a 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py
@@ -157,7 +157,8 @@
self.curPlayer = None
# 属性、阵容
- self._calcAttrDict = {} # 非武将功能点属性统计 {calcIndex:{attrID:value, ...}, ...}
+ self._calcAttrDict = {} # 功能点属性统计 {calcIndex:{attrID:value, ...}, ...}
+ self._calcSpecEffDict = {} # 功能点特殊效果统计 {calcIndex:effInfo, ...}
self._lineupDict = {} # 上阵阵容 {lineupID:Lineup, ...}
self._effectiveCardDict = {} # 加成属性生效的武将卡牌信息 {heroID:[cardAddPer, itemIndex, inMain], ...}
@@ -202,10 +203,14 @@
def SetEffectiveCardDict(self, effectiveCardDict): self._effectiveCardDict = effectiveCardDict
def GetEffectiveCardDict(self): return self._effectiveCardDict
+ def GetCalcSpecInfo(self, calcIndex): return self._calcSpecEffDict.get(calcIndex, {})
def GetCalcAttr(self, calcIndex): return self._calcAttrDict.get(calcIndex, {})
- def SetCalcAttr(self, calcIndex, attrDict):
+ def SetCalcAttr(self, calcIndex, attrDict, specEffInfo=None):
## 设置某个功能点计算的属性
+ # @param specEffDict: 特殊效果缓存,功能自定义数据结构
self._calcAttrDict[calcIndex] = attrDict
+ if specEffInfo != None:
+ self._calcSpecEffDict[calcIndex] = specEffInfo
return
def ReCalcAllAttr(self):
@@ -214,6 +219,7 @@
GameWorld.DebugLog("ReCalcAllAttr...", self.playerID)
self._calcAttrDict = {}
+ self._calcSpecEffDict = {}
self._lineupDict = {}
self._effectiveCardDict = {}
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTravel.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTravel.py
index 3f83ad7..6275bc3 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTravel.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTravel.py
@@ -22,6 +22,7 @@
import NetPackCommon
import ItemControler
import PlayerBeauty
+import PlayerGubao
import GameWorld
import random
@@ -257,6 +258,9 @@
GameWorld.DebugLog("更新体力: energy=%s,travelCnt=%s" % (energy, travelCnt))
CheckTravelEnergyRecover(curPlayer, False)
SyncTravelInfo(curPlayer, [[row, col]], Result_Comm)
+
+ PlayerGubao.AddGubaoSpecEffLayer(curPlayer, PlayerGubao.GubaoEffType_Travel, 1)
+
else:
__doClickGridEvent(curPlayer, row, col)
@@ -304,6 +308,8 @@
if awardItemID:
multiRate = IpyGameDataPY.GetFuncCfg("TravelRate", 2)
+ multiRate += PlayerGubao.GetGubaoPowerValue(curPlayer, PlayerGubao.GubaoPowerType_TravelMultiRate)
+ GameWorld.DebugLog("multiRate=%s" % multiRate)
if GameWorld.CanHappen(multiRate):
multi = 2
SetGridMulti(curPlayer, row, col, multi)
--
Gitblit v1.8.0