Merge branch '1.4.4' into ButcherRework

This commit is contained in:
CongratsIsTrash committed 2024-06-03 11:53:30 -04:00
commit 96f1be960d
602 files changed
+12380 -2194

No files matched your search

+5
View File
@@ -8,6 +8,7 @@ using Terraria.ModLoader;
namespace CalamityMod.Backgrounds
{
//this is just a blank background, so each custom background will draw over it
public class AstralSurfaceBGStyle : ModSurfaceBackgroundStyle
{
internal static readonly FieldInfo screenOffField = typeof(Main).GetField("screenOff", BindingFlags.Instance | BindingFlags.NonPublic);
@@ -25,13 +26,17 @@ namespace CalamityMod.Backgrounds
{
fades[i] += transitionSpeed;
if (fades[i] > 1f)
{
fades[i] = 1f;
}
}
else
{
fades[i] -= transitionSpeed;
if (fades[i] < 0f)
{
fades[i] = 0f;
}
}
}
}
+14
View File
@@ -0,0 +1,14 @@
using Terraria.ModLoader;
namespace CalamityMod.Backgrounds
{
public class FloralParadiseBGStyle : ModUndergroundBackgroundStyle
{
public override void FillTextureArray(int[] textureSlots)
{
// Corresponds to underground jungle backgrounds. Something custom could probably be made, but for what it is it works sufficiently for the minibiome.
for (int i = 0; i <= 3; i++)
textureSlots[i] = i + 153;
}
}
}
+6 -2
View File
@@ -1,4 +1,5 @@
using Terraria.ModLoader;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Backgrounds
{
@@ -7,7 +8,10 @@ namespace CalamityMod.Backgrounds
public override void FillTextureArray(int[] textureSlots)
{
for (int i = 0; i <= 3; i++)
textureSlots[i] = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/SunkenSeaBG" + i.ToString());
{
textureSlots[i] = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
//textureSlots[i] = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/SunkenSeaBG" + i.ToString());
}
}
}
}
+128
View File
@@ -0,0 +1,128 @@
using Terraria;
using Terraria.ModLoader;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
namespace CalamityMod.Backgrounds
{
internal static class SunkenSeaBurrowsBG
{
public static void Load()
{
if (Main.dedServ)
{
return;
}
On_Main.DrawBackgroundBlackFill += DrawBurrowsBG;
}
public static float Transparency;
public static float TransitionSpeed => 0.02f;
private static void DrawBurrowsBG(On_Main.orig_DrawBackgroundBlackFill orig, Main self)
{
if (Main.gameMenu || Main.screenPosition.Y + Main.screenHeight < ((int)Main.worldSurface) * 16f)
{
orig(self);
return;
}
orig(self);
if (Main.LocalPlayer.InModBiome(ModContent.GetInstance<BiomeManagers.SunkenSeaBurrowsBiome>()))
{
Transparency += TransitionSpeed;
if (Transparency > 1f)
{
Transparency = 1f;
}
}
else
{
//make transparency immediately go down so it doesnt look weird, since vanilla underground backgrounds dont have the fade-in effect this background has
Transparency -= 1f;
if (Transparency < 0f)
{
Transparency = 0f;
}
}
//dont bother running any of the background drawing if the transparency is zero (meaning the background isnt actually active)
//also do not run any of the background drawing if you have the vanilla background config option turned off
if (Transparency > 0f && Main.BackgroundEnabled)
{
Vector2 vector = Main.screenPosition + new Vector2((Main.screenWidth >> 1), (Main.screenHeight >> 1));
float num = (Main.GameViewMatrix.Zoom.Y - 1f) * 0.5f * 200f;
float Scale = 1.5f;
for (int Layers = 4; Layers >= 0; Layers--)
{
//get each background texture
Texture2D BGTexture = ModContent.Request<Texture2D>("CalamityMod/Backgrounds/SunkenSeaBurrowsBG" + Layers).Value;
Vector2 vector2 = new Vector2(BGTexture.Width, BGTexture.Height) * 0.5f;
float num2 = (Layers * 2 + 3f);
Vector2 vector3 = new Vector2(1f / num2);
Rectangle rectangle = new Rectangle(0, 0, BGTexture.Width, BGTexture.Height);
Vector2 zero = Vector2.Zero;
switch (Layers)
{
case 0:
{
zero.Y += 800f;
break;
}
case 1:
{
zero.Y += 200f;
break;
}
case 2:
{
zero.Y += 450f;
break;
}
case 3:
{
zero.Y += 45f;
break;
}
case 4:
{
zero.Y += 45f;
break;
}
}
vector2 *= Scale;
zero.Y -= num;
float LoopWidth = Scale * rectangle.Width;
//float LoopHeight = Scale * rectangle.Height;
int LoopX = (int)((vector.X * vector3.X - vector2.X + zero.X - (Main.screenWidth >> 1)) / LoopWidth);
//int LoopY = (int)((vector.Y * vector3.Y - vector2.Y + zero.Y - (Main.screenWidth >> 1)) / LoopWidth);
//for (int i = LoopY - 2; i < LoopY + 4 + (int)(Main.screenWidth / LoopHeight); i++)
//{
for (int j = LoopX - 2; j < LoopX + 4 + (int)(Main.screenWidth / LoopWidth); j++)
{
Vector2 drawPosition = (new Vector2(j * Scale * (rectangle.Width / vector3.X), ((Main.LocalPlayer.Center.Y / 16f) - 90) * 16f) + vector2 - vector) * vector3 + vector - Main.screenPosition - vector2 + zero;
var frame = rectangle;
var color = Color.MediumTurquoise * Transparency;
Main.spriteBatch.Draw(BGTexture, drawPosition, frame, color, 0f, Vector2.Zero, Scale, SpriteEffects.None, 0f);
}
//}
}
}
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

+18
View File
@@ -0,0 +1,18 @@
using CalamityMod.Systems;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.BiomeManagers
{
public class FloralParadiseBiome : ModBiome
{
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/FloralParadiseWater");
public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle => ModContent.Find<ModUndergroundBackgroundStyle>("CalamityMod/FloralParadiseBGStyle");
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
public override bool IsBiomeActive(Player player)
{
return BiomeTileCounterSystem.FloralParadiseTiles >= 300;
}
}
}
+56 -8
View File
@@ -1,18 +1,65 @@
using CalamityMod.Items.Placeables.Furniture;
using CalamityMod.Systems;
using Terraria;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Graphics.Light;
using Microsoft.Xna.Framework;
using System;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using CalamityMod.Items.Placeables.Furniture;
using CalamityMod.Systems;
namespace CalamityMod.BiomeManagers
{
//this is just a global sunken sea biome to check if you are in any of the existing biomes
public class SunkenSeaBiome : ModBiome
{
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/SunkenSeaWater");
public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle => ModContent.Find<ModUndergroundBackgroundStyle>("CalamityMod/SunkenSeaBGStyle");
public override int BiomeTorchItemType => ModContent.ItemType<NavyPrismTorch>();
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("SunkenSea") ?? MusicID.OceanNight;
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
public override void Load()
{
//apply the drawblack edits here since all sunken sea biomes will have custom backgrounds
IL_Main.DrawBlack += ChangeBlackThreshold;
On_Main.DrawBlack += ForceDrawBlack;
}
private void ForceDrawBlack(On_Main.orig_DrawBlack orig, Main self, bool force)
{
if (Main.LocalPlayer.InModBiome(ModContent.GetInstance<BiomeManagers.SunkenSeaBiome>()) && Main.BackgroundEnabled)
{
orig(self, true);
}
else
{
orig(self, force);
}
}
private float NewThreshold(float orig)
{
if (Main.LocalPlayer.InModBiome(ModContent.GetInstance<BiomeManagers.SunkenSeaBiome>()) && Main.BackgroundEnabled)
{
return 0.1f;
}
else
{
return orig;
}
}
private void ChangeBlackThreshold(ILContext il)
{
if (Main.BackgroundEnabled)
{
var c = new ILCursor(il);
c.TryGotoNext(n => n.MatchLdloc(6), n => n.MatchStloc(13)); //beginning of the loop, local 11 is a looping variable
c.Index++; //this is kinda goofy since I dont think you could actually ever write c# to compile to the resulting IL from emitting here.
c.Emit(OpCodes.Ldloc, 3); //pass the original value so we can set that instead if we dont want to change the threshold
c.EmitDelegate<Func<float, float>>(NewThreshold); //check if were in the biome to set, else set the original value
c.Emit(OpCodes.Stloc, 3); //num2 in vanilla, controls minimum threshold to turn a tile black
}
}
public override string BestiaryIcon => "CalamityMod/BiomeManagers/SunkenSeaIcon";
// Placeholder until we get a dedicated Sunken Sea background
public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1";
@@ -20,7 +67,8 @@ namespace CalamityMod.BiomeManagers
public override bool IsBiomeActive(Player player)
{
return BiomeTileCounterSystem.SunkenSeaTiles > 150;
return BiomeTileCounterSystem.SunkenSeaBurrowsTiles > 500 || BiomeTileCounterSystem.SunkenSeaPolypTiles > 500 ||
BiomeTileCounterSystem.SunkenSeaReefsTiles > 500 || BiomeTileCounterSystem.SunkenSeaShoresTiles > 500;
}
}
}
+29
View File
@@ -0,0 +1,29 @@
using CalamityMod.Items.Placeables.Furniture;
using CalamityMod.Systems;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.BiomeManagers
{
public class SunkenSeaBurrowsBiome : ModBiome
{
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/SunkenSeaBurrowsWater");
public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle => ModContent.Find<ModUndergroundBackgroundStyle>("CalamityMod/SunkenSeaBGStyle");
public override int BiomeTorchItemType => ModContent.ItemType<NavyPrismTorch>();
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("SunkenSea") ?? MusicID.OceanNight;
public override SceneEffectPriority Priority => SceneEffectPriority.Environment;
public override string BestiaryIcon => "CalamityMod/BiomeManagers/SunkenSeaIcon";
// Placeholder until we get a dedicated Sunken Sea background
public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1";
public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1";
public override bool IsBiomeActive(Player player)
{
bool MoreThanReefs = BiomeTileCounterSystem.SunkenSeaBurrowsTiles > BiomeTileCounterSystem.SunkenSeaReefsTiles;
bool MoreThanPolyp = BiomeTileCounterSystem.SunkenSeaBurrowsTiles > BiomeTileCounterSystem.SunkenSeaPolypTiles;
return BiomeTileCounterSystem.SunkenSeaBurrowsTiles > 500 && MoreThanReefs && MoreThanPolyp;
}
}
}
+29
View File
@@ -0,0 +1,29 @@
using CalamityMod.Items.Placeables.Furniture;
using CalamityMod.Systems;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.BiomeManagers
{
public class SunkenSeaPolypBiome : ModBiome
{
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/SunkenSeaPolypWater");
public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle => ModContent.Find<ModUndergroundBackgroundStyle>("CalamityMod/SunkenSeaBGStyle");
public override int BiomeTorchItemType => ModContent.ItemType<NavyPrismTorch>();
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("SunkenSea") ?? MusicID.OceanNight;
public override SceneEffectPriority Priority => SceneEffectPriority.Environment;
public override string BestiaryIcon => "CalamityMod/BiomeManagers/SunkenSeaIcon";
// Placeholder until we get a dedicated Sunken Sea background
public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1";
public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1";
public override bool IsBiomeActive(Player player)
{
bool MoreThanReefs = BiomeTileCounterSystem.SunkenSeaPolypTiles > BiomeTileCounterSystem.SunkenSeaReefsTiles;
bool MoreThanBurrows = BiomeTileCounterSystem.SunkenSeaPolypTiles > BiomeTileCounterSystem.SunkenSeaBurrowsTiles;
return BiomeTileCounterSystem.SunkenSeaPolypTiles > 500 && MoreThanReefs && MoreThanBurrows;
}
}
}
+29
View File
@@ -0,0 +1,29 @@
using CalamityMod.Items.Placeables.Furniture;
using CalamityMod.Systems;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.BiomeManagers
{
public class SunkenSeaReefsBiome : ModBiome
{
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/SunkenSeaReefsWater");
public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle => ModContent.Find<ModUndergroundBackgroundStyle>("CalamityMod/SunkenSeaBGStyle");
public override int BiomeTorchItemType => ModContent.ItemType<NavyPrismTorch>();
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("SunkenSea") ?? MusicID.OceanNight;
public override SceneEffectPriority Priority => SceneEffectPriority.Environment;
public override string BestiaryIcon => "CalamityMod/BiomeManagers/SunkenSeaIcon";
// Placeholder until we get a dedicated Sunken Sea background
public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1";
public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1";
public override bool IsBiomeActive(Player player)
{
bool MoreThanBurrows = BiomeTileCounterSystem.SunkenSeaReefsTiles > BiomeTileCounterSystem.SunkenSeaBurrowsTiles;
bool MoreThanPolyp = BiomeTileCounterSystem.SunkenSeaReefsTiles > BiomeTileCounterSystem.SunkenSeaPolypTiles;
return BiomeTileCounterSystem.SunkenSeaReefsTiles > 500 && MoreThanBurrows && MoreThanPolyp;
}
}
}
+26
View File
@@ -0,0 +1,26 @@
using CalamityMod.Items.Placeables.Furniture;
using CalamityMod.Systems;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.BiomeManagers
{
public class SunkenSeaShoresBiome : ModBiome
{
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/SunkenSeaShoresWater");
public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle => ModContent.Find<ModUndergroundBackgroundStyle>("CalamityMod/SunkenSeaBGStyle");
public override int BiomeTorchItemType => ModContent.ItemType<NavyPrismTorch>();
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("SunkenSea") ?? MusicID.OceanNight;
public override SceneEffectPriority Priority => SceneEffectPriority.Environment;
public override string BestiaryIcon => "CalamityMod/BiomeManagers/SunkenSeaIcon";
// Placeholder until we get a dedicated Sunken Sea background
public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1";
public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1";
public override bool IsBiomeActive(Player player)
{
return BiomeTileCounterSystem.SunkenSeaShoresTiles > 500;
}
}
}
-7
View File
@@ -88,13 +88,6 @@ namespace CalamityMod.Buffs
{
player.endurance += BalancingConstants.SolarFlareShieldDR;
}
else if (type == BuffID.Warmth)
{
player.buffImmune[ModContent.BuffType<GlacialState>()] = true;
player.buffImmune[BuffID.Frozen] = true;
player.buffImmune[BuffID.Chilled] = true;
}
else if (type == BuffID.Rabies)
{
player.GetDamage<GenericDamageClass>() -= 0.2f;
+15 -3
View File
@@ -6,17 +6,29 @@ namespace CalamityMod.Buffs.Placeables
{
public class CirrusBlueCandleBuff : ModBuff
{
public static float MoveSpeedBoost = 0.1f;
public static double WingTimeBoost = 0.1D;
public static float AccelerationBoost = 0.1f;
public override void SetStaticDefaults()
{
Main.buffNoTimeDisplay[Type] = true;
Main.debuff[Type] = true;
// These settings are standard for a "opt-in eternal" buff, which has the following properties:
// - Is not removed on death
// - Saves with the player / is not removed on logout
// - Does not display its time
// - Never reduces its duration
// - Can be manually canceled
Main.pvpBuff[Type] = true;
Main.persistentBuff[Type] = true;
Main.buffNoSave[Type] = false;
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
Main.buffNoTimeDisplay[Type] = true;
BuffID.Sets.TimeLeftDoesNotDecrease[Type] = true;
}
// Implementation is partially performed elsewhere using the blueCandle bool.
public override void Update(Player player, ref int buffIndex)
{
player.moveSpeed += MoveSpeedBoost;
player.Calamity().blueCandle = true;
}
}
+13 -7
View File
@@ -6,18 +6,24 @@ namespace CalamityMod.Buffs.Placeables
{
public class CirrusPinkCandleBuff : ModBuff
{
public static double PercentHealthPerSecond = 0.004D;
public override void SetStaticDefaults()
{
Main.buffNoTimeDisplay[Type] = true;
Main.debuff[Type] = true;
// These settings are standard for a "opt-in eternal" buff, which has the following properties:
// - Is not removed on death
// - Saves with the player / is not removed on logout
// - Does not display its time
// - Never reduces its duration
// - Can be manually canceled
Main.pvpBuff[Type] = true;
Main.persistentBuff[Type] = true;
Main.buffNoSave[Type] = false;
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
Main.buffNoTimeDisplay[Type] = true;
BuffID.Sets.TimeLeftDoesNotDecrease[Type] = true;
}
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().pinkCandle = true;
}
// Implementation is performed elsewhere using the pinkCandle bool.
public override void Update(Player player, ref int buffIndex) => player.Calamity().pinkCandle = true;
}
}
+9 -3
View File
@@ -10,11 +10,17 @@ namespace CalamityMod.Buffs.Placeables
public override void SetStaticDefaults()
{
Main.buffNoTimeDisplay[Type] = true;
Main.debuff[Type] = true;
// These settings are standard for a "opt-in eternal" buff, which has the following properties:
// - Is not removed on death
// - Saves with the player / is not removed on logout
// - Does not display its time
// - Never reduces its duration
// - Can be manually canceled
Main.pvpBuff[Type] = true;
Main.persistentBuff[Type] = true;
Main.buffNoSave[Type] = false;
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
Main.buffNoTimeDisplay[Type] = true;
BuffID.Sets.TimeLeftDoesNotDecrease[Type] = true;
}
public override void Update(Player player, ref int buffIndex)
+20 -7
View File
@@ -1,24 +1,37 @@
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using static Terraria.NPC;
namespace CalamityMod.Buffs.Placeables
{
public class CirrusYellowCandleBuff : ModBuff
{
public static float ExtraChipDamageRatio = 0.07f;
public override void SetStaticDefaults()
{
Main.buffNoTimeDisplay[Type] = true;
Main.debuff[Type] = true;
// These settings are standard for a "opt-in eternal" buff, which has the following properties:
// - Is not removed on death
// - Saves with the player / is not removed on logout
// - Does not display its time
// - Never reduces its duration
// - Can be manually canceled
Main.pvpBuff[Type] = true;
Main.persistentBuff[Type] = true;
Main.buffNoSave[Type] = false;
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
// Spite (the +5% final damage effect of Yellow Candle) is a tag buff. Nothing is immune to it.
// They may however be unaffected by it (including only temporarily) if they have incredibly high DR.
BuffID.Sets.IsATagBuff[Type] = true;
Main.buffNoTimeDisplay[Type] = true;
BuffID.Sets.TimeLeftDoesNotDecrease[Type] = true;
}
// Implementation is performed elsewhere using the yellowCandle bool.
public override void Update(Player player, ref int buffIndex) => player.Calamity().yellowCandle = true;
// Yellow Candle is implemented as a dirty modifier.
internal static void ModifyHitInfo_Spite(ref HitInfo info)
{
int damageBoost = (int)(info.SourceDamage * ExtraChipDamageRatio);
info.Damage += damageBoost;
}
}
}
+32 -12
View File
@@ -4,6 +4,7 @@ using System.Linq;
using CalamityMod.Balancing;
using CalamityMod.BiomeManagers;
using CalamityMod.Buffs;
using CalamityMod.Buffs.Placeables;
using CalamityMod.Buffs.StatBuffs;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.CalPlayer.Dashes;
@@ -54,6 +55,7 @@ using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ModLoader.IO;
using Terraria.Utilities.Terraria.Utilities;
namespace CalamityMod.CalPlayer
{
@@ -533,6 +535,8 @@ namespace CalamityMod.CalPlayer
public bool honeyDewHalveDebuffs = false;
public bool livingDewHalveDebuffs = false;
public int jewelBonusDefense = 0;
public float pulseCounter = 0; // Toxic Heart
public float pulseRate = 1; // Toxic Heart
public bool aAmpoule = false;
public bool rOoze = false;
public bool JustWasDebuffed = false;
@@ -794,6 +798,7 @@ namespace CalamityMod.CalPlayer
public bool astralStarRain = false;
public int astralStarRainCooldown = 0;
public int AbaddonCooldown = 0;
public int AlchFlaskCooldown = 0;
public bool plagueReaper = false;
public bool plaguebringerPatronSet = false;
public bool plaguebringerCarapace = false;
@@ -901,6 +906,9 @@ namespace CalamityMod.CalPlayer
public bool wither = false;
public bool ManaBurn = false;
public int ImmobilityDebuffImmunityTimer = 0;
public const int ImmobilityDebuffImmunityTimerMax = 300;
public const int SulphSeaWaterSafetyTime = 720;
public const int SulphSeaWaterRecoveryTime = 150;
#endregion
@@ -1096,13 +1104,21 @@ namespace CalamityMod.CalPlayer
#region Biome
public bool ZoneCalamity => Player.InModBiome(ModContent.GetInstance<BrimstoneCragsBiome>());
public bool ZoneAstral => Player.InModBiome(ModContent.GetInstance<BiomeManagers.AstralInfectionBiome>()) && !ZoneAbyss;
public bool ZoneSunkenSea => Player.InModBiome(ModContent.GetInstance<SunkenSeaBiome>());
public bool ZoneSunkenSea => ZoneSunkenBurrows || ZoneSunkenSeaReefs || ZoneSunkenSeaPolyp || ZoneSunkenSeaShores;
public bool ZoneSunkenBurrows => Player.InModBiome(ModContent.GetInstance<SunkenSeaBurrowsBiome>());
public bool ZoneSunkenSeaReefs => Player.InModBiome(ModContent.GetInstance<SunkenSeaReefsBiome>());
public bool ZoneSunkenSeaPolyp => Player.InModBiome(ModContent.GetInstance<SunkenSeaPolypBiome>());
public bool ZoneSunkenSeaShores => Player.InModBiome(ModContent.GetInstance<SunkenSeaShoresBiome>());
public bool ZoneSulphur => Player.InModBiome(ModContent.GetInstance<SulphurousSeaBiome>());
public bool ZoneAbyss => ZoneAbyssLayer1 || ZoneAbyssLayer2 || ZoneAbyssLayer3 || ZoneAbyssLayer4;
public bool ZoneAbyssLayer1 => Player.InModBiome(ModContent.GetInstance<AbyssLayer1Biome>());
public bool ZoneAbyssLayer2 => Player.InModBiome(ModContent.GetInstance<AbyssLayer2Biome>());
public bool ZoneAbyssLayer3 => Player.InModBiome(ModContent.GetInstance<AbyssLayer3Biome>());
public bool ZoneAbyssLayer4 => Player.InModBiome(ModContent.GetInstance<AbyssLayer4Biome>());
public bool ZoneFloralParadise => Player.InModBiome(ModContent.GetInstance<FloralParadiseBiome>());
public bool InAnyCalamityBiome => ZoneAbyss || ZoneCalamity || ZoneFloralParadise || ZoneSulphur || ZoneSunkenSea || ZoneAstral;
public bool abyssDeath = false;
public int abyssBreathCD;
public float caveDarkness = 0f;
@@ -1785,7 +1801,6 @@ namespace CalamityMod.CalPlayer
corrosiveSpine = false;
RustyMedallionDroplets = false;
MiniSwarmers = false;
noStupidNaturalARSpawns = false;
rottenDogTooth = false;
angelicAlliance = false;
BloomStoneRegen = false;
@@ -2156,7 +2171,8 @@ namespace CalamityMod.CalPlayer
StellarTorus = false;
LiliesOfFinalityBool = false;
/*
/* Spawn blockers from back when they used to work by being favorited and not a toggleable item
noStupidNaturalARSpawns = false
disableVoodooSpawns = false;
disablePerfCystSpawns = false;
disableHiveCystSpawns = false;
@@ -2316,6 +2332,7 @@ namespace CalamityMod.CalPlayer
gSabatonTempJumpSpeed = 0;
astralStarRainCooldown = 0;
AbaddonCooldown = 0;
AlchFlaskCooldown = 0;
silvaMageCooldown = 0;
bloodflareMageCooldown = 0;
tarraRangedCooldown = 0;
@@ -2383,6 +2400,7 @@ namespace CalamityMod.CalPlayer
banishingFire = false;
wither = false;
PurityHealSlowdownFrames = 0;
ImmobilityDebuffImmunityTimer = 0;
#endregion
#region Rogue
@@ -2703,6 +2721,15 @@ namespace CalamityMod.CalPlayer
if (Player.dead)
return;
if (ascendantInsignia && Main.myPlayer == Player.whoAmI && CalamityKeybinds.AscendantInsigniaHotKey.JustPressed && ascendantInsigniaCooldown <= 0)
{
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<AscendantInsignia>()));
Projectile.NewProjectileDirect(source, Player.Center - Vector2.UnitY * 45f, Vector2.Zero, ModContent.ProjectileType<AscendantAura>(), 0, 0f);
SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/AscendantActivate"));
ascendantInsigniaCooldown = 2400;
ascendantInsigniaBuffTime = 240; //4 seconds
}
//Only increment hotkey holdtime if not on ground, not mounted, not on rope, not hooked, not tongued, otherwise reset hold time to zero
if (CalamityKeybinds.GravistarSabatonHotkey.Current && gSabaton && Main.myPlayer == Player.whoAmI && (Player.velocity.Y != Player.oldVelocity.Y) && !Player.pulley && !Player.mount.Active && Player.grappling[0] == -1 && !Player.tongued)
{
@@ -3701,7 +3728,7 @@ namespace CalamityMod.CalPlayer
(kamiBoost ? KamiBuff.RunAccelerationBoost : 0f) +
(CobaltSet ? CobaltArmorSetChange.SpeedBoostSetBonusPercentage * 0.01f : 0f) +
(silvaSet ? 0.05f : 0f) +
(blueCandle ? 0.05f : 0f) +
(blueCandle ? CirrusBlueCandleBuff.AccelerationBoost : 0f) +
(planarSpeedBoost > 0 ? (0.01f * planarSpeedBoost) : 0f) +
(hasteLevel * 0.05f);
@@ -4852,15 +4879,8 @@ namespace CalamityMod.CalPlayer
if (CalamityConfig.Instance.SpeedrunTimer)
CalamityMod.SpeedrunTimer.Restart();
//
// 04JAN2024: Ozzatron: Added a temporary message for the Gimme Swag plushie campaign.
// This message should not exist indefinitely. It is being pushed as a silent public update just for itself.
// As this message always displays and is not configurable, the previous rules about startup messages have been replaced with always-true.
//
// Set a random delay between 12 and 20 seconds. When this delay hits zero, startup messages display
bool plushieMessage = true;
if (plushieMessage || CalamityConfig.Instance.WikiStatusMessage)
if (CalamityConfig.Instance.WikiStatusMessage)
{
startMessageDisplayDelay = Main.rand.Next(CalamityUtils.SecondsToFrames(12), CalamityUtils.SecondsToFrames(20) + 1);
}
+18
View File
@@ -330,6 +330,24 @@ namespace CalamityMod.CalPlayer
}
}
// Prideful Hunter's Planar Ripper movement speed boost
if (calamityPlayer.planarSpeedBoost > 0 && drawInfo.shadow == 0f)
{
int spawnChance = (int)(13 - (calamityPlayer.planarSpeedBoost / 2));
if (Main.rand.NextBool(spawnChance))
{
Vector2 sparkVelocity = -(Vector2.UnitY * Main.rand.NextFloat(2.5f, 5f)).RotatedByRandom(MathHelper.Pi / 10);
Vector2 sparkPos = new Vector2(Player.position.X + Main.rand.NextFloat(-8f, 40f), Player.position.Y + Main.rand.NextFloat(-8f, 56f));
Particle movementSpark = new AltLineParticle(sparkPos, sparkVelocity, false, 20, Main.rand.NextFloat(0.375f, 0.5f), new Color(130, 255, 255));
GeneralParticleHandler.SpawnParticle(movementSpark);
sparkVelocity = -(Vector2.UnitY * Main.rand.NextFloat(3f, 5.5f)).RotatedByRandom(MathHelper.Pi / 6);
sparkPos = new Vector2(Player.position.X + Main.rand.NextFloat(-8f, 40f), Player.position.Y + Main.rand.NextFloat(-8f, 56f));
Particle addSparks = new CustomPulse(sparkPos, sparkVelocity, new Color(180, 255, 255), "CalamityMod/Particles/ElectricSpark", Vector2.One, 0f, 0.5f, 0.65f, 20);
GeneralParticleHandler.SpawnParticle(addSparks);
}
}
// Some extraneous and probably undocumented visual effect caused by the heart lad pet thing
if ((calamityPlayer.ladHearts > 0) && !Player.loveStruck && Main.netMode != NetmodeID.Server && drawInfo.shadow == 0f)
{
+37 -5
View File
@@ -3,6 +3,7 @@ using System.Linq;
using CalamityMod.Balancing;
using CalamityMod.Buffs.Cooldowns;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.Placeables;
using CalamityMod.Buffs.StatBuffs;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.CalPlayer.Dashes;
@@ -37,6 +38,7 @@ using CalamityMod.Projectiles.Typeless;
using CalamityMod.UI;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Mono.Cecil;
using Terraria;
using Terraria.Audio;
using Terraria.Chat;
@@ -523,6 +525,14 @@ namespace CalamityMod.CalPlayer
// Apply all Calamity multipliers as a sum total to TML New Damage in a single step
modifiers.SourceDamage *= totalDamageMult;
// 01JUN2024: Ozzatron: apply Yellow Candle "chip damage" as a dirty modifier
// The registration of the dirty modifier is conditional to ensure it doesn't apply to "near invincible" targets
//
// FinalDamage cannot be used for the intended effect because there is no way to access the actual damage of the hit
CalamityGlobalNPC cgn = target.Calamity();
if (yellowCandle && cgn.DR < 0.99f && target.takenDamageMultiplier > 0.05f)
modifiers.ModifyHitInfo += CirrusYellowCandleBuff.ModifyHitInfo_Spite;
// Excalibur and True Excalibur deal +100% damage to targets above 75% HP.
if (item.type == ItemID.Excalibur || item.type == ItemID.TrueExcalibur)
{
@@ -589,6 +599,14 @@ namespace CalamityMod.CalPlayer
// Apply all Calamity multipliers as a sum total to TML New Damage in a single step
modifiers.SourceDamage *= totalDamageMult;
// 01JUN2024: Ozzatron: apply Yellow Candle "chip damage" as a dirty modifier
// The registration of the dirty modifier is conditional to ensure it doesn't apply to "near invincible" targets
//
// FinalDamage cannot be used for the intended effect because there is no way to access the actual damage of the hit
CalamityGlobalNPC cgn = target.Calamity();
if (yellowCandle && cgn.DR < 0.99f && target.takenDamageMultiplier > 0.05f)
modifiers.ModifyHitInfo += CirrusYellowCandleBuff.ModifyHitInfo_Spite;
// Stealth strike damage multipliers are applied here.
// TODO -- stealth should be its own damage class and this should be applied as player StealthDamage *= XYZ
if (proj.Calamity().stealthStrike && proj.CountsAsClass<RogueDamageClass>())
@@ -1219,6 +1237,22 @@ namespace CalamityMod.CalPlayer
GeneralParticleHandler.SpawnParticle(spark);
}
}
if (alchFlask)
{
for (int i = 0; i < 9; i++)
{
int seekerDamage = (int)Player.GetBestClassDamage().ApplyTo(15);
seekerDamage = Player.ApplyArmorAccDamageBonusesTo(seekerDamage);
Projectile bee = Projectile.NewProjectileDirect(Player.GetSource_FromThis(), Player.Center, new Vector2(5, 5).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1.2f), ModContent.ProjectileType<BasicPlagueBee>(), seekerDamage, 0f, Player.whoAmI, -20, 30, 2);
bee.ArmorPenetration = 35;
bee.penetrate = 6;
bee.extraUpdates = 2;
bee.timeLeft = 600;
}
Player.AddBuff(BuffID.Honey, 900);
}
}
public override void OnHitByProjectile(Projectile proj, Player.HurtInfo hurtInfo)
@@ -1306,10 +1340,6 @@ namespace CalamityMod.CalPlayer
{
Player.AddBuff(BuffID.BrokenArmor, 600);
}
else if (proj.type == ProjectileID.FrostBeam && !Player.frozen && !gState)
{
Player.AddBuff(ModContent.BuffType<GlacialState>(), 60);
}
else if (proj.type == ProjectileID.DeathLaser || proj.type == ProjectileID.RocketSkeleton || proj.type == ProjectileID.BombSkeletronPrime)
{
Player.AddBuff(BuffID.OnFire, 180);
@@ -1345,7 +1375,9 @@ namespace CalamityMod.CalPlayer
}
else if (proj.type == ProjectileID.CultistBossIceMist)
{
Player.AddBuff(BuffID.Frozen, 60);
if (!Player.frozen)
Player.AddBuff(BuffID.Frozen, 60);
Player.AddBuff(BuffID.Chilled, 180);
}
else if (proj.type == ProjectileID.CultistBossLightningOrbArc)
+25 -4
View File
@@ -2,17 +2,21 @@
using System.Linq;
using CalamityMod.Buffs.Alcohol;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.Placeables;
using CalamityMod.Cooldowns;
using CalamityMod.Items.Accessories;
using CalamityMod.NPCs;
using CalamityMod.Projectiles.Ranged;
using CalamityMod.Projectiles.Typeless;
using CalamityMod.Systems;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Utilities.Terraria.Utilities;
namespace CalamityMod.CalPlayer
{
@@ -21,9 +25,6 @@ namespace CalamityMod.CalPlayer
#region Update Bad Life Regen
public override void UpdateBadLifeRegen()
{
if (Player.ownedProjectileCounts[ModContent.ProjectileType<BloodBoilerFire>()] > 0)
noLifeRegen = true;
// Universal +25% increase to DoT debuff damage in Death Mode
float deathNegativeRegenBonus = 0.25f;
float calamityDebuffMultiplier = 1f + (CalamityWorld.death ? deathNegativeRegenBonus : 0f);
@@ -736,7 +737,7 @@ namespace CalamityMod.CalPlayer
if (pinkCandle && !noLifeRegen)
{
// Every frame, add up 1/60th of the healing value (0.4% max HP per second)
pinkCandleHealFraction += Player.statLifeMax2 * 0.004 / 60;
pinkCandleHealFraction += Player.statLifeMax2 * CirrusPinkCandleBuff.PercentHealthPerSecond / 60;
if (pinkCandleHealFraction >= 1D)
{
@@ -879,6 +880,26 @@ namespace CalamityMod.CalPlayer
}
}
}
if (toxicHeart) // Since it needs to know your life regen, it must be placed here
{
int auraDamage = (int)Player.GetBestClassDamage().ApplyTo(200);
auraDamage = Player.ApplyArmorAccDamageBonusesTo(auraDamage);
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<ToxicHeart>()));
pulseRate = Utils.Remap(Player.lifeRegen, -30, 10, 20, 1, true);
if (pulseCounter >= 420)
{
Projectile.NewProjectileDirect(source, Player.Center, Vector2.Zero, ModContent.ProjectileType<PlaguePulse>(), auraDamage, 0f, Player.whoAmI, 0, 0, 0);
pulseCounter = 0;
float soundVolume = Utils.Remap(Player.lifeRegen, -30, 10, 1f, 0.3f, true);
SoundStyle heartbeat = new("CalamityMod/Sounds/Item/Heartbeat");
SoundEngine.PlaySound(heartbeat with { Volume = soundVolume, PitchVariance = 0.2f }, Player.Center);
}
else
{
pulseCounter += MathHelper.Clamp(pulseRate, 1, 20);
}
}
}
#endregion
}
+74 -28
View File
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using CalamityMod.Balancing;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.Placeables;
using CalamityMod.Buffs.Potions;
using CalamityMod.Buffs.StatBuffs;
using CalamityMod.Buffs.StatDebuffs;
@@ -144,6 +145,9 @@ namespace CalamityMod.CalPlayer
// Check if schematics are present on the mouse, for the sake of registering their recipes.
CheckIfMouseItemIsSchematic();
// Do environmental effects.
DoEnvironmentalEffects();
// Handle Androomba's Right Click function
AndroombaRightClick();
@@ -1337,6 +1341,22 @@ namespace CalamityMod.CalPlayer
if (expiredCooldowns.Count > 0)
SyncCooldownRemoval(Main.netMode == NetmodeID.Server, expiredCooldowns);
// Grant the player 5 seconds of immunity to immobilizing debuffs after an immobilizing debuff wears off.
if (Player.stoned || Player.frozen || Player.webbed || gState)
{
ImmobilityDebuffImmunityTimer = ImmobilityDebuffImmunityTimerMax;
}
else if (ImmobilityDebuffImmunityTimer > 0)
{
ImmobilityDebuffImmunityTimer--;
Player.buffImmune[BuffID.Stoned] = true;
Player.buffImmune[BuffID.Frozen] = true;
Player.buffImmune[BuffID.Webbed] = true;
Player.buffImmune[ModContent.BuffType<GlacialState>()] = true;
}
if (ascendantInsigniaCooldown > 0 && ascendantInsigniaBuffTime <= 0)
ascendantInsigniaCooldown--;
if (DragonsBreathAudioCooldown > 0)
DragonsBreathAudioCooldown--;
if (DragonsBreathAudioCooldown2 > 0)
@@ -1373,6 +1393,8 @@ namespace CalamityMod.CalPlayer
astralStarRainCooldown--;
if (AbaddonCooldown > 0)
AbaddonCooldown--;
if (AlchFlaskCooldown > 0)
AlchFlaskCooldown--;
if (tarraRangedCooldown > 0)
tarraRangedCooldown--;
if (bloodflareMageCooldown > 0)
@@ -2012,6 +2034,13 @@ namespace CalamityMod.CalPlayer
}
// This section of code ensures set bonuses and accessories with cooldowns go on cooldown immediately if the armor or accessory is removed.
if (!ascendantInsignia && ascendantInsigniaBuffTime > 0)
{
ascendantInsigniaBuffTime = 0;
ascendantInsigniaCooldown = 2400;
Player.AddCooldown(AscendEffect.ID, 2400);
}
if (!brimflameSet && brimflameFrenzy)
{
brimflameFrenzy = false;
@@ -2069,6 +2098,31 @@ namespace CalamityMod.CalPlayer
}
#endregion
#region Biome Effects
public void DrawPollenInFloralParadise()
{
if (!ZoneFloralParadise || !Main.rand.NextBool(7) || Main.netMode == NetmodeID.Server)
return;
for (int i = 0; i < 15; i++)
{
Vector2 dustSpawnPosition = Player.Center + Main.rand.NextVector2Square(-360f, 360f);
dustSpawnPosition.Y += 200f;
Tile tile = CalamityUtils.ParanoidTileRetrieval((int)(dustSpawnPosition.X / 16f), (int)(dustSpawnPosition.Y / 16f));
if (WorldGen.SolidTile(tile) || tile.LiquidAmount > 0)
continue;
Dust pollen = Dust.NewDustPerfect(dustSpawnPosition, 261);
pollen.velocity = Main.rand.NextVector2Circular(0.4f, 0.4f);
pollen.scale = Main.rand.NextFloat(0.8f, 1f);
pollen.fadeIn = 2f;
pollen.color = Color.YellowGreen;
pollen.noGravity = true;
break;
}
}
#endregion Biome Effects
#region Abyss Effects
private void AbyssEffects()
{
@@ -2519,6 +2573,21 @@ namespace CalamityMod.CalPlayer
if (AdamantiteSet)
Player.statDefense += AdamantiteSetDefenseBoost;
// Warmth makes Chilled, Frozen, and Glacial State tick down 3x as fast
if (Player.HasBuff(BuffID.Warmth))
{
for (int b = 0; b < Player.MaxBuffs; b++)
{
if (Player.buffType[b] == BuffID.Chilled || Player.buffType[b] == BuffID.Frozen || Player.buffType[b] == ModContent.BuffType<GlacialState>())
{
if (Player.buffTime[b] > 3)
{
Player.buffTime[b] -= 2;
}
}
}
}
if (astralInjection)
{
if (Player.statMana < Player.statManaMax2)
@@ -2822,16 +2891,13 @@ namespace CalamityMod.CalPlayer
(harpyRing ? 0.2 : 0D) +
(reaverSpeed ? 0.1 : 0D) +
(angelTreads ? 0.1 : 0D) +
(blueCandle ? 0.05 : 0D) +
(blueCandle ? CirrusBlueCandleBuff.WingTimeBoost : 0D) +
(soaring ? 0.1 : 0D) +
(prismaticGreaves ? 0.1 : 0D) +
(plagueReaper ? 0.05 : 0D) +
(ascendantInsignia ? 0.05 : 0D) + // Added to soaring insignia's flight to get 30%
(Player.empressBrooch ? 0.25 : 0D);
if (blueCandle)
Player.moveSpeed += 0.05f;
if (community)
{
float baseBoost = TheCommunity.CalculatePower();
@@ -2925,9 +2991,6 @@ namespace CalamityMod.CalPlayer
if (pFlames && !purity)
{
if (!alchFlask)
Player.blind = true;
Player.GetDamage<GenericDamageClass>() -= 0.1f;
}
@@ -3077,27 +3140,13 @@ namespace CalamityMod.CalPlayer
}
}
if (ascendantInsignia)
if (ascendantInsignia && ascendantInsigniaBuffTime > 0)
{
if (CalamityKeybinds.AscendantInsigniaHotKey.JustPressed && ascendantInsigniaCooldown <= 0)
{
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<AscendantInsignia>()));
Projectile.NewProjectileDirect(source, Player.Center - Vector2.UnitY * 45f, Vector2.Zero, ModContent.ProjectileType<AscendantAura>(), 0, 0f);
SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/AscendantActivate"));
ascendantInsigniaCooldown = 2400;
ascendantInsigniaBuffTime = 240; //4 seconds
}
if (ascendantInsigniaCooldown > 0 && ascendantInsigniaBuffTime <= 0)
ascendantInsigniaCooldown--;
ascendantTrail = true;
infiniteFlight = true;
if (ascendantInsigniaBuffTime == 1)
Player.AddCooldown(AscendEffect.ID, 2400);
if (ascendantInsigniaBuffTime > 0)
{
ascendantTrail = true;
infiniteFlight = true;
ascendantInsigniaBuffTime--;
}
ascendantInsigniaBuffTime--;
}
if (abyssalDivingSuit && !Player.IsUnderwater())
@@ -4147,9 +4196,6 @@ namespace CalamityMod.CalPlayer
CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Misc.WikiStatus1");
CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Misc.WikiStatus2");
}
// 04JAN2024: Ozzatron: Plushie message always appears.
CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Misc.GimmeSwagPlushieCampaign");
}
--startMessageDisplayDelay;
+8 -8
View File
@@ -595,14 +595,17 @@ namespace CalamityMod.CalPlayer
if (!proj.CountsAsClass<MeleeDamageClass>() && !proj.CountsAsClass<SummonMeleeSpeedDamageClass>() && Player.meleeEnchant == 7)
Projectile.NewProjectile(source, position, proj.velocity, ProjectileID.ConfettiMelee, 0, 0f, proj.owner);
if (alchFlask && Player.ownedProjectileCounts[ProjectileType<PlagueSeeker>()] < 3 && hasClass)
if (alchFlask && AlchFlaskCooldown == 0 && proj.type != ModContent.ProjectileType<BasicPlagueBee>())
{
int seekerDamage = (int)Player.GetBestClassDamage().ApplyTo(30);
int seekerDamage = (int)Player.GetBestClassDamage().ApplyTo(10);
seekerDamage = Player.ApplyArmorAccDamageBonusesTo(seekerDamage);
Vector2 seekerVelocity = new Vector2(5, 5).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1.2f);
Projectile projectile = CalamityUtils.SpawnOrb(proj, seekerDamage, ProjectileType<PlagueSeeker>(), 400f, 12f);
if (projectile.whoAmI.WithinBounds(Main.maxProjectiles))
Main.projectile[projectile.whoAmI].DamageType = DamageClass.Generic;
Projectile bee = Projectile.NewProjectileDirect(source, position, seekerVelocity, ModContent.ProjectileType<BasicPlagueBee>(), seekerDamage, 0f, Player.whoAmI, -20, 30, 2);
bee.ArmorPenetration = 20;
bee.penetrate = 2;
bee.extraUpdates = 1;
AlchFlaskCooldown = 7;
}
bool lifeAndShieldCondition = Player.statLife >= Player.statLifeMax2 && (!HasAnyEnergyShield || TotalEnergyShielding >= TotalMaxShieldDurability);
@@ -1237,9 +1240,6 @@ namespace CalamityMod.CalPlayer
if (divineBless)
target.AddBuff(BuffType<BanishingFire>(), 60);
if (holyMinions)
target.AddBuff(BuffType<HolyFlames>(), 180);
if (shadowMinions)
target.AddBuff(BuffID.ShadowFlame, 180);
+37
View File
@@ -0,0 +1,37 @@
using CalamityMod.Projectiles.Environment;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ModLoader;
namespace CalamityMod.CalPlayer
{
public partial class CalamityPlayer : ModPlayer
{
public void DoEnvironmentalEffects()
{
CreateLilyglowInFloralParadise();
}
public void CreateLilyglowInFloralParadise()
{
// Don't do anything if the player is not in the floral paradise of if this code is called by anyone other than the player.
if (!ZoneFloralParadise || Main.myPlayer != Player.whoAmI)
return;
if (!Main.rand.NextBool(12))
return;
for (int tries = 0; tries < 50; tries++)
{
Vector2 potentialSpawnPosition = Player.Center + Main.rand.NextVector2Unit() * Main.rand.NextFloat(200f, 800f);
if (Collision.SolidCollision(potentialSpawnPosition, 1, 1))
continue;
Vector2 spawnVelocity = -Vector2.UnitY.RotatedByRandom(0.82f) * Main.rand.NextFloat(0.5f, 1.35f);
Projectile.NewProjectile(new EntitySource_WorldEvent(), potentialSpawnPosition, spawnVelocity, ModContent.ProjectileType<Lilyglow>(), 0, 0f, Player.whoAmI);
break;
}
}
}
}
+21
View File
@@ -175,6 +175,27 @@ namespace CalamityMod
public float FlightBarPosY { get; set; }
#endregion
#region Music Events
[Header("MusicEvents")]
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
public bool Interlude1 { get; set; }
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
public bool Interlude2 { get; set; }
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
public bool Interlude3 { get; set; }
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
public bool DevourerofGodsEulogy { get; set; }
#endregion
#region General Gameplay Changes
[Header("Gameplay")]
+1
View File
@@ -1943,6 +1943,7 @@ namespace CalamityMod
ProjectileType<PrismaticBeam>(),
ProjectileType<RancorLaserbeam>(),
ProjectileType<ReaperProjectile>(),
ProjectileType<RespiteblockHoldout>(),
ProjectileType<SacrificeProjectile>(),
ProjectileType<SnapClamProj>(),
ProjectileType<SnapClamStealth>(),
+5 -41
View File
@@ -100,7 +100,7 @@ namespace CalamityMod
// Astral Snow Sky/BG
public static Texture2D AstralSnowSurfaceMiddle;
// Sulpher Sea Sky/BG
// Sulphur Sea Sky/BG
public static Texture2D SulphurSeaSky;
public static Texture2D SulphurSeaSkyFront;
public static Texture2D SulphurSeaSurface;
@@ -132,8 +132,10 @@ namespace CalamityMod
internal static CalamityMod Instance;
// TODO -- Mod references should be contained in a ModSystem (example name "ModLoadedChecker")
internal Mod musicMod = null; // This is Calamity's official music mod, CalamityModMusic
internal bool MusicAvailable => !(musicMod is null);
// This is Calamity's official music mod, CalamityModMusic. It is now a hard dependency.
internal Mod musicMod = null;
internal bool MusicAvailable => musicMod is not null;
// Please keep this in alphabetical order so it's easy to read
internal Mod ancientsAwakened = null;
@@ -246,29 +248,6 @@ namespace CalamityMod
BalancingChangesManager.Load();
BaseIdleHoldoutProjectile.LoadAll();
PlayerDashManager.Load();
/*
//keep this disabled for now, hell bg system isnt used and there is a better way to load it
//hell background loading
HellBGManager.Load();
//load stuff for hell background
loadCache = new List<HellBGLoad>();
foreach (Type type in Code.GetTypes())
{
if (!type.IsAbstract && type.GetInterfaces().Contains(typeof(HellBGLoad)))
{
var instance = Activator.CreateInstance(type);
loadCache.Add(instance as HellBGLoad);
}
}
for (int k = 0; k < loadCache.Count; k++)
{
loadCache[k].Load();
}
*/
}
private void LoadClient()
@@ -483,21 +462,6 @@ namespace CalamityMod
carpetOriginal = null;
/*
//unload hell background stuff
HellBGManager.Unload();
if (loadCache != null)
{
foreach (var loadable in loadCache)
{
loadable.Unload();
}
}
loadCache = null;
*/
Instance = null;
base.Unload();
}
+17 -1
View File
@@ -6,6 +6,7 @@ using CalamityMod.NPCs;
using CalamityMod.NPCs.NormalNPCs;
using CalamityMod.NPCs.Providence;
using CalamityMod.NPCs.TownNPCs;
using CalamityMod.Systems;
using CalamityMod.TileEntities;
using CalamityMod.World;
using Microsoft.Xna.Framework;
@@ -300,6 +301,17 @@ namespace CalamityMod
SyncCalamityWorldDifficulties(sender);
break;
//
// Music event syncs
//
case CalamityModMessageType.MusicEventSyncRequest:
MusicEventSystem.FulfillSyncRequest(whoAmI);
break;
case CalamityModMessageType.MusicEventSyncResponse:
MusicEventSystem.ReceiveSyncResponse(reader);
break;
//
// Default case: with no idea how long the packet is, we can't safely read data.
// Throw an exception now instead of allowing the network stream to corrupt.
@@ -421,6 +433,10 @@ namespace CalamityMod
MousePositionSync,
// World state sync
SyncDifficulties
SyncDifficulties,
// Music events
MusicEventSyncRequest,
MusicEventSyncResponse
}
}
@@ -0,0 +1,27 @@
using Terraria.ModLoader;
namespace CalamityMod
{
public class MeleeRangedHybridDamageClass : DamageClass
{
internal static MeleeRangedHybridDamageClass Instance;
internal static readonly StatInheritanceData FiftyPercentBoost = new(0.5f, 0.5f, 0.5f, 0.5f, 0.5f);
public override void Load() => Instance = this;
public override void Unload() => Instance = null;
public override StatInheritanceData GetModifierInheritance(DamageClass damageClass)
{
if (damageClass == Melee || damageClass == Ranged)
return FiftyPercentBoost;
if (damageClass == Generic)
return StatInheritanceData.Full;
return StatInheritanceData.None;
}
// Inherits from both melee and ranged
public override bool GetEffectInheritance(DamageClass damageClass) => damageClass == Melee || damageClass == Ranged;
}
}
+12
View File
@@ -126,6 +126,12 @@ namespace CalamityMod.Effects
// Used by Devourer of Gods. Renders the portal that he escapes through at the end of phase 1.
internal static Effect DoGPortalShader;
// Used to render all-encompassing fog in the Floral Paradise biome.
internal static Effect FogShader;
// Used to render background water features in the Floral Paradise biome.
internal static Effect WaterfallShader;
// Metaballs. See the MetaballManager class for comments on how this system works.
// These shaders are leveraged to render the results of the metaball simulation to the screen.
// The "Base" shader draws the particles themselves.
@@ -351,6 +357,12 @@ namespace CalamityMod.Effects
DoGPortalShader = LoadShader("ScreenShaders/DoGPortalShader");
RegisterMiscShader(DoGPortalShader, "ScreenPass", "DoGPortal");
FogShader = LoadShader("ScreenShaders/Fog");
RegisterMiscShader(FogShader, "DyePass", "Fog");
WaterfallShader = LoadShader("WaterfallShader");
RegisterMiscShader(WaterfallShader, "TrailPass", "Waterfall");
// These two shaders are often (but not always) used together.
MetaballEdgeShader = LoadShader("Metaballs/MetaballEdgeShader");
RegisterMiscShader(MetaballEdgeShader, "ParticlePass", "MetaballEdge");
+61
View File
@@ -0,0 +1,61 @@
sampler uImage0 : register(s0);
sampler uImage1 : register(s1);
float3 uColor;
float3 uSecondaryColor;
float uOpacity;
float uSaturation;
float uRotation;
float uTime;
float4 uSourceRect;
float2 uWorldPosition;
float uDirection;
float3 uLightSource;
float2 uImageSize0;
float2 uImageSize1;
float fogMovementSpeed;
float4 uShaderSpecificData;
float Random(float2 coords)
{
return frac(sin(dot(coords, float2(49, 81)) * 100) * 100);
}
float PerlinNoise(float2 coords)
{
float2 integerPart = floor(coords);
float2 fractionalPart = frac(coords);
float a = Random(integerPart);
float b = Random(integerPart + float2(1, 0));
float c = Random(integerPart + float2(0, 1));
float d = Random(integerPart + float2(1, 1));
float2 cubic = fractionalPart * fractionalPart * (3 - fractionalPart * 2);
return lerp(a, b, cubic.x) + (c - a) * cubic.y * (1 - cubic.x) + (d - b) * cubic.x * cubic.y;
}
float ScaledNoise(float2 coords)
{
float result = 0;
float2 coordsCopy = coords;
float scale = 0.5;
for (int i = 0; i < 4; i++)
{
result += PerlinNoise(coordsCopy) * scale;
coordsCopy *= 2;
scale *= 0.5;
}
return result;
}
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
{
float motion = ScaledNoise(coords * uSaturation * 12 + float2(uTime * fogMovementSpeed * -0.23, uTime * fogMovementSpeed * 0.64));
float2 motion2D = motion;
float3 noise = ScaledNoise(coords * uSaturation * 15 + motion2D + float2(0, uTime * 0.78));
return lerp(float4(noise, 1), float4(uColor, 1), 0.67) * uOpacity * 0.2;
}
technique Technique1
{
pass DyePass
{
PixelShader = compile ps_3_0 PixelShaderFunction();
}
}
Binary file not shown.
+67
View File
@@ -0,0 +1,67 @@
sampler uImage0 : register(s0);
sampler uImage1 : register(s1);
sampler uImage2 : register(s2);
float3 uColor;
float3 uSecondaryColor;
float uOpacity;
float uSaturation;
float uRotation;
float uTime;
float4 uSourceRect;
float2 uWorldPosition;
float uDirection;
float3 uLightSource;
float2 uImageSize0;
float2 uImageSize1;
matrix uWorldViewProjection;
float4 uShaderSpecificData;
struct VertexShaderInput
{
float4 Position : POSITION0;
float4 Color : COLOR0;
float2 TextureCoordinates : TEXCOORD0;
};
struct VertexShaderOutput
{
float4 Position : SV_POSITION;
float4 Color : COLOR0;
float2 TextureCoordinates : TEXCOORD0;
};
VertexShaderOutput VertexShaderFunction(in VertexShaderInput input)
{
VertexShaderOutput output = (VertexShaderOutput)0;
float4 pos = mul(input.Position, uWorldViewProjection);
output.Position = pos;
output.Color = input.Color;
output.TextureCoordinates = input.TextureCoordinates;
return output;
}
// The X coordinate is the trail completion, the Y coordinate is the same as any other.
// This is simply how the primitive TextCoord is layed out in the C# code.
// Inputted images go into uImage1 sampler, in case you have a noise map or something similar.
float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
{
float4 color = input.Color;
float2 coords = input.TextureCoordinates;
float2 pixellatedCoords = round(coords * 20) / 20;
float4 noiseColor = tex2D(uImage1, float2(pixellatedCoords.x - uTime * 1.3, pixellatedCoords.y) * float2(0.5, 1));
float4 noiseColor2 = tex2D(uImage1, float2(pixellatedCoords.x - uTime * 1.1, pixellatedCoords.y + uTime * 0.44) * float2(0.5, 1));
float4 baseColor = lerp(noiseColor, noiseColor2, sin(uTime * 5.1 + coords.x * 3.4) * 0.5 + 0.5);
baseColor = pow(baseColor, 2);
return lerp(color * 0.4, 1, baseColor.r) * uOpacity;
}
technique Technique1
{
pass TrailPass
{
VertexShader = compile vs_2_0 VertexShaderFunction();
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}
Binary file not shown.
-2
View File
@@ -156,8 +156,6 @@ namespace CalamityMod.Events
new Boss(ModContent.NPCType<DesertScourgeHead>(), spawnContext: type =>
{
NPC.SpawnOnPlayer(ClosestPlayerToWorldCenter, ModContent.NPCType<DesertScourgeHead>());
NPC.SpawnOnPlayer(ClosestPlayerToWorldCenter, ModContent.NPCType<DesertNuisanceHead>());
NPC.SpawnOnPlayer(ClosestPlayerToWorldCenter, ModContent.NPCType<DesertNuisanceHeadYoung>());
}, permittedNPCs: new int[] { ModContent.NPCType<DesertScourgeBody>(), ModContent.NPCType<DesertScourgeTail>(), ModContent.NPCType<DesertNuisanceHead>(),
ModContent.NPCType<DesertNuisanceBody>(), ModContent.NPCType<DesertNuisanceTail>(), ModContent.NPCType<DesertNuisanceHeadYoung>(),
ModContent.NPCType<DesertNuisanceBodyYoung>(), ModContent.NPCType<DesertNuisanceTailYoung>() }),
Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

+10
View File
@@ -3,6 +3,7 @@ using System.Reflection;
using CalamityMod.Graphics.Renderers.CalamityRenderers;
using CalamityMod.Tiles.DraedonStructures;
using CalamityMod.Tiles.FurnitureExo;
using CalamityMod.Walls;
using Terraria;
using Terraria.DataStructures;
using Terraria.GameContent;
@@ -39,6 +40,7 @@ namespace CalamityMod.ILEditing
// Graphics
IL_Main.DoDraw += AdditiveDrawing;
IL_Main.DoDraw += DrawFloralParadiseFog;
On_Main.DrawGore += DrawForegroundStuff;
On_Main.DrawCursor += UseCoolFireCursorEffect;
On_Main.SortDrawCacheWorms += DrawFusableParticles;
@@ -171,6 +173,14 @@ namespace CalamityMod.ILEditing
//HeldOnlyItem detours Player.dropItemCheck, ItemSlot.Draw (Sb, itemarray, int, int, vector2, color) and ItemSlot.LeftClick_ItemArray to make its stuff work
}
/// <summary>
/// Loads things which need to be instantiated later in the load order.
/// </summary>
public override void AddRecipes()
{
WallVisibleThroughWater.InitializeWaterMapEntryLookups();
}
/// <summary>
/// Unloads all IL Editing changes in the mod.
/// </summary>
+79 -9
View File
@@ -22,6 +22,7 @@ using CalamityMod.Projectiles;
using CalamityMod.Projectiles.Typeless;
using CalamityMod.Systems;
using CalamityMod.Tiles.Abyss;
using CalamityMod.Waterfalls;
using CalamityMod.Waters;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
@@ -724,6 +725,42 @@ namespace CalamityMod.ILEditing
}
#endregion
#region Fog Effect in Floral Paradise
private static void DrawFloralParadiseFog(ILContext il)
{
ILCursor cursor = new ILCursor(il);
cursor.GotoNext(MoveType.Before, i => i.MatchCallOrCallvirt<Main>("DrawInfernoRings"));
cursor.EmitDelegate<Action>(() =>
{
if (Main.netMode != NetmodeID.Server && BiomeTileCounterSystem.FloralParadiseTiles > 0)
DrawFog(Utils.GetLerpValue(0f, 250f, BiomeTileCounterSystem.FloralParadiseTiles, true));
});
}
private static void DrawFog(float intensity)
{
Main.spriteBatch.EnterShaderRegion();
WaterfallRenderer.DrawWaterfalls();
Texture2D fogTexture = ModContent.Request<Texture2D>("Terraria/Images/Misc/Perlin").Value;
Vector2 scale = new Vector2(Main.screenWidth, Main.screenHeight) / fogTexture.Size();
Main.spriteBatch.End();
Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix);
GameShaders.Misc["CalamityMod:Fog"].UseOpacity(intensity * 0.74f);
GameShaders.Misc["CalamityMod:Fog"].UseColor(Color.Lerp(Color.Lime, Color.Black, 0.85f));
GameShaders.Misc["CalamityMod:Fog"].UseSaturation(1.67f);
GameShaders.Misc["CalamityMod:Fog"].Shader.Parameters["fogMovementSpeed"].SetValue(1.75f);
GameShaders.Misc["CalamityMod:Fog"].Apply();
Main.spriteBatch.Draw(fogTexture, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, scale, SpriteEffects.None, 0f);
Main.spriteBatch.End();
Main.spriteBatch.Begin();
}
#endregion Fog Effect in Floral Paradise
#region Custom Draw Layers
private static void AdditiveDrawing(ILContext il)
{
@@ -864,7 +901,11 @@ namespace CalamityMod.ILEditing
cursor.Emit(OpCodes.Ldloc, 4);
// Caching these values can save a LOT of overhead at runtime.
ModWaterStyle sunkenSeaWater = ModContent.GetInstance<SunkenSeaWater>();
ModWaterStyle basaltWater = ModContent.GetInstance<BasaltGullyWater>();
ModWaterStyle burrowsWater = ModContent.GetInstance<SunkenSeaBurrowsWater>();
ModWaterStyle polypWater = ModContent.GetInstance<SunkenSeaPolypWater>();
ModWaterStyle reefsWater = ModContent.GetInstance<SunkenSeaReefsWater>();
ModWaterStyle shoresWater = ModContent.GetInstance<SunkenSeaShoresWater>();
ModWaterStyle sulphuricWater = ModContent.GetInstance<SulphuricWater>();
ModWaterStyle sulphuricDepthsWater = ModContent.GetInstance<SulphuricDepthsWater>();
ModWaterStyle upperAbyssWater = ModContent.GetInstance<UpperAbyssWater>();
@@ -878,8 +919,11 @@ namespace CalamityMod.ILEditing
{
initialColor = SelectLavaQuadColor(initialTexture, ref initialColor, liquidType == 1);
}
if (liquidType == sunkenSeaWater.Slot ||
if (liquidType == burrowsWater.Slot ||
liquidType == basaltWater.Slot ||
liquidType == polypWater.Slot ||
liquidType == shoresWater.Slot ||
liquidType == reefsWater.Slot ||
liquidType == sulphuricWater.Slot ||
liquidType == sulphuricDepthsWater.Slot ||
liquidType == upperAbyssWater.Slot ||
@@ -1000,13 +1044,13 @@ namespace CalamityMod.ILEditing
return;
Tile tile = CalamityUtils.ParanoidTileRetrieval(x, y);
if (tile.LiquidAmount <= 0 || tile.HasTile || (Main.waterStyle != SulphuricWater.Type &&
Main.waterStyle != SulphuricDepthsWater.Type && Main.waterStyle != SunkenSeaWater.Type))
if (tile.LiquidAmount <= 0 || tile.HasTile || tile.Get<LiquidData>().LiquidType != LiquidID.Water || (Main.waterStyle != SulphuricWater.Type &&
Main.waterStyle != SulphuricDepthsWater.Type && Main.waterStyle != SunkenSeaBurrowsWater.Type && Main.waterStyle != SunkenSeaPolypWater.Type &&
Main.waterStyle != SunkenSeaReefsWater.Type && Main.waterStyle != SunkenSeaShoresWater.Type && Main.waterStyle != BasaltGullyWater.Type))
return;
Tile above = CalamityUtils.ParanoidTileRetrieval(x, y - 1);
if (!Main.gamePaused && !above.HasTile && above.LiquidAmount <= 0 && Main.rand.NextBool(9) &&
Main.waterStyle == SulphuricWater.Type)
if (!Main.gamePaused && !above.HasTile && above.LiquidAmount <= 0 && Main.rand.NextBool(9) && Main.waterStyle == SulphuricWater.Type)
{
MediumMistParticle acidFoam = new(new(x * 16f + Main.rand.NextFloat(16f), y * 16f + 8f), -Vector2.UnitY.RotatedByRandom(0.67f) * Main.rand.NextFloat(1f, 2.4f), Color.LightSeaGreen, Color.White, 0.16f, 128f, 0.02f);
GeneralParticleHandler.SpawnParticle(acidFoam);
@@ -1073,8 +1117,34 @@ namespace CalamityMod.ILEditing
if (Main.waterStyle == SulphuricDepthsWater.Type)
outputColor = Vector3.Lerp(outputColor, Color.MediumSeaGreen.ToVector3(), 0.18f);
if (Main.waterStyle == SunkenSeaWater.Type)
if (Main.waterStyle == SunkenSeaBurrowsWater.Type || Main.waterStyle == SunkenSeaPolypWater.Type || Main.waterStyle == SunkenSeaReefsWater.Type ||
Main.waterStyle == SunkenSeaShoresWater.Type || Main.waterStyle == BasaltGullyWater.Type)
{
//default to white
Color waterGlowColor = Color.White;
//set the glow colors for each sunken sea biome water style
if (Main.waterStyle == SunkenSeaShoresWater.Type)
{
waterGlowColor = new Color(233, 170, 184);
}
if (Main.waterStyle == SunkenSeaPolypWater.Type)
{
waterGlowColor = new Color(213, 185, 178);
}
if (Main.waterStyle == SunkenSeaReefsWater.Type)
{
waterGlowColor = new Color(140, 222, 239);
}
if (Main.waterStyle == SunkenSeaBurrowsWater.Type)
{
waterGlowColor = new Color(76, 211, 231);
}
if (Main.waterStyle == BasaltGullyWater.Type)
{
waterGlowColor = new Color(144, 174, 200);
}
float brightness = MathHelper.Clamp(0.07f, 0f, 0.07f);
float waveScale1 = Main.GameUpdateCount * 0.028f;
float waveScale2 = Main.GameUpdateCount * 0.1f;
@@ -1094,7 +1164,7 @@ namespace CalamityMod.ILEditing
float wave5angle = 0.55f + 0.45f * (float)Math.Sin(MathHelper.ToRadians(wave5));
float wave6angle = 0.55f + 0.45f * (float)Math.Sin(MathHelper.ToRadians(wave6));
float bigwaveangle = 0.55f + 0.80f * (float)Math.Sin(MathHelper.ToRadians(bigwave));
outputColor = Vector3.Lerp(outputColor, Color.DeepSkyBlue.ToVector3(), 0.07f + wave1angle + wave2angle + wave3angle + wave4angle + wave5angle + wave6angle + bigwaveangle);
outputColor = Vector3.Lerp(outputColor, Color.DarkSlateGray.ToVector3(), 0.07f + wave1angle + wave2angle + wave3angle + wave4angle + wave5angle + wave6angle + bigwaveangle);
outputColor *= brightness;
}
}
+19 -2
View File
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using CalamityMod.Balancing;
using CalamityMod.Items.Fishing;
using CalamityMod.Items.Materials;
using CalamityMod.Items.TreasureBags.MiscGrabBags;
@@ -13,14 +12,20 @@ using Mono.Cecil.Cil;
using MonoMod.Cil;
using Terraria;
using Terraria.DataStructures;
using Terraria.GameContent.Drawing;
using Terraria.ID;
using Terraria.Map;
using Terraria.ModLoader;
namespace CalamityMod.ILEditing
{
public partial class ILChanges
{
public static WindGrid Windgrid
{
get;
internal set;
}
#region Decrease Sandstorm Wind Speed Requirement
private static void DecreaseSandstormWindSpeedRequirement(ILContext il)
{
@@ -957,5 +962,17 @@ namespace CalamityMod.ILEditing
c.Emit(OpCodes.Stloc, relativeMapTypeIndex);
}
#endregion
// 02JUN2024: Ozzatron: The below code is being kept in its initial state for historic value.
#region Store The Stupid Fucking Private Wind Map In Public Property
private static void StoreWindGrid(On_TileDrawing.orig_Update orig, TileDrawing self)
{
orig(self);
// FUCK YOU FUCK YOU FUCK YOU FUCK YOU FUCK YOU FUCK YOU FUCK YOU FUCK YOU FUCK YOU FUCK
if (Windgrid is null)
Windgrid = typeof(TileDrawing).GetField("_windGrid", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(self) as WindGrid;
}
#endregion Store The Stupid Fucking Private Wind Map In Public Property
}
}
+3 -2
View File
@@ -29,8 +29,9 @@ namespace CalamityMod.Items.Accessories
{
CreateRecipe().
AddIngredient(ItemID.BottledWater).
AddIngredient(ItemID.BeeWax, 5).
AddIngredient<PlagueCellCanister>(10).
AddIngredient(ItemID.HoneyComb).
AddIngredient(ItemID.BeeWax, 8).
AddIngredient<PlagueCellCanister>(15).
AddTile(TileID.MythrilAnvil).
Register();
}
-38
View File
@@ -1,38 +0,0 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.CalPlayer;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
{
public class PlagueHive : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public override void SetDefaults()
{
Item.width = 42;
Item.height = 48;
Item.value = CalamityGlobalItem.RarityRedBuyPrice;
Item.rare = ItemRarityID.Red;
Item.accessory = true;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<AlchemicalFlask>().
AddIngredient(ItemID.HoneyComb).
AddTile(TileID.LunarCraftingStation).
Register();
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.uberBees = true;
modPlayer.alchFlask = true;
player.buffImmune[ModContent.BuffType<Plague>()] = true;
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 825 B

+1 -1
View File
@@ -213,7 +213,7 @@ namespace CalamityMod.Items.Accessories
string stats3 = "\n" + this.GetLocalization("GenericStats").Format(
player.GetCurrentDefense(false),
TwoPlaces(100f * player.endurance),
player.lifeRegen, // Normally we'd divide this by 2 in Expert without Well Fed, but we disable that shit
OnePlace((float)player.lifeRegen / 2f), // Divided by 2 to show HP/s, because vanilla! Also normally we'd divide this by 2 in Expert without Well Fed, but we disable that shit
Sign(moveSpeedBoost) + TwoPlaces(100f * moveSpeedBoost),
TwoPlaces(20f * player.GetJumpBoost()));
// Show wing stats only if over 0 flight time
+1 -1
View File
@@ -24,7 +24,7 @@ namespace CalamityMod.Items.Accessories
CalamityPlayer modPlayer = player.Calamity();
modPlayer.holyMinions = true;
player.GetKnockback<SummonDamageClass>() += 2.5f;
player.GetDamage<SummonDamageClass>() += 0.1f;
player.GetDamage<SummonDamageClass>() += 0.12f;
}
public override void AddRecipes()
+1 -1
View File
@@ -35,7 +35,7 @@ namespace CalamityMod.Items.Accessories
modPlayer.shadowMinions = true;
modPlayer.holyMinions = true;
player.GetKnockback<SummonDamageClass>() += 2.75f;
player.GetDamage<SummonDamageClass>() += 0.1f;
player.GetDamage<SummonDamageClass>() += 0.12f;
player.buffImmune[ModContent.BuffType<Shadowflame>()] = true;
}
+1 -1
View File
@@ -13,7 +13,7 @@ namespace CalamityMod.Items.Accessories
{
Item.width = 20;
Item.height = 24;
Item.defense = 15;
Item.defense = 10;
Item.value = CalamityGlobalItem.RarityRedBuyPrice;
Item.rare = ItemRarityID.Red;
Item.accessory = true;
+2 -38
View File
@@ -5,6 +5,7 @@ using CalamityMod.Projectiles.Typeless;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.Audio;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
@@ -12,6 +13,7 @@ namespace CalamityMod.Items.Accessories
public class ToxicHeart : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public float pulseCounter = 0;
public override void SetDefaults()
{
Item.width = 28;
@@ -25,44 +27,6 @@ namespace CalamityMod.Items.Accessories
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.toxicHeart = true;
player.buffImmune[ModContent.BuffType<Plague>()] = true;
int plagueCounter = 0;
Lighting.AddLight((int)(player.Center.X / 16f), (int)(player.Center.Y / 16f), 0.05f, 1f, 0.1f);
int plagueDebuff = ModContent.BuffType<Plague>();
bool shouldInflictPlague = plagueCounter % 60 == 0;
int auraDamage = (int)player.GetBestClassDamage().ApplyTo(50);
auraDamage = player.ApplyArmorAccDamageBonusesTo(auraDamage);
int random = Main.rand.Next(10);
var source = player.GetSource_Accessory(Item);
if (player.whoAmI == Main.myPlayer)
{
if (random == 0)
{
foreach (NPC nPC in Main.ActiveNPCs)
{
if (nPC.IsAnEnemy() && !nPC.dontTakeDamage && !nPC.buffImmune[plagueDebuff] && Vector2.Distance(player.Center, nPC.Center) <= 300f)
{
if (nPC.FindBuffIndex(plagueDebuff) == -1)
{
nPC.AddBuff(plagueDebuff, 120, false);
}
if (shouldInflictPlague)
{
if (player.whoAmI == Main.myPlayer)
{
Projectile.NewProjectileDirect(source, nPC.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), auraDamage, 0f, player.whoAmI, nPC.whoAmI);
}
}
}
}
}
}
plagueCounter++;
if (plagueCounter >= 180)
{
}
}
}
}
+88 -18
View File
@@ -16,6 +16,7 @@ using CalamityMod.Items.Weapons.Summon;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Terraria;
using Terraria.ID;
using Terraria.Localization;
@@ -29,7 +30,26 @@ namespace CalamityMod.Items
#region Main ModifyTooltips Function
public override void ModifyTooltips(Item item, List<TooltipLine> tooltips)
{
// Apply rarity coloration to the item's name.
// Get the first index, last index and total count of standard vanilla tooltip lines.
// The first index and count are used to delete all vanilla tooltips when holding SHIFT, if requested.
// The last index is used to insert various extra tooltip lines in the right position.
//
// This code used to be in the HoldShiftTooltip utility, but is needed to correctly place other tooltips.
int firstTooltipIndex = -1;
int lastTooltipIndex = -1;
int standardTooltipCount = 0;
for (int i = 0; i < tooltips.Count; i++)
{
if (tooltips[i].Name.StartsWith("Tooltip"))
{
if (firstTooltipIndex == -1)
firstTooltipIndex = i;
lastTooltipIndex = i;
standardTooltipCount++;
}
}
// Apply custom rarity coloration to the item's name if applicable.
TooltipLine nameLine = tooltips.FirstOrDefault(x => x.Name == "ItemName" && x.Mod == "Terraria");
if (nameLine != null)
ApplyRarityColor(item, nameLine);
@@ -40,20 +60,21 @@ namespace CalamityMod.Items
// Adds "Does extra damage to enemies shot at point-blank range" to weapons capable of it.
if (canFirePointBlankShots)
{
TooltipLine line = new TooltipLine(Mod, "PointBlankShot", "Does extra damage to enemies shot at point-blank range");
tooltips.Add(line);
var lineText = CalamityUtils.GetText("Misc.PointBlank");
TooltipLine line = new TooltipLine(Mod, "CalamityMod:PointBlankTooltip", lineText.Value);
tooltips.Insert(++lastTooltipIndex, line);
}
// If an item has an enchantment, show its prefix in the first tooltip line and append its description to the
// tooltip list.
// If an item has an enchantment, show its prefix in the first tooltip line and append its description to the tooltip list.
EnchantmentTooltips(item, tooltips);
// Replace rogue with rouge in gfb
// In GFB, replace all instances of "rogue" with "rouge".
if (Main.zenithWorld)
{
tooltips.FindAndReplace("Rogue", "Rouge");
tooltips.FindAndReplace("rogue", "rouge");
}
// Everything below this line can only apply to modded items. If the item is vanilla, stop here for efficiency.
if (item.type < ItemID.Count)
return;
@@ -65,27 +86,68 @@ namespace CalamityMod.Items
// Convert current charge ratio into a percentage.
float displayedPercent = ChargeRatio * 100f;
TooltipLine line = new TooltipLine(Mod, "CalamityCharge", $"Current Charge: {displayedPercent:N1}%");
tooltips.Add(line);
tooltips.Insert(++lastTooltipIndex, line);
}
// Generic support for any and all Hold SHIFT tooltips.
// For more information, see IHoldShiftTooltipItem.
if (item.ModItem is IHoldShiftTooltipItem holdShiftItem)
{
string dynamicKey = $"{Mod.Name}:{item.ModItem.Name}_HoldShift";
string lineText = item.ModItem.GetLocalizedValue(holdShiftItem.TooltipExtensionKey);
var line = new TooltipLine(Mod, dynamicKey, lineText);
if (holdShiftItem.TooltipExtensionColor is not null)
line.OverrideColor = holdShiftItem.TooltipExtensionColor;
TooltipLine[] lines = { line };
//
// Original code lifted from Iban's extended armor tooltips.
//
bool holdingShift = Main.keyState.IsKeyDown(Keys.LeftShift);
// If holding SHIFT, actually display the extended tooltip.
if (holdingShift && firstTooltipIndex != -1)
{
// If asked to, remove all standard tooltip lines. This moves the last tooltip index.
if (holdShiftItem.HidesNormalTooltip)
{
tooltips.RemoveRange(firstTooltipIndex, standardTooltipCount);
lastTooltipIndex -= standardTooltipCount;
}
// Append every "Hold SHIFT" tooltip at the end of standard tooltips.
tooltips.InsertRange(++lastTooltipIndex, lines);
}
// If not holding SHIFT, display the extension indicator if appropriate.
if (!holdingShift && holdShiftItem.ShowExtensionIndicator)
{
LocalizedText indicatorText = CalamityUtils.GetText(holdShiftItem.ExtensionIndicatorKey);
var indicator = new TooltipLine(Mod, IHoldShiftTooltipItem.ExtensionIndicatorTooltipID, indicatorText.Value);
if (holdShiftItem.ExtensionIndicatorColor is not null)
indicator.OverrideColor = holdShiftItem.ExtensionIndicatorColor;
tooltips.Insert(++lastTooltipIndex, indicator);
}
}
// Adds "Donor Item" and "Developer Item" to donor items and developer items respectively.
if (donorItem)
{
TooltipLine line = new TooltipLine(Mod, "CalamityDonor", CalamityUtils.ColorMessage("- Donor Item -", CalamityUtils.DonatorItemColor));
tooltips.Add(line);
}
// This is intentionally at the bottom, below everything else.
if (devItem)
{
TooltipLine line = new TooltipLine(Mod, "CalamityDev", CalamityUtils.ColorMessage("- Developer Item -", CalamityUtils.DevItemColor));
tooltips.Add(line);
}
else if (donorItem)
{
TooltipLine line = new TooltipLine(Mod, "CalamityDonor", CalamityUtils.ColorMessage("- Donor Item -", CalamityUtils.DonatorItemColor));
tooltips.Add(line);
}
}
#endregion
#region Rarity Coloration
private void ApplyRarityColor(Item item, TooltipLine nameLine)
private static void ApplyRarityColor(Item item, TooltipLine nameLine)
{
#region Uniquely Colored Items
if (item.type == ModContent.ItemType<LiliesOfFinality>())
nameLine.OverrideColor = Color.Lerp(Color.Red, Color.White, (float)Math.Sin(Main.GlobalTimeWrappedHourly) / 2f + 0.5f);
if (item.type == ModContent.ItemType<HeartoftheElements>() || item.type == ModContent.ItemType<TheCommunity>() || item.type == ModContent.ItemType<IridescentExcalibur>())
@@ -192,7 +254,6 @@ namespace CalamityMod.Items
nameLine.OverrideColor = Color.Lerp(currentColor, nextColor, Main.GlobalTimeWrappedHourly % 2f > 1f ? 1f : Main.GlobalTimeWrappedHourly % 1f);
}
}
#endregion
}
#endregion
@@ -262,6 +323,10 @@ namespace CalamityMod.Items
if (item.type == ModContent.ItemType<LiliesOfFinality>())
EditTooltipByName("Damage", (line) => line.Text = LiliesOfFinality.TheNumber + " summon damage");
// Apparently 612 is a homestuck reference
if (item.type == ModContent.ItemType<Respiteblock>())
EditTooltipByName("AxePower", (line) => line.Text = line.Text.Replace("610%", "612%"));
// Master Mode items also drop in Revengeance
// Only affects vanilla and Calamity items
if (item.master && (item.type < ItemID.Count || item.ModItem?.Mod is CalamityMod))
@@ -323,10 +388,13 @@ namespace CalamityMod.Items
if (item.type == ItemID.HamBat)
EditTooltipByNum(1, (line) => line.Text = "Defeating enemies temporarily grants +3 HP/s life regen");
// Warmth Potion provides debuff immunities
if (item.type == ItemID.AegisCrystal)
EditTooltipByNum(0, (line) => line.Text = "Permanently boosts natural life regeneration");
// Warmth Potion reduces debuff durations
if (item.type == ItemID.WarmthPotion)
{
string immunityLine = "\nGrants immunity to Chilled, Frozen and Glacial State";
string immunityLine = "\nGreatly reduces the duration of Chilled, Frozen, and Glacial State";
EditTooltipByNum(0, (line) => line.Text += immunityLine);
}
@@ -619,7 +687,7 @@ namespace CalamityMod.Items
{
EditTooltipByNum(0, (line) => line.Text = "Multiplies all fire-based debuff damage by 1.25\n" +
"All attacks light enemies on fire\n" +
"'Never get cold feet again'\n");
"'Never get cold feet again'");
}
// Hellfire Treads buff.
@@ -920,6 +988,8 @@ namespace CalamityMod.Items
// Solar Flare
if (item.type == ItemID.SolarFlareHelmet)
EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("26%", "20%"));
if (item.type == ItemID.SolarFlareHelmet || item.type == ItemID.SolarFlareBreastplate || item.type == ItemID.SolarFlareLeggings)
EditTooltipByNum(1, (line) => line.Text = "Grants +1 HP/s life regeneration");
// Vortex
if (item.type == ItemID.VortexHelmet)
+5 -5
View File
@@ -45,8 +45,9 @@ namespace CalamityMod.Items
{ ItemID.Bananarang, Do(DamageExact(76), UseExact(14)) },
{ ItemID.BatScepter, Do(DamageExact(56)) },
{ ItemID.BeamSword, Do(UseMeleeSpeed, DamageExact(142), UseAnimationExact(45), ShootSpeedExact(23f), KnockbackExact(8)) },
{ ItemID.BeeGun, Do(DamageExact(10), ManaExact(4)) },
{ ItemID.BeesKnees, Do(PointBlank, DamageExact(18), UseExact(38)) },
{ ItemID.BeeGun, Do(DamageExact(13), ManaExact(4)) },
{ ItemID.BeeKeeper, Do((UseTurn),DamageExact(32)) },
{ ItemID.BeesKnees, Do(PointBlank, DamageExact(24), UseExact(38)) },
{ ItemID.Bladetongue, Do(UseTurn, UseRatio(0.8f), DamageExact(120)) },
{ ItemID.BlizzardStaff, Do(DamageExact(41), ManaExact(7)) },
{ ItemID.BloodyMachete, Do(AutoReuse, DamageExact(24)) },
@@ -127,7 +128,7 @@ namespace CalamityMod.Items
{ ItemID.HellwingBow, Do(PointBlank, DamageExact(16)) },
{ ItemID.HighVelocityBullet, Do(DamageExact(13)) },
{ ItemID.HiveFive, Do(AutoReuse, DamageExact(26)) },
{ ItemID.HornetStaff, Do(AutoReuse, DamageExact(13), UseExact(30)) },
{ ItemID.HornetStaff, Do(AutoReuse, DamageExact(18), UseExact(30)) },
{ ItemID.IceBlade, Do(UseMeleeSpeed) },
{ ItemID.IceBoomerang, Do(UseExact(25), ShootSpeedExact(9)) },
{ ItemID.IceRod, Do(UseExact(6), DamageExact(30), ShootSpeedExact(20)) },
@@ -185,7 +186,7 @@ namespace CalamityMod.Items
{ ItemID.PalladiumSword, Do(UseTurn, DamageExact(100)) },
{ ItemID.PearlwoodBow, Do(AutoReuse, PointBlank, DamageExact(20), UseDelta(+8), ShootSpeedDelta(+3.4f), KnockbackDelta(+1f)) },
{ ItemID.PearlwoodSword, Do(UseTurn, DamageExact(45)) },
{ ItemID.PewMaticHorn, Do(DamageExact(24)) },
{ ItemID.PewMaticHorn, Do(DamageExact(25), ShootSpeedExact(15)) },
{ ItemID.Phantasm, Do(PointBlank, DamageExact(48)) },
{ ItemID.PhoenixBlaster, Do(AutoReuse, PointBlank, UseExact(18)) },
{ ItemID.PiranhaGun, Do(DamageExact(48)) },
@@ -511,7 +512,6 @@ namespace CalamityMod.Items
#region CATEGORY 7: Other Quality of Life (AutoReuse / UseTurn)
{ ItemID.Amarok, autoReuse },
{ ItemID.BatBat, autoReuse },
{ ItemID.BeeKeeper, Do(UseTurn) },
{ ItemID.BladeofGrass, Do(AutoReuse, UseTurn) },
{ ItemID.BloodButcherer, Do(AutoReuse, UseTurn) },
{ ItemID.BoneSword, Do(AutoReuse, UseTurn) },
@@ -51,6 +51,7 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches
// Materials
itemLoot.Add(ModContent.ItemType<Navystone>(), 1, 10, 30);
itemLoot.Add(ModContent.ItemType<EutrophicSand>(), 1, 10, 30);
itemLoot.Add(ModContent.ItemType<Driftwood>(), 1, 30, 60);
postDesertScourge.Add(ModContent.ItemType<PrismShard>(), 1, 5, 10);
postDesertScourge.Add(ModContent.ItemType<SeaPrism>(), 5, 2, 5);
@@ -54,6 +54,7 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches
// Materials
itemLoot.Add(ModContent.ItemType<Navystone>(), 1, 10, 30);
itemLoot.Add(ModContent.ItemType<EutrophicSand>(), 1, 10, 30);
itemLoot.Add(ModContent.ItemType<Driftwood>(), 1, 30, 60);
postDesertScourge.Add(ModContent.ItemType<PrismShard>(), 1, 5, 10);
postDesertScourge.Add(ModContent.ItemType<SeaPrism>(), 5, 2, 5);
postHardmodeClam.Add(ModContent.ItemType<MolluskHusk>(), new Fraction(12, 100), 2, 5);
+61
View File
@@ -0,0 +1,61 @@
using Microsoft.Xna.Framework;
namespace CalamityMod.Items
{
// This interface is used on items where you can hold Left SHIFT for an expanded tooltip.
// All actual implementation of this behavior is done in CalamityGlobalItemTooltip.
public interface IHoldShiftTooltipItem
{
/// <summary>
/// Internal ID for the TooltipLine which contains Calamity items' "Hold SHIFT" extension indicators.
/// </summary>
internal const string ExtensionIndicatorTooltipID = "CalamityMod:HoldShiftExtensionIndicator";
/// <summary>
/// The lang/localization key of the default tooltip extension indicator message.
/// </summary>
public const string DefaultExtensionIndicatorKey = "UI.HoldShiftTooltipExtensionIndicator";
/// <summary>
/// The default color of the default tooltip extension indicator message.
/// </summary>
public static readonly Color DefaultExtensionIndicatorColor = new Color(184, 184, 184); // #B8B8B8
/// <summary>
/// The default lang/localization key which is queried to show an item's tooltip extension.
/// </summary>
public const string DefaultTooltipExtensionKey = "HoldShiftTooltip";
/// <summary>
/// Whether holding Left SHIFT for the tooltip extension hides the normal tooltip. Typically this is false.
/// </summary>
public virtual bool HidesNormalTooltip => false;
/// <summary>
/// Whether the "Hold SHIFT for more" extension indicator appears by default. Should essentially always be true.<br />
/// You can set this to false for "secret" flavor or easter egg tooltips, like the one on Midas Prime.
/// </summary>
public virtual bool ShowExtensionIndicator => true;
/// <summary>
/// The lang/localization key of this item's tooltip extension indicator message.
/// </summary>
public virtual string ExtensionIndicatorKey => DefaultExtensionIndicatorKey;
/// <summary>
/// The color of this item's tooltip extension indicator message. If set to <b>null</b>, the indicator will not be colored.
/// </summary>
public virtual Color? ExtensionIndicatorColor => DefaultExtensionIndicatorColor;
/// <summary>
/// The lang/localization key which this item uses for its tooltip extension.
/// </summary>
public virtual string TooltipExtensionKey => DefaultTooltipExtensionKey;
/// <summary>
/// The color of this item's tooltip extension. If set to <b>null</b>, the tooltip extension will not be colored.
/// </summary>
public virtual Color? TooltipExtensionColor => null;
}
}
+12 -17
View File
@@ -1,21 +1,25 @@
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.Items.LoreItems
{
public abstract class LoreItem : ModItem, ILocalizedModType
public abstract class LoreItem : ModItem, ILocalizedModType, IHoldShiftTooltipItem
{
public new string LocalizationCategory => "Items.Lore";
// All lore items initially have a short tooltip which indicates there is more to be read.
public override LocalizedText Tooltip => CalamityUtils.GetText($"{LocalizationCategory}.ShortTooltip");
// When holding SHIFT on a lore item, the default tooltip is removed entirely.
public bool HidesNormalTooltip => true;
// By default, lore text appears in white, but this can be changed.
public virtual Color? LoreColor => null;
// Lore items have a flavorful extension indicator tooltip.
public string ExtensionIndicatorKey => $"{LocalizationCategory}.ShortTooltip";
// Each line of the extension indicator tooltip is manually colored, so don't provide an override color.
public Color? ExtensionIndicatorColor => null;
// The localization key for all lore items' full lore content is just "Lore".
public string TooltipExtensionKey => "Lore";
public override void SetStaticDefaults()
{
@@ -30,14 +34,5 @@ namespace CalamityMod.Items.LoreItems
{
itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.LoreItems;
}
// All lore items use the same code for holding SHIFT to extend tooltips.
public override void ModifyTooltips(List<TooltipLine> tooltips)
{
TooltipLine fullLore = new(Mod, "CalamityMod:Lore", this.GetLocalizedValue("Lore"));
if (LoreColor.HasValue)
fullLore.OverrideColor = LoreColor.Value;
CalamityUtils.HoldShiftTooltip(tooltips, new TooltipLine[] { fullLore }, true);
}
}
}
-2
View File
@@ -20,11 +20,9 @@ namespace CalamityMod.Items.Pets
Item.useTime = 20;
Item.useStyle = ItemUseStyleID.Swing;
Item.noMelee = true;
Item.value = Item.sellPrice(platinum: 1);
Item.rare = ItemRarityID.Cyan;
Item.Calamity().devItem = true;
Item.shoot = ModContent.ProjectileType<EidolonSnail>();
Item.buffType = ModContent.BuffType<EidolonSnailBuff>();
Item.UseSound = SoundID.Item2;
+30
View File
@@ -0,0 +1,30 @@
using CalamityMod.Tiles.FloralParadise;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Placeables
{
public class AlgalSlateItem : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Placeables";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 100;
}
public override void SetDefaults()
{
Item.createTile = ModContent.TileType<AlgalSlate>();
Item.useStyle = ItemUseStyleID.Swing;
Item.useTurn = true;
Item.useAnimation = 15;
Item.useTime = 10;
Item.autoReuse = true;
Item.consumable = true;
Item.width = 16;
Item.height = 16;
Item.maxStack = 999;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 270 B

+28
View File
@@ -0,0 +1,28 @@
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Placeables
{
public class Basalt : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Placeables";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 100;
}
public override void SetDefaults()
{
Item.width = 12;
Item.height = 12;
Item.maxStack = 9999;
Item.useTurn = true;
Item.autoReuse = true;
Item.useAnimation = 15;
Item.useTime = 10;
Item.useStyle = ItemUseStyleID.Swing;
Item.consumable = true;
Item.createTile = ModContent.TileType<Tiles.SunkenSea.Basalt>();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 232 B

+37
View File
@@ -0,0 +1,37 @@
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Placeables
{
public class BlackPearlPile : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Placeables";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 100;
}
public override void SetDefaults()
{
Item.width = 12;
Item.height = 12;
Item.rare = ItemRarityID.Blue;
Item.maxStack = 9999;
Item.useTurn = true;
Item.autoReuse = true;
Item.useAnimation = 15;
Item.useTime = 10;
Item.useStyle = ItemUseStyleID.Swing;
Item.consumable = true;
Item.createTile = ModContent.TileType<Tiles.SunkenSea.BlackPearlPile>();
}
public override void AddRecipes()
{
CreateRecipe(4).
AddIngredient(ItemID.BlackPearl).
AddTile(TileID.HeavyWorkBench).
Register();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 244 B

+37
View File
@@ -0,0 +1,37 @@
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Placeables
{
public class CyanCoral : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Placeables";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 100;
}
public override void SetDefaults()
{
Item.width = 12;
Item.height = 12;
Item.rare = ItemRarityID.Blue;
Item.maxStack = 9999;
Item.useTurn = true;
Item.autoReuse = true;
Item.useAnimation = 15;
Item.useTime = 10;
Item.useStyle = ItemUseStyleID.Swing;
Item.consumable = true;
Item.createTile = ModContent.TileType<Tiles.SunkenSea.CyanCoral>();
}
//public override void AddRecipes()
//{
// CreateRecipe(4).
// AddIngredient(ItemID.PinkPearl).
// AddTile(TileID.HeavyWorkBench).
// Register();
//}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 367 B

+42
View File
@@ -0,0 +1,42 @@
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Placeables
{
public class Driftwood : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Placeables";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 100;
ItemID.Sets.ShimmerTransformToItem[Type] = ItemID.Wood;
}
public override void SetDefaults()
{
Item.width = 12;
Item.height = 12;
Item.maxStack = 9999;
Item.useTurn = true;
Item.autoReuse = true;
Item.useAnimation = 15;
Item.useTime = 10;
Item.useStyle = ItemUseStyleID.Swing;
Item.consumable = true;
Item.createTile = ModContent.TileType<Tiles.SunkenSea.Driftwood>();
}
public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
{
itemGroup = ContentSamples.CreativeHelper.ItemGroup.Wood;
}
public override void AddRecipes()
{
CreateRecipe(4).
AddIngredient<Items.Placeables.Walls.DriftwoodWall>(4).
AddTile(TileID.WorkBenches).
Register();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 241 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

@@ -19,8 +19,9 @@ namespace CalamityMod.Items.Placeables.Furniture
Item.useTime = 10;
Item.useStyle = ItemUseStyleID.Swing;
Item.consumable = true;
Item.value = Item.buyPrice(0, 25, 0, 0);
Item.rare = ItemRarityID.LightRed;
// Cirrus overcharges: 10% sell value instead of 20%
Item.value = Item.sellPrice(gold: 20);
Item.rare = ItemRarityID.Pink;
Item.createTile = ModContent.TileType<Tiles.Furniture.PurpleCandle>();
}
}
+3 -2
View File
@@ -19,8 +19,9 @@ namespace CalamityMod.Items.Placeables.Furniture
Item.useTime = 10;
Item.useStyle = ItemUseStyleID.Swing;
Item.consumable = true;
Item.value = Item.buyPrice(0, 25, 0, 0);
Item.rare = ItemRarityID.LightRed;
// Cirrus overcharges: 10% sell value instead of 20%
Item.value = Item.sellPrice(gold: 20);
Item.rare = ItemRarityID.Pink;
Item.createTile = ModContent.TileType<Tiles.Furniture.YellowCandle>();
}
}
+3 -2
View File
@@ -19,8 +19,9 @@ namespace CalamityMod.Items.Placeables.Furniture
Item.useTime = 10;
Item.useStyle = ItemUseStyleID.Swing;
Item.consumable = true;
Item.value = Item.buyPrice(0, 25, 0, 0);
Item.rare = ItemRarityID.LightRed;
// Cirrus overcharges: 10% sell value instead of 20%
Item.value = Item.sellPrice(gold: 20);
Item.rare = ItemRarityID.Pink;
Item.createTile = ModContent.TileType<Tiles.Furniture.PinkCandle>();
}
}
@@ -19,8 +19,9 @@ namespace CalamityMod.Items.Placeables.Furniture
Item.useTime = 10;
Item.useStyle = ItemUseStyleID.Swing;
Item.consumable = true;
Item.value = Item.buyPrice(0, 25, 0, 0);
Item.rare = ItemRarityID.LightRed;
// Cirrus overcharges: 10% sell value instead of 20%
Item.value = Item.sellPrice(gold: 20);
Item.rare = ItemRarityID.Pink;
Item.createTile = ModContent.TileType<Tiles.Furniture.BlueCandle>();
}
}
+37
View File
@@ -0,0 +1,37 @@
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Placeables
{
public class LimeCoral : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Placeables";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 100;
}
public override void SetDefaults()
{
Item.width = 12;
Item.height = 12;
Item.rare = ItemRarityID.Blue;
Item.maxStack = 9999;
Item.useTurn = true;
Item.autoReuse = true;
Item.useAnimation = 15;
Item.useTime = 10;
Item.useStyle = ItemUseStyleID.Swing;
Item.consumable = true;
Item.createTile = ModContent.TileType<Tiles.SunkenSea.LimeCoral>();
}
//public override void AddRecipes()
//{
// CreateRecipe(4).
// AddIngredient(ItemID.PinkPearl).
// AddTile(TileID.HeavyWorkBench).
// Register();
//}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 303 B

+28
View File
@@ -0,0 +1,28 @@
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Placeables
{
public class Limestone : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Placeables";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 100;
}
public override void SetDefaults()
{
Item.width = 12;
Item.height = 12;
Item.maxStack = 9999;
Item.useTurn = true;
Item.autoReuse = true;
Item.useAnimation = 15;
Item.useTime = 10;
Item.useStyle = ItemUseStyleID.Swing;
Item.consumable = true;
Item.createTile = ModContent.TileType<Tiles.SunkenSea.Limestone>();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

+37
View File
@@ -0,0 +1,37 @@
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Placeables
{
public class MagentaCoral : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Placeables";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 100;
}
public override void SetDefaults()
{
Item.width = 12;
Item.height = 12;
Item.rare = ItemRarityID.Blue;
Item.maxStack = 9999;
Item.useTurn = true;
Item.autoReuse = true;
Item.useAnimation = 15;
Item.useTime = 10;
Item.useStyle = ItemUseStyleID.Swing;
Item.consumable = true;
Item.createTile = ModContent.TileType<Tiles.SunkenSea.MagentaCoral>();
}
//public override void AddRecipes()
//{
// CreateRecipe(4).
// AddIngredient(ItemID.PinkPearl).
// AddTile(TileID.HeavyWorkBench).
// Register();
//}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 362 B

+37
View File
@@ -0,0 +1,37 @@
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Placeables
{
public class OrangeCoral : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Placeables";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 100;
}
public override void SetDefaults()
{
Item.width = 12;
Item.height = 12;
Item.rare = ItemRarityID.Blue;
Item.maxStack = 9999;
Item.useTurn = true;
Item.autoReuse = true;
Item.useAnimation = 15;
Item.useTime = 10;
Item.useStyle = ItemUseStyleID.Swing;
Item.consumable = true;
Item.createTile = ModContent.TileType<Tiles.SunkenSea.OrangeCoral>();
}
//public override void AddRecipes()
//{
// CreateRecipe(4).
// AddIngredient(ItemID.PinkPearl).
// AddTile(TileID.HeavyWorkBench).
// Register();
//}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 364 B

+30
View File
@@ -0,0 +1,30 @@
using CalamityMod.Tiles.FloralParadise;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Placeables
{
public class PeatItem : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Placeables";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 100;
}
public override void SetDefaults()
{
Item.createTile = ModContent.TileType<Peat>();
Item.useStyle = ItemUseStyleID.Swing;
Item.useTurn = true;
Item.useAnimation = 15;
Item.useTime = 10;
Item.autoReuse = true;
Item.consumable = true;
Item.width = 16;
Item.height = 16;
Item.maxStack = 999;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 320 B

+30
View File
@@ -0,0 +1,30 @@
using CalamityMod.Tiles.FloralParadise;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Placeables
{
public class PeatMossItem : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Placeables";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 100;
}
public override void SetDefaults()
{
Item.createTile = ModContent.TileType<PeatMoss>();
Item.useStyle = ItemUseStyleID.Swing;
Item.useTurn = true;
Item.useAnimation = 15;
Item.useTime = 10;
Item.autoReuse = true;
Item.consumable = true;
Item.width = 16;
Item.height = 16;
Item.maxStack = 999;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 380 B

+37
View File
@@ -0,0 +1,37 @@
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Placeables
{
public class PinkPearlPile : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Placeables";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 100;
}
public override void SetDefaults()
{
Item.width = 12;
Item.height = 12;
Item.rare = ItemRarityID.Blue;
Item.maxStack = 9999;
Item.useTurn = true;
Item.autoReuse = true;
Item.useAnimation = 15;
Item.useTime = 10;
Item.useStyle = ItemUseStyleID.Swing;
Item.consumable = true;
Item.createTile = ModContent.TileType<Tiles.SunkenSea.PinkPearlPile>();
}
public override void AddRecipes()
{
CreateRecipe(4).
AddIngredient(ItemID.PinkPearl).
AddTile(TileID.HeavyWorkBench).
Register();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 244 B

@@ -0,0 +1,36 @@
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Placeables
{
public class PolishedNavystoneBrick : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Placeables";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 100;
}
public override void SetDefaults()
{
Item.width = 12;
Item.height = 12;
Item.maxStack = 9999;
Item.useTurn = true;
Item.autoReuse = true;
Item.useAnimation = 15;
Item.useTime = 10;
Item.useStyle = ItemUseStyleID.Swing;
Item.consumable = true;
Item.createTile = ModContent.TileType<Tiles.SunkenSea.PolishedNavystoneBrick>();
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<Navystone>(2).
AddTile(TileID.Furnaces).
Register();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

+28
View File
@@ -0,0 +1,28 @@
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Placeables
{
public class PolypSand : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Placeables";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 100;
}
public override void SetDefaults()
{
Item.width = 12;
Item.height = 12;
Item.maxStack = 9999;
Item.useTurn = true;
Item.autoReuse = true;
Item.useAnimation = 15;
Item.useTime = 10;
Item.useStyle = ItemUseStyleID.Swing;
Item.consumable = true;
Item.createTile = ModContent.TileType<Tiles.SunkenSea.PolypSand>();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 288 B

+29
View File
@@ -0,0 +1,29 @@
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Placeables
{
public class RuneSand : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Placeables";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 100;
ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType<Shellstone>();
}
public override void SetDefaults()
{
Item.width = 12;
Item.height = 12;
Item.maxStack = 9999;
Item.useTurn = true;
Item.autoReuse = true;
Item.useAnimation = 15;
Item.useTime = 10;
Item.useStyle = ItemUseStyleID.Swing;
Item.consumable = true;
Item.createTile = ModContent.TileType<Tiles.SunkenSea.RuneSand>();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 251 B

+33
View File
@@ -0,0 +1,33 @@
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.Walls;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Placeables
{
public class Runestone : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Placeables";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 200;
}
public override void SetDefaults()
{
Item.width = 12;
Item.height = 12;
Item.rare = ItemRarityID.Blue;
Item.maxStack = 9999;
Item.useTurn = true;
Item.autoReuse = true;
Item.useAnimation = 15;
Item.useTime = 10;
Item.useStyle = ItemUseStyleID.Swing;
Item.consumable = true;
Item.createTile = ModContent.TileType<Tiles.SunkenSea.Runestone>();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 312 B

+31
View File
@@ -0,0 +1,31 @@
using CalamityMod.Tiles.FloralParadise;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Placeables
{
public class ScintillatingBloom : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Placeables";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 10;
}
public override void SetDefaults()
{
Item.createTile = ModContent.TileType<PinkFlower>();
Item.useStyle = ItemUseStyleID.Swing;
Item.useTurn = true;
Item.useAnimation = 15;
Item.useTime = 10;
Item.autoReuse = true;
Item.consumable = true;
Item.width = 24;
Item.height = 24;
Item.maxStack = 999;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 560 B

+28
View File
@@ -0,0 +1,28 @@
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Placeables
{
public class Shellstone : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Placeables";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 100;
}
public override void SetDefaults()
{
Item.width = 12;
Item.height = 12;
Item.maxStack = 9999;
Item.useTurn = true;
Item.autoReuse = true;
Item.useAnimation = 15;
Item.useTime = 10;
Item.useStyle = ItemUseStyleID.Swing;
Item.consumable = true;
Item.createTile = ModContent.TileType<Tiles.SunkenSea.Shellstone>();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 249 B

+41
View File
@@ -0,0 +1,41 @@
using CalamityMod.Items.Placeables.Walls;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Placeables
{
public class ShellstoneSlab : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Placeables";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 100;
}
public override void SetDefaults()
{
Item.width = 12;
Item.height = 12;
Item.maxStack = 9999;
Item.useTurn = true;
Item.autoReuse = true;
Item.useAnimation = 15;
Item.useTime = 10;
Item.useStyle = ItemUseStyleID.Swing;
Item.consumable = true;
Item.createTile = ModContent.TileType<Tiles.SunkenSea.ShellstoneSlab>();
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<Shellstone>().
AddTile(TileID.HeavyWorkBench).
Register();
CreateRecipe().
AddIngredient<ShellstoneSlabWall>(4).
AddTile(TileID.WorkBenches).
Register();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

Loaded 100 of 602 files, more files were not shown because too many files have changed in this diff. Show more