fixed weapon spawning in and added per-weapon crosshair size
This commit is contained in:
@@ -17,25 +17,25 @@ func _process(delta):
|
||||
pass
|
||||
|
||||
func picked_up():
|
||||
var spawn_gun = gun_resource.instantiate()
|
||||
var gun_held = false
|
||||
#check if gun is owned
|
||||
for i in GameGlobals.held_guns:
|
||||
if i == gun_resource:
|
||||
gun_held = true
|
||||
|
||||
if spawn_gun.weapon_info.weapon_type == 0:
|
||||
add_ammo(gun_held,spawn_gun.weapon_info.gun_name,spawn_gun.weapon_info.bullet.ammo_type,spawn_gun.weapon_info.bullet.special_bullet_name,spawn_gun.weapon_info.max_ammo,spawn_gun.weapon_info.start_mags)
|
||||
|
||||
if !gun_held:
|
||||
GameGlobals.held_guns.append(gun_resource)
|
||||
var instance_gun = gun_resource.instantiate()
|
||||
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)
|
||||
SignalBus.emit_signal("weapon_list_changed")
|
||||
queue_free()
|
||||
var spawn_gun = gun_resource.instantiate()
|
||||
var gun_held = false
|
||||
#check if gun is owned
|
||||
for i in GameGlobals.held_guns:
|
||||
if i == gun_resource:
|
||||
gun_held = true
|
||||
|
||||
if spawn_gun.weapon_info.weapon_type == 0:
|
||||
add_ammo(!gun_held,spawn_gun.weapon_info.gun_name,spawn_gun.weapon_info.bullet.ammo_type,spawn_gun.weapon_info.bullet.special_bullet_name,spawn_gun.weapon_info.max_ammo,spawn_gun.weapon_info.start_mags)
|
||||
|
||||
if !gun_held:
|
||||
GameGlobals.held_guns.append(gun_resource)
|
||||
var instance_gun = gun_resource.instantiate()
|
||||
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)
|
||||
SignalBus.emit_signal("weapon_list_changed")
|
||||
queue_free()
|
||||
|
||||
func add_ammo(new_gun,gun_name,ammo_type,special_bullet_name,max_ammo,start_mags):
|
||||
if new_gun:
|
||||
|
||||
Reference in New Issue
Block a user