204 lines
5.0 KiB
C#
204 lines
5.0 KiB
C#
using Godot;
|
|
using Zennysoft.Ma.Adapter;
|
|
|
|
public class Augment
|
|
{
|
|
public JewelTags AugmentTag;
|
|
|
|
public Augment(JewelTags tag, IAugmentType augment, string name, string description, Texture2D augmentTexture)
|
|
{
|
|
AugmentTag = tag;
|
|
AugmentName = name;
|
|
AugmentType = augment;
|
|
AugmentDescription = description;
|
|
AugmentTexture = augmentTexture;
|
|
}
|
|
|
|
public IAugmentType AugmentType { get; set; }
|
|
|
|
public string AugmentName { get; set; }
|
|
|
|
public string AugmentDescription { get; set; }
|
|
|
|
public Texture2D AugmentTexture { get; set; }
|
|
}
|
|
|
|
public class HPRecoverySpeedAugment : IAugmentType
|
|
{
|
|
private readonly IPlayer _player;
|
|
|
|
public HPRecoverySpeedAugment(IPlayer player)
|
|
{
|
|
_player = player;
|
|
}
|
|
|
|
public void Apply() => _player.HealthTimerHPRate += 2;
|
|
|
|
public void Remove() => _player.HealthTimerHPRate -= 2;
|
|
}
|
|
|
|
public class BasicAugment : IAugmentType
|
|
{
|
|
public void Apply()
|
|
{
|
|
// do nothing
|
|
}
|
|
|
|
public void Remove()
|
|
{
|
|
// do nothing
|
|
}
|
|
}
|
|
|
|
public class HastenVTAugment : IAugmentType
|
|
{
|
|
private readonly IPlayer _player;
|
|
|
|
public HastenVTAugment(IPlayer player)
|
|
{
|
|
_player = player;
|
|
}
|
|
|
|
public void Apply() => _player.ModifyHealthTimerSpeed(_player.HealthTimerSpeedModifier + 0.25f);
|
|
|
|
public void Remove() => _player.ModifyHealthTimerSpeed(_player.HealthTimerSpeedModifier - 0.25f);
|
|
}
|
|
|
|
public class SlowVTReductionAugment : IAugmentType
|
|
{
|
|
private readonly IPlayer _player;
|
|
|
|
public SlowVTReductionAugment(IPlayer player)
|
|
{
|
|
_player = player;
|
|
}
|
|
|
|
public void Apply() => _player.ModifyHealthTimerSpeed(_player.HealthTimerSpeedModifier - 0.25f);
|
|
|
|
public void Remove() => _player.ModifyHealthTimerSpeed(_player.HealthTimerSpeedModifier + 0.25f);
|
|
}
|
|
|
|
public class IncreaseEXPRateAugment : IAugmentType
|
|
{
|
|
private readonly IPlayer _player;
|
|
|
|
public IncreaseEXPRateAugment(IPlayer player)
|
|
{
|
|
_player = player;
|
|
}
|
|
|
|
public void Apply() => _player.ExperiencePointsComponent.ModifyExpGainRate(_player.ExperiencePointsComponent.ExpGainRate.Value + 0.25f);
|
|
public void Remove() => _player.ExperiencePointsComponent.ModifyExpGainRate(_player.ExperiencePointsComponent.ExpGainRate.Value - 0.25f);
|
|
}
|
|
|
|
public class LowerEXPRateAugment : IAugmentType
|
|
{
|
|
private readonly IPlayer _player;
|
|
|
|
public LowerEXPRateAugment(IPlayer player)
|
|
{
|
|
_player = player;
|
|
}
|
|
|
|
public void Apply() => _player.ExperiencePointsComponent.ModifyExpGainRate(_player.ExperiencePointsComponent.ExpGainRate.Value - 0.25f);
|
|
public void Remove() => _player.ExperiencePointsComponent.ModifyExpGainRate(_player.ExperiencePointsComponent.ExpGainRate.Value + 0.25f);
|
|
}
|
|
|
|
public class BoostStatsAugment : IAugmentType
|
|
{
|
|
private readonly IPlayer _player;
|
|
private readonly int _bonusLuck;
|
|
private readonly int _bonusHp;
|
|
private readonly int _bonusVt;
|
|
|
|
public BoostStatsAugment(IPlayer player, int bonusLuck, int bonusHp, int bonusVt)
|
|
{
|
|
_player = player;
|
|
_bonusLuck = bonusLuck;
|
|
_bonusHp = bonusHp;
|
|
_bonusVt = bonusVt;
|
|
}
|
|
|
|
public void Apply()
|
|
{
|
|
_player.HealthComponent.RaiseMaximumHP(_bonusHp);
|
|
_player.VTComponent.RaiseMaximumVT(_bonusVt);
|
|
_player.LuckComponent.IncreaseLuck(_bonusLuck);
|
|
}
|
|
|
|
public void Remove()
|
|
{
|
|
}
|
|
}
|
|
|
|
public class LowerHPRecoveryAugment : IAugmentType
|
|
{
|
|
private readonly IPlayer _player;
|
|
|
|
public LowerHPRecoveryAugment(IPlayer player)
|
|
{
|
|
_player = player;
|
|
}
|
|
|
|
public void Apply() => _player.HealthTimerHPRate -= 1;
|
|
public void Remove() => _player.HealthTimerHPRate += 1;
|
|
}
|
|
|
|
public class IdentifyAllItemsAugment : IAugmentType
|
|
{
|
|
private readonly IPlayer _player;
|
|
|
|
public IdentifyAllItemsAugment(IPlayer player)
|
|
{
|
|
_player = player;
|
|
}
|
|
|
|
public void Apply()
|
|
{
|
|
_player.AutoIdentifyItems = true;
|
|
foreach (var item in _player.Inventory.Items.ToList())
|
|
{
|
|
if (item.ItemTag == ItemTag.MysteryItem)
|
|
_player.IdentifyItem(item);
|
|
}
|
|
}
|
|
|
|
public void Remove()
|
|
{
|
|
var weaponAugment = _player.EquipmentComponent.EquippedWeapon.Value.Augment;
|
|
var armorAugment = _player.EquipmentComponent.EquippedArmor.Value.Augment;
|
|
var accessoryAugment = _player.EquipmentComponent.EquippedAccessory.Value.Augment;
|
|
var augments = new List<Augment?>() { weaponAugment, armorAugment, accessoryAugment };
|
|
if (augments.Count(x => x != null && x.AugmentTag == JewelTags.AutoIdentifyAllItems) > 1)
|
|
return;
|
|
else
|
|
_player.AutoIdentifyItems = false;
|
|
}
|
|
}
|
|
|
|
public class RevivePlayerAugment : IAugmentType
|
|
{
|
|
private readonly IPlayer _player;
|
|
|
|
public RevivePlayerAugment(IPlayer player)
|
|
{
|
|
_player = player;
|
|
}
|
|
|
|
public void Apply()
|
|
{
|
|
_player.AutoRevive = true;
|
|
}
|
|
|
|
public void Remove()
|
|
{
|
|
var weaponAugment = _player.EquipmentComponent.EquippedWeapon.Value.Augment;
|
|
var armorAugment = _player.EquipmentComponent.EquippedArmor.Value.Augment;
|
|
var accessoryAugment = _player.EquipmentComponent.EquippedAccessory.Value.Augment;
|
|
var augments = new List<Augment?>() { weaponAugment, armorAugment, accessoryAugment };
|
|
if (augments.Count(x => x != null && x.AugmentTag == JewelTags.ReviveUserOnce) > 1)
|
|
return;
|
|
else
|
|
_player.AutoRevive = false;
|
|
}
|
|
} |