|
@@ -1,5 +1,5 @@
|
|
|
--[[
|
|
--[[
|
|
|
- 失落神庙
|
|
|
|
|
|
|
+ 失锟斤拷锟斤拷锟斤拷
|
|
|
|
|
|
|
|
]]
|
|
]]
|
|
|
local Msg = require("core.Msg")
|
|
local Msg = require("core.Msg")
|
|
@@ -28,9 +28,9 @@ local CommonDB = require("common.CommonDB")
|
|
|
|
|
|
|
|
local Lost_Handle_Func = { }
|
|
local Lost_Handle_Func = { }
|
|
|
|
|
|
|
|
-QUEUE_LEN = 3 -- 每次推送的横向队列数
|
|
|
|
|
-START_X = 1 -- 起始横向位置
|
|
|
|
|
-START_LAYER = 1 -- 起始层数
|
|
|
|
|
|
|
+QUEUE_LEN = 3 -- 每锟斤拷锟斤拷锟酵的猴拷锟斤拷锟斤拷锟斤拷锟�
|
|
|
|
|
+START_X = 1 -- 锟斤拷始锟斤拷锟斤拷位锟斤拷
|
|
|
|
|
+START_LAYER = 1 -- 锟斤拷始锟斤拷锟斤拷
|
|
|
OP_QUERY = 0
|
|
OP_QUERY = 0
|
|
|
OP_CONFIRM = 1
|
|
OP_CONFIRM = 1
|
|
|
INIT_HP_MAX = 100
|
|
INIT_HP_MAX = 100
|
|
@@ -42,23 +42,23 @@ end
|
|
|
|
|
|
|
|
--
|
|
--
|
|
|
local function isOpen(human)
|
|
local function isOpen(human)
|
|
|
- local openDay = CommonDB.getServerOpenDay()
|
|
|
|
|
- if not openDay then
|
|
|
|
|
- return Broadcast.sendErr(human,Lang.LOST_TEMPLE_OPEN_ERROR)
|
|
|
|
|
- end
|
|
|
|
|
-
|
|
|
|
|
- if openDay < 7 then
|
|
|
|
|
- return Broadcast.sendErr(human,Lang.LOST_TEMPLE_OPEN_ERROR)
|
|
|
|
|
- end
|
|
|
|
|
-
|
|
|
|
|
- -- 已经开启
|
|
|
|
|
- if (openDay - 7 + 1) % 2 ~= 1 then
|
|
|
|
|
- return Broadcast.sendErr(human,Lang.LOST_TEMPLE_OPEN_ERROR)
|
|
|
|
|
- end
|
|
|
|
|
-
|
|
|
|
|
- if not RoleSystemLogic.isOpen(human, RoleSystemDefine.ROLE_SYS_ID_1208) then
|
|
|
|
|
- return Broadcast.sendErr(human,Lang.LOST_TEMPLE_OPEN_ERROR)
|
|
|
|
|
- end
|
|
|
|
|
|
|
+ --local openDay = CommonDB.getServerOpenDay()
|
|
|
|
|
+ --if not openDay then
|
|
|
|
|
+ -- return Broadcast.sendErr(human,Lang.LOST_TEMPLE_OPEN_ERROR)
|
|
|
|
|
+ --end
|
|
|
|
|
+ --
|
|
|
|
|
+ --if openDay < 7 then
|
|
|
|
|
+ -- return Broadcast.sendErr(human,Lang.LOST_TEMPLE_OPEN_ERROR)
|
|
|
|
|
+ --end
|
|
|
|
|
+ --
|
|
|
|
|
+ ---- 锟窖撅拷锟斤拷锟斤拷
|
|
|
|
|
+ --if (openDay - 7 + 1) % 2 ~= 1 then
|
|
|
|
|
+ -- return Broadcast.sendErr(human,Lang.LOST_TEMPLE_OPEN_ERROR)
|
|
|
|
|
+ --end
|
|
|
|
|
+ --
|
|
|
|
|
+ --if not RoleSystemLogic.isOpen(human, RoleSystemDefine.ROLE_SYS_ID_1208) then
|
|
|
|
|
+ -- return Broadcast.sendErr(human,Lang.LOST_TEMPLE_OPEN_ERROR)
|
|
|
|
|
+ --end
|
|
|
return true
|
|
return true
|
|
|
end
|
|
end
|
|
|
|
|
|
|
@@ -73,7 +73,7 @@ function onZero()
|
|
|
return
|
|
return
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
- -- 已经关闭
|
|
|
|
|
|
|
+ -- 锟窖撅拷锟截憋拷
|
|
|
if (openDay - 7 + 1) % 2 ~= 0 then
|
|
if (openDay - 7 + 1) % 2 ~= 0 then
|
|
|
return
|
|
return
|
|
|
end
|
|
end
|
|
@@ -83,30 +83,30 @@ end
|
|
|
|
|
|
|
|
|
|
|
|
|
function updateDaily(human)
|
|
function updateDaily(human)
|
|
|
- local openDay = CommonDB.getServerOpenDay()
|
|
|
|
|
- if not openDay then
|
|
|
|
|
- return
|
|
|
|
|
- end
|
|
|
|
|
-
|
|
|
|
|
- if openDay < 7 then
|
|
|
|
|
- return
|
|
|
|
|
- end
|
|
|
|
|
-
|
|
|
|
|
- -- 已经关闭
|
|
|
|
|
- if (openDay - 7 + 1) % 2 ~= 0 then
|
|
|
|
|
- return
|
|
|
|
|
- end
|
|
|
|
|
-
|
|
|
|
|
- human.lostTemple = nil
|
|
|
|
|
-
|
|
|
|
|
- local msgRet = Msg.gc.GC_LOST_TEMPLE_CLOSE
|
|
|
|
|
- Msg.send(msgRet, human.fd)
|
|
|
|
|
|
|
+ --local openDay = CommonDB.getServerOpenDay()
|
|
|
|
|
+ --if not openDay then
|
|
|
|
|
+ -- return
|
|
|
|
|
+ --end
|
|
|
|
|
+ --
|
|
|
|
|
+ --if openDay < 7 then
|
|
|
|
|
+ -- return
|
|
|
|
|
+ --end
|
|
|
|
|
+ --
|
|
|
|
|
+ ---- 锟窖撅拷锟截憋拷
|
|
|
|
|
+ --if (openDay - 7 + 1) % 2 ~= 0 then
|
|
|
|
|
+ -- return
|
|
|
|
|
+ --end
|
|
|
|
|
+ --
|
|
|
|
|
+ --human.lostTemple = nil
|
|
|
|
|
+ --
|
|
|
|
|
+ --local msgRet = Msg.gc.GC_LOST_TEMPLE_CLOSE
|
|
|
|
|
+ --Msg.send(msgRet, human.fd)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
-- db
|
|
-- db
|
|
|
local QueryByUuid = { _id = nil }
|
|
local QueryByUuid = { _id = nil }
|
|
|
|
|
|
|
|
--- 插入新的数据
|
|
|
|
|
|
|
+-- 锟斤拷锟斤拷锟铰碉拷锟斤拷锟斤拷
|
|
|
function dbRead(human)
|
|
function dbRead(human)
|
|
|
if not isOpen(human) then return end
|
|
if not isOpen(human) then return end
|
|
|
human.lostTemple = { }
|
|
human.lostTemple = { }
|
|
@@ -143,7 +143,7 @@ function onLogin(human)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
--- 初始化玩家当前格子
|
|
|
|
|
|
|
+-- 锟斤拷始锟斤拷锟斤拷业锟角帮拷锟斤拷锟�
|
|
|
local function printGrid(human)
|
|
local function printGrid(human)
|
|
|
if not human.lostTemple then return end
|
|
if not human.lostTemple then return end
|
|
|
|
|
|
|
@@ -185,7 +185,7 @@ local function makeMonsterGrid(human, cmd)
|
|
|
local LostTempleMonster = LostTempleExcel.Lost[x]
|
|
local LostTempleMonster = LostTempleExcel.Lost[x]
|
|
|
if not LostTempleMonster then return end
|
|
if not LostTempleMonster then return end
|
|
|
|
|
|
|
|
- -- 取共鸣英雄的等级
|
|
|
|
|
|
|
+ -- 取锟斤拷锟斤拷英锟桔的等硷拷
|
|
|
local totalLv = 0
|
|
local totalLv = 0
|
|
|
local equally = 0
|
|
local equally = 0
|
|
|
local equallyLv = 0
|
|
local equallyLv = 0
|
|
@@ -228,10 +228,10 @@ local function makeMonsterGrid(human, cmd)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
--- 制造一个召唤祭坛
|
|
|
|
|
|
|
+-- 锟斤拷锟斤拷一锟斤拷锟劫伙拷锟斤拷坛
|
|
|
local function makeSummonHeroGrid(human)
|
|
local function makeSummonHeroGrid(human)
|
|
|
|
|
|
|
|
- -- 取共鸣英雄的等级
|
|
|
|
|
|
|
+ -- 取锟斤拷锟斤拷英锟桔的等硷拷
|
|
|
local totalLv = 0
|
|
local totalLv = 0
|
|
|
local equally = 0
|
|
local equally = 0
|
|
|
local equallyLv = 0
|
|
local equallyLv = 0
|
|
@@ -263,13 +263,13 @@ local function makeSummonHeroGrid(human)
|
|
|
--
|
|
--
|
|
|
local summonHero = { }
|
|
local summonHero = { }
|
|
|
local weightHeroTb = Util.copyTable(LostTempleExcel.Hero[heroIndex].heroid)
|
|
local weightHeroTb = Util.copyTable(LostTempleExcel.Hero[heroIndex].heroid)
|
|
|
- -- 根据权重取出4英雄
|
|
|
|
|
|
|
+ -- 锟斤拷锟斤拷权锟斤拷取锟斤拷4英锟斤拷
|
|
|
local totalWeight = 0
|
|
local totalWeight = 0
|
|
|
for i = 1, #weightHeroTb do
|
|
for i = 1, #weightHeroTb do
|
|
|
totalWeight = totalWeight + weightHeroTb[i][4]
|
|
totalWeight = totalWeight + weightHeroTb[i][4]
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
- -- 取4次
|
|
|
|
|
|
|
+ -- 取4锟斤拷
|
|
|
local len = 0
|
|
local len = 0
|
|
|
for k = 1, 4 do
|
|
for k = 1, 4 do
|
|
|
local random = math.random(1, totalWeight)
|
|
local random = math.random(1, totalWeight)
|
|
@@ -281,7 +281,7 @@ local function makeSummonHeroGrid(human)
|
|
|
summonHero[len].lv = weightHeroTb[i][2]
|
|
summonHero[len].lv = weightHeroTb[i][2]
|
|
|
summonHero[len].star = weightHeroTb[i][3]
|
|
summonHero[len].star = weightHeroTb[i][3]
|
|
|
|
|
|
|
|
- -- 最后一个放入到 这一个里面 删掉最后一个
|
|
|
|
|
|
|
+ -- 锟斤拷锟揭伙拷锟斤拷锟斤拷氲� 锟斤拷一锟斤拷锟斤拷锟斤拷 删锟斤拷锟斤拷锟揭伙拷锟�
|
|
|
totalWeight = totalWeight - weightHeroTb[i][4]
|
|
totalWeight = totalWeight - weightHeroTb[i][4]
|
|
|
weightHeroTb[i] = weightHeroTb[#weightHeroTb]
|
|
weightHeroTb[i] = weightHeroTb[#weightHeroTb]
|
|
|
weightHeroTb[#weightHeroTb] = nil
|
|
weightHeroTb[#weightHeroTb] = nil
|
|
@@ -300,19 +300,19 @@ end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--- 制造一个智慧树
|
|
|
|
|
|
|
+-- 锟斤拷锟斤拷一锟斤拷锟角伙拷锟斤拷
|
|
|
local function makeSummonTreeGrid(human)
|
|
local function makeSummonTreeGrid(human)
|
|
|
|
|
|
|
|
--
|
|
--
|
|
|
local summonTree = { }
|
|
local summonTree = { }
|
|
|
local weightTreeTb = Util.copyTable(LostTempleExcel.Tree)
|
|
local weightTreeTb = Util.copyTable(LostTempleExcel.Tree)
|
|
|
- -- 根据权重取出4英雄
|
|
|
|
|
|
|
+ -- 锟斤拷锟斤拷权锟斤拷取锟斤拷4英锟斤拷
|
|
|
local totalWeight = 0
|
|
local totalWeight = 0
|
|
|
for i = 1, #weightTreeTb do
|
|
for i = 1, #weightTreeTb do
|
|
|
totalWeight = totalWeight + weightTreeTb[i].weight
|
|
totalWeight = totalWeight + weightTreeTb[i].weight
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
- -- 取3次
|
|
|
|
|
|
|
+ -- 取3锟斤拷
|
|
|
local len = 0
|
|
local len = 0
|
|
|
for k = 1, 3 do
|
|
for k = 1, 3 do
|
|
|
local random = math.random(1, totalWeight)
|
|
local random = math.random(1, totalWeight)
|
|
@@ -320,7 +320,7 @@ local function makeSummonTreeGrid(human)
|
|
|
if random <= weightTreeTb[i].weight then
|
|
if random <= weightTreeTb[i].weight then
|
|
|
len = len + 1
|
|
len = len + 1
|
|
|
summonTree[len] = i
|
|
summonTree[len] = i
|
|
|
- -- 最后一个放入到 这一个里面 删掉最后一个
|
|
|
|
|
|
|
+ -- 锟斤拷锟揭伙拷锟斤拷锟斤拷氲� 锟斤拷一锟斤拷锟斤拷锟斤拷 删锟斤拷锟斤拷锟揭伙拷锟�
|
|
|
totalWeight = totalWeight - weightTreeTb[i].weight
|
|
totalWeight = totalWeight - weightTreeTb[i].weight
|
|
|
weightTreeTb[i] = weightTreeTb[#weightTreeTb]
|
|
weightTreeTb[i] = weightTreeTb[#weightTreeTb]
|
|
|
weightTreeTb[#weightTreeTb] = nil
|
|
weightTreeTb[#weightTreeTb] = nil
|
|
@@ -338,18 +338,18 @@ local function makeSummonTreeGrid(human)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
--- 神界商店
|
|
|
|
|
|
|
+-- 锟斤拷锟斤拷痰锟�
|
|
|
local function makeSummonShopGrid(human)
|
|
local function makeSummonShopGrid(human)
|
|
|
--
|
|
--
|
|
|
local summonShop = { }
|
|
local summonShop = { }
|
|
|
local weightShopTb = Util.copyTable(LostTempleExcel.LostShop)
|
|
local weightShopTb = Util.copyTable(LostTempleExcel.LostShop)
|
|
|
- -- 根据权重取出4英雄
|
|
|
|
|
|
|
+ -- 锟斤拷锟斤拷权锟斤拷取锟斤拷4英锟斤拷
|
|
|
local totalWeight = 0
|
|
local totalWeight = 0
|
|
|
for i = 1, #weightShopTb do
|
|
for i = 1, #weightShopTb do
|
|
|
totalWeight = totalWeight + weightShopTb[i].weight
|
|
totalWeight = totalWeight + weightShopTb[i].weight
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
- -- 取3次
|
|
|
|
|
|
|
+ -- 取3锟斤拷
|
|
|
local len = 0
|
|
local len = 0
|
|
|
for k = 1, 4 do
|
|
for k = 1, 4 do
|
|
|
local random = math.random(1, totalWeight)
|
|
local random = math.random(1, totalWeight)
|
|
@@ -357,7 +357,7 @@ local function makeSummonShopGrid(human)
|
|
|
if random <= weightShopTb[i].weight then
|
|
if random <= weightShopTb[i].weight then
|
|
|
len = len + 1
|
|
len = len + 1
|
|
|
summonShop[len] = i
|
|
summonShop[len] = i
|
|
|
- -- 最后一个放入到 这一个里面 删掉最后一个
|
|
|
|
|
|
|
+ -- 锟斤拷锟揭伙拷锟斤拷锟斤拷氲� 锟斤拷一锟斤拷锟斤拷锟斤拷 删锟斤拷锟斤拷锟揭伙拷锟�
|
|
|
totalWeight = totalWeight - weightShopTb[i].weight
|
|
totalWeight = totalWeight - weightShopTb[i].weight
|
|
|
weightShopTb[i] = weightShopTb[#weightShopTb]
|
|
weightShopTb[i] = weightShopTb[#weightShopTb]
|
|
|
weightShopTb[#weightShopTb] = nil
|
|
weightShopTb[#weightShopTb] = nil
|
|
@@ -374,7 +374,7 @@ local function makeSummonShopGrid(human)
|
|
|
return summonShop
|
|
return summonShop
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
--- 制造一个宝箱
|
|
|
|
|
|
|
+-- 锟斤拷锟斤拷一锟斤拷锟斤拷锟斤拷
|
|
|
local function makeBoxGrid(human)
|
|
local function makeBoxGrid(human)
|
|
|
for i = 1, #ElementExcel do
|
|
for i = 1, #ElementExcel do
|
|
|
local element = ElementExcel[i]
|
|
local element = ElementExcel[i]
|
|
@@ -385,7 +385,7 @@ local function makeBoxGrid(human)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
--- 制造一个传送门
|
|
|
|
|
|
|
+-- 锟斤拷锟斤拷一锟斤拷锟斤拷锟斤拷锟斤拷
|
|
|
local function makeConverDoorGrid(human)
|
|
local function makeConverDoorGrid(human)
|
|
|
for i = 1, #ElementExcel do
|
|
for i = 1, #ElementExcel do
|
|
|
local element = ElementExcel[i]
|
|
local element = ElementExcel[i]
|
|
@@ -397,7 +397,7 @@ end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--- 初始化玩家当前格子
|
|
|
|
|
|
|
+-- 锟斤拷始锟斤拷锟斤拷业锟角帮拷锟斤拷锟�
|
|
|
local function makeGrid(human)
|
|
local function makeGrid(human)
|
|
|
if not human.lostTemple then return end
|
|
if not human.lostTemple then return end
|
|
|
|
|
|
|
@@ -409,7 +409,7 @@ local function makeGrid(human)
|
|
|
local LostTemple = LostTempleConfig[random]
|
|
local LostTemple = LostTempleConfig[random]
|
|
|
if not LostTemple then return end
|
|
if not LostTemple then return end
|
|
|
|
|
|
|
|
- -- 清除玩家当前位置的数据
|
|
|
|
|
|
|
+ -- 锟斤拷锟斤拷锟揭碉拷前位锟矫碉拷锟斤拷锟斤拷
|
|
|
human.lostTemple.grid = human.lostTemple.grid or { }
|
|
human.lostTemple.grid = human.lostTemple.grid or { }
|
|
|
human.lostTemple.grid[human.lostTemple.x] = nil
|
|
human.lostTemple.grid[human.lostTemple.x] = nil
|
|
|
|
|
|
|
@@ -427,22 +427,22 @@ local function makeGrid(human)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
local element = ElementExcel[LostTempleX[y][1]]
|
|
local element = ElementExcel[LostTempleX[y][1]]
|
|
|
- -- 召唤神坛
|
|
|
|
|
|
|
+ -- 锟劫伙拷锟斤拷坛
|
|
|
if element.cmd == "summonHero" then
|
|
if element.cmd == "summonHero" then
|
|
|
human.lostTemple.grid[x][y].summonHero = makeSummonHeroGrid(human)
|
|
human.lostTemple.grid[x][y].summonHero = makeSummonHeroGrid(human)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
- -- 智慧树
|
|
|
|
|
|
|
+ -- 锟角伙拷锟斤拷
|
|
|
if element.cmd == "summonTree" then
|
|
if element.cmd == "summonTree" then
|
|
|
human.lostTemple.grid[x][y].summonTree = makeSummonTreeGrid(human)
|
|
human.lostTemple.grid[x][y].summonTree = makeSummonTreeGrid(human)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
- -- 神界商店
|
|
|
|
|
|
|
+ -- 锟斤拷锟斤拷痰锟�
|
|
|
if element.cmd == "summonShop" then
|
|
if element.cmd == "summonShop" then
|
|
|
human.lostTemple.grid[x][y].summonShop = makeSummonShopGrid(human)
|
|
human.lostTemple.grid[x][y].summonShop = makeSummonShopGrid(human)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
- -- 只生成 第一层的怪物
|
|
|
|
|
|
|
+ -- 只锟斤拷锟斤拷 锟斤拷一锟斤拷墓锟斤拷锟�
|
|
|
if x == startX then
|
|
if x == startX then
|
|
|
if element.cmd == "nomalMonster" or element.cmd == "eliteMonster" or element.cmd == "eliteBoss" then
|
|
if element.cmd == "nomalMonster" or element.cmd == "eliteMonster" or element.cmd == "eliteBoss" then
|
|
|
human.lostTemple.grid[x][y].monsterOutID = makeMonsterGrid(human, element.cmd)
|
|
human.lostTemple.grid[x][y].monsterOutID = makeMonsterGrid(human, element.cmd)
|
|
@@ -455,26 +455,26 @@ local function makeGrid(human)
|
|
|
return true
|
|
return true
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
--- 制造一个默认的位置数据
|
|
|
|
|
|
|
+-- 锟斤拷锟斤拷一锟斤拷默锟较碉拷位锟斤拷锟斤拷锟斤拷
|
|
|
local function makeLostTempLe(layer)
|
|
local function makeLostTempLe(layer)
|
|
|
- -- 第一层
|
|
|
|
|
|
|
+ -- 锟斤拷一锟斤拷
|
|
|
local LostTempleConfig = LostTempleExcel[layer]
|
|
local LostTempleConfig = LostTempleExcel[layer]
|
|
|
if not LostTempleConfig then
|
|
if not LostTempleConfig then
|
|
|
assert(nil, "lostTemple startLayer error = " .. layer)
|
|
assert(nil, "lostTemple startLayer error = " .. layer)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
- -- 随机一张地图
|
|
|
|
|
|
|
+ -- 锟斤拷锟揭伙拷诺锟酵�
|
|
|
local startRandom = math.random(1, #LostTempleConfig)
|
|
local startRandom = math.random(1, #LostTempleConfig)
|
|
|
local LostTemple = LostTempleConfig[startRandom]
|
|
local LostTemple = LostTempleConfig[startRandom]
|
|
|
if not LostTemple then return end
|
|
if not LostTemple then return end
|
|
|
|
|
|
|
|
- -- 起始位置
|
|
|
|
|
|
|
+ -- 锟斤拷始位锟斤拷
|
|
|
local LostTempleX = LostTemple[START_X]
|
|
local LostTempleX = LostTemple[START_X]
|
|
|
if not LostTempleX then
|
|
if not LostTempleX then
|
|
|
assert(nil, "lostTemple startX error = " .. START_LAYER)
|
|
assert(nil, "lostTemple startX error = " .. START_LAYER)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
- -- 找到纵向可以站立的位置
|
|
|
|
|
|
|
+ -- 锟揭碉拷锟斤拷锟斤拷锟斤拷锟秸撅拷锟斤拷锟轿伙拷锟�
|
|
|
local startY = 1
|
|
local startY = 1
|
|
|
for y = 1, LostTemple.vertical do
|
|
for y = 1, LostTemple.vertical do
|
|
|
if LostTempleX[y] and LostTempleX[y][1] == 0 then
|
|
if LostTempleX[y] and LostTempleX[y][1] == 0 then
|
|
@@ -486,7 +486,7 @@ local function makeLostTempLe(layer)
|
|
|
return layer, START_X, startY, startRandom
|
|
return layer, START_X, startY, startRandom
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
--- 初始化
|
|
|
|
|
|
|
+-- 锟斤拷始锟斤拷
|
|
|
local function initDB(human)
|
|
local function initDB(human)
|
|
|
if human.lostTemple then return end
|
|
if human.lostTemple then return end
|
|
|
|
|
|
|
@@ -503,7 +503,7 @@ end
|
|
|
-- initDB(human)
|
|
-- initDB(human)
|
|
|
-- printGrid(human)
|
|
-- printGrid(human)
|
|
|
-- print("-----------------------------")
|
|
-- print("-----------------------------")
|
|
|
--- 下一格
|
|
|
|
|
|
|
+-- 锟斤拷一锟斤拷
|
|
|
function nextGrid(human, y)
|
|
function nextGrid(human, y)
|
|
|
if not human.lostTemple then return end
|
|
if not human.lostTemple then return end
|
|
|
|
|
|
|
@@ -530,7 +530,7 @@ function nextGrid(human, y)
|
|
|
makeGrid(human)
|
|
makeGrid(human)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
--- 下一层
|
|
|
|
|
|
|
+-- 锟斤拷一锟斤拷
|
|
|
local function nextDB(human)
|
|
local function nextDB(human)
|
|
|
if not human.lostTemple then return end
|
|
if not human.lostTemple then return end
|
|
|
|
|
|
|
@@ -606,11 +606,11 @@ local function makeGridNet(human, net)
|
|
|
return true
|
|
return true
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
--- 查询
|
|
|
|
|
|
|
+-- 锟斤拷询
|
|
|
function query(human)
|
|
function query(human)
|
|
|
if not isOpen(human) then return end
|
|
if not isOpen(human) then return end
|
|
|
|
|
|
|
|
- -- 没有共鸣
|
|
|
|
|
|
|
+ -- 没锟叫癸拷锟斤拷
|
|
|
local db = human.db.xingYaoGongMing
|
|
local db = human.db.xingYaoGongMing
|
|
|
if not db or not db.defList then return end
|
|
if not db or not db.defList then return end
|
|
|
|
|
|
|
@@ -626,7 +626,7 @@ function query(human)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
--- 更新
|
|
|
|
|
|
|
+-- 锟斤拷锟斤拷
|
|
|
function update(human)
|
|
function update(human)
|
|
|
if not human.lostTemple then return end
|
|
if not human.lostTemple then return end
|
|
|
|
|
|
|
@@ -639,27 +639,27 @@ function update(human)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
--- 检测点击格子是否合法
|
|
|
|
|
|
|
+-- 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷欠锟较凤拷
|
|
|
function checkPutByY(human, y)
|
|
function checkPutByY(human, y)
|
|
|
local startX = human.lostTemple.x + 1
|
|
local startX = human.lostTemple.x + 1
|
|
|
if not human.lostTemple.grid or not human.lostTemple.grid[startX] or not human.lostTemple.grid[startX][y] then return end
|
|
if not human.lostTemple.grid or not human.lostTemple.grid[startX] or not human.lostTemple.grid[startX][y] then return end
|
|
|
local grid = human.lostTemple.grid[startX][y]
|
|
local grid = human.lostTemple.grid[startX][y]
|
|
|
|
|
|
|
|
- -- 检测点击位置是否合法
|
|
|
|
|
|
|
+ -- 锟斤拷锟斤拷锟轿伙拷锟斤拷欠锟较凤拷
|
|
|
return grid
|
|
return grid
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
--- 检测点击格子是否合法
|
|
|
|
|
|
|
+-- 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷欠锟较凤拷
|
|
|
function checkPut(human, x, y)
|
|
function checkPut(human, x, y)
|
|
|
local startX = x
|
|
local startX = x
|
|
|
if not human.lostTemple.grid or not human.lostTemple.grid[startX] or not human.lostTemple.grid[startX][y] then return end
|
|
if not human.lostTemple.grid or not human.lostTemple.grid[startX] or not human.lostTemple.grid[startX][y] then return end
|
|
|
local grid = human.lostTemple.grid[startX][y]
|
|
local grid = human.lostTemple.grid[startX][y]
|
|
|
|
|
|
|
|
- -- 检测点击位置是否合法
|
|
|
|
|
|
|
+ -- 锟斤拷锟斤拷锟轿伙拷锟斤拷欠锟较凤拷
|
|
|
return grid
|
|
return grid
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
--- 设置格子
|
|
|
|
|
|
|
+-- 锟斤拷锟矫革拷锟斤拷
|
|
|
function putSet(human, y, cmd)
|
|
function putSet(human, y, cmd)
|
|
|
local startX = human.lostTemple.x + 1
|
|
local startX = human.lostTemple.x + 1
|
|
|
if not human.lostTemple.grid or not human.lostTemple.grid[startX] or not human.lostTemple.grid[startX][y] then return end
|
|
if not human.lostTemple.grid or not human.lostTemple.grid[startX] or not human.lostTemple.grid[startX][y] then return end
|
|
@@ -675,7 +675,7 @@ function putSet(human, y, cmd)
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
--- 走到下一步
|
|
|
|
|
|
|
+-- 锟竭碉拷锟斤拷一锟斤拷
|
|
|
function put(human, op, x, y, arg)
|
|
function put(human, op, x, y, arg)
|
|
|
if not isOpen(human) then return end
|
|
if not isOpen(human) then return end
|
|
|
if not human.lostTemple then return end
|
|
if not human.lostTemple then return end
|
|
@@ -699,7 +699,7 @@ function put(human, op, x, y, arg)
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
--- 怪物面板
|
|
|
|
|
|
|
+-- 锟斤拷锟斤拷锟斤拷锟�
|
|
|
local function monsterQuery(human, grid, elementConfig)
|
|
local function monsterQuery(human, grid, elementConfig)
|
|
|
if not human.lostTemple then return end
|
|
if not human.lostTemple then return end
|
|
|
if not grid.monsterOutID then return end
|
|
if not grid.monsterOutID then return end
|
|
@@ -752,7 +752,7 @@ local function monsterQuery(human, grid, elementConfig)
|
|
|
Msg.send(msgRet, human.fd)
|
|
Msg.send(msgRet, human.fd)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
--- 英雄列表
|
|
|
|
|
|
|
+-- 英锟斤拷锟叫憋拷
|
|
|
function sendHeroStatus(human)
|
|
function sendHeroStatus(human)
|
|
|
if not human.lostTemple then return end
|
|
if not human.lostTemple then return end
|
|
|
|
|
|
|
@@ -786,7 +786,7 @@ function sendHeroStatus(human)
|
|
|
Msg.send(msgRet, human.fd)
|
|
Msg.send(msgRet, human.fd)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
--- 推送召唤祭坛英雄列表
|
|
|
|
|
|
|
+-- 锟斤拷锟斤拷锟劫伙拷锟斤拷坛英锟斤拷锟叫憋拷
|
|
|
function sendSummonHeroList(human)
|
|
function sendSummonHeroList(human)
|
|
|
if not human.lostTemple then return end
|
|
if not human.lostTemple then return end
|
|
|
if not human.lostTemple.summonHero then return end
|
|
if not human.lostTemple.summonHero then return end
|
|
@@ -800,7 +800,7 @@ function sendSummonHeroList(human)
|
|
|
Msg.send(msgRet, human.fd)
|
|
Msg.send(msgRet, human.fd)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
--- 推送buff属性
|
|
|
|
|
|
|
+-- 锟斤拷锟斤拷buff锟斤拷锟斤拷
|
|
|
function sendSummonTreeList(human)
|
|
function sendSummonTreeList(human)
|
|
|
if not human.lostTemple then return end
|
|
if not human.lostTemple then return end
|
|
|
if not human.lostTemple.summonTree then return end
|
|
if not human.lostTemple.summonTree then return end
|
|
@@ -823,7 +823,7 @@ function sendSummonTreeList(human)
|
|
|
Msg.send(msgRet, human.fd)
|
|
Msg.send(msgRet, human.fd)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
--- 随机奖励宝箱
|
|
|
|
|
|
|
+-- 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟�
|
|
|
function sendRandomBox(human)
|
|
function sendRandomBox(human)
|
|
|
if not human.lostTemple then return end
|
|
if not human.lostTemple then return end
|
|
|
|
|
|
|
@@ -865,7 +865,7 @@ end
|
|
|
|
|
|
|
|
--
|
|
--
|
|
|
function Lost_Handle_Func.summonHero(human, op, y, grid, arg, elementConfig)
|
|
function Lost_Handle_Func.summonHero(human, op, y, grid, arg, elementConfig)
|
|
|
- -- 召唤神坛查询
|
|
|
|
|
|
|
+ -- 锟劫伙拷锟斤拷坛锟斤拷询
|
|
|
if op == OP_QUERY then
|
|
if op == OP_QUERY then
|
|
|
if not grid.summonHero then return end
|
|
if not grid.summonHero then return end
|
|
|
local msgRet = Msg.gc.GC_LOST_TEMPLE_SUMMON
|
|
local msgRet = Msg.gc.GC_LOST_TEMPLE_SUMMON
|
|
@@ -880,7 +880,7 @@ function Lost_Handle_Func.summonHero(human, op, y, grid, arg, elementConfig)
|
|
|
return
|
|
return
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
- -- 添加召唤英雄
|
|
|
|
|
|
|
+ -- 锟斤拷锟斤拷倩锟接�拷锟�
|
|
|
if op == OP_CONFIRM then
|
|
if op == OP_CONFIRM then
|
|
|
local index = tonumber(arg)
|
|
local index = tonumber(arg)
|
|
|
if not grid.summonHero then return end
|
|
if not grid.summonHero then return end
|
|
@@ -891,7 +891,7 @@ function Lost_Handle_Func.summonHero(human, op, y, grid, arg, elementConfig)
|
|
|
local heroGrid = HeroGrid.createHeroGrid(hero.id, hero.star)
|
|
local heroGrid = HeroGrid.createHeroGrid(hero.id, hero.star)
|
|
|
if not heroGrid then return end
|
|
if not heroGrid then return end
|
|
|
heroGrid.isLostTemple = 1
|
|
heroGrid.isLostTemple = 1
|
|
|
- -- 初始化属性
|
|
|
|
|
|
|
+ -- 锟斤拷始锟斤拷锟斤拷锟斤拷
|
|
|
local attrConfig = HeroDefine.getAttrConfig(hero.id, heroGrid.star)
|
|
local attrConfig = HeroDefine.getAttrConfig(hero.id, heroGrid.star)
|
|
|
if not attrConfig then return end
|
|
if not attrConfig then return end
|
|
|
local quality = HeroGrid.getMaxQualityByLv(heroGrid.star, hero.lv)
|
|
local quality = HeroGrid.getMaxQualityByLv(heroGrid.star, hero.lv)
|
|
@@ -900,9 +900,9 @@ function Lost_Handle_Func.summonHero(human, op, y, grid, arg, elementConfig)
|
|
|
heroGrid.lv = math.min(maxLv, hero.lv or 0)
|
|
heroGrid.lv = math.min(maxLv, hero.lv or 0)
|
|
|
heroGrid.quality = math.max(heroGrid.quality, quality or 0)
|
|
heroGrid.quality = math.max(heroGrid.quality, quality or 0)
|
|
|
|
|
|
|
|
- -- 加入装备
|
|
|
|
|
|
|
+ -- 锟斤拷锟斤拷装锟斤拷
|
|
|
|
|
|
|
|
- -- 加入到英雄队列
|
|
|
|
|
|
|
+ -- 锟斤拷锟诫到英锟桔讹拷锟斤拷
|
|
|
human.lostTemple.summonHero = human.lostTemple.summonHero or { }
|
|
human.lostTemple.summonHero = human.lostTemple.summonHero or { }
|
|
|
human.lostTemple.summonHero[0] = human.lostTemple.summonHero[0] or 0
|
|
human.lostTemple.summonHero[0] = human.lostTemple.summonHero[0] or 0
|
|
|
human.lostTemple.summonHero[0] = human.lostTemple.summonHero[0] + 1
|
|
human.lostTemple.summonHero[0] = human.lostTemple.summonHero[0] + 1
|
|
@@ -910,18 +910,18 @@ function Lost_Handle_Func.summonHero(human, op, y, grid, arg, elementConfig)
|
|
|
human.lostTemple.summonHero[addIndex] = heroGrid
|
|
human.lostTemple.summonHero[addIndex] = heroGrid
|
|
|
heroGrid.bagIndex = addIndex
|
|
heroGrid.bagIndex = addIndex
|
|
|
|
|
|
|
|
- -- 计算属性
|
|
|
|
|
|
|
+ -- 锟斤拷锟斤拷锟斤拷锟斤拷
|
|
|
LostTempleCombatLogic.getHeroAttrs(human, addIndex)
|
|
LostTempleCombatLogic.getHeroAttrs(human, addIndex)
|
|
|
|
|
|
|
|
- -- 通知客户端
|
|
|
|
|
|
|
+ -- 通知锟酵伙拷锟斤拷
|
|
|
sendSummonHeroList(human)
|
|
sendSummonHeroList(human)
|
|
|
return true
|
|
return true
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
--- 智慧树
|
|
|
|
|
|
|
+-- 锟角伙拷锟斤拷
|
|
|
function Lost_Handle_Func.summonTree(human, op, y, grid, arg, elementConfig)
|
|
function Lost_Handle_Func.summonTree(human, op, y, grid, arg, elementConfig)
|
|
|
- -- 召唤神坛查询
|
|
|
|
|
|
|
+ -- 锟劫伙拷锟斤拷坛锟斤拷询
|
|
|
if op == OP_QUERY then
|
|
if op == OP_QUERY then
|
|
|
if not grid.summonTree then return end
|
|
if not grid.summonTree then return end
|
|
|
local msgRet = Msg.gc.GC_LOST_TEMPLE_BUFF
|
|
local msgRet = Msg.gc.GC_LOST_TEMPLE_BUFF
|
|
@@ -945,7 +945,7 @@ function Lost_Handle_Func.summonTree(human, op, y, grid, arg, elementConfig)
|
|
|
return
|
|
return
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
- -- 添加召唤英雄
|
|
|
|
|
|
|
+ -- 锟斤拷锟斤拷倩锟接�拷锟�
|
|
|
if op == OP_CONFIRM then
|
|
if op == OP_CONFIRM then
|
|
|
local index = tonumber(arg)
|
|
local index = tonumber(arg)
|
|
|
if not grid.summonTree then return end
|
|
if not grid.summonTree then return end
|
|
@@ -969,7 +969,7 @@ function Lost_Handle_Func.summonTree(human, op, y, grid, arg, elementConfig)
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
--- 炽天使
|
|
|
|
|
|
|
+-- 锟斤拷锟斤拷使
|
|
|
function Lost_Handle_Func.treatRevive(human, op, y, grid, arg, elementConfig)
|
|
function Lost_Handle_Func.treatRevive(human, op, y, grid, arg, elementConfig)
|
|
|
|
|
|
|
|
if op == OP_QUERY then
|
|
if op == OP_QUERY then
|
|
@@ -977,13 +977,13 @@ function Lost_Handle_Func.treatRevive(human, op, y, grid, arg, elementConfig)
|
|
|
return
|
|
return
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
- -- 复活治疗
|
|
|
|
|
|
|
+ -- 锟斤拷锟斤拷锟斤拷锟斤拷
|
|
|
if op == OP_CONFIRM then
|
|
if op == OP_CONFIRM then
|
|
|
local opType = tonumber(arg)
|
|
local opType = tonumber(arg)
|
|
|
local heroStatus = human.lostTemple.heroStatus
|
|
local heroStatus = human.lostTemple.heroStatus
|
|
|
if not heroStatus then return true end
|
|
if not heroStatus then return true end
|
|
|
|
|
|
|
|
- -- 复活
|
|
|
|
|
|
|
+ -- 锟斤拷锟斤拷
|
|
|
if opType == 1 then
|
|
if opType == 1 then
|
|
|
local len = 0
|
|
local len = 0
|
|
|
local cnt = 0
|
|
local cnt = 0
|
|
@@ -1009,7 +1009,7 @@ function Lost_Handle_Func.treatRevive(human, op, y, grid, arg, elementConfig)
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
- -- 治疗
|
|
|
|
|
|
|
+ -- 锟斤拷锟斤拷
|
|
|
if opType == 2 then
|
|
if opType == 2 then
|
|
|
for k, hpRate in pairs(heroStatus) do
|
|
for k, hpRate in pairs(heroStatus) do
|
|
|
if heroStatus[k] > 0.0 then
|
|
if heroStatus[k] > 0.0 then
|
|
@@ -1027,7 +1027,7 @@ function Lost_Handle_Func.treatRevive(human, op, y, grid, arg, elementConfig)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
--- 神界商店
|
|
|
|
|
|
|
+-- 锟斤拷锟斤拷痰锟�
|
|
|
function Lost_Handle_Func.summonShop(human, op, y, grid, arg, elementConfig)
|
|
function Lost_Handle_Func.summonShop(human, op, y, grid, arg, elementConfig)
|
|
|
|
|
|
|
|
if op == OP_QUERY then
|
|
if op == OP_QUERY then
|
|
@@ -1047,7 +1047,7 @@ function Lost_Handle_Func.summonShop(human, op, y, grid, arg, elementConfig)
|
|
|
return
|
|
return
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
- -- 购买东西
|
|
|
|
|
|
|
+ -- 锟斤拷锟斤拷锟斤拷
|
|
|
if op == OP_CONFIRM then
|
|
if op == OP_CONFIRM then
|
|
|
local index = tonumber(arg)
|
|
local index = tonumber(arg)
|
|
|
if not grid.summonShop then return end
|
|
if not grid.summonShop then return end
|
|
@@ -1069,7 +1069,7 @@ end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--- 宝箱
|
|
|
|
|
|
|
+-- 锟斤拷锟斤拷
|
|
|
function Lost_Handle_Func.summonBox(human, op, y, grid, arg, elementConfig)
|
|
function Lost_Handle_Func.summonBox(human, op, y, grid, arg, elementConfig)
|
|
|
|
|
|
|
|
if op == OP_QUERY then
|
|
if op == OP_QUERY then
|
|
@@ -1091,11 +1091,11 @@ function Lost_Handle_Func.summonBox(human, op, y, grid, arg, elementConfig)
|
|
|
human.lostTemple.randomReward = nil
|
|
human.lostTemple.randomReward = nil
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
- -- 判定有没有下一程
|
|
|
|
|
|
|
+ -- 锟叫讹拷锟斤拷没锟斤拷锟斤拷一锟斤拷
|
|
|
local nextLayer = human.lostTemple.layer + 1
|
|
local nextLayer = human.lostTemple.layer + 1
|
|
|
local LostTempleConfig = LostTempleExcel[nextLayer]
|
|
local LostTempleConfig = LostTempleExcel[nextLayer]
|
|
|
if LostTempleConfig then
|
|
if LostTempleConfig then
|
|
|
- -- 变成传送门
|
|
|
|
|
|
|
+ -- 锟斤拷纱锟斤拷锟斤拷锟�
|
|
|
putSet(human, y, elementConfig.cmd)
|
|
putSet(human, y, elementConfig.cmd)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
@@ -1105,7 +1105,7 @@ function Lost_Handle_Func.summonBox(human, op, y, grid, arg, elementConfig)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
--- 传送门
|
|
|
|
|
|
|
+-- 锟斤拷锟斤拷锟斤拷
|
|
|
function Lost_Handle_Func.conveyDoor(human, op, y, grid, arg, elementConfig)
|
|
function Lost_Handle_Func.conveyDoor(human, op, y, grid, arg, elementConfig)
|
|
|
|
|
|
|
|
if op == OP_QUERY then
|
|
if op == OP_QUERY then
|
|
@@ -1113,7 +1113,7 @@ function Lost_Handle_Func.conveyDoor(human, op, y, grid, arg, elementConfig)
|
|
|
return
|
|
return
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
- -- 进入下一层
|
|
|
|
|
|
|
+ -- 锟斤拷锟斤拷锟斤拷一锟斤拷
|
|
|
if op == OP_CONFIRM then
|
|
if op == OP_CONFIRM then
|
|
|
|
|
|
|
|
nextDB(human)
|
|
nextDB(human)
|