#pragma once
#include "Mod.h"

class Speed : public Mod {
public:
	int mode = 0;
	bool strafe = true;
	float strafeDelay = 2.f;
	int jumpMode = 0;
	float speed = 3.f;
	bool half = false;
	float jumpDelay = 0.f;
	float height = 4.2f;
	float timer = 20.f;
	float ongroundtimer = 21.f;
	bool sendinput = true;
	bool spellboost = true;
	bool damageboost = true;
	bool onlywhentarget = true;

	float spellboostspeed = 3.8f;
	float damageboostspeed = 3.8f;

	Speed() : Mod("Speed", "Moves faster than normal walking speed.", Category::MOVEMENT) {
		settings.push_back(new Setting{ _("Mode"), &mode, new int(4), new int(0), 1, {
			_("Vanilla"),
			_("Flareon"),
			_("Jump"),
			_("Friction"),
			_("Flareon Semi")
			}, true });

		settings.push_back(new Setting{ _("Strafe"), &strafe, 0, 0, 0, {}, true });
		settings.push_back(new Setting{ _("Strafe Delay"), &strafeDelay, new float(10.f), new float(0.f), 2, {}, true, 10.f });

		settings.push_back(new Setting{ _("Jump Mode"), &jumpMode, new int(1), new int(0), 1, {
			_("Vanilla"),
			_("Motion")
			}, true });

		settings.push_back(new Setting{ _("Jump Delay"), &jumpDelay, new float(1.f), new float(0.f), 2, {}, true });
		settings.push_back(new Setting{ _("General Settings"), 0, 0, 0, 3, {}, true });
		settings.push_back(new Setting{ _("Height"), &height, new float(10.f), new float(0.f), 2, {}, true, 10.f });
		settings.push_back(new Setting{ _("Speed"), &speed, new float(10.f), new float(0.f), 2, {}, true, 10.f });
		settings.push_back(new Setting{ _("Half"), &half, 0, 0, 0, {}, true });

		settings.push_back(new Setting{ _("Timer Settings"), 0, 0, 0, 3, {}, true });
		settings.push_back(new Setting{ _("Timer"), &timer, new float(30.f), new float(0.f), 2, {}, true, 5.f });
		settings.push_back(new Setting{ _("Onground Timer"), &ongroundtimer, new float(30.f), new float(0.f), 2, {}, true, 5.f });

		settings.push_back(new Setting{ _("Send Input"), &sendinput, 0, 0, 0, {}, true });
		settings.push_back(new Setting{ _("Spell Boost"), &spellboost, 0, 0, 0, {}, true });
		settings.push_back(new Setting{ _("Damage Boost"), &damageboost, 0, 0, 0, {}, true });
		settings.push_back(new Setting{ _("Boost Settings"), 0, 0, 0, 3, {}, true });
		settings.push_back(new Setting{ _("Only When Target"), &onlywhentarget, 0, 0, 0, {}, true });

		settings.push_back(new Setting{ _("Spell Boost Speed"), &spellboostspeed, new float(10.f), new float(0.f), 2, {}, true, 10.f });
		settings.push_back(new Setting{ _("Damage Boost Speed"), &damageboostspeed, new float(10.f), new float(0.f), 2, {}, true, 10.f });

		enabled = false;
	}

private:
	float yaw = 0.f;
	bool cancelupdate = false;

	virtual auto onWorldTick(Player* _this) -> void override;
	virtual auto onPacketSendBefore(Packet* packet) -> void override;
	virtual auto onClient() -> void override;
	virtual auto onDisabled() -> void override;
	virtual auto onEnabled() -> void override;
	virtual auto getMode() -> std::string override;
};
