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

@ -1,4 +1,4 @@
[gd_scene load_steps=86 format=3 uid="uid://bo5aw2cad3akl"]
[gd_scene load_steps=87 format=3 uid="uid://bo5aw2cad3akl"]
[ext_resource type="Script" uid="uid://bq038uo4cm6nv" path="res://player/scripts/player.gd" id="1_oul6g"]
[ext_resource type="Texture2D" uid="uid://dqgq2c1h6yk3k" path="res://assets/sprites/characters/pink/Pink_Monster_Attack1_4.png" id="2_yllr7"]
@ -17,6 +17,7 @@
[ext_resource type="PackedScene" uid="uid://dud7c465danl4" path="res://combat/weapons/RangedWeaponComponent.tscn" id="15_wodsf"]
[ext_resource type="PackedScene" uid="uid://dqful6et42ok8" path="res://combat/weapons/MeleeWeaponComponent.tscn" id="16_32hag"]
[ext_resource type="PackedScene" uid="uid://bjybfg0xrowb5" path="res://entities/StatsComponent.tscn" id="17_tqiix"]
[ext_resource type="PackedScene" uid="uid://b0w0oxbtax5si" path="res://UI/DebugUI.tscn" id="18_e7oew"]
[sub_resource type="CircleShape2D" id="CircleShape2D_rkbax"]
@ -545,11 +546,12 @@ animations = [{
"speed": 5.0
}]
[node name="Player" type="CharacterBody2D" node_paths=PackedStringArray("ranged", "melee") groups=["friendly"]]
[node name="Player" type="CharacterBody2D" node_paths=PackedStringArray("ranged", "melee", "stats") groups=["friendly", "player"]]
collision_mask = 14
script = ExtResource("1_oul6g")
ranged = NodePath("RangedWeaponComponent")
melee = NodePath("MeleeWeaponComponent")
stats = NodePath("StatsComponent")
[node name="PlayerCollision" type="CollisionShape2D" parent="."]
position = Vector2(0, 7)
@ -572,3 +574,15 @@ stats = NodePath("../StatsComponent")
[node name="MeleeWeaponComponent" parent="." instance=ExtResource("16_32hag")]
[node name="StatsComponent" parent="." instance=ExtResource("17_tqiix")]
[node name="CanvasLayer" type="CanvasLayer" parent="."]
layer = 100
[node name="DebugUi" parent="CanvasLayer" instance=ExtResource("18_e7oew")]
offset_left = -288.0
offset_top = -161.0
offset_right = 870.0
offset_bottom = 492.0
scale = Vector2(0.499389, 0.499439)
size_flags_horizontal = 4
size_flags_vertical = 4