-- Facility presentation models. Mutations stay in App:Do / Engine. local W = require("Game/UI/Widgets") local M = {} ---@param a any ---@param key string ---@return table function M.Facility(a,key) local E,s=a.engine,a.state local level=s.facilities[key] or 1 local locked=(key=="fenhao" or key=="biaoqi") and not E.unlocked(s,key) local full=key=="biaoqi" and level>=E.biaoqiCfg().maxLevel local cost=E.facilityCost(s,key) local effect if key=="wuguan" then effect="训练上限 "..E.trainCap(s).." → "..(E.trainCap(s)+10) elseif key=="male" then effect=0.03*(level-1)>=0.5 and "设施减时已达 50%" or "升级后用时 −3%" elseif key=="zhangfang" then effect="升级后镖银 +4%\n提高离线收益" elseif key=="biaoqi" then effect="当前战力 ×"..string.format("%.1f",E.biaoqiMul(s)) else effect="并行押镖 "..E.parallelLimit(s).." → "..(level+1).." 队" end return {key=key,title=E.data.FACILITIES[key].name,level=level,effect=effect, cost=cost,locked=locked,full=full,disabled=locked or full or s.silver