Merge branch '1.4.4' into ArsenalReworksTier1
No files matched your search
@@ -3,26 +3,52 @@ using Terraria.ModLoader;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using ReLogic.Content;
|
||||
using Terraria.ID;
|
||||
|
||||
namespace CalamityMod.Backgrounds
|
||||
{
|
||||
internal static class SunkenSeaBurrowsBG
|
||||
public class SunkenSeaBurrowsBG : ModSystem
|
||||
{
|
||||
public static void Load()
|
||||
public override void Load()
|
||||
{
|
||||
if (Main.dedServ)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
On_Main.DrawBackgroundBlackFill += DrawBurrowsBG;
|
||||
On_Main.DrawBackgroundBlackFill += On_Main_DrawBackgroundBlackFill;
|
||||
}
|
||||
|
||||
public static float Transparency;
|
||||
/// <summary>
|
||||
/// This code runs because there is a system in vanilla that causes backgrounds to not draw if lighting is too low.
|
||||
/// That would be fine, the problem arises because sloped tiles still block light the same way normal tiles do.
|
||||
/// Which means that the background will occasionally be blocked by slopes as though said slopes were full squares.
|
||||
/// This is a hacky method that sets the light level of every sloped tile *AT LEAST* high enough to render the background while in the Burrows.
|
||||
///
|
||||
/// ENNWAY's note:
|
||||
/// if this doesn't get fixed in 1.4.5 i am throwing really big rocks at unsuspecting re logic employees
|
||||
/// </summary>
|
||||
public override void PreUpdatePlayers()
|
||||
{
|
||||
if (!Main.dedServ && Main.LocalPlayer.InModBiome<BiomeManagers.SunkenSeaBurrowsBiome>())
|
||||
{
|
||||
for (int i = 0; i < Main.screenWidth / 16; i++)
|
||||
{
|
||||
for (int j = 0; j < Main.screenWidth / 16; j++)
|
||||
{
|
||||
Point pos = (Main.screenPosition / 16).ToPoint() + new Point(i, j);
|
||||
|
||||
public static float TransitionSpeed => 0.02f;
|
||||
if (Main.tile[pos.X, pos.Y].Slope != SlopeType.Solid)
|
||||
{
|
||||
Lighting.AddLight(pos.X, pos.Y, TorchID.White, 0.1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void DrawBurrowsBG(On_Main.orig_DrawBackgroundBlackFill orig, Main self)
|
||||
private void On_Main_DrawBackgroundBlackFill(On_Main.orig_DrawBackgroundBlackFill orig, Main self)
|
||||
{
|
||||
if (Main.gameMenu || Main.screenPosition.Y + Main.screenHeight < ((int)Main.worldSurface) * 16f)
|
||||
{
|
||||
@@ -33,6 +59,15 @@ namespace CalamityMod.Backgrounds
|
||||
|
||||
orig(self);
|
||||
|
||||
DrawBurrowsBG();
|
||||
}
|
||||
|
||||
public static float Transparency;
|
||||
|
||||
public static float TransitionSpeed => 0.02f;
|
||||
|
||||
private static void DrawBurrowsBG()
|
||||
{
|
||||
if (Main.LocalPlayer.InModBiome(ModContent.GetInstance<BiomeManagers.SunkenSeaBurrowsBiome>()))
|
||||
{
|
||||
Transparency += TransitionSpeed;
|
||||
@@ -75,54 +110,54 @@ namespace CalamityMod.Backgrounds
|
||||
switch (Layers)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
zero.Y += 800f;
|
||||
break;
|
||||
}
|
||||
{
|
||||
zero.Y += 800f;
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
zero.Y += 200f;
|
||||
break;
|
||||
}
|
||||
{
|
||||
zero.Y += 200f;
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
zero.Y += 450f;
|
||||
break;
|
||||
}
|
||||
{
|
||||
zero.Y += 450f;
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
zero.Y += 45f;
|
||||
break;
|
||||
}
|
||||
{
|
||||
zero.Y += 45f;
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
zero.Y += 45f;
|
||||
break;
|
||||
}
|
||||
{
|
||||
zero.Y += 45f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
vector2 *= Scale;
|
||||
|
||||
zero.Y -= num;
|
||||
float LoopWidth = Scale * rectangle.Width;
|
||||
//float LoopHeight = Scale * rectangle.Height;
|
||||
float LoopHeight = Scale * rectangle.Height;
|
||||
int LoopX = (int)((vector.X * vector3.X - vector2.X + zero.X - (Main.screenWidth >> 1)) / LoopWidth);
|
||||
//int LoopY = (int)((vector.Y * vector3.Y - vector2.Y + zero.Y - (Main.screenWidth >> 1)) / LoopWidth);
|
||||
int LoopY = (int)((vector.Y * vector3.Y - vector2.Y + zero.Y - (Main.screenWidth >> 1)) / LoopWidth);
|
||||
|
||||
//for (int i = LoopY - 2; i < LoopY + 4 + (int)(Main.screenWidth / LoopHeight); i++)
|
||||
//{
|
||||
for (int i = LoopY - 2; i < LoopY + 4 + (int)(Main.screenWidth / LoopHeight); i++)
|
||||
{
|
||||
for (int j = LoopX - 2; j < LoopX + 4 + (int)(Main.screenWidth / LoopWidth); j++)
|
||||
{
|
||||
Vector2 drawPosition = (new Vector2(j * Scale * (rectangle.Width / vector3.X), ((Main.LocalPlayer.Center.Y / 16f) - 90) * 16f) + vector2 - vector) * vector3 + vector - Main.screenPosition - vector2 + zero;
|
||||
|
||||
var frame = rectangle;
|
||||
var color = Color.MediumTurquoise * Transparency;
|
||||
var color = Color.White * Transparency;
|
||||
|
||||
Main.spriteBatch.Draw(BGTexture, drawPosition, frame, color, 0f, Vector2.Zero, Scale, SpriteEffects.None, 0f);
|
||||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CalamityMod.Items.Weapons.Ranged;
|
||||
using CalamityMod.NPCs.AstrumAureus;
|
||||
using CalamityMod.NPCs.CeaselessVoid;
|
||||
using CalamityMod.NPCs.Crabulon;
|
||||
@@ -8,7 +7,6 @@ using CalamityMod.NPCs.ExoMechs.Artemis;
|
||||
using CalamityMod.NPCs.OldDuke;
|
||||
using CalamityMod.NPCs.ProfanedGuardians;
|
||||
using CalamityMod.NPCs.Providence;
|
||||
using CalamityMod.NPCs.Ravager;
|
||||
using CalamityMod.NPCs.SupremeCalamitas;
|
||||
using CalamityMod.NPCs.Yharon;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
@@ -19,6 +17,8 @@ using CalamityMod.Projectiles.Rogue;
|
||||
using CalamityMod.Projectiles.Summon;
|
||||
using CalamityMod.Projectiles.Summon.MirrorofKalandraMinions;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -60,6 +60,9 @@ namespace CalamityMod.Balancing
|
||||
bool AotCThrowCombo(Projectile p) =>
|
||||
p.type == ProjectileType<ArkoftheCosmosSwungBlade>() && (p.ai[0] == 2 || p.ai[0] == 3);
|
||||
|
||||
bool HiveBeeFilter(Projectile p) =>
|
||||
p.type == ProjectileType<BasicPlagueBee>() && Main.player[p.owner].ActiveItem().type == ItemType<TheHive>();
|
||||
|
||||
UniversalBalancingChanges = new List<IBalancingRule[]>()
|
||||
{
|
||||
// Nerf Crystal bullet shards by 45%
|
||||
@@ -171,8 +174,8 @@ namespace CalamityMod.Balancing
|
||||
// 45% resist to Mounted Scanner.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DestroyerIDs, Do(new ProjectileResistBalancingRule(0.55f, ProjectileType<MountedScannerLaser>()))));
|
||||
|
||||
// 40% resist to Meowthrower.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DestroyerIDs, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType<MeowFire>()))));
|
||||
// 30% resist to Meowthrower.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DestroyerIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<MeowFire>()))));
|
||||
|
||||
// 25% resist to SHPC.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DestroyerIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<SHPExplosion>()))));
|
||||
@@ -188,7 +191,7 @@ namespace CalamityMod.Balancing
|
||||
|
||||
#region Duke Fishron
|
||||
// 20% vulnerability to The Hive's bees.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.DukeFishron, Do(new ProjectileResistBalancingRule(1.2f, ProjectileType<BasicPlagueBee>()))));
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.DukeFishron, Do(new ProjectileSpecificRequirementBalancingRule(1.2f, HiveBeeFilter))));
|
||||
|
||||
// 35% vulnerability to Resurrection Butterfly.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.DukeFishron, Do(new ProjectileResistBalancingRule(1.35f, ProjectileType<SakuraBullet>(), ProjectileType<PurpleButterfly>()))));
|
||||
@@ -313,8 +316,8 @@ namespace CalamityMod.Balancing
|
||||
// 50% resist to Dazzling Stabber Staff.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.StormWeaverIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<DazzlingStabber>()))));
|
||||
|
||||
// 50% resist to Elemental Axe.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.StormWeaverIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<ElementalAxeMinion>()))));
|
||||
// 50% resist to Legion of Celestia.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.StormWeaverIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<CelestialAxeMinion>()))));
|
||||
|
||||
// 50% resist to Pristine Fury's alt fire.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.StormWeaverIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<PristineSecondary>()))));
|
||||
@@ -338,8 +341,8 @@ namespace CalamityMod.Balancing
|
||||
// 50% resist to Eidolic Wail.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DevourerOfGodsIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<EidolicWailSoundwave>()))));
|
||||
|
||||
// 35% resist to Venusian Trident's explosions.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DevourerOfGodsIDs, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<VenusianBolt>(), ProjectileType<VenusianExplosion>()))));
|
||||
// 25% resist to Corinth Prime's Grenades.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DevourerOfGodsIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<CorinthPrimeAirburst>()))));
|
||||
|
||||
// 20% resist to Valediction's typhoons; will catch Nuclear Fury as well but that doesn't matter.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DevourerOfGodsIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<NuclearFuryProjectile>()))));
|
||||
@@ -354,9 +357,6 @@ namespace CalamityMod.Balancing
|
||||
#endregion
|
||||
|
||||
#region Exo Mechs: Ares
|
||||
// 50% resist to true melee.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(ResistTrueMelee(0.5f))));
|
||||
|
||||
// 30% resist to Dynamic Pursuer.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<DynamicPursuerProjectile>(), ProjectileType<DynamicPursuerLaser>(), ProjectileType<DynamicPursuerElectricity>()))));
|
||||
|
||||
@@ -501,11 +501,11 @@ namespace CalamityMod.Balancing
|
||||
#endregion
|
||||
|
||||
#region Supreme Calamitas: Soul Seekers
|
||||
// 85% resist to Chicken Cannon.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<SoulSeekerSupreme>(), new ProjectileResistBalancingRule(0.15f, ProjectileType<ChickenExplosion>())));
|
||||
// 80% resist to Chicken Cannon.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<SoulSeekerSupreme>(), new ProjectileResistBalancingRule(0.2f, ProjectileType<ChickenExplosion>())));
|
||||
|
||||
// 50% resist to Subsuming Vortex.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<SoulSeekerSupreme>(), new ProjectileResistBalancingRule(0.5f, ProjectileType<ExoVortex>(), ProjectileType<ExoVortex2>(), ProjectileType<EnormousConsumingVortex>())));
|
||||
// 40% resist to Subsuming Vortex.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<SoulSeekerSupreme>(), new ProjectileResistBalancingRule(0.6f, ProjectileType<ExoVortex>(), ProjectileType<ExoVortex2>(), ProjectileType<EnormousConsumingVortex>())));
|
||||
|
||||
// 40% resist to Supernova.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<SoulSeekerSupreme>(), new ProjectileResistBalancingRule(0.6f, ProjectileType<SupernovaBoom>(), ProjectileType<SupernovaStealthBoom>())));
|
||||
@@ -515,15 +515,6 @@ namespace CalamityMod.Balancing
|
||||
|
||||
// 25% resist to Yharim's Crystal.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<SoulSeekerSupreme>(), new ProjectileResistBalancingRule(0.75f, ProjectileType<YharimsCrystalBeam>())));
|
||||
|
||||
// 10% resist to Celestus.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<SoulSeekerSupreme>(), new ProjectileResistBalancingRule(0.9f, ProjectileType<CelestusProj>(), ProjectileType<CelestusMiniScythe>())));
|
||||
|
||||
// 10% resist to Executioner's Blade stealth strikes.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<SoulSeekerSupreme>(), new ProjectileResistBalancingRule(0.9f, ProjectileType<ExecutionersBladeStealthProj>())));
|
||||
|
||||
// 10% resist to Surge Driver's alt click comets.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<SoulSeekerSupreme>(), new ProjectileResistBalancingRule(0.9f, ProjectileType<PrismComet>())));
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
@@ -65,6 +65,10 @@ namespace CalamityMod.Buffs
|
||||
player.pickSpeed += 0.05f;
|
||||
player.GetAttackSpeed<MeleeDamageClass>() -= 0.1f;
|
||||
}
|
||||
else if (type == BuffID.Weak)
|
||||
{
|
||||
player.GetAttackSpeed<MeleeDamageClass>() += 0.051f;
|
||||
}
|
||||
else if (type == BuffID.Shine)
|
||||
{
|
||||
player.Calamity().shine = true;
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
public class Daybroken : ModBuff
|
||||
{
|
||||
public override LocalizedText DisplayName => Language.GetOrRegister("BuffName.Daybreak");
|
||||
public override LocalizedText Description => Language.GetOrRegister("BuffDescription.Daybreak");
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
player.Calamity().daybroken = true;
|
||||
}
|
||||
|
||||
internal static void DrawEffects(PlayerDrawSet drawInfo, bool reducedEffects)
|
||||
{
|
||||
Player Player = drawInfo.drawPlayer;
|
||||
|
||||
if (Main.rand.Next(reducedEffects ? 8 : 4) < 3)
|
||||
{
|
||||
Dust solarDust = Dust.NewDustDirect(Player.position, Player.width, Player.height, DustID.OrangeTorch, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, reducedEffects ? 175 : 100, default, reducedEffects ? 2f : 3f);
|
||||
solarDust.noGravity = true;
|
||||
solarDust.velocity *= 2.8f;
|
||||
solarDust.velocity.Y -= 0.5f;
|
||||
if (Main.rand.NextBool(4))
|
||||
{
|
||||
solarDust.noGravity = false;
|
||||
solarDust.scale *= 0.5f;
|
||||
}
|
||||
}
|
||||
|
||||
Lighting.AddLight((int)(Player.position.X / 16f), (int)(Player.position.Y / 16f + 1f), 1f, 0.3f, 0.1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 643 B After Width: | Height: | Size: 643 B |
@@ -30,24 +30,24 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
buffIndex--;
|
||||
}
|
||||
|
||||
internal static void DrawEffects(PlayerDrawSet drawInfo, bool hasDebuffResistance = false)
|
||||
internal static void DrawEffects(PlayerDrawSet drawInfo)
|
||||
{
|
||||
Player Player = drawInfo.drawPlayer;
|
||||
|
||||
if (Main.rand.NextBool(hasDebuffResistance ? 4 : 2))
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
Vector2 Vect = new Vector2(0f, Main.rand.NextBool(4) ? -5f : -9f).RotatedByRandom(MathHelper.ToRadians(25f)) * Main.rand.NextFloat(0.1f, 1.9f);
|
||||
CritSpark spark = new CritSpark(Player.Calamity().RandomDebuffVisualSpot, Vect, Main.rand.NextBool() ? Color.Coral : Color.OrangeRed, Color.Orange, (hasDebuffResistance ? 0.4f : 0.8f), 15, 2f, 1.9f);
|
||||
CritSpark spark = new CritSpark(Player.Calamity().RandomDebuffVisualSpot, Vect, Main.rand.NextBool() ? Color.Coral : Color.OrangeRed, Color.Orange, 0.8f, 15, 2f, 1.9f);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
}
|
||||
|
||||
if (Main.rand.NextBool(hasDebuffResistance ? 4 : 2))
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
Vector2 dustCorner = Player.position - 2f * Vector2.One;
|
||||
Vector2 dustVel = Player.velocity + new Vector2(0f, Main.rand.NextFloat(-5f, -1f));
|
||||
int d = Dust.NewDust(dustCorner, Player.width + 4, Player.height + 4, DustID.GemTopaz, dustVel.X, dustVel.Y);
|
||||
Main.dust[d].noGravity = true;
|
||||
Main.dust[d].scale = hasDebuffResistance ? Main.rand.NextFloat(0.3f, 0.5f) : Main.rand.NextFloat(0.7f, 1.2f);
|
||||
Main.dust[d].scale = Main.rand.NextFloat(0.7f, 1.2f);
|
||||
Main.dust[d].alpha = 235;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,16 +37,16 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
if (Main.rand.NextBool(hasDebuffResistance ? 4 : 2))
|
||||
{
|
||||
Vector2 Vect = new Vector2(0f, Main.rand.NextBool(4) ? -5f : -9f).RotatedByRandom(MathHelper.ToRadians(25f)) * Main.rand.NextFloat(0.1f, 1.9f);
|
||||
CritSpark spark = new CritSpark(Player.Calamity().RandomDebuffVisualSpot, Vect, Main.rand.NextBool() ? Color.Cyan : Color.DarkBlue, Color.DodgerBlue, (hasDebuffResistance ? 0.4f : 0.8f), 15, 2f, 1.9f);
|
||||
CritSpark spark = new CritSpark(Player.Calamity().RandomDebuffVisualSpot, Vect, Main.rand.NextBool() ? Color.Cyan : Color.Turquoise, Color.PaleTurquoise, (hasDebuffResistance ? 0.4f : 0.8f), 15, 2f, 1.9f);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
}
|
||||
for (int i = 0; i < (hasDebuffResistance ? 1 : 2); i++)
|
||||
{
|
||||
Vector2 dustCorner = Player.position - 2f * Vector2.One;
|
||||
Vector2 dustVel = Player.velocity + new Vector2(0f, Main.rand.NextFloat(-11f, -2f));
|
||||
int d = Dust.NewDust(dustCorner, Player.width + 4, Player.height + 4, Main.rand.NextBool(4) ? 160 : 206, dustVel.X, dustVel.Y);
|
||||
int d = Dust.NewDust(dustCorner, Player.width + 4, Player.height + 4, Main.rand.NextBool(4) ? 300 : 323, dustVel.X, dustVel.Y);
|
||||
Main.dust[d].noGravity = true;
|
||||
Main.dust[d].scale = hasDebuffResistance ? Main.rand.NextFloat(0.3f, 0.4f) : Main.rand.NextFloat(0.5f, 0.7f);
|
||||
Main.dust[d].scale = hasDebuffResistance ? Main.rand.NextFloat(0.3f, 0.3f) : Main.rand.NextFloat(0.5f, 0.5f);
|
||||
Main.dust[d].alpha = 235;
|
||||
}
|
||||
}
|
||||
@@ -57,16 +57,16 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
if (Main.rand.NextBool(3))
|
||||
{
|
||||
Vector2 Vect = new Vector2(0f, Main.rand.NextBool(4) ? -5f : -9f).RotatedByRandom(MathHelper.ToRadians(25f)) * Main.rand.NextFloat(0.1f, 1.9f);
|
||||
CritSpark spark = new CritSpark(npcSize, Vect, Main.rand.NextBool() ? Color.Cyan : Color.DarkBlue, Color.DodgerBlue, 0.8f, 15, 2f, 1.9f);
|
||||
CritSpark spark = new CritSpark(npcSize, Vect, Main.rand.NextBool() ? Color.Cyan : Color.Turquoise, Color.PaleTurquoise, 0.8f, 15, 2f, 1.9f);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
}
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
Vector2 dustCorner = npc.position - 2f * Vector2.One;
|
||||
Vector2 dustVel = npc.velocity + new Vector2(0f, Main.rand.NextFloat(-11f, -2f));
|
||||
int d = Dust.NewDust(dustCorner, npc.width + 4, npc.height + 4, Main.rand.NextBool(4) ? 160 : 206, dustVel.X, dustVel.Y);
|
||||
int d = Dust.NewDust(dustCorner, npc.width + 4, npc.height + 4, Main.rand.NextBool(4) ? 300 : 323, dustVel.X, dustVel.Y);
|
||||
Main.dust[d].noGravity = true;
|
||||
Main.dust[d].scale = Main.rand.NextFloat(0.6f, 0.8f);
|
||||
Main.dust[d].scale = Main.rand.NextFloat(0.5f, 0.5f);
|
||||
Main.dust[d].alpha = 235;
|
||||
}
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 517 B After Width: | Height: | Size: 623 B |
@@ -1,25 +0,0 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
public class RancorBurn : ModBuff
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
Main.buffNoTimeDisplay[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(NPC npc, ref int buffIndex)
|
||||
{
|
||||
if (npc.Calamity().RancorBurnTime < npc.buffTime[buffIndex])
|
||||
npc.Calamity().RancorBurnTime = npc.buffTime[buffIndex];
|
||||
npc.DelBuff(buffIndex);
|
||||
buffIndex--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 358 B |
@@ -0,0 +1,79 @@
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.Particles;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
public class TrueVulnerabilityHex : ModBuff
|
||||
{
|
||||
// The visual number displayed in ticks as the enemy takes damage.
|
||||
public const int TickNumber = 666;
|
||||
|
||||
// The exact amount True Vulnerability Hex reduces NPC life regen by.
|
||||
public const int DPS = TickNumber * 6; // -3996 life regen, 1998 DPS
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex) => player.Calamity().trueVHex = true;
|
||||
|
||||
public override void Update(NPC npc, ref int buffIndex)
|
||||
{
|
||||
CalamityGlobalNPC cgn = npc.Calamity();
|
||||
if (cgn.trueVulnerabilityHex < npc.buffTime[buffIndex])
|
||||
{
|
||||
cgn.trueVulnerabilityHex = npc.buffTime[buffIndex];
|
||||
// Set the remaining time of the fire drawer to be exactly right.
|
||||
if (cgn.VulnerabilityHexFireDrawer != null)
|
||||
cgn.VulnerabilityHexFireDrawer.SetLifetime = cgn.VulnerabilityHexFireDrawer.LocalTimer + cgn.trueVulnerabilityHex;
|
||||
}
|
||||
|
||||
// Apply immunity timer.
|
||||
if ((CalamityLists.enemyImmunityList.Contains(npc.type) || npc.boss) && cgn.debuffResistanceTimer <= 0)
|
||||
cgn.debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + cgn.trueVulnerabilityHex;
|
||||
|
||||
// Destroy the vanilla buff, we don't use it.
|
||||
npc.DelBuff(buffIndex);
|
||||
buffIndex--;
|
||||
}
|
||||
|
||||
internal static void DrawEffects(NPC npc, ref Color drawColor)
|
||||
{
|
||||
if (Main.rand.NextBool())
|
||||
{
|
||||
Vector2 position = new(npc.position.X + Main.rand.NextFloat(npc.width), npc.position.Y + Main.rand.NextFloat(npc.height));
|
||||
VoidSparkParticle voidSpark = new(position, -Vector2.UnitY.RotatedByRandom(MathHelper.Pi / 10f) * Main.rand.NextFloat(10f, 18f), false, 20, Main.rand.NextFloat(0.02f, 0.05f), Main.rand.NextBool() ? Color.Black : Color.Lerp(Color.Red, Color.Magenta, 0.35f));
|
||||
GeneralParticleHandler.SpawnParticle(voidSpark);
|
||||
}
|
||||
}
|
||||
|
||||
internal static void DrawEffects(PlayerDrawSet drawInfo)
|
||||
{
|
||||
Player Player = drawInfo.drawPlayer;
|
||||
|
||||
if (Main.rand.NextBool())
|
||||
{
|
||||
VoidSparkParticle spark2 = new VoidSparkParticle(Player.Calamity().RandomDebuffVisualSpot, -Vector2.UnitY * Main.rand.NextFloat(6f, 10f), false, Main.rand.Next(18, 27), Main.rand.NextFloat(0.015f, 0.045f), Main.rand.NextBool() ? Color.Black : Color.Lerp(Color.Red, Color.Magenta, 0.65f));
|
||||
GeneralParticleHandler.SpawnParticle(spark2);
|
||||
}
|
||||
|
||||
Dust dust = Dust.NewDustPerfect(Player.Calamity().RandomDebuffVisualSpot, Main.rand.NextBool() ? 261 : (int)CalamityDusts.Brimstone);
|
||||
dust.scale = Main.rand.NextFloat(0.6f, 0.7f);
|
||||
dust.velocity = -Vector2.UnitY.RotatedByRandom(MathHelper.PiOver4) * Main.rand.NextFloat(0.5f, 2.5f);
|
||||
if (dust.type == 261)
|
||||
dust.color = Color.Lerp(Color.Orange, Color.White, Main.rand.NextFloat());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 741 B |
@@ -0,0 +1,81 @@
|
||||
using CalamityMod.Particles;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
public class Voidfrost : ModBuff
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
player.Calamity().voidfrost = true;
|
||||
}
|
||||
|
||||
public override void Update(NPC npc, ref int buffIndex)
|
||||
{
|
||||
if (npc.Calamity().voidfrost < npc.buffTime[buffIndex])
|
||||
npc.Calamity().voidfrost = npc.buffTime[buffIndex];
|
||||
npc.DelBuff(buffIndex);
|
||||
buffIndex--;
|
||||
}
|
||||
|
||||
internal static void DrawEffects(PlayerDrawSet drawInfo, bool hasDebuffResistance = false)
|
||||
{
|
||||
Player Player = drawInfo.drawPlayer;
|
||||
|
||||
if (Main.rand.NextBool(5))
|
||||
{
|
||||
Vector2 Vect = new Vector2(0f, Main.rand.NextBool(4) ? -5f : -9f).RotatedByRandom(MathHelper.ToRadians(25f)) * Main.rand.NextFloat(0.1f, 1.9f);
|
||||
SnowflakeSparkle snowflake = new SnowflakeSparkle(Player.Calamity().RandomDebuffVisualSpot, Vect, Main.rand.NextBool() ? Color.Cyan : Color.DarkBlue, Color.DodgerBlue, 0.4f, 15, 2f, 1.9f);
|
||||
GeneralParticleHandler.SpawnParticle(snowflake);
|
||||
}
|
||||
if (Main.rand.NextBool(40))
|
||||
{
|
||||
Vector2 Vect = new Vector2(0f, Main.rand.NextBool(4) ? -5f : -9f).RotatedByRandom(MathHelper.ToRadians(25f)) * Main.rand.NextFloat(0.1f, 1.9f);
|
||||
MediumMistParticle mist = new MediumMistParticle(Player.Calamity().RandomDebuffVisualSpot, Vect, new Color(172, 238, 255), new Color(145, 170, 188), Main.rand.NextFloat(0.5f, 1.5f), 245 - Main.rand.Next(50), 0.02f);
|
||||
GeneralParticleHandler.SpawnParticle(mist);
|
||||
}
|
||||
Vector2 dustCorner = Player.position - 2f * Vector2.One;
|
||||
Vector2 dustVel = Player.velocity + new Vector2(0f, Main.rand.NextFloat(-11f, -2f));
|
||||
int d = Dust.NewDust(dustCorner, Player.width + 4, Player.height + 4, Main.rand.NextBool(4) ? 20 : 113, dustVel.X, dustVel.Y);
|
||||
Main.dust[d].noGravity = true;
|
||||
Main.dust[d].scale = Main.rand.NextFloat(1f, 0.3f);
|
||||
Main.dust[d].alpha = 10;
|
||||
}
|
||||
|
||||
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(5))
|
||||
{
|
||||
Vector2 Vect = new Vector2(0f, Main.rand.NextBool(4) ? -5f : -9f).RotatedByRandom(MathHelper.ToRadians(25f)) * Main.rand.NextFloat(0.1f, 1.9f);
|
||||
SnowflakeSparkle snowflake = new SnowflakeSparkle(npcSize, Vect, Main.rand.NextBool() ? Color.Cyan : Color.DarkBlue, Color.DodgerBlue, 0.8f, 15, 2f, 1.9f);
|
||||
GeneralParticleHandler.SpawnParticle(snowflake);
|
||||
}
|
||||
if (Main.rand.NextBool(40))
|
||||
{
|
||||
Vector2 Vect = new Vector2(0f, Main.rand.NextBool(4) ? -5f : -9f).RotatedByRandom(MathHelper.ToRadians(25f)) * Main.rand.NextFloat(0.1f, 1.9f);
|
||||
MediumMistParticle mist = new MediumMistParticle(npcSize, Vect, new Color(172, 238, 255), new Color(145, 170, 188), Main.rand.NextFloat(0.5f, 1.5f), 245 - Main.rand.Next(50), 0.02f);
|
||||
GeneralParticleHandler.SpawnParticle(mist);
|
||||
}
|
||||
|
||||
Vector2 dustCorner = npc.position - 2f * Vector2.One;
|
||||
Vector2 dustVel = npc.velocity + new Vector2(0f, Main.rand.NextFloat(-11f, -2f));
|
||||
int d = Dust.NewDust(dustCorner, npc.width + 4, npc.height + 4, Main.rand.NextBool(4) ? 20 : 113, dustVel.X, dustVel.Y);
|
||||
Main.dust[d].noGravity = true;
|
||||
Main.dust[d].scale = Main.rand.NextFloat(1f, 0.3f);
|
||||
Main.dust[d].alpha = 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 517 B |
@@ -1,24 +1,23 @@
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.Particles;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Microsoft.Xna.Framework;
|
||||
using ReLogic.Utilities;
|
||||
using CalamityMod.Dusts;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
public class VulnerabilityHex : ModBuff
|
||||
{
|
||||
// This is the visual number displayed in ticks as the enemy takes damage from this debuff.
|
||||
// The visual number displayed in ticks as the enemy takes damage.
|
||||
public const int TickNumber = 666;
|
||||
|
||||
// This is the exact DPS dealt by Vulnerability Hex to NPCs.
|
||||
public const int DPS = TickNumber * 4; // 2664 DPS
|
||||
// The exact amount Vulnerability Hex reduces NPC life regen by.
|
||||
public const int DPS = TickNumber * 4; // -2664 life regen, 1332 DPS
|
||||
|
||||
public const int CalamityDuration = 24;
|
||||
public const int CalamityDuration = 60;
|
||||
public const int AflameDuration = 120;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
|
||||
|
Before Width: | Height: | Size: 741 B After Width: | Height: | Size: 572 B |
@@ -15,7 +15,7 @@ namespace CalamityMod.Buffs.Potions
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
player.Calamity().shadow = true;
|
||||
if (player.yoraiz0rEye < 2 && CalamityConfig.Instance.StealthInvisibility)
|
||||
if (player.yoraiz0rEye < 2 && CalamityClientConfig.Instance.StealthInvisibility)
|
||||
player.yoraiz0rEye = 2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Potions
|
||||
{
|
||||
public class TeslaBuff : ModBuff
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = false;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
player.Calamity().tesla = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@ namespace CalamityMod.Buffs.StatBuffs
|
||||
|
||||
public override void ModifyBuffText(ref string buffName, ref string tip, ref int rare)
|
||||
{
|
||||
if (CalamityConfig.Instance.BossZen)
|
||||
if (CalamityServerConfig.Instance.BossZen)
|
||||
tip = tip.Replace(":", ":\n" + this.GetLocalizedValue("ZenDescription"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using Terraria;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.StatDebuffs
|
||||
@@ -19,5 +21,16 @@ namespace CalamityMod.Buffs.StatDebuffs
|
||||
npc.DelBuff(buffIndex);
|
||||
buffIndex--;
|
||||
}
|
||||
|
||||
internal static void DrawEffects(NPC npc, ref Color drawColor)
|
||||
{
|
||||
if (Main.rand.NextBool(4))
|
||||
{
|
||||
int dustType = Main.rand.NextBool() ? DustID.GemSapphire : DustID.BlueCrystalShard;
|
||||
Vector2 dustVelocity = Vector2.UnitX.RotatedBy(Main.rand.NextFloat(-MathHelper.Pi / 12f, 0f)) * (Main.rand.NextBool() ? -1f : 1f);
|
||||
Dust theDust = Dust.NewDustDirect(npc.position, npc.width, npc.height, dustType, dustVelocity.X, dustVelocity.Y);
|
||||
theDust.noGravity = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Summon
|
||||
{
|
||||
public class ElementalAxeBuff : ModBuff
|
||||
public class LegionofCelestiaBuff : ModBuff
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
@@ -17,7 +17,7 @@ namespace CalamityMod.Buffs.Summon
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
if (player.ownedProjectileCounts[ModContent.ProjectileType<ElementalAxeMinion>()] > 0)
|
||||
if (player.ownedProjectileCounts[ModContent.ProjectileType<CelestialAxeMinion>()] > 0)
|
||||
{
|
||||
modPlayer.eAxe = true;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 530 B After Width: | Height: | Size: 530 B |
@@ -85,9 +85,9 @@ namespace CalamityMod.CalPlayer
|
||||
public double contactDamageReduction = 0D;
|
||||
public double projectileDamageReduction = 0D;
|
||||
public const float projectileMeleeWeaponMeleeSpeedMultiplier = 0f;
|
||||
public bool brimlashBusterBoost = false;
|
||||
public int evilSmasherBoost = 0;
|
||||
public int hellbornBoost = 0;
|
||||
public int burningSeaBurnOut = 0;
|
||||
public int hellbornShots = 0;
|
||||
public int searedPanCounter = 0;
|
||||
public int searedPanTimer = 0;
|
||||
public int potionTimer = 0;
|
||||
@@ -95,7 +95,7 @@ namespace CalamityMod.CalPlayer
|
||||
public bool blockAllDashes = false;
|
||||
public bool resetHeightandWidth = false;
|
||||
public bool noLifeRegen = false;
|
||||
public bool reducedHolyFlamesDamage = false;
|
||||
public bool reducedDaybrokenDamage = false;
|
||||
public bool reducedNightwitherDamage = false;
|
||||
public float rangedAmmoCost = 1f;
|
||||
public float healingPotionMultiplier = 1f;
|
||||
@@ -179,6 +179,7 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
#region Timer and Counter
|
||||
public int gaelSwipes = 0;
|
||||
public int arsenalCooldown = 0;
|
||||
public int dragoonDrizzlefishGelBoost = 1;
|
||||
public int deadSunCounter = 6;
|
||||
public int DragonsBreathAudioCooldown = 0;
|
||||
@@ -488,6 +489,7 @@ namespace CalamityMod.CalPlayer
|
||||
public bool unstableGraniteCore = false;
|
||||
public bool regenator = false;
|
||||
public bool theBee = false;
|
||||
public bool shouldTriggerBeeCooldown = false;
|
||||
public int theBeeCooldown = 0;
|
||||
public bool alluringBait = false;
|
||||
public bool enchantedPearl = false;
|
||||
@@ -506,11 +508,14 @@ namespace CalamityMod.CalPlayer
|
||||
public bool evasionScarf = false;
|
||||
public bool badgeOfBravery = false;
|
||||
public bool warbannerOfTheSun = false;
|
||||
public bool tesla = false;
|
||||
public bool teslaVisuals = true;
|
||||
public bool cryogenSoul = false;
|
||||
public bool ascendantInsignia = false;
|
||||
public int ascendantInsigniaBuffTime = 0;
|
||||
public int ascendantInsigniaCooldown = 0;
|
||||
public bool ascendantTrail = false;
|
||||
public bool frozenWingsCold = false;
|
||||
public bool magmaStoneVisuals = true;
|
||||
public bool eGauntlet = false;
|
||||
public bool eGauntletVisuals = true; // Used to control dust spawned when swinging
|
||||
@@ -549,7 +554,7 @@ namespace CalamityMod.CalPlayer
|
||||
public bool aBrain = false;
|
||||
public bool amalgam = false;
|
||||
public bool raiderTalisman = false;
|
||||
public float raiderCritBonus = RaidersTalisman.RaiderBonus;
|
||||
public float raiderCritLifespan = 0f;
|
||||
public int raiderSoundCooldown = 0;
|
||||
public bool gSabaton = false;
|
||||
public int gSabatonHotkeyHoldTime = 0;
|
||||
@@ -574,6 +579,7 @@ namespace CalamityMod.CalPlayer
|
||||
public bool alchFlask = false;
|
||||
public bool toxicHeart = false;
|
||||
public bool abaddon = false;
|
||||
|
||||
public bool aeroStone = false;
|
||||
public bool lifejelly = false;
|
||||
public bool cleansingjelly = false;
|
||||
@@ -638,6 +644,7 @@ namespace CalamityMod.CalPlayer
|
||||
public bool royalGel = false;
|
||||
public bool handWarmer = false;
|
||||
public bool ursaSergeant = false;
|
||||
public bool ursaSergeantVisual = false;
|
||||
public bool scuttlersJewel = false;
|
||||
public int scuttlerCooldown = 0;
|
||||
public bool thiefsDime = false;
|
||||
@@ -804,6 +811,7 @@ namespace CalamityMod.CalPlayer
|
||||
public bool astralStarRain = false;
|
||||
public int astralStarRainCooldown = 0;
|
||||
public int AbaddonCooldown = 0;
|
||||
public int ursaSergeantCooldown = 0;
|
||||
public int AlchFlaskCooldown = 0;
|
||||
public bool plagueReaper = false;
|
||||
public bool plaguebringerPatronSet = false;
|
||||
@@ -873,6 +881,7 @@ namespace CalamityMod.CalPlayer
|
||||
#region Debuff
|
||||
public bool alcoholPoisoning = false;
|
||||
public bool shadowflame = false;
|
||||
public bool daybroken = false;
|
||||
public bool wDeath = false;
|
||||
public bool dragonFire = false;
|
||||
public bool vermillionFlux = false;
|
||||
@@ -897,6 +906,7 @@ namespace CalamityMod.CalPlayer
|
||||
public bool icarusFolly = false;
|
||||
public bool weakPetrification = false;
|
||||
public bool vHex = false;
|
||||
public bool trueVHex = false;
|
||||
public bool DoGExtremeGravity = false;
|
||||
public bool warped = false;
|
||||
public bool cDepth = false;
|
||||
@@ -907,6 +917,7 @@ namespace CalamityMod.CalPlayer
|
||||
public bool absorberAffliction = false;
|
||||
public bool sulphurPoison = false;
|
||||
public bool nightwither = false;
|
||||
public bool voidfrost = false;
|
||||
public bool eutrophication = false;
|
||||
public bool iCantBreathe = false; //Frozen Lungs debuff
|
||||
public bool cragsLava = false;
|
||||
@@ -962,7 +973,6 @@ namespace CalamityMod.CalPlayer
|
||||
public bool astralInjection = false;
|
||||
public bool gravityNormalizer = false;
|
||||
public bool flaskHoly = false;
|
||||
public bool tesla = false;
|
||||
public bool galvanicCorrosion = false;
|
||||
public bool sulphurskin = false;
|
||||
public bool baguette = false;
|
||||
@@ -1171,8 +1181,7 @@ namespace CalamityMod.CalPlayer
|
||||
public bool omegaBlueTransformation;
|
||||
public bool omegaBlueTransformationForce;
|
||||
public bool omegaBlueTransformationPower;
|
||||
public bool redBow;
|
||||
public bool cocosFeather;
|
||||
public bool ghostBracelet;
|
||||
#endregion
|
||||
|
||||
#region Calamitas Enchant Effects
|
||||
@@ -1731,9 +1740,12 @@ namespace CalamityMod.CalPlayer
|
||||
evolution = false;
|
||||
nanotech = false;
|
||||
deadshotBrooch = false;
|
||||
tesla = false;
|
||||
teslaVisuals = true;
|
||||
cryogenSoul = false;
|
||||
ascendantInsignia = false;
|
||||
ascendantTrail = false;
|
||||
frozenWingsCold = false;
|
||||
magmaStoneVisuals = true;
|
||||
eGauntlet = false;
|
||||
eGauntletVisuals = true;
|
||||
@@ -1803,6 +1815,7 @@ namespace CalamityMod.CalPlayer
|
||||
tracersElysian = false;
|
||||
tracersSeraph = false;
|
||||
ursaSergeant = false;
|
||||
ursaSergeantVisual = false;
|
||||
scuttlersJewel = false;
|
||||
thiefsDime = false;
|
||||
dynamoStemCells = false;
|
||||
@@ -1825,7 +1838,7 @@ namespace CalamityMod.CalPlayer
|
||||
CryoStoneVanity = false;
|
||||
voidField = false;
|
||||
copyrightInfringementShield = false;
|
||||
reducedHolyFlamesDamage = false;
|
||||
reducedDaybrokenDamage = false;
|
||||
reducedNightwitherDamage = false;
|
||||
|
||||
daedalusReflect = false;
|
||||
@@ -1953,6 +1966,7 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
alcoholPoisoning = false;
|
||||
shadowflame = false;
|
||||
daybroken = false;
|
||||
wDeath = false;
|
||||
dragonFire = false;
|
||||
vermillionFlux = false;
|
||||
@@ -1978,6 +1992,7 @@ namespace CalamityMod.CalPlayer
|
||||
elementalMix = false;
|
||||
icarusFolly = false;
|
||||
vHex = false;
|
||||
trueVHex = false;
|
||||
DoGExtremeGravity = false;
|
||||
warped = false;
|
||||
cDepth = false;
|
||||
@@ -1989,6 +2004,7 @@ namespace CalamityMod.CalPlayer
|
||||
snowmanNoseless = false;
|
||||
sulphurPoison = false;
|
||||
nightwither = false;
|
||||
voidfrost = false;
|
||||
eutrophication = false;
|
||||
iCantBreathe = false;
|
||||
cragsLava = false;
|
||||
@@ -2024,7 +2040,6 @@ namespace CalamityMod.CalPlayer
|
||||
astralInjection = false;
|
||||
gravityNormalizer = false;
|
||||
flaskHoly = false;
|
||||
tesla = false;
|
||||
galvanicCorrosion = false;
|
||||
sulphurskin = false;
|
||||
baguette = false;
|
||||
@@ -2223,8 +2238,7 @@ namespace CalamityMod.CalPlayer
|
||||
omegaBlueTransformationPrevious = omegaBlueTransformation;
|
||||
omegaBlueTransformation = omegaBlueTransformationForce = omegaBlueTransformationPower = false;
|
||||
|
||||
redBow = false;
|
||||
cocosFeather = false;
|
||||
ghostBracelet = false;
|
||||
|
||||
rageModeActive = false;
|
||||
adrenalineModeActive = false;
|
||||
@@ -2273,13 +2287,13 @@ namespace CalamityMod.CalPlayer
|
||||
#region Screen Position Movements
|
||||
public override void ModifyScreenPosition()
|
||||
{
|
||||
if (CalamityConfig.Instance.ScreenshakePower == 0)
|
||||
if (CalamityClientConfig.Instance.ScreenshakePower == 0)
|
||||
return;
|
||||
|
||||
if (GeneralScreenShakePower > 0f)
|
||||
{
|
||||
Main.screenPosition += Main.rand.NextVector2Circular(GeneralScreenShakePower * CalamityConfig.Instance.ScreenshakePower, GeneralScreenShakePower * CalamityConfig.Instance.ScreenshakePower);
|
||||
GeneralScreenShakePower = MathHelper.Clamp(GeneralScreenShakePower - 0.185f, 0f, 20f * CalamityConfig.Instance.ScreenshakePower);
|
||||
Main.screenPosition += Main.rand.NextVector2Circular(GeneralScreenShakePower * CalamityClientConfig.Instance.ScreenshakePower, GeneralScreenShakePower * CalamityClientConfig.Instance.ScreenshakePower);
|
||||
GeneralScreenShakePower = MathHelper.Clamp(GeneralScreenShakePower - 0.185f, 0f, 20f * CalamityClientConfig.Instance.ScreenshakePower);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -2327,6 +2341,7 @@ namespace CalamityMod.CalPlayer
|
||||
#region Debuffs
|
||||
heldGaelsLastFrame = false;
|
||||
gaelSwipes = 0;
|
||||
arsenalCooldown = 0;
|
||||
andromedaState = AndromedaPlayerState.Inactive;
|
||||
planarSpeedBoost = 0;
|
||||
galileoCooldown = 0;
|
||||
@@ -2346,7 +2361,7 @@ namespace CalamityMod.CalPlayer
|
||||
spiritOriginConvertedCrit = 0;
|
||||
rage = 0f;
|
||||
adrenaline = 0f;
|
||||
raiderCritBonus = 0f;
|
||||
raiderCritLifespan = 0f;
|
||||
raiderSoundCooldown = 0;
|
||||
gSabatonHotkeyHoldTime = 0;
|
||||
gSabatonFall = 0;
|
||||
@@ -2354,6 +2369,7 @@ namespace CalamityMod.CalPlayer
|
||||
gSabatonTempJumpSpeed = 0;
|
||||
astralStarRainCooldown = 0;
|
||||
AbaddonCooldown = 0;
|
||||
ursaSergeantCooldown = 0;
|
||||
AlchFlaskCooldown = 0;
|
||||
ascendantInsigniaCooldown = 0;
|
||||
silvaMageCooldown = 0;
|
||||
@@ -2383,6 +2399,7 @@ namespace CalamityMod.CalPlayer
|
||||
noLifeRegen = false;
|
||||
alcoholPoisoning = false;
|
||||
shadowflame = false;
|
||||
daybroken = false;
|
||||
wDeath = false;
|
||||
dragonFire = false;
|
||||
vermillionFlux = false;
|
||||
@@ -2408,6 +2425,7 @@ namespace CalamityMod.CalPlayer
|
||||
elementalMix = false;
|
||||
icarusFolly = false;
|
||||
vHex = false;
|
||||
trueVHex = false;
|
||||
DoGExtremeGravity = false;
|
||||
warped = false;
|
||||
cDepth = false;
|
||||
@@ -2419,6 +2437,7 @@ namespace CalamityMod.CalPlayer
|
||||
abyssalDivingSuitPlateHits = 0;
|
||||
sulphurPoison = false;
|
||||
nightwither = false;
|
||||
voidfrost = false;
|
||||
eutrophication = false;
|
||||
iCantBreathe = false;
|
||||
cragsLava = false;
|
||||
@@ -2492,7 +2511,6 @@ namespace CalamityMod.CalPlayer
|
||||
astralInjection = false;
|
||||
gravityNormalizer = false;
|
||||
flaskHoly = false;
|
||||
tesla = false;
|
||||
galvanicCorrosion = false;
|
||||
sulphurskin = false;
|
||||
baguette = false;
|
||||
@@ -2683,11 +2701,11 @@ namespace CalamityMod.CalPlayer
|
||||
#endregion
|
||||
|
||||
KameiBladeUseDelay = 0;
|
||||
brimlashBusterBoost = false;
|
||||
AdrenalineTrail = false;
|
||||
ascendantTrail = false;
|
||||
evilSmasherBoost = 0;
|
||||
hellbornBoost = 0;
|
||||
burningSeaBurnOut = 0;
|
||||
hellbornShots = 0;
|
||||
searedPanCounter = 0;
|
||||
searedPanTimer = 0;
|
||||
potionTimer = 0;
|
||||
@@ -2711,7 +2729,7 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
// Respawn the player faster
|
||||
// 3 seconds normally and configurable while a boss is alive between 15 and 60 seconds
|
||||
int respawnTimerSet = areThereAnyDamnBosses ? (CalamityConfig.Instance.PlayerRespawnTime_BossAlive * 60) : 180;
|
||||
int respawnTimerSet = areThereAnyDamnBosses ? (CalamityServerConfig.Instance.PlayerRespawnTime_BossAlive * 60) : 180;
|
||||
if (Player.respawnTimer > respawnTimerSet)
|
||||
Player.respawnTimer = respawnTimerSet;
|
||||
}
|
||||
@@ -2762,7 +2780,7 @@ namespace CalamityMod.CalPlayer
|
||||
if (CalamityKeybinds.GravistarSabatonHotkey.Current && gSabaton && Main.myPlayer == Player.whoAmI && (Player.velocity.Y != Player.oldVelocity.Y) && !Player.pulley && !Player.mount.Active && Player.grappling[0] == -1 && !Player.tongued)
|
||||
{
|
||||
gSabatonHotkeyHoldTime++;
|
||||
if (gSabatonHotkeyHoldTime < 60 && gSabatonHotkeyHoldTime % 3f == 0)
|
||||
if (gSabatonHotkeyHoldTime < 30 && gSabatonHotkeyHoldTime % 3f == 0)
|
||||
{
|
||||
SpawnGravistarParticle();
|
||||
}
|
||||
@@ -2835,16 +2853,15 @@ namespace CalamityMod.CalPlayer
|
||||
Player.statLife = Player.statLifeMax2;
|
||||
}
|
||||
}
|
||||
if (CalamityKeybinds.SandCloakHotkey.JustPressed && sandCloak && Main.myPlayer == Player.whoAmI && rogueStealth >= rogueStealthMax * 0.1f &&
|
||||
wearingRogueArmor && rogueStealthMax > 0 && !Player.HasCooldown(Cooldowns.SandCloak.ID))
|
||||
if (CalamityKeybinds.SandCloakHotkey.JustPressed && sandCloak && Main.myPlayer == Player.whoAmI && !Player.HasCooldown(Cooldowns.SandCloak.ID))
|
||||
{
|
||||
Player.AddCooldown(Cooldowns.SandCloak.ID, CalamityUtils.SecondsToFrames(30));
|
||||
Player.AddCooldown(Cooldowns.SandCloak.ID, CalamityUtils.SecondsToFrames(20));
|
||||
|
||||
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<Items.Accessories.SandCloak>()));
|
||||
rogueStealth -= rogueStealthMax * 0.1f;
|
||||
int damage = Player.ApplyArmorAccDamageBonusesTo(7);
|
||||
int damage = Player.ApplyArmorAccDamageBonusesTo(12);
|
||||
float knockback = 2.5f;
|
||||
|
||||
int veil = Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType<SandCloakVeil>(), damage, 8, Player.whoAmI);
|
||||
int veil = Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType<SandCloakVeil>(), damage, knockback, Player.whoAmI);
|
||||
Main.projectile[veil].Center = Player.Center;
|
||||
SoundEngine.PlaySound(SoundID.Item45, Player.Center);
|
||||
}
|
||||
@@ -3384,14 +3401,14 @@ namespace CalamityMod.CalPlayer
|
||||
public override void UpdateEquips()
|
||||
{
|
||||
// TODO -- why is boss health bar code in Player.UpdateEquips and not a ModSystem
|
||||
CalamityConfig.Instance.BossHealthBarExtraInfo = shouldDrawSmallText;
|
||||
CalamityClientConfig.Instance.BossHealthBarExtraInfo = shouldDrawSmallText;
|
||||
|
||||
// Putting this in GlobalItem will run multiple times for each slot, which this system already does, creating a slew of problems.
|
||||
VanillaArmorChangeManager.ApplyPotentialEffectsTo(Player);
|
||||
|
||||
// If the config is enabled, vastly increase the player's base tile and wall placement speeds
|
||||
// This stacks with the Brick Layer and Portable Cement Mixer
|
||||
if (CalamityConfig.Instance.FasterTilePlacement)
|
||||
if (CalamityServerConfig.Instance.FasterTilePlacement)
|
||||
{
|
||||
Player.tileSpeed += 0.5f;
|
||||
Player.wallSpeed += 0.5f;
|
||||
@@ -3466,59 +3483,72 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
Player.AddBuff(ModContent.BuffType<ProfanedCrystalBuff>(), 60, true);
|
||||
}
|
||||
if (gSabaton && Player.whoAmI == Main.myPlayer)
|
||||
if (gSabaton)
|
||||
{
|
||||
//While holding hotkey, but before slam, bring Y velocity closer to 0
|
||||
if (gSabatonHotkeyHoldTime < 60 && gSabatonHotkeyHoldTime != 0 && !gSabatonFalling)
|
||||
if (Player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
Player.velocity.Y *= (60 - (gSabatonHotkeyHoldTime / 4f)) / 60f;
|
||||
}
|
||||
//Play sound a bit early so it goes in time with the fall
|
||||
if (gSabatonHotkeyHoldTime == 45 && !gSabatonFalling)
|
||||
{
|
||||
SoundEngine.PlaySound(new("CalamityMod/Sounds/Custom/GravistarCharge") { Volume = 0.3f });
|
||||
}
|
||||
//1 second passed, falling time
|
||||
if (gSabatonHotkeyHoldTime == 60)
|
||||
{
|
||||
gSabatonFalling = true;
|
||||
}
|
||||
//Cancel fall and don't give 'on ground' effects if on rope, on mount, grappled, or tongued
|
||||
if (Player.pulley || Player.mount.Active || Player.grappling[0] != -1 || Player.tongued)
|
||||
{
|
||||
gSabatonFall = 0;
|
||||
gSabatonFalling = false;
|
||||
}
|
||||
if (gSabatonFalling)
|
||||
{
|
||||
SpawnGravistarParticle();
|
||||
|
||||
//Cap time converted to damage at 2 seconds
|
||||
if (gSabatonFall < 120)
|
||||
gSabatonFall++;
|
||||
|
||||
Player.maxFallSpeed = 40f;
|
||||
Player.gravity = 1.3f;
|
||||
//If the player can fly during the fall, the physics gets a bit funky
|
||||
Player.controlJump = false;
|
||||
|
||||
//Check if player hit some form of solid resistance (the ground)
|
||||
if (Player.oldVelocity.Y == Player.velocity.Y)
|
||||
// While holding hotkey, but before slam, bring Y velocity closer to 0
|
||||
if (gSabatonHotkeyHoldTime < 30 && gSabatonHotkeyHoldTime != 0 && !gSabatonFalling)
|
||||
{
|
||||
Player.velocity.Y *= (60 - (gSabatonHotkeyHoldTime / 2f)) / 60f;
|
||||
}
|
||||
// Play sound a bit early so it goes in time with the fall
|
||||
if (gSabatonHotkeyHoldTime == 15 && !gSabatonFalling)
|
||||
{
|
||||
SoundEngine.PlaySound(new("CalamityMod/Sounds/Custom/GravistarCharge") { Volume = 0.3f });
|
||||
}
|
||||
// 0.5 seconds passed, falling time
|
||||
if (gSabatonHotkeyHoldTime == 30)
|
||||
{
|
||||
gSabatonFalling = true;
|
||||
Player.velocity.Y = 0.01f;
|
||||
}
|
||||
// Cancel fall and don't give 'on ground' effects if on rope, on mount, grappled, or tongued
|
||||
// Also cancel fall if the player has upwards Y velocity (Goodbye Inner Tube cheese)
|
||||
if (Player.velocity.Y < 0f || Player.pulley || Player.mount.Active || Player.grappling[0] != -1 || Player.tongued)
|
||||
{
|
||||
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<GravistarSabaton>()));
|
||||
//Spawn explosion. ai[0] is used for transferring the recorded falling time
|
||||
|
||||
int damage = Player.ApplyArmorAccDamageBonusesTo(Player.CalcIntDamage<MeleeDamageClass>(GravistarSabaton.SlamDamage));
|
||||
|
||||
Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType<SabatonSlam>(), damage, 4f, Player.whoAmI, gSabatonFall);
|
||||
gSabatonFall = 0;
|
||||
gSabatonFalling = false;
|
||||
//Temporary jump speed is granted for 40 frames
|
||||
gSabatonTempJumpSpeed = 40;
|
||||
}
|
||||
if (gSabatonFalling)
|
||||
{
|
||||
SpawnGravistarParticle();
|
||||
|
||||
// Cap time converted to damage at 2 seconds
|
||||
if (gSabatonFall < 120)
|
||||
gSabatonFall++;
|
||||
|
||||
Player.maxFallSpeed = 40f;
|
||||
Player.gravity = 1.3f;
|
||||
// If the player can fly during the fall, the physics gets a bit funky
|
||||
Player.controlJump = false;
|
||||
|
||||
// Check if player hit some form of solid resistance (the ground)
|
||||
if (Player.oldVelocity.Y == Player.velocity.Y)
|
||||
{
|
||||
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<InterstellarStompers>()));
|
||||
//Spawn explosion. ai[0] is used for transferring the recorded falling time
|
||||
|
||||
int damage = Player.ApplyArmorAccDamageBonusesTo(Player.CalcIntDamage<MeleeDamageClass>(InterstellarStompers.SlamDamage));
|
||||
|
||||
Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType<StomperSlam>(), damage, 4f, Player.whoAmI, gSabatonFall);
|
||||
gSabatonFall = 0;
|
||||
gSabatonFalling = false;
|
||||
// Temporary jump speed is granted for 40 frames
|
||||
gSabatonTempJumpSpeed = 40;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else // Reset slam effect if the accessory is unequipped
|
||||
{
|
||||
gSabatonFall = 0;
|
||||
gSabatonFalling = false;
|
||||
}
|
||||
|
||||
// Reset The Evolution's same projectile DR if unequipped or the cooldown ends
|
||||
if (!evolution || !Player.HasCooldown(GlobalDodge.ID))
|
||||
projTypeJustHitBy = -1;
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -3641,7 +3671,7 @@ namespace CalamityMod.CalPlayer
|
||||
#region PostUpdateBuffs
|
||||
public override void PostUpdateBuffs()
|
||||
{
|
||||
if (Player.whoAmI == Main.myPlayer && CalamityConfig.Instance.VanillaCooldownDisplay)
|
||||
if (Player.whoAmI == Main.myPlayer && CalamityClientConfig.Instance.VanillaCooldownDisplay)
|
||||
{
|
||||
if (Player.whoAmI == Main.myPlayer && Player.potionDelay != 0)
|
||||
potionSick = true;
|
||||
@@ -3867,9 +3897,6 @@ namespace CalamityMod.CalPlayer
|
||||
#region Get Weapon Damage And KB
|
||||
public override void ModifyWeaponDamage(Item item, ref StatModifier damage)
|
||||
{
|
||||
if (fungalSymbiote && CalamityLists.MushroomWeaponIDs.Contains(item.type))
|
||||
damage += 0.1f;
|
||||
|
||||
if (item.CountsAsClass<RogueDamageClass>())
|
||||
{
|
||||
// Apply weapon modifier stealth strike damage bonus
|
||||
@@ -3957,7 +3984,7 @@ namespace CalamityMod.CalPlayer
|
||||
if (item.CountsAsClass<MeleeDamageClass>())
|
||||
{
|
||||
var source = Player.GetSource_ItemUse(item);
|
||||
if (fungalSymbiote && CalamityLists.MushroomWeaponIDs.Contains(item.type) && Player.whoAmI == Main.myPlayer)
|
||||
if (fungalSymbiote && Player.HasBuff(ModContent.BuffType<Mushy>()) && Player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
if (Player.itemAnimation == (int)(Player.itemAnimationMax * 0.1) ||
|
||||
Player.itemAnimation == (int)(Player.itemAnimationMax * 0.3) ||
|
||||
@@ -4272,18 +4299,13 @@ namespace CalamityMod.CalPlayer
|
||||
profanedCrystalAnimCounter = new KeyValuePair<int, int>(0, 10);
|
||||
}
|
||||
|
||||
if (redBow)
|
||||
if (ghostBracelet)
|
||||
{
|
||||
Player.legs = EquipLoader.GetEquipSlot(Mod, "RedBow", EquipType.Legs);
|
||||
Player.body = EquipLoader.GetEquipSlot(Mod, "RedBow", EquipType.Body);
|
||||
Player.head = EquipLoader.GetEquipSlot(Mod, "RedBow", EquipType.Head);
|
||||
}
|
||||
if (cocosFeather)
|
||||
{
|
||||
Player.legs = EquipLoader.GetEquipSlot(Mod, "CocosFeather", EquipType.Legs);
|
||||
Player.body = EquipLoader.GetEquipSlot(Mod, "CocosFeather", EquipType.Body);
|
||||
Player.head = EquipLoader.GetEquipSlot(Mod, "CocosFeather", EquipType.Head);
|
||||
Player.legs = EquipLoader.GetEquipSlot(Mod, "GhostBracelet", EquipType.Legs);
|
||||
Player.body = EquipLoader.GetEquipSlot(Mod, "GhostBracelet", EquipType.Body);
|
||||
Player.head = EquipLoader.GetEquipSlot(Mod, "GhostBracelet", EquipType.Head);
|
||||
}
|
||||
|
||||
if (snowRuffianSet)
|
||||
{
|
||||
Player.wings = EquipLoader.GetEquipSlot(Mod, "SnowRuffianMask", EquipType.Wings);
|
||||
@@ -4920,11 +4942,11 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
// Enabling the config while a player is loaded will show the timer immediately.
|
||||
// But it won't start running until you save and quit and re-enter a world.
|
||||
if (CalamityConfig.Instance.SpeedrunTimer)
|
||||
if (CalamityClientConfig.Instance.SpeedrunTimer)
|
||||
CalamityMod.SpeedrunTimer.Restart();
|
||||
|
||||
bool showWikiMessage = CalamityConfig.Instance.WikiStatusMessage;
|
||||
bool showVCMMMessage = CalamityConfig.Instance.VCMMStatusMessage && !CalamityMod.Instance.VCMMAvailable;
|
||||
bool showWikiMessage = CalamityClientConfig.Instance.WikiStatusMessage;
|
||||
bool showVCMMMessage = CalamityClientConfig.Instance.VCMMStatusMessage && !CalamityMod.Instance.VCMMAvailable;
|
||||
bool showStartupMessages = showWikiMessage || showVCMMMessage;
|
||||
|
||||
// Set a random delay between 12 and 20 seconds. When this delay hits zero, startup messages display
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
get
|
||||
{
|
||||
return (String.IsNullOrEmpty(dashID) && Player.dashType == 0 && CalamityConfig.Instance.DefaultDashEnabled) ? DefaultDash.ID : dashID; //gives default dash ONLY if no custom or vanilla dash.
|
||||
return (String.IsNullOrEmpty(dashID) && Player.dashType == 0 && CalamityServerConfig.Instance.DefaultDashEnabled) ? DefaultDash.ID : dashID; //gives default dash ONLY if no custom or vanilla dash.
|
||||
}
|
||||
set => dashID = value;
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
|
||||
// TODO -- rogue stealth visuals are an utter catastrophe and should be fully destroyed on next stealth rework
|
||||
if (calamityPlayer.rogueStealth > 0f && calamityPlayer.rogueStealthMax > 0f && Player.townNPCs < 3f && CalamityConfig.Instance.StealthInvisibility)
|
||||
if (calamityPlayer.rogueStealth > 0f && calamityPlayer.rogueStealthMax > 0f && Player.townNPCs < 3f && CalamityClientConfig.Instance.StealthInvisibility)
|
||||
{
|
||||
// A translucent orchid color, the rogue class color
|
||||
float colorValue = calamityPlayer.rogueStealth / calamityPlayer.rogueStealthMax * 0.9f; //0 to 0.9
|
||||
@@ -208,6 +208,9 @@ namespace CalamityMod.CalPlayer
|
||||
if (calamityPlayer.astralInfection && drawInfo.shadow == 0f)
|
||||
AstralInfectionDebuff.DrawEffects(drawInfo);
|
||||
|
||||
if (calamityPlayer.auricRebuke && drawInfo.shadow == 0f)
|
||||
AuricRebuke.DrawEffects(drawInfo);
|
||||
|
||||
if (calamityPlayer.bBlood && drawInfo.shadow == 0f)
|
||||
BurningBlood.DrawEffects(drawInfo);
|
||||
|
||||
@@ -223,14 +226,9 @@ namespace CalamityMod.CalPlayer
|
||||
if (calamityPlayer.cDepth && drawInfo.shadow == 0f)
|
||||
CrushDepth.DrawEffects(drawInfo);
|
||||
|
||||
if (calamityPlayer.vermillionFlux && drawInfo.shadow == 0f)
|
||||
VermillionFlux.DrawEffects(drawInfo);
|
||||
|
||||
if (calamityPlayer.auricRebuke && drawInfo.shadow == 0f)
|
||||
AuricRebuke.DrawEffects(drawInfo);
|
||||
|
||||
if (calamityPlayer.staticDischarge && drawInfo.shadow == 0f)
|
||||
StaticDischarge.DrawEffects(drawInfo);
|
||||
// Daybroken's visual effects are reduced if the player resists it
|
||||
if (calamityPlayer.daybroken && drawInfo.shadow == 0f)
|
||||
Daybroken.DrawEffects(drawInfo, reducedDaybrokenDamage);
|
||||
|
||||
if (calamityPlayer.dragonFire && drawInfo.shadow == 0f)
|
||||
Dragonfire.DrawEffects(drawInfo);
|
||||
@@ -255,11 +253,7 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
// Holy Flames, Holy Inferno and Banishing Fire share the same visual effects
|
||||
if (drawInfo.shadow == 0f && (calamityPlayer.hFlames || calamityPlayer.hInferno || calamityPlayer.banishingFire))
|
||||
{
|
||||
// You cannot "resist" Holy Inferno or Banishing Fire, so if you have either of those the visuals are always full strength
|
||||
bool resistsHolyFlames = !calamityPlayer.hInferno && !calamityPlayer.banishingFire && reducedHolyFlamesDamage;
|
||||
HolyFlames.DrawEffects(drawInfo, resistsHolyFlames);
|
||||
}
|
||||
HolyFlames.DrawEffects(drawInfo);
|
||||
|
||||
// Icarus' Folly has visual effects but they are mutually exclusive with all Holy Flames variations to prevent visual clutter
|
||||
else if (calamityPlayer.icarusFolly && drawInfo.shadow == 0f)
|
||||
@@ -275,6 +269,9 @@ namespace CalamityMod.CalPlayer
|
||||
if (calamityPlayer.nightwither && drawInfo.shadow == 0f) // Looks weaker if you have Moon Stone equipped
|
||||
Nightwither.DrawEffects(drawInfo, reducedNightwitherDamage);
|
||||
|
||||
if (calamityPlayer.voidfrost && drawInfo.shadow == 0f)
|
||||
Voidfrost.DrawEffects(drawInfo);
|
||||
|
||||
if (calamityPlayer.pFlames && drawInfo.shadow == 0f)
|
||||
Plague.DrawEffects(drawInfo);
|
||||
|
||||
@@ -284,6 +281,9 @@ namespace CalamityMod.CalPlayer
|
||||
if (calamityPlayer.shadowflame && drawInfo.shadow == 0f)
|
||||
Shadowflame.DrawEffects(drawInfo);
|
||||
|
||||
if (calamityPlayer.staticDischarge && drawInfo.shadow == 0f)
|
||||
StaticDischarge.DrawEffects(drawInfo);
|
||||
|
||||
if (calamityPlayer.sulphurPoison && drawInfo.shadow == 0f)
|
||||
SulphuricPoisoning.DrawEffects(drawInfo);
|
||||
|
||||
@@ -291,9 +291,15 @@ namespace CalamityMod.CalPlayer
|
||||
if (calamityPlayer.tRegen && drawInfo.shadow == 0f)
|
||||
TarraLifeRegen.DrawEffects(drawInfo);
|
||||
|
||||
if (calamityPlayer.trueVHex && drawInfo.shadow == 0f)
|
||||
TrueVulnerabilityHex.DrawEffects(drawInfo);
|
||||
|
||||
if (calamityPlayer.vaporfied && drawInfo.shadow == 0f)
|
||||
Vaporfied.DrawEffects(drawInfo);
|
||||
|
||||
if (calamityPlayer.vermillionFlux && drawInfo.shadow == 0f)
|
||||
VermillionFlux.DrawEffects(drawInfo);
|
||||
|
||||
if (calamityPlayer.vHex && drawInfo.shadow == 0f)
|
||||
VulnerabilityHex.DrawEffects(drawInfo);
|
||||
#endregion
|
||||
@@ -446,7 +452,7 @@ namespace CalamityMod.CalPlayer
|
||||
ModContent.ItemType<SparkSpreader>(),
|
||||
ModContent.ItemType<HalleysInferno>(),
|
||||
ModContent.ItemType<CleansingBlaze>(),
|
||||
ModContent.ItemType<ElementalEruption>(),
|
||||
ModContent.ItemType<ChromaticEruption>(),
|
||||
ModContent.ItemType<DeadSunsWind>(),
|
||||
ModContent.ItemType<Meowthrower>(),
|
||||
ModContent.ItemType<OverloadedBlaster>(),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CalamityMod.Balancing;
|
||||
using CalamityMod.Buffs.Cooldowns;
|
||||
@@ -19,10 +20,13 @@ using CalamityMod.Items.Armor.LunicCorps;
|
||||
using CalamityMod.Items.Armor.Silva;
|
||||
using CalamityMod.Items.Armor.Wulfrum;
|
||||
using CalamityMod.Items.Mounts;
|
||||
using CalamityMod.Items.Tools;
|
||||
using CalamityMod.Items.VanillaArmorChanges;
|
||||
using CalamityMod.Items.Weapons.DraedonsArsenal;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.NPCs.Abyss;
|
||||
using CalamityMod.NPCs.Cryogen;
|
||||
using CalamityMod.NPCs.NormalNPCs;
|
||||
using CalamityMod.NPCs.Other;
|
||||
using CalamityMod.NPCs.ProfanedGuardians;
|
||||
@@ -38,12 +42,11 @@ using CalamityMod.Projectiles.Typeless;
|
||||
using CalamityMod.UI;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Mono.Cecil;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.Chat;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.GameContent.Events;
|
||||
using Terraria.Graphics.Renderers;
|
||||
using Terraria.Graphics.Shaders;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
@@ -442,6 +445,10 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Shadowflame").Format(Player.name));
|
||||
}
|
||||
if (daybroken)
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Daybroken").Format(Player.name));
|
||||
}
|
||||
if (bBlood)
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.BurningBlood" + Main.rand.Next(1, 2 + 1)).Format(Player.name));
|
||||
@@ -490,10 +497,6 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.ManaBurn").Format(Player.name));
|
||||
}
|
||||
if (bloodyMary || everclear || evergreenGin || fireball || margarita || moonshine || moscowMule || redWine || screwdriver || starBeamRye || tequila || tequilaSunrise || vodka || whiteWine || Player.tipsy)
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AlcoholSmall").Format(Player.name));
|
||||
}
|
||||
if (witheredDebuff)
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Withered").Format(Player.name));
|
||||
@@ -508,7 +511,7 @@ namespace CalamityMod.CalPlayer
|
||||
if (Main.zenithWorld)
|
||||
SoundEngine.PlaySound(LeonDeathNoiseRE4_ForGFB, Player.Center);
|
||||
|
||||
if (NorfleetCounter >= 3 && NorfleetCounter < 1000)
|
||||
if (NorfleetCounter > 3 && NorfleetCounter < 1000)
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Norfleet").Format(Player.name));
|
||||
NorfleetCounter = 0;
|
||||
|
||||
@@ -585,11 +588,45 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
float meleeBoost = MathHelper.Lerp(0f, FrostArmorSetChange.ProximityBoost, 1 - DistanceInterpolant);
|
||||
modifiers.SourceDamage += meleeBoost;
|
||||
|
||||
if (meleeBoost >= FrostArmorSetChange.ProximityBoost * 0.5f)
|
||||
{
|
||||
float intensity = meleeBoost / FrostArmorSetChange.ProximityBoost;
|
||||
SoundEngine.PlaySound(Cryogen.HitSound with { Volume = intensity - 0.2f }, Player.Center);
|
||||
}
|
||||
if (meleeBoost > 0f)
|
||||
{
|
||||
int count = (int)(30f * meleeBoost);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
Vector2 velocity = Main.rand.NextVector2Unit() * (5f + 100f * meleeBoost);
|
||||
float scale = Main.rand.NextFloat(0.5f, 1f) + 0.5f * meleeBoost / FrostArmorSetChange.ProximityBoost;
|
||||
Particle sparkle = new CritSpark(target.Center, velocity, Color.White, Color.DodgerBlue, scale, 15, 0.1f, scale * 2f);
|
||||
GeneralParticleHandler.SpawnParticle(sparkle);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (item.CountsAsClass<RangedDamageClass>())
|
||||
{
|
||||
float rangedBoost = MathHelper.Lerp(0f, FrostArmorSetChange.ProximityBoost, DistanceInterpolant);
|
||||
modifiers.SourceDamage += rangedBoost;
|
||||
|
||||
if (rangedBoost >= FrostArmorSetChange.ProximityBoost * 0.5f)
|
||||
{
|
||||
float intensity = rangedBoost / FrostArmorSetChange.ProximityBoost;
|
||||
SoundEngine.PlaySound(Cryogen.HitSound with { Volume = intensity - 0.2f }, Player.Center);
|
||||
}
|
||||
if (rangedBoost > 0f)
|
||||
{
|
||||
int count = (int)(30f * rangedBoost);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
Vector2 velocity = Main.rand.NextVector2Unit() * (5f + 100f * rangedBoost);
|
||||
float scale = Main.rand.NextFloat(0.5f, 1f) + 0.5f * rangedBoost / FrostArmorSetChange.ProximityBoost;
|
||||
Particle sparkle = new CritSpark(target.Center, velocity, Color.White, Color.DodgerBlue, scale, 15, 0.1f, scale * 2f);
|
||||
GeneralParticleHandler.SpawnParticle(sparkle);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -671,11 +708,45 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
float meleeBoost = MathHelper.Lerp(0f, FrostArmorSetChange.ProximityBoost, 1 - DistanceInterpolant);
|
||||
modifiers.SourceDamage += meleeBoost;
|
||||
|
||||
if (meleeBoost >= FrostArmorSetChange.ProximityBoost * 0.5f)
|
||||
{
|
||||
float intensity = meleeBoost / FrostArmorSetChange.ProximityBoost;
|
||||
SoundEngine.PlaySound(Cryogen.HitSound with { Volume = intensity - 0.2f }, Player.Center);
|
||||
}
|
||||
if (meleeBoost > 0f)
|
||||
{
|
||||
int count = (int)(30f * meleeBoost);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
Vector2 velocity = Main.rand.NextVector2Unit() * (5f + 100f * meleeBoost);
|
||||
float scale = Main.rand.NextFloat(0.5f, 1f) + 0.5f * meleeBoost / FrostArmorSetChange.ProximityBoost;
|
||||
Particle sparkle = new CritSpark(target.Center, velocity, Color.White, Color.DodgerBlue, scale, 15, 0.1f, scale * 2f);
|
||||
GeneralParticleHandler.SpawnParticle(sparkle);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (proj.CountsAsClass<RangedDamageClass>())
|
||||
{
|
||||
float rangedBoost = MathHelper.Lerp(0f, FrostArmorSetChange.ProximityBoost, DistanceInterpolant);
|
||||
modifiers.SourceDamage += rangedBoost;
|
||||
|
||||
if (rangedBoost >= FrostArmorSetChange.ProximityBoost * 0.5f)
|
||||
{
|
||||
float intensity = rangedBoost / FrostArmorSetChange.ProximityBoost;
|
||||
SoundEngine.PlaySound(Cryogen.HitSound with { Volume = intensity - 0.2f }, Player.Center);
|
||||
}
|
||||
if (rangedBoost > 0f)
|
||||
{
|
||||
int count = (int)(30f * rangedBoost);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
Vector2 velocity = Main.rand.NextVector2Unit() * (5f + 100f * rangedBoost);
|
||||
float scale = Main.rand.NextFloat(0.5f, 1f) + 0.5f * rangedBoost / FrostArmorSetChange.ProximityBoost;
|
||||
Particle sparkle = new CritSpark(target.Center, velocity, Color.White, Color.DodgerBlue, scale, 15, 0.1f, scale * 2f);
|
||||
GeneralParticleHandler.SpawnParticle(sparkle);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -692,32 +763,8 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
Item heldItem = Player.ActiveItem();
|
||||
|
||||
bool wearingForbiddenSet = Player.armor[0].type == ItemID.AncientBattleArmorHat && Player.armor[1].type == ItemID.AncientBattleArmorShirt && Player.armor[2].type == ItemID.AncientBattleArmorPants;
|
||||
|
||||
bool forbiddenWithMagicWeapon = wearingForbiddenSet && heldItem.CountsAsClass<MagicDamageClass>();
|
||||
bool gemTechBlueGem = GemTechSet && GemTechState.IsBlueGemActive;
|
||||
|
||||
bool crossClassNerfDisabled = forbiddenWithMagicWeapon || fearmongerSet || gemTechBlueGem || profanedCrystalBuffs || DD2Event.Ongoing;
|
||||
crossClassNerfDisabled |= CalamityLists.DisabledSummonerNerfMinions.Contains(proj.type);
|
||||
|
||||
// If this projectile is a summon, its owner is holding an item, and the cross class nerf isn't disabled from equipment:
|
||||
if (isSummon && heldItem.type > ItemID.None && !crossClassNerfDisabled)
|
||||
{
|
||||
bool heldItemIsClassedWeapon = !heldItem.CountsAsClass<SummonDamageClass>() && (
|
||||
heldItem.CountsAsClass<MeleeDamageClass>() ||
|
||||
heldItem.CountsAsClass<RangedDamageClass>() ||
|
||||
heldItem.CountsAsClass<MagicDamageClass>() ||
|
||||
heldItem.CountsAsClass<ThrowingDamageClass>()
|
||||
);
|
||||
|
||||
bool heldItemIsTool = heldItem.pick > 0 || heldItem.axe > 0 || heldItem.hammer > 0;
|
||||
bool heldItemCanBeUsed = heldItem.useStyle != ItemUseStyleID.None;
|
||||
bool heldItemIsAccessoryOrAmmo = heldItem.accessory || heldItem.ammo != AmmoID.None;
|
||||
bool heldItemIsExcludedByModCall = CalamityLists.DisabledSummonerNerfItems.Contains(heldItem.type);
|
||||
|
||||
if (heldItemIsClassedWeapon && heldItemCanBeUsed && !heldItemIsTool && !heldItemIsAccessoryOrAmmo && !heldItemIsExcludedByModCall)
|
||||
modifiers.FinalDamage *= BalancingConstants.SummonerCrossClassNerf;
|
||||
}
|
||||
if (CalamityUtils.ShouldTriggerSummonPenalty(Player, heldItem) && !CalamityLists.DisabledSummonerNerfMinions.Contains(proj.type))
|
||||
modifiers.FinalDamage *= BalancingConstants.SummonerCrossClassNerf;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -801,6 +848,9 @@ namespace CalamityMod.CalPlayer
|
||||
modifiers.SourceDamage *= damageReductionFromWhisperingDeath;
|
||||
}
|
||||
|
||||
if (trueVHex)
|
||||
modifiers.SourceDamage *= 1.15f;
|
||||
|
||||
//
|
||||
// At this point, the player is guaranteed to be hit if there is no dodge.
|
||||
// The amount of damage that will be dealt is yet to be determined.
|
||||
@@ -855,7 +905,7 @@ namespace CalamityMod.CalPlayer
|
||||
if (theBee && theBeeCooldown <= 0 && lifeAndShieldCondition)
|
||||
{
|
||||
contactDamageReduction += 0.5;
|
||||
theBeeCooldown = 600;
|
||||
shouldTriggerBeeCooldown = true;
|
||||
}
|
||||
|
||||
// Apply Adrenaline DR if available
|
||||
@@ -950,6 +1000,7 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
proj.hostile = false;
|
||||
proj.friendly = true;
|
||||
proj.damage *= 10;
|
||||
proj.velocity *= -2f;
|
||||
proj.extraUpdates += 1;
|
||||
proj.penetrate = 1;
|
||||
@@ -978,6 +1029,9 @@ namespace CalamityMod.CalPlayer
|
||||
projectileDamageReduction += 0.2;
|
||||
}
|
||||
|
||||
if (trueVHex)
|
||||
modifiers.SourceDamage *= 1.15f;
|
||||
|
||||
if (auralisAuroraCounter >= 300)
|
||||
{
|
||||
modifiers.SourceDamage.Flat -= 100;
|
||||
@@ -1054,13 +1108,7 @@ namespace CalamityMod.CalPlayer
|
||||
if (evolution)
|
||||
{
|
||||
if (proj.type == projTypeJustHitBy)
|
||||
projectileDamageReduction += 0.15;
|
||||
}
|
||||
|
||||
if (transformer)
|
||||
{
|
||||
if (proj.type == ProjectileID.BulletSnowman || proj.type == ProjectileID.BulletDeadeye || proj.type == ProjectileID.SniperBullet)
|
||||
projectileDamageReduction += 0.5;
|
||||
projectileDamageReduction += 0.25;
|
||||
}
|
||||
|
||||
if (CalamityLists.projectileDestroyExceptionList.TrueForAll(x => proj.type != x) && proj.active && !proj.friendly && proj.hostile && proj.damage > 0)
|
||||
@@ -1094,7 +1142,7 @@ namespace CalamityMod.CalPlayer
|
||||
if (theBee && theBeeCooldown <= 0 && lifeAndShieldCondition)
|
||||
{
|
||||
projectileDamageReduction += 0.5;
|
||||
theBeeCooldown = 600;
|
||||
shouldTriggerBeeCooldown = true;
|
||||
}
|
||||
|
||||
// Apply Adrenaline DR if available
|
||||
@@ -1255,21 +1303,7 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
}
|
||||
|
||||
if (alchFlask)
|
||||
{
|
||||
for (int i = 0; i < 9; i++)
|
||||
{
|
||||
int seekerDamage = (int)Player.GetBestClassDamage().ApplyTo(15);
|
||||
seekerDamage = Player.ApplyArmorAccDamageBonusesTo(seekerDamage);
|
||||
|
||||
Projectile bee = Projectile.NewProjectileDirect(Player.GetSource_FromThis(), Player.Center, new Vector2(5, 5).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1.2f), ModContent.ProjectileType<BasicPlagueBee>(), seekerDamage, 0f, Player.whoAmI, -20, 30, 2);
|
||||
bee.ArmorPenetration = 35;
|
||||
bee.penetrate = 6;
|
||||
bee.extraUpdates = 2;
|
||||
bee.timeLeft = 600;
|
||||
}
|
||||
Player.AddBuff(BuffID.Honey, 900);
|
||||
}
|
||||
OnHitByCombat(hurtInfo);
|
||||
}
|
||||
|
||||
public override void OnHitByProjectile(Projectile proj, Player.HurtInfo hurtInfo)
|
||||
@@ -1285,20 +1319,36 @@ namespace CalamityMod.CalPlayer
|
||||
if (!hasIFrames && !Player.creativeGodMode)
|
||||
nextHitDealsDefenseDamage |= proj.Calamity().DealsDefenseDamage;
|
||||
|
||||
if (sulphurSet && !proj.friendly && hurtInfo.Damage > 0)
|
||||
// CIT 22JUL2024: This entire code segment is bugged, so I'm disabling it.
|
||||
// Very likely because it's trying to index into Main.npc using Projectile.owner.
|
||||
/*if (!proj.friendly && hurtInfo.Damage > 0)
|
||||
{
|
||||
if (Main.player[proj.owner] is null)
|
||||
{
|
||||
if (!Main.npc[proj.owner].friendly)
|
||||
Main.npc[proj.owner].AddBuff(BuffID.Poisoned, 60);
|
||||
{
|
||||
if (sulphurSet)
|
||||
Main.npc[proj.owner].AddBuff(BuffID.Poisoned, 60);
|
||||
if (aSpark)
|
||||
{
|
||||
if (transformer)
|
||||
Main.npc[proj.owner].Calamity().transformerShocked = 120;
|
||||
else
|
||||
Main.npc[proj.owner].Calamity().shocked = 120;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Player p = Main.player[proj.owner];
|
||||
if (p.hostile && Player.hostile && (Player.team != p.team || p.team == 0))
|
||||
p.AddBuff(BuffID.Poisoned, 60);
|
||||
{
|
||||
if (sulphurSet)
|
||||
p.AddBuff(BuffID.Poisoned, 60);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
if (proj.hostile && hurtInfo.Damage > 0)
|
||||
{
|
||||
@@ -1390,6 +1440,10 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
Player.AddBuff(BuffID.Poisoned, 300);
|
||||
}
|
||||
else if (proj.type == ProjectileID.CultistBossFireBall)
|
||||
{
|
||||
Player.AddBuff(ModContent.BuffType<Daybroken>(), 120);
|
||||
}
|
||||
else if (proj.type == ProjectileID.CultistBossIceMist)
|
||||
{
|
||||
if (!Player.frozen)
|
||||
@@ -1421,17 +1475,17 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
Player.AddBuff(ModContent.BuffType<Nightwither>(), 300);
|
||||
}
|
||||
else if (proj.type == ProjectileID.FairyQueenLance || proj.type == ProjectileID.HallowBossRainbowStreak || proj.type == ProjectileID.HallowBossSplitShotCore)
|
||||
else if ((proj.type == ProjectileID.FairyQueenLance || proj.type == ProjectileID.HallowBossRainbowStreak || proj.type == ProjectileID.HallowBossSplitShotCore) && NPC.ShouldEmpressBeEnraged())
|
||||
{
|
||||
Player.AddBuff(NPC.ShouldEmpressBeEnraged() ? ModContent.BuffType<HolyFlames>() : ModContent.BuffType<Nightwither>(), 60);
|
||||
Player.AddBuff(ModContent.BuffType<Daybroken>(), 60);
|
||||
}
|
||||
else if (proj.type == ProjectileID.HallowBossLastingRainbow)
|
||||
else if (proj.type == ProjectileID.HallowBossLastingRainbow && NPC.ShouldEmpressBeEnraged())
|
||||
{
|
||||
Player.AddBuff(NPC.ShouldEmpressBeEnraged() ? ModContent.BuffType<HolyFlames>() : ModContent.BuffType<Nightwither>(), 120);
|
||||
Player.AddBuff(ModContent.BuffType<Daybroken>(), 120);
|
||||
}
|
||||
else if (proj.type == ProjectileID.FairyQueenSunDance)
|
||||
else if (proj.type == ProjectileID.FairyQueenSunDance && NPC.ShouldEmpressBeEnraged())
|
||||
{
|
||||
Player.AddBuff(NPC.ShouldEmpressBeEnraged() ? ModContent.BuffType<HolyFlames>() : ModContent.BuffType<Nightwither>(), 180);
|
||||
Player.AddBuff(ModContent.BuffType<Daybroken>(), 180);
|
||||
}
|
||||
else if (proj.type == ProjectileID.BloodNautilusShot)
|
||||
{
|
||||
@@ -1450,23 +1504,6 @@ namespace CalamityMod.CalPlayer
|
||||
// As these reflects do not cancel damage, they need to be in OnHit rather than ModifyHit
|
||||
if (CalamityLists.projectileDestroyExceptionList.TrueForAll(x => proj.type != x) && proj.active && !proj.friendly && proj.hostile && hurtInfo.Damage > 0)
|
||||
{
|
||||
// The Transformer can reflect bullets
|
||||
if (transformer)
|
||||
{
|
||||
if (proj.type == ProjectileID.BulletSnowman || proj.type == ProjectileID.BulletDeadeye || proj.type == ProjectileID.SniperBullet || proj.type == ProjectileID.VortexLaser)
|
||||
{
|
||||
proj.hostile = false;
|
||||
proj.friendly = true;
|
||||
proj.velocity *= -1f;
|
||||
proj.damage = (int)Player.GetBestClassDamage().ApplyTo(proj.damage * 8);
|
||||
proj.penetrate = 1;
|
||||
|
||||
// 17APR2024: Ozzatron: The Transformer is a reflect which also functions as a dodge. It uses vanilla dodge iframes and benefits from Cross Necklace.
|
||||
int transformerIFrames = Player.ComputeReflectIFrames();
|
||||
Player.GiveUniversalIFrames(transformerIFrames, true);
|
||||
}
|
||||
}
|
||||
|
||||
double dodgeDamageGateValuePercent = 0.05;
|
||||
int dodgeDamageGateValue = (int)Math.Round(Player.statLifeMax2 * dodgeDamageGateValuePercent);
|
||||
|
||||
@@ -1502,6 +1539,52 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
Player.AddBuff(ModContent.BuffType<NOU>(), 15, true);
|
||||
}
|
||||
|
||||
OnHitByCombat(hurtInfo);
|
||||
}
|
||||
|
||||
// Shortcut for applying hit effects when hit by either an NPC or projectile
|
||||
// Reminder that external sources ie. forcefully called hurt functions, hazards (thorns, spikes, lava) are not valid
|
||||
public void OnHitByCombat(Player.HurtInfo hurtInfo)
|
||||
{
|
||||
// Apply The Bee cooldown, must be applied here so that it does not apply on dodges
|
||||
if (theBee && shouldTriggerBeeCooldown)
|
||||
{
|
||||
shouldTriggerBeeCooldown = false;
|
||||
if (hurtInfo.Damage > 0)
|
||||
theBeeCooldown = TheBee.CooldownLength;
|
||||
}
|
||||
|
||||
if (alchFlask)
|
||||
{
|
||||
for (int i = 0; i < 9; i++)
|
||||
{
|
||||
int seekerDamage = (int)Player.GetBestClassDamage().ApplyTo(15);
|
||||
seekerDamage = Player.ApplyArmorAccDamageBonusesTo(seekerDamage);
|
||||
|
||||
Projectile bee = Projectile.NewProjectileDirect(Player.GetSource_FromThis(), Player.Center, new Vector2(5, 5).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1.2f), ModContent.ProjectileType<BasicPlagueBee>(), seekerDamage, 0f, Player.whoAmI, -20, 30, 2);
|
||||
bee.ArmorPenetration = 35;
|
||||
bee.penetrate = 6;
|
||||
bee.extraUpdates = 2;
|
||||
bee.timeLeft = 600;
|
||||
}
|
||||
Player.AddBuff(BuffID.Honey, 900);
|
||||
}
|
||||
|
||||
if (ursaSergeant)
|
||||
{
|
||||
ursaSergeantCooldown = (int)MathHelper.Clamp(ursaSergeantCooldown - 180, 0, 300);
|
||||
Player.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 150);
|
||||
for (int i = 0; i < 9; i++)
|
||||
{
|
||||
Particle spark2 = new LineParticle(Player.Center, new Vector2(8, 8).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1f), false, 20, Main.rand.NextFloat(0.5f, 1.1f), Main.rand.NextBool() ? Color.Coral : Color.DarkTurquoise);
|
||||
GeneralParticleHandler.SpawnParticle(spark2);
|
||||
Dust dust2 = Dust.NewDustPerfect(Player.Center, 267, new Vector2(8, 8).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1f));
|
||||
dust2.scale = Main.rand.NextFloat(0.75f, 1.2f);
|
||||
dust2.noGravity = true;
|
||||
dust2.color = Main.rand.NextBool() ? Color.Coral : Color.DarkTurquoise;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -1539,14 +1622,14 @@ namespace CalamityMod.CalPlayer
|
||||
Rectangle npcHitbox = n.getRect();
|
||||
if ((Player.getRect()).Intersects(npcHitbox) && (n.noTileCollide || Collision.CanHit(Player.position, Player.width, Player.height, n.position, n.width, n.height)))
|
||||
{
|
||||
int damage = Player.ApplyArmorAccDamageBonusesTo(Player.CalcIntDamage<MeleeDamageClass>(GravistarSabaton.PassthroughDamage));
|
||||
int damage = Player.ApplyArmorAccDamageBonusesTo(Player.CalcIntDamage<MeleeDamageClass>(InterstellarStompers.PassthroughDamage));
|
||||
|
||||
Projectile.NewProjectile(Player.GetSource_FromThis(), n.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), damage, 0, Main.myPlayer);
|
||||
|
||||
// 17APR2024: Ozzatron: Gravistar Sabaton gives iframes when passing through enemies for projectile safety.
|
||||
// This is a fixed and intentionally very low number of iframes, and is not boosted by Cross Necklace.
|
||||
n.Calamity().dashImmunityTime[Player.whoAmI] = 4;
|
||||
Player.GiveUniversalIFrames(GravistarSabaton.PassthroughIFrames, false);
|
||||
Player.GiveUniversalIFrames(InterstellarStompers.PassthroughIFrames, false);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -2054,11 +2137,12 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
// If the player was just hit by something capable of dealing defense damage, then apply defense damage.
|
||||
// Bloodflare Core makes every hit deal defense damage (to enable its function).
|
||||
// Defense damage is not applied if the player has iframes.
|
||||
// This function will be ignored if the player is wearing Chalice, as it handles its defense damage elsewhere.
|
||||
// Defense damage is not applied if the player has iframes or godmode.
|
||||
bool hitCanApplyDefenseDamage = nextHitDealsDefenseDamage || bloodflareCore;
|
||||
bool defenseDamageShouldApply = hitCanApplyDefenseDamage && !hasIFrames && !Player.creativeGodMode;
|
||||
|
||||
if (hitCanApplyDefenseDamage && !hasIFrames && !Player.creativeGodMode)
|
||||
// 15AUG2024: Ozzatron: External flag which completely disables defense damage. This overrides Bloodflare Core.
|
||||
if (defenseDamageShouldApply && !CalamityMod.ExternalFlag_DisableDefenseDamage)
|
||||
{
|
||||
double halfDefense = Player.statDefense / 2.0;
|
||||
int netMitigation = hurtInfo.SourceDamage - hurtInfo.Damage;
|
||||
@@ -2210,8 +2294,6 @@ namespace CalamityMod.CalPlayer
|
||||
if (evilSmasherBoost > 0)
|
||||
evilSmasherBoost -= 1;
|
||||
|
||||
hellbornBoost = 0;
|
||||
|
||||
if (trinketOfChi)
|
||||
chiBuffTimer = 0;
|
||||
|
||||
@@ -2385,15 +2467,15 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
if (npcDist < range)
|
||||
{
|
||||
float duration = Main.rand.Next(300 + (int)hurtInfo.Damage / 3, 480 + (int)hurtInfo.Damage / 2);
|
||||
npc.AddBuff(BuffID.Confused, (int)duration, false);
|
||||
int duration = Main.rand.Next(300 + hurtInfo.Damage / 3, 480 + hurtInfo.Damage / 2);
|
||||
npc.AddBuff(BuffID.Confused, duration, false);
|
||||
if (amalgam)
|
||||
{
|
||||
npc.AddBuff(BuffID.Venom, (int)duration);
|
||||
npc.AddBuff(ModContent.BuffType<Plague>(), (int)duration);
|
||||
npc.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), (int)duration);
|
||||
npc.AddBuff(ModContent.BuffType<SulphuricPoisoning>(), (int)duration);
|
||||
npc.AddBuff(ModContent.BuffType<Irradiated>(), (int)duration);
|
||||
npc.AddBuff(BuffID.Venom, duration);
|
||||
npc.AddBuff(ModContent.BuffType<Plague>(), duration);
|
||||
npc.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), duration);
|
||||
npc.AddBuff(ModContent.BuffType<SulphuricPoisoning>(), duration);
|
||||
npc.AddBuff(ModContent.BuffType<Irradiated>(), duration);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2459,6 +2541,10 @@ namespace CalamityMod.CalPlayer
|
||||
else
|
||||
Player.immuneTime += iFramesToAdd;
|
||||
|
||||
// Similar handle to 1.4 Star Cloak: these hits ie. spikes or lava cannot activate hit effects
|
||||
if (hurtInfo.CooldownCounter != -1 && hurtInfo.CooldownCounter != 1)
|
||||
return;
|
||||
|
||||
if (aeroSet && hurtInfo.Damage > 25)
|
||||
{
|
||||
// https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list
|
||||
@@ -2508,55 +2594,40 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
if (aSpark)
|
||||
{
|
||||
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<HideofAstrumDeus>()));
|
||||
if (hurtInfo.Damage > 0)
|
||||
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++)
|
||||
{
|
||||
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;
|
||||
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;
|
||||
if (transformer)
|
||||
sDamage += 42;
|
||||
sDamage = (int)Player.GetBestClassDamage().ApplyTo(sDamage);
|
||||
sDamage = Player.ApplyArmorAccDamageBonusesTo(sDamage);
|
||||
|
||||
if (Player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
for (int i = 0; i < (transformer ? 5 : 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<Spark>(), sDamage, 1.25f, Player.whoAmI, 0f, 0f);
|
||||
int spark2 = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType<Spark>(), sDamage, 1.25f, Player.whoAmI, 0f, 0f);
|
||||
if (spark1.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[spark1].timeLeft = 120;
|
||||
Main.projectile[spark1].DamageType = DamageClass.Generic;
|
||||
if (transformer)
|
||||
{
|
||||
Main.projectile[spark1].timeLeft = 240;
|
||||
Main.projectile[spark1].extraUpdates = 1;
|
||||
Main.projectile[spark1].penetrate = 10;
|
||||
}
|
||||
}
|
||||
if (spark2.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[spark2].timeLeft = 120;
|
||||
Main.projectile[spark2].DamageType = DamageClass.Generic;
|
||||
if (transformer)
|
||||
{
|
||||
Main.projectile[spark2].timeLeft = 240;
|
||||
Main.projectile[spark2].extraUpdates = 1;
|
||||
Main.projectile[spark2].penetrate = 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
NanoParticle nano = new(Player.Center, dustVel, new Color(0, 186, 242), 1f, 20, true, true);
|
||||
GeneralParticleHandler.SpawnParticle(nano);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (rBrain)
|
||||
{
|
||||
if (!CalamityUtils.AnyProjectiles(ModContent.ProjectileType<ShadeNimbus>()))
|
||||
{
|
||||
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<RottenBrain>()));
|
||||
int effectStrength = amalgam ? 3 : aBrain ? 2 : 1;
|
||||
int effectDamage = amalgam ? 300 : aBrain ? 50 : 15;
|
||||
effectDamage = (int)Player.GetBestClassDamage().ApplyTo(effectDamage);
|
||||
effectDamage = Player.ApplyArmorAccDamageBonusesTo(effectDamage);
|
||||
|
||||
Vector2 spawnerVelocity = -Vector2.UnitY.RotatedByRandom(MathHelper.Pi / 40f) * 12.5f;
|
||||
Projectile.NewProjectile(source, Player.Center, spawnerVelocity, ModContent.ProjectileType<ShadeNimbusSpawner>(), effectDamage, 0f, Player.whoAmI, 0f, 0f, effectStrength);
|
||||
}
|
||||
}
|
||||
if (inkBomb && !abyssalMirror && !eclipseMirror)
|
||||
{
|
||||
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<Items.Accessories.InkBomb>()));
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
|
||||
//
|
||||
// Calamity debuffs (Vanilla Shadowflame is added here)
|
||||
// Calamity debuffs (Vanilla Shadowflame and Daybroken are added here)
|
||||
//
|
||||
void ApplyDoTDebuff(bool hasDebuff, int negativeLifeRegenToApply, bool immuneCondition = false)
|
||||
{
|
||||
@@ -104,9 +104,12 @@ namespace CalamityMod.CalPlayer
|
||||
int staticDoT = ((Player.controlLeft || Player.controlRight) ? 12 : 3) / (eleResist ? 2 : 1);
|
||||
ApplyDoTDebuff(staticDischarge, staticDoT, purity);
|
||||
ApplyDoTDebuff(bFlames, abaddon ? 10 : 30, purity);
|
||||
ApplyDoTDebuff(daybroken, reducedDaybrokenDamage ? 20 : 40, purity);
|
||||
ApplyDoTDebuff(nightwither, reducedNightwitherDamage ? 20 : 40, purity);
|
||||
ApplyDoTDebuff(hFlames, reducedHolyFlamesDamage ? 20 : 40, purity);
|
||||
ApplyDoTDebuff(hFlames, 40, purity);
|
||||
ApplyDoTDebuff(voidfrost, 40, purity);
|
||||
ApplyDoTDebuff(vHex, 35);
|
||||
ApplyDoTDebuff(trueVHex, 50);
|
||||
ApplyDoTDebuff(cDepth, 18, purity);
|
||||
ApplyDoTDebuff(astralInfection, 24, infectedJewel || purity);
|
||||
ApplyDoTDebuff(pFlames, alchFlask ? 10 : 30, purity);
|
||||
@@ -653,29 +656,12 @@ namespace CalamityMod.CalPlayer
|
||||
if (trinketOfChi || chiRegen)
|
||||
Player.lifeRegen += 2;
|
||||
|
||||
if (ursaSergeant)
|
||||
{
|
||||
if (Player.statLife <= (int)(actualMaxLife * 0.15))
|
||||
{
|
||||
Player.lifeRegen += 3;
|
||||
Player.lifeRegenTime += 3;
|
||||
}
|
||||
else if (Player.statLife <= (int)(actualMaxLife * 0.25))
|
||||
{
|
||||
Player.lifeRegen += 2;
|
||||
Player.lifeRegenTime += 2;
|
||||
}
|
||||
else if (Player.statLife <= (int)(actualMaxLife * 0.5))
|
||||
{
|
||||
Player.lifeRegen += 1;
|
||||
Player.lifeRegenTime += 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Remember this is for 5 seconds after triggering a reflect with a long cooldown
|
||||
if (evolutionLifeRegenCounter > 0)
|
||||
{
|
||||
Player.lifeRegenTime += 2;
|
||||
Player.lifeRegen += 2;
|
||||
Player.lifeRegen += 12;
|
||||
if (Player.lifeRegenTime < 3600f)
|
||||
Player.lifeRegenTime = 3600f;
|
||||
}
|
||||
|
||||
if (darkSunRing)
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace CalamityMod.CalPlayer
|
||||
// Give the player a 24% jump speed boost while wings are equipped, otherwise grant 4% more jump speed so that players can jump 7 tiles high
|
||||
if (Player.wingsLogic > 0)
|
||||
Player.jumpSpeedBoost += 1.2f;
|
||||
else if (CalamityConfig.Instance.FasterJumpSpeed)
|
||||
else if (CalamityServerConfig.Instance.FasterJumpSpeed)
|
||||
Player.jumpSpeedBoost += 0.2f;
|
||||
|
||||
// Decrease the counter on Fearmonger set turbo regeneration
|
||||
@@ -193,13 +193,12 @@ namespace CalamityMod.CalPlayer
|
||||
Player.GetCritChance<RangedDamageClass>() = -spiritOriginConvertedCrit;
|
||||
}
|
||||
|
||||
if (Player.ActiveItem().type == ModContent.ItemType<GaelsGreatsword>())
|
||||
heldGaelsLastFrame = true;
|
||||
|
||||
if (Player.ActiveItem().type != ModContent.ItemType<SaharaSlicers>())
|
||||
saharaSlicersBolts = 0;
|
||||
|
||||
// De-equipping Gael's Greatsword deletes all rage.
|
||||
if (Player.ActiveItem().type == ModContent.ItemType<GaelsGreatsword>())
|
||||
heldGaelsLastFrame = true;
|
||||
else if (heldGaelsLastFrame)
|
||||
{
|
||||
heldGaelsLastFrame = false;
|
||||
@@ -664,7 +663,7 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
// Auric Ore causes an Auric Rejection unless you are wearing Auric Armor
|
||||
// Auric Rejection causes an electrical explosion that yeets the player a considerable distance
|
||||
if ((tile.TileType == auricOreID && !(auricSet || tracersSeraph)) || tile.TileType == auricRepulserID)
|
||||
if ((tile.TileType == auricOreID && !(auricSet || tracersSeraph || Player.creativeGodMode)) || tile.TileType == auricRepulserID)
|
||||
{
|
||||
// Cut grappling hooks so the player is surely thrown
|
||||
Player.RemoveAllGrapplingHooks();
|
||||
@@ -691,18 +690,8 @@ namespace CalamityMod.CalPlayer
|
||||
SoundEngine.PlaySound(explode with { Pitch = 0.8f }, touchedTile.ToWorldCoordinates());
|
||||
GenericSparkle sparker = new GenericSparkle(touchedTile.ToWorldCoordinates(), Vector2.Zero, Color.Goldenrod, Color.Gold, 2.5f, 9, Main.rand.NextFloat(-0.01f, 0.01f), 2.68f);
|
||||
GeneralParticleHandler.SpawnParticle(sparker);
|
||||
//GeneralScreenShakePower = 200;
|
||||
Player.RemoveAllIFrames();
|
||||
Projectile.NewProjectile(new EntitySource_TileInteraction(Player, touchedTile.X, touchedTile.Y), touchedTile.ToWorldCoordinates(), Vector2.Zero, ModContent.ProjectileType<AuricLandMineExplosion>(), 40000, 0f);
|
||||
//for (int i = 0; i < 3; i++)
|
||||
{
|
||||
/* int p = Projectile.NewProjectile(new EntitySource_TileInteraction(Player, touchedTile.X, touchedTile.Y), touchedTile.ToWorldCoordinates(), Vector2.Zero, ModContent.ProjectileType<AresGaussNukeProjectileBoom>(), 0, 0f);
|
||||
Projectile explosion = Main.projectile[p];
|
||||
explosion.ai[1] = 560f + 90f;
|
||||
explosion.localAI[1] = 0.25f;
|
||||
explosion.Opacity = MathHelper.Lerp(0.18f, 0.6f, 0.2f) + Main.rand.NextFloat(-0.08f, 0.08f);
|
||||
explosion.netUpdate = true;*/
|
||||
}
|
||||
WorldGen.KillTile(touchedTile.X, touchedTile.Y, noItem: true);
|
||||
}
|
||||
}
|
||||
@@ -716,11 +705,6 @@ namespace CalamityMod.CalPlayer
|
||||
if (!blazingCursorDamage)
|
||||
return;
|
||||
|
||||
// miscCounter is used to limit Calamity's hit rate.
|
||||
int framesPerHit = 5;
|
||||
if (Player.miscCounter % framesPerHit != 1)
|
||||
return;
|
||||
|
||||
Rectangle sigilHitbox = Utils.CenteredRectangle(Main.MouseWorld, new Vector2(35f, 62f));
|
||||
int sigilDamage = (int)Player.GetBestClassDamage().ApplyTo(Calamity.BaseDamage);
|
||||
sigilDamage = Player.ApplyArmorAccDamageBonusesTo(sigilDamage);
|
||||
@@ -728,9 +712,39 @@ namespace CalamityMod.CalPlayer
|
||||
bool brightenedSigil = false;
|
||||
foreach (NPC target in Main.ActiveNPCs)
|
||||
{
|
||||
if (!target.Hitbox.Intersects(sigilHitbox) || target.immortal || target.dontTakeDamage || target.townNPC || NPCID.Sets.ActsLikeTownNPC[target.type] || NPCID.Sets.CountsAsCritter[target.type])
|
||||
if (!target.Hitbox.Intersects(sigilHitbox) || target.immortal || target.dontTakeDamage || target.friendly || NPCID.Sets.CountsAsCritter[target.type])
|
||||
continue;
|
||||
|
||||
// Increment the cursor focus counter. Note this actually has a net of increasing by 2 per frame, due to the 1 per frame falloff in GlobalNPC.
|
||||
// If this counter reaches 300 (which takes 2.5 seconds without interruptions), True VHex is activated.
|
||||
if (target.Calamity().cursorFocus < CalamityGlobalNPC.cursorFocusMax)
|
||||
{
|
||||
target.Calamity().cursorFocus += 3;
|
||||
|
||||
// Draw an expanding orb effect on the cursor based on the cursor focus value.
|
||||
float cursorFocusRatio = target.Calamity().cursorFocus / (float)CalamityGlobalNPC.cursorFocusMax;
|
||||
StrongBloom indicator = new(Main.MouseWorld, Vector2.Zero, Color.Lerp(Color.Magenta, Color.Red, cursorFocusRatio), cursorFocusRatio * 0.7f, 2);
|
||||
GeneralParticleHandler.SpawnParticle(indicator);
|
||||
|
||||
if (target.Calamity().cursorFocus >= CalamityGlobalNPC.cursorFocusMax)
|
||||
{
|
||||
target.Calamity().trueVulnerabilityHex = target.Calamity().vulnerabilityHex >= 300 ? target.Calamity().vulnerabilityHex : 300;
|
||||
target.Calamity().vulnerabilityHex = 0;
|
||||
SoundEngine.PlaySound(new("CalamityMod/Sounds/Custom/WeaponEnchant"), target.Center);
|
||||
|
||||
for (int i = 0; i < 18; i++)
|
||||
{
|
||||
Vector2 orbVel = new Vector2(15, 15).RotatedByRandom(MathHelper.Pi) * Main.rand.NextFloat(0.33f, 1f);
|
||||
GlowOrbParticle orb = new(target.Center + orbVel, orbVel, false, 60, Main.rand.NextFloat(0.95f, 1.75f), Color.Lerp(Color.Red, Color.Magenta, 0.3f));
|
||||
GeneralParticleHandler.SpawnParticle(orb);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// miscCounter is used to limit Calamity's hit rate.
|
||||
if (Player.miscCounter % Calamity.FramesPerHit != 1)
|
||||
return;
|
||||
|
||||
// Brighten the sigil because it is dealing damage. This can only happen once per hit event.
|
||||
if (!brightenedSigil)
|
||||
{
|
||||
@@ -740,13 +754,15 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
// Create a direct strike to hit this specific NPC.
|
||||
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<Calamity>()));
|
||||
Projectile sigilStrike = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), sigilDamage, 0f, Player.whoAmI, target.whoAmI);
|
||||
Projectile sigilStrike = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), sigilDamage, 0f, Player.whoAmI, target.whoAmI, 1f);
|
||||
|
||||
// Enable crits by setting the sigil's damage class to be whatever the player's strongest damage class is.
|
||||
sigilStrike.DamageType = Player.GetBestClass();
|
||||
|
||||
// Incinerate the target with Vulnerability Hex.
|
||||
target.AddBuff(ModContent.BuffType<VulnerabilityHex>(), VulnerabilityHex.CalamityDuration);
|
||||
// Incinerate the target with either Vulnerability Hex or True Vulnerability Hex, depending on current cursor focus.
|
||||
// This adds 8 to the buff duration, which results in a net increase of 3 frames every time damage is dealt, due to damage occurring every 5 frames.
|
||||
int buffToInflict = target.Calamity().trueVulnerabilityHex > 0 ? ModContent.BuffType<TrueVulnerabilityHex>() : ModContent.BuffType<VulnerabilityHex>();
|
||||
target.AddBuff(buffToInflict, target.Calamity().trueVulnerabilityHex > 0 ? target.Calamity().trueVulnerabilityHex + 8 : target.Calamity().vulnerabilityHex < VulnerabilityHex.CalamityDuration ? VulnerabilityHex.CalamityDuration : target.Calamity().vulnerabilityHex + 8);
|
||||
|
||||
// Make some fancy dust to indicate damage is being done.
|
||||
for (int j = 0; j < 12; j++)
|
||||
@@ -985,7 +1001,7 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
Player.buffImmune[ModContent.BuffType<FrozenLungs>()] = true;
|
||||
}
|
||||
if (CalamityConfig.Instance.ChilledWaterRework)
|
||||
if (CalamityServerConfig.Instance.ChilledWaterRework)
|
||||
{
|
||||
if (Main.expertMode && Player.ZoneSnow && Player.wet && !Player.lavaWet && !Player.honeyWet)
|
||||
{
|
||||
@@ -1108,7 +1124,7 @@ namespace CalamityMod.CalPlayer
|
||||
Player.noFallDmg = true;
|
||||
}
|
||||
|
||||
if (CalamityConfig.Instance.FasterFallHotkey)
|
||||
if (CalamityClientConfig.Instance.FasterFallHotkey)
|
||||
{
|
||||
// Allow the player to double their gravity (but NOT max fall speed!) by holding the down button while in midair.
|
||||
bool holdingDown = Player.controlDown && !Player.controlJump;
|
||||
@@ -1138,7 +1154,7 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
|
||||
// Increase Rope climb velocities, if enabled
|
||||
if (CalamityConfig.Instance.FasterRopeClimbSpeed)
|
||||
if (CalamityServerConfig.Instance.FasterRopeClimbSpeed)
|
||||
{
|
||||
if (Player.pulley)
|
||||
{
|
||||
@@ -1424,6 +1440,8 @@ namespace CalamityMod.CalPlayer
|
||||
Player.buffImmune[ModContent.BuffType<GlacialState>()] = true;
|
||||
}
|
||||
|
||||
if (arsenalCooldown > 0)
|
||||
arsenalCooldown--;
|
||||
if (ascendantInsigniaCooldown > 0 && ascendantInsigniaBuffTime <= 0)
|
||||
ascendantInsigniaCooldown--;
|
||||
if (DragonsBreathAudioCooldown > 0)
|
||||
@@ -1456,14 +1474,16 @@ namespace CalamityMod.CalPlayer
|
||||
soundCooldown--;
|
||||
if (shadowPotCooldown > 0)
|
||||
shadowPotCooldown--;
|
||||
if (raiderCritBonus > 0f)
|
||||
raiderCritBonus -= RaidersTalisman.RaiderBonus / (float)CalamityUtils.SecondsToFrames(RaidersTalisman.RaiderCooldown);
|
||||
if (raiderCritLifespan > 0f)
|
||||
raiderCritLifespan--;
|
||||
if (raiderSoundCooldown > 0)
|
||||
raiderSoundCooldown--;
|
||||
if (astralStarRainCooldown > 0)
|
||||
astralStarRainCooldown--;
|
||||
if (AbaddonCooldown > 0)
|
||||
AbaddonCooldown--;
|
||||
if (ursaSergeantCooldown > 0)
|
||||
ursaSergeantCooldown--;
|
||||
if (AlchFlaskCooldown > 0)
|
||||
AlchFlaskCooldown--;
|
||||
if (tarraRangedCooldown > 0)
|
||||
@@ -1522,8 +1542,17 @@ namespace CalamityMod.CalPlayer
|
||||
hideOfDeusTimer--;
|
||||
if (murasamaHitCooldown > 0)
|
||||
murasamaHitCooldown--;
|
||||
if (hellbornBoost > 0)
|
||||
hellbornBoost--;
|
||||
if (burningSeaBurnOut > 0)
|
||||
{
|
||||
burningSeaBurnOut--;
|
||||
if (Main.rand.NextBool())
|
||||
{
|
||||
Vector2 dustSpawnPos = Player.position + new Vector2(Main.rand.NextFloat(Player.width), 0f);
|
||||
Vector2 dustVelocity = -Vector2.UnitY * Main.rand.NextFloat(3f, 6f);
|
||||
Dust burnOutDust = Dust.NewDustPerfect(dustSpawnPos, (int)CalamityDusts.Brimstone, dustVelocity);
|
||||
burnOutDust.noGravity = true;
|
||||
}
|
||||
}
|
||||
if (persecutedEnchantSummonTimer < 1800)
|
||||
persecutedEnchantSummonTimer++;
|
||||
else
|
||||
@@ -1578,6 +1607,9 @@ namespace CalamityMod.CalPlayer
|
||||
FlameLickedShell.HandleParryCountdown(Player);
|
||||
}
|
||||
|
||||
if (!flameLickedShell && flameLickedShellParry > 0)
|
||||
flameLickedShellParry--;
|
||||
|
||||
// Silver Armor "Medkit" effect
|
||||
if (silverMedkitTimer > 0)
|
||||
{
|
||||
@@ -1699,7 +1731,10 @@ namespace CalamityMod.CalPlayer
|
||||
Player.statLife = upperHealthLimit;
|
||||
|
||||
if (necroReviveCounter >= NecroArmorSetChange.PostMortemDuration * 60)
|
||||
{
|
||||
Player.KillMe(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.NecroRevive").Format(Player.name)), 1000, -1);
|
||||
necroReviveCounter = -1;
|
||||
}
|
||||
else if (necroReviveCounter % 60 == 59)
|
||||
SoundEngine.PlaySound(NecroArmorSetChange.TimerSound, Player.Center);
|
||||
}
|
||||
@@ -1836,8 +1871,8 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
|
||||
// Raider Talisman bonus
|
||||
if (raiderTalisman && !StealthStrikeAvailable())
|
||||
Player.GetCritChance<ThrowingDamageClass>() += raiderCritBonus;
|
||||
if (raiderTalisman && !StealthStrikeAvailable() && raiderCritLifespan > 0f)
|
||||
Player.GetCritChance<ThrowingDamageClass>() += RaidersTalisman.RaiderBonus;
|
||||
|
||||
if (kamiBoost)
|
||||
Player.GetDamage<GenericDamageClass>() += 0.15f;
|
||||
@@ -2274,11 +2309,12 @@ namespace CalamityMod.CalPlayer
|
||||
double breathLossMult = 1D -
|
||||
(Player.gills ? 0.2 : 0D) - // 0.8
|
||||
(oceanCrest ? 0.2 : 0D) - // 0.8
|
||||
(victideSet ? 0.2 : 0D) - // 0.8
|
||||
(Player.accDivingHelm ? 0.25 : 0D) - // 0.75
|
||||
(Player.arcticDivingGear ? 0.25 : 0D) - // 0.75
|
||||
(aquaticEmblem ? 0.25 : 0D) - // 0.75
|
||||
(Player.accMerman ? 0.3 : 0D) - // 0.7
|
||||
(victideSet ? 0.2 : 0D) - // 0.85
|
||||
(reaverExplore ? 0.3 : 0D) - // 0.7
|
||||
((aquaticHeart && NPC.downedBoss3) ? 0.3 : 0D) - // 0.7
|
||||
(abyssalDivingSuit ? 0.3 : 0D); // 0.7
|
||||
|
||||
@@ -2366,7 +2402,7 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
// Reduce breath
|
||||
if (Player.breath > 0)
|
||||
Player.breath -= (int)(cDepth ? breathLoss + 1D : breathLoss);
|
||||
Player.breath -= (int)(cDepth && !depthCharm ? breathLoss + 1D : breathLoss);
|
||||
}
|
||||
|
||||
// If breath is greater than 0 and player has gills or is merfolk, balance out the effects by reducing breath
|
||||
@@ -2693,7 +2729,7 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
Player.statDefense += 30;
|
||||
Player.endurance += 0.1f;
|
||||
Player.GetDamage<MeleeDamageClass>() += 0.2f;
|
||||
Player.GetDamage<GenericDamageClass>() += 0.15f;
|
||||
}
|
||||
|
||||
if (brutalCarnage)
|
||||
@@ -2816,7 +2852,7 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
// 50% movement speed bonus so that you don't feel like a snail in the early game
|
||||
// Disabled while Overhaul is enabled, because Overhaul does very similar things to make movement more snappy
|
||||
if (CalamityMod.Instance.overhaul is null && CalamityConfig.Instance.FasterBaseSpeed)
|
||||
if (CalamityMod.Instance.overhaul is null && CalamityServerConfig.Instance.FasterBaseSpeed)
|
||||
Player.moveSpeed += BalancingConstants.DefaultMoveSpeedBoost;
|
||||
|
||||
// Reduce how slow Chilled makes the player, because it's cancerous right now
|
||||
@@ -2919,7 +2955,7 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
if (giantPearl)
|
||||
{
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient && !areThereAnyDamnBosses)
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
foreach (NPC npc in Main.ActiveNPCs)
|
||||
{
|
||||
@@ -3001,15 +3037,8 @@ namespace CalamityMod.CalPlayer
|
||||
Player.wingTimeMax = (int)(Player.wingTimeMax * flightTimeMult);
|
||||
|
||||
if (vHex)
|
||||
{
|
||||
Player.statDefense -= 20;
|
||||
|
||||
if (Player.wingTimeMax < 0)
|
||||
Player.wingTimeMax = 0;
|
||||
|
||||
Player.wingTimeMax = (int)(Player.wingTimeMax * 0.75);
|
||||
}
|
||||
|
||||
if (icarusFolly)
|
||||
{
|
||||
if (Player.wingTimeMax < 0)
|
||||
@@ -3040,7 +3069,11 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
|
||||
if (mushy)
|
||||
Player.statDefense += 6;
|
||||
{
|
||||
Player.statDefense += 8;
|
||||
if (fungalSymbiote)
|
||||
Player.GetDamage<GenericDamageClass>() += 0.1f;
|
||||
}
|
||||
|
||||
if (omniscience)
|
||||
{
|
||||
@@ -3125,14 +3158,6 @@ namespace CalamityMod.CalPlayer
|
||||
if (manaOverloader)
|
||||
Player.GetDamage<MagicDamageClass>() += 0.06f;
|
||||
|
||||
if (rBrain)
|
||||
{
|
||||
if (Player.statLife <= (int)(Player.statLifeMax2 * 0.75))
|
||||
Player.GetDamage<GenericDamageClass>() += 0.1f;
|
||||
if (Player.statLife <= (int)(Player.statLifeMax2 * 0.5))
|
||||
Player.moveSpeed -= 0.05f;
|
||||
}
|
||||
|
||||
if (bloodyWormTooth)
|
||||
{
|
||||
Player.GetDamage<MeleeDamageClass>() += 0.1f;
|
||||
@@ -3224,6 +3249,25 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
}
|
||||
|
||||
if (silvaSummon && Player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
var source = Player.GetSource_FromThis(SilvaHeadSummon.SilvaCrystalEntitySourceContext);
|
||||
if (Player.FindBuffIndex(ModContent.BuffType<SilvaCrystalBuff>()) == -1)
|
||||
{
|
||||
Player.AddBuff(ModContent.BuffType<SilvaCrystalBuff>(), 3600, true);
|
||||
}
|
||||
if (Player.ownedProjectileCounts[ModContent.ProjectileType<SilvaCrystal>()] < 1)
|
||||
{
|
||||
// 08DEC2023: Ozzatron: Silva Crystals spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care.
|
||||
int baseDamage = Player.ApplyArmorAccDamageBonusesTo(600);
|
||||
var damage = (int)Player.GetTotalDamage<SummonDamageClass>().ApplyTo(baseDamage);
|
||||
|
||||
var p = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, 0f, -1f, ModContent.ProjectileType<SilvaCrystal>(), damage, 0f, Main.myPlayer, -20f, 0f);
|
||||
if (Main.projectile.IndexInRange(p))
|
||||
Main.projectile[p].originalDamage = baseDamage;
|
||||
}
|
||||
}
|
||||
|
||||
if (ascendantInsignia && ascendantInsigniaBuffTime > 0)
|
||||
{
|
||||
ascendantTrail = true;
|
||||
@@ -3239,9 +3283,6 @@ namespace CalamityMod.CalPlayer
|
||||
Player.moveSpeed -= moveSpeedLoss;
|
||||
}
|
||||
|
||||
if (ursaSergeant)
|
||||
Player.moveSpeed -= 0.15f;
|
||||
|
||||
if (godSlayerThrowing)
|
||||
{
|
||||
if (Player.statLife >= Player.statLifeMax2)
|
||||
@@ -3309,13 +3350,9 @@ namespace CalamityMod.CalPlayer
|
||||
if (Main.rand.NextBool(10))
|
||||
{
|
||||
Vector2 velocity = CalamityUtils.RandomVelocity(50f, 30f, 60f);
|
||||
int spark = Projectile.NewProjectile(source, npc.Center, velocity, ModContent.ProjectileType<EutrophicSpark>(), damage / 2, 0f, Player.whoAmI);
|
||||
if (spark.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[spark].DamageType = DamageClass.Generic;
|
||||
Main.projectile[spark].localNPCHitCooldown = -2;
|
||||
Main.projectile[spark].penetrate = 5;
|
||||
}
|
||||
Projectile spark = Projectile.NewProjectileDirect(source, npc.Center, velocity, ModContent.ProjectileType<GenericElectricSpark>(), damage / 2, 0f, Player.whoAmI);
|
||||
spark.localNPCHitCooldown = -2;
|
||||
spark.timeLeft = 30;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3431,7 +3468,6 @@ namespace CalamityMod.CalPlayer
|
||||
Player.lavaImmune = true;
|
||||
Player.fireWalk = true;
|
||||
Player.buffImmune[ModContent.BuffType<HolyFlames>()] = Main.dayTime || empowered;
|
||||
Player.buffImmune[ModContent.BuffType<Nightwither>()] = !Main.dayTime || empowered;
|
||||
Player.buffImmune[BuffID.OnFire] = true;
|
||||
Player.buffImmune[BuffID.Burning] = true;
|
||||
Player.buffImmune[BuffID.Daybreak] = true;
|
||||
@@ -3528,11 +3564,24 @@ namespace CalamityMod.CalPlayer
|
||||
if (check)
|
||||
{
|
||||
// https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list
|
||||
var source = Player.GetSource_Buff(Player.FindBuffIndex(ModContent.BuffType<TeslaBuff>()));
|
||||
int damage = (int)Player.GetBestClassDamage().ApplyTo(10);
|
||||
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<TeslasAmulet>()));
|
||||
int damage = (int)Player.GetBestClassDamage().ApplyTo(12);
|
||||
if (Player.ownedProjectileCounts[ModContent.ProjectileType<TeslaAura>()] < 1)
|
||||
Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType<TeslaAura>(), damage, 0f, Player.whoAmI);
|
||||
}
|
||||
|
||||
// Reduce duration of Static Discharge
|
||||
for (int l = 0; l < Player.MaxBuffs; l++)
|
||||
{
|
||||
if (Player.buffType[l] == ModContent.BuffType<StaticDischarge>())
|
||||
{
|
||||
if (Player.buffTime[l] > 2)
|
||||
{
|
||||
Player.buffTime[l]--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (Player.ownedProjectileCounts[ModContent.ProjectileType<TeslaAura>()] > 0)
|
||||
@@ -4250,13 +4299,13 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
if (startMessageDisplayDelay == 0)
|
||||
{
|
||||
if (CalamityConfig.Instance.WikiStatusMessage)
|
||||
if (CalamityClientConfig.Instance.WikiStatusMessage)
|
||||
{
|
||||
CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Misc.WikiStatus1");
|
||||
CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Misc.WikiStatus2");
|
||||
}
|
||||
|
||||
if (CalamityConfig.Instance.VCMMStatusMessage && !CalamityMod.Instance.VCMMAvailable)
|
||||
if (CalamityClientConfig.Instance.VCMMStatusMessage && !CalamityMod.Instance.VCMMAvailable)
|
||||
{
|
||||
CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Misc.VCMMStatus");
|
||||
}
|
||||
|
||||
@@ -7,9 +7,7 @@ using CalamityMod.Buffs.StatBuffs;
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Cooldowns;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.EntitySources;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Armor.Prismatic;
|
||||
using CalamityMod.Items.Armor.Reaver;
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using CalamityMod.Items.VanillaArmorChanges;
|
||||
@@ -27,7 +25,6 @@ using CalamityMod.Projectiles.Summon;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using CalamityMod.Systems;
|
||||
using Microsoft.Xna.Framework;
|
||||
using MonoMod.Cil;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ID;
|
||||
@@ -59,9 +56,10 @@ namespace CalamityMod.CalPlayer
|
||||
return;
|
||||
|
||||
// Handle on-hit melee effects for the gem tech armor set.
|
||||
GemTechState.MeleeOnHitEffects(target);
|
||||
if (item.CountsAsClass<MeleeDamageClass>())
|
||||
GemTechState.MeleeOnHitEffects(target);
|
||||
|
||||
// Handle on-hit melee effects for the mythril armor set.
|
||||
// Handle on-hit melee effects for the mythril armor set. (all class inclusive)
|
||||
MythrilArmorSetChange.OnHitEffects(target, damageDone, Player);
|
||||
|
||||
if (witheringWeaponEnchant)
|
||||
@@ -71,6 +69,7 @@ namespace CalamityMod.CalPlayer
|
||||
target.AddBuff(BuffType<VulnerabilityHex>(), VulnerabilityHex.AflameDuration);
|
||||
|
||||
target.Calamity().IncreasedColdEffects_EskimoSet = eskimoSet;
|
||||
target.Calamity().IncreasedColdEffects_FrozenWings = frozenWingsCold;
|
||||
target.Calamity().IncreasedColdEffects_CryoStone = CryoStone;
|
||||
|
||||
target.Calamity().IncreasedElectricityEffects_Transformer = transformer;
|
||||
@@ -181,6 +180,10 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
if (rageModeActive && shatteredCommunity)
|
||||
Player.GetModPlayer<ShatteredCommunityPlayer>().AccumulateRageDamage(damageDone);
|
||||
|
||||
// Ursa Sergeant slash cooldown is reset on kill
|
||||
if (ursaSergeant && target.life <= 0 && target.realLife == -1)
|
||||
ursaSergeantCooldown = (int)MathHelper.Clamp(ursaSergeantCooldown - 180, 0, 300);
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -197,17 +200,18 @@ namespace CalamityMod.CalPlayer
|
||||
GemTechState.MeleeOnHitEffects(target);
|
||||
|
||||
// Handle on-hit ranged effects for the gem tech armor set.
|
||||
if (proj.CountsAsClass<RangedDamageClass>() && proj.type != ModContent.ProjectileType<GemTechGreenFlechette>())
|
||||
if (proj.CountsAsClass<RangedDamageClass>() && proj.type != ProjectileType<GemTechGreenFlechette>())
|
||||
GemTechState.RangedOnHitEffects(target, proj.damage);
|
||||
|
||||
// Handle on-hit projectiles effects for the mythril armor set.
|
||||
if (proj.type != ModContent.ProjectileType<MythrilFlare>())
|
||||
if (proj.type != ProjectileType<MythrilFlare>())
|
||||
MythrilArmorSetChange.OnHitEffects(target, damageDone, Player);
|
||||
|
||||
if (witheringWeaponEnchant)
|
||||
witheringDamageDone += (int)(damageDone * (hit.Crit ? 2D : 1D));
|
||||
|
||||
cgn.IncreasedColdEffects_EskimoSet = eskimoSet;
|
||||
cgn.IncreasedColdEffects_FrozenWings = frozenWingsCold;
|
||||
cgn.IncreasedColdEffects_CryoStone = CryoStone;
|
||||
|
||||
cgn.IncreasedElectricityEffects_Transformer = transformer;
|
||||
@@ -286,6 +290,10 @@ namespace CalamityMod.CalPlayer
|
||||
target.AddBuff(BuffType<WhisperingDeath>(), 60);
|
||||
break;
|
||||
|
||||
case ProjectileID.LunarFlare:
|
||||
target.AddBuff(BuffType<Nightwither>(), 180);
|
||||
break;
|
||||
|
||||
case ProjectileID.Cascade:
|
||||
target.AddBuff(BuffID.OnFire, 60);
|
||||
break;
|
||||
@@ -338,6 +346,10 @@ namespace CalamityMod.CalPlayer
|
||||
target.AddBuff(BuffID.OnFire3, 120);
|
||||
}
|
||||
|
||||
// Ursa Sergeant slash cooldown is reset on kill
|
||||
if (ursaSergeant && target.life <= 0 && target.realLife == -1)
|
||||
ursaSergeantCooldown = (int)MathHelper.Clamp(ursaSergeantCooldown - 180, 0, 300);
|
||||
|
||||
if (!proj.npcProj && !proj.trap && proj.friendly)
|
||||
{
|
||||
if ((plaguebringerCarapace || uberBees) && CalamityLists.friendlyBeeList.Contains(proj.type))
|
||||
@@ -487,7 +499,7 @@ namespace CalamityMod.CalPlayer
|
||||
if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
|
||||
return;
|
||||
|
||||
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Main.player[proj.owner], heal, ModContent.ProjectileType<AltTransfusionTrail>(), BalancingConstants.LifeStealRange);
|
||||
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Main.player[proj.owner], heal, ProjectileType<AltTransfusionTrail>(), BalancingConstants.LifeStealRange);
|
||||
}
|
||||
|
||||
if ((cgp.betterLifeBullet1 || cgp.betterLifeBullet2) && proj.numHits == 0)
|
||||
@@ -509,7 +521,7 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
for (int i = 0; i <= 2; i++)
|
||||
{
|
||||
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Main.player[proj.owner], heal, ModContent.ProjectileType<AltTransfusionTrail>(), BalancingConstants.LifeStealRange);
|
||||
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Main.player[proj.owner], heal, ProjectileType<AltTransfusionTrail>(), BalancingConstants.LifeStealRange);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -615,13 +627,13 @@ namespace CalamityMod.CalPlayer
|
||||
if (!proj.CountsAsClass<MeleeDamageClass>() && !proj.CountsAsClass<SummonMeleeSpeedDamageClass>() && Player.meleeEnchant == 7)
|
||||
Projectile.NewProjectile(source, position, proj.velocity, ProjectileID.ConfettiMelee, 0, 0f, proj.owner);
|
||||
|
||||
if (alchFlask && AlchFlaskCooldown == 0 && proj.type != ModContent.ProjectileType<BasicPlagueBee>())
|
||||
if (alchFlask && AlchFlaskCooldown == 0 && proj.type != ProjectileType<BasicPlagueBee>())
|
||||
{
|
||||
int seekerDamage = (int)Player.GetBestClassDamage().ApplyTo(10);
|
||||
seekerDamage = Player.ApplyArmorAccDamageBonusesTo(seekerDamage);
|
||||
Vector2 seekerVelocity = new Vector2(5, 5).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1.2f);
|
||||
|
||||
Projectile bee = Projectile.NewProjectileDirect(source, position, seekerVelocity, ModContent.ProjectileType<BasicPlagueBee>(), seekerDamage, 0f, Player.whoAmI, -20, 30, 2);
|
||||
Projectile bee = Projectile.NewProjectileDirect(source, position, seekerVelocity, ProjectileType<BasicPlagueBee>(), seekerDamage, 0f, Player.whoAmI, -20, 30, 2);
|
||||
bee.ArmorPenetration = 20;
|
||||
bee.penetrate = 2;
|
||||
bee.extraUpdates = 1;
|
||||
@@ -664,7 +676,17 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
AbaddonCooldown = 15;
|
||||
int AbaddonExploDamage = CalamityUtils.DamageSoftCap(proj.damage * 0.03f, 25);
|
||||
Projectile.NewProjectile(source, position, Vector2.Zero, ModContent.ProjectileType<AbaddonCrit>(), AbaddonExploDamage, 0f, Player.whoAmI);
|
||||
Projectile.NewProjectile(source, position, Vector2.Zero, ProjectileType<AbaddonCrit>(), AbaddonExploDamage, 0f, Player.whoAmI);
|
||||
}
|
||||
|
||||
if (ursaSergeant && ursaSergeantCooldown <= 0)
|
||||
{
|
||||
ursaSergeantCooldown = 300;
|
||||
|
||||
int ursaSlashdamage = (int)Player.GetBestClassDamage().ApplyTo(333);
|
||||
ursaSlashdamage = Player.ApplyArmorAccDamageBonusesTo(ursaSlashdamage);
|
||||
|
||||
Projectile.NewProjectile(source, position, Vector2.Zero, ProjectileType<UrsaSlash>(), ursaSlashdamage, 0f, Player.whoAmI);
|
||||
}
|
||||
|
||||
if (proj.CountsAsClass<MeleeDamageClass>())
|
||||
@@ -787,7 +809,7 @@ namespace CalamityMod.CalPlayer
|
||||
// Bloodflare Mage Explosion: 50%, softcap starts at 500 base damage to not overly punish slow weapons
|
||||
int bloodflareFireballDamage = Player.ApplyArmorAccDamageBonusesTo(CalamityUtils.DamageSoftCap(proj.damage * 0.5, 250));
|
||||
|
||||
int fire = Projectile.NewProjectile(source, position, Vector2.Zero, ModContent.ProjectileType<BloodBombExplosion>(), bloodflareFireballDamage, 0f, Player.whoAmI, 0f, 0f, 1f);
|
||||
int fire = Projectile.NewProjectile(source, position, Vector2.Zero, ProjectileType<BloodBombExplosion>(), bloodflareFireballDamage, 0f, Player.whoAmI, 0f, 0f, 1f);
|
||||
if (fire.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[fire].DamageType = DamageClass.Generic;
|
||||
@@ -1075,11 +1097,11 @@ namespace CalamityMod.CalPlayer
|
||||
int damage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(40);
|
||||
damage = Player.ApplyArmorAccDamageBonusesTo(damage);
|
||||
|
||||
Projectile.NewProjectile(spawnSource, proj.Center, Vector2.Zero, ProjectileType<SabatonBoom>(), damage, proj.knockBack, proj.owner, 1f, 0f);
|
||||
Projectile.NewProjectile(spawnSource, proj.Center, Vector2.Zero, ProjectileType<TitanHeartBoom>(), damage, proj.knockBack, proj.owner, 1f, 0f);
|
||||
SoundEngine.PlaySound(SoundID.Item14, proj.Center);
|
||||
for (int dustexplode = 0; dustexplode < 360; dustexplode++)
|
||||
for (int dustexplode = 0; dustexplode < 180; dustexplode++)
|
||||
{
|
||||
Vector2 dustd = new Vector2(17f, 17f).RotatedBy(MathHelper.ToRadians(dustexplode));
|
||||
Vector2 dustd = new Vector2(17f, 17f).RotatedBy(MathHelper.ToRadians(dustexplode * 2));
|
||||
int d = Dust.NewDust(proj.Center, proj.width, proj.height, Main.rand.NextBool() ? DustType<AstralBlue>() : DustType<AstralOrange>(), dustd.X, dustd.Y, 100, default, 1f);
|
||||
Main.dust[d].noGravity = true;
|
||||
Main.dust[d].position = proj.Center;
|
||||
@@ -1134,7 +1156,7 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
if (raiderTalisman && modProj.stealthStrike)
|
||||
{
|
||||
raiderCritBonus = RaidersTalisman.RaiderBonus;
|
||||
raiderCritLifespan = CalamityUtils.SecondsToFrames(RaidersTalisman.RaiderCooldown);
|
||||
if (raiderSoundCooldown <= 0)
|
||||
{
|
||||
SoundEngine.PlaySound(RaidersTalisman.StealthHitSound, Player.Center);
|
||||
@@ -1182,7 +1204,7 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
if (eGauntlet)
|
||||
{
|
||||
CalamityUtils.Inflict246DebuffsNPC(target, ModContent.BuffType<ElementalMix>());
|
||||
CalamityUtils.Inflict246DebuffsNPC(target, BuffType<ElementalMix>());
|
||||
}
|
||||
if (ataxiaFire)
|
||||
{
|
||||
@@ -1244,13 +1266,9 @@ namespace CalamityMod.CalPlayer
|
||||
if (pSoulArtifact && !profanedCrystal)
|
||||
target.AddBuff(BuffType<HolyFlames>(), 300);
|
||||
|
||||
if (profanedCrystalBuffs)
|
||||
if (profanedCrystal && (DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs))
|
||||
{
|
||||
bool empowered = pscState == (int)ProfanedSoulCrystal.ProfanedSoulCrystalState.Empowered;
|
||||
if (empowered || Main.dayTime)
|
||||
target.AddBuff(BuffType<HolyFlames>(), 600);
|
||||
if (empowered || !Main.dayTime)
|
||||
target.AddBuff(BuffType<Nightwither>(), 600);
|
||||
target.AddBuff(BuffType<HolyFlames>(), 600);
|
||||
}
|
||||
|
||||
if (divineBless)
|
||||
@@ -1265,7 +1283,7 @@ namespace CalamityMod.CalPlayer
|
||||
//20% chance for Voltaic Jelly
|
||||
if (Main.rand.NextBool(starTaintedGenerator ? 1 : 5))
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<StaticDischarge>(), 60);
|
||||
target.AddBuff(BuffType<StaticDischarge>(), 60);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1283,6 +1301,11 @@ namespace CalamityMod.CalPlayer
|
||||
target.AddBuff(BuffType<CrushDepth>(), 180);
|
||||
if (sulphurSet)
|
||||
target.AddBuff(BuffID.Poisoned, 60);
|
||||
if (aSpark && Player.IsUnderwater())
|
||||
{
|
||||
int duration = transformer ? 120 : 60;
|
||||
target.AddBuff(BuffType<StaticDischarge>(), duration);
|
||||
}
|
||||
if (abyssalAmulet)
|
||||
{
|
||||
CalamityUtils.Inflict246DebuffsNPC(target, BuffType<RiptideDebuff>());
|
||||
@@ -1324,7 +1347,7 @@ namespace CalamityMod.CalPlayer
|
||||
if (gladiatorSword && target.IsAnEnemy(false) && target.life <= 0 && target.Calamity().gladiatorOnKill && target.lifeMax > 5)
|
||||
{
|
||||
target.Calamity().gladiatorOnKill = false;
|
||||
Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center.X, target.Center.Y, target.velocity.X / 2, target.velocity.Y / 2, ModContent.ProjectileType<GladiatorHealOrb>(), 0, 0f);
|
||||
Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center.X, target.Center.Y, target.velocity.X / 2, target.velocity.Y / 2, ProjectileType<GladiatorHealOrb>(), 0, 0f);
|
||||
}
|
||||
|
||||
if (Main.player[Main.myPlayer].lifeSteal > 0f && !Player.moonLeech && target.lifeMax > 5)
|
||||
@@ -1490,7 +1513,7 @@ namespace CalamityMod.CalPlayer
|
||||
if (gladiatorSword && target.IsAnEnemy(false) && target.life <= 0 && target.Calamity().gladiatorOnKill && target.lifeMax > 5)
|
||||
{
|
||||
target.Calamity().gladiatorOnKill = false;
|
||||
Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, target.velocity * 0.5f, ModContent.ProjectileType<GladiatorHealOrb>(), 0, 0f);
|
||||
Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, target.velocity * 0.5f, ProjectileType<GladiatorHealOrb>(), 0, 0f);
|
||||
}
|
||||
|
||||
if (reaverDefense)
|
||||
|
||||
@@ -23,9 +23,6 @@ namespace CalamityMod.CalPlayer.DrawLayers
|
||||
if (drawPlayer.armor[10].type > ItemID.None)
|
||||
headItem = drawPlayer.armor[10];
|
||||
|
||||
if (drawPlayer.Calamity().cocosFeather)
|
||||
headItem = new Item(ModContent.ItemType<CocosFeather>());
|
||||
|
||||
if (ModContent.GetModItem(headItem.type) is IExtendedHat extendedHatDrawer)
|
||||
{
|
||||
string equipSlotName = extendedHatDrawer.EquipSlotName(drawPlayer) != "" ? extendedHatDrawer.EquipSlotName(drawPlayer) : headItem.ModItem.Name;
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace CalamityMod.CalPlayer.DrawLayers
|
||||
else if (itemType == ModContent.ItemType<SoulPiercer>())
|
||||
glowMask = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Magic/SoulPiercerGlow").Value;
|
||||
else if (itemType == ModContent.ItemType<SubsumingVortex>())
|
||||
glowMask = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Magic/SubsumingVortexGlow").Value;
|
||||
glowMask = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Magic/SubsumingVortexSmallGlow").Value;
|
||||
else if (itemType == ModContent.ItemType<TerrorBlade>())
|
||||
glowMask = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Melee/TerrorBladeGlow").Value;
|
||||
else if (itemType == ModContent.ItemType<TheEnforcer>())
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace CalamityMod
|
||||
// Config based conditions
|
||||
//
|
||||
|
||||
public static readonly Condition PotionSellingConfig = Create("PotionConfig", () => CalamityConfig.Instance.PotionSelling);
|
||||
public static readonly Condition PotionSellingConfig = Create("PotionConfig", () => CalamityServerConfig.Instance.PotionSelling);
|
||||
|
||||
//
|
||||
// Player conditions
|
||||
|
||||
@@ -5,25 +5,22 @@ using CalamityMod.UI.DraedonsArsenal;
|
||||
using CalamityMod.UI.Rippers;
|
||||
using CalamityMod.UI.SulphurousWaterMeter;
|
||||
using Terraria;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader.Config;
|
||||
|
||||
namespace CalamityMod
|
||||
{
|
||||
[BackgroundColor(49, 32, 36, 216)]
|
||||
public class CalamityConfig : ModConfig
|
||||
public class CalamityClientConfig : ModConfig
|
||||
{
|
||||
public static CalamityConfig Instance;
|
||||
public static CalamityClientConfig Instance;
|
||||
|
||||
// TODO -- Not all Calamity config settings should be considered client side.
|
||||
// There are many configs which are server side and should stay that way.
|
||||
public override ConfigScope Mode => ConfigScope.ClientSide;
|
||||
public override bool AcceptClientChanges(ModConfig pendingConfig, int whoAmI, ref string message) => true;
|
||||
|
||||
// Clamps values that would cause ugly problems if loaded directly without sanitization.
|
||||
[OnDeserialized]
|
||||
internal void ClampValues(StreamingContext context)
|
||||
{
|
||||
BossHealthBoost = Utils.Clamp(BossHealthBoost, MinBossHealthBoost, MaxBossHealthBoost);
|
||||
RipperMeterShake = Utils.Clamp(RipperMeterShake, MinMeterShake, MaxMeterShake);
|
||||
ParticleLimit = (int)Utils.Clamp(ParticleLimit, MinParticleLimit, MaxParticleLimit);
|
||||
}
|
||||
@@ -48,10 +45,6 @@ namespace CalamityMod
|
||||
[DefaultValue(5000)]
|
||||
public int ParticleLimit { get; set; }
|
||||
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[DefaultValue(false)]
|
||||
public bool BossesStopWeather { get; set; }
|
||||
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[SliderColor(224, 165, 56, 128)]
|
||||
[Range(0f, 10f)]
|
||||
@@ -106,6 +99,33 @@ namespace CalamityMod
|
||||
[DefaultValue(true)]
|
||||
public bool StealthMeter { get; set; }
|
||||
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[DefaultValue(true)]
|
||||
public bool ChargeMeter { get; set; }
|
||||
|
||||
private const float MinMeterShake = 0f;
|
||||
private const float MaxMeterShake = 4f;
|
||||
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[SliderColor(224, 165, 56, 128)]
|
||||
[Range(MinMeterShake, MaxMeterShake)]
|
||||
[Increment(1f)]
|
||||
[DrawTicks]
|
||||
[DefaultValue(2f)]
|
||||
public float RipperMeterShake { get; set; }
|
||||
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[DefaultValue(false)]
|
||||
public bool SpeedrunTimer { get; set; }
|
||||
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[DefaultValue(true)]
|
||||
public bool FlightBar { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Meter Positions
|
||||
[Header("MeterPositions")]
|
||||
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[SliderColor(224, 165, 56, 128)]
|
||||
[Range(0f, 100f)]
|
||||
@@ -130,10 +150,6 @@ namespace CalamityMod
|
||||
[DefaultValue(SulphurousWaterMeterUI.DefaultPosY)]
|
||||
public float SulphuricWaterMeterPosY { get; set; }
|
||||
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[DefaultValue(true)]
|
||||
public bool ChargeMeter { get; set; }
|
||||
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[SliderColor(224, 165, 56, 128)]
|
||||
[Range(0f, 100f)]
|
||||
@@ -147,8 +163,28 @@ namespace CalamityMod
|
||||
public float ChargeMeterPosY { get; set; }
|
||||
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[DefaultValue(false)]
|
||||
public bool SpeedrunTimer { get; set; }
|
||||
[SliderColor(224, 165, 56, 128)]
|
||||
[Range(0f, 100f)]
|
||||
[DefaultValue(RipperUI.DefaultRagePosX)]
|
||||
public float RageMeterPosX { get; set; }
|
||||
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[SliderColor(224, 165, 56, 128)]
|
||||
[Range(0f, 100f)]
|
||||
[DefaultValue(RipperUI.DefaultRagePosY)]
|
||||
public float RageMeterPosY { get; set; }
|
||||
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[SliderColor(224, 165, 56, 128)]
|
||||
[Range(0f, 100f)]
|
||||
[DefaultValue(RipperUI.DefaultAdrenPosX)]
|
||||
public float AdrenalineMeterPosX { get; set; }
|
||||
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[SliderColor(224, 165, 56, 128)]
|
||||
[Range(0f, 100f)]
|
||||
[DefaultValue(RipperUI.DefaultAdrenPosY)]
|
||||
public float AdrenalineMeterPosY { get; set; }
|
||||
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[SliderColor(224, 165, 56, 128)]
|
||||
@@ -162,10 +198,6 @@ namespace CalamityMod
|
||||
[DefaultValue(SpeedrunTimerUI.DefaultTimerPosY)]
|
||||
public float SpeedrunTimerPosY { get; set; }
|
||||
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[DefaultValue(true)]
|
||||
public bool FlightBar { get; set; }
|
||||
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[SliderColor(224, 165, 56, 128)]
|
||||
[Range(0f, 100f)]
|
||||
@@ -206,7 +238,37 @@ namespace CalamityMod
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[DefaultValue(true)]
|
||||
public bool FasterFallHotkey { get; set; }
|
||||
#endregion
|
||||
}
|
||||
|
||||
[BackgroundColor(49, 32, 36, 216)]
|
||||
public class CalamityServerConfig : ModConfig
|
||||
{
|
||||
public static CalamityServerConfig Instance;
|
||||
public override ConfigScope Mode => ConfigScope.ServerSide;
|
||||
public override bool AcceptClientChanges(ModConfig pendingConfig, int whoAmI, ref NetworkText message)
|
||||
{
|
||||
if (whoAmI == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (whoAmI != 0)
|
||||
{
|
||||
message = CalamityUtils.GetText("Configs.CalamityServerConfig.Denied").ToNetworkText();
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Clamps values that would cause ugly problems if loaded directly without sanitization.
|
||||
[OnDeserialized]
|
||||
internal void ClampValues(StreamingContext context)
|
||||
{
|
||||
BossHealthBoost = Utils.Clamp(BossHealthBoost, MinBossHealthBoost, MaxBossHealthBoost);
|
||||
}
|
||||
|
||||
[Header("Gameplay")]
|
||||
#region General Gameplay Changes
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[DefaultValue(true)]
|
||||
public bool RemoveReforgeRNG { get; set; }
|
||||
@@ -257,6 +319,10 @@ namespace CalamityMod
|
||||
[DrawTicks]
|
||||
[DefaultValue(MinBossHealthBoost)]
|
||||
public float BossHealthBoost { get; set; }
|
||||
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[DefaultValue(false)]
|
||||
public bool BossesStopWeather { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Default Player Stat Boosts
|
||||
@@ -306,44 +372,5 @@ namespace CalamityMod
|
||||
[DefaultValue(false)]
|
||||
public bool ForceTownSafety { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Revengeance Mode Changes
|
||||
[Header("Revengeance")]
|
||||
|
||||
private const float MinMeterShake = 0f;
|
||||
private const float MaxMeterShake = 4f;
|
||||
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[SliderColor(224, 165, 56, 128)]
|
||||
[Range(MinMeterShake, MaxMeterShake)]
|
||||
[Increment(1f)]
|
||||
[DrawTicks]
|
||||
[DefaultValue(2f)]
|
||||
public float RipperMeterShake { get; set; }
|
||||
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[SliderColor(224, 165, 56, 128)]
|
||||
[Range(0f, 100f)]
|
||||
[DefaultValue(RipperUI.DefaultRagePosX)]
|
||||
public float RageMeterPosX { get; set; }
|
||||
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[SliderColor(224, 165, 56, 128)]
|
||||
[Range(0f, 100f)]
|
||||
[DefaultValue(RipperUI.DefaultRagePosY)]
|
||||
public float RageMeterPosY { get; set; }
|
||||
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[SliderColor(224, 165, 56, 128)]
|
||||
[Range(0f, 100f)]
|
||||
[DefaultValue(RipperUI.DefaultAdrenPosX)]
|
||||
public float AdrenalineMeterPosX { get; set; }
|
||||
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[SliderColor(224, 165, 56, 128)]
|
||||
[Range(0f, 100f)]
|
||||
[DefaultValue(RipperUI.DefaultAdrenPosY)]
|
||||
public float AdrenalineMeterPosY { get; set; }
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@ using CalamityMod.Items.LoreItems;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables;
|
||||
using CalamityMod.Items.Placeables.Furniture.Trophies;
|
||||
using CalamityMod.Items.Tools;
|
||||
using CalamityMod.Items.TreasureBags;
|
||||
using CalamityMod.Items.Weapons.DraedonsArsenal;
|
||||
using CalamityMod.Items.Weapons.Magic;
|
||||
@@ -63,6 +64,7 @@ using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using CalamityMod.Projectiles.Enemy;
|
||||
using CalamityMod.Projectiles.Magic;
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
using CalamityMod.Projectiles.Melee.MaceFlails;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using CalamityMod.Projectiles.Summon;
|
||||
@@ -104,8 +106,7 @@ namespace CalamityMod
|
||||
public static List<int> amalgamBuffList;
|
||||
public static List<int> persistentBuffList;
|
||||
public static List<int> MagicGunIDs;
|
||||
public static List<int> MushroomWeaponIDs;
|
||||
public static List<int> MushroomProjectileIDs;
|
||||
public static List<int> BlacklistedWeaponsWithToolPower;
|
||||
|
||||
// Some of these lists of enemies are unused, but were difficult to create. Many of these common enemy types have a ton of variants.
|
||||
public static List<int> zombieList;
|
||||
@@ -281,7 +282,7 @@ namespace CalamityMod
|
||||
"cocodezi_",
|
||||
"Mendzey",
|
||||
"GameRDheAsianSandwich",
|
||||
"Tobias",
|
||||
"Chigbungus",
|
||||
"Streakist",
|
||||
"Eisaya",
|
||||
"Xenocrona",
|
||||
@@ -816,6 +817,7 @@ namespace CalamityMod
|
||||
ProjectileType<TrueDecaysRetort>(),
|
||||
ProjectileType<TrueGrovetendersTouch>(),
|
||||
ProjectileType<HeavensMight>(),
|
||||
ProjectileType<HellbornHoldout>(),
|
||||
ProjectileType<ExtantAbhorrence>(),
|
||||
ProjectileType<TrueBiomeBladeHoldout>(),
|
||||
ProjectileType<LamentationsOfTheChained>(),
|
||||
@@ -837,6 +839,7 @@ namespace CalamityMod
|
||||
ProjectileType<ArkoftheElementsParryHoldout>(),
|
||||
ProjectileType<ArkoftheCosmosSwungBlade>(),
|
||||
ProjectileType<ArkoftheCosmosParryHoldout>(),
|
||||
ProjectileType<BasherHoldout>(),
|
||||
ProjectileType<GrandDadHoldout>(),
|
||||
ProjectileType<GrandGuardianHoldout>(),
|
||||
ProjectileType<EarthHoldout>(),
|
||||
@@ -910,17 +913,17 @@ namespace CalamityMod
|
||||
NPCType<KingSlimeJewelRuby>(),
|
||||
NPCType<KingSlimeJewelSapphire>(),
|
||||
NPCType<KingSlimeJewelEmerald>(),
|
||||
NPCID.EyeofCthulhu,
|
||||
NPCType<BloodlettingServant>(),
|
||||
NPCID.EaterofWorldsHead,
|
||||
NPCID.EaterofWorldsBody,
|
||||
NPCID.EaterofWorldsTail,
|
||||
NPCID.BrainofCthulhu,
|
||||
NPCID.Creeper,
|
||||
NPCID.EyeofCthulhu,
|
||||
NPCType<BloodlettingServant>(),
|
||||
NPCID.QueenBee,
|
||||
NPCID.Deerclops,
|
||||
NPCID.SkeletronHead,
|
||||
NPCID.SkeletronHand,
|
||||
NPCID.Deerclops,
|
||||
NPCID.WallofFlesh,
|
||||
NPCID.WallofFleshEye,
|
||||
NPCID.PirateShipCannon,
|
||||
@@ -928,6 +931,7 @@ namespace CalamityMod
|
||||
NPCID.Probe,
|
||||
NPCID.Retinazer,
|
||||
NPCID.Spazmatism,
|
||||
NPCType<Foveanator>(),
|
||||
NPCID.SkeletronPrime,
|
||||
NPCType<SkeletronPrime2>(),
|
||||
NPCID.PrimeCannon,
|
||||
@@ -937,7 +941,6 @@ namespace CalamityMod
|
||||
NPCID.Plantera,
|
||||
NPCID.PlanterasTentacle,
|
||||
NPCType<PlanterasFreeTentacle>(),
|
||||
NPCID.HallowBoss,
|
||||
NPCID.Everscream,
|
||||
NPCID.SantaNK1,
|
||||
NPCID.IceQueen,
|
||||
@@ -955,6 +958,7 @@ namespace CalamityMod
|
||||
NPCID.DukeFishron,
|
||||
NPCID.Sharkron,
|
||||
NPCID.Sharkron2,
|
||||
NPCID.HallowBoss,
|
||||
NPCID.CultistBoss,
|
||||
NPCID.CultistDragonHead,
|
||||
NPCID.CultistDragonBody1,
|
||||
@@ -1562,6 +1566,7 @@ namespace CalamityMod
|
||||
TileType<LivingGodSlayerFireBlockTile>(),
|
||||
TileType<LivingHolyFireBlockTile>(),
|
||||
TileType<LivingBrimstoneFireBlockTile>(),
|
||||
TileType<LivingPlagueFireBlockTile>(),
|
||||
TileID.LivingFire,
|
||||
TileID.LivingCursedFire,
|
||||
TileID.LivingDemonFire,
|
||||
@@ -1585,7 +1590,6 @@ namespace CalamityMod
|
||||
BuffType<ShadowBuff>(),
|
||||
BuffType<Soaring>(),
|
||||
BuffType<SulphurskinBuff>(),
|
||||
BuffType<TeslaBuff>(),
|
||||
BuffType<WeaponImbueBrimstone>(),
|
||||
BuffType<WeaponImbueCrumbling>(),
|
||||
BuffType<WeaponImbueHolyFlames>(),
|
||||
@@ -1723,32 +1727,17 @@ namespace CalamityMod
|
||||
ItemID.ZapinatorOrange
|
||||
};
|
||||
|
||||
MushroomWeaponIDs = new List<int>()
|
||||
// This list intentionally does not contain Grax.
|
||||
BlacklistedWeaponsWithToolPower = new List<int>()
|
||||
{
|
||||
ItemType<Mycoroot>(),
|
||||
ItemType<InfestedClawmerang>(),
|
||||
ItemType<PuffShroom>(),
|
||||
ItemType<HyphaeRod>(),
|
||||
ItemType<Fungicide>(),
|
||||
ItemType<MycelialClaws>(),
|
||||
ItemType<Shroomer>(),
|
||||
ItemID.Hammush,
|
||||
ItemID.MushroomSpear,
|
||||
ItemID.Shroomerang
|
||||
};
|
||||
|
||||
MushroomProjectileIDs = new List<int>()
|
||||
{
|
||||
ProjectileType<MycorootProj>(),
|
||||
ProjectileType<ShroomerangSpore>(),
|
||||
ProjectileType<InfestedClawmerangProj>(),
|
||||
ProjectileType<PuffCloud>(),
|
||||
ProjectileType<FungiOrb2>(),
|
||||
ProjectileType<FungiOrb>(),
|
||||
ProjectileType<Shroom>(),
|
||||
ProjectileID.TruffleSpore,
|
||||
ProjectileID.MushroomSpear,
|
||||
ProjectileID.Shroomerang
|
||||
ItemID.ButchersChainsaw,
|
||||
ItemID.LucyTheAxe,
|
||||
ItemID.Rockfish,
|
||||
ItemType<AxeofPurity>(),
|
||||
ItemType<HydraulicVoltCrasher>(),
|
||||
ItemType<InfernaCutter>(),
|
||||
ItemType<PhotonRipper>(),
|
||||
ItemType<Respiteblock>()
|
||||
};
|
||||
|
||||
zombieList = new List<int>()
|
||||
@@ -1987,6 +1976,7 @@ namespace CalamityMod
|
||||
ProjectileID.PiercingStarlight,
|
||||
ProjectileID.Terragrim,
|
||||
ProjectileType<AcidicSaxBubble>(),
|
||||
ProjectileType<BasherHoldout>(),
|
||||
ProjectileType<BlushieStaffProj>(),
|
||||
ProjectileType<BonebreakerProjectile>(),
|
||||
ProjectileType<DarkSparkBeam>(),
|
||||
@@ -2005,6 +1995,7 @@ namespace CalamityMod
|
||||
ProjectileType<GodsParanoiaProj>(),
|
||||
ProjectileType<GrandDadHoldout>(),
|
||||
ProjectileType<GrandGuardianHoldout>(),
|
||||
ProjectileType<HellbornHoldout>(),
|
||||
ProjectileType<HellkiteHoldout>(),
|
||||
ProjectileType<InsidiousHarpoon>(),
|
||||
ProjectileType<JawsProjectile>(),
|
||||
@@ -2037,13 +2028,11 @@ namespace CalamityMod
|
||||
ProjectileType<TaserHook>(),
|
||||
ProjectileType<Teslabeam>(),
|
||||
ProjectileType<TyphonsGreedStaff>(),
|
||||
ProjectileType<UrchinBall>(),
|
||||
ProjectileType<UrchinBallSpike>(),
|
||||
ProjectileType<UrchinMaceProjectile>(),
|
||||
ProjectileType<UrchinStingerProj>(),
|
||||
ProjectileType<ViolenceThrownProjectile>(),
|
||||
ProjectileType<WaterLeechProj>(),
|
||||
ProjectileType<YateveoBloomProj>(),
|
||||
ProjectileType<YateveoBloomMace>(),
|
||||
ProjectileType<YharimsCrystalBeam>(),
|
||||
};
|
||||
|
||||
@@ -2556,6 +2545,7 @@ namespace CalamityMod
|
||||
|
||||
{ NPCID.Spazmatism, 150000 }, // 30 seconds
|
||||
{ NPCID.Retinazer, 125000 },
|
||||
{ NPCType<Foveanator>(), 137500 },
|
||||
|
||||
{ NPCID.TheDestroyer, 250000 }, // 30 seconds + immunity timer at start
|
||||
{ NPCID.TheDestroyerBody, 250000 },
|
||||
@@ -2603,20 +2593,20 @@ namespace CalamityMod
|
||||
|
||||
BossValues = new SortedDictionary<int, int>
|
||||
{
|
||||
{ NPCID.KingSlime, Item.buyPrice(0, 5)},
|
||||
{ NPCID.EyeofCthulhu, Item.buyPrice(0, 10)},
|
||||
{ NPCID.QueenBee, Item.buyPrice(0, 15)},
|
||||
{ NPCID.KingSlime, Item.buyPrice(0, 5) },
|
||||
{ NPCID.EyeofCthulhu, Item.buyPrice(0, 10) },
|
||||
{ NPCID.QueenBee, Item.buyPrice(0, 15) },
|
||||
{ NPCID.SkeletronHead, Item.buyPrice(0, 20) },
|
||||
{ NPCID.Deerclops, Item.buyPrice(0, 20) },
|
||||
{ NPCID.WallofFlesh, Item.buyPrice(0, 25)},
|
||||
{ NPCID.QueenSlimeBoss, Item.buyPrice(0, 30)},
|
||||
{ NPCID.Spazmatism, Item.buyPrice(0, 40)},
|
||||
{ NPCID.Retinazer, Item.buyPrice(0, 40)},
|
||||
{ NPCID.TheDestroyer, Item.buyPrice(0, 40)},
|
||||
{ NPCID.SkeletronPrime, Item.buyPrice(0, 40)},
|
||||
{ NPCID.Plantera, Item.buyPrice(0, 50)},
|
||||
{ NPCID.HallowBoss, Item.buyPrice(0, 60)},
|
||||
{ NPCID.Golem, Item.buyPrice(0, 60)},
|
||||
{ NPCID.WallofFlesh, Item.buyPrice(0, 25) },
|
||||
{ NPCID.QueenSlimeBoss, Item.buyPrice(0, 30) },
|
||||
{ NPCID.Spazmatism, Item.buyPrice(0, 40) },
|
||||
{ NPCID.Retinazer, Item.buyPrice(0, 40) },
|
||||
{ NPCID.TheDestroyer, Item.buyPrice(0, 40) },
|
||||
{ NPCID.SkeletronPrime, Item.buyPrice(0, 40) },
|
||||
{ NPCID.Plantera, Item.buyPrice(0, 50) },
|
||||
{ NPCID.HallowBoss, Item.buyPrice(0, 60) },
|
||||
{ NPCID.Golem, Item.buyPrice(0, 60) },
|
||||
{ NPCID.DukeFishron, Item.buyPrice(0, 75) },
|
||||
{ NPCID.CultistBoss, Item.buyPrice(1) },
|
||||
{ NPCID.MoonLordCore, Item.buyPrice(1, 50) }
|
||||
@@ -2748,8 +2738,7 @@ namespace CalamityMod
|
||||
amalgamBuffList = null;
|
||||
persistentBuffList = null;
|
||||
MagicGunIDs = null;
|
||||
MushroomWeaponIDs = null;
|
||||
MushroomProjectileIDs = null;
|
||||
BlacklistedWeaponsWithToolPower = null;
|
||||
|
||||
zombieList = null;
|
||||
demonEyeList = null;
|
||||
|
||||
@@ -82,6 +82,9 @@ namespace CalamityMod
|
||||
public static int ghostKillCount = 0;
|
||||
public static int sharkKillCount = 0;
|
||||
|
||||
// Boss Head Icons
|
||||
public static int chadPrimeIcon;
|
||||
|
||||
public static Asset<Texture2D> carpetOriginal;
|
||||
|
||||
// Astral Sky/BG
|
||||
@@ -108,6 +111,9 @@ namespace CalamityMod
|
||||
// Destroyer glowmasks
|
||||
public static Asset<Texture2D>[] DestroyerGlowmasks = new Asset<Texture2D>[3];
|
||||
|
||||
// Probe glowmask
|
||||
public static Asset<Texture2D> ProbeGlowmask;
|
||||
|
||||
// Wall of Flesh glowmasks
|
||||
public static Asset<Texture2D> WallOfFleshEyeGlowmask;
|
||||
public static Asset<Texture2D> WallOfFleshDemonSickleTexture;
|
||||
@@ -129,6 +135,11 @@ namespace CalamityMod
|
||||
// This can be edited by other mods using reflection to prevent compatibility issues
|
||||
public static bool ExternalFlag_DisableNonRevBossAI = false;
|
||||
|
||||
// External flag to disable Defense Damage
|
||||
// This can be edited by other mods using reflection if desired
|
||||
// Note that this flag trumps Bloodflare Core and will stop that accessory from working properly.
|
||||
public static bool ExternalFlag_DisableDefenseDamage = false;
|
||||
|
||||
internal static CalamityMod Instance;
|
||||
|
||||
// TODO -- Mod references should be contained in a ModSystem (example name "ModLoadedChecker")
|
||||
@@ -286,6 +297,9 @@ namespace CalamityMod
|
||||
DestroyerGlowmasks[1] = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerBodyGlow", AssetRequestMode.AsyncLoad);
|
||||
DestroyerGlowmasks[2] = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerTailGlow", AssetRequestMode.AsyncLoad);
|
||||
|
||||
// Probe glowmask
|
||||
ProbeGlowmask = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/VanillaBossGlowmasks/ProbeGlow", AssetRequestMode.AsyncLoad);
|
||||
|
||||
// Wall of Flesh glowmasks
|
||||
WallOfFleshEyeGlowmask = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/VanillaBossGlowmasks/WallOfFleshEyeTelegraphGlow", AssetRequestMode.AsyncLoad);
|
||||
WallOfFleshDemonSickleTexture = ModContent.Request<Texture2D>("CalamityMod/Projectiles/Melee/ForbiddenOathbladeProjectile", AssetRequestMode.AsyncLoad);
|
||||
@@ -368,6 +382,11 @@ namespace CalamityMod
|
||||
ThanatosBody2.LoadHeadIcons();
|
||||
ThanatosTail.LoadHeadIcons();
|
||||
|
||||
// All the head icon loading shit is done here, so I'm putting this here
|
||||
string chadPrimeIconPath = "CalamityMod/ExtraTextures/ChadPrime_Head_Boss";
|
||||
CalamityMod.Instance.AddBossHeadTexture(chadPrimeIconPath, -1);
|
||||
chadPrimeIcon = ModContent.GetModBossHeadSlot(chadPrimeIconPath);
|
||||
|
||||
// TODO -- Is this not possible to place in ModItem.Load or ModItem.SetStaticDefaults ?
|
||||
// Centralizing hair dye shaders like this seems absurdly stiff
|
||||
GameShaders.Hair.BindShader(ModContent.ItemType<AdrenalineHairDye>(), new LegacyHairShaderData().UseLegacyMethod((Player player, Color newColor, ref bool lighting) => Color.Lerp(player.hairColor, new Color(0, 255, 171), ((float)player.Calamity().adrenaline / (float)player.Calamity().adrenalineMax))));
|
||||
@@ -433,6 +452,7 @@ namespace CalamityMod
|
||||
NPCStats.Unload();
|
||||
CalamityGlobalItem.UnloadTweaks();
|
||||
CalamityGlobalProjectile.UnloadTweaks();
|
||||
FramedGlowMask.UnloadTexCache();
|
||||
|
||||
PopupGUIManager.UnloadGUIs();
|
||||
InvasionProgressUIManager.UnloadGUIs();
|
||||
@@ -484,7 +504,7 @@ namespace CalamityMod
|
||||
#endregion Render Target Management
|
||||
|
||||
#region Force ModConfig save (Reflection)
|
||||
internal static void SaveConfig(CalamityConfig cfg)
|
||||
internal static void SaveConfig(CalamityClientConfig cfg)
|
||||
{
|
||||
// There is no current way to manually save a mod configuration file in tModLoader.
|
||||
// The method which saves mod config files is private in ConfigManager, so reflection is used to invoke it.
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.IO;
|
||||
using CalamityMod.Events;
|
||||
using CalamityMod.Items;
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.NPCs.NormalNPCs;
|
||||
using CalamityMod.NPCs.Providence;
|
||||
@@ -144,16 +145,28 @@ namespace CalamityMod
|
||||
}
|
||||
break;
|
||||
|
||||
case CalamityModMessageType.PlaceAltCritter:
|
||||
{
|
||||
int placerplayer = reader.ReadInt32();
|
||||
int posX = reader.ReadInt32();
|
||||
int posY = reader.ReadInt32();
|
||||
int type = reader.ReadInt32();
|
||||
int itemType = reader.ReadInt32();
|
||||
float color = reader.ReadInt32();
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
int n = NPC.NewNPC(Main.player[placerplayer].GetSource_ReleaseEntity(), posX, posY, type, ai1: color);
|
||||
Main.npc[n].catchItem = itemType;
|
||||
Main.npc[n].releaseOwner = (short)placerplayer;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case CalamityModMessageType.ServersideSpawnOldDuke:
|
||||
byte playerIndex2 = reader.ReadByte();
|
||||
CalamityUtils.SpawnOldDuke(playerIndex2);
|
||||
break;
|
||||
|
||||
case CalamityModMessageType.ArmoredDiggerCountdownSync:
|
||||
int countdown5 = reader.ReadInt32();
|
||||
CalamityWorld.ArmoredDiggerSpawnCooldown = countdown5;
|
||||
break;
|
||||
|
||||
case CalamityModMessageType.ProvidenceDyeConditionSync:
|
||||
byte npcIndex3 = reader.ReadByte();
|
||||
(Main.npc[npcIndex3].ModNPC as Providence).hasTakenDaytimeDamage = reader.ReadBoolean();
|
||||
@@ -312,6 +325,47 @@ namespace CalamityMod
|
||||
MusicEventSystem.ReceiveSyncResponse(reader);
|
||||
break;
|
||||
|
||||
//
|
||||
// Bandit refund syncs
|
||||
//
|
||||
case CalamityModMessageType.SomeoneGotScammedByTinkerer:
|
||||
int scammedOne = reader.ReadByte();
|
||||
int stolen = reader.Read7BitEncodedInt();
|
||||
|
||||
CalamityWorld.MoneyStolenByBandit += stolen;
|
||||
CalamityWorld.Reforges++;
|
||||
|
||||
// Broadcast back for tragic event
|
||||
// WorldSync DO sync the MoneyStolenByBandit and Refores variable, But spamming SyncWorld is not a ideal action
|
||||
if (Main.dedServ)
|
||||
{
|
||||
ModPacket packet = CalamityMod.Instance.GetPacket();
|
||||
packet.Write((byte)CalamityModMessageType.SomeoneGotScammedByTinkerer);
|
||||
packet.Write((byte)scammedOne);
|
||||
packet.Write7BitEncodedInt(stolen);
|
||||
packet.Send(ignoreClient: scammedOne);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case CalamityModMessageType.WantToRefundReforges:
|
||||
int requester = reader.ReadByte();
|
||||
|
||||
// Only Server should handle this action!
|
||||
if (!Main.dedServ)
|
||||
break;
|
||||
|
||||
int banditIdx = NPC.FindFirstNPC(ModContent.NPCType<THIEF>());
|
||||
if (banditIdx == -1)
|
||||
break;
|
||||
|
||||
NPC bandit = Main.npc[banditIdx];
|
||||
if (bandit == null || !bandit.active)
|
||||
break;
|
||||
|
||||
THIEF.DoRefund(bandit);
|
||||
break;
|
||||
|
||||
//
|
||||
// Default case: with no idea how long the packet is, we can't safely read data.
|
||||
// Throw an exception now instead of allowing the network stream to corrupt.
|
||||
@@ -392,8 +446,8 @@ namespace CalamityMod
|
||||
SyncAndroombaSolution,
|
||||
SyncAndroombaAI,
|
||||
SyncSlabCrabAI,
|
||||
PlaceAltCritter,
|
||||
ServersideSpawnOldDuke,
|
||||
ArmoredDiggerCountdownSync, // TODO -- remove this mechanic entirely
|
||||
ProvidenceDyeConditionSync, // TODO -- this packetstorms if you hit Provi with spam weapons. It should ONLY send a packet if the status changes.
|
||||
PSCChallengeSync, // TODO -- once you've failed the PSC challenge this packetstorms
|
||||
|
||||
@@ -437,6 +491,10 @@ namespace CalamityMod
|
||||
|
||||
// Music events
|
||||
MusicEventSyncRequest,
|
||||
MusicEventSyncResponse
|
||||
MusicEventSyncResponse,
|
||||
|
||||
// Bandit Reforge Refund
|
||||
SomeoneGotScammedByTinkerer,
|
||||
WantToRefundReforges
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.Localization;
|
||||
using static CalamityMod.CalamityUtils;
|
||||
|
||||
namespace CalamityMod.Cooldowns
|
||||
{
|
||||
public class ArsenalPower : CooldownHandler
|
||||
{
|
||||
public static new string ID => "ArsenalPower";
|
||||
public override bool ShouldDisplay => true;
|
||||
public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}");
|
||||
public override string Texture => "CalamityMod/Cooldowns/ArsenalPower";
|
||||
public override Color OutlineColor => Color.White;
|
||||
public override Color CooldownStartColor => Color.Sienna;
|
||||
public override Color CooldownEndColor => Color.LightSlateGray;
|
||||
|
||||
public override SoundStyle? EndSound => new("CalamityMod/Sounds/Item/ArsenalOffCooldown");
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
@@ -8,7 +8,7 @@ namespace CalamityMod.Cooldowns
|
||||
{
|
||||
public static new string ID => "ChaosState";
|
||||
|
||||
public override bool ShouldDisplay => CalamityConfig.Instance.VanillaCooldownDisplay && instance.player.chaosState;
|
||||
public override bool ShouldDisplay => CalamityClientConfig.Instance.VanillaCooldownDisplay && instance.player.chaosState;
|
||||
public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}");
|
||||
public override string Texture => "CalamityMod/Cooldowns/ChaosState" + skinTexture;
|
||||
public override Color OutlineColor => outlineColor;
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace CalamityMod.Cooldowns
|
||||
public class PotionSickness : CooldownHandler
|
||||
{
|
||||
public static new string ID => "PotionSickness";
|
||||
public override bool ShouldDisplay => CalamityConfig.Instance.VanillaCooldownDisplay && instance.player.potionDelay > 0;
|
||||
public override bool ShouldDisplay => CalamityClientConfig.Instance.VanillaCooldownDisplay && instance.player.potionDelay > 0;
|
||||
public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}");
|
||||
public override string Texture => "CalamityMod/Cooldowns/PotionSickness";
|
||||
public override Color OutlineColor => new Color(255, 142, 165);
|
||||
|
||||
@@ -200,6 +200,7 @@ namespace CalamityMod
|
||||
|
||||
{ NPCID.Spazmatism, 0.85 },
|
||||
{ NPCID.Retinazer, 0.85 },
|
||||
{ ModContent.NPCType<Foveanator>(), 0.85 },
|
||||
|
||||
{ ModContent.NPCType<AquaticScourgeHead>(), 1.1 },
|
||||
{ ModContent.NPCType<AquaticScourgeBody>(), 0.8 },
|
||||
@@ -398,6 +399,12 @@ namespace CalamityMod
|
||||
102, // 153 in phase 2
|
||||
119, // 178 in phase 2
|
||||
153 } }, // 229 in phase 2
|
||||
{ ModContent.NPCType<Foveanator>(), new int[] {
|
||||
62, // 93 in phase 2
|
||||
94, // 141 in phase 2
|
||||
110, // 165 in phase 2
|
||||
128, // 192 in phase 2
|
||||
178 } }, // 267 in phase 2
|
||||
|
||||
{ ModContent.NPCType<AquaticScourgeHead>(), new int[] { 110, 176, 187, 198, 330 } },
|
||||
{ ModContent.NPCType<AquaticScourgeBody>(), new int[] { 75, 112, 136, 160, 240 } },
|
||||
@@ -636,6 +643,9 @@ namespace CalamityMod
|
||||
{ new Tuple<int, int>(NPCID.Spazmatism, ProjectileID.EyeFire), new int[] { 60, 120, 148, 176, 264 } },
|
||||
{ new Tuple<int, int>(NPCID.Spazmatism, ModContent.ProjectileType<Shadowflamethrower>()), new int[] { 70, 120, 148, 176, 264 } },
|
||||
{ new Tuple<int, int>(NPCID.Spazmatism, ModContent.ProjectileType<ShadowflameFireball>()), new int[] { 60, 100, 128, 156, 234 } },
|
||||
/*{ new Tuple<int, int>(ModContent.NPCType<Foveanator>(), ModContent.ProjectileType<FoveaLaser>()), new int[] { 50, 108, 132, 156, 234 } },
|
||||
{ new Tuple<int, int>(ModContent.NPCType<Foveanator>(), ModContent.ProjectileType<FoveaEnergyBomb>()), new int[] { 70, 120, 148, 176, 264 } },
|
||||
{ new Tuple<int, int>(ModContent.NPCType<Foveanator>(), ModContent.ProjectileType<FoveaFlamethrower>()), new int[] { 70, 120, 148, 176, 264 } },*/
|
||||
|
||||
{ new Tuple<int, int>(ModContent.NPCType<AquaticScourgeHead>(), ModContent.ProjectileType<SulphuricAcidMist>()), new int[] { 60, 100, 120, 140, 210 } },
|
||||
{ new Tuple<int, int>(ModContent.NPCType<AquaticScourgeHead>(), ModContent.ProjectileType<SandPoisonCloud>()), new int[] { 70, 120, 136, 152, 228 } },
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace CalamityMod.Effects
|
||||
// Scarlet Devil main spear glowing trail. BEWARE: Is reused by many other items!
|
||||
internal static Effect ScarletDevilShader;
|
||||
|
||||
// Yharon border suns (or flame pillars?) unsure. it's one or the other. maybe both
|
||||
// Yharon border flame pillar trail.
|
||||
internal static Effect BordernadoFireShader;
|
||||
|
||||
// Photon Ripper hardlight teeth trail shader
|
||||
@@ -99,13 +99,13 @@ namespace CalamityMod.Effects
|
||||
// Exoblade's melee slash trails. Also used by Terratomere
|
||||
internal static Effect ExobladeSlashShader;
|
||||
|
||||
// Exoblade's projectile on-hit "aniume slash marks". Also used by Terratomere
|
||||
// Exoblade's projectile on-hit "anime slash marks". Also used by Terratomere
|
||||
internal static Effect ExobladePierceShader;
|
||||
|
||||
// Used by Subsuming Vortex's various vortices. Draws the main vortices
|
||||
// Used by Subsuming Vortex's various vortices. Draws the main vortices. BEWARE: Reused by Burning Sea's fireball.
|
||||
internal static Effect ExoVortexShader;
|
||||
|
||||
// Used by Subsuming Vortex's side vortices. Draws the swirling energy tendrils.
|
||||
// Used by Subsuming Vortex's small vortices. Draws the trailing energy tendrils.
|
||||
internal static Effect SideStreakTrailShader;
|
||||
|
||||
// Used by Heavenly Gale's hardlight arrows.
|
||||
@@ -185,6 +185,8 @@ namespace CalamityMod.Effects
|
||||
#region Aqua's Shaders
|
||||
internal static Effect CircularGradientWithEdge;
|
||||
internal static Effect GaleforceArrowTrailShader;
|
||||
internal static Effect WavyOpacity;
|
||||
internal static Effect HellBall;
|
||||
#endregion
|
||||
|
||||
//
|
||||
@@ -410,6 +412,12 @@ namespace CalamityMod.Effects
|
||||
|
||||
GaleforceArrowTrailShader = LoadShader("GaleforceArrowTrail");
|
||||
RegisterMiscShader(ArtAttackTrailShader, "TrailPass", "GaleforceArrowTrail");
|
||||
|
||||
WavyOpacity = LoadShader("WavyOpacity");
|
||||
RegisterMiscShader(WavyOpacity, "WavyOpacityPass", "WavyOpacity");
|
||||
|
||||
HellBall = LoadShader("HellBall");
|
||||
RegisterScreenShader(HellBall, "HellBallPass", "HellBall");
|
||||
#endregion
|
||||
|
||||
#region Loading Amber's Shaders
|
||||
|
||||
@@ -212,7 +212,8 @@ namespace CalamityMod.Events
|
||||
{
|
||||
NPC.SpawnOnPlayer(ClosestPlayerToWorldCenter, NPCID.Spazmatism);
|
||||
NPC.SpawnOnPlayer(ClosestPlayerToWorldCenter, NPCID.Retinazer);
|
||||
}, permittedNPCs: NPCID.Retinazer),
|
||||
NPC.SpawnOnPlayer(ClosestPlayerToWorldCenter, ModContent.NPCType<Foveanator>());
|
||||
}, permittedNPCs: new int[] { NPCID.Retinazer, ModContent.NPCType<Foveanator>() }),
|
||||
|
||||
new Boss(ModContent.NPCType<AquaticScourgeHead>(), TimeChangeContext.Day, permittedNPCs: new int[] { ModContent.NPCType<AquaticScourgeBody>(), ModContent.NPCType<AquaticScourgeBodyAlt>(), ModContent.NPCType<AquaticScourgeTail>() }),
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 493 B |
|
Before Width: | Height: | Size: 868 B |
|
After Width: | Height: | Size: 238 B |
|
Before Width: | Height: | Size: 864 B |
|
After Width: | Height: | Size: 594 B |
|
After Width: | Height: | Size: 760 B |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 383 B |
|
After Width: | Height: | Size: 387 B |
|
After Width: | Height: | Size: 790 B |
|
After Width: | Height: | Size: 768 B |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
@@ -15,8 +15,8 @@ namespace CalamityMod.Graphics.Renderers.CalamityRenderers
|
||||
|
||||
public static NPC Deerclops => Main.npc[NPC.deerclopsBoss];
|
||||
|
||||
//Should only draw if not in the main menu, deerclops is active or the border is fading post-death,
|
||||
//it's rev+ and the boolean for drawing the border is true.
|
||||
// Should only draw if not in the main menu, deerclops is active or the border is fading post-death,
|
||||
// It's rev+ and the boolean for drawing the border is true.
|
||||
public override bool ShouldDraw => !Main.gameMenu && DeerclopsAI.borderScalar > 0f && DeerclopsAI.shouldDrawEnrageBorder;
|
||||
#endregion
|
||||
|
||||
@@ -26,18 +26,21 @@ namespace CalamityMod.Graphics.Renderers.CalamityRenderers
|
||||
bool shouldDraw;
|
||||
var deerclopsInactive = false;
|
||||
if (NPC.deerclopsBoss >= 0 && NPC.deerclopsBoss.WithinBounds(Main.npc.Length))
|
||||
{
|
||||
shouldDraw = Deerclops.HasValidTarget;
|
||||
}
|
||||
else
|
||||
{
|
||||
shouldDraw = DeerclopsAI.borderScalar > 0f;
|
||||
deerclopsInactive = true;
|
||||
}
|
||||
|
||||
if (shouldDraw)
|
||||
{
|
||||
var minRadius = DeerclopsAI.innerBorder;
|
||||
var maxRadius = DeerclopsAI.outerBorder;
|
||||
|
||||
//Begin drawing the shadow
|
||||
// Begin drawing the shadow
|
||||
var blackTile = TextureAssets.MagicPixel;
|
||||
|
||||
var shader = GameShaders.Misc["CalamityMod:DeerclopsShadowShader"].Shader;
|
||||
@@ -48,16 +51,17 @@ namespace CalamityMod.Graphics.Renderers.CalamityRenderers
|
||||
shader.Parameters["screenSize"].SetValue(Main.ScreenSize.ToVector2());
|
||||
shader.Parameters["maxOpacity"].SetValue(DeerclopsAI.borderScalar);
|
||||
|
||||
|
||||
spriteBatch.EnterShaderRegion(BlendState.NonPremultiplied, shader);
|
||||
Rectangle rekt = new(Main.screenWidth / 2, Main.screenHeight / 2, Main.screenWidth, Main.screenHeight);
|
||||
spriteBatch.Draw(blackTile.Value, rekt, null, default, 0f, blackTile.Value.Size() * 0.5f, 0, 0f);
|
||||
//Shadow drawing complete
|
||||
|
||||
// Shadow drawing complete
|
||||
spriteBatch.ExitShaderRegion();
|
||||
}
|
||||
|
||||
if (deerclopsInactive)
|
||||
{
|
||||
//Push the border away and fade out when deerclops is deadge
|
||||
// Push the border away and fade out when deerclops is deadge
|
||||
DeerclopsAI.borderScalar = MathHelper.Clamp(DeerclopsAI.borderScalar - 0.015f, 0f, 1f);
|
||||
DeerclopsAI.innerBorder += 30f;
|
||||
DeerclopsAI.outerBorder += 30f;
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace CalamityMod.ILEditing
|
||||
cursor.Remove();
|
||||
|
||||
// Increase by 10% if the higher jump speed is enabled.
|
||||
cursor.EmitDelegate<Func<float>>(() => CalamityConfig.Instance.HigherJumpHeight ? BalancingConstants.ConfigBoostedBaseJumpHeight : VanillaBaseJumpHeight);
|
||||
cursor.EmitDelegate<Func<float>>(() => CalamityServerConfig.Instance.HigherJumpHeight ? BalancingConstants.ConfigBoostedBaseJumpHeight : VanillaBaseJumpHeight);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -86,7 +86,10 @@ namespace CalamityMod.ILEditing
|
||||
On_Player.UpdateItemDye += FindCalamityItemDyeShader;
|
||||
On_AWorldListItem.GetDifficulty += GetDifficultyOverride;
|
||||
On_Item.GetShimmered += ShimmerEffectEdits;
|
||||
Terraria.On_Player.Teleport += TPOverride;
|
||||
On_Player.Teleport += TPOverride;
|
||||
On_NPC.SpawnBoss += TripletsSpawnTextOverride;
|
||||
On_NPC.DoDeathEvents_BeforeLoot += PreventFoveanatorDefeatMessageIfNotKilledLast;
|
||||
On_NPC.DoDeathEvents_CelebrateBossDeath += TripletsDefeatTextOverride;
|
||||
|
||||
// Mana Burn (Chaos Stone) and Chalice of the Blood God
|
||||
IL_Player.ApplyLifeAndOrMana += ManaSicknessAndChaliceBufferHeal;
|
||||
@@ -157,6 +160,9 @@ namespace CalamityMod.ILEditing
|
||||
On_Player.GetPickaxeDamage += RemoveHellforgePickaxeRequirement;
|
||||
On_Player.GetAnglerReward += ImproveAnglerRewards;
|
||||
|
||||
On_Player.ItemCheck_CheckCanUse += RemoveCelestialSigilUseLock;
|
||||
On_Player.ItemCheck_UseEventItems += ApplyCelestialSigilChanges;
|
||||
|
||||
// Fix vanilla bugs exposed by Calamity mechanics
|
||||
IL_NPC.NPCLoot += FixSplittingWormBannerDrops;
|
||||
On_NPC.PlayerInteraction += FixSplittingWormInteraction;
|
||||
|
||||
@@ -16,6 +16,7 @@ using CalamityMod.NPCs;
|
||||
using CalamityMod.NPCs.Astral;
|
||||
using CalamityMod.NPCs.AstrumAureus;
|
||||
using CalamityMod.NPCs.Crabulon;
|
||||
using CalamityMod.NPCs.NormalNPCs;
|
||||
using CalamityMod.NPCs.Ravager;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Projectiles;
|
||||
@@ -25,12 +26,14 @@ using CalamityMod.Tiles.Abyss;
|
||||
using CalamityMod.Walls;
|
||||
using CalamityMod.Waterfalls;
|
||||
using CalamityMod.Waters;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Mono.Cecil.Cil;
|
||||
using MonoMod.Cil;
|
||||
using ReLogic.Content;
|
||||
using Terraria;
|
||||
using Terraria.Chat;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.Achievements;
|
||||
@@ -342,7 +345,7 @@ namespace CalamityMod.ILEditing
|
||||
{
|
||||
// A cached delegate is used here instead of direct reflection for performance reasons
|
||||
// since UpdateTime is called every frame.
|
||||
if (Main.dayTime || CalamityConfig.Instance.TownNPCsSpawnAtNight)
|
||||
if (Main.dayTime || CalamityServerConfig.Instance.TownNPCsSpawnAtNight)
|
||||
VanillaSpawnTownNPCs();
|
||||
});
|
||||
|
||||
@@ -358,7 +361,7 @@ namespace CalamityMod.ILEditing
|
||||
private static void AlterTownNPCSpawnRate(Terraria.On_Main.orig_UpdateTime_SpawnTownNPCs orig)
|
||||
{
|
||||
double oldWorldRate = Main.desiredWorldTilesUpdateRate;
|
||||
Main.desiredWorldTilesUpdateRate *= CalamityConfig.Instance.TownNPCSpawnRateMultiplier;
|
||||
Main.desiredWorldTilesUpdateRate *= CalamityServerConfig.Instance.TownNPCSpawnRateMultiplier;
|
||||
orig();
|
||||
Main.desiredWorldTilesUpdateRate = oldWorldRate;
|
||||
}
|
||||
@@ -781,7 +784,7 @@ namespace CalamityMod.ILEditing
|
||||
private static void AdditiveDrawing(ILContext il)
|
||||
{
|
||||
ILCursor cursor = new(il);
|
||||
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchCall<MoonlordDeathDrama>("DrawWhite")))
|
||||
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchCall<ScreenObstruction>("Draw")))
|
||||
return;
|
||||
|
||||
cursor.EmitDelegate<Action>(() =>
|
||||
@@ -1181,7 +1184,7 @@ namespace CalamityMod.ILEditing
|
||||
float wave6angle = 0.55f + 0.45f * (float)Math.Sin(MathHelper.ToRadians(wave6));
|
||||
float bigwaveangle = 0.55f + 0.80f * (float)Math.Sin(MathHelper.ToRadians(bigwave));
|
||||
outputColor = Vector3.Lerp(outputColor, Color.DarkSlateGray.ToVector3(), 0.07f + wave1angle + wave2angle + wave3angle + wave4angle + wave5angle + wave6angle + bigwaveangle);
|
||||
outputColor *= brightness;
|
||||
outputColor *= brightness * 6f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1551,5 +1554,66 @@ namespace CalamityMod.ILEditing
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Revengeance Master Mode Twins Shenanigans
|
||||
public static void TripletsSpawnTextOverride(Terraria.On_NPC.orig_SpawnBoss orig, int x, int y, int type, int targetPlayerIndex)
|
||||
{
|
||||
if (Main.masterMode && CalamityWorld.revenge && type == NPCID.Retinazer)
|
||||
{
|
||||
int retinazerIndex = NPC.NewNPC(NPC.GetBossSpawnSource(targetPlayerIndex), x, y, type, 1);
|
||||
if (retinazerIndex == 200)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Main.npc[retinazerIndex].target = targetPlayerIndex;
|
||||
Main.npc[retinazerIndex].timeLeft *= 20;
|
||||
|
||||
if (Main.netMode == NetmodeID.Server && retinazerIndex < 200)
|
||||
{
|
||||
NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, retinazerIndex);
|
||||
}
|
||||
|
||||
AchievementsHelper.CheckMechaMayhem();
|
||||
|
||||
CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Status.Boss.TripletsBossText", new Color(175, 75, 255));
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
orig(x, y, type, targetPlayerIndex);
|
||||
}
|
||||
}
|
||||
|
||||
public static void PreventFoveanatorDefeatMessageIfNotKilledLast(On_NPC.orig_DoDeathEvents_BeforeLoot orig, NPC self, Player closestPlayer)
|
||||
{
|
||||
if (Main.masterMode && CalamityWorld.revenge && self.type == ModContent.NPCType<Foveanator>() && (NPC.AnyNPCs(NPCID.Spazmatism) || NPC.AnyNPCs(NPCID.Retinazer)))
|
||||
{
|
||||
self.value = 0f;
|
||||
self.boss = false;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
orig(self, closestPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
public static void TripletsDefeatTextOverride(On_NPC.orig_DoDeathEvents_CelebrateBossDeath orig, NPC self, string typeName)
|
||||
{
|
||||
bool correctNPCType = self.type == NPCID.Retinazer || self.type == NPCID.Spazmatism || self.type == ModContent.NPCType<Foveanator>();
|
||||
if (Main.masterMode && CalamityWorld.revenge && correctNPCType)
|
||||
{
|
||||
if (Main.netMode == NetmodeID.SinglePlayer)
|
||||
Main.NewText(Language.GetTextValue("Announcement.HasBeenDefeated_Plural", CalamityUtils.GetTextValue("Status.Boss.TripletsDefeatName")), 175, 75, 255);
|
||||
else if (Main.dedServ)
|
||||
ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasBeenDefeated_Plural", NetworkText.FromKey("Mods.CalamityMod.Status.Boss.TripletsDefeatName")), new Color(175, 75, 255));
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
orig(self, typeName);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using CalamityMod.Events;
|
||||
using CalamityMod.Items.Fishing;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.TreasureBags.MiscGrabBags;
|
||||
@@ -11,6 +12,7 @@ using Microsoft.Xna.Framework;
|
||||
using Mono.Cecil.Cil;
|
||||
using MonoMod.Cil;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.GameContent.Drawing;
|
||||
using Terraria.ID;
|
||||
@@ -121,7 +123,7 @@ namespace CalamityMod.ILEditing
|
||||
#region Prevention of Slime Rain Spawns When Near Bosses
|
||||
private static void PreventBossSlimeRainSpawns(Terraria.On_NPC.orig_SlimeRainSpawns orig, int plr)
|
||||
{
|
||||
if (!Main.player[plr].Calamity().isNearbyBoss && CalamityConfig.Instance.BossZen)
|
||||
if (!Main.player[plr].Calamity().isNearbyBoss && CalamityServerConfig.Instance.BossZen)
|
||||
orig(plr);
|
||||
}
|
||||
#endregion Prevention of Slime Rain Spawns When Near Bosses
|
||||
@@ -1002,6 +1004,35 @@ namespace CalamityMod.ILEditing
|
||||
|
||||
#endregion Make Magma Stone & Fire Gauntlet Dust Toggleable
|
||||
|
||||
#region Celestial Sigil Non-Linearity Change
|
||||
private static bool RemoveCelestialSigilUseLock(On_Player.orig_ItemCheck_CheckCanUse orig, Player self, Item sItem)
|
||||
{
|
||||
if (sItem.type == ItemID.CelestialSigil)
|
||||
return !NPC.AnyNPCs(NPCID.MoonLordCore) && !BossRushEvent.BossRushActive;
|
||||
|
||||
return orig(self, sItem);
|
||||
}
|
||||
|
||||
private static void ApplyCelestialSigilChanges(On_Player.orig_ItemCheck_UseEventItems orig, Player self, Item sItem)
|
||||
{
|
||||
if (self.ItemTimeIsZero && self.itemAnimation > 0 && sItem.type == ItemID.CelestialSigil)
|
||||
{
|
||||
if (NPC.AnyNPCs(NPCID.MoonLordCore) || BossRushEvent.BossRushActive)
|
||||
return;
|
||||
|
||||
SoundEngine.PlaySound(SoundID.Roar, self.Center);
|
||||
self.ApplyItemTime(sItem);
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
NPC.SpawnOnPlayer(self.whoAmI, NPCID.MoonLordCore);
|
||||
else
|
||||
NetMessage.SendData(MessageID.SpawnBossUseLicenseStartEvent, -1, -1, null, self.whoAmI, NPCID.MoonLordCore);
|
||||
}
|
||||
else
|
||||
orig(self, sItem);
|
||||
}
|
||||
#endregion
|
||||
|
||||
// 02JUN2024: Ozzatron: The below code is being kept in its initial state for historic value.
|
||||
#region Store The Stupid Fucking Private Wind Map In Public Property
|
||||
private static void StoreWindGrid(On_TileDrawing.orig_Update orig, TileDrawing self)
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace CalamityMod.ILEditing
|
||||
#region Removal of Hardmode Ore Generation from Evil Altars
|
||||
private static void PreventSmashAltarCode(Terraria.On_WorldGen.orig_SmashAltar orig, int i, int j)
|
||||
{
|
||||
if (CalamityConfig.Instance.EarlyHardmodeProgressionRework)
|
||||
if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework)
|
||||
return;
|
||||
|
||||
orig(i, j);
|
||||
|
||||
@@ -8,7 +8,6 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
// TODO -- this item includes a dodge accessory, Brain of Cthulhu
|
||||
public class AmalgamatedBrain : ModItem, ILocalizedModType, IHoldShiftTooltipItem
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
@@ -24,29 +23,10 @@ namespace CalamityMod.Items.Accessories
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.rBrain = true; // Handles shaderain cloud spawning on hit
|
||||
modPlayer.aBrain = true;
|
||||
player.brainOfConfusionItem = Item;
|
||||
if (player.immune)
|
||||
{
|
||||
var source = player.GetSource_Accessory(Item);
|
||||
if (player.miscCounter % 6 == 0)
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
int damage = (int)player.GetBestClassDamage().ApplyTo(60);
|
||||
damage = player.ApplyArmorAccDamageBonusesTo(damage);
|
||||
|
||||
Projectile rain = CalamityUtils.ProjectileRain(source, player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType<AuraRain>(), damage, 2f, player.whoAmI);
|
||||
if (rain.whoAmI.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
rain.DamageType = DamageClass.Generic;
|
||||
rain.tileCollide = false;
|
||||
rain.penetrate = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
player.GetDamage<GenericDamageClass>() += 0.1f;
|
||||
player.GetDamage<GenericDamageClass>() += 0.05f;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public class AmidiasPendant : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
public const int ShardProjectiles = 2;
|
||||
public const float ShardAngleSpread = 120;
|
||||
public int ShardCountdown = 0;
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 26;
|
||||
Item.height = 46;
|
||||
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
|
||||
Item.rare = ItemRarityID.Green;
|
||||
Item.accessory = true;
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
if (ShardCountdown <= 0)
|
||||
{
|
||||
ShardCountdown = 140;
|
||||
}
|
||||
if (ShardCountdown > 0)
|
||||
{
|
||||
ShardCountdown -= Main.rand.Next(1, 4);
|
||||
if (ShardCountdown <= 0)
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
var source = player.GetSource_Accessory(Item);
|
||||
int speed2 = 25;
|
||||
float spawnX = Main.rand.Next(1000) - 500 + player.Center.X;
|
||||
float spawnY = -1000 + player.Center.Y;
|
||||
Vector2 baseSpawn = new Vector2(spawnX, spawnY);
|
||||
Vector2 baseVelocity = player.Center - baseSpawn;
|
||||
baseVelocity.Normalize();
|
||||
baseVelocity *= speed2;
|
||||
int spawnOffset = ShardProjectiles * 15;
|
||||
float spread = -ShardAngleSpread / 2f;
|
||||
for (int i = 0; i < ShardProjectiles; i++)
|
||||
{
|
||||
Vector2 spawn = baseSpawn;
|
||||
spawn.X = spawn.X + i * 30 - spawnOffset;
|
||||
Vector2 velocity = baseVelocity.RotatedBy(MathHelper.ToRadians(spread + (ShardAngleSpread * i / (float)ShardProjectiles)));
|
||||
velocity.X = velocity.X + 3 * Main.rand.NextFloat() - 1.5f;
|
||||
int type = 0;
|
||||
int damage = 0;
|
||||
switch (Main.rand.Next(3))
|
||||
{
|
||||
case 0:
|
||||
type = ModContent.ProjectileType<PendantProjectile1>();
|
||||
damage = 15;
|
||||
break;
|
||||
case 1:
|
||||
type = ModContent.ProjectileType<PendantProjectile2>();
|
||||
damage = 15;
|
||||
break;
|
||||
case 2:
|
||||
type = ModContent.ProjectileType<PendantProjectile3>();
|
||||
damage = 30;
|
||||
break;
|
||||
}
|
||||
|
||||
int finalDamage = (int)player.GetBestClassDamage().ApplyTo(damage);
|
||||
finalDamage = player.ApplyArmorAccDamageBonusesTo(finalDamage);
|
||||
Projectile.NewProjectile(source, spawn.X, spawn.Y, velocity.X / 3, velocity.Y / 2, type, finalDamage, 5f, Main.myPlayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.0 KiB |
@@ -17,6 +17,8 @@ namespace CalamityMod.Items.Accessories
|
||||
Item.accessory = true;
|
||||
}
|
||||
|
||||
public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().transformer;
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
|
||||
@@ -80,9 +80,10 @@ namespace CalamityMod.Items.Accessories
|
||||
// Additional debuff immunities (Everything from Elysian Aegis + thematic counterparts)
|
||||
player.buffImmune[BuffID.CursedInferno] = true;
|
||||
player.buffImmune[BuffID.ShadowFlame] = true;
|
||||
player.buffImmune[BuffID.Daybreak] = true;
|
||||
player.buffImmune[ModContent.BuffType<Daybroken>()] = true;
|
||||
player.buffImmune[ModContent.BuffType<Nightwither>()] = true;
|
||||
player.buffImmune[ModContent.BuffType<HolyFlames>()] = true;
|
||||
player.buffImmune[ModContent.BuffType<Voidfrost>()] = true;
|
||||
|
||||
// Immune to God Slayer Inferno itself
|
||||
player.buffImmune[ModContent.BuffType<GodSlayerInferno>()] = true;
|
||||
|
||||
@@ -22,8 +22,8 @@ namespace CalamityMod.Items.Accessories
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 38;
|
||||
Item.height = 44;
|
||||
Item.width = 50;
|
||||
Item.height = 48;
|
||||
Item.value = CalamityGlobalItem.RarityLimeBuyPrice;
|
||||
Item.rare = ItemRarityID.Lime;
|
||||
Item.defense = 8; // we buff Ankh Shield to 8
|
||||
|
||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories
|
||||
// This is ONLY the direct DPS of having the cursor over the enemy, not the damage from the flames debuff.
|
||||
// The debuff is VulnerabilityHex, check that file for its DPS.
|
||||
public const int BaseDamage = 320;
|
||||
public const int HitsPerSecond = 12;
|
||||
public const int FramesPerHit = 5;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
|
||||
@@ -16,6 +16,7 @@ namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
public bool HasFlavorTooltip => true;
|
||||
public Color? TooltipExtensionColor => new(195, 223, 255);
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace CalamityMod.Items.Accessories
|
||||
public class ElysianAegis : ModItem, ILocalizedModType, IHoldShiftTooltipItem
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
|
||||
public bool HasFlavorTooltip => true;
|
||||
public Color? TooltipExtensionColor => new(195, 223, 255);
|
||||
|
||||
public const int ShieldSlamDamage = 500;
|
||||
@@ -51,7 +51,7 @@ namespace CalamityMod.Items.Accessories
|
||||
player.buffImmune[BuffID.CursedInferno] = true;
|
||||
player.buffImmune[BuffID.ShadowFlame] = true;
|
||||
player.buffImmune[ModContent.BuffType<BrimstoneFlames>()] = true;
|
||||
player.buffImmune[BuffID.Daybreak] = true;
|
||||
player.buffImmune[ModContent.BuffType<Daybroken>()] = true;
|
||||
player.buffImmune[ModContent.BuffType<HolyFlames>()] = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Particles;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
[LegacyName("AmidiasPendant")]
|
||||
public class GiantPearl : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
@@ -22,6 +26,32 @@ namespace CalamityMod.Items.Accessories
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.giantPearl = true;
|
||||
Lighting.AddLight((int)player.Center.X / 16, (int)player.Center.Y / 16, 0.45f, 0.8f, 0.8f);
|
||||
|
||||
// Draw the aura visual
|
||||
float npcDistCompare = 1000f;
|
||||
foreach (NPC n in Main.ActiveNPCs)
|
||||
{
|
||||
if (n.friendly || n.dontTakeDamage)
|
||||
continue;
|
||||
|
||||
float currentNPCDist = Vector2.Distance(n.Center, player.Center);
|
||||
if (currentNPCDist < npcDistCompare)
|
||||
npcDistCompare = currentNPCDist;
|
||||
}
|
||||
float opacity = Utils.Remap(npcDistCompare, 120f, 640f, 1f, 0f);
|
||||
|
||||
if (opacity > 0.7f)
|
||||
{
|
||||
for (int d = 0; d < 3; d++)
|
||||
{
|
||||
Vector2 bubbleSpawn = player.Center + Vector2.UnitX.RotatedByRandom(MathHelper.Pi) * 120f;
|
||||
GenericBubbleParticle bubble = new(bubbleSpawn, Main.rand.NextVector2CircularEdge(0.75f, 0.75f), 0.3f, Main.rand.NextFloat(MathHelper.TwoPi), 8);
|
||||
GeneralParticleHandler.SpawnParticle(bubble);
|
||||
}
|
||||
}
|
||||
|
||||
CustomPulse auraVisual = new(player.Center, Vector2.Zero, new Color(75, 164, 191), "CalamityMod/Particles/HighResFoggyCircleHardEdge", Vector2.One, 0f, 0.12f, 0.1175f, 3, true, opacity);
|
||||
GeneralParticleHandler.SpawnParticle(auraVisual);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,8 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public class GravistarSabaton : ModItem, ILocalizedModType
|
||||
[LegacyName("GravistarSabaton")]
|
||||
public class InterstellarStompers : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
|
||||
@@ -27,6 +28,7 @@ namespace CalamityMod.Items.Accessories
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
player.noFallDmg = true;
|
||||
player.moveSpeed += 0.06f;
|
||||
player.jumpSpeedBoost += 1f;
|
||||
player.Calamity().gSabaton = true;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 891 B After Width: | Height: | Size: 891 B |
@@ -15,7 +15,7 @@ using static CalamityMod.CalamityUtils;
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
[AutoloadEquip(EquipType.Back)]
|
||||
//Its not like its a renamed version of the bayonet, but i put this here more as a way to "refund" the item, so it doesnt end up rotting as an unloaded item.
|
||||
//It's not like it's a renamed version of the bayonet, but I put this here more as a way to "refund" the item, so it doesnt end up rotting as an unloaded item.
|
||||
[LegacyName("MarniteBayonet")]
|
||||
public class MarniteRepulsionShield : ModItem, ILocalizedModType
|
||||
{
|
||||
@@ -27,7 +27,7 @@ namespace CalamityMod.Items.Accessories
|
||||
Item.rare = ItemRarityID.Blue;
|
||||
Item.value = CalamityGlobalItem.RarityBlueBuyPrice;
|
||||
Item.accessory = true;
|
||||
Item.defense = 2;
|
||||
Item.defense = 4;
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
@@ -41,7 +41,7 @@ namespace CalamityMod.Items.Accessories
|
||||
var source = player.GetSource_Accessory(Item);
|
||||
if (player.ownedProjectileCounts[ModContent.ProjectileType<MarniteRepulsionHitbox>()] < 1)
|
||||
{
|
||||
var hitbox = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, ModContent.ProjectileType<MarniteRepulsionHitbox>(), baseDamage, 10f, Main.myPlayer);
|
||||
var hitbox = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, ModContent.ProjectileType<MarniteRepulsionHitbox>(), baseDamage, 12f, Main.myPlayer);
|
||||
hitbox.originalDamage = baseDamage;
|
||||
}
|
||||
}
|
||||
@@ -91,6 +91,7 @@ namespace CalamityMod.Items.Accessories
|
||||
Projectile.penetrate = -1;
|
||||
Projectile.timeLeft = 700;
|
||||
Projectile.tileCollide = false;
|
||||
Projectile.ArmorPenetration = 20;
|
||||
Projectile.netImportant = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,11 +33,11 @@ namespace CalamityMod.Items.Accessories
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.nCore = true;
|
||||
player.GetDamage<GenericDamageClass>() += 0.1f;
|
||||
int damage = (int)player.GetBestClassDamage().ApplyTo(250);
|
||||
damage = player.ApplyArmorAccDamageBonusesTo(damage);
|
||||
float knockBack = 3f;
|
||||
|
||||
// Spawn nebula stars
|
||||
if (Main.rand.NextBool(15))
|
||||
{
|
||||
// Count the number of current active nebula stars; if this is at least 10, no more can spawn
|
||||
int numProj = 0;
|
||||
foreach (Projectile p in Main.ActiveProjectiles)
|
||||
{
|
||||
@@ -46,56 +46,32 @@ namespace CalamityMod.Items.Accessories
|
||||
numProj++;
|
||||
}
|
||||
}
|
||||
var source = player.GetSource_Accessory(Item);
|
||||
if (Main.rand.Next(15) >= numProj && numProj < 10)
|
||||
{
|
||||
int spawnRadius = 24;
|
||||
int backupSpawnRadius = 90;
|
||||
for (int j = 0; j < 50; j++)
|
||||
for (int j = 0; j < 50; j++) // Attempt to spawn the star randomly around the player
|
||||
{
|
||||
int randomProjOffset = Main.rand.Next(200 - j * 2, 400 + j * 2);
|
||||
float randomProjOffset = Main.rand.NextFloat(200 - j * 2, 400 + j * 2);
|
||||
Vector2 center = player.Center;
|
||||
center.X += (float)Main.rand.Next(-randomProjOffset, randomProjOffset + 1);
|
||||
center.Y += (float)Main.rand.Next(-randomProjOffset, randomProjOffset + 1);
|
||||
center.X += Main.rand.NextFloat(-randomProjOffset, randomProjOffset + 1);
|
||||
center.Y += Main.rand.NextFloat(-randomProjOffset, randomProjOffset + 1);
|
||||
// Ensure we are not trying to spawn the star on top of a solid tile or liquid
|
||||
if (!Collision.SolidCollision(center, spawnRadius, spawnRadius) && !Collision.WetCollision(center, spawnRadius, spawnRadius))
|
||||
{
|
||||
center.X += (float)(spawnRadius / 2);
|
||||
center.Y += (float)(spawnRadius / 2);
|
||||
if (Collision.CanHit(new Vector2(player.Center.X, player.position.Y), 1, 1, center, 1, 1) || Collision.CanHit(new Vector2(player.Center.X, player.position.Y - 50f), 1, 1, center, 1, 1))
|
||||
// Ensure the star's spawn point has line-of-sight with the player
|
||||
if (Collision.CanHit(player.Center, 1, 1, center, 1, 1) || Collision.CanHit(player.Center - new Vector2(0f, 50f), 1, 1, center, 1, 1))
|
||||
{
|
||||
int projTileX = (int)center.X / 16;
|
||||
int projTileY = (int)center.Y / 16;
|
||||
bool canSpawnProj = false;
|
||||
if (Main.rand.NextBool(3) && Main.tile[projTileX, projTileY] != null && Main.tile[projTileX, projTileY].WallType > 0)
|
||||
if (Main.rand.NextBool(3) && Main.myPlayer == player.whoAmI)
|
||||
{
|
||||
canSpawnProj = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
center.X -= (float)(backupSpawnRadius / 2);
|
||||
center.Y -= (float)(backupSpawnRadius / 2);
|
||||
if (Collision.SolidCollision(center, backupSpawnRadius, backupSpawnRadius))
|
||||
{
|
||||
center.X += (float)(backupSpawnRadius / 2);
|
||||
center.Y += (float)(backupSpawnRadius / 2);
|
||||
canSpawnProj = true;
|
||||
}
|
||||
}
|
||||
if (canSpawnProj)
|
||||
{
|
||||
for (int k = 0; k < Main.maxProjectiles; k++)
|
||||
{
|
||||
if (Main.projectile[k].active && Main.projectile[k].owner == player.whoAmI && Main.projectile[k].type == ModContent.ProjectileType<NebulaStar>() && (center - Main.projectile[k].Center).Length() < 48f)
|
||||
{
|
||||
canSpawnProj = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (canSpawnProj && Main.myPlayer == player.whoAmI)
|
||||
{
|
||||
Projectile.NewProjectile(source, center.X, center.Y, 0f, 0f, ModContent.ProjectileType<NebulaStar>(), damage, knockBack, player.whoAmI);
|
||||
return;
|
||||
}
|
||||
var source = player.GetSource_Accessory(Item);
|
||||
int damage = (int)player.GetBestClassDamage().ApplyTo(250);
|
||||
damage = player.ApplyArmorAccDamageBonusesTo(damage);
|
||||
float knockBack = 3f;
|
||||
|
||||
Projectile.NewProjectile(source, center.X, center.Y, 0f, 0f, ModContent.ProjectileType<NebulaStar>(), damage, knockBack, player.whoAmI);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace CalamityMod.Items.Accessories
|
||||
public class RaidersTalisman : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
public const float RaiderBonus = 12f;
|
||||
public const float RaiderBonus = 10f;
|
||||
public const int RaiderCooldown = 5;
|
||||
public static readonly SoundStyle StealthHitSound = new("CalamityMod/Sounds/Custom/RaidersTalismanStealthHit");
|
||||
|
||||
|
||||
@@ -20,28 +20,9 @@ namespace CalamityMod.Items.Accessories
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
if (player.immune)
|
||||
{
|
||||
var source = player.GetSource_Accessory(Item);
|
||||
if (player.miscCounter % 6 == 0)
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
int damage = (int)player.GetBestClassDamage().ApplyTo(18);
|
||||
damage = player.ApplyArmorAccDamageBonusesTo(damage);
|
||||
|
||||
Projectile rain = CalamityUtils.ProjectileRain(source, player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType<AuraRain>(), damage, 2f, player.whoAmI);
|
||||
if (rain.whoAmI.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
rain.DamageType = DamageClass.Generic;
|
||||
rain.tileCollide = false;
|
||||
rain.penetrate = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.rBrain = true;
|
||||
player.GetDamage<GenericDamageClass>() += 0.06f;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
|
||||
@@ -34,8 +34,8 @@ namespace CalamityMod.Items.Accessories
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<SulphuricScale>(20).
|
||||
AddRecipeGroup("AnySilverBar", 10).
|
||||
AddIngredient<SulphuricScale>(3).
|
||||
AddTile(TileID.Anvils).
|
||||
Register();
|
||||
}
|
||||
|
||||
@@ -7,8 +7,6 @@ namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public class SandCloak : ModItem, ILocalizedModType
|
||||
{
|
||||
public static float KnockbackStrength = 0.3f;
|
||||
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -17,7 +15,6 @@ namespace CalamityMod.Items.Accessories
|
||||
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
|
||||
Item.rare = ItemRarityID.Green;
|
||||
Item.accessory = true;
|
||||
Item.defense = 2;
|
||||
}
|
||||
|
||||
public override void ModifyTooltips(List<TooltipLine> list) => list.IntegrateHotkey(CalamityKeybinds.SandCloakHotkey);
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public class TeslasAmulet : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.RegisterItemAnimation(Type, new DrawAnimationVertical(5, 14));
|
||||
ItemID.Sets.AnimatesAsSoul[Type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 32;
|
||||
Item.height = 32;
|
||||
Item.rare = ItemRarityID.Orange;
|
||||
Item.value = CalamityGlobalItem.RarityOrangeBuyPrice;
|
||||
Item.accessory = true;
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
player.Calamity().tesla = true;
|
||||
player.Calamity().teslaVisuals = !hideVisual;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient(ItemID.BottledWater).
|
||||
AddIngredient<AerialiteBar>(8).
|
||||
AddIngredient<SeaPrism>(8).
|
||||
AddIngredient<StormlionMandible>(4).
|
||||
AddTile(TileID.Anvils).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
@@ -34,28 +34,10 @@ namespace CalamityMod.Items.Accessories
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.rBrain = true; // Handles shaderain cloud spawning on hit
|
||||
modPlayer.amalgam = true;
|
||||
player.brainOfConfusionItem = Item;
|
||||
player.GetDamage<GenericDamageClass>() += 0.15f;
|
||||
|
||||
if (player.immune)
|
||||
{
|
||||
var source = player.GetSource_Accessory(Item);
|
||||
if (player.miscCounter % 6 == 0)
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
int damage = (int)player.GetBestClassDamage().ApplyTo(300);
|
||||
Projectile rain = CalamityUtils.ProjectileRain(source, player.Center, 400f, 100f, 500f, 800f, 22f, ProjectileType<AuraRain>(), damage, 2f, player.whoAmI);
|
||||
if (rain.whoAmI.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
rain.DamageType = DamageClass.Generic;
|
||||
rain.tileCollide = false;
|
||||
rain.penetrate = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
|
||||
@@ -7,6 +7,7 @@ namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public class TheBee : ModItem, ILocalizedModType
|
||||
{
|
||||
public static int CooldownLength = 600;
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
public override void SetDefaults()
|
||||
{
|
||||
|
||||
@@ -27,6 +27,8 @@ namespace CalamityMod.Items.Accessories
|
||||
Item.accessory = true;
|
||||
}
|
||||
|
||||
public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().aSpark;
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
|
||||
|
Before Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 480 B |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
@@ -1,69 +0,0 @@
|
||||
using CalamityMod;
|
||||
using CalamityMod.CalPlayer;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
|
||||
namespace CalamityMod.Items.Accessories.Vanity
|
||||
{
|
||||
public class CocosFeather : ModItem, IExtendedHat, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
public override void Load()
|
||||
{
|
||||
if (Main.netMode != NetmodeID.Server)
|
||||
{
|
||||
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Birds_Head", EquipType.Head, this);
|
||||
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Birds_Torso", EquipType.Body, this);
|
||||
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Birds_Legs", EquipType.Legs, this);
|
||||
}
|
||||
}
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
|
||||
if (Main.netMode == NetmodeID.Server)
|
||||
return;
|
||||
|
||||
int equipSlotHead = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Head);
|
||||
ArmorIDs.Head.Sets.DrawHead[equipSlotHead] = false;
|
||||
|
||||
int equipSlotBody = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body);
|
||||
ArmorIDs.Body.Sets.HidesTopSkin[equipSlotBody] = true;
|
||||
ArmorIDs.Body.Sets.HidesArms[equipSlotBody] = true;
|
||||
|
||||
int equipSlotLegs = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs);
|
||||
ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlotLegs] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 42;
|
||||
Item.height = 38;
|
||||
Item.accessory = true;
|
||||
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
|
||||
Item.rare = ItemRarityID.Green;
|
||||
Item.vanity = true;
|
||||
Item.Calamity().devItem = true;
|
||||
}
|
||||
|
||||
public override void UpdateVanity(Player player)
|
||||
{
|
||||
player.Calamity().cocosFeather = true;
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
if (!hideVisual)
|
||||
{
|
||||
player.Calamity().cocosFeather = true;
|
||||
}
|
||||
}
|
||||
public string ExtensionTexture => "CalamityMod/Items/Accessories/Vanity/Birds_Head_Extension";
|
||||
public Vector2 ExtensionSpriteOffset(PlayerDrawSet drawInfo) => new Vector2(0, -4f);
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 753 B |
|
After Width: | Height: | Size: 5.7 KiB |