dev_chengFeng
zhangqiang 2020-08-22 19:08:50 +08:00
parent 44a2538eb3
commit ead1ba8fd9
3 changed files with 44 additions and 5 deletions

View File

@ -446,6 +446,7 @@ function this.ShowBattleResult(result, msg)
end
this:ClosePanel()
Game.GlobalEvent:DispatchEvent(GameEvent.Guild.RefreshGuildTranscripQuickBtn)
GuildTranscriptManager.IsKillShowTip()
end, 6,true,true)
end)
end

View File

@ -416,8 +416,8 @@ function this.GetMonsterConfigDataById(MonsterId)
return monsterData
end
function this.ShowEndNumInfo()
this.endNumText.text = "剩余购买次数:" .. GuildTranscriptManager.GetCanBattleCount()
this.endNumBuyText.text = "剩余次数:" .. GuildTranscriptManager.GetCanBuyBattleCount()
this.endNumText.text = "剩余次数:" .. GuildTranscriptManager.GetCanBattleCount()
this.endNumBuyText.text = "剩余购买次数:" .. GuildTranscriptManager.GetCanBuyBattleCount()
end
function this.QuickWar()
GuildTranscriptManager.GuildChallengeRequest(1,function()
@ -490,6 +490,7 @@ function this.TimeStampToDateString(second)
end
function this.SetSelectImagePos(parent)
Util.SetGray(this.SelectImage,false)
this.SelectImage.transform:SetParent(Util.GetGameObject(parent, "GameObject").transform)
this.SelectImage:GetComponent("RectTransform").localPosition = Vector3.zero
this.SelectImage:GetComponent("RectTransform").localScale = Vector3.New(1,1,1)

View File

@ -6,6 +6,7 @@ local curBoss = 1--当前bossId
local blood = 0--剩余血量万分比
local canSweep = 0--是否能扫荡今天是否挑战过这个boss
local isKill = 0 --当场战斗boss 是否击杀
local isKillShowTip = false --当场战斗boss 是否击杀
local buffCount = 0--当前buff到多少索引
local buffTime = 0--buff结束时间
@ -34,7 +35,9 @@ function this.GetGuildChallengeInfoRequest(fun)
end)
end
--请求战斗
local attackTypeShotTime
function this.GuildChallengeRequest(attackType,callBack)
attackTypeShotTime = attackType
if attackType == 0 then
NetManager.GuildChallengeRequest(this.GetCurBoss(),attackType,function (msg)
local fightData = BattleManager.GetBattleServerData(msg)
@ -58,15 +61,21 @@ function this.GuildChallengeRequest(attackType,callBack)
end)
end
end
local oldBossId = 0
function this.RefreshGuildTranscriptInfo(msg)
local oldBossId = curBoss
oldBossId = curBoss
LogGreen("msg.curBoss "..msg.curBoss.." msg.blood "..msg.blood.." msg.isKill "..msg.isKill)
curBoss = msg.curBoss--当前bossId
blood = msg.blood--剩余血量万分比
-- canSweep = msg.canSweep--是否能扫荡今天是否挑战过这个boss
isKill = msg.isKill--是否击杀
isKillShowTip = false
if msg.isKill == 1 then
PopupTipPanel.ShowTip("已击败【首领名称】!")
-- canSweep = 0
isKillShowTip = true
if attackTypeShotTime == 1 then
local monsterData = this.GetMonsterConfigDataById(oldBossId)
PopupTipPanel.ShowTip( string.format("已击败【%s】",monsterData.ReadingName) )
end
end
if oldBossId ~= curBoss then--前后ID不等认为是击杀
canSweep = 0
@ -76,11 +85,39 @@ function this.RefreshGuildTranscriptInfo(msg)
end
Game.GlobalEvent:DispatchEvent(GameEvent.Guild.RefreshGuildTranscript)
end
function this.IsKillShowTip()
if isKillShowTip and attackTypeShotTime == 0 then
local monsterData = this.GetMonsterConfigDataById(oldBossId)
PopupTipPanel.ShowTip( string.format("已击败【%s】",monsterData.ReadingName) )
end
end
function this.RefreshGuildTranscriptBuffInfo(msg)
LogGreen("msg.buffCount "..msg.buffCount.." msg.buffTime "..msg.buffTime)
buffCount = msg.buffCount
buffTime = msg.buffTime
Game.GlobalEvent:DispatchEvent(GameEvent.Guild.RefreshGuildTranscriptBuff)
end
function this.GetMonsterConfigDataById(chapterId)
local MonsterId = ConfigManager.GetConfigData(ConfigName.GuildCheckpointConfig,chapterId).MonsterId
local monsterConFig = nil
local monsterGrip = ConfigManager.GetConfigData(ConfigName.MonsterGroup,MonsterId)
if not monsterGrip then return nil end
local monsterId = 0
for i = 1, #monsterGrip.Contents do
if monsterId <= 0 then
for j = 1, #monsterGrip.Contents[i] do
if monsterGrip.Contents[i][j] > 0 then
monsterId = monsterGrip.Contents[i][j]
break
end
end
end
end
if monsterId <= 0 then return nil end
local monsterData = ConfigManager.GetConfigData(ConfigName.MonsterConfig,monsterId)
return monsterData
end
-- 获取剩余挑战次数 特权
function this.GetCanBattleCount()
return PrivilegeManager.GetPrivilegeRemainValue(PRIVILEGE_TYPE.GUILDTRANSCRIPT_BATTLENUM)