local Base = require("Battle/Logic/Level/LevelFunction/GoldHeroBaseLevelFunction") local GoldHeroCooperateLevelFunction = class("GoldHeroCooperateLevelFunction",Base) function GoldHeroCooperateLevelFunction:GetExpClass() return require "Battle/Expression/ExpLevel/ExpLevelFunction/ExpGoldHeroCooperateLevelFunction" end function GoldHeroCooperateLevelFunction:InitLevel() Base.InitLevel(self) self.dmgToBoss = FP.newV1(0) self:InitAttribute() end function GoldHeroCooperateLevelFunction:InitAttribute() local FormulaCalculator = require"Battle/Logic/Missile/FormulaCalculator" self.standardPlayerAttrDic = FormulaCalculator.CalculateStandardPlayerAttribute(LevelManager.GetServerGs()) end function GoldHeroCooperateLevelFunction:GetSubjugateDataPVE() local data = {} local Segments_Table = {} data.Segments_Table = Segments_Table local count = 5 --写死5个,因为表就配了5个 for i=1,count do local segment = {} segment.PowerPoint = FP.tonumberV1(DataSheetManager.ConstData:GetDataByID("SubjugateDataSpecialHero_PowerPointRate_" .. i).FloatValue) * LevelManager.GetServerGs() segment.PVE_UpperLimit = FP.tonumberV1(DataSheetManager.ConstData:GetDataByID("SubjugateDataSpecialHero_PVE_UpperLimit_" .. i).FloatValue) segment.PVE_LowerLimit = FP.tonumberV1(DataSheetManager.ConstData:GetDataByID("SubjugateDataSpecialHero_PVE_LowerLimit_" .. i).FloatValue) segment.EVP_UpperLimit = FP.tonumberV1(DataSheetManager.ConstData:GetDataByID("SubjugateDataSpecialHero_EVP_UpperLimit_" .. i).FloatValue) segment.EVP_LowerLimit = FP.tonumberV1(DataSheetManager.ConstData:GetDataByID("SubjugateDataSpecialHero_EVP_LowerLimit_" .. i).FloatValue) segment.SubjugateColor = DataSheetManager.ConstData:GetDataByID("SubjugateDataSpecialHero_SubjugateColor_" .. i).IntValue segment.IsPowerNotEnough = DataSheetManager.ConstData:GetDataByID("SubjugateDataSpecialHero_IsPowerNotEnough_" .. i).BoolValue table.insert(Segments_Table, segment) end return data end function GoldHeroCooperateLevelFunction:OnCreatePlayer() Base.OnCreatePlayer(self) if LevelPlayerManager.GetPlayerSetting(LevelPlayerManager.MyPlayerIDInRoom, LuaConst.BattleSettingEnum.AutoFightGoldHeroCooperate) then self:StartAutoFight(LogicUpdateManager._curEntity)--主视角safe 单机模式 end end function GoldHeroCooperateLevelFunction:OnUpdate() Base.OnUpdate(self) if LogicUpdateManager._clientHandleFrame == self.callBaseSucceedFrame then Base.OnLevelSucceed(self, self.callBaseSucceedWithShow) end end function GoldHeroCooperateLevelFunction:OnLevelSucceed(withShow) self.callBaseSucceedFrame = LogicUpdateManager._clientHandleFrame + 20 --这里不延迟,处理不了一个动画的问题,因为现在配了是全部英雄死亡就胜利,此时会播一个受击动画 self.callBaseSucceedWithShow = withShow end function GoldHeroCooperateLevelFunction:OnHpChange(entity, caster, delta, op, realDelta) --协同讨伐要求统计realDelta if realDelta < FP.Const.Zero and caster then local originEntity = caster:GetOriginEntity() if entity:IsBoss() and originEntity:IsHero() then self.dmgToBoss:Add(-realDelta) end end end return GoldHeroCooperateLevelFunction