mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-24 00:10:52 +00:00
Merge branch 'main' of https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public
This commit is contained in:
@@ -6,9 +6,6 @@ static var character_save := "Mario"
|
||||
|
||||
func _ready() -> void:
|
||||
activated.get_node("ResourceSetterNew").resource_json = load(get_character_sprite_path(0))
|
||||
if Settings.file.difficulty.checkpoint_style == 0 and (Global.current_game_mode != Global.GameMode.LEVEL_EDITOR and Global.current_game_mode != Global.GameMode.CUSTOM_LEVEL) or Global.current_campaign == "SMBANN":
|
||||
owner.queue_free()
|
||||
return
|
||||
owner.show()
|
||||
if owner.passed:
|
||||
sprite.hide()
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -27,7 +27,7 @@ func _enter_tree() -> void:
|
||||
LevelPersistance.active_nodes = old_state.duplicate(true)
|
||||
|
||||
func _ready() -> void:
|
||||
if [Global.GameMode.CHALLENGE, Global.GameMode.MARATHON_PRACTICE].has(Global.current_game_mode) or Global.current_campaign == "SMBANN":
|
||||
if [Global.GameMode.CHALLENGE, Global.GameMode.MARATHON_PRACTICE].has(Global.current_game_mode) or Global.current_campaign == "SMBANN" or (Settings.file.difficulty.extra_checkpoints == 0 and optional):
|
||||
queue_free()
|
||||
return
|
||||
if has_meta("is_flag") == false:
|
||||
@@ -71,6 +71,3 @@ func get_id() -> String:
|
||||
return str(Global.level_editor.sub_level_id) + "," + str(Vector2i(global_position)) + "," + get_parent().name
|
||||
else:
|
||||
return Global.current_level.scene_file_path + "," + str(Vector2i(global_position)) + "," + get_parent().name
|
||||
|
||||
func on_tree_exiting() -> void:
|
||||
pass # Replace with function body.
|
||||
|
||||
@@ -2,6 +2,8 @@ extends Node2D
|
||||
|
||||
const FLAG_POINTS := [100, 400, 800, 2000, 5000]
|
||||
|
||||
const FLAG_POINTS_MODERN := [100, 200, 800, 4000, 8000]
|
||||
|
||||
signal player_reached
|
||||
|
||||
signal sequence_begin
|
||||
@@ -42,8 +44,10 @@ func player_touch(player: Player) -> void:
|
||||
func give_points(player: Player) -> void:
|
||||
var value = clamp(int(lerp(0, 4, (player.global_position.y / -144))), 0, 4)
|
||||
var nearest_value = FLAG_POINTS[value]
|
||||
if Settings.file.difficulty.flagpole_lives:
|
||||
nearest_value = FLAG_POINTS_MODERN[value]
|
||||
$Score.text = str(nearest_value)
|
||||
if nearest_value == 5000 and Settings.file.difficulty.flagpole_lives and not [Global.GameMode.CHALLENGE, Global.GameMode.BOO_RACE].has(Global.current_game_mode) and not Settings.file.difficulty.inf_lives:
|
||||
if nearest_value == 8000 and not [Global.GameMode.CHALLENGE, Global.GameMode.BOO_RACE].has(Global.current_game_mode) and not Settings.file.difficulty.inf_lives:
|
||||
AudioManager.play_sfx("1_up", global_position)
|
||||
Global.lives += 1
|
||||
$ScoreNoteSpawner.spawn_one_up_note()
|
||||
|
||||
Reference in New Issue
Block a user