diff --git a/Zennysoft.Game.Abstractions/Entity/IStackable.cs b/Zennysoft.Game.Abstractions/Entity/IStackable.cs deleted file mode 100644 index e70cab9c1..000000000 --- a/Zennysoft.Game.Abstractions/Entity/IStackable.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Zennysoft.Game.Abstractions; - -public interface IStackable -{ - int Count { get; } - - void SetCount(int count); -} diff --git a/Zennysoft.Game.Godot.Implementation/Entity/IStackable.cs b/Zennysoft.Game.Godot.Implementation/Entity/IStackable.cs new file mode 100644 index 000000000..14816da70 --- /dev/null +++ b/Zennysoft.Game.Godot.Implementation/Entity/IStackable.cs @@ -0,0 +1,10 @@ +using Chickensoft.Collections; + +namespace Zennysoft.Game.Implementation; + +public interface IStackable +{ + AutoProp Count { get; } + + void SetCount(int count); +} diff --git a/Zennysoft.Game.Godot.Implementation/Zennysoft.Game.Implementation.csproj b/Zennysoft.Game.Godot.Implementation/Zennysoft.Game.Implementation.csproj index 754937c10..d5da8d21b 100644 --- a/Zennysoft.Game.Godot.Implementation/Zennysoft.Game.Implementation.csproj +++ b/Zennysoft.Game.Godot.Implementation/Zennysoft.Game.Implementation.csproj @@ -13,7 +13,7 @@ - + diff --git a/Zennysoft.Game.Ma.Implementation/Equipment/EquipableItem.cs b/Zennysoft.Game.Ma.Implementation/Equipment/EquipableItem.cs index ce952be63..423411ebe 100644 --- a/Zennysoft.Game.Ma.Implementation/Equipment/EquipableItem.cs +++ b/Zennysoft.Game.Ma.Implementation/Equipment/EquipableItem.cs @@ -1,4 +1,5 @@ -using Chickensoft.Introspection; +using Chickensoft.Collections; +using Chickensoft.Introspection; using Chickensoft.Serialization; using Zennysoft.Ma.Adapter.Entity; @@ -17,6 +18,10 @@ public abstract partial class EquipableItem : InventoryItem public virtual int BonusVT { get; } [Save("bonus_luck_stats")] public virtual int BonusLuck { get; } + + [Save("equipment_is_glued")] + public bool Glued { get; set; } + [Save("bonus_elemental_resist_stats")] public virtual ElementalResistanceSet ElementalResistance { get; } = new ElementalResistanceSet(0, 0, 0, 0, 0, 0, 0); } diff --git a/Zennysoft.Game.Ma/project.godot b/Zennysoft.Game.Ma/project.godot index f2b53ad91..1bb522f17 100644 --- a/Zennysoft.Game.Ma/project.godot +++ b/Zennysoft.Game.Ma/project.godot @@ -298,6 +298,7 @@ locale/translations_pot_files=PackedStringArray("res://src/dialog/Dialogue.dialo 3d/run_on_separate_thread=true common/physics_ticks_per_second=144 +jolt_physics_3d/simulation/areas_detect_static_bodies=true [rendering] diff --git a/Zennysoft.Game.Ma/src/audio/SfxDatabase.cs b/Zennysoft.Game.Ma/src/audio/SfxDatabase.cs index 1a1246456..c16938d34 100644 --- a/Zennysoft.Game.Ma/src/audio/SfxDatabase.cs +++ b/Zennysoft.Game.Ma/src/audio/SfxDatabase.cs @@ -106,6 +106,6 @@ public enum SoundEffect SwapHPAndVT, TurnAllEnemiesIntoHealingItems, WeaponQuickSlash, - WeaponSlowSlash + WeaponSlowSlash, } diff --git a/Zennysoft.Game.Ma/src/game/Game.cs b/Zennysoft.Game.Ma/src/game/Game.cs index 5bad62646..75245e3ae 100644 --- a/Zennysoft.Game.Ma/src/game/Game.cs +++ b/Zennysoft.Game.Ma/src/game/Game.cs @@ -11,6 +11,7 @@ using Zennysoft.Game.Abstractions; using Zennysoft.Ma.Adapter; using System.IO; using System.Threading.Tasks; +using Zennysoft.Game.Implementation; [Meta(typeof(IAutoNode))] public partial class Game : Node3D, IGame @@ -226,6 +227,9 @@ public partial class Game : Node3D, IGame case ThrowableItem throwableItem: EnactThrowableItemEffects(throwableItem); break; + case Jewel jewel: + EnactJewelItemEffects(jewel); + break; } await ToSignal(GetTree().CreateTimer(0.3f), "timeout"); @@ -240,6 +244,7 @@ public partial class Game : Node3D, IGame dropped.Item = item; _map.AddChild(dropped); dropped.Drop(); + _player.Inventory.Remove(item); } public void SetItem(InventoryItem item) @@ -248,6 +253,7 @@ public partial class Game : Node3D, IGame var setItem = setScene.Instantiate(); _map.AddChild(setItem); setItem.Set(); + _player.Inventory.Remove(item); } public void ThrowItem(InventoryItem item) @@ -257,6 +263,7 @@ public partial class Game : Node3D, IGame thrown.ItemThatIsThrown = item; _map.AddChild(thrown); thrown.Throw(_effectService); + _player.Inventory.Remove(item); } public IDungeonFloor CurrentFloor => _map.CurrentFloor; @@ -560,9 +567,6 @@ public partial class Game : Node3D, IGame _effectService.TeleportToRandomRoom(_player); GameRepo.CloseInventory(); break; - case ThrowableItemTag.CanChangeAffinity: - _effectService.ChangeAffinity(throwableItem); - break; case ThrowableItemTag.WarpToExitIfFound: _effectService.WarpToExit(); GameRepo.CloseInventory(); @@ -575,10 +579,17 @@ public partial class Game : Node3D, IGame _player.VTComponent.Restore(throwableItem.HealVTAmount); } + private void EnactJewelItemEffects(Jewel jewel) + { + switch (jewel.Stats.JewelTag) + { + //case JewelTags.AeolicElement + } + } private void RemoveItemOrSubtractFromItemCount(InventoryItem item) { - if (item is IStackable stackableItem && stackableItem.Count > 1) - stackableItem.SetCount(stackableItem.Count - 1); + if (item is IStackable stackableItem && stackableItem.Count.Value > 1) + stackableItem.SetCount(stackableItem.Count.Value - 1); else _player.Inventory.Remove(item); } diff --git a/Zennysoft.Game.Ma/src/items/EffectService.cs b/Zennysoft.Game.Ma/src/items/EffectService.cs index 63b080182..386a84e8a 100644 --- a/Zennysoft.Game.Ma/src/items/EffectService.cs +++ b/Zennysoft.Game.Ma/src/items/EffectService.cs @@ -213,20 +213,6 @@ public class EffectService SfxDatabase.Instance.Play(SoundEffect.TeleportToRandomRoom); } - public void ChangeAffinity(ThrowableItem throwableItem) - { - var maximumElements = Enum.GetNames(typeof(ElementType)).Length; - var newElement = ((int)throwableItem.ElementType + 1) % maximumElements; - throwableItem.SetElementType((ElementType)newElement); - - // TODO: Make this an inventory animation to cycle through elements. - throwableItem.SetDescription( - $"Inflicts {throwableItem.ElementType} damage when thrown." + - $"{System.Environment.NewLine}Use item to change Affinity."); - - throwableItem.SetCount(throwableItem.Count + 1); - } - public void WarpToExit() { var exitRoom = _game.CurrentFloor.Rooms.OfType().Single(); diff --git a/Zennysoft.Game.Ma/src/items/Inventory.cs b/Zennysoft.Game.Ma/src/items/Inventory.cs index 82bc8a8f5..279a86eee 100644 --- a/Zennysoft.Game.Ma/src/items/Inventory.cs +++ b/Zennysoft.Game.Ma/src/items/Inventory.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; using System.Linq; using Zennysoft.Game.Abstractions; +using Zennysoft.Game.Implementation; using Zennysoft.Ma.Adapter; namespace Zennysoft.Game.Ma; @@ -96,9 +97,10 @@ public partial class Inventory : Node, IInventory foreach (var itemStack in itemsToStack) { var firstItem = itemStack.First(); - firstItem.SetCount(itemStack.Count()); + firstItem.SetCount(itemStack.Sum(x => x.Count.Value)); var itemsToRemove = itemStack.Except([firstItem]).Cast(); - Items = [.. Items.Except(itemsToRemove)]; + foreach (var item in itemsToRemove) + Remove(item); } return !Items.SequenceEqual(initialList); diff --git a/Zennysoft.Game.Ma/src/items/ItemDatabase.cs b/Zennysoft.Game.Ma/src/items/ItemDatabase.cs index 55e25a1ab..7f75da901 100644 --- a/Zennysoft.Game.Ma/src/items/ItemDatabase.cs +++ b/Zennysoft.Game.Ma/src/items/ItemDatabase.cs @@ -49,9 +49,6 @@ public class ItemDatabase var weights = itemsToSelectFrom.Select(x => x.SpawnRate).ToArray(); var selectedItem = itemsToSelectFrom.ToArray()[rng.RandWeighted(weights)]; - if (selectedItem is ThrowableItem throwableItem) - throwableItem.SetCount(rng.RandiRange(throwableItem.Stats.MinimumCount, throwableItem.Stats.MaximumCount)); - return selectedItem; } @@ -140,14 +137,14 @@ public class ItemDatabase database.Add(ammoItemScene); } - //foreach (var jewelItem in jewelResources) - //{ - // var jewelItemInfo = GD.Load($"res://src/items/jewel/resources/{jewelItem}".TrimSuffix(".remap")); - // var jewelItemScene = ResourceLoader.Load("res://src/items/jewel/Jewel.tscn").Instantiate(); - // jewelItemScene.Stats = jewelItemInfo; - // if (!database.Contains(jewelItemScene)) - // database.Add(jewelItemScene); - //} + foreach (var jewelItem in jewelResources) + { + var jewelItemInfo = GD.Load($"res://src/items/jewels/resources/{jewelItem}".TrimSuffix(".remap")); + var jewelItemScene = ResourceLoader.Load("res://src/items/jewels/Jewel.tscn").Instantiate(); + jewelItemScene.Stats = jewelItemInfo; + if (!database.Contains(jewelItemScene)) + database.Add(jewelItemScene); + } Items = [.. database]; } diff --git a/Zennysoft.Game.Ma/src/items/ammo/Ammo.cs b/Zennysoft.Game.Ma/src/items/ammo/Ammo.cs index e27d3c1b1..342b14d29 100644 --- a/Zennysoft.Game.Ma/src/items/ammo/Ammo.cs +++ b/Zennysoft.Game.Ma/src/items/ammo/Ammo.cs @@ -1,8 +1,9 @@ using Chickensoft.AutoInject; +using Chickensoft.Collections; using Chickensoft.Introspection; using Chickensoft.Serialization; using Godot; -using Zennysoft.Game.Abstractions; +using Zennysoft.Game.Implementation; using Zennysoft.Game.Ma; using Zennysoft.Ma.Adapter; @@ -11,13 +12,11 @@ public partial class Ammo : EquipableItem, IStackable { public override void _Notification(int what) => this.Notify(what); - private int _count; - [Node] private Sprite3D _sprite { get; set; } public void OnReady() { - _count = Stats.InitialCount; + Count = new AutoProp(Stats.InitialCount); _sprite.Texture = Stats.Texture; } @@ -37,8 +36,9 @@ public partial class Ammo : EquipableItem, IStackable public override Texture2D GetTexture() => Stats.Texture; [Save("ammo_item_count")] - public int Count { get => _count; } - public void SetCount(int count) => _count = count; + public AutoProp Count { get; private set; } + + public void SetCount(int count) => Count.OnNext(count); [Save("ammo_element")] public ElementType AmmoElement => Stats.AmmoElement; diff --git a/Zennysoft.Game.Ma/src/items/jewels/Jewel.cs b/Zennysoft.Game.Ma/src/items/jewels/Jewel.cs new file mode 100644 index 000000000..e87bac67a --- /dev/null +++ b/Zennysoft.Game.Ma/src/items/jewels/Jewel.cs @@ -0,0 +1,37 @@ +using Chickensoft.AutoInject; +using Chickensoft.Introspection; +using Chickensoft.Serialization; +using Godot; +using Zennysoft.Game.Ma; +using Zennysoft.Ma.Adapter; + +[Meta(typeof(IAutoNode)), Id("jewel")] +public partial class Jewel : InventoryItem +{ + public override void _Notification(int what) => this.Notify(what); + + [Node] private Sprite3D _sprite { get; set; } + + public void OnReady() + { + _sprite.Texture = Stats.Texture; + } + + public override string ItemName => Stats.Name; + + public override string Description => Stats.Description; + + public override float SpawnRate => Stats.SpawnRate; + + public override int ThrowDamage => Stats.ThrowDamage; + + public override float ThrowSpeed => Stats.ThrowSpeed; + + public override ItemTag ItemTag => Stats.ItemTag; + + public override Texture2D GetTexture() => Stats.Texture; + + [Export] + [Save("jewel_stats")] + public JewelStats Stats { get; set; } = new JewelStats(); +} diff --git a/Zennysoft.Game.Ma/src/items/jewels/Jewels.cs.uid b/Zennysoft.Game.Ma/src/items/jewels/Jewel.cs.uid similarity index 100% rename from Zennysoft.Game.Ma/src/items/jewels/Jewels.cs.uid rename to Zennysoft.Game.Ma/src/items/jewels/Jewel.cs.uid diff --git a/Zennysoft.Game.Ma/src/items/jewels/Jewel.tscn b/Zennysoft.Game.Ma/src/items/jewels/Jewel.tscn new file mode 100644 index 000000000..e139102a6 --- /dev/null +++ b/Zennysoft.Game.Ma/src/items/jewels/Jewel.tscn @@ -0,0 +1,38 @@ +[gd_scene load_steps=4 format=3 uid="uid://dqlbkyxqhyqtl"] + +[ext_resource type="Script" uid="uid://bou7fk1evvet" path="res://src/items/jewels/Jewel.cs" id="1_sedqc"] + +[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_40de3"] + +[sub_resource type="BoxShape3D" id="BoxShape3D_qdeu2"] +size = Vector3(0.898941, 2.34974, 0.86676) + +[node name="Jewel" type="RigidBody3D"] +collision_layer = 0 +axis_lock_linear_x = true +axis_lock_linear_z = true +axis_lock_angular_x = true +axis_lock_angular_y = true +axis_lock_angular_z = true +script = ExtResource("1_sedqc") + +[node name="CollisionShape3D" type="CollisionShape3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.720724, 0) +shape = SubResource("CapsuleShape3D_40de3") + +[node name="Pickup" type="Area3D" parent="."] +unique_name_in_owner = true +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.49274, 0) +collision_layer = 4 +collision_mask = 0 + +[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.370004, 0) +pixel_size = 0.025 +billboard = 2 +texture_filter = 0 + +[node name="CollisionShape3D" type="CollisionShape3D" parent="Pickup"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00804907, 0.709896, 0.0675965) +shape = SubResource("BoxShape3D_qdeu2") diff --git a/Zennysoft.Game.Ma/src/items/jewels/JewelStats.cs b/Zennysoft.Game.Ma/src/items/jewels/JewelStats.cs index 1d5461b5e..a4b5e4cbb 100644 --- a/Zennysoft.Game.Ma/src/items/jewels/JewelStats.cs +++ b/Zennysoft.Game.Ma/src/items/jewels/JewelStats.cs @@ -1,4 +1,5 @@ using Chickensoft.Introspection; +using Chickensoft.Serialization; using Godot; namespace Zennysoft.Game.Ma; @@ -7,4 +8,7 @@ namespace Zennysoft.Game.Ma; [Meta, Id("jewel_stat_type")] public partial class JewelStats : InventoryItemStats { + [Save("jewel_tag")] + [Export] + public JewelTags JewelTag { get; set; } } diff --git a/Zennysoft.Game.Ma/src/items/jewels/JewelTags.cs b/Zennysoft.Game.Ma/src/items/jewels/JewelTags.cs new file mode 100644 index 000000000..676ccc059 --- /dev/null +++ b/Zennysoft.Game.Ma/src/items/jewels/JewelTags.cs @@ -0,0 +1,19 @@ + +public enum JewelTags +{ + None, + AeolicElement, + IncreaseHPRecovery, + HastenVT, + LowerEXPGain, + Glue, + ItemRescue, + HydricElement, + IgneousElement, + IncreaseEXPGain, + LowerHPRecovery, + SlowVTReduction, + AutoIdentifyAllItems, + ReviveUserOnce, + TelluricElement +} diff --git a/Zennysoft.Game.Ma/src/items/jewels/JewelTags.cs.uid b/Zennysoft.Game.Ma/src/items/jewels/JewelTags.cs.uid new file mode 100644 index 000000000..2a33e7bd5 --- /dev/null +++ b/Zennysoft.Game.Ma/src/items/jewels/JewelTags.cs.uid @@ -0,0 +1 @@ +uid://hm03eov1reaj diff --git a/Zennysoft.Game.Ma/src/items/jewels/Jewels.cs b/Zennysoft.Game.Ma/src/items/jewels/Jewels.cs deleted file mode 100644 index a1faf8047..000000000 --- a/Zennysoft.Game.Ma/src/items/jewels/Jewels.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Godot; -using System; -using Zennysoft.Game.Ma; -using Zennysoft.Ma.Adapter; - -public partial class Jewels : InventoryItem -{ - public override string ItemName { get; } - public override string Description { get; } - public override float SpawnRate { get; } - public override int ThrowDamage { get; } - public override float ThrowSpeed { get; } - public override ItemTag ItemTag { get; } - - public override Texture2D GetTexture() => throw new NotImplementedException(); - - public JewelStats Stats { get; set; } = new JewelStats(); -} diff --git a/Zennysoft.Game.Ma/src/items/jewels/resources/AeollicJewel.tres b/Zennysoft.Game.Ma/src/items/jewels/resources/AeollicJewel.tres new file mode 100644 index 000000000..737526398 --- /dev/null +++ b/Zennysoft.Game.Ma/src/items/jewels/resources/AeollicJewel.tres @@ -0,0 +1,28 @@ +[gd_resource type="Resource" script_class="JewelStats" load_steps=3 format=3 uid="uid://bxen2ertkxmwo"] + +[ext_resource type="Texture2D" uid="uid://c47igpgj02war" path="res://src/items/jewels/texture/Aeollic Jewel.png" id="1_p3ar8"] +[ext_resource type="Script" uid="uid://btikba31yb0tl" path="res://src/items/jewels/JewelStats.cs" id="1_u0a3e"] + +[resource] +script = ExtResource("1_u0a3e") +JewelTag = 1 +Name = "Aeolic Jewel" +Description = "Add Aeolic damage to Weapon or Aeolic resistance to Armor." +SpawnRate = 0.5 +BonusAttack = 0 +BonusDefense = 0 +BonusLuck = 5 +BonusHP = 0 +BonusVT = 0 +AeolicResistance = 0 +TelluricResistance = 0 +HydricResistance = 0 +IgneousResistance = 0 +FerrumResistance = 0 +HolyResistance = 0 +CurseResistance = 0 +ThrowSpeed = 12.0 +ThrowDamage = 5 +ItemTag = 0 +Texture = ExtResource("1_p3ar8") +metadata/_custom_type_script = "uid://btikba31yb0tl" diff --git a/Zennysoft.Game.Ma/src/items/jewels/resources/AnabolicJewel.tres b/Zennysoft.Game.Ma/src/items/jewels/resources/AnabolicJewel.tres new file mode 100644 index 000000000..cccceec3d --- /dev/null +++ b/Zennysoft.Game.Ma/src/items/jewels/resources/AnabolicJewel.tres @@ -0,0 +1,28 @@ +[gd_resource type="Resource" script_class="JewelStats" load_steps=3 format=3 uid="uid://b8f23e2kay1cr"] + +[ext_resource type="Texture2D" uid="uid://cdq12s3k2oemt" path="res://src/items/jewels/texture/Anabolic.png" id="1_6jhk1"] +[ext_resource type="Script" uid="uid://btikba31yb0tl" path="res://src/items/jewels/JewelStats.cs" id="1_6xlbl"] + +[resource] +script = ExtResource("1_6xlbl") +JewelTag = 2 +Name = "Anabolic Jewel" +Description = "Increase HP regen speed." +SpawnRate = 0.5 +BonusAttack = 0 +BonusDefense = 0 +BonusLuck = 5 +BonusHP = 0 +BonusVT = 0 +AeolicResistance = 0 +TelluricResistance = 0 +HydricResistance = 0 +IgneousResistance = 0 +FerrumResistance = 0 +HolyResistance = 0 +CurseResistance = 0 +ThrowSpeed = 12.0 +ThrowDamage = 5 +ItemTag = 0 +Texture = ExtResource("1_6jhk1") +metadata/_custom_type_script = "uid://btikba31yb0tl" diff --git a/Zennysoft.Game.Ma/src/items/jewels/resources/BlackEgg.tres b/Zennysoft.Game.Ma/src/items/jewels/resources/BlackEgg.tres new file mode 100644 index 000000000..9a7053073 --- /dev/null +++ b/Zennysoft.Game.Ma/src/items/jewels/resources/BlackEgg.tres @@ -0,0 +1,27 @@ +[gd_resource type="Resource" script_class="JewelStats" load_steps=3 format=3 uid="uid://ciejgco24n0qo"] + +[ext_resource type="Script" uid="uid://btikba31yb0tl" path="res://src/items/jewels/JewelStats.cs" id="1_dxj8h"] +[ext_resource type="Texture2D" uid="uid://bjpp5hp78g2w6" path="res://src/items/jewels/texture/Black Egg.png" id="1_rbr4o"] + +[resource] +script = ExtResource("1_dxj8h") +Name = "Black Egg" +Description = "Increase Attack, Defense, and Luck." +SpawnRate = 0.5 +BonusAttack = 0 +BonusDefense = 0 +BonusLuck = 5 +BonusHP = 0 +BonusVT = 0 +AeolicResistance = 0 +TelluricResistance = 0 +HydricResistance = 0 +IgneousResistance = 0 +FerrumResistance = 0 +HolyResistance = 0 +CurseResistance = 0 +ThrowSpeed = 12.0 +ThrowDamage = 5 +ItemTag = 0 +Texture = ExtResource("1_rbr4o") +metadata/_custom_type_script = "uid://btikba31yb0tl" diff --git a/Zennysoft.Game.Ma/src/items/jewels/resources/CatsEye.tres b/Zennysoft.Game.Ma/src/items/jewels/resources/CatsEye.tres new file mode 100644 index 000000000..0e3c1298e --- /dev/null +++ b/Zennysoft.Game.Ma/src/items/jewels/resources/CatsEye.tres @@ -0,0 +1,27 @@ +[gd_resource type="Resource" script_class="JewelStats" load_steps=3 format=3 uid="uid://d8186oeld7up"] + +[ext_resource type="Texture2D" uid="uid://bnno0bwaxvvq4" path="res://src/items/jewels/texture/Cats Eye.png" id="1_a82hi"] +[ext_resource type="Script" uid="uid://btikba31yb0tl" path="res://src/items/jewels/JewelStats.cs" id="1_vvfsu"] + +[resource] +script = ExtResource("1_vvfsu") +Name = "Cat's Eye" +Description = "Dramatically increases Luck." +SpawnRate = 0.5 +BonusAttack = 0 +BonusDefense = 0 +BonusLuck = 5 +BonusHP = 0 +BonusVT = 0 +AeolicResistance = 0 +TelluricResistance = 0 +HydricResistance = 0 +IgneousResistance = 0 +FerrumResistance = 0 +HolyResistance = 0 +CurseResistance = 0 +ThrowSpeed = 12.0 +ThrowDamage = 5 +ItemTag = 0 +Texture = ExtResource("1_a82hi") +metadata/_custom_type_script = "uid://btikba31yb0tl" diff --git a/Zennysoft.Game.Ma/src/items/jewels/resources/CinnabarStructure.tres b/Zennysoft.Game.Ma/src/items/jewels/resources/CinnabarStructure.tres new file mode 100644 index 000000000..279abb5fa --- /dev/null +++ b/Zennysoft.Game.Ma/src/items/jewels/resources/CinnabarStructure.tres @@ -0,0 +1,27 @@ +[gd_resource type="Resource" script_class="JewelStats" load_steps=3 format=3 uid="uid://bfmujwmg1iehy"] + +[ext_resource type="Texture2D" uid="uid://b2tnug7fnsqor" path="res://src/items/jewels/texture/Cinnabar Structure.png" id="1_fc5tr"] +[ext_resource type="Script" uid="uid://btikba31yb0tl" path="res://src/items/jewels/JewelStats.cs" id="1_k60ln"] + +[resource] +script = ExtResource("1_k60ln") +Name = "Cinnabar Structure" +Description = "Hastens VT, adds or improves Rust." +SpawnRate = 0.5 +BonusAttack = 0 +BonusDefense = 0 +BonusLuck = 5 +BonusHP = 0 +BonusVT = 0 +AeolicResistance = 0 +TelluricResistance = 0 +HydricResistance = 0 +IgneousResistance = 0 +FerrumResistance = 0 +HolyResistance = 0 +CurseResistance = 0 +ThrowSpeed = 12.0 +ThrowDamage = 5 +ItemTag = 0 +Texture = ExtResource("1_fc5tr") +metadata/_custom_type_script = "uid://btikba31yb0tl" diff --git a/Zennysoft.Game.Ma/src/items/jewels/resources/FoolishOrb.tres b/Zennysoft.Game.Ma/src/items/jewels/resources/FoolishOrb.tres new file mode 100644 index 000000000..1f2280e4f --- /dev/null +++ b/Zennysoft.Game.Ma/src/items/jewels/resources/FoolishOrb.tres @@ -0,0 +1,27 @@ +[gd_resource type="Resource" script_class="JewelStats" load_steps=3 format=3 uid="uid://cdygc6sdh0oki"] + +[ext_resource type="Texture2D" uid="uid://dqqyx7usmyo1k" path="res://src/items/jewels/texture/Foolish Orb.png" id="1_ltr3k"] +[ext_resource type="Script" uid="uid://btikba31yb0tl" path="res://src/items/jewels/JewelStats.cs" id="1_pn071"] + +[resource] +script = ExtResource("1_pn071") +Name = "Foolish Orb" +Description = "Lowers EXP gain." +SpawnRate = 0.5 +BonusAttack = 0 +BonusDefense = 0 +BonusLuck = 5 +BonusHP = 0 +BonusVT = 0 +AeolicResistance = 0 +TelluricResistance = 0 +HydricResistance = 0 +IgneousResistance = 0 +FerrumResistance = 0 +HolyResistance = 0 +CurseResistance = 0 +ThrowSpeed = 12.0 +ThrowDamage = 5 +ItemTag = 0 +Texture = ExtResource("1_ltr3k") +metadata/_custom_type_script = "uid://btikba31yb0tl" diff --git a/Zennysoft.Game.Ma/src/items/jewels/resources/GlueOrb.tres b/Zennysoft.Game.Ma/src/items/jewels/resources/GlueOrb.tres new file mode 100644 index 000000000..99febc7c7 --- /dev/null +++ b/Zennysoft.Game.Ma/src/items/jewels/resources/GlueOrb.tres @@ -0,0 +1,27 @@ +[gd_resource type="Resource" script_class="JewelStats" load_steps=3 format=3 uid="uid://b00agx6qy6yhv"] + +[ext_resource type="Script" uid="uid://btikba31yb0tl" path="res://src/items/jewels/JewelStats.cs" id="1_c23yr"] +[ext_resource type="Texture2D" uid="uid://d3vv6ea17uifk" path="res://src/items/jewels/texture/Glue Orb.png" id="1_sww4k"] + +[resource] +script = ExtResource("1_c23yr") +Name = "Glue Orb" +Description = "Prevents item from being unequipped." +SpawnRate = 0.5 +BonusAttack = 0 +BonusDefense = 0 +BonusLuck = 5 +BonusHP = 0 +BonusVT = 0 +AeolicResistance = 0 +TelluricResistance = 0 +HydricResistance = 0 +IgneousResistance = 0 +FerrumResistance = 0 +HolyResistance = 0 +CurseResistance = 0 +ThrowSpeed = 12.0 +ThrowDamage = 5 +ItemTag = 0 +Texture = ExtResource("1_sww4k") +metadata/_custom_type_script = "uid://btikba31yb0tl" diff --git a/Zennysoft.Game.Ma/src/items/jewels/resources/HeirloomStone.tres b/Zennysoft.Game.Ma/src/items/jewels/resources/HeirloomStone.tres new file mode 100644 index 000000000..e0d50ee1e --- /dev/null +++ b/Zennysoft.Game.Ma/src/items/jewels/resources/HeirloomStone.tres @@ -0,0 +1,27 @@ +[gd_resource type="Resource" script_class="JewelStats" load_steps=3 format=3 uid="uid://bxq5xnxfhatpi"] + +[ext_resource type="Script" uid="uid://btikba31yb0tl" path="res://src/items/jewels/JewelStats.cs" id="1_7gwjj"] +[ext_resource type="Texture2D" uid="uid://4247dwj5g705" path="res://src/items/jewels/texture/Heirloom Stone.png" id="1_gk4x7"] + +[resource] +script = ExtResource("1_7gwjj") +Name = "Heirloom Stone" +Description = "Returns item to the surface world." +SpawnRate = 0.5 +BonusAttack = 0 +BonusDefense = 0 +BonusLuck = 5 +BonusHP = 0 +BonusVT = 0 +AeolicResistance = 0 +TelluricResistance = 0 +HydricResistance = 0 +IgneousResistance = 0 +FerrumResistance = 0 +HolyResistance = 0 +CurseResistance = 0 +ThrowSpeed = 12.0 +ThrowDamage = 5 +ItemTag = 0 +Texture = ExtResource("1_gk4x7") +metadata/_custom_type_script = "uid://btikba31yb0tl" diff --git a/Zennysoft.Game.Ma/src/items/jewels/resources/HydricJewel.tres b/Zennysoft.Game.Ma/src/items/jewels/resources/HydricJewel.tres new file mode 100644 index 000000000..d68f07873 --- /dev/null +++ b/Zennysoft.Game.Ma/src/items/jewels/resources/HydricJewel.tres @@ -0,0 +1,27 @@ +[gd_resource type="Resource" script_class="JewelStats" load_steps=3 format=3 uid="uid://c65jk6stksnai"] + +[ext_resource type="Script" uid="uid://btikba31yb0tl" path="res://src/items/jewels/JewelStats.cs" id="1_cyti8"] +[ext_resource type="Texture2D" uid="uid://brx581xmqv54k" path="res://src/items/jewels/texture/Hydric Jewel.png" id="1_fdjqp"] + +[resource] +script = ExtResource("1_cyti8") +Name = "Hydric Jewel" +Description = "Hydric e" +SpawnRate = 0.5 +BonusAttack = 0 +BonusDefense = 0 +BonusLuck = 5 +BonusHP = 0 +BonusVT = 0 +AeolicResistance = 0 +TelluricResistance = 0 +HydricResistance = 0 +IgneousResistance = 0 +FerrumResistance = 0 +HolyResistance = 0 +CurseResistance = 0 +ThrowSpeed = 12.0 +ThrowDamage = 5 +ItemTag = 0 +Texture = ExtResource("1_fdjqp") +metadata/_custom_type_script = "uid://btikba31yb0tl" diff --git a/Zennysoft.Game.Ma/src/items/jewels/resources/IgenousJewel.tres b/Zennysoft.Game.Ma/src/items/jewels/resources/IgenousJewel.tres new file mode 100644 index 000000000..ccb05649b --- /dev/null +++ b/Zennysoft.Game.Ma/src/items/jewels/resources/IgenousJewel.tres @@ -0,0 +1,27 @@ +[gd_resource type="Resource" script_class="JewelStats" load_steps=3 format=3 uid="uid://duk8un4sdv0cs"] + +[ext_resource type="Texture2D" uid="uid://d3bx1j5irhdes" path="res://src/items/jewels/texture/Igneous Jewel.png" id="1_knm0p"] +[ext_resource type="Script" uid="uid://btikba31yb0tl" path="res://src/items/jewels/JewelStats.cs" id="1_qh03l"] + +[resource] +script = ExtResource("1_qh03l") +Name = "Igneous Jewel" +Description = "" +SpawnRate = 0.5 +BonusAttack = 0 +BonusDefense = 0 +BonusLuck = 5 +BonusHP = 0 +BonusVT = 0 +AeolicResistance = 0 +TelluricResistance = 0 +HydricResistance = 0 +IgneousResistance = 0 +FerrumResistance = 0 +HolyResistance = 0 +CurseResistance = 0 +ThrowSpeed = 12.0 +ThrowDamage = 5 +ItemTag = 0 +Texture = ExtResource("1_knm0p") +metadata/_custom_type_script = "uid://btikba31yb0tl" diff --git a/Zennysoft.Game.Ma/src/items/jewels/resources/MeditativeOrb.tres b/Zennysoft.Game.Ma/src/items/jewels/resources/MeditativeOrb.tres new file mode 100644 index 000000000..f2907435d --- /dev/null +++ b/Zennysoft.Game.Ma/src/items/jewels/resources/MeditativeOrb.tres @@ -0,0 +1,27 @@ +[gd_resource type="Resource" script_class="JewelStats" load_steps=3 format=3 uid="uid://d2rdaghcccw0f"] + +[ext_resource type="Script" uid="uid://btikba31yb0tl" path="res://src/items/jewels/JewelStats.cs" id="1_6e2y5"] +[ext_resource type="Texture2D" uid="uid://drfx1s7mc3j0h" path="res://src/items/jewels/texture/Meditative Stone.png" id="1_cyim2"] + +[resource] +script = ExtResource("1_6e2y5") +Name = "Meditative Stone" +Description = "" +SpawnRate = 0.5 +BonusAttack = 0 +BonusDefense = 0 +BonusLuck = 5 +BonusHP = 0 +BonusVT = 0 +AeolicResistance = 0 +TelluricResistance = 0 +HydricResistance = 0 +IgneousResistance = 0 +FerrumResistance = 0 +HolyResistance = 0 +CurseResistance = 0 +ThrowSpeed = 12.0 +ThrowDamage = 5 +ItemTag = 0 +Texture = ExtResource("1_cyim2") +metadata/_custom_type_script = "uid://btikba31yb0tl" diff --git a/Zennysoft.Game.Ma/src/items/jewels/resources/MercuryPrism.tres b/Zennysoft.Game.Ma/src/items/jewels/resources/MercuryPrism.tres new file mode 100644 index 000000000..b758fcbd5 --- /dev/null +++ b/Zennysoft.Game.Ma/src/items/jewels/resources/MercuryPrism.tres @@ -0,0 +1,27 @@ +[gd_resource type="Resource" script_class="JewelStats" load_steps=3 format=3 uid="uid://djim1rdpt03ai"] + +[ext_resource type="Script" uid="uid://btikba31yb0tl" path="res://src/items/jewels/JewelStats.cs" id="1_ivvck"] +[ext_resource type="Texture2D" uid="uid://rl6df2udk2ui" path="res://src/items/jewels/texture/Mercury.png" id="1_rw1fk"] + +[resource] +script = ExtResource("1_ivvck") +Name = "Mercury Prism" +Description = "" +SpawnRate = 0.5 +BonusAttack = 0 +BonusDefense = 0 +BonusLuck = 5 +BonusHP = 0 +BonusVT = 0 +AeolicResistance = 0 +TelluricResistance = 0 +HydricResistance = 0 +IgneousResistance = 0 +FerrumResistance = 0 +HolyResistance = 0 +CurseResistance = 0 +ThrowSpeed = 12.0 +ThrowDamage = 5 +ItemTag = 0 +Texture = ExtResource("1_rw1fk") +metadata/_custom_type_script = "uid://btikba31yb0tl" diff --git a/Zennysoft.Game.Ma/src/items/jewels/resources/MetabolicJewel.tres b/Zennysoft.Game.Ma/src/items/jewels/resources/MetabolicJewel.tres new file mode 100644 index 000000000..bdcc15e16 --- /dev/null +++ b/Zennysoft.Game.Ma/src/items/jewels/resources/MetabolicJewel.tres @@ -0,0 +1,27 @@ +[gd_resource type="Resource" script_class="JewelStats" load_steps=3 format=3 uid="uid://dd5stvt4g531e"] + +[ext_resource type="Script" uid="uid://btikba31yb0tl" path="res://src/items/jewels/JewelStats.cs" id="1_cabnq"] +[ext_resource type="Texture2D" uid="uid://vxeil6eo3hdp" path="res://src/items/jewels/texture/Metabolic Jewel.png" id="1_pscn1"] + +[resource] +script = ExtResource("1_cabnq") +Name = "Metabolic Jewel" +Description = "" +SpawnRate = 0.5 +BonusAttack = 0 +BonusDefense = 0 +BonusLuck = 5 +BonusHP = 0 +BonusVT = 0 +AeolicResistance = 0 +TelluricResistance = 0 +HydricResistance = 0 +IgneousResistance = 0 +FerrumResistance = 0 +HolyResistance = 0 +CurseResistance = 0 +ThrowSpeed = 12.0 +ThrowDamage = 5 +ItemTag = 0 +Texture = ExtResource("1_pscn1") +metadata/_custom_type_script = "uid://btikba31yb0tl" diff --git a/Zennysoft.Game.Ma/src/items/jewels/resources/OssifiedCortex.tres b/Zennysoft.Game.Ma/src/items/jewels/resources/OssifiedCortex.tres new file mode 100644 index 000000000..648488385 --- /dev/null +++ b/Zennysoft.Game.Ma/src/items/jewels/resources/OssifiedCortex.tres @@ -0,0 +1,27 @@ +[gd_resource type="Resource" script_class="JewelStats" load_steps=3 format=3 uid="uid://bdd7xh6v03xul"] + +[ext_resource type="Script" uid="uid://btikba31yb0tl" path="res://src/items/jewels/JewelStats.cs" id="1_75k4l"] +[ext_resource type="Texture2D" uid="uid://bxa1kqlqhbyi3" path="res://src/items/jewels/texture/Ossified Cortex.png" id="1_cq6jp"] + +[resource] +script = ExtResource("1_75k4l") +Name = "Ossified Cortex" +Description = "" +SpawnRate = 0.5 +BonusAttack = 0 +BonusDefense = 0 +BonusLuck = 5 +BonusHP = 0 +BonusVT = 0 +AeolicResistance = 0 +TelluricResistance = 0 +HydricResistance = 0 +IgneousResistance = 0 +FerrumResistance = 0 +HolyResistance = 0 +CurseResistance = 0 +ThrowSpeed = 12.0 +ThrowDamage = 5 +ItemTag = 0 +Texture = ExtResource("1_cq6jp") +metadata/_custom_type_script = "uid://btikba31yb0tl" diff --git a/Zennysoft.Game.Ma/src/items/jewels/resources/RejectionStone.tres b/Zennysoft.Game.Ma/src/items/jewels/resources/RejectionStone.tres new file mode 100644 index 000000000..bfc95483a --- /dev/null +++ b/Zennysoft.Game.Ma/src/items/jewels/resources/RejectionStone.tres @@ -0,0 +1,27 @@ +[gd_resource type="Resource" script_class="JewelStats" load_steps=3 format=3 uid="uid://byufike6hontv"] + +[ext_resource type="Script" uid="uid://btikba31yb0tl" path="res://src/items/jewels/JewelStats.cs" id="1_fkhpb"] +[ext_resource type="Texture2D" uid="uid://c6fu3kd5yelwi" path="res://src/items/jewels/texture/Rejection Stone.png" id="1_rh6wh"] + +[resource] +script = ExtResource("1_fkhpb") +Name = "Rejection Stone" +Description = "" +SpawnRate = 0.5 +BonusAttack = 0 +BonusDefense = 0 +BonusLuck = 5 +BonusHP = 0 +BonusVT = 0 +AeolicResistance = 0 +TelluricResistance = 0 +HydricResistance = 0 +IgneousResistance = 0 +FerrumResistance = 0 +HolyResistance = 0 +CurseResistance = 0 +ThrowSpeed = 12.0 +ThrowDamage = 5 +ItemTag = 0 +Texture = ExtResource("1_rh6wh") +metadata/_custom_type_script = "uid://btikba31yb0tl" diff --git a/Zennysoft.Game.Ma/src/items/jewels/resources/TarnishedJewel.tres b/Zennysoft.Game.Ma/src/items/jewels/resources/TarnishedJewel.tres new file mode 100644 index 000000000..4a1161db2 --- /dev/null +++ b/Zennysoft.Game.Ma/src/items/jewels/resources/TarnishedJewel.tres @@ -0,0 +1,27 @@ +[gd_resource type="Resource" script_class="JewelStats" load_steps=3 format=3 uid="uid://blghjvef7p6fm"] + +[ext_resource type="Texture2D" uid="uid://cgs0hr24h5g6q" path="res://src/items/jewels/texture/Tarnished Jewel.png" id="1_6qtep"] +[ext_resource type="Script" uid="uid://btikba31yb0tl" path="res://src/items/jewels/JewelStats.cs" id="1_868vv"] + +[resource] +script = ExtResource("1_868vv") +Name = "Tarnished Jewel" +Description = "" +SpawnRate = 0.5 +BonusAttack = 0 +BonusDefense = 0 +BonusLuck = 5 +BonusHP = 0 +BonusVT = 0 +AeolicResistance = 0 +TelluricResistance = 0 +HydricResistance = 0 +IgneousResistance = 0 +FerrumResistance = 0 +HolyResistance = 0 +CurseResistance = 0 +ThrowSpeed = 12.0 +ThrowDamage = 5 +ItemTag = 0 +Texture = ExtResource("1_6qtep") +metadata/_custom_type_script = "uid://btikba31yb0tl" diff --git a/Zennysoft.Game.Ma/src/items/jewels/resources/TelluricJewel.tres b/Zennysoft.Game.Ma/src/items/jewels/resources/TelluricJewel.tres new file mode 100644 index 000000000..6f40dbe6e --- /dev/null +++ b/Zennysoft.Game.Ma/src/items/jewels/resources/TelluricJewel.tres @@ -0,0 +1,27 @@ +[gd_resource type="Resource" script_class="JewelStats" load_steps=3 format=3 uid="uid://d3fipjd8sayiw"] + +[ext_resource type="Texture2D" uid="uid://r36ecoqigs2o" path="res://src/items/jewels/texture/Telleric Jewel.png" id="1_yooxp"] +[ext_resource type="Script" uid="uid://btikba31yb0tl" path="res://src/items/jewels/JewelStats.cs" id="2_c8kww"] + +[resource] +script = ExtResource("2_c8kww") +Name = "Telluric Jewel" +Description = "Add Telluric damage to Weapon or Telluric resistance to Armor." +SpawnRate = 0.5 +BonusAttack = 0 +BonusDefense = 0 +BonusLuck = 5 +BonusHP = 0 +BonusVT = 0 +AeolicResistance = 0 +TelluricResistance = 0 +HydricResistance = 0 +IgneousResistance = 0 +FerrumResistance = 0 +HolyResistance = 0 +CurseResistance = 0 +ThrowSpeed = 12.0 +ThrowDamage = 5 +ItemTag = 0 +Texture = ExtResource("1_yooxp") +metadata/_custom_type_script = "uid://btikba31yb0tl" diff --git a/Zennysoft.Game.Ma/src/items/throwable/ThrowableItem.cs b/Zennysoft.Game.Ma/src/items/throwable/ThrowableItem.cs index ed489aeba..4aa916f84 100644 --- a/Zennysoft.Game.Ma/src/items/throwable/ThrowableItem.cs +++ b/Zennysoft.Game.Ma/src/items/throwable/ThrowableItem.cs @@ -1,8 +1,9 @@ using Chickensoft.AutoInject; +using Chickensoft.Collections; using Chickensoft.Introspection; using Chickensoft.Serialization; using Godot; -using Zennysoft.Game.Abstractions; +using Zennysoft.Game.Implementation; using Zennysoft.Ma.Adapter; namespace Zennysoft.Game.Ma; @@ -17,6 +18,9 @@ public partial class ThrowableItem : InventoryItem, IStackable public override void _Ready() { _sprite.Texture = Stats.Texture; + var rng = new RandomNumberGenerator(); + rng.Randomize(); + Count = new AutoProp(rng.RandiRange(Stats.MinimumCount, Stats.MaximumCount)); } public override string ItemName => Stats.Name; @@ -45,7 +49,7 @@ public partial class ThrowableItem : InventoryItem, IStackable public void SetDescription(string description) => Stats.Description = description; [Save("throwable_item_count")] - public int Count { get; private set; } = 1; + public AutoProp Count { get; private set; } [Export] [Save("throwable_item_stats")] @@ -53,5 +57,5 @@ public partial class ThrowableItem : InventoryItem, IStackable public override Texture2D GetTexture() => Stats.Texture; - public void SetCount(int count) => Count = count; + public void SetCount(int count) => Count.OnNext(count); } diff --git a/Zennysoft.Game.Ma/src/items/weapons/AirReactorProjectile.tscn b/Zennysoft.Game.Ma/src/items/weapons/AirReactorProjectile.tscn index 4ad3dabd2..1fc797e5e 100644 --- a/Zennysoft.Game.Ma/src/items/weapons/AirReactorProjectile.tscn +++ b/Zennysoft.Game.Ma/src/items/weapons/AirReactorProjectile.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=63 format=3 uid="uid://nnns2ade62al"] +[gd_scene load_steps=64 format=3 uid="uid://nnns2ade62al"] [ext_resource type="Script" uid="uid://cqm6u7qa8japr" path="res://src/system/Projectile.cs" id="1_xt24t"] [ext_resource type="Script" uid="uid://ctshiyffvt4y5" path="res://src/system/AttackDataResource.cs" id="2_yf47k"] @@ -516,6 +516,8 @@ _data = { &"RESET": SubResource("Animation_8qeb2") } +[sub_resource type="SphereShape3D" id="SphereShape3D_xt24t"] + [node name="AirReactor" type="Node3D"] script = ExtResource("1_xt24t") AttackData = SubResource("Resource_kcnxw") @@ -550,3 +552,9 @@ root_node = NodePath("../AnimatedSprite3D") libraries = { &"": SubResource("AnimationLibrary_q8n6h") } + +[node name="WallCollision" type="RigidBody3D" parent="Bullet"] +unique_name_in_owner = true + +[node name="CollisionShape3D" type="CollisionShape3D" parent="Bullet/WallCollision"] +shape = SubResource("SphereShape3D_xt24t") diff --git a/Zennysoft.Game.Ma/src/items/weapons/FireReactorProjectile.tscn b/Zennysoft.Game.Ma/src/items/weapons/FireReactorProjectile.tscn index 8aef4e0ae..6d2f34b05 100644 --- a/Zennysoft.Game.Ma/src/items/weapons/FireReactorProjectile.tscn +++ b/Zennysoft.Game.Ma/src/items/weapons/FireReactorProjectile.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=67 format=3 uid="uid://igpvnbi8qi6e"] +[gd_scene load_steps=68 format=3 uid="uid://igpvnbi8qi6e"] [ext_resource type="Script" uid="uid://cqm6u7qa8japr" path="res://src/system/Projectile.cs" id="1_pk6yq"] [ext_resource type="Script" uid="uid://ctshiyffvt4y5" path="res://src/system/AttackDataResource.cs" id="2_d874y"] @@ -547,6 +547,8 @@ _data = { &"RESET": SubResource("Animation_8qeb2") } +[sub_resource type="SphereShape3D" id="SphereShape3D_pk6yq"] + [node name="FireReactor" type="Node3D"] script = ExtResource("1_pk6yq") AttackData = SubResource("Resource_14f5p") @@ -581,3 +583,9 @@ root_node = NodePath("../AnimatedSprite3D") libraries = { &"": SubResource("AnimationLibrary_q8n6h") } + +[node name="WallCollision" type="RigidBody3D" parent="Bullet"] +unique_name_in_owner = true + +[node name="CollisionShape3D" type="CollisionShape3D" parent="Bullet/WallCollision"] +shape = SubResource("SphereShape3D_pk6yq") diff --git a/Zennysoft.Game.Ma/src/items/weapons/PersuaderProjectile.tscn b/Zennysoft.Game.Ma/src/items/weapons/PersuaderProjectile.tscn index f0ff9fdaf..5aabd97ee 100644 --- a/Zennysoft.Game.Ma/src/items/weapons/PersuaderProjectile.tscn +++ b/Zennysoft.Game.Ma/src/items/weapons/PersuaderProjectile.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=72 format=3 uid="uid://d3nx0suvhbcda"] +[gd_scene load_steps=73 format=3 uid="uid://d3nx0suvhbcda"] [ext_resource type="Script" uid="uid://cqm6u7qa8japr" path="res://src/system/Projectile.cs" id="1_7ykt2"] [ext_resource type="Script" uid="uid://ctshiyffvt4y5" path="res://src/system/AttackDataResource.cs" id="2_3v8me"] [ext_resource type="Texture2D" uid="uid://c1x4iaqgj2rur" path="res://src/vfx/Items Etc/smokepuff.png" id="3_7ykt2"] +[ext_resource type="AudioStream" uid="uid://bgvt4kqyvl5gp" path="res://src/audio/sfx/ENEMY_EDEN_FIRE.ogg" id="4_3v8me"] [sub_resource type="Resource" id="Resource_14f5p"] script = ExtResource("2_3v8me") @@ -456,8 +457,7 @@ animations = [{ [sub_resource type="Animation" id="Animation_xrn7e"] resource_name = "fire" -length = 1.11667 -step = 0.0166667 +length = 0.66667 tracks/0/type = "value" tracks/0/imported = false tracks/0/enabled = true @@ -477,10 +477,10 @@ tracks/1/path = NodePath(".:frame") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/keys = { -"times": PackedFloat32Array(0, 0.416667), +"times": PackedFloat32Array(0.2, 0.666667), "transitions": PackedFloat32Array(1, 1), "update": 0, -"values": [1, 67] +"values": [0, 67] } tracks/2/type = "value" tracks/2/imported = false @@ -489,7 +489,7 @@ tracks/2/path = NodePath("%ProjectileHitbox:position") tracks/2/interp = 1 tracks/2/loop_wrap = true tracks/2/keys = { -"times": PackedFloat32Array(0, 1.1), +"times": PackedFloat32Array(0, 0.666667), "transitions": PackedFloat32Array(1, 1), "update": 0, "values": [Vector3(0, 2.1, 0), Vector3(0, 2.1, -40)] @@ -501,11 +501,35 @@ tracks/3/path = NodePath("%ProjectileHitbox/CollisionShape3D:disabled") tracks/3/interp = 1 tracks/3/loop_wrap = true tracks/3/keys = { -"times": PackedFloat32Array(0, 0.0166667, 1.11667), +"times": PackedFloat32Array(0, 0.0166667, 0.666667), "transitions": PackedFloat32Array(1, 1, 1), "update": 1, "values": [true, false, true] } +tracks/4/type = "value" +tracks/4/imported = false +tracks/4/enabled = true +tracks/4/path = NodePath("../Bullet/ProjectileHitbox/AudioStreamPlayer3D:stream") +tracks/4/interp = 1 +tracks/4/loop_wrap = true +tracks/4/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [ExtResource("4_3v8me")] +} +tracks/5/type = "value" +tracks/5/imported = false +tracks/5/enabled = true +tracks/5/path = NodePath("../Bullet/ProjectileHitbox/AudioStreamPlayer3D:playing") +tracks/5/interp = 1 +tracks/5/loop_wrap = true +tracks/5/keys = { +"times": PackedFloat32Array(0.0333333), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [true] +} [sub_resource type="Animation" id="Animation_8qeb2"] length = 0.001 @@ -557,6 +581,18 @@ tracks/3/keys = { "update": 1, "values": [true] } +tracks/4/type = "value" +tracks/4/imported = false +tracks/4/enabled = true +tracks/4/path = NodePath("%AudioStreamPlayer3D:playing") +tracks/4/interp = 1 +tracks/4/loop_wrap = true +tracks/4/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [false] +} [sub_resource type="AnimationLibrary" id="AnimationLibrary_q8n6h"] _data = { @@ -578,16 +614,16 @@ sprite_frames = SubResource("SpriteFrames_pck2g") [node name="ProjectileHitbox" type="Area3D" parent="Bullet"] unique_name_in_owner = true -collision_layer = 0 -collision_mask = 2048 -monitorable = false +collision_mask = 2049 [node name="CollisionShape3D" type="CollisionShape3D" parent="Bullet/ProjectileHitbox"] shape = SubResource("SphereShape3D_kct8n") disabled = true -[node name="AudioStreamPlayer3D" type="AudioStreamPlayer3D" parent="Bullet"] +[node name="AudioStreamPlayer3D" type="AudioStreamPlayer3D" parent="Bullet/ProjectileHitbox"] unique_name_in_owner = true +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -2.1, 5.8557) +stream = ExtResource("4_3v8me") [node name="AnimationPlayer" type="AnimationPlayer" parent="Bullet"] unique_name_in_owner = true diff --git a/Zennysoft.Game.Ma/src/items/weapons/WaterReactorProjectile.tscn b/Zennysoft.Game.Ma/src/items/weapons/WaterReactorProjectile.tscn index 3c93e50f6..89db932ea 100644 --- a/Zennysoft.Game.Ma/src/items/weapons/WaterReactorProjectile.tscn +++ b/Zennysoft.Game.Ma/src/items/weapons/WaterReactorProjectile.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=78 format=3 uid="uid://7p2sh52lj42o"] +[gd_scene load_steps=79 format=3 uid="uid://7p2sh52lj42o"] [ext_resource type="Script" uid="uid://cqm6u7qa8japr" path="res://src/system/Projectile.cs" id="1_n88a7"] [ext_resource type="Script" uid="uid://ctshiyffvt4y5" path="res://src/system/AttackDataResource.cs" id="2_er0le"] @@ -621,6 +621,8 @@ _data = { &"RESET": SubResource("Animation_8qeb2") } +[sub_resource type="SphereShape3D" id="SphereShape3D_n88a7"] + [node name="WaterReactor" type="Node3D"] script = ExtResource("1_n88a7") AttackData = SubResource("Resource_k6pkx") @@ -655,3 +657,9 @@ root_node = NodePath("../AnimatedSprite3D") libraries = { &"": SubResource("AnimationLibrary_q8n6h") } + +[node name="WallCollision" type="RigidBody3D" parent="Bullet"] +unique_name_in_owner = true + +[node name="CollisionShape3D" type="CollisionShape3D" parent="Bullet/WallCollision"] +shape = SubResource("SphereShape3D_n88a7") diff --git a/Zennysoft.Game.Ma/src/player/Player.cs b/Zennysoft.Game.Ma/src/player/Player.cs index ddc447e2d..3e9fb6911 100644 --- a/Zennysoft.Game.Ma/src/player/Player.cs +++ b/Zennysoft.Game.Ma/src/player/Player.cs @@ -282,6 +282,7 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide VTComponent.RaiseMaximumVT(equipable.BonusVT, false); EquipmentComponent.Equip(equipable); + SfxDatabase.Instance.Play(SoundEffect.Equip); if (equipable is Weapon weapon && weapon.WeaponTag == WeaponTag.KineticProjectile) PersuaderCrosshair.Show(); @@ -293,6 +294,7 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide VTComponent.SetMaximumVT(VTComponent.MaximumVT.Value - equipable.BonusVT); EquipmentComponent.Unequip(equipable); + SfxDatabase.Instance.Play(SoundEffect.Unequip); if (equipable is Weapon weapon && weapon.WeaponTag == WeaponTag.KineticProjectile) PersuaderCrosshair.Hide(); @@ -354,30 +356,30 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide private void HandleProjectile(Weapon weapon) { var ammo = EquipmentComponent.EquippedAmmo.Value as Ammo; - if (ammo == null || ammo.Count <= 0) + if (ammo.Count == null || ammo.Count?.Value <= 0) return; + var fired = false; + if (weapon.WeaponTag == WeaponTag.ElementalProjectile) { - var fired = false; if (ammo.AmmoElement == ElementType.Igneous) fired = FireReactor.Fire(); if (ammo.AmmoElement == ElementType.Aeolic) fired = AirReactor.Fire(); if (ammo.AmmoElement == ElementType.Hydric) fired = WaterReactor.Fire(); - - if (!fired) - return; } - else if (weapon.WeaponTag == WeaponTag.KineticProjectile) - { - var fired = false; + + if (weapon.WeaponTag == WeaponTag.KineticProjectile) fired = PersuaderBullet.Fire(); - } - ammo.SetCount(ammo.Count - 1); - if (ammo.Count <= 0) + if (!fired) + return; + + ammo.SetCount(ammo.Count.Value - 1); + EquipmentComponent.UpdateEquipment(ammo); + if (ammo.Count.Value <= 0) { EquipmentComponent.Unequip(ammo); Inventory.Remove(ammo); diff --git a/Zennysoft.Game.Ma/src/system/Projectile.cs b/Zennysoft.Game.Ma/src/system/Projectile.cs index d3c6ff6d4..751c02e08 100644 --- a/Zennysoft.Game.Ma/src/system/Projectile.cs +++ b/Zennysoft.Game.Ma/src/system/Projectile.cs @@ -1,6 +1,7 @@ using Chickensoft.AutoInject; using Chickensoft.Introspection; using Godot; +using System; using Zennysoft.Game.Ma; using Zennysoft.Ma.Adapter; using Zennysoft.Ma.Adapter.Entity; @@ -23,13 +24,13 @@ public partial class Projectile : Node3D public void OnReady() { ProjectileHitbox.AreaEntered += Hitbox_AreaEntered; - ProjectileHitbox.BodyEntered += ProjectileHitbox_BodyEntered; + ProjectileHitbox.BodyEntered += ProjectileHitbox_BodyEntered1; + ProjectileHitbox.BodyShapeEntered += ProjectileHitbox_BodyEntered; } - private void ProjectileHitbox_BodyEntered(Node3D body) - { - AnimationPlayer.Play("RESET"); - } + private void ProjectileHitbox_BodyEntered1(Node3D body) => AnimationPlayer.Stop(); + + private void ProjectileHitbox_BodyEntered(Rid bodyRid, Node3D body, long bodyShapeIndex, long localShapeIndex) => AnimationPlayer.Stop(); public bool Fire() { diff --git a/Zennysoft.Game.Ma/src/ui/in_game_ui/InGameUI.tscn b/Zennysoft.Game.Ma/src/ui/in_game_ui/InGameUI.tscn index 44318cb69..0bd7ec765 100644 --- a/Zennysoft.Game.Ma/src/ui/in_game_ui/InGameUI.tscn +++ b/Zennysoft.Game.Ma/src/ui/in_game_ui/InGameUI.tscn @@ -2,13 +2,13 @@ [ext_resource type="Script" uid="uid://dlq2mkhl4pe7a" path="res://src/ui/in_game_ui/InGameUI.cs" id="1_sc13i"] [ext_resource type="PackedScene" uid="uid://bwbofurcvf3yh" path="res://src/minimap/Minimap.tscn" id="2_6sfje"] -[ext_resource type="PackedScene" uid="uid://dlj8qdg1c5048" path="res://src/ui/inventory_menu/InventoryMenu.tscn" id="3_4vcdl"] [ext_resource type="PackedScene" uid="uid://dxl8il8f13c2x" path="res://src/ui/player_ui/PlayerInfoUI.tscn" id="4_46s5l"] [ext_resource type="PackedScene" uid="uid://bea2waybmgd6u" path="res://src/ui/teleport_prompt/UseTeleportPrompt.tscn" id="5_h1hgq"] [ext_resource type="PackedScene" uid="uid://x0f1ol50nnp3" path="res://src/ui/in_game_ui/InventoryMessageUI.tscn" id="6_y26qy"] -[ext_resource type="Script" uid="uid://dj6oqler47dqf" path="res://src/utils/FpsCounter.cs" id="7_c6o8j"] +[ext_resource type="Script" uid="uid://3fpuxsgdl8xe" path="res://src/utils/FpsCounter.cs" id="7_c6o8j"] [ext_resource type="PackedScene" uid="uid://8f3dk16nj0dn" path="res://src/menu/DebugMenu.tscn" id="7_llomk"] [ext_resource type="Texture2D" uid="uid://bj4p4qxb1mj3q" path="res://src/ui/player_ui/Assets/panel rough draft.png" id="7_ur8ag"] +[ext_resource type="PackedScene" uid="uid://c3e6hbctay1us" path="res://src/ui/inventory_menu/InventoryMenu2.tscn" id="9_ur8ag"] [sub_resource type="StyleBoxLine" id="StyleBoxLine_ur8ag"] color = Color(0.792157, 0.698039, 0.643137, 1) @@ -144,7 +144,6 @@ offset_right = 267.0 offset_bottom = 1004.0 size_flags_vertical = 3 -[node name="InventoryMenu" parent="." instance=ExtResource("3_4vcdl")] +[node name="InventoryMenu" parent="." instance=ExtResource("9_ur8ag")] unique_name_in_owner = true -process_mode = 3 layout_mode = 1 diff --git a/Zennysoft.Game.Ma/src/ui/inventory_menu/IItemSlot.cs b/Zennysoft.Game.Ma/src/ui/inventory_menu/IItemSlot.cs index 5335f38a5..df36e26a7 100644 --- a/Zennysoft.Game.Ma/src/ui/inventory_menu/IItemSlot.cs +++ b/Zennysoft.Game.Ma/src/ui/inventory_menu/IItemSlot.cs @@ -9,11 +9,9 @@ public interface IItemSlot : IButton { public AutoProp Item { get; } - public bool IsSelected { get; set; } + public void SetItemEquipmentStatus(bool isEquipped); - public void SetItemStyle(); + public event Action ItemPressed; - public event Action ItemPressed; - public event Action ItemEnterFocus; - public event Action ItemExitFocus; + public event Action ItemSelected; } diff --git a/Zennysoft.Game.Ma/src/ui/inventory_menu/InventoryMenu.cs b/Zennysoft.Game.Ma/src/ui/inventory_menu/InventoryMenu.cs index cc2a04bc0..fff258e42 100644 --- a/Zennysoft.Game.Ma/src/ui/inventory_menu/InventoryMenu.cs +++ b/Zennysoft.Game.Ma/src/ui/inventory_menu/InventoryMenu.cs @@ -67,8 +67,6 @@ public partial class InventoryMenu : Control, IInventoryMenu foreach (var item in ItemSlots) { item.ItemPressed += Item_Pressed; - item.ItemEnterFocus += Item_FocusEntered; - item.ItemExitFocus += Item_ItemExitFocus; } _player.AttackComponent.CurrentAttack.Sync += Attack_Sync; @@ -122,8 +120,6 @@ public partial class InventoryMenu : Control, IInventoryMenu SfxDatabase.Instance.Play(SoundEffect.SortInventory); Inventory_InventoryChanged(); - foreach (var slot in ItemSlots) - slot.SetItemStyle(); Item_ItemExitFocus(_currentlySelectedItem); _currentlySelectedItem = ItemSlot1; _currentlySelectedItem.GrabFocus(); @@ -151,8 +147,6 @@ public partial class InventoryMenu : Control, IInventoryMenu { ItemDescriptionTitle.Text = string.Empty; ItemEffectLabel.Text = string.Empty; - itemSlot.IsSelected = false; - itemSlot.SetItemStyle(); } private void Item_FocusEntered(IItemSlot itemSlot) @@ -166,19 +160,16 @@ public partial class InventoryMenu : Control, IInventoryMenu ItemDescriptionTitle.Text = $"{itemSlot.Item.Value.ItemName}"; ItemEffectLabel.Text = $"{itemSlot.Item.Value.Description}"; _currentlySelectedItem = itemSlot; - itemSlot.IsSelected = true; - itemSlot.SetItemStyle(); AcceptEvent(); } - private void Item_Pressed(InventoryItem item) => DisplayUserActionPrompt(item); + private void Item_Pressed(IItemSlot item) => DisplayUserActionPrompt(item.Item.Value); private async void Inventory_InventoryChanged() { foreach (var slot in ItemSlots) { slot.Visible = false; - slot.SetItemStyle(); } var itemsToDisplay = _player.Inventory.Items; @@ -213,6 +204,8 @@ public partial class InventoryMenu : Control, IInventoryMenu await EquipOrUnequipItem(equipable); else if (_currentlySelectedItem.Item.Value is Plastique plastique) SetItem(); + else if (_currentlySelectedItem.Item.Value is Jewel jewel) + AugmentEquipment(jewel); else await _game.UseItem(_currentlySelectedItem.Item.Value); UseButton.Disabled = false; @@ -250,6 +243,15 @@ public partial class InventoryMenu : Control, IInventoryMenu _gameRepo.CloseInventory(); } + private void AugmentEquipment(Jewel jewel) + { + DisplayUserActionPrompt(jewel); + foreach (var item in ItemSlots) + { + item.Disabled = item.Item.Value is not Weapon && item.Item.Value is not Armor && item.Item.Value is not Accessory; + } + } + private void DisplayUserActionPrompt(InventoryItem item) { SfxDatabase.Instance.Play(SoundEffect.SelectUI); @@ -264,6 +266,7 @@ public partial class InventoryMenu : Control, IInventoryMenu { var isItemEquipped = _player.EquipmentComponent.IsItemEquipped(equipable); UseButton.Text = isItemEquipped ? "Unequip" : "Equip"; + UseButton.Disabled = equipable.Glued; ThrowButton.Disabled = isItemEquipped; ThrowButton.FocusMode = isItemEquipped ? FocusModeEnum.None : FocusModeEnum.All; DropButton.Disabled = isItemEquipped; diff --git a/Zennysoft.Game.Ma/src/ui/inventory_menu/InventoryMenu.tscn b/Zennysoft.Game.Ma/src/ui/inventory_menu/InventoryMenu.tscn index f4cce1788..47f2c3da5 100644 --- a/Zennysoft.Game.Ma/src/ui/inventory_menu/InventoryMenu.tscn +++ b/Zennysoft.Game.Ma/src/ui/inventory_menu/InventoryMenu.tscn @@ -38,7 +38,6 @@ light_mode = 2 [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_unikd"] [node name="InventoryMenu" type="Control"] -visible = false layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 @@ -290,120 +289,126 @@ offset_top = 23.0 offset_right = 1885.0 offset_bottom = 1015.0 -[node name="ScrollContainer" type="ScrollContainer" parent="Panel"] +[node name="MarginContainer" type="MarginContainer" parent="Panel"] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 +theme_override_constants/margin_left = 15 +theme_override_constants/margin_top = 15 +theme_override_constants/margin_right = 15 +theme_override_constants/margin_bottom = 15 + +[node name="ScrollContainer" type="ScrollContainer" parent="Panel/MarginContainer"] +layout_mode = 2 theme_override_styles/panel = SubResource("StyleBoxEmpty_unikd") follow_focus = true draw_focus_border = true -[node name="ItemsPage" type="VBoxContainer" parent="Panel/ScrollContainer"] +[node name="ItemsPage" type="VBoxContainer" parent="Panel/MarginContainer/ScrollContainer"] unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 2 alignment = 1 -[node name="ItemSlot1" parent="Panel/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] +[node name="ItemSlot1" parent="Panel/MarginContainer/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] +unique_name_in_owner = true +layout_mode = 2 + +[node name="ItemSlot2" parent="Panel/MarginContainer/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] unique_name_in_owner = true visible = false layout_mode = 2 -[node name="ItemSlot2" parent="Panel/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] +[node name="ItemSlot3" parent="Panel/MarginContainer/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] unique_name_in_owner = true visible = false layout_mode = 2 -[node name="ItemSlot3" parent="Panel/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] +[node name="ItemSlot4" parent="Panel/MarginContainer/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] unique_name_in_owner = true visible = false layout_mode = 2 -[node name="ItemSlot4" parent="Panel/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] +[node name="ItemSlot5" parent="Panel/MarginContainer/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] unique_name_in_owner = true visible = false layout_mode = 2 -[node name="ItemSlot5" parent="Panel/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] +[node name="ItemSlot6" parent="Panel/MarginContainer/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] unique_name_in_owner = true visible = false layout_mode = 2 -[node name="ItemSlot6" parent="Panel/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] +[node name="ItemSlot7" parent="Panel/MarginContainer/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] unique_name_in_owner = true visible = false layout_mode = 2 -[node name="ItemSlot7" parent="Panel/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] +[node name="ItemSlot8" parent="Panel/MarginContainer/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] unique_name_in_owner = true visible = false layout_mode = 2 -[node name="ItemSlot8" parent="Panel/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] +[node name="ItemSlot9" parent="Panel/MarginContainer/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] unique_name_in_owner = true visible = false layout_mode = 2 -[node name="ItemSlot9" parent="Panel/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] +[node name="ItemSlot10" parent="Panel/MarginContainer/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] unique_name_in_owner = true visible = false layout_mode = 2 -[node name="ItemSlot10" parent="Panel/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] +[node name="ItemSlot11" parent="Panel/MarginContainer/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] unique_name_in_owner = true visible = false layout_mode = 2 -[node name="ItemSlot11" parent="Panel/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] +[node name="ItemSlot12" parent="Panel/MarginContainer/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] unique_name_in_owner = true visible = false layout_mode = 2 -[node name="ItemSlot12" parent="Panel/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] +[node name="ItemSlot13" parent="Panel/MarginContainer/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] unique_name_in_owner = true visible = false layout_mode = 2 -[node name="ItemSlot13" parent="Panel/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] +[node name="ItemSlot14" parent="Panel/MarginContainer/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] unique_name_in_owner = true visible = false layout_mode = 2 -[node name="ItemSlot14" parent="Panel/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] +[node name="ItemSlot15" parent="Panel/MarginContainer/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] unique_name_in_owner = true visible = false layout_mode = 2 -[node name="ItemSlot15" parent="Panel/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] +[node name="ItemSlot16" parent="Panel/MarginContainer/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] unique_name_in_owner = true visible = false layout_mode = 2 -[node name="ItemSlot16" parent="Panel/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] +[node name="ItemSlot17" parent="Panel/MarginContainer/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] unique_name_in_owner = true visible = false layout_mode = 2 -[node name="ItemSlot17" parent="Panel/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] +[node name="ItemSlot18" parent="Panel/MarginContainer/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] unique_name_in_owner = true visible = false layout_mode = 2 -[node name="ItemSlot18" parent="Panel/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] +[node name="ItemSlot19" parent="Panel/MarginContainer/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] unique_name_in_owner = true visible = false layout_mode = 2 -[node name="ItemSlot19" parent="Panel/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] -unique_name_in_owner = true -visible = false -layout_mode = 2 - -[node name="ItemSlot20" parent="Panel/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] +[node name="ItemSlot20" parent="Panel/MarginContainer/ScrollContainer/ItemsPage" instance=ExtResource("4_aiji3")] unique_name_in_owner = true visible = false layout_mode = 2 diff --git a/Zennysoft.Game.Ma/src/ui/inventory_menu/InventoryMenu2.cs b/Zennysoft.Game.Ma/src/ui/inventory_menu/InventoryMenu2.cs new file mode 100644 index 000000000..702964872 --- /dev/null +++ b/Zennysoft.Game.Ma/src/ui/inventory_menu/InventoryMenu2.cs @@ -0,0 +1,264 @@ +using Chickensoft.AutoInject; +using Chickensoft.Introspection; +using Godot; +using System.Collections.Generic; +using System.Linq; +using Zennysoft.Game.Implementation; +using Zennysoft.Game.Ma; +using Zennysoft.Ma.Adapter; + +[Meta(typeof(IAutoNode))] +public partial class InventoryMenu2 : Control, IInventoryMenu +{ + public override void _Notification(int what) => this.Notify(what); + + [Dependency] private IPlayer _player => this.DependOn(); + + [Dependency] private IGame _game => this.DependOn(); + + [Dependency] private IGameRepo _gameRepo => this.DependOn(); + + [Node] public Label ItemName { get; set; } + + [Node] public Label ItemFlavor { get; set; } + + [Node] public Label ItemStats { get; set; } + + [Node] public Button InteractButton { get; set; } + + [Node] public Button ThrowButton { get; set; } + + [Node] public Button DropButton { get; set; } + + [Node] public Control ActionPanel { get; set; } + + private List ItemSlots; + + private List