Initial commit
This commit is contained in:
@@ -0,0 +1 @@
|
||||
uid://dnjusl5hyybly
|
||||
@@ -0,0 +1,38 @@
|
||||
extends BasicRoom
|
||||
class_name CorridorDeadEndBreakable
|
||||
|
||||
@onready var wallShard: MeshInstance3D = $WallShard
|
||||
var broken: bool = false
|
||||
|
||||
@onready var interactBox: InteractBox = $InteractBox
|
||||
|
||||
@onready var holeProximety = $Area3D
|
||||
var repairCube: Area3D
|
||||
var toolBox: bool = false
|
||||
var interacted: bool = false
|
||||
|
||||
func updateWallVisibility(status: bool):
|
||||
broken = !status
|
||||
wallShard.visible = status
|
||||
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
repairCube = null
|
||||
toolBox = false
|
||||
var objectsProxy: Array[Area3D] = holeProximety.get_overlapping_areas()
|
||||
for obj in objectsProxy:
|
||||
if obj.type == "RepairCube":
|
||||
repairCube = obj
|
||||
if obj.type == "ToolBox":
|
||||
toolBox = true
|
||||
|
||||
if repairCube and toolBox and interacted:
|
||||
updateWallVisibility(true)
|
||||
interacted = false
|
||||
repairCube.get_parent().queue_free()
|
||||
SpaceshipLogicRef.hullBreached = false
|
||||
|
||||
|
||||
func _on_interact_box_interacted_with(_playerRef: PlayerCharacter) -> void:
|
||||
interacted = true
|
||||
#Needs to be replaced with a repair minigame/ progress bar later
|
||||
@@ -0,0 +1 @@
|
||||
uid://co1ktq45h26wx
|
||||
Reference in New Issue
Block a user