local EventSystem = require('Event/EventSystem') local Base = require("Battle/Expression/ExpLevel/ExpLevelFunction/ExpSyncLevelFunction") local ExpSyncDragonArteryLevelFunction = class("ExpSyncDragonArteryLevelFunction",Base) -- function ExpSyncDragonArteryLevelFunction:OnDragonArteryDurationReachLimit(reachLimitPlayerID) -- end function ExpSyncDragonArteryLevelFunction:OnSummonRequest(summoner, propId) EventSystem.Dispatch(EventID.UIBattle_DragonArtery_SummonRequest, summoner) end function ExpSyncDragonArteryLevelFunction:OnLevelSucceed(withShow) Base.OnLevelSucceed(self, withShow) self:SendResult(self.levelFunction.dragonArteryPlayerID) end function ExpSyncDragonArteryLevelFunction:OnLevelFail() Base.OnLevelSucceed(self) self:SendResult(self.levelFunction.dragonArteryPlayerID) end function ExpSyncDragonArteryLevelFunction:OnDragonArteryPlayerChanged(entity, playerID, oldDragonArteryPlayerID) if entity then local entityList = LevelPlayerManager.GetPlayerEntitysByPlayerIDInRoom(entity:GetPlayerID()) for i,_entity in ipairs(entityList) do _entity.ExpEntity:SetModelUIDragonArteryTotem(true) _entity.ExpEntity:PlayEffectByType(LuaConst.EffectType.DragonArtery) end end if oldDragonArteryPlayerID then local oldEntityList = LevelPlayerManager.GetPlayerEntitysByPlayerIDInRoom(oldDragonArteryPlayerID) if oldEntityList then for i,oldEntity in ipairs(oldEntityList) do oldEntity.ExpEntity:SetModelUIDragonArteryTotem(false) oldEntity.ExpEntity:StopEffectByType(LuaConst.EffectType.DragonArtery) end end end --EventSystem.Dispatch(EventID.UI_MainShowYellowTips, string.FormatByIdsKey("IDS_DragonArtey_PlayerGetTotem", UTL.String.GetCountryName(entity:GetCampID()), entity._logicInitData.Name)) --EventSystem.Dispatch(EventID.UI_MainShowBattleReport, string.FormatByIdsKey("IDS_DragonArtey_PlayerGetTotem", UTL.String.GetCountryName(entity:GetCampID()), entity._logicInitData.Name)) EventSystem.Dispatch(EventID.UI_MainShowDragonArteryDialogue, string.FormatByIdsKey("IDS_DragonArtey_DragonCountry", UTL.String.GetColorCountryName(entity:GetCampID()), entity._logicInitData.Name)) if self.levelFunction.dragonArteryPlayerChangedCount <= 1 then EventSystem.Dispatch(EventID.UI_MainShowTips, UIUtils.GetLocalizedTxt(Const_IDS["IDS_DragonArtey_BossGone"])) end EventSystem.Dispatch(EventID.UIBattle_DragonArtery_DragonArteryPlayerChanged, entity, playerID, oldDragonArteryPlayerID) end function ExpSyncDragonArteryLevelFunction:OnDragonArteryPlayerSwitchHero(fromEntity, toEntity) toEntity.ExpEntity:SetModelUIDragonArteryTotem(true) end function ExpSyncDragonArteryLevelFunction:OnDragonArteryBossKilledByPlayer(boss, killer) local campID = killer:GetCampID() local kingdomName if campID == LuaConst.EHeroKingdomType.WEI then kingdomName = UIUtils.GetLocalizedTxt(Const_IDS["IDS_DrawCard_PageTitle_WEI"]) elseif campID == LuaConst.EHeroKingdomType.SHU then kingdomName = UIUtils.GetLocalizedTxt(Const_IDS["IDS_DrawCard_PageTitle_SHU"]) elseif campID == LuaConst.EHeroKingdomType.WU then kingdomName = UIUtils.GetLocalizedTxt(Const_IDS["IDS_DrawCard_PageTitle_WU"]) elseif campID == LuaConst.EHeroKingdomType.QUN then kingdomName = UIUtils.GetLocalizedTxt(Const_IDS["IDS_DrawCard_PageTitle_QUN"]) end EventSystem.Dispatch(EventID.UI_MainShowYellowTips, string.FormatByIdsKey("IDS_DragonArtey_PlayerKillBoss", UIUtils.GetLocalizedTxt(Const_IDS[boss.components.base.CurCharacterData.MonsterNameIDS]), kingdomName, killer and killer._logicInitData.Name or "")) end function ExpSyncDragonArteryLevelFunction:OnMiddileBossBorn(bossEntity) if self.levelFunction:GetDragonArteryPlayer() == LevelPlayerManager.MyPlayerIDInRoom then EventSystem.Dispatch(EventID.UI_MainShowBattleReport, UIUtils.GetLocalizedTxt(Const_IDS["IDS_DragonArtey_CantDamage"])) end end function ExpSyncDragonArteryLevelFunction:OnGetDragonArteryRevive(entity) if entity == LogicUpdateManager._curEntity then CTL.Tips.AddTipsMsg(Const_IDS["IDS_DragonArtey_RebornNow"]) end EventSystem.Dispatch(EventID.UI_DragonArtery_ForceRefreshPlayerHead) end return ExpSyncDragonArteryLevelFunction