Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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();
        }
Esempio n. 3
0
 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 PlayEMPEffect(EMPEffectReadyEvent e, EMPEffectNode effect, [JoinByTank] TankNode tank, [JoinAll] SingleNode <MapInstanceComponent> map)
        {
            EMPWaveGraphicsBehaviour behaviour = Object.Instantiate <EMPWaveGraphicsBehaviour>(tank.empWaveGraphicsEffect.EMPWaveAsset, tank.tankVisualRoot.transform.position, tank.tankVisualRoot.transform.rotation, map.component.SceneRoot.transform);
            float          num2 = effect.empEffect.Radius * 2f;
            ParticleSystem waveParticleSystem = behaviour.WaveParticleSystem;

            ParticleSystem.SizeOverLifetimeModule sizeOverLifetime = waveParticleSystem.sizeOverLifetime;
            ParticleSystem.MinMaxCurve            size             = sizeOverLifetime.size;
            AnimationCurve curve = size.curve;
            Keyframe       key   = curve.keys[0];

            key.value = (num2 * 0.152f) / 50f;
            curve.MoveKey(0, key);
            size.curveMultiplier  = num2;
            sizeOverLifetime.size = size;
            AudioSource waveSound = behaviour.WaveSound;

            waveSound.transform.parent = null;
            waveSound.Play();
            waveParticleSystem.Play();
            Object.Destroy(behaviour.gameObject, waveParticleSystem.startLifetime + 0.5f);
            Object.Destroy(waveSound.gameObject, waveSound.clip.length + 0.5f);
        }