feat: add plasma gun weapon implementation and new pause menu system with loadout management

This commit is contained in:
DottsGit
2026-06-04 17:06:50 -04:00
parent 67bd5b4302
commit 1ccc66a601
37 changed files with 1070 additions and 0 deletions
+80
View File
@@ -0,0 +1,80 @@
extends BaseHitscanWeapon
class_name MP7
func _init() -> void:
weapon_name = "MP7"
fire_rate = 0.05 # ~1200 RPM
max_ammo = 45
reload_time = 1.2
base_damage = 12.0
min_damage = 3.0
falloff_start = 8.0
max_range = 50.0
automatic = true
spread_angle = 0.025
func _build_model() -> void:
position = Vector3(0.25, -0.25, -0.5)
var black_mat = StandardMaterial3D.new()
black_mat.albedo_color = Color(0.05, 0.05, 0.05)
# Receiver
var receiver = MeshInstance3D.new()
var rec_mesh = BoxMesh.new()
rec_mesh.size = Vector3(0.04, 0.1, 0.2)
rec_mesh.material = black_mat
receiver.mesh = rec_mesh
receiver.position = Vector3(0, 0, 0)
model_root.add_child(receiver)
# Grip
var grip = MeshInstance3D.new()
var g_mesh = BoxMesh.new()
g_mesh.size = Vector3(0.03, 0.12, 0.04)
g_mesh.material = black_mat
grip.mesh = g_mesh
grip.position = Vector3(0, -0.06, 0.08)
grip.rotation.x = deg_to_rad(10)
model_root.add_child(grip)
# Foregrip
var fgrip = MeshInstance3D.new()
var fg_mesh = BoxMesh.new()
fg_mesh.size = Vector3(0.03, 0.08, 0.03)
fg_mesh.material = black_mat
fgrip.mesh = fg_mesh
fgrip.position = Vector3(0, -0.05, -0.06)
fgrip.rotation.x = deg_to_rad(-10)
model_root.add_child(fgrip)
# Barrel
var barrel = MeshInstance3D.new()
var b_mesh = CylinderMesh.new()
b_mesh.top_radius = 0.008
b_mesh.bottom_radius = 0.008
b_mesh.height = 0.1
b_mesh.material = black_mat
barrel.mesh = b_mesh
barrel.rotation.x = deg_to_rad(90)
barrel.position = Vector3(0, 0.02, -0.15)
model_root.add_child(barrel)
# Muzzle Flash
muzzle_flash = OmniLight3D.new()
muzzle_flash.light_color = Color(1.0, 0.9, 0.5)
muzzle_flash.light_energy = 0.0
muzzle_flash.omni_range = 3.0
muzzle_flash.position = Vector3(0, 0.02, -0.2)
model_root.add_child(muzzle_flash)
# Audio
fire_sound = AudioStreamPlayer3D.new()
fire_sound.stream = load("res://assets/sounds/mp7_fire.wav")
fire_sound.position = muzzle_flash.position
fire_sound.volume_db = -10.0
model_root.add_child(fire_sound)
reload_sound = AudioStreamPlayer3D.new()
reload_sound.stream = load("res://assets/sounds/shotgun_reload.wav")
model_root.add_child(reload_sound)