tweaks and continued gd4.4 upgrading

This commit is contained in:
derek
2025-03-06 16:28:52 -06:00
parent 326351a595
commit cba8e22fb4
13 changed files with 2210 additions and 2672 deletions

View File

@@ -152,7 +152,7 @@ func spawn_mag():
get_tree().get_root().add_child(instance_mag)
func spawn_casing():
if weapon_info.casing != null:
if weapon_info.casing != null and casing_ejector != null:
# Casing transform
var instance_casing = weapon_info.casing.instantiate()
instance_casing.position = casing_ejector.global_position
@@ -207,6 +207,7 @@ func tracker_checker(_delta):
func shotgun_pellet_spawn():
audio_fire.play()
spawn_casing()
var pellets_remaining = weapon_info.pellets_per_shot
while pellets_remaining > 0:
@@ -255,15 +256,12 @@ func projectile_initialize():
func bullet_fire():
audio_fire.play()
get_tree().current_scene.add_child(projectile_initialize())
if casing_ejector != null:
spawn_casing()
spawn_casing()
vibration()
if chamber != null:
revolver_chamber_rot_amt += 60
revolver_chamber_rot_amt += weapon_info.chamber_rot_amount
if weapon_info.smoke_enabled:
spawn_muzzle_smoke()
if casing_ejector != null:
spawn_casing()
player.recoil.add_recoil(Vector3(0,weapon_info.recoil_amount.y,weapon_info.recoil_amount.z),10,10)
player.recoil.add_gun_recoil(weapon_info.recoil_amount.x)
@@ -286,4 +284,4 @@ func melee_collider_disable():
melee_collision_shape.disabled = true
func vibration():
Input.start_joy_vibration(0,.1,.5,.1)
Input.start_joy_vibration(0,weapon_info.vibration_weak_magnitude,weapon_info.vibration_strong_magnitude,weapon_info.vibration_duration)