diff --git a/Items/Dyes/BaseDye.cs b/Items/Dyes/BaseDye.cs index bb2837aa67..65d718738e 100644 --- a/Items/Dyes/BaseDye.cs +++ b/Items/Dyes/BaseDye.cs @@ -1,3 +1,4 @@ +using Terraria; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -12,7 +13,10 @@ namespace CalamityMod.Items.Dyes } public sealed override void SetStaticDefaults() { - GameShaders.Armor.BindShader(item.type, ShaderDataToBind); + if (!Main.dedServ) + { + GameShaders.Armor.BindShader(item.type, ShaderDataToBind); + } SafeSetStaticDefaults(); } public sealed override void SetDefaults() diff --git a/Items/Materials/DepthCells.png b/Items/Materials/DepthCells.png index 1475b534ef..75d3fe54a6 100644 Binary files a/Items/Materials/DepthCells.png and b/Items/Materials/DepthCells.png differ diff --git a/Items/Materials/Lumenite.png b/Items/Materials/Lumenite.png index 012625eb5d..b67689835f 100644 Binary files a/Items/Materials/Lumenite.png and b/Items/Materials/Lumenite.png differ diff --git a/Items/Weapons/Magic/AquamarineStaff.cs b/Items/Weapons/Magic/AquamarineStaff.cs index b2a3f00265..ffcd12cb7b 100644 --- a/Items/Weapons/Magic/AquamarineStaff.cs +++ b/Items/Weapons/Magic/AquamarineStaff.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Magic public override Vector2? HoldoutOrigin() { - return new Vector2(15, 15); + return new Vector2(10, 10); } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/NPCs/Cryogen/IceMass.cs b/NPCs/Cryogen/IceMass.cs index ea66820ec8..2680500612 100644 --- a/NPCs/Cryogen/IceMass.cs +++ b/NPCs/Cryogen/IceMass.cs @@ -1,4 +1,5 @@ using CalamityMod.World; +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -10,7 +11,7 @@ namespace CalamityMod.NPCs.Cryogen public override void SetStaticDefaults() { DisplayName.SetDefault("Aurora Spirit"); - Main.npcFrameCount[npc.type] = 6; + Main.npcFrameCount[npc.type] = 5; } public override void SetDefaults() @@ -27,13 +28,40 @@ namespace CalamityMod.NPCs.Cryogen npc.lifeMax = 30000; } npc.knockBackResist = 0f; - animationType = 472; npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit5; npc.DeathSound = SoundID.NPCDeath15; npc.coldDamage = true; } + public override void FindFrame(int frameHeight) + { + int num1 = 1; + if (!Main.dedServ) + { + if (!Main.NPCLoaded[npc.type] || Main.npcTexture[npc.type] == null) + return; + num1 = Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type]; + } + if (npc.velocity.X < 0f) + npc.direction = -1; + else + npc.direction = 1; + if (npc.direction == 1) + npc.spriteDirection = 1; + if (npc.direction == -1) + npc.spriteDirection = -1; + npc.rotation = (float)Math.Atan2((double)npc.velocity.Y * (double)npc.direction, (double)npc.velocity.X * (double)npc.direction); + npc.frameCounter++; + if (npc.frameCounter > 4) + { + npc.frame.Y += num1; + npc.frameCounter = 0; + } + if (npc.frame.Y / num1 >= Main.npcFrameCount[npc.type]) + npc.frame.Y = 0; + } + public override void OnHitPlayer(Player player, int damage, bool crit) { player.AddBuff(BuffID.Frostburn, 90, true); diff --git a/NPCs/Cryogen/IceMass.png b/NPCs/Cryogen/IceMass.png index 894d997568..f85f260eba 100644 Binary files a/NPCs/Cryogen/IceMass.png and b/NPCs/Cryogen/IceMass.png differ diff --git a/Projectiles/Magic/AquamarineBolt.cs b/Projectiles/Magic/AquamarineBolt.cs index b02c21774b..fa855a7ebe 100644 --- a/Projectiles/Magic/AquamarineBolt.cs +++ b/Projectiles/Magic/AquamarineBolt.cs @@ -1,6 +1,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { @@ -9,12 +10,14 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { DisplayName.SetDefault("Bolt"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 2; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; } public override void SetDefaults() { - projectile.width = 8; - projectile.height = 8; + projectile.width = 16; + projectile.height = 16; projectile.friendly = true; projectile.ignoreWater = true; projectile.penetrate = 1; @@ -24,27 +27,26 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0.25f / 255f, (255 - projectile.alpha) * 0.25f / 255f); - for (int num151 = 0; num151 < 3; num151++) - { - int num154 = 14; - int num155 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, 68, 0f, 0f, 100, default, 1.5f); - Main.dust[num155].noGravity = true; - Main.dust[num155].velocity *= 0.1f; - Main.dust[num155].velocity += projectile.velocity * 0.5f; - } - if (Main.rand.NextBool(8)) + int num154 = 14; + int num155 = Dust.NewDust(projectile.Center, projectile.width - num154 * 2, projectile.height - num154 * 2, 68, 0f, 0f, 100, default, 1.5f); + Main.dust[num155].noGravity = true; + Main.dust[num155].velocity *= 0.1f; + Main.dust[num155].velocity += projectile.velocity * 0.5f; + if (Main.rand.NextBool(16)) { int num156 = 16; - int num157 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num156 * 2, projectile.height - num156 * 2, 68, 0f, 0f, 100, default, 1f); + int num157 = Dust.NewDust(projectile.Center, projectile.width - num156 * 2, projectile.height - num156 * 2, 68, 0f, 0f, 100, default, 1f); Main.dust[num157].velocity *= 0.25f; Main.dust[num157].velocity += projectile.velocity * 0.5f; } + projectile.rotation += 0.3f * (float)projectile.direction; } + public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, 200); + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - Texture2D tex = Main.projectileTexture[projectile.type]; - spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); return false; } } diff --git a/Projectiles/Magic/AquamarineBolt.png b/Projectiles/Magic/AquamarineBolt.png index 0056fc1e24..bfb8c86d2a 100644 Binary files a/Projectiles/Magic/AquamarineBolt.png and b/Projectiles/Magic/AquamarineBolt.png differ diff --git a/Projectiles/Magic/AuraRain.cs b/Projectiles/Magic/AuraRain.cs index 486a150678..cbba29991f 100644 --- a/Projectiles/Magic/AuraRain.cs +++ b/Projectiles/Magic/AuraRain.cs @@ -1,5 +1,8 @@ using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { @@ -12,8 +15,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetDefaults() { - projectile.width = 2; - projectile.height = 2; + projectile.width = 10; + projectile.height = 10; projectile.aiStyle = 45; projectile.friendly = true; projectile.penetrate = -1; @@ -23,17 +26,25 @@ namespace CalamityMod.Projectiles.Magic projectile.scale = 1.1f; projectile.magic = true; projectile.extraUpdates = 1; - aiType = 239; + aiType = ProjectileID.RainFriendly; } public override void AI() { - Dust dust4 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 14, projectile.velocity.X, projectile.velocity.Y, 100, default, 1f)]; - dust4.velocity = Vector2.Zero; - dust4.position -= projectile.velocity / 5f; - dust4.noGravity = true; - dust4.scale = 0.8f; - dust4.noLight = true; + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) - MathHelper.PiOver2; + Dust dust = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 14, projectile.velocity.X, projectile.velocity.Y, 100, default, 1f)]; + dust.velocity = Vector2.Zero; + dust.position -= projectile.velocity / 5f; + dust.noGravity = true; + dust.scale = 0.8f; + dust.noLight = true; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D tex = Main.projectileTexture[projectile.type]; + spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + return false; } } } diff --git a/Projectiles/Magic/AuraRain.png b/Projectiles/Magic/AuraRain.png index 0c09522090..f129a7b060 100644 Binary files a/Projectiles/Magic/AuraRain.png and b/Projectiles/Magic/AuraRain.png differ diff --git a/Projectiles/Summon/SolarGod.cs b/Projectiles/Summon/SolarGod.cs index e57f8abe75..242828bf03 100644 --- a/Projectiles/Summon/SolarGod.cs +++ b/Projectiles/Summon/SolarGod.cs @@ -147,14 +147,8 @@ namespace CalamityMod.Projectiles.Summon } } - public override Color? GetAlpha(Color lightColor) - { - return new Color(200, 200, 200, 200); - } + public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, 200); - public override bool CanDamage() - { - return false; - } + public override bool CanDamage() => false; } } diff --git a/World/CalamityWorld.cs b/World/CalamityWorld.cs index 1eed03e300..5c5f53b36e 100644 --- a/World/CalamityWorld.cs +++ b/World/CalamityWorld.cs @@ -968,17 +968,31 @@ namespace CalamityMod.World if (rainingAcid) { - for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++) - { - if (Main.player[playerIndex].active) - { - if (Main.player[playerIndex].Calamity().ZoneSulphur) - { - startAcidicDownpour = true; - CalamityMod.UpdateServerBoolean(); - } - } - } + if (!startAcidicDownpour) + { + int sulphSeaWidth = Abyss.BiomeWidth; + for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++) + { + // A variable named "player" already exists above, which retrieves the player who is closest to the map center. + Player player2 = Main.player[playerIndex]; + if (player2.active) + { + // An artificial biome can be made, and therefore, the event could be started by an artificial biome. + // While fighting the event in an artificial biome is not bad, having it be started by a patch of Sulphurous Sand + // would definitely be strange. + // Because of this, this code is executed based on if the player is in the sea (based on tile count) AND position relative to the naturally generated sea. + if (((player2.Center.X <= (sulphSeaWidth + 60f) * 16f && abyssSide) || + (player2.Center.X >= (Main.maxTilesX - (sulphSeaWidth + 60f)) * 16f && !abyssSide)) && + player2.Calamity().ZoneSulphur) + { + startAcidicDownpour = true; + CalamityMod.UpdateServerBoolean(); + break; + } + } + } + } + // Makes rain pour at its maximum intensity (but only after an idiot meanders into the Sulphurous Sea) // You'll never catch me, Fabs, Not when I shift into MAXIMUM OVERDRIVE!! if (startAcidicDownpour || forcedDownpourWithTear) @@ -994,7 +1008,7 @@ namespace CalamityMod.World } // Summon Old Duke tornado post-Polter as needed - if (downedPolterghast && acidRainPoints == 2f) + if (downedPolterghast && acidRainPoints == 2) { if (!NPC.AnyNPCs(ModContent.NPCType()) && CalamityUtils.CountProjectiles(ModContent.ProjectileType()) <= 0)