//Golden Crawla script
//I wanted to make it drop rings upon defeat, just so it can differentiate itself a little more from the vanilla Crawlas.

//Here's what happened sometimes when cooking up this script:
// - the lua wouldn't work (maybe i was doing something wrong back there)
// - the game would crash upon collecting the dropped ring (annoyed me a lot lmao)
// - I N F I N I T E  R I N G S  (no really, everything dropped infinite rings and even the level rings were infinite)

//By the way, big thanks to NARbluebear and Sebo2205 for helping me out a bit with the script. Seriously, you guys rock.
//Anyway here's what I came up with for this lol.

freeslot("MT_GOLDCRAWLA")

//Spawn Rings upon defeat
addHook("MobjDeath", function(MT_GOLDCRAWLA)
	P_SpawnMobjFromMobj(MT_GOLDCRAWLA, 0, 0, 0, MT_RING)
	P_SpawnMobjFromMobj(MT_GOLDCRAWLA, 3*FRACUNIT, 20*FRACUNIT, 0, MT_RING)
	P_SpawnMobjFromMobj(MT_GOLDCRAWLA, 19*FRACUNIT, 4*FRACUNIT, 0, MT_RING)
end, MT_GOLDCRAWLA)

//Henry Stickmin compatibility - custom fail screen
if not (henryDeathText)
	rawset(_G, "henryDeathText", {})
	rawset(_G, "henryDeathText2", {})
	rawset(_G, "henryDeathText3", {})
	rawset(_G, "henryDeathText4", {})
	rawset(_G, "henryDeathText5", {})
	rawset(_G, "henryDeathText6", {})
	rawset(_G, "henryDeathText7", {})
	rawset(_G, "henryDeathText8", {})
	rawset(_G, "henryDeathText9", {})
	rawset(_G, "henryDeathText10", {})
end

henryDeathText[MT_GOLDCRAWLA] = "If you actually died to an enemy like THAT,"
henryDeathText2[MT_GOLDCRAWLA] = "you probably shouldn't be playing SRB2."