--Draw SMS tutorial stuff.
rawset(_G, "SMS_TutorialDraw", function(s,p,v)
	if not s.health or p.exiting or p.sweepangle == nil
		return
	end
	--First, stuff that applies to all skins.	
	if (s.skin != "sms") --First, SMS only stuff.
		if (p.panim == PA_IDLE) and (p.rings >= 30)
		and A_SMScompatibleskin(s, true)
			v.drawString(5, 144, "\x84 C3: Transform", V_30TRANS|V_ALLOWLOWERCASE, "small")
		end	
		return --
	end
	
	--Now SMS only!
	//Atom Dive specific
	if p.smsdivetimer
		if not s.smsdropdash
			v.drawString(205, 152, "\x83 Spin: Drop Dash", V_20TRANS|V_ALLOWLOWERCASE, "small")
		else
			v.drawString(5, 136, "\x87 C2: Cancel Drop Dash", V_20TRANS|V_ALLOWLOWERCASE, "small")
			v.drawString(205, 152, "\x83 Spin: Drop Dash", V_70TRANS|V_ALLOWLOWERCASE, "small")
		end
		if p.hypermysticsonic
			v.drawString(205, 162, "\x85 Jump: Cancel Atomdive", V_20TRANS|V_ALLOWLOWERCASE, "small")
		elseif s.smsdropdash
			v.drawString(205, 162, "\x85 Jump: Cancel Drop Dash", V_20TRANS|V_ALLOWLOWERCASE, "small")				
		end
		return --
	elseif p.smsdivefloat or ((p.cmd.buttons & BT_WEAPONPREV) and p.hypermysticsonic and p.speed < s.scale)	
		v.drawString(205, 152, "\x83 Spin: Launch", V_30TRANS|V_ALLOWLOWERCASE, "small")	
		return --
	end
	
	--Both HMS and SMS forms apply on this.
	if p.smspickup
		v.drawString(140, 194, "\x85 Fire: Strong Throw", V_20TRANS|V_ALLOWLOWERCASE, "small")
		v.drawString(50, 194, "\x85 NFire: Strong Throw", V_20TRANS|V_ALLOWLOWERCASE, "small")
		v.drawString(5, 160, "\x86 TossFlag: Throw", V_20TRANS|V_ALLOWLOWERCASE, "small")
	else
		if s.smspkuret
			v.drawString(140, 194, "\x85 Fire: Pick Up", V_20TRANS|V_ALLOWLOWERCASE, "small")
			v.drawString(50, 194, "\x85 NFire: Pick Up", V_20TRANS|V_ALLOWLOWERCASE, "small")
		end
		v.drawString(5, 160, "\x86 TossFlag: Pick Up", V_20TRANS|V_ALLOWLOWERCASE, "small")
	end
	
	--Now, all the NON-Hyper Mystic Sonic stuff.
	if not p.hypermysticsonic
		if not (p.sms_boostlevel >= 65)
		and not ((s.eflags & MFE_UNDERWATER) and not p.hypermysticsonic)
			if not (p.cmd.buttons & BT_CUSTOM1)
				v.drawString(205, 144, "\x82 C1: Sprint", V_40TRANS|V_ALLOWLOWERCASE, "small")
			else
				v.drawString(205, 144, "\x82 C1: Sprint", V_70TRANS|V_ALLOWLOWERCASE, "small")
			end
		end

		if (p.pflags & PF_JUMPED) //Welcome to the land of jumps.
		or (s.state == S_SMS_AIRBOOST) 
		or p.sms_stompanim or p.hometrickanim

			if not (s.state == S_SMS_AIRBOOST)
 				if not (p.pflags & PF_THOKKED)
					v.drawString(205, 160, "\x85 Jump: Speed Thok", V_40TRANS|V_ALLOWLOWERCASE, "small")
				end
				if (s.state != S_SMS_ATOMDIVE)
					v.drawString(5, 152, "\x86 TossFlag: Atom Dive", V_60TRANS|V_ALLOWLOWERCASE, "small")
				end				
				if not ((p.pflags & PF_THOKKED) and (p.sms_wallstat and not p.sms_stompanim))
					if (p.cmd.buttons & BT_SPIN)
						if p.sms_wallstat
							v.drawString(205, 168, "\x83 Spin: Homing thok", V_70TRANS|V_ALLOWLOWERCASE, "small")
						else
							v.drawString(205, 168, "\x83 Spin: Multi-homing thok", V_70TRANS|V_ALLOWLOWERCASE, "small")
						end
						v.drawString(205, 176, "\x83 Homing Thok+forward > Walljump", V_70TRANS|V_ALLOWLOWERCASE, "small")
						v.drawString(205, 184, "\x83 Homing Thok > 180 Walljump", V_70TRANS|V_ALLOWLOWERCASE, "small")
					else
						if p.sms_wallstat
							v.drawString(205, 168, "\x83 Spin: Homing thok", V_30TRANS|V_ALLOWLOWERCASE, "small")
						else
							v.drawString(205, 168, "\x83 Spin: Multi-homing thok", V_30TRANS|V_ALLOWLOWERCASE, "small")
						end
						v.drawString(205, 176, "\x83 Homing Thok&forward > Walljump", V_30TRANS|V_ALLOWLOWERCASE, "small")
						v.drawString(205, 184, "\x83 Homing Thok > 180 Walljump", V_30TRANS|V_ALLOWLOWERCASE, "small")
					end
				end
			elseif not p.sms_stompanim and not p.sms_afterstompthok
				v.drawString(205, 152, "\x82 C1: Airboost", V_70TRANS|V_ALLOWLOWERCASE, "small")
			else
				v.drawString(205, 152, "\x82 C1: Airboost", V_40TRANS|V_ALLOWLOWERCASE, "small")
			end
		end
		
		if p.sms_stompanim or p.sms_afterstompthok
			v.drawString(5, 144, "\x87 C2: Stomp", V_70TRANS|V_ALLOWLOWERCASE, "small")
		elseif (p.pflags & PF_JUMPED) or p.hometrickanim or (p.panim == PA_SPRING) or (p.panim == PA_FALL)
			v.drawString(5, 144, "\x87 C2: Stomp", V_30TRANS|V_ALLOWLOWERCASE, "small")
		end
		if (p.pflags & PF_JUMPED) or p.hometrickanim
			if (p.rings > 49) and not s.battlemodsms
				v.drawString(5, 176, "\x84 C3: Transform", V_30TRANS|V_ALLOWLOWERCASE, "small")
			end
			v.drawString(5, 152, "\x86 TossFlag: Atom Dive", V_20TRANS|V_ALLOWLOWERCASE, "small")
		end
		if (p.sms_boostlevel >= 65)
		and not (s.SMS_BDboostloss and (p.pflags & PF_STARTDASH))
			if p.smseasyhaymaker
				v.drawString(5, 168, "\x81 C2: Comet Haymaker", ((p.sms_comethaymaker) and V_60TRANS or V_20TRANS)|V_ALLOWLOWERCASE, "small")
			else
				v.drawString(5, 168, "\x81 Back+C2: Comet Haymaker", ((p.sms_comethaymaker) and V_60TRANS or V_20TRANS)|V_ALLOWLOWERCASE, "small")
			end
		end
		
		if not p.smsdivefloat and not p.sms_dodging
		and not p.footsweepanim and not p.smsatomicdivefail
		and not p.smsatomdivestun
			if not p.sms_hugeflametoss
				if (p.cmd.buttons & BT_FIRENORMAL)
					v.drawString(50, 194, "\x85 NFire: Flametoss", V_70TRANS|V_ALLOWLOWERCASE, "small")
				else
					v.drawString(50, 194, "\x85 NFire: Flametoss", V_20TRANS|V_ALLOWLOWERCASE, "small")
				end
			end
			if (p.cmd.buttons & BT_ATTACK)
				v.drawString(140, 194, "\x85 Fire(Hold): Diffusion Flame", V_70TRANS|V_ALLOWLOWERCASE, "small")
			else
				v.drawString(140, 194, "\x85 Fire(Hold): Diffusion Flame", V_20TRANS|V_ALLOWLOWERCASE, "small")
			end
		end
		if p.sms_hugeflametoss
			if (p.cmd.buttons & BT_FIRENORMAL)
				v.drawString(50, 196, "\x85 NFire: Manual aim", V_70TRANS|V_ALLOWLOWERCASE, "small")
			else
				v.drawString(50, 196, "\x85 NFire: Manual aim", V_20TRANS|V_ALLOWLOWERCASE, "small")
			end
			v.drawString(5, 144, "\x87 C2: Manual aim", V_30TRANS|V_ALLOWLOWERCASE, "small")
			v.drawString(205, 168, "\x83 Spin: Manual aim", V_30TRANS|V_ALLOWLOWERCASE, "small")
		end
		if p.sms_ringburstfly				
			v.drawString(5, 144, "\x87 C2: Stomp Cancel", V_30TRANS|V_ALLOWLOWERCASE, "small")					
			if p.sms_ringburstfly == 1
				v.drawString(205, 152, "\x83 Spin: Horizontal Shift", V_30TRANS|V_ALLOWLOWERCASE, "small")
			elseif p.sms_ringburstfly == 3
				v.drawString(205, 152, "\x83 Spin: Recover", V_30TRANS|V_ALLOWLOWERCASE, "small")
			else
				v.drawString(205, 152, "\x83 Spin: Cancel Ringburst", V_30TRANS|V_ALLOWLOWERCASE, "small")					
			end				
		elseif p.sms_ringburst
			v.drawString(5, 160, "\x81 C1+C1: Ringburst", V_30TRANS|V_ALLOWLOWERCASE, "small")
		end		
	
		//Welcome to actual land!
		if P_IsObjectOnGround(s)	
			if not (p.pflags & PF_JUMPED)
				if not p.powers[pw_nocontrol]
				or p.powers[pw_carry] == CR_ROPEHANG	
					if not p.sms_dodging and not (p.footsweepanim and not p.footsweep01)
						v.drawString(5, 152, "\x87 Move Tap+C2: Dodge", V_30TRANS|V_ALLOWLOWERCASE, "small")
					elseif p.sms_dodging
						v.drawString(5, 152, "\x87 Move Tap+C2: Dodge", V_70TRANS|V_ALLOWLOWERCASE, "small")
					end
				end
				if not (p.sms_boostlevel >= 65)
				and not (p.powers[pw_sneakers] and (p.speed > 107*s.scale))
				and not p.sms_ringburst
					if not (s.eflags & MFE_UNDERWATER)
					and not (p.cmd.buttons & BT_CUSTOM1)
						if p.footsweepanim and not p.sms_dodging 
							v.drawString(5, 144, "\x87 C2: Triple Footsweep", V_60TRANS|V_ALLOWLOWERCASE, "small")
						elseif not (p.pflags & PF_SPINNING)
							v.drawString(5, 144, "\x87 C2: Triple Footsweep", V_30TRANS|V_ALLOWLOWERCASE, "small")
						end
					else
						if not (p.cmd.buttons & BT_CUSTOM1)
							if p.footsweepanim and not p.sms_dodging
								v.drawString(5, 144, "\x87 C2: Footsweep", V_60TRANS|V_ALLOWLOWERCASE, "small")
							elseif not (p.pflags & PF_SPINNING)
								v.drawString(5, 144, "\x87 C2: Footsweep", V_30TRANS|V_ALLOWLOWERCASE, "small")
							end
						end
					end
				end
			//	if p.lightdashenable and (p.pflags & PF_STARTDASH) and (p.dashspeed >= p.maxdash)
			//	v.drawString(5, 144, "\x87 C2: Lightspeed Attack", V_30TRANS|V_ALLOWLOWERCASE, "small")
			//	end
			
				if p.footsweepanim and (p.footsweep01 or p.footsweep02)
					v.drawString(205, 152, "\x85 Jump: Flip Leap", V_40TRANS|V_ALLOWLOWERCASE, "small")
					v.drawString(205, 160, "\x83 Spin: Spindash cancel", V_30TRANS|V_ALLOWLOWERCASE, "small")					
				elseif (p.speed > 5*s.scale)
					if not (p.pflags & PF_STARTDASH)
						v.drawString(205, 152, "\x83 Back+Spin = Moving SpinCharge", V_30TRANS|V_ALLOWLOWERCASE, "small")
					else
						v.drawString(205, 152, "\x83 Back+Spin = Moving SpinCharge", V_60TRANS|V_ALLOWLOWERCASE, "small")
					end
				elseif p.speed == 0 and not p.sms_ringburst
					if (p.cmd.buttons & BT_CUSTOM3) and not p.sms_ringburst
						v.drawString(5, 176, "\x84 C3: Powershare", V_70TRANS|V_ALLOWLOWERCASE, "small")
					elseif not p.sms_ringburst
						v.drawString(5, 176, "\x84 C3: Powershare", V_30TRANS|V_ALLOWLOWERCASE, "small")
					end
					if not (p.sms_tauntcooldown and (p.sms_tauntcooldown > 745)) and not (p.pflags & PF_SPINNING)
						if (p.cmd.buttons & BT_TOSSFLAG)
							v.drawString(5, 168, "\x86 TossFlag: Playertoss", V_60TRANS|V_ALLOWLOWERCASE, "small")
						else
							v.drawString(5, 168, "\x86 TossFlag: Playertoss", V_20TRANS|V_ALLOWLOWERCASE, "small")
						end
					end
					if (p.sms_tauntcooldown != nil) and not (netgame)
						if (p.sms_tauntcooldown >= 745)
							v.drawString(5, 136, "\x81 TossFlag+C2: Taunt", V_60TRANS|V_ALLOWLOWERCASE, "small")
						else
							v.drawString(5, 136, "\x81 TossFlag+C2: Taunt", V_30TRANS|V_ALLOWLOWERCASE, "small")
						end
					end
				end
				if (p.sms_boostlevel >= 65) 
				or p.powers[pw_sneakers] and (p.speed > 107*s.scale) 
				or p.sms_ringburst
					if (p.sms_boostlevel >= 65)
						if p.sms_comethaymaker
							v.drawString(5, 144, "\x87 C2: Comet Haymaker", V_60TRANS|V_ALLOWLOWERCASE, "small")
						else
							v.drawString(5, 144, "\x87 C2: Comet Haymaker", V_20TRANS|V_ALLOWLOWERCASE, "small")
						end
					end
					if (p.rings > 9)
						v.drawString(5, 160, "\x81 C1+C1: Ringburst", V_30TRANS|V_ALLOWLOWERCASE, "small")
					end
				end
			end
		end			 
		
	else //if p.hypermysticsonic --HMS specific stuff!
	
			if s.starthmscombo
				v.drawString(146, 192, "\x81 TossFlag>C2: Godbreaker", V_60TRANS|V_ALLOWLOWERCASE, "small")	
				return --
			end
			if (p.hmsblackhole > 36)
				v.drawString(50, 192, "\x81 NFire>Fire: Black Hole", V_70TRANS|V_ALLOWLOWERCASE, "small")
				return --
			end
			if (p.novafire > 40)
				v.drawString(50, 184, "\x85 Fire: Novablast", V_60TRANS|V_ALLOWLOWERCASE, "small")
				return --
			end
			if s.hmsgalaxystorm
				v.drawString(50, 184, "\x85 Fire: Galaxy Storm", V_70TRANS|V_ALLOWLOWERCASE, "small")
				return --
			end
			if (netgame or splitscreen)
				if not (p.cmd.buttons & BT_WEAPONNEXT)
					v.drawString(5, 176, "\x86 WEP_NEXT(Hold): Player Warp", V_20TRANS|V_ALLOWLOWERCASE, "small")
				else
					v.drawString(5, 176, "\x86 WEP_NEXT(Hold): Player Warp", V_60TRANS|V_ALLOWLOWERCASE, "small")
					v.drawString(205, 160, "\x83 Spin: Cancel Warp", V_30TRANS|V_ALLOWLOWERCASE, "small")
					v.drawString(205, 152, "\x85 Left/Right: Switch Target", V_30TRANS|V_ALLOWLOWERCASE, "small")
					return --
				end
			end
			
			--Aerial HMS stuff.
			if not P_IsObjectOnGround(s) 
				if p.smseasyhaymaker
					v.drawString(5, 128, "\x81 C2: Comet Haymaker", V_20TRANS|V_ALLOWLOWERCASE, "small")
				else
					v.drawString(5, 128, "\x81 Back+C2: Comet Haymaker", V_20TRANS|V_ALLOWLOWERCASE, "small")
				end			
				if (p.cmd.buttons & BT_SPIN)
					v.drawString(205, 160, "\x83 Spin: Boost", V_70TRANS|V_ALLOWLOWERCASE, "small")
					if not (p.cmd.buttons & BT_CUSTOM1)
						v.drawString(205, 152, "\x82 C1+Spin: HyperBoost", V_40TRANS|V_ALLOWLOWERCASE, "small")
					else
						v.drawString(205, 152, "\x82 C1+Spin: HyperBoost", V_70TRANS|V_ALLOWLOWERCASE, "small")
					end
				else
					v.drawString(205, 160, "\x83 Spin: Boost", V_30TRANS|V_ALLOWLOWERCASE, "small")
					v.drawString(205, 152, "\x82 C1+Spin: HyperBoost", V_40TRANS|V_ALLOWLOWERCASE, "small")
				end	
				
			else --if P_IsObjectOnGround(s) 
				if p.speed == 0
					if (p.cmd.buttons & BT_CUSTOM3)
						v.drawString(5, 168, "\x84 C3: Powershare/Untransform", V_70TRANS|V_ALLOWLOWERCASE, "small")
					elseif not p.sms_ringburst
						v.drawString(5, 168, "\x84 C3: Powershare/Untransform", V_30TRANS|V_ALLOWLOWERCASE, "small")
					end
				end	
				if (p.pflags & PF_STARTDASH)
					v.drawString(50, 184, "\x85 Fire: Galaxy Storm", V_20TRANS|V_ALLOWLOWERCASE, "small")
				else
					if p.hms_gravburstcd
						v.drawString(50, 184, "\x85 Fire: Gravity Burst", V_70TRANS|V_ALLOWLOWERCASE, "small")
					else
						v.drawString(50, 184, "\x85 Fire: Gravity Burst", V_20TRANS|V_ALLOWLOWERCASE, "small")
					end
				end
				if not (p.pflags & PF_SPINNING)
					if not (p.cmd.buttons & BT_TOSSFLAG)
						v.drawString(5, 136, "\x87 C2: Comet Haymaker", V_20TRANS|V_ALLOWLOWERCASE, "small")
					end
				else
					v.drawString(5, 136, "\x87 C2: Unspin", V_20TRANS|V_ALLOWLOWERCASE, "small")
				end
				if (p.speed > s.scale*5)
					if not (p.pflags & PF_STARTDASH)
						v.drawString(205, 152, "\x83"+"Back+Spin = Moving SpinCharge", V_30TRANS|V_ALLOWLOWERCASE, "small")
					else
						v.drawString(205, 152, "\x83"+"Back+Spin = Moving SpinCharge", V_70TRANS|V_ALLOWLOWERCASE, "small")
					end	
				end				
			end			
			
			if not p.smspickup and not s.smspkuret
				if (p.cmd.buttons & BT_FIRENORMAL) and not (p.pflags & PF_STARTDASH)
					v.drawString(146, 184, "\x85 NFire: Flamebringer", V_60TRANS|V_ALLOWLOWERCASE, "small")
				elseif not (p.pflags & PF_STARTDASH)
					v.drawString(146, 184, "\x85 NFire: Flamebringer", V_20TRANS|V_ALLOWLOWERCASE, "small")
				end
				if (p.pflags & PF_STARTDASH)
					v.drawString(146, 184, "\x85 NFire: Armagedon Blast", V_20TRANS|V_ALLOWLOWERCASE, "small")
				end
			end
			if not (p.cmd.buttons & BT_WEAPONPREV)
				v.drawString(5, 144, "\x86 WEP_PREV: Teleport-Dash", V_20TRANS|V_ALLOWLOWERCASE, "small")
				v.drawString(5, 152, "\x86 WEP_PREV(Hold): Atom Dive", V_20TRANS|V_ALLOWLOWERCASE, "small")
			else
				v.drawString(5, 144, "\x86 WEP_PREV: Teleport-Dash", V_60TRANS|V_ALLOWLOWERCASE, "small")
				v.drawString(5, 152, "\x86 WEP_PREV(Hold): Atom Dive", V_60TRANS|V_ALLOWLOWERCASE, "small")
				v.drawString(205, 152, "\x83 Spin: Launch", V_20TRANS|V_ALLOWLOWERCASE, "small")
				return --
			end
			if not s.SMS_locked
				v.drawString(146, 192, "\x81 TossFlag>C2: Godbreaker", V_20TRANS|V_ALLOWLOWERCASE, "small")
			end			
	end
end)