facsimile-wing/scripts/weapon_shot.gd

39 lines
1.8 KiB
GDScript

class_name WeaponShot
extends Resource
@export_category("Parameters")
@export var shot_name: String
@export var bullet_scene: PackedScene = null
@export var damage: int = 1
@export var speed: int = 135
@export var projectiles: int = 2
# Vertical spacing between projectiles in a burst (used by WeaponFireHelper to compute the ^ pattern).
# This controls spatial burst geometry, NOT temporal spacing between continuous fire bursts.
@export var projectile_vertical_spacing: float = 35
# Spawn offset strictly relative to the ship node's global position (origin).
# This offset is measured from the ship node's center, not the sprite texture.
# x is usually 0 (horizontal centering), y controls vertical fire position.
# Negative Y moves bullets "above" the ship (in front of it); positive Y
# moves them "below" (behind it). The default of (0, -25) places the burst
# 25 pixels above (in front of) the ship center.
# All weapon resources in this project use the default. Custom weapons with
# explicit origin.y > 0 (positive) will have their burst pattern appear
# behind or below the ship -- verify visually if adjusting.
@export var origin: Vector2 = Vector2(0, -25)
@export_category("Spread")
# Horizontal distance between projectiles
@export var horizontal_offset: float = 6.5
# Total spread angle in degrees (only applied when projectiles >= 3)
@export var spread_angle: float = 0.0
# Time delay per projectile index
@export var stagger_offset: float = 0.25
@export_category("Effects")
# Offset animation playback per projectile index
@export var stagger_animation: bool = false
# Rotate projectiles to point along their travel direction (requires >2 projectiles and spread_angle > 0)
@export var follow_angle: bool = false
@export_category("Grouped Projectiles")
@export var groups: Array[WeaponProjectileGroup] = []