fix:3094 【后端】仙盟兽粮,修改为可手动捐献
| | |
| | | BYTE EliteCnt; //精英数量
|
| | | DWORD NeedMoney; //升级需要资金
|
| | | DWORD WeekMissionMoneyMax; //每周任务最大可获得仙盟资金
|
| | | BYTE BossFBCnt; //BOSS副本次数
|
| | | };
|
| | |
|
| | | //集市查询表
|
| | |
| | | Def_FamilySetting_MaxZhangLaoCnt, #最大长老数
|
| | | Def_FamilySetting_LvUpCost, #家族升级需要消耗升级所需资金
|
| | | Def_FamilySetting_WeekMissionMoneyMax,#每周任务最大可获得仙盟资金
|
| | | Def_FamilySetting_SystemLostMoney, #系统每日维护费
|
| | | Def_FamilySetting_BossFBCnt, #BOSS副本次数
|
| | | Def_FamilySetting_Max, #表长度异常(必须放最后)
|
| | | ) = range(0, 6 + 1)
|
| | | FamilySettingDict = {
|
| | |
| | | Def_FamilySetting_MaxZhangLaoCnt:'EliteCnt',
|
| | | Def_FamilySetting_LvUpCost:'NeedMoney',
|
| | | Def_FamilySetting_WeekMissionMoneyMax:'WeekMissionMoneyMax',
|
| | | Def_FamilySetting_BossFBCnt:'BossFBCnt',
|
| | | }
|
| | |
|
| | | #家族成员接口对应家族配置表索引
|
| | |
| | | ("BYTE", "EliteCnt", 0),
|
| | | ("DWORD", "NeedMoney", 0),
|
| | | ("DWORD", "WeekMissionMoneyMax", 0),
|
| | | ("BYTE", "BossFBCnt", 0),
|
| | | ),
|
| | |
|
| | | "MarketQuery":(
|
| | |
| | | self.DeputyLeaderCnt = 0
|
| | | self.EliteCnt = 0
|
| | | self.NeedMoney = 0
|
| | | self.WeekMissionMoneyMax = 0 |
| | | self.WeekMissionMoneyMax = 0
|
| | | self.BossFBCnt = 0 |
| | | return |
| | | |
| | | def GetFamilyLV(self): return self.FamilyLV # 仙盟等级
|
| | |
| | | def GetDeputyLeaderCnt(self): return self.DeputyLeaderCnt # 副盟主数量
|
| | | def GetEliteCnt(self): return self.EliteCnt # 精英数量
|
| | | def GetNeedMoney(self): return self.NeedMoney # 升级需要资金
|
| | | def GetWeekMissionMoneyMax(self): return self.WeekMissionMoneyMax # 每周任务最大可获得仙盟资金 |
| | | def GetWeekMissionMoneyMax(self): return self.WeekMissionMoneyMax # 每周任务最大可获得仙盟资金
|
| | | def GetBossFBCnt(self): return self.BossFBCnt # BOSS副本次数 |
| | | |
| | | # 集市查询表 |
| | | class IPY_MarketQuery(): |
| | |
| | | for i, strValue in enumerate(rowList):
|
| | | if i == 0:
|
| | | continue
|
| | | fieldName = fieldList[i][1]
|
| | | strValue = strValue.lstrip().rstrip()
|
| | | if strValue.isdigit():
|
| | | configValue = int(strValue)
|
| | | elif (strValue.startswith("{") and strValue.endswith("}")) \
|
| | | or (strValue.startswith("[") and strValue.endswith("]")) \
|
| | | or (strValue.startswith("(") and strValue.endswith(")")):
|
| | | configValue = eval(strValue)
|
| | | elif "_" in strValue and type(self.__StrToDict(strValue)) == dict:
|
| | | configValue = self.__StrToDict(strValue)
|
| | | elif ChConfig.Def_Str_Montant in strValue:
|
| | | configValue = eval("(%s,)" % strValue.replace(ChConfig.Def_Str_Montant, ","))
|
| | | elif strValue in ["-", ""]:
|
| | | configValue = ""
|
| | | else:
|
| | | configValue = self.__ToFloat(strValue)
|
| | | try:
|
| | | fieldName = fieldList[i][1]
|
| | | strValue = strValue.lstrip().rstrip()
|
| | | if strValue.isdigit():
|
| | | configValue = int(strValue)
|
| | | elif (strValue.startswith("{") and strValue.endswith("}")) \
|
| | | or (strValue.startswith("[") and strValue.endswith("]")) \
|
| | | or (strValue.startswith("(") and strValue.endswith(")")):
|
| | | configValue = eval(strValue)
|
| | | elif "_" in strValue and type(self.__StrToDict(strValue)) == dict:
|
| | | configValue = self.__StrToDict(strValue)
|
| | | elif ChConfig.Def_Str_Montant in strValue:
|
| | | configValue = eval("(%s,)" % strValue.replace(ChConfig.Def_Str_Montant, ","))
|
| | | elif strValue in ["-", ""]:
|
| | | configValue = ""
|
| | | else:
|
| | | configValue = self.__ToFloat(strValue)
|
| | | except BaseException:
|
| | | ErrLog("SetIpyDataError: tableName=%s,key=%s,i=%s,value=%s" % ("FuncConfig", key, i, strValue))
|
| | | raise
|
| | | setattr(funcConfigObj, fieldName, configValue)
|
| | | self.ipyFuncConfigDict[key] = funcConfigObj
|
| | | return
|
| | |
| | |
|
| | | familyMoney = family.GetMoney()
|
| | |
|
| | | useMoney = GetFamilySetting(family, ChConfig.Def_FamilySetting_SystemLostMoney)
|
| | | |
| | | #家族资金不足, 解散
|
| | | if familyMoney < useMoney:
|
| | | family.SetMoney(0)
|
| | | delFamilyList.append(family)
|
| | | continue
|
| | | # useMoney = GetFamilySetting(family, ChConfig.Def_FamilySetting_SystemLostMoney)
|
| | | # |
| | | # #家族资金不足, 解散
|
| | | # if familyMoney < useMoney:
|
| | | # family.SetMoney(0)
|
| | | # delFamilyList.append(family)
|
| | | # continue
|
| | | #多久没人上线,解散
|
| | | offlineDay = GetLastOnlineMemberOfflineTime(family)
|
| | | GameWorld.DebugLog(' 仙盟%s %s天没人上线了'%(family.GetID(), offlineDay))
|
| | |
| | | ChConfig.Def_Family_ClearRequestAddNote_Day)
|
| | |
|
| | | #此处不通知地图服务器家族资金变更
|
| | | family.SetMoney(familyMoney - useMoney)
|
| | | if useMoney > 0:
|
| | | #帮会日常维持消耗{%S1%}银两帮会资金
|
| | | PlayerControl.FamilyNotify(family.GetID(), 'jiazu_lhs_272921', [useMoney])
|
| | | # family.SetMoney(familyMoney - useMoney)
|
| | | # if useMoney > 0:
|
| | | # #帮会日常维持消耗{%S1%}银两帮会资金
|
| | | # PlayerControl.FamilyNotify(family.GetID(), 'jiazu_lhs_272921', [useMoney])
|
| | | #自动传位
|
| | | __AutoChangeLeader(family)
|
| | |
|
| | |
| | | def GetFamilyBossIsOpen(fActionData): return fActionData.GetValue2()
|
| | | def SetFamilyBossIsOpen(fActionData, isOpen): return fActionData.SetValue2(isOpen)
|
| | |
|
| | | def GetFamilyBossLimitCnt():
|
| | | def GetFamilyBossLimitCnt(family):
|
| | | '''仙盟BOSS每周次数限制'''
|
| | | return IpyGameDataPY.GetFuncCfg('FamilyBossOpen', 4)
|
| | | return PlayerFamily.GetFamilySetting(family, ChConfig.Def_FamilySetting_BossFBCnt)#IpyGameDataPY.GetFuncCfg('FamilyBossOpen', 4)
|
| | |
|
| | | def GetFamilyBossCostFood():
|
| | | '''仙盟BOSS开启消耗兽粮'''
|
| | |
| | | curWeekOpenCnt = GetFamilyBossOpenCnt(familyBossFBData)
|
| | |
|
| | | # 次数判断
|
| | | maxOpenCnt = GetFamilyBossLimitCnt()
|
| | | maxOpenCnt = GetFamilyBossLimitCnt(curFamily)
|
| | | if curWeekOpenCnt >= maxOpenCnt:
|
| | | GameWorld.Log(" 本周开启次数=%s >= 最大开启次数=%s" % (curWeekOpenCnt, maxOpenCnt))
|
| | | return
|
| | |
| | | Item = curRunAroundRewardNode.GetAttribute("item")
|
| | | minLV = GameWorld.ToIntDef(curRunAroundRewardNode.GetAttribute("minlv"), 0)
|
| | | maxLV = GameWorld.ToIntDef(curRunAroundRewardNode.GetAttribute("maxlv"), 0)
|
| | | familyHornor = GameWorld.ToIntDef(curRunAroundRewardNode.GetAttribute("familyhornor"), 0)
|
| | | #继承每日奖励,参考设置
|
| | | dayEventRewardData = RunAroundRewardData()
|
| | | dayEventRewardData.Exp = Exp
|
| | | dayEventRewardData.AddExp = addExp
|
| | | dayEventRewardData.Money = Money
|
| | | dayEventRewardData.Item = Item
|
| | | dayEventRewardData.PlayerFamilyHornor = familyHornor
|
| | | allRunAround.Rewards[(minLV, maxLV)] = dayEventRewardData
|
| | | if minLV < allRunAround.MinLV:
|
| | | allRunAround.MinLV = minLV
|
| | |
| | | Def_Run_Around_Reward_Exp = "run_around_exp" #跑环任务的奖励
|
| | | Def_Run_Around_Reward_ExpPoint = "run_around_exp_point" #跑环任务的奖励
|
| | | Def_Run_Around_Reward_Money = "run_around_money" #跑环任务的给钱
|
| | |
|
| | | Def_Run_Around_Reward_FamilyHornor = "run_around_familyhornor" #跑环任务的仙盟贡献奖励
|
| | | Def_Run_Around_Reward_Multiple = "run_around_multiple" #跑环任务的奖励翻倍数
|
| | |
|
| | | Def_Task_Reward_Per = "reward_per" #领取任务奖励倍数百分比; 150代表1.5倍
|
| | |
| | | packList=[IPY_GameWorld.rptItem], isSuite=False,
|
| | | addAttrLV=0, isLucky=False, skillBoostEff=[], holeCount=0,
|
| | | equipIndex= -1, isGreat=0, baseAttrRate=ShareDefine.Def_MaxRateValue, greatAttrList=[]):
|
| | | if PlayerFamily.DoAddFamilyBossFoodEx(curPlayer, itemID, itemCount, ShareDefine.Def_AddFAVReason_DoFamilyMisson):
|
| | | #仙盟兽粮自动使用
|
| | | return
|
| | | # if PlayerFamily.DoAddFamilyBossFoodEx(curPlayer, itemID, itemCount, ShareDefine.Def_AddFAVReason_DoFamilyMisson):
|
| | | # #仙盟兽粮自动使用
|
| | | # return
|
| | |
|
| | | #任务给予物品应该只能放入万能背包和背包
|
| | | itemControl = ItemControler.PlayerItemControler(curPlayer)
|
| | |
| | |
|
| | | rewardList = __GetRunAroundReward(curPlayer, curMission)
|
| | | if rewardList:
|
| | | curExp, curMoney, itemID, itemCount = rewardList
|
| | | curExp, curMoney, curFamilyHornor, itemID, itemCount = rewardList
|
| | | else:
|
| | | curExp, curMoney, itemID, itemCount = 0, 0, 0, 0
|
| | | curExp, curMoney, curFamilyHornor, itemID, itemCount = 0, 0, 0, 0
|
| | |
|
| | | curMission.SetProperty(Def_Run_Around_Reward_Exp, curExp % ChConfig.Def_PerPointValue)
|
| | | curMission.SetProperty(Def_Run_Around_Reward_ExpPoint, curExp / ChConfig.Def_PerPointValue)
|
| | |
| | |
|
| | | curMission.SetProperty(Def_Day_Event_Reward_Item_Id, itemID)
|
| | | curMission.SetProperty(Def_Day_Event_Reward_Item_Count, itemCount)
|
| | | curMission.SetProperty(Def_Run_Around_Reward_FamilyHornor, curFamilyHornor)
|
| | | |
| | | return
|
| | |
|
| | |
|
| | |
| | | curExp = eval(IpyGameDataPY.GetFuncCfg('RunTaskExp'))
|
| | | curExp += curLVRunAroundReward.AddExp
|
| | | curMoney = baseMoney
|
| | | |
| | | curFamilyHornor = curLVRunAroundReward.PlayerFamilyHornor
|
| | | itemInfo = curLVRunAroundReward.Item
|
| | | if itemInfo:
|
| | | itemID, itemCount = eval(itemInfo)
|
| | | else:
|
| | | itemID, itemCount = 0, 0
|
| | |
|
| | | return (curExp, curMoney, itemID, itemCount)
|
| | | return (curExp, curMoney, curFamilyHornor, itemID, itemCount)
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | ##给予跑环奖励
|
| | |
| | | addDataDict = {ChConfig.Def_Give_Reason_SonKey:"Run"}
|
| | | PlayerControl.GiveMoney(curPlayer, runAroundReward.MoneyType, money, ChConfig.Def_GiveMoney_Mission, addDataDict, False)
|
| | |
|
| | | familyHornor = curMission.GetProperty(Def_Run_Around_Reward_FamilyHornor)
|
| | | if familyHornor: |
| | | PlayerFamily.AddPlayerFamilyActiveValue(curPlayer, familyHornor, True, ShareDefine.Def_AddFAVReason_DoFamilyMisson, True)
|
| | |
|
| | | item_id = curMission.GetProperty(Def_Day_Event_Reward_Item_Id)
|
| | | item_count = curMission.GetProperty(Def_Day_Event_Reward_Item_Count)
|
| | |
|