天天0.1折开启条件修改 山河设计图添加跳过战斗

tcx_xiyou_bt_ios
wangzhenxing 2024-06-13 17:59:42 +08:00
parent 5ee38bd7bf
commit 251a724d79
4 changed files with 121 additions and 8 deletions

View File

@ -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)

View File

@ -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,

View File

@ -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()

View File

@ -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")