Compare commits
2 commits
a655f9332f
...
1ac71cc104
| Author | SHA1 | Date | |
|---|---|---|---|
| 1ac71cc104 | |||
| fa882502b4 |
1 changed files with 60 additions and 21 deletions
|
|
@ -1,45 +1,84 @@
|
||||||
class_name WeaponShot
|
class_name WeaponShot
|
||||||
extends Resource
|
extends Resource
|
||||||
|
|
||||||
@export_category("Parameters")
|
|
||||||
|
@export_group("Weapon")
|
||||||
|
|
||||||
|
|
||||||
|
# Human-readable name for reference in UI and logs.
|
||||||
@export var shot_name: String
|
@export var shot_name: String
|
||||||
@export var bullet_scene: PackedScene = null
|
|
||||||
@export var damage: int = 1
|
# PackedScene reference to the bullet / projectile scene instantiated on fire.
|
||||||
@export var speed: int = 135
|
@export var bullet_scene: PackedScene
|
||||||
@export var projectiles: int = 2
|
|
||||||
|
|
||||||
|
@export_subgroup("Launch")
|
||||||
|
|
||||||
|
|
||||||
|
# Damage dealt by a single projectile instance.
|
||||||
|
@export_range(1, 100, 1) var damage: int = 1
|
||||||
|
|
||||||
|
# Travel speed of projectiles in pixels per second.
|
||||||
|
@export_range(50, 2000, 10) var speed: int = 135
|
||||||
|
|
||||||
|
# Number of projectiles fired in a burst pattern.
|
||||||
|
@export_range(1, 20, 1) var projectiles: int = 2
|
||||||
|
|
||||||
|
|
||||||
|
@export_subgroup("Spawn Geometry")
|
||||||
|
|
||||||
|
|
||||||
# Vertical spacing between projectiles in a burst (used by WeaponFireHelper to compute the ^ pattern).
|
# Vertical spacing between projectiles in a burst (used by WeaponFireHelper to compute the ^ pattern).
|
||||||
# This parameter has a dual role: spatial (computing the ^ burst geometry) and temporal
|
# This parameter has a dual role: spatial (computing the ^ burst geometry) and temporal
|
||||||
# (serving as the burst-gating threshold in ShootComponent.shoot()). When compensate_spawn_geometry
|
# (serving as the burst-gating threshold in ShootComponent.shoot()). When compensate_spawn_geometry
|
||||||
# is enabled, this parameter is overridden by geometric compensation for spatial calculations;
|
# is enabled, this parameter is overridden by geometric compensation for spatial calculations;
|
||||||
# temporal behavior remains unchanged and continues to use this value.
|
# temporal behavior remains unchanged and continues to use this value.
|
||||||
@export var projectile_vertical_spacing: float = 35
|
@export_range(10, 200, 0.5) var projectile_vertical_spacing: float = 35
|
||||||
|
|
||||||
# Vertical offset from the top of the player's sprite where bullets spawn.
|
# Vertical offset from the top of the player's sprite where bullets spawn.
|
||||||
# Measured in pixels; negative values fire in front of (above) the ship,
|
# Measured in pixels; negative values fire in front of (above) the ship,
|
||||||
# positive values fire behind (below) it. The default of -25 places the
|
# positive values fire behind (below) it. The default of -25 places the
|
||||||
# burst 25 pixels above the sprite's top edge.
|
# burst 25 pixels above the sprite's top edge.
|
||||||
@export var origin: float = -25.0
|
@export_range(-200, 200, 0.5) var origin: float = -25.0
|
||||||
|
|
||||||
|
|
||||||
|
@export_subgroup("Spread")
|
||||||
|
|
||||||
|
|
||||||
|
# Horizontal distance between adjacent projectiles in a burst.
|
||||||
|
@export_range(0, 100, 0.25) var horizontal_offset: float = 6.5
|
||||||
|
|
||||||
|
# Total spread angle in degrees (only applied when projectiles >= 3).
|
||||||
|
@export_range(0, 360, 0.5) var spread_angle: float = 0.0
|
||||||
|
|
||||||
|
# Time delay per projectile index in a burst.
|
||||||
|
@export_range(0.01, 5.0, 0.05) var stagger_offset: float = 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
|
|
||||||
# When enabled, adjusts spawn vertical offsets so the geometric line
|
# When enabled, adjusts spawn vertical offsets so the geometric line
|
||||||
# from the center bullet to each outer bullet matches their velocity
|
# from the center bullet to each outer bullet matches their velocity
|
||||||
# direction. Eliminates the optical illusion where the spread appears
|
# direction. Eliminates the optical illusion where the spread appears
|
||||||
# wider than the actual bullet trajectories (e.g. spread.tres flies at
|
# wider than the actual bullet trajectories (e.g. vanguard+). See the
|
||||||
# half the angle it visually appears to fan).
|
# Debugging Checklist for the vertical offset pitfall on standard shots.
|
||||||
|
|
||||||
## WARNING: This flag uses a trigonometric formula (horizontal_offset / tan(angle)) that evaluates independently-tuned horizontal and spread angles in grouped shots ONLY!
|
## WARNING: This flag uses a trigonometric formula (horizontal_offset / tan(angle)) that evaluates independently-tuned horizontal and spread angles in grouped shots ONLY!
|
||||||
@export var compensate_spawn_geometry: bool = false
|
@export var compensate_spawn_geometry: bool = false
|
||||||
|
|
||||||
@export_category("Effects")
|
|
||||||
# Offset animation playback per projectile index
|
@export_subgroup("Timing")
|
||||||
|
|
||||||
|
|
||||||
|
# Offset animation playback per projectile index.
|
||||||
@export var stagger_animation: bool = false
|
@export var stagger_animation: bool = false
|
||||||
# Rotate projectiles to point along their travel direction (requires >2 projectiles and spread_angle > 0)
|
|
||||||
|
|
||||||
|
@export_subgroup("Effects")
|
||||||
|
|
||||||
|
|
||||||
|
# Rotate projectiles to point along their travel direction (requires >2 projectiles and spread_angle > 0).
|
||||||
@export var follow_angle: bool = false
|
@export var follow_angle: bool = false
|
||||||
|
|
||||||
@export_category("Grouped Projectiles")
|
|
||||||
|
@export_subgroup("Groups")
|
||||||
|
|
||||||
|
|
||||||
|
# Array of projectile groups defining layered, multi-directional fire patterns.
|
||||||
@export var groups: Array[WeaponProjectileGroup] = []
|
@export var groups: Array[WeaponProjectileGroup] = []
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue