挂机战斗修改提交

tcx_xiyou_solider
PC-202302260912\Administrator 2024-03-19 17:47:02 +08:00
parent 344270edab
commit 96258981ad
10 changed files with 1929 additions and 723 deletions

View File

@ -304,6 +304,7 @@ ConfigName = {
SoldiersLotteryConfig="SoldiersLotteryConfig",
SoldiersQualityConfig="SoldiersQualityConfig",
SoldiersSetting="SoldiersSetting",
SoldierStageConfig="SoldierStageConfig",
}
require "Framework/GameDataBase"

View File

@ -276,6 +276,7 @@ UPSOLDIERLEVELRESPONSE = protobuf.Descriptor();
UPSOLDIERLEVELRESPONSE_UPLVENDTIME_FIELD = protobuf.FieldDescriptor();
SOLDIERFIGHTCHECKREQUEST = protobuf.Descriptor();
SOLDIERFIGHTCHECKRESPONSE = protobuf.Descriptor();
SOLDIERFIGHTCHECKRESPONSE_RESULT_FIELD = protobuf.FieldDescriptor();
SOLDIERFIGHTCHECKRESPONSE_DROP_FIELD = protobuf.FieldDescriptor();
HEROINFO_HEROID_FIELD.name = "heroId"
@ -2802,10 +2803,20 @@ SOLDIERFIGHTCHECKREQUEST.enum_types = {}
SOLDIERFIGHTCHECKREQUEST.fields = {}
SOLDIERFIGHTCHECKREQUEST.is_extendable = false
SOLDIERFIGHTCHECKREQUEST.extensions = {}
SOLDIERFIGHTCHECKRESPONSE_RESULT_FIELD.name = "result"
SOLDIERFIGHTCHECKRESPONSE_RESULT_FIELD.full_name = ".rpc.protocols.SoldierFightCheckResponse.result"
SOLDIERFIGHTCHECKRESPONSE_RESULT_FIELD.number = 1
SOLDIERFIGHTCHECKRESPONSE_RESULT_FIELD.index = 0
SOLDIERFIGHTCHECKRESPONSE_RESULT_FIELD.label = 1
SOLDIERFIGHTCHECKRESPONSE_RESULT_FIELD.has_default_value = false
SOLDIERFIGHTCHECKRESPONSE_RESULT_FIELD.default_value = 0
SOLDIERFIGHTCHECKRESPONSE_RESULT_FIELD.type = 5
SOLDIERFIGHTCHECKRESPONSE_RESULT_FIELD.cpp_type = 1
SOLDIERFIGHTCHECKRESPONSE_DROP_FIELD.name = "drop"
SOLDIERFIGHTCHECKRESPONSE_DROP_FIELD.full_name = ".rpc.protocols.SoldierFightCheckResponse.drop"
SOLDIERFIGHTCHECKRESPONSE_DROP_FIELD.number = 1
SOLDIERFIGHTCHECKRESPONSE_DROP_FIELD.index = 0
SOLDIERFIGHTCHECKRESPONSE_DROP_FIELD.number = 2
SOLDIERFIGHTCHECKRESPONSE_DROP_FIELD.index = 1
SOLDIERFIGHTCHECKRESPONSE_DROP_FIELD.label = 1
SOLDIERFIGHTCHECKRESPONSE_DROP_FIELD.has_default_value = false
SOLDIERFIGHTCHECKRESPONSE_DROP_FIELD.default_value = nil
@ -2817,7 +2828,7 @@ SOLDIERFIGHTCHECKRESPONSE.name = "SoldierFightCheckResponse"
SOLDIERFIGHTCHECKRESPONSE.full_name = ".rpc.protocols.SoldierFightCheckResponse"
SOLDIERFIGHTCHECKRESPONSE.nested_types = {}
SOLDIERFIGHTCHECKRESPONSE.enum_types = {}
SOLDIERFIGHTCHECKRESPONSE.fields = {SOLDIERFIGHTCHECKRESPONSE_DROP_FIELD}
SOLDIERFIGHTCHECKRESPONSE.fields = {SOLDIERFIGHTCHECKRESPONSE_RESULT_FIELD, SOLDIERFIGHTCHECKRESPONSE_DROP_FIELD}
SOLDIERFIGHTCHECKRESPONSE.is_extendable = false
SOLDIERFIGHTCHECKRESPONSE.extensions = {}

View File

@ -405,6 +405,8 @@ GETMAINLEVELINFORESPONSE_STATE_FIELD = protobuf.FieldDescriptor();
GETMAINLEVELINFORESPONSE_DURATION_FIELD = protobuf.FieldDescriptor();
GETMAINLEVELINFORESPONSE_ADVENTUREBOSSINFO_FIELD = protobuf.FieldDescriptor();
GETMAINLEVELINFORESPONSE_REWARD_FIELD = protobuf.FieldDescriptor();
GETMAINLEVELINFORESPONSE_SOLDIERLAYERID_FIELD = protobuf.FieldDescriptor();
GETMAINLEVELINFORESPONSE_SOLDIERSTARTTIME_FIELD = protobuf.FieldDescriptor();
QUICKBUYTREASURELEVELREQUEST = protobuf.Descriptor();
QUICKBUYTREASURELEVELREQUEST_LEVEL_FIELD = protobuf.FieldDescriptor();
TREASUREREFRESHINDICATION = protobuf.Descriptor();
@ -4544,11 +4546,31 @@ GETMAINLEVELINFORESPONSE_REWARD_FIELD.default_value = ""
GETMAINLEVELINFORESPONSE_REWARD_FIELD.type = 9
GETMAINLEVELINFORESPONSE_REWARD_FIELD.cpp_type = 9
GETMAINLEVELINFORESPONSE_SOLDIERLAYERID_FIELD.name = "soldierLayerId"
GETMAINLEVELINFORESPONSE_SOLDIERLAYERID_FIELD.full_name = ".rpc.protocols.GetMainLevelInfoResponse.soldierLayerId"
GETMAINLEVELINFORESPONSE_SOLDIERLAYERID_FIELD.number = 6
GETMAINLEVELINFORESPONSE_SOLDIERLAYERID_FIELD.index = 5
GETMAINLEVELINFORESPONSE_SOLDIERLAYERID_FIELD.label = 1
GETMAINLEVELINFORESPONSE_SOLDIERLAYERID_FIELD.has_default_value = false
GETMAINLEVELINFORESPONSE_SOLDIERLAYERID_FIELD.default_value = 0
GETMAINLEVELINFORESPONSE_SOLDIERLAYERID_FIELD.type = 5
GETMAINLEVELINFORESPONSE_SOLDIERLAYERID_FIELD.cpp_type = 1
GETMAINLEVELINFORESPONSE_SOLDIERSTARTTIME_FIELD.name = "soldierStartTime"
GETMAINLEVELINFORESPONSE_SOLDIERSTARTTIME_FIELD.full_name = ".rpc.protocols.GetMainLevelInfoResponse.soldierStartTime"
GETMAINLEVELINFORESPONSE_SOLDIERSTARTTIME_FIELD.number = 7
GETMAINLEVELINFORESPONSE_SOLDIERSTARTTIME_FIELD.index = 6
GETMAINLEVELINFORESPONSE_SOLDIERSTARTTIME_FIELD.label = 1
GETMAINLEVELINFORESPONSE_SOLDIERSTARTTIME_FIELD.has_default_value = false
GETMAINLEVELINFORESPONSE_SOLDIERSTARTTIME_FIELD.default_value = 0
GETMAINLEVELINFORESPONSE_SOLDIERSTARTTIME_FIELD.type = 5
GETMAINLEVELINFORESPONSE_SOLDIERSTARTTIME_FIELD.cpp_type = 1
GETMAINLEVELINFORESPONSE.name = "GetMainLevelInfoResponse"
GETMAINLEVELINFORESPONSE.full_name = ".rpc.protocols.GetMainLevelInfoResponse"
GETMAINLEVELINFORESPONSE.nested_types = {}
GETMAINLEVELINFORESPONSE.enum_types = {}
GETMAINLEVELINFORESPONSE.fields = {GETMAINLEVELINFORESPONSE_FIGHTID_FIELD, GETMAINLEVELINFORESPONSE_STATE_FIELD, GETMAINLEVELINFORESPONSE_DURATION_FIELD, GETMAINLEVELINFORESPONSE_ADVENTUREBOSSINFO_FIELD, GETMAINLEVELINFORESPONSE_REWARD_FIELD}
GETMAINLEVELINFORESPONSE.fields = {GETMAINLEVELINFORESPONSE_FIGHTID_FIELD, GETMAINLEVELINFORESPONSE_STATE_FIELD, GETMAINLEVELINFORESPONSE_DURATION_FIELD, GETMAINLEVELINFORESPONSE_ADVENTUREBOSSINFO_FIELD, GETMAINLEVELINFORESPONSE_REWARD_FIELD, GETMAINLEVELINFORESPONSE_SOLDIERLAYERID_FIELD, GETMAINLEVELINFORESPONSE_SOLDIERSTARTTIME_FIELD}
GETMAINLEVELINFORESPONSE.is_extendable = false
GETMAINLEVELINFORESPONSE.extensions = {}
QUICKBUYTREASURELEVELREQUEST_LEVEL_FIELD.name = "level"

View File

@ -6,11 +6,13 @@ local invadeMonster = require("Modules/Fight/View/InvadeMonsterView")
-- 小人行动
--local roleWalkView = require("Modules/Fight/View/RoleShowView")
-- 小地图
local fightMap = require("Modules/Fight/View/FightPointMapView")
--local fightMap = require("Modules/Fight/View/FightPointMapView")
local fightLevelConfig = ConfigManager.GetConfig(ConfigName.MainLevelConfig)
local fightLevelSetConfig = ConfigManager.GetConfig(ConfigName.MainLevelSettingConfig)
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
local aaa=ConfigManager.GetConfigData(ConfigName.SpecialConfig,180).Value
local roleConfig=ConfigManager.GetConfig(ConfigName.RoleConfig)
local curSoliderStageConfig
local cost=string.split(aaa,"#")
local points = {}
local isCounting = false
@ -58,14 +60,14 @@ local fightAnim = {
-- local mapNpc = "live2d_npc_map"
-- local mapNpc2 = "live2d_npc_map_nv"
-- local npc
local heroSpineList={}
--初始化组件(用于子类重写)
function FightPointPassMainPanel:InitComponent()
invadeMonster:InitComponent(self.gameObject, this)
this.spLoader = SpriteLoader.New()
isAnimActive = false
fightMap:InitComponent(self.gameObject, this)
--fightMap:InitComponent(self.gameObject, this)
-- 通关豪礼入口
this.pgBtn=Util.GetGameObject(self.gameObject,"LeftUp/box/passGift")
this.pgFrame=Util.GetGameObject(this.pgBtn,"frame"):GetComponent("Image")
@ -216,9 +218,7 @@ function FightPointPassMainPanel:InitComponent()
this.btnFightLevel:SetActive(false)
-- this.funcBtnList[FUNCTION_OPEN_TYPE.FIGHTLEVEL] = this.btnFightLevel
-- this.btnFightLevelRedPoint = Util.GetGameObject(this.btnFightLevel, "redPoint")
this.bossObj=Util.GetGameObject(self.gameObject, "Bg/battleObj/boss")
this.playerPos=Util.GetGameObject(self.gameObject, "Bg/battleObj/player")
this.playerList={}
--小兵系统
this.btn_lv=Util.GetGameObject(self.gameObject, "soldierObj/btn_lv")
this.lvTxt=Util.GetGameObject(self.gameObject, "soldierObj/btn_lv/Text"):GetComponent("Text")
@ -242,9 +242,34 @@ function FightPointPassMainPanel:InitComponent()
this.soliderList[i].type=Util.GetGameObject(go, "type"):GetComponent("Text")
this.soliderList[i].lock=Util.GetGameObject(go, "Image")
end
--战斗部分
this.battlePanel=Util.GetGameObject(self.gameObject, "Bg/battlePanel")
this.enemyPos=Util.GetGameObject(self.gameObject, "battlePanel/enemyPos/pos")
local aaa={}
aaa.role={}
aaa.role.camp=1
this.Floater = FloatNode.New(aaa, this.enemyPos, this.enemyPos)
this.heroList={}
for i=1,6 do
this.heroList[i]={}
local obj=Util.GetGameObject(self.gameObject, "battlePanel/heroPos/hero1 (".. i ..")")
this.heroList[i].go=obj
this.heroList[i].pos=Util.GetGameObject(this.heroList[i].go, "pos")
this.heroList[i].effect = poolManager:LoadAsset("c_xy_0012_skeff_slidesk_ballistic", PoolManager.AssetType.GameObject)
this.heroList[i].effect.transform:SetParent(this.heroList[i].pos.transform)
this.heroList[i].effect.transform.localScale = Vector3.one
this.heroList[i].effect.transform.localPosition = Vector3.New(0, 0, 0)
this.heroList[i].effect:SetActive(false)
end
this.soliderGrid=Util.GetGameObject(self.gameObject, "battlePanel/soliderPos")
this.soliderPre=Util.GetGameObject(self.gameObject, "battlePanel/soliderPre")
this.timeTxt=Util.GetGameObject(self.gameObject, "battlePanel/timeTxt"):GetComponent("Text")
this.hpTxt=Util.GetGameObject(self.gameObject, "battlePanel/hpTxt"):GetComponent("Text")
this.bossObj=Util.GetGameObject(self.gameObject, "battlePanel/bossObj")
this.bossImg=Util.GetGameObject(self.gameObject, "battlePanel/bossObj/icon"):GetComponent("Image")
this.bossNum=Util.GetGameObject(self.gameObject, "battlePanel/bossObj/num"):GetComponent("Text")
end
--绑定事件(用于子类重写)
@ -374,9 +399,30 @@ end
function this.RefreshLvInfo()
end
local levelList={}
--刷新boss信息显示
function this.RefreshBossInfo()
levelList={}
local curFight=FightPointPassManager.curOpenFight
--LogError("curfight==========================================================="..curFight)
for k,v in ConfigPairs(fightLevelConfig) do
if k>=curFight then
if v.OpenRule and (v.OpenRule[1][1]==9 or v.OpenRule[1][1]==0 )and SmallSoldierManager.level>=v.OpenRule[1][2] then
LogError("k==================================="..k)
table.insert(levelList,k)
end
end
end
if #levelList>0 then
this.bossObj:SetActive(true)
this.bossNum.text=#levelList
else
this.bossObj:SetActive(false)
end
end
--刷新小兵信息
function this.RefreshSoliderInfo()
this.RefreshBossInfo()
this.lvTxt.text=SmallSoldierManager.level
local lotteryConfig=ConfigManager.GetConfigData(ConfigName.SoldiersLotteryConfig,SmallSoldierManager.level)
this.lvBarTxt.text=string.format("兵力:%s/%s",BagManager.GetItemCountById(lotteryConfig.Soldiers[1]),lotteryConfig.Soldiers[2])
@ -389,6 +435,7 @@ function this.RefreshSoliderInfo()
this.costTxt.text=BagManager.GetItemCountById(tonumber(cost[1]))
local openList=lotteryConfig.SoldierType
local dataList=SmallSoldierManager.soldierList
LogError("dataList=========================================================="..#dataList)
for i=1,#this.soliderList do
--如果这个位置有小兵
if dataList[i] then
@ -412,10 +459,199 @@ function this.RefreshSoliderInfo()
--
this.soliderList[i].lock:SetActive(CheckListIsContainValue1(openList,i)==false)
end
this.ShowBattleInfo()
end
local soliderPreList={}
local bossSpine
function this.ShowBattleInfo()
--显示boss
curSoliderStageConfig=ConfigManager.GetConfigData(ConfigName.SoldierStageConfig,FightPointPassManager.soldierLayerId)
local heroData = ConfigManager.GetConfigData(ConfigName.HeroConfig,curSoliderStageConfig.Hero)
local bossName=GetResourcePath(heroData.Live)
if bossName~=this.bossLiveName then
--poolManager:UnLoadLive(this.bossLiveName, this.bossLiveGO, PoolManager.AssetType.GameObject)
this.bossLiveName=bossName
this.bossLiveGO= poolManager:LoadLive(this.bossLiveName,this.enemyPos.transform, Vector3.one, Vector3.zero)
this.bossLiveGO.transform:SetParent(this.enemyPos.transform)
this.bossLiveGO.transform.localPosition = Vector2.New(0, 0)
this.bossLiveGO.transform.localScale=Vector3.one * roleConfig[curSoliderStageConfig.Hero].enemy_liveScale*0.5
bossSpine=this.bossLiveGO:GetComponent("SkeletonGraphic")
end
local team=FormationManager.GetFormationByID(FormationTypeDef.FORMATION_NORMAL)
for i=1,6 do
--如果这个位置有英雄
if team.teamHeroInfos[i] then
local heroData = HeroManager.GetSingleHeroData(team.teamHeroInfos[i].heroId)
local sId=heroData.id
local roleLiveGO=nil
if heroSpineList[heroData.live]==nil then
roleLiveGO= poolManager:LoadLive(heroData.live,this.heroList[i].pos.transform, Vector3.one, Vector3.zero)
else
roleLiveGO=heroSpineList[heroData.live]
end
roleLiveGO.transform:SetParent(this.heroList[i].pos.transform)
roleLiveGO.transform.localPosition = Vector2.New(0, 0)
roleLiveGO.transform.localScale=Vector3.one * roleConfig[sId].enemy_liveScale*0.2 -- * 0.75--* 1.5
if i<=3 then
if heroData.heroConfig.Toward==1 then
SetHEeroLiveToward(roleLiveGO,1)
end
else
if heroData.heroConfig.Toward==2 then
SetHEeroLiveToward(roleLiveGO,1)
end
end
this.heroList[i].spine=roleLiveGO:GetComponent("SkeletonGraphic")
this.heroList[i].data=heroData
heroSpineList[heroData.live]=roleLiveGO
end
end
--小兵显示
local aaa=SmallSoldierManager.soldierList
LogError("dataList=======len==========="..#SmallSoldierManager.soldierList)
local index=0
for k, v in pairs(aaa) do
index=index+1
if not soliderPreList[index] then
local obj=newObjToParent(this.soliderPre,this.soliderGrid)
soliderPreList[index]={}
soliderPreList[index].go=obj
soliderPreList[index].pos=Util.GetGameObject(obj, "pos")
soliderPreList[index].effect = poolManager:LoadAsset("c_xy_0012_skeff_slidesk_ballistic", PoolManager.AssetType.GameObject)
soliderPreList[index].effect.transform:SetParent(soliderPreList[index].pos.transform)
soliderPreList[index].effect.transform.localScale = Vector3.one
soliderPreList[index].effect.transform.localPosition = Vector3.New(0, 0, 0)
soliderPreList[index].data=v
soliderPreList[index].effect:SetActive(false)
Util.SetParticleSortLayer(soliderPreList[index].effect, orginLayer+2)
else
end
end
if this.timer then
this.timer:Stop()
this.timer = nil
end
local cd=0
local battleTime=curSoliderStageConfig.Time
local bossHp=curSoliderStageConfig.Hp
local isHit=false
LogError("curSoliderStageConfig.Time===="..curSoliderStageConfig.Time.." curSoliderStageConfig.Hp=="..curSoliderStageConfig.Hp)
this.timer = Timer.New(function()
cd=cd+1
--每隔三秒攻击一次
if cd==3 then
--英雄攻击
for i=1,6 do
if this.heroList[i].spine then
this.heroList[i].effect.transform.position =this.heroList[i].pos.transform.position
this.heroList[i].spine.AnimationState:SetAnimation(0, "touch", true)
Util.ClearTrailRender(this.heroList[i].effect)
this.heroList[i].effect:SetActive(true)
this.heroList[i].effect:GetComponent("RectTransform"):DOMove(this.enemyPos.transform.position, 0.6, false):OnComplete(function ()
if this.heroList[i].effect then
this.heroList[i].effect:SetActive(false)
end
this.heroList[i].spine.AnimationState:SetAnimation(0, "idle", true)
--LogError("this.heroList[i].data.attack=="..this.heroList[i].data.attack)
local proList=HeroPropManager.GetHeroProp(this.heroList[i].data.dynamicId, FormationTypeDef.FORMATION_NORMAL)
--LogError("prolist[2]==============="..proList[2])
--for i=1,5 do
bossHp=bossHp-proList[2]
this.Floater:ArtFloating(ArtFloatingType.Damage,ArtFloatingColor.White,proList[2])
--end
isHit=true
if isHit then
--LogError("boss被攻击======================================")
bossSpine.AnimationState:SetAnimation(0, "hit",false)
isHit=false
end
end)
end
end
local lotteryConfig=ConfigManager.GetConfigData(ConfigName.SoldiersLotteryConfig,SmallSoldierManager.level)
local add=lotteryConfig.SoldiersUP/10000
--小兵攻击
for i=1,#soliderPreList do
local aaa=soliderPreList[i]
--if aaa.spine then
aaa.effect.transform.position =aaa.pos.transform.position
--aaa.spine.AnimationState:SetAnimation(0, "touch", true)
Util.ClearTrailRender(aaa.effect)
aaa.effect:SetActive(true)
aaa.effect:GetComponent("RectTransform"):DOMove(this.enemyPos.transform.position, 0.6, false):OnComplete(function ()
if aaa.effect then
aaa.effect:SetActive(false)
end
--aaa.spine.AnimationState:SetAnimation(0, "idle", true)
-- for i=1,5 do
--LogError("aaa.data.attributes[2].value=="..aaa.data.attributes[2].value)
local attack=math.floor(aaa.data.attributes[2].value*(1+add))
bossHp=bossHp-attack
this.Floater:ArtFloating(ArtFloatingType.Damage,ArtFloatingColor.White,attack)
-- end
end)
--end
end
cd=0
end
bossSpine.AnimationState:SetAnimation(0, "idle", true)
battleTime=battleTime-1
this.timeTxt.text=battleTime
this.hpTxt.text=bossHp
--战斗时间到了,重头开始打
if battleTime<=0 then
LogError("战斗结束")
this.timer:Stop()
cd=0
battleTime=curSoliderStageConfig.Time
bossHp=curSoliderStageConfig.Hp
this.timer:Start()
end
if bossHp<=0 then
LogError("boss被击败")
this.timer:Stop()
NetManager.SoldierFightCheckRequest(function(msg)
--战斗成功
if msg.result==1 then
FightPointPassManager.soldierLayerId=curSoliderStageConfig.NextId
curSoliderStageConfig=ConfigManager.GetConfigData(ConfigName.SoldierStageConfig,FightPointPassManager.soldierLayerId)
local heroData = ConfigManager.GetConfigData(ConfigName.HeroConfig,curSoliderStageConfig.Hero)
local name=GetResourcePath(heroData.Live)
--换boss了
if name~=this.bossLiveName then
poolManager:UnLoadLive(this.bossLiveName, this.bossLiveGO, PoolManager.AssetType.GameObject)
this.bossLiveName=name
this.bossLiveGO= poolManager:LoadLive(this.bossLiveName,this.enemyPos.transform, Vector3.one, Vector3.zero)
this.bossLiveGO.transform:SetParent(this.enemyPos.transform)
this.bossLiveGO.transform.localPosition = Vector2.New(0, 0)
this.bossLiveGO.transform.localScale=Vector3.one * roleConfig[curSoliderStageConfig.Hero].enemy_liveScale*0.5
bossSpine=this.bossLiveGO:GetComponent("SkeletonGraphic")
end
end
this.timer:Start()
cd=0
battleTime=curSoliderStageConfig.Time
bossHp=curSoliderStageConfig.Hp
this.RefreshBossInfo()
end)
end
end, 1, -1, true)
this.timer:Start()
end
function this.SetInitAnim()
-- 隐藏界面特效
-- count = 1
@ -426,7 +662,7 @@ function this.SetInitAnim()
-- fightSkeleton.AnimationState:SetAnimation(0, fightAnim[2], false)
-- isAnimActive = true
-- chooseAnim = FightPointPassManager.IsFightBoss() and 4 or 3
fightMap.StopAction()
--fightMap.StopAction()
UIManager.OpenPanel(UIName.FightLevelSwitchPopup, true)
end
@ -437,9 +673,9 @@ function this:PlayerKillAllSkill()
go.transform.localScale = Vector3.one
go.transform.localPosition =offset
go:SetActive(true)
this.skillTimer = Timer.New(function ()
fightMap.AllBattleEnd()
end,3)
-- this.skillTimer = Timer.New(function ()
-- fightMap.AllBattleEnd()
-- end,3)
this.skillTimer:Start()
Timer.New(function ()
destroy(go)
@ -457,7 +693,7 @@ end
function FightPointPassMainPanel:AddListener()
invadeMonster:AddListener()
fightMap:AddListener()
--fightMap:AddListener()
Game.GlobalEvent:AddEvent(GameEvent.FunctionCtrl.OnFunctionOpen, this.BtnsIsOpen)
Game.GlobalEvent:AddEvent(GameEvent.Bag.BagGold, this.UpdateFindTreasureMaterialNum)
Game.GlobalEvent:AddEvent(GameEvent.FindTreasure.RefreshFindTreasureRedPot, this.RefreshFindTreasureRedPoint)
@ -478,7 +714,7 @@ end
function FightPointPassMainPanel:RemoveListener()
invadeMonster:RemoveListener()
fightMap:RemoveListener()
--fightMap:RemoveListener()
Game.GlobalEvent:RemoveEvent(GameEvent.FunctionCtrl.OnFunctionOpen, this.BtnsIsOpen)
Game.GlobalEvent:RemoveEvent(GameEvent.Bag.BagGold, this.UpdateFindTreasureMaterialNum)
Game.GlobalEvent:RemoveEvent(GameEvent.FindTreasure.RefreshFindTreasureRedPot, this.RefreshFindTre3asureRedPoint)
@ -591,7 +827,7 @@ function FightPointPassMainPanel:OnShow()
coroutine.start(function()
-- coroutine.wait(0.01)
if UIManager.IsOpen(UIName.FightPointPassMainPanel) then
fightMap:Init()
--fightMap:Init()
hasMap = true
end
end)
@ -746,7 +982,7 @@ end
--按钮开启限制
function this.BtnsIsOpen()
for i, v in pairs(this.funcBtnList) do
LogError("i==="..i)
--LogError("i==="..i)
local isOpen = ActTimeCtrlManager.SingleFuncState(i)
v:SetActive(isOpen)
end
@ -755,11 +991,12 @@ end
function this.IntiReward()
local rewardData
if FightPointPassManager.isOpenNewChapter then
rewardData = fightLevelConfig[FightPointPassManager.curOpenFight].RewardShowMin
else
rewardData = fightLevelConfig[FightPointPassManager.lastPassFightId].RewardShowMin
end
rewardData = ConfigManager.GetConfigData(ConfigName.SoldierStageConfig,SmallSoldierManager.level).RewardShowMin
-- if FightPointPassManager.isOpenNewChapter then
-- rewardData = fightLevelConfig[FightPointPassManager.curOpenFight].RewardShowMin
-- else
-- rewardData = fightLevelConfig[FightPointPassManager.lastPassFightId].RewardShowMin
-- end
if rewardData then
for i = 1, #rewardData do
if not this.rewardList[i] then
@ -864,15 +1101,31 @@ end
function this.ExcuteBattle()
if not FightPointPassManager.IsChapterClossState() then
--fightMap.StopAction()
if hasMap then
LogGreen("关闭挂机")
fightMap:OnClose()
hasMap = false
-- if hasMap then
-- LogGreen("关闭挂机")
-- fightMap:OnClose()
-- hasMap = false
-- end
-- UIManager.OpenPanel(UIName.FightMiddleChoosePanel, FightPointPassManager.curOpenFight, true,function ()
-- --- 临时代码
-- --FightPointPassManager.SetChapterOpenState(false)
-- end)
-- 章节解锁时添加对话
FightPointPassManager.SetChapterOpenState(false)
LogError("FightPointPassManager.lastPassFightId=="..FightPointPassManager.lastPassFightId)
LogError("FightPointPassManager.GetCurFightId()"..FightPointPassManager.GetCurFightId())
local chapterId = math.floor(FightPointPassManager.lastPassFightId / 1000)
LogError("chapterid==================="..chapterId)
local curChapterId = fightLevelSetConfig[chapterId].EventId
if curChapterId>0 then
StoryManager.EventTrigger(curChapterId, function()
LogGreen("打开挂机界面")
UIManager.OpenPanel(UIName.FightPointPassMainPanel)
end)
else
UIManager.OpenPanel(UIName.FightPointPassMainPanel)
end
UIManager.OpenPanel(UIName.FightMiddleChoosePanel, FightPointPassManager.curOpenFight, true,function ()
--- 临时代码
--FightPointPassManager.SetChapterOpenState(false)
end)
return
end
@ -900,7 +1153,17 @@ function this.ExcuteBattle()
else
-- 检测是否有前置引导
GuideManager.BeforeFightCheck(curFightId, function()
this.SetInitAnim()
if #levelList<=0 then
LogError("没有要打的boss关卡")
return
end
--屏蔽弹怪追认的动画
--this.SetInitAnim()
local isBoss = FightPointPassManager.IsFightBoss()
local sound = isBoss and SoundConfig.Sound_FightArea_Boss or SoundConfig.Sound_FightArea_Monster
SoundManager.PlaySound(sound, AUDIO_FADE_TYPE.FADE_OUT_NOT_IN, AUDIO_RUN_TYPE.CONC, nil, 20)
LogError("levelList[1]=================================="..levelList[1])
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.STORY, levelList[1])
end)
end
end
@ -933,7 +1196,7 @@ function FightPointPassMainPanel:OnSortingOrderChange()
Util.AddParticleSortLayer(this.UI_Effect_MuBiaoJiangLi, self.sortingOrder - orginLayer)
Util.SetParticleSortLayer(this.fightSaoGuang, self.sortingOrder + 1)
Util.SetParticleSortLayer(this.fightGuideEffect, self.sortingOrder + 2)
fightMap:OnSortingOrderChange(self.sortingOrder)
--fightMap:OnSortingOrderChange(self.sortingOrder)
orginLayer = self.sortingOrder
@ -942,6 +1205,13 @@ function FightPointPassMainPanel:OnSortingOrderChange()
if this.playerInfoView then
this.playerInfoView:SetLayer(self.sortingOrder)
end
for i=1,6 do
if this.heroList[i] then
Util.SetParticleSortLayer(this.heroList[i].effect, self.sortingOrder+2)
end
end
end
--界面关闭时调用(用于子类重写)
@ -950,10 +1220,10 @@ function FightPointPassMainPanel:OnClose()
PlayerManager.StopBattleUpLvTipTime()
hasLoad = false
invadeMonster:OnClose()
if hasMap then
fightMap:OnClose()
hasMap = false
end
-- if hasMap then
-- fightMap:OnClose()
-- hasMap = false
-- end
if this.animTimer then
this.animTimer:Stop()
@ -1000,6 +1270,15 @@ function FightPointPassMainPanel:OnDestroy()
this.playerInfoView = nil
end
points = {}
for k, v in pairs(heroSpineList) do
poolManager:UnLoadAsset(k,v,poolManager.AssetType.GameObject)
end
poolManager:UnLoadLive(this.bossLiveName, this.bossLiveGO, PoolManager.AssetType.GameObject)
heroSpineList={}
this.heroList={}
soliderPreList={}
this.bossLiveGO=nil
this.bossLiveName=nil
end
--跳转显示新手提示圈
function FightPointPassMainPanel.ShowGuideGo(btnIndex)

View File

@ -5,6 +5,7 @@ local mainLevelConfig = ConfigManager.GetConfig(ConfigName.MainLevelConfig)
local Huo_Dong_Diao_Luo = ConfigManager.GetConfig(ConfigName.ActivityDropReward)
local rewardGroupConfig = ConfigManager.GetConfig(ConfigName.RewardGroup)
local LevelTipsConfig = ConfigManager.GetConfig(ConfigName.LevelTips)
local curSoliderConfig=nil
this.talkingTime = 0 --对话时间
-- 挂机物品栏位对应vip数值加成特权
@ -39,7 +40,9 @@ function this.Initialize()
Game.GlobalEvent:AddEvent(GameEvent.Player.OnLevelChange, this.CheckFightRP)
-- Game.GlobalEvent:AddEvent(GameEvent.Mission.OnOpenEnableFight, this.CheckFightRP)
Game.GlobalEvent:AddEvent(GameEvent.Mission.OnOpenFight, this.CheckFightRP)
this.soldierLayerId=0
this.soldierStartTime=0
end
function this.CheckFightRP()
@ -55,6 +58,9 @@ function this.InitAllFightPointState(msg)
this.HangOnTime = msg.duration
this.curOpenFight = msg.fightId
this.soldierStartTime = msg.soldierStartTime
this.soldierLayerId = msg.soldierLayerId
LogError("msg.soldierLayerId========================================================="..msg.soldierLayerId)
if mainLevelConfig[this.curOpenFight].SortId-1 > 0 then
this.lastPassFightId = ConfigManager.GetConfigDataByKey(ConfigName.MainLevelConfig,"SortId", mainLevelConfig[this.curOpenFight].SortId-1).Id
LogError("this.lastPassFightId=="..this.lastPassFightId)
@ -63,7 +69,7 @@ function this.InitAllFightPointState(msg)
this.curFightState = msg.state
this.adventrueEnemyList=msg.adventureBossInfo
this.HangOnReward=msg.reward
Log()
--Log()
this.maxChapterNum = LengthOfTable(GameDataBase.SheetBase.GetKeys(ConfigManager.GetConfig(ConfigName.MainLevelSettingConfig)))
end
@ -172,6 +178,7 @@ function this.RefreshFightId(msg)
Game.GlobalEvent:DispatchEvent(GameEvent.Mission.OnPassFight, oldFight)
-- 服务器更新关卡状态
LogError("服务器更新关卡状态---------------------------------------------------")
this.curOpenFight = msg.fightId
this.curFightState = msg.state
@ -204,33 +211,7 @@ function this.RefreshFightId(msg)
Log(" 更新关卡ID " .. this.curOpenFight)
Log(" 关卡状态 " .. this.curFightState)
-- 判断新解锁关卡的状态
--if PlayerManager.level >= data.LevelLimit then
-- this.curFightState = 1
--if this.curFightState == 1 then
-- -- 解锁一个可以打的新关卡, 发送新关卡ID
-- Game.GlobalEvent:DispatchEvent(GameEvent.Mission.OnOpenEnableFight, data.NextLevel)
--end
--else
-- this.curFightState = -1
--end
---- 章节开启
--local isOpen = mainLevelConfig[this.curOpenFight].PicShow == 1
----开启新章节的表现处理
--if isOpen then
-- this.SetChapterOpenState(true)
--end
--Log("~关卡已通关id = "..oldFight)
-- 发送关卡通关事件
--[[ Game.GlobalEvent:DispatchEvent(GameEvent.Mission.OnOpenFight, oldFight)]]
--else
-- this.curFightState = 2
--end
--end
end
function this.GetIsOpenRewardUpTip()
return isOpenRewardUpTip

View File

@ -1,34 +1,108 @@
SmallSoldierManager = {}
local this = SmallSoldierManager
local ItemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
local settingConfig=ConfigManager.GetConfig(ConfigName.SoldiersSetting)
this.level=1
this.changeSolider=nil
this.upEndTime=0
function this.Initialize()
LogError("初始化============================================小兵管理器")
this.soldierList={}
end
function this.InitData(msg)
LogError("初始化============================================小兵管理器")
this.soldierList={}
this.level=msg.level
this.upEndTime=msg.upLvEndTime
--this.soldierList=msg.soldiers
LogError("this.level============"..this.level.." endtime============"..this.upEndTime.." msg.soldiers len==="..#msg.soldiers)
--LogError("this.level============"..this.level.." endtime============"..this.upEndTime.." msg.soldiers len==="..#msg.soldiers)
if msg.soldiers then
for i=1,#msg.soldiers do
local v= msg.soldiers[i]
LogError("position====================="..v.position)
--LogError("position====================="..v.position)
if v.position==-1 then
this.changeSolider=v
else
this.soldierList[v.position] = v
if v.position then
this.soldierList[v.position] = v
end
end
end
end
for k, v in pairs(this.soldierList) do
LogError("k============="..k)
end
--LogError("服务器发过来的小兵 this.soldierList=================len=="..#this.soldierList.." msg.soldiers===="..#msg.soldiers)
HeroPropManager.SetFuncPropDirty(Func_Prop_Type.Solider)
end
--获取所有的加成属性
function this.GetAllAddPro()
local allAddPro={}
local list=FormationManager.GetAllMainFormationHeroId()
-- LogError("获取所有加成属性============================= list len=="..#list)
for key, value in pairs(list) do
local id=key
--LogError("id======================================"..id)
local heroData=HeroManager.GetSingleHeroData(id)
--便利队伍里每个英雄
if heroData then
--便利队伍里所有小兵给这个英雄加的属性
local proList={}
for k, v in pairs(this.soldierList) do
local addPro=0
--便利阵营
for j=1, #settingConfig[v.id].PropertyName do
local aaa=settingConfig[v.id].PropertyName[j]
if aaa then
if aaa[1]==0 then
addPro=addPro+aaa[2]
--LogError("111111111111111111111111111111")
elseif heroData.heroConfig.PropertyName==aaa[1] then
addPro=addPro+aaa[2]
end
end
end
for j=1, #settingConfig[v.id].Profession do
local aaa=settingConfig[v.id].Profession[j]
if aaa then
if aaa[1]==0 then
addPro=addPro+aaa[2]
elseif heroData.heroConfig.Profession==aaa[1] then
addPro=addPro+aaa[2]
end
end
end
-- for prok, prov in pairs(v.attributes) do
-- end
--LogError("addpro============================"..addPro)
for j=1,#v.attributes do
local prov=v.attributes[j]
if proList[prov.id] then
proList[prov.id]=proList[prov.id]+math.floor(prov.value*addPro/10000+0.5)
else
proList[prov.id]=math.floor(prov.value*addPro/10000+0.5)
end
end
end
allAddPro[heroData.dynamicId]=proList
-- for k, v in pairs(proList) do
-- LogError("k============"..k.." value======="..v.." herodata.name=="..heroData.heroConfig.ReadingName)
-- end
end
end
return allAddPro
end
return this

View File

@ -21,6 +21,7 @@ Func_Prop_Type = {
Weapon =18, --神兵
WeaponFetter=19, --神兵羁绊
Gift =20, --礼物
Solider = 21, --小兵
}
-- 计算需要缓存数据的方法
@ -146,7 +147,16 @@ Func_Prop_Func = {
end
return allPro
end,
}
--小兵属性
[Func_Prop_Type.Solider] = function()
local allPro = SmallSoldierManager.GetAllAddPro()
-- for k, v in pairs(allPro) do
-- LogError("k===================================="..k.." v.."..v)
-- end
return allPro
end,
}
-- 功能属性针对个人的筛选器
@ -249,5 +259,16 @@ Func_Prop_Filter = {
[Func_Prop_Type.WeaponFetter] = function(funcData, heroData)
return funcData
end,
--神兵羁绊属性加成
[Func_Prop_Type.Solider] = function(funcData, heroData)
--LogError("heroData.dId======================================="..heroData.dId)
if funcData[heroData.dId] then
-- for k, v in pairs(funcData[heroData.dId]) do
-- --LogError("k==================================="..k.." v================="..v)
-- end
return funcData[heroData.dId]
end
return {}
end,
}

View File

@ -671,7 +671,7 @@ function this.ExecuteLoading()
--[[[3] = ]]function() NetManager.ItemInfoRequest(0, LoadingPanel.OnStep) end, -- 物品信息
-- [[[4] = ]]function() NetManager.AllEquipRequest(0, LoadingPanel.OnStep) end, -- 装备(走背包了)
--[[[5] = ]]function() NetManager.AllEquipTreasureRequest(0, LoadingPanel.OnStep) end, -- 宝物
--[[[5] = ]]function() NetManager.GetAllFaXiangRequest(1, LoadingPanel.OnStep) end, -- 法相
--[[[6] = ]]function() NetManager.GetAllFaXiangRequest(1, LoadingPanel.OnStep) end, -- 法相
-- [[[6] = ]]function() NetManager.GetSoulPrintDataRequest(0, LoadingPanel.OnStep) end, -- 魂印(走背包了)
--[[[7] = ]]function() NetManager.DiffMonsterRequest(0,LoadingPanel.OnStep) end, -- 异妖
--[[[8] = ]]function() NetManager.HeroInfoRequest(0, LoadingPanel.OnStep) end, -- 神将信息

View File

@ -7874,16 +7874,19 @@ function NetManager.UpSoldierLevelRequest(_pos, _func)
end
--小兵战斗校验
function NetManager.SoldierFightCheckRequest(_pos, _func)
function NetManager.SoldierFightCheckRequest(_func)
local data=MapInfoProto_pb.ReplaceSoldierRequest()
data.operate=_pos
--data.operate=_pos
local msg = data:SerializeToString()
Network:SendMessageWithCallBack(MessageTypeProto_pb.SoldierFightCheckRequest,MessageTypeProto_pb.SoldierFightCheckResponse,msg,function(buffer)
local data = buffer:DataByte()
local msg = MapInfoProto_pb.SoldierFightCheckResponse()
msg:ParseFromString(data)
if msg.drop then
UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1)
end
if _func then
_func()
_func(msg)
end
end)
end