diff --git a/Buffs/DamageOverTime/Laceration.cs b/Buffs/DamageOverTime/Laceration.cs index ded4f05975..621b51dfe4 100644 --- a/Buffs/DamageOverTime/Laceration.cs +++ b/Buffs/DamageOverTime/Laceration.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -29,20 +30,44 @@ namespace CalamityMod.Buffs.DamageOverTime npc.DelBuff(buffIndex); buffIndex--; } + internal static void DrawEffects(PlayerDrawSet drawInfo) + { + Player player = drawInfo.drawPlayer; + var modPlayer = player.Calamity(); + + if (Main.rand.NextBool()) + { + Vector2 randVel = new Vector2(6, 6).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 1f); + Dust dust = Dust.NewDustPerfect(modPlayer.RandomDebuffVisualSpot, 5, randVel * Main.rand.NextFloat(0.1f, 0.8f), 100, default, Main.rand.NextFloat(0.6f, 0.9f)); + dust.noGravity = false; + Particle spark = new AltSparkParticle(modPlayer.RandomDebuffVisualSpot, randVel + new Vector2(0, -4), true, 12, Main.rand.NextFloat(0.25f, 0.6f), Color.DarkRed * 0.5f); + GeneralParticleHandler.SpawnParticle(spark); + } + if (Main.rand.NextBool(8)) + { + Particle spark = new GlowOrbParticle(modPlayer.RandomDebuffVisualSpot, new Vector2(0, 4) * Main.rand.NextFloat(0.5f, 0.7f), true, 16, Main.rand.NextFloat(0.55f, 0.8f), Color.DarkRed * 0.8f, false, false, false); + GeneralParticleHandler.SpawnParticle(spark); + } + } 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)); + Vector2 randVel = new Vector2(6, 6).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 1f); if (Main.rand.NextBool(3)) { - for (int b = 0; b < 2; b++) - { - Vector2 bloodVel = Main.rand.NextVector2CircularEdge(1f, 1f); - bloodVel.SafeNormalize(Vector2.Zero); - bloodVel *= Main.rand.NextFloat(4f, 7f); - - Particle bloody = new BloodParticle(npc.Center, bloodVel, 40, 0.75f, new Color(192, 0, 0)); - GeneralParticleHandler.SpawnParticle(bloody); - } + Particle spark = new AltSparkParticle(npcSize, randVel + new Vector2(0, -4), true, 12, Main.rand.NextFloat(0.25f, 0.6f), Color.DarkRed * 0.5f); + GeneralParticleHandler.SpawnParticle(spark); + } + else + { + Dust dust = Dust.NewDustPerfect(npcSize, 5, randVel * Main.rand.NextFloat(0.1f, 0.8f), 100, default, Main.rand.NextFloat(0.2f, 0.6f)); + dust.noGravity = false; + } + if (Main.rand.NextBool(8)) + { + Particle spark = new GlowOrbParticle(npcSize, new Vector2(0, 4) * Main.rand.NextFloat(0.5f, 0.7f), true, 16, Main.rand.NextFloat(0.55f, 0.8f), Color.DarkRed * 0.8f, false, false, false); + GeneralParticleHandler.SpawnParticle(spark); } } } diff --git a/Buffs/DamageOverTime/RiptideDebuff.cs b/Buffs/DamageOverTime/RiptideDebuff.cs index 0de09111d2..44ab9c9d92 100644 --- a/Buffs/DamageOverTime/RiptideDebuff.cs +++ b/Buffs/DamageOverTime/RiptideDebuff.cs @@ -32,8 +32,9 @@ namespace CalamityMod.Buffs.DamageOverTime internal static void DrawEffects(PlayerDrawSet drawInfo) { Player Player = drawInfo.drawPlayer; + var modPlayer = Player.Calamity(); - if (Main.rand.NextBool(7)) + if (Main.rand.NextBool(14)) { int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, DustID.FungiHit, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1f); Main.dust[dust].noGravity = false; @@ -41,16 +42,29 @@ namespace CalamityMod.Buffs.DamageOverTime Main.dust[dust].velocity.Y += 0.8f; drawInfo.DustCache.Add(dust); } + if (Main.rand.NextBool(9)) + { + Gore bubble = Gore.NewGorePerfect(Player.GetSource_FromAI(), modPlayer.RandomDebuffVisualSpot, new Vector2(2f, 2f).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 0.7f), 411); + bubble.timeLeft = 4 + Main.rand.Next(7); + bubble.scale = Main.rand.NextFloat(0.6f, 1f); + bubble.type = Main.rand.NextBool(3) ? 412 : 411; + } } internal static void DrawEffects(NPC npc, ref Color drawColor) { - if (Main.rand.Next(7) < 3) + 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(9)) { - int dust = Dust.NewDust(npc.position - new Vector2(2f, 2f), npc.width + 4, npc.height + 4, DustID.FungiHit, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 1f); - Main.dust[dust].noGravity = false; - Main.dust[dust].velocity *= 1.2f; - Main.dust[dust].velocity.Y += 0.5f; + Dust dust = Dust.NewDustPerfect(npcSize, 76, new Vector2(2f, 2f).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 0.7f), 0, default, Main.rand.NextFloat(0.2f, 0.6f)); + dust.color = (Main.rand.NextBool(3) ? Color.LightBlue : Color.LightSkyBlue); + } + if (Main.rand.NextBool(8)) + { + Gore bubble = Gore.NewGorePerfect(npc.GetSource_FromAI(), npcSize, new Vector2(2f, 2f).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 0.7f), 411); + bubble.timeLeft = 4 + Main.rand.Next(7); + bubble.scale = Main.rand.NextFloat(0.6f, 1f); + bubble.type = Main.rand.NextBool(3) ? 412 : 411; } } } diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index 52366027c3..a3b04b91cf 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -85,6 +85,7 @@ namespace CalamityMod.ILEditing On_Player.UpdateItemDye += FindCalamityItemDyeShader; On_AWorldListItem.GetDifficulty += GetDifficultyOverride; On_Item.GetShimmered += ShimmerEffectEdits; + Terraria.On_Player.Teleport += TPOverride; // Mana Burn (Chaos Stone) and Chalice of the Blood God IL_Player.ApplyLifeAndOrMana += ManaSicknessAndChaliceBufferHeal; diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index d760dabb3a..b39756e7be 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -22,6 +22,7 @@ using CalamityMod.Projectiles; using CalamityMod.Projectiles.Typeless; using CalamityMod.Systems; using CalamityMod.Tiles.Abyss; +using CalamityMod.Walls; using CalamityMod.Waterfalls; using CalamityMod.Waters; using Microsoft.Xna.Framework; @@ -1495,5 +1496,45 @@ namespace CalamityMod.ILEditing } } #endregion + + #region Block Abyss from Teleportation Potions + + public static void TPOverride(Terraria.On_Player.orig_Teleport orig, Player self, Vector2 newPos, int Style = 0, int extraInfo = 0) + { + // Grab the tile from where the potion wants to teleport + Tile t = CalamityUtils.ParanoidTileRetrieval(newPos.ToTileCoordinates().X, newPos.ToTileCoordinates().Y); + // Check if it's a Teleportation Potion + if (Style == 2) + { + // Check if it's an Abyss wall + if (t.WallType == ModContent.WallType() || t.WallType == ModContent.WallType() || t.WallType == ModContent.WallType() || t.WallType == ModContent.WallType() || t.WallType == ModContent.WallType() || t.WallType == ModContent.WallType()) + { + // If an Abyss wall is detected, try to find another teleportation location + bool canSpawn = false; + int teleportStartX = 100; + int teleportRangeX = Main.maxTilesX - 200; + int teleportStartY = 100; + int underworldLayer = Main.UnderworldLayer; + Vector2 newerPos = self.CheckForGoodTeleportationSpot(ref canSpawn, teleportStartX, teleportRangeX, teleportStartY, underworldLayer, new Player.RandomTeleportationAttemptSettings + { + avoidLava = true, + avoidHurtTiles = true, + maximumFallDistanceFromOrignalPoint = 100, + attemptsBeforeGivingUp = 1000 + }); + // Attempt teleporting again with the new location + orig(self, newerPos, Style, extraInfo); + } + else + { + orig(self, newPos, Style, extraInfo); + } + } + else + { + orig(self, newPos, Style, extraInfo); + } + } + #endregion } } diff --git a/Items/Accessories/Wings/ElysianWings_Wings.png b/Items/Accessories/Wings/ElysianWings_Wings.png index 42659430ad..82759640f1 100644 Binary files a/Items/Accessories/Wings/ElysianWings_Wings.png and b/Items/Accessories/Wings/ElysianWings_Wings.png differ diff --git a/Items/Weapons/Ranged/NitroExpressRifle.cs b/Items/Weapons/Ranged/NitroExpressRifle.cs index eab45c79d1..c7111ac95b 100644 --- a/Items/Weapons/Ranged/NitroExpressRifle.cs +++ b/Items/Weapons/Ranged/NitroExpressRifle.cs @@ -65,7 +65,9 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - player.velocity += -velocity * 0.3f; + Vector2 recoilVelocity = velocity; + recoilVelocity.Normalize(); + player.velocity += -recoilVelocity * 7f; if (type == ProjectileID.Bullet) type = ModContent.ProjectileType(); Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0f); diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.Wings.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.Wings.hjson index 4e8375354c..880417844b 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.Wings.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.Wings.hjson @@ -30,7 +30,7 @@ ElysianWings: { Acceleration multiplier: 2.7 Great vertical speed Flight time: 240 - Temporary immunity to lava and 10% increased movement speed + Immunity to lava and 10% increased movement speed Blessed by the Profaned Flame ''' }