From 540eced2499bf2814f3264c0d41eb0e9c52b9957 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期日, 08 二月 2026 15:33:04 +0800
Subject: [PATCH] 462 【付费活动】限时冲刺-服务端(轮回殿)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamilyTaofa.py | 169 +++++++++++++++++++++++++++++---------------------------
1 files changed, 87 insertions(+), 82 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamilyTaofa.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamilyTaofa.py
index 510f31e..5b6ec67 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamilyTaofa.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFamilyTaofa.py
@@ -78,11 +78,15 @@
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBuZhenState, 0)
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaAnger, 0)
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxUnGetCnt, 0)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaLeaveGetCnt, 0)
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxTotalGetCnt, 0)
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxLastTime, 0)
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxContribCnt, 0)
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxHurt, 0)
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxHurtEx, 0)
+ #玩家自己过天非时间过天的,需要刷新一下
+ familyID = curPlayer.GetFamilyID()
+ curFamily = DBDataMgr.GetFamilyMgr().FindFamily(familyID)
+ RefreshPlayerAwardBoxCnt(curFamily, curPlayer, unSyncIDList=[curPlayer.GetPlayerID()])
SyncTaofaInfo(curPlayer)
return
@@ -111,8 +115,8 @@
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBuZhenState, 0)
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaAnger, 0)
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxUnGetCnt, 0)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaLeaveGetCnt, 0)
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxTotalGetCnt, 0)
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxLastTime, 0)
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxContribCnt, 0)
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxHurt, 0)
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxHurtEx, 0)
@@ -121,13 +125,13 @@
SyncTaofaInfo(curPlayer)
return
-def OnFamilyMemberLeave(family, leavePlayerID, leavePlayer=None):
+def OnFamilyMemberLeave(family, leavePlayerID):
## 公会成员删除,针对公会的处理
familyAction = DBDataMgr.GetFamilyActionMgr().GetFamilyAction(family.GetID(), ActionType)
actionData = familyAction.GetActionDataByValue1(leavePlayerID, False)
if not actionData:
return
- memInfo = PlayerViewCache.GetPlayerBaseViewInfo(leavePlayerID, leavePlayer)
+ memInfo = PlayerViewCache.GetPlayerBaseViewInfo(leavePlayerID)
actionData.GetUserDict().update({"info":memInfo})
PlayerFamily.SendFamilyAction([actionData])
return
@@ -136,54 +140,57 @@
## 玩家退出了公会,针对玩家个人的处理
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaAnger, 0)
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxUnGetCnt, 0)
+ totalGetCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaBoxTotalGetCnt)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaLeaveGetCnt, totalGetCnt)
+ GameWorld.DebugLog("退出公会记录讨伐已累计领取宝箱数: totalGetCnt=%s" % totalGetCnt)
SyncTaofaInfo(curPlayer)
return
-def OnPlayerEnterFamily(curPlayer):
+def OnCrossPlayerEnterFamily(crossPlayer):
## 玩家进入新公会
- familyID = curPlayer.GetFamilyID()
- PlayerFamily.SendFamilyActionInfo(curPlayer, familyID, ActionType)
+ familyID = crossPlayer.GetFamilyID()
+ PlayerFamily.SendFamilyActionInfo(crossPlayer, familyID, ActionType)
return
-def RefreshFamilyBuZhenInfo(family):
- ## 刷新公会公共布阵信息
- familyID = family.GetID()
- curTime = int(time.time())
- bzDuration = IpyGameDataPY.GetFuncCfg("FamilyTaofaBuzhen", 4) * 60 # 有效时长秒
- maxLayer = IpyGameDataPY.GetFuncCfg("FamilyTaofaBuzhen", 3)
-
- gLayer = 0
- gEndTime = 0
- gActionData = None
- familyAction = DBDataMgr.GetFamilyActionMgr().GetFamilyAction(familyID, ActionType)
- for index in range(0, familyAction.Count()):
- actionData = familyAction.At(index)
- dataID = GetFAPlayerID(actionData)
- if dataID == ActionGlobalID:
- gActionData = actionData
- continue
- bzTime = GetFABuzhenTime(actionData)
- if not bzTime:
- continue
- endTime = bzTime + bzDuration
- if endTime <= curTime:
- continue
-
- if not maxLayer or gLayer < maxLayer:
- gLayer += 1
-
- if gEndTime < endTime:
- gEndTime = endTime
-
- GameWorld.DebugLog("刷新公会公共布阵信息: familyID=%s,gLayer=%s,gEndTime=%s" % (familyID, gLayer, GameWorld.ChangeTimeNumToStr(gEndTime)))
- if not gActionData:
- gActionData = familyAction.AddAction()
- SetFAPlayerID(gActionData, ActionGlobalID)
-
- SetFABuzhenEndTime(gActionData, gEndTime)
- SetFABuzhenLayer(gActionData, gLayer)
- PlayerFamily.SendFamilyAction(gActionData)
- return
+#def RefreshFamilyBuZhenInfo(family):
+# ## 刷新公会公共布阵信息
+# familyID = family.GetID()
+# curTime = int(time.time())
+# bzDuration = IpyGameDataPY.GetFuncCfg("FamilyTaofaBuzhen", 4) * 60 # 有效时长秒
+# maxLayer = IpyGameDataPY.GetFuncCfg("FamilyTaofaBuzhen", 3)
+#
+# gLayer = 0
+# gEndTime = 0
+# gActionData = None
+# familyAction = DBDataMgr.GetFamilyActionMgr().GetFamilyAction(familyID, ActionType)
+# for index in range(0, familyAction.Count()):
+# actionData = familyAction.At(index)
+# dataID = GetFAPlayerID(actionData)
+# if dataID == ActionGlobalID:
+# gActionData = actionData
+# continue
+# bzTime = GetFABuzhenTime(actionData)
+# if not bzTime:
+# continue
+# endTime = bzTime + bzDuration
+# if endTime <= curTime:
+# continue
+#
+# if not maxLayer or gLayer < maxLayer:
+# gLayer += 1
+#
+# if gEndTime < endTime:
+# gEndTime = endTime
+#
+# GameWorld.DebugLog("刷新公会公共布阵信息: familyID=%s,gLayer=%s,gEndTime=%s" % (familyID, gLayer, GameWorld.ChangeTimeNumToStr(gEndTime)))
+# if not gActionData:
+# gActionData = familyAction.AddAction()
+# SetFAPlayerID(gActionData, ActionGlobalID)
+#
+# SetFABuzhenEndTime(gActionData, gEndTime)
+# SetFABuzhenLayer(gActionData, gLayer)
+# PlayerFamily.SendFamilyAction(gActionData)
+# return
def RefreshPlayerAwardBoxCnt(family, curPlayer=None, unSyncIDList=[]):
## 刷新玩家可领取的宝箱数
@@ -231,37 +238,33 @@
def __doUpdPlayerAwardBoxCnt(curPlayer, member, memContribDict, awardBoxMax, unSyncIDList):
playerID = curPlayer.GetPlayerID()
joinTime = member.GetJoinTime()
- boxLastTime = max(curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaBoxLastTime), joinTime) # 与加入时间取最大
+ leaveGetCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaLeaveGetCnt) # 上次离开公会时累计领取数
boxTotalGetCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaBoxTotalGetCnt) # 已领取宝箱数
+ curFamilyGetCnt = boxTotalGetCnt - leaveGetCnt # 来到本公会后累计领取数
boxUnGetCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaBoxUnGetCnt) # 未领取宝箱数
canAddBoxMax = awardBoxMax - boxTotalGetCnt - boxUnGetCnt # 还可领取的箱子数
if canAddBoxMax <= 0:
- GameWorld.DebugLog(" 成员可领取宝箱已达上限不刷新: playerID=%s,boxLastTime=%s,boxTotalGetCnt(%s)+boxUnGetCnt(%s) >= %s"
- % (playerID, boxLastTime, boxTotalGetCnt, boxUnGetCnt, awardBoxMax))
+ GameWorld.DebugLog(" 成员可领取宝箱已达上限不刷新: playerID=%s,boxTotalGetCnt(%s)+boxUnGetCnt(%s) >= %s"
+ % (playerID, boxTotalGetCnt, boxUnGetCnt, awardBoxMax))
return
- updBoxLastTime = boxLastTime
- addUnGetBox = 0
+ curFamilyCanGet = 0 # 在本公会累计可领取箱子数
for contribList in memContribDict.values():
- if addUnGetBox >= canAddBoxMax:
- break
for atkTime, contribBoxCnt in contribList:
- if boxLastTime >= atkTime:
+ if joinTime >= atkTime:
+ #GameWorld.DebugLog(" 加入公会之前的箱子不能领取: joinTime=%s > atkTime(%s),contribBoxCnt=%s" % (joinTime, atkTime, contribBoxCnt))
continue
- updBoxLastTime = max(updBoxLastTime, atkTime)
- addUnGetBox += contribBoxCnt
- if addUnGetBox >= canAddBoxMax:
- break
+ curFamilyCanGet += contribBoxCnt
+ addUnGetBox = min(curFamilyCanGet - curFamilyGetCnt - boxUnGetCnt, canAddBoxMax)
if addUnGetBox <= 0:
- GameWorld.DebugLog(" 成员当前没有可领取的宝箱不刷新: playerID=%s,boxLastTime=%s,boxTotalGetCnt=%s,boxUnGetCnt=%s,awardBoxMax=%s,canAddBoxMax=%s"
- % (playerID, boxLastTime, boxTotalGetCnt, boxUnGetCnt, awardBoxMax, canAddBoxMax))
+ GameWorld.DebugLog(" 成员当前没有可领取的宝箱不刷新: playerID=%s,curFamilyCanGet=%s,curFamilyGetCnt=%s(%s-%s),boxUnGetCnt=%s,awardBoxMax=%s,canAddBoxMax=%s"
+ % (playerID, curFamilyCanGet, curFamilyGetCnt, boxTotalGetCnt, leaveGetCnt, boxUnGetCnt, awardBoxMax, canAddBoxMax))
return
updBoxUnGetCnt = boxUnGetCnt + addUnGetBox
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxUnGetCnt, updBoxUnGetCnt)
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyTaofaBoxLastTime, updBoxLastTime)
- GameWorld.DebugLog(" 成员可领取的宝箱数: playerID=%s,addUnGetBox=%s,updBoxUnGetCnt=%s,updBoxLastTime=%s,boxLastTime=%s,boxTotalGetCnt=%s,boxUnGetCnt=%s,awardBoxMax=%s,canAddBoxMax=%s"
- % (playerID, addUnGetBox, updBoxUnGetCnt, updBoxLastTime, boxLastTime, boxTotalGetCnt, boxUnGetCnt, awardBoxMax, canAddBoxMax))
+ GameWorld.DebugLog(" 成员可领取的宝箱数: playerID=%s,addUnGetBox=%s,updBoxUnGetCnt=%s,curFamilyCanGet=%s,curFamilyGetCnt=%s(%s-%s),boxUnGetCnt=%s,awardBoxMax=%s,canAddBoxMax=%s"
+ % (playerID, addUnGetBox, updBoxUnGetCnt, curFamilyCanGet, curFamilyGetCnt, boxTotalGetCnt, leaveGetCnt, boxUnGetCnt, awardBoxMax, canAddBoxMax))
if not unSyncIDList or playerID not in unSyncIDList:
SyncTaofaInfo(curPlayer)
return
@@ -322,11 +325,11 @@
return
gLayer, gActionData = GetFamilyBuzhenLayer(familyID)
bzDuration = IpyGameDataPY.GetFuncCfg("FamilyTaofaBuzhen", 4) * 60 # 有效时长秒
- maxLayer = IpyGameDataPY.GetFuncCfg("FamilyTaofaBuzhen", 3)
gEndTime = int(time.time()) + bzDuration # 直接覆盖更新
- if not maxLayer or gLayer < maxLayer:
- gLayer += 1
-
+ gLayer += 1 # 布阵不限制次数,直接加
+ #if not maxLayer or gLayer < maxLayer:
+ # gLayer += 1
+
GameWorld.DebugLog("公会讨伐布阵: gLayer=%s,gEndTime=%s" % (gLayer, GameWorld.ChangeTimeNumToStr(gEndTime)), playerID)
# 公共信息
SetFABuzhenEndTime(gActionData, gEndTime)
@@ -352,18 +355,25 @@
if not curFamily:
return
- atkCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaCnt)
- itemAddCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaItemAddCnt)
- freeCnt = IpyGameDataPY.GetFuncCfg("FamilyTaofaAtk", 1)
- canAtkCnt = freeCnt + itemAddCnt - atkCnt
- if canAtkCnt <= 0:
- GameWorld.DebugLog("公会讨伐没有斩杀次数: atkCnt=%s >= freeCnt(%s) + itemAddCnt(%s)" % (atkCnt, freeCnt, itemAddCnt), playerID)
- return
+ commAddAnger, superAddAnger, maxAnger = IpyGameDataPY.GetFuncEvalCfg("FamilyTaofaAtk", 4)
+ anger = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaAnger)
+ atkType = AtkType_Anger if anger >= maxAnger else AtkType_Normal
+ if atkType == AtkType_Normal:
+ atkCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaCnt)
+ itemAddCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaItemAddCnt)
+ freeCnt = IpyGameDataPY.GetFuncCfg("FamilyTaofaAtk", 1)
+ canAtkCnt = freeCnt + itemAddCnt - atkCnt
+ if canAtkCnt <= 0:
+ GameWorld.DebugLog("公会讨伐没有斩杀次数: atkCnt=%s >= freeCnt(%s) + itemAddCnt(%s)" % (atkCnt, freeCnt, itemAddCnt), playerID)
+ return
+
atkTime = int(time.time())
# 计算属性
gLayer, _ = GetFamilyBuzhenLayer(familyID)
+ maxLayer = IpyGameDataPY.GetFuncCfg("FamilyTaofaBuzhen", 3)
+ gLayer = min(gLayer, maxLayer) # 限制生效的最大布阵层数
fightPower = PlayerControl.GetFightPower(curPlayer)
superRate = IpyGameDataPY.GetFuncCfg("FamilyTaofaBuzhen", 1)
superRatio = IpyGameDataPY.GetFuncCfg("FamilyTaofaAtk", 3) # 暴击伤害倍值
@@ -372,12 +382,9 @@
if gLayer > 0:
superRate += gLayer * addSuperRatePerLayer
damRatio += gLayer * addDamPerLayer / 10000.0
-
- commAddAnger, superAddAnger, maxAnger = IpyGameDataPY.GetFuncEvalCfg("FamilyTaofaAtk", 4)
- anger = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaAnger)
- GameWorld.DebugLog("---公会讨伐斩杀: fightPower=%s,gLayer=%s,superRate=%s,superRatio=%s,damRatio=%s,anger=%s/%s"
- % (fightPower, gLayer, superRate, superRatio, damRatio, anger, maxAnger), playerID)
+ GameWorld.DebugLog("---公会讨伐斩杀: fightPower=%s,gLayer=%s,superRate=%s,superRatio=%s,damRatio=%s,anger=%s/%s,atkType=%s"
+ % (fightPower, gLayer, superRate, superRatio, damRatio, anger, maxAnger, atkType), playerID)
familyAction = DBDataMgr.GetFamilyActionMgr().GetFamilyAction(familyID, ActionType)
actionData = familyAction.GetActionDataByValue1(playerID, True)
@@ -395,11 +402,9 @@
boxHurtTotalHis = boxHurtHis + boxHurtHisEx * ChConfig.Def_PerPointValue
GameWorld.DebugLog("boxContribCnt=%s,boxHurtTotal=%s,boxHurtTotalHis=%s" % (boxContribCnt, boxHurtTotal, boxHurtTotalHis), playerID)
- atkType = AtkType_Normal
calcHurtCnt = 1 # 计算伤害次数
- if anger >= maxAnger:
+ if atkType == AtkType_Anger: # 怒气攻击
anger -= maxAnger
- atkType = AtkType_Anger # 怒气攻击
calcHurtCnt = IpyGameDataPY.GetFuncCfg("FamilyTaofaAtk", 5)
hurtTotal = 0 # 本次总伤害
--
Gitblit v1.8.0