private void PlayCommonAttackTargetEffect(ActorRoot actorRoot) { if (actorRoot != null) { Singleton <SkillIndicateSystem> .GetInstance().PlayCommonAttackTargetEffect(actorRoot); if (actorRoot.MatHurtEffect != null) { actorRoot.MatHurtEffect.PlayHighLitEffect(this.highLitColor); } } }
public void UpdateLerp(ActorRoot _parent) { if (!this.childActorRoot || !this.bUpdateWithParentLerpPosition) { return; } Vector3 b = (Vector3)this.translation; Vector3 position = _parent.myTransform.position + b; this.childActorRoot.handle.myTransform.position = position; this.childActorRoot.handle.myTransform.forward = _parent.myTransform.forward; }
public override void Born(ActorRoot owner) { base.Born(owner); this.actor.MovementComponent = this.actor.CreateLogicComponent <PlayerMovement>(this.actor); this.actor.MatHurtEffect = this.actor.CreateActorComponent <MaterialHurtEffect>(this.actor); this.actor.EffectControl = this.actor.CreateLogicComponent <EffectPlayComponent>(this.actor); this.actor.EquipComponent = this.actor.CreateLogicComponent <EquipComponent>(this.actor); this.actor.ShadowEffect = this.actor.CreateActorComponent <UpdateShadowPlane>(this.actor); VCollisionShape.InitActorCollision(this.actor); this.actor.DefaultAttackModeControl = this.actor.CreateLogicComponent <DefaultAttackMode>(this.actor); this.actor.LockTargetAttackModeControl = this.actor.CreateLogicComponent <LockTargetAttackMode>(this.actor); }
public override VInt3 SelectTargetDir(SkillSlot UseSlot) { ActorRoot root = Singleton <TargetSearcher> .GetInstance().GetLowestHpTarget(UseSlot.Actor.handle, UseSlot.SkillObj.cfgData.iMaxSearchDistance, TargetPriority.TargetPriority_Hero, UseSlot.SkillObj.cfgData.dwSkillTargetFilter, false, true); if (root != null) { VInt3 num = root.location - UseSlot.Actor.handle.location; num.y = 0; return(num.NormalizeTo(0x3e8)); } return(UseSlot.Actor.handle.forward); }
public override VInt3 SelectTargetDir(SkillSlot UseSlot) { ActorRoot lowestHpTarget = Singleton <TargetSearcher> .GetInstance().GetLowestHpTarget(UseSlot.Actor.get_handle(), UseSlot.SkillObj.GetMaxSearchDistance(UseSlot.GetSkillLevel()), TargetPriority.TargetPriority_Hero, UseSlot.SkillObj.cfgData.dwSkillTargetFilter, false, true); if (lowestHpTarget != null) { VInt3 vInt = lowestHpTarget.location - UseSlot.Actor.get_handle().location; vInt.y = 0; return(vInt.NormalizeTo(1000)); } return(UseSlot.Actor.get_handle().forward); }
private bool ShouldCare(ActorRoot src) { if ((src.ActorControl == null) || !(src.ActorControl is HeroWrapper)) { return(false); } if (this.targetCamp == 0) { return(src.TheActorMeta.ActorCamp == Singleton <GamePlayerCenter> .instance.hostPlayerCamp); } return(src.TheActorMeta.ActorCamp != Singleton <GamePlayerCenter> .instance.hostPlayerCamp); }
public override VInt3 SelectTargetDir(SkillSlot UseSlot) { ActorRoot target = SelectTargetHelper.GetTarget(UseSlot); if (target != null) { VInt3 num = target.location - UseSlot.Actor.handle.location; num.y = 0; return(num.NormalizeTo(0x3e8)); } return(UseSlot.Actor.handle.forward); }
public override VInt3 SelectTargetDir(SkillSlot UseSlot) { ActorRoot nextSkillTarget = this.GetNextSkillTarget(UseSlot); if (nextSkillTarget != null) { VInt3 vInt = nextSkillTarget.location - UseSlot.Actor.get_handle().location; vInt.y = 0; return(vInt.NormalizeTo(1000)); } return(UseSlot.Actor.get_handle().forward); }
public ActorRoot GetNearestEnemyWithoutNotInBattleJungleMonsterWithoutActor(ActorRoot InActor, int srchR, uint withOutActor) { if (InActor == null) { return(null); } ActorRoot root = null; ulong num = (ulong)(srchR * srchR); for (int i = 0; i < 3; i++) { if (i != InActor.TheActorMeta.ActorCamp) { List <PoolObjHandle <ActorRoot> > campActors = Singleton <GameObjMgr> .GetInstance().GetCampActors((COM_PLAYERCAMP)i); int count = campActors.Count; for (int j = 0; j < count; j++) { PoolObjHandle <ActorRoot> handle = campActors[j]; ActorRoot target = handle.handle; if (((target != null) && (target.ObjID != withOutActor)) && target.HorizonMarker.IsVisibleFor(InActor.TheActorMeta.ActorCamp)) { MonsterWrapper wrapper = target.AsMonster(); if (wrapper != null) { ResMonsterCfgInfo cfgInfo = wrapper.cfgInfo; if ((cfgInfo != null) && (cfgInfo.bMonsterType == 2)) { switch (target.ActorAgent.GetCurBehavior()) { case ObjBehaviMode.State_Idle: case ObjBehaviMode.State_Dead: case ObjBehaviMode.State_Null: { continue; } } } } VInt3 num6 = target.location - InActor.location; ulong num5 = (ulong)num6.sqrMagnitudeLong2D; if ((num5 < num) && InActor.CanAttack(target)) { root = target; num = num5; } } } } } return(root); }
public void SetUseSkillTarget() { ActorRoot actorRoot = null; Skill skill = (this.skillSlot.NextSkillObj != null) ? this.skillSlot.NextSkillObj : this.skillSlot.SkillObj; if (skill == null || skill.cfgData == null || skill.cfgData.bWheelType == 1 || skill.cfgData.bWheelType == 6) { return; } uint dwSkillTargetFilter = skill.cfgData.dwSkillTargetFilter; if (skill.cfgData.bRangeAppointType == 1) { if (!this.bUseAdvanceSelect && this.guidePrefab != null && this.guideSelectActive) { SkillSelectControl instance = Singleton <SkillSelectControl> .GetInstance(); actorRoot = instance.SelectTarget((SkillTargetRule)skill.cfgData.bSkillTargetRule, this.skillSlot); } else if (this.bUseAdvanceSelect && this.effectPrefab != null && this.effectSelectActive) { int srchR; if (this.skillSlot.SlotType != SkillSlotType.SLOT_SKILL_0) { srchR = skill.cfgData.iMaxAttackDistance; } else { srchR = skill.GetMaxSearchDistance(this.skillSlot.GetSkillLevel()); } uint num = 2u; num |= dwSkillTargetFilter; actorRoot = Singleton <SectorTargetSearcher> .GetInstance().GetEnemyTarget(this.skillSlot.Actor, srchR, this.useSkillDirection, 50f, num); if (actorRoot == null) { uint num2 = 1u; num2 |= dwSkillTargetFilter; actorRoot = Singleton <SectorTargetSearcher> .GetInstance().GetEnemyTarget(this.skillSlot.Actor, srchR, this.useSkillDirection, 50f, num2); } } if (actorRoot != this.targetActor) { this.StopCommonAttackTargetEffect(this.targetActor); if (this.skillSlot.Actor && actorRoot != null && actorRoot.ObjID != this.skillSlot.Actor.handle.ObjID) { this.PlayCommonAttackTargetEffect(actorRoot); } this.targetActor = actorRoot; } } }
private ActorRoot GetNextSkillTarget(SkillSlot UseSlot) { for (int i = 0; i < UseSlot.NextSkillTargetIDs.Count; i++) { ActorRoot actorRoot = Singleton <GameObjMgr> .GetInstance().GetActor(UseSlot.NextSkillTargetIDs[i]); if (actorRoot != null && ((ulong)UseSlot.SkillObj.cfgData.dwSkillTargetFilter & 1uL << (int)(actorRoot.TheActorMeta.ActorType & (ActorTypeDef)31)) <= 0uL && actorRoot.HorizonMarker.IsVisibleFor(UseSlot.Actor.handle.TheActorMeta.ActorCamp) && UseSlot.Actor.handle.CanAttack(actorRoot) && DistanceSearchCondition.Fit(actorRoot, UseSlot.Actor.handle, UseSlot.SkillObj.GetMaxSearchDistance(UseSlot.GetSkillLevel()))) { return(actorRoot); } } return(null); }
private bool FilterCoordActor(ref PoolObjHandle<ActorRoot> actorPtr) { ActorRoot handle = actorPtr.handle; if (((handle.shape != null) && handle.shape.Intersects(this.m_shape)) && this.ActorFilter(ref actorPtr)) { this._actorTestCache[this.m_collidedCnt++] = actorPtr; if (this.m_collidedCnt >= this.Capacity) { return false; } } return true; }
public ActorRoot GetNearestEnemy(ActorRoot InActor, int srchR, uint filter, bool bWithMonsterNotInBattle = true) { ActorRoot root = null; ulong num = (ulong)(srchR * srchR); for (int i = 0; i < 3; i++) { if (i != InActor.TheActorMeta.ActorCamp) { List <PoolObjHandle <ActorRoot> > campActors = Singleton <GameObjMgr> .GetInstance().GetCampActors((COM_PLAYERCAMP)i); int count = campActors.Count; for (int j = 0; j < count; j++) { PoolObjHandle <ActorRoot> handle = campActors[j]; ActorRoot target = handle.handle; if (((filter & (((int)1) << target.TheActorMeta.ActorType)) <= 0L) && target.HorizonMarker.IsVisibleFor(InActor.TheActorMeta.ActorCamp)) { if (!bWithMonsterNotInBattle) { MonsterWrapper actorControl = target.ActorControl as MonsterWrapper; if (actorControl != null) { ResMonsterCfgInfo cfgInfo = actorControl.cfgInfo; if ((cfgInfo != null) && (cfgInfo.bMonsterType == 2)) { switch (target.ActorAgent.GetCurBehavior()) { case ObjBehaviMode.State_Idle: case ObjBehaviMode.State_Dead: case ObjBehaviMode.State_Null: { continue; } } } } } VInt3 num6 = target.location - InActor.location; ulong num5 = (ulong)num6.sqrMagnitudeLong2D; if ((num5 < num) && InActor.CanAttack(target)) { root = target; num = num5; } } } } } return(root); }
public void UpdateLogic(int delta) { if (this._enabled && this._fighting) { uint num = Singleton <FrameSynchr> .get_instance().CurFrameNum % 8u; GameObjMgr instance = Singleton <GameObjMgr> .GetInstance(); List <PoolObjHandle <ActorRoot> > gameActors = instance.GameActors; int count = gameActors.get_Count(); for (int i = 0; i < count; i++) { if (gameActors.get_Item(i)) { ActorRoot handle = gameActors.get_Item(i).get_handle(); if (handle.ObjID % 8u == num && (!handle.ActorControl.IsDeadState || handle.TheStaticData.TheBaseAttribute.DeadControl)) { for (int j = 0; j < 3; j++) { if (j != handle.TheActorMeta.ActorCamp) { COM_PLAYERCAMP actorCamp = handle.TheActorMeta.ActorCamp; List <PoolObjHandle <ActorRoot> > campActors = instance.GetCampActors(j); int count2 = campActors.get_Count(); for (int k = 0; k < count2; k++) { if (campActors.get_Item(k)) { ActorRoot handle2 = campActors.get_Item(k).get_handle(); if (!handle2.HorizonMarker.IsSightVisited(actorCamp)) { long num2 = (long)Horizon.GlobalSightSqr_; if (handle.HorizonMarker.SightRadius != 0) { num2 = (long)handle.HorizonMarker.SightRadius; num2 *= num2; } if ((handle2.location - handle.location).get_sqrMagnitudeLong2D() < num2) { handle2.HorizonMarker.VisitSight(actorCamp); } } } } } } } } } } }
public ActorRoot GetUseSkillTargetDefaultAttackMode() { if (!this.bUseAdvanceSelect) { SkillSelectControl instance = Singleton <SkillSelectControl> .GetInstance(); Skill skill = (this.skillSlot.NextSkillObj != null) ? this.skillSlot.NextSkillObj : this.skillSlot.SkillObj; if (skill.cfgData.bWheelType != 1 && skill.cfgData.bWheelType != 6) { this.targetActor = instance.SelectTarget((SkillTargetRule)skill.cfgData.bSkillTargetRule, this.skillSlot); } } return(this.targetActor); }
public void UpdateLogic(int delta) { if (this._enabled && this._fighting) { uint num = Singleton <FrameSynchr> .instance.CurFrameNum % 8; List <PoolObjHandle <ActorRoot> > gameActors = Singleton <GameObjMgr> .GetInstance().GameActors; int count = gameActors.Count; for (int i = 0; i < count; i++) { PoolObjHandle <ActorRoot> handle = gameActors[i]; ActorRoot root = handle.handle; if (((root.ObjID % 8) == num) && !root.ActorControl.IsDeadState) { for (int j = 0; j < 3; j++) { if (j != root.TheActorMeta.ActorCamp) { COM_PLAYERCAMP actorCamp = root.TheActorMeta.ActorCamp; List <PoolObjHandle <ActorRoot> > campActors = Singleton <GameObjMgr> .GetInstance().GetCampActors((COM_PLAYERCAMP)j); int num5 = campActors.Count; for (int k = 0; k < num5; k++) { PoolObjHandle <ActorRoot> handle2 = campActors[k]; ActorRoot root2 = handle2.handle; if (!root2.HorizonMarker.IsSightVisited(actorCamp)) { long sightRadius; if (root.HorizonMarker.SightRadius != 0) { sightRadius = root.HorizonMarker.SightRadius; } else { sightRadius = _globalSight; } VInt3 num8 = root2.location - root.location; if (num8.sqrMagnitudeLong2D < (sightRadius * sightRadius)) { root2.HorizonMarker.VisitSight(actorCamp); } } } } } } } } }
private bool FilterCoordActor(ref PoolObjHandle <ActorRoot> actorPtr) { ActorRoot handle = actorPtr.handle; if ((!handle.ActorControl.IsDeadState && (handle.shape != null)) && (handle.shape.Intersects(this.m_shape) && this.ActorFilter(ref actorPtr))) { this._actorTestCache[this.m_collidedCnt++] = actorPtr; if (this.m_collidedCnt >= this.Capacity) { return(false); } } return(true); }
public void Searcher(ActorRoot _curActor, ActorRoot _inActor, DistanceDelegate _delegate) { ulong num = _delegate(_curActor.location, _inActor.location); if (num < this.maxValue) { this.targetList.Clear(); this.maxValue = num; this.targetList.Add(_inActor); } else if (num == this.maxValue) { this.targetList.Add(_inActor); } }
public void Searcher(ActorRoot _inActor, RES_FUNCEFT_TYPE _propertyType, PropertyDelegate _delegate) { ulong num = _delegate(_inActor, _propertyType); if (num < this.maxValue) { this.targetList.Clear(); this.maxValue = num; this.targetList.Add(_inActor); } else if (num == this.maxValue) { this.targetList.Add(_inActor); } }
public override void TriggerLeave(PoolObjHandle <ActorRoot> src, ITrigger inTrigger) { int leaveUniqueId = this.LeaveUniqueId; ActorRoot inSrc = src ? src.handle : null; ActorRoot inAtker = null; if (this.bEnable) { Singleton <TipProcessor> .GetInstance().PlayDrama(leaveUniqueId, inSrc, inAtker); } else { Singleton <TipProcessor> .GetInstance().EndDrama(leaveUniqueId); } }
public void SetUseSkillTarget(ActorRoot actorRoot) { if (actorRoot != this.targetActor) { if (this.targetActor != null) { this.StopCommonAttackTargetEffect(this.targetActor); } if (actorRoot != null) { this.PlayCommonAttackTargetEffect(actorRoot); } this.targetActor = actorRoot; } }
public void SetUseSkillTarget() { ActorRoot actorRoot = null; Skill skill = (this.skillSlot.NextSkillObj == null) ? this.skillSlot.SkillObj : this.skillSlot.NextSkillObj; if (((skill != null) && (skill.cfgData != null)) && (skill.cfgData.bWheelType != 1)) { uint dwSkillTargetFilter = skill.cfgData.dwSkillTargetFilter; if (skill.cfgData.dwRangeAppointType == 1) { if ((!this.bUseAdvanceSelect && (this.guidePrefab != null)) && this.guideSelectActive) { actorRoot = Singleton <SkillSelectControl> .GetInstance().SelectTarget((SkillTargetRule)skill.cfgData.dwSkillTargetRule, this.skillSlot); } else if ((this.bUseAdvanceSelect && (this.effectPrefab != null)) && this.effectSelectActive) { int srchR = 0; if (this.skillSlot.SlotType != SkillSlotType.SLOT_SKILL_0) { srchR = (int)skill.cfgData.iMaxAttackDistance; } else { srchR = skill.cfgData.iMaxSearchDistance; } uint filter = 2; filter |= dwSkillTargetFilter; actorRoot = Singleton <SectorTargetSearcher> .GetInstance().GetEnemyTarget((ActorRoot)this.skillSlot.Actor, srchR, this.useSkillDirection, 50f, filter); if (actorRoot == null) { uint num4 = 1; num4 |= dwSkillTargetFilter; actorRoot = Singleton <SectorTargetSearcher> .GetInstance().GetEnemyTarget((ActorRoot)this.skillSlot.Actor, srchR, this.useSkillDirection, 50f, num4); } } if (actorRoot != this.targetActor) { this.StopCommonAttackTargetEffect(this.targetActor); if (((this.skillSlot.Actor != 0) && (actorRoot != null)) && (actorRoot.ObjID != this.skillSlot.Actor.handle.ObjID)) { this.PlayCommonAttackTargetEffect(actorRoot); } this.targetActor = actorRoot; } } } }
public ActorRoot Searcher(List <ActorRoot> .Enumerator _etr, ActorRoot _mainActor) { ActorRoot result = null; while (_etr.MoveNext()) { ActorRoot current = _etr.get_Current(); ulong sqrMagnitudeLong2D = (ulong)(current.location - _mainActor.location).get_sqrMagnitudeLong2D(); if (sqrMagnitudeLong2D > this.minDisSqr) { result = current; this.minDisSqr = sqrMagnitudeLong2D; } } return(result); }
public static bool FitSoldier(ActorRoot _actor) { if (_actor.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster) { MonsterWrapper monsterWrapper = _actor.ActorControl as MonsterWrapper; if (monsterWrapper != null) { ResMonsterCfgInfo cfgInfo = monsterWrapper.cfgInfo; if (cfgInfo != null && cfgInfo.bMonsterType == 1) { return(true); } } } return(false); }
public static ulong GetPropertyHpRate(ActorRoot _inActor, RES_FUNCEFT_TYPE _type) { int num = _inActor.ValueComponent.actorHp * 100; int totalValue = _inActor.ValueComponent.mActorValue[_type].totalValue; if (totalValue != 0) { num /= totalValue; } else { object[] inParameters = new object[] { (_inActor.gameObject != null) ? _inActor.name : "null" }; DebugHelper.Assert(false, "Gameobj MaxHp = 0 Exception, ActorName:{0}", inParameters); } return((ulong)num); }
public ActorRoot Searcher(List<ActorRoot>.Enumerator _etr, ActorRoot _mainActor) { ActorRoot root = null; while (_etr.MoveNext()) { ActorRoot current = _etr.Current; VInt3 num2 = current.location - _mainActor.location; ulong num = (ulong) num2.sqrMagnitudeLong2D; if (num > this.minDisSqr) { root = current; this.minDisSqr = num; } } return root; }
public VInt3 SelectTargetPos(SkillTargetRule ruleType, SkillSlot slot, out bool bTarget) { SkillBaseSelectTarget target; bTarget = false; if (this.registedRule.TryGetValue((uint)ruleType, out target)) { ActorRoot root = target.SelectTarget(slot); if (root != null) { bTarget = true; return(root.location); } } return(slot.Actor.handle.location); }
public override void Born(ActorRoot owner) { base.Born(owner); int childCount = base.gameObject.transform.childCount; for (int i = 0; i < childCount; i++) { GameObject gameObject = base.gameObject.transform.GetChild(i).gameObject; if (gameObject.GetComponent <Animation>() != null) { base.actor.SetActorMesh(gameObject); base.actor.RecordOriginalActorMesh(); break; } } }
private void UpdateTeleportTargetList() { this.m_CanTeleportActorList.Clear(); CSkillButtonManager skillButtonManager = Singleton <CBattleSystem> .GetInstance().FightForm.m_skillButtonManager; SkillSlotType type; if (!skillButtonManager.HasMapSlectTargetSkill(out type)) { return; } SkillSlot skillSlot = null; Player hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer(); if (hostPlayer == null || !hostPlayer.Captain) { return; } if (!hostPlayer.Captain.get_handle().SkillControl.TryGetSkillSlot(type, out skillSlot)) { return; } if (!skillSlot.IsEnableSkillSlot()) { return; } List <PoolObjHandle <ActorRoot> > gameActors = Singleton <GameObjMgr> .get_instance().GameActors; int count = gameActors.get_Count(); for (int i = 0; i < count; i++) { PoolObjHandle <ActorRoot> poolObjHandle = gameActors.get_Item(i); if (poolObjHandle && !(poolObjHandle == hostPlayer.Captain)) { ActorRoot handle = poolObjHandle.get_handle(); if (!handle.ActorControl.IsDeadState && handle.IsHostCamp() && handle.InCamera) { uint dwSkillTargetFilter = skillSlot.SkillObj.cfgData.dwSkillTargetFilter; if (((ulong)dwSkillTargetFilter & (ulong)(1L << (int)(handle.TheActorMeta.ActorType & (ActorTypeDef)31))) <= 0uL) { this.m_CanTeleportActorList.Add(poolObjHandle); } } } } }
public void OnGet() { this.CanMovable = true; this.isStatic = false; this.CharInfo = null; this.ActorObj = null; this.ActorPtr.Release(); this.myRenderer = null; this.bNeedLerp = false; this.GroundSpeed = 0; this.nPreMoveSeq = -1; this.RepairFramesMin = 1; this.FrameBlockIndex = 0; this.CustomMoveLerp = null; this.ActorControl = null; this.ActorMovement = null; }