Add item spawn menu
Fix game over bug Start adding more implementation for jewels
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
1
Zennysoft.Game.Ma/src/items/jewels/Augment.cs.uid
Normal file
1
Zennysoft.Game.Ma/src/items/jewels/Augment.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://xlqkn5j388il
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
|
||||
public enum JewelTags
|
||||
{
|
||||
None,
|
||||
AeolicElement,
|
||||
IncreaseHPRecovery,
|
||||
HastenVT,
|
||||
LowerEXPGain,
|
||||
Glue,
|
||||
ItemRescue,
|
||||
HydricElement,
|
||||
IgneousElement,
|
||||
IncreaseEXPGain,
|
||||
LowerHPRecovery,
|
||||
SlowVTReduction,
|
||||
AutoIdentifyAllItems,
|
||||
ReviveUserOnce,
|
||||
TelluricElement
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_6e2y5")
|
||||
JewelTag = 9
|
||||
Name = "Meditative Stone"
|
||||
Description = ""
|
||||
SpawnRate = 0.5
|
||||
|
||||
Reference in New Issue
Block a user