Add the old computer screen popup.
This commit is contained in:
1 parent
fef374fe95
commit
81322e787a
8 files changed
+131
-4
No files matched your search
+10
-3
@@ -3,8 +3,8 @@ extends Interactable
|
||||
var disks_wanted = [1, 2, 3, 4]
|
||||
var disks_loaded = []
|
||||
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
var starting_integrity = 2
|
||||
var total_integrity = starting_integrity + len(disks_wanted)
|
||||
|
||||
func load_disk(disk_num: int) -> bool:
|
||||
if !disk_num or (disk_num in disks_loaded):
|
||||
@@ -14,6 +14,9 @@ func load_disk(disk_num: int) -> bool:
|
||||
disks_wanted.remove_at(disks_wanted.find(disk_num))
|
||||
return true
|
||||
|
||||
func get_memory_integrity():
|
||||
return 100.0 / total_integrity * (starting_integrity + len(disks_loaded))
|
||||
|
||||
func _on_interacted() -> void:
|
||||
var wanted_disk = disks_wanted.front()
|
||||
if not %Player2D.take_disk(wanted_disk):
|
||||
@@ -24,9 +27,13 @@ func _on_interacted() -> void:
|
||||
|
||||
%Player2D.complete_objective("disk%d" % wanted_disk)
|
||||
print("Loaded up disk ", wanted_disk)
|
||||
%OldComputer.printline(
|
||||
">> Loaded data disk %d (of %d). Memory integrity now at %d%%" %
|
||||
[wanted_disk, len(disks_wanted) + len(disks_loaded), get_memory_integrity()]
|
||||
)
|
||||
|
||||
wanted_disk = disks_wanted.front()
|
||||
if wanted_disk and %Player2D.has_disk(wanted_disk):
|
||||
if (not wanted_disk) or %Player2D.has_disk(wanted_disk):
|
||||
return
|
||||
|
||||
%Player2D.give_objective("disk%d" % wanted_disk, "Locate data disk %d" % wanted_disk)
|
||||
Reference in new issue
Block a user