randomgeon/player/modifiers/projectile_size_additive.gd
Dan Baker 214e0aa5e0 Many changes
Handle it
2025-05-04 09:30:14 +01:00

25 lines
No EOL
979 B
GDScript

class_name ProjectileSizeAdditive extends Modifier
@export var size_increase: float = 0.5 # +50% bigger
func _init():
id = "size_additive"
display_name = "Enlarged Projectiles"
description = "Increases projectile size by %d%%" % (size_increase * 100)
modifier_type = ModifierType.ADDITIVE
func apply_stats_modification(final_stats: Dictionary, base_stats: Dictionary) -> void:
if final_stats.has("projectile_size"):
final_stats.projectile_size += size_increase
func modify_projectile(projectile) -> void:
# This will be called when the projectile is created
# Scale is often handled in the recalculate_stats method, but we can also add visual effects here
projectile.connect("on_spawned", _on_projectile_spawned)
func _on_projectile_spawned(projectile):
# Add a trail effect for larger projectiles
if projectile.scale.x > 1.2:
pass
#var trail = preload("res://scenes/projectile_trail.tscn").instantiate()
#projectile.add_child(trail)