From 2f64dfa5d5b4f1106c5985bec7c23615636ccbe2 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 17 九月 2019 15:11:44 +0800
Subject: [PATCH] 8266 【后端】货币祈愿改为获得灵石

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_PlayerBuyZhenQi.py |   49 +++++++++++++++++++++++++------------------------
 1 files changed, 25 insertions(+), 24 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_PlayerBuyZhenQi.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_PlayerBuyZhenQi.py
index 5439ff8..a03dbba 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_PlayerBuyZhenQi.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_PlayerBuyZhenQi.py
@@ -50,7 +50,7 @@
 
 
 #祈愿类型列表
-TotalPrayList = [ChConfig.VIPPrivilege_MoneyPray,ChConfig.VIPPrivilege_ExpPray]
+TotalPrayList = [ChConfig.VIPPrivilege_MoneyPray, ChConfig.VIPPrivilege_ExpPray]
 
 
 #struct    tagCMBuySomething
@@ -70,7 +70,7 @@
     buyType = clientData.Type  #购买的类型
     #祈愿类型错误,不处理
     if buyType not in TotalPrayList:
-        GameWorld.DebugLog("祈愿类型错误---buyType:%s"%buyType )
+        GameWorld.DebugLog("祈愿类型错误---buyType:%s" % buyType)
         return
     if buyType == ChConfig.VIPPrivilege_MoneyPray:
         if not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_RefineMoney):
@@ -82,11 +82,11 @@
             return
     
     totalCnt = PlayerVip.GetPrivilegeValue(curPlayer, buyType)
-    curCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_HasPrayCnt%buyType)
-    cnt = curCnt+1 #参数用
+    curCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_HasPrayCnt % buyType)
+    cnt = curCnt + 1 #参数用
     #金币祈愿
     if buyType == ChConfig.VIPPrivilege_MoneyPray:
-        historyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_HistoryPrayCnt%buyType)
+        historyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_HistoryPrayCnt % buyType)
         #判断免费祈愿CD时间
         needTime = __GetFreeCD(curPlayer)
         if needTime:
@@ -109,23 +109,24 @@
                     GameWorld.DebugLog("仙玉不足!costGold=%s" % needGold)
                     return
             if not isCostItem: #用物品不增加次数
-                PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_HasPrayCnt%buyType, curCnt + 1)
+                PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_HasPrayCnt % buyType, curCnt + 1)
         else:
             curTime = int(time.time())
             PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FreePrayTime, curTime)
-        
-        preCnt, fixMoney =IpyGameDataPY.GetFuncEvalCfg('MoneyPray', 4)
-        GameWorld.DebugLog('11111fixMoney=%s,historyCnt=%s,preCnt=%s'%(fixMoney,historyCnt,preCnt))
-        if fixMoney and historyCnt< preCnt:
+            
+        preCnt, fixMoney = IpyGameDataPY.GetFuncEvalCfg("MoneyPray", 4)
+        GameWorld.DebugLog('11111fixMoney=%s,historyCnt=%s,preCnt=%s' % (fixMoney, historyCnt, preCnt))
+        if fixMoney and historyCnt < preCnt:
             addMoney = fixMoney
             #更新历史次数(特殊收益次数达到后不再更新)
-            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_HistoryPrayCnt%buyType, historyCnt+1)
+            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_HistoryPrayCnt % buyType, historyCnt + 1)
         else:
             addMoney = GetMoneyPrayAward()
         addDataDict = {ChConfig.Def_Give_Reason_SonKey:"MoneyPray"}
-        PlayerControl.GiveMoney(curPlayer, IPY_GameWorld.TYPE_Price_Silver_Money, addMoney, 
-                            ChConfig.Def_GiveMoney_Pray, addDataDict, False)
-        PlayerControl.NotifyCode(curPlayer, 'MoneyPray_HowMuch', [addMoney])
+        #20190917 by hxp 祈愿金币改为绑玉
+        giveMoneyType = IPY_GameWorld.TYPE_Price_Gold_Paper
+        PlayerControl.GiveMoney(curPlayer, giveMoneyType, addMoney, ChConfig.Def_GiveMoney_Pray, addDataDict, False)
+        PlayerControl.NotifyCode(curPlayer, 'MoneyPray_HowMuch', [addMoney, giveMoneyType])
         PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_MoneyPray, 1)
         
     #经验祈愿    
@@ -149,7 +150,7 @@
         else:
             infoDict = {ChConfig.Def_Cost_Reason_SonKey:buyType}
             needGold = eval(GetExpPrayCost())
-            GameWorld.DebugLog("需要仙玉--needGold--%s"%needGold )
+            GameWorld.DebugLog("需要仙玉--needGold--%s" % needGold)
             if not PlayerControl.PayMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money, needGold, ChConfig.Def_Cost_Pray, infoDict):
                 GameWorld.DebugLog("仙玉不足!costGold=%s" % needGold)
                 return   
@@ -160,7 +161,7 @@
         PlayerControl.PlayerControl(curPlayer).AddExp(addExp)
         PlayerControl.NotifyCode(curPlayer, 'ExpPray_HowMuch', [addExp])
         if not isCostItem: #用物品不增加次数
-            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_HasPrayCnt%buyType, curCnt + 1)
+            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_HasPrayCnt % buyType, curCnt + 1)
         PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_ExpPray, 1)
     else:
         return
@@ -184,7 +185,7 @@
     curTime = int(time.time())
     passTime = curTime - lastTime
     cdTime = IpyGameDataPY.GetFuncCfg("MoneyPray", 3)
-    needTime = max(0,cdTime - passTime)
+    needTime = max(0, cdTime - passTime)
     return needTime
     
 ## OnDay操作,通知客户端,购买次数变了
@@ -193,10 +194,10 @@
 def PlayerOnDay(curPlayer):
     needSyncList = []
     for prayType in TotalPrayList:
-        hasPrayCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_HasPrayCnt%prayType)
+        hasPrayCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_HasPrayCnt % prayType)
         if not hasPrayCnt:
             continue
-        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_HasPrayCnt%prayType, 0)
+        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_HasPrayCnt % prayType, 0)
         needSyncList.append(prayType)
     Sync_NotifyDataChange(curPlayer, needSyncList)
     return
@@ -205,7 +206,7 @@
 ## 通知客户端,购买次数变了
 #  @param curPlayer: 玩家实例
 #  @return None
-def Sync_NotifyDataChange(curPlayer, prayType = []):
+def Sync_NotifyDataChange(curPlayer, prayType=[]):
     if prayType == []:
         prayList = TotalPrayList
     else:
@@ -214,13 +215,13 @@
     for buyType in prayList:
         subPack = ChPyNetSendPack.tagMCSingleBuySomethingInfo()
         subPack.Type = buyType
-        subPack.BuyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_HasPrayCnt%buyType)
-        subPack.HistoryBuyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_HistoryPrayCnt%buyType)
+        subPack.BuyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_HasPrayCnt % buyType)
+        subPack.HistoryBuyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_HistoryPrayCnt % buyType)
         
         if buyType == ChConfig.VIPPrivilege_MoneyPray:
             subPack.LastFreeTime = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FreePrayTime)
         pack.Infos.append(subPack)
-        GameWorld.DebugLog("通知祈愿次数--buyType:%s--BuyCnt:%s--LastFreeTime%s" % (subPack.Type,subPack.BuyCnt,subPack.LastFreeTime))
+        GameWorld.DebugLog("通知祈愿次数--buyType:%s--BuyCnt:%s--LastFreeTime%s" % (subPack.Type, subPack.BuyCnt, subPack.LastFreeTime))
     pack.Cnt = len(pack.Infos)
     NetPackCommon.SendFakePack(curPlayer, pack)
     
@@ -231,4 +232,4 @@
 def DoPlayerLogin(curPlayer):
     Sync_NotifyDataChange(curPlayer)
     return
-    
\ No newline at end of file
+    

--
Gitblit v1.8.0