Commit 61dc5eb6c90fe68df51a6ad6f4071ba38c145bba
1 parent
cb3aaefb
fix global to local
Showing
1 changed file
with
4 additions
and
4 deletions
Show diff stats
src/adv/Adv.lua
1 | local Passive = require "adv.AdvPassive" | 1 | local Passive = require "adv.AdvPassive" |
2 | 2 | ||
3 | --- 工具函数 | 3 | +-- 工具函数--第一象限 < 10000 < 第二象限 < 20000 < 第四象限 < 30000 < 第三象限 |
4 | local function getIdByCr(c, r) | 4 | local function getIdByCr(c, r) |
5 | - local crId = math.abs(r) + math.abs(c) * 100 | 5 | + local crId = math.abs(r) + math.abs(c) * 100 -- row + column * 100 |
6 | if c < 0 then | 6 | if c < 0 then |
7 | crId = crId + 10000 | 7 | crId = crId + 10000 |
8 | end | 8 | end |
@@ -27,7 +27,7 @@ local function getCrById(crId) | @@ -27,7 +27,7 @@ local function getCrById(crId) | ||
27 | end | 27 | end |
28 | 28 | ||
29 | -----------------------------随机地图----------------------------- | 29 | -----------------------------随机地图----------------------------- |
30 | ---检查 是否满足层数限制条件 | 30 | +--检查 是否满足层数限制条件 -- if checktype == 1 then check value in range a=b else check value in array a=b=c |
31 | local function checkIsIn(checkValue, checkType, checkRange) | 31 | local function checkIsIn(checkValue, checkType, checkRange) |
32 | if not checkValue then return end | 32 | if not checkValue then return end |
33 | if checkType == 1 then | 33 | if checkType == 1 then |
@@ -213,7 +213,7 @@ local function randomAdvMap(role, chapterId, level, notNotify) | @@ -213,7 +213,7 @@ local function randomAdvMap(role, chapterId, level, notNotify) | ||
213 | end | 213 | end |
214 | for blockId, stageType in pairs(roomData["blocks"]) do | 214 | for blockId, stageType in pairs(roomData["blocks"]) do |
215 | if AdvSpecialStage[stageType] then | 215 | if AdvSpecialStage[stageType] then |
216 | - eventType = AdvEventType[AdvSpecialStage[stageType]] -- 地块固定类型 | 216 | + local eventType = AdvEventType[AdvSpecialStage[stageType]] -- 地块固定类型 |
217 | randomEvent(roomId, blockId, eventType) | 217 | randomEvent(roomId, blockId, eventType) |
218 | else | 218 | else |
219 | stagePool["global"][stageType] = stagePool["global"][stageType] or {} | 219 | stagePool["global"][stageType] = stagePool["global"][stageType] or {} |