From f0f101d1d778e26a2e3ecd368c90c8f52a7ea011 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 13 六月 2019 11:11:44 +0800
Subject: [PATCH] 7220 【后端】【2.0】灵器开发1.0版(删除绝版属性,原绝版属性转移到灵器属性)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldInvest.py | 85 ++++++++++++++++++++++++++----------------
1 files changed, 53 insertions(+), 32 deletions(-)
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 31d6ff3..ae2e1f0 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldInvest.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldInvest.py
@@ -77,21 +77,21 @@
def __CheckInvestReset(curPlayer):
##检查vip投资重置 超过28天或28天奖励已领取可重置
- investType = ChConfig.GoldInvestType_VIP
- investGoldRecord = __GetPDictValue(curPlayer, ChConfig.Def_PDict_GoldInvest_Gold % investType)
- if not investGoldRecord:
- return
- curDay = __GetInvestCurDay(curPlayer, investType)
- investMaxDayDict = IpyGameDataPY.GetFuncEvalCfg('InvestMaxDay')
- maxDay = investMaxDayDict.get(str(investType), 0)
- if curDay > maxDay or __GetPDictValue(curPlayer, ChConfig.Def_PDict_GoldInvest_GotRewardValue % (investType, maxDay)):
- __SetPDictValue(curPlayer, ChConfig.Def_PDict_GoldInvest_Time % investType, 0)
- __SetPDictValue(curPlayer, ChConfig.Def_PDict_GoldInvest_Gold % investType, 0)
- for i in xrange(1, maxDay+1):
- __SetPDictValue(curPlayer, ChConfig.Def_PDict_GoldInvest_GotRewardValue % (investType, i), 0)
- Sync_GoldInvestInfo(curPlayer, investType, isForce=True)
+ for investType in ChConfig.CanRepeatInvestType:
+ investGoldRecord = __GetPDictValue(curPlayer, ChConfig.Def_PDict_GoldInvest_Gold % investType)
+ if not investGoldRecord:
+ return
+ curDay = __GetInvestCurDay(curPlayer, investType)
+ investMaxDayDict = IpyGameDataPY.GetFuncEvalCfg('InvestMaxDay')
+ maxDay = investMaxDayDict.get(str(investType), 0)
+ if curDay > maxDay or __GetPDictValue(curPlayer, ChConfig.Def_PDict_GoldInvest_GotRewardValue % (investType, maxDay)):
+ __SetPDictValue(curPlayer, ChConfig.Def_PDict_GoldInvest_Time % investType, 0)
+ __SetPDictValue(curPlayer, ChConfig.Def_PDict_GoldInvest_Gold % investType, 0)
+ for i in xrange(1, maxDay+1):
+ __SetPDictValue(curPlayer, ChConfig.Def_PDict_GoldInvest_GotRewardValue % (investType, i), 0)
+ Sync_GoldInvestInfo(curPlayer, investType, isForce=True)
return
-
+
#// A5 40 投资理财 #tagCMGoldInvest
#
#struct tagCMGoldInvest
@@ -107,8 +107,6 @@
curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
investType = clientData.InvestType
investGold = clientData.InvestGold
-
- GameWorld.DebugLog("投资理财:investType=%s,investGold=%s" % (investType, investGold))
investCostDict = IpyGameDataPY.GetFuncEvalCfg('InvestCost')
if str(investType) not in investCostDict:
return
@@ -116,17 +114,36 @@
if investGold not in costList:
GameWorld.DebugLog(' 投资理财 投资额度不存在 investGold=%s, investType=%s'%(investGold, investType))
return
-
awardData = costList.index(investGold) + 1
if investType == ChConfig.GoldInvestType_VIP:
awardData = __GetInvestLVData(curPlayer)
- needVIPLV = IpyGameDataPY.GetFuncCfg('VIPInvest', 2)
- if curPlayer.GetVIPLv() < needVIPLV:
- GameWorld.DebugLog(' 投资理财 需要VIP%s'%(needVIPLV))
- return
+ __DoLogicInvest(curPlayer, investType, investGold, awardData)
+ return
+
+def InvestByCTG(curPlayer, ctgID):
+ ## 充值投资
+ ctgInvestDict = IpyGameDataPY.GetFuncEvalCfg('InvestCost', 3, {})
+ for investType, ctgIDList in ctgInvestDict.items():
+ if ctgID in ctgIDList:
+ __DoLogicInvest(curPlayer, int(investType), ctgID, 1)
+ GameWorld.Log('投资理财 investType=%s,ctgID=%s'%(investType, ctgID), curPlayer.GetID())
+ break
+ return
+
+
+def __DoLogicInvest(curPlayer, investType, investGold, awardData):
+ GameWorld.DebugLog("投资理财:investType=%s,investGold=%s, awardData=%s" % (investType, investGold, awardData))
+
+ needVIPLVDict = IpyGameDataPY.GetFuncEvalCfg('InvestCost', 2, {})
+ needVIPLV = needVIPLVDict.get(str(investType), 0)
+ if curPlayer.GetVIPLv() < needVIPLV:
+ GameWorld.DebugLog(' 投资理财 需要VIP%s'%(needVIPLV))
+ return
deductGold = investGold
+ if str(investType) in IpyGameDataPY.GetFuncEvalCfg('InvestCost', 3, {}):
+ deductGold = 0 #充钱的不用扣仙玉
investGoldRecord = __GetPDictValue(curPlayer, ChConfig.Def_PDict_GoldInvest_Gold % investType)
if investGoldRecord:
curDay = __GetInvestCurDay(curPlayer, investType)
@@ -147,7 +164,7 @@
# 不可循环投资,但可追加投资
- elif investType in [ChConfig.GoldInvestType_Gold]:
+ elif investType in ChConfig.InvestGoldTypeList:
if investGoldRecord >= investGold:
GameWorld.DebugLog(" 已投资档次=%s >= 追加投资档次=%s ,不可追加投资!"
% (investGoldRecord, investGold))
@@ -158,11 +175,11 @@
else:
GameWorld.DebugLog(" investType = %s 已投资过,不可重复投资" % investType)
return
- elif investType == ChConfig.GoldInvestType_Gold:
- goldInvestLVLimit = IpyGameDataPY.GetFuncCfg('GoldInvestLVLimit')
- if curPlayer.GetLV() > goldInvestLVLimit:
- GameWorld.DebugLog(' 仙玉投资理财 等级不能高于%s'%(goldInvestLVLimit))
- return
+# elif investType in ChConfig.InvestGoldTypeList:
+# goldInvestLVLimit = IpyGameDataPY.GetFuncEvalCfg('GoldInvestLVLimit', 1, {}).get(investType, 0)
+# if goldInvestLVLimit and curPlayer.GetLV() > goldInvestLVLimit:
+# GameWorld.DebugLog(' 仙玉投资理财 等级不能高于%s'%(goldInvestLVLimit))
+# return
__DoGoldInvest(curPlayer, investType, investGold, deductGold, awardData)
return
@@ -194,15 +211,19 @@
ChConfig.Def_Cost_GoldInvest, infoDict):
return
#红包奖励
- if investGold == deductGold:
+ if not (investType in ChConfig.InvestGoldTypeList and investGold != deductGold):
redPacketID = IpyGameDataPY.GetFuncEvalCfg('InvestRedPackAward', 1, {}).get(investType, 0)
if redPacketID:
PlayerFamilyRedPacket.CreatRedPacketByID(curPlayer, redPacketID)
if investType == ChConfig.GoldInvestType_VIP:
PlayerControl.WorldNotify(0, 'VIPInvestmentRadio', [curPlayer.GetName()])
- elif investType == ChConfig.GoldInvestType_Gold:
+ elif investType in ChConfig.InvestGoldTypeList:
PlayerControl.WorldNotify(0, 'JadeInvestmentRadio', [curPlayer.GetName(), investGold])
-
+ elif investType == ChConfig.GoldInvestType_Month:
+ PlayerControl.WorldNotify(0, 'MonthInvestment', [curPlayer.GetName()])
+ elif investType == ChConfig.GoldInvestType_Week:
+ PlayerControl.WorldNotify(0, 'WeekInPInvestment', [curPlayer.GetName()])
+
# 更新投资时时间,投资金额,重置回报记录
curTime = GameWorld.GetCurrentTime()
curTimeNum = GameWorld.ChangeTimeStrToNum(str(curTime)[:10], ChConfig.TYPE_Time_Format_Day)
@@ -279,7 +300,7 @@
lastDayGotData = __GetPDictValue(curPlayer, rewardValueKey) # 已领取数据
if lastDayGotData:
- if investType == ChConfig.GoldInvestType_Gold:
+ if investType in ChConfig.InvestGoldTypeList:
if awardData > lastDayGotData:
lastGotAwardList = rewardDict[str(lastDayGotData)]
rewardItemList = []
@@ -303,7 +324,7 @@
GameWorld.DebugLog(" 领取投资理财回报 rewardItemList=%s" % (rewardItemList))
if rewardItemList:
for itemID, itemCnt, isBind in rewardItemList:
- ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, isBind, [IPY_GameWorld.rptItem, IPY_GameWorld.rptAnyWhere], True, showSysInfo=True)
+ ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, 0, [IPY_GameWorld.rptItem, IPY_GameWorld.rptAnyWhere])
__CheckInvestReset(curPlayer)
# 记录领取事件
--
Gitblit v1.8.0