Quick fixes for optional animations (#612)

* Quick fix for flipped Jump/RunJump anims

accidentally used the condition the wrong way, my bad LOL

* >= moment

so thats why it was playing the fall animation for a single frame

* Reverted attempted fixes accidentally left in for CrouchBump
This commit is contained in:
SkyanUltra
2025-10-17 08:56:12 -04:00
committed by GitHub
parent a0521becb4
commit ed297891fd
2 changed files with 13 additions and 9 deletions

View File

@@ -159,7 +159,7 @@ const ANIMATION_FALLBACKS := {
"WingCrouch": "WaterCrouch", "WingCrouch": "WaterCrouch",
"CrouchFall": "Crouch", "CrouchFall": "Crouch",
"CrouchJump": "Crouch", "CrouchJump": "Crouch",
"CrouchBump": "Crouch", "CrouchBump": "Bump",
"CrouchMove": "Crouch", "CrouchMove": "Crouch",
"IdleAttack": "MoveAttack", "IdleAttack": "MoveAttack",
"CrouchAttack": "IdleAttack", "CrouchAttack": "IdleAttack",
@@ -685,6 +685,10 @@ func set_power_state_frame() -> void:
$ResourceSetterNew.update_resource() $ResourceSetterNew.update_resource()
if %Sprite.sprite_frames != null: if %Sprite.sprite_frames != null:
can_pose = %Sprite.sprite_frames.has_animation("PoseDoor") can_pose = %Sprite.sprite_frames.has_animation("PoseDoor")
can_bump_jump = %Sprite.sprite_frames.has_animation("JumpBump")
can_bump_crouch = %Sprite.sprite_frames.has_animation("CrouchBump")
can_bump_swim = %Sprite.sprite_frames.has_animation("SwimBump")
can_bump_fly = %Sprite.sprite_frames.has_animation("FlyBump")
can_kick_anim = %Sprite.sprite_frames.has_animation("Kick") can_kick_anim = %Sprite.sprite_frames.has_animation("Kick")
func get_power_up(power_name := "") -> void: func get_power_up(power_name := "") -> void:

View File

@@ -212,10 +212,10 @@ func get_animation_name() -> String:
if player.kicking and player.can_kick_anim: if player.kicking and player.can_kick_anim:
return "Kick" return "Kick"
if player.crouching and not wall_pushing: if player.crouching and not wall_pushing:
if player.bumping: if player.bumping and player.can_bump_crouch:
return "CrouchBump" return "CrouchBump"
elif player.is_on_floor() == false: elif player.is_on_floor() == false:
if player.velocity.y > 0: if player.velocity.y >= 0:
return "CrouchFall" return "CrouchFall"
elif player.velocity.y < 0: elif player.velocity.y < 0:
return "CrouchJump" return "CrouchJump"
@@ -275,23 +275,23 @@ func get_animation_name() -> String:
if player.has_jumped: if player.has_jumped:
if player.bumping and player.can_bump_jump: if player.bumping and player.can_bump_jump:
if abs(player.velocity_x_jump_stored) < player.RUN_SPEED - 10: if abs(player.velocity_x_jump_stored) < player.RUN_SPEED - 10:
return "RunJumpBump"
else:
return "JumpBump" return "JumpBump"
else:
return "RunJumpBump"
elif player.velocity.y < 0: elif player.velocity.y < 0:
if player.is_invincible: if player.is_invincible:
return "StarJump" return "StarJump"
elif abs(player.velocity_x_jump_stored) < player.RUN_SPEED - 10: elif abs(player.velocity_x_jump_stored) < player.RUN_SPEED - 10:
return "RunJump"
else:
return "Jump" return "Jump"
else:
return "RunJump"
else: else:
if player.is_invincible: if player.is_invincible:
return "StarFall" return "StarFall"
elif abs(player.velocity_x_jump_stored) < player.RUN_SPEED - 10: elif abs(player.velocity_x_jump_stored) < player.RUN_SPEED - 10:
return "RunJumpFall"
else:
return "JumpFall" return "JumpFall"
else:
return "RunJumpFall"
else: else:
# guzlad: Fixes characters with fall anims not playing them, but also prevents old characters without that anim not being accurate # guzlad: Fixes characters with fall anims not playing them, but also prevents old characters without that anim not being accurate
if !player.sprite.sprite_frames.has_animation("Fall"): if !player.sprite.sprite_frames.has_animation("Fall"):