--副将相关 local AdjutantComponent = class("AdjutantComponent") function AdjutantComponent:initialize(entity) self.entity = entity --副将技的当前CD self.AdjutantCD = -1 --副将技的总cd时长 ms self.TotalCD = nil --副将 self.AdjutantEntity = nil --释放副将时,如果有摇杆是否严格按照摇杆释放,而不是自动索敌 self.lockAttackDir = false self.curHasSkillJoy = false -- 当前释放的副将技能是否有双摇杆输入(释放副将技时一定是重新设置这个值的) end function AdjutantComponent:SetAdjutantEntity(adjutantEntity) self.AdjutantEntity = adjutantEntity if self.AdjutantEntity then local skillData = self.AdjutantEntity.components.skillBase:GetSkillDataBySkillIndex(2) if skillData then self.AdjutantSkillCastRadiusSqr = skillData.CastRadius * skillData.CastRadius else self.AdjutantSkillCastRadiusSqr = nil end else self.AdjutantSkillCastRadiusSqr = nil end self.lockAttackDir = LevelPlayerManager.GetPlayerSetting(self.entity:GetPlayerID() ,LuaConst.BattleSettingEnum.AdjutantLockAttackDir) end --会返回副将的原始heroId(比如张角副将,会返回6而不是1000) function AdjutantComponent:GetAdjutantCharacterID() local id = self.AdjutantEntity:GetCharacterID() if self.AdjutantEntity then for k,v in DataSheetManager.HeroData:GetEnumerator() do if v.FuJiangRelate == id then return v.ID end end return id end end function AdjutantComponent:SetCurHasSkillJoy(val) self.curHasSkillJoy = val end function AdjutantComponent:GetNeedSearchTarget() return not (self.curHasSkillJoy and self.lockAttackDir) end return AdjutantComponent