예제 #1
0
        public ComponentThruster(Ship ship, float arg_size, ThrusterTemplate arg_template) : base(ship, ship.template.component_thruster_pos, arg_size, arg_template)
        {

            template = arg_template;
            side_thrust = template.side_thrust * size;
            reverse_thrust = template.reverse_thrust * size;
            main_thrust = template.main_thrust * size;
            torque = template.torque * ship.template.mass_avg_radius * size; //template.torque * size;

            facade = new ThrusterFacade(this);

            // this needs to be dynamic
            sparkles = ArtManager.GetVentResource(template.sparkle_effects).New(0.5f);


            // I was copying particle_ports from the template, when there is no need to. Just take a pointer.
            //particle_ports = new List<ThrusterPort>();
            particle_ports = ship.template.thruster_ports;
            particle_vents = new List<ArtVent>();

            
            foreach (ThrusterPort port in ship.template.thruster_ports)
            {
                //particle_ports.Add( port.Copy() );
                ArtVent vent = ArtManager.GetVentResource(template.particle_effects).New(port.size);
                particle_vents.Add(vent);
            }
            
        }
        public static void GenerateAssets()
        {
            ThrusterTemplate template = new ThrusterTemplate();

            template.main_thrust = 1.0f;
            template.reverse_thrust = 0.3f;
            template.side_thrust = 0.3f;
            template.torque = 0.3f;
            template.particle_effects = "default_thruster";
            template.sparkle_effects = "default_sparkles";

            thruster_templates.Add("default", template);


            ArtVentResource vent = new ArtVentResource("particle");
            vent.temperature = 2000;
            vent.size_start = new Vector2(1.0f, 1.0f);
            vent.size_end = new Vector2(4.0f, 1.0f);
            vent.particle_life = 5f;
            vent.temp_halflife = 3f;
            vent.velocity_scatter = 0.1f;
            vent.velocity_ejection = 1f;
            vent.generation_frequency = 0.8f;
            vent.particle_count = 20;
            ArtManager.vents.Add("default_sparkles", vent);

            vent = new ArtVentResource("particle");
            vent.temperature = 2000;
            vent.size_start = new Vector2(1.0f, 1.0f);
            vent.size_end = new Vector2(4.0f, 1.0f);
            vent.particle_life = 0.4f;
            vent.temp_halflife = 0.25f;
            vent.velocity_scatter = 0.15f;
            vent.velocity_ejection = 1f;
            ArtManager.vents.Add("default_thruster", vent);





            template = new ThrusterTemplate();

            template.main_thrust = 1.2f;
            template.reverse_thrust = 0.4f;
            template.side_thrust = 0.4f;
            template.torque = 0.4f;
            template.particle_effects = "better_thruster";
            template.sparkle_effects = "default_sparkles";

            thruster_templates.Add("better", template);


            vent = new ArtVentResource("particle");
            vent.temperature = 5500;
            vent.size_start = new Vector2(1.0f, 1.0f);
            vent.size_end = new Vector2(4.0f, 1.0f);
            vent.particle_life = 0.55f;
            vent.temp_halflife = 0.3f;
            vent.velocity_scatter = 0.2f;
            vent.velocity_ejection = 1f;
            ArtManager.vents.Add("better_thruster", vent);



            template = new ThrusterTemplate();

            template.main_thrust = 0.6f;
            template.reverse_thrust = 0.15f;
            template.side_thrust = 0.15f;
            template.torque = 0.15f;
            template.particle_effects = "worse_thruster";
            template.sparkle_effects = "default_sparkles";

            thruster_templates.Add("worse", template);

            vent = new ArtVentResource("particle");
            vent.temperature = 1500;
            vent.size_start = new Vector2(1.0f, 1.0f);
            vent.size_end = new Vector2(4.0f, 1.0f);
            vent.particle_life = 0.45f;
            vent.temp_halflife = 0.2f;
            vent.velocity_scatter = 0.5f;
            vent.velocity_ejection = 1f;
            ArtManager.vents.Add("worse_thruster", vent);

        }