substantial work on saving and loading and hub mechanic
This commit is contained in:
@@ -18,18 +18,16 @@ func _process(delta):
|
||||
pass
|
||||
|
||||
func picked_up():
|
||||
for i in level_control.held_guns:
|
||||
for i in GameGlobals.held_guns:
|
||||
if i == gun_resource:
|
||||
gun_already_held = true
|
||||
|
||||
if !gun_already_held:
|
||||
var gun_info = gun_resource.instantiate()
|
||||
level_control.player.add_ammo(true,gun_info.gun_name,gun_info.ammo_type,gun_info.max_ammo,gun_info.start_mags)
|
||||
level_control.held_guns.append(gun_resource)
|
||||
GameGlobals.held_guns.append(gun_resource)
|
||||
var instance_gun = gun_resource.instantiate()
|
||||
level_control.ammo_current.append(instance_gun.max_ammo)
|
||||
level_control.ammo_reserve.append(instance_gun.max_ammo * instance_gun.start_mags)
|
||||
var weapon_id = level_control.held_guns.size() - 1
|
||||
var weapon_id = GameGlobals.held_guns.size() - 1
|
||||
if level_control.player.gun != null:
|
||||
level_control.player.gun.anim_player.play("swap_out")
|
||||
level_control.gun_spawn(weapon_id)
|
||||
|
||||
Reference in New Issue
Block a user