From 180eab3510f793ed008e9504976c3b3063f7ca6d Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 18 十一月 2025 18:21:52 +0800
Subject: [PATCH] 110 【主界面】仙树升级-服务端(免费减时修改为充能减时;特权支持充能额外上限;广告奖励支持领取充能奖励;)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py | 51 ++++++++++++++++++++++++++++-----------------------
1 files changed, 28 insertions(+), 23 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
index d082054..3a2e2e4 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
@@ -49,7 +49,6 @@
import PlayerCostRebate
import PlayerActLunhuidian
import GY_Query_CrossRealmReg
-import PlayerGoldInvest
import CrossRealmPlayer
import CrossPlayerData
import PlayerActivity
@@ -58,7 +57,7 @@
import PlayerOnline
import PlayerTask
import PlayerMail
-import PlayerLLMJ
+import TurnAttack
import ChPlayer
import GameObj
@@ -2450,17 +2449,12 @@
return
def GetUnXiantaoCntEquip(curPlayer):
- '''因为战锤对应装备是1个战锤可能对应多个装备掉落,所以分解装备的时候1个战锤需要支持可拆分
- 所以需要支持小数存储,暂定以支持3位小数存储
- '''
- return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_UnXiantaoCntEquip) / 1000.0
+ return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_UnXiantaoCntEquip)
def AddUnXiantaoCntEquip(curPlayer, addCnt):
- unXiantaoCntEquip = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_UnXiantaoCntEquip) + addCnt * 1000
+ unXiantaoCntEquip = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_UnXiantaoCntEquip) + addCnt
return NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_UnXiantaoCntEquip, unXiantaoCntEquip)
def SetUnXiantaoCntEquip(curPlayer, unXiantaoCntEquip):
- ## 保存装备未结算战锤数,保留3位小数
- # @param unXiantaoCntEquip: 实际的未结算数量,支持小数
- unXiantaoCntEquip = int(round(unXiantaoCntEquip, 3) * 1000) # 保留3为小数
+ ## 保存装备未结算战锤数
return NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_UnXiantaoCntEquip, unXiantaoCntEquip)
##玩家是否有钱款
@@ -2765,10 +2759,7 @@
unXiantaoCntBooty = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_UnXiantaoCntBooty % itemID)
NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_UnXiantaoCntBooty % itemID, unXiantaoCntBooty + price)
- PlayerLLMJ.AddUseZhanchui(curPlayer, price)
- PlayerPrestigeSys.AddRealmTaskValue(curPlayer, PlayerPrestigeSys.RealmTaskType_UseXiantao, price)
- PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_CutTree, price)
- PlayerActivity.AddDailyTaskValue(curPlayer, ChConfig.DailyTask_CutTree, price)
+ TurnAttack.GetMainFightMgr(curPlayer).useZhanchui += price
unitPrice = price if quantity == 1 else int(math.ceil(price * 1.0 / quantity)) # 单价
#reason_name = "Unknown" if not costType else costType
@@ -4144,7 +4135,6 @@
def Sync_ExpRateChange(curPlayer):
totalExpRate = GetPlayerExpRate(curPlayer)
fightExpRate = curPlayer.GetFightExpRate() # 系统及功能累加
- fightExpRate += PlayerGoldInvest.GetAddFightExpRate(curPlayer)
actExpRateInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_ExpRate, {})# 多倍经验活动加成
if actExpRateInfo.get(ShareDefine.ActKey_State):
@@ -4200,11 +4190,11 @@
return totalExpRate
-##外观额外数据: 其他 * 100 + 坐骑外观
-def GetHorseSkinID(curPlayer): return GameWorld.GetValue(curPlayer.GetEquipShowSwitch(), 2, 2)
+##外观额外数据: 其他 * 1000 + 坐骑外观
+def GetHorseSkinID(curPlayer): return GameWorld.GetValue(curPlayer.GetEquipShowSwitch(), 3, 3)
def SetHorseSkinID(curPlayer, horseSkinID):
showValue = curPlayer.GetEquipShowSwitch()
- updShowValue = GameWorld.SetValue(showValue, 2, 2, min(horseSkinID, 99))
+ updShowValue = GameWorld.SetValue(showValue, 3, 3, min(horseSkinID, 999))
curPlayer.SetEquipShowSwitch(updShowValue)
GameWorld.DebugLog("使用坐骑外观: horseSkinID=%s,showValue=%s,updShowValue=%s" % (horseSkinID, showValue, updShowValue))
return
@@ -4304,10 +4294,25 @@
def IsMainLevelPass(curPlayer, lvID):
## 判断玩家是否过关某个主线关卡ID
- # @param lvID: 关卡唯一ID,与策划约定好 = 章节*100+关卡编号
- passChapterID, passLevelNum, _ = GetMainLevelPassInfo(curPlayer)
- passValue = passChapterID * 100 + passLevelNum # 因为pass的记录是带波数的,即当前关卡boss还没过关,所以只有大于该记录值的才算过关
- return passValue > lvID
+ return GetPassMainLevelID(curPlayer) >= lvID
+def GetPassMainLevelID(curPlayer):
+ ## 获取已过关主线关卡ID
+ passChapterID, passLevelNum, _ = GetMainLevelPassInfo(curPlayer) # 当前过关进度包含波,所以需要取上一关的
+ passLVID = 0 # 关卡唯一ID,与策划约定好 = 章节*100+关卡编号
+ if passLevelNum > 1:
+ preLevelNum = passLevelNum - 1
+ passLVID = passChapterID * 100 + preLevelNum
+ GameWorld.DebugLog("非某章节的第1关直接减1即可: passLVID=%s,passChapterID=%s,passLevelNum=%s" % (passLVID, passChapterID, passLevelNum))
+
+ elif passChapterID > 1: # 取上一章节
+ preChapterID = passChapterID - 1
+ levelDataList = IpyGameDataPY.GetIpyGameDataByCondition("MainLevel", {"ChapterID":preChapterID}, True)
+ levelCount = len(levelDataList) if levelDataList else 0
+ if levelCount:
+ passLVID = preChapterID * 100 + levelCount
+ GameWorld.DebugLog("取上一章节作为已过关关卡: passLVID=%s,preChapterID=%s,levelCount=%s,passChapterID=%s,passLevelNum=%s"
+ % (passLVID, preChapterID, levelCount, passChapterID, passLevelNum))
+ return passLVID
## 主线关卡过关进度值 = 章节*10000+关卡编号*100+第x波
def GetMainLevelPassValue(curPlayer): return curPlayer.GetExAttr1()
@@ -4320,7 +4325,7 @@
value = ComMainLevelValue(chapterID, levelNum, wave)
SetMainLevelPassValue(curPlayer, value)
if wave == 0:
- lvID = chapterID * 100 + levelNum
+ lvID = GetPassMainLevelID(curPlayer)
PlayerBillboard.UpdatePlayerBillboard(curPlayer, ShareDefine.Def_BT_MainLevel, lvID)
PlayerTask.UpdTaskValue(curPlayer, ChConfig.TaskType_MainLevel)
PlayerSuccess.UptateSuccessProgress(curPlayer, ShareDefine.SuccType_MainLevel, lvID)
--
Gitblit v1.8.0