Skip to content

Commit

Permalink
Quick fixes and additions.
Browse files Browse the repository at this point in the history
  • Loading branch information
stvene3004 authored Sep 7, 2024
1 parent d10b5fc commit 5694d5b
Show file tree
Hide file tree
Showing 13 changed files with 436 additions and 310 deletions.
Binary file modified actors/amy_rose_geo.bin
Binary file not shown.
Binary file modified actors/amy_rose_winter_geo.bin
Binary file not shown.
Binary file added actors/knuckles_geo.bin
Binary file not shown.
Binary file modified actors/sonic_geo.bin
Binary file not shown.
Binary file modified actors/spinball_geo.bin
Binary file not shown.
84 changes: 84 additions & 0 deletions animations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2403,6 +2403,90 @@ smlua_anim_util_register_animation("SONIC_EXIT_LEVEL",

})

smlua_anim_util_register_animation("SONIC_WINDMILL_KICK",
1,
0,
0,
0,
10,
{0x0000, 0x00BD, 0x0000, 0x0010, 0x0028, 0x0035, 0x003E, 0x0045, 0x004A,
0x004D, 0x004E, 0x004F, 0x0000, 0x3FFF, 0x0000, 0xFFFF, 0xFB9E, 0xF537,
0xF1A8, 0xEEFB, 0xED10, 0xEBC8, 0xEB00, 0xEA9A, 0xEA74, 0xEA6F, 0x0000,
0x0011, 0x0029, 0x0036, 0x0040, 0x0048, 0x004D, 0x0050, 0x0051, 0x0052,
0x40A1, 0x3D63, 0x38A6, 0x3604, 0x340A, 0x329F, 0x31AB, 0x3118, 0x30CC,
0x30B0, 0x30AC, 0xFFFF, 0x0288, 0x063B, 0x084A, 0x09D5, 0x0AF1, 0x0BAF,
0x0C22, 0x0C5E, 0x0C73, 0x0C76, 0x0000, 0x0007, 0x0010, 0x0016, 0x001A,
0x001C, 0x001E, 0x0020, 0xF820, 0xF988, 0xFB97, 0xFCBC, 0xFD98, 0xFE35,
0xFE9F, 0xFEDF, 0xFF00, 0xFF0C, 0xFF0E, 0xFFFF, 0x01DD, 0x0496, 0x0619,
0x073D, 0x080D, 0x0899, 0x08EE, 0x091A, 0x092A, 0x092C, 0xFFFF, 0xFF5E,
0xFE74, 0xFDF2, 0xFD90, 0xFD4A, 0xFD1B, 0xFCFE, 0xFCEF, 0xFCEA, 0xFCE9,
0x0D75, 0x0D8F, 0x0DB5, 0x0DCA, 0x0DDA, 0x0DE6, 0x0DED, 0x0DF2, 0x0DF4,
0x0DF5, 0xFFFE, 0x0001, 0xC170, 0xFD05, 0xEEE4, 0xDA3E, 0xCEC4, 0xC623,
0xBFF5, 0xBBD1, 0xB94D, 0xB803, 0xB789, 0xB778, 0xE176, 0xE294, 0xE436,
0xE51F, 0xE5CD, 0xE64A, 0xE69E, 0xE6D1, 0xE6EB, 0xE6F5, 0xE6F6, 0xC49A,
0xD38B, 0xE962, 0xF585, 0xFEA5, 0x052F, 0x0991, 0x0C39, 0x0D97, 0x0E17,
0x0E2A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0000, 0xC5DC, 0xD1A2, 0xE2D7, 0xEC68,
0xF399, 0xF8C0, 0xFC34, 0xFE4C, 0xFF5F, 0xFFC4, 0xFFD3, 0xFF89, 0xFEEB,
0xFE03, 0xFD82, 0xFD21, 0xFCDC, 0xFCAE, 0xFC91, 0xFC83, 0xFC7E, 0xFC7D,
0xF97F, 0xF9B3, 0xF9FF, 0xFA2A, 0xFA4A, 0xFA60, 0xFA70, 0xFA79, 0xFA7E,
0xFA7F, 0xFA80, 0xF06E, 0xF490, 0xFA9B, 0xFDF7, 0x007E, 0x024D, 0x0383,
0x043F, 0x04A0, 0x04C4, 0x04C9, 0xFFFE, 0x0001, 0xC170, 0x091C, 0x1628,
0x293B, 0x33D5, 0x3BCD, 0x4182, 0x4556, 0x47A8, 0x48D9, 0x4949, 0x495A,
0x1F32, 0x1EDB, 0x1E5C, 0x1E15, 0x1DE0, 0x1DBA, 0x1DA0, 0x1D91, 0x1D89,
0x1D86, 0x1D85, 0xC4FA, 0xD442, 0xEA98, 0xF703, 0x0058, 0x0708, 0x0B83,
0x0E3B, 0x0FA1, 0x1024, 0x1037, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0xFFFF,
0x0000, 0x0000, 0x0000, 0x0000, 0xFFFF, 0x0000, 0xC8DA, 0xD4AA, 0xE5ED,
0xEF86, 0xF6BD, 0xFBE8, 0xFF5F, 0x017A, 0x028E, 0x02F4, 0x0302, 0x0000,
0xFFFF, 0x0000, 0x0000, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0x0000,
0xFFFF, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0x0000, 0xFFFF,
0xED8B, 0xF190, 0xF76F, 0xFAB3, 0xFD27, 0xFEE9, 0x0018, 0x00CF, 0x012D,
0x014F, 0x0154, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0xFFFF,
0x0000, 0xFFFF, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0xFFFF,
0xFFFF, 0x0000, 0x0000, 0x0000, 0xFFFF, 0xBF5E, 0x0041, 0xFF32, 0xFDA8,
0xFCCC, 0xFC27, 0xFBB1, 0xFB62, 0xFB32, 0xFB1A, 0xFB10, 0xFB0F, 0x0055,
0xFC11, 0xF5D6, 0xF25F, 0xEFC5, 0xEDE7, 0xECA7, 0xEBE5, 0xEB81, 0xEB5D,
0xEB57, 0x8266, 0x8404, 0x8661, 0x87B1, 0x88AE, 0x8963, 0x89DD, 0x8A26,
0x8A4C, 0x8A5A, 0x8A5C, 0xFFFA, 0xFFFB, 0xFFFC, 0xFFFD, 0xFFFE, 0xFFFE,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0000, 0x0055, 0x0044, 0x002B, 0x001D,
0x0012, 0x000A, 0x0005, 0x0002, 0x0001, 0x0000, 0x33B1, 0x2A44, 0x1C7E,
0x14D6, 0x0F14, 0x0AF5, 0x0831, 0x0684, 0x05A8, 0x0557, 0x054B, 0x00B8,
0x00B1, 0x00A7, 0x00A1, 0x009C, 0x0099, 0x0097, 0x0096, 0x0095, 0xFF27,
0xFF20, 0xFF17, 0xFF12, 0xFF0E, 0xFF0C, 0xFF0A, 0xFF09, 0xFF08, 0xBA69,
0xBE09, 0xC355, 0xC647, 0xC87E, 0xCA14, 0xCB24, 0xCBC9, 0xCC1E, 0xCC3D,
0xCC41, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0xFFFF, 0x0000,
0xFFFF, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0xFFFF, 0xFFFF,
0x0000, 0x0000, 0x0000, 0xFFFF, 0xBF5E, 0xFEE8, 0xFB27, 0xF5AA, 0xF29E,
0xF053, 0xEEAE, 0xED95, 0xECEA, 0xEC92, 0xEC71, 0xEC6D, 0xFF3E, 0xFCE2,
0xF96F, 0xF784, 0xF614, 0xF50B, 0xF45A, 0xF3EF, 0xF3B7, 0xF3A3, 0xF3A0,
0xC74D, 0xC183, 0xB90D, 0xB459, 0xB0D0, 0xAE48, 0xAC95, 0xAB8E, 0xAB06,
0xAAD4, 0xAACD, 0xFFF8, 0xFFFA, 0xFFFC, 0xFFFD, 0xFFFE, 0xFFFE, 0xFFFF,
0xFFFF, 0xFFFF, 0xFFFF, 0x0000, 0xFEC9, 0xFF08, 0xFF64, 0xFF97, 0xFFBE,
0xFFD9, 0xFFEC, 0xFFF7, 0xFFFD, 0xFFFF, 0x0000, 0x2CFD, 0x3554, 0x4183,
0x4849, 0x4D61, 0x5107, 0x5378, 0x54F4, 0x55B7, 0x55FF, 0x5609, 0x0137,
0x00EC, 0x007F, 0x0043, 0x0015, 0xFFF3, 0xFFDD, 0xFFD0, 0xFFC9, 0xFFC7,
0x020C, 0x01F5, 0x01D3, 0x01C0, 0x01B1, 0x01A7, 0x01A0, 0x019C, 0x019A,
0x0199, 0xEFD4, 0xEDE2, 0xEB0A, 0xE975, 0xE845, 0xE76B, 0xE6D9, 0xE680,
0xE652, 0xE642, 0xE63F,
},
{
0x0001, 0x0000, 0x0001, 0x0001, 0x000A, 0x0002, 0x0001, 0x000C, 0x0001,
0x000D, 0x0001, 0x000E, 0x000B, 0x000F, 0x000A, 0x001A, 0x000B, 0x0024,
0x000B, 0x002F, 0x0008, 0x003A, 0x000B, 0x0042, 0x000B, 0x004D, 0x000B,
0x0058, 0x000A, 0x0063, 0x0001, 0x006D, 0x0001, 0x006E, 0x0001, 0x006F,
0x000B, 0x0070, 0x000B, 0x007B, 0x000B, 0x0086, 0x000B, 0x0091, 0x000B,
0x009C, 0x000B, 0x00A7, 0x000B, 0x00B2, 0x000B, 0x00BD, 0x000B, 0x00C8,
0x0001, 0x00D3, 0x0001, 0x00D4, 0x0001, 0x00D5, 0x000B, 0x00D6, 0x000B,
0x00E1, 0x000B, 0x00EC, 0x000A, 0x00F7, 0x0001, 0x0101, 0x000B, 0x0102,
0x0008, 0x010D, 0x000B, 0x0115, 0x000B, 0x0120, 0x000B, 0x012B, 0x000A,
0x0136, 0x0001, 0x0140, 0x000B, 0x0141, 0x000B, 0x014C, 0x000B, 0x0157,
0x000B, 0x0162, 0x000A, 0x016D, 0x000B, 0x0177, 0x0009, 0x0182, 0x0009,
0x018B, 0x000B, 0x0194, 0x000B, 0x019F, 0x000A, 0x01AA, 0x0001, 0x01B4,
0x000B, 0x01B5, 0x000B, 0x01C0, 0x000B, 0x01CB, 0x000B, 0x01D6, 0x000B,
0x01E1, 0x000B, 0x01EC, 0x000A, 0x01F7, 0x000A, 0x0201, 0x000B, 0x020B,
})

smlua_anim_util_register_animation("VANILLA_SPINNING",
0,
189,
Expand Down
2 changes: 1 addition & 1 deletion b-sonic-water.lua
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ function act_sonic_water_walking(m)
if m.heldObj ~= nil then
anim_and_audio_for_hold_walk(m)
else
sonic_anim_and_audio_for_walk(m)
sonic_gen_anim_and_audio_for_walk(m, 20, 48)
end
mario_set_forward_vel(m, m.forwardVel)
elseif stepResult == GROUND_STEP_HIT_WALL then
Expand Down
159 changes: 22 additions & 137 deletions char-amy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,125 +79,6 @@ function amy_spawn_heart_particles(m, angley, offset, anglex, vert)
)
end

function amy_anim_and_audio_for_walk(m)
local val14 = 0
local marioObj = m.marioObj
local val0C = true
local targetPitch = 0
local val04 = 4.0

if val14 < 4 then
val14 = 4
end

if m.forwardVel > 2 then
val04 = math.abs(m.forwardVel)
else
val04 = 5
end

if (m.quicksandDepth > 50.0) then
val14 = (val04 / 4.0 * 0x10000)
set_mario_anim_with_accel(m, MARIO_ANIM_MOVE_IN_QUICKSAND, val14)
play_step_sound(m, 19, 93)
m.actionTimer = 0
else
if val0C == true then
if m.actionTimer == 0 then
if (val04 > 8.0) then
m.actionTimer = 2
else
--(Speed Crash) If Mario's speed is more than 2^17.
if (val14 < 0x1000) then
val14 = 0x1000
else
val14 = (val04 / 4.0 * 0x10000)
end
set_mario_animation(m, MARIO_ANIM_START_TIPTOE)
play_step_sound(m, 7, 22)
if (is_anim_past_frame(m, 23)) then
m.actionTimer = 2
end

val0C = false
end
elseif m.actionTimer == 1 then
if (val04 > 8.0) or m.intendedMag > 8.0 then
m.actionTimer = 2
else
-- (Speed Crash) If Mario's speed is more than 2^17.
if (val14 < 0x1000) then
val14 = 0x1000
else
val14 = (val04 / 4.0 * 0x10000)
end
set_mario_animation(m, MARIO_ANIM_TIPTOE)
play_step_sound(m, 14, 72)

val0C = false
end
elseif m.actionTimer == 2 then
if (val04 < 5.0) then
m.actionTimer = 1
elseif (val04 > 22.0) then
m.actionTimer = 3
else
-- (Speed Crash) If Mario's speed is more than 2^17.
val14 = (val04 / 4.0 * 0x10000)
set_mario_anim_with_accel(m, MARIO_ANIM_WALKING, val14)
play_step_sound(m, 19, 57)

val0C = false
end
elseif m.actionTimer == 3 then
if (val04 < 18.0) then
m.actionTimer = 2
else
-- (Speed Crash) If Mario's speed is more than 2^17.
val14 = (val04 / 4.0 * 0x10000)
if m.forwardVel > 38 then
smlua_anim_util_set_animation(marioObj, "AMY_RUNNING")
set_mario_anim_with_accel(m, MARIO_ANIM_RUNNING_UNUSED, val14)
else
set_mario_anim_with_accel(m, MARIO_ANIM_RUNNING, val14)
end
play_step_sound(m, 9, 45)
targetPitch = tilt_body_running(m)

val0C = false
end
end
end
end

marioObj.oMarioWalkingPitch =
convert_s16(approach_s32(marioObj.oMarioWalkingPitch, find_floor_slope(m, 0x8000), 0x800, 0x800))
marioObj.header.gfx.angle.x = marioObj.oMarioWalkingPitch
end

-- Code nabbed from Shell Rush.
function amy_wall_bounce(m)
-- figure out direction
local v = {
x = sins(m.faceAngle.y) * m.forwardVel,
y = 0,
z = coss(m.faceAngle.y) * m.forwardVel
}

-- projection
local parallel = vec3f_project(v, m.wallNormal)
local perpendicular = {x = v.x - parallel.x, y = v.y - parallel.y, z = v.z - parallel.z}

-- reflect velocity along normal
local reflect = {
x = perpendicular.x - parallel.x,
y = perpendicular.y - parallel.y,
z = perpendicular.z - parallel.z
}

m.faceAngle.y = atan2s(reflect.z, reflect.x)
end

function amy_update_sliding(m, stopSpeed)
local lossFactor
local tempLossFactor
Expand Down Expand Up @@ -331,10 +212,10 @@ function act_amy_idle(m)
elseif m.actionState == 3 then
set_mario_animation(m, MARIO_ANIM_START_SLEEP_YAWN)
smlua_anim_util_set_animation(m.marioObj, "AMY_WAIT_KICK")
if is_anim_at_end(m) ~= 0 then
m.actionState = 2
m.actionTimer = 0
m.actionTimer = 0
end
elseif m.actionState == 4 then
set_mario_animation(m, MARIO_ANIM_START_SLEEP_SITTING)
Expand Down Expand Up @@ -372,8 +253,8 @@ function act_amy_sitting_down(m)
if m.actionState == 0 then
set_mario_animation(m, MARIO_ANIM_IDLE_HEAD_LEFT)
smlua_anim_util_set_animation(m.marioObj, "AMY_WAIT_2")
set_anim_to_frame(m, 40)
set_anim_to_frame(m, 40)
--if is_anim_past_frame(m, 20) ~= 0 then
-- if m.actionTimer > math.random(40, 50) * 30 then
-- e.animFrame = 8
Expand Down Expand Up @@ -443,7 +324,7 @@ function act_amy_walking(m)
set_mario_anim_with_accel(m, MARIO_ANIM_WALK_WITH_LIGHT_OBJ, m.forwardVel * 0x4000)
play_step_sound(m, 12, 62)
else
amy_anim_and_audio_for_walk(m)
sonic_gen_anim_and_audio_for_walk(m, 18, 38)
end
if (m.intendedMag - m.forwardVel) > 16 then
set_mario_particle_flags(m, PARTICLE_DUST, false)
Expand Down Expand Up @@ -514,7 +395,7 @@ function act_amy_swimming(m)
lua_update_swimming_pitch(m)
update_amy_swimming_speed(m, e.movingSpeed)
lua_update_water_pitch(m)
move_with_current(m)
move_with_current(m)

m.actionState = 0
local stepResult = perform_water_step(m)
Expand Down Expand Up @@ -673,7 +554,7 @@ function act_amy_hammer_attack_air(m)
play_sound(SOUND_ACTION_BOUNCE_OFF_OBJECT, m.marioObj.header.gfx.cameraToObject)
audio_sample_play(SOUND_AMY_PIKO, m.pos, 1)
cur_obj_shake_screen(SHAKE_POS_MEDIUM)
amy_wall_bounce(m)
wall_bounce(m)
if m.vel.y < 140 then
set_mario_y_vel_based_on_fspeed(m, 40, 0.5)
else
Expand Down Expand Up @@ -761,7 +642,7 @@ function act_amy_hammer_jump(m)
if m.actionTimer == 0 then
play_character_sound_if_no_flag(m, CHAR_SOUND_YAHOO_WAHA_YIPPEE, MARIO_ACTION_SOUND_PLAYED)
end
if m.actionTimer < 10 and m.vel.y > 20 then
set_mario_particle_flags(m, PARTICLE_DUST, false)
end
Expand Down Expand Up @@ -872,7 +753,7 @@ function act_amy_hammer_spin(m)
play_sound(SOUND_ACTION_BOUNCE_OFF_OBJECT, m.marioObj.header.gfx.cameraToObject)
cur_obj_shake_screen(SHAKE_POS_MEDIUM)
audio_sample_play(SOUND_AMY_PIKO, m.pos, 1)
amy_wall_bounce(m)
wall_bounce(m)
if m.forwardVel < 5 then
mario_set_forward_vel(m, 5)
else
Expand Down Expand Up @@ -927,7 +808,7 @@ function act_amy_hammer_spin_air(m)
play_sound(SOUND_ACTION_BOUNCE_OFF_OBJECT, m.marioObj.header.gfx.cameraToObject)
cur_obj_shake_screen(SHAKE_POS_MEDIUM)
audio_sample_play(SOUND_AMY_PIKO, m.pos, 1)
amy_wall_bounce(m)
wall_bounce(m)

if m.forwardVel < 5 then
mario_set_forward_vel(m, 5)
Expand Down Expand Up @@ -1223,7 +1104,7 @@ function act_amy_crouch_slide(m)
if (m.input & INPUT_FIRST_PERSON) ~= 0 then
return set_mario_action(m, ACT_BRAKING, 0)
end
m.actionTimer = m.actionTimer + 1

cancel = common_slide_action_with_jump(m, ACT_CROUCHING, ACT_GIANT_STEPS, ACT_FREEFALL, MARIO_ANIM_START_CROUCHING)
Expand Down Expand Up @@ -1292,7 +1173,7 @@ function amy_update(m)
and (m.controller.buttonDown & A_BUTTON) ~= 0 then
m.action = ACT_AMY_SWIMMING
end
--if m.marioObj.header.gfx.animInfo.animID == 79 then
-- m.marioObj.header.gfx.disableAutomaticShadowPos = true
--end
Expand Down Expand Up @@ -1330,6 +1211,10 @@ function amy_update(m)
smlua_anim_util_set_animation(m.marioObj, "AMY_JOGGING")
end

if m.marioObj.header.gfx.animInfo.animID == MARIO_ANIM_RUNNING_UNUSED then
smlua_anim_util_set_animation(m.marioObj, "AMY_RUNNING")
end

if m.marioObj.header.gfx.animInfo.animID == MARIO_ANIM_SKID_ON_GROUND then
smlua_anim_util_set_animation(m.marioObj, "AMY_SKID")
m.marioBodyState.eyeState = 16
Expand Down Expand Up @@ -1387,20 +1272,20 @@ function amy_update(m)
m.marioBodyState.handState = MARIO_HAND_OPEN
smlua_anim_util_set_animation(m.marioObj, "AMY_EXIT_LEVEL")
m.marioBodyState.capState = 0
if m.marioObj.header.gfx.animInfo.animFrame > 5 then
if m.marioObj.header.gfx.animInfo.animFrame < 16 then
if m.marioObj.header.gfx.animInfo.animFrame < 16 then
m.marioBodyState.eyeState = 11
elseif m.marioObj.header.gfx.animInfo.animFrame < 40 then
m.marioBodyState.eyeState = 15
elseif m.marioObj.header.gfx.animInfo.animFrame < 56 then
m.marioBodyState.eyeState = 11
elseif m.marioObj.header.gfx.animInfo.animFrame < 80 then
m.marioBodyState.eyeState = 15
end
end
else
m.marioBodyState.eyeState = 0
end
end
end

if m.marioObj.header.gfx.animInfo.animID == MARIO_ANIM_DROWNING_PART1 then
Expand Down Expand Up @@ -1498,15 +1383,15 @@ function amy_on_set_action(m)
or m.action == ACT_HOLD_FLUTTER_KICK then
m.action = ACT_AMY_SWIMMING
end

if m.action == ACT_GIANT_STEPS then
e.animFrame = 0
m.faceAngle.y = m.intendedYaw
m.vel.y = 20
if m.forwardVel < 100 then mario_set_forward_vel(m, m.forwardVel + 35) end
end
--if (m.action == ACT_PUNCHING and m.actionArg == 9) or m.action == ACT_SLIDE_KICK then

local jumpActions = {
Expand Down
Loading

0 comments on commit 5694d5b

Please sign in to comment.