Spawnables
This commit is contained in:
parent
6b5e768faf
commit
ea4f70f5ef
25 changed files with 4784 additions and 4436 deletions
|
|
@ -1,7 +1,5 @@
|
|||
extends WeaponState
|
||||
|
||||
const active_bomb: StringName = "uid://dtbpyfdawb02b"
|
||||
|
||||
func enter():
|
||||
machine.animation_player.play(machine.animation_prefix+"plant")
|
||||
machine.animation_player.animation_finished.connect(on_animation_finished)
|
||||
|
|
@ -17,7 +15,7 @@ func on_animation_finished(animation: StringName):
|
|||
return
|
||||
if animation == machine.animation_prefix + "plant":
|
||||
|
||||
Session.spawn({"scene": active_bomb, "position": machine.player_camera.get_parent().global_position,"plant": Session.get_site().name})
|
||||
Session.spawn({"type": "object","spawn_name": "active_bomb", "position": machine.player_camera.get_parent().global_position,"plant": Session.get_site().name})
|
||||
|
||||
machine.ammo -= 1
|
||||
return_to_previous.emit()
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ extends SubStateMachine
|
|||
class_name WeaponSubStateMachine
|
||||
|
||||
@export var animation_prefix: StringName
|
||||
@export var droppable: StringName
|
||||
@export var index: StringName
|
||||
@export var visibility_target: StringName
|
||||
|
||||
@export var max_ammo: int
|
||||
|
|
|
|||
|
|
@ -103,7 +103,8 @@ func drop(weapon: WeaponSubStateMachine) -> void:
|
|||
if slots.find_key(weapon) == "knife":
|
||||
return
|
||||
var drop_data: Dictionary = {}
|
||||
drop_data.scene = weapon.droppable
|
||||
drop_data.type = "weapon"
|
||||
drop_data.spawn_name = weapon.index
|
||||
drop_data.ammo = weapon.ammo
|
||||
drop_data.remaining_ammo = weapon.remaining_ammo
|
||||
drop_data.slot = weapon.slot
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue