Compare commits
No commits in common. "d7099548b5f8e22b7d4c24a1f971bf00c2a5610f" and "c5400d54e4d590861e3199559db782588184d202" have entirely different histories.
d7099548b5
...
c5400d54e4
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,6 +1,3 @@
|
|||||||
# Godot 4+ specific ignores
|
# Godot 4+ specific ignores
|
||||||
.godot/
|
.godot/
|
||||||
/android/
|
/android/
|
||||||
export_presets.cfg
|
|
||||||
Randoloot.console.exe
|
|
||||||
Randoloot.exe
|
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
extends Node
|
extends Node
|
||||||
|
|
||||||
var selected_ship_path: String = ""
|
var selected_ship_path: String = ""
|
||||||
var restart_inventory: Dictionary = {}
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
var game_window := get_tree().root
|
var game_window := get_tree().root
|
||||||
|
|||||||
@ -66,10 +66,6 @@ func _ready() -> void:
|
|||||||
_sprite.texture = ship_texture
|
_sprite.texture = ship_texture
|
||||||
var largest_dimension := maxf(ship_texture.get_width(), ship_texture.get_height())
|
var largest_dimension := maxf(ship_texture.get_width(), ship_texture.get_height())
|
||||||
_sprite.scale = Vector2.ONE * (64.0 / largest_dimension)
|
_sprite.scale = Vector2.ONE * (64.0 / largest_dimension)
|
||||||
# Inventory children have already applied the restored equipment bonuses.
|
|
||||||
hull = max_hull
|
|
||||||
shields = max_shields
|
|
||||||
energy = max_energy
|
|
||||||
_update_shield_visual()
|
_update_shield_visual()
|
||||||
|
|
||||||
func _ensure_input_action(action_name: StringName, physical_key: Key) -> void:
|
func _ensure_input_action(action_name: StringName, physical_key: Key) -> void:
|
||||||
@ -129,7 +125,6 @@ func _destroy_ship() -> void:
|
|||||||
func _restart_level_after_destruction() -> void:
|
func _restart_level_after_destruction() -> void:
|
||||||
await get_tree().create_timer(1.1).timeout
|
await get_tree().create_timer(1.1).timeout
|
||||||
if is_inside_tree():
|
if is_inside_tree():
|
||||||
$ShipInventory.preserve_for_restart()
|
|
||||||
get_tree().reload_current_scene()
|
get_tree().reload_current_scene()
|
||||||
|
|
||||||
func _physics_process(delta: float) -> void:
|
func _physics_process(delta: float) -> void:
|
||||||
|
|||||||
@ -18,13 +18,7 @@ func _ready() -> void:
|
|||||||
cargo.resize(CARGO_SIZE)
|
cargo.resize(CARGO_SIZE)
|
||||||
weapon_slots.resize(WEAPON_SLOT_COUNT)
|
weapon_slots.resize(WEAPON_SLOT_COUNT)
|
||||||
module_slots.resize(MODULE_SLOT_COUNT)
|
module_slots.resize(MODULE_SLOT_COUNT)
|
||||||
if GameState.restart_inventory.is_empty():
|
_add_starter_items()
|
||||||
_add_starter_items()
|
|
||||||
else:
|
|
||||||
cargo.assign(GameState.restart_inventory["cargo"])
|
|
||||||
weapon_slots.assign(GameState.restart_inventory["weapon"])
|
|
||||||
module_slots.assign(GameState.restart_inventory["module"])
|
|
||||||
GameState.restart_inventory.clear()
|
|
||||||
_recalculate_ship_stats()
|
_recalculate_ship_stats()
|
||||||
inventory_changed.emit()
|
inventory_changed.emit()
|
||||||
|
|
||||||
@ -35,14 +29,6 @@ func get_cargo_used() -> int:
|
|||||||
used += 1
|
used += 1
|
||||||
return used
|
return used
|
||||||
|
|
||||||
func preserve_for_restart() -> void:
|
|
||||||
# Copy the slot arrays; resources retain levels and individual modifiers.
|
|
||||||
GameState.restart_inventory = {
|
|
||||||
"cargo": cargo.duplicate(),
|
|
||||||
"weapon": weapon_slots.duplicate(),
|
|
||||||
"module": module_slots.duplicate(),
|
|
||||||
}
|
|
||||||
|
|
||||||
func get_item(slot_kind: String, index: int) -> ItemInstance:
|
func get_item(slot_kind: String, index: int) -> ItemInstance:
|
||||||
var slots := _get_slots(slot_kind)
|
var slots := _get_slots(slot_kind)
|
||||||
if index < 0 or index >= slots.size():
|
if index < 0 or index >= slots.size():
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user