User File #37758217365144749

Upload All User Files

#37758217365144749 - Crash Bandicoot Huge Adventure - lua v2.13

CrashGBA - v2.13 BizHawk.lua
1132 downloads
Uploaded 3/19/2017 10:25 AM by Spikestuff (see all 287)
HA IT WASN'T A "c"
-- Crash Huge Adventure lua v2.13 BizHawk
-- This is Community Work Please Help
-- Join in add updates of your own and add your name

-- Values Found by: Spikestuff
-- Script Code by: Spikestuff, Ilari, Dica, Warepire

function flying()
	memory.usememorydomain("IWRAM")
	-- Shooting Cooldown
	local cooldwn = memory.readbyte(0x14E0)-1
	if cooldwn ~= -1 then
		gui.text(0,118,"Cooldown: " .. cooldwn)
	end
end

function ngin()
	memory.usememorydomain("IWRAM")
	local bombhealth = memory.read_s8(0x4130)
	local turthealth = memory.read_u8(0x40B0)
	local lefthealth = memory.read_u16_le(0x41B0)
	local righthealth = memory.read_u16_le(0x4230)

	if not (bombhealth == 255 or bombhealth == -1) then
		gui.text(30,70,"Bomb: " .. (bombhealth+1)/2) 
	end
	if not (lefthealth == 0 and righthealth == 0) then
		gui.text(0,86,"Rockets: " .. (lefthealth/2) .. "/" .. (righthealth/2))
	end
	if not (turthealth == 255 or turthealth == -1) then
		gui.text(10,102,"Turret: " .. (turthealth+1)/2)
	end
	memory.usememorydomain("EWRAM")
end

function bonus()
	gui.text(0,70,"Pixel X: " .. memory.read_u32_le(0x010E2C))
	gui.text(0,86,"Pixel Y: " .. memory.read_u32_le(0x010E30))
	gui.text(0,102,"Speed X: " .. memory.read_s16_le(0x010E8C))
	gui.text(0,118,"Speed Y: " .. memory.read_s16_le(0x010E90))
	gui.text(0,276,"Slide Time: 22/" .. memory.read_s16_le(0x0111F4),"orange")
	gui.text(0,292," Spin Time: 23/" .. memory.read_s16_le(0x0111F4),"orange")
end

function normal_lvl(area)
	gui.text(0,70,"Pixel X: " .. memory.read_u32_le(0x010A14))
	gui.text(0,86,"Pixel Y: " .. memory.read_u32_le(0x010A18))
	gui.text(0,102,"Speed X: " .. memory.read_s16_le(0x010A74))
	gui.text(0,118,"Speed Y: " .. memory.read_s16_le(0x010A78))
end

function ground()
	gui.text(0,276,"Slide Time: 22/" .. memory.read_s16_le(0x010DDC),"yellow")
	gui.text(0,292," Spin Time: 23/" .. memory.read_s16_le(0x010DDC),"yellow")
end

function water()
	gui.text(0,292," Spin Dur.: 24/" .. memory.read_s16_le(0x010DDC),"lime")
end

function neocortex()
	gui.drawBox(-1,142,240,160,"null","black")
	gui.text(330,286,"Pixel X: " .. memory.read_u32_le(0x010A14))
	gui.text(330,300,"Pixel Y: " .. memory.read_u32_le(0x010A18))
	gui.text(180,286,"Speed X: " .. memory.read_s16_le(0x010A74))
	gui.text(180,300,"Speed Y: " .. memory.read_s16_le(0x010A78))
	gui.text(0,286,"Slide: 22/" .. memory.read_s16_le(0x010DDC),"yellow")
	gui.text(0,300," Spin: 23/" .. memory.read_s16_le(0x010DDC),"yellow")
end

function dingodile()
	local dshi = memory.readbyte(0x003EFC)
	local dhia = memory.readbyte(0x011851)
	local dhib = memory.readbyte(0x0118B4)
	gui.text(0,286,"Shield: " .. ((dshi == 1) and "ON" or "OFF"))
	
	if dhia == 5 and dhib == 8 then
		gui.text(0,300,"Hit?: NOW")
	elseif dhia == 0 and dhib == 7 then
		gui.text(0,300,"Hit?: NOW")
	elseif dhia == 0 and dhib == 2 then
		gui.text(0,300,"Hit?: SOON")
	else
		gui.text(0,300,"Hit?: NO")
	end
end

function tiny()
--maybe
end

function warp_room()
	-- Mask Level Checking
	gui.text(175,30,"Mask Level: " .. memory.readbyte(0x00009C),"yellow")
end

while true do
	memory.usememorydomain("IWRAM")
	local area = memory.readbyte(0x1644)
	local areab = memory.readbyte(0x0830)

	if not (area == 11 or area == 13 or area == 14 or area == 15 or area == 16 or area == 17) then
		if area == 5 or area == 9 then
			gui.text(0,134,memory.read_s16_le(0x1404),"orange")
		elseif area == 2 and areab == 1 or area == 18 then
			gui.text(0,134,memory.read_s16_le(0x1404),"yellow")
		else
			gui.text(0,134,memory.read_s16_le(0x082C),"yellow")
		end
	end


	memory.usememorydomain("EWRAM")
	local lvl = memory.readbyte(0x0000E8)

	if area == 16 then
		warp_room()
	elseif area == 9 then
		ngin()
		flying()
	elseif lvl == 20 and area == 8 then
		dingodile()
		normal_lvl()
	elseif lvl == 22 and area == 7 then
		tiny()
		normal_lvl()
	elseif area == 6 then
		bonus()
	elseif area == 5 or area == 9 then
		flying()
	elseif area == 10 then
		neocortex()
	elseif areab == 1 then
	else
		normal_lvl()
		if area == 1 or area == 8 then
			water()
		else
			ground()
		end
	end
	emu.frameadvance()
end