Merge branch 'main' of http://git.nanoyagi.com/NanoYagi/JumpRopeOldTech
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
commit
9aa9903b41
6 files changed
+29
-9
No files matched your search
@@ -7,6 +7,7 @@
|
|||||||
bg_color = Color(0.28627452, 0.25490198, 0.22745098, 1)
|
bg_color = Color(0.28627452, 0.25490198, 0.22745098, 1)
|
||||||
|
|
||||||
[node name="OldComputer" type="CanvasLayer" unique_id=1944134941]
|
[node name="OldComputer" type="CanvasLayer" unique_id=1944134941]
|
||||||
|
visible = false
|
||||||
script = ExtResource("1_6jyhx")
|
script = ExtResource("1_6jyhx")
|
||||||
|
|
||||||
[node name="BackgroundPanel" type="Panel" parent="." unique_id=1876350245]
|
[node name="BackgroundPanel" type="Panel" parent="." unique_id=1876350245]
|
||||||
|
|||||||
@@ -7,5 +7,5 @@ func _ready() -> void:
|
|||||||
|
|
||||||
func _on_picked_up() -> void:
|
func _on_picked_up() -> void:
|
||||||
%Player2D.give_disk(disk_num)
|
%Player2D.give_disk(disk_num)
|
||||||
%Player2D.give_objective("disk%d" % disk_num, "Install data disk %d" % disk_num)
|
%Player2D.give_objective("disk%d" % disk_num, disk_num, "Install data disk %d" % disk_num)
|
||||||
print("Picked up disk ", disk_num)
|
print("Picked up disk ", disk_num)
|
||||||
+2
-2
@@ -3,6 +3,6 @@ extends RichTextLabel
|
|||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
func _process(delta: float) -> void:
|
func _process(delta: float) -> void:
|
||||||
var new_text = "OBJECTIVES:\n"
|
var new_text = "OBJECTIVES:\n"
|
||||||
for objective in %Player2D.objectives:
|
for objective in %Player2D.get_current_objectives():
|
||||||
new_text = new_text + %Player2D.objectives[objective] + "\n"
|
new_text = new_text + objective + "\n"
|
||||||
text = new_text
|
text = new_text
|
||||||
@@ -2,7 +2,6 @@ extends CanvasLayer
|
|||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
$ConsoleText.text = $ConsoleText.text % %Pharaoh.get_memory_integrity()
|
$ConsoleText.text = $ConsoleText.text % %Pharaoh.get_memory_integrity()
|
||||||
open()
|
|
||||||
|
|
||||||
func open() -> void:
|
func open() -> void:
|
||||||
visible = true
|
visible = true
|
||||||
|
|||||||
+9
-1
@@ -18,11 +18,19 @@ func get_memory_integrity():
|
|||||||
return 100.0 / total_integrity * (starting_integrity + len(disks_loaded))
|
return 100.0 / total_integrity * (starting_integrity + len(disks_loaded))
|
||||||
|
|
||||||
func _on_interacted() -> void:
|
func _on_interacted() -> void:
|
||||||
|
#%OldComputer.open()
|
||||||
|
|
||||||
var wanted_disk = disks_wanted.front()
|
var wanted_disk = disks_wanted.front()
|
||||||
|
|
||||||
%Player2D.spawn_point = position
|
%Player2D.spawn_point = position
|
||||||
|
|
||||||
if not %Player2D.take_disk(wanted_disk):
|
if not %Player2D.take_disk(wanted_disk):
|
||||||
|
if wanted_disk == 1 and not %Player2D.has_objective("disk%d" % wanted_disk):
|
||||||
|
%OldComputer.open()
|
||||||
|
%Player2D.give_objective(
|
||||||
|
"disk%d" % wanted_disk,
|
||||||
|
wanted_disk, "Locate data disk %d" % wanted_disk
|
||||||
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
if not load_disk(wanted_disk):
|
if not load_disk(wanted_disk):
|
||||||
@@ -39,4 +47,4 @@ func _on_interacted() -> void:
|
|||||||
if (not wanted_disk) or %Player2D.has_disk(wanted_disk):
|
if (not wanted_disk) or %Player2D.has_disk(wanted_disk):
|
||||||
return
|
return
|
||||||
|
|
||||||
%Player2D.give_objective("disk%d" % wanted_disk, "Locate data disk %d" % wanted_disk)
|
%Player2D.give_objective("disk%d" % wanted_disk, wanted_disk, "Locate data disk %d" % wanted_disk)
|
||||||
+16
-4
@@ -54,14 +54,26 @@ func take_disk(disk_num) -> bool:
|
|||||||
func has_disk(disk_num: int) -> bool:
|
func has_disk(disk_num: int) -> bool:
|
||||||
return disk_num in data_disks
|
return disk_num in data_disks
|
||||||
|
|
||||||
func give_objective(id: String, description: String) -> void:
|
func give_objective(id: String, priority: int, description: String) -> void:
|
||||||
objectives[id] = description
|
objectives[id] = {
|
||||||
|
"priority": priority,
|
||||||
|
"description": description,
|
||||||
|
"completed": false
|
||||||
|
}
|
||||||
|
|
||||||
func has_objective(id: String) -> bool:
|
func has_objective(id: String) -> bool:
|
||||||
return objectives.has(id)
|
return objectives.has(id) and not objectives[id].completed
|
||||||
|
|
||||||
|
func get_current_objectives() -> Array[String]:
|
||||||
|
var current_objectives = objectives.values()
|
||||||
|
current_objectives.sort_custom(func(a, b): return a.priority < b.priority)
|
||||||
|
return current_objectives.filter(func(objective): return not objective.completed).map(func(objective): return objective.description)
|
||||||
|
|
||||||
func complete_objective(id: String) -> bool:
|
func complete_objective(id: String) -> bool:
|
||||||
return objectives.erase(id)
|
if not has_objective(id):
|
||||||
|
return false
|
||||||
|
objectives[id].completed = true
|
||||||
|
return true
|
||||||
|
|
||||||
func on_teleport():
|
func on_teleport():
|
||||||
refresh_jump(1)
|
refresh_jump(1)
|
||||||
|
|||||||
Reference in new issue
Block a user