From 8e25bc7b9ca60ea789374fa70e0ddae4a5adc79a Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期四, 28 十二月 2023 16:41:57 +0800 Subject: [PATCH] 10077 游戏代币方案 --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py | 34 ++++++++++++++++++++++++++++++++-- 1 files changed, 32 insertions(+), 2 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 eb86a44..f45de84 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py @@ -2833,6 +2833,10 @@ elif TYPE_Price == IPY_GameWorld.TYPE_Price_Silver_Paper: return curPlayer.GetSilverPaper() + #代币 + elif TYPE_Price == ShareDefine.TYPE_Price_PayCoin: + return GetPayCoin(curPlayer) + #自定义货币 elif TYPE_Price in ShareDefine.TYPE_Price_CurrencyDict: return GetPlayerCurrency(curPlayer, TYPE_Price) @@ -2873,6 +2877,10 @@ #银票 elif moneyType == IPY_GameWorld.TYPE_Price_Silver_Paper: curPlayer.SetSilverPaper(value) + + #代币 + elif moneyType == ShareDefine.TYPE_Price_PayCoin: + SetPayCoin(curPlayer, value) #自定义货币 elif moneyType in ShareDefine.TYPE_Price_CurrencyDict: @@ -3009,6 +3017,10 @@ elif TYPE_Price == IPY_GameWorld.TYPE_Price_Silver_Paper: needMoneyCount = curPlayer.GetSilverPaper() notifyCode = "SilverPaperErr" + + #代币支付 + elif TYPE_Price == ShareDefine.TYPE_Price_PayCoin: + needMoneyCount = GetPayCoin(curPlayer) #自定义货币 elif TYPE_Price in ShareDefine.TYPE_Price_CurrencyDict: @@ -3168,6 +3180,15 @@ return False #有足够的钱支付 curPlayer.SetSilverPaper(curPlayerSilverPaper - price) + + #代币支付 + elif type_Price == ShareDefine.TYPE_Price_PayCoin: + curPlayerPayCoin = GetPayCoin(curPlayer) + if curPlayerPayCoin < price: + return False + #有足够的钱支付 + SetPayCoin(curPlayer, curPlayerPayCoin - price) + #自定义货币 elif type_Price in ShareDefine.TYPE_Price_CurrencyDict: curCurrency = GetPlayerCurrency(curPlayer, type_Price) @@ -3253,7 +3274,7 @@ #=========================================================================== # 除钻石及绑钻外,未指定操作类型的不记录 - if type_Price not in [IPY_GameWorld.TYPE_Price_Gold_Money, IPY_GameWorld.TYPE_Price_Gold_Paper] \ + if type_Price not in [IPY_GameWorld.TYPE_Price_Gold_Money, IPY_GameWorld.TYPE_Price_Gold_Paper, ShareDefine.TYPE_Price_PayCoin] \ and costType == ChConfig.Def_Cost_Unknown: #GameWorld.DebugLog("该货币没有指定消费类型不记录!type_Price=%s,costType=%s" % (type_Price, costType)) return @@ -3432,7 +3453,10 @@ return curPlayer.SetSilverPaper(curPlayer.GetSilverPaper() + value) - + + elif priceType == ShareDefine.TYPE_Price_PayCoin: + SetPayCoin(curPlayer, GetPayCoin(curPlayer) + value) + #自定义货币 elif priceType in ShareDefine.TYPE_Price_CurrencyDict: curCurrency = GetPlayerCurrency(curPlayer, priceType) @@ -3556,6 +3580,8 @@ #超过金钱上限 NotifyCode(curPlayer, "MoneyIsFull", [priceType]) return False + elif priceType == ShareDefine.TYPE_Price_PayCoin: + pass elif priceType in ShareDefine.TYPE_Price_CurrencyDict: curCurrency = GetPlayerCurrency(curPlayer, priceType) if curCurrency + value > ChConfig.Def_UpperLimit_DWord: @@ -6280,6 +6306,10 @@ def GetChatBubbleBox(curPlayer): return curPlayer.GetExAttr10() def SetChatBubbleBox(curPlayer, value): return curPlayer.SetExAttr10(value, False, True) +##游戏充值支付代币 +def GetPayCoin(curPlayer): return curPlayer.GetExAttr11() +def SetPayCoin(curPlayer, value): return curPlayer.SetExAttr11(min(value, ChConfig.Def_UpperLimit_DWord), False, False) + ##伴侣 def GetCoupleID(curPlayer): coupleInfo = GetCoupleInfo(curPlayer.GetPlayerID()) -- Gitblit v1.8.0