#pragma once

#include "../../../GAME_COMMON.h"
#include "../../ecs_entity.h"

#include "../component_physics.h"
#include "../stat/component_allegiance.h"
#include "../stat/component_health.h"
#include "../stat/component_invincibility.h"
#include "../stat/component_game_entity_type.h"
#include "../stat/component_stun.h"
#include "component_action_on_delete_drop_goodies.h"

#include "../../entity/play/entity_damage_number.h"

#define COMPONENT_ACTION_DAMAGE_OVERKILL_MAX 3

typedef struct DamageEntry
{
	u32 id;
	u32 timer;
} DamageEntry;

typedef struct ComponentActionDamage
{
	ECSComponent component;
	Vector damageEntries; /* DamageEntry */
	AllegianceType attackType;
	u32 value;
	u32 damageTimer;
} ComponentActionDamage;

void component_action_damage_init(ComponentActionDamage* self, AllegianceType attackType, u32 damageTimer, u32 value);
void component_action_damage_add(ComponentActionDamage* self, ECS* ecs);
void component_action_damage_delete(ComponentActionDamage* self, ECS* ecs);
void component_action_damage_tick(ComponentActionDamage* self, ECS* ecs);

static const ECSComponentInfo COMPONENT_ACTION_DAMAGE_INFO = 
{
	.system = 
	{
		.functions = 
		{ 

			(ECSFunction)component_action_damage_add,
			(ECSFunction)component_action_damage_delete,
			(ECSFunction)component_action_damage_tick,
			NULL
		}
	},
	.type = ECS_COMPONENT_ACTION_DAMAGE,
	.size = sizeof(ComponentActionDamage)
};


