Add item spawn menu

Fix game over bug
Start adding more implementation for jewels
This commit is contained in:
2026-02-11 15:25:20 -08:00
parent 8ce38c3c13
commit 230b47061d
32 changed files with 1215 additions and 358 deletions

View File

@@ -54,6 +54,8 @@ public partial class Inventory : Node, IInventory
return true;
}
public bool AtCapacity() => Items.Count >= _maxInventorySize;
public bool TryInsert(InventoryItem inventoryItem, int index)
{
if (Items.Count >= _maxInventorySize || index >= _maxInventorySize || index < 0)

View File

@@ -49,8 +49,8 @@ public partial class DroppedItem : RigidBody3D, IDroppedItem
public void RescueItem()
{
ContactMonitor = false;
Pickup.Monitorable = false;
Pickup.Monitoring = false;
Pickup.SetDeferred(Area3D.PropertyName.Monitorable, false);
Pickup.SetDeferred(Area3D.PropertyName.Monitoring, false);
SfxDatabase.Instance.Play(SoundEffect.Transfer);
PlayRescueAnimation();
Game.RescuedItems.Items.Add(Item);

View File

@@ -0,0 +1 @@
uid://xlqkn5j388il

View File

@@ -6,7 +6,7 @@ using Zennysoft.Game.Ma;
using Zennysoft.Ma.Adapter;
[Meta(typeof(IAutoNode)), Id("jewel")]
public partial class Jewel : InventoryItem
public partial class Jewel : InventoryItem, IAugmentItem
{
public override void _Notification(int what) => this.Notify(what);
@@ -34,4 +34,42 @@ public partial class Jewel : InventoryItem
[Export]
[Save("jewel_stats")]
public JewelStats Stats { get; set; } = new JewelStats();
public JewelTags Augment => Stats.JewelTag;
public void ApplyAugment(Weapon weapon)
{
weapon.Augment = new Augment(Stats.JewelTag);
switch (Stats.JewelTag)
{
case JewelTags.AeolicElement:
weapon.Stats.WeaponElement = ElementType.Aeolic;
break;
}
}
public void ApplyAugment(Armor armor)
{
armor.Augment = new Augment(Stats.JewelTag);
switch (Stats.JewelTag)
{
case JewelTags.AeolicElement:
armor.Stats.AeolicResistance += 25;
break;
case JewelTags.HydricElement:
armor.Stats.HydricResistance += 25;
break;
case JewelTags.IgneousElement:
armor.Stats.IgneousResistance += 25;
break;
case JewelTags.TelluricElement:
armor.Stats.TelluricResistance += 25;
break;
}
}
public void ApplyAugment(Accessory accessory)
{
accessory.Augment = new Augment(Stats.JewelTag);
}
}

View File

@@ -1,19 +0,0 @@
public enum JewelTags
{
None,
AeolicElement,
IncreaseHPRecovery,
HastenVT,
LowerEXPGain,
Glue,
ItemRescue,
HydricElement,
IgneousElement,
IncreaseEXPGain,
LowerHPRecovery,
SlowVTReduction,
AutoIdentifyAllItems,
ReviveUserOnce,
TelluricElement
}

View File

@@ -5,8 +5,9 @@
[resource]
script = ExtResource("1_cyti8")
JewelTag = 7
Name = "Hydric Jewel"
Description = "Hydric e"
Description = "Add Hydric damage to Weapon or Hydric resistance to Armor."
SpawnRate = 0.5
BonusAttack = 0
BonusDefense = 0

View File

@@ -5,6 +5,7 @@
[resource]
script = ExtResource("1_6e2y5")
JewelTag = 9
Name = "Meditative Stone"
Description = ""
SpawnRate = 0.5