extends KinematicBody2D
class_name Actor

#TODO Split the blobby specific parts up from this

onready var levelState := get_tree().root.get_child(3).get_node("%LevelState")
onready var signalManager := get_tree().root.get_child(3).get_node("%SignalManager")

const PhysicsConst = preload("res://src/Utilities/Physic/PhysicsConst.gd")

const FLOOR_NORMAL := Vector2.UP

var stomp_feedback := 1400 * 60
var stomp_time := 0.2
var init_stomp_time := 0.2
var inair_velocity := 21
var wallslide_threshold := 1000
var base_floor_friction := 0.5
var initial_velocity_dependence := 0.7
var floor_friction := base_floor_friction
# TODO Mixing Vectors and ints is questionable
var max_velocity := {
    "walk": 120, "run": 160, "jump": Vector2(120, 420),	"fall": Vector2(120, 420), "walljump": 200, "idle": 12000, "duck": 160
}
var velocity_jump_boost_ratio := 10
# This is added to the acceleration force initially
var init_acceleration_force := {
    "": 0, "idle_walk": 4181, "idle_run": 5765, "walk_run": 1000
}
# Oriented around deltas of 0.0166666...s
# newtonmeters is the unit
var acceleration_force := {
    "walk": Vector2(1800, 1350),
    "fall": Vector2(1800, 1050),
    "jump": Vector2(1800, 0),
    "idle": Vector2(1800, 1233),
    "duck": Vector2(500, 1300),
    "run": Vector2(2500, 1400),
    "walljump": Vector2(600, 1050),
    "air_strafe": Vector2(333, 2000)
}
# Gravity as m/s^2
var _gravity: float = PhysicsConst.gravity
# Mass of Blobby
# Kilograms
export var mass := 6.5

var velocity := Vector2.ZERO

var max_air_strafe_charges := 0
var air_strafe_charges := 0
