Merge branch '1.4.4' of https://github.com/CalamityTeam/CalamityMod into gift-mult-two
No files matched your search
@@ -10,49 +10,24 @@ namespace CalamityMod.Backgrounds
|
||||
private int SSBG2;
|
||||
private int SSBG3;
|
||||
|
||||
private int BGBG0;
|
||||
private int BGBG1;
|
||||
private int BGBG2;
|
||||
private int BGBG3;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
if (Main.dedServ)
|
||||
return;
|
||||
|
||||
SSBG0 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
|
||||
SSBG1 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
|
||||
SSBG2 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
|
||||
SSBG3 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
|
||||
|
||||
BGBG0 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
|
||||
BGBG1 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BasaltGullyBG");
|
||||
BGBG2 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
|
||||
BGBG3 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BasaltGullyBG");
|
||||
SSBG0 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/SunkenSeaBG0");
|
||||
SSBG1 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/SunkenSeaBG1");
|
||||
SSBG2 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/SunkenSeaBG2");
|
||||
SSBG3 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/SunkenSeaBG3");
|
||||
}
|
||||
|
||||
public override void FillTextureArray(int[] textureSlots)
|
||||
{
|
||||
if (Main.LocalPlayer.InModBiome(ModContent.GetInstance<BiomeManagers.RadiantReefsBiome>()) ||
|
||||
Main.LocalPlayer.InModBiome(ModContent.GetInstance<BiomeManagers.PolypForestBiome>()) ||
|
||||
Main.LocalPlayer.InModBiome(ModContent.GetInstance<BiomeManagers.TimelessShoresBiome>()) ||
|
||||
Main.LocalPlayer.InModBiome<BiomeManagers.GleamingBurrowsBiome>())
|
||||
{
|
||||
textureSlots[0] = SSBG0;
|
||||
textureSlots[1] = SSBG1;
|
||||
textureSlots[2] = SSBG2;
|
||||
textureSlots[3] = SSBG3;
|
||||
}
|
||||
if (!Main.LocalPlayer.InModBiome(ModContent.GetInstance<BiomeManagers.RadiantReefsBiome>()) &&
|
||||
!Main.LocalPlayer.InModBiome(ModContent.GetInstance<BiomeManagers.PolypForestBiome>()) &&
|
||||
!Main.LocalPlayer.InModBiome(ModContent.GetInstance<BiomeManagers.TimelessShoresBiome>()) &&
|
||||
!Main.LocalPlayer.InModBiome<BiomeManagers.GleamingBurrowsBiome>())
|
||||
{
|
||||
textureSlots[0] = BGBG0;
|
||||
textureSlots[1] = BGBG1;
|
||||
textureSlots[2] = BGBG2;
|
||||
textureSlots[3] = BGBG3;
|
||||
}
|
||||
textureSlots[0] = SSBG0;
|
||||
textureSlots[1] = SSBG1;
|
||||
textureSlots[2] = SSBG2;
|
||||
textureSlots[3] = SSBG3;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -182,15 +182,17 @@ namespace CalamityMod.Backgrounds
|
||||
Main.spriteBatch.End();
|
||||
Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, Main.Rasterizer, distortionShader.Shader, CalamityUtils.BackgroundMatrix);
|
||||
|
||||
const float distortionXSpeed = -0.012f;
|
||||
const float distortionYSpeed = 0.02f;
|
||||
const float noiseScale = 0.075f;
|
||||
const float noiseStrength = 0.035f;
|
||||
Vector2 timeOffset = new Vector2(distortionXSpeed, distortionYSpeed) * Main.GlobalTimeWrappedHourly * noiseScale;
|
||||
Vector2 noiseScaleStrength = new Vector2(noiseScale, noiseStrength);
|
||||
distortionShader.Shader.Parameters["timeOffset"].SetValue(timeOffset);
|
||||
distortionShader.Shader.Parameters["noiseScaleStrength"].SetValue(noiseScaleStrength);
|
||||
distortionShader.SetShaderTexture(distortionTexture);
|
||||
float distortionXSpeed = -0.012f;
|
||||
float distortionYSpeed = 0.02f;
|
||||
float noiseScale = 0.075f;
|
||||
float noiseStrength = 0.035f;
|
||||
|
||||
distortionShader.Shader.Parameters["time"].SetValue(Main.GlobalTimeWrappedHourly);
|
||||
distortionShader.Shader.Parameters["noiseScale"].SetValue(noiseScale);
|
||||
distortionShader.Shader.Parameters["distortionStrength"].SetValue(noiseStrength);
|
||||
distortionShader.Shader.Parameters["timeOffset"].SetValue(new Vector2(distortionXSpeed, distortionYSpeed));
|
||||
Main.graphics.GraphicsDevice.Textures[1] = distortionTexture.Value;
|
||||
Main.graphics.GraphicsDevice.SamplerStates[1] = SamplerState.LinearWrap;
|
||||
|
||||
Main.spriteBatch.Draw(WaterDistortionTarget.Target, new Rectangle(16, 16, Main.screenWidth, Main.screenHeight), Color.White);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ using CalamityMod.Items.Weapons.Ranged;
|
||||
using CalamityMod.NPCs.AstrumAureus;
|
||||
using CalamityMod.NPCs.CeaselessVoid;
|
||||
using CalamityMod.NPCs.Crabulon;
|
||||
using CalamityMod.NPCs.NormalNPCs.HorribleHog;
|
||||
using CalamityMod.NPCs.OldDuke;
|
||||
using CalamityMod.NPCs.ProfanedGuardians;
|
||||
using CalamityMod.NPCs.Providence;
|
||||
@@ -54,6 +55,13 @@ namespace CalamityMod.Balancing
|
||||
|
||||
NPCSpecificBalancingChanges = new List<NPCBalancingChange>();
|
||||
|
||||
// ENEMIES
|
||||
#region Horrible Hog
|
||||
// Take 300% damage from Finch Staff.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<HorribleHog>(), Do(new ProjectileResistBalancingRule(3f, ProjectileID.BabyBird))));
|
||||
#endregion
|
||||
|
||||
// BOSSES
|
||||
#region Crabulon
|
||||
// 20% resist to true melee.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<Crabulon>(), ResistTrueMelee(0.8f)));
|
||||
@@ -68,6 +76,9 @@ namespace CalamityMod.Balancing
|
||||
|
||||
// 25% resist to true melee.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.EaterOfWorlds, Do(ResistTrueMelee(0.75f))));
|
||||
|
||||
// 40% resist to Lemon 'nade
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.EaterOfWorlds, Do(new ProjectileResistBalancingRule(0.60f, ProjectileType<LemonNadeProjectile>()))));
|
||||
#endregion
|
||||
|
||||
#region Brain of Cthulhu: Creepers
|
||||
@@ -204,6 +215,9 @@ namespace CalamityMod.Balancing
|
||||
// 50% resist to Charged Blaster Cannon.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.ChargedBlasterLaser))));
|
||||
|
||||
//45% resist to Duststorm in a Bottle
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.55f, ProjectileType<DuststormCloud>(), ProjectileType<DuststormCloudExplosion>(), ProjectileType<DuststormInABottleProj>()))));
|
||||
|
||||
// 40% resist to Stardust Dragon Staff.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.6f, ProjectileID.StardustDragon1, ProjectileID.StardustDragon2, ProjectileID.StardustDragon3, ProjectileID.StardustDragon4))));
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace CalamityMod.BiomeManagers
|
||||
{
|
||||
public class PolypForestBiome : ModBiome
|
||||
{
|
||||
public override ModWaterStyle WaterStyle => SunkenSeaPolypWater.Instance;
|
||||
public override ModWaterStyle WaterStyle => SunkenSeaBurrowsWater.Instance;
|
||||
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;
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace CalamityMod.BiomeManagers
|
||||
{
|
||||
public class RadiantReefsBiome : ModBiome
|
||||
{
|
||||
public override ModWaterStyle WaterStyle => SunkenSeaReefsWater.Instance;
|
||||
public override ModWaterStyle WaterStyle => SunkenSeaBurrowsWater.Instance;
|
||||
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;
|
||||
|
||||
@@ -4,6 +4,7 @@ using System;
|
||||
using Mono.Cecil.Cil;
|
||||
using MonoMod.Cil;
|
||||
using CalamityMod.Systems;
|
||||
using Terraria.ID;
|
||||
|
||||
namespace CalamityMod.BiomeManagers
|
||||
{
|
||||
@@ -11,7 +12,7 @@ namespace CalamityMod.BiomeManagers
|
||||
public class SunkenSeaBiome : ModBiome
|
||||
{
|
||||
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
|
||||
|
||||
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("SunkenSea") ?? MusicID.OceanNight;
|
||||
public override void Load()
|
||||
{
|
||||
//apply the drawblack edits here since all sunken sea biomes will have custom backgrounds
|
||||
@@ -63,8 +64,8 @@ namespace CalamityMod.BiomeManagers
|
||||
|
||||
public override bool IsBiomeActive(Player player)
|
||||
{
|
||||
return BiomeTileCounterSystem.SunkenSeaBurrowsTiles > 1000 || BiomeTileCounterSystem.SunkenSeaPolypTiles > 1000 ||
|
||||
BiomeTileCounterSystem.SunkenSeaReefsTiles > 1000 || BiomeTileCounterSystem.SunkenSeaShoresTiles > 1000;
|
||||
return BiomeTileCounterSystem.SunkenSeaBurrowsTiles > 200 || BiomeTileCounterSystem.SunkenSeaPolypTiles > 200 ||
|
||||
BiomeTileCounterSystem.SunkenSeaReefsTiles > 200 || BiomeTileCounterSystem.SunkenSeaShoresTiles > 200;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ namespace CalamityMod.BiomeManagers
|
||||
{
|
||||
public class TimelessShoresBiome : ModBiome
|
||||
{
|
||||
public override ModWaterStyle WaterStyle => SunkenSeaShoresWater.Instance;
|
||||
public override ModWaterStyle WaterStyle => SunkenSeaBurrowsWater.Instance;
|
||||
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;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Systems.Collections;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -18,7 +19,7 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
Main.buffNoSave[Type] = false;
|
||||
Main.persistentBuff[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
|
Before Width: | Height: | Size: 723 B After Width: | Height: | Size: 731 B |
@@ -140,14 +140,16 @@ namespace CalamityMod.Buffs
|
||||
{
|
||||
// Globally remove summon tag debuff stacking, unless allowed in the SummonTag
|
||||
// Other mods need to add to this list because otherwise we can't tell which IsATag buff is actually for whips
|
||||
if (CalamityBuffSets.SummonTagDebuff.TryGetValue(type, out var tag1) && !tag1.AllowsWhipStacking && buffIndex > 0)
|
||||
var tag1 = CalamityBuffSets.SummonTagDebuff[type];
|
||||
if (tag1 is not null && !tag1.AllowsWhipStacking && buffIndex > 0)
|
||||
{
|
||||
for (int i = buffIndex; i >= 0; i--)
|
||||
{
|
||||
if (npc.buffTime[i] > 0)
|
||||
{
|
||||
int buffID = npc.buffType[i];
|
||||
if (CalamityBuffSets.SummonTagDebuff.TryGetValue(buffID, out var tag2) && !tag2.AllowsWhipStacking && buffID != type)
|
||||
var tag2 = CalamityBuffSets.SummonTagDebuff[buffID];
|
||||
if (tag2 is not null && !tag2.AllowsWhipStacking && buffID != type)
|
||||
{
|
||||
npc.DelBuff(i);
|
||||
break;
|
||||
|
||||
@@ -5,6 +5,7 @@ using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
@@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -5,6 +5,7 @@ using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
@@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -7,6 +7,7 @@ using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
@@ -25,7 +26,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
public static void BaneNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage)
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
@@ -24,7 +25,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -4,6 +4,7 @@ using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
@@ -20,7 +21,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -5,6 +5,7 @@ using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
@@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -5,6 +5,7 @@ using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
@@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -5,6 +5,7 @@ using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
@@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -4,6 +4,7 @@ using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
@@ -17,7 +18,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = DebuffData.Daybroken;
|
||||
CalamityBuffSets.DebuffDataset[Type] = DebuffData.Daybroken;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -7,6 +7,7 @@ using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
@@ -29,7 +30,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -5,6 +5,7 @@ using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
@@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -5,6 +5,7 @@ using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
@@ -20,7 +21,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -5,6 +5,7 @@ using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
@@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -5,6 +5,7 @@ using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
@@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
@@ -70,7 +71,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Particle smoke = new HeavySmokeParticle(npcSize, new Vector2(2f, 2f).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 0.7f), smokeColor, 40, Main.rand.NextFloat(0.3f, 0.4f) + (0.00000013f * npc.width * npc.height), 0.5f, Main.rand.NextFloat(-0.2f, 0.2f), false, required: true);
|
||||
GeneralParticleHandler.SpawnParticle(smoke);
|
||||
}
|
||||
Dust water = Dust.NewDustDirect(npc.position - new Vector2(2f), npc.width + 4, npc.height + 4, 360, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 1.4f);
|
||||
Dust water = Dust.NewDustDirect(npc.position - new Vector2(2f), npc.width + 4, npc.height + 4, 390, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 1.4f);
|
||||
water.noGravity = true;
|
||||
water.velocity *= 0.75f;
|
||||
water.velocity.X = water.velocity.X * 0.75f;
|
||||
|
||||
@@ -6,6 +6,7 @@ using Terraria.DataStructures;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
@@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -5,6 +5,7 @@ using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
@@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
@@ -19,7 +20,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -6,6 +6,7 @@ using Terraria.DataStructures;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
@@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -13,6 +13,7 @@ using Terraria.DataStructures;
|
||||
using Terraria.Graphics.Shaders;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
@@ -55,7 +56,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -5,6 +5,7 @@ using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
@@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -5,6 +5,7 @@ using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
@@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -4,6 +4,7 @@ using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
@@ -20,7 +21,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -3,6 +3,7 @@ using CalamityMod.Projectiles.Summon;
|
||||
using CalamityMod.Systems.Collections;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
@@ -58,7 +59,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
public override void Update(NPC npc, ref int buffIndex)
|
||||
{
|
||||
|
||||
@@ -1,171 +0,0 @@
|
||||
using System;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.Particles;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
public class SeaKingsAssurance : ModBuff
|
||||
{
|
||||
public static Color BaseColor => new Color(31, 78, 155);
|
||||
public static Color LightColor => new Color(31, 108, 225);
|
||||
public static void Apply(NPC npc, Vector2 orig)
|
||||
{
|
||||
int stacks = 1;
|
||||
if (npc.HasBuff<SeaKingsAssurance>())
|
||||
{
|
||||
int buffTimer = npc.buffTime[npc.FindBuffIndex(ModContent.BuffType<SeaKingsAssurance>())];
|
||||
npc.buffTime[npc.FindBuffIndex(ModContent.BuffType<SeaKingsAssurance>())] += FramesPerStack;
|
||||
npc.buffTime[npc.FindBuffIndex(ModContent.BuffType<SeaKingsAssurance>())] = ((int)Math.Ceiling((double)buffTimer / FramesPerStack) + 1) * FramesPerStack;
|
||||
buffTimer = npc.buffTime[npc.FindBuffIndex(ModContent.BuffType<SeaKingsAssurance>())];
|
||||
stacks += ((int)Math.Ceiling((double)buffTimer / FramesPerStack));
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.AddBuff(ModContent.BuffType<SeaKingsAssurance>(), FramesPerStack);
|
||||
}
|
||||
|
||||
npc.GetGlobalNPC<SeaKingsAssuranceNPC>().StackGlow = 1f;
|
||||
npc.GetGlobalNPC<SeaKingsAssuranceNPC>().StackScale = 1.2f;
|
||||
|
||||
SoundStyle style = new SoundStyle("CalamityMod/Sounds/Item/WaterSplash1");
|
||||
SoundEngine.PlaySound(style.WithPitchOffset(1f + ((float)stacks / 6f)).WithVolumeScale(0.2f));
|
||||
|
||||
float sc = 0.05f + ((float)stacks * 0.06f);
|
||||
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
float rot = Main.rand.NextFloat(MathHelper.TwoPi) + MathHelper.PiOver2;
|
||||
if (orig != Vector2.Zero)
|
||||
{
|
||||
rot = orig.AngleTo(npc.Center) + MathHelper.PiOver2;
|
||||
}
|
||||
|
||||
GeneralParticleHandler.SpawnParticle(new CustomPulse(
|
||||
npc.Center, (rot - MathHelper.PiOver2).ToRotationVector2() * 6f, Color.Lerp(BaseColor, LightColor, sc * 3f), "CalamityMod/Particles/ForwardSmear", new Vector2(Main.rand.NextFloat(0.015f, 0.1f), 0.1f),
|
||||
rot, sc, sc * 2f, 8
|
||||
));
|
||||
}
|
||||
|
||||
float range = 20 + ((float)stacks * 15f);
|
||||
|
||||
if (orig == Vector2.Zero)
|
||||
{
|
||||
foreach (NPC npc2 in Main.npc)
|
||||
{
|
||||
if (npc2 != npc)
|
||||
{
|
||||
if (npc2.active && !npc2.friendly && !npc2.isLikeATownNPC)
|
||||
{
|
||||
if (npc2.Distance(npc.Center) < range)
|
||||
{
|
||||
Apply(npc2, npc.Center);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The number of frames per stack of this buff.
|
||||
/// For instance, if the buff has less than one of this number's worth of time left,
|
||||
/// it will count as one stack.
|
||||
/// </summary>
|
||||
public static int FramesPerStack => 60;
|
||||
public static SoundStyle ImpactSound => new SoundStyle("CalamityMod/Sounds/Item/WaterSplash1");
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(NPC npc, ref int buffIndex)
|
||||
{
|
||||
npc.buffTime[buffIndex] = Math.Min(npc.buffTime[buffIndex], 10 * FramesPerStack);
|
||||
|
||||
npc.GetGlobalNPC<SeaKingsAssuranceNPC>().assuredStacks = (int)Math.Ceiling((double)(npc.buffTime[buffIndex] / FramesPerStack));
|
||||
}
|
||||
}
|
||||
|
||||
public class SeaKingsAssuranceNPC : GlobalNPC
|
||||
{
|
||||
public static readonly Asset<Texture2D> Stacks = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/AmidiasTrident_Stacks");
|
||||
|
||||
public override bool InstancePerEntity => true;
|
||||
public int assuredStacks = 0;
|
||||
public int StackFrame = 0;
|
||||
public float StackRotation = 0f;
|
||||
public float StackScale = 0f;
|
||||
public float StackGlow = 0f;
|
||||
public override void ResetEffects(NPC npc)
|
||||
{
|
||||
if (assuredStacks == 0)
|
||||
{
|
||||
StackScale *= 0.5f;
|
||||
}
|
||||
else
|
||||
{
|
||||
StackScale = MathHelper.Lerp(StackScale, 1f, 0.2f);
|
||||
}
|
||||
StackGlow *= 0.7f;
|
||||
assuredStacks = 0;
|
||||
base.ResetEffects(npc);
|
||||
}
|
||||
public override void DrawEffects(NPC npc, ref Color drawColor)
|
||||
{
|
||||
base.DrawEffects(npc, ref drawColor);
|
||||
}
|
||||
public override void UpdateLifeRegen(NPC npc, ref int damage)
|
||||
{
|
||||
}
|
||||
public override void PostDraw(NPC npc, SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
|
||||
{
|
||||
StackFrame = 0;
|
||||
if (assuredStacks > 5) StackFrame = 1;
|
||||
if (assuredStacks > 8) StackFrame = 2;
|
||||
|
||||
Rectangle frame = Stacks.Frame(3, 1, StackFrame);
|
||||
|
||||
if (StackFrame == 2)
|
||||
{
|
||||
StackRotation = MathHelper.Lerp(StackRotation, MathHelper.Pi, 0.2f);
|
||||
}
|
||||
else
|
||||
{
|
||||
StackRotation = MathHelper.Lerp(StackRotation, 0f, 0.1f);
|
||||
}
|
||||
|
||||
float offset = -28;
|
||||
|
||||
for (int b = 0; b < CalamityGlobalNPC.moddedDebuffTextureList.Count; b++)
|
||||
{
|
||||
if (CalamityGlobalNPC.moddedDebuffTextureList[b].Item2.Invoke(npc))
|
||||
{
|
||||
offset = -48;
|
||||
}
|
||||
}
|
||||
|
||||
if (StackScale > 0.2f && assuredStacks > 2)
|
||||
{
|
||||
spriteBatch.Draw(Stacks.Value, npc.Top - Main.screenPosition + new Vector2(0, offset), frame, Color.White, StackRotation, frame.Size() / 2f, StackScale, SpriteEffects.None, 0f);
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
spriteBatch.Draw(Stacks.Value, npc.Top - Main.screenPosition + new Vector2(0, offset), frame, Color.White.MultiplyRGBA(new(StackGlow, StackGlow, StackGlow, 0f)), StackRotation, frame.Size() / 2f, StackScale, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
StackRotation = 0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 596 B |
@@ -2,6 +2,7 @@
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
@@ -33,7 +34,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -5,6 +5,7 @@ using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
@@ -18,7 +19,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = DebuffData.Shadowflame;
|
||||
CalamityBuffSets.DebuffDataset[Type] = DebuffData.Shadowflame;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -5,6 +5,7 @@ using CalamityMod.Projectiles.Summon;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
@@ -51,7 +52,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
BuffID.Sets.IsATagBuff[Type] = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
@@ -34,7 +35,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(NPC npc, ref int buffIndex)
|
||||
|
||||
@@ -4,6 +4,7 @@ using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
@@ -20,7 +21,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -5,6 +5,7 @@ using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
@@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
|
||||
// Acid Venom immunity is granted automatically if you are immune to Sulphuric Poisoning.
|
||||
BuffID.Sets.GrantImmunityWith[BuffID.Venom].Add(Type);
|
||||
|
||||
@@ -8,6 +8,7 @@ using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
@@ -28,7 +29,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex) => player.Calamity().trueVHex = true;
|
||||
|
||||
@@ -6,6 +6,7 @@ using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
@@ -23,7 +24,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -5,6 +5,7 @@ using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
@@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -5,6 +5,7 @@ using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
@@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -8,6 +8,7 @@ using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
@@ -31,7 +32,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex) => player.Calamity().vHex = true;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
@@ -17,7 +18,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
Main.buffNoTimeDisplay[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex) => player.Calamity().weakBrimstoneFlames = true;
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Projectiles.Magic;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using CalamityMod.Systems.Collections;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
@@ -31,12 +26,12 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
public static void WindChilledNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage)
|
||||
{
|
||||
var cnpc = npc.Calamity();
|
||||
|
||||
|
||||
int baseDoTValue = (int)(cnpc.windChilledMult * npc.Calamity().ActiveColdDebuffMultiplier.ApplyTo(debuffData.EnemyLostRegen));
|
||||
cnpc.ApplyDPSDebuff(baseDoTValue, Math.Max((int)(baseDoTValue * debuffData.MultiplierDamageTickSize), debuffData.MinimumDamageTickSize) / 2, ref npc.lifeRegen, ref damage);
|
||||
}
|
||||
@@ -94,7 +89,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
bool start = !Main.rand.NextBool(4);
|
||||
Vector2 particleVel = Vector2.UnitY * Main.rand.NextFloat(-1.25f, 1.25f) * Math.Max(hightMult, widthMult) * (Main.rand.NextBool(5) ? 1.5f : 1) + npc.velocity * 0.85f;
|
||||
Vector2 particlePos = npc.Center + Main.rand.NextVector2Circular(3 * widthMult + 8, 3 * widthMult + 8) * Math.Max(hightMult, widthMult);
|
||||
Particle mist = new CustomPulsingSpark(particlePos, particleVel, "CalamityMod/Particles/ThinSparkle", "CalamityMod/Particles/BloomCircle", false, 65, Main.rand.NextFloat(0.95f, 1.35f) * MathF.Pow(widthMult, 0.45f), start ? color : color2, start ? color2 : color,
|
||||
Particle mist = new CustomPulsingSpark(particlePos, particleVel, "CalamityMod/Particles/ThinSparkle", "CalamityMod/Particles/BloomCircle", false, 65, Main.rand.NextFloat(0.95f, 1.35f) * MathF.Pow(widthMult, 0.45f), start ? color : color2, start ? color2 : color,
|
||||
new Vector2(0.6f, 1.2f), true, true, Main.rand.Next(4, 7 + 1), colorFadeSpeed: 0.85f, noShrink: true, extraRotation: -particleVel.ToRotation(), shrinkSpeed: 0.1f, sineRate: Main.rand.NextFloat(0.25f, 0.55f), sineIntensity: (int)(Main.rand.Next(12, 19 + 1) * Math.Max(hightMult, widthMult)));
|
||||
GeneralParticleHandler.SpawnParticle(mist, true, Main.rand.NextBool() ? Enums.GeneralDrawLayer.AfterNPCs : Enums.GeneralDrawLayer.BeforeNPCs);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
using CalamityMod.Projectiles.Pets;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Pets
|
||||
{
|
||||
public class BeldumBuff : ModBuff
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.buffNoTimeDisplay[Type] = true;
|
||||
Main.vanityPet[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
player.buffTime[buffIndex] = 18000;
|
||||
player.Calamity().beldum = true;
|
||||
bool PetProjectileNotSpawned = player.ownedProjectileCounts[ModContent.ProjectileType<Beldum>()] <= 0;
|
||||
if (PetProjectileNotSpawned && player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
Projectile.NewProjectile(player.GetSource_Buff(buffIndex), player.Center, Vector2.Zero, ModContent.ProjectileType<Beldum>(), 0, 0f, player.whoAmI, 0f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 632 B |
|
Before Width: | Height: | Size: 575 B After Width: | Height: | Size: 587 B |
|
Before Width: | Height: | Size: 664 B After Width: | Height: | Size: 644 B |
|
Before Width: | Height: | Size: 562 B After Width: | Height: | Size: 551 B |
|
Before Width: | Height: | Size: 535 B After Width: | Height: | Size: 503 B |
|
Before Width: | Height: | Size: 587 B After Width: | Height: | Size: 530 B |
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.DataStructures;
|
||||
using System;
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Items.Potions;
|
||||
using CalamityMod.Particles;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -16,6 +17,7 @@ namespace CalamityMod.Buffs.Potions
|
||||
public class SwinesWrathBuff : ModBuff
|
||||
{
|
||||
public static readonly SoundStyle TimerSound = new("CalamityMod/Sounds/Custom/TickingTimer");
|
||||
public static readonly SoundStyle TimerSound2 = new("CalamityMod/Sounds/Custom/TickingTimerReverb");
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
@@ -33,10 +35,14 @@ namespace CalamityMod.Buffs.Potions
|
||||
{
|
||||
player.KillMe(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.SwinesWrath" + Main.rand.Next(1, 7 + 1)).ToNetworkText(player.name)), 1000, -1);
|
||||
concoctionPlayer.swinesWrathCounter = -1;
|
||||
concoctionPlayer.spamTimer = 0;
|
||||
}
|
||||
|
||||
else if (concoctionPlayer.swinesWrathCounter % 60 == 59)
|
||||
SoundEngine.PlaySound(TimerSound with { Volume = ((600f - concoctionPlayer.swinesWrathCounter) / 600f) }, player.Center); // Gets louder as time progresses
|
||||
{
|
||||
SoundEngine.PlaySound(TimerSound2 with { Volume = MathF.Pow((600f - concoctionPlayer.swinesWrathCounter) / 600f, 2) * 0.8f, MaxInstances = -1 }, player.Center); // Gets louder as time progresses
|
||||
SoundEngine.PlaySound(TimerSound with { Volume = ((600f - concoctionPlayer.swinesWrathCounter) / 600f), MaxInstances = -1 }, player.Center); // Gets louder as time progresses
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Particles;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.StatBuffs
|
||||
{
|
||||
public class FortunesFavor : ModBuff
|
||||
{
|
||||
public static int FortunesFavorRegenBoost = 3;
|
||||
|
||||
public override LocalizedText Description => base.Description.WithFormatArgs(FortunesFavorRegenBoost.ToRegenPerSecond());
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = false;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
player.Calamity().fortunesFavor = true; // Draw FX handled in CalamityPlayerDrawEffects as is standard for regen buffs
|
||||
}
|
||||
|
||||
public override void Update(NPC npc, ref int buffIndex)
|
||||
{
|
||||
npc.Calamity().fortunesFavor = true;
|
||||
}
|
||||
|
||||
internal static void DrawEffects(NPC npc, ref Color drawColor)
|
||||
{
|
||||
Vector2 npcSize = npc.Center + new Vector2(Main.rand.NextFloat(-npc.width / 2, npc.width / 2), Main.rand.NextFloat(-npc.height / 2, npc.height / 2));
|
||||
|
||||
if (Main.rand.NextBool(16))
|
||||
{
|
||||
Particle Plus = new HealingPlus(npcSize, Main.rand.NextFloat(0.3f, 0.5f), new Vector2(0, Main.rand.NextFloat(-2f, -3.5f)) + npc.velocity, Color.Gold, Color.Goldenrod, Main.rand.Next(9, 13));
|
||||
GeneralParticleHandler.SpawnParticle(Plus);
|
||||
}
|
||||
Lighting.AddLight(npc.Center, Color.Gold.ToVector3() * 0.1f);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 740 B |
@@ -4,6 +4,7 @@ using CalamityMod.Items.Accessories;
|
||||
using Terraria;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.StatBuffs
|
||||
{
|
||||
@@ -47,7 +48,7 @@ namespace CalamityMod.Buffs.StatBuffs
|
||||
Main.debuff[Type] = false;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -4,6 +4,7 @@ using CalamityMod.Particles;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.StatDebuffs
|
||||
{
|
||||
@@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.StatDebuffs
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(NPC npc, ref int buffIndex)
|
||||
|
||||
@@ -6,8 +6,6 @@ namespace CalamityMod.Buffs.StatDebuffs
|
||||
{
|
||||
public class Crumbling : ModBuff
|
||||
{
|
||||
public static int DefenseReduction = 10;
|
||||
public static float MultiplicativeDamageReductionPlayer = 0.7f;
|
||||
// 8% DR reduction
|
||||
public static float MultiplicativeDamageReductionEnemy = 0.92f;
|
||||
|
||||
@@ -24,10 +22,5 @@ namespace CalamityMod.Buffs.StatDebuffs
|
||||
{
|
||||
npc.Calamity().crumble = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
player.Calamity().crumble = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ using CalamityMod.Systems.Collections;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.StatDebuffs
|
||||
{
|
||||
@@ -15,7 +16,7 @@ namespace CalamityMod.Buffs.StatDebuffs
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
// Purely to make it get electric color in tooltips
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
|
||||
@@ -4,6 +4,7 @@ using CalamityMod.Projectiles.Magic;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.StatDebuffs
|
||||
{
|
||||
@@ -53,7 +54,7 @@ namespace CalamityMod.Buffs.StatDebuffs
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -2,11 +2,15 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Systems.Collections;
|
||||
|
||||
namespace CalamityMod.Buffs.StatDebuffs
|
||||
{
|
||||
public class WhisperingDeath : ModBuff
|
||||
{
|
||||
public static float PlayerDamageReduction = 0.2f;
|
||||
public static float EnemyDamageReduction = 0.1f;
|
||||
|
||||
// Whispering Death does not deal DoT, but is classified as a sickness debuff.
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
@@ -18,7 +22,7 @@ namespace CalamityMod.Buffs.StatDebuffs
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
CalamityBuffSets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -1,12 +1,37 @@
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Projectiles.Summon;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Summon
|
||||
{
|
||||
public class SeaSnailBuff : BaseSummonBuff
|
||||
public class SeaSnailBuff : ModBuff
|
||||
{
|
||||
protected override int MinionProjectileType => ModContent.ProjectileType<VictideSeaSnail>();
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.buffNoTimeDisplay[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
}
|
||||
|
||||
protected override ref bool MinionBool => ref BuffModdedOwner.victideSnail;
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
|
||||
|
||||
if (player.ownedProjectileCounts[ModContent.ProjectileType<VictideSeaSnail>()] > 0)
|
||||
{
|
||||
modPlayer.victideSnail = true;
|
||||
}
|
||||
|
||||
if (!modPlayer.victideSnail)
|
||||
{
|
||||
player.DelBuff(buffIndex);
|
||||
buffIndex--;
|
||||
}
|
||||
else
|
||||
{
|
||||
player.buffTime[buffIndex] = 18000;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
using CalamityMod.Projectiles.Summon;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Summon
|
||||
{
|
||||
public class SeashineSwordBuff : BaseSummonBuff
|
||||
{
|
||||
protected override int MinionProjectileType => ModContent.ProjectileType<SeashineSwordProj>();
|
||||
|
||||
protected override ref bool MinionBool => ref BuffModdedOwner.seashineSwordBuff;
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 693 B |
|
Before Width: | Height: | Size: 3.3 KiB |
@@ -36,6 +36,7 @@ using CalamityMod.Items.Armor.TitanHeart;
|
||||
using CalamityMod.Items.Armor.Victide;
|
||||
using CalamityMod.Items.Armor.Wulfrum;
|
||||
using CalamityMod.Items.Dyes;
|
||||
using CalamityMod.Items.Fishing;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Mounts;
|
||||
using CalamityMod.Items.Mounts.Minecarts;
|
||||
@@ -68,7 +69,9 @@ using CalamityMod.Projectiles.Typeless;
|
||||
using CalamityMod.Systems;
|
||||
using CalamityMod.Systems.Collections;
|
||||
using CalamityMod.Systems.Mechanic;
|
||||
using CalamityMod.Tiles.Abyss;
|
||||
using CalamityMod.Utilities;
|
||||
using CalamityMod.Walls.UnsafeWalls;
|
||||
using CalamityMod.Waters;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -433,6 +436,7 @@ namespace CalamityMod.CalPlayer
|
||||
public int murasamaHitCooldown = 0;
|
||||
public int giantShellPostHit = 0;
|
||||
public int tortShellPostHit = 0;
|
||||
public int sharkGunDamageScaling = 0;
|
||||
public int MiniSwarmerCooldown = 0;
|
||||
public float SulphWaterPoisoningLevel;
|
||||
public float holyInfernoFadeIntensity;
|
||||
@@ -599,6 +603,7 @@ namespace CalamityMod.CalPlayer
|
||||
public bool lordePet = false;
|
||||
public bool frostyBat = false;
|
||||
public bool toastyBat = false;
|
||||
public bool beldum = false;
|
||||
public bool starSwallowerPetFroge = false;
|
||||
#endregion
|
||||
|
||||
@@ -1063,9 +1068,6 @@ namespace CalamityMod.CalPlayer
|
||||
public bool fadedIdolatry = false;
|
||||
public bool pSoulArtifact = false;
|
||||
public bool giantPearl = false;
|
||||
public bool shieldOfTheOcean = false;
|
||||
public int shieldOfTheOceanParry = 0;
|
||||
public bool shieldOfTheOceanEmpoweredParry = false;
|
||||
public bool normalityRelocator = false;
|
||||
public bool flameLickedShell = false;
|
||||
public int flameLickedShellParry = 0;
|
||||
@@ -1148,6 +1150,7 @@ namespace CalamityMod.CalPlayer
|
||||
public bool scionsCurioVisuals = false;
|
||||
public float scionsCurioDebuffDamage = 0;
|
||||
public bool frozenCube = false;
|
||||
public bool frozenCubeVanity = false;
|
||||
public bool frozenCubeVisuals = false;
|
||||
public float frozenCubeDebuffBoost = 0;
|
||||
public float frozenCubeElumphantBoost = 0;
|
||||
@@ -1227,12 +1230,8 @@ namespace CalamityMod.CalPlayer
|
||||
public bool necroSet = false;
|
||||
/// <summary> Calamity's Frost armor set bonus; gives a combined 20% damage boost split between melee and ranged based on distance from the closest enemy. </summary>
|
||||
public bool frostSet = false;
|
||||
public bool victideBarrierSet = false;
|
||||
public int victideBarrierHeal = 0;
|
||||
public bool victideBarrierHead = false;
|
||||
public bool victideBurrowSet = false;
|
||||
public bool victideBurrowHead = false;
|
||||
public bool victideSnailSet = false;
|
||||
public bool victideSet = false;
|
||||
public bool victideSummoner = false;
|
||||
public bool sulphurSet = false;
|
||||
public bool sulphurJump = false;
|
||||
public int sulphurBubbleCooldown = 0;
|
||||
@@ -1392,7 +1391,6 @@ namespace CalamityMod.CalPlayer
|
||||
public bool staticDischarge = false;
|
||||
public bool miracleBlight = false;
|
||||
public bool armorCrunch = false;
|
||||
public bool crumble = false;
|
||||
public bool irradiated = false;
|
||||
public bool bane = false;
|
||||
public bool brimstoneFlames = false;
|
||||
@@ -1466,7 +1464,6 @@ namespace CalamityMod.CalPlayer
|
||||
public bool purpleHaze = false;
|
||||
public int purpleHazeStealthTimer = 0;
|
||||
public bool mushy = false;
|
||||
public bool fortunesFavor = false;
|
||||
public bool PinkJellyRegen = false;
|
||||
public bool GreenJellyRegen = false;
|
||||
public bool AbsorberRegen = false;
|
||||
@@ -2314,6 +2311,7 @@ namespace CalamityMod.CalPlayer
|
||||
lordePet = false;
|
||||
frostyBat = false;
|
||||
toastyBat = false;
|
||||
beldum = false;
|
||||
starSwallowerPetFroge = false;
|
||||
|
||||
onyxExcavator = false;
|
||||
@@ -2502,7 +2500,6 @@ namespace CalamityMod.CalPlayer
|
||||
fadedIdolatry = false;
|
||||
pSoulArtifact = false;
|
||||
giantPearl = false;
|
||||
shieldOfTheOcean = false;
|
||||
normalityRelocator = false;
|
||||
flameLickedShell = false;
|
||||
sPauldron = false;
|
||||
@@ -2537,7 +2534,7 @@ namespace CalamityMod.CalPlayer
|
||||
camper = false;
|
||||
corrosiveSpine = false;
|
||||
scionsCurio = false;
|
||||
frozenCube = false; frozenCubeDebuffBoost = 0; frozenCubeElumphantBoost = 0; frozenCubeUsedDefense = 0;
|
||||
frozenCube = false; frozenCubeVanity = false; frozenCubeDebuffBoost = 0; frozenCubeElumphantBoost = 0; frozenCubeUsedDefense = 0;
|
||||
rottenDogTooth = false;
|
||||
angelicAlliance = false;
|
||||
ChaosStone = false;
|
||||
@@ -2611,11 +2608,8 @@ namespace CalamityMod.CalPlayer
|
||||
necroSet = false;
|
||||
frostSet = false;
|
||||
|
||||
victideBarrierSet = false;
|
||||
victideBarrierHead = false;
|
||||
victideBurrowSet = false;
|
||||
victideBurrowHead = false;
|
||||
victideSnailSet = false;
|
||||
victideSet = false;
|
||||
victideSummoner = false;
|
||||
|
||||
sulphurSet = false;
|
||||
|
||||
@@ -2696,7 +2690,6 @@ namespace CalamityMod.CalPlayer
|
||||
staticDischarge = false;
|
||||
miracleBlight = false;
|
||||
armorCrunch = false;
|
||||
crumble = false;
|
||||
irradiated = false;
|
||||
bane = false;
|
||||
brimstoneFlames = false;
|
||||
@@ -2783,7 +2776,6 @@ namespace CalamityMod.CalPlayer
|
||||
shine = false;
|
||||
anechoicCoating = false;
|
||||
mushy = false;
|
||||
fortunesFavor = false;
|
||||
PinkJellyRegen = false;
|
||||
GreenJellyRegen = false;
|
||||
AbsorberRegen = false;
|
||||
@@ -3185,7 +3177,6 @@ namespace CalamityMod.CalPlayer
|
||||
staticDischarge = false;
|
||||
miracleBlight = false;
|
||||
armorCrunch = false;
|
||||
crumble = false;
|
||||
irradiated = false;
|
||||
bane = false;
|
||||
brimstoneFlames = false;
|
||||
@@ -3299,7 +3290,6 @@ namespace CalamityMod.CalPlayer
|
||||
shine = false;
|
||||
anechoicCoating = false;
|
||||
mushy = false;
|
||||
fortunesFavor = false;
|
||||
PinkJellyRegen = false;
|
||||
GreenJellyRegen = false;
|
||||
AbsorberRegen = false;
|
||||
@@ -3431,10 +3421,7 @@ namespace CalamityMod.CalPlayer
|
||||
meteorSet = false;
|
||||
necroSet = false;
|
||||
frostSet = false;
|
||||
victideBarrierSet = false;
|
||||
victideBarrierHead = false;
|
||||
victideBurrowSet = false;
|
||||
victideBurrowHead = false;
|
||||
victideSet = false;
|
||||
aeroSet = false;
|
||||
sulphurSet = false;
|
||||
statigelSet = false;
|
||||
@@ -3462,8 +3449,6 @@ namespace CalamityMod.CalPlayer
|
||||
xerocSet = false;
|
||||
tracersDust = false;
|
||||
GemTechState.OnDeathEffects();
|
||||
shieldOfTheOceanParry = 0;
|
||||
shieldOfTheOceanEmpoweredParry = false;
|
||||
blazingCoreParry = 0;
|
||||
blazingCoreEmpoweredParry = false;
|
||||
blazingCoreSuccessfulParry = 0;
|
||||
@@ -3844,12 +3829,6 @@ namespace CalamityMod.CalPlayer
|
||||
flameLickedShellParry = FlameLickedShell.flameLickedParry;
|
||||
}
|
||||
}
|
||||
else if (shieldOfTheOcean && shieldOfTheOceanParry == 0)
|
||||
{
|
||||
Player.SetScreenshake(2f);
|
||||
SoundEngine.PlaySound(ShieldoftheOcean.TriggerSound, Player.Center);
|
||||
shieldOfTheOceanParry = ShieldoftheOcean.ParryTime;
|
||||
}
|
||||
}
|
||||
|
||||
// Trigger for pressing the God Slayer dash key
|
||||
@@ -4025,36 +4004,6 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
public override void ArmorSetBonusActivated()
|
||||
{
|
||||
// TODO -- It would be nice if triggerable set bonuses used interfaces instead of having to go through this large if chain.
|
||||
if (victideBurrowSet)
|
||||
{
|
||||
if (cooldowns.TryGetValue(BubblyBurrow.ID, out CooldownInstance cd))
|
||||
{
|
||||
// Return to normal if you have the ability active
|
||||
if (cd.timeLeft > VictideHeadBurrow.BurrowCooldown)
|
||||
{
|
||||
cd.timeLeft = VictideHeadBurrow.BurrowCooldown + 1;
|
||||
SyncCooldownDictionary(false);
|
||||
}
|
||||
}
|
||||
else if (!Player.tongued && !Player.shimmering)
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Item154, Player.Center);
|
||||
if (Player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
Player.AddCooldown(BubblyBurrow.ID, VictideHeadBurrow.BurrowCooldown + VictideHeadBurrow.BurrowDuration);
|
||||
|
||||
var source = Player.GetSource_Misc("1");
|
||||
Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ProjectileType<VictideSpirit>(), 0, 0f, Player.whoAmI);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (victideBarrierSet && !Player.HasCooldown(WardingWave.ID))
|
||||
{
|
||||
// Explosion and dash are handled in the VictideBarrier file
|
||||
if (Player.whoAmI == Main.myPlayer)
|
||||
Player.AddCooldown(WardingWave.ID, VictideHeadBarrier.BarrierCooldown);
|
||||
}
|
||||
if (brimflameSet && !Player.HasCooldown(BrimflameFrenzy.ID))
|
||||
{
|
||||
if (Player.whoAmI == Main.myPlayer)
|
||||
@@ -4323,10 +4272,10 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
int foundX = -1;
|
||||
int foundY = -1;
|
||||
bool dungeonOnRightSide = Main.dungeonX > Main.spawnTileX;
|
||||
int xSearchEnd = dungeonOnRightSide ? 20 : Main.maxTilesX - 20;
|
||||
bool templeOnLeftSide = Main.dungeonX > Main.spawnTileX;
|
||||
int xSearchEnd = templeOnLeftSide ? 20 : Main.maxTilesX - 20;
|
||||
|
||||
if (dungeonOnRightSide)
|
||||
if (templeOnLeftSide)
|
||||
{
|
||||
for (int i = Main.spawnTileX; i >= xSearchEnd; i -= 2)
|
||||
{
|
||||
@@ -4368,9 +4317,9 @@ namespace CalamityMod.CalPlayer
|
||||
return null;
|
||||
|
||||
int attempts = 25;
|
||||
int rangeX = 300;
|
||||
int rangeY = 300;
|
||||
int randomFluff = 500;
|
||||
int rangeX = 100;
|
||||
int rangeY = 100;
|
||||
int randomFluff = 400;
|
||||
Point finalTeleportPoint = Point.Zero;
|
||||
for (int i = 0; i < attempts; i++)
|
||||
{
|
||||
@@ -4378,13 +4327,13 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
for (int y = 0; y <= rangeY; y++)
|
||||
{
|
||||
int teleportPosX = foundX + x + Main.rand.Next(-randomFluff, randomFluff);
|
||||
int teleportPosX = foundX + (templeOnLeftSide ? x : -x) + Main.rand.Next(-randomFluff, randomFluff);
|
||||
int teleportPosY = foundY + y + Main.rand.Next(-randomFluff, randomFluff);
|
||||
Tile tile = Framing.GetTileSafely(teleportPosX, teleportPosY);
|
||||
Tile tileAbove = Framing.GetTileSafely(teleportPosX, teleportPosY - 1);
|
||||
Tile tileBelow = Framing.GetTileSafely(teleportPosX, teleportPosY + 1);
|
||||
|
||||
if (!tileAbove.HasTile && tileBelow.HasTile && tile.WallType == WallID.LihzahrdBrickUnsafe)
|
||||
if (!tileAbove.HasTile && WorldGen.ActiveAndWalkableTile(tileBelow.X(), tileBelow.Y()) && tile.WallType == WallID.LihzahrdBrickUnsafe)
|
||||
{
|
||||
finalTeleportPoint = new(tile.X(), tile.Y());
|
||||
if (!Collision.SolidCollision(finalTeleportPoint.ToWorldCoordinates(), player.width, player.height))
|
||||
@@ -4403,28 +4352,83 @@ namespace CalamityMod.CalPlayer
|
||||
/// </summary>
|
||||
public static Vector2? GetAbyssVoidTeleportPosition(Player player)
|
||||
{
|
||||
bool canSpawn = false;
|
||||
int halfWorldWidth = Main.maxTilesX / 2;
|
||||
|
||||
int abyssStartX = Abyss.AtLeftSideOfWorld ? halfWorldWidth - (halfWorldWidth - 135) + 35 : halfWorldWidth + (halfWorldWidth - 135) - 35;
|
||||
int abyssXRange = 50;
|
||||
int abyssEndX = Abyss.AtLeftSideOfWorld ? 0 : Main.maxTilesX;
|
||||
|
||||
int teleportStartY = Main.remixWorld ? SulphurousSea.YStart - (int)(Main.UnderworldLayer * 0.6f) : Main.maxTilesY - 300;
|
||||
int teleportRangeY = 80;
|
||||
int foundX = -1;
|
||||
int foundY = -1;
|
||||
|
||||
Player.RandomTeleportationAttemptSettings settings = new Player.RandomTeleportationAttemptSettings
|
||||
if (Abyss.AtLeftSideOfWorld)
|
||||
{
|
||||
mostlySolidFloor = false,
|
||||
avoidAnyLiquid = false,
|
||||
avoidLava = true,
|
||||
avoidHurtTiles = true,
|
||||
avoidWalls = false,
|
||||
attemptsBeforeGivingUp = 1000,
|
||||
maximumFallDistanceFromOrignalPoint = 10
|
||||
};
|
||||
for (int y = Main.maxTilesY; y >= (int)Main.worldSurface; y--)
|
||||
{
|
||||
for (int x = abyssStartX; x >= abyssEndX; x -= 2)
|
||||
{
|
||||
Tile tile = Framing.GetTileSafely(x, y);
|
||||
if (tile.TileType == ModContent.TileType<Voidstone>())
|
||||
{
|
||||
foundX = x;
|
||||
foundY = y;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Vector2 teleportPosition = player.CheckForGoodTeleportationSpot(ref canSpawn, abyssStartX, abyssXRange, teleportStartY, teleportRangeY, settings);
|
||||
return canSpawn ? teleportPosition : null;
|
||||
if (foundY != -1)
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int y = Main.maxTilesY; y >= (int)Main.worldSurface; y--)
|
||||
{
|
||||
for (int x = abyssStartX; x <= abyssEndX; x += 2)
|
||||
{
|
||||
Tile tile = Framing.GetTileSafely(x, y);
|
||||
if (tile.TileType == ModContent.TileType<Voidstone>())
|
||||
{
|
||||
foundX = x;
|
||||
foundY = y;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (foundY != -1)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (foundY == -1)
|
||||
return null;
|
||||
|
||||
int attempts = 25;
|
||||
int rangeX = 100;
|
||||
int rangeY = 200;
|
||||
int randomFluff = 200;
|
||||
Point finalTeleportPoint = new(foundX, foundY);
|
||||
for (int i = 0; i < attempts; i++)
|
||||
{
|
||||
for (int x = 0; x <= rangeX; x++)
|
||||
{
|
||||
for (int y = 0; y <= rangeY; y++)
|
||||
{
|
||||
int teleportPosX = foundX + (Abyss.AtLeftSideOfWorld ? x : -x) + Main.rand.Next(-randomFluff, randomFluff);
|
||||
int teleportPosY = foundY - y + Main.rand.Next(-randomFluff, randomFluff);
|
||||
Tile tile = Framing.GetTileSafely(teleportPosX, teleportPosY);
|
||||
Tile tileAbove = Framing.GetTileSafely(teleportPosX, teleportPosY - 1);
|
||||
Tile tileBelow = Framing.GetTileSafely(teleportPosX, teleportPosY + 1);
|
||||
|
||||
if (!tileAbove.HasTile && WorldGen.ActiveAndWalkableTile(tileBelow.X(), tileBelow.Y()) && tile.WallType == ModContent.WallType<UnsafeVoidstoneWall>())
|
||||
{
|
||||
finalTeleportPoint = new(tile.X(), tile.Y());
|
||||
if (!Collision.SolidCollision(finalTeleportPoint.ToWorldCoordinates(), player.width, player.height))
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return finalTeleportPoint.ToWorldCoordinates() - new Vector2(player.width, player.height);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -4436,20 +4440,20 @@ namespace CalamityMod.CalPlayer
|
||||
// Define an area around the center to search for a valid spot to tp
|
||||
int teleportStartX = WorldgenManagementSystem.DungeonArchivePos.X;
|
||||
int teleportStartY = WorldgenManagementSystem.DungeonArchivePos.Y;
|
||||
bool dungeonOnRightSide = Main.dungeonX > Main.spawnTileX;
|
||||
|
||||
// Manually search for the Archives from the bottom of the world if the Archive position isn't saved.
|
||||
if (WorldgenManagementSystem.DungeonArchivePos == Point.Zero)
|
||||
{
|
||||
int foundX = -1;
|
||||
int foundY = -1;
|
||||
bool dungeonOnRightSide = Main.dungeonX > Main.spawnTileX;
|
||||
int xSearchStart = dungeonOnRightSide ? Main.maxTilesX - 20 : 20;
|
||||
|
||||
if (dungeonOnRightSide)
|
||||
{
|
||||
for (int y = Main.UnderworldLayer; y > (int)Main.rockLayer; y--)
|
||||
for (int y = Main.maxTilesY; y >= (int)Main.worldSurface; y--)
|
||||
{
|
||||
for (int x = xSearchStart; x >= Main.maxTilesX / 2; x -= 2)
|
||||
for (int x = xSearchStart; x >= Main.spawnTileX; x -= 2)
|
||||
{
|
||||
Tile tile = Framing.GetTileSafely(x, y);
|
||||
if (Main.wallDungeon[tile.WallType] && Main.tileDungeon[tile.TileType])
|
||||
@@ -4466,9 +4470,9 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int y = Main.UnderworldLayer; y > (int)Main.rockLayer; y--)
|
||||
for (int y = Main.maxTilesY; y >= (int)Main.worldSurface; y--)
|
||||
{
|
||||
for (int x = xSearchStart; x <= Main.maxTilesX / 2; x += 2)
|
||||
for (int x = xSearchStart; x <= Main.spawnTileX; x += 2)
|
||||
{
|
||||
Tile tile = Framing.GetTileSafely(x, y);
|
||||
if (Main.wallDungeon[tile.WallType] && Main.tileDungeon[tile.TileType])
|
||||
@@ -4491,24 +4495,25 @@ namespace CalamityMod.CalPlayer
|
||||
teleportStartY = foundY;
|
||||
}
|
||||
|
||||
|
||||
int attempts = 25;
|
||||
int rangeX = 100;
|
||||
int rangeY = 200;
|
||||
int randomFluff = 60;
|
||||
int rangeX = 50;
|
||||
int rangeY = 50;
|
||||
int randomFluff = 20;
|
||||
Point finalTeleportPoint = Point.Zero;
|
||||
for (int i = 0; i < attempts; i++)
|
||||
{
|
||||
for (int x = -rangeX; x <= rangeX; x++)
|
||||
for (int x = 0; x <= rangeX; x++)
|
||||
{
|
||||
for (int y = 0; y <= rangeY; y++)
|
||||
{
|
||||
int teleportPosX = teleportStartX + x + Main.rand.Next(-randomFluff, randomFluff);
|
||||
int teleportPosY = teleportStartY + y + Main.rand.Next(-randomFluff, randomFluff);
|
||||
int teleportPosX = teleportStartX + (dungeonOnRightSide ? -x : x) + Main.rand.Next(-randomFluff, randomFluff);
|
||||
int teleportPosY = teleportStartY - y + Main.rand.Next(-randomFluff, randomFluff);
|
||||
Tile tile = Framing.GetTileSafely(teleportPosX, teleportPosY);
|
||||
Tile tileAbove = Framing.GetTileSafely(teleportPosX, teleportPosY - 1);
|
||||
Tile tileBelow = Framing.GetTileSafely(teleportPosX, teleportPosY + 1);
|
||||
|
||||
if (!tileAbove.HasTile && tileBelow.HasUnactuatedTile && Main.wallDungeon[tile.WallType])
|
||||
if (!tileAbove.HasTile && WorldGen.ActiveAndWalkableTile(tileBelow.X(), tileBelow.Y()) && Main.tileDungeon[tile.TileType] && Main.wallDungeon[tile.WallType])
|
||||
{
|
||||
finalTeleportPoint = new(tile.X(), tile.Y());
|
||||
if (!Collision.SolidCollision(finalTeleportPoint.ToWorldCoordinates(), player.width, player.height))
|
||||
@@ -5107,7 +5112,7 @@ namespace CalamityMod.CalPlayer
|
||||
for (int l = 0; l < Player.MaxBuffs; ++l)
|
||||
{
|
||||
int buffID = Player.buffType[l];
|
||||
if ((BuffDatasets.DebuffDataset[buffID] != null && BuffDatasets.DebuffDataset[buffID].AlcoholLevel > 0) || buffID == BuffID.Tipsy)
|
||||
if ((CalamityBuffSets.DebuffDataset[buffID] != null && CalamityBuffSets.DebuffDataset[buffID].AlcoholLevel > 0) || buffID == BuffID.Tipsy)
|
||||
{
|
||||
Player.buffTime[l]++;
|
||||
}
|
||||
@@ -5474,7 +5479,6 @@ namespace CalamityMod.CalPlayer
|
||||
if (!Player.mount.Active)
|
||||
{
|
||||
float runAccMult = 1f +
|
||||
(victideBurrowHead ? VictideHeadBurrow.MoveSpeedAccelerationBoost : 0f) +
|
||||
(lunicCorpsLegs ? LunicCorpsBoots.MoveSpeedAccelerationBoost : 0f) +
|
||||
(shadowSpeed ? DemonshadeGreaves.AccelerationBoost : 0f) +
|
||||
(stressPills ? 0.05f : 0f) +
|
||||
@@ -5495,7 +5499,6 @@ namespace CalamityMod.CalPlayer
|
||||
(hasteLevel * 0.05f);
|
||||
|
||||
float runSpeedMult = 1f +
|
||||
(victideBurrowHead ? VictideHeadBurrow.MoveSpeedAccelerationBoost : 0f) +
|
||||
(lunicCorpsLegs ? LunicCorpsBoots.MoveSpeedAccelerationBoost : 0f) +
|
||||
(shadowSpeed ? DemonshadeGreaves.AccelerationBoost : 0f) +
|
||||
(stressPills ? 0.05f : 0f) +
|
||||
@@ -5525,12 +5528,6 @@ namespace CalamityMod.CalPlayer
|
||||
else
|
||||
momentumCapacitorBoost = 0f;
|
||||
|
||||
if (victideBarrierHead)
|
||||
{
|
||||
Player.runAcceleration *= VictideHeadBarrier.RunAccelerationMult;
|
||||
Player.runSlowdown *= VictideHeadBarrier.RunAccelerationMult;
|
||||
}
|
||||
|
||||
Player.runAcceleration *= runAccMult;
|
||||
Player.maxRunSpeed *= runSpeedMult;
|
||||
}
|
||||
@@ -6403,6 +6400,9 @@ namespace CalamityMod.CalPlayer
|
||||
if (it.type == ItemType<ElephantKiller>())
|
||||
playerUsingWeapon = false;
|
||||
|
||||
if (it.type == ItemType<Spadefish>())
|
||||
playerUsingWeapon = false;
|
||||
|
||||
// Animation check depends on whether the item is "clockwork", like Clockwork Assault Rifle.
|
||||
// "Clockwork" weapons can chain-fire multiple stealth strikes (really only 2 max) until you run out of stealth.
|
||||
bool animationCheck = it.useAnimation == it.useTime
|
||||
|
||||
@@ -40,14 +40,7 @@ namespace CalamityMod.CalPlayer
|
||||
PlayerDrawLayers.Shoes.Hide();
|
||||
}
|
||||
|
||||
if (drawInfo.drawPlayer.ownedProjectileCounts[ModContent.ProjectileType<VictideSpirit>()] > 0)
|
||||
{
|
||||
foreach (var layer in PlayerDrawLayerLoader.Layers)
|
||||
{
|
||||
layer.Hide();
|
||||
}
|
||||
}
|
||||
else if (drawInfo.drawPlayer.Calamity().andromedaState != AndromedaPlayerState.Inactive)
|
||||
if (drawInfo.drawPlayer.Calamity().andromedaState != AndromedaPlayerState.Inactive)
|
||||
{
|
||||
foreach (var layer in PlayerDrawLayerLoader.Layers)
|
||||
{
|
||||
@@ -589,16 +582,6 @@ namespace CalamityMod.CalPlayer
|
||||
WindChilled.DrawEffects(drawInfo);
|
||||
#endregion
|
||||
|
||||
if (calamityPlayer.fortunesFavor && drawInfo.shadow == 0f)
|
||||
{
|
||||
if (Main.rand.NextBool(12))
|
||||
{
|
||||
Vector2 plusPos = new Vector2(Player.position.X + Main.rand.NextFloat(-8f, 20f), Player.position.Y + Main.rand.NextFloat(-14f, 36f));
|
||||
|
||||
Particle Plus = new HealingPlus(plusPos, Main.rand.NextFloat(0.33f, 0.66f), new Vector2(0, Main.rand.NextFloat(-2f, -3.5f)) + Player.velocity, Color.Gold, Color.Goldenrod, Main.rand.Next(9, 13));
|
||||
GeneralParticleHandler.SpawnParticle(Plus);
|
||||
}
|
||||
}
|
||||
if (calamityPlayer.PinkJellyRegen && drawInfo.shadow == 0f)
|
||||
{
|
||||
if (Main.rand.NextBool(24))
|
||||
|
||||
@@ -170,10 +170,6 @@ namespace CalamityMod.CalPlayer
|
||||
else
|
||||
itemDrop = ModContent.ItemType<CragBullhead>();
|
||||
}
|
||||
if (ZoneBasaltGully)
|
||||
{
|
||||
itemDrop = ModContent.ItemType<MoltenFishron>();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -330,7 +326,7 @@ namespace CalamityMod.CalPlayer
|
||||
// Lower chance of Spadefish in Hardmode
|
||||
if (underground) // Underground
|
||||
{
|
||||
int chance = Main.hardMode ? 10 : 2;
|
||||
int chance = Main.hardMode ? 10 : 4;
|
||||
if (attempt.veryrare && Main.rand.NextBool(chance))
|
||||
{
|
||||
itemDrop = ModContent.ItemType<Spadefish>();
|
||||
@@ -370,14 +366,6 @@ namespace CalamityMod.CalPlayer
|
||||
if (Player.ZoneDesert && Main.rand.NextBool())
|
||||
return;
|
||||
|
||||
int commonCatch = ModContent.ItemType<CoralskinFoolfish>();
|
||||
if (ZonePolypForest)
|
||||
commonCatch = ModContent.ItemType<GleamingCucumber>();
|
||||
else if (ZoneGleamingBurrows)
|
||||
commonCatch = ModContent.ItemType<SpecularSturgeon>();
|
||||
else if (ZoneTimelessShores)
|
||||
commonCatch = ModContent.ItemType<Squidoom>();
|
||||
|
||||
if (attempt.legendary)
|
||||
{
|
||||
List<int> legendaryCatches =
|
||||
@@ -411,7 +399,7 @@ namespace CalamityMod.CalPlayer
|
||||
else if (Main.rand.NextBool()) // 50% chance the common fish is replaced with driftwood
|
||||
itemDrop = ModContent.ItemType<Driftwood>();
|
||||
else
|
||||
itemDrop = commonCatch;
|
||||
itemDrop = ModContent.ItemType<PrismaticGuppy>();
|
||||
return;
|
||||
}
|
||||
// There is no complete fishing pool here, so most of it is vanilla default
|
||||
|
||||
@@ -43,6 +43,7 @@ using CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Projectiles.Magic;
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
using CalamityMod.Projectiles.Pets;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
@@ -282,17 +283,11 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
// Custom Death Messages
|
||||
|
||||
#region DoT Sources
|
||||
if (damage == 10.0 && hitDirection == 0 && damageSource.SourceOtherIndex == 8)
|
||||
{
|
||||
if (fishStocks && fishStockPower < 0)
|
||||
{
|
||||
string year = DateTime.Now.ToString("yy");
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.FishStocks" + Main.rand.Next(1, 6 + 1)).ToNetworkText(Player.name, year));
|
||||
}
|
||||
if (alcoholPoisoning)
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AlcoholBig" + Main.rand.Next(1, 2 + 1)).ToNetworkText(Player.name));
|
||||
}
|
||||
if (vHex)
|
||||
{
|
||||
// Unique messages appear half the time during each individual stage of SCal's fight
|
||||
@@ -314,13 +309,9 @@ namespace CalamityMod.CalPlayer
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText(vHexKeyToUse).ToNetworkText(Player.name));
|
||||
}
|
||||
if (ZoneCalamity && Player.lavaWet)
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.SearingLava" + Main.rand.Next(1, 2 + 1)).ToNetworkText(Player.name));
|
||||
}
|
||||
if (godSlayerInferno)
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.GodSlayerInferno" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
|
||||
}
|
||||
if (sulphurPoison)
|
||||
{
|
||||
if (!Main.rand.NextBool(4)) // 75% custom
|
||||
@@ -329,116 +320,76 @@ namespace CalamityMod.CalPlayer
|
||||
damageSource = PlayerDeathReason.ByOther(9); // 25% generic Poisoned death text
|
||||
}
|
||||
if (dragonFire)
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Dragonfire" + Main.rand.Next(1, 4 + 1)).ToNetworkText(Player.name));
|
||||
}
|
||||
if (vermillionFlux)
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.VermillionFlux" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
|
||||
}
|
||||
if (auricRebuke)
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AuricRebuke" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
|
||||
}
|
||||
if (staticDischarge)
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.StaticDischarge" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
|
||||
}
|
||||
if (miracleBlight)
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.MiracleBlight" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
|
||||
}
|
||||
if (holyInferno)
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.HolyInferno").ToNetworkText(Player.name));
|
||||
}
|
||||
if (holyFlames || banishingFire)
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.HolyFlames" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
|
||||
}
|
||||
if (shadowflame)
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Shadowflame").ToNetworkText(Player.name));
|
||||
}
|
||||
if (daybroken)
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Daybroken").ToNetworkText(Player.name));
|
||||
}
|
||||
if (burningBlood)
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.BurningBlood" + Main.rand.Next(1, 2 + 1)).ToNetworkText(Player.name));
|
||||
}
|
||||
if (brainRot)
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.BrainRot" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
|
||||
}
|
||||
if (heavybleeding)
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.HeavyBleeding" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
|
||||
}
|
||||
if (laceration)
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Laceration" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
|
||||
}
|
||||
if (elementalMix)
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.ElementalMix" + Main.rand.Next(1, 2 + 1)).ToNetworkText(Player.name));
|
||||
}
|
||||
if (crushDepth)
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.CrushDepth" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
|
||||
}
|
||||
if (riptide)
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Riptide" + Main.rand.Next(1, 2 + 1)).ToNetworkText(Player.name));
|
||||
}
|
||||
if (hadopelagicPressure)
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.HadopelagicPressure" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
|
||||
}
|
||||
if (brimstoneFlames || weakBrimstoneFlames || demonicFlames)
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.BrimstoneFlames" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
|
||||
}
|
||||
if (plague)
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Plague" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
|
||||
}
|
||||
if (astralInfection)
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AstralInfection" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
|
||||
}
|
||||
if (nightwither)
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Nightwither").ToNetworkText(Player.name));
|
||||
}
|
||||
if (vaporfied)
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Vaporfied").ToNetworkText(Player.name));
|
||||
}
|
||||
if (manaOverloader || ManaBurn)
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.ManaBurn").ToNetworkText(Player.name));
|
||||
}
|
||||
if (witheredDebuff)
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Withered").ToNetworkText(Player.name));
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Item Sources
|
||||
if (profanedCrystalBuffs && Player.Transformation().Type == ModContent.ItemType<ProfanedSoulCrystal>())
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.ProfanedSoulCrystal").ToNetworkText(Player.name));
|
||||
|
||||
if (fishStocks && fishStockPower < 0)
|
||||
{
|
||||
string year = DateTime.Now.ToString("yy");
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.FishStocks" + Main.rand.Next(1, 6 + 1)).ToNetworkText(Player.name, year));
|
||||
}
|
||||
|
||||
// Leon Death Noise RE4
|
||||
if (Main.zenithWorld)
|
||||
SoundEngine.PlaySound(LeonDeathNoiseRE4_ForGFB, Player.Center);
|
||||
if (damageSource.TryGetCausingEntity(out var Entity) && Entity is Projectile && (Entity as Projectile).type == ModContent.ProjectileType<LemonNadeProjectile>())
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Lemonnade" + Main.rand.Next(1, 4)).ToNetworkText(Player.name));
|
||||
|
||||
if (NorfleetCounter > 3 && NorfleetCounter < 1000)
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Norfleet").ToNetworkText(Player.name));
|
||||
NorfleetCounter = 0;
|
||||
#endregion
|
||||
|
||||
if (damageSource.TryGetCausingEntity(out var Entity) && Entity is NPC && (Entity as NPC).type == ModContent.NPCType<DevourerofGodsHead>())
|
||||
#region NPC Sources
|
||||
if (damageSource.TryGetCausingEntity(out var Entity2) && Entity2 is NPC && (Entity2 as NPC).type == ModContent.NPCType<DevourerofGodsHead>())
|
||||
{
|
||||
var npc = Main.npc[damageSource.SourceNPCIndex];
|
||||
if (npc.ai[3] < 2) //Divinity Devourer
|
||||
@@ -446,6 +397,7 @@ namespace CalamityMod.CalPlayer
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.DivinityDevourer"+Main.rand.Next(1,4)).ToNetworkText(Player.name));
|
||||
}
|
||||
else if (npc.ai[3] >= 3)
|
||||
{
|
||||
if (npc.life > npc.lifeMax / 4) //Dimensional Drive
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.DimensionalDrive").ToNetworkText(Player.name));
|
||||
@@ -454,6 +406,7 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.UltracosmicMaelstrom" + Main.rand.Next(1, 3)).ToNetworkText(Player.name));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (NPC.AnyNPCs(ModContent.NPCType<SupremeCalamitas>()))
|
||||
@@ -461,6 +414,11 @@ namespace CalamityMod.CalPlayer
|
||||
if (sCalDeathCount < 51)
|
||||
sCalDeathCount++;
|
||||
}
|
||||
#endregion
|
||||
|
||||
// Leon Death Noise RE4
|
||||
if (Main.zenithWorld)
|
||||
SoundEngine.PlaySound(LeonDeathNoiseRE4_ForGFB, Player.Center);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -502,7 +460,7 @@ namespace CalamityMod.CalPlayer
|
||||
for (int index = 0; index < target.buffType.Length; index++)
|
||||
{
|
||||
int type = target.buffType[index];
|
||||
var debuffData = BuffDatasets.DebuffDataset[type];
|
||||
var debuffData = CalamityBuffSets.DebuffDataset[type];
|
||||
if (debuffData != null)
|
||||
numOfDebuffs++;
|
||||
}
|
||||
@@ -727,70 +685,10 @@ namespace CalamityMod.CalPlayer
|
||||
if (npc.Calamity().antlionCloudDebuffTimer > 0)
|
||||
modifiers.SourceDamage *= AntlionSkewer.CloudDamageDebuffMult;
|
||||
|
||||
// Enemies deal less contact damage while sick, due to being weakened.
|
||||
if (npc.poisoned)
|
||||
{
|
||||
float damageReductionFromPoison = (float)((npc.Calamity().irradiated ? npc.Calamity().irradiatedContactBoost : 1) * 0.05f);
|
||||
if (npc.Calamity().VulnerableToSickness.HasValue)
|
||||
{
|
||||
if (npc.Calamity().VulnerableToSickness.Value)
|
||||
damageReductionFromPoison *= 2f;
|
||||
else
|
||||
damageReductionFromPoison /= 2f;
|
||||
}
|
||||
damageReductionFromPoison = 1f - damageReductionFromPoison;
|
||||
|
||||
modifiers.SourceDamage *= damageReductionFromPoison;
|
||||
}
|
||||
|
||||
if (npc.venom)
|
||||
{
|
||||
float damageReductionFromVenom = (float)((npc.Calamity().irradiated ? npc.Calamity().irradiatedContactBoost : 1) * 0.05f);
|
||||
if (npc.Calamity().VulnerableToSickness.HasValue)
|
||||
{
|
||||
if (npc.Calamity().VulnerableToSickness.Value)
|
||||
damageReductionFromVenom *= 2f;
|
||||
else
|
||||
damageReductionFromVenom /= 2f;
|
||||
}
|
||||
damageReductionFromVenom = 1f - damageReductionFromVenom;
|
||||
|
||||
modifiers.SourceDamage *= damageReductionFromVenom;
|
||||
}
|
||||
|
||||
if (npc.Calamity().astralInfection)
|
||||
{
|
||||
float damageReductionFromAstralInfection = (float)((npc.Calamity().irradiated ? npc.Calamity().irradiatedContactBoost : 1) * 0.05f);
|
||||
if (npc.Calamity().VulnerableToSickness.HasValue)
|
||||
{
|
||||
if (npc.Calamity().VulnerableToSickness.Value)
|
||||
damageReductionFromAstralInfection *= 2f;
|
||||
else
|
||||
damageReductionFromAstralInfection /= 2f;
|
||||
}
|
||||
damageReductionFromAstralInfection = 1f - damageReductionFromAstralInfection;
|
||||
|
||||
modifiers.SourceDamage *= damageReductionFromAstralInfection;
|
||||
}
|
||||
|
||||
if (npc.Calamity().plague)
|
||||
{
|
||||
float damageReductionFromPlague = (float)((npc.Calamity().irradiated? npc.Calamity().irradiatedContactBoost : 1) * 0.05f);
|
||||
if (npc.Calamity().VulnerableToSickness.HasValue)
|
||||
{
|
||||
if (npc.Calamity().VulnerableToSickness.Value)
|
||||
damageReductionFromPlague *= 2f;
|
||||
else
|
||||
damageReductionFromPlague /= 2f;
|
||||
}
|
||||
damageReductionFromPlague = 1f - damageReductionFromPlague;
|
||||
|
||||
modifiers.SourceDamage *= damageReductionFromPlague;
|
||||
}
|
||||
|
||||
// Whispering Death makes enemies deal less damage
|
||||
if (npc.Calamity().whisperingDeath)
|
||||
{
|
||||
float damageReductionFromWhisperingDeath = (float)((npc.Calamity().irradiated ? npc.Calamity().irradiatedContactBoost : 1) * 0.1f);
|
||||
float damageReductionFromWhisperingDeath = (float)((npc.Calamity().irradiated ? npc.Calamity().irradiatedContactBoost : 1) * WhisperingDeath.EnemyDamageReduction);
|
||||
if (npc.Calamity().VulnerableToSickness.HasValue)
|
||||
{
|
||||
if (npc.Calamity().VulnerableToSickness.Value)
|
||||
@@ -1223,8 +1121,6 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
if (sulphurSet)
|
||||
Main.npc[proj.Calamity().ParentNPCIndex].AddBuff(BuffID.Poisoned, SulphurousHelmet.SetBonusPoisonDuration);
|
||||
if (ilSpark)
|
||||
Main.npc[proj.Calamity().ParentNPCIndex].Calamity().shocked = 120;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1732,23 +1628,6 @@ namespace CalamityMod.CalPlayer
|
||||
FlameLickedShell.handleParry(Player);
|
||||
}
|
||||
}
|
||||
else if (shieldOfTheOceanParry >= 12)
|
||||
{
|
||||
if (!Player.HasCooldown(ParryCooldown.ID))
|
||||
{
|
||||
// Shield of the Ocean is a parry. It uses vanilla parry iframes and benefits from Cross Necklace.
|
||||
int shieldParryIFrames = Player.ComputeParryIFrames();
|
||||
Player.GiveUniversalIFrames(shieldParryIFrames, true);
|
||||
|
||||
shieldOfTheOceanEmpoweredParry = true;
|
||||
modifiers.FinalDamage *= 0.4f; // 60% DR
|
||||
modifiers.DisableSound();
|
||||
}
|
||||
|
||||
SoundEngine.PlaySound(ShieldoftheOcean.ParrySound, Player.Center);
|
||||
Player.AddCooldown(ParryCooldown.ID, 1200, false, "shieldoftheocean");
|
||||
ShieldoftheOcean.ActivateParry(Player);
|
||||
}
|
||||
|
||||
if (Player.Calamity().scionsCurio)
|
||||
scionsCurioGotHit = true;
|
||||
@@ -2202,12 +2081,6 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
}
|
||||
|
||||
if (victideBarrierSet && !Player.HasCooldown(WardingWave.ID))
|
||||
{
|
||||
int healAmt = (int)(hurtInfo.Damage * VictideHeadBarrier.BarrierDamageAbsorptionPercent);
|
||||
victideBarrierHeal += healAmt;
|
||||
}
|
||||
|
||||
if (daedalusAbsorb && Main.rand.NextBool(DaedalusHeadMagic.AbsorptionChanceDenominator))
|
||||
{
|
||||
int healAmt = (int)(hurtInfo.Damage * DaedalusHeadMagic.DamageAbsorptionPercent);
|
||||
@@ -2511,19 +2384,38 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
if (ilSpark)
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Item93, Player.Center);
|
||||
|
||||
// Only visual effects are done here
|
||||
// The actual spark spawning is now handled with the shocked variable in CalamityGlobalNPC
|
||||
|
||||
SeaFoamParticle boom = new(Player.Center, Vector2.Zero, new Color(89, 239, 247), new Color(56, 158, 209), 1f, 200f, Main.rand.NextBool() ? -1f : 1f);
|
||||
GeneralParticleHandler.SpawnParticle(boom);
|
||||
|
||||
for (int e = 0; e < 6; e++)
|
||||
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<HideofAstrumDeus>()));
|
||||
if (hurtInfo.Damage > 0)
|
||||
{
|
||||
Vector2 dustVel = Main.rand.NextVector2CircularEdge(1f, 1f) * Main.rand.NextFloat(4.5f, 5.25f);
|
||||
Dust electric = Dust.NewDustPerfect(Player.Center, DustID.Electric, dustVel, Scale: 0.75f);
|
||||
electric.noGravity = true;
|
||||
SoundEngine.PlaySound(SoundID.Item93, Player.Center);
|
||||
float spread = 45f * 0.0174f;
|
||||
double startAngle = Math.Atan2(Player.velocity.X, Player.velocity.Y) - spread / 2;
|
||||
double deltaAngle = spread / 8f;
|
||||
double offsetAngle;
|
||||
|
||||
// Start with base damage, then apply the best damage class you can
|
||||
int sDamage = 6;
|
||||
if (transformer)
|
||||
sDamage += 42;
|
||||
sDamage = (int)Player.GetBestClassDamage().ApplyTo(sDamage);
|
||||
|
||||
if (Player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
|
||||
int spark1 = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType<GenericElectricSpark>(), sDamage, 1.25f, Player.whoAmI, 0f, 1);
|
||||
int spark2 = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType<GenericElectricSpark>(), sDamage, 1.25f, Player.whoAmI, 0f, 1);
|
||||
if (spark1.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[spark1].timeLeft = 120;
|
||||
}
|
||||
if (spark2.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[spark2].timeLeft = 120;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (rBrain)
|
||||
|
||||
@@ -198,18 +198,18 @@ namespace CalamityMod.CalPlayer
|
||||
int buff = Player.buffType[l];
|
||||
if (buff <= 0) continue;
|
||||
|
||||
var data = BuffDatasets.DebuffDataset[buff];
|
||||
var data = CalamityBuffSets.DebuffDataset[buff];
|
||||
if (data?.AlcoholLevel > 0)
|
||||
alcoholPoisonLevel += data.AlcoholLevel;
|
||||
}
|
||||
|
||||
if (dripPlayer.ivDripEquipped && dripPlayer.currentAlcohol != AlcoholType.None)
|
||||
{
|
||||
int ivBuffID = BuffDatasets.GetBuffIDFromAlcoholType(dripPlayer.currentAlcohol);
|
||||
int ivBuffID = CalamityBuffSets.GetBuffIDFromAlcoholType(dripPlayer.currentAlcohol);
|
||||
|
||||
if (ivBuffID != -1)
|
||||
{
|
||||
var ivData = BuffDatasets.DebuffDataset[ivBuffID];
|
||||
var ivData = CalamityBuffSets.DebuffDataset[ivBuffID];
|
||||
if (ivData?.AlcoholLevel > 0)
|
||||
alcoholPoisonLevel += ivData.AlcoholLevel;
|
||||
}
|
||||
@@ -338,7 +338,7 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
|
||||
// Permafrost's Concoction increases life regen while afflicted with a fire debuff
|
||||
if (permafrostsConcoction && Player.buffType.Any(l => BuffDatasets.DebuffDataset[l] is not null && BuffDatasets.DebuffDataset[l].HeatDebuffScaling > 0))
|
||||
if (permafrostsConcoction && Player.buffType.Any(l => CalamityBuffSets.DebuffDataset[l] is not null && CalamityBuffSets.DebuffDataset[l].HeatDebuffScaling > 0))
|
||||
Player.lifeRegen += 6;
|
||||
|
||||
if (grandDadHealTimer == 0 && grandDadHealPool >= 7)
|
||||
@@ -493,9 +493,6 @@ namespace CalamityMod.CalPlayer
|
||||
if (sRegen)
|
||||
Player.lifeRegen += SpiritGlyph.RegenBoost;
|
||||
|
||||
if (fortunesFavor)
|
||||
Player.lifeRegen += FortunesFavor.FortunesFavorRegenBoost;
|
||||
|
||||
if (PinkJellyRegen)
|
||||
Player.lifeRegen += LifeJelly.AuraRegenBoost;
|
||||
|
||||
@@ -588,9 +585,8 @@ namespace CalamityMod.CalPlayer
|
||||
if (community)
|
||||
{
|
||||
int regenBoost = 1 + (int)(TheCommunity.CalculatePower() * TheCommunity.RegenMultiplier);
|
||||
bool lesserEffect = Player.buffType.Any(i => BuffDatasets.DebuffDataset[i] is not null && BuffDatasets.DebuffDataset[i].AlcoholLevel > 0);
|
||||
if (Player.lifeRegen < 0)
|
||||
Player.lifeRegen += lesserEffect ? 1 : regenBoost;
|
||||
Player.lifeRegen += regenBoost;
|
||||
}
|
||||
|
||||
if (manaOverloader)
|
||||
|
||||
@@ -908,6 +908,11 @@ namespace CalamityMod.CalPlayer
|
||||
int scoriaOreID = ModContent.TileType<ScoriaOre>();
|
||||
int abyssKelpID = ModContent.TileType<AbyssKelp>();
|
||||
|
||||
// Auric Ore causes an Auric Rejection unless you are wearing Auric Armor or have God Mode
|
||||
// Auric Rejection causes an electrical explosion that yeets the player a considerable distance
|
||||
// CIT 17AUG2024: Despite providing full invulnerability, Silva armor revive intentionally does not prevent Auric rejection's yeeting.
|
||||
// 25FEB2025 Ozzatron: Added external bool to control Auric Rejection immunity from the ore.
|
||||
bool rejectionImmunity = auricSet || seraphTracers || Player.creativeGodMode || externalAuricRejectionImmunity;
|
||||
int auricRejectionDamage = 300;
|
||||
float auricRejectionKB = Player.noKnockback ? 20f : 40f;
|
||||
|
||||
@@ -944,11 +949,6 @@ namespace CalamityMod.CalPlayer
|
||||
Player.AddBuff(BuffID.Burning, 2);
|
||||
}
|
||||
|
||||
// Auric Ore causes an Auric Rejection unless you are wearing Auric Armor or have God Mode
|
||||
// Auric Rejection causes an electrical explosion that yeets the player a considerable distance
|
||||
// CIT 17AUG2024: Despite providing full invulnerability, Silva armor revive intentionally does not prevent Auric rejection's yeeting.
|
||||
// 25FEB2025 Ozzatron: Added external bool to control Auric Rejection immunity from the ore.
|
||||
bool rejectionImmunity = auricSet || seraphTracers || Player.creativeGodMode || externalAuricRejectionImmunity;
|
||||
bool oreRejection = (tile.TileType == auricOreID) && !rejectionImmunity;
|
||||
|
||||
// Repulsers always perform this effect because they are player-placed tiles made for this exact purpose
|
||||
@@ -976,14 +976,17 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
}
|
||||
|
||||
if (Player.sitting.TryGetSittingBlock(Player, out Tile AuricToiletTile))
|
||||
if (Player.sitting.TryGetSittingBlock(Player, out Tile AuricToiletTile) && !rejectionImmunity)
|
||||
{
|
||||
Player.Hurt(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AuricRejection").ToNetworkText(Player.name)), auricRejectionDamage, 0);
|
||||
Player.AddBuff(ModContent.BuffType<AuricRebuke>(), 120);
|
||||
SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/ExoMechs/TeslaShoot1"), Player.Center);
|
||||
Player.sitting.SitUp(Player, false);
|
||||
Vector2 yeetVec = new Vector2(Player.direction, -1.5f);
|
||||
Player.velocity += yeetVec * auricRejectionKB;
|
||||
if (AuricToiletTile.TileType == ModContent.TileType<AuricToiletTile>())
|
||||
{
|
||||
Player.Hurt(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AuricRejection").ToNetworkText(Player.name)), auricRejectionDamage, 0);
|
||||
Player.AddBuff(ModContent.BuffType<AuricRebuke>(), 120);
|
||||
SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/ExoMechs/TeslaShoot1"), Player.Center);
|
||||
Player.sitting.SitUp(Player, false);
|
||||
Vector2 yeetVec = new Vector2(Player.direction, -1.5f);
|
||||
Player.velocity += yeetVec * auricRejectionKB;
|
||||
}
|
||||
}
|
||||
}
|
||||
private void HandleBlazingMouseEffects()
|
||||
@@ -1718,6 +1721,7 @@ namespace CalamityMod.CalPlayer
|
||||
fishStockOldPower.Item2,
|
||||
fishStockOldPower.Item3,
|
||||
fishStockOldPower.Item4);
|
||||
fishStockPower = newFishStockPower;
|
||||
}
|
||||
// Stats
|
||||
Player.GetDamage<GenericDamageClass>() += 0.15f * fishStockPower;
|
||||
@@ -2391,7 +2395,7 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
if (bloomStoneTotalHeal > 0)
|
||||
{
|
||||
float healRateDiv = (Player.statLife >= Player.statLifeMax ? 5 : // 5 times as slow if at max hp already (overheal prevention)
|
||||
float healRateDiv = (Player.statLife >= Player.statLifeMax ? 2 : // 2 times as slow if at max hp already (overheal prevention)
|
||||
bloomStoneBuffedHealRateTimer > 0 ? Utils.Remap(bloomStoneBuffedHealRateTimer, 90, 0, 0.5f, 1f, true) // 2 times faster if pollen buffed, scales back down to regular speed as the buff fades
|
||||
: 1); // Regular speed
|
||||
bloomStoneHealRate = 1 / healRateDiv;
|
||||
@@ -2549,13 +2553,6 @@ namespace CalamityMod.CalPlayer
|
||||
else
|
||||
flameLickedShellParry--;
|
||||
}
|
||||
if (shieldOfTheOceanParry > 0)
|
||||
{
|
||||
if (shieldOfTheOcean)
|
||||
ShieldoftheOcean.HandleParryCountdown(Player);
|
||||
else
|
||||
shieldOfTheOceanParry--;
|
||||
}
|
||||
|
||||
if (!flameLickedShell && flameLickedShellParry > 0)
|
||||
flameLickedShellParry--;
|
||||
@@ -3224,7 +3221,7 @@ namespace CalamityMod.CalPlayer
|
||||
(Player.arcticDivingGear ? 5D : 0D) +
|
||||
(aquaticEmblem ? 5D : 0D) +
|
||||
(Player.accMerman ? 8D : 0D) +
|
||||
(victideBurrowHead ? 2D : 0D) +
|
||||
(victideSet ? 2D : 0D) +
|
||||
((aquaticHeart && NPC.downedBoss3) ? 8D : 0D) +
|
||||
(abyssalDivingSuit ? 8D : 0D) +
|
||||
externalBreathTickBoost;
|
||||
@@ -3747,10 +3744,7 @@ namespace CalamityMod.CalPlayer
|
||||
continue;
|
||||
float distance = (npc.Center - Player.Center).Length();
|
||||
if (distance < GiantPearl.AuraRadius)
|
||||
{
|
||||
npc.AddBuff(ModContent.BuffType<PearlAura>(), 20, false);
|
||||
npc.Calamity().pearlAuraOwner = Player.whoAmI;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3847,7 +3841,7 @@ namespace CalamityMod.CalPlayer
|
||||
Player.lifeMagnet = true;
|
||||
|
||||
if (whisperingDeath && !laudanum)
|
||||
Player.GetDamage<GenericDamageClass>() -= 0.2f;
|
||||
Player.GetDamage<GenericDamageClass>() -= WhisperingDeath.PlayerDamageReduction;
|
||||
|
||||
if (armorCrunch && !laudanum)
|
||||
{
|
||||
@@ -3863,7 +3857,7 @@ namespace CalamityMod.CalPlayer
|
||||
if (eutrophication)
|
||||
Player.velocity = Vector2.Zero;
|
||||
|
||||
if (vaporfied || galvanicCorrosion)
|
||||
if (vaporfied || galvanicCorrosion || windChilled)
|
||||
Player.velocity *= 0.98f;
|
||||
|
||||
if (molluskHelmet)
|
||||
@@ -4460,7 +4454,7 @@ namespace CalamityMod.CalPlayer
|
||||
else if (hasBuff == ModContent.BuffType<WhisperingDeath>())
|
||||
{
|
||||
Player.lifeRegenCount += 5;
|
||||
Player.GetDamage<GenericDamageClass>() += 0.2f;
|
||||
Player.GetDamage<GenericDamageClass>() += WhisperingDeath.PlayerDamageReduction;
|
||||
}
|
||||
|
||||
switch (hasBuff)
|
||||
@@ -4986,6 +4980,53 @@ namespace CalamityMod.CalPlayer
|
||||
RecipeUnlockHandler.HasFoundIceSchematic = true;
|
||||
shouldSync = true;
|
||||
}
|
||||
|
||||
if (Main.mouseItem.type == ModContent.ItemType<LuxorsGift>() && !RecipeUnlockHandler.HasFoundLuxorsGift)
|
||||
{
|
||||
RecipeUnlockHandler.HasFoundLuxorsGift = true;
|
||||
shouldSync = true;
|
||||
}
|
||||
|
||||
if (Main.mouseItem.type == ModContent.ItemType<FungalSymbiote>() && !RecipeUnlockHandler.HasFoundFungalSymbiote)
|
||||
{
|
||||
RecipeUnlockHandler.HasFoundFungalSymbiote = true;
|
||||
shouldSync = true;
|
||||
}
|
||||
|
||||
if (Main.mouseItem.type == ModContent.ItemType<TrinketofChi>() && !RecipeUnlockHandler.HasFoundTrinketOfChi)
|
||||
{
|
||||
RecipeUnlockHandler.HasFoundTrinketOfChi = true;
|
||||
shouldSync = true;
|
||||
}
|
||||
|
||||
if (Main.mouseItem.type == ModContent.ItemType<FrozenCube>() && !RecipeUnlockHandler.HasFoundFrozenCube)
|
||||
{
|
||||
RecipeUnlockHandler.HasFoundFrozenCube = true;
|
||||
shouldSync = true;
|
||||
}
|
||||
|
||||
if (Main.mouseItem.type == ModContent.ItemType<GladiatorsLocket>() && !RecipeUnlockHandler.HasFoundGladiatorsLocket)
|
||||
{
|
||||
RecipeUnlockHandler.HasFoundGladiatorsLocket = true;
|
||||
shouldSync = true;
|
||||
}
|
||||
if (Main.mouseItem.type == ModContent.ItemType<UnstableGraniteCore>() && !RecipeUnlockHandler.HasFoundUnstableGraniteCore)
|
||||
{
|
||||
RecipeUnlockHandler.HasFoundUnstableGraniteCore = true;
|
||||
shouldSync = true;
|
||||
}
|
||||
|
||||
if (Main.mouseItem.type == ModContent.ItemType<CrimsonEffigy>() && !RecipeUnlockHandler.HasFoundCrimsonEffigy)
|
||||
{
|
||||
RecipeUnlockHandler.HasFoundCrimsonEffigy = true;
|
||||
shouldSync = true;
|
||||
}
|
||||
|
||||
if (Main.mouseItem.type == ModContent.ItemType<CorruptionEffigy>() && !RecipeUnlockHandler.HasFoundCorruptionEffigy)
|
||||
{
|
||||
RecipeUnlockHandler.HasFoundCorruptionEffigy = true;
|
||||
shouldSync = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (shouldSync)
|
||||
|
||||
@@ -212,6 +212,11 @@ namespace CalamityMod.CalPlayer
|
||||
if (Player.whoAmI != Main.myPlayer)
|
||||
return;
|
||||
|
||||
// Don't activate for non-friendly projectiles (obviously).
|
||||
// Override CanHitNPC if you want a hostile projectile that can also damage enemies.
|
||||
if (!proj.friendly)
|
||||
return;
|
||||
|
||||
//Undo raider crit after hit
|
||||
if (!proj.Calamity().stealthStrike && !proj.Calamity().stealthStrikeSubProjectile && raiderCritLifespan > 0f)
|
||||
{
|
||||
@@ -456,6 +461,15 @@ namespace CalamityMod.CalPlayer
|
||||
GungeonMusicSystem.GUN();
|
||||
}
|
||||
|
||||
// Used by Megalodon, Seadragon & Voidragon, allows bullets to track their damage scaling
|
||||
if (cgp.sharkBullets)
|
||||
{
|
||||
if (proj.numHits == 0)
|
||||
{
|
||||
sharkGunDamageScaling++;
|
||||
}
|
||||
}
|
||||
|
||||
if (cgp.fireBullet)
|
||||
{
|
||||
target.AddBuff(BuffID.OnFire3, 60);
|
||||
@@ -1226,11 +1240,6 @@ namespace CalamityMod.CalPlayer
|
||||
target.AddBuff(BuffType<HadopelagicPressure>(), 180);
|
||||
if (sulphurSet)
|
||||
target.AddBuff(BuffID.Poisoned, SulphurousHelmet.SetBonusPoisonDuration);
|
||||
if (ilSpark && Player.Calamity().countsAsAnyWet)
|
||||
{
|
||||
int duration = 60;
|
||||
target.AddBuff(BuffType<StaticDischarge>(), duration);
|
||||
}
|
||||
if (corrosiveSpine)
|
||||
{
|
||||
target.AddBuff(BuffType<Irradiated>(), 120);
|
||||
@@ -1289,7 +1298,7 @@ namespace CalamityMod.CalPlayer
|
||||
//Nanotech has the same heal as Electrician's glove
|
||||
Player.SpawnLifeStealProjectile(target, proj, ProjectileID.VampireHeal, electricianGlove ? 10 : 5, electricianGlove ? 2f : 3f);
|
||||
|
||||
if (proj.CountsAsClass<MagicDamageClass>() && Player.HeldItem.CountsAsClass<MagicDamageClass>())
|
||||
if (proj.CountsAsClass<MagicDamageClass>())
|
||||
{
|
||||
if (manaOverloader)
|
||||
{
|
||||
|
||||
@@ -11,12 +11,11 @@ namespace CalamityMod.CalPlayer.DrawLayers
|
||||
public enum EncasementType
|
||||
{
|
||||
BlazingCore,
|
||||
FlameLickedShell,
|
||||
ShieldoftheOcean
|
||||
FlameLickedShell
|
||||
}
|
||||
public override Position GetDefaultPosition() => new BeforeParent(PlayerDrawLayers.FrontAccFront); //me when the player layer is called front acc front :skull:
|
||||
|
||||
public EncasementType GetEncasementTypeFor(CalamityPlayer modPlayer) => modPlayer.blazingCore ? EncasementType.BlazingCore : modPlayer.flameLickedShell ? EncasementType.FlameLickedShell : EncasementType.ShieldoftheOcean;
|
||||
public EncasementType GetEncasementTypeFor(CalamityPlayer modPlayer) => modPlayer.blazingCore ? EncasementType.BlazingCore : EncasementType.FlameLickedShell;
|
||||
|
||||
public override bool GetDefaultVisibility(PlayerDrawSet drawInfo)
|
||||
{
|
||||
@@ -28,7 +27,6 @@ namespace CalamityMod.CalPlayer.DrawLayers
|
||||
{
|
||||
EncasementType.BlazingCore => visible && modPlayer.blazingCoreParry > 0,
|
||||
EncasementType.FlameLickedShell => visible && modPlayer.flameLickedShellParry > 0,
|
||||
EncasementType.ShieldoftheOcean => visible && modPlayer.shieldOfTheOceanParry > 0,
|
||||
_ => false
|
||||
};
|
||||
return visible;
|
||||
@@ -57,12 +55,6 @@ namespace CalamityMod.CalPlayer.DrawLayers
|
||||
defaultOpacity = 0.875f;
|
||||
scale = 1.2f;
|
||||
break;
|
||||
case EncasementType.ShieldoftheOcean:
|
||||
tex += "OceanShieldBubble";
|
||||
currentParry = calPlayer.shieldOfTheOceanParry;
|
||||
defaultOpacity = 0.7f;
|
||||
scale = 1.3f;
|
||||
break;
|
||||
default: //should never be this option
|
||||
tex += "BlazingCoreCrystal";
|
||||
currentParry = 0;
|
||||
|
||||
|
Before Width: | Height: | Size: 1.1 KiB |
@@ -21,7 +21,7 @@ namespace CalamityMod.CalPlayer.DrawLayers
|
||||
private Asset<Texture2D> springTexture;
|
||||
private Asset<Texture2D> topTexture;
|
||||
|
||||
public override Position GetDefaultPosition() => new BeforeParent(PlayerDrawLayers.Leggings);
|
||||
public override Position GetDefaultPosition() => new AfterParent(PlayerDrawLayers.PortableStool);
|
||||
|
||||
public override bool GetDefaultVisibility(PlayerDrawSet drawInfo)
|
||||
{
|
||||
|
||||
@@ -33,36 +33,37 @@ namespace CalamityMod
|
||||
// Calamity Boss Flag conditions
|
||||
//
|
||||
|
||||
public static readonly Condition DownedDesertScourge = Create("Drops.DownedDS", () => DownedBossSystem.downedDesertScourge);
|
||||
public static readonly Condition DownedCrabulon = Create("Drops.DownedCrabulon", () => DownedBossSystem.downedCrabulon);
|
||||
public static readonly Condition DownedHiveMind = Create("Drops.DownedHM", () => DownedBossSystem.downedHiveMind);
|
||||
public static readonly Condition DownedPerforator = Create("Drops.DownedPerfs", () => DownedBossSystem.downedPerforator);
|
||||
public static readonly Condition DownedSlimeGod = Create("Drops.DownedSG", () => DownedBossSystem.downedSlimeGod);
|
||||
public static readonly Condition DownedCryogen = Create("Drops.DownedCryo", () => DownedBossSystem.downedCryogen);
|
||||
public static readonly Condition DownedAquaticScourge = Create("Drops.DownedAS", () => DownedBossSystem.downedAquaticScourge);
|
||||
public static readonly Condition DownedBrimstoneElemental = Create("Drops.DownedBrim", () => DownedBossSystem.downedBrimstoneElemental);
|
||||
public static readonly Condition DownedCalamitasClone = Create("Drops.DownedCal", () => DownedBossSystem.downedCalamitasClone);
|
||||
public static readonly Condition DownedLeviathan = Create("Drops.DownedLevi", () => DownedBossSystem.downedLeviathan);
|
||||
public static readonly Condition DownedAstrumAureus = Create("Drops.DownedAureus", () => DownedBossSystem.downedAstrumAureus);
|
||||
public static readonly Condition DownedPlaguebringer = Create("Drops.DownedPBG", () => DownedBossSystem.downedPlaguebringer);
|
||||
public static readonly Condition DownedRavager = Create("Drops.DownedRav", () => DownedBossSystem.downedRavager);
|
||||
public static readonly Condition DownedAstrumDeus = Create("Drops.DownedAD", () => DownedBossSystem.downedAstrumDeus);
|
||||
public static readonly Condition DownedGuardians = Create("Drops.DownedGuard", () => DownedBossSystem.downedGuardians);
|
||||
public static readonly Condition DownedBumblebird = Create("Drops.DownedBirb", () => DownedBossSystem.downedDragonfolly);
|
||||
public static readonly Condition DownedProvidence = Create("Drops.DownedProv", () => DownedBossSystem.downedProvidence);
|
||||
public static readonly Condition DownedSignus = Create("Drops.DownedSig", () => DownedBossSystem.downedSignus);
|
||||
public static readonly Condition DownedStormWeaver = Create("Drops.DownedSW", () => DownedBossSystem.downedStormWeaver);
|
||||
public static readonly Condition DownedCeaselessVoid = Create("Drops.DownedCV", () => DownedBossSystem.downedCeaselessVoid);
|
||||
public static readonly Condition DownedPolterghast = Create("Drops.DownedPolter", () => DownedBossSystem.downedPolterghast);
|
||||
public static readonly Condition DownedOldDuke = Create("Drops.DownedOD", () => DownedBossSystem.downedBoomerDuke);
|
||||
public static readonly Condition DownedDevourerOfGods = Create("Drops.DownedDoG", () => DownedBossSystem.downedDoG);
|
||||
public static readonly Condition DownedYharon = Create("Drops.DownedYharon", () => DownedBossSystem.downedYharon);
|
||||
public static readonly Condition DownedExoMechs = Create("Drops.DownedExos", () => DownedBossSystem.downedExoMechs);
|
||||
public static readonly Condition DownedSupremeCalamitas = Create("Drops.DownedSCal", () => DownedBossSystem.downedCalamitas);
|
||||
public static readonly Condition DownedPrimordialWyrm = Create("Drops.DownedAEW", () => DownedBossSystem.downedPrimordialWyrm);
|
||||
public static readonly Condition DownedClam = Create("Drops.DownedClam", () => DownedBossSystem.downedCLAM);
|
||||
public static readonly Condition DownedBuffedClam = Create("Drops.DownedClamHM", () => DownedBossSystem.downedCLAMHardMode);
|
||||
public static readonly Condition DownedGreatSandShark = Create("Drops.DownedGSS", () => DownedBossSystem.downedGSS);
|
||||
public static readonly Condition DownedDesertScourge = Create("Drops.DownedDS", () => DownedBossSystem.downedDesertScourge);
|
||||
public static readonly Condition DownedCrabulon = Create("Drops.DownedCrabulon", () => DownedBossSystem.downedCrabulon);
|
||||
public static readonly Condition DownedHiveMind = Create("Drops.DownedHM", () => DownedBossSystem.downedHiveMind);
|
||||
public static readonly Condition DownedPerforator = Create("Drops.DownedPerfs", () => DownedBossSystem.downedPerforator);
|
||||
public static readonly Condition DownedSlimeGod = Create("Drops.DownedSG", () => DownedBossSystem.downedSlimeGod);
|
||||
public static readonly Condition DownedCryogen = Create("Drops.DownedCryo", () => DownedBossSystem.downedCryogen);
|
||||
public static readonly Condition DownedAquaticScourge = Create("Drops.DownedAS", () => DownedBossSystem.downedAquaticScourge);
|
||||
public static readonly Condition DownedBrimstoneElemental = Create("Drops.DownedBrim", () => DownedBossSystem.downedBrimstoneElemental);
|
||||
public static readonly Condition DownedCalamitasClone = Create("Drops.DownedCal", () => DownedBossSystem.downedCalamitasClone);
|
||||
public static readonly Condition DownedLeviathan = Create("Drops.DownedLevi", () => DownedBossSystem.downedLeviathan);
|
||||
public static readonly Condition DownedAstrumAureus = Create("Drops.DownedAureus", () => DownedBossSystem.downedAstrumAureus);
|
||||
public static readonly Condition DownedPlaguebringer = Create("Drops.DownedPBG", () => DownedBossSystem.downedPlaguebringer);
|
||||
public static readonly Condition DownedRavager = Create("Drops.DownedRav", () => DownedBossSystem.downedRavager);
|
||||
public static readonly Condition DownedAstrumDeus = Create("Drops.DownedAD", () => DownedBossSystem.downedAstrumDeus);
|
||||
public static readonly Condition DownedGuardians = Create("Drops.DownedGuard", () => DownedBossSystem.downedGuardians);
|
||||
public static readonly Condition DownedBumblebird = Create("Drops.DownedBirb", () => DownedBossSystem.downedDragonfolly);
|
||||
public static readonly Condition DownedProvidence = Create("Drops.DownedProv", () => DownedBossSystem.downedProvidence);
|
||||
public static readonly Condition DownedSignus = Create("Drops.DownedSig", () => DownedBossSystem.downedSignus);
|
||||
public static readonly Condition DownedStormWeaver = Create("Drops.DownedSW", () => DownedBossSystem.downedStormWeaver);
|
||||
public static readonly Condition DownedCeaselessVoid = Create("Drops.DownedCV", () => DownedBossSystem.downedCeaselessVoid);
|
||||
public static readonly Condition DownedPolterghast = Create("Drops.DownedPolter", () => DownedBossSystem.downedPolterghast);
|
||||
public static readonly Condition DownedOldDuke = Create("Drops.DownedOD", () => DownedBossSystem.downedBoomerDuke);
|
||||
public static readonly Condition DownedDevourerOfGods = Create("Drops.DownedDoG", () => DownedBossSystem.downedDoG);
|
||||
public static readonly Condition DownedYharon = Create("Drops.DownedYharon", () => DownedBossSystem.downedYharon);
|
||||
public static readonly Condition DownedExoMechs = Create("Drops.DownedExos", () => DownedBossSystem.downedExoMechs);
|
||||
public static readonly Condition DownedSupremeCalamitas = Create("Drops.DownedSCal", () => DownedBossSystem.downedCalamitas);
|
||||
public static readonly Condition DownedPrimordialWyrm = Create("Drops.DownedAEW", () => DownedBossSystem.downedPrimordialWyrm);
|
||||
public static readonly Condition DownedHorribleHog = Create("Drops.DownedHorribleHog", () => DownedBossSystem.downedHorribleHog);
|
||||
public static readonly Condition DownedClam = Create("Drops.DownedClam", () => DownedBossSystem.downedCLAM);
|
||||
public static readonly Condition DownedBuffedClam = Create("Drops.DownedClamHM", () => DownedBossSystem.downedCLAMHardMode);
|
||||
public static readonly Condition DownedGreatSandShark = Create("Drops.DownedGSS", () => DownedBossSystem.downedGSS);
|
||||
|
||||
// Mixed
|
||||
public static readonly Condition DownedHiveMindOrPerforator = Create("Drops.DownedHMOrPerfs",() => DownedBossSystem.downedHiveMind || DownedBossSystem.downedPerforator);
|
||||
|
||||
@@ -48,12 +48,6 @@ namespace CalamityMod
|
||||
Main.QueueMainThreadAction(() => Main.OnPreDraw += PrepareRenderTargets);
|
||||
}
|
||||
}
|
||||
|
||||
public override void PostSetupContent()
|
||||
{
|
||||
// Force open certain ModMenus for various reasons and the added flair of "Hey! Something big has happened! Check it out!"
|
||||
CalamityMainMenu_Sunken.ForceMenuStyle();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Unload
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using CalamityMod.NPCs.DevourerofGods;
|
||||
using CalamityMod.Rarities;
|
||||
using CalamityMod.Utilities.Daybreak;
|
||||
using CalamityMod.Utilities.Daybreak.Buffers;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.UI.Chat;
|
||||
|
||||
namespace CalamityMod.ChatTags
|
||||
{
|
||||
public sealed class SmallTextHandler : AbstractTagHandler<SmallTextHandler>
|
||||
{
|
||||
protected override string[] TagNames { get; } = ["scale"];
|
||||
public override TextSnippet Parse(string text, Color baseColor = new(), string options = null)
|
||||
{
|
||||
if (float.TryParse(options, out float result))
|
||||
return new SmallTextSnippet(text, baseColor,result);
|
||||
|
||||
return new SmallTextSnippet(text, baseColor);
|
||||
}
|
||||
}
|
||||
public sealed class SmallTextSnippet(string text) : TextSnippet
|
||||
{
|
||||
public SmallTextSnippet( string text, Color color, float scale = 0.5f) : this(text)
|
||||
{
|
||||
textColor = color;
|
||||
Scale = scale;
|
||||
}
|
||||
|
||||
Color textColor = Color.White;
|
||||
public override bool UniqueDraw(bool justCheckingString, out Vector2 size, SpriteBatch spriteBatch, Vector2 position = new Vector2(), Color color = new Color(), float scale = 1)
|
||||
{
|
||||
color = textColor;
|
||||
|
||||
size = new Vector2(GetStringLength(FontAssets.MouseText.Value), FontAssets.MouseText.Value.MeasureString(" ").Y * Scale);
|
||||
|
||||
if (!justCheckingString && (color.R != 0 || color.G != 0 || color.B != 0) && Color != Color.Transparent)
|
||||
{
|
||||
ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, FontAssets.MouseText.Value, text, position, color, 0, Vector2.Zero, new Vector2(scale));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public override float GetStringLength(DynamicSpriteFont font)
|
||||
{
|
||||
float size = font.MeasureString(text).X;
|
||||
return size * Scale;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
using System;
|
||||
using CalamityMod.Items.Armor.Victide;
|
||||
using CalamityMod.UI;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.Graphics.Shaders;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using static Terraria.ModLoader.ModContent;
|
||||
|
||||
namespace CalamityMod.Cooldowns
|
||||
{
|
||||
public class BubblyBurrow : CooldownHandler
|
||||
{
|
||||
public bool PowerActive => instance.timeLeft > VictideHeadBurrow.BurrowCooldown;
|
||||
public float PowerPercent => (instance.timeLeft - VictideHeadBurrow.BurrowCooldown) / (float)VictideHeadBurrow.BurrowDuration;
|
||||
|
||||
public static new string ID => "BubblyBurrow";
|
||||
public override bool ShouldDisplay => true;
|
||||
public override LocalizedText DisplayName => CalamityUtils.GetText("UI.Cooldowns.BubblyBurrow" + (PowerActive ? "Active" : "Cooldown"));
|
||||
public override string Texture => PowerActive ? "CalamityMod/Cooldowns/BubblyBurrow" : "CalamityMod/Cooldowns/BubblyBurrowCooldown";
|
||||
public override string OutlineTexture => "CalamityMod/Cooldowns/BubblyBurrowOutline";
|
||||
public override string OverlayTexture => "CalamityMod/Cooldowns/BubblyBurrowOverlay";
|
||||
public override Color OutlineColor => new Color(158, 158, 255);
|
||||
public override Color CooldownStartColor => PowerActive ? Color.Lerp(new Color(255, 170, 204), new Color(72, 125, 204), PowerPercent) : new Color(72, 125, 204);
|
||||
public override Color CooldownEndColor => PowerActive ? Color.Lerp(new Color(255, 170, 204), new Color(97, 255, 255), PowerPercent) : new Color(97, 255, 255);
|
||||
public override SoundStyle? EndSound => SoundID.Item85;
|
||||
|
||||
public override void OnCompleted()
|
||||
{
|
||||
Vector2 playerVelocity = instance.player.velocity / 8f;
|
||||
if (!Main.dedServ)
|
||||
{
|
||||
for (int i = 0; i < 16; i++)
|
||||
{
|
||||
Vector2 bubblePos = instance.player.MountedCenter + Main.rand.NextVector2Circular(50f, 50f);
|
||||
Vector2 bubbleSpeed = Main.rand.NextVector2Circular(1f, 1f) + playerVelocity;
|
||||
Gore bubble = Gore.NewGoreDirect(instance.player.GetSource_Misc("1"), bubblePos, bubbleSpeed, 411, Main.rand.NextFloat(0.8f, 1.6f));
|
||||
bubble.timeLeft = 24 + Main.rand.Next(13);
|
||||
bubble.type = 411;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Charge down at first, and then charge back up
|
||||
private float AdjustedCompletion => CooldownRackUI.DebugFullDisplay ? CooldownRackUI.DebugForceCompletion : PowerActive ? PowerPercent : 1 - (instance.timeLeft / (float)VictideHeadBurrow.BurrowCooldown);
|
||||
|
||||
public override void ApplyBarShaders(float opacity)
|
||||
{
|
||||
//Use the adjusted completion
|
||||
GameShaders.Misc["CalamityMod:CircularBarShader"].UseOpacity(opacity);
|
||||
GameShaders.Misc["CalamityMod:CircularBarShader"].UseSaturation(AdjustedCompletion);
|
||||
GameShaders.Misc["CalamityMod:CircularBarShader"].UseColor(CooldownStartColor);
|
||||
GameShaders.Misc["CalamityMod:CircularBarShader"].UseSecondaryColor(CooldownEndColor);
|
||||
GameShaders.Misc["CalamityMod:CircularBarShader"].Apply();
|
||||
}
|
||||
|
||||
public override void DrawCompact(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale)
|
||||
{
|
||||
Texture2D sprite = Request<Texture2D>(Texture).Value;
|
||||
Texture2D outline = Request<Texture2D>(OutlineTexture).Value;
|
||||
Texture2D overlay = Request<Texture2D>(OverlayTexture).Value;
|
||||
|
||||
//Draw the outline
|
||||
spriteBatch.Draw(outline, position, null, OutlineColor * opacity, 0, outline.Size() * 0.5f, scale, SpriteEffects.None, 0f);
|
||||
|
||||
//Draw the icon
|
||||
spriteBatch.Draw(sprite, position, null, Color.White * opacity, 0, sprite.Size() * 0.5f, scale, SpriteEffects.None, 0f);
|
||||
|
||||
//Draw the small overlay
|
||||
int lostHeight = (int)Math.Ceiling(overlay.Height * AdjustedCompletion);
|
||||
Rectangle crop = new Rectangle(0, lostHeight, overlay.Width, overlay.Height - lostHeight);
|
||||
spriteBatch.Draw(overlay, position + Vector2.UnitY * lostHeight * scale, crop, OutlineColor * opacity * 0.9f, 0, sprite.Size() * 0.5f, scale, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 375 B |
|
Before Width: | Height: | Size: 393 B |
|
Before Width: | Height: | Size: 176 B |
|
Before Width: | Height: | Size: 147 B |
@@ -25,6 +25,6 @@ namespace CalamityMod.Cooldowns
|
||||
public override Color CooldownStartColor => Color.Brown;
|
||||
public override Color CooldownEndColor => Color.Khaki;
|
||||
|
||||
public override SoundStyle? EndSound => new("CalamityMod/Sounds/Item/AscendantOff");
|
||||
public override SoundStyle? EndSound => new("CalamityMod/Sounds/Item/StooldownResolve");
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,16 @@ namespace CalamityMod.CustomRecipes
|
||||
public static bool HasFoundHellSchematic = false;
|
||||
public static bool HasFoundIceSchematic = false;
|
||||
|
||||
public static bool HasFoundLuxorsGift = false;
|
||||
public static bool HasFoundFungalSymbiote = false;
|
||||
public static bool HasFoundTrinketOfChi = false;
|
||||
public static bool HasFoundFrozenCube = false;
|
||||
public static bool HasFoundGladiatorsLocket = false;
|
||||
public static bool HasFoundUnstableGraniteCore = false;
|
||||
public static bool HasFoundCrimsonEffigy = false;
|
||||
public static bool HasFoundCorruptionEffigy = false;
|
||||
|
||||
|
||||
public static void Save(List<string> boolTagContainer)
|
||||
{
|
||||
boolTagContainer.AddWithCondition("HasUnlockedT1ArsenalRecipes", HasUnlockedT1ArsenalRecipes);
|
||||
@@ -31,6 +41,15 @@ namespace CalamityMod.CustomRecipes
|
||||
boolTagContainer.AddWithCondition("HasFoundJungleSchematic", HasFoundJungleSchematic);
|
||||
boolTagContainer.AddWithCondition("HasFoundHellSchematic", HasFoundHellSchematic);
|
||||
boolTagContainer.AddWithCondition("HasFoundIceSchematic", HasFoundIceSchematic);
|
||||
|
||||
boolTagContainer.AddWithCondition("HasFoundLuxorsGift", HasFoundLuxorsGift);
|
||||
boolTagContainer.AddWithCondition("HasFoundFungalSymbiote", HasFoundFungalSymbiote);
|
||||
boolTagContainer.AddWithCondition("HasFoundTrinketOfChi", HasFoundTrinketOfChi);
|
||||
boolTagContainer.AddWithCondition("HasFoundFrozenCube", HasFoundFrozenCube);
|
||||
boolTagContainer.AddWithCondition("HasFoundGladiatorsLocket", HasFoundGladiatorsLocket);
|
||||
boolTagContainer.AddWithCondition("HasFoundUnstableGraniteCore", HasFoundUnstableGraniteCore);
|
||||
boolTagContainer.AddWithCondition("HasFoundCrimsonEffigy", HasFoundCrimsonEffigy);
|
||||
boolTagContainer.AddWithCondition("HasFoundCorruptionEffigy", HasFoundCorruptionEffigy);
|
||||
}
|
||||
|
||||
public static void Load(IList<string> boolTagContainer)
|
||||
@@ -46,6 +65,16 @@ namespace CalamityMod.CustomRecipes
|
||||
HasFoundJungleSchematic = boolTagContainer.Contains("HasFoundJungleSchematic");
|
||||
HasFoundHellSchematic = boolTagContainer.Contains("HasFoundHellSchematic");
|
||||
HasFoundIceSchematic = boolTagContainer.Contains("HasFoundIceSchematic");
|
||||
|
||||
HasFoundLuxorsGift = boolTagContainer.Contains("HasFoundLuxorsGift");
|
||||
HasFoundFungalSymbiote = boolTagContainer.Contains("HasFoundFungalSymbiote");
|
||||
HasFoundTrinketOfChi = boolTagContainer.Contains("HasFoundTrinketOfChi");
|
||||
HasFoundFrozenCube = boolTagContainer.Contains("HasFoundFrozenCube");
|
||||
HasFoundGladiatorsLocket = boolTagContainer.Contains("HasFoundGladiatorsLocket");
|
||||
HasFoundUnstableGraniteCore = boolTagContainer.Contains("HasFoundUnstableGraniteCore");
|
||||
HasFoundCrimsonEffigy = boolTagContainer.Contains("HasFoundCrimsonEffigy");
|
||||
HasFoundCorruptionEffigy = boolTagContainer.Contains("HasFoundCorruptionEffigy");
|
||||
|
||||
}
|
||||
|
||||
public static void SendData(BinaryWriter writer)
|
||||
@@ -63,9 +92,19 @@ namespace CalamityMod.CustomRecipes
|
||||
BitsByte flags2 = new BitsByte();
|
||||
flags2[0] = HasFoundHellSchematic;
|
||||
flags2[1] = HasFoundIceSchematic;
|
||||
flags2[2] = HasFoundLuxorsGift;
|
||||
flags2[3] = HasFoundFungalSymbiote;
|
||||
flags2[4] = HasFoundTrinketOfChi;
|
||||
flags2[5] = HasFoundGladiatorsLocket;
|
||||
flags2[6] = HasFoundUnstableGraniteCore;
|
||||
flags2[7] = HasFoundCrimsonEffigy;
|
||||
|
||||
BitsByte flags3 = new BitsByte();
|
||||
flags3[0] = HasFoundCorruptionEffigy;
|
||||
|
||||
writer.Write(flags);
|
||||
writer.Write(flags2);
|
||||
writer.Write(flags3);
|
||||
}
|
||||
|
||||
public static void ReceiveData(BinaryReader reader)
|
||||
@@ -83,6 +122,16 @@ namespace CalamityMod.CustomRecipes
|
||||
BitsByte flags2 = reader.ReadByte();
|
||||
HasFoundHellSchematic = flags2[0];
|
||||
HasFoundIceSchematic = flags2[1];
|
||||
HasFoundLuxorsGift = flags2[2];
|
||||
HasFoundFungalSymbiote = flags2[3];
|
||||
HasFoundTrinketOfChi = flags2[4];
|
||||
HasFoundGladiatorsLocket = flags2[5];
|
||||
HasFoundUnstableGraniteCore = flags2[6];
|
||||
HasFoundCrimsonEffigy = flags2[7];
|
||||
|
||||
BitsByte flags3 = reader.ReadByte();
|
||||
HasFoundCorruptionEffigy = flags3[0];
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Systems.Collections;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -9,88 +8,6 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.DataStructures
|
||||
{
|
||||
[ReinitializeDuringResizeArrays]
|
||||
public static class BuffDatasets
|
||||
{
|
||||
private static DebuffData Alch(int level) => new DebuffData() { AlcoholLevel = level };
|
||||
public static DebuffData[] DebuffDataset = BuffID.Sets.Factory.CreateNamedSet("DebuffData")
|
||||
.Description("Stores DebuffData for a particular debuff")
|
||||
.RegisterCustomSet<DebuffData>(null,
|
||||
BuffID.OnFire, DebuffData.OnFire,
|
||||
BuffID.OnFire3, DebuffData.Hellfire,
|
||||
BuffID.CursedInferno, DebuffData.CursedInferno,
|
||||
BuffID.ShadowFlame, DebuffData.Shadowflame,
|
||||
BuffID.Daybreak, DebuffData.Daybroken,
|
||||
BuffID.Burning, DebuffData.Burning,
|
||||
BuffID.Frostburn, DebuffData.Frostburn,
|
||||
BuffID.Frostburn2, DebuffData.Frostbite,
|
||||
BuffID.Poisoned, DebuffData.Poisoned,
|
||||
BuffID.Venom, DebuffData.AcidVenom,
|
||||
BuffID.Electrified, DebuffData.Electrified,
|
||||
BuffID.Oiled, DebuffData.Oiled,
|
||||
|
||||
BuffID.Tipsy, Alch(1),
|
||||
ModContent.BuffType<BloodyMaryBuff>(), Alch(1),
|
||||
ModContent.BuffType<CaribbeanRumBuff>(), Alch(1),
|
||||
ModContent.BuffType<CinnamonRollBuff>(), Alch(1),
|
||||
ModContent.BuffType<EvergreenGinBuff>(), Alch(1),
|
||||
ModContent.BuffType<FireballBuff>(), Alch(1),
|
||||
ModContent.BuffType<GrapeBeerBuff>(), Alch(1),
|
||||
ModContent.BuffType<ManhattanBuff>(), Alch(1),
|
||||
ModContent.BuffType<MargaritaBuff>(), Alch(1),
|
||||
ModContent.BuffType<MoonshineBuff>(), Alch(1),
|
||||
ModContent.BuffType<MoscowMuleBuff>(), Alch(1),
|
||||
ModContent.BuffType<OldFashionedBuff>(), Alch(1),
|
||||
ModContent.BuffType<PurpleHazeBuff>(), Alch(1),
|
||||
ModContent.BuffType<RedWineBuff>(), Alch(1),
|
||||
ModContent.BuffType<RumBuff>(), Alch(1),
|
||||
ModContent.BuffType<ScrewdriverBuff>(), Alch(1),
|
||||
ModContent.BuffType<StarBeamRyeBuff>(), Alch(1),
|
||||
ModContent.BuffType<TequilaBuff>(), Alch(1),
|
||||
ModContent.BuffType<TequilaSunriseBuff>(), Alch(1),
|
||||
ModContent.BuffType<VodkaBuff>(), Alch(1),
|
||||
ModContent.BuffType<WhiskeyBuff>(), Alch(1),
|
||||
ModContent.BuffType<WhiteWineBuff>(), Alch(1),
|
||||
|
||||
ModContent.BuffType<EverclearBuff>(), Alch(2),
|
||||
ModContent.BuffType<BaconOilBuff>(), Alch(3)
|
||||
);
|
||||
public static int GetBuffIDFromAlcoholType(AlcoholType type)
|
||||
{
|
||||
return type switch
|
||||
{
|
||||
AlcoholType.BaconOil => ModContent.BuffType<BaconOilBuff>(),
|
||||
AlcoholType.BloodyMary => ModContent.BuffType<BloodyMaryBuff>(),
|
||||
AlcoholType.CaribbeanRum => ModContent.BuffType<CaribbeanRumBuff>(),
|
||||
AlcoholType.CinnamonRoll => ModContent.BuffType<CinnamonRollBuff>(),
|
||||
AlcoholType.Everclear => ModContent.BuffType<EverclearBuff>(),
|
||||
AlcoholType.EvergreenGin => ModContent.BuffType<EvergreenGinBuff>(),
|
||||
AlcoholType.Fireball => ModContent.BuffType<FireballBuff>(),
|
||||
AlcoholType.GrapeBeer => ModContent.BuffType<GrapeBeerBuff>(),
|
||||
AlcoholType.Manhattan => ModContent.BuffType<ManhattanBuff>(),
|
||||
AlcoholType.Margarita => ModContent.BuffType<MargaritaBuff>(),
|
||||
AlcoholType.Moonshine => ModContent.BuffType<MoonshineBuff>(),
|
||||
AlcoholType.MoscowMule => ModContent.BuffType<MoscowMuleBuff>(),
|
||||
AlcoholType.OldFashioned => ModContent.BuffType<OldFashionedBuff>(),
|
||||
AlcoholType.PurpleHaze => ModContent.BuffType<PurpleHazeBuff>(),
|
||||
AlcoholType.RedWine => ModContent.BuffType<RedWineBuff>(),
|
||||
AlcoholType.Rum => ModContent.BuffType<RumBuff>(),
|
||||
AlcoholType.Screwdriver => ModContent.BuffType<ScrewdriverBuff>(),
|
||||
AlcoholType.StarBeamRye => ModContent.BuffType<StarBeamRyeBuff>(),
|
||||
AlcoholType.Tequila => ModContent.BuffType<TequilaBuff>(),
|
||||
AlcoholType.TequilaSunrise => ModContent.BuffType<TequilaSunriseBuff>(),
|
||||
AlcoholType.Vodka => ModContent.BuffType<VodkaBuff>(),
|
||||
AlcoholType.Whiskey => ModContent.BuffType<WhiskeyBuff>(),
|
||||
AlcoholType.WhiteWine => ModContent.BuffType<WhiteWineBuff>(),
|
||||
|
||||
// Vanilla treats both Ale and Sake as the "Tipsy" buff
|
||||
AlcoholType.Ale => BuffID.Tipsy,
|
||||
AlcoholType.Sake => BuffID.Tipsy,
|
||||
|
||||
_ => -1
|
||||
};
|
||||
}
|
||||
}
|
||||
public class DebuffData
|
||||
{
|
||||
/// <summary>
|
||||
@@ -239,8 +156,8 @@ namespace CalamityMod.DataStructures
|
||||
public static StatModifier ApplyScalingToStatModifer(StatModifier Modifer, float scaling)
|
||||
{
|
||||
StatModifier output = new();
|
||||
output += (Modifer.Additive-1) * scaling;
|
||||
output *= 1 + (Modifer.Multiplicative-1) * scaling;
|
||||
output += (Modifer.Additive - 1) * scaling;
|
||||
output *= 1 + (Modifer.Multiplicative - 1) * scaling;
|
||||
output.Base = Modifer.Base * scaling;
|
||||
output.Flat = Modifer.Flat * scaling;
|
||||
return output;
|
||||
@@ -254,9 +171,9 @@ namespace CalamityMod.DataStructures
|
||||
public static StatModifier ForceModifierPositiveWithScaling(StatModifier Modifer, float scaling)
|
||||
{
|
||||
StatModifier output = new();
|
||||
output += MathHelper.Max((Modifer.Additive - 1) * scaling,0);
|
||||
output *= MathHelper.Max(1 + (Modifer.Multiplicative - 1) * scaling,1);
|
||||
output.Base = MathHelper.Max(Modifer.Base * scaling,0);
|
||||
output += MathHelper.Max((Modifer.Additive - 1) * scaling, 0);
|
||||
output *= MathHelper.Max(1 + (Modifer.Multiplicative - 1) * scaling, 1);
|
||||
output.Base = MathHelper.Max(Modifer.Base * scaling, 0);
|
||||
output.Flat = MathHelper.Max(Modifer.Flat * scaling, 0);
|
||||
return output;
|
||||
}
|
||||
@@ -267,7 +184,7 @@ namespace CalamityMod.DataStructures
|
||||
/// </summary>
|
||||
public void DefaultUpdateOnPlayer(Player player, int buffType, ref int buffIndex, ref int damage)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -292,13 +209,13 @@ namespace CalamityMod.DataStructures
|
||||
|
||||
//Ensure at least 25% effectiveness
|
||||
if (totalScaling.Multiplicative <= 0.25f)
|
||||
totalScaling.Multiplicative = 0.25f;
|
||||
totalScaling.Multiplicative = 0.25f;
|
||||
if (totalScaling.Additive < 0.25f)
|
||||
totalScaling.Additive = 0.25f;
|
||||
|
||||
totalDPS = totalScaling.ApplyTo(totalDPS);
|
||||
var totalDPSAdjusted = totalDPS-EnemyVanillaRegenToCancelOut;
|
||||
npc.Calamity().ApplyDPSDebuff((int)(totalDPSAdjusted), (int)Math.Max(totalDPS*MultiplierDamageTickSize,MinimumDamageTickSize), ref npc.lifeRegen, ref damage);
|
||||
var totalDPSAdjusted = totalDPS - EnemyVanillaRegenToCancelOut;
|
||||
npc.Calamity().ApplyDPSDebuff((int)(totalDPSAdjusted), (int)Math.Max(totalDPS * MultiplierDamageTickSize, MinimumDamageTickSize), ref npc.lifeRegen, ref damage);
|
||||
}
|
||||
/// <summary>
|
||||
/// DoT functionality that takes into account Electric debuff's 4x DPS when moving
|
||||
@@ -360,7 +277,7 @@ namespace CalamityMod.DataStructures
|
||||
// If there are no Daybreak impaled spears, Daybroken has 1x potency (it was applied some other way)
|
||||
int adjustedSpears = Math.Max(1, numImpaledSpears);
|
||||
int baseDaybreakDoTValue = (int)(npc.Calamity().ActiveHeatDebuffMultiplier.ApplyTo(Daybroken.EnemyLostRegen) + (Daybroken.EnemyLostRegen * (adjustedSpears - 1)));
|
||||
int totalDPSAdjusted = baseDaybreakDoTValue - Daybroken.EnemyVanillaRegenToCancelOut*numImpaledSpears;
|
||||
int totalDPSAdjusted = baseDaybreakDoTValue - Daybroken.EnemyVanillaRegenToCancelOut * numImpaledSpears;
|
||||
if (numImpaledSpears == 0)
|
||||
{
|
||||
totalDPSAdjusted -= Daybroken.EnemyVanillaRegenToCancelOut;
|
||||
@@ -373,10 +290,10 @@ namespace CalamityMod.DataStructures
|
||||
public static void OiledNPCMethod(NPC npc, int buffType, ref int buffIndex, ref int damage)
|
||||
{
|
||||
var cnpc = npc.Calamity();
|
||||
double totalDPS = ApplyScalingToStatModifer(cnpc.ActiveHeatDebuffMultiplier,Oiled.HeatDebuffScaling).ApplyTo(Oiled.EnemyLostRegen);
|
||||
double totalDPS = ApplyScalingToStatModifer(cnpc.ActiveHeatDebuffMultiplier, Oiled.HeatDebuffScaling).ApplyTo(Oiled.EnemyLostRegen);
|
||||
if (totalDPS <= 0)
|
||||
return;
|
||||
npc.Calamity().ApplyDPSDebuff((int)(totalDPS), damage+(int)Math.Max(totalDPS * Oiled.MultiplierDamageTickSize, Oiled.MinimumDamageTickSize), ref npc.lifeRegen, ref damage);
|
||||
npc.Calamity().ApplyDPSDebuff((int)(totalDPS), damage + (int)Math.Max(totalDPS * Oiled.MultiplierDamageTickSize, Oiled.MinimumDamageTickSize), ref npc.lifeRegen, ref damage);
|
||||
}
|
||||
/// <summary>
|
||||
/// Has Dryad's Bane scale with Calamity's town NPC buffs
|
||||
@@ -501,5 +418,38 @@ namespace CalamityMod.DataStructures
|
||||
NPCLifeRegenMethod = DryadsBaneNPCMethod
|
||||
};
|
||||
#endregion
|
||||
|
||||
#region Helpers
|
||||
public static int GetDebuffRegenValue(NPC npc, int type)
|
||||
{
|
||||
var debuffData = CalamityBuffSets.DebuffDataset[type];
|
||||
if (debuffData == null)
|
||||
return 0;
|
||||
|
||||
var oldRegen = npc.lifeRegen;
|
||||
var oldCount = npc.lifeRegenCount;
|
||||
int dmg = 1;
|
||||
npc.lifeRegenCount = 0;
|
||||
npc.lifeRegen = 0;
|
||||
|
||||
int index = npc.FindBuffIndex(type);
|
||||
|
||||
if (debuffData == Oiled)
|
||||
{
|
||||
bool hasVanillaOil = npc.onFrostBurn || npc.onFrostBurn2 || npc.onFire || npc.onFire2 || npc.onFire3 || npc.shadowFlame;
|
||||
if (hasVanillaOil)
|
||||
npc.lifeRegen -= Oiled.EnemyVanillaRegenToCancelOut;
|
||||
Oiled.NPCLifeRegenMethod(npc, BuffID.Oiled, ref index, ref dmg);
|
||||
}
|
||||
|
||||
debuffData.NPCLifeRegenMethod(npc, type, ref index, ref dmg);
|
||||
|
||||
int done = npc.lifeRegen;
|
||||
npc.lifeRegen = oldRegen;
|
||||
npc.lifeRegenCount = oldCount;
|
||||
return done;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
sampler noiseTexture : register(s1);
|
||||
sampler noiseTexture2 : register(s2);
|
||||
|
||||
float time;
|
||||
float glowPower;
|
||||
float overallColorStrength;
|
||||
float2 noiseScale;
|
||||
float2 edgeFadeoutThreshold;
|
||||
float3 innerColor;
|
||||
float3 outerColor;
|
||||
float3 overallColor;
|
||||
float3 tipColor;
|
||||
matrix uWorldViewProjection;
|
||||
|
||||
struct VertexShaderInput
|
||||
{
|
||||
float4 Position : POSITION0;
|
||||
float4 Color : COLOR0;
|
||||
float3 TextureCoordinates : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct VertexShaderOutput
|
||||
{
|
||||
float4 Position : SV_POSITION;
|
||||
float4 Color : COLOR0;
|
||||
float3 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;
|
||||
}
|
||||
|
||||
float InverseLerp(float from, float to, float x)
|
||||
{
|
||||
return saturate((x - from) / (to - from));
|
||||
}
|
||||
|
||||
float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
|
||||
{
|
||||
float4 color = input.Color;
|
||||
float2 coords = input.TextureCoordinates;
|
||||
|
||||
// Account for texture distortion artifacts.
|
||||
coords.y = (coords.y - 0.5) / input.TextureCoordinates.z + 0.5;
|
||||
|
||||
// Fade out at the horizontal and vertical ends of the streak.
|
||||
float horizonatalDistanceFromCenter = distance(0.5, coords.y);
|
||||
float opacity = smoothstep(0.5, 0.5 - edgeFadeoutThreshold, horizonatalDistanceFromCenter);
|
||||
|
||||
// Calculate the main nosie color and distortion.
|
||||
float4 noiseDistortion = tex2D(noiseTexture, coords * float2(4, 2) + float2(time * -0.72, time * 0.51));
|
||||
float4 noiseColor = tex2D(noiseTexture, coords * noiseScale + float2(time * -2.42 - noiseDistortion.r * 0.8, time * -1.33 + noiseDistortion.r * 0.8));
|
||||
|
||||
// Calculate how much a pixel should glow from the center outwards.
|
||||
float glow = pow(0.1 / horizonatalDistanceFromCenter, glowPower);
|
||||
|
||||
// Render as white near the tip of the flame jet, then ease into the inner and outer colors of the jet.
|
||||
float3 flameBodyColor = lerp(tipColor, lerp(outerColor, innerColor, opacity), InverseLerp(0, 0.092, coords.x));
|
||||
float3 finalFlameColor = lerp(flameBodyColor, overallColor, overallColorStrength);
|
||||
|
||||
float4 returnColor = (color * float4(finalFlameColor, 1) + noiseColor * glow) * opacity;
|
||||
return returnColor;
|
||||
}
|
||||
|
||||
technique Technique1
|
||||
{
|
||||
pass LaserPass
|
||||
{
|
||||
VertexShader = compile vs_3_0 VertexShaderFunction();
|
||||
PixelShader = compile ps_3_0 PixelShaderFunction();
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,16 @@
|
||||
sampler baseTexture : register(s0);
|
||||
sampler distortionTexture : register(s1);
|
||||
|
||||
float time;
|
||||
float noiseScale;
|
||||
float distortionStrength;
|
||||
float2 timeOffset;
|
||||
float2 noiseScaleStrength;
|
||||
|
||||
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR
|
||||
{
|
||||
float2 distortedCoords = coords * noiseScaleStrength.x + timeOffset;
|
||||
float distortion = tex2D(distortionTexture, distortedCoords).r * noiseScaleStrength.y;
|
||||
return tex2D(baseTexture, coords + distortion) * sampleColor.a;
|
||||
float2 distortedCoords = coords + float2(time * timeOffset.x, time * timeOffset.y);
|
||||
float distortion = tex2D(distortionTexture, distortedCoords * noiseScale).r;
|
||||
return tex2D(baseTexture, coords + distortion * distortionStrength);
|
||||
}
|
||||
|
||||
technique Technique1
|
||||
|
||||
@@ -254,6 +254,18 @@ namespace CalamityMod.Effects
|
||||
|
||||
// The distorted circular effect seen emanating from the distortion rift during DoG's fight.
|
||||
internal static Asset<Effect> DoGRiftAuraShader;
|
||||
|
||||
// The shader effect used for Voidragon's Abyssal Fire laser projectile.
|
||||
internal static Asset<Effect> AbyssalFireShader;
|
||||
|
||||
// A simple chromatic abberation effect shader with support for custom abberation colors.
|
||||
internal static Asset<Effect> ChromaticAbberationShader;
|
||||
|
||||
// Distorts a texture using a sine wave of specified amplitude and frequency either vertically or horizontally.
|
||||
internal static Asset<Effect> SineWaveDistortionShader;
|
||||
|
||||
// The swirling aura effect seen around Horrible Hog while its idling.
|
||||
internal static Asset<Effect> HorribleHogAuraShader;
|
||||
#endregion
|
||||
|
||||
#region Big E's Shaders
|
||||
@@ -513,6 +525,18 @@ namespace CalamityMod.Effects
|
||||
|
||||
DoGRiftAuraShader = LoadShader("DoGRiftAuraShader");
|
||||
RegisterMiscShader(DoGRiftAuraShader, "DoGRiftAuraPass", "DoGRiftAura");
|
||||
|
||||
AbyssalFireShader = LoadShader("AbyssalFireShader");
|
||||
RegisterMiscShader(AbyssalFireShader, "LaserPass", "AbyssalFire");
|
||||
|
||||
ChromaticAbberationShader = LoadShader("ChromaticAbberationShader");
|
||||
RegisterMiscShader(ChromaticAbberationShader, "ChormaAbberationPass", "ChromaticAbberation");
|
||||
|
||||
SineWaveDistortionShader = LoadShader("SineWaveDistortionShader");
|
||||
RegisterMiscShader(SineWaveDistortionShader, "SinePass", "SineWaveDistortion");
|
||||
|
||||
HorribleHogAuraShader = LoadShader("HorribleHogAuraShader");
|
||||
RegisterMiscShader(HorribleHogAuraShader, "ScaryAuraPass", "HorribleHogAura");
|
||||
#endregion
|
||||
|
||||
#region Loading Big E's Shaders
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
sampler baseTexture : register(s0);
|
||||
|
||||
bool useCustomColors;
|
||||
float abberationStrength;
|
||||
float2 impactPosition;
|
||||
float3 primaryAbberationColor;
|
||||
float3 secondaryAbberationColor;
|
||||
float3 tertiaryAbberationColor;
|
||||
|
||||
float3 ChromaticAbberation(sampler2D samplerTexture, float2 coords)
|
||||
{
|
||||
// Calculate the distortion level of each color.
|
||||
float separation = abberationStrength / distance(coords, impactPosition);
|
||||
float rColor = tex2D(samplerTexture, coords + float2(-1, -1) * separation).r;
|
||||
float gColor = tex2D(samplerTexture, coords + float2(1, -1) * separation).g;
|
||||
float bColor = tex2D(samplerTexture, coords + float2(0, 1) * separation).b;
|
||||
|
||||
// Return the three calculations as one singular color.
|
||||
float3 returnColor = float3(rColor, gColor, bColor);
|
||||
return returnColor;
|
||||
}
|
||||
|
||||
float3 ChromaticAbberation_CustomColors(sampler2D samplerTexture, float2 coords)
|
||||
{
|
||||
// Calculate the distortion level of each color.
|
||||
float separation = abberationStrength / distance(coords, impactPosition);
|
||||
float4 pColor = tex2D(samplerTexture, coords + float2(-1, -1) * separation) * float4(primaryAbberationColor, 1);
|
||||
float4 sColor = tex2D(samplerTexture, coords + float2(1, -1) * separation) * float4(primaryAbberationColor, 1);
|
||||
float4 tColor = tex2D(samplerTexture, coords + float2(0, 1) * separation) * float4(primaryAbberationColor, 1);
|
||||
|
||||
// Return the three calculations as one singular color.
|
||||
float3 returnColor = saturate(pColor + sColor + tColor);
|
||||
return returnColor;
|
||||
}
|
||||
|
||||
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
|
||||
{
|
||||
float3 color = useCustomColors ? ChromaticAbberation_CustomColors(baseTexture, coords) : ChromaticAbberation(baseTexture, coords);
|
||||
return sampleColor * float4(color, 1.0);
|
||||
}
|
||||
|
||||
technique Technique1
|
||||
{
|
||||
pass ChormaAbberationPass
|
||||
{
|
||||
PixelShader = compile ps_2_0 PixelShaderFunction();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
sampler vortexNoiseTexture : register(s0);
|
||||
sampler vortexNoiseTexture2 : register(s1);
|
||||
sampler distortionTexture : register(s2);
|
||||
|
||||
float time;
|
||||
float colorPaletteLimit;
|
||||
float spiralArms;
|
||||
float spiralAdditionalAngle;
|
||||
float minPixelFadeDistance;
|
||||
float maxPixelFadeDistance;
|
||||
|
||||
float2 pixelatonFactor;
|
||||
float2 spiralTimeOffset;
|
||||
float2 pixelationFactor;
|
||||
float3 vortexDarkColor;
|
||||
float3 vortexBrightColor;
|
||||
|
||||
float inverseLerp(float from, float to, float x)
|
||||
{
|
||||
return saturate((x - from) / (to - from));
|
||||
}
|
||||
|
||||
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
|
||||
{
|
||||
// Pixelate.
|
||||
coords = round(coords * pixelationFactor) / pixelationFactor;
|
||||
|
||||
float2 centeredCoords = coords - 0.5;
|
||||
float polarAngle = atan2(centeredCoords.y, centeredCoords.x) / 6.283;
|
||||
float distanceToCenter = length(centeredCoords);
|
||||
float2 polarCoords = float2(polarAngle, distanceToCenter);
|
||||
|
||||
// Define coordinates for creating the vortex effect.
|
||||
float vortexRadius = pow(distanceToCenter, 0.6);
|
||||
float vortexAngle = spiralArms * atan2(centeredCoords.y, centeredCoords.x) / 3.141 + spiralAdditionalAngle * vortexRadius;
|
||||
float2 vortexPolarCoords = float2(vortexAngle, vortexRadius) * 0.5 + float2(time * spiralTimeOffset.x, time * spiralTimeOffset.y);
|
||||
|
||||
// Add some distortion over it.
|
||||
float distortion1 = tex2D(distortionTexture, coords * 0.46 + float2(time * -0.02, time * 0.022)).r;
|
||||
float distortion2 = tex2D(distortionTexture, coords * 0.32 + float2(time * 0.018, time * -0.03)).r;
|
||||
float totalDistortion = (distortion1 * 0.5) + (distortion2 * 0.5);
|
||||
|
||||
float4 vortexNoiseColor1 = tex2D(vortexNoiseTexture, vortexPolarCoords + totalDistortion);
|
||||
float4 vortexNoiseColor2 = tex2D(vortexNoiseTexture2, polarCoords + float2(time * -0.02, time * -0.092) + totalDistortion * 0.64);
|
||||
float4 vortexNoiseColor = lerp(vortexNoiseColor1, vortexNoiseColor2, inverseLerp(0, maxPixelFadeDistance - 0.075, distanceToCenter));
|
||||
|
||||
// Apply coloration based on pixel brightness.
|
||||
float brightness = (vortexNoiseColor.r + vortexNoiseColor.g + vortexNoiseColor.b) / 3.0;
|
||||
vortexNoiseColor.rgb *= lerp(vortexDarkColor, vortexBrightColor, brightness);
|
||||
|
||||
// Quantization.
|
||||
vortexNoiseColor = round(vortexNoiseColor * colorPaletteLimit) / colorPaletteLimit;
|
||||
|
||||
// Fade out at the edge of the texture.
|
||||
float edgeFade = inverseLerp(0, minPixelFadeDistance - 0.016, distanceToCenter) * inverseLerp(maxPixelFadeDistance, minPixelFadeDistance, distanceToCenter);
|
||||
// float edgeOffset = tex2D(edgeFadeTexture, vortexPolarCoords + float2(time * spiralTimeOffset.x, time * spiralTimeOffset.y)).r * 0.13;
|
||||
// float edgeFade = smoothstep(0.5, opacityCutoffValue, polarCoords.y + edgeOffset);
|
||||
|
||||
return (vortexNoiseColor * edgeFade) * sampleColor.a;
|
||||
}
|
||||
|
||||
technique Technique1
|
||||
{
|
||||
pass ScaryAuraPass
|
||||
{
|
||||
PixelShader = compile ps_3_0 PixelShaderFunction();
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,7 @@
|
||||
float rotation; // The rotation of the sprite.
|
||||
float4 color;
|
||||
|
||||
|
||||
texture sampleTexture;
|
||||
sampler2D Texture1Sampler = sampler_state { texture = <sampleTexture>; magfilter = LINEAR; minfilter = LINEAR; mipfilter = LINEAR; AddressU = wrap; AddressV = wrap; };
|
||||
sampler baseTexture : register(s0);
|
||||
float rotation; // The rotation of the sprite.
|
||||
float2 spriteDimensions; // Dimensions of the sprite.
|
||||
float4 spriteRectangle; // For use with animated sprites.
|
||||
|
||||
float realCos(float value)
|
||||
{
|
||||
@@ -11,7 +9,7 @@ float realCos(float value)
|
||||
}
|
||||
|
||||
//This only works on square sprites.
|
||||
float4 main(float2 uv : TEXCOORD) : COLOR
|
||||
float4 main(float4 sampleColor : COLOR0, float2 uv : TEXCOORD0) : COLOR0
|
||||
{
|
||||
float2x2 rotate = float2x2(realCos(rotation), -sin(rotation), sin(rotation), realCos(rotation));
|
||||
float spriteDiagonal = 1 / (sqrt(2) / 2);
|
||||
@@ -19,14 +17,14 @@ float4 main(float2 uv : TEXCOORD) : COLOR
|
||||
|
||||
uv += float2(-0.5, -0.5); //remap the uv to (-0.5, -0.5) - (0.5, 0.5) for trig to work.
|
||||
uv = mul(uv, rotate);
|
||||
uv = mul(uv, downscale);
|
||||
//uv = mul(uv, downscale);
|
||||
uv += float2(0.5, 0.5); //remap the uv properly
|
||||
|
||||
//Crop (Attempting to sample a texture with coordinates that arent between 0 to 1 wraps it around
|
||||
if (uv.x < 0 || uv.x >= 1 || uv.y < 0 || uv.y >= 1)
|
||||
return float4(0, 0, 0, 0);
|
||||
|
||||
return tex2D(Texture1Sampler, uv) * color;
|
||||
return tex2D(baseTexture, uv) * sampleColor;
|
||||
}
|
||||
|
||||
technique Technique1
|
||||
|
||||