Rework player state system to use an event subscription system to avoid directly calling methods on individual state and having to worry about validity

This commit is contained in:
2026-04-01 11:11:02 -05:00
parent 7cd34cb07e
commit eabfeab91a
35 changed files with 882 additions and 2288 deletions

View File

@@ -6,7 +6,7 @@
[ext_resource type="PackedScene" uid="uid://ddgeo3vwebqeg" path="res://Entities/Map Objects/Mechanisms/shop_item.tscn" id="3_7ftpj"]
[ext_resource type="Script" uid="uid://dkcsftcdqtmg" path="res://Maps/Connectors/Scripts/spawn_marker_connector.gd" id="3_t8w5b"]
[ext_resource type="Texture2D" uid="uid://hop1gedjh8s4" path="res://Assets/Spritesheets/Player/icons_full_32.png" id="4_r8s0p"]
[ext_resource type="PackedScene" uid="uid://6athlweutl2g" path="res://Entities/Characters/Player/player.tscn" id="5_6ky6i"]
[ext_resource type="PackedScene" uid="uid://6athlweutl2g" path="res://Entities/Characters/Player/Individual Components/body.tscn" id="5_6ky6i"]
[ext_resource type="Texture2D" uid="uid://crebnygky3qv0" path="res://Assets/Sprites/Black Square.png" id="6_kt7c3"]
[ext_resource type="PackedScene" uid="uid://bbules4o3xayc" path="res://Entities/Map Objects/Loading Zone/loading_zone_transporter.tscn" id="6_t8w5b"]
[ext_resource type="Texture2D" uid="uid://bf6llktwqhs8l" path="res://Assets/Sprites/Door Fade.png" id="7_7ftpj"]
@@ -44,7 +44,7 @@ script = ExtResource("2_r8s0p")
[node name="Spawn Marker Connector" type="Node" parent="." unique_id=2053338893 node_paths=PackedStringArray("player", "markers")]
script = ExtResource("3_t8w5b")
player = NodePath("../Player")
player = NodePath("../Player Body")
markers = NodePath("../Spawn Markers")
[node name="Tilemap" type="Node2D" parent="." unique_id=81778152]
@@ -115,7 +115,7 @@ destination_marker_name = "Shop Entrance"
[node name="Shop Entrance" type="Marker2D" parent="Spawn Markers" unique_id=122141189]
position = Vector2(223, 225)
[node name="Player" parent="." unique_id=1502234578 instance=ExtResource("5_6ky6i")]
[node name="Player Body" parent="." unique_id=1502234578 instance=ExtResource("5_6ky6i")]
position = Vector2(289, 174)
[node name="Camera2D" type="Camera2D" parent="." unique_id=1684491254]
@@ -145,6 +145,3 @@ texture = ExtResource("6_kt7c3")
position = Vector2(224, 232)
scale = Vector2(2, 1)
texture = ExtResource("7_7ftpj")
[connection signal="InteractScannerAreaEntered" from="Player" to="Shop Item Notification Connector" method="OnPlayerInteractScannerAreaEntered"]
[connection signal="InteractScannerAreaExited" from="Player" to="Shop Item Notification Connector" method="OnPlayerInteractScannerAreaExited"]