public void SendTargetsToServer(CollectTargetsInRadius evt, ExplosiveMassEffectNode effect, SelfTankNode tank) { SelfHitEvent eventInstance = new SelfHitEvent { Targets = new List <HitTarget>() }; foreach (Entity entity in evt.Targets) { Entity tankIncarnation = entity.SendEvent <GetTankIncarnationEvent>(new GetTankIncarnationEvent()).TankIncarnation; if (tankIncarnation != null) { HitTarget item = new HitTarget { Entity = entity, LocalHitPoint = Vector3.zero, HitDirection = Vector3.zero, HitDistance = 0f, IncarnationEntity = tankIncarnation, TargetPosition = Vector3.zero }; eventInstance.Targets.Add(item); } } base.ScheduleEvent <SynchronizeSelfTankPositionBeforeEffectEvent>(tank); base.ScheduleEvent(eventInstance, effect); }
public void SendEmpTargetsToServer(CollectTargetsInRadius evt, EMPEffectNode emp, SelfTankNode tank) { ApplyTargetsForEMPEffectEvent eventInstance = new ApplyTargetsForEMPEffectEvent { Targets = evt.Targets.ToArray() }; base.ScheduleEvent <SynchronizeSelfTankPositionBeforeEffectEvent>(tank); base.ScheduleEvent(eventInstance, emp); }
public void CollectTargetsForEMPEffectInNonTeamBattle(NodeAddedEvent e, EMPEffectNode emp, [JoinByTank] SelfTankNonTeamNode selfTank, [JoinByBattle] NonTeamBattleNode battle, [JoinByBattle] ICollection <RemoteTankNode> otherTanks) { CollectTargetsInRadius eventInstance = new CollectTargetsInRadius { Radius = emp.empEffect.Radius }; Node[] nodes = new Node[] { emp, selfTank, battle }; base.NewEvent(eventInstance).AttachAll(nodes).Schedule(); }
public void CollectTargetsInNonTeamBattle(NodeAddedEvent e, ExplosiveMassEffectNode effect, [JoinByTank] SelfTankNonTeamNode selfTank, [JoinByBattle] NonTeamBattleNode battle, [JoinByBattle] ICollection <RemoteTankNode> otherTanks) { CollectTargetsInRadius eventInstance = new CollectTargetsInRadius { Radius = effect.explosiveMassEffect.Radius }; Node[] nodes = new Node[] { effect, selfTank, battle }; base.NewEvent(eventInstance).AttachAll(nodes).ScheduleDelayed(((float)effect.explosiveMassEffect.Delay) / 1000f); }
public void CollectTargetsForEMPEffectInTeamBattle(NodeAddedEvent e, EMPEffectNode emp, [JoinByTank] SelfTankTeamNode selfTank, [JoinByTeam] TeamNode selfTeam, [JoinByBattle] TeamBattleNode battle, [JoinByBattle, Combine] TeamNode team) { if (!team.Entity.Equals(selfTeam.Entity)) { CollectTargetsInRadius eventInstance = new CollectTargetsInRadius { Radius = emp.empEffect.Radius }; Node[] nodes = new Node[] { emp, selfTank, battle, team }; base.NewEvent(eventInstance).AttachAll(nodes).Schedule(); } }
public void CollectTargetsInTeamBattle(NodeAddedEvent e, ExplosiveMassEffectNode effect, [JoinByTank] SelfTankTeamNode selfTank, [JoinByTeam] TeamNode selfTeam, [JoinByBattle] TeamBattleNode battle, [JoinByBattle, Combine] TeamNode team) { if (!team.Entity.Equals(selfTeam.Entity)) { CollectTargetsInRadius eventInstance = new CollectTargetsInRadius { Radius = effect.explosiveMassEffect.Radius }; Node[] nodes = new Node[] { effect, selfTank, battle, team }; base.NewEvent(eventInstance).AttachAll(nodes).ScheduleDelayed(((float)effect.explosiveMassEffect.Delay) / 1000f); } }
private void CollectTargetsForEMP(CollectTargetsInRadius e, TankNode tank, IEnumerable <RemoteTankNode> otherTanks) { Vector3 position = tank.rigidbody.Rigidbody.position; e.Targets = new List <Entity>(); foreach (RemoteTankNode node in otherTanks) { Vector3 targetPosition = node.rigidbody.Rigidbody.position; Collider boundsCollider = node.tankColliders.BoundsCollider; SkinnedMeshRenderer renderer = node.baseRenderer.Renderer as SkinnedMeshRenderer; if ((renderer != null) && this.CheckBodyInRadius(position, e.Radius, targetPosition, boundsCollider, renderer.localBounds.extents.y)) { e.Targets.Add(node.Entity); } } }
public void CollectTargetsForEMPEffectInTeamBattle(CollectTargetsInRadius e, EffectNode any, SelfTankTeamNode selfTank, TeamBattleNode battle, TeamNode team, [JoinByTeam] ICollection <RemoteTankNode> otherTanks) { this.CollectTargetsForEMP(e, selfTank, otherTanks); }