tidying before making individual effects
This commit is contained in:
1 parent
56c718ae82
commit
ec2a5fb234
2 files changed
+15
-6
No files matched your search
@@ -55,8 +55,6 @@ namespace CalamityMod.Items.Accessories
|
||||
public int containedAlcoholID = -1;
|
||||
public AlcoholType currentAlcoholType = AlcoholType.None;
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
public static readonly float DamageBoostMultiplier = 1.25f; // (only exists right now so that it compiles, leave it be)
|
||||
public static readonly float DamageReductionMultiplier = 0.75f; // (only exists right now so that it compiles, leave it be)
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
@@ -156,8 +154,9 @@ namespace CalamityMod.Items.Accessories
|
||||
|
||||
if (containedAlcoholID != -1)
|
||||
{
|
||||
Item alcoholItem = new Item(containedAlcoholID);
|
||||
dripPlayer.currentAlcohol = currentAlcoholType;
|
||||
|
||||
Item alcoholItem = new Item(containedAlcoholID);
|
||||
if (alcoholItem.ModItem is IAlcoholItem alcohol)
|
||||
dripPlayer.ApplyAlcoholEffect(alcohol.AlcoholEffect);
|
||||
}
|
||||
@@ -213,11 +212,19 @@ namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public Dictionary<Action<Player, float>, float> alcoholEffects = new();
|
||||
public bool ivDripEquipped;
|
||||
public AlcoholType currentAlcohol = AlcoholType.None;
|
||||
|
||||
// would otherwise be spamming these checks manually any time another class wants to check for if IV drip has a certain alcohol filled
|
||||
public bool HasAlcohol(AlcoholType type)
|
||||
{
|
||||
return ivDripEquipped && currentAlcohol == type;
|
||||
}
|
||||
|
||||
public override void ResetEffects()
|
||||
{
|
||||
alcoholEffects.Clear();
|
||||
ivDripEquipped = false;
|
||||
currentAlcohol = AlcoholType.None;
|
||||
}
|
||||
|
||||
public void ApplyAlcoholEffect(Action<Player, float> effect)
|
||||
|
||||
@@ -4602,8 +4602,10 @@ namespace CalamityMod.Projectiles
|
||||
// IV Drip on the Rocks inherits the same logic as Old Fashioned
|
||||
if (modPlayer.oldFashioned && buffedByOldFashioned.HasValue)
|
||||
modifiers.SourceDamage *= buffedByOldFashioned.Value ? OldFashioned.DamageBoostMultiplier : OldFashioned.DamageReductionMultiplier;
|
||||
if (modPlayer.ivDrip && buffedByOldFashioned.HasValue)
|
||||
modifiers.SourceDamage *= buffedByOldFashioned.Value ? IVDripOnTheRocks.DamageBoostMultiplier : IVDripOnTheRocks.DamageReductionMultiplier;
|
||||
|
||||
var dripPlayer = player.GetModPlayer<IVDripPlayer>();
|
||||
if (dripPlayer.HasAlcohol(AlcoholType.OldFashioned) && buffedByOldFashioned.HasValue)
|
||||
modifiers.SourceDamage *= buffedByOldFashioned.Value ? OldFashioned.DamageBoostMultiplier : OldFashioned.DamageReductionMultiplier;
|
||||
|
||||
if (modPlayer.rum && projectile.DamageType.CountsAsClass(DamageClass.Summon))
|
||||
{
|
||||
@@ -4755,7 +4757,7 @@ namespace CalamityMod.Projectiles
|
||||
{
|
||||
var player = Main.player[projectile.owner];
|
||||
float burnRatio = (-player.statMana / 100) * ChaosStone.DamageMultPer100Mana;
|
||||
target.Calamity().manaBurn += damageDone * burnRatio * (player.Calamity().oldFashioned ? OldFashioned.DamageBoostMultiplier : 1) * (player.Calamity().ivDrip ? IVDripOnTheRocks.DamageBoostMultiplier : 1) * (player.Calamity().vodka ? 1+Vodka.DebuffBoost : 1);
|
||||
target.Calamity().manaBurn += damageDone * burnRatio * (player.Calamity().oldFashioned ? OldFashioned.DamageBoostMultiplier : 1) * (player.Calamity().ivDrip ? OldFashioned.DamageBoostMultiplier : 1) * (player.Calamity().vodka ? 1+Vodka.DebuffBoost : 1);
|
||||
target.Calamity().playerManaBurnIntensity = -player.statMana / (float)player.statManaMax2;
|
||||
if (Main.netMode != NetmodeID.SinglePlayer)
|
||||
ManaBurnSyncPacket.Send(target);
|
||||
|
||||
Reference in new issue
Block a user