mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-22 15:38:14 +00:00
Fixed brick blocks with items in, being affected by p-switches
This commit is contained in:
@@ -6,7 +6,10 @@ signal shell_block_hit(shell: Shell)
|
||||
|
||||
@export var visuals: Node = null
|
||||
const EMPTY_BLOCK = ("res://Scenes/Prefabs/Blocks/EmptyBlock.tscn")
|
||||
@export var item: PackedScene = null
|
||||
@export var item: PackedScene = null:
|
||||
set(value):
|
||||
item = value
|
||||
item_changed.emit()
|
||||
@export var destructable := true
|
||||
@export var destruction_particle_scene: PackedScene = null
|
||||
@export_range(1, 99) var item_amount := 1
|
||||
@@ -19,7 +22,7 @@ var bouncing := false
|
||||
const NO_SFX_ITEMS := ["res://Scenes/Prefabs/Entities/Items/SpinningRedCoin.tscn","res://Scenes/Prefabs/Entities/Items/SpinningCoin.tscn", "res://Scenes/Prefabs/Entities/Items/Vine.tscn" ]
|
||||
|
||||
@export var start_z := -1
|
||||
|
||||
signal item_changed
|
||||
signal block_emptied
|
||||
signal block_destroyed
|
||||
|
||||
|
@@ -4,10 +4,12 @@ extends Block
|
||||
var ticking_down := false
|
||||
|
||||
func _ready() -> void:
|
||||
$PSwitcher.enabled = item == null
|
||||
if item_amount == 10 and item.resource_path == "res://Scenes/Prefabs/Entities/Items/SpinningCoin.tscn" and is_instance_valid(Global.level_editor) == false:
|
||||
Global.log_warning("Coin Brick Block is wrong! please report!: " + name)
|
||||
|
||||
func check_brick_empty() -> void:
|
||||
$PSwitcher.enabled = item == null
|
||||
|
||||
func on_block_hit(player: Player) -> void:
|
||||
if player.power_state.hitbox_size == "Big":
|
||||
if item == null:
|
||||
|
Reference in New Issue
Block a user