Move "computer" related state to the OldComputer singleton.
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
1 parent
5ef5874d11
commit
f8eb3cb378
2 files changed
+31
-30
No files matched your search
+28
-1
@@ -1,7 +1,34 @@
|
||||
extends CanvasLayer
|
||||
|
||||
var disks_wanted = [1, 2, 3, 4]
|
||||
var disks_loaded = []
|
||||
|
||||
var starting_integrity = 2
|
||||
var total_integrity = starting_integrity + len(disks_wanted)
|
||||
|
||||
func _ready() -> void:
|
||||
$ConsoleText.text = $ConsoleText.text % %Pharaoh.get_memory_integrity()
|
||||
$ConsoleText.text = $ConsoleText.text % get_memory_integrity()
|
||||
|
||||
func load_disk(disk_num: int) -> bool:
|
||||
if !disk_num or (disk_num in disks_loaded):
|
||||
return false
|
||||
|
||||
disks_loaded.push_back(disk_num)
|
||||
disks_wanted.remove_at(disks_wanted.find(disk_num))
|
||||
|
||||
print("Loaded up disk ", disk_num)
|
||||
printline(
|
||||
">> Loaded data disk %d (of %d). Memory integrity now at %d%%" %
|
||||
[disk_num, len(disks_wanted) + len(disks_loaded), get_memory_integrity()]
|
||||
)
|
||||
|
||||
return true
|
||||
|
||||
func get_next_disk_num() -> int:
|
||||
return disks_wanted.front()
|
||||
|
||||
func get_memory_integrity():
|
||||
return 100.0 / total_integrity * (starting_integrity + len(disks_loaded))
|
||||
|
||||
func open() -> void:
|
||||
visible = true
|
||||
|
||||
Reference in new issue
Block a user