Beispiel #1
0
        public Pax4ActorEnemyMonsterIce(String p_name, Pax4Object p_parent0, int p_modelIndex)
            : base(p_name, p_parent0)
        {
            SetScale(_scaleFactor * Vector3.One);

            _actorElementType = EActorType._ICE;

            SetModel("Model/lavaandiceEnemyIce" + p_modelIndex);

            float scaleFactor = 0.2f;

            _particleEffectAura = new Pax4ParticleEffectPart("_particleEffectAura", this);
            _particleEffectAura.Ini(((Pax4ParticleEffectLavaAndIce)Pax4ParticleEffect._current)._particleEffectIceMonsterShield);
            _particleEffectAura.SetScale(Vector3.One * scaleFactor);

            _particleEffectAura1 = new Pax4ParticleEffectPart("_particleEffectAura1", this);
            _particleEffectAura1.Ini(((Pax4ParticleEffectLavaAndIce)Pax4ParticleEffect._current)._particleEffectIceMonsterShield);
            _particleEffectAura1.SetScaleRotation(Vector3.One * scaleFactor, new Vector3(0.0f, (float)Math.PI / 2.0f, 0.0f));

            _particleEffectAura2 = new Pax4ParticleEffectPart("_particleEffectAura2", this);
            _particleEffectAura2.Ini(((Pax4ParticleEffectLavaAndIce)Pax4ParticleEffect._current)._particleEffectIceMonsterShield);
            _particleEffectAura2.SetScaleRotation(Vector3.One * scaleFactor, new Vector3((float)Math.PI / 2.0f, (float)Math.PI / 2.0f, 0.0f));

            _particleEffectExplosion = new Pax4ParticleEffectPart("_particleEffectExplosion", this);
            _particleEffectExplosion.Ini(((Pax4ParticleEffectLavaAndIce)Pax4ParticleEffect._current)._particleEffectIceExplosion);

            _current = this;
        }
Beispiel #2
0
        public override void Dx()
        {
            base.Dx();

            if (this == _current)
            {
                _current = null;
            }
        }
Beispiel #3
0
        public void PopulateWithActors(List <Pax4ObjectPhysicsPart> p_result            = null,
                                       EPopulateWithActorsType p_populateWithActorsType = EPopulateWithActorsType._HETEROGENEOUS,
                                       bool p_lava = true,
                                       Pax4WayPointPathList p_wayPointPaths = null,
                                       float p_velocityFactor = 1.0f)
        {
            List <Pax4WayPointPath> wayPointPathList = null;

            if (p_wayPointPaths != null)
            {
                wayPointPathList = p_wayPointPaths._wayPointPath;
            }
            else
            {
                wayPointPathList = _wayPointPath;
            }

            if (wayPointPathList.Count <= 0)
            {
                return;
            }

            if (p_result != null)
            {
                p_result.Clear();
            }

            Pax4WayPointPath wayPointPath = null;
            Pax4Actor        actor        = null;

            int half       = wayPointPathList.Count / 2;
            int halfLength = half;

            for (int wi = 0; wi < wayPointPathList.Count; wi++)
            {
                wayPointPath = wayPointPathList[wi];

                if (p_wayPointPaths == null)
                {
                    halfLength = wayPointPath._wayPoint.Length / 2;
                }

                if (wayPointPath._residentCount != 0) //this allows for multipe calls to PopulateWithActors for the glorious benefit of waves after wave after wave
                {
                    continue;
                }

                if (wayPointPath._locked)
                {
                    if (Pax4WorldLavaAndIce._missionType == ELavaAndIceMissionType._LAVA ||
                        Pax4WorldLavaAndIce._missionType == ELavaAndIceMissionType._LAVA_AND_ICE &&
                        Pax4ActorEnemyMonsterIce._current == null)
                    {
                        Pax4ActorEnemyMonsterIce monsterIce = new Pax4ActorEnemyMonsterIce(_iceIndex.ToString(), null, _iceIndex);
                        monsterIce.MoveTo(Vector3.Zero, wayPointPath._wayPoint[0]);
                        new Pax4WayPointControllerActor(monsterIce, _difficulty, wayPointPath);
                        monsterIce.Enable();
                        continue;
                    }
                    else if (Pax4WorldLavaAndIce._missionType == ELavaAndIceMissionType._ICE ||
                             Pax4WorldLavaAndIce._missionType == ELavaAndIceMissionType._LAVA_AND_ICE &&
                             Pax4ActorEnemyMonsterLava._current == null)
                    {
                        Pax4ActorEnemyMonsterLava monsterLava = new Pax4ActorEnemyMonsterLava(_lavaIndex.ToString(), null, _lavaIndex);
                        monsterLava.MoveTo(Vector3.Zero, wayPointPath._wayPoint[0]);
                        new Pax4WayPointControllerActor(monsterLava, _difficulty, wayPointPath);
                        monsterLava.Enable();
                        continue;
                    }
                }
                else
                {
                    switch (p_populateWithActorsType)
                    {
                    case EPopulateWithActorsType._HOMOGENEOUS:

                        if (wayPointPath._wayPoint.Length == 1)
                        {
                            if (p_lava)
                            {
                                actor = new Pax4ActorEnemyAmmoLava(_lavaIndex.ToString(), null, _lavaIndex);
                                actor.SetScale(Vector3.One * 1.8f);
                            }
                            else
                            {
                                actor = new Pax4ActorEnemyAmmoIce(_iceIndex.ToString(), null, _iceIndex);
                                actor.SetScale(Vector3.One * 1.8f);
                            }

                            if (wi % _powerUpRatio == 0)
                            {
                                actor.SetPowerUp(Pax4Actor.EActorPowerUp._DURABILITY);
                            }

                            actor.MoveTo(Vector3.Zero, wayPointPath._wayPoint[0]);

                            new Pax4WayPointControllerActor(actor, Pax4WorldLavaAndIce._difficulty * 3.0f * p_velocityFactor, wayPointPath, 0);
                            actor.Enable();
                            if (p_result != null)
                            {
                                p_result.Add(actor);
                            }
                        }
                        else
                        {
                            for (int i = 0; i < wayPointPath._wayPoint.Length; i++)
                            {
                                if (i % 3 != 0)
                                {
                                    continue;
                                }

                                if (p_lava)
                                {
                                    actor = new Pax4ActorEnemyAmmoLava(_lavaIndex.ToString(), null, _lavaIndex);
                                    actor.SetScale(Vector3.One * 1.8f);
                                }
                                else
                                {
                                    actor = new Pax4ActorEnemyAmmoIce(_iceIndex.ToString(), null, _iceIndex);
                                    actor.SetScale(Vector3.One * 1.8f);
                                }

                                actor.MoveTo(Vector3.Zero, wayPointPath._wayPoint[i]);

                                if (i % _powerUpRatio == 0)
                                {
                                    actor.SetPowerUp(Pax4Actor.EActorPowerUp._DURABILITY);
                                }

                                new Pax4WayPointControllerActor(actor, Pax4WorldLavaAndIce._difficulty * 3.0f * p_velocityFactor, wayPointPath, i);
                                actor.Enable();
                                if (p_result != null)
                                {
                                    p_result.Add(actor);
                                }
                            }
                        }

                        break;

                    case EPopulateWithActorsType._HETEROGENEOUS:

                        if (wayPointPath._wayPoint.Length == 1)
                        {
                            if (wi % 2 == 0)
                            {
                                actor = new Pax4ActorEnemyAmmoLava(_lavaIndex.ToString(), null, _lavaIndex);
                                actor.SetScale(Vector3.One * 1.8f);
                            }
                            else
                            {
                                actor = new Pax4ActorEnemyAmmoIce(_iceIndex.ToString(), null, _iceIndex);
                                actor.SetScale(Vector3.One * 1.8f);
                            }

                            if (wi % _powerUpRatio == 0)
                            {
                                actor.SetPowerUp(Pax4Actor.EActorPowerUp._DURABILITY);
                            }

                            actor.MoveTo(Vector3.Zero, wayPointPath._wayPoint[0]);

                            new Pax4WayPointControllerActor(actor, Pax4WorldLavaAndIce._difficulty * 3.0f * p_velocityFactor, wayPointPath, 0);
                            actor.Enable();
                            if (p_result != null)
                            {
                                p_result.Add(actor);
                            }
                        }
                        else
                        {
                            for (int i = 0; i < wayPointPath._wayPoint.Length; i++)
                            {
                                if (i % 3 != 0)
                                {
                                    continue;
                                }

                                if (i % 2 == 0)
                                {
                                    actor = new Pax4ActorEnemyAmmoLava(_lavaIndex.ToString(), null, _lavaIndex);
                                    actor.SetScale(Vector3.One * 1.8f);
                                }
                                else
                                {
                                    actor = new Pax4ActorEnemyAmmoIce(_iceIndex.ToString(), null, _iceIndex);
                                    actor.SetScale(Vector3.One * 1.8f);
                                }

                                actor.MoveTo(Vector3.Zero, wayPointPath._wayPoint[i]);

                                if (i % _powerUpRatio == 0)
                                {
                                    actor.SetPowerUp(Pax4Actor.EActorPowerUp._DURABILITY);
                                }

                                new Pax4WayPointControllerActor(actor, Pax4WorldLavaAndIce._difficulty * 3.0f * p_velocityFactor, wayPointPath, i);
                                actor.Enable();
                                if (p_result != null)
                                {
                                    p_result.Add(actor);
                                }
                            }
                        }

                        break;

                    case EPopulateWithActorsType._LAYERED:

                        if (wayPointPath._wayPoint.Length == 1)
                        {
                            if (wi < half)
                            {
                                if (p_lava)
                                {
                                    actor = new Pax4ActorEnemyAmmoLava(_lavaIndex.ToString(), null, _lavaIndex);
                                    actor.SetScale(Vector3.One * 1.8f);
                                }
                                else
                                {
                                    actor = new Pax4ActorEnemyAmmoIce(_iceIndex.ToString(), null, _iceIndex);
                                    actor.SetScale(Vector3.One * 1.8f);
                                }
                            }
                            else
                            {
                                if (p_lava)
                                {
                                    actor = new Pax4ActorEnemyAmmoLava(_lavaIndex.ToString(), null, _lavaIndex);
                                    actor.SetScale(Vector3.One * 1.8f);
                                }
                                else
                                {
                                    actor = new Pax4ActorEnemyAmmoIce(_iceIndex.ToString(), null, _iceIndex);
                                    actor.SetScale(Vector3.One * 1.8f);
                                }
                            }

                            if (wi % _powerUpRatio == 0)
                            {
                                actor.SetPowerUp(Pax4Actor.EActorPowerUp._DURABILITY);
                            }

                            actor.MoveTo(Vector3.Zero, wayPointPath._wayPoint[0]);

                            new Pax4WayPointControllerActor(actor, Pax4WorldLavaAndIce._difficulty * 3.0f * p_velocityFactor, wayPointPath, 0);
                            actor.Enable();
                            if (p_result != null)
                            {
                                p_result.Add(actor);
                            }
                        }
                        else
                        {
                            for (int i = 0; i < wayPointPath._wayPoint.Length; i++)
                            {
                                if (i % 3 != 0)
                                {
                                    continue;
                                }

                                if (i < halfLength)
                                {
                                    if (p_lava)
                                    {
                                        actor = new Pax4ActorEnemyAmmoLava(_lavaIndex.ToString(), null, _lavaIndex);
                                        actor.SetScale(Vector3.One * 1.8f);
                                    }
                                    else
                                    {
                                        actor = new Pax4ActorEnemyAmmoIce(_iceIndex.ToString(), null, _iceIndex);
                                        actor.SetScale(Vector3.One * 1.8f);
                                    }
                                }
                                else
                                {
                                    if (p_lava)
                                    {
                                        actor = new Pax4ActorEnemyAmmoLava(_lavaIndex.ToString(), null, _lavaIndex);
                                        actor.SetScale(Vector3.One * 1.8f);
                                    }
                                    else
                                    {
                                        actor = new Pax4ActorEnemyAmmoIce(_iceIndex.ToString(), null, _iceIndex);
                                        actor.SetScale(Vector3.One * 1.8f);
                                    }
                                }

                                actor.MoveTo(Vector3.Zero, wayPointPath._wayPoint[i]);

                                if (i % _powerUpRatio == 0)
                                {
                                    actor.SetPowerUp(Pax4Actor.EActorPowerUp._DURABILITY);
                                }

                                new Pax4WayPointControllerActor(actor, Pax4WorldLavaAndIce._difficulty * 3.0f * p_velocityFactor, wayPointPath, i);
                                actor.Enable();
                                if (p_result != null)
                                {
                                    p_result.Add(actor);
                                }
                            }
                        }

                        break;
                    }
                }
            }
        }