规则函数、模块与来源索引
从基线
410df07的当前规则源自动抽取;配置原文中的历史措辞不覆盖现行逻辑。
全部 Lua 规则函数
这里逐函数列出原生模块与行号,保证不只按六个界面标题覆盖。模块篇章是主要阅读入口,招募/收藏/忠诚等跨模块规则在正文另有说明。
Business
| 函数签名 | Lua 行号 |
|---|---|
businessList() | 8 |
businessById(id) | 13 |
businessPower(s, b) | 20 |
businessForRoute(routeId) | 25 |
progressionPrestige(s) | 32 |
milestoneList() | 37 |
milestoneCrossed(before, after) | 42 |
nextMilestone(p) | 49 |
catchUpStreak(s) | 64 |
catchUpMul(s) | 69 |
setCatchUpStreak(s, n) | 77 |
prestige2xLeft(s) | 84 |
prestige2xActive(s) | 89 |
grantPrestige2x(s) | 94 |
businessUnlocked(s, b) | 101 |
bestBusiness(s) | 115 |
runBusiness(run) | 123 |
businessBaseSilver(b) | 132 |
bizTier(b) | 139 |
openedTier(s) | 147 |
depositFor(b) | 152 |
shopOpened(s, b) | 162 |
shopOpening(s, b) | 167 |
openShop(s, bizId) | 189 |
branchCount(s) | 205 |
chainCost(s) | 210 |
chainPrestigeGate(n) | 220 |
chainMul(s) | 229 |
chainCanExpand(s) | 236 |
openBranch(s) | 254 |
fmtNum(n) | 270 |
monopolyDegree(s, id) | 275 |
monopolyList(s) | 280 |
investMonopoly(s, id) | 301 |
monopolyHourly(s) | 330 |
Dispatch
| 函数签名 | Lua 行号 |
|---|---|
powerProfile(s, ids) | 8 |
escortPowerContribution(e) | 33 |
teamPower(s, ids) | 41 |
insightSum(s, ids) | 46 |
parallelLimit(s) | 56 |
occupied(s) | 61 |
durationSec(s, route, ids, needPower, knownPower) | 74 |
startRun(s, routeOrBizId, escortIds, bizId) | 99 |
fireEvent(s, run) | 183 |
effectivePower(run) | 220 |
choiceProjection(run, e, failed) | 225 |
battlePreview(s, run, opt) | 253 |
acknowledgeBattle(s, runId) | 274 |
applyChoice(s, run, opt) | 287 |
retryBattle(s, run) | 356 |
Growth
| 函数签名 | Lua 行号 |
|---|---|
facilityCost(s, key) | 8 |
upgradeFacility(s, key) | 13 |
expNeed(level) | 34 |
addExp(s, esc, amount) | 39 |
effAttr(e, key) | 61 |
equipCost(key, level, s) | 78 |
upgradeEquip(s, escId, key) | 87 |
equipPlan(s, escId, key) | 113 |
equipBulk(s, escId, key) | 145 |
pacify(s, escId) | 170 |
giftLoyalty(s, escId, amount) | 187 |
bondList(s) | 200 |
bondMul(s) | 228 |
titleList(s) | 235 |
titleMul(s) | 251 |
biaoqiMul(s) | 258 |
regionList(s) | 268 |
regionMul(s) | 284 |
Journey
| 函数签名 | Lua 行号 |
|---|---|
cityRunName(run) | 40 |
journeyState(s) | 51 |
cityGoal(s, id) | 62 |
selectCityGoal(s, id) | 75 |
drillCityTeam(s) | 94 |
startCityRun(s, kind, escortIds) | 123 |
cityRoadBrief(s, kind) | 174 |
initCityDecisions(s, run) | 182 |
cityDecisionReport(run) | 200 |
cityDecisionSpecs(run) | 220 |
applyDecisionEffect(j, spec) | 236 |
previewCityDecision(run, key) | 247 |
cityDecisionHint(run, o) | 263 |
cityDecisionOptions(run) | 269 |
cityDecisionPreview(run, spec) | 276 |
decisionRandom(j) | 305 |
cityDecisionOutcomes(run, spec) | 313 |
randomDecisionResult(run, spec) | 359 |
acknowledgeCityDecision(s, runId) | 378 |
cityDecisionEvent(run) | 391 |
applyCityDecision(s, run, opt) | 402 |
cityRunOutcome(s, run) | 445 |
creditCityRun(s, run) | 469 |
Progression
| 函数签名 | Lua 行号 |
|---|---|
today() | 8 |
biaoqiCfg() | 13 |
regionCfg() | 18 |
chainCfg() | 23 |
monopolyCfg() | 28 |
monopolyRoutes() | 33 |
dayOf(s) | 38 |
rankOf(prestige) | 49 |
rankBonus(rankIdx) | 65 |
rankIndex(prestige) | 71 |
rankInfo(s) | 76 |
unlocked(s, key) | 84 |
qualityGate(next) | 107 |
maxQuality(s) | 112 |
cityList() | 132 |
cityUnlocked(s, c) | 137 |
citiesOpen(s) | 148 |
citiesForRoute(s, routeId) | 155 |
pickEndCity(s, routeId) | 163 |
cityLocalEvents(city) | 172 |
Records
| 函数签名 | Lua 行号 |
|---|---|
recruitCost(e) | 8 |
recruit(s, idx) | 14 |
refreshRecruits(s) | 45 |
leaderboard(s, metric) | 50 |
track(s, type, value) | 67 |
telemetrySummary(s) | 78 |
Reforge
| 函数签名 | Lua 行号 |
|---|---|
hourlyPrestige(s) | 8 |
bountyCost(s) | 24 |
bountyLeft(s) | 30 |
bountyActive(s) | 36 |
buyBounty(s) | 41 |
reforgeLevel(e, slot) | 60 |
reforgeCost(e, slot) | 66 |
reforgeSlotCost() | 75 |
reforgeOf(e) | 91 |
reforgeBonus(s, ids) | 107 |
reforgeSlots(s, ids) | 130 |
reforge(s, escId, slot, times) | 152 |
reforgeInfo(e) | 224 |
Settlement
| 函数签名 | Lua 行号 |
|---|---|
creditPrestige(s, amount) | 8 |
legCount(run) | 29 |
legName(run, idx) | 34 |
arriveLeg(s, run, idx) | 40 |
settleFinal(s, run) | 62 |
quoteOf(s, ids) | 72 |
settle(s, run) | 80 |
tick(s, dt) | 117 |
commitAll(s, double) | 164 |
State
| 函数签名 | Lua 行号 |
|---|---|
newEscort(qualityIdx, clsKey, entry) | 8 |
recruitTopOdds(cap) | 17 |
recruitOdds(cap) | 25 |
rollQuality(s) | 61 |
recruitPool(s) | 79 |
refreshCost(s) | 91 |
genRecruits(s) | 96 |
initState() | 129 |
migrate(s) | 145 |
offlinePlan(s) | 327 |
offlineRate(s) | 430 |
Training
| 函数签名 | Lua 行号 |
|---|---|
trainCap(s) | 8 |
unitFreight(s) | 13 |
costScale(s) | 20 |
trainCost(key, current, s) | 25 |
trainAttr(s, escId, key) | 32 |
trainPlan(s, escId, key) | 63 |
trainAllPlan(s, escId) | 93 |
trainBulk(s, escId, key) | 149 |
trainAllBulk(s, escId) | 177 |
breakthroughCost(e) | 207 |
breakthrough(s, escId, way) | 215 |
fragRate(s) | 246 |
exchangeFrag(s, escId, target, amount) | 253 |
App、存档与托管适配
原生 App/Save/Auto 的行为优先于 H5 参考源中的 load/save 等浏览器适配。原生适配还负责全局暂停、文件写入、存档校验、离线区间和 UI 入口。
App.lua
| 方法 | 行号 |
|---|---|
App.new() | 18 |
App:Init() | 24 |
App:LoadMode(mode) | 60 |
App:Invalidate() self.dirty=true end | 81 |
App:Toast(message) | 84 |
App:Persist() | 92 |
App:Do(rule,...) | 105 |
App:SelectedIds() | 119 |
App:SetPage(page) | 130 |
App:Open(kind,data) | 142 |
App:CloseDialog() | 149 |
App:CurrentDialog() | 156 |
App:Choose(run,option) | 175 |
App:Claim() | 183 |
App:ClaimOffline() | 191 |
App:RefreshRecruits() | 202 |
App:LeaveCity() | 211 |
App:SwitchMode(mode) | 220 |
App:ImportSave(code) | 231 |
App:RestoreBackup() | 241 |
App:Reset() | 250 |
App:ToggleAuto() | 258 |
App:Update(dt) | 267 |
App:Shutdown() if self.state then self:Persist() end end | 323 |
Save.lua
| 方法 | 行号 |
|---|---|
Save.Validate(state,canonical) | 8 |
Save.LoadMode() | 111 |
Save.RememberMode(mode) | 121 |
Save.Decode(engine, raw) | 128 |
Save.Load(engine) | 142 |
Save.Write(engine, state) | 177 |
Save.RestoreBackup(engine) | 193 |
Save.Export(state) return Codec.Base64Encode(Codec.Encode(state)) end | 201 |
Save.Import(engine, code) | 206 |
Auto.lua
| 方法 | 行号 |
|---|---|
Auto.Choose(a,event,run) | 8 |
Auto.Step(a) | 27 |
全量配置分组
| 配置 | 最终元素数/类型 |
|---|---|
| QUALITY | 12 |
| RECRUIT_COST | 12 |
| CLASSES | object |
| ATTRS | object |
| ROUTES | 4 |
| GOODS | object |
| FACILITIES | object |
| RANKS | 12 |
| EVENTS | 300 |
| NPC_NAMES | 30 |
| ROSTER | 40 |
| EQUIPMENT | 4 |
| UNLOCKS | 22 |
| EVENTS_P1 | 80 |
| ROSTER_P2 | 25 |
| CITIES | 48 |
| EVENTS_P2 | 180 |
| BONDS | 18 |
| TITLES | 14 |
| BIAOQI_POWER | object |
| REGION_POWER | object |
| POWER_TARGET | object |
| BUSINESS_COEF | number |
| BUSINESSES | 7 |
| CHAIN | object |
| MONOPOLY_ROUTES | 5 |
| MONOPOLY | object |