From 251a724d79569d4a509023e02f7b1bfaa6afa8b9 Mon Sep 17 00:00:00 2001 From: wangzhenxing <1545929779@qq.com> Date: Thu, 13 Jun 2024 17:59:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A9=E5=A4=A90.1=E6=8A=98=E5=BC=80?= =?UTF-8?q?=E5=90=AF=E6=9D=A1=E4=BB=B6=E4=BF=AE=E6=94=B9=20=E5=B1=B1?= =?UTF-8?q?=E6=B2=B3=E8=AE=BE=E8=AE=A1=E5=9B=BE=E6=B7=BB=E5=8A=A0=E8=B7=B3?= =?UTF-8?q?=E8=BF=87=E6=88=98=E6=96=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Common/functions.lua | 116 ++++++++++++++++++ .../~Lua/Modules/Battle/View/BattlePanel.lua | 2 +- .../Modules/EightDay/ZeroPointOnePanel.lua | 9 +- .../Modules/Formation/FormationPanelV2.lua | 2 +- 4 files changed, 121 insertions(+), 8 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Common/functions.lua b/Assets/ManagedResources/~Lua/Common/functions.lua index 7b45ebd006..69fd9ede44 100644 --- a/Assets/ManagedResources/~Lua/Common/functions.lua +++ b/Assets/ManagedResources/~Lua/Common/functions.lua @@ -642,6 +642,122 @@ function GetPassiveByMaxStar2(heroConfig,list,star) return aaa end +--获取开启条件及状态 +function GetCommonFunctionOpenTip(openRule) + if openRule then + local states = {} + local tips = {} + local btnTxts = {} + for index, rule in ipairs(openRule) do + states[index] = true + if not rule[1] or rule[1] == 0 then + --LogRed("当前:没有限制条件1") + states[index] = true + elseif rule[1] == 1 then + local star = FightLevelManager.GetAllChapterStars() + if star < rule[2] then + states[index] = false + tips[index] = string.format("山河社稷图星数达%s", rule[2])-- 山河社稷图%s星 + btnTxts[index] = string.format("山河社稷图%s星", rule[2]) + --LogRed(tips[index]..", 当前:"..star) + end + elseif rule[1] == 2 then + local wave = MonsterCampManager.GetMonsterCampCurWave() + if wave <= rule[2] then + states[index] = false + tips[index] = string.format("心魔试炼通关%s层", rule[2])-- 心魔试炼通关999层 + btnTxts[index] = string.format("心魔试炼通关%s层", rule[2]) + --LogRed(tips[index]..", 当前:"..wave) + end + elseif rule[1] == 3 then + local lv = HarmonyManager.GetSingleAdditions(HarmonyAddType.AddLv) + if lv < rule[2] then + states[index] = false + tips[index] = string.format("鸿蒙阵共鸣等级达%s", rule[2])-- 鸿蒙阵共鸣%s级 + btnTxts[index] = string.format("鸿蒙阵共鸣%s级", rule[2]) + --LogRed(tips[index]..", 当前:"..lv) + end + elseif rule[1] == 4 then + -- 指定星级(运算星级)装备数量(初始可用) + local num = EquipManager.GetLimitStarEquipNum(rule[2]) + if num < rule[3] then + local equipStarConfig = ConfigManager.GetConfigData(ConfigName.EquipStarsConfig, rule[2]) + states[index] = false + tips[index] = string.format("拥有%s个%s%s星装备", rule[3], QualityNameDef[equipStarConfig.Quality], equipStarConfig.Stars) + btnTxts[index] = string.format("%s个%s%s星装备", rule[3], QualityNameDef[equipStarConfig.Quality], equipStarConfig.Stars) + --LogRed(tips[index]..", 当前:"..num) + end + elseif rule[1] == 5 then + local _, tlv, _ = LikabilityManager.GetTotalHeroLikeLv(-1) + if tlv < rule[2] then + states[index] = false + tips[index] = string.format("神将总好感度等级达%s", rule[2]) -- 总好感度%s级 + btnTxts[index] = string.format("总好感度%s级", rule[2]) + --LogRed(tips[index]..", 当前:"..tlv) + end + elseif rule[1] == 6 then + -- 逍遥游通关次数 + local xyPassTimes = XiaoYaoManager.GetCurPassTimes() + if xyPassTimes < rule[2] then + states[index] = false + tips[index] = string.format("逍遥游通关%s次", rule[2]) + btnTxts[index] = string.format("逍遥游通关%s次", rule[2]) + --LogRed(tips[index]..", 当前:"..xyPassTimes) + end + elseif rule[1] == 7 then + local c_lv = rule[2] + local c_num = rule[3] + local num = #HeroManager.GetAllHeroDatas(c_lv) + if num < c_num then + states[index] = false + tips[index] = string.format("拥有%s个等级%s以上的神将", c_num, c_lv)-- %s个%s级神将 + btnTxts[index] = string.format("%s个%s级神将", c_num, c_lv) + --LogRed(tips[index]..", 当前:"..num) + end + elseif rule[1]==8 then + if PlayerManager.level < rule[2] then + states[index] = false + tips[index] = string.format("玩家等级达到%s级",rule[2])-- %s个%s级神将 + btnTxts[index] = string.format("玩家等级达到%s级",rule[2]) + end + elseif rule[1]==9 then + if FightPointPassManager.soldierLayerId < rule[2] then + states[index] = false + tips[index] = string.format("关卡达到%s关",rule[2])-- %s个%s级神将 + btnTxts[index] = string.format("关卡达到%s关",rule[2]) + end + end + end + local tip = "" + local btnTxt = "" + local isOk = true + for index, state in ipairs(states) do + if not state then + isOk = false + -- 提示文字 + if tip ~= "" then + tip = tip..string.format(",且%s", tips[index]) + else + tip = tips[index] + end + -- 按钮显示文字 + if btnTxt ~= "" then + btnTxt = tip..string.format(",且%s", btnTxts[index]) + else + btnTxt = btnTxts[index] + end + end + end + return isOk, tip.."解锁", btnTxt, states + end + --LogRed("当前:没有限制条件2") + return true +end + + + + + --把英雄星级父对象和星级传过来 type 1 第6-11个预设 type 2 第12-17个预设 type 3 第18-24个预设 function SetHeroStars(spLoader, starGrid, star, type,_starSize,_scale,_pivot,rotation) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/BattlePanel.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/BattlePanel.lua index 6eb371dea8..7d61743b38 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/BattlePanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/BattlePanel.lua @@ -266,7 +266,7 @@ function this:OnOpen(_fightData, _fightType, _endFunc, _guideType,isChangeBGM) isBack = _fightType == BATTLE_TYPE.BACK --判定是否是战斗回放 hadCounted = 0 -- _fightType ~= BATTLE_TYPE.BACK and _fightType ~= BATTLE_TYPE.BACK_BATTLE - if _fightType==BATTLE_TYPE.STORY_FIGHT and PlayerPrefs.GetInt(PlayerManager.uid.."isJumpFight")==1 then + if (_fightType==BATTLE_TYPE.STORY_FIGHT or _fightType==BATTLE_TYPE.FIGHTLEVEL ) and PlayerPrefs.GetInt(PlayerManager.uid.."isJumpFight")==1 then local record = { fightData = _fightData.fightData, diff --git a/Assets/ManagedResources/~Lua/Modules/EightDay/ZeroPointOnePanel.lua b/Assets/ManagedResources/~Lua/Modules/EightDay/ZeroPointOnePanel.lua index 4206a943d9..a6ffb32022 100644 --- a/Assets/ManagedResources/~Lua/Modules/EightDay/ZeroPointOnePanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/EightDay/ZeroPointOnePanel.lua @@ -155,13 +155,10 @@ end --获取开启条件 function this.GetOpenTip(_config) if _config and _config.Condition then - local type=_config.Condition[1][1] - local value=_config.Condition[1][2] - if type==1 then - return string.format("玩家等级%s级开启",value) - end + local isOk,tip=GetCommonFunctionOpenTip(_config.Condition) + return tip end - return + return "" end function ZeroPointOnePanel:OnSortingOrderChange() diff --git a/Assets/ManagedResources/~Lua/Modules/Formation/FormationPanelV2.lua b/Assets/ManagedResources/~Lua/Modules/Formation/FormationPanelV2.lua index 731dccf8c3..99153adf4b 100644 --- a/Assets/ManagedResources/~Lua/Modules/Formation/FormationPanelV2.lua +++ b/Assets/ManagedResources/~Lua/Modules/Formation/FormationPanelV2.lua @@ -277,7 +277,7 @@ end function this:OnOpen(_panelType,...) Log("panelType:".._panelType) panelType = _panelType - this.jumpFightObj:SetActive(CheckFunctionOpen(FUNCTION_OPEN_TYPE.FightJump) and panelType==FORMATION_TYPE.STORY) + this.jumpFightObj:SetActive(CheckFunctionOpen(FUNCTION_OPEN_TYPE.FightJump) and (panelType==FORMATION_TYPE.STORY or panelType==FORMATION_TYPE.FIGHTLEVEL )) if panelType == FORMATION_TYPE.EXPEDITION or panelType == FORMATION_TYPE.CARBON then for k,v in pairs(bgListGo) do v:GetComponent("Image").sprite = this.spLoader:LoadSprite("bd_xinkapaifan")