Merge branch '1.4.4' into doze-misc
No files matched your search
@@ -167,9 +167,6 @@ namespace CalamityMod.Balancing
|
||||
// 50% resist to Aegis Blade's explosions because the true melee resist ain't enough.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ravager, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<AegisBlast>()))));
|
||||
|
||||
// 40% resist to Icicle Arrows.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ravager, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType<IcicleArrowProj>()))));
|
||||
|
||||
// 35% resist to Flying Dragon.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ravager, Do(new ProjectileResistBalancingRule(0.65f, ProjectileID.DD2SquireSonicBoom))));
|
||||
|
||||
@@ -213,9 +210,6 @@ namespace CalamityMod.Balancing
|
||||
// 35% resist to Aerial Bane.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.65f, ProjectileID.DD2BetsyArrow))));
|
||||
|
||||
// 35% resist to Icicle Arrows.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<IcicleArrowProj>()))));
|
||||
|
||||
// 30% resist to Aurora Blazer.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<AuroraFire>()))));
|
||||
|
||||
@@ -254,9 +248,6 @@ namespace CalamityMod.Balancing
|
||||
// 50% resist to Galactus Blade.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<DarkEnergy>(), new ProjectileResistBalancingRule(0.5f, ProjectileType<GalacticaComet>())));
|
||||
|
||||
// 40% resist to Pristine Fury's alt fire.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<DarkEnergy>(), new ProjectileResistBalancingRule(0.6f, ProjectileType<PristineSecondary>())));
|
||||
|
||||
// 40% resist to Stellar Torus Staff.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<DarkEnergy>(), new ProjectileResistBalancingRule(0.6f, ProjectileType<StellarTorusBeam>())));
|
||||
#endregion
|
||||
@@ -274,9 +265,6 @@ namespace CalamityMod.Balancing
|
||||
// 50% resist to Legion of Celestia.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<CelestialAxeMinion>()))));
|
||||
|
||||
// 50% resist to Pristine Fury's alt fire.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<PristineSecondary>()))));
|
||||
|
||||
// 50% resist to Tactician's Trump Card's explosions.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<TacticiansElectricBoom>()))));
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class BaconOilBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 3
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
Main.persistentBuff[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
player.Calamity().baconOil = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 3.5 KiB |
@@ -1,10 +1,15 @@
|
||||
using Terraria;
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class BloodyMaryBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
using Terraria;
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class CaribbeanRumBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
using Terraria;
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class CinnamonRollBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
using Terraria;
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class EverclearBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 2
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -6,6 +7,10 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class EvergreenGinBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -6,6 +7,10 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class FireballBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -6,6 +7,10 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class GrapeBeerBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -6,6 +7,10 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class ManhattanBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -6,6 +7,10 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class MargaritaBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
using Terraria;
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class MoonshineBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
using Terraria;
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class MoscowMuleBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
using Terraria;
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class OldFashionedBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
using Terraria;
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class PurpleHazeBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
using Terraria;
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class RedWineBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
using Terraria;
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class RumBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -6,6 +7,10 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class ScrewdriverBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
using Terraria;
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class StarBeamRyeBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -6,6 +7,10 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class TequilaBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
using Terraria;
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class TequilaSunriseBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -6,6 +7,10 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class VodkaBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
using Terraria;
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class WhiskeyBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
using Terraria;
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class WhiteWineBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Items.Potions;
|
||||
using CalamityMod.Particles;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.Graphics.Shaders;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Potions
|
||||
{
|
||||
public class SwinesWrathBuff : ModBuff
|
||||
{
|
||||
public static readonly SoundStyle TimerSound = new("CalamityMod/Sounds/Custom/TickingTimer");
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
TheConcoctionPlayer concoctionPlayer = player.GetModPlayer<TheConcoctionPlayer>();
|
||||
|
||||
if (concoctionPlayer.swinesWrathCounter < 2 && concoctionPlayer.swinesWrathCounter != -1)
|
||||
{
|
||||
player.KillMe(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.SwinesWrath" + Main.rand.Next(1, 7 + 1)).ToNetworkText(player.name)), 1000, -1);
|
||||
concoctionPlayer.swinesWrathCounter = -1;
|
||||
}
|
||||
|
||||
else if (concoctionPlayer.swinesWrathCounter % 60 == 59)
|
||||
SoundEngine.PlaySound(TimerSound with { Volume = ((600f - concoctionPlayer.swinesWrathCounter) / 600f) }, player.Center); // Gets louder as time progresses
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 522 B |
@@ -0,0 +1,22 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.StatDebuffs
|
||||
{
|
||||
public class Malnourished : ModBuff
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
player.Calamity().malnourished = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 798 B |
@@ -43,6 +43,7 @@ using CalamityMod.Items.PermanentBoosters;
|
||||
using CalamityMod.Items.Placeables.Furniture;
|
||||
using CalamityMod.Items.Potions;
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using CalamityMod.Items.Potions.Food;
|
||||
using CalamityMod.Items.Tools;
|
||||
using CalamityMod.Items.Tools.ClimateChange;
|
||||
using CalamityMod.Items.TreasureBags.MiscGrabBags;
|
||||
@@ -69,6 +70,7 @@ using CalamityMod.Systems;
|
||||
using CalamityMod.Systems.Collections;
|
||||
using CalamityMod.Systems.Mechanic;
|
||||
using CalamityMod.Utilities;
|
||||
using CalamityMod.Waters;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
@@ -140,6 +142,13 @@ namespace CalamityMod.CalPlayer
|
||||
/// </summary>
|
||||
public bool heldGaelsLastFrame = false;
|
||||
/// <summary>
|
||||
/// Tracks whether or not the player is currently holding Elephant Killer.<br/>
|
||||
/// Used to reset stealth when swapping to this item.
|
||||
/// </summary>
|
||||
public bool heldElephantKillerLastFrame = false;
|
||||
public float elephantKillerJoke = 0;
|
||||
public bool drawingElephantKillerJoke = false;
|
||||
/// <summary>
|
||||
/// Tracks whether or not the player currently has Draedon's Heart equipped.<br/>
|
||||
/// Used to reset Adrenaline when (un)equipped to prevent exploits.
|
||||
/// </summary>
|
||||
@@ -379,9 +388,12 @@ namespace CalamityMod.CalPlayer
|
||||
public int hideOfDeusMeleeBoostTimer = 0;
|
||||
/// <summary>
|
||||
/// The player's alcohol level. Increased by 1 for each alcohol the player has drank, 2 for Everclear.<br/>
|
||||
/// If this value is greater than 3, the player is inflicted with Alcohol Poisoning.
|
||||
/// If this value is greater than the max (normally 3), the player is inflicted with Alcohol Poisoning.
|
||||
/// </summary>
|
||||
public int alcoholPoisonLevel = 0;
|
||||
public static int alcoholPoisonMaxBase = 3;
|
||||
/// <summary> The maximum alcohol level the player can reach before getting Alcohol Poisoning. </summary>
|
||||
public int alcoholPoisonMax = alcoholPoisonMaxBase;
|
||||
public int dashTimeMod;
|
||||
/// <summary>
|
||||
/// Timer variable which tracks how long the player has spent outside of Providence's border radius, in frames.<br/>
|
||||
@@ -804,6 +816,7 @@ namespace CalamityMod.CalPlayer
|
||||
#endregion
|
||||
|
||||
#region Accessory
|
||||
public int friendlyMinions = 0;
|
||||
public bool shieldOfTheHighRulerDashVelocityBoosted = false;
|
||||
public bool yharimsGift = false;
|
||||
public bool luxorsGift = false;
|
||||
@@ -1395,6 +1408,7 @@ namespace CalamityMod.CalPlayer
|
||||
public bool riptide = false;
|
||||
public bool hadopelagicPressure = false;
|
||||
public bool fishAlert = false;
|
||||
public bool malnourished = false;
|
||||
public bool clamity = false;
|
||||
public bool NOU = false;
|
||||
public bool absorberAffliction = false;
|
||||
@@ -1486,6 +1500,8 @@ namespace CalamityMod.CalPlayer
|
||||
public bool whiteWine = false;
|
||||
public float whiteWineTimer = 0;
|
||||
public bool evergreenGin = false;
|
||||
public bool baconOil = false;
|
||||
public int baconOilSoundCooldown = 0;
|
||||
public bool tranquilityCandle = false;
|
||||
public bool chaosCandle = false;
|
||||
public bool blueCandle = false;
|
||||
@@ -2162,6 +2178,7 @@ namespace CalamityMod.CalPlayer
|
||||
externalAuricRejectionImmunity = false;
|
||||
|
||||
alcoholPoisonLevel = 0;
|
||||
alcoholPoisonMax = alcoholPoisonMaxBase;
|
||||
noLifeRegen = false;
|
||||
|
||||
//Stratus Starburst amount management
|
||||
@@ -2251,6 +2268,7 @@ namespace CalamityMod.CalPlayer
|
||||
if (!pSoulArtifact)
|
||||
pSoulShieldDurability = 0;
|
||||
}
|
||||
friendlyMinions = 0;
|
||||
pSoulShieldVisible = false;
|
||||
roverDrive = false;
|
||||
roverDriveShieldVisible = false;
|
||||
@@ -2695,6 +2713,7 @@ namespace CalamityMod.CalPlayer
|
||||
riptide = false;
|
||||
hadopelagicPressure = false;
|
||||
fishAlert = false;
|
||||
malnourished = false;
|
||||
clamity = false;
|
||||
NOU = false;
|
||||
enraged = false;
|
||||
@@ -2782,6 +2801,7 @@ namespace CalamityMod.CalPlayer
|
||||
moscowMule = false;
|
||||
whiteWine = false;
|
||||
evergreenGin = false;
|
||||
baconOil = false;
|
||||
|
||||
tranquilityCandle = false;
|
||||
chaosCandle = false;
|
||||
@@ -3071,6 +3091,7 @@ namespace CalamityMod.CalPlayer
|
||||
if (Player.HeldItem.IsAir || Player.HeldItem.fishingPole == 0)
|
||||
consecutiveCaughtFish = 0;
|
||||
heldGaelsLastFrame = false;
|
||||
heldElephantKillerLastFrame = false;
|
||||
partialLifeRegenCounter = 0f;
|
||||
gaelSwipes = 0;
|
||||
whitewaterHeal = 0;
|
||||
@@ -3179,6 +3200,7 @@ namespace CalamityMod.CalPlayer
|
||||
riptide = false;
|
||||
hadopelagicPressure = false;
|
||||
fishAlert = false;
|
||||
malnourished = false;
|
||||
clamity = false;
|
||||
NOU = false;
|
||||
snowmanNoseless = false;
|
||||
@@ -3293,6 +3315,7 @@ namespace CalamityMod.CalPlayer
|
||||
moscowMule = false;
|
||||
whiteWine = false;
|
||||
evergreenGin = false;
|
||||
baconOil = false;
|
||||
tranquilityCandle = false;
|
||||
chaosCandle = false;
|
||||
blueCandle = false;
|
||||
@@ -4274,12 +4297,217 @@ namespace CalamityMod.CalPlayer
|
||||
vector = player.CheckForGoodTeleportationSpot(ref canSpawn, halfWorldXTiles + smallerCheckRadius, smallerCheckRadius, teleportStartY, teleportRangeY, settings);
|
||||
|
||||
if (canSpawn)
|
||||
{
|
||||
return (Vector2?)vector;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a random position in the Lihzhard Temple to teleport the player to. <br></br>
|
||||
/// Used primarily for <see cref="Items.Potions.TheElixir"/>.
|
||||
/// </summary>
|
||||
public static Vector2? GetTempleTeleportPosition(Player player)
|
||||
{
|
||||
int foundX = -1;
|
||||
int foundY = -1;
|
||||
bool dungeonOnRightSide = Main.dungeonX > Main.spawnTileX;
|
||||
int xSearchEnd = dungeonOnRightSide ? 20 : Main.maxTilesX - 20;
|
||||
|
||||
if (dungeonOnRightSide)
|
||||
{
|
||||
for (int i = Main.spawnTileX; i >= xSearchEnd; i -= 2)
|
||||
{
|
||||
for (int j = (int)Main.worldSurface; j < Main.maxTilesY - 210; j++)
|
||||
{
|
||||
Tile tile = Framing.GetTileSafely(i, j);
|
||||
if (tile.WallType == WallID.LihzahrdBrickUnsafe)
|
||||
{
|
||||
foundX = i;
|
||||
foundY = j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (foundX != -1)
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = Main.spawnTileX; i <= xSearchEnd; i += 2)
|
||||
{
|
||||
for (int j = (int)Main.worldSurface; j < Main.maxTilesY - 210; j++)
|
||||
{
|
||||
Tile tile = Framing.GetTileSafely(i, j);
|
||||
if (tile.WallType == WallID.LihzahrdBrickUnsafe)
|
||||
{
|
||||
foundX = i;
|
||||
foundY = j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (foundX != -1)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (foundX == -1)
|
||||
return null;
|
||||
|
||||
int attempts = 25;
|
||||
int rangeX = 300;
|
||||
int rangeY = 300;
|
||||
int randomFluff = 500;
|
||||
Point finalTeleportPoint = Point.Zero;
|
||||
for (int i = 0; i < attempts; i++)
|
||||
{
|
||||
for (int x = 0; x <= rangeX; x++)
|
||||
{
|
||||
for (int y = 0; y <= rangeY; y++)
|
||||
{
|
||||
int teleportPosX = foundX + x + Main.rand.Next(-randomFluff, randomFluff);
|
||||
int teleportPosY = foundY + y + Main.rand.Next(-randomFluff, randomFluff);
|
||||
Tile tile = Framing.GetTileSafely(teleportPosX, teleportPosY);
|
||||
Tile tileAbove = Framing.GetTileSafely(teleportPosX, teleportPosY - 1);
|
||||
Tile tileBelow = Framing.GetTileSafely(teleportPosX, teleportPosY + 1);
|
||||
|
||||
if (!tileAbove.HasTile && tileBelow.HasTile && tile.WallType == WallID.LihzahrdBrickUnsafe)
|
||||
{
|
||||
finalTeleportPoint = new(tile.X(), tile.Y());
|
||||
if (!Collision.SolidCollision(finalTeleportPoint.ToWorldCoordinates(), player.width, player.height))
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return finalTeleportPoint.ToWorldCoordinates() - new Vector2(player.width, player.height);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a random position in the Void (Abyss Layer 4) to teleport the player to. <br></br>
|
||||
/// Used primarily for <see cref="Items.Potions.TheElixir"/>.
|
||||
/// </summary>
|
||||
public static Vector2? GetAbyssVoidTeleportPosition(Player player)
|
||||
{
|
||||
bool canSpawn = false;
|
||||
int halfWorldWidth = Main.maxTilesX / 2;
|
||||
|
||||
int abyssStartX = Abyss.AtLeftSideOfWorld ? halfWorldWidth - (halfWorldWidth - 135) + 35 : halfWorldWidth + (halfWorldWidth - 135) - 35;
|
||||
int abyssXRange = 50;
|
||||
|
||||
int teleportStartY = Main.remixWorld ? SulphurousSea.YStart - (int)(Main.UnderworldLayer * 0.6f) : Main.maxTilesY - 300;
|
||||
int teleportRangeY = 80;
|
||||
|
||||
Player.RandomTeleportationAttemptSettings settings = new Player.RandomTeleportationAttemptSettings
|
||||
{
|
||||
mostlySolidFloor = false,
|
||||
avoidAnyLiquid = false,
|
||||
avoidLava = true,
|
||||
avoidHurtTiles = true,
|
||||
avoidWalls = false,
|
||||
attemptsBeforeGivingUp = 1000,
|
||||
maximumFallDistanceFromOrignalPoint = 10
|
||||
};
|
||||
|
||||
Vector2 teleportPosition = player.CheckForGoodTeleportationSpot(ref canSpawn, abyssStartX, abyssXRange, teleportStartY, teleportRangeY, settings);
|
||||
return canSpawn ? teleportPosition : null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a random position in the Forsaken Archives to teleport the player to. <br></br>
|
||||
/// Used primarily for <see cref="Items.Potions.TheElixir"/>.
|
||||
/// </summary>
|
||||
public static Vector2? GetDungeonArchivesTeleportPosition(Player player)
|
||||
{
|
||||
// Define an area around the center to search for a valid spot to tp
|
||||
int teleportStartX = WorldgenManagementSystem.DungeonArchivePos.X;
|
||||
int teleportStartY = WorldgenManagementSystem.DungeonArchivePos.Y;
|
||||
|
||||
// Manually search for the Archives from the bottom of the world if the Archive position isn't saved.
|
||||
if (WorldgenManagementSystem.DungeonArchivePos == Point.Zero)
|
||||
{
|
||||
int foundX = -1;
|
||||
int foundY = -1;
|
||||
bool dungeonOnRightSide = Main.dungeonX > Main.spawnTileX;
|
||||
int xSearchStart = dungeonOnRightSide ? Main.maxTilesX - 20 : 20;
|
||||
|
||||
if (dungeonOnRightSide)
|
||||
{
|
||||
for (int y = Main.UnderworldLayer; y > (int)Main.rockLayer; y--)
|
||||
{
|
||||
for (int x = xSearchStart; x >= Main.maxTilesX / 2; x -= 2)
|
||||
{
|
||||
Tile tile = Framing.GetTileSafely(x, y);
|
||||
if (Main.wallDungeon[tile.WallType] && Main.tileDungeon[tile.TileType])
|
||||
{
|
||||
foundX = x;
|
||||
foundY = y;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (foundY != -1)
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int y = Main.UnderworldLayer; y > (int)Main.rockLayer; y--)
|
||||
{
|
||||
for (int x = xSearchStart; x <= Main.maxTilesX / 2; x += 2)
|
||||
{
|
||||
Tile tile = Framing.GetTileSafely(x, y);
|
||||
if (Main.wallDungeon[tile.WallType] && Main.tileDungeon[tile.TileType])
|
||||
{
|
||||
foundX = x;
|
||||
foundY = y;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (foundY != -1)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (foundY == -1)
|
||||
return null;
|
||||
|
||||
teleportStartX = foundX;
|
||||
teleportStartY = foundY;
|
||||
}
|
||||
|
||||
int attempts = 25;
|
||||
int rangeX = 100;
|
||||
int rangeY = 200;
|
||||
int randomFluff = 60;
|
||||
Point finalTeleportPoint = Point.Zero;
|
||||
for (int i = 0; i < attempts; i++)
|
||||
{
|
||||
for (int x = -rangeX; x <= rangeX; x++)
|
||||
{
|
||||
for (int y = 0; y <= rangeY; y++)
|
||||
{
|
||||
int teleportPosX = teleportStartX + x + Main.rand.Next(-randomFluff, randomFluff);
|
||||
int teleportPosY = teleportStartY + y + Main.rand.Next(-randomFluff, randomFluff);
|
||||
Tile tile = Framing.GetTileSafely(teleportPosX, teleportPosY);
|
||||
Tile tileAbove = Framing.GetTileSafely(teleportPosX, teleportPosY - 1);
|
||||
Tile tileBelow = Framing.GetTileSafely(teleportPosX, teleportPosY + 1);
|
||||
|
||||
if (!tileAbove.HasTile && tileBelow.HasUnactuatedTile && Main.wallDungeon[tile.WallType])
|
||||
{
|
||||
finalTeleportPoint = new(tile.X(), tile.Y());
|
||||
if (!Collision.SolidCollision(finalTeleportPoint.ToWorldCoordinates(), player.width, player.height))
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return finalTeleportPoint.ToWorldCoordinates() - new Vector2(player.width, player.height);
|
||||
}
|
||||
|
||||
public static void ModTeleport(Player player, Vector2 pos, bool playSound = true, int style = TeleportationStyleID.RecallPotion)
|
||||
{
|
||||
bool postImmune = player.immune;
|
||||
@@ -4596,12 +4824,12 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
|
||||
//Multiply vertical speed
|
||||
if (redWine)
|
||||
if (redWine || Player.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.RedWine))
|
||||
{
|
||||
if (Player.velocity.Y > 0.2f || Player.velocity.Y < -0.2f)
|
||||
{
|
||||
redWineStoredY = Player.velocity.Y;
|
||||
Player.velocity.Y *= 1 + RedWine.VerticalSpeedBoost;
|
||||
Player.velocity.Y *= 1 + (redWine ? RedWine.VerticalSpeedBoost : 0) + (Player.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.RedWine) ? RedWine.VerticalSpeedBoost : 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4850,6 +5078,32 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (malnourished) // Has to be here because alcoholPoisonLevel isn't updated until now
|
||||
{
|
||||
alcoholPoisonMax += TheSandwich.alcoholCapBoost;
|
||||
// Gives inverted buffs from well fed
|
||||
Player.statDefense -= 2;
|
||||
Player.GetCritChance<GenericDamageClass>() -= 2;
|
||||
Player.minionKB -= 0.5f;
|
||||
Player.moveSpeed -= 0.05f;
|
||||
// damage nerf/boost happens in PostUpdate
|
||||
Player.pickSpeed += 0.05f;
|
||||
|
||||
|
||||
for (int l = 0; l < Player.MaxBuffs; ++l)
|
||||
{
|
||||
int buffID = Player.buffType[l];
|
||||
if ((BuffDatasets.DebuffDataset[buffID] != null && BuffDatasets.DebuffDataset[buffID].AlcoholLevel > 0) || buffID == BuffID.Tipsy)
|
||||
{
|
||||
Player.buffTime[l]++;
|
||||
}
|
||||
}
|
||||
|
||||
if (Player.wellFed)
|
||||
Player.ClearBuff(ModContent.BuffType<Malnourished>());
|
||||
}
|
||||
|
||||
if (moonshine)
|
||||
Player.statLifeMax2 = (int)(Player.statLifeMax2 * (1 + Moonshine.MaxLifePercentBoost));
|
||||
ForceVariousEffects();
|
||||
@@ -4882,7 +5136,7 @@ namespace CalamityMod.CalPlayer
|
||||
#region PostUpdateEquips
|
||||
public override void PostUpdateEquips()
|
||||
{
|
||||
|
||||
var dripPlayer = Player.GetModPlayer<IVDripPlayer>();
|
||||
var item = Player.HeldItem;
|
||||
if (!(item.IsAir || item.damage <= 0))
|
||||
{
|
||||
@@ -4891,11 +5145,13 @@ namespace CalamityMod.CalPlayer
|
||||
TimeHoldingMelee++;
|
||||
if (TimeHoldingMelee > Whiskey.TimeToDischarge)
|
||||
TimeHoldingMelee = (int)Whiskey.TimeToDischarge;
|
||||
if (whiskey)
|
||||
{
|
||||
Player.GetDamage(DamageClass.Melee) += MathHelper.Lerp(Whiskey.MaxDamageBoost, Whiskey.MinDamageBoost, TimeHoldingMelee / Whiskey.TimeToDischarge);
|
||||
}
|
||||
} else
|
||||
|
||||
if (dripPlayer.HasAlcohol(AlcoholType.Whiskey) && whiskey)
|
||||
Player.GetDamage(DamageClass.Melee) += MathHelper.Lerp(Whiskey.CombinedDamageCeiling, Whiskey.CombinedDamageFloor, TimeHoldingMelee / Whiskey.TimeToDischarge);
|
||||
else if (whiskey || dripPlayer.HasAlcohol(AlcoholType.Whiskey))
|
||||
Player.GetDamage(DamageClass.Melee) += MathHelper.Lerp(Whiskey.StandardDamageCeiling, Whiskey.StandardDamageFloor, TimeHoldingMelee / Whiskey.TimeToDischarge);
|
||||
}
|
||||
else
|
||||
{
|
||||
TimeHoldingMelee -= 2;
|
||||
if (TimeHoldingMelee < 0)
|
||||
@@ -4905,11 +5161,12 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
TimeHoldingRanged++;
|
||||
if (TimeHoldingRanged > Whiskey.TimeToDischarge)
|
||||
TimeHoldingRanged = (int)Whiskey.TimeToDischarge;
|
||||
if (whiskey)
|
||||
{
|
||||
Player.GetDamage(DamageClass.Ranged) += MathHelper.Lerp(Whiskey.MaxDamageBoost, Whiskey.MinDamageBoost, TimeHoldingRanged / Whiskey.TimeToDischarge);
|
||||
}
|
||||
TimeHoldingRanged = (int)Whiskey.TimeToDischarge;
|
||||
|
||||
if (dripPlayer.HasAlcohol(AlcoholType.Whiskey) && whiskey)
|
||||
Player.GetDamage(DamageClass.Ranged) += MathHelper.Lerp(Whiskey.CombinedDamageCeiling, Whiskey.CombinedDamageFloor, TimeHoldingRanged / Whiskey.TimeToDischarge);
|
||||
else if (whiskey || dripPlayer.HasAlcohol(AlcoholType.Whiskey))
|
||||
Player.GetDamage(DamageClass.Ranged) += MathHelper.Lerp(Whiskey.StandardDamageCeiling, Whiskey.StandardDamageFloor, TimeHoldingRanged / Whiskey.TimeToDischarge);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4922,10 +5179,11 @@ namespace CalamityMod.CalPlayer
|
||||
TimeHoldingMagic++;
|
||||
if (TimeHoldingMagic > Whiskey.TimeToDischarge)
|
||||
TimeHoldingMagic = (int)Whiskey.TimeToDischarge;
|
||||
if (whiskey)
|
||||
{
|
||||
Player.GetDamage(DamageClass.Magic) += MathHelper.Lerp(Whiskey.MaxDamageBoost, Whiskey.MinDamageBoost, TimeHoldingMagic / Whiskey.TimeToDischarge);
|
||||
}
|
||||
|
||||
if (dripPlayer.HasAlcohol(AlcoholType.Whiskey) && whiskey)
|
||||
Player.GetDamage(DamageClass.Magic) += MathHelper.Lerp(Whiskey.CombinedDamageCeiling, Whiskey.CombinedDamageFloor, TimeHoldingMagic / Whiskey.TimeToDischarge);
|
||||
else if (whiskey || dripPlayer.HasAlcohol(AlcoholType.Whiskey))
|
||||
Player.GetDamage(DamageClass.Magic) += MathHelper.Lerp(Whiskey.StandardDamageCeiling, Whiskey.StandardDamageFloor, TimeHoldingMagic / Whiskey.TimeToDischarge);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4938,10 +5196,11 @@ namespace CalamityMod.CalPlayer
|
||||
TimeHoldingSummon++;
|
||||
if (TimeHoldingSummon > Whiskey.TimeToDischarge)
|
||||
TimeHoldingSummon = (int)Whiskey.TimeToDischarge;
|
||||
if (whiskey)
|
||||
{
|
||||
Player.GetDamage(DamageClass.Summon) += MathHelper.Lerp(Whiskey.MaxDamageBoost, Whiskey.MinDamageBoost, TimeHoldingSummon / Whiskey.TimeToDischarge);
|
||||
}
|
||||
|
||||
if (dripPlayer.HasAlcohol(AlcoholType.Whiskey) && whiskey)
|
||||
Player.GetDamage(DamageClass.Summon) += MathHelper.Lerp(Whiskey.CombinedDamageCeiling, Whiskey.CombinedDamageFloor, TimeHoldingSummon / Whiskey.TimeToDischarge);
|
||||
else if (whiskey || dripPlayer.HasAlcohol(AlcoholType.Whiskey))
|
||||
Player.GetDamage(DamageClass.Summon) += MathHelper.Lerp(Whiskey.StandardDamageCeiling, Whiskey.StandardDamageFloor, TimeHoldingSummon / Whiskey.TimeToDischarge);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4954,10 +5213,12 @@ namespace CalamityMod.CalPlayer
|
||||
TimeHoldingRogue++;
|
||||
if (TimeHoldingRogue > Whiskey.TimeToDischarge)
|
||||
TimeHoldingRogue = (int)Whiskey.TimeToDischarge;
|
||||
if (whiskey)
|
||||
{
|
||||
Player.GetDamage(RogueDamageClass.Instance) += MathHelper.Lerp(Whiskey.MaxDamageBoost, Whiskey.MinDamageBoost, TimeHoldingRogue / Whiskey.TimeToDischarge);
|
||||
}
|
||||
|
||||
if (dripPlayer.HasAlcohol(AlcoholType.Whiskey) && whiskey)
|
||||
Player.GetDamage(RogueDamageClass.Instance) += MathHelper.Lerp(Whiskey.CombinedDamageCeiling, Whiskey.CombinedDamageFloor, TimeHoldingRogue / Whiskey.TimeToDischarge);
|
||||
else if (whiskey || dripPlayer.HasAlcohol(AlcoholType.Whiskey))
|
||||
Player.GetDamage(RogueDamageClass.Instance) += MathHelper.Lerp(Whiskey.StandardDamageCeiling, Whiskey.StandardDamageFloor, TimeHoldingRogue / Whiskey.TimeToDischarge);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4978,6 +5239,10 @@ namespace CalamityMod.CalPlayer
|
||||
if (TimeHoldingRogue-- < 0)
|
||||
TimeHoldingRogue = 0;
|
||||
}
|
||||
if (dripPlayer.HasAlcohol(AlcoholType.Moonshine))
|
||||
{
|
||||
Player.statLifeMax2 = (int)(Player.statLifeMax2 * (1 + Moonshine.MaxLifePercentBoost));
|
||||
}
|
||||
|
||||
|
||||
// PostUpdateMiscEffects runs after the cap has been applied. Do NOT put mining speed stuff there.
|
||||
@@ -5114,7 +5379,7 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
|
||||
//reset the stored Y value for red wine's increased vertical speed
|
||||
if (redWine && (redWineStoredY > 0.2f || redWineStoredY < -0.2f) && (Player.velocity.Y > 0.2f || Player.velocity.Y < -0.2f))
|
||||
if ((redWine || Player.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.RedWine)) && (redWineStoredY > 0.2f || redWineStoredY < -0.2f) && (Player.velocity.Y > 0.2f || Player.velocity.Y < -0.2f))
|
||||
{
|
||||
Player.velocity.Y = redWineStoredY;
|
||||
}
|
||||
@@ -5133,6 +5398,9 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
}
|
||||
|
||||
if (malnourished) // Has to be here because alcoholPoisonLevel isn't updated until now
|
||||
Player.GetDamage<GenericDamageClass>() += -0.05f + TheSandwich.statBoost * alcoholPoisonLevel;
|
||||
|
||||
// Relic of Convergence defense cut
|
||||
if (Player.ownedProjectileCounts[ModContent.ProjectileType<RelicOfConvergenceCrystal>()] > 0 && Player.HeldItem.type == ModContent.ItemType<RelicOfConvergence>())
|
||||
Player.statDefense *= RelicOfConvergence.DefenseMultiplier;
|
||||
@@ -5264,6 +5532,92 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
#endregion
|
||||
|
||||
if ((Player.Calamity().baconOil || Player.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.BaconOil)) && !Player.mount.Active)
|
||||
{
|
||||
Player.noFallDmg = true;
|
||||
|
||||
float stackScale = (Player.Calamity().baconOil && Player.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.BaconOil)) ? 1.33f : 1;
|
||||
|
||||
float velX = Math.Abs(Player.velocity.X);
|
||||
float velY = Math.Abs(Player.velocity.Y);
|
||||
|
||||
float speedMult = Player.GetBestClassDamage().ApplyTo(1);
|
||||
float maxMoveSpeed = 10.5f * speedMult * stackScale;
|
||||
float minMoveSpeed = 3 * stackScale; // Minimum move speed to be at if the player can bounce
|
||||
float hitboxSizeMult = 0.45f;
|
||||
|
||||
bool onPlatform = false;
|
||||
if (Player.velocity.Y > 0 && !Player.controlDown)
|
||||
{
|
||||
for (int i = 4; i < 8; i++)
|
||||
{
|
||||
Point bottom = (Player.Bottom + Vector2.UnitY * i).ToTileCoordinates();
|
||||
if (TileID.Sets.Platforms[CalamityUtils.ParanoidTileRetrieval(bottom.X, bottom.Y).TileType])
|
||||
{
|
||||
onPlatform = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool hitDown = velY > minMoveSpeed && (Collision.SolidCollision(Player.Bottom + Vector2.UnitY * Player.velocity.Y, (int)(Player.width * hitboxSizeMult), 1) || onPlatform);
|
||||
bool hitUp = velY > minMoveSpeed && Collision.SolidCollision(Player.Top + Vector2.UnitY * Player.velocity.Y, (int)(Player.width * hitboxSizeMult), 1);
|
||||
bool hitSide = velX > minMoveSpeed && Collision.SolidCollision(Vector2.Lerp(Player.TopLeft, Player.Left, 0.15f) + Vector2.UnitX * Player.velocity.X, 1, (int)(Player.height * hitboxSizeMult)) || Collision.SolidCollision(Vector2.Lerp(Player.TopRight, Player.Right, 0.15f) + Vector2.UnitX * Player.velocity.X, 1, (int)(Player.height * hitboxSizeMult));
|
||||
float acceleration = 0.05f * stackScale;
|
||||
float decceleration = -0.025f / speedMult;
|
||||
float riseSpeed = 0.8f * stackScale; // The speed the player rises when in water or rain
|
||||
float slipPower = 0.85f; //How strong the slippery effect is
|
||||
|
||||
float bounceReduction = 0.9f;
|
||||
bool makeSound = false;
|
||||
if (hitSide)
|
||||
{
|
||||
Player.velocity.X = -Player.velocity.X * bounceReduction;
|
||||
Player.oldVelocity.X = -Player.oldVelocity.X * bounceReduction;
|
||||
makeSound = true;
|
||||
}
|
||||
if ((hitDown || hitUp))
|
||||
{
|
||||
if (Player.controlUp)
|
||||
bounceReduction = 1.3f;
|
||||
Player.velocity.Y = -Player.velocity.Y * bounceReduction;
|
||||
Player.oldVelocity.Y = -Player.oldVelocity.Y * bounceReduction;
|
||||
if (hitDown)
|
||||
{
|
||||
Player.RefreshMovementAbilities(true);
|
||||
}
|
||||
makeSound = true;
|
||||
}
|
||||
int soundCDMax = 150;
|
||||
if (makeSound && baconOilSoundCooldown < soundCDMax)
|
||||
{
|
||||
if (baconOilSoundCooldown < soundCDMax)
|
||||
baconOilSoundCooldown += 30;
|
||||
float pitch = (0.55f * stackScale) * Utils.GetLerpValue(0, soundCDMax, baconOilSoundCooldown, true);
|
||||
SoundStyle boyoyoing = new("CalamityMod/Sounds/Item/BaconOilBounce");
|
||||
SoundEngine.PlaySound(boyoyoing with { Volume = 0.45f, Pitch = hitSide ? pitch - 0.3f : pitch, MaxInstances = 5 }, Player.Center);
|
||||
}
|
||||
|
||||
bool playerMoving = Player.controlLeft || Player.controlRight;
|
||||
bool playerMovingInDirection = (Player.controlLeft && Player.oldVelocity.X < 0) || (Player.controlRight && Player.oldVelocity.X > 0);
|
||||
if (((Player.oldVelocity.X > 0 && Player.velocity.X > 0) || (Player.oldVelocity.X < 0 && Player.velocity.X < 0)))
|
||||
Player.velocity.X = MathHelper.Clamp(Player.velocity.X + maxMoveSpeed * MathF.Sign(Player.oldVelocity.X) *
|
||||
((playerMovingInDirection || !playerMoving) ? Player.dashDelay == -1 ? decceleration : // If dashing, deccelerate to prevent infinite dash
|
||||
// If not moving or holding in move direction, accelerate to max speed, otherwise deccelerate
|
||||
acceleration : decceleration), -maxMoveSpeed, maxMoveSpeed);
|
||||
|
||||
bool raining = Player.Center.Y < Main.worldSurface * 16.0 && Main.raining;
|
||||
if ((Player.wet || raining) && Player.velocity.Y > -maxMoveSpeed)
|
||||
{
|
||||
Player.velocity.Y -= riseSpeed; // Cover yourself in oil (go up in liquid)
|
||||
}
|
||||
|
||||
|
||||
Vector2 lerpedVel = Vector2.Lerp(Player.velocity, Player.oldVelocity, slipPower);
|
||||
Player.velocity = new Vector2(lerpedVel.X, Player.velocity.Y);
|
||||
}
|
||||
if (baconOilSoundCooldown > 0)
|
||||
baconOilSoundCooldown = (int)MathHelper.Lerp(baconOilSoundCooldown, 0, 0.027f);
|
||||
|
||||
Player.oldVelocity = Player.velocity; // Apparently this value is not updated on its own, so we do it
|
||||
}
|
||||
#endregion
|
||||
@@ -5295,7 +5649,8 @@ namespace CalamityMod.CalPlayer
|
||||
// Apply weapon modifier stealth strike damage bonus
|
||||
// 01OCT2023: Ozzatron: This is a multiplicative bonus because it is a prefix.
|
||||
// It should be equivalent to x1.15 (or whatever multiplier) on the base damage of the weapon for stealth only.
|
||||
if (rogueItem.StealthStrikePrefixBonus != 0f && StealthStrikeAvailable())
|
||||
bool dontProvideStealthDamage = Player.HeldItem.type == ModContent.ItemType<ElephantKiller>();
|
||||
if (rogueItem.StealthStrikePrefixBonus != 0f && StealthStrikeAvailable() && !dontProvideStealthDamage)
|
||||
damage *= rogueItem.StealthStrikePrefixBonus; // This number centers on 1f, so 1.15f = 1.15x damage.
|
||||
}
|
||||
}
|
||||
@@ -5307,6 +5662,8 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
if (moscowMule)
|
||||
knockback += MoscowMule.KnockbackBoost;
|
||||
if (Player.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.MoscowMule))
|
||||
knockback += MoscowMule.KnockbackBoost;
|
||||
|
||||
if (titanHeartMantle && rogue)
|
||||
knockback += TitanHeartMantle.RogueKnockbackBoost;
|
||||
@@ -5485,7 +5842,7 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
if (bladeArmEnchant)
|
||||
return false;
|
||||
if (purpleHaze)
|
||||
if (purpleHaze || Player.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.PurpleHaze))
|
||||
{
|
||||
if (item.CountsAsClass<RogueDamageClass>() && StealthStrikeAvailable())
|
||||
{
|
||||
@@ -6018,6 +6375,10 @@ namespace CalamityMod.CalPlayer
|
||||
if (it.type == ItemType<DoomsdayDevice>())
|
||||
playerUsingWeapon = false;
|
||||
|
||||
// Elephant Killer consumes stealth in a special wa- hey maybe this is a sign this class needs some work huh
|
||||
if (it.type == ItemType<ElephantKiller>())
|
||||
playerUsingWeapon = false;
|
||||
|
||||
// Animation check depends on whether the item is "clockwork", like Clockwork Assault Rifle.
|
||||
// "Clockwork" weapons can chain-fire multiple stealth strikes (really only 2 max) until you run out of stealth.
|
||||
bool animationCheck = it.useAnimation == it.useTime
|
||||
@@ -6084,7 +6445,7 @@ namespace CalamityMod.CalPlayer
|
||||
Player.ownedProjectileCounts[ProjectileType<FinalDawnThrow2>()];
|
||||
|
||||
// If you are actively using an item, you cannot gain stealth.
|
||||
if (Player.itemAnimation > 0 || finalDawnProjCount > 0)
|
||||
if (Player.itemAnimation > 0 || finalDawnProjCount > 0 || (Player.ownedProjectileCounts[ProjectileType<ElephantKillerThrown>()] > 0 || Player.HeldItem.type == ModContent.ItemType<ElephantKiller>()))
|
||||
return 0f;
|
||||
|
||||
if (shadow)
|
||||
|
||||
@@ -438,6 +438,10 @@ namespace CalamityMod.CalPlayer
|
||||
if (Player.ZoneSkyHeight && fishingRod.type == ModContent.ItemType<HeronRod>())
|
||||
fishingLevel = fishingLevel * HeronRod.FishingPowerBiomeMult;
|
||||
|
||||
// Rage bait gives free sonar effect
|
||||
if (bait.type == ModContent.ItemType<RageBait>())
|
||||
Player.sonarPotion = true;
|
||||
|
||||
// Prevent the player from fishing if they have the Bloodworm
|
||||
if (bait.type == ModContent.ItemType<BloodwormItem>())
|
||||
{
|
||||
|
||||
@@ -2889,8 +2889,9 @@ namespace CalamityMod.CalPlayer
|
||||
defenseDamageRecoveryFrames = 0;
|
||||
|
||||
// Directly add the base defense damage recovery time to whatever recovery time the player already has.
|
||||
int baseTime = DefenseDamageBaseRecoveryTime * (moonshine ? 3 : 1);
|
||||
int baseTime = DefenseDamageBaseRecoveryTime * (moonshine ? 3 : 1) * (Player.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.Moonshine) ? 3 : 1);
|
||||
totalDefenseDamageRecoveryFrames = defenseDamageRecoveryFrames + baseTime;
|
||||
|
||||
if (totalDefenseDamageRecoveryFrames > DefenseDamageMaxRecoveryTime)
|
||||
totalDefenseDamageRecoveryFrames = DefenseDamageMaxRecoveryTime;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using CalamityMod.Buffs.Potions;
|
||||
using CalamityMod.Buffs.StatBuffs;
|
||||
using CalamityMod.CalPlayer.Dashes;
|
||||
using CalamityMod.DataStructures;
|
||||
@@ -12,9 +13,7 @@ using CalamityMod.Items.Armor.Silva;
|
||||
using CalamityMod.Items.Armor.Tarragon;
|
||||
using CalamityMod.Items.Fishing.BrimstoneCragCatches;
|
||||
using CalamityMod.Items.Placeables.Furniture;
|
||||
using CalamityMod.Items.Potions;
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using CalamityMod.Items.Potions.Food;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using CalamityMod.Systems;
|
||||
@@ -191,17 +190,34 @@ namespace CalamityMod.CalPlayer
|
||||
#endregion
|
||||
|
||||
#region Alcohol
|
||||
var dripPlayer = Player.GetModPlayer<IVDripPlayer>();
|
||||
|
||||
for (int l = 0; l < Player.MaxBuffs; l++)
|
||||
{
|
||||
int buff = Player.buffType[l];
|
||||
if (CalamityBuffSets.AlcoholStrength.TryGetValue(buff, out int level))
|
||||
alcoholPoisonLevel += level;
|
||||
if (buff <= 0) continue;
|
||||
|
||||
var data = BuffDatasets.DebuffDataset[buff];
|
||||
if (data?.AlcoholLevel > 0)
|
||||
alcoholPoisonLevel += data.AlcoholLevel;
|
||||
}
|
||||
if (Player.Calamity().ivDrip) // +1 stack of poisoning while IV Drip is equipped
|
||||
alcoholPoisonLevel++;
|
||||
|
||||
if (dripPlayer.ivDripEquipped && dripPlayer.currentAlcohol != AlcoholType.None)
|
||||
{
|
||||
int ivBuffID = BuffDatasets.GetBuffIDFromAlcoholType(dripPlayer.currentAlcohol);
|
||||
|
||||
if (ivBuffID != -1)
|
||||
{
|
||||
var ivData = BuffDatasets.DebuffDataset[ivBuffID];
|
||||
if (ivData?.AlcoholLevel > 0)
|
||||
alcoholPoisonLevel += ivData.AlcoholLevel;
|
||||
}
|
||||
}
|
||||
|
||||
if (everclear)
|
||||
totalNegativeLifeRegen += Everclear.RegenLoss;
|
||||
|
||||
if (Player.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.Everclear))
|
||||
totalNegativeLifeRegen += Everclear.RegenLoss;
|
||||
// Blanket effect for all alcohols
|
||||
if (alcoholPoisonLevel > 0)
|
||||
{
|
||||
@@ -213,7 +229,7 @@ namespace CalamityMod.CalPlayer
|
||||
Player.fishingSkill += 5;
|
||||
|
||||
}
|
||||
if (alcoholPoisonLevel > 3)
|
||||
if (alcoholPoisonLevel > alcoholPoisonMax)
|
||||
{
|
||||
// Independently of Calamity's nerfs to Nebula life regen, it is disabled entirely by alcohol poisoning.
|
||||
Player.nebulaLevelLife = 0;
|
||||
@@ -268,8 +284,11 @@ namespace CalamityMod.CalPlayer
|
||||
// At the last second, Reaver defense helm reduces DoT debuffs by 20%
|
||||
if (reaverDefense)
|
||||
totalNegativeLifeRegen -= (int)(totalNegativeLifeRegen * ReaverHeadTank.SetBonusDebuffDamageReduction);
|
||||
|
||||
if (tequilaSunrise)
|
||||
totalNegativeLifeRegen = (int)(totalNegativeLifeRegen * TequilaSunrise.DoTMultiplier);
|
||||
if (Player.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.TequilaSunrise))
|
||||
totalNegativeLifeRegen = (int)(totalNegativeLifeRegen * TequilaSunrise.DoTMultiplier);
|
||||
|
||||
Player.lifeRegen -= (int)totalNegativeLifeRegen;
|
||||
|
||||
@@ -341,8 +360,18 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
if (tequilaSunrise)
|
||||
Player.lifeRegenTime += 1800;
|
||||
|
||||
}
|
||||
|
||||
if (dripPlayer.HasAlcohol(AlcoholType.TequilaSunrise))
|
||||
{
|
||||
if (hadLifeRegenHinderingDebuff && !hasLifeRegenHinderingDebuff)
|
||||
{
|
||||
Player.lifeRegenTime += 1800;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
// During Silva revive or God Slayer dash, all negative life regen is canceled
|
||||
@@ -558,12 +587,7 @@ namespace CalamityMod.CalPlayer
|
||||
if (community)
|
||||
{
|
||||
int regenBoost = 1 + (int)(TheCommunity.CalculatePower() * TheCommunity.RegenMultiplier);
|
||||
bool lesserEffect = false;
|
||||
for (int l = 0; l < Player.MaxBuffs; l++)
|
||||
{
|
||||
int hasBuff = Player.buffType[l];
|
||||
lesserEffect = CalamityBuffSets.AlcoholStrength.TryGetValue(hasBuff, out var a);
|
||||
}
|
||||
bool lesserEffect = Player.buffType.Any(i => BuffDatasets.DebuffDataset[i] is not null && BuffDatasets.DebuffDataset[i].AlcoholLevel > 0);
|
||||
if (Player.lifeRegen < 0)
|
||||
Player.lifeRegen += lesserEffect ? 1 : regenBoost;
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@ using CalamityMod.Items.VanillaArmorChanges;
|
||||
using CalamityMod.Items.Weapons.Magic;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.Items.Weapons.Ranged;
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
using CalamityMod.Items.Weapons.Summon;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.NPCs.AcidRain;
|
||||
@@ -239,6 +240,21 @@ namespace CalamityMod.CalPlayer
|
||||
rage = 0f;
|
||||
}
|
||||
|
||||
bool holdingElephantKiller = Player.HeldItem.type == ModContent.ItemType<ElephantKiller>();
|
||||
if (holdingElephantKiller && !heldElephantKillerLastFrame)
|
||||
{
|
||||
Player.Calamity().rogueStealth = 0;
|
||||
heldElephantKillerLastFrame = true;
|
||||
}
|
||||
else if (!holdingElephantKiller)
|
||||
heldElephantKillerLastFrame = false;
|
||||
|
||||
if (!drawingElephantKillerJoke)
|
||||
elephantKillerJoke = 0;
|
||||
else
|
||||
elephantKillerJoke++;
|
||||
drawingElephantKillerJoke = false;
|
||||
|
||||
if (furyFuel < FuryFuelMax && furyRefuelTimer >= 0)
|
||||
{
|
||||
furyFuel += (int)furyRefuelTimer;
|
||||
@@ -257,7 +273,9 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
|
||||
// Apply stealth damage to rogue.
|
||||
Player.GetDamage<RogueDamageClass>() += stealthDamage;
|
||||
bool dontProvideStealthDamage = Player.HeldItem.type == ModContent.ItemType<ElephantKiller>();
|
||||
if (!dontProvideStealthDamage)
|
||||
Player.GetDamage<RogueDamageClass>() += stealthDamage;
|
||||
|
||||
if ((XykVisualsBlue || XykVisualsOrange))
|
||||
{
|
||||
@@ -562,9 +580,16 @@ namespace CalamityMod.CalPlayer
|
||||
if (cinnamonRoll && !(Main.getGoodWorld && Main.npc.Any(x=> x.active && x.type == ModContent.NPCType<DevourerofGodsHead>())))
|
||||
{
|
||||
if (dashStart)
|
||||
Player.velocity.X *= 3;
|
||||
Player.velocity.X *= 2f;
|
||||
else if (Player.dashDelay == -1)
|
||||
Player.velocity.X *= 0.8f;
|
||||
Player.velocity.X *= 0.825f;
|
||||
}
|
||||
if (Player.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.CinnamonRoll) && !(Main.getGoodWorld && Main.npc.Any(x => x.active && x.type == ModContent.NPCType<DevourerofGodsHead>())))
|
||||
{
|
||||
if (dashStart)
|
||||
Player.velocity.X *= 2f;
|
||||
else if (Player.dashDelay == -1)
|
||||
Player.velocity.X *= 0.825f;
|
||||
}
|
||||
|
||||
if (Player.dashDelay == -1)
|
||||
@@ -1277,6 +1302,18 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Player.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.Margarita))
|
||||
{
|
||||
if (Main.myPlayer == Player.whoAmI)
|
||||
{
|
||||
for (int l = 0; l < Player.MaxBuffs; l++)
|
||||
{
|
||||
int buffID = Player.buffType[l];
|
||||
if (Player.buffTime[l] > 2 && CalamityBuffSets.IsDebuff[buffID])
|
||||
Player.buffTime[l]--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Update the Providence Burn effect drawer if applicable.
|
||||
float providenceBurnIntensity = 0f;
|
||||
@@ -1721,6 +1758,16 @@ namespace CalamityMod.CalPlayer
|
||||
if (rOfResilienceCooldown > 0)
|
||||
rOfResilienceCooldown--;
|
||||
|
||||
if (Player.Calamity().friendlyMinions > 0)
|
||||
{
|
||||
int numOfPigs = Player.ownedProjectileCounts[ModContent.ProjectileType<Pigion>()];
|
||||
if (numOfPigs < Player.Calamity().friendlyMinions)
|
||||
{
|
||||
int pigDamage = 7;
|
||||
Projectile.NewProjectileDirect(Player.GetSource_FromThis(), Player.Center, new Vector2(0, -16).RotatedByRandom(MathHelper.Pi), ModContent.ProjectileType<Pigion>(), pigDamage, 0f, Player.whoAmI, 0, numOfPigs + 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (transformer && Player.Calamity().transformerCooldown == 0 && transformerDelay == 0) // The code for this acursed thing took much... MUCH, too long to make
|
||||
{
|
||||
float zoneSize = 150;
|
||||
@@ -3347,7 +3394,7 @@ namespace CalamityMod.CalPlayer
|
||||
#region Other Buff Effects
|
||||
private void OtherBuffEffects()
|
||||
{
|
||||
|
||||
var dripPlayer = Player.GetModPlayer<IVDripPlayer>();
|
||||
if (gravityNormalizer)
|
||||
{
|
||||
Player.buffImmune[BuffID.VortexDebuff] = true;
|
||||
@@ -3535,30 +3582,50 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
//this is so janky looking but it's the only way I could get it to work properly
|
||||
if (!(StealthStrikeAvailable() && Player.HeldItem.DamageType == RogueDamageClass.Instance))
|
||||
Player.GetDamage(DamageClass.Generic) += PurpleHaze.DamageBoost;
|
||||
Player.GetDamage(DamageClass.Generic) += PurpleHaze.DamageBoost + ((dripPlayer.HasAlcohol(AlcoholType.PurpleHaze) && purpleHaze) ? PurpleHaze.DamageBoost : 0);
|
||||
else
|
||||
stealthDamage -= PurpleHaze.StealthDamageLoss;
|
||||
stealthDamage -= PurpleHaze.StealthDamageLoss + ((dripPlayer.HasAlcohol(AlcoholType.PurpleHaze) && purpleHaze) ? PurpleHaze.StealthDamageLoss : 0);
|
||||
}
|
||||
|
||||
if (everclear)
|
||||
Player.GetDamage<GenericDamageClass>() += Everclear.DamageBoost;
|
||||
|
||||
if (dripPlayer.HasAlcohol(AlcoholType.Everclear))
|
||||
Player.GetDamage<GenericDamageClass>() += Everclear.DamageBoost;
|
||||
|
||||
if (caribbeanRum)
|
||||
{
|
||||
Player.gravity *= CaribbeanRum.GravityMultiplier;
|
||||
Player.moveSpeed += CaribbeanRum.MoveSpeedBoost;
|
||||
}
|
||||
if (dripPlayer.HasAlcohol(AlcoholType.CaribbeanRum))
|
||||
{
|
||||
Player.gravity *= CaribbeanRum.GravityMultiplier;
|
||||
Player.moveSpeed += CaribbeanRum.MoveSpeedBoost;
|
||||
}
|
||||
|
||||
if (starBeamRye)
|
||||
{
|
||||
Player.manaRegenCount += StarBeamRye.ManaRegenBoost;
|
||||
Player.GetDamage<MagicDamageClass>() *= StarBeamRye.MagicDmgMult;
|
||||
}
|
||||
|
||||
if (whiteWine)
|
||||
if (dripPlayer.HasAlcohol(AlcoholType.StarBeamRye))
|
||||
{
|
||||
Player.wingTimeMax = (int)(Player.wingTimeMax * (1f - WhiteWine.FlightTimeLoss));
|
||||
Player.manaRegenCount += StarBeamRye.ManaRegenBoost;
|
||||
Player.GetDamage<MagicDamageClass>() *= StarBeamRye.MagicDmgMult;
|
||||
}
|
||||
|
||||
if (dripPlayer.HasAlcohol(AlcoholType.Ale) || dripPlayer.HasAlcohol(AlcoholType.Sake))
|
||||
{
|
||||
Player.GetAttackSpeed<MeleeDamageClass>() -= 0.1f;
|
||||
// See CalamityGlobalItem and PlayerUtils for Ale's melee size increase
|
||||
}
|
||||
|
||||
if (whiteWine || dripPlayer.HasAlcohol(AlcoholType.WhiteWine))
|
||||
{
|
||||
if (whiteWine)
|
||||
Player.wingTimeMax = (int)(Player.wingTimeMax * (1f - WhiteWine.FlightTimeLoss));
|
||||
if (Player.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.WhiteWine))
|
||||
Player.wingTimeMax = (int)(Player.wingTimeMax * (1f - WhiteWine.FlightTimeLoss));
|
||||
|
||||
float bonus = 0f;
|
||||
float MaxDistance = 640f;
|
||||
@@ -3570,7 +3637,12 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
else
|
||||
bonus = 0;
|
||||
whiteWineTimer += bonus * WhiteWine.FlightTimeRecoveryAmount;
|
||||
|
||||
if (whiteWine)
|
||||
whiteWineTimer += bonus * WhiteWine.FlightTimeRecoveryAmount;
|
||||
if (Player.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.WhiteWine))
|
||||
whiteWineTimer += bonus * WhiteWine.FlightTimeRecoveryAmount;
|
||||
|
||||
while (whiteWineTimer > 1)
|
||||
{
|
||||
if (Player.wingTime < Player.wingTimeMax)
|
||||
@@ -3580,9 +3652,9 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
|
||||
if (redWine)
|
||||
{
|
||||
Player.wingTimeMax = (int)(Player.wingTimeMax * (1f - RedWine.FlightTimeLoss));
|
||||
}
|
||||
if (Player.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.RedWine))
|
||||
Player.wingTimeMax = (int)(Player.wingTimeMax * (1f - RedWine.FlightTimeLoss));
|
||||
|
||||
if (giantPearl)
|
||||
{
|
||||
@@ -4724,6 +4796,12 @@ namespace CalamityMod.CalPlayer
|
||||
if (Player.statDefense > 0)
|
||||
Player.statDefense -= (int)(Player.statDefense * Everclear.DefenseLossPercent);
|
||||
}
|
||||
if (Player.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.Everclear))
|
||||
{
|
||||
if (Player.statDefense > 0)
|
||||
Player.statDefense -= (int)(Player.statDefense * Everclear.DefenseLossPercent);
|
||||
}
|
||||
|
||||
if (DesertProwlerHat.ShroudedInSmoke(Player, out _))
|
||||
Player.statDefense -= (int)(Player.statDefense * DesertProwlerHat.SmokeDefenseMult);
|
||||
}
|
||||
|
||||
@@ -90,7 +90,6 @@ namespace CalamityMod.CalPlayer
|
||||
target.Calamity().IncreasedElectricityEffects_Unused = false;
|
||||
|
||||
target.Calamity().IncreasedHeatEffects_Fireball = fireball;
|
||||
target.Calamity().IncreasedHeatEffects_CinnamonRoll = cinnamonRoll;
|
||||
target.Calamity().IncreasedHeatEffects_FireBoots = bootLevel;
|
||||
|
||||
target.Calamity().IncreasedSicknessEffects_ToxicHeart = toxicHeart;
|
||||
@@ -240,7 +239,10 @@ namespace CalamityMod.CalPlayer
|
||||
if (proj.type != ProjectileType<MythrilFlare>())
|
||||
MythrilArmorSetChange.OnHitEffects(target, damageDone, Player);
|
||||
|
||||
if (moscowMule)
|
||||
var ivDripPlayer = Player.GetModPlayer<IVDripPlayer>();
|
||||
|
||||
// "Heavy" Knockback effect
|
||||
if (moscowMule || ivDripPlayer.HasAlcohol(AlcoholType.MoscowMule))
|
||||
{
|
||||
var center = Player.Center;
|
||||
if (proj.IsMinionOrSentryRelated)
|
||||
@@ -255,10 +257,16 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
proj.damage = (int)(proj.damage * (moscowMule ? 0.8f : 1f) * (bloodyMary ? 0.75f : 1f));
|
||||
}
|
||||
|
||||
}
|
||||
if (ivDripPlayer.HasAlcohol(AlcoholType.MoscowMule) || ivDripPlayer.HasAlcohol(AlcoholType.BloodyMary))
|
||||
{
|
||||
if (!(PierceResistNPC.exemptProjectiles.Contains(proj.type) || (PierceResistNPC.singleHitboxExemptProjectiles.ContainsKey(proj.type) && PierceResistNPC.singleHitboxExemptProjectiles[proj.type])))
|
||||
{
|
||||
proj.damage = (int)(proj.damage * (ivDripPlayer.HasAlcohol(AlcoholType.MoscowMule) ? 0.8f : 1f) * (ivDripPlayer.HasAlcohol(AlcoholType.BloodyMary) ? 0.75f : 1f));
|
||||
}
|
||||
}
|
||||
|
||||
if (witheringWeaponEnchant)
|
||||
if (witheringWeaponEnchant)
|
||||
witheringDamageDone += (int)(damageDone * (hit.Crit ? 2D : 1D));
|
||||
cgn.TypelessDebuffMultiplier = TypelessDebuffMultiplier;
|
||||
cgn.HeatDebuffMultiplier = HeatDebuffMultiplier;
|
||||
@@ -1002,7 +1010,7 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
if (xerocSet && xerocDmg <= 0 && Player.ownedProjectileCounts[ProjectileType<EmpyreanEmber>()] < 3 && Player.ownedProjectileCounts[ProjectileType<EmpyreanBlast>()] < 3)
|
||||
{
|
||||
switch (Main.rand.Next(5))
|
||||
switch (Main.rand.Next(4))
|
||||
{
|
||||
case 0:
|
||||
// Exodus Rogue Stars: 80%
|
||||
@@ -1030,13 +1038,6 @@ namespace CalamityMod.CalPlayer
|
||||
Projectile.NewProjectile(spawnSource, proj.Center, Vector2.Zero, ProjectileType<EmpyreanBlast>(), blastDamage, 0f, proj.owner, 0f, 0f);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
// Exodus Rogue Bubble: 60%
|
||||
int bubbleDamage = (int)(proj.damage * 0.6f);
|
||||
CalamityUtils.SpawnOrb(proj, bubbleDamage, ProjectileType<EmpyreanGlob>(), 800f, 15f);
|
||||
xerocDmg += (int)(bubbleDamage * 0.5);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -10,6 +12,7 @@ namespace CalamityMod.DataStructures
|
||||
[ReinitializeDuringResizeArrays]
|
||||
public static class BuffDatasets
|
||||
{
|
||||
private static DebuffData Alch(int level) => new DebuffData() { AlcoholLevel = level };
|
||||
public static DebuffData[] DebuffDataset = BuffID.Sets.Factory.CreateNamedSet("DebuffData")
|
||||
.Description("Stores DebuffData for a particular debuff")
|
||||
.RegisterCustomSet<DebuffData>(null,
|
||||
@@ -24,8 +27,69 @@ namespace CalamityMod.DataStructures
|
||||
BuffID.Poisoned, DebuffData.Poisoned,
|
||||
BuffID.Venom, DebuffData.AcidVenom,
|
||||
BuffID.Electrified, DebuffData.Electrified,
|
||||
BuffID.Oiled, DebuffData.Oiled
|
||||
BuffID.Oiled, DebuffData.Oiled,
|
||||
|
||||
BuffID.Tipsy, Alch(1),
|
||||
ModContent.BuffType<BloodyMaryBuff>(), Alch(1),
|
||||
ModContent.BuffType<CaribbeanRumBuff>(), Alch(1),
|
||||
ModContent.BuffType<CinnamonRollBuff>(), Alch(1),
|
||||
ModContent.BuffType<EvergreenGinBuff>(), Alch(1),
|
||||
ModContent.BuffType<FireballBuff>(), Alch(1),
|
||||
ModContent.BuffType<GrapeBeerBuff>(), Alch(1),
|
||||
ModContent.BuffType<ManhattanBuff>(), Alch(1),
|
||||
ModContent.BuffType<MargaritaBuff>(), Alch(1),
|
||||
ModContent.BuffType<MoonshineBuff>(), Alch(1),
|
||||
ModContent.BuffType<MoscowMuleBuff>(), Alch(1),
|
||||
ModContent.BuffType<OldFashionedBuff>(), Alch(1),
|
||||
ModContent.BuffType<PurpleHazeBuff>(), Alch(1),
|
||||
ModContent.BuffType<RedWineBuff>(), Alch(1),
|
||||
ModContent.BuffType<RumBuff>(), Alch(1),
|
||||
ModContent.BuffType<ScrewdriverBuff>(), Alch(1),
|
||||
ModContent.BuffType<StarBeamRyeBuff>(), Alch(1),
|
||||
ModContent.BuffType<TequilaBuff>(), Alch(1),
|
||||
ModContent.BuffType<TequilaSunriseBuff>(), Alch(1),
|
||||
ModContent.BuffType<VodkaBuff>(), Alch(1),
|
||||
ModContent.BuffType<WhiskeyBuff>(), Alch(1),
|
||||
ModContent.BuffType<WhiteWineBuff>(), Alch(1),
|
||||
|
||||
ModContent.BuffType<EverclearBuff>(), Alch(2),
|
||||
ModContent.BuffType<BaconOilBuff>(), Alch(3)
|
||||
);
|
||||
public static int GetBuffIDFromAlcoholType(AlcoholType type)
|
||||
{
|
||||
return type switch
|
||||
{
|
||||
AlcoholType.BaconOil => ModContent.BuffType<BaconOilBuff>(),
|
||||
AlcoholType.BloodyMary => ModContent.BuffType<BloodyMaryBuff>(),
|
||||
AlcoholType.CaribbeanRum => ModContent.BuffType<CaribbeanRumBuff>(),
|
||||
AlcoholType.CinnamonRoll => ModContent.BuffType<CinnamonRollBuff>(),
|
||||
AlcoholType.Everclear => ModContent.BuffType<EverclearBuff>(),
|
||||
AlcoholType.EvergreenGin => ModContent.BuffType<EvergreenGinBuff>(),
|
||||
AlcoholType.Fireball => ModContent.BuffType<FireballBuff>(),
|
||||
AlcoholType.GrapeBeer => ModContent.BuffType<GrapeBeerBuff>(),
|
||||
AlcoholType.Manhattan => ModContent.BuffType<ManhattanBuff>(),
|
||||
AlcoholType.Margarita => ModContent.BuffType<MargaritaBuff>(),
|
||||
AlcoholType.Moonshine => ModContent.BuffType<MoonshineBuff>(),
|
||||
AlcoholType.MoscowMule => ModContent.BuffType<MoscowMuleBuff>(),
|
||||
AlcoholType.OldFashioned => ModContent.BuffType<OldFashionedBuff>(),
|
||||
AlcoholType.PurpleHaze => ModContent.BuffType<PurpleHazeBuff>(),
|
||||
AlcoholType.RedWine => ModContent.BuffType<RedWineBuff>(),
|
||||
AlcoholType.Rum => ModContent.BuffType<RumBuff>(),
|
||||
AlcoholType.Screwdriver => ModContent.BuffType<ScrewdriverBuff>(),
|
||||
AlcoholType.StarBeamRye => ModContent.BuffType<StarBeamRyeBuff>(),
|
||||
AlcoholType.Tequila => ModContent.BuffType<TequilaBuff>(),
|
||||
AlcoholType.TequilaSunrise => ModContent.BuffType<TequilaSunriseBuff>(),
|
||||
AlcoholType.Vodka => ModContent.BuffType<VodkaBuff>(),
|
||||
AlcoholType.Whiskey => ModContent.BuffType<WhiskeyBuff>(),
|
||||
AlcoholType.WhiteWine => ModContent.BuffType<WhiteWineBuff>(),
|
||||
|
||||
// Vanilla treats both Ale and Sake as the "Tipsy" buff
|
||||
AlcoholType.Ale => BuffID.Tipsy,
|
||||
AlcoholType.Sake => BuffID.Tipsy,
|
||||
|
||||
_ => -1
|
||||
};
|
||||
}
|
||||
}
|
||||
public class DebuffData
|
||||
{
|
||||
@@ -113,11 +177,10 @@ namespace CalamityMod.DataStructures
|
||||
public bool GearCanModifyDebuff = true;
|
||||
|
||||
/// <summary>
|
||||
/// UNIMPLEMENTED. WILL BE DONE IN A FUTURE PR
|
||||
/// How much alcohol this counts as.
|
||||
/// Default is 0, most alcohol is 1, and Everclear is 2
|
||||
/// </summary>
|
||||
public float AlcoholLevel = 0f;
|
||||
public int AlcoholLevel = 0;
|
||||
|
||||
/// <summary>
|
||||
/// UNIMPLEMENTED. WILL BE DONE IN A FUTURE PR
|
||||
|
||||
|
After Width: | Height: | Size: 155 B |
|
After Width: | Height: | Size: 203 B |
|
After Width: | Height: | Size: 163 B |
|
After Width: | Height: | Size: 152 B |
@@ -774,5 +774,81 @@ namespace CalamityMod.ILEditing
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Tweak Pygmy Staff Aggro Distance Logic
|
||||
// Code written by Habble
|
||||
private static void PygmyAggroOnClosestPointInHitbox(ILContext context)
|
||||
{
|
||||
// Adjust Pygmy Staff's attack distance logic to be measured from the closest point to the enemy instead of the enemy's center.
|
||||
ILCursor cursor = new(context);
|
||||
|
||||
// Go to the latest newly set variable near the point we wanna be, as that is an easy unique instruction to jump to. 131 is the number assigned to that local variable.
|
||||
if (!cursor.TryGotoNext(i => i.MatchStloc(131)))
|
||||
{
|
||||
LogFailure("Tweaking Pygmy Staff aggro distance logic", "Could not locate unique Stloc(131) instruction nearest to aggro distance check.");
|
||||
return;
|
||||
}
|
||||
// Move before the minion range variable emission so as to receive the value being targetted at it.
|
||||
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdloc(126)))
|
||||
{
|
||||
LogFailure("Tweaking Pygmy Staff aggro distance logic", "Could not locate the minion range variable.");
|
||||
return;
|
||||
}
|
||||
cursor.Emit(OpCodes.Ldarg_0); // Emits the Projectile entity itself
|
||||
cursor.Emit(OpCodes.Ldloc, 129); // Emits the NPC index via the incremented loop variable
|
||||
cursor.Emit(OpCodes.Ldloc, 6); // Emits the bool containing type check for Pygmies
|
||||
// Replace the distance with a different value calculated off of closest point in hitboxes
|
||||
cursor.EmitDelegate((float distance, Projectile projectile, int npcIndex, bool pygmy) =>
|
||||
{
|
||||
if (!pygmy)
|
||||
return distance;
|
||||
|
||||
NPC npc = Main.npc[npcIndex];
|
||||
Player player = Main.player[projectile.owner];
|
||||
float finalDistance = npc.Hitbox.ClosestPointInRect(player.Center).Distance(player.Hitbox.ClosestPointInRect(npc.Center));
|
||||
return finalDistance;
|
||||
});
|
||||
|
||||
// That was part 1, time for part 2.
|
||||
// Go directly before the instruction that's meant to receive the distance value of this tagged NPC.
|
||||
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchStloc(185)))
|
||||
{
|
||||
LogFailure("Tweaking Pygmy Staff aggro distance logic", "Could not locate first unique Stloc(185) instruction.");
|
||||
return;
|
||||
}
|
||||
cursor.Emit(OpCodes.Ldarg_0);
|
||||
cursor.Emit(OpCodes.Ldloc, 181); // Emits the tagged NPC
|
||||
cursor.Emit(OpCodes.Ldloc, 6);
|
||||
// Replace the distance with a different value calculated off of closest point in hitboxes
|
||||
cursor.EmitDelegate((float distance, Projectile projectile, NPC npc, bool pygmy) =>
|
||||
{
|
||||
if (!pygmy)
|
||||
return distance;
|
||||
|
||||
float finalDistance = npc.Hitbox.ClosestPointInRect(projectile.Center).Distance(projectile.Hitbox.ClosestPointInRect(npc.Center));
|
||||
return finalDistance;
|
||||
});
|
||||
|
||||
// Go directly before the instruction that's meant to receive the distance value of this NPC currently being iterated over.
|
||||
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchStloc(189)))
|
||||
{
|
||||
LogFailure("Tweaking Pygmy Staff aggro distance logic", "Could not locate first unique Stloc(189) instruction.");
|
||||
return;
|
||||
}
|
||||
cursor.Emit(OpCodes.Ldarg_0);
|
||||
cursor.Emit(OpCodes.Ldloc, 186); // Emits the NPC index via the incremented loop variable
|
||||
cursor.Emit(OpCodes.Ldloc, 6);
|
||||
// Replace the distance with a different value calculated off of closest point in hitboxes
|
||||
cursor.EmitDelegate((float distance, Projectile projectile, int npcIndex, bool pygmy) =>
|
||||
{
|
||||
if (!pygmy)
|
||||
return distance;
|
||||
|
||||
NPC npc = Main.npc[npcIndex];
|
||||
float finalDistance = npc.Hitbox.ClosestPointInRect(projectile.Center).Distance(projectile.Hitbox.ClosestPointInRect(npc.Center));
|
||||
return finalDistance;
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -105,6 +105,7 @@ namespace CalamityMod.ILEditing
|
||||
On_Main.DamageVar_float_int_float += AdjustDamageVariance;
|
||||
IL_NPC.ScaleStats_ApplyExpertTweaks += RemoveExpertHardmodeScaling;
|
||||
IL_Projectile.Damage += VanillaBossResistChanges;
|
||||
IL_Projectile.AI_026 += PygmyAggroOnClosestPointInHitbox;
|
||||
IL_Projectile.AI_099_2 += LimitTerrarianProjectiles;
|
||||
On_Projectile.AI_015_Flails += FlailsNoLongerAffectedByPlayerVelocity;
|
||||
IL_Projectile.AI_015_Flails += IncreaseFlowerPowRetSpeed;
|
||||
|
||||
@@ -563,6 +563,8 @@ namespace CalamityMod.ILEditing
|
||||
{
|
||||
if (self.Calamity().oldFashioned)
|
||||
damage = (int)(damage * OldFashioned.DamageBoostMultiplier);
|
||||
if (self.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.OldFashioned))
|
||||
damage = (int)(damage * OldFashioned.DamageBoostMultiplier);
|
||||
orig(self, npc, damage, knockback, direction, crit, damageType, damageVariation);
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace CalamityMod.Items.Accessories
|
||||
CreateRecipe().
|
||||
AddIngredient<SilencingSheath>().
|
||||
AddIngredient<RuinMedallion>().
|
||||
AddIngredient<MeldConstruct>(5).
|
||||
AddIngredient<MeldBlob>(14). //Consistent with Vanilla lunar wing costs
|
||||
AddTile(TileID.LunarCraftingStation).
|
||||
Register();
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace CalamityMod.Items.Accessories
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.dOfTheDeep = true;
|
||||
modPlayer.dOfTheDeepVisual = !hideVisual;
|
||||
modPlayer.WaterDebuffMultiplier += 0.75f;
|
||||
modPlayer.WaterDebuffMultiplier += 0.6f;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
|
||||
@@ -1,21 +1,68 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
using CalamityMod.Rarities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.UI;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public enum AlcoholType
|
||||
{
|
||||
None,
|
||||
BaconOil,
|
||||
BloodyMary,
|
||||
CaribbeanRum,
|
||||
CinnamonRoll,
|
||||
Everclear,
|
||||
EvergreenGin,
|
||||
Fireball,
|
||||
GrapeBeer,
|
||||
Manhattan,
|
||||
Margarita,
|
||||
Moonshine,
|
||||
MoscowMule,
|
||||
OldFashioned,
|
||||
PurpleHaze,
|
||||
RedWine,
|
||||
Rum,
|
||||
Screwdriver,
|
||||
StarBeamRye,
|
||||
Tequila,
|
||||
TequilaSunrise,
|
||||
Vodka,
|
||||
Whiskey,
|
||||
WhiteWine,
|
||||
Ale,
|
||||
Sake,
|
||||
}
|
||||
|
||||
public interface IAlcoholItem
|
||||
{
|
||||
Action<Player, float> IVDripAlcoholEffect { get; }
|
||||
AlcoholType AlcoholVariant { get; }
|
||||
LocalizedText DripEffectText { get; }
|
||||
}
|
||||
|
||||
public class IVDripOnTheRocks : ModItem, ILocalizedModType
|
||||
{
|
||||
public int containedAlcoholID = -1;
|
||||
public AlcoholType currentAlcoholType = AlcoholType.None;
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
public static readonly float DamageBoostMultiplier = 1.25f; // Same as Old Fashioned but can be changed at any time
|
||||
public static readonly float DamageReductionMultiplier = 0.75f; // Same as Old Fashioned but can be changed at any time
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((DamageBoostMultiplier).ToString("N2"), (DamageReductionMultiplier).ToString("N2")); public override void SetDefaults()
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.RegisterItemAnimation(Item.type, new Terraria.DataStructures.DrawAnimationVertical(1, 26));
|
||||
ItemID.Sets.AnimatesAsSoul[Item.type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 58;
|
||||
Item.height = 60;
|
||||
@@ -24,19 +71,216 @@ namespace CalamityMod.Items.Accessories
|
||||
Item.accessory = true;
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
public override void Load()
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.ivDrip = true;
|
||||
On_ItemSlot.OverrideLeftClick += IvDripAlcoholEquip;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
public override void Unload()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<OldFashioned>().
|
||||
AddIngredient<LivingShard>(6).
|
||||
AddTile(TileID.MythrilAnvil).
|
||||
Register();
|
||||
On_ItemSlot.OverrideLeftClick -= IvDripAlcoholEquip;
|
||||
}
|
||||
|
||||
private bool IvDripAlcoholEquip(On_ItemSlot.orig_OverrideLeftClick orig, Item[] inv, int context, int slot)
|
||||
{
|
||||
if (context == ItemSlot.Context.InventoryItem || context == ItemSlot.Context.ChestItem)
|
||||
{
|
||||
Item mouseItem = Main.mouseItem;
|
||||
Item targetItem = inv[slot];
|
||||
|
||||
// Vanilla alcohols have to be applied manually
|
||||
bool isMouseAle = mouseItem.type == ItemID.Ale;
|
||||
bool isTargetAle = targetItem.type == ItemID.Ale;
|
||||
bool isMouseSake = mouseItem.type == ItemID.Sake;
|
||||
bool isTargetSake = targetItem.type == ItemID.Sake;
|
||||
|
||||
// Alcohol into this acc
|
||||
if (targetItem.ModItem is IVDripOnTheRocks drip && (mouseItem.ModItem is IAlcoholItem || isMouseAle || isMouseSake))
|
||||
{
|
||||
if (drip.containedAlcoholID == -1)
|
||||
{
|
||||
drip.containedAlcoholID = mouseItem.type;
|
||||
drip.currentAlcoholType = isMouseAle ? AlcoholType.Ale : (isMouseSake ? AlcoholType.Sake : (mouseItem.ModItem as IAlcoholItem).AlcoholVariant);
|
||||
|
||||
mouseItem.stack--;
|
||||
if (mouseItem.stack <= 0)
|
||||
mouseItem.TurnToAir();
|
||||
|
||||
SoundEngine.PlaySound(SoundID.Grab);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (mouseItem.ModItem is IVDripOnTheRocks dripHeld && (targetItem.ModItem is IAlcoholItem || isTargetAle || isTargetSake))
|
||||
{
|
||||
if (dripHeld.containedAlcoholID == -1)
|
||||
{
|
||||
dripHeld.containedAlcoholID = targetItem.type;
|
||||
dripHeld.currentAlcoholType = isTargetAle ? AlcoholType.Ale : (isTargetSake ? AlcoholType.Sake : (targetItem.ModItem as IAlcoholItem).AlcoholVariant);
|
||||
|
||||
targetItem.stack--;
|
||||
if (targetItem.stack <= 0)
|
||||
targetItem.TurnToAir();
|
||||
|
||||
SoundEngine.PlaySound(SoundID.Grab);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return orig(inv, context, slot);
|
||||
}
|
||||
|
||||
#region Shift-Right Click to Empty IV Drip
|
||||
|
||||
// Allow shift-right clicking only if the IV drip actually contains alcohol
|
||||
public override bool CanRightClick() => containedAlcoholID != -1 && Main.keyState.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.LeftShift);
|
||||
|
||||
public override void RightClick(Player player)
|
||||
{
|
||||
if (containedAlcoholID != -1)
|
||||
{
|
||||
// Give the alcohol back to the player
|
||||
player.QuickSpawnItem(player.GetSource_ItemUse(Item), containedAlcoholID);
|
||||
|
||||
containedAlcoholID = -1;
|
||||
currentAlcoholType = AlcoholType.None;
|
||||
|
||||
Item.stack++;
|
||||
|
||||
SoundEngine.PlaySound(SoundID.Grab);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
public override void PreReforge()
|
||||
{
|
||||
if (containedAlcoholID != -1)
|
||||
{
|
||||
// Refund the alcohol to the player.
|
||||
Main.LocalPlayer.QuickSpawnItem(Main.LocalPlayer.GetSource_ItemUse(Item), containedAlcoholID);
|
||||
|
||||
containedAlcoholID = -1;
|
||||
currentAlcoholType = AlcoholType.None;
|
||||
}
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
IVDripPlayer dripPlayer = player.GetModPlayer<IVDripPlayer>();
|
||||
dripPlayer.ivDripEquipped = true;
|
||||
|
||||
if (containedAlcoholID != -1)
|
||||
{
|
||||
dripPlayer.currentAlcohol = currentAlcoholType;
|
||||
|
||||
Item alcoholItem = new Item(containedAlcoholID);
|
||||
if (alcoholItem.ModItem is IAlcoholItem alcohol)
|
||||
dripPlayer.ApplyIVDripAlcoholEffect(alcohol.IVDripAlcoholEffect);
|
||||
}
|
||||
}
|
||||
|
||||
public override void ModifyTooltips(List<TooltipLine> tooltips)
|
||||
{
|
||||
if (tooltips == null) return;
|
||||
|
||||
var effectLine = tooltips.FirstOrDefault(x => x.Text.Contains("[EFFECT]"));
|
||||
var nameLine = tooltips.FirstOrDefault(x => x.Text.Contains("[NAME]"));
|
||||
|
||||
if (containedAlcoholID == -1)
|
||||
{
|
||||
if (effectLine != null)
|
||||
{
|
||||
effectLine.Text = this.GetLocalizedValue("Empty");
|
||||
}
|
||||
nameLine?.Hide();
|
||||
return;
|
||||
}
|
||||
|
||||
if (effectLine != null)
|
||||
{
|
||||
if (containedAlcoholID == ItemID.Ale || containedAlcoholID == ItemID.Sake)
|
||||
effectLine.Text = this.GetLocalizedValue("SakeAndAleText");
|
||||
|
||||
else
|
||||
{
|
||||
Item alcoholItem = new Item(containedAlcoholID);
|
||||
if (alcoholItem.ModItem is IAlcoholItem alcohol)
|
||||
effectLine.Text = alcohol.DripEffectText.Value;
|
||||
}
|
||||
}
|
||||
|
||||
if (nameLine != null)
|
||||
{
|
||||
string alcoholName = Lang.GetItemNameValue(containedAlcoholID);
|
||||
nameLine.Text = this.GetLocalizedValue("CurrentAlcoholText") + $" [c/FF81E4:{alcoholName}]";
|
||||
}
|
||||
}
|
||||
|
||||
// Draw the correct alcohol variant frame
|
||||
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
|
||||
{
|
||||
Texture2D texture = TextureAssets.Item[Item.type].Value;
|
||||
|
||||
int frameHeight = texture.Height / 26;
|
||||
int frameIndex = (int)currentAlcoholType;
|
||||
|
||||
Rectangle targetFrame = new Rectangle(0, frameIndex * frameHeight, texture.Width, frameHeight);
|
||||
|
||||
spriteBatch.Draw(texture, position, targetFrame, drawColor, 0f, origin, scale, SpriteEffects.None, 0f);
|
||||
return false;
|
||||
}
|
||||
public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
|
||||
{
|
||||
Texture2D texture = TextureAssets.Item[Item.type].Value;
|
||||
|
||||
int frameHeight = texture.Height / 26;
|
||||
int frameIndex = (int)currentAlcoholType;
|
||||
|
||||
Rectangle targetFrame = new Rectangle(0, frameIndex * frameHeight, texture.Width, frameHeight);
|
||||
|
||||
Vector2 drawPosition = Item.position - Main.screenPosition + new Vector2(Item.width / 2, Item.height - frameHeight / 2);
|
||||
Vector2 origin = targetFrame.Size() / 2f;
|
||||
|
||||
spriteBatch.Draw(texture, drawPosition, targetFrame, lightColor, rotation, origin, scale, SpriteEffects.None, 0f);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public class IVDripPlayer : ModPlayer
|
||||
{
|
||||
public Dictionary<Action<Player, float>, float> IVDripAlcoholEffects = 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()
|
||||
{
|
||||
IVDripAlcoholEffects.Clear();
|
||||
ivDripEquipped = false;
|
||||
currentAlcohol = AlcoholType.None;
|
||||
}
|
||||
|
||||
public void ApplyIVDripAlcoholEffect(Action<Player, float> effect)
|
||||
{
|
||||
if (effect == null)
|
||||
return;
|
||||
|
||||
if (IVDripAlcoholEffects.ContainsKey(effect))
|
||||
IVDripAlcoholEffects[effect] += 1f;
|
||||
else
|
||||
IVDripAlcoholEffects[effect] = 1f;
|
||||
}
|
||||
|
||||
public override void PostUpdateEquips()
|
||||
{
|
||||
foreach (var effect in IVDripAlcoholEffects)
|
||||
{
|
||||
effect.Key.Invoke(Player, effect.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 540 B |
@@ -46,7 +46,7 @@ namespace CalamityMod.Items.Accessories
|
||||
AddIngredient<Baroclaw>().
|
||||
AddIngredient<GiantTortoiseShell>().
|
||||
AddIngredient<MolluskHusk>(5).
|
||||
AddIngredient<MeldConstruct>(6).
|
||||
AddIngredient<MeldBlob>(14). //Consistent with Vanilla lunar wing costs
|
||||
AddTile(TileID.LunarCraftingStation).
|
||||
Register();
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace CalamityMod.Items.Accessories.Wings
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient(ItemID.SoulofFlight, 20).
|
||||
AddIngredient<MeldConstruct>(14).
|
||||
AddIngredient<MeldBlob>(14).
|
||||
AddIngredient(ItemID.LunarBar, 10).
|
||||
AddTile(TileID.LunarCraftingStation).
|
||||
Register();
|
||||
|
||||
|
Before Width: | Height: | Size: 485 B After Width: | Height: | Size: 643 B |
@@ -53,7 +53,7 @@ namespace CalamityMod.Items.Armor.Empyrean
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<MeldConstruct>(20).
|
||||
AddIngredient<MeldBlob>(20).
|
||||
AddIngredient(ItemID.LunarBar, 16).
|
||||
AddTile(TileID.LunarCraftingStation).
|
||||
Register();
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace CalamityMod.Items.Armor.Empyrean
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<MeldConstruct>(15).
|
||||
AddIngredient<MeldBlob>(15).
|
||||
AddIngredient(ItemID.LunarBar, 12).
|
||||
AddTile(TileID.LunarCraftingStation).
|
||||
Register();
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace CalamityMod.Items.Armor.Empyrean
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<MeldConstruct>(10).
|
||||
AddIngredient<MeldBlob>(10).
|
||||
AddIngredient(ItemID.LunarBar, 8).
|
||||
AddTile(TileID.LunarCraftingStation).
|
||||
SortBeforeFirstRecipesOf(ModContent.ItemType<EmpyreanCloak>()).
|
||||
|
||||
|
Before Width: | Height: | Size: 488 B |
|
Before Width: | Height: | Size: 393 B |
@@ -884,8 +884,10 @@ namespace CalamityMod.Items
|
||||
// This assume all items with a damage hit is a weapon. There appears to be no edge cases for this thus far
|
||||
if (player.Calamity().oldFashioned)
|
||||
modifiers.SourceDamage *= OldFashioned.DamageReductionMultiplier;
|
||||
if (player.Calamity().ivDrip)
|
||||
modifiers.SourceDamage *= IVDripOnTheRocks.DamageReductionMultiplier;
|
||||
|
||||
var dripPlayer = player.GetModPlayer<IVDripPlayer>();
|
||||
if (dripPlayer.HasAlcohol(AlcoholType.OldFashioned))
|
||||
modifiers.SourceDamage *= OldFashioned.DamageReductionMultiplier;
|
||||
}
|
||||
|
||||
public override void OnHitNPC(Item item, Player player, NPC target, NPC.HitInfo hit, int damageDone)
|
||||
@@ -937,6 +939,8 @@ namespace CalamityMod.Items
|
||||
// Xyk 3MARCH2026: Doesn't work on any non use style 1 items currently, Doze will fix it
|
||||
if (item.CountsAsClass<MeleeDamageClass>() && player.HasBuff(BuffID.Tipsy))
|
||||
scale += 0.15f;
|
||||
if (item.CountsAsClass<MeleeDamageClass>() && (player.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.Ale) || player.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.Sake)))
|
||||
scale += 0.15f;
|
||||
}
|
||||
public override void UpdateArmorSet(Player player, string set)
|
||||
{
|
||||
|
||||
@@ -1497,6 +1497,18 @@ namespace CalamityMod.Items
|
||||
#region Enchanted Rarity Text Drawing
|
||||
public override bool PreDrawTooltipLine(Item item, DrawableTooltipLine line, ref int yOffset)
|
||||
{
|
||||
if (line.Mod == "Terraria" && item.type == ModContent.ItemType<ElephantKiller>() && CalamityClientConfig.Instance.TextEffects && line.Name == "Damage")
|
||||
{
|
||||
string fakeLine = line.Text.Replace(" " + RogueDamageClass.Instance.DisplayName.ToString(), DamageClass.Ranged.DisplayName.ToString());
|
||||
float fade = Utils.GetLerpValue(18, 120, Main.LocalPlayer.Calamity().elephantKillerJoke, true);
|
||||
|
||||
ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, line.Font, fakeLine, new Vector2(line.X, line.Y), line.Color * (1 - fade), line.Rotation, line.Origin, line.BaseScale, line.MaxWidth, line.Spread);
|
||||
ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, line.Font, line.Text, new Vector2(line.X, line.Y), line.Color * fade, line.Rotation, line.Origin, line.BaseScale, line.MaxWidth, line.Spread);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (line.Name == "ItemName" && line.Mod == "Terraria" && item.type == ModContent.ItemType<XyksBlessingBlue>() && CalamityClientConfig.Instance.TextEffects)
|
||||
{
|
||||
Color rarityColor = Color.White;
|
||||
|
||||
@@ -197,7 +197,7 @@ namespace CalamityMod.Items
|
||||
{ ItemID.PurpleClubberfish, Do(UseTurn, KnockbackExact(10f)) }, // VANILLA: 8 KB
|
||||
{ ItemID.PurplePhaseblade, phaseblade },
|
||||
{ ItemID.PurplePhasesaber, phasesaber },
|
||||
{ ItemID.PygmyStaff, Do(DamageExact(63)) }, // VANILLA: 40 DMG
|
||||
{ ItemID.PygmyStaff, Do(DamageExact(60)) }, // VANILLA: 40 DMG
|
||||
{ ItemID.RainbowGun, Do(DamageExact(60)) }, // VANILLA: 45 DMG
|
||||
{ ItemID.RainbowRod, Do(DamageExact(40), KnockbackExact(8f)) }, // VANILLA: 50 DMG, 6 KB
|
||||
{ ItemID.Rally, Do(DamageExact(18)) }, // VANILLA: 14 DMG
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Fishing.FishingRods
|
||||
{
|
||||
public class TrustyOldRod : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Fishing";
|
||||
public static (int, int) enemyChance = (1, 3); // x/x Chance to pull up enemies
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 70;
|
||||
Item.height = 70;
|
||||
Item.useAnimation = 8;
|
||||
Item.useTime = 8;
|
||||
Item.useStyle = ItemUseStyleID.Swing;
|
||||
Item.UseSound = SoundID.Item1;
|
||||
Item.fishingPole = 45;
|
||||
Item.shootSpeed = 14f;
|
||||
Item.shoot = ModContent.ProjectileType<TrustyOldBobber>();
|
||||
Item.rare = ItemRarityID.Green;
|
||||
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
|
||||
}
|
||||
public override void ModifyFishingLine(Projectile bobber, ref Vector2 lineOriginOffset, ref Color lineColor)
|
||||
{
|
||||
lineOriginOffset = new Vector2(68f, -52f);
|
||||
lineColor = new Color(171, 171, 171, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,32 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Fishing
|
||||
{
|
||||
public class RageBait : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Fishing";
|
||||
public static (int, int) junkChance = (2, 3); // x/x Chance to turn items to junk
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 5;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 12;
|
||||
Item.height = 12;
|
||||
Item.maxStack = Item.CommonMaxStack;
|
||||
Item.rare = ItemRarityID.Blue;
|
||||
Item.value = Item.sellPrice(copper: 1);
|
||||
Item.bait = 100;
|
||||
Item.consumable = true;
|
||||
}
|
||||
|
||||
public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
|
||||
{
|
||||
itemGroup = ContentSamples.CreativeHelper.ItemGroup.FishingBait;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 529 B |
@@ -7,18 +7,26 @@ namespace CalamityMod.Items.Materials
|
||||
public class MeldBlob : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Materials";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 100;
|
||||
Item.ResearchUnlockCount = 25;
|
||||
ItemID.Sets.ItemIconPulse[Type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 16;
|
||||
Item.height = 14;
|
||||
Item.width = 24;
|
||||
Item.height = 22;
|
||||
Item.maxStack = Item.CommonMaxStack;
|
||||
Item.value = Item.sellPrice(silver: 20);
|
||||
Item.rare = ItemRarityID.Red;
|
||||
Item.rare = ItemRarityID.Cyan;
|
||||
ItemID.Sets.ItemNoGravity[Type] = true;
|
||||
}
|
||||
public override void Update(ref float gravity, ref float maxFallSpeed)
|
||||
{
|
||||
float brightness = Main.essScale * Main.rand.NextFloat(0.9f, 1.1f);
|
||||
Lighting.AddLight(Item.Center, 0.5f * brightness, 0.5f * brightness, 0.5f * brightness);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 462 B |
@@ -1,33 +0,0 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Materials
|
||||
{
|
||||
[LegacyName("MeldiateBar")]
|
||||
public class MeldConstruct : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Materials";
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 25;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 15;
|
||||
Item.height = 12;
|
||||
Item.maxStack = Item.CommonMaxStack;
|
||||
Item.value = Item.sellPrice(silver: 42);
|
||||
Item.rare = ItemRarityID.Red;
|
||||
}
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(3).
|
||||
AddIngredient<MeldBlob>(6).
|
||||
AddIngredient<StarblightSoot>(3).
|
||||
AddTile(TileID.LunarCraftingStation).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.0 KiB |
@@ -63,7 +63,6 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings
|
||||
"CrabBar",
|
||||
"Critaquil",
|
||||
"Dandy",
|
||||
"Dia",
|
||||
"Done",
|
||||
"dozezoze",
|
||||
"Flowaria",
|
||||
@@ -74,7 +73,6 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings
|
||||
"LordMetarex",
|
||||
"Moonburn",
|
||||
"Ozzatron",
|
||||
"Piky",
|
||||
"PokerFace",
|
||||
"Raesh",
|
||||
"Sagittariod",
|
||||
@@ -109,6 +107,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings
|
||||
"Daim",
|
||||
"DarkTiny",
|
||||
"Demik",
|
||||
"Dia",
|
||||
"DM Dokuro",
|
||||
"Doog",
|
||||
"drh",
|
||||
@@ -165,6 +164,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings
|
||||
"Pbtopacio",
|
||||
"Phantasmal Deathray",
|
||||
"Phupperbat",
|
||||
"Piky",
|
||||
"Pinkie Poss",
|
||||
"Poly",
|
||||
"Popo",
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.Tiles.Furniture;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Placeables.Furniture
|
||||
{
|
||||
public class TheMonument : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Placeables";
|
||||
|
||||
public const float MonumentTaxIncrease = 0.5f;
|
||||
public const float MonumentHappinessReduction = 0.15f;
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.DefaultToPlaceableTile(ModContent.TileType<TheMonumentTile>());
|
||||
Item.width = 40;
|
||||
Item.height = 50;
|
||||
Item.rare = ItemRarityID.Pink;
|
||||
Item.value = Item.buyPrice(gold: 5);
|
||||
}
|
||||
|
||||
public override void Load()
|
||||
{
|
||||
On_Player.CollectTaxes += AddMonumentTaxes;
|
||||
}
|
||||
|
||||
private static void AddMonumentTaxes(On_Player.orig_CollectTaxes orig, Player self)
|
||||
{
|
||||
orig(self);
|
||||
|
||||
foreach (NPC n in Main.ActiveNPCs)
|
||||
{
|
||||
if (!n.homeless && !NPCID.Sets.IsTownPet[n.type] && NPC.TypeToDefaultHeadIndex(n.type) > 0 && n.GetGlobalNPC<CalamityGlobalTownNPC>().AffectedByTheMonument)
|
||||
self.taxMoney += (int)(CalamityGlobalTownNPC.TotalTaxesPerNPC * MonumentTaxIncrease);
|
||||
}
|
||||
if (self.taxMoney > CalamityGlobalTownNPC.TaxesToCollectLimit)
|
||||
self.taxMoney = CalamityGlobalTownNPC.TaxesToCollectLimit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Potions.Alcohol
|
||||
{
|
||||
public class BaconOil : ModItem, ILocalizedModType, IAlcoholItem
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Potions";
|
||||
public LocalizedText DripEffectText => Language.GetText("Mods.CalamityMod.Items.Potions.BaconOil.DripEffect");
|
||||
public AlcoholType AlcoholVariant => AlcoholType.BaconOil;
|
||||
public Action<Player, float> IVDripAlcoholEffect => ApplyBaconOilEffect;
|
||||
|
||||
private static void ApplyBaconOilEffect(Player player, float intensity)
|
||||
{
|
||||
// See CalamityPlayer
|
||||
}
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 20;
|
||||
ItemID.Sets.DrinkParticleColors[Type] = new Color[3] {
|
||||
new Color(204, 90, 73),
|
||||
new Color(168, 37, 37),
|
||||
new Color(120, 28, 28)
|
||||
};
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.DefaultToFood(20, 32, ModContent.BuffType<BaconOilBuff>(), CalamityUtils.MinutesToFrames(6), true);
|
||||
Item.value = Item.sellPrice(silver: 2);
|
||||
Item.rare = ItemRarityID.Blue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 3.2 KiB |
@@ -1,4 +1,6 @@
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using System;
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -8,10 +10,26 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Potions.Alcohol
|
||||
{
|
||||
public class BloodyMary : ModItem, ILocalizedModType
|
||||
public class BloodyMary : ModItem, ILocalizedModType, IAlcoholItem
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Potions";
|
||||
|
||||
public static float PierceDamageMultiplier = 0.66f;
|
||||
public static float SpawnRateGateMultiplier = 0.142f;
|
||||
public static float IVDripAdditionalSpawnRateGateMultiplier = 0.7f;
|
||||
public static float SpawnLimitMultiplier = 5f;
|
||||
public static float IVDripAdditionalSpawnLimitMultiplier = 1.5f;
|
||||
public override LocalizedText Tooltip => base.Tooltip;
|
||||
public LocalizedText DripEffectText => Language.GetText("Mods.CalamityMod.Items.Potions.BloodyMary.DripEffect");
|
||||
public AlcoholType AlcoholVariant => AlcoholType.BloodyMary;
|
||||
|
||||
public Action<Player, float> IVDripAlcoholEffect => ApplyBloodyMaryEffect;
|
||||
|
||||
private static void ApplyBloodyMaryEffect(Player player, float intensity)
|
||||
{
|
||||
// See CalamityPlayerOnHit
|
||||
}
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 20;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using System;
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -8,14 +10,23 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Potions.Alcohol
|
||||
{
|
||||
public class CaribbeanRum : ModItem, ILocalizedModType
|
||||
public class CaribbeanRum : ModItem, ILocalizedModType, IAlcoholItem
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Potions";
|
||||
|
||||
public static float MoveSpeedBoost = 0.25f;
|
||||
public static float GravityMultiplier = 0.5f;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MoveSpeedBoost.ToPercent(), (1-GravityMultiplier).ToPercent());
|
||||
public LocalizedText DripEffectText => Language.GetText("Mods.CalamityMod.Items.Potions.CaribbeanRum.DripEffect").WithFormatArgs(MoveSpeedBoost.ToPercent(), (1 - GravityMultiplier).ToPercent());
|
||||
|
||||
public AlcoholType AlcoholVariant => AlcoholType.CaribbeanRum;
|
||||
|
||||
public Action<Player, float> IVDripAlcoholEffect => ApplyCaribbeanRumEffect;
|
||||
|
||||
private static void ApplyCaribbeanRumEffect(Player player, float intensity)
|
||||
{
|
||||
// See CalamityPlayerMiscEffects
|
||||
}
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 20;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using System;
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables.Ores;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -9,10 +11,19 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Potions.Alcohol
|
||||
{
|
||||
public class CinnamonRoll : ModItem, ILocalizedModType
|
||||
public class CinnamonRoll : ModItem, ILocalizedModType, IAlcoholItem
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Potions";
|
||||
public AlcoholType AlcoholVariant => AlcoholType.CinnamonRoll;
|
||||
|
||||
public override LocalizedText Tooltip => base.Tooltip;
|
||||
public LocalizedText DripEffectText => Language.GetText("Mods.CalamityMod.Items.Potions.CinnamonRoll.DripEffect");
|
||||
public Action<Player, float> IVDripAlcoholEffect => ApplyCinnamonRollEffect;
|
||||
|
||||
private static void ApplyCinnamonRollEffect(Player player, float intensity)
|
||||
{
|
||||
// See CalamityPlayerMiscEffects and CalamityPlayerOnHit
|
||||
}
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 20;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using System;
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -8,7 +10,7 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Potions.Alcohol
|
||||
{
|
||||
public class Everclear : ModItem, ILocalizedModType
|
||||
public class Everclear : ModItem, ILocalizedModType, IAlcoholItem
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Potions";
|
||||
|
||||
@@ -16,7 +18,15 @@ namespace CalamityMod.Items.Potions.Alcohol
|
||||
public static int RegenLoss = 10;
|
||||
public static float DefenseLossPercent = 0.30f;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), RegenLoss.ToRegenPerSecond(), DefenseLossPercent.ToPercent());
|
||||
public LocalizedText DripEffectText => Language.GetText("Mods.CalamityMod.Items.Potions.Everclear.DripEffect").WithFormatArgs(DamageBoost.ToPercent(), RegenLoss.ToRegenPerSecond(), DefenseLossPercent.ToPercent());
|
||||
public AlcoholType AlcoholVariant => AlcoholType.Everclear;
|
||||
|
||||
public Action<Player, float> IVDripAlcoholEffect => ApplyEverclearEffect;
|
||||
|
||||
private static void ApplyEverclearEffect(Player player, float intensity)
|
||||
{
|
||||
// See CalamityPlayerLifeRegen and CalamityPlayerMiscEffects
|
||||
}
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 20;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using System;
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -8,13 +10,25 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Potions.Alcohol
|
||||
{
|
||||
public class EvergreenGin : ModItem, ILocalizedModType
|
||||
public class EvergreenGin : ModItem, ILocalizedModType, IAlcoholItem
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Potions";
|
||||
|
||||
public static float DebuffBoost = 0.5f;
|
||||
public static float DebuffLoss = 0.5f;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((DebuffBoost).ToPercent(), DebuffLoss.ToPercent());
|
||||
public LocalizedText DripEffectText => Language.GetText("Mods.CalamityMod.Items.Potions.EvergreenGin.DripEffect").WithFormatArgs((DebuffBoost).ToPercent(), DebuffLoss.ToPercent());
|
||||
public AlcoholType AlcoholVariant => AlcoholType.EvergreenGin;
|
||||
|
||||
public Action<Player, float> IVDripAlcoholEffect => ApplyEvergreenGinEffect;
|
||||
private static void ApplyEvergreenGinEffect(Player player, float intensity)
|
||||
{
|
||||
var cplayer = player.Calamity();
|
||||
cplayer.SicknessDebuffMultiplier += EvergreenGin.DebuffBoost;
|
||||
cplayer.WaterDebuffMultiplier += EvergreenGin.DebuffBoost;
|
||||
cplayer.ElectricDebuffMultiplier -= EvergreenGin.DebuffLoss;
|
||||
cplayer.HeatDebuffMultiplier -= EvergreenGin.DebuffLoss;
|
||||
}
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using System;
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -8,14 +10,25 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Potions.Alcohol
|
||||
{
|
||||
public class Fireball : ModItem, ILocalizedModType
|
||||
public class Fireball : ModItem, ILocalizedModType, IAlcoholItem
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Potions";
|
||||
|
||||
public static float DebuffBoost = 0.5f;
|
||||
public static float DebuffLoss = 0.5f;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((DebuffBoost).ToPercent(), DebuffLoss.ToPercent());
|
||||
public LocalizedText DripEffectText => Language.GetText("Mods.CalamityMod.Items.Potions.Fireball.DripEffect").WithFormatArgs((DebuffBoost).ToPercent(), DebuffLoss.ToPercent());
|
||||
|
||||
public AlcoholType AlcoholVariant => AlcoholType.Fireball;
|
||||
|
||||
public Action<Player, float> IVDripAlcoholEffect => ApplyFireballEffect;
|
||||
|
||||
private static void ApplyFireballEffect(Player player, float intensity)
|
||||
{
|
||||
var cplayer = player.Calamity();
|
||||
cplayer.HeatDebuffMultiplier += Fireball.DebuffBoost;
|
||||
cplayer.SicknessDebuffMultiplier -= Fireball.DebuffLoss;
|
||||
}
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 20;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using System;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -9,15 +9,24 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Potions.Alcohol
|
||||
{
|
||||
public class GrapeBeer : ModItem, ILocalizedModType
|
||||
public class GrapeBeer : ModItem, ILocalizedModType, IAlcoholItem
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Potions";
|
||||
|
||||
public static float CloseRangeDistance = 80;
|
||||
public static float LongRangeDistance = 1200;
|
||||
public static float CloseRangeDamage = 0.75f;
|
||||
public static float LongRangeDamage = 0.25f;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(LongRangeDamage,LongRangeDistance/16f);
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(LongRangeDamage, LongRangeDistance / 16f);
|
||||
public LocalizedText DripEffectText => Language.GetText("Mods.CalamityMod.Items.Potions.GrapeBeer.DripEffect").WithFormatArgs(LongRangeDamage, LongRangeDistance / 16f);
|
||||
public AlcoholType AlcoholVariant => AlcoholType.GrapeBeer;
|
||||
|
||||
public Action<Player, float> IVDripAlcoholEffect => ApplyGrapeBeerEffect;
|
||||
|
||||
private static void ApplyGrapeBeerEffect(Player player, float intensity)
|
||||
{
|
||||
// See CalamityGlobalProjectile
|
||||
}
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 20;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using System;
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables.Ores;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -9,14 +11,24 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Potions.Alcohol
|
||||
{
|
||||
public class Manhattan : ModItem, ILocalizedModType
|
||||
public class Manhattan : ModItem, ILocalizedModType, IAlcoholItem
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Potions";
|
||||
|
||||
public static float DebuffBoost = 0.5f;
|
||||
public static float DebuffLoss = 0.5f;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((DebuffBoost).ToPercent(), DebuffLoss.ToPercent());
|
||||
public LocalizedText DripEffectText => Language.GetText("Mods.CalamityMod.Items.Potions.Manhattan.DripEffect").WithFormatArgs((DebuffBoost).ToPercent(), DebuffLoss.ToPercent());
|
||||
public AlcoholType AlcoholVariant => AlcoholType.Manhattan;
|
||||
|
||||
public Action<Player, float> IVDripAlcoholEffect => ApplyManhattanEffect;
|
||||
|
||||
private static void ApplyManhattanEffect(Player player, float intensity)
|
||||
{
|
||||
var cplayer = player.Calamity();
|
||||
cplayer.ColdDebuffMultiplier += Manhattan.DebuffBoost;
|
||||
cplayer.WaterDebuffMultiplier -= Manhattan.DebuffLoss;
|
||||
}
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 20;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using System;
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -8,7 +10,7 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Potions.Alcohol
|
||||
{
|
||||
public class Margarita : ModItem, ILocalizedModType
|
||||
public class Margarita : ModItem, ILocalizedModType, IAlcoholItem
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Potions";
|
||||
|
||||
@@ -16,7 +18,22 @@ namespace CalamityMod.Items.Potions.Alcohol
|
||||
public static float DebuffLoss = 0.5f;
|
||||
public static int MinuteDuration = 3;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DebuffLoss.ToPercent());
|
||||
public LocalizedText DripEffectText => Language.GetText("Mods.CalamityMod.Items.Potions.Margarita.DripEffect").WithFormatArgs(DebuffLoss.ToPercent());
|
||||
public AlcoholType AlcoholVariant => AlcoholType.Margarita;
|
||||
|
||||
public Action<Player, float> IVDripAlcoholEffect => ApplyMargaritaEffect;
|
||||
|
||||
private static void ApplyMargaritaEffect(Player player, float intensity)
|
||||
{
|
||||
var cplayer = player.Calamity();
|
||||
cplayer.HeatDebuffMultiplier -= Margarita.DebuffLoss;
|
||||
cplayer.SicknessDebuffMultiplier -= Margarita.DebuffLoss;
|
||||
cplayer.ColdDebuffMultiplier -= Margarita.DebuffLoss;
|
||||
cplayer.WaterDebuffMultiplier -= Margarita.DebuffLoss;
|
||||
cplayer.ElectricDebuffMultiplier -= Margarita.DebuffLoss;
|
||||
cplayer.TypelessDebuffMultiplier -= Margarita.DebuffLoss;
|
||||
// Also see CalamityPlayerMiscEffects
|
||||
}
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 20;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using System;
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -8,13 +10,21 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Potions.Alcohol
|
||||
{
|
||||
public class Moonshine : ModItem, ILocalizedModType
|
||||
public class Moonshine : ModItem, ILocalizedModType, IAlcoholItem
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Potions";
|
||||
|
||||
public static float MaxLifePercentBoost = 0.33f;
|
||||
public static float MaxLifePercentBoost = 0.25f;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxLifePercentBoost.ToPercent());
|
||||
public LocalizedText DripEffectText => Language.GetText("Mods.CalamityMod.Items.Potions.Moonshine.DripEffect").WithFormatArgs(MaxLifePercentBoost.ToPercent());
|
||||
public AlcoholType AlcoholVariant => AlcoholType.Moonshine;
|
||||
|
||||
public Action<Player, float> IVDripAlcoholEffect => ApplyMoonshineEffect;
|
||||
|
||||
private static void ApplyMoonshineEffect(Player player, float intensity)
|
||||
{
|
||||
// See CalamityPlayer and CalamityPlayerHitHurt
|
||||
}
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 20;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using System;
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables.Ores;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -9,13 +11,21 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Potions.Alcohol
|
||||
{
|
||||
public class MoscowMule : ModItem, ILocalizedModType
|
||||
public class MoscowMule : ModItem, ILocalizedModType, IAlcoholItem
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Potions";
|
||||
|
||||
public static float KnockbackBoost = 0.5f;
|
||||
public static float PierceDamageMultiplier = 0.7f;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(KnockbackBoost.ToPercent());
|
||||
public LocalizedText DripEffectText => Language.GetText("Mods.CalamityMod.Items.Potions.MoscowMule.DripEffect").WithFormatArgs(KnockbackBoost.ToPercent());
|
||||
public AlcoholType AlcoholVariant => AlcoholType.MoscowMule;
|
||||
|
||||
public Action<Player, float> IVDripAlcoholEffect => ApplyMoscowMuleEffect;
|
||||
|
||||
private static void ApplyMoscowMuleEffect(Player player, float intensity)
|
||||
{
|
||||
// See CalamityPlayer and CalamityPlayerOnHit
|
||||
}
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 20;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using System;
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -8,14 +10,22 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Potions.Alcohol
|
||||
{
|
||||
public class OldFashioned : ModItem, ILocalizedModType
|
||||
public class OldFashioned : ModItem, ILocalizedModType, IAlcoholItem
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Potions";
|
||||
|
||||
public static readonly float DamageBoostMultiplier = 1.25f;
|
||||
public static readonly float DamageReductionMultiplier = 0.75f;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((DamageBoostMultiplier).ToString("N2"), (DamageReductionMultiplier).ToString("N2"));
|
||||
public LocalizedText DripEffectText => Language.GetText("Mods.CalamityMod.Items.Potions.OldFashioned.DripEffect").WithFormatArgs(DamageBoostMultiplier.ToString("N2"), DamageReductionMultiplier.ToString("N2"));
|
||||
public AlcoholType AlcoholVariant => AlcoholType.OldFashioned;
|
||||
|
||||
public Action<Player, float> IVDripAlcoholEffect => ApplyOldFashionedEffect;
|
||||
|
||||
private static void ApplyOldFashionedEffect(Player player, float intensity)
|
||||
{
|
||||
// See CalamityGlobalProjectile
|
||||
}
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 20;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using System;
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -9,15 +11,23 @@ using Terraria.ModLoader;
|
||||
namespace CalamityMod.Items.Potions.Alcohol
|
||||
{
|
||||
[LegacyName("FabsolsVodka")]
|
||||
public class PurpleHaze : ModItem, ILocalizedModType
|
||||
public class PurpleHaze : ModItem, ILocalizedModType, IAlcoholItem
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Potions";
|
||||
|
||||
public static float DamageBoost = 0.25f;
|
||||
public static float StealthDamageLoss = 0.25f;
|
||||
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(),StealthDamageLoss.ToPercent());
|
||||
public LocalizedText DripEffectText => Language.GetText("Mods.CalamityMod.Items.Potions.PurpleHaze.DripEffect").WithFormatArgs(DamageBoost.ToPercent(), StealthDamageLoss.ToPercent());
|
||||
|
||||
public AlcoholType AlcoholVariant => AlcoholType.PurpleHaze;
|
||||
|
||||
public Action<Player, float> IVDripAlcoholEffect => ApplyPurpleHazeEffect;
|
||||
|
||||
private static void ApplyPurpleHazeEffect(Player player, float intensity)
|
||||
{
|
||||
// See CalamityPlayer and CalamityPlayerMiscEffects
|
||||
}
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 20;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using System;
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Potions.Food;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -9,14 +11,23 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Potions.Alcohol
|
||||
{
|
||||
public class RedWine : ModItem, ILocalizedModType
|
||||
public class RedWine : ModItem, ILocalizedModType, IAlcoholItem
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Potions";
|
||||
|
||||
public static float VerticalSpeedBoost = 0.1f;
|
||||
public static float FlightTimeLoss = 0.25f;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(VerticalSpeedBoost.ToPercent(), FlightTimeLoss.ToPercent());
|
||||
public LocalizedText DripEffectText => Language.GetText("Mods.CalamityMod.Items.Potions.RedWine.DripEffect").WithFormatArgs(VerticalSpeedBoost.ToPercent(), FlightTimeLoss.ToPercent());
|
||||
|
||||
public AlcoholType AlcoholVariant => AlcoholType.RedWine;
|
||||
|
||||
public Action<Player, float> IVDripAlcoholEffect => ApplyRedWineEffect;
|
||||
|
||||
private static void ApplyRedWineEffect(Player player, float intensity)
|
||||
{
|
||||
// See CalamityPlayer and CalamityPlayerMiscEffects
|
||||
}
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 20;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using System;
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -8,14 +10,22 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Potions.Alcohol
|
||||
{
|
||||
public class Rum : ModItem, ILocalizedModType
|
||||
public class Rum : ModItem, ILocalizedModType, IAlcoholItem
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Potions";
|
||||
|
||||
public static float NonMinionBoost = 1.15f;
|
||||
public static float MinionBoost = 0.85f;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((NonMinionBoost-1).ToPercent(), (1- MinionBoost).ToPercent());
|
||||
public LocalizedText DripEffectText => Language.GetText("Mods.CalamityMod.Items.Potions.Rum.DripEffect").WithFormatArgs((NonMinionBoost - 1).ToPercent(), (1 - MinionBoost).ToPercent());
|
||||
public AlcoholType AlcoholVariant => AlcoholType.Rum;
|
||||
|
||||
public Action<Player, float> IVDripAlcoholEffect => ApplyRumEffect;
|
||||
|
||||
private static void ApplyRumEffect(Player player, float intensity)
|
||||
{
|
||||
// See CalamityGlobalProjectile
|
||||
}
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 20;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using System;
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables.Ores;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -9,14 +11,25 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Potions.Alcohol
|
||||
{
|
||||
public class Screwdriver : ModItem, ILocalizedModType
|
||||
public class Screwdriver : ModItem, ILocalizedModType, IAlcoholItem
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Potions";
|
||||
|
||||
public static float DebuffBoost = 0.5f;
|
||||
public static float DebuffLoss = 0.5f;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((DebuffBoost).ToPercent(), DebuffLoss.ToPercent());
|
||||
public LocalizedText DripEffectText => Language.GetText("Mods.CalamityMod.Items.Potions.Screwdriver.DripEffect").WithFormatArgs(DebuffBoost.ToString("N2"), DebuffLoss.ToString("N2"));
|
||||
public AlcoholType AlcoholVariant => AlcoholType.Screwdriver;
|
||||
|
||||
public Action<Player, float> IVDripAlcoholEffect => ApplyScrewdriverEffect;
|
||||
|
||||
private static void ApplyScrewdriverEffect(Player player, float intensity)
|
||||
{
|
||||
player.blockRange += 5;
|
||||
player.tileSpeed += 1;
|
||||
player.wallSpeed += 1;
|
||||
player.GetDamage(DamageClass.Generic) *= 0.75f;
|
||||
}
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 20;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using System;
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -8,14 +10,22 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Potions.Alcohol
|
||||
{
|
||||
public class StarBeamRye : ModItem, ILocalizedModType
|
||||
public class StarBeamRye : ModItem, ILocalizedModType, IAlcoholItem
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Potions";
|
||||
|
||||
public static float MagicDmgMult = 0.9f;
|
||||
public static int ManaRegenBoost = 30;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MagicDmgMult);
|
||||
public AlcoholType AlcoholVariant => AlcoholType.StarBeamRye;
|
||||
public LocalizedText DripEffectText => Language.GetText("Mods.CalamityMod.Items.Potions.StarBeamRye.DripEffect").WithFormatArgs(MagicDmgMult);
|
||||
|
||||
public Action<Player, float> IVDripAlcoholEffect => ApplyStarBeamRyeEffect;
|
||||
|
||||
private static void ApplyStarBeamRyeEffect(Player player, float intensity)
|
||||
{
|
||||
// See CalamityPlayerMiscEffects
|
||||
}
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 20;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using System;
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -8,7 +10,7 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Potions.Alcohol
|
||||
{
|
||||
public class Tequila : ModItem, ILocalizedModType
|
||||
public class Tequila : ModItem, ILocalizedModType, IAlcoholItem
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Potions";
|
||||
|
||||
@@ -16,7 +18,17 @@ namespace CalamityMod.Items.Potions.Alcohol
|
||||
public static float DebuffBoost = 0.5f;
|
||||
public static float DebuffLoss = 0.5f;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((DebuffBoost).ToPercent(), DebuffLoss.ToPercent());
|
||||
public LocalizedText DripEffectText => Language.GetText("Mods.CalamityMod.Items.Potions.Tequila.DripEffect").WithFormatArgs((DebuffBoost).ToPercent(), DebuffLoss.ToPercent());
|
||||
public AlcoholType AlcoholVariant => AlcoholType.Tequila;
|
||||
|
||||
public Action<Player, float> IVDripAlcoholEffect => ApplyTequilaEffect;
|
||||
|
||||
private static void ApplyTequilaEffect(Player player, float intensity)
|
||||
{
|
||||
var cplayer = player.Calamity();
|
||||
cplayer.ElectricDebuffMultiplier += Tequila.DebuffBoost;
|
||||
cplayer.ColdDebuffMultiplier -= Tequila.DebuffLoss;
|
||||
}
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 20;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using System;
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables.Ores;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -9,13 +11,21 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Potions.Alcohol
|
||||
{
|
||||
public class TequilaSunrise : ModItem, ILocalizedModType
|
||||
public class TequilaSunrise : ModItem, ILocalizedModType, IAlcoholItem
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Potions";
|
||||
|
||||
public static float DoTMultiplier = 1.5f;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((DoTMultiplier-1).ToPercent());
|
||||
public LocalizedText DripEffectText => Language.GetText("Mods.CalamityMod.Items.Potions.TequilaSunrise.DripEffect").WithFormatArgs((DoTMultiplier-1).ToPercent());
|
||||
public AlcoholType AlcoholVariant => AlcoholType.TequilaSunrise;
|
||||
|
||||
public Action<Player, float> IVDripAlcoholEffect => ApplyTequilaSunriseEffect;
|
||||
|
||||
private static void ApplyTequilaSunriseEffect(Player player, float intensity)
|
||||
{
|
||||
// See CalamityPlayerLifeRegen
|
||||
}
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 20;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using System;
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables.Ores;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -9,14 +11,28 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Potions.Alcohol
|
||||
{
|
||||
public class Vodka : ModItem, ILocalizedModType
|
||||
public class Vodka : ModItem, ILocalizedModType, IAlcoholItem
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Potions";
|
||||
|
||||
public static float DebuffBoost = 0.25f;
|
||||
public static float DebuffLoss = 0.5f;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((DebuffBoost).ToPercent(), DebuffLoss.ToPercent());
|
||||
public LocalizedText DripEffectText => Language.GetText("Mods.CalamityMod.Items.Potions.Vodka.DripEffect").WithFormatArgs((DebuffBoost).ToPercent(), DebuffLoss.ToPercent());
|
||||
public AlcoholType AlcoholVariant => AlcoholType.Vodka;
|
||||
|
||||
public Action<Player, float> IVDripAlcoholEffect => ApplyVodkaEffect;
|
||||
|
||||
private static void ApplyVodkaEffect(Player player, float intensity)
|
||||
{
|
||||
var cplayer = player.Calamity();
|
||||
cplayer.TypelessDebuffMultiplier += Vodka.DebuffBoost;
|
||||
cplayer.HeatDebuffMultiplier -= Vodka.DebuffLoss;
|
||||
cplayer.ColdDebuffMultiplier -= Vodka.DebuffLoss;
|
||||
cplayer.SicknessDebuffMultiplier -= Vodka.DebuffLoss;
|
||||
cplayer.WaterDebuffMultiplier -= Vodka.DebuffLoss;
|
||||
cplayer.ElectricDebuffMultiplier -= Vodka.DebuffLoss;
|
||||
}
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 20;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using System;
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -8,16 +10,27 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Potions.Alcohol
|
||||
{
|
||||
public class Whiskey : ModItem, ILocalizedModType
|
||||
public class Whiskey : ModItem, ILocalizedModType, IAlcoholItem
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Potions";
|
||||
|
||||
public static float MaxDamageBoost = 0.15f;
|
||||
public static float MinDamageBoost = -0.15f;
|
||||
public static float StandardDamageCeiling = 0.15f;
|
||||
public static float StandardDamageFloor = -0.15f;
|
||||
public static float TimeToDischarge = 600;
|
||||
public static float TimeToRecharge = 300;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinDamageBoost.ToPercent(), MaxDamageBoost.ToPercent(), (TimeToDischarge/60).ToString("0.##"), (TimeToRecharge/60).ToString("0.##"));
|
||||
public static float CombinedDamageCeiling = 0.3f;
|
||||
public static float CombinedDamageFloor = -0.3f;
|
||||
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(StandardDamageFloor.ToPercent(), StandardDamageCeiling.ToPercent(), (TimeToDischarge/60).ToString("0.##"), (TimeToRecharge/60).ToString("0.##"));
|
||||
public LocalizedText DripEffectText => Language.GetText("Mods.CalamityMod.Items.Potions.Whiskey.DripEffect").WithFormatArgs(StandardDamageFloor.ToPercent(), StandardDamageCeiling.ToPercent(), (TimeToDischarge / 60).ToString("0.##"), (TimeToRecharge / 60).ToString("0.##"), CombinedDamageFloor.ToPercent(), CombinedDamageCeiling.ToPercent());
|
||||
public AlcoholType AlcoholVariant => AlcoholType.Whiskey;
|
||||
|
||||
public Action<Player, float> IVDripAlcoholEffect => ApplyWhiskeyEffect;
|
||||
|
||||
private static void ApplyWhiskeyEffect(Player player, float intensity)
|
||||
{
|
||||
// See CalamityPlayer
|
||||
}
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 20;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using System;
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables.Ores;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -10,14 +12,22 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Potions.Alcohol
|
||||
{
|
||||
public class WhiteWine : ModItem, ILocalizedModType
|
||||
public class WhiteWine : ModItem, ILocalizedModType, IAlcoholItem
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Potions";
|
||||
|
||||
public static float FlightTimeRecoveryAmount = 0.66f;
|
||||
public static float FlightTimeLoss = 0.5f;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(FlightTimeLoss.ToPercent());
|
||||
public LocalizedText DripEffectText => Language.GetText("Mods.CalamityMod.Items.Potions.WhiteWine.DripEffect").WithFormatArgs(FlightTimeLoss.ToPercent());
|
||||
public AlcoholType AlcoholVariant => AlcoholType.WhiteWine;
|
||||
|
||||
public Action<Player, float> IVDripAlcoholEffect => ApplyWhiteWineEffect;
|
||||
|
||||
private static void ApplyWhiteWineEffect(Player player, float intensity)
|
||||
{
|
||||
// See CalamityPlayerMiscEffects
|
||||
}
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 20;
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Potions.Food
|
||||
{
|
||||
public class TheSandwich : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Potions";
|
||||
public static int alcoholCapBoost = 2;
|
||||
public static float statBoost = 0.05f; // The player starts with negative stat boosts, so it is a bit less than you'd expect
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(statBoost.ToPercent());
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 5;
|
||||
Main.RegisterItemAnimation(Type, new DrawAnimationVertical(int.MaxValue, 3));
|
||||
ItemID.Sets.FoodParticleColors[Type] = new Color[3] {
|
||||
new Color(132, 171, 87),
|
||||
new Color(174, 91, 107),
|
||||
new Color(218, 176, 133)
|
||||
};
|
||||
ItemID.Sets.IsFood[Type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.DefaultToFood(70, 48, ModContent.BuffType<Malnourished>(), CalamityUtils.MinutesToFrames(10));
|
||||
Item.value = Item.sellPrice(silver: 20);
|
||||
Item.rare = ItemRarityID.Blue;
|
||||
}
|
||||
public override void UseAnimation(Player player)
|
||||
{
|
||||
player.ClearBuff(BuffID.WellFed);
|
||||
player.ClearBuff(BuffID.WellFed2);
|
||||
player.ClearBuff(BuffID.WellFed3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 4.8 KiB |
@@ -0,0 +1,89 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CalamityMod.Buffs.Potions;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Rarities;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Potions
|
||||
{
|
||||
public class TheConcoction : ModItem, ILocalizedModType
|
||||
{
|
||||
private static int hoverTimer = 0;
|
||||
private static bool wasHovering = false;
|
||||
public new string LocalizationCategory => "Items.Potions";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 30;
|
||||
ItemID.Sets.DrinkParticleColors[Type] = new Color[3]
|
||||
{
|
||||
new Color(255, 190, 250),
|
||||
new Color(255, 225, 183),
|
||||
new Color(246, 34, 79)
|
||||
};
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.DefaultToHealingPotion(50, 56, 500);
|
||||
Item.value = Item.sellPrice(silver: 60);
|
||||
Item.rare = ItemRarityID.Green;
|
||||
}
|
||||
|
||||
|
||||
public override void OnConsumeItem(Player player)
|
||||
{
|
||||
TheConcoctionPlayer cocPlayer = player.GetModPlayer<TheConcoctionPlayer>();
|
||||
cocPlayer.swinesWrathCounter = 1200; // Creates a 10 second delay before the buff is visible (triggers at 600)
|
||||
}
|
||||
|
||||
|
||||
public override void UpdateInventory(Player player)
|
||||
{
|
||||
wasHovering = Main.HoverItem?.type == Type;
|
||||
}
|
||||
|
||||
// Display different text for the first 10 frames of hovering over the item's tooltip.
|
||||
public override void ModifyTooltips(List<TooltipLine> tooltips)
|
||||
{
|
||||
bool isHovering = Main.HoverItem?.type == Type;
|
||||
|
||||
if (isHovering && !wasHovering)
|
||||
hoverTimer = 0;
|
||||
if (isHovering)
|
||||
hoverTimer++;
|
||||
|
||||
if (hoverTimer <= 10 && hoverTimer > 0)
|
||||
{
|
||||
TooltipLine healLine = tooltips.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "HealLife");
|
||||
healLine?.Text = this.GetLocalization("EasterEggText").Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class TheConcoctionPlayer : ModPlayer
|
||||
{
|
||||
public int swinesWrathCounter = -1;
|
||||
|
||||
public override void PostUpdate()
|
||||
{
|
||||
if (swinesWrathCounter > 0)
|
||||
{
|
||||
swinesWrathCounter--;
|
||||
|
||||
if (swinesWrathCounter <= 600 && !Player.HasBuff<SwinesWrathBuff>()) // When there is 10 seconds left
|
||||
{
|
||||
Player.AddBuff(ModContent.BuffType<SwinesWrathBuff>(), 600);
|
||||
|
||||
SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/SwinesWrathProc"), Player.Center);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,111 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Systems;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Potions
|
||||
{
|
||||
public class TheElixir : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Potions";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 20;
|
||||
ItemID.Sets.DrinkParticleColors[Type] = new Color[3] {
|
||||
new Color(159, 67, 199),
|
||||
new Color(176, 147, 243),
|
||||
new Color(84, 50, 185)
|
||||
};
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.value = Item.sellPrice(silver: 2);
|
||||
Item.rare = ItemRarityID.Blue;
|
||||
Item.DefaultToFood(28, 51, 0, 0, true);
|
||||
}
|
||||
|
||||
// Player is unable to use the item when Chaos State is enabled to prevent spamming the item.
|
||||
// Even though the item also inflicts Cursed, this is kept as a failsafe in the event the player has something equipped that
|
||||
// provides immunity to Cursed. (i.e Countercurse Mantra or Nazar)
|
||||
public override bool CanUseItem(Player player)
|
||||
{
|
||||
if (player.HasBuff(BuffID.ChaosState))
|
||||
return false;
|
||||
|
||||
return base.CanUseItem(player);
|
||||
}
|
||||
|
||||
public override bool? UseItem(Player player)
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
if (Main.rand.NextBool(4))
|
||||
{
|
||||
int roll = Main.rand.Next(3);
|
||||
Vector2? location = roll switch
|
||||
{
|
||||
1 => CalamityPlayer.GetAbyssVoidTeleportPosition(player),
|
||||
2 => CalamityPlayer.GetTempleTeleportPosition(player),
|
||||
_ => CalamityPlayer.GetDungeonArchivesTeleportPosition(player)
|
||||
};
|
||||
|
||||
if (!location.HasValue)
|
||||
return false;
|
||||
|
||||
player.AddBuff(BuffID.ChaosState, 300, false);
|
||||
player.AddBuff(BuffID.Cursed, 300, false);
|
||||
CalamityPlayer.ModTeleport(player, location.Value, false, TeleportationStyleID.RecallPotion);
|
||||
}
|
||||
//If it doesn't fail, just act like a Potion of Return
|
||||
else
|
||||
player.DoPotionOfReturnTeleportationAndSetTheComebackPoint();
|
||||
|
||||
//Dust and Teleport sounds happen regardless of if it fails or not
|
||||
Rectangle rect = player.getRect();
|
||||
int dustAmt = rect.Width * rect.Height / 5;
|
||||
for (int k = 0; k < dustAmt; k++)
|
||||
{
|
||||
Dust dust = Dust.NewDustDirect(new Vector2(rect.X, rect.Y), rect.Width, rect.Height, DustID.TeleportationPotion);
|
||||
dust.scale = Main.rand.NextFloat(0.2f, 0.7f);
|
||||
if (k < 10)
|
||||
dust.scale += 0.25f;
|
||||
if (k < 5)
|
||||
dust.scale += 0.25f;
|
||||
}
|
||||
for (int k = 0; k < 70; k++)
|
||||
{
|
||||
Dust dust = Dust.NewDustDirect(new Vector2(rect.X, rect.Y), rect.Width, rect.Height, DustID.DungeonSpirit);
|
||||
dust.noGravity = true;
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
if (Main.rand.NextBool(3))
|
||||
dust.velocity *= 0.75f;
|
||||
}
|
||||
if (Main.rand.NextBool(3))
|
||||
{
|
||||
dust.velocity *= 2f;
|
||||
dust.scale *= 1.2f;
|
||||
}
|
||||
if (Main.rand.NextBool(3))
|
||||
{
|
||||
dust.velocity *= 2f;
|
||||
dust.scale *= 1.2f;
|
||||
}
|
||||
if (Main.rand.NextBool())
|
||||
{
|
||||
dust.fadeIn = Main.rand.NextFloat(0.75f, 1f);
|
||||
dust.scale = Main.rand.NextFloat(0.25f, 0.75f);
|
||||
}
|
||||
dust.scale *= 0.8f;
|
||||
}
|
||||
SoundEngine.PlaySound(SoundID.Item6, player.Center);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 933 B |