/*/

ACROBATICS HUD-CONSOLE BLOCK

/*/

/*

this code's a certified mess, don't ever look at this

*/

if acrobatics == nil then return end--let's not even bother.

--CVARS for HUD aesthetics - These are all clientside 

local ac_prefmeter = {"\x85 NONE", "\x88 MINIMAL", "\x88 SIMPLE", "\x88 DEFAULT", "\x88 ALTERNATIVE"}
local ac_meterstyle = CV_RegisterVar({
	name = "ac_meterstyle",
	defaultvalue = "default",
	flags = CV_CALL,
	possiblevalue = {none = 1, minimal = 2, simple = 3, default = 4, alternative = 5},
	func = function(cv)
		print("\131*Charge meter style has been changed to" .. ac_prefmeter[cv.value] .. "\131.")
		S_StartSound(nil, sfx_acpick, p) --beep
	end 
})

local ac_textalignment = CV_RegisterVar({ 
	name = "ac_textalignment",
	defaultvalue = "centered",
	flags = CV_CALL,
	possiblevalue = {left = -1, centered = 0},
	func = function(cv)
		local t_type = "you shouldn't see this"
		if cv.value == 0
			t_type = "\x85 CENTERED"
		elseif cv.value == -1
			t_type = "\x88 LEFT"
		end
		print("\131*Flavor text alignment adjusted to" .. t_type .. "\131.")
		S_StartSound(nil, sfx_acpick, p) --beep
	end 
})

local ac_barsnap = CV_RegisterVar({ 
	name = "ac_barsnap",
	defaultvalue = "yes",
	flags = CV_CALL,
	possiblevalue = CV_YesNo,
	func = function(cv)
		local t_type = "nagisa dies at the end of clannad"
		if cv.value == 1
			t_type = "\x88 YES"
		elseif cv.value == 0
			t_type = "\x84 NO"
		end
		print("\131*STORE bar snap set to" .. t_type .. "\131.")
		S_StartSound(nil, sfx_acpick, p) --beep
	end 
})

local ac_augshow = CV_RegisterVar({ 
	name = "ac_augshow",
	defaultvalue = "potential",
	flags = CV_CALL,
	possiblevalue = {potential = 0, raw = 1},
	func = function(cv)
		local t_type = "nagisa dies at the end of clannad"
		if cv.value == 1
			t_type = "\x8B RAW"
		elseif cv.value == 0
			t_type = "\x83 POTENTIAL"
		end
		print("\131*AUGMENT store percent shown is" .. t_type .. "\131 Percentage.")
		S_StartSound(nil, sfx_acpick, p) --beep
	end 
})

--PAIN THAT'S SPLITSCREEN EXCLSUVE:tm:
local splitflavorinfo = {[0] = "MISS...", [1] = "OK...", [2] = "NICE!", [3] = "RAD!", [4] = "WILD!", [5] = "PERFECT!", [6] = "MAX!", [7] = "STORE..."}
local splitcolorinfo = {[0] = V_GRAYMAP, [1] = V_ORANGEMAP, [2] = V_YELLOWMAP, [3] = V_GREENMAP, [4] = V_SKYMAP, [5] = V_PURPLEMAP, [6] = V_GREENMAP, [7] = V_SKYMAP}

--------||
--HUD---||
--FUNKS-||	

--FLAVOR ANIMATION INFO
local flavorframeinfo = { [0] = 8, [1] = 10, [2] = 16, [3] = 8, [4] = 8, [5] = 8, [6] = 8, [7] = 8}
local flavorleftedinfo = {[0] = -10, [1] = -10, [2] = -10, [3] = 0, [4] = -10, [5] = 0, [6] = -15, [7] = -10}
local curframe, maxframes, lastframe, prevframe, delayflip = 0, 0, 0, 0, -1

local function flavoranimation(p, frameinf, tableref) 
	maxframes = frameinf[tableref] --The max amount of frames for each status
	curframe = (leveltime)%maxframes 
	return curframe	
end

--------||
--MODULE||
--------||	

--Logic for store gfx inspired by Callmore's HP Mod - maybe rewritten a bit more smoothbrained...
--We're sacrificing a smidge of accuracy to save draw cycles. such is life.
--A Store bar can be 36 at most, so I mean that's at max 13 draws dedicated to a fucking bar, all because v.drawFill doesn't respect HUD Transparency :v
local bargfx = {}
local ss_bargfx = {}
local barbggfx = {}
local ss_barbggfx = {}
local storebarCount = 36 
local storeTutorial = 0
local storebarHeight, barvflags, storeGfxset, storeBarX, storeBarY, storeBarSox, storeBarSoy, storeBarcur, barcached, yBuild, boxExists, itemCheck, blinkflag, whichBar
local function ac_drawStoreBar(v, p, c, ssmode)

	if not(barcached) then --pull them graphics
		--single and 2p
		for i = 0, 1 do 
			bargfx[i] = v.cachePatch("STOBR" .. i)
		end
		for k = 0, 1 do
			barbggfx[k] = v.cachePatch("STOBRG" .. k)
		end
		--3/4p
		for l = 0, 1 do
			ss_bargfx[l] = v.cachePatch("STOBRS" .. l)
		end
		for m = 0, 1 do
			ss_barbggfx[m] = v.cachePatch("STOSSG" .. m)
		end
		barcached = true
	end
	
	if not(ac_styleCheck(p, 1, true)) then return end
	
    local ks = p.kartstuff --POPSCICLE STICK ENUMS AAAAAAAAAAAAAAAA
    itemCheck = (ks[k_itemroulette] or 
    ks[k_itemtype] or 
    ks[k_itemheld] or
    ks[k_eggmanheld] or 
    ks[k_eggmanexplode] or 
    ks[k_rocketsneakertimer] or
    ks[k_growshrinktimer] > 0 or
    p.forceMobj) --valid check :^))))
	
	barvflags = V_HUDTRANS
	
	if itemCheck or not(ac_barsnap.value) then boxExists = 0 else boxExists = 38 end
	storebarHeight = storebarCount
	storeBarX = 57 - boxExists
	storeBarY = 48
	storeBarSox, storeBarSoy = 0, 0

	if splitscreen
		if splitscreen == 1 
			barvflags = $|V_SNAPTOLEFT
			if ssmode == 1
				barvflags = $|V_SPLITSCREEN
			end
		else --3/4p
			storeBarX, storeBarY = 6, 82
			
			if ssmode%2 == 1
				storeBarSox = 306
				barvflags = $|V_SNAPTORIGHT
			else
				barvflags = $|V_SNAPTOLEFT
			end
			
			if ssmode > 1
				barvflags = $|V_SPLITSCREEN
			end
			
		end
	else
		barvflags = $|V_SNAPTOLEFT|V_SNAPTOTOP
	end
	
	storeGfxset = (p.acrostore > p.kspdfactor and leveltime%16 > 8) and 1 or 0 --FLASH, AAAAH
	
	whichBar = splitscreen < 2 and barbggfx[storeGfxset] or ss_barbggfx[storeGfxset] --THISSUCKSTHISSUCKSTHISUCKSAAAA
	
	v.draw(storeBarX+storeBarSox, storeBarY+storeBarSoy, whichBar, barvflags, v.getColormap(0, p.skincolor))
	
	storeBarcur = FixedInt(FixedDiv((p.acrostore<<FRACBITS),(maxStore<<FRACBITS)))
	storebarHeight = max(min(storebarCount, storebarHeight), 0) --need me a fucking clamp func
	yBuild = p.acrostore/30
	if p.acrostore > 0 and yBuild == 0 then yBuild = 1 end --don't ever let me write hud code
	for b = 1, yBuild
		whichBar = splitscreen < 2 and bargfx[storeGfxset] or ss_bargfx[storeGfxset]
		v.draw(storeBarX+storeBarSox, storeBarY - (3*b) + 3+storeBarSoy, whichBar, barvflags, v.getColormap(0, p.skincolor)) --we'll base it off of colorization for blink fx
	end
	
	if splitscreen then return end
	--Store Tutorial
	if p.acrostore > 0 and storeTutorial < 6*TICRATE and not(itemCheck)
		if ac_btnPress(p, 1) or p.trickboost
			blinkflag = leveltime%8 > 4 and V_SKYMAP or V_BLUEMAP
			v.drawString(storeBarX + storeBarSox + 10, storeBarY + storeBarSoy - 8, "\136JAMMIN'!", blinkflag|barvflags, "thin")
			storeTutorial = $+1 --GO AWAY FASTER BECAUSE THEY LEARNED
		else
			v.drawString(storeBarX + storeBarSox + 10, storeBarY + storeBarSoy - 8, "\136Press \130ITEM\n\136to use!", barvflags|V_ALLOWLOWERCASE, "thin")
		end
	end
end

local meterx, metery, dangerclose, meterSox, meterSoy, meterFlags
local function ac_drawMeter(v, p, c, ssmode)
	if ac_meterstyle.value < 1 or not(p.trickactive) then return end -- you've lost it!

	--1P values
	meterx, metery = 190, 48
	meterSox, meterSoy = 0, 0
	meterFlags = V_HUDTRANS --universal
	
	if splitscreen
		meterx, metery = 190, 80
		if splitscreen == 1 --2p 
			meterSoy = ssmode == 1 and 100 or 0
		else --3/4p
		
			meterx = 100 	
			if ssmode%2 == 1
				meterSox = 160 --shift right!
			end
			if ssmode > 1
				meterSoy = 100
			end			
		end
	end

	if debugang.value == 2 then v.drawString(meterx+meterSox, metery+meterSoy,"SCREEN" .. #p) end
	
	if not(splitscreen)
	
		dangerclose = (ac_btnPress(p, 0) or p.trickcharge > 330) and 1 or 0
		
		--The Meter backing.
		v.draw(meterx, metery, v.cachePatch("TRMETER" .. ac_meterstyle.value), meterFlags) 
		if dangerclose then v.draw(meterx, metery, v.cachePatch("TRMETERWARN"), meterFlags) end
		
		if ac_meterstyle.value > 1 --Lil cursor dude, floored to bottom to enhance visual accuracy
			v.draw(meterx-3, (metery+100)-max((ac_floor10(p.trickcharge)/5),1), v.cachePatch("TRCUR"), meterFlags)
		else
			v.draw(meterx-3, (metery+100)-max((ac_floor10(p.trickcharge)/5),1), v.cachePatch("TRCURMIN"), meterFlags)
		end 
		
		if debugang.value == 1 then v.drawString(meterx-1, metery+100, p.trickcharge, V_ROSYMAP, "left") end --You like numbers in debug?
		
	else
		v.draw(meterx+meterSox, metery+meterSoy, v.cachePatch("TRMETERSS"), meterFlags) --The Meter backing.
		v.draw(meterx+meterSox-3, (metery+meterSoy)-(ac_floor10(p.trickcharge)/10), v.cachePatch("TRCURMIN"), meterFlags)
	end 
	
end


--FLAVOR TEXT
local flavoralignment, flavorflags 
local flavorstack, flavorX, flavorY, flavorSox, flavorSoy
local function ac_drawFlavors(v, p, c, ssmode)
	if not p.sincelasttrick then return end

	flavoralignment = 100*(ac_textalignment.value)
	
	flavorX, flavorY  = 160, 40
	flavorSox, flavorSoy = 0, 0
	flavorflags = V_HUDTRANS|splitcolorinfo[p.trickgrade] --handling flags for 1P later on, don't worry about it.
	if splitscreen
		if splitscreen == 1 
			flavorX, flavorY  = 6, 52
			flavorflags = $|V_SNAPTOLEFT
			if ssmode == 1
				flavorflags = $|V_SPLITSCREEN
			end
		else --3/4p
			flavorX, flavorY = 6, 30 
			
			if ssmode%2 == 1
				flavorSox = 262 
				flavorflags = $|V_SNAPTORIGHT
			else
				flavorflags = $|V_SNAPTOLEFT
			end
			
			if ssmode > 1
				flavorflags = $|V_SPLITSCREEN
			end
			
		end
	end


	if not(splitscreen)
		if ac_textalignment.value == 0 or tsrb2kr --jesus.
			flavorflags = V_SNAPTOTOP
			v.draw(flavorX, flavorY, v.cachePatch("TS" .. p.trickgrade .. "FLAVBACK0"), flavorflags) --The backing
			v.draw(flavorX+flavoralignment, flavorY, v.cachePatch("TS" .. p.trickgrade .. "FLAV" .. flavoranimation(p, flavorframeinfo, p.trickgrade)), flavorflags) --The text
		else
			flavorflags = V_SNAPTOLEFT
			v.draw(flavorX+flavoralignment+flavorleftedinfo[p.trickgrade], flavorY+25, v.cachePatch("TS" .. p.trickgrade .. "FLAV" .. flavoranimation(p, flavorframeinfo, p.trickgrade)), flavorflags) --The text
		end
	else
		v.drawString(flavorX+flavorSox, flavorY+flavorSoy, splitflavorinfo[p.trickgrade],flavorflags) --a simpler time
		if p.basebonusgrade > 0
			v.drawString(flavorX+flavorSox, flavorY+flavorSoy+10, "\131+" ..FixedMul(p.basebonusgrade, 100*FRACUNIT)>>FRACBITS .. "% BONUS", flavorflags, "thin")
		end
	end
		
	if splitscreen then return end
		
	--BURST - combo count
	if p.chaincount > 1
		flavorflags = $|V_REDMAP
		if p.chaincount < 11
			v.drawString(flavorX+flavoralignment, flavorY+10, p.chaincount .. " COMBO!", flavorflags, "center")
		else
			v.drawString(flavorX+flavoralignment, flavorY+10, "HOLY CRACKERS!", flavorflags, "center")
		end
	end
		
	--STORE - current bonus
	if p.acrostoregrade
		flavorflags = $|V_SKYMAP
		if p.acrostore < maxStore
			if p.acrostore >= p.kspdfactor 
				v.drawString(flavorX+flavoralignment, flavorY+10, "Power Boost Ready!", flavorflags, "center")
			else
				v.drawString(flavorX+flavoralignment, flavorY+10, "Charging..." , flavorflags, "center")
			end
		else 
			v.drawString(flavorX+flavoralignment, flavorY+10, (p.trickgrade == 6 and "\x88 Boost Full!") or "No Bonus", flavorflags, "center")
		end
	end
		
	--AUGMENT - current bonus
	if p.basebonusgrade
		flavorflags = $|V_GREENMAP
		if p.basebonus < p.maxAug
			v.drawString(flavorX+flavoralignment, flavorY+10, "Max Speed UP!", flavorflags, "center")
		else 
			v.drawString(flavorX+flavoralignment, flavorY+10, (p.trickgrade == 6 and "\131Full AUGMENT!") or "AUGMENT Sustain!", flavorflags, "center")
		end
	end
	
end


local aughudX, aughudY, augflags, augstimate --This pun might get me shot one day.
local function ac_drawAug(v, p, c, ssmode)
	if not(ac_styleCheck(p, 2, true)) then return end
	aughudX, aughudY = 90, 178
	augflags = V_HUDTRANS
	
	if splitscreen
		
		if splitscreen <= 1
			aughudY = ssmode == 1 and 76 or -26
			augflags =  $|V_SPLITSCREEN|V_SNAPTOLEFT
		else
		--3/4P
			aughudX = ssmode%2 == 1 and 256 or 42 
			aughudY = 88 
			
			--i hate flags so much
			
			--2p and 4p right snap
			if ssmode%2 == 1
				augflags = $|V_SNAPTORIGHT
			end
			
			--1p and 3p left snap
			if ssmode%2 == 0
				augflags = $|V_SNAPTOLEFT
			end
			
			
			if ssmode > 1
				augflags = $|V_SPLITSCREEN
			end
		end
	else
		augflags = $|V_SNAPTOBOTTOM|V_SNAPTOLEFT 
	end
	
	if ac_augshow.value == 1
		augstimate = FixedMul(p.basebonus, 100*FRACUNIT)>>FRACBITS 
	else
		augstimate = FixedMul(FixedDiv(p.basebonus, p.maxAug), 100*FRACUNIT)>>FRACBITS 
	end
	
	if augstimate == 0 and p.basebonus > 0 then augstimate = "<1" end --what the fuck man

	if p.basebonus == p.maxAug then blinkflag = leveltime%8 > 4 and V_PERIDOTMAP or V_GREENMAP else blinkflag = V_GREENMAP end
	
	v.drawString(aughudX, aughudY, "\131+" .. augstimate .. "%", blinkflag|augflags)
		
end

--EMBLEM STUFF
local emblemflags, emblemcmap, isBattle
local emblemadjust, emblemX, emblemY 
local emblemText = 
{
	str =
	{
		[0] = "B",
		[1] = "S",
		[2] = " ", --CERTIFIED 100% COMEDY GOLD
		[3] = "V",
		[4] = "H"
	},
	cmap =
	{
		[0] = V_REDMAP,
		[1] = V_SKYMAP,
		[2] = V_GREENMAP,
		[3] = V_PURPLEMAP,
		[4] = V_REDMAP
	}
}
local function ac_drawEmblems(v, p, c, ssmode)
	
	--1P values
	emblemX, emblemY = 90, 170
	emblemflags = V_HUDTRANS --universal
	isBattle = G_BattleGametype() and v.cachePatch("ACEMBM3") or v.cachePatch("ACEMBM" .. p.trickstyle)
	if splitscreen
		
		if splitscreen <= 1
			emblemY = ssmode == 1 and 76 or -26
			emblemflags =  $|V_SPLITSCREEN|V_SNAPTOLEFT
		else
		--3/4P
			emblemX = ssmode%2 == 1 and 268 or 42 
			emblemY = 88 
			
			--i hate flags so much
			
			--2p and 4p right snap
			if ssmode%2 == 1
				emblemflags = $|V_SNAPTORIGHT
			end
			
			--1p and 3p left snap
			if ssmode%2 == 0
				emblemflags = $|V_SNAPTOLEFT
			end
			
			--3p/4p splitscreen changes the references. blessing or curse?
			if ssmode > 1
				emblemflags = $|V_SPLITSCREEN
			end
		end
	else
		emblemflags = $|V_SNAPTOBOTTOM|V_SNAPTOLEFT 
	end
	
	--Our drawing of the stats kind of depends on acrohell and SPB denial.
	if splitscreen < 2
		if p.trickdenial
			v.draw(emblemX, emblemY, v.cachePatch("ACSPB"), emblemflags)
			if ac_btnPress(p, 0)
				v.draw(emblemX, emblemY, v.cachePatch("SPBNO"), emblemflags)
			end
		elseif acrohell and not G_BattleGametype()
			v.draw(emblemX, emblemY, v.cachePatch("ACEMBM4"), emblemflags)
		else
			v.draw(emblemX, emblemY, isBattle, emblemflags)
		end	
	else
		if p.trickdenial
			v.drawString(emblemX, emblemY, "X", emblemflags|V_GRAYMAP)
		elseif acrohell and not G_BattleGametype()
			v.drawString(emblemX, emblemY, emblemText.str[4], emblemflags|emblemText.cmap[p.trickstyle])
		else
			isBattle = G_BattleGametype() and emblemText.str[3] or emblemText.str[p.trickstyle]
			v.drawString(emblemX, emblemY, isBattle, emblemflags|V_PURPLEMAP)
		end
	end
	
end


--HUDFRAME for GAME
local ssindex
hud.add(function(v, p, c)

	if (p.trickready == nil or p.exiting) or not(ac_active.value) or p.spectator then return end --let's not get hasty here
	
	--acrohell alerts lol
	if (leveltime > 2*TICRATE) and (leveltime < 5*TICRATE) and acrohell and leveltime%8 >= 4
		v.drawString(160, 60, "DAREDEVIL MODE ACTIVATED", V_REDMAP, "center")
	end

	ssindex = 0
	if splitscreen
		for i = 0, splitscreen do
			if p == displayplayers[i] then
				ssindex = i 
				break
			end
		end	
	end
	
	ac_drawEmblems(v, p, c, ssindex)
	if G_BattleGametype() then return end --Battle's basically done at this point.
	ac_drawFlavors(v, p, c, ssindex)
	ac_drawMeter(v, p, c, ssindex)
	ac_drawStoreBar(v, p, c, ssindex)
	ac_drawAug(v, p, c, ssindex)
	
	if debugang.value == 4 --misc hud vars and reminders
		v.drawString(12,65, splitscreen, V_SNAPTOLEFT, "left")
		v.drawString(12,75, "curframe: " .. curframe, V_SNAPTOLEFT,"left")
		v.drawString(12,85, "maxframes: " .. maxframes, V_SNAPTOLEFT,"left")
		v.drawString(12,95, "L-ADJ: " .. flavorleftedinfo[p.trickgrade],V_SNAPTOLEFT,"left")
	end
	
end, "game")

/*/

ACROBATICS HELP BLOCK

Shoving a help file into the console is probably janky from a UI standpoint, but I also don't wanna write out 17 different ui screens, so...

/*/

--certified comedy gold
local lastEE
local help_ee = {
"\128Real funny, asking for help about help.",
"\128You've met with a terrible fate, haven't you?",
"\128Do you enjoy this??? Do you enjoy sitting here waiting for some other message to pop up, while your meaningless existence whittles away little by little? Go drink some water.",
"\130YOU'VE UNLOCKED SECRET 1 OF 6", -- i can't WAIT to get messages about this one
"\133[CARRIER LOST]",
"\128SORRY\n\n\nNOTHING",
"\128Wait a minute...",
"\132https://www.youtube.com/watch?v=XeNKhm09Q88",
"\128Please stop. I'm begging you.",
"\128Do not fall for the illusion of paradise. The flesh lies to you.",
"\131ac_help ac_help ac_help ac_help ac_help ac_help ac_help \133HELPI'MTRAPPEDINALUAFACTORY \131ac_help ac_help ac_help",
"\128You've got a real twitchy copy paste finger, buddy.",
"\128We're sorry; you have reached a command that has been disconnected or is no longer in service. If you feel you have reached this message in error, please check the syntax and try your command again."
}
--please don't judge me for switching between hex and dec color codes :(
local helpmuhshitdude = {
	{input = "ac_trickstyle", param = "\130[BURST, STORE, AUGMENT] or [0-2]", msg = "\128Switch your trick style. If you switch mid-race, it won't take effect until the next one.\n\130[ALIASES:]\128 trickstyle, changetrick, trick, ts]", cmod = "\130"},
	{input = "ac_trickbtn", param = "\130[BRAKE, CUSTOM1] or [0-2]", msg = "\128Switch which button is used to trick. Depending on mod loadout, you may not be able to switch the button!\n\130[ALIASES:]\128 trickbutton, trickbtn]", cmod = "\130"},
	{input = "ac_trickreminder", param = "\130[ON/OFF]", msg = "\128Toggles whether or not you see a reminder of your trickstyle every couple of races. Can be toggled to reduce chat log spam.", cmod = "\130"},
	{input = "ac_textalignment", param = "\130[CENTERED/LEFT]", msg = "\128Toggles whether the \130flavor text\128 'NICE!, OK..., etc' shows up in the center or off to the left.\nCan possibly get in the way of extra HUD elements on the left.", cmod = "\130"},
	{input = "ac_meterstyle", param = "\130[NONE/MINIMAL/SIMPLE/DEFAULT/ALTERNATIVE]", msg = "\128Changes the look of the trick meter. Different skins may be cleaner to look at depending on taste, or will take up less screen.\nIf on \130NONE\128, it simply won't show up - but you're still responsible for landing it by feel!", cmod = "\130"},
	{input = "ac_barsnap", param = "\130[YES/NO]", msg = "\128The\x88 STORE\128 bar will snap to the left if there's no item being used \130[YES]\128 or will stay where it is regardless \130[NO]\128.", cmod = "\x88"},
	{input = "ac_augshow", param = "\130[POTENTIAL/RAW]", msg = "\131AUGMENT'S\128 percentage will you either the percentage of maximum POTENTIAL of your boost gained, or the RAW speed boost percent relative to your character.\x85 Toggling this does not affect your actual speed bonus!", cmod = "\x83"},
	{input = "ac_forcetrick", param = "\130[FREESTYLE/BURST/STORE/AUGMENT]", msg = "\128This will force everyone on the server to use the noted trickstyle. Use \130FREESTYLE\128 to allow players to choose their styles freely.", cmod = "\135"},
	{input = "ac_acrohell", param = "\130[FORCED/DISABLED/HELLMAP]", msg = "\128This will force randomized trickstyles! A danger lurks within this power.", cmod = "\135"},
	{input = "ac_active", param = "\130[ON/OFF]", msg = "\128This will enable/disable Acrobatics as a whole on the server. Takes effect on next race if mid-race.", cmod = "\135"},
	{input = "ac_textdebug", param = "\130[ON/OFF]", msg = "\128This function spams the console with irrelevant text.\x85 There's no need for this to be on unless you're troubleshooting something!", cmod = "\133"},
	{input = "BURST", param = "\128Set with \130ac_trickstyle 0\128.\133", msg = "\128This trickstyle gives a powerful speed boost upon landing.\nYou can charge up a drift, release, and \130zipboost\128 while you're in this state to rocket yourself forward! Use it to turn on a dime.", cmod = "\x85"}, 
	{input = "STORE", param = "\128Set with \130ac_trickstyle 1\128.\136", msg = "\128This trickstyle stores energy in a bar when landing.\nPress \130ITEM\128 without an item being held to use it and get a tiny boost forward. Hold \130ITEM\128 down to continue burning stored energy. If you build it up enough, you'll get a stronger \130POWER BOOST\128 from it instead!", cmod = "\x88"},
	{input = "AUGMENT", param = "\128Set with \130ac_trickstyle 2\128.\131", msg = "\128This trickstyle increases your general boost power. While it raises your top speed slightly, it gets multiplied when any other boosts are affecting you!\nThis upgrade decays \130over time\128 or by \130bonking a wall, getting hit by items, or dying\128 - Tricks must be done regularly to maintain this charge.", cmod = "\x83"},
	{input = "STOMP", param = "[BATTLE MODE ONLY]", msg = "\128This style lets you hop in midair! Press the trick button again to \130slam the ground and create a shockwave!\n\128You can push away foes and \130detonate mines!?", cmod = "\142"}, 
	{input = "ac_help", param = "[any parameter but itself?]\131", msg = help_ee[P_RandomRange(1, #help_ee)], cmod = "\131"}
}
local function acHelp(p, arg) --run
	if arg == nil
		CONS_Printf(p, "\132===\nLIST OF ACROBATICS TRICKSTYLES:\n===")
		CONS_Printf(p, "\133BURST \128| \136STORE \128| \131AUGMENT \128| \137STOMP")
		CONS_Printf(p, "\136===\nLIST OF ACROBATICS COMMANDS:\n===")
		CONS_Printf(p, "\136ac_trickstyle \130[BURST/STORE/AUGMENT] [STOMP (Battle)]")
		CONS_Printf(p, "\136ac_trickbtn \130[BRAKE/CUSTOM1]")
		CONS_Printf(p, "\136ac_trickreminder \130[ON/OFF]")
		CONS_Printf(p, "\136ac_textalignment \130[CENTERED/LEFT]")
		CONS_Printf(p, "\136ac_meterstyle \130[0 - 4]")
		CONS_Printf(p, "\136ac_barsnap \130[YES/NO]")
		CONS_Printf(p, "\136ac_augshow \130[POTENTIAL/RAW]")
		if (p == server) or IsPlayerAdmin(p) --wow so cool!
			CONS_Printf(p, "\135===\nLIST OF SERVER OWNER COMMANDS:\n===")
			CONS_Printf(p, "\135ac_active \139[ON/OFF]")
			CONS_Printf(p, "\135ac_forcetrick \139[FREESTYLE/BURST/STORE/AUGMENT]")
			CONS_Printf(p, "\135ac_acrohell \139[FORCED/DISABLED/HELLMAP]")
			CONS_Printf(p, "\135ac_textdebug \139[ON/OFF]")
		end
		CONS_Printf(p, "\128Type \131ac_help [command]\128 for more info on a command...")
		CONS_Printf(p, "\128...or, type \131ac_help [trickstyle]\128 for more on how a trickstyle works.")
		CONS_Printf(p, "\128Refer to \131https://kart.moe/acrobatics/\128 for a thorough, complete documentation.")
		S_StartSound(nil, sfx_acpick, p) 
		return
	end
	arg = tostring(arg):lower() 
	--angular takes 17 tries to understand table formatting dot png
	for o = 1, #helpmuhshitdude
		if arg == tostring(helpmuhshitdude[o].input):lower() 
			if o == #helpmuhshitdude then 
				helpmuhshitdude[o].msg = help_ee[P_RandomRange(1, #help_ee)] 
				while helpmuhshitdude[o].msg == lastEE --making a shitpost work elegantly needs a shitpost solution.
					helpmuhshitdude[o].msg = help_ee[P_RandomRange(1, #help_ee)]
				end
				lastEE = helpmuhshitdude[o].msg 
			end 
			CONS_Printf(p, helpmuhshitdude[o].cmod .. helpmuhshitdude[o].input .. ": \n" .. helpmuhshitdude[o].param .. "\n==========\n" .. helpmuhshitdude[o].msg) --strings, woo
			S_StartSound(nil, sfx_acpick, p) 
			return
		end
	end
	CONS_Printf(p, "\135Unknown command - try typing \131ac_help\135 by itself and seeing all the commands again.")
	S_StartSound(nil, sfx_trifal, p) 
end

COM_AddCommand("ac_help", acHelp)