Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adam_rsf & gelatin changes #1

Merged
merged 2 commits into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 53 additions & 14 deletions disp_hitboxes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ local display_pushboxes = true
local display_throwboxes = true
local display_throwhurtboxes = true
local display_proximityboxes = true
local display_properties = true
local hide_p2 = false
local changed
local gBattle
Expand All @@ -16,10 +17,11 @@ local reversePairs = function ( aTable )

local n = 0

return function ( )
n = n + 1
return keys[n], aTable[keys[n] ]
end
return function ( )
n = n + 1
if n > #keys then return nil, nil end
return keys[n], aTable[keys[n] ]
end
end

re.on_draw_ui(function()
Expand All @@ -30,6 +32,7 @@ re.on_draw_ui(function()
changed, display_throwboxes = imgui.checkbox("Display Throw Boxes", display_throwboxes)
changed, display_throwhurtboxes = imgui.checkbox("Display Throw Hurtboxes", display_throwhurtboxes)
changed, display_proximityboxes = imgui.checkbox("Display Proximity Boxes", display_proximityboxes)
changed, display_properties = imgui.checkbox("Display Properties", display_properties)
changed, hide_p2 = imgui.checkbox("Hide P2 Boxes", hide_p2)
imgui.tree_pop()
end
Expand Down Expand Up @@ -69,12 +72,12 @@ re.on_frame(function()
if rect.TypeFlag > 0 and display_hitboxes then
draw.outline_rect(finalPosX, finalPosY, finalSclX, finalSclY, 0xFF0040C0)
draw.filled_rect(finalPosX, finalPosY, finalSclX, finalSclY, 0x600040C0)
elseif rect.CondFlag & 0x2C0 == 0x2C0 and display_throwboxes then
elseif (rect.TypeFlag == 0 and rect.PoseBit > 0) and display_throwboxes then
draw.outline_rect(finalPosX, finalPosY, finalSclX, finalSclY, 0xFFD080FF)
draw.filled_rect(finalPosX, finalPosY, finalSclX, finalSclY, 0x60D080FF)
elseif display_proximityboxes then
draw.outline_rect(finalPosX, finalPosY, finalSclX, finalSclY, 0xFFFF0080)
draw.filled_rect(finalPosX, finalPosY, finalSclX, finalSclY, 0x40FF0080)
draw.outline_rect(finalPosX, finalPosY, finalSclX, finalSclY, 0xFF5b5b5b)
draw.filled_rect(finalPosX, finalPosY, finalSclX, finalSclY, 0x405b5b5b)
end
elseif rect:get_field("Attr") ~= nil then
if display_pushboxes then
Expand All @@ -83,8 +86,26 @@ re.on_frame(function()
end
elseif rect:get_field("HitNo") ~= nil then
if display_hurtboxes then
draw.outline_rect(finalPosX, finalPosY, finalSclX, finalSclY, 0xFF00FF00)
draw.filled_rect(finalPosX, finalPosY, finalSclX, finalSclY, 0x4000FF00)
if rect.Type == 2 or rect.Type == 1 then
draw.outline_rect(finalPosX, finalPosY, finalSclX, finalSclY, 0xFFFF0080)
draw.filled_rect(finalPosX, finalPosY, finalSclX, finalSclY, 0x40FF0080)
else
draw.outline_rect(finalPosX, finalPosY, finalSclX, finalSclY, 0xFF00FF00)
draw.filled_rect(finalPosX, finalPosY, finalSclX, finalSclY, 0x4000FF00)
end
if rect.TypeFlag == 1 and rect.Immune == 4 and display_properties then
draw.text("Air Strike Inv", finalPosX, finalPosY + (finalSclY / 2), 0xFFFFFF00)
draw.text("Projectile Inv", finalPosX, finalPosY + (finalSclY / 2) - 10, 0xFFFFFF00)
elseif rect.TypeFlag == 2 and rect.Immune == 4 and display_properties then
draw.text("Strike Inv", finalPosX, finalPosY + (finalSclY / 2), 0xFFFFFF00)
draw.text("Projectile Inv", finalPosX, finalPosY + (finalSclY / 2) - 10, 0xFFFFFF00)
elseif rect.TypeFlag == 1 and display_properties then
draw.text("Projectile Inv", finalPosX, finalPosY + (finalSclY / 2), 0xFFFFFF00)
elseif rect.Immune == 4 and display_properties then
draw.text("Air Strike Inv", finalPosX, finalPosY + (finalSclY / 2), 0xFFFFFF00)
elseif rect.TypeFlag == 2 and display_properties then
draw.text("Strike Inv", finalPosX, finalPosY + (finalSclY / 2), 0xFFFFFF00)
end
end
elseif display_throwboxes then
draw.outline_rect(finalPosX, finalPosY, finalSclX, finalSclY, 0xFFFF0000)
Expand Down Expand Up @@ -127,12 +148,12 @@ re.on_frame(function()
if rect.TypeFlag > 0 and display_hitboxes then
draw.outline_rect(finalPosX, finalPosY, finalSclX, finalSclY, 0xFF0040C0)
draw.filled_rect(finalPosX, finalPosY, finalSclX, finalSclY, 0x600040C0)
elseif rect.CondFlag & 0x2C0 == 0x2C0 and display_throwboxes then
elseif (rect.TypeFlag == 0 and rect.PoseBit > 0) and display_throwboxes then
draw.outline_rect(finalPosX, finalPosY, finalSclX, finalSclY, 0xFFD080FF)
draw.filled_rect(finalPosX, finalPosY, finalSclX, finalSclY, 0x60D080FF)
elseif display_proximityboxes then
draw.outline_rect(finalPosX, finalPosY, finalSclX, finalSclY, 0xFFFF0080)
draw.filled_rect(finalPosX, finalPosY, finalSclX, finalSclY, 0x40FF0080)
draw.outline_rect(finalPosX, finalPosY, finalSclX, finalSclY, 0xFF5b5b5b)
draw.filled_rect(finalPosX, finalPosY, finalSclX, finalSclY, 0x405b5b5b)
end
elseif rect:get_field("Attr") ~= nil then
if display_pushboxes then
Expand All @@ -141,8 +162,26 @@ re.on_frame(function()
end
elseif rect:get_field("HitNo") ~= nil then
if display_hurtboxes then
draw.outline_rect(finalPosX, finalPosY, finalSclX, finalSclY, 0xFF00FF00)
draw.filled_rect(finalPosX, finalPosY, finalSclX, finalSclY, 0x4000FF00)
if rect.Type == 2 or rect.Type == 1 then
draw.outline_rect(finalPosX, finalPosY, finalSclX, finalSclY, 0xFFFF0080)
draw.filled_rect(finalPosX, finalPosY, finalSclX, finalSclY, 0x40FF0080)
else
draw.outline_rect(finalPosX, finalPosY, finalSclX, finalSclY, 0xFF00FF00)
draw.filled_rect(finalPosX, finalPosY, finalSclX, finalSclY, 0x4000FF00)
end
if rect.TypeFlag == 1 and rect.Immune == 4 and display_properties then
draw.text("Air Strike Inv", finalPosX, finalPosY + (finalSclY / 2), 0xFFFFFF00)
draw.text("Projectile Inv", finalPosX, finalPosY + (finalSclY / 2) - 10, 0xFFFFFF00)
elseif rect.TypeFlag == 2 and rect.Immune == 4 and display_properties then
draw.text("Strike Inv", finalPosX, finalPosY + (finalSclY / 2), 0xFFFFFF00)
draw.text("Projectile Inv", finalPosX, finalPosY + (finalSclY / 2) - 10, 0xFFFFFF00)
elseif rect.TypeFlag == 1 and display_properties then
draw.text("Projectile Inv", finalPosX, finalPosY + (finalSclY / 2), 0xFFFFFF00)
elseif rect.Immune == 4 and display_properties then
draw.text("Air Strike Inv", finalPosX, finalPosY + (finalSclY / 2), 0xFFFFFF00)
elseif rect.TypeFlag == 2 and display_properties then
draw.text("Strike Inv", finalPosX, finalPosY + (finalSclY / 2), 0xFFFFFF00)
end
end
elseif display_throwboxes then
draw.outline_rect(finalPosX, finalPosY, finalSclX, finalSclY, 0xFFFF0000)
Expand Down
45 changes: 32 additions & 13 deletions info_display.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,34 +49,42 @@ re.on_frame(function()
local cPlayer = sPlayer.mcPlayer
local BattleTeam = gBattle:get_field("Team"):get_data(nil)
local cTeam = BattleTeam.mcTeam

p1.posX = cPlayer[0].pos.x.v / 65336.0
p1.posY = cPlayer[0].pos.y.v / 65336.0
p1.spdX = cPlayer[0].speed.x.v / 65336.0
p1.spdY = cPlayer[0].speed.y.v / 65336.0
p1.aclX = cPlayer[0].alpha.x.v / 65336.0
p1.aclY = cPlayer[0].alpha.y.v / 65336.0
local storageData = gBattle:get_field("Command"):get_data(nil).StorageData
local p1ChargeInfo = storageData.UserEngines[0].m_charge_infos

p1.mActionId = cPlayer[0].mActionId
p1.posX = cPlayer[0].pos.x.v / 65536.0
p1.posY = cPlayer[0].pos.y.v / 65536.0
p1.spdX = cPlayer[0].speed.x.v / 65536.0
p1.spdY = cPlayer[0].speed.y.v / 65536.0
p1.aclX = cPlayer[0].alpha.x.v / 65536.0
p1.aclY = cPlayer[0].alpha.y.v / 65536.0
p1.dir = bitand(cPlayer[0].BitValue, 128) == 128
p1.hitstop = cPlayer[0].hit_stop
p1.stance = cPlayer[0].pose_st
p1.juggle = cPlayer[0].combo_dm_air
p1.drive = cPlayer[0].focus_new
p1.drive_cooldown = cPlayer[0].focus_wait
p1.super = cTeam[0].mSuperGauge
p1.chargeInfo = p1ChargeInfo

p2.posX = cPlayer[1].pos.x.v / 65336.0
p2.posY = cPlayer[1].pos.y.v / 65336.0
p2.spdX = cPlayer[1].speed.x.v / 65336.0
p2.spdY = cPlayer[1].speed.y.v / 65336.0
p2.aclX = cPlayer[1].alpha.x.v / 65336.0
p2.aclY = cPlayer[1].alpha.y.v / 65336.0
p2.mActionId = cPlayer[1].mActionId
p2.posX = cPlayer[1].pos.x.v / 65536.0
p2.posY = cPlayer[1].pos.y.v / 65536.0
p2.spdX = cPlayer[1].speed.x.v / 65536.0
p2.spdY = cPlayer[1].speed.y.v / 65536.0
p2.aclX = cPlayer[1].alpha.x.v / 65536.0
p2.aclY = cPlayer[1].alpha.y.v / 65536.0
p2.dir = bitand(cPlayer[1].BitValue, 128) == 128
p2.hitstop = cPlayer[1].hit_stop
p2.stance = cPlayer[1].pose_st
p2.juggle = cPlayer[1].combo_dm_air
p2.drive = cPlayer[1].focus_new
p2.drive_cooldown = cPlayer[1].focus_wait
p2.super = cTeam[1].mSuperGauge

if imgui.tree_node("P1 Info") then
imgui.text("P1 Action ID: " .. p1.mActionId)
imgui.text("Position X: " .. p1.posX)
imgui.text("Position Y: " .. p1.posY)
imgui.text("Speed X: " .. p1.spdX)
Expand All @@ -98,11 +106,21 @@ re.on_frame(function()
end
imgui.text("Juggle Counter: " .. p2.juggle)
imgui.text("Drive Gauge: " .. p1.drive)
imgui.text("Drive Cooldown: " .. p1.drive_cooldown)
imgui.text("Super Gauge: " .. p1.super)
if p1.chargeInfo:get_Count() > 0 then
imgui.text("Move 1 Charge Time: " .. p1.chargeInfo:get_Values()._dictionary._entries[0].value.charge_frame)
imgui.text("Move 1 Charge Keep Time: " .. p1.chargeInfo:get_Values()._dictionary._entries[0].value.keep_frame)
imgui.text("Move 2 Charge Time: " .. p1.chargeInfo:get_Values()._dictionary._entries[1].value.charge_frame)
imgui.text("Move 2 Charge Keep Time: " .. p1.chargeInfo:get_Values()._dictionary._entries[1].value.keep_frame)
imgui.text("Move 3 Charge Time: " .. p1.chargeInfo:get_Values()._dictionary._entries[2].value.charge_frame)
imgui.text("Move 3 Charge Keep Time: " .. p1.chargeInfo:get_Values()._dictionary._entries[2].value.keep_frame)
end
imgui.tree_pop()
end

if imgui.tree_node("P2 Info") then
imgui.text("P1 Action ID: " .. p1.mActionId)
imgui.text("Position X: " .. p2.posX)
imgui.text("Position Y: " .. p2.posY)
imgui.text("Speed X: " .. p2.spdX)
Expand All @@ -124,6 +142,7 @@ re.on_frame(function()
end
imgui.text("Juggle Counter: " .. p1.juggle)
imgui.text("Drive Gauge: " .. p2.drive)
imgui.text("Drive Cooldown: " .. p2.drive_cooldown)
imgui.text("Super Gauge: " .. p2.super)
imgui.tree_pop()
end
Expand Down