5805 【后端】【1.5】新增增加跨服匹配次数的道具
| | |
| | | ("DayPKCount", c_ubyte), # 当日已PK次数
|
| | | ("DayWinCount", c_ubyte), # 当日已胜利次数
|
| | | ("DayBuyCount", c_ubyte), # 当日已购买次数
|
| | | ("DayItemAddCount", c_ubyte), # 当日物品增加次数
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | |
| | | self.DayPKCount = 0
|
| | | self.DayWinCount = 0
|
| | | self.DayBuyCount = 0
|
| | | self.DayItemAddCount = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | CWinCount:%d,
|
| | | DayPKCount:%d,
|
| | | DayWinCount:%d,
|
| | | DayBuyCount:%d
|
| | | DayBuyCount:%d,
|
| | | DayItemAddCount:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | |
| | | self.CWinCount,
|
| | | self.DayPKCount,
|
| | | self.DayWinCount,
|
| | | self.DayBuyCount
|
| | | self.DayBuyCount,
|
| | | self.DayItemAddCount
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | | Def_ItemType_DogzEquipTooth = 121 # 神兽獠牙
|
| | | Def_ItemType_DogzEquipClaw = 122 # 神兽兽爪
|
| | | Def_ItemType_DogzEquipScute = 123 # 神兽鳞甲
|
| | | Def_ItemType_AddCrossRealmPKCnt = 127 #增加跨服PK次数
|
| | |
|
| | | #以下定义物品类型下次删除
|
| | | Def_Item_Type_Horse = 1000036 #坐骑
|
| | |
| | | Def_PDict_CrossPK_TodayPKCount = "CrossPK_TodayPKCount" # 今日已PK次数
|
| | | Def_PDict_CrossPK_TodayWinCount = "CrossPK_TodayWinCount" # 今日已胜利次数
|
| | | Def_PDict_CrossPK_TodayBuyCount = "CrossPK_TodayBuyCount" # 今日已购买PK次数
|
| | | Def_PDict_CrossPK_ItemAddCount = "CrossPK_ItemAddCount" # 今日道具增加PK次数
|
| | | Def_PDict_CrossPK_DayPKCountAwardState = "CrossPK_DayPKCountAwardState" # 每日匹配次数奖励记录,二进制位存储是否已领取,按匹配次数升序排序索引代表奖励位
|
| | | Def_PDict_CrossPK_DayWinCountAwardState = "CrossPK_DayWinCountAwardState" # 每日胜利次数奖励记录,二进制位存储是否已领取,按胜利次数升序排序索引代表奖励位
|
| | | Def_PDict_CrossPK_DanLVAwardState = "CrossPK_DanLVAwardState" # 段位达标奖励记录,二进制位存储是否已领取,按段位代表奖励位
|
| | |
| | | ("DayPKCount", c_ubyte), # 当日已PK次数
|
| | | ("DayWinCount", c_ubyte), # 当日已胜利次数
|
| | | ("DayBuyCount", c_ubyte), # 当日已购买次数
|
| | | ("DayItemAddCount", c_ubyte), # 当日物品增加次数
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | |
| | | self.DayPKCount = 0
|
| | | self.DayWinCount = 0
|
| | | self.DayBuyCount = 0
|
| | | self.DayItemAddCount = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | CWinCount:%d,
|
| | | DayPKCount:%d,
|
| | | DayWinCount:%d,
|
| | | DayBuyCount:%d
|
| | | DayBuyCount:%d,
|
| | | DayItemAddCount:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | |
| | | self.CWinCount,
|
| | | self.DayPKCount,
|
| | | self.DayWinCount,
|
| | | self.DayBuyCount
|
| | | self.DayBuyCount,
|
| | | self.DayItemAddCount
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | | import EventReport
|
| | | import PlayerGoldGift
|
| | | import PlayerMagicWeapon
|
| | | import ChPlayer
|
| | |
|
| | | #---副本配置对应key值---
|
| | | (
|
| | |
| | | playerManager = GameWorld.GetMapCopyPlayerManager()
|
| | | if playerManager.GetPlayerCount() > 0:
|
| | | curPlayer = playerManager.GetPlayerByIndex(0)
|
| | | if curPlayer.GetHP() <=0:
|
| | | ChPlayer.PlayerRebornByType(curPlayer, ChConfig.rebornType_System, tick)
|
| | | else:
|
| | | curPlayer.SetHP(curPlayer.GetMaxHP())
|
| | | DoFBHelp(curPlayer, tick)
|
| | |
|
| | |
| | | ChConfig.Def_ItemType_GiveMoney:"Item_GiveMoney", # 给人物金钱
|
| | | ChConfig.Def_ItemType_AddLimitBuff:"Item_Add_LimitingBuff", # 给限时buff物品
|
| | | ChConfig.Def_ItemType_AddExpBuff:"Item_Add_LimitingBuff", # 给限时buff物品
|
| | | ChConfig.Def_ItemType_ResetAttrPoint:"Item_ResetAttrPoint" #单个属性点重置
|
| | | ChConfig.Def_ItemType_ResetAttrPoint:"Item_ResetAttrPoint", #单个属性点重置
|
| | | ChConfig.Def_ItemType_AddCrossRealmPKCnt:"Item_AddCrossRealmPKCnt" #增加跨服PK次数
|
| | | }
|
| | |
|
| | | #根据物品效果使用{物品效果ID:call的py名}
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package UseItem.Item_AddCrossRealmPKCnt
|
| | | #
|
| | | # @todo:增加跨服PK次数
|
| | | # @author xdh
|
| | | # @date 2019-01-14
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 增加跨服PK次数
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2018-03-09 12:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | | import ItemCommon
|
| | | import PlayerCrossRealmPK
|
| | | import PlayerControl
|
| | | import ChConfig
|
| | | import CrossRealmPlayer
|
| | | import GameWorld
|
| | |
|
| | |
|
| | | def BatchUseItem(curPlayer, curRoleItem, tick, useCnt, exData):
|
| | | ##批量使用物品
|
| | | playerID = curPlayer.GetID()
|
| | | #curEff = curRoleItem.GetEffectByIndex(0)
|
| | | addCnt = useCnt #curEff.GetEffectValue(0)
|
| | | if not CrossRealmPlayer.IsCrossServerOpen():
|
| | | PlayerControl.NotifyCode(curPlayer, "CrossMatching18")
|
| | | return
|
| | | if not PlayerCrossRealmPK.IsCrossRealmPKMatchState():
|
| | | GameWorld.DebugLog("跨服匹配未开启,不可进行使用物品增加次数!", playerID)
|
| | | return
|
| | | todayItemAddCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_ItemAddCount)
|
| | |
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_ItemAddCount, todayItemAddCount+addCnt)
|
| | | |
| | | ItemCommon.DelItem(curPlayer, curRoleItem, useCnt, True, ChConfig.ItemDel_AddFBCnt)
|
| | | PlayerCrossRealmPK.SyncCrossRealmPKPlayerInfo(curPlayer)
|
| | | |
| | | PlayerControl.NotifyCode(curPlayer, 'CrossMatching25', [useCnt])
|
| | | |
| | | return True, useCnt
|
| | |
|
| | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_TodayPKCount, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_TodayWinCount, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_TodayBuyCount, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_ItemAddCount, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_DayPKCountAwardState, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_DayWinCountAwardState, 0)
|
| | | SyncCrossRealmPKPlayerInfo(curPlayer)
|
| | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_TodayPKCount, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_TodayWinCount, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_TodayBuyCount, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_ItemAddCount, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_DayPKCountAwardState, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_DayWinCountAwardState, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_DanLVAwardState, 0)
|
| | |
| | | if dayFreeMatchCountMax:
|
| | | todayPKCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_TodayPKCount)
|
| | | todayBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_TodayBuyCount)
|
| | | if todayPKCount >= (dayFreeMatchCountMax + todayBuyCount):
|
| | | GameWorld.DebugLog("PK次数不足,无法发起匹配! todayPKCount=%s >= (dayFreeMatchCountMax=%s + todayBuyCount=%s)" |
| | | % (todayPKCount, dayFreeMatchCountMax, todayBuyCount), playerID)
|
| | | todayItemAddCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_ItemAddCount)
|
| | | |
| | | if todayPKCount >= (dayFreeMatchCountMax + todayBuyCount + todayItemAddCount):
|
| | | GameWorld.DebugLog("PK次数不足,无法发起匹配! todayPKCount=%s >= (dayFreeMatchCountMax=%s + todayBuyCount=%s + todayItemAddCount=%s)" |
| | | % (todayPKCount, dayFreeMatchCountMax, todayBuyCount, todayItemAddCount), playerID)
|
| | | return
|
| | |
|
| | | dataMsg = {
|
| | |
| | | pkPlayerInfo.DayPKCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_TodayPKCount)
|
| | | pkPlayerInfo.DayWinCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_TodayWinCount)
|
| | | pkPlayerInfo.DayBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_TodayBuyCount)
|
| | | pkPlayerInfo.DayItemAddCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_ItemAddCount)
|
| | | NetPackCommon.SendFakePack(curPlayer, pkPlayerInfo)
|
| | | return
|
| | |
|