mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-23 16:00:54 +00:00
Implement WaterCrouchMove and WingCrouchMove (and fix an incorrect default value on small crouch height) (#643)
* Add WaterCrouchMove and WingCrouchMove states * Implement WaterCrouchMove and WingCrouchMove * Quick patch for incorrect crouch height im adding this to this branch for this since its literally just a number change lol
This commit is contained in:
@@ -161,6 +161,8 @@ const ANIMATION_FALLBACKS := {
|
||||
"CrouchJump": "Crouch",
|
||||
"CrouchBump": "Bump",
|
||||
"CrouchMove": "Crouch",
|
||||
"WaterCrouchMove": "CrouchMove",
|
||||
"WingCrouchMove": "WaterCrouchMove",
|
||||
"IdleAttack": "MoveAttack",
|
||||
"CrouchAttack": "IdleAttack",
|
||||
"MoveAttack": "Attack",
|
||||
@@ -247,7 +249,7 @@ func apply_character_physics(apply: bool) -> void:
|
||||
|
||||
for i in get_tree().get_nodes_in_group("SmallCollisions"):
|
||||
var hitbox_scale = json.get("small_hitbox_scale", [1, 1]) if apply else [1, 1]
|
||||
i.hitbox = Vector3(hitbox_scale[0], hitbox_scale[1] if i.get_meta("scalable", true) else 1, json.get("small_crouch_scale", 0.75) if apply else 0.5)
|
||||
i.hitbox = Vector3(hitbox_scale[0], hitbox_scale[1] if i.get_meta("scalable", true) else 1, json.get("small_crouch_scale", 0.75) if apply else 0.75)
|
||||
i._physics_process(0)
|
||||
for i in get_tree().get_nodes_in_group("BigCollisions"):
|
||||
var hitbox_scale = json.get("big_hitbox_scale", [1, 1]) if apply else [1, 1]
|
||||
|
||||
@@ -221,13 +221,19 @@ func get_animation_name() -> String:
|
||||
return "CrouchJump"
|
||||
elif player.is_actually_on_floor():
|
||||
if abs(player.velocity.x) >= 5 and not player.is_actually_on_wall():
|
||||
return "CrouchMove"
|
||||
elif player.in_water:
|
||||
return "WaterCrouch"
|
||||
elif player.flight_meter > 0:
|
||||
return "WingCrouch"
|
||||
if player.in_water:
|
||||
return "WaterCrouchMove"
|
||||
elif player.flight_meter > 0:
|
||||
return "WingCrouchMove"
|
||||
else:
|
||||
return "CrouchMove"
|
||||
else:
|
||||
return "Crouch"
|
||||
if player.in_water:
|
||||
return "WaterCrouch"
|
||||
elif player.flight_meter > 0:
|
||||
return "WingCrouch"
|
||||
else:
|
||||
return "Crouch"
|
||||
if player.is_actually_on_floor():
|
||||
if player.skidding:
|
||||
return "Skid"
|
||||
|
||||
Reference in New Issue
Block a user