local Base = require("Battle/Expression/ExpLevel/ExpLevelFunction/ExpSyncLevelFunction") local EventSystem = require('Event/EventSystem') local ExpFightThroneBaseLevelFunction = class("ExpFightThroneBaseLevelFunction", Base) local JADE_SHARD_KEY = LuaConst.EFightThroneCollectType.JADE --local FightThroneKilledIDS11 = DataSheetManager.ConstData:GetDataByID("FightThroneKilledIDS11").StringValue --2022年7月7日 策划改需求了,杀死没有令旗的人,不再弹tips了 local FightThroneKilledIDS12 = DataSheetManager.ConstData:GetDataByID("FightThroneKilledIDS12").StringValue local FightThroneKilledIDS13 = DataSheetManager.ConstData:GetDataByID("FightThroneKilledIDS13").StringValue --local FightThroneKilledIDS21 = DataSheetManager.ConstData:GetDataByID("FightThroneKilledIDS21").StringValue --2022年7月7日 策划改需求了,杀死没有令旗的人,不再弹tips了 local FightThroneKilledIDS22 = DataSheetManager.ConstData:GetDataByID("FightThroneKilledIDS22").StringValue local FightThroneKilledIDS23 = DataSheetManager.ConstData:GetDataByID("FightThroneKilledIDS23").StringValue --local FightThroneKilledIDS31 = DataSheetManager.ConstData:GetDataByID("FightThroneKilledIDS31").StringValue local FightThroneKilledIDS32 = DataSheetManager.ConstData:GetDataByID("FightThroneKilledIDS32").StringValue local FightThroneKilledIDS33 = DataSheetManager.ConstData:GetDataByID("FightThroneKilledIDS33").StringValue --local FightThroneKilledIDS41 = DataSheetManager.ConstData:GetDataByID("FightThroneKilledIDS41").StringValue --2022年7月7日 策划改需求了,杀死没有令旗的人,不再弹tips了 local FightThroneKilledIDS42 = DataSheetManager.ConstData:GetDataByID("FightThroneKilledIDS42").StringValue local FightThroneKilledIDS43 = DataSheetManager.ConstData:GetDataByID("FightThroneKilledIDS43").StringValue function ExpFightThroneBaseLevelFunction:OnSwitchHero(fromEntity, toEntity) Base.OnSwitchHero(self, fromEntity, toEntity) if LevelManager.GetCurLevelType() ~= LuaConst.LevelType.FightThroneThirdFloor then toEntity.ExpEntity:SetModelUIFightThroneFlag(self.levelFunction:GetFlagAmountOfPlayer(toEntity:GetPlayerID()) > 0) toEntity.ExpEntity:SetModelUIFightThronePiece(self.levelFunction:GetCollectAmountOfPlayerByCollectKey(toEntity:GetPlayerID(), JADE_SHARD_KEY)) end end function ExpFightThroneBaseLevelFunction:OnPlayerFlagAmountChange(entity, delta, curValue, eventEntityType) entity.ExpEntity:SetModelUIFightThroneFlag(curValue > 0) end function ExpFightThroneBaseLevelFunction:OnPlayerCollectAmountChange(entity, collectType, delta, reasonType, curAmount) EventSystem.Dispatch(EventID.FightThrone_CollectAmountChange, entity, collectType, delta) if LevelManager.GetCurLevelType() ~= LuaConst.LevelType.FightThroneThirdFloor then if entity then if collectType == JADE_SHARD_KEY then entity.ExpEntity:SetModelUIFightThronePiece(curAmount) end --else --正常情况 有时候没有entity,也会改变采集物数量 end end end function ExpFightThroneBaseLevelFunction:OnHeroDead(entity) repeat local killer = entity.components.record.KillerEntity if not killer then break end if not killer:IsHero() then break end local deadPlayerInfo = LevelPlayerManager.GetPlayerInfoByPlayerIDInRoom(entity:GetPlayerID()) if not deadPlayerInfo then break end local killerPlayerInfo = LevelPlayerManager.GetPlayerInfoByPlayerIDInRoom(killer:GetPlayerID()) if not killerPlayerInfo then break end local deadFlagCount = self.levelFunction:GetFlagAmountOfPlayer(entity:GetPlayerID()) local killerFlagCount = self.levelFunction:GetFlagAmountOfPlayer(killer:GetPlayerID()) if entity:HasGuild() and killer:HasGuild() then --双方都有势力 if deadFlagCount == 0 then --2022年7月7日 策划改需求了,杀死没有令旗的人,不再弹tips了 --EventSystem.Dispatch(EventID.UI_MainShowTips, string.format(UIUtils.GetLocalizedTxt(Const_IDS[FightThroneKilledIDS11]), killerPlayerInfo.guildName, killerPlayerInfo.name, deadPlayerInfo.guildName, deadPlayerInfo.name)) else local killerFlagCount = self.levelFunction:GetFlagAmountOfPlayer(killer:GetPlayerID()) if killerFlagCount == 0 then EventSystem.Dispatch(EventID.UI_MainShowTips, string.format(UIUtils.GetLocalizedTxt(Const_IDS[FightThroneKilledIDS12]), killerPlayerInfo.guildName, killerPlayerInfo.name, deadPlayerInfo.guildName, deadPlayerInfo.name), 5) else EventSystem.Dispatch(EventID.UI_MainShowTips, string.format(UIUtils.GetLocalizedTxt(Const_IDS[FightThroneKilledIDS13]), killerPlayerInfo.guildName, killerPlayerInfo.name, deadPlayerInfo.guildName, deadPlayerInfo.name), 5) end end elseif not killer:HasGuild() and entity:HasGuild() then --杀人者没势力,被杀者有势力 if deadFlagCount == 0 then --2022年7月7日 策划改需求了,杀死没有令旗的人,不再弹tips了 --EventSystem.Dispatch(EventID.UI_MainShowTips, string.format(UIUtils.GetLocalizedTxt(Const_IDS[FightThroneKilledIDS21]), killerPlayerInfo.name, deadPlayerInfo.guildName, deadPlayerInfo.name)) else local killerFlagCount = self.levelFunction:GetFlagAmountOfPlayer(killer:GetPlayerID()) if killerFlagCount == 0 then EventSystem.Dispatch(EventID.UI_MainShowTips, string.format(UIUtils.GetLocalizedTxt(Const_IDS[FightThroneKilledIDS22]), killerPlayerInfo.name, deadPlayerInfo.guildName, deadPlayerInfo.name), 5) else EventSystem.Dispatch(EventID.UI_MainShowTips, string.format(UIUtils.GetLocalizedTxt(Const_IDS[FightThroneKilledIDS23]), killerPlayerInfo.name, deadPlayerInfo.guildName, deadPlayerInfo.name), 5) end end elseif not entity:HasGuild() and killer:HasGuild() then --杀人者有势力,被杀者没势力 if deadFlagCount == 0 then --2022年7月7日 策划改需求了,杀死没有令旗的人,不再弹tips了 --EventSystem.Dispatch(EventID.UI_MainShowTips, string.format(UIUtils.GetLocalizedTxt(Const_IDS[FightThroneKilledIDS31]), killerPlayerInfo.guildName, killerPlayerInfo.name, deadPlayerInfo.name)) else local killerFlagCount = self.levelFunction:GetFlagAmountOfPlayer(killer:GetPlayerID()) if killerFlagCount == 0 then EventSystem.Dispatch(EventID.UI_MainShowTips, string.format(UIUtils.GetLocalizedTxt(Const_IDS[FightThroneKilledIDS32]), killerPlayerInfo.guildName, killerPlayerInfo.name, deadPlayerInfo.name), 5) else EventSystem.Dispatch(EventID.UI_MainShowTips, string.format(UIUtils.GetLocalizedTxt(Const_IDS[FightThroneKilledIDS33]), killerPlayerInfo.guildName, killerPlayerInfo.name, deadPlayerInfo.name), 5) end end else --双方都没有势力 if deadFlagCount == 0 then --2022年7月7日 策划改需求了,杀死没有令旗的人,不再弹tips了 --EventSystem.Dispatch(EventID.UI_MainShowTips, string.format(UIUtils.GetLocalizedTxt(Const_IDS[FightThroneKilledIDS41]), killerPlayerInfo.name, deadPlayerInfo.name)) else local killerFlagCount = self.levelFunction:GetFlagAmountOfPlayer(killer:GetPlayerID()) if killerFlagCount == 0 then EventSystem.Dispatch(EventID.UI_MainShowTips, string.format(UIUtils.GetLocalizedTxt(Const_IDS[FightThroneKilledIDS42]), killerPlayerInfo.name, deadPlayerInfo.name), 5) else EventSystem.Dispatch(EventID.UI_MainShowTips, string.format(UIUtils.GetLocalizedTxt(Const_IDS[FightThroneKilledIDS43]), killerPlayerInfo.name, deadPlayerInfo.name), 5) end end end until true end return ExpFightThroneBaseLevelFunction