extends Area2D


var modifier_type = 0

export var modifier_name :String = ''
var animation_name: String = '' # Not using this one
var timeout_seconds: float = 0.0 # Not doing timeout based ones yet either.

export var directional_modifier: bool = false

export var move_speed: float = 0.0
export var move_acceleration: float = 0.0
export var move_speed_modifier: float = 0.0
export var move_modifier_move_acceleration: float = 0.0
export var jerk_factor: float = 0

export var gravity_modifier: int = 0

#var state_timeout: Timer

# Declare member variables here. Examples:
# var a = 2
# var b = "text"

var modifier :StateModifier
#var modifier_properties: ModifierProperties


# Called when the node enters the scene tree for the first time.
func _ready():
	modifier = StateModifier.new()
	modifier.ready( modifier_name, animation_name , modifier.TYPE.NONE, timeout_seconds)
	modifier.modifier_properties = ModifierProperties.new( move_speed,
										gravity_modifier, 
										move_acceleration,
										move_speed_modifier,
										move_modifier_move_acceleration,
										jerk_factor)
	print("Debug Direction property shy are you stopid?! ", directional_modifier)
	modifier.modifier_properties.directional_modifier = directional_modifier

func _on_Modifier_Component_body_entered(body):
	var colliding_node = body
	if colliding_node.has_node("Modifier_Receiver"):
		colliding_node.get_node("Modifier_Receiver").register_modifier(modifier)


func _on_Modifier_Component_body_exited(body):
	var colliding_node = body
	if colliding_node.has_node("Modifier_Receiver"):
		colliding_node.get_node("Modifier_Receiver").remove_modifier(modifier)
