Equipment menu
This commit is contained in:
parent
c6bf51f1b0
commit
bef15301cb
28 changed files with 809 additions and 48 deletions
|
|
@ -38,18 +38,17 @@ func _ready():
|
|||
ship.hull.fuel = save['fuel']
|
||||
ship.hull.ammunition = save['ammo']
|
||||
ship.hull.cargo = save['cargo']
|
||||
if save.has('primaryweapon'):
|
||||
for node in ship.primary_slot.get_children():
|
||||
node.queue_free()
|
||||
var weapon_inst = Game.get_weapon(save['primaryweapon']).instantiate()
|
||||
weapon_inst.id = save['primaryweapon']
|
||||
ship.primary_slot.add_child(weapon_inst)
|
||||
if save.has('secondaryweapon'):
|
||||
for node in ship.secondary_slot.get_children():
|
||||
node.queue_free()
|
||||
var weapon_inst = Game.get_weapon(save['secondaryweapon']).instantiate()
|
||||
weapon_inst.id = save['secondaryweapon']
|
||||
ship.secondary_slot.add_child(weapon_inst)
|
||||
if save.has('ship_equipment'):
|
||||
var hull = Game.get_module(save['ship_equipment']['hull'], 'hull').instantiate()
|
||||
var engine = Game.get_module(save['ship_equipment']['hull'], 'engine').instantiate()
|
||||
var shield = Game.get_module(save['ship_equipment']['hull'], 'shield').instantiate()
|
||||
var primary_weapon = Game.get_weapon(save['ship_equipment']['primary_weapon']).instantiate()
|
||||
var secondary_weapon = Game.get_weapon(save['ship_equipment']['secondary_weapon']).instantiate()
|
||||
ship.change_hull(hull)
|
||||
ship.change_engine(engine)
|
||||
ship.change_shield(shield)
|
||||
ship.change_primary_weapon(primary_weapon)
|
||||
ship.change_secondary_weapon(secondary_weapon)
|
||||
if save.has('quest'):
|
||||
var data = save['quest']
|
||||
var type = data['type'] as Quest.TYPE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue