Cmall fixes
This commit is contained in:
parent
c0489d405b
commit
de1ab2bb53
3 changed files with 14 additions and 15 deletions
|
|
@ -3,7 +3,6 @@ extends WeaponState
|
|||
@export var emptyable: bool
|
||||
|
||||
func _enter() -> void:
|
||||
|
||||
machine.animation_player.play(with_morphems("intro"))
|
||||
machine.animation_player.animation_finished.connect(on_animation_finished)
|
||||
|
||||
|
|
|
|||
|
|
@ -12,18 +12,18 @@ func _exit() -> void:
|
|||
func on_animation_finished(animation):
|
||||
if animation == machine.animation_prefix + "throw" or animation == machine.animation_prefix + "shoot":
|
||||
transition.emit("Idle")
|
||||
|
||||
machine.ammo -= 1
|
||||
if is_multiplayer_authority():
|
||||
var molotov: CharacterBody3D = molik.instantiate()
|
||||
Session.dynamic_objects_parent.add_child(molotov,true)
|
||||
molotov.global_transform = machine.player_camera.global_transform
|
||||
molotov.velocity = -molotov.global_basis.z * 25 + machine.player.velocity
|
||||
|
||||
|
||||
func fire() -> void:
|
||||
if machine.ammo == 0:
|
||||
return
|
||||
machine.ammo -= 1
|
||||
|
||||
|
||||
machine.animation_player.stop()
|
||||
machine.animation_player.play(machine.animation_prefix + "shoot")
|
||||
|
||||
if is_multiplayer_authority():
|
||||
var molotov: CharacterBody3D = molik.instantiate()
|
||||
Session.dynamic_objects_parent.add_child(molotov,true)
|
||||
molotov.global_transform = machine.player_camera.global_transform
|
||||
molotov.velocity = -molotov.global_basis.z * 25 + machine.player.velocity
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue