Global refactor
This commit is contained in:
parent
3868af29e3
commit
0589ca4e23
180 changed files with 249 additions and 401 deletions
|
|
@ -1,28 +0,0 @@
|
|||
extends WeaponState
|
||||
|
||||
const molik: PackedScene = preload("res://scenes/weapons/molik.tscn")
|
||||
|
||||
func enter() -> void:
|
||||
fire()
|
||||
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 == machine.animation_prefix + "throw":
|
||||
transition.emit("Idle")
|
||||
|
||||
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: RigidBody3D = molik.instantiate()
|
||||
Session.dynamic_objects_spawner.get_parent().add_child(molotov)
|
||||
molotov.global_transform = machine.player_camera.global_transform
|
||||
molotov.apply_impulse(-molotov.global_basis.z * 10)
|
||||
Loading…
Add table
Add a link
Reference in a new issue