From b8e5794d483a6bb9728ec0e98e3b7b846eca1018 Mon Sep 17 00:00:00 2001 From: Zenny Date: Fri, 7 Feb 2025 02:47:44 -0800 Subject: [PATCH] Clean up --- src/audio/InGameAudio.cs | 3 --- src/boss/Boss.cs | 3 --- src/enemy/Enemy.cs | 2 -- src/enemy/enemy_types/ox_face/OxFace.cs | 2 -- src/inventory_menu/ItemSlot.cs | 2 -- src/items/accessory/Accessory.cs | 2 -- src/items/consumable/ConsumableItem.tscn | 20 +++----------------- src/items/dropped/DroppedItem.cs | 2 -- src/items/restorative/Restorative.cs | 1 - src/map/dungeon/code/BossRoom.cs | 2 -- src/map/dungeon/code/DungeonRoom.cs | 2 -- src/map/dungeon/code/Overworld.cs | 3 --- src/player/Player.cs | 3 +++ src/ui/floor_clear/FloorClearMenu.cs | 3 --- src/ui/player_ui/PlayerInfoUI.cs | 2 -- 15 files changed, 6 insertions(+), 46 deletions(-) diff --git a/src/audio/InGameAudio.cs b/src/audio/InGameAudio.cs index bb6a4fb1..6f515999 100644 --- a/src/audio/InGameAudio.cs +++ b/src/audio/InGameAudio.cs @@ -12,8 +12,6 @@ public partial class InGameAudio : Node [Dependency] public IAppRepo AppRepo => this.DependOn(); - [Dependency] public IGameRepo GameRepo => this.DependOn(); - [Dependency] public IGameEventDepot GameEventDepot => this.DependOn(); #region BGM Nodes @@ -55,7 +53,6 @@ public partial class InGameAudio : Node public void OnResolved() { InGameAudioLogic.Set(AppRepo); - InGameAudioLogic.Set(GameRepo); InGameAudioLogic.Set(GameEventDepot); InGameAudioBinding = InGameAudioLogic.Bind(); diff --git a/src/boss/Boss.cs b/src/boss/Boss.cs index e29c1ad1..9fcf3541 100644 --- a/src/boss/Boss.cs +++ b/src/boss/Boss.cs @@ -32,8 +32,6 @@ public partial class Boss : CharacterBody3D, IBoss, IProvide public BossLogic.IBinding BossBinding { get; set; } = default!; - [Dependency] public IGameRepo GameRepo => this.DependOn(); - [Dependency] public IGameEventDepot GameEventDepot => this.DependOn(); [Dependency] public IGame Game => this.DependOn(); @@ -58,7 +56,6 @@ public partial class Boss : CharacterBody3D, IBoss, IProvide { BossLogic = new BossLogic(); BossLogic.Set(this as IBoss); - BossLogic.Set(GameRepo); SetPhysicsProcess(false); Hide(); diff --git a/src/enemy/Enemy.cs b/src/enemy/Enemy.cs index da6235be..96e1ff17 100644 --- a/src/enemy/Enemy.cs +++ b/src/enemy/Enemy.cs @@ -20,8 +20,6 @@ public partial class Enemy : RigidBody3D, IEnemy, IProvide #region Dependencies - [Dependency] IGameRepo GameRepo => this.DependOn(); - [Dependency] IGameEventDepot GameEventDepot => this.DependOn(); [Dependency] IPlayer Player => this.DependOn(); diff --git a/src/enemy/enemy_types/ox_face/OxFace.cs b/src/enemy/enemy_types/ox_face/OxFace.cs index 412390a4..812e6152 100644 --- a/src/enemy/enemy_types/ox_face/OxFace.cs +++ b/src/enemy/enemy_types/ox_face/OxFace.cs @@ -11,8 +11,6 @@ public partial class OxFace : Node3D [Node] public AnimationTree AnimationTree { get; set; } = default!; - [Dependency] public IGameRepo GameRepo => this.DependOn(); - [Dependency] public IPlayer Player => this.DependOn(); [Node] public Timer AttackTimer { get; set; } = default!; diff --git a/src/inventory_menu/ItemSlot.cs b/src/inventory_menu/ItemSlot.cs index 9fe4939a..4cb616eb 100644 --- a/src/inventory_menu/ItemSlot.cs +++ b/src/inventory_menu/ItemSlot.cs @@ -23,8 +23,6 @@ public partial class ItemSlot : HBoxContainer, IItemSlot { public override void _Notification(int what) => this.Notify(what); - [Dependency] public IGameRepo GameRepo => this.DependOn(); - [Dependency] public IPlayer Player => this.DependOn(); //[Node] public Label EquipBonus { get; set; } = default!; diff --git a/src/items/accessory/Accessory.cs b/src/items/accessory/Accessory.cs index ab393a71..bed3a7c7 100644 --- a/src/items/accessory/Accessory.cs +++ b/src/items/accessory/Accessory.cs @@ -11,8 +11,6 @@ public partial class Accessory : Node3D, IEquipableItem { public override void _Notification(int what) => this.Notify(what); - [Dependency] public IGameRepo GameRepo => this.DependOn(); - [Dependency] public IGameEventDepot GameEventDepot => this.DependOn(); [Dependency] public IPlayer Player => this.DependOn(); diff --git a/src/items/consumable/ConsumableItem.tscn b/src/items/consumable/ConsumableItem.tscn index 6172283a..57251f48 100644 --- a/src/items/consumable/ConsumableItem.tscn +++ b/src/items/consumable/ConsumableItem.tscn @@ -1,19 +1,6 @@ -[gd_scene load_steps=5 format=3 uid="uid://c6w7dpk0hurj0"] +[gd_scene load_steps=3 format=3 uid="uid://c6w7dpk0hurj0"] -[ext_resource type="Script" path="res://src/items/consumable/ConsumableItem.cs" id="1_26bad"] -[ext_resource type="Script" path="res://src/items/consumable/ConsumableItemStats.cs" id="2_g3oo3"] - -[sub_resource type="Resource" id="Resource_33w5s"] -script = ExtResource("2_g3oo3") -RaiseHPAmount = 0 -RaiseVTAmount = 0 -Name = "" -Description = "" -SpawnRate = 0.5 -ThrowSpeed = 12.0 -HealHPAmount = 0 -HealVTAmount = 0 -ThrowDamage = 5 +[ext_resource type="Script" uid="uid://cyqibeq07rjr" path="res://src/items/consumable/ConsumableItem.cs" id="1_26bad"] [sub_resource type="BoxShape3D" id="BoxShape3D_7mh0f"] size = Vector3(0.778381, 0.929947, 0.731567) @@ -21,7 +8,6 @@ size = Vector3(0.778381, 0.929947, 0.731567) [node name="ConsumableItem" type="Node3D"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.75, 0) script = ExtResource("1_26bad") -ConsumableItemInfo = SubResource("Resource_33w5s") [node name="Pickup" type="Area3D" parent="."] unique_name_in_owner = true @@ -31,7 +17,7 @@ collision_mask = 4 [node name="Sprite" type="Sprite3D" parent="Pickup"] unique_name_in_owner = true transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.0322805, 0) -pixel_size = 0.0005 +pixel_size = 0.0015 billboard = 2 shaded = true double_sided = false diff --git a/src/items/dropped/DroppedItem.cs b/src/items/dropped/DroppedItem.cs index 52b4be6c..0f34885e 100644 --- a/src/items/dropped/DroppedItem.cs +++ b/src/items/dropped/DroppedItem.cs @@ -15,8 +15,6 @@ public partial class DroppedItem : RigidBody3D, IDroppedItem { public override void _Notification(int what) => this.Notify(what); - [Dependency] public IGameRepo GameRepo => this.DependOn(); - [Dependency] public IGame Game => this.DependOn(); [Dependency] public IPlayer Player => this.DependOn(); diff --git a/src/items/restorative/Restorative.cs b/src/items/restorative/Restorative.cs index a46561a4..0a79bd85 100644 --- a/src/items/restorative/Restorative.cs +++ b/src/items/restorative/Restorative.cs @@ -9,7 +9,6 @@ public partial class Restorative : Node3D { public override void _Notification(int what) => this.Notify(what); - [Dependency] public IGameRepo GameRepo => this.DependOn(); [Dependency] public IGameEventDepot GameEventDepot => this.DependOn(); [Node] public Area3D Pickup { get; set; } = default!; diff --git a/src/map/dungeon/code/BossRoom.cs b/src/map/dungeon/code/BossRoom.cs index 77f72ad8..43528eb0 100644 --- a/src/map/dungeon/code/BossRoom.cs +++ b/src/map/dungeon/code/BossRoom.cs @@ -10,8 +10,6 @@ public partial class BossRoom : Node3D, IDungeonRoom { public override void _Notification(int what) => this.Notify(what); - [Dependency] public IGameRepo GameRepo => this.DependOn(); - [Node] public Marker3D PlayerSpawn { get; set; } = default!; [Node] public Marker3D TeleportSpawn { get; set; } = default!; diff --git a/src/map/dungeon/code/DungeonRoom.cs b/src/map/dungeon/code/DungeonRoom.cs index 3c5af7bb..43a38847 100644 --- a/src/map/dungeon/code/DungeonRoom.cs +++ b/src/map/dungeon/code/DungeonRoom.cs @@ -17,8 +17,6 @@ public partial class DungeonRoom : Node3D, IDungeonRoom { public override void _Notification(int what) => this.Notify(what); - [Dependency] public IGameRepo GameRepo => this.DependOn(); - [Node] public Marker3D PlayerSpawn { get; set; } = default!; [Node] public Marker3D TeleportSpawn { get; set; } = default!; diff --git a/src/map/dungeon/code/Overworld.cs b/src/map/dungeon/code/Overworld.cs index 2604c943..ef289cb5 100644 --- a/src/map/dungeon/code/Overworld.cs +++ b/src/map/dungeon/code/Overworld.cs @@ -8,9 +8,6 @@ public partial class Overworld : Node3D, IDungeonFloor { public override void _Notification(int what) => this.Notify(what); - [Dependency] - public IGameRepo GameRepo => this.DependOn(); - [Node] public Marker3D PlayerSpawnPoint { get; set; } = default!; [Node] public Marker3D ExitSpawnPoint { get; set; } = default!; diff --git a/src/player/Player.cs b/src/player/Player.cs index 325b8a65..27559d72 100644 --- a/src/player/Player.cs +++ b/src/player/Player.cs @@ -325,6 +325,9 @@ public partial class Player : CharacterBody3D, IPlayer private void OnHealthTimerTimeout() { + if (Stats.CurrentHP.Value <= 0) + return; + if (Stats.CurrentVT.Value > 0) { if (Inventory.EquippedAccessory.Value.AccessoryTags.Contains(AccessoryTag.HalfVTConsumption)) diff --git a/src/ui/floor_clear/FloorClearMenu.cs b/src/ui/floor_clear/FloorClearMenu.cs index f967115c..e159e57d 100644 --- a/src/ui/floor_clear/FloorClearMenu.cs +++ b/src/ui/floor_clear/FloorClearMenu.cs @@ -23,9 +23,6 @@ public partial class FloorClearMenu : Control, IFloorClearMenu { public override void _Notification(int what) => this.Notify(what); - [Dependency] - public IGameRepo GameRepo => this.DependOn(); - [Node] public IAnimationPlayer AnimationPlayer { get; set; } = default!; [Node] public Button ContinueButton { get; set; } = default!; diff --git a/src/ui/player_ui/PlayerInfoUI.cs b/src/ui/player_ui/PlayerInfoUI.cs index babc8e9d..98a5246b 100644 --- a/src/ui/player_ui/PlayerInfoUI.cs +++ b/src/ui/player_ui/PlayerInfoUI.cs @@ -27,8 +27,6 @@ public partial class PlayerInfoUI : Control, IPlayerInfoUI [Node] public Label VTNumber { get; set; } = default!; #endregion - [Dependency] public IGameRepo GameRepo => this.DependOn(); - [Dependency] public IPlayer Player => this.DependOn(); public void OnResolved()