static void Initialize()
        {
            initialized = true;

            // this is the method call where the ships shape is set.
            InitShape();
            // This is the movement info of the ship.
            DefaultMovementInfo = new ShipMovementInfo(
                new Bounded <float>(TimeWarp.AngularAcceleration),             // Angular Acceleration in Radians per second per second
                new Bounded <float>(TimeWarp.ScaleTurning(1)),                 // Max Angular Velocity in Radians per second
                new Bounded <float>(TimeWarp.ScaleAcceleration(45, 0)),        //Linear Acceleration in a Distance unit per second per second
                new Bounded <float>(TimeWarp.ScaleVelocity(45)));              // Max Linear Velocity in a Distance unit per second
            DefaultState = new ShipState(
                new Bounded <float>(6),                                        // Ships Health
                new Bounded <float>(20),                                       //Ships Energy
                new Bounded <float>(0),                                        //Health Recharge Rate
                new Bounded <float>(TimeWarp.RechargeRateToPerSeconds(6, 1))); //Energy Recharge Rate

            // Sets the actions of the ship (the weapons)
            // If you changed the order the Primary would become the Secondary
            DefaultActions.Add(ArilouSkiffPrimary.Create());
            DefaultActions.Add(ArilouSkiffSecondary.Create());

            //The sounds related to the Controlable since Ship inherits from Controlable.
            //They are just the .oggs in the Sound directory without the file extension.
            //The first is the sounds played when it is created the seconde is when it dies.
            DefaultControlableSounds = new ControlableSounds(null, "ShipDies");
            //Ships sounds this is actaully a music so its teh file in the music directory without the file extension.
            //The music played when the ship wins.
            DefaultShipSounds = new ShipSounds("ArilouSkiffDitty");
        }
Пример #2
0
        static void Initialize()
        {
            initialized = true;

            InitShape();
            DefaultMovementInfo = new ShipMovementInfo(
                new Bounded <float>(TimeWarp.AngularAcceleration),
                new Bounded <float>(TimeWarp.ScaleTurning(1)),
                new Bounded <float>(TimeWarp.ScaleAcceleration(5, 0)),
                new Bounded <float>(TimeWarp.ScaleVelocity(35)));

            DefaultState = new ShipState(new Bounded <float>(16),
                                         new Bounded <float>(20),
                                         new Bounded <float>(0),
                                         new Bounded <float>(TimeWarp.RechargeRateToPerSeconds(6, 1)));

            DefaultActions.Add(OrzNemesisPrimary.Create());
            DefaultActions.Add(OrzNemesisSecondary.Create());
            DefaultActions.Add(OrzNemesisTernary.Create());

            DefaultSubShips    = new IShip[1];
            DefaultSubShips[0] = OrzTurret.Create(new PhysicsState(), new FactionInfo(0));


            DefaultControlableSounds = new ControlableSounds(null, "ShipDies");
            DefaultShipSounds        = new ShipSounds("OrzNemesisDitty");
        }
Пример #3
0
        private MySoundPair GetShipSound(ShipSounds sound)
        {
            if (m_shipCategory == ShipTypeEnum.Debris)
            {
                return(MySoundPair.Empty);
            }
            MySoundPair result;

            if (m_shipSoundDatabase.TryGetValue((int)m_shipCategory + (int)sound, out result))//sound for correct size
            {
                return(result);
            }
            else
            {
                int category = (int)m_shipCategory;
                while (category > (int)ShipTypeEnum.Tiny)//correct sound not found, try sounds for smaller ships
                {
                    category -= 100;
                    if (m_shipSoundDatabase.TryGetValue(category + (int)sound, out result))//sound for correct size
                    {
                        return(result);
                    }
                }
                category = (int)m_shipCategory;
                while (category < (int)ShipTypeEnum.Huge)//correct sound not found, try sounds for bigger ships
                {
                    category += 100;
                    if (m_shipSoundDatabase.TryGetValue(category + (int)sound, out result))//sound for correct size
                    {
                        return(result);
                    }
                }
            }
            return(MySoundPair.Empty);
        }
        static void Initialize()
        {
            initialized = true;

            InitShape();
            DefaultLifeTime     = new LifeSpan(TimeWarp.RangeToTime(400, 35));
            DefaultMovementInfo = new ShipMovementInfo(
                new Bounded <float>(TimeWarp.AngularAcceleration),
                new Bounded <float>(20),
                new Bounded <float>(1000),
                new Bounded <float>(TimeWarp.ScaleVelocity(35)));
            DefaultState = new ShipState(
                new Bounded <float>(1),
                new Bounded <float>(1),
                new Bounded <float>(0),
                new Bounded <float>(1));

            DefaultEffectCollection.Effects.Add(new MedKitEffect(new TargetingInfo(TargetingTypes.None, TargetingTypes.Ally | TargetingTypes.Ship, TargetingTypes.None), EffectTypes.None, new EffectSounds(null, "FighterGet", null), 1));

            DefaultEffectsWho = new TargetingInfo(TargetingTypes.None, TargetingTypes.Ally | TargetingTypes.Ship, TargetingTypes.None);

            DefaultActions.Add(EarthlingFighterPrimary.Create());

            DefaultControlableSounds = new ControlableSounds();
            DefaultShipSounds        = new ShipSounds();
        }
Пример #5
0
            static void Initialize()
            {
                initialized = true;

                InitShape();
                DefaultMovementInfo = new ShipMovementInfo(
                    new Bounded <float>(100),
                    new Bounded <float>(TimeWarp.ScaleTurning(13)),
                    new Bounded <float>(TimeWarp.ScaleAcceleration(10, 0)),
                    new Bounded <float>(TimeWarp.ScaleVelocity(50)));
                DefaultState = new ShipState(new Bounded <float>(20),
                                             new Bounded <float>(10),
                                             new Bounded <float>(0),
                                             new Bounded <float>(TimeWarp.RechargeRateToPerSeconds(6, 1)));

                DefaultActions.Add(MmrnmhrmXFormMissilePrimary.Create());

                NullTransformAction t = new NullTransformAction();

                t.AIInfo = new SpecificRangeActionAIInfo(
                    MmrnmhrmXFormSecondary.DefaultCost.ActivationCost,
                    0,
                    800);
                DefaultActions.Add(t);

                DefaultControlableSounds = new ControlableSounds(null, "ShipDies");
                DefaultShipSounds        = new ShipSounds("MmrnmhrmXFormDitty");
            }
Пример #6
0
 static void Initialize()
 {
     initialized = true;
     InitShape();
     DefaultMovementInfo = new ShipMovementInfo(
         new Bounded <float>(100),
         new Bounded <float>(TimeWarp.ScaleTurning(0.9f)),
         new Bounded <float>(8000),
         new Bounded <float>(TimeWarp.ScaleVelocity(60)));
     DefaultState = new ShipState(new Bounded <float>(20),
                                  new Bounded <float>(10),
                                  new Bounded <float>(0),
                                  new Bounded <float>(TimeWarp.RechargeRateToPerSeconds(8, -1), TimeWarp.RechargeRateToPerSeconds(8, -1), TimeWarp.RechargeRateToPerSeconds(8, -1), false));
     DefaultTargetingTypes = TargetingInfo.All;
     DefaultActions.Add(new NullAction());
     DefaultActions.Add(new NullAction());
     DefaultActions.Add(new NullAction());
     DefaultActions.Add(new NullTransformAction());
     DefaultActions[3].Costs        = new Costs(new ShipStateChange(0, 0, 0, 0), null, null);
     DefaultActions[3].ActionSounds = new ActionSounds();
     DefaultEffectCollection.Effects.Add(new ShipStateEffect(
                                             DefaultTargetingTypes,
                                             EffectTypes.None,
                                             new EffectSounds(),
                                             new ShipStateChange(-3, 0, 0, 0)));
     DefaultEffectCollection.AttachmentFlags = EffectAttachmentFlags.ClonedAttachment;
     DefaultControlableSounds = new ControlableSounds(null, "ShipDies");
     DefaultShipSounds        = new ShipSounds("AndrosynthGuardianDitty");
 }
Пример #7
0
        private void PlayShipSound(ShipEmitters emitter, ShipSounds sound, bool checkIfAlreadyPlaying = true, bool stopPrevious = true, bool useForce2D = true, bool useFadeOut = false)
        {
            MySoundPair soundPair = GetShipSound(sound);

            if (soundPair == MySoundPair.Empty)
            {
                return;
            }
            if (m_emitters[(int)emitter] != null)
            {
                if (checkIfAlreadyPlaying && m_emitters[(int)emitter].IsPlaying && m_emitters[(int)emitter].SoundPair == soundPair)
                {
                    return;
                }
                if (m_emitters[(int)emitter].IsPlaying && useFadeOut)
                {
                    var effect = MyAudio.Static.ApplyEffect(m_emitters[(int)emitter].Sound, MyStringHash.GetOrCompute("CrossFade"), new MyCueId[] { soundPair.SoundId }, 1500);
                    m_emitters[(int)emitter].Sound = effect.OutputSound;
                }
                else
                {
                    m_emitters[(int)emitter].PlaySound(soundPair, stopPrevious, force2D: useForce2D && m_shouldPlay2D);
                }
            }
        }
Пример #8
0
    void Awake()
    {
        GameEvents.GameEventManager.registerListener(this);
        anim       = GetComponent <Animator>();
        shipSounds = GetComponent <ShipSounds>();

        fireRate = fireRateProgress[fireRateLevel];   // The number of times the player can shoot in 1 second.
        damage   = damageProgress[damageLevel];       // The number of damage the player deals per shot.
    }
Пример #9
0
        static void Initialize()
        {
            initialized = true;

            InitShape();
            DefaultMovementInfo = new ShipMovementInfo(
                new Bounded <float>(100),
                new Bounded <float>(TimeWarp.ScaleTurning(3)),
                new Bounded <float>(TimeWarp.ScaleAcceleration(2, 1)),
                new Bounded <float>(TimeWarp.ScaleVelocity(20)));
            DefaultState = new ShipState(new Bounded <float>(14),
                                         new Bounded <float>(32),
                                         new Bounded <float>(0),
                                         new Bounded <float>(TimeWarp.RechargeRateToPerSeconds(50, 1)));
            DefaultActions.Add(OrzTurretPrimary.Create());

            DefaultControlableSounds = new ControlableSounds();
            DefaultShipSounds        = new ShipSounds();
        }
        static void Initialize()
        {
            initialized = true;

            InitShape();
            DefaultMovementInfo = new ShipMovementInfo(
                new Bounded <float>(0),
                new Bounded <float>(0),
                new Bounded <float>(0),
                new Bounded <float>(0));

            DefaultState = new ShipState(new Bounded <float>(10),
                                         new Bounded <float>(0),
                                         new Bounded <float>(0),
                                         new Bounded <float>(0));
            DefaultActions.Add(ChmmrSatellitePrimary.Create());
            DefaultControlableSounds = new ControlableSounds(null, "Boom45");
            DefaultShipSounds        = new ShipSounds();
        }
        static void Initialize()
        {
            initialized = true;

            InitShape();
            DefaultMovementInfo = new ShipMovementInfo(
                new Bounded <float>(TimeWarp.AngularAcceleration),
                new Bounded <float>(TimeWarp.ScaleTurning(4)),
                new Bounded <float>(TimeWarp.ScaleAcceleration(7, 3)),
                new Bounded <float>(TimeWarp.ScaleVelocity(18)));
            DefaultState = new ShipState(new Bounded <float>(8),
                                         new Bounded <float>(28),
                                         new Bounded <float>(0),
                                         new Bounded <float>(TimeWarp.RechargeRateToPerSeconds(6, 1)));
            DefaultActions.Add(ThraddashTorchPrimary.Create());
            DefaultActions.Add(ThraddashTorchSecondary.Create());

            DefaultControlableSounds = new ControlableSounds(null, "ShipDies");
            DefaultShipSounds        = new ShipSounds("ThraddashTorchDitty");
        }
        static void Initialize()
        {
            initialized = true;

            InitShape();
            DefaultMovementInfo = new ShipMovementInfo(
                new Bounded <float>(TimeWarp.AngularAcceleration),
                new Bounded <float>(TimeWarp.ScaleTurning(1)),
                new Bounded <float>(TimeWarp.ScaleAcceleration(6, 6)),
                new Bounded <float>(TimeWarp.ScaleVelocity(36)));
            DefaultState = new ShipState(new Bounded <float>(20),
                                         new Bounded <float>(0, 10, 20, false),
                                         new Bounded <float>(0),
                                         new Bounded <float>(0));
            DefaultActions.Add(UtwigJuggerPrimary.Create());
            DefaultActions.Add(UtwigJuggerSecondary.Create());

            DefaultControlableSounds = new ControlableSounds(null, "ShipDies");
            DefaultShipSounds        = new ShipSounds("UtwigJuggerDitty");
        }
Пример #13
0
            static void Initialize()
            {
                initialized = true;

                InitShape();
                DefaultMovementInfo = new ShipMovementInfo(
                    new Bounded <float>(TimeWarp.AngularAcceleration),
                    new Bounded <float>(TimeWarp.ScaleTurning(2)),
                    new Bounded <float>(TimeWarp.ScaleAcceleration(5, 1)),
                    new Bounded <float>(TimeWarp.ScaleVelocity(20)));

                DefaultState = new ShipState(new Bounded <float>(20),
                                             new Bounded <float>(10),
                                             new Bounded <float>(0),
                                             new Bounded <float>(TimeWarp.RechargeRateToPerSeconds(6, 2)));
                DefaultActions.Add(MmrnmhrmXFormLaserPrimary.Create());
                DefaultActions.Add(MmrnmhrmXFormSecondary.Create());
                DefaultControlableSounds = new ControlableSounds(null, "ShipDies");
                DefaultShipSounds        = new ShipSounds("MmrnmhrmXFormDitty");
            }
Пример #14
0
        static void Initialize()
        {
            initialized = true;

            InitShape();
            DefaultMovementInfo = new ShipMovementInfo(
                new Bounded <float>(TimeWarp.AngularAcceleration),
                new Bounded <float>(TimeWarp.ScaleTurning(6)),
                new Bounded <float>(TimeWarp.ScaleAcceleration(7, 4)),
                new Bounded <float>(TimeWarp.ScaleVelocity(21)));

            DefaultState = new ShipState(new Bounded <float>(20),
                                         new Bounded <float>(40),
                                         new Bounded <float>(0),
                                         new Bounded <float>(TimeWarp.RechargeRateToPerSeconds(8, 1)));
            DefaultActions.Add(VuxIntruderPrimary.Create());
            DefaultActions.Add(VuxIntruderSecondary.Create());

            DefaultControlableSounds = new ControlableSounds(null, "ShipDies");
            DefaultShipSounds        = new ShipSounds("VuxIntruderDitty");
        }
Пример #15
0
        static void Initialize()
        {
            initialized = true;

            InitShape();
            DefaultMovementInfo = new ShipMovementInfo(
                new Bounded <float>(TimeWarp.AngularAcceleration),
                new Bounded <float>(TimeWarp.ScaleTurning(0)),
                new Bounded <float>(TimeWarp.ScaleAcceleration(60, 0)),
                new Bounded <float>(TimeWarp.ScaleVelocity(60)));
            DefaultState = new ShipState(new Bounded <float>(12),
                                         new Bounded <float>(20),
                                         new Bounded <float>(0),
                                         new Bounded <float>(TimeWarp.RechargeRateToPerSeconds(0, 0)));

            DefaultActions.Add(SlylandroProbePrimary.Create());
            DefaultActions.Add(SlylandroProbeSecondary.Create());

            DefaultControlableSounds = new ControlableSounds(null, "ShipDies");
            DefaultShipSounds        = new ShipSounds("SlylandroProbeDitty");
        }
        static void Initialize()
        {
            initialized = true;

            InitShape();
            DefaultMovementInfo = new ShipMovementInfo(
                new Bounded <float>(TimeWarp.AngularAcceleration),
                new Bounded <float>(TimeWarp.ScaleTurning(1)),
                new Bounded <float>(TimeWarp.ScaleAcceleration(9, 1)),
                new Bounded <float>(TimeWarp.ScaleVelocity(36)));
            DefaultState = new ShipState(new Bounded <float>(0, 12, 42, false),
                                         new Bounded <float>(16),
                                         new Bounded <float>(0),
                                         new Bounded <float>(TimeWarp.RechargeRateToPerSeconds(6, 1)));

            DefaultActions.Add(SyreenPenetratorPrimary.Create());
            DefaultActions.Add(SyreenPenetratorSecondary.Create());

            DefaultControlableSounds = new ControlableSounds(null, "ShipDies");
            DefaultShipSounds        = new ShipSounds("SyreenPenetratorDitty");
        }
        static void Initialize()
        {
            initialized = true;

            InitShape();
            DefaultMovementInfo = new ShipMovementInfo(
                new Bounded <float>(TimeWarp.AngularAcceleration),
                new Bounded <float>(TimeWarp.ScaleTurning(4)),
                new Bounded <float>(TimeWarp.ScaleAcceleration(6, 6)),
                new Bounded <float>(TimeWarp.ScaleVelocity(30)));
            DefaultState = new ShipState(new Bounded <float>(42),
                                         new Bounded <float>(42),
                                         new Bounded <float>(0),
                                         new Bounded <float>(TimeWarp.RechargeRateToPerSeconds(4, 1)));

            DefaultActions.Add(KzerZaDreadnoughtPrimary.Create());
            DefaultActions.Add(KzerZaDreadnoughtSecondary.Create());

            DefaultControlableSounds = new ControlableSounds(null, "ShipDies");
            DefaultShipSounds        = new ShipSounds("KzerZaDreadnoughtDitty");
        }
        static void Initialize()
        {
            initialized = true;

            InitShape();
            DefaultMovementInfo = new ShipMovementInfo(
                new Bounded <float>(TimeWarp.AngularAcceleration),
                new Bounded <float>(TimeWarp.ScaleTurning(6)),
                new Bounded <float>(TimeWarp.ScaleAcceleration(3, 4)),
                new Bounded <float>(TimeWarp.ScaleVelocity(27)));
            DefaultState = new ShipState(new Bounded <float>(36),
                                         new Bounded <float>(30),
                                         new Bounded <float>(0),
                                         new Bounded <float>(TimeWarp.RechargeRateToPerSeconds(4, 1)));

            DefaultActions.Add(ChenjesuBroodhomePrimary.Create());
            DefaultActions.Add(ChenjesuBroodhomeSecondary.Create());

            DefaultControlableSounds = new ControlableSounds(null, "ShipDies");
            DefaultShipSounds        = new ShipSounds("ChenjesuBroodhomeDitty");
        }
Пример #19
0
        static void Initialize()
        {
            initialized = true;

            InitShape();
            DefaultMovementInfo = new ShipMovementInfo(
                new Bounded <float>(TimeWarp.AngularAcceleration),
                new Bounded <float>(TimeWarp.ScaleTurning(4)),
                new Bounded <float>(TimeWarp.ScaleAcceleration(6, 3)),
                new Bounded <float>(TimeWarp.ScaleVelocity(18)));
            DefaultState = new ShipState(new Bounded <float>(10),
                                         new Bounded <float>(30),
                                         new Bounded <float>(0),
                                         new Bounded <float>(0));//TimeWarp.RechargeRateToPerSeconds(150, 30)));
            DefaultRechargeDelay = new Bounded <float>(TimeWarp.RateToTime(150));
            DefaultActions.Add(UmgahDronePrimary.Create());
            DefaultActions.Add(UmgahDroneSecondary.Create());

            DefaultControlableSounds = new ControlableSounds(null, "ShipDies");
            DefaultShipSounds        = new ShipSounds("UmgahDroneDitty");
        }
Пример #20
0
        static void Initialize()
        {
            initialized = true;

            InitShape();
            DefaultMovementInfo = new ShipMovementInfo(
                new Bounded <float>(TimeWarp.AngularAcceleration),
                new Bounded <float>(TimeWarp.ScaleTurning(2)),
                new Bounded <float>(TimeWarp.ScaleAcceleration(5, 0)),
                new Bounded <float>(TimeWarp.ScaleVelocity(25)));
            DefaultState = new ShipState(new Bounded <float>(22),
                                         new Bounded <float>(16),
                                         new Bounded <float>(0),
                                         new Bounded <float>(TimeWarp.RechargeRateToPerSeconds(4, 4)));

            DefaultActions.Add(IlwrathAvengerPrimary.Create());
            DefaultActions.Add(IlwrathAvengerSecondary.Create());

            DefaultControlableSounds = new ControlableSounds(null, "ShipDies");
            DefaultShipSounds        = new ShipSounds("IlwrathAvengerDitty");
        }
Пример #21
0
        static void Initialize()
        {
            initialized = true;

            InitShape();
            DefaultMovementInfo = new ShipMovementInfo(
                new Bounded <float>(TimeWarp.AngularAcceleration),
                new Bounded <float>(TimeWarp.ScaleTurning(1)),
                new Bounded <float>(TimeWarp.ScaleAcceleration(5, 0)),
                new Bounded <float>(TimeWarp.ScaleVelocity(35)));
            DefaultState = new ShipState(
                new Bounded <float>(6),
                new Bounded <float>(4),
                new Bounded <float>(0),
                new Bounded <float>(TimeWarp.RechargeRateToPerSeconds(9, 1)));

            DefaultActions.Add(ShofixtiScoutPrimary.Create());
            DefaultActions.Add(ShofixtiScoutSecondary.Create());

            DefaultControlableSounds = new ControlableSounds(null, "ShipDies");
            DefaultShipSounds        = new ShipSounds("ShofixtiScoutDitty");
        }
Пример #22
0
        static void Initialize()
        {
            initialized = true;

            InitShape();
            DefaultMovementInfo = new ShipMovementInfo(
                new Bounded <float>(TimeWarp.AngularAcceleration),
                new Bounded <float>(TimeWarp.ScaleTurning(0)),
                new Bounded <float>(TimeWarp.ScaleAcceleration(16, 0)),
                new Bounded <float>(TimeWarp.ScaleVelocity(64)));
            DefaultState = new ShipState(new Bounded <float>(8),
                                         new Bounded <float>(12),
                                         new Bounded <float>(0),
                                         new Bounded <float>(TimeWarp.RechargeRateToPerSeconds(50, 1)));

            DefaultActions.Add(PkunkFuryPrimary.Create());
            DefaultActions.Add(PkunkFurySecondary.Create());

            DefaultControlableSounds = new ControlableSounds(null, "ShipDies");
            DefaultShipSounds        = new ShipSounds("PkunkFuryDitty");
            DefaultRespawnSound      = new MeleeSound("Hallelujah");
            DefaultRespawnChance     = .5f;
        }
        static void Initialize()
        {
            initialized = true;

            InitShape();

            DefaultMovementInfo = new ShipMovementInfo(
                new Bounded <float>(TimeWarp.AngularAcceleration),
                new Bounded <float>(TimeWarp.ScaleTurning(3)),
                new Bounded <float>(TimeWarp.ScaleAcceleration(7, 6)),
                new Bounded <float>(TimeWarp.ScaleVelocity(35)));
            DefaultState = new ShipState(
                new Bounded <float>(42),
                new Bounded <float>(42),
                new Bounded <float>(0),
                new Bounded <float>(TimeWarp.RechargeRateToPerSeconds(1, 1)));

            DefaultActions.Add(ChmmrAvatarPrimary.Create());
            DefaultActions.Add(ChmmrAvatarSecondary.Create());

            InitSubShips();
            DefaultControlableSounds = new ControlableSounds(null, "ShipDies");
            DefaultShipSounds        = new ShipSounds("ChmmrAvatarDitty");
        }
Пример #24
0
    void Awake()
    {
        GameEvents.GameEventManager.registerListener(this);
        anim = GetComponent<Animator>();
        shipSounds = GetComponent<ShipSounds>();

        fireRate = fireRateProgress[fireRateLevel]; // The number of times the player can shoot in 1 second.
        damage = damageProgress[damageLevel]; // The number of damage the player deals per shot.
    }
Пример #25
0
 // Use this for initialization
 void Start()
 {
     anim       = GetComponent <Animator>();
     shipSounds = GetComponent <ShipSounds>();
     health     = maxHealth;
 }
Пример #26
0
 // Use this for initialization
 void Start()
 {
     anim = GetComponent<Animator>();
     shipSounds = GetComponent<ShipSounds>();
     health = maxHealth;
 }