<commit_before>#include "all.h"
#include "game/resources/manager.h"
#include "game/resources/particle_effect.h"
#include "game/assets/particle_effect_id.h"
#include "augs/graphics/shader.h"

namespace resource_setups {
	void load_standard_particle_effects() {
		{
			auto& effect = get_resource_manager().create(assets::particle_effect_id::WANDERING_SMOKE);

			resources::emission em;
			em.min_swing_spread.set(0.5, 1);
			em.min_swings_per_sec.set(0.3/2, 0.5/2);
			em.max_swing_spread.set(10/2, 10/2);
			em.max_swings_per_sec.set(0.3/2, 0.5/2);

			em.swing_spread.set(0, 0);
			em.swings_per_sec.set(0.3/2, 0.5/2);
			em.swing_spread_change_rate.set(0.3/2, 0.5/2);

			em.spread_degrees = std::make_pair(7, 7);
			em.particles_per_sec = std::make_pair(40, 50);
			em.stream_duration_ms = std::make_pair(3000000, 3000000);
			
			em.base_velocity = std::make_pair(200, 300);
			em.base_velocity_variation = std::make_pair(5.f, 10.f);

			em.angular_velocity = std::make_pair(1.5f*RAD_TO_DEGf, 2.3f*RAD_TO_DEGf);
			em.particle_lifetime_ms = std::make_pair(5000, 5000);

			for (int i = 0; i < 3; ++i) {
				resources::particle particle_template;

				particle_template.angular_damping = 0;
				particle_template.linear_damping = 10;
				particle_template.face.set(assets::texture_id(int(assets::texture_id::SMOKE_PARTICLE_FIRST) + i), augs::rgba(255, 255, 255, 60));
				particle_template.unshrinking_time_ms = 2000.f;
				particle_template.shrink_when_ms_remaining = 1500.f;

				em.particle_templates.push_back(particle_template);
			}

			em.size_multiplier = std::make_pair(1.0, 1.0);
			em.particle_render_template.layer = render_layer::DIM_SMOKES;
			em.initial_rotation_variation = 180;

			effect.push_back(em);
		}

		{
			auto& effect = get_resource_manager().create(assets::particle_effect_id::ENGINE_PARTICLES);

			{
				resources::emission em;
				em.min_swing_spread.set(0.5, 1);
				em.min_swings_per_sec.set(0.3 / 2, 0.5 / 2);
				em.max_swing_spread.set(10 / 2, 10 / 2);
				em.max_swings_per_sec.set(0.3 / 2, 0.5 / 2);

				em.swing_spread.set(0, 0);
				em.swings_per_sec.set(0.3 / 2, 0.5 / 2);
				em.swing_spread_change_rate.set(0.3 / 2, 0.5 / 2);

				em.spread_degrees = std::make_pair(7, 7);
				em.particles_per_sec = std::make_pair(80, 80);
				em.stream_duration_ms = std::make_pair(3000000, 3000000);

				em.base_velocity = std::make_pair(100, 110);
				em.base_velocity_variation = std::make_pair(5.f, 10.f);

				em.angular_velocity = std::make_pair(2.5f*RAD_TO_DEGf, 2.8f*RAD_TO_DEGf);
				em.particle_lifetime_ms = std::make_pair(2500, 2500);

				for (int i = 0; i < 3; ++i) {
					resources::particle particle_template;

					particle_template.angular_damping = 0;
					particle_template.linear_damping = 10;
					particle_template.face.set(assets::texture_id(int(assets::texture_id::SMOKE_PARTICLE_FIRST) + i), augs::rgba(255, 255, 255, 60));
					particle_template.unshrinking_time_ms = 250.f;
					particle_template.shrink_when_ms_remaining = 1000.f;

					em.particle_templates.push_back(particle_template);
				}

				em.size_multiplier = std::make_pair(1.0, 1.0);
				em.particle_render_template.layer = render_layer::DIM_SMOKES;
				em.initial_rotation_variation = 180;

				effect.push_back(em);
			}

			{
				resources::emission em;
				//em.min_swing_spread.set(0.5, 1);
				//em.min_swings_per_sec.set(0.3 / 2, 0.5 / 2);
				//em.max_swing_spread.set(10 / 2, 10 / 2);
				//em.max_swings_per_sec.set(0.3 / 2, 0.5 / 2);
				//
				//em.swing_spread.set(0, 0);
				//em.swings_per_sec.set(0.3 / 2, 0.5 / 2);
				//em.swing_spread_change_rate.set(0.3 / 2, 0.5 / 2);
				//
				//em.spread_degrees = std::make_pair(6, 6);
				em.particles_per_sec = std::make_pair(500, 500);
				em.stream_duration_ms = std::make_pair(3000000, 3000000);
				em.base_velocity = std::make_pair(10, 100);
				em.angular_velocity = std::make_pair(0, 0);
				em.particle_lifetime_ms = std::make_pair(40, 100);

				//for (int i = 0; i < 6; ++i) {
					resources::particle particle_template;

					particle_template.angular_damping = 0;
					//if (i == 5) {
					//	particle_template.face.set(assets::texture_id(int(assets::texture_id::BLINK_FIRST) + 3), augs::rgba(255, 255, 255, 255));
					//}
					//else {
						particle_template.face.set(assets::texture_id(int(assets::texture_id::ROUND_TRACE)), augs::rgba(255, 255, 255, 255));
					//}
					//particle_template.face.size_multiplier.set(1, 0.5);					
					particle_template.unshrinking_time_ms = 30.f;
					particle_template.shrink_when_ms_remaining = 30.f;
					particle_template.alpha_levels = 1;
					
					em.particle_templates.push_back(particle_template);
				//}

				em.size_multiplier = std::make_pair(1.0, 1.0);
				em.particle_render_template.layer = render_layer::EFFECTS;
				em.initial_rotation_variation = 0;

				effect.push_back(em);
			}
		}

		{
			auto& effect = get_resource_manager().create(assets::particle_effect_id::PIXEL_MUZZLE_LEAVE_EXPLOSION);

			resources::emission em;
			em.spread_degrees = std::make_pair(100, 130);
			em.num_of_particles_to_spawn_initially = std::make_pair(30, 120);
			em.base_velocity = std::make_pair(250, 800);
			em.angular_velocity = std::make_pair(0, 0);
			em.particle_lifetime_ms = std::make_pair(30, 100);

			for (int i = 0; i < 5; ++i) {
				resources::particle particle_template;

				particle_template.angular_damping = 0;
				particle_template.linear_damping = 5000;
				particle_template.face.set(assets::texture_id(int(assets::texture_id::PIXEL_THUNDER_FIRST) + i), augs::rgba(255, 255, 255, 255));
				particle_template.alpha_levels = 1;

				em.particle_templates.push_back(particle_template);
			}

			em.size_multiplier = std::make_pair(0.5, 1);
			em.particle_render_template.layer = render_layer::EFFECTS;
			em.initial_rotation_variation = 0;

			effect.push_back(em);
		}

		{
			auto& effect = get_resource_manager().create(assets::particle_effect_id::PIXEL_BURST);

			resources::emission em;
			em.spread_degrees = std::make_pair(150, 360);
			em.num_of_particles_to_spawn_initially = std::make_pair(30, 120);
			em.base_velocity = std::make_pair(10, 800);<commit_msg>shorter muzzle flash<commit_after>#include "all.h"
#include "game/resources/manager.h"
#include "game/resources/particle_effect.h"
#include "game/assets/particle_effect_id.h"
#include "augs/graphics/shader.h"

namespace resource_setups {
	void load_standard_particle_effects() {
		{
			auto& effect = get_resource_manager().create(assets::particle_effect_id::WANDERING_SMOKE);

			resources::emission em;
			em.min_swing_spread.set(0.5, 1);
			em.min_swings_per_sec.set(0.3/2, 0.5/2);
			em.max_swing_spread.set(10/2, 10/2);
			em.max_swings_per_sec.set(0.3/2, 0.5/2);

			em.swing_spread.set(0, 0);
			em.swings_per_sec.set(0.3/2, 0.5/2);
			em.swing_spread_change_rate.set(0.3/2, 0.5/2);

			em.spread_degrees = std::make_pair(7, 7);
			em.particles_per_sec = std::make_pair(40, 50);
			em.stream_duration_ms = std::make_pair(3000000, 3000000);
			
			em.base_velocity = std::make_pair(200, 300);
			em.base_velocity_variation = std::make_pair(5.f, 10.f);

			em.angular_velocity = std::make_pair(1.5f*RAD_TO_DEGf, 2.3f*RAD_TO_DEGf);
			em.particle_lifetime_ms = std::make_pair(5000, 5000);

			for (int i = 0; i < 3; ++i) {
				resources::particle particle_template;

				particle_template.angular_damping = 0;
				particle_template.linear_damping = 10;
				particle_template.face.set(assets::texture_id(int(assets::texture_id::SMOKE_PARTICLE_FIRST) + i), augs::rgba(255, 255, 255, 60));
				particle_template.unshrinking_time_ms = 2000.f;
				particle_template.shrink_when_ms_remaining = 1500.f;

				em.particle_templates.push_back(particle_template);
			}

			em.size_multiplier = std::make_pair(1.0, 1.0);
			em.particle_render_template.layer = render_layer::DIM_SMOKES;
			em.initial_rotation_variation = 180;

			effect.push_back(em);
		}

		{
			auto& effect = get_resource_manager().create(assets::particle_effect_id::ENGINE_PARTICLES);

			{
				resources::emission em;
				em.min_swing_spread.set(0.5, 1);
				em.min_swings_per_sec.set(0.3 / 2, 0.5 / 2);
				em.max_swing_spread.set(10 / 2, 10 / 2);
				em.max_swings_per_sec.set(0.3 / 2, 0.5 / 2);

				em.swing_spread.set(0, 0);
				em.swings_per_sec.set(0.3 / 2, 0.5 / 2);
				em.swing_spread_change_rate.set(0.3 / 2, 0.5 / 2);

				em.spread_degrees = std::make_pair(7, 7);
				em.particles_per_sec = std::make_pair(80, 80);
				em.stream_duration_ms = std::make_pair(3000000, 3000000);

				em.base_velocity = std::make_pair(100, 110);
				em.base_velocity_variation = std::make_pair(5.f, 10.f);

				em.angular_velocity = std::make_pair(2.5f*RAD_TO_DEGf, 2.8f*RAD_TO_DEGf);
				em.particle_lifetime_ms = std::make_pair(2500, 2500);

				for (int i = 0; i < 3; ++i) {
					resources::particle particle_template;

					particle_template.angular_damping = 0;
					particle_template.linear_damping = 10;
					particle_template.face.set(assets::texture_id(int(assets::texture_id::SMOKE_PARTICLE_FIRST) + i), augs::rgba(255, 255, 255, 60));
					particle_template.unshrinking_time_ms = 250.f;
					particle_template.shrink_when_ms_remaining = 1000.f;

					em.particle_templates.push_back(particle_template);
				}

				em.size_multiplier = std::make_pair(1.0, 1.0);
				em.particle_render_template.layer = render_layer::DIM_SMOKES;
				em.initial_rotation_variation = 180;

				effect.push_back(em);
			}

			{
				resources::emission em;
				//em.min_swing_spread.set(0.5, 1);
				//em.min_swings_per_sec.set(0.3 / 2, 0.5 / 2);
				//em.max_swing_spread.set(10 / 2, 10 / 2);
				//em.max_swings_per_sec.set(0.3 / 2, 0.5 / 2);
				//
				//em.swing_spread.set(0, 0);
				//em.swings_per_sec.set(0.3 / 2, 0.5 / 2);
				//em.swing_spread_change_rate.set(0.3 / 2, 0.5 / 2);
				//
				//em.spread_degrees = std::make_pair(6, 6);
				em.particles_per_sec = std::make_pair(500, 500);
				em.stream_duration_ms = std::make_pair(3000000, 3000000);
				em.base_velocity = std::make_pair(10, 100);
				em.angular_velocity = std::make_pair(0, 0);
				em.particle_lifetime_ms = std::make_pair(40, 100);

				//for (int i = 0; i < 6; ++i) {
					resources::particle particle_template;

					particle_template.angular_damping = 0;
					//if (i == 5) {
					//	particle_template.face.set(assets::texture_id(int(assets::texture_id::BLINK_FIRST) + 3), augs::rgba(255, 255, 255, 255));
					//}
					//else {
						particle_template.face.set(assets::texture_id(int(assets::texture_id::ROUND_TRACE)), augs::rgba(255, 255, 255, 255));
					//}
					//particle_template.face.size_multiplier.set(1, 0.5);					
					particle_template.unshrinking_time_ms = 30.f;
					particle_template.shrink_when_ms_remaining = 30.f;
					particle_template.alpha_levels = 1;
					
					em.particle_templates.push_back(particle_template);
				//}

				em.size_multiplier = std::make_pair(1.0, 1.0);
				em.particle_render_template.layer = render_layer::EFFECTS;
				em.initial_rotation_variation = 0;

				effect.push_back(em);
			}
		}

		{
			auto& effect = get_resource_manager().create(assets::particle_effect_id::PIXEL_MUZZLE_LEAVE_EXPLOSION);

			resources::emission em;
			em.spread_degrees = std::make_pair(100, 130);
			em.num_of_particles_to_spawn_initially = std::make_pair(30, 120);
			em.base_velocity = std::make_pair(250+200, 800+200);
			em.angular_velocity = std::make_pair(0, 0);
			em.particle_lifetime_ms = std::make_pair(30, 50);

			for (int i = 0; i < 5; ++i) {
				resources::particle particle_template;

				particle_template.angular_damping = 0;
				particle_template.linear_damping = 5000;
				particle_template.face.set(assets::texture_id(int(assets::texture_id::PIXEL_THUNDER_FIRST) + i), augs::rgba(255, 255, 255, 255));
				particle_template.alpha_levels = 1;

				em.particle_templates.push_back(particle_template);
			}

			em.size_multiplier = std::make_pair(0.5, 1);
			em.particle_render_template.layer = render_layer::EFFECTS;
			em.initial_rotation_variation = 0;

			effect.push_back(em);
		}

		{
			auto& effect = get_resource_manager().create(assets::particle_effect_id::PIXEL_BURST);

			resources::emission em;
			em.spread_degrees = std::make_pair(150, 360);
			em.num_of_particles_to_spawn_initially = std::make_pair(30, 120);
			em.base_velocity = std::make_pair(10, 800);
{'fraction_non_alphanumeric': 0.1489327032752159, 'fraction_numerical': 0.06363043832491445, 'mean_word_length': 4.020449897750511, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1115448', 'n_tokens_mistral': 6291, 'n_tokens_neox': 4750, 'n_words': 639}