Add more spell effects

This commit is contained in:
2026-02-26 02:09:38 -08:00
parent a686ce2fbc
commit fadb1652d4
20 changed files with 163 additions and 49 deletions

View File

@@ -7,7 +7,6 @@ using System;
using System.Linq;
using Zennysoft.Ma.Adapter;
using Zennysoft.Ma.Adapter.Entity;
using static Zennysoft.Ma.Adapter.AppLogic;
namespace Zennysoft.Game.Ma;
@@ -19,6 +18,8 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
IPlayer IProvide<IPlayer>.Value() => this;
[Dependency] public IGame _game => this.DependOn<IGame>();
private PlayerLogic.IBinding PlayerBinding { get; set; } = default!;
#endregion
@@ -391,7 +392,7 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
ApplyNewAugment((dynamic)augmentableItem, jewel as Jewel);
if (augmentableItem is IEquipableItem equipable && EquipmentComponent.IsItemEquipped(equipable))
if (augmentableItem.Augment != null && augmentableItem is IEquipableItem equipable && EquipmentComponent.IsItemEquipped(equipable))
augmentableItem.Augment.AugmentType.Apply();
}
@@ -423,7 +424,12 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
weapon.Augment = new Augment(JewelTags.LowerEXPGain, new LowerEXPRateAugment(this), jewel.ItemName, jewel.StatDescription, jewel.GetTexture());
break;
case JewelTags.ItemRescue:
if (!_game.RescuedItems.TryAdd(weapon))
break;
if (EquipmentComponent.IsItemEquipped(weapon))
Unequip(weapon);
Inventory.Remove(weapon);
SfxDatabase.Instance.Play(SoundEffect.Transfer);
break;
case JewelTags.Glue:
if (!EquipmentComponent.IsItemEquipped(weapon))
@@ -480,7 +486,12 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
armor.Augment = new Augment(JewelTags.LowerEXPGain, new LowerEXPRateAugment(this), jewel.ItemName, jewel.StatDescription, jewel.GetTexture());
break;
case JewelTags.ItemRescue:
if (!_game.RescuedItems.TryAdd(armor))
break;
if (EquipmentComponent.IsItemEquipped(armor))
Unequip(armor);
Inventory.Remove(armor);
SfxDatabase.Instance.Play(SoundEffect.Transfer);
break;
case JewelTags.Glue:
if (!EquipmentComponent.IsItemEquipped(armor))
@@ -537,7 +548,12 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
accessory.Augment = new Augment(JewelTags.LowerEXPGain, new LowerEXPRateAugment(this), jewel.ItemName, jewel.StatDescription, jewel.GetTexture());
break;
case JewelTags.ItemRescue:
if (!_game.RescuedItems.TryAdd(accessory))
break;
if (EquipmentComponent.IsItemEquipped(accessory))
Unequip(accessory);
Inventory.Remove(accessory);
SfxDatabase.Instance.Play(SoundEffect.Transfer);
break;
case JewelTags.Glue:
if (!EquipmentComponent.IsItemEquipped(accessory))