Implements modifier system for weapons

Adds a modifier system allowing dynamic modification of weapon
stats and behavior. This includes:

- Creating ModifierLibrary to manage available modifiers.
- Adds ModifierManager to handle equipping and unequipping modifiers
- Adds a new RangedWeaponComponent to handle firing projectiles and
  managing modifiers.
- Introduces a DebugUI for in-game modifier management.
- Introduces an "Unlimited Power" modifier that changes the projectile scene.
- Modifies stats components to work with the new modifier system.

This system allows for more flexible and customizable weapon
functionality.
This commit is contained in:
Dan Baker 2025-05-08 18:31:19 +01:00
parent 9f66ab0a73
commit 70839387ca
22 changed files with 432 additions and 40 deletions

View file

@ -5,13 +5,10 @@ class_name MapBuilderClass
# Function to copy a TileMap layer from one scene to a target TileMap at a specific grid position
func copy_tilemap_to_target(source_scene, target_tilemap: TileMapLayer, target_layer: String, grid_position: Vector2i):
# First, load and instantiate the source scene if it's a resource path
Log.pr("Copying tilemap from source scene to target tilemap at grid position: ", grid_position)
Log.pr("Source scene: ", source_scene)
var source_instance
if source_scene is String:
source_instance = load(source_scene).instantiate()
elif source_scene is PackedScene:
Log.pr("Source scene is a PackedScene, instantiating it")
source_instance = source_scene.instantiate()
else:
source_instance = source_scene
@ -68,8 +65,6 @@ func find_tilemap_by_name(root_node: Node, tilemap_name: String) -> TileMapLayer
func redraw_terrain(positions: Array, layer: TileMapLayer, terrain_set: int, terrain: int) -> void:
Log.pr("Filtering and redrawing surrounding tiles", positions)
# Filter positions to only include cells with terrainset 0 and terrain 0
var filtered_positions: Array = []
for cell in positions:
@ -80,7 +75,6 @@ func redraw_terrain(positions: Array, layer: TileMapLayer, terrain_set: int, ter
# Only redraw if we have filtered cells
if filtered_positions.size() > 0:
Log.pr("Redrawing filtered tiles:", filtered_positions)
layer.set_cells_terrain_connect(filtered_positions, terrain_set, terrain)
else:
Log.pr("No tiles to redraw after filtering")