10156 副本功能玩法关联回合战斗表现(竞技场挑战券优化)
| | |
| | | ("SubCmd", c_ubyte),
|
| | | ("IsReset", c_ubyte), #是否是重置的
|
| | | ("Score", c_int), #当前积分
|
| | | ("BattleCountToday", c_ubyte), #今日已挑战次数
|
| | | ("MatchRefreshCount", c_ubyte), #当前已刷新匹配列表次数,每次挑战后会重置
|
| | | ("ItemAddBattleCountToday", c_ubyte), #今日已使用物品增加的挑战次数
|
| | | ("BattleCount", c_ubyte), #当前可挑战次数
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | |
| | | self.SubCmd = 0xC3
|
| | | self.IsReset = 0
|
| | | self.Score = 0
|
| | | self.BattleCountToday = 0
|
| | | self.MatchRefreshCount = 0
|
| | | self.ItemAddBattleCountToday = 0
|
| | | self.BattleCount = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | SubCmd:%s,
|
| | | IsReset:%d,
|
| | | Score:%d,
|
| | | BattleCountToday:%d,
|
| | | MatchRefreshCount:%d,
|
| | | ItemAddBattleCountToday:%d
|
| | | BattleCount:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.IsReset,
|
| | | self.Score,
|
| | | self.BattleCountToday,
|
| | | self.MatchRefreshCount,
|
| | | self.ItemAddBattleCountToday
|
| | | self.BattleCount
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | | Def_PDict_ArenaOSSeasonState = "ArenaOSSeasonState" # 开服前定制X天赛季状态 0-未比赛过,1-进行中,>1结算时的开服天
|
| | | Def_PDict_ArenaScore = "ArenaScore" # 当前积分
|
| | | Def_PDict_ArenaHighestScore = "ArenaHighestScore" # 历史最高积分
|
| | | Def_PDict_ArenaBattleCountDay = "ArenaBattleCountDay" # 今日已战斗次数
|
| | | Def_PDict_ArenaMatchRefreshCount = "ArenaMatchRefreshCount" # 匹配刷新列表次数
|
| | | Def_PDict_ArenaItemAddCount = "ArenaItemAddCount" # 今日已使用物品增加次数
|
| | | Def_PDict_ArenaBattleTagID = "ArenaBattleTagID" # 当前对战的对手ID
|
| | | Def_PDict_ArenaBattleCount = "ArenaBattleCount" # 当前可用次数
|
| | |
|
| | | #功能系统特权
|
| | | Def_PDict_FuncSysPrivilegeActTime = "FuncSysPrivilegeActTime_%s" # 系统功能特权激活时间戳,参数(系统功能ID)
|
| | |
| | | ("SubCmd", c_ubyte),
|
| | | ("IsReset", c_ubyte), #是否是重置的
|
| | | ("Score", c_int), #当前积分
|
| | | ("BattleCountToday", c_ubyte), #今日已挑战次数
|
| | | ("MatchRefreshCount", c_ubyte), #当前已刷新匹配列表次数,每次挑战后会重置
|
| | | ("ItemAddBattleCountToday", c_ubyte), #今日已使用物品增加的挑战次数
|
| | | ("BattleCount", c_ubyte), #当前可挑战次数
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | |
| | | self.SubCmd = 0xC3
|
| | | self.IsReset = 0
|
| | | self.Score = 0
|
| | | self.BattleCountToday = 0
|
| | | self.MatchRefreshCount = 0
|
| | | self.ItemAddBattleCountToday = 0
|
| | | self.BattleCount = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | SubCmd:%s,
|
| | | IsReset:%d,
|
| | | Score:%d,
|
| | | BattleCountToday:%d,
|
| | | MatchRefreshCount:%d,
|
| | | ItemAddBattleCountToday:%d
|
| | | BattleCount:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.IsReset,
|
| | | self.Score,
|
| | | self.BattleCountToday,
|
| | | self.MatchRefreshCount,
|
| | | self.ItemAddBattleCountToday
|
| | | self.BattleCount
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | | ## 回合战斗请求 - 地图验证
|
| | |
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | if not PlayerArena.CheckArenaBattleCount(curPlayer):
|
| | | if not PlayerArena.GetArenaBattleCount(curPlayer):
|
| | | GameWorld.DebugLog("竞技场已经没有对战次数!", playerID)
|
| | | return
|
| | |
|
| | |
| | | return
|
| | | tagPlayerID = valueList[0]
|
| | |
|
| | | if not PlayerArena.CheckArenaBattleCount(curPlayer):
|
| | | if not PlayerArena.GetArenaBattleCount(curPlayer):
|
| | | return
|
| | |
|
| | | playerLV = curPlayer.GetLV()
|
| | |
| | | import IpyGameDataPY
|
| | | import DataRecordPack
|
| | | import PlayerGubao
|
| | | import PlayerArena
|
| | | import EventShell
|
| | | import PlayerTask
|
| | | import PlayerVip
|
| | |
| | | tagItem.Clear()
|
| | | return True
|
| | |
|
| | | #增加竞技场次数
|
| | | if itemEff.GetEffectID() == ChConfig.Def_Effect_AddArenaBattleCount:
|
| | | PlayerArena.AddArenaBattleCount(curPlayer, itemEff.GetEffectValue(0))
|
| | | #GameWorld.DebugLog("增加竞技场次数物品默认使用!")
|
| | | tagItem.Clear()
|
| | | return True
|
| | | |
| | | if itemID in ChConfig.Def_TransformItemIDList or tagItem.GetType() == ChConfig.Def_ItemType_AutoUseMoney:
|
| | | # 直接转化为对应货币的物品仅在放入背包时直接转化,否则还是以真实物品的形式存在,但堆叠上限需要做特殊处理
|
| | | if packIndex == IPY_GameWorld.rptItem:
|
| | |
| | | # @return 是否使用物品成功
|
| | | # @remarks 使用物品,触发物品附加效果
|
| | | def BatchUseItem(curPlayer, curRoleItem, tick, useCnt, exData):
|
| | | useItemEff = curRoleItem.GetEffectByIndex(0)
|
| | | addCnt = useItemEff.GetEffectValue(0) * useCnt
|
| | | if addCnt <= 0:
|
| | | return
|
| | | |
| | | updItemAddCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ArenaItemAddCount) + addCnt
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ArenaItemAddCount, updItemAddCount)
|
| | | PlayerArena.Sync_ArenaInfo(curPlayer)
|
| | | |
| | | #扣除物品
|
| | | ItemCommon.DelItem(curPlayer, curRoleItem, useCnt)
|
| | | |
| | | # 竞技场挑战次数增加<color=#109d06FF>%s0</color>次
|
| | | PlayerControl.NotifyCode(curPlayer, "ArenaBattleCountAdd", [addCnt])
|
| | | return True
|
| | | #改为自动使用
|
| | | return
|
| | | #===============================================================================================
|
| | | # useItemEff = curRoleItem.GetEffectByIndex(0)
|
| | | # addCnt = useItemEff.GetEffectValue(0) * useCnt
|
| | | # if addCnt <= 0:
|
| | | # return
|
| | | # |
| | | # updItemAddCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ArenaItemAddCount) + addCnt
|
| | | # PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ArenaItemAddCount, updItemAddCount)
|
| | | # PlayerArena.Sync_ArenaInfo(curPlayer)
|
| | | # |
| | | # #扣除物品
|
| | | # ItemCommon.DelItem(curPlayer, curRoleItem, useCnt)
|
| | | # |
| | | # # 竞技场挑战次数增加<color=#109d06FF>%s0</color>次
|
| | | # PlayerControl.NotifyCode(curPlayer, "ArenaBattleCountAdd", [addCnt])
|
| | | # return True
|
| | | #===============================================================================================
|
| | |
| | | if not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_Arena):
|
| | | return
|
| | |
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ArenaItemAddCount, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ArenaBattleCountDay, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ArenaMatchRefreshCount, 0)
|
| | | Sync_ArenaInfo(curPlayer)
|
| | |
|
| | |
| | | GameWorld.DebugLog("竞技场赛季重置! preSeasonscore=%s,setScore=%s" % (preSeasonscore, setScore))
|
| | |
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ArenaScore, setScore)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ArenaItemAddCount, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ArenaBattleCountDay, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ArenaMatchRefreshCount, 0)
|
| | | Sync_ArenaInfo(curPlayer, True)
|
| | | return
|
| | |
|
| | | def CheckArenaBattleCount(curPlayer):
|
| | | ## 验证是否还有对战次数
|
| | | todayBattleCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ArenaBattleCountDay)
|
| | | itemAddCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ArenaItemAddCount)
|
| | | dayFreeCount = IpyGameDataPY.GetFuncCfg("ArenaSet", 3)
|
| | | return todayBattleCount < (dayFreeCount + itemAddCount)
|
| | | def AddArenaBattleCount(curPlayer, addCount):
|
| | | updCount = min(ChConfig.Def_UpperLimit_DWord, curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ArenaBattleCount) + addCount)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ArenaBattleCount, updCount)
|
| | | Sync_ArenaInfo(curPlayer)
|
| | | return
|
| | |
|
| | | def GetArenaBattleCount(curPlayer):
|
| | | ## 获取当前可对战次数
|
| | | return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ArenaBattleCount)
|
| | |
|
| | | def GetArenaBattleCountMax(curPlayer):
|
| | | ## 最大可累计挑战次数
|
| | | initMax = IpyGameDataPY.GetFuncCfg("ArenaSet", 3) # 初始最大次数
|
| | | |
| | | # 其他功能增加上限...
|
| | | |
| | | maxCount = initMax
|
| | | return maxCount
|
| | |
|
| | | def CheckCanGiveBattleCountItem(curPlayer, itemID):
|
| | | ## 可否给加挑战次数道具
|
| | | itemData = GameWorld.GetGameData().GetItemByTypeID(itemID)
|
| | | if not itemData:
|
| | | return False
|
| | | itemEff = itemData.GetEffectByIndex(0)
|
| | | if itemEff.GetEffectID() != ChConfig.Def_Effect_AddArenaBattleCount:
|
| | | GameWorld.DebugLog("非挑战券可给! itemID=%s" % itemID)
|
| | | return True
|
| | | canGive = GetArenaBattleCount(curPlayer) < GetArenaBattleCountMax(curPlayer)
|
| | | GameWorld.DebugLog("可否给挑战券: canGive=%s" % canGive)
|
| | | return canGive
|
| | |
|
| | | #// B2 09 竞技场匹配玩家 #tagCMArenaMatch
|
| | | #
|
| | |
| | | updOrder = retDict["updOrder"]
|
| | |
|
| | | # 扣次数
|
| | | todayBattleCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ArenaBattleCountDay) + 1
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ArenaBattleCountDay, todayBattleCount)
|
| | | battleCount = max(0, curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ArenaBattleCount) - 1)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ArenaBattleCount, battleCount)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ArenaMatchRefreshCount, 0)
|
| | | |
| | | |
| | | # 更新积分
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ArenaScore, updScore)
|
| | | highestScore = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ArenaHighestScore)
|
| | |
| | | clientPack = ChPyNetSendPack.tagMCArenaPlayerInfo()
|
| | | clientPack.IsReset = 1 if isReset else 0
|
| | | clientPack.Score = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ArenaScore)
|
| | | clientPack.BattleCountToday = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ArenaBattleCountDay)
|
| | | clientPack.MatchRefreshCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ArenaMatchRefreshCount)
|
| | | clientPack.ItemAddBattleCountToday = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ArenaItemAddCount)
|
| | | clientPack.BattleCount = min(255, curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ArenaBattleCount))
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | | return
|
| | |
|
| | |
| | | import PlayerControl
|
| | | import IPY_GameWorld
|
| | | import ItemControler
|
| | | import PlayerArena
|
| | | import PlayerTask
|
| | | import NPCCommon
|
| | | import ChConfig
|
| | |
| | | giveEquipIDList.append(equipItemID)
|
| | |
|
| | | exItem = GameWorld.GetResultByRandomList(exAwardItemRateList)
|
| | | if exItem:
|
| | | if exItem and PlayerArena.CheckCanGiveBattleCountItem(curPlayer, exItem[0]):
|
| | | giveItemListEx.append([exItem[0], exItem[1], 0])
|
| | | |
| | | |
| | | if not giveEquipIDList:
|
| | | return
|
| | | giveEquipCount = len(giveEquipIDList)
|