Exemplo n.º 1
0
        protected override void Init(MyObjectBuilder_DefinitionBase builder)
        {
            base.Init(builder);

            var thrustBuilder = builder as MyObjectBuilder_ThrustDefinition;

            MyDebug.AssertDebug(thrustBuilder != null, "Initializing thrust definition using wrong object builder.");

            ResourceSinkGroup       = MyStringHash.GetOrCompute(thrustBuilder.ResourceSinkGroup);
            FuelConverter           = thrustBuilder.FuelConverter;
            SlowdownFactor          = thrustBuilder.SlowdownFactor;
            ForceMagnitude          = thrustBuilder.ForceMagnitude;
            MaxPowerConsumption     = thrustBuilder.MaxPowerConsumption;
            MinPowerConsumption     = thrustBuilder.MinPowerConsumption;
            FlameDamageLengthScale  = thrustBuilder.FlameDamageLengthScale;
            FlameDamage             = thrustBuilder.FlameDamage;
            FlameLengthScale        = thrustBuilder.FlameLengthScale;
            FlameFullColor          = thrustBuilder.FlameFullColor;
            FlameIdleColor          = thrustBuilder.FlameIdleColor;
            FlamePointMaterial      = thrustBuilder.FlamePointMaterial;
            FlameLengthMaterial     = thrustBuilder.FlameLengthMaterial;
            FlameGlareMaterial      = thrustBuilder.FlameGlareMaterial;
            FlameVisibilityDistance = thrustBuilder.FlameVisibilityDistance;
            FlameGlareSize          = thrustBuilder.FlameGlareSize;
            FlameGlareQuerySize     = thrustBuilder.FlameGlareQuerySize;

            EffectivenessAtMinInfluence = thrustBuilder.EffectivenessAtMinInfluence;
            EffectivenessAtMaxInfluence = thrustBuilder.EffectivenessAtMaxInfluence;
        }
        protected override void Init(MyObjectBuilder_DefinitionBase builder)
        {
            base.Init(builder);

            var thrustBuilder = builder as MyObjectBuilder_ThrustDefinition;

            MyDebug.AssertDebug(thrustBuilder != null, "Initializing thrust definition using wrong object builder.");

            ResourceSinkGroup       = MyStringHash.GetOrCompute(thrustBuilder.ResourceSinkGroup);
            FuelConverter           = thrustBuilder.FuelConverter;
            SlowdownFactor          = thrustBuilder.SlowdownFactor;
            ForceMagnitude          = thrustBuilder.ForceMagnitude;
            ThrusterType            = MyStringHash.GetOrCompute(thrustBuilder.ThrusterType);
            MaxPowerConsumption     = thrustBuilder.MaxPowerConsumption;
            MinPowerConsumption     = thrustBuilder.MinPowerConsumption;
            FlameDamageLengthScale  = thrustBuilder.FlameDamageLengthScale;
            FlameDamage             = thrustBuilder.FlameDamage;
            FlameLengthScale        = thrustBuilder.FlameLengthScale;
            FlameFullColor          = thrustBuilder.FlameFullColor;
            FlameIdleColor          = thrustBuilder.FlameIdleColor;
            FlamePointMaterial      = thrustBuilder.FlamePointMaterial;
            FlameLengthMaterial     = thrustBuilder.FlameLengthMaterial;
            FlameGlareMaterial      = thrustBuilder.FlameGlareMaterial;
            FlameVisibilityDistance = thrustBuilder.FlameVisibilityDistance;
            FlameGlareSize          = thrustBuilder.FlameGlareSize;
            FlameGlareQuerySize     = thrustBuilder.FlameGlareQuerySize;

            MinPlanetaryInfluence       = thrustBuilder.MinPlanetaryInfluence;
            MaxPlanetaryInfluence       = thrustBuilder.MaxPlanetaryInfluence;
            EffectivenessAtMinInfluence = thrustBuilder.EffectivenessAtMinInfluence;
            EffectivenessAtMaxInfluence = thrustBuilder.EffectivenessAtMaxInfluence;
            NeedsAtmosphereForInfluence = thrustBuilder.NeedsAtmosphereForInfluence;
            ConsumptionFactorPerG       = thrustBuilder.ConsumptionFactorPerG;

            PropellerUse          = thrustBuilder.PropellerUsesPropellerSystem;
            PropellerEntity       = thrustBuilder.PropellerSubpartEntityName;
            PropellerFullSpeed    = thrustBuilder.PropellerRoundsPerSecondOnFullSpeed;
            PropellerIdleSpeed    = thrustBuilder.PropellerRoundsPerSecondOnIdleSpeed;
            PropellerAcceleration = thrustBuilder.PropellerAccelerationTime;
            PropellerDeceleration = thrustBuilder.PropellerDecelerationTime;
            PropellerMaxDistance  = thrustBuilder.PropellerMaxVisibleDistance;
        }
Exemplo n.º 3
0
        protected override void Init(MyObjectBuilder_DefinitionBase builder)
        {
            base.Init(builder);
            MyObjectBuilder_ThrustDefinition definition = builder as MyObjectBuilder_ThrustDefinition;

            this.ResourceSinkGroup               = MyStringHash.GetOrCompute(definition.ResourceSinkGroup);
            this.FuelConverter                   = definition.FuelConverter;
            this.SlowdownFactor                  = definition.SlowdownFactor;
            this.ForceMagnitude                  = definition.ForceMagnitude;
            this.ThrusterType                    = MyStringHash.GetOrCompute(definition.ThrusterType);
            this.MaxPowerConsumption             = definition.MaxPowerConsumption;
            this.MinPowerConsumption             = definition.MinPowerConsumption;
            this.FlameDamageLengthScale          = definition.FlameDamageLengthScale;
            this.FlameDamage                     = definition.FlameDamage;
            this.FlameLengthScale                = definition.FlameLengthScale;
            this.FlameFullColor                  = definition.FlameFullColor;
            this.FlameIdleColor                  = definition.FlameIdleColor;
            this.FlamePointMaterial              = definition.FlamePointMaterial;
            this.FlameLengthMaterial             = definition.FlameLengthMaterial;
            this.FlameFlare                      = definition.FlameFlare;
            this.FlameVisibilityDistance         = definition.FlameVisibilityDistance;
            this.FlameGlareQuerySize             = definition.FlameGlareQuerySize;
            this.MinPlanetaryInfluence           = definition.MinPlanetaryInfluence;
            this.MaxPlanetaryInfluence           = definition.MaxPlanetaryInfluence;
            this.EffectivenessAtMinInfluence     = definition.EffectivenessAtMinInfluence;
            this.EffectivenessAtMaxInfluence     = definition.EffectivenessAtMaxInfluence;
            this.NeedsAtmosphereForInfluence     = definition.NeedsAtmosphereForInfluence;
            this.ConsumptionFactorPerG           = definition.ConsumptionFactorPerG;
            this.PropellerUse                    = definition.PropellerUsesPropellerSystem;
            this.PropellerEntity                 = definition.PropellerSubpartEntityName;
            this.PropellerFullSpeed              = definition.PropellerRoundsPerSecondOnFullSpeed;
            this.PropellerIdleSpeed              = definition.PropellerRoundsPerSecondOnIdleSpeed;
            this.PropellerAcceleration           = definition.PropellerAccelerationTime;
            this.PropellerDeceleration           = definition.PropellerDecelerationTime;
            this.PropellerMaxDistance            = definition.PropellerMaxVisibleDistance;
            this.InvDiffMinMaxPlanetaryInfluence = 1f / (this.MaxPlanetaryInfluence - this.MinPlanetaryInfluence);
            if (!this.InvDiffMinMaxPlanetaryInfluence.IsValid())
            {
                this.InvDiffMinMaxPlanetaryInfluence = 0f;
            }
        }
Exemplo n.º 4
0
        protected override void Init(MyObjectBuilder_DefinitionBase builder)
        {
            base.Init(builder);

            var thrustBuilder = builder as MyObjectBuilder_ThrustDefinition;
            MyDebug.AssertDebug(thrustBuilder != null, "Initializing thrust definition using wrong object builder.");

	        ResourceSinkGroup = MyStringHash.GetOrCompute(thrustBuilder.ResourceSinkGroup);
            FuelConverter = thrustBuilder.FuelConverter;
			SlowdownFactor = thrustBuilder.SlowdownFactor;
            ForceMagnitude = thrustBuilder.ForceMagnitude;
            ThrusterType = MyStringHash.GetOrCompute(thrustBuilder.ThrusterType);
            MaxPowerConsumption = thrustBuilder.MaxPowerConsumption;
            MinPowerConsumption = thrustBuilder.MinPowerConsumption;
            FlameDamageLengthScale = thrustBuilder.FlameDamageLengthScale;
            FlameDamage = thrustBuilder.FlameDamage;
            FlameLengthScale = thrustBuilder.FlameLengthScale;
            FlameFullColor = thrustBuilder.FlameFullColor;
            FlameIdleColor = thrustBuilder.FlameIdleColor;
            FlamePointMaterial = thrustBuilder.FlamePointMaterial;
            FlameLengthMaterial = thrustBuilder.FlameLengthMaterial;
            FlameGlareMaterial = thrustBuilder.FlameGlareMaterial;
            FlameVisibilityDistance = thrustBuilder.FlameVisibilityDistance;
            FlameGlareSize = thrustBuilder.FlameGlareSize;
            FlameGlareQuerySize = thrustBuilder.FlameGlareQuerySize;

            MinPlanetaryInfluence = thrustBuilder.MinPlanetaryInfluence;
            MaxPlanetaryInfluence = thrustBuilder.MaxPlanetaryInfluence;
            EffectivenessAtMinInfluence = thrustBuilder.EffectivenessAtMinInfluence;
            EffectivenessAtMaxInfluence = thrustBuilder.EffectivenessAtMaxInfluence;
            NeedsAtmosphereForInfluence = thrustBuilder.NeedsAtmosphereForInfluence;
            ConsumptionFactorPerG = thrustBuilder.ConsumptionFactorPerG;

            PropellerUse = thrustBuilder.PropellerUsesPropellerSystem;
            PropellerEntity = thrustBuilder.PropellerSubpartEntityName;
            PropellerFullSpeed = thrustBuilder.PropellerRoundsPerSecondOnFullSpeed;
            PropellerIdleSpeed = thrustBuilder.PropellerRoundsPerSecondOnIdleSpeed;
            PropellerAcceleration = thrustBuilder.PropellerAccelerationTime;
            PropellerDeceleration = thrustBuilder.PropellerDecelerationTime;
            PropellerMaxDistance = thrustBuilder.PropellerMaxVisibleDistance;
        }
Exemplo n.º 5
0
 public virtual void Init(MyObjectBuilder_Character characterBuilder)
 {
     if (characterBuilder != null)
     {
         MyFuelConverterInfo fuelConverter;
         this.CurrentAutoEnableDelay = characterBuilder.AutoenableJetpackDelay;
         if (this.ThrustComp != null)
         {
             base.Character.Components.Remove <MyJetpackThrustComponent>();
         }
         MyObjectBuilder_ThrustDefinition thrustProperties = base.Character.Definition.Jetpack.ThrustProperties;
         this.FuelConverterDefinition = null;
         if (MyFakes.ENABLE_HYDROGEN_FUEL)
         {
             fuelConverter = base.Character.Definition.Jetpack.ThrustProperties.FuelConverter;
         }
         else
         {
             MyFuelConverterInfo info1 = new MyFuelConverterInfo();
             info1.Efficiency = 1f;
             fuelConverter    = info1;
         }
         this.FuelConverterDefinition = fuelConverter;
         MyDefinitionId defId = new MyDefinitionId();
         if (!this.FuelConverterDefinition.FuelId.IsNull())
         {
             defId = thrustProperties.FuelConverter.FuelId;
         }
         MyGasProperties definition = null;
         if (MyFakes.ENABLE_HYDROGEN_FUEL)
         {
             MyDefinitionManager.Static.TryGetDefinition <MyGasProperties>(defId, out definition);
         }
         MyGasProperties properties2 = definition;
         if (definition == null)
         {
             MyGasProperties local1      = definition;
             MyGasProperties properties1 = new MyGasProperties();
             properties1.Id            = MyResourceDistributorComponent.ElectricityId;
             properties1.EnergyDensity = 1f;
             properties2 = properties1;
         }
         this.FuelDefinition              = properties2;
         this.ForceMagnitude              = thrustProperties.ForceMagnitude;
         this.MinPowerConsumption         = thrustProperties.MinPowerConsumption;
         this.MaxPowerConsumption         = thrustProperties.MaxPowerConsumption;
         this.MinPlanetaryInfluence       = thrustProperties.MinPlanetaryInfluence;
         this.MaxPlanetaryInfluence       = thrustProperties.MaxPlanetaryInfluence;
         this.EffectivenessAtMinInfluence = thrustProperties.EffectivenessAtMinInfluence;
         this.EffectivenessAtMaxInfluence = thrustProperties.EffectivenessAtMaxInfluence;
         this.NeedsAtmosphereForInfluence = thrustProperties.NeedsAtmosphereForInfluence;
         this.ConsumptionFactorPerG       = thrustProperties.ConsumptionFactorPerG;
         MyEntityThrustComponent component = new MyJetpackThrustComponent();
         component.Init();
         base.Character.Components.Add <MyEntityThrustComponent>(component);
         this.ThrustComp.DampenersEnabled = characterBuilder.DampenersEnabled;
         foreach (Vector3I vectori in Base6Directions.IntDirections)
         {
             this.ThrustComp.Register(base.Character, vectori, null);
         }
         component.ResourceSink(base.Character).TemporaryConnectedEntity = base.Character;
         base.Character.SuitRechargeDistributor.AddSink(component.ResourceSink(base.Character));
         this.TurnOnJetpack(characterBuilder.JetpackEnabled, true, true);
     }
 }