试炼副本改到了一半

(cherry picked from commit 4e442c7614a669cee38e731edf627b2582b2547b)
dev_chengFeng
ZhangBiao 2020-08-12 22:39:43 +08:00
parent e2589d5301
commit 4ef8870c4d
9 changed files with 136 additions and 131 deletions

View File

@ -125,15 +125,15 @@ function this.InitData(msg)
-- end
local time = msg.leftTime
if time < 0 then
this.isOpen = false
else
-- local time = msg.leftTime
-- if time < 0 then
-- this.isOpen = false
-- else
this.isOpen = true
-- 已经计时的时间
local durationTime = this.totalTime - msg.leftTime
PlayerManager.startTime = PlayerManager.serverTime - durationTime
end
-- local durationTime = this.totalTime - msg.leftTime
-- PlayerManager.startTime = PlayerManager.serverTime - durationTime
-- end
-- 调用MissionManager初始化副本任务
MissionManager.InitMissionInfo(msg)
--=============================================
@ -152,19 +152,19 @@ function this.InitData(msg)
this.formationList = {}
--Log("服务器英雄数量 msg.heroInfos " .. #msg.heroInfos)
for i=1, #msg.heroInfos do
local heroDid = msg.heroInfos[i].heroId
local curHeroData = HeroManager.GetSingleHeroData(heroDid)
local lv = ConfigManager.GetConfigData(ConfigName.HeroLevelConfig, curHeroData.lv).CharacterLevelPara
local allEquipAddProVal= HeroManager.CalculateWarAllProVal(heroDid)
allEquipAddProVal[2] = msg.heroInfos[i].heroHp
allEquipAddProVal[3] = msg.heroInfos[i].heroMaxHp
this.totalEnergy=this.totalEnergy+curHeroData.actionPower
this.formationList[i] = {
heroId = heroDid,
allProVal = allEquipAddProVal,
}
end
-- for i=1, #msg.heroInfos do
-- local heroDid = msg.heroInfos[i].heroId
-- local curHeroData = HeroManager.GetSingleHeroData(heroDid)
-- local lv = ConfigManager.GetConfigData(ConfigName.HeroLevelConfig, curHeroData.lv).CharacterLevelPara
-- local allEquipAddProVal= HeroManager.CalculateWarAllProVal(heroDid)
-- allEquipAddProVal[2] = msg.heroInfos[i].heroHp
-- allEquipAddProVal[3] = msg.heroInfos[i].heroMaxHp
-- this.totalEnergy=this.totalEnergy+curHeroData.actionPower
-- this.formationList[i] = {
-- heroId = heroDid,
-- allProVal = allEquipAddProVal,
-- }
-- end
-- 如果是重登,则进图时请求一次血量数据
@ -174,7 +174,7 @@ function this.InitData(msg)
end)
end
this.UpdateMaoShotTimeBagData(msg.temporaryItems)
-- this.UpdateMaoShotTimeBagData(msg.temporaryItems)
-- 获得所有的buff效果
--Log("******人物身上的buff数量 " .. #msg.foodBuffers)
@ -334,34 +334,34 @@ function this.InitAllMapProgressData(_curMapData)
end
end
function this.UpdateMaoShotTimeBagData(_temporaryItems)
if _temporaryItems.itemlist~=nil and #_temporaryItems.itemlist>0 then
for i = 1, #_temporaryItems.itemlist do
BagManager.InitMapShotTimeBagData(_temporaryItems.itemlist[i])
end
end
if _temporaryItems.equipId~=nil and #_temporaryItems.equipId>0 then
for i = 1, #_temporaryItems.equipId do
EquipManager.InitMapShotTimeEquipBagData(_temporaryItems.equipId[i])
end
end
if _temporaryItems.Hero~=nil and #_temporaryItems.Hero>0 then
for i = 1, #_temporaryItems.Hero do
HeroManager.InitMapShotTimeHeroBagData(_temporaryItems.Hero[i])
end
end
if _temporaryItems.soulEquip~=nil and #_temporaryItems.soulEquip>0 then
for i = 1, #_temporaryItems.soulEquip do
SoulPrintManager.InitMapShotTimeSoulPrintBagData(_temporaryItems.soulEquip[i])
end
end
-- function this.UpdateMaoShotTimeBagData(_temporaryItems)
-- if _temporaryItems.itemlist~=nil and #_temporaryItems.itemlist>0 then
-- for i = 1, #_temporaryItems.itemlist do
-- BagManager.InitMapShotTimeBagData(_temporaryItems.itemlist[i])
-- end
-- end
-- if _temporaryItems.equipId~=nil and #_temporaryItems.equipId>0 then
-- for i = 1, #_temporaryItems.equipId do
-- EquipManager.InitMapShotTimeEquipBagData(_temporaryItems.equipId[i])
-- end
-- end
-- if _temporaryItems.Hero~=nil and #_temporaryItems.Hero>0 then
-- for i = 1, #_temporaryItems.Hero do
-- HeroManager.InitMapShotTimeHeroBagData(_temporaryItems.Hero[i])
-- end
-- end
-- if _temporaryItems.soulEquip~=nil and #_temporaryItems.soulEquip>0 then
-- for i = 1, #_temporaryItems.soulEquip do
-- SoulPrintManager.InitMapShotTimeSoulPrintBagData(_temporaryItems.soulEquip[i])
-- end
-- end
-- if _temporaryItems.especialEquipId~=nil and #_temporaryItems.especialEquipId>0 then
-- for i = 1, #_temporaryItems.especialEquipId do
-- TalismanManager.InitMapShotTimeTalismanBagData(_temporaryItems.especialEquipId[i])
-- end
-- end
end
-- end
--前端更新地图进度 _type 2/3 怪物组id#次数/本次地图获得战斗胜利次数 4/8 行脚商人id#物品id /行脚商人id#物品类型 5 本地图采矿都少次 6 消耗行动力数量 7 宝箱
function this.UpdateMapProgressDatas(_type,_eventId,_monsterId,_num,_isSend)--没有数据可传0
--Log("UpdateMapProgressDatas _type,_eventId数据1 ".._type.." ".._eventId)

View File

@ -380,23 +380,22 @@ function this.InitTrial()
MapTrialManager.canMove = true
MapManager.isRemoving = false
MapManager.deadTime = 0
if not MapManager.isOpen then
this.TrialMissionStart()
end
end
-- 试炼副本进图流程
function this.TrialMissionStart()
NetManager.CarbonMissionStartRequest(function(msg)
Log(Language[11258])
local showStr = Language[11259] .. MapTrialManager.curTowerLevel ..Language[10319]
UIManager.OpenPanel(UIName.CurlingTipPanel, showStr)
MapPanel.SetRoleShow(MapManager.mapScale, MapManager.roleInitPos)
PlayerManager.startTime = PlayerManager.serverTime
MissionManager.missionTime = 0
MapManager.isOpen = true
end)
-- if not MapManager.isOpen then
-- this.TrialMissionStart()
-- end
end
-- -- 试炼副本进图流程
-- function this.TrialMissionStart()
-- NetManager.CarbonMissionStartRequest(function(msg)
-- Log(Language[11258])
-- local showStr = Language[11259] .. MapTrialManager.curTowerLevel ..Language[10319]
-- UIManager.OpenPanel(UIName.CurlingTipPanel, showStr)
-- MapPanel.SetRoleShow(MapManager.mapScale, MapManager.roleInitPos)
-- PlayerManager.startTime = PlayerManager.serverTime
-- MissionManager.missionTime = 0
-- MapManager.isOpen = true
-- end)
-- end
-- 试炼副本显示时间
function this.TrialShowTime()

View File

@ -127,7 +127,8 @@ function this.OnOpen()
-- 初始化各种标志的状态
this.InitBoolState()
-- 开始探索请求
this.StartExplore()
-- this.StartExplore()
MapPanel.SetRoleShow(MapManager.mapScale, MapManager.roleInitPos)
-- 设置任务显示
this.SetTipShow()
-- 初始化行动力消耗的类型数值
@ -169,18 +170,18 @@ function this.OnShow()
end
-- ================ 进入地图的正常流程 ===============
function this.StartExplore()
if not this.IsEndLessMap() then return end
if MapManager.isOpen == false then
NetManager.CarbonMissionStartRequest(function(msg)
Log(Language[11258])
MapPanel.SetRoleShow(MapManager.mapScale, MapManager.roleInitPos)
PlayerManager.startTime = PlayerManager.serverTime
MissionManager.missionTime = 0
MapManager.isOpen = true
end)
end
end
-- function this.StartExplore()
-- if not this.IsEndLessMap() then return end
-- if MapManager.isOpen == false then
-- NetManager.CarbonMissionStartRequest(function(msg)
-- Log(Language[11258])
-- MapPanel.SetRoleShow(MapManager.mapScale, MapManager.roleInitPos)
-- PlayerManager.startTime = PlayerManager.serverTime
-- MissionManager.missionTime = 0
-- MapManager.isOpen = true
-- end)
-- end
-- end
function this.InitCompShow(carbonType)
if carbonType ~= CARBON_TYPE.ENDLESS then

View File

@ -240,18 +240,18 @@ function this.SetCarbonShowType(mission)
this.DragCtrl:SetActive(true)
if MapManager.curMapId == 100 then
-- 直接开始
NetManager.CarbonMissionStartRequest(function(msg)
local mission = MissionManager.carBonMission
UIManager.OpenPanel(UIName.CurlingTipPanel, Language[11312])
Log(Language[11313] .. msg.leftTime)
if msg.leftTime > 0 then --开启任务
-- 刷新任务
Game.GlobalEvent:DispatchEvent(GameEvent.Mission.OnMissionAdd, mission)
started = true
else
MapManager.isOpen = false
end
end)
-- NetManager.CarbonMissionStartRequest(function(msg)
-- local mission = MissionManager.carBonMission
-- UIManager.OpenPanel(UIName.CurlingTipPanel, Language[11312])
-- Log(Language[11313] .. msg.leftTime)
-- if msg.leftTime > 0 then --开启任务
-- -- 刷新任务
-- Game.GlobalEvent:DispatchEvent(GameEvent.Mission.OnMissionAdd, mission)
-- started = true
-- else
-- MapManager.isOpen = false
-- end
-- end)
else
UIManager.OpenPanel(UIName.CarbonMissionPopup, this)
end

View File

@ -90,6 +90,7 @@ function MapPointView.New(u, v, pointId)
setmetatable(instance, MapPointView)
local cell = MapPointConfig[pointId]
if not cell then
LogRed("not cell return")
return
end
instance.cell = cell
@ -97,6 +98,7 @@ function MapPointView.New(u, v, pointId)
instance.v = v
if cell.Style == 8 then --阻挡点不处理
TileMapView.GetTileData(u, v).val = 2
LogRed("cell.Style == 8 return")
return
elseif cell.Style == 2 then --矿
elseif cell.Style == 7 then --宝箱

View File

@ -39,6 +39,7 @@ function this.GeneratePoint()
for k, v in pairs(MapManager.mapPointList) do
local x, y = Map_Pos2UV(k)
LogYellow("X:"..x.." Y"..y)
this.GenEventPoint(x, y, v)
end
@ -92,6 +93,7 @@ end
function this.GenEventPoint(u, v, pointId)
local pointView = MapPointView.New(u, v, pointId)
if pointView then
LogGreen("生成了事件点")
pointView.go.transform:SetParent(Util.GetTransform(this.Ctrl, "uiObj#"))
pointView.go:GetComponent("RectTransform").anchoredPosition3D = TileMapView.GetLiveTilePos(u, v) * 100
pointView.go.transform.localScale = Vector3.one

View File

@ -337,8 +337,8 @@ end
function this.MapInfoRequest(mapId, teamId, func)
Log(Language[11427] .. mapId)
local data = MapInfoProto_pb.MapEnterRequest()
data.mapId = mapId
data.teamId = teamId
data.mapId = 1
-- data.teamId = teamId
local msg = data:SerializeToString()
Network:SendMessageWithCallBack(MessageTypeProto_pb.MAP_ENTER_REQUEST, MessageTypeProto_pb.MAP_ENTER_RESPONSE, msg, function(buffer)
local data = buffer:DataByte()
@ -399,18 +399,18 @@ function this.MapOutRequest(outType, func, nextMapId)
end)
end
-- 请求开始探索副本地图
function this.CarbonMissionStartRequest(func)
Network:SendMessageWithCallBack(MessageTypeProto_pb.MAP_START_EXPLORE_REQUEST, MessageTypeProto_pb.MAP_START_EXPLORE_RESPONSE, nil, function(buffer)
local data = buffer:DataByte()
local msg = MapInfoProto_pb.MapStartExploreResponse()
msg:ParseFromString(data)
if func then
func(msg)
end
-- -- 请求开始探索副本地图
-- function this.CarbonMissionStartRequest(func)
-- Network:SendMessageWithCallBack(MessageTypeProto_pb.MAP_START_EXPLORE_REQUEST, MessageTypeProto_pb.MAP_START_EXPLORE_RESPONSE, nil, function(buffer)
-- local data = buffer:DataByte()
-- local msg = MapInfoProto_pb.MapStartExploreResponse()
-- msg:ParseFromString(data)
-- if func then
-- func(msg)
-- end
end)
end
-- end)
-- end
--请求更新事件
function this.EventUpdateRequest(eventId, optionId, func)

View File

@ -49,20 +49,20 @@ end
--绑定事件(用于子类重写)
function CarbonMissionPopup:BindEvent()
Util.AddClick(this.btnConfirm, function ()
-- 点击后依次播放动画
this.BtnCallBack(isStartExplore)
end)
-- Util.AddClick(this.btnConfirm, function ()
-- -- 点击后依次播放动画
-- this.BtnCallBack(isStartExplore)
-- end)
end
function this.BtnCallBack(start)
if start then
this.StartMission(1.8)
else
this.SetStartAni(1)
end
this.letterAni:SetBool("isEnd", not start)
end
-- function this.BtnCallBack(start)
-- if start then
-- this.StartMission(1.8)
-- else
-- this.SetStartAni(1)
-- end
-- this.letterAni:SetBool("isEnd", not start)
-- end
-- 播放开始探索
function this.SetStartAni(timeScale)
@ -77,30 +77,30 @@ function this.SetStartAni(timeScale)
end
-- 开始任务
function this.StartMission(timeScale)
this.exploreAni:SetTrigger("close")
Timer.New(function()
this:ClosePanel()
this.StartExplore()
end, timeScale):Start()
end
-- function this.StartMission(timeScale)
-- this.exploreAni:SetTrigger("close")
-- Timer.New(function()
-- this:ClosePanel()
-- this.StartExplore()
-- end, timeScale):Start()
-- end
-- 开始地图探索
function this.StartExplore()
if not started then
started = true
NetManager.CarbonMissionStartRequest(function(msg)
local mission = MissionManager.carBonMission
Log(Language[11313] .. msg.leftTime)
if msg.leftTime > 0 then --开启任务
-- 刷新任务
Game.GlobalEvent:DispatchEvent(GameEvent.Mission.OnMissionAdd, mission)
else
MapManager.isOpen = false
end
end)
end
end
-- function this.StartExplore()
-- if not started then
-- started = true
-- NetManager.CarbonMissionStartRequest(function(msg)
-- local mission = MissionManager.carBonMission
-- Log(Language[11313] .. msg.leftTime)
-- if msg.leftTime > 0 then --开启任务
-- -- 刷新任务
-- Game.GlobalEvent:DispatchEvent(GameEvent.Mission.OnMissionAdd, mission)
-- else
-- MapManager.isOpen = false
-- end
-- end)
-- end
-- end
--添加事件监听(用于子类重写)
function CarbonMissionPopup:AddListener()

View File

@ -43,6 +43,7 @@ end
--- 重新获取商店数据
function this.RequestAllShopData(func)
LogRed("商店")
NetManager.RequestMainShopData(func)
end