paratate/systems/bullets/bullet_preset.gd

46 lines
1.7 KiB
GDScript

@tool
class_name BulletPreset
extends Resource
@export_group("Bullets")
## Behavior used to control the motion and actions of the bullets.
@export var behavior: BulletBehavior = null
## Size in pixels of the bullets' hitboxes.
@export var hitbox_size: Vector2i = Vector2i.ZERO
## If [code]true[/code], the bullets will rotate to face their direction.
@export var face_direction: bool = false
## Array of graphics that will be picked from randomly for
## each bullet and modulated by the picked color.
@export var base_graphics: Array[AnimationStrip] = []:
set(value):
base_graphics = value
if base_graphics.size() != overlay_graphics.size():
overlay_graphics.resize(base_graphics.size())
notify_property_list_changed()
## Array of graphics that will be picked based on the chosen graphic from
## [member base_graphics] and drawn over top without being modulated.
@export var overlay_graphics: Array[AnimationStrip] = []:
set(value):
overlay_graphics = value
if base_graphics.size() != overlay_graphics.size():
overlay_graphics.resize(base_graphics.size())
notify_property_list_changed()
## Array of colors that will be picked from randomly to
## modulate the graphic chosen from [member base_graphics].
@export var colors: Array[Color] = [Color.WHITE]
@export_group("Spawning")
## The pattern to use for positioning each "round" of bullets.
@export var pattern: BulletSpawnPattern = null
## How many rounds of bullets to spawn before stopping.
@export var rounds: int = 1
## The time to wait after each "round" of bullets before spawning the next.
@export var round_delay: float = 0.0
@export_group("Bullet Set")
## Behavior that controls the movement and actions of the [BulletSet].
@export var set_behavior: BulletSetBehavior = null