4436 【后端】【1.2.0】功能预告界面修改,新增可领取奖励
| | |
| | | BYTE IsBind; //是否绑定
|
| | | DWORD Weight; //权重
|
| | | DWORD Mark; //排序用标识
|
| | | };
|
| | |
|
| | | //功能预告表
|
| | |
|
| | | struct tagFunctionForecast
|
| | | {
|
| | | DWORD _FuncID; //功能ID
|
| | | dict Award; //属性类型
|
| | | }; |
| | |
| | | _fields_ = [
|
| | | ("FuncID", c_ubyte), # 功能ID
|
| | | ("State", c_ubyte), # 是否开启
|
| | | ("AwardState", c_ubyte), # 是否已领奖励
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | |
| | | def Clear(self):
|
| | | self.FuncID = 0
|
| | | self.State = 0
|
| | | self.AwardState = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | def OutputString(self):
|
| | | DumpString = '''//A3 02 功能开通状态 //tagMCFuncOpenStateList:
|
| | | FuncID:%d,
|
| | | State:%d
|
| | | State:%d,
|
| | | AwardState:%d
|
| | | '''\
|
| | | %(
|
| | | self.FuncID,
|
| | | self.State
|
| | | self.State,
|
| | | self.AwardState
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | | ("Value3", c_int), # 自定义值3
|
| | | ("Value4", c_int), # 自定义值4
|
| | | ("Value5", c_int), # 自定义值5
|
| | | ("Value6", c_int), # 自定义值6
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | |
| | | self.Value3 = 0
|
| | | self.Value4 = 0
|
| | | self.Value5 = 0
|
| | | self.Value6 = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | Value2:%d,
|
| | | Value3:%d,
|
| | | Value4:%d,
|
| | | Value5:%d,
|
| | | Value6:%d
|
| | | Value5:%d
|
| | | '''\
|
| | | %(
|
| | | self.SetNum,
|
| | |
| | | self.Value2,
|
| | | self.Value3,
|
| | | self.Value4,
|
| | | self.Value5,
|
| | | self.Value6
|
| | | self.Value5
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | | Def_Player_Dict_FBHistoryMaxLine = "FBHistoryMaxLine_%s" # 副本历史最高通关, 参数为副本ID
|
| | | Def_Player_Dict_RefurbishGoodBookPlayerLv = "RefurbishGoodBookPlayerLv_97" # 刷新天书任务时的玩家等级
|
| | | Def_Player_Dict_GameFuncFirstTouch = "GameFuncFirstTouch_%s" # 服务端功能首次触发开启状态; 参数, key编号
|
| | | Def_Player_Dict_GameFuncAwardState = "GameFuncAwardState_%s" # 服务端功能开启领奖状态; 参数, key编号
|
| | | Def_Player_Dict_MissionFinish = "MissionFinish_%s" # 任务是否完成; 参数, 任务ID, 只会记录部分需要记录的任务ID
|
| | | Def_Player_Dict_FamilyArrestAwardState = "ArrestAwardState_103" # 家族悬赏奖励领取情况
|
| | | Def_Player_Dict_OtherDayLogin = "OtherDayLogin_105" # 非同一天二次登陆
|
| | |
| | | Def_RewardType_FCParty, # 仙界盛典全民来嗨14
|
| | | Def_RewardType_DownLoad, # 分包下载奖励15
|
| | | Def_RewardType_WishingWell, # 许愿池奖励16
|
| | | )= range(17)
|
| | | Def_RewardType_OpenFunc, # 功能开启奖励17
|
| | | )= range(18)
|
| | |
|
| | |
|
| | | #boss复活相关活动定义
|
| | |
| | | _fields_ = [
|
| | | ("FuncID", c_ubyte), # 功能ID
|
| | | ("State", c_ubyte), # 是否开启
|
| | | ("AwardState", c_ubyte), # 是否已领奖励
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | |
| | | def Clear(self):
|
| | | self.FuncID = 0
|
| | | self.State = 0
|
| | | self.AwardState = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | def OutputString(self):
|
| | | DumpString = '''//A3 02 功能开通状态 //tagMCFuncOpenStateList:
|
| | | FuncID:%d,
|
| | | State:%d
|
| | | State:%d,
|
| | | AwardState:%d
|
| | | '''\
|
| | | %(
|
| | | self.FuncID,
|
| | | self.State
|
| | | self.State,
|
| | | self.AwardState
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | | ("Value3", c_int), # 自定义值3
|
| | | ("Value4", c_int), # 自定义值4
|
| | | ("Value5", c_int), # 自定义值5
|
| | | ("Value6", c_int), # 自定义值6
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | |
| | | self.Value3 = 0
|
| | | self.Value4 = 0
|
| | | self.Value5 = 0
|
| | | self.Value6 = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | Value2:%d,
|
| | | Value3:%d,
|
| | | Value4:%d,
|
| | | Value5:%d,
|
| | | Value6:%d
|
| | | Value5:%d
|
| | | '''\
|
| | | %(
|
| | | self.SetNum,
|
| | |
| | | self.Value2,
|
| | | self.Value3,
|
| | | self.Value4,
|
| | | self.Value5,
|
| | | self.Value6
|
| | | self.Value5
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | |
|
| | | for keyNum in xrange(8):
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_GameFuncFirstTouch % keyNum, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_GameFuncAwardState % keyNum, 0)
|
| | |
|
| | | needLV, needMagicWeaponIDList, needRealmLV, needMissionIDList = __GetOpenFuncLimit([])
|
| | | for missionID in needMissionIDList:
|
| | |
| | | return 0
|
| | | #任务
|
| | | EventShell.EventRespons_FBEvent(curPlayer, 'fbhelp')
|
| | | EventShell.EventRespons_FBEvent(curPlayer, 'fbhelp_%s'%mapID)
|
| | | # 每日活动
|
| | | PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_FBHelp)
|
| | | addHelpPoint = helpPoint * addFBCnt
|
| | |
| | | ("DWORD", "Weight", 0),
|
| | | ("DWORD", "Mark", 0),
|
| | | ),
|
| | |
|
| | | "FunctionForecast":(
|
| | | ("DWORD", "FuncID", 1),
|
| | | ("dict", "Award", 0),
|
| | | ),
|
| | | }
|
| | |
|
| | | |
| | |
| | | def GetIsBind(self): return self.IsBind # 是否绑定
|
| | | def GetWeight(self): return self.Weight # 权重
|
| | | def GetMark(self): return self.Mark # 排序用标识 |
| | | |
| | | # 功能预告表 |
| | | class IPY_FunctionForecast(): |
| | | |
| | | def __init__(self): |
| | | self.FuncID = 0
|
| | | self.Award = {} |
| | | return |
| | | |
| | | def GetFuncID(self): return self.FuncID # 功能ID
|
| | | def GetAward(self): return self.Award # 属性类型 |
| | |
|
| | |
|
| | | def Log(msg, playerID=0, par=0):
|
| | |
| | | self.ipyActWishingWellLen = len(self.ipyActWishingWellCache)
|
| | | self.ipyWishingWellCache = self.__LoadFileData("WishingWell", IPY_WishingWell)
|
| | | self.ipyWishingWellLen = len(self.ipyWishingWellCache)
|
| | | self.ipyFunctionForecastCache = self.__LoadFileData("FunctionForecast", IPY_FunctionForecast)
|
| | | self.ipyFunctionForecastLen = len(self.ipyFunctionForecastCache)
|
| | | Log("IPY_FuncConfig count=%s" % len(self.ipyFuncConfigDict))
|
| | | Log("IPY_DataMgr InitOK!")
|
| | | return
|
| | |
| | | def GetActWishingWellByIndex(self, index): return self.ipyActWishingWellCache[index]
|
| | | def GetWishingWellCount(self): return self.ipyWishingWellLen
|
| | | def GetWishingWellByIndex(self, index): return self.ipyWishingWellCache[index]
|
| | | def GetFunctionForecastCount(self): return self.ipyFunctionForecastLen
|
| | | def GetFunctionForecastByIndex(self, index): return self.ipyFunctionForecastCache[index]
|
| | |
|
| | | IPYData = IPY_DataMgr()
|
| | | def IPY_Data(): return IPYData
|
| | |
| | | # 领取许愿池奖励
|
| | | elif rewardType == ChConfig.Def_RewardType_WishingWell:
|
| | | PlayerWishingWell.DoGetWishingAward(curPlayer)
|
| | | |
| | | # 功能开启奖励
|
| | | elif rewardType == ChConfig.Def_RewardType_OpenFunc:
|
| | | GameFuncComm.GetFuncOpenAward(curPlayer, dataEx)
|
| | | #
|
| | | # # 充值豪礼奖励
|
| | | # elif rewardType == ShareDefine.Def_RewardType_GoldGift:
|
| | |
| | | import PlayerFreeGoods
|
| | | import FunctionNPCCommon
|
| | | import PlayerGreatMaster
|
| | |
|
| | |
|
| | | import IPY_GameWorld
|
| | | import ItemCommon
|
| | | import ItemControler
|
| | |
|
| | |
|
| | | # 功能开启需执行的函数{功能ID:执行函数, ...} 函数需返回是否激活成功, 功能开启有需要处理功能逻辑的这里增加函数调用配置即可
|
| | |
| | |
|
| | | return ipyData.GetLimitLV()
|
| | |
|
| | | def GetFuncOpenAward(curPlayer, funcID):
|
| | | ## 领取功能开启奖励
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('FunctionForecast', funcID)
|
| | | if not ipyData:
|
| | | return
|
| | | getState = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_GameFuncAwardState, funcID)
|
| | | if getState:
|
| | | return
|
| | | awardDict = ipyData.GetAward()
|
| | | job = curPlayer.GetJob()
|
| | | itemList = awardDict.get(str(job))
|
| | | if not itemList:
|
| | | return
|
| | | # 检查背包
|
| | | needSpace = len(itemList)
|
| | | packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, needSpace)
|
| | | if needSpace > packSpace:
|
| | | PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_998371")
|
| | | return
|
| | | GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_GameFuncAwardState, funcID, 1)
|
| | | |
| | | # 给物品
|
| | | for itemID, itemCount in itemList:
|
| | | ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, 1, [IPY_GameWorld.rptItem])
|
| | | Sync_FuncOpenState(curPlayer, [funcID])
|
| | | return
|
| | | |
| | | def Sync_FuncOpenState(curPlayer, syncFuncIDList=[], isSyncUnOpen=False):
|
| | | ## 通知功能首次触发情况
|
| | | if not syncFuncIDList:
|
| | |
| | | funcOpenState.Clear()
|
| | | funcOpenState.FuncID = funcID
|
| | | funcOpenState.State = openState
|
| | | funcOpenState.AwardState = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_GameFuncAwardState, funcID)
|
| | | funcStatePack.FuncStateList.append(funcOpenState)
|
| | | funcCount = len(funcStatePack.FuncStateList)
|
| | | funcStatePack.FuncCount = funcCount
|