80 lines
2.3 KiB
C#
80 lines
2.3 KiB
C#
using PetCompanion.Models.Enums;
|
|
|
|
namespace PetCompanion.Models
|
|
{
|
|
public class MaterialItem : Item
|
|
{
|
|
public MaterialItem()
|
|
{
|
|
Type = ItemType.Material;
|
|
}
|
|
|
|
public override void Use(ref Pet pet)
|
|
{
|
|
// Materials cannot be used directly
|
|
}
|
|
}
|
|
|
|
public class StatBoostEquipment : EquipableItem
|
|
{
|
|
public Dictionary<string, int> StatBoosts { get; set; } = new();
|
|
|
|
public override void Equip(ref Pet pet)
|
|
{
|
|
base.Equip(ref pet);
|
|
if (IsEquipped)
|
|
{
|
|
foreach (var boost in StatBoosts)
|
|
{
|
|
switch (boost.Key.ToLower())
|
|
{
|
|
case "health":
|
|
pet.MaxHealth += boost.Value;
|
|
break;
|
|
case "intelligence":
|
|
pet.Stats.MaxIntelligence += boost.Value;
|
|
break;
|
|
case "strength":
|
|
pet.Stats.MaxStrength += boost.Value;
|
|
break;
|
|
case "charisma":
|
|
pet.Stats.MaxCharisma += boost.Value;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public override void Unequip(ref Pet pet)
|
|
{
|
|
if (IsEquipped)
|
|
{
|
|
foreach (var boost in StatBoosts)
|
|
{
|
|
switch (boost.Key.ToLower())
|
|
{
|
|
case "health":
|
|
pet.MaxHealth -= boost.Value;
|
|
break;
|
|
case "intelligence":
|
|
pet.Stats.MaxIntelligence -= boost.Value;
|
|
break;
|
|
case "strength":
|
|
pet.Stats.MaxStrength -= boost.Value;
|
|
break;
|
|
case "charisma":
|
|
pet.Stats.MaxCharisma -= boost.Value;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
base.Unequip(ref pet);
|
|
}
|
|
|
|
public override void Use(ref Pet pet)
|
|
{
|
|
Equip(ref pet);
|
|
}
|
|
}
|
|
}
|