Smoke effect and animations revamp

This commit is contained in:
Rendo 2025-12-17 11:51:28 +05:00
commit 4c3e35d1fc
20 changed files with 106 additions and 29 deletions

View file

@ -3,7 +3,7 @@ extends WeaponState
@export var emptyable: bool
func _enter() -> void:
machine.animation_player.play(with_morphems("idle"))
machine.play(with_morphems("idle"))
if is_multiplayer_authority():
machine.player.get_node("PlayerInput").reload.connect(init_reload)
@ -21,4 +21,4 @@ func init_reload():
transition.emit("Reload")
func with_morphems(animation):
return machine.animation_prefix + ((animation+"_empty") if emptyable and machine.ammo == 0 else animation)
return ((animation+"_empty") if emptyable and machine.ammo == 0 else animation)

View file

@ -3,7 +3,7 @@ extends WeaponState
@export var emptyable: bool
func _enter() -> void:
machine.animation_player.play(with_morphems("intro"))
machine.play(with_morphems("intro"))
machine.animation_player.animation_finished.connect(on_animation_finished)
func _exit() -> void:
@ -11,8 +11,8 @@ func _exit() -> void:
machine.animation_player.animation_finished.disconnect(on_animation_finished)
func on_animation_finished(animation):
if animation == with_morphems("intro"):
if animation == machine.animation_prefix + with_morphems("intro"):
transition.emit("Idle")
func with_morphems(animation):
return machine.animation_prefix + ((animation+"_empty") if emptyable and machine.ammo == 0 else animation)
return ((animation+"_empty") if emptyable and machine.ammo == 0 else animation)

View file

@ -3,14 +3,14 @@ extends WeaponState
@export var emptyable: bool
func _enter() -> void:
machine.animation_player.play(with_morphems("reload"))
machine.play(with_morphems("reload"))
machine.animation_player.animation_finished.connect(on_animation_finished)
func _exit() -> void:
machine.animation_player.animation_finished.disconnect(on_animation_finished)
func on_animation_finished(animation):
if animation == with_morphems("reload"):
if animation == machine.animation_prefix + with_morphems("reload"):
if machine.remaining_ammo > machine.max_ammo:
machine.remaining_ammo -= machine.max_ammo-machine.ammo
machine.ammo = machine.max_ammo
@ -20,4 +20,4 @@ func on_animation_finished(animation):
transition.emit("Idle")
func with_morphems(animation):
return machine.animation_prefix + ((animation+"_empty") if emptyable and machine.ammo == 0 else animation)
return ((animation+"_empty") if emptyable and machine.ammo == 0 else animation)

View file

@ -24,7 +24,7 @@ func _exit() -> void:
machine.animation_player.animation_finished.disconnect(on_animation_finished)
func on_animation_finished(animation):
if animation == with_morphems("shoot"):
if animation == machine.animation_prefix + with_morphems("shoot"):
transition.emit("Idle")
func _use_begin() -> void:
@ -38,8 +38,7 @@ func fire() -> void:
machine.ammo -= 1
bullets_shot += 1
machine.animation_player.stop()
machine.animation_player.play(with_morphems("shoot"))
machine.play(with_morphems("shoot"))
if is_multiplayer_authority():
Session.shoot_pellets(int(machine.player.name),limb_pellet_damage,torso_pellet_damage,head_pellet_damage,shoot_distance,pellet_spread.get_dots(),damage_reduction_curve)
@ -49,4 +48,4 @@ func fire() -> void:
machine.player_camera.recoil(horizontal_curve.sample(bullets_shot),vertical_curve.sample(bullets_shot))
func with_morphems(animation):
return machine.animation_prefix + ((animation+"_empty") if emptyable and machine.ammo == 0 else animation)
return ((animation+"_empty") if emptyable and machine.ammo == 0 else animation)

View file

@ -23,7 +23,7 @@ func _exit() -> void:
machine.animation_player.animation_finished.disconnect(on_animation_finished)
func on_animation_finished(animation):
if animation == with_morphems("shoot"):
if animation == machine.animation_prefix + with_morphems("shoot"):
transition.emit("Idle")
func _use_begin() -> void:
@ -37,8 +37,7 @@ func fire() -> void:
machine.ammo -= 1
bullets_shot += 1
machine.animation_player.stop()
machine.animation_player.play(with_morphems("shoot"))
machine.play(with_morphems("shoot"))
if is_multiplayer_authority():
Session.shoot(int(machine.player.name),limb_damage,torso_damage,head_damage,shoot_distance,damage_reduction_curve)
@ -48,4 +47,4 @@ func fire() -> void:
machine.player_camera.recoil(horizontal_curve.sample(bullets_shot),vertical_curve.sample(bullets_shot))
func with_morphems(animation):
return machine.animation_prefix + ((animation+"_empty") if emptyable and machine.ammo == 0 else animation)
return ((animation+"_empty") if emptyable and machine.ammo == 0 else animation)