174 lines
4.2 KiB
C#
174 lines
4.2 KiB
C#
using Zennysoft.Ma.Adapter;
|
|
|
|
public class Augment
|
|
{
|
|
public JewelTags AugmentTag;
|
|
|
|
public Augment(JewelTags tag, IAugmentType augment)
|
|
{
|
|
AugmentTag = tag;
|
|
AugmentType = augment;
|
|
}
|
|
|
|
public IAugmentType AugmentType { get; set; }
|
|
}
|
|
|
|
public interface IAugmentType
|
|
{
|
|
void Apply();
|
|
|
|
void Remove();
|
|
}
|
|
|
|
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 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;
|
|
}
|
|
} |