Merge branch 'china/dev' of http://60.1.1.230/gaoxin/JL_Client into china/dev
commit
4c5e87e06f
|
@ -12,7 +12,13 @@ RECHARGEABLE = true --false不可充值 true可充值
|
|||
GuideType = {
|
||||
Force = 1,--强制
|
||||
Function = 2, --功能
|
||||
Check = 3 --检测
|
||||
Check = 3, --检测
|
||||
Battle = 4 --战斗
|
||||
}
|
||||
|
||||
BattleGuideType = {
|
||||
FakeBattle = 1,
|
||||
QuickFight = 1021,
|
||||
}
|
||||
|
||||
SDKSubMitType = {
|
||||
|
|
|
@ -23,6 +23,8 @@ GameEvent = {
|
|||
GuideBattleTeamCDDone = "Guide.GuideBattleTeamCDDone",
|
||||
GuideBattleStageChange = "Guide.GuideBattleStageChange",
|
||||
GuidePanelScrollViewPos = "Guide.GuidePanelScrollViewPos",
|
||||
|
||||
BattleGuideDone = "Guide.BattleGuideDone",
|
||||
},
|
||||
Player = {
|
||||
--金币数量改变
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
require("Base/Stack")
|
||||
require("Modules.Battle.Config.PokemonEffectConfig")
|
||||
local BattleView = require("Modules/Battle/View/BattleView")
|
||||
local GuideBattleLogic = require("Modules/Battle/View/GuideBattleLogic")
|
||||
BattlePanel = Inherit(BasePanel)
|
||||
|
||||
local this = BattlePanel
|
||||
|
@ -208,7 +209,8 @@ function this:OnSortingOrderChange()
|
|||
end
|
||||
|
||||
--界面打开时调用(用于子类重写)
|
||||
function this:OnOpen(_fightData, _fightType, _endFunc)
|
||||
function this:OnOpen(_fightData, _fightType, _endFunc, _guideType)
|
||||
GuideBattleLogic:Init(_guideType)
|
||||
BattleView:OnOpen(_fightData,_fightType)
|
||||
|
||||
endFunc = _endFunc
|
||||
|
@ -232,10 +234,10 @@ function this:OnOpen(_fightData, _fightType, _endFunc)
|
|||
BattleView:SetNameStr(nil)
|
||||
this.DefResult:SetActive(false)
|
||||
this.AtkResult:SetActive(false)
|
||||
local lvOpenTimeScaleConFig = ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.PrivilegeTypeConfig,"PrivilegeType",PRIVILEGE_TYPE.DoubleTimesFight,"UnlockType",1)
|
||||
if lvOpenTimeScaleConFig and PlayerManager.level == lvOpenTimeScaleConFig.Condition[1][1] and BattleManager.GetTimeScale() == BATTLE_TIME_SCALE_ONE then
|
||||
BattleManager.SetTimeScale(BATTLE_TIME_SCALE_TWO)
|
||||
end
|
||||
-- local lvOpenTimeScaleConFig = ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.PrivilegeTypeConfig,"PrivilegeType",PRIVILEGE_TYPE.DoubleTimesFight,"UnlockType",1)
|
||||
-- if lvOpenTimeScaleConFig and PlayerManager.level == lvOpenTimeScaleConFig.Condition[1][1] and BattleManager.GetTimeScale() == BATTLE_TIME_SCALE_ONE then
|
||||
-- BattleManager.SetTimeScale(BATTLE_TIME_SCALE_TWO)
|
||||
-- end
|
||||
-- 开始战斗
|
||||
BattleView:StartBattle()
|
||||
|
||||
|
@ -596,8 +598,10 @@ function this.OnOrderChanged(order)
|
|||
end
|
||||
|
||||
-- 战斗回合变化回调
|
||||
this.curRound = 1
|
||||
function this.OnRoundChanged(round)
|
||||
-- body
|
||||
-- 轮数变化
|
||||
this.curRound = round
|
||||
--显示波次
|
||||
local curRound, maxRound = BattleLogic.GetCurRound()
|
||||
curRound = curRound <= 0 and 1 or curRound -- 最小显示第一回合
|
||||
|
@ -607,6 +611,11 @@ function this.OnRoundChanged(round)
|
|||
this.roundText.text = string.format(Language[10211], curRound, maxRound)
|
||||
|
||||
end
|
||||
-- 角色轮转回调
|
||||
function this.RoleTurnChange(role)
|
||||
GuideBattleLogic:RoleTurnChange(this.curRound, role)
|
||||
end
|
||||
|
||||
|
||||
-- 由BattleView驱动
|
||||
function this.OnUpdate()
|
||||
|
|
|
@ -0,0 +1,67 @@
|
|||
local GuideBattleLogic = {}
|
||||
|
||||
-- 引导节点配置
|
||||
local _GuideConfig = {
|
||||
-- 轮数 = {阵营 = { 释放位置 = 对话id}}} 新手引导假战斗
|
||||
[BattleGuideType.FakeBattle] = {
|
||||
[1] = {
|
||||
[0] = {
|
||||
[1] = 300008,
|
||||
[4] = 300010,
|
||||
}
|
||||
},
|
||||
[2] = {
|
||||
[0] = {
|
||||
[1] = 300012,
|
||||
[2] = 300014,
|
||||
[3] = 300016,
|
||||
}
|
||||
}
|
||||
},
|
||||
[BattleGuideType.QuickFight] = {
|
||||
-- 轮数 = {阵营 = { 释放位置 = 引导id}}}
|
||||
[1] = {
|
||||
[0] = {
|
||||
[1] = 200000,
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
function GuideBattleLogic:Init(guideType)
|
||||
self.guideType = guideType
|
||||
end
|
||||
|
||||
|
||||
function GuideBattleLogic:RoleTurnChange(curRound, role)
|
||||
local curCamp = role.camp
|
||||
local curPos = role.position
|
||||
local _config = _GuideConfig[self.guideType]
|
||||
if not _config
|
||||
or not _config[curRound]
|
||||
or not _config[curRound][curCamp]
|
||||
or not _config[curRound][curCamp][curPos]
|
||||
then
|
||||
return
|
||||
end
|
||||
-- 对话形式的引导
|
||||
if self.guideType == BattleGuideType.FakeBattle then
|
||||
BattleManager.SetGuidePause(true)
|
||||
local storyId = _config[curRound][curCamp][curPos]
|
||||
StoryManager.EventTrigger(storyId, function()
|
||||
BattleManager.SetGuidePause(false)
|
||||
end)
|
||||
-- 引导形式的引导
|
||||
elseif self.guideType == BattleGuideType.QuickFight then
|
||||
BattleManager.SetGuidePause(true)
|
||||
local guideId = _config[curRound][curCamp][curPos]
|
||||
GuideManager.ShowGuide(guideId)
|
||||
local function _onGuideDone()
|
||||
Game.GlobalEvent:RemoveEvent(GameEvent.Guide.BattleGuideDone, _onGuideDone)
|
||||
BattleManager.SetGuidePause(false)
|
||||
end
|
||||
Game.GlobalEvent:AddEvent(GameEvent.Guide.BattleGuideDone, _onGuideDone)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return GuideBattleLogic
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 05943705ab7aeb841bb457e6658112b3
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -2,6 +2,7 @@
|
|||
require("Base/Stack")
|
||||
require("Modules.Battle.Config.PokemonEffectConfig")
|
||||
local BattleView = require("Modules/Battle/View/BattleView")
|
||||
local GuideBattleLogic = require("Modules/Battle/View/GuideBattleLogic")
|
||||
GuideBattlePanel = Inherit(BasePanel)
|
||||
|
||||
local this = GuideBattlePanel
|
||||
|
@ -71,10 +72,12 @@ function this:OnSortingOrderChange()
|
|||
end
|
||||
|
||||
--界面打开时调用(用于子类重写)
|
||||
function this:OnOpen(_fightData, _endFunc)
|
||||
function this:OnOpen(_fightData, _endFunc, guideType)
|
||||
GuideBattleLogic:Init(guideType)
|
||||
BattleView:OnOpen(_fightData)
|
||||
|
||||
this.guideType = guideType
|
||||
endFunc = _endFunc
|
||||
|
||||
fightType = BATTLE_TYPE.Test --判定战斗类型
|
||||
this.BG:GetComponent("Image").sprite = Util.LoadSprite(BattleManager.GetBattleBg(fightType))
|
||||
|
||||
|
@ -111,7 +114,6 @@ function this.InitOption()
|
|||
local curRound, maxRound = BattleLogic.GetCurRound()
|
||||
this.roundText.text = string.format(Language[10211], curRound, maxRound)
|
||||
|
||||
|
||||
-- 初始化战斗时间,刷新前端显示
|
||||
Time.timeScale = BATTLE_TIME_SCALE_ONE
|
||||
end
|
||||
|
@ -181,43 +183,9 @@ function this.OnRoundChanged(round)
|
|||
|
||||
end
|
||||
|
||||
|
||||
-- 引导节点配置
|
||||
local _GuideConfig = {
|
||||
-- 轮数 = {阵营 = { 释放位置 = 对话id}}}
|
||||
[1] = {
|
||||
[0] = {
|
||||
[1] = 300008,
|
||||
[4] = 300010,
|
||||
}
|
||||
},
|
||||
[2] = {
|
||||
[0] = {
|
||||
[1] = 300012,
|
||||
[2] = 300014,
|
||||
[3] = 300016,
|
||||
}
|
||||
}
|
||||
}
|
||||
-- 角色轮转回调
|
||||
function this.RoleTurnChange(role)
|
||||
local curCamp = role.camp
|
||||
local curPos = role.position
|
||||
|
||||
if not _GuideConfig[this.curRound] then
|
||||
return
|
||||
end
|
||||
if not _GuideConfig[this.curRound][curCamp] then
|
||||
return
|
||||
end
|
||||
if not _GuideConfig[this.curRound][curCamp][curPos] then
|
||||
return
|
||||
end
|
||||
|
||||
BattleManager.SetGuidePause(true)
|
||||
StoryManager.EventTrigger(_GuideConfig[this.curRound][curCamp][curPos], function()
|
||||
BattleManager.SetGuidePause(false)
|
||||
end)
|
||||
GuideBattleLogic:RoleTurnChange(this.curRound, role)
|
||||
end
|
||||
|
||||
-- 由BattleView驱动
|
||||
|
|
|
@ -343,7 +343,7 @@ function this.ExecuteFightBattle(monsterGroupId, fightId, callBack)
|
|||
NetManager.LevelStarFightDataRequest(monsterGroupId, fightId, function (msg)
|
||||
hadUpdate = false
|
||||
local fightData = BattleManager.GetBattleServerData(msg)
|
||||
UIManager.OpenPanel(UIName.BattlePanel, fightData, BATTLE_TYPE.STORY_FIGHT, callBack)
|
||||
UIManager.OpenPanel(UIName.BattlePanel, fightData, BATTLE_TYPE.STORY_FIGHT, callBack, fightId)
|
||||
end)
|
||||
end
|
||||
|
||||
|
|
|
@ -192,6 +192,8 @@ function this.ShowGuide(id, ...)
|
|||
_IsFuncGuild = false
|
||||
-- 检测是否还需要功能引导
|
||||
this.CheckFuncGuide()
|
||||
elseif GuideConfig[id].Type == GuideType.Battle then
|
||||
Game.GlobalEvent:DispatchEvent(GameEvent.Guide.BattleGuideDone)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ function this.PlayTransEffect(func)
|
|||
DoTween.To(DG.Tweening.Core.DOGetter_float( function () return 6 end),
|
||||
DG.Tweening.Core.DOSetter_float(function (progress)
|
||||
this.CircleMaskMat:SetFloat("_R", progress)
|
||||
end), 0, 1):SetEase(Ease.OutQuad):OnComplete(function ()
|
||||
end), 0, 2):SetEase(Ease.OutQuad):OnComplete(function ()
|
||||
if func then
|
||||
func()
|
||||
end
|
||||
|
|
|
@ -37,7 +37,7 @@ function this.EventTrigger(eventId, callBack)
|
|||
local options = chapterDataConfig[eventId].Option
|
||||
|
||||
if showType and showValues and options then
|
||||
LogError("showtype "..showType.." showvalue "..showValues)
|
||||
-- LogError("showtype "..showType.." showvalue "..showValues)
|
||||
-- 如果是第一次打开,则打开开幕界面
|
||||
if showType == 11 then -- 对话界面
|
||||
if callBack then
|
||||
|
@ -58,13 +58,12 @@ function this.EventTrigger(eventId, callBack)
|
|||
fightType = 0,
|
||||
maxRound = 20
|
||||
}
|
||||
UIManager.OpenPanel(UIName.GuideBattlePanel, testFightData, function()
|
||||
StoryManager.EventTrigger(300017, function ()
|
||||
-- PatFaceManager.isLogin = true
|
||||
-- UIManager.OpenPanel(UIName.FightPointPassMainPanel)
|
||||
-- LoadingPanel.End()
|
||||
end)
|
||||
end)
|
||||
local panel = UIManager.OpenPanel(UIName.GuideBattlePanel, testFightData, function()
|
||||
StoryManager.EventTrigger(300017)
|
||||
end, BattleGuideType.FakeBattle)
|
||||
|
||||
|
||||
|
||||
elseif showType == 15 then -- 播放转场特效
|
||||
SwitchPanel.PlayTransEffect(function()
|
||||
this.StoryJumpType(options[1])
|
||||
|
|
Loading…
Reference in New Issue