From 38e60738cd84d2f7422e3972462320beee2c657c Mon Sep 17 00:00:00 2001 From: mochi-angel Date: Mon, 17 Jun 2024 16:24:16 -0700 Subject: [PATCH 001/133] Base implementation --- Items/Weapons/Ranged/FlakToxicannon.cs | 1 - Items/Weapons/Ranged/Leviatitan.cs | 50 ++++---- ...ods.CalamityMod.Items.Weapons.Ranged.hjson | 7 +- .../Mods.CalamityMod.Projectiles.Ranged.hjson | 1 + Projectiles/Ranged/AquaBlast.cs | 13 +- Projectiles/Ranged/AquaBlastToxic.cs | 24 +++- Projectiles/Ranged/LeviatitanAberration.cs | 102 +++++++++++++++ Projectiles/Ranged/LeviatitanHoldout.cs | 118 ++++++++++++++++++ 8 files changed, 284 insertions(+), 32 deletions(-) create mode 100644 Projectiles/Ranged/LeviatitanAberration.cs create mode 100644 Projectiles/Ranged/LeviatitanHoldout.cs diff --git a/Items/Weapons/Ranged/FlakToxicannon.cs b/Items/Weapons/Ranged/FlakToxicannon.cs index 78d2f57a2b..cbebae4cc0 100644 --- a/Items/Weapons/Ranged/FlakToxicannon.cs +++ b/Items/Weapons/Ranged/FlakToxicannon.cs @@ -35,7 +35,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.useTime = Item.useAnimation = 44; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 15f; - Item.width = 88; Item.height = 28; Item.noMelee = true; diff --git a/Items/Weapons/Ranged/Leviatitan.cs b/Items/Weapons/Ranged/Leviatitan.cs index 2130046725..f5afd38582 100644 --- a/Items/Weapons/Ranged/Leviatitan.cs +++ b/Items/Weapons/Ranged/Leviatitan.cs @@ -1,6 +1,12 @@ -using CalamityMod.Projectiles.Ranged; +using System.Diagnostics.Metrics; +using CalamityMod.Particles; +using CalamityMod.Projectiles.Magic; +using CalamityMod.Projectiles.Ranged; +using CalamityMod.Projectiles.Rogue; +using Microsoft.Build.Tasks; using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -10,46 +16,44 @@ namespace CalamityMod.Items.Weapons.Ranged public class Leviatitan : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; + public override void SetDefaults() { Item.width = 82; Item.height = 28; - Item.damage = 77; + Item.damage = 117; Item.DamageType = DamageClass.Ranged; - Item.useTime = 10; - Item.useAnimation = 10; - Item.useStyle = ItemUseStyleID.Shoot; + Item.useTime = Item.useAnimation = 18; + Item.noUseGraphic = true; + Item.channel = true; Item.noMelee = true; Item.knockBack = 5f; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; - Item.UseSound = SoundID.Item92; + Item.UseSound = new SoundStyle("CalamityMod/Sounds/Item/DudFire") with { Volume = .4f, Pitch = -.7f, PitchVariance = 0.1f }; Item.autoReuse = true; - Item.shoot = ModContent.ProjectileType(); + Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 12f; - Item.useAmmo = AmmoID.Bullet; + Item.useStyle = ItemUseStyleID.Shoot; Item.Calamity().canFirePointBlankShots = true; + Item.useAmmo = AmmoID.Bullet; } - public override Vector2? HoldoutOffset() - { - return new Vector2(-15, 0); - } + // Obviously we don't want multiple holdouts existing at the same time. + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] == 0; + + // Spawning the holdout won't consume ammo. + public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] != 0; + + // Makes the rotation of the mouse around the player sync in multiplayer. + public override void HoldItem(Player player) => player.Calamity().mouseWorldListener = true; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - float SpeedX = velocity.X + Main.rand.Next(-10, 11) * 0.05f; - float SpeedY = velocity.Y + Main.rand.Next(-10, 11) * 0.05f; + Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, player.whoAmI); - if (type == ProjectileID.Bullet) - { - if (Main.rand.NextBool(3)) - Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType(), (int)(damage * 1.5), knockback, player.whoAmI); - else - Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType(), damage, knockback, player.whoAmI); - } - else - Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI); + // We set the rotation to the direction to the mouse so the first frame doesn't appear bugged out. + holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero); return false; } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index 8cf1520dc0..84f95c7e74 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -693,7 +693,12 @@ Kingsbane: { Leviatitan: { DisplayName: Leviatitan - Tooltip: Converts musket balls into toxic and normal water blasts + Tooltip: + ''' + Converts musket balls into high velocity aqua blasts + Fires homing aberrations that shred enemy defense every 7th shot + to vomit a meteor that explodes on hit + ''' } LunarianBow: { diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson index 00a4491211..9bcc2d7f26 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson @@ -253,3 +253,4 @@ WildfireBloomFlare.DisplayName: Wildfire Flare WulfrumScrapBullet.DisplayName: High Speed Scrap NitroShot.DisplayName: Nitro Shot ChargedBlastSplit.DisplayName: Charged Blast Split +LeviatitanAberration.DisplayName: Leviatitan Aberration diff --git a/Projectiles/Ranged/AquaBlast.cs b/Projectiles/Ranged/AquaBlast.cs index 0397ad3904..de5536f071 100644 --- a/Projectiles/Ranged/AquaBlast.cs +++ b/Projectiles/Ranged/AquaBlast.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -53,6 +54,16 @@ namespace CalamityMod.Projectiles.Ranged Main.dust[dust].noGravity = true; Main.dust[dust].velocity = dspeed; } + if (Projectile.timeLeft <= 580 && Projectile.timeLeft % 3 == 0) + { + Particle spark = new LineParticle(Projectile.Center - Projectile.velocity + Main.rand.NextVector2Circular(20, 20), -Projectile.velocity * Main.rand.NextFloat(0.2f, 1.8f), false, Main.rand.Next(9, 20 + 1), Main.rand.NextFloat(0.8f, 1.2f), Color.Lerp(Color.Cyan, Color.AliceBlue, Main.rand.NextFloat(0.35f)) * Main.rand.NextFloat(0.15f, 0.5f)); + GeneralParticleHandler.SpawnParticle(spark); + } + if (Main.rand.NextBool(6)) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(20, 20), 75, -Projectile.velocity.RotatedByRandom(0.1) * Main.rand.NextFloat(0.1f, 0.3f), 0, default, Main.rand.NextFloat(0.5f, 1.2f)); + dust.noGravity = true; + } } public override void OnKill(int timeLeft) diff --git a/Projectiles/Ranged/AquaBlastToxic.cs b/Projectiles/Ranged/AquaBlastToxic.cs index 963152fa75..0edbad3be6 100644 --- a/Projectiles/Ranged/AquaBlastToxic.cs +++ b/Projectiles/Ranged/AquaBlastToxic.cs @@ -1,5 +1,9 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Graphics.Primitives; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -45,12 +49,15 @@ namespace CalamityMod.Projectiles.Ranged Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == 1 ? 0f : MathHelper.Pi) + MathHelper.ToRadians(90) * Projectile.direction; Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0.35f / 255f, (255 - Projectile.alpha) * 0.4f / 255f); - for (int i = 0; i < 2; i++) + if (Projectile.timeLeft <= 580 && Projectile.timeLeft % 3 == 0) { - Vector2 dspeed = -Projectile.velocity * Main.rand.NextFloat(0.5f * 0.8f); - int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.GemEmerald, 0f, 0f, 100, default, 1f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity = dspeed; + Particle spark = new LineParticle(Projectile.Center - Projectile.velocity + Main.rand.NextVector2Circular(20, 20), -Projectile.velocity * Main.rand.NextFloat(0.2f, 1.8f), false, Main.rand.Next(9, 20 + 1), Main.rand.NextFloat(0.8f, 1.2f), Color.Chartreuse * Main.rand.NextFloat(0.15f, 0.5f)); + GeneralParticleHandler.SpawnParticle(spark); + } + if (Main.rand.NextBool(6)) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(20, 20), 75, -Projectile.velocity.RotatedByRandom(0.1) * Main.rand.NextFloat(0.1f, 0.3f), 0, default, Main.rand.NextFloat(0.5f, 1.2f)); + dust.noGravity = true; } } @@ -60,6 +67,11 @@ namespace CalamityMod.Projectiles.Ranged { Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.GemEmerald, 0f, 0f, 100, default, 1f); } + for (int i = 0; i <= 3; i++) + { + Particle skull = new DesertProwlerSkullParticle(Projectile.Center, new Vector2(2.5f, 2.5f).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1f), Main.rand.NextBool() ? Color.LightGreen: Color.Lime, Color.LimeGreen, Main.rand.NextFloat(0.2f, 0.9f), 175); + GeneralParticleHandler.SpawnParticle(skull); + } } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) diff --git a/Projectiles/Ranged/LeviatitanAberration.cs b/Projectiles/Ranged/LeviatitanAberration.cs new file mode 100644 index 0000000000..8f51f3bd11 --- /dev/null +++ b/Projectiles/Ranged/LeviatitanAberration.cs @@ -0,0 +1,102 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class LeviatitanAberration : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Ranged"; + public override string Texture => "CalamityMod/Projectiles/Summon/GastricBelcher"; + public override void SetStaticDefaults() + { + Main.projFrames[Projectile.type] = 4; + ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8; + ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + } + + public override void SetDefaults() + { + Projectile.width = 40; + Projectile.height = 40; + Projectile.aiStyle = ProjAIStyleID.Arrow; + Projectile.friendly = true; + Projectile.tileCollide = false; + Projectile.DamageType = DamageClass.Ranged; + Projectile.penetrate = 1; + Projectile.timeLeft = 600; + Projectile.extraUpdates = 1; + AIType = ProjectileID.Bullet; + } + + public override void AI() + { + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 150f, 12f, 20f); + + //Rotation + Projectile.spriteDirection = Projectile.direction = (Projectile.velocity.X > 0).ToDirectionInt(); + Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == 1 ? 0f : MathHelper.Pi) + MathHelper.ToRadians(360) * Projectile.direction; + + //Update frames + if (Projectile.frameCounter++ % 6 == 0) + { + Projectile.frame++; + } + if (Projectile.frame >= Main.projFrames[Projectile.type]) + { + Projectile.frame = 0; + } + } + public override void OnSpawn(IEntitySource source) + { + int dustAmt = 36; + for (int dustIndex = 0; dustIndex < dustAmt; dustIndex++) + { + int randomDust = Utils.SelectRandom(Main.rand, new int[] + { + 33, + 89 + }); + Vector2 direction = Vector2.Normalize(Projectile.velocity) * new Vector2(Projectile.width / 2f, Projectile.height) * 0.75f; + direction = direction.RotatedBy((double)((dustIndex - (dustAmt / 2f - 1f)) * MathHelper.TwoPi / dustAmt), default) + Projectile.Center; + Vector2 dustVel = direction - Projectile.Center; + int water = Dust.NewDust(direction + dustVel, 0, 0, randomDust, dustVel.X * 1.75f, dustVel.Y * 1.75f, 100, default, 1.1f); + Main.dust[water].noGravity = true; + Main.dust[water].velocity = dustVel; + } + Particle shootPulse = new DirectionalPulseRing(Projectile.Center, + Vector2.Zero, + Color.LimeGreen * 0.7f, + new Vector2(0.5f, 1f), + Projectile.rotation, + 0.1f, + 0.4f, + 20); + GeneralParticleHandler.SpawnParticle(shootPulse); + } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(ModContent.BuffType(), 120); + SoundEngine.PlaySound(SoundID.NPCDeath1 with { Volume = SoundID.NPCDeath1.Volume * 0.5f }, Projectile.Center); + } + public override void OnKill(int timeLeft) + { + for (int d = 0; d < 15; ++d) + { + int idx = Dust.NewDust(Projectile.Center - Vector2.One * 10f, 50, 50, DustID.Blood, 0f, -2f, 0, default, 1f); + Dust dust = Main.dust[idx]; + dust.velocity /= 2f; + } + } + } +} diff --git a/Projectiles/Ranged/LeviatitanHoldout.cs b/Projectiles/Ranged/LeviatitanHoldout.cs new file mode 100644 index 0000000000..8c275eab72 --- /dev/null +++ b/Projectiles/Ranged/LeviatitanHoldout.cs @@ -0,0 +1,118 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.Metrics; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Particles; +using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Projectiles.Ranged; +using Microsoft.Xna.Framework; +using Mono.Cecil; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using static CalamityMod.Items.Weapons.Ranged.Leviatitan; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Items.Weapons.Ranged +{ + public class LeviatitanHoldout : BaseGunHoldoutProjectile + { + public override int AssociatedItemID => ItemType(); + public override string Texture => "CalamityMod/Items/Weapons/Ranged/Leviatitan"; + + + public override float MaxOffsetLengthFromArm => 38f; + public override float RecoilResolveSpeed => 0.1f; + public override float OffsetXUpwards => -10f; + public override float OffsetXDownwards => 2f; + public override float BaseOffsetY => -10f; + public override float OffsetYUpwards => 10f; + public override float OffsetYDownwards => 5f; + public ref float ShootingTimer => ref Projectile.ai[0]; + public ref float ShotsFired => ref Projectile.ai[1]; + public ref float ShootTimer => ref Projectile.ai[2]; + + public override void HoldoutAI() + { + // The center of the player, taking into account if they have a mount or not. + Vector2 mountedCenter = Owner.MountedCenter; + + // The vector between the player and the mouse. + Vector2 ownerToMouse = Owner.Calamity().mouseWorld - mountedCenter; + + + if (ShootingTimer >= HeldItem.useAnimation) + { + // We use the velocity of this projectile as its direction vector. + Vector2 direction = Projectile.velocity.SafeNormalize(Vector2.Zero); + + Owner.PickAmmo(Owner.ActiveItem(), out _, out float itemShootSpeed, out int itemDamage, out float itemKnockback, out int rocketTypeShot); + + Vector2 smokeVel = Projectile.velocity.SafeNormalize(Vector2.UnitY) * 5; + + if (Main.rand.NextBool(3)) + Projectile.NewProjectileDirect( + Projectile.GetSource_FromThis(), + GunTipPosition, + direction * itemShootSpeed, + ProjectileType(), + itemDamage, + itemKnockback, + Projectile.owner, + ownerToMouse.Length()); + else + Projectile.NewProjectileDirect( + Projectile.GetSource_FromThis(), + GunTipPosition, + direction * itemShootSpeed, + ProjectileType(), + itemDamage, + itemKnockback, + Projectile.owner, + ownerToMouse.Length()); + + // Inside here go all the things that dedicated servers shouldn't spend resources on. + // Like visuals and sounds. + if (!Main.dedServ) + { + // By decreasing the offset length of the gun from the arms, we give an effect of recoil. + OffsetLengthFromArm = 18f; + + int smokeAmount = Main.rand.Next(8, 12 + 1); + for (int i = 0; i < smokeAmount; i++) + { + Particle smoke = new HeavySmokeParticle(GunTipPosition, smokeVel.RotatedByRandom(0.4f) * Main.rand.NextFloat(0.2f, 1f), Color.White, Main.rand.Next(40, 60 + 1), Main.rand.NextFloat(0.2f, 0.4f), 0.5f, Main.rand.NextFloat(-0.2f, 0.2f), Main.rand.NextBool(), required: true); + GeneralParticleHandler.SpawnParticle(smoke); + + } + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/FlakKrakenShoot") { Pitch = 0.65f, Volume = 0.5f }, GunTipPosition); + } + ShootingTimer = 0f; + ShotsFired++; + if (ShotsFired == 7) + { + int monsterCount; + monsterCount = 2; + for (int a = 0; a < monsterCount; a++) + { + float projSpeed = itemShootSpeed; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Owner.Center + Main.rand.NextVector2Circular(30, 30), (Owner.Calamity().mouseWorld - Owner.MountedCenter).SafeNormalize(Vector2.Zero) * projSpeed, ModContent.ProjectileType(), (int)(itemDamage * 1.5f), itemKnockback); + SoundEngine.PlaySound(SoundID.Zombie38 with { Volume = SoundID.Zombie38.Volume * 0.5f }, mountedCenter); + } + } + if (ShotsFired >= 8) + ShotsFired = 0; + } + ShootingTimer++; + } + public override void OnSpawn(IEntitySource source) + { + base.OnSpawn(source); + SoundEngine.PlaySound(SoundID.Item108 with { Volume = 0.7f }, Projectile.Center); + } + } +} From 2ee12dbfee6164db52c5675ac7623f3c8bccb823 Mon Sep 17 00:00:00 2001 From: Xyk Date: Sat, 22 Jun 2024 01:34:34 -0700 Subject: [PATCH 002/133] Leviatitan Progress --- Items/Weapons/Ranged/Leviatitan.cs | 11 +- ...ods.CalamityMod.Items.Weapons.Ranged.hjson | 6 +- Projectiles/Ranged/AquaBlast.cs | 23 ++-- Projectiles/Ranged/AquaBlastToxic.cs | 24 ++--- Projectiles/Ranged/LeviatitanHoldout.cs | 100 ++++++++++-------- Sounds/Item/LeviatitanRoar.ogg | Bin 0 -> 20379 bytes 6 files changed, 84 insertions(+), 80 deletions(-) create mode 100644 Sounds/Item/LeviatitanRoar.ogg diff --git a/Items/Weapons/Ranged/Leviatitan.cs b/Items/Weapons/Ranged/Leviatitan.cs index f5afd38582..40242f1024 100644 --- a/Items/Weapons/Ranged/Leviatitan.cs +++ b/Items/Weapons/Ranged/Leviatitan.cs @@ -21,9 +21,9 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 82; Item.height = 28; - Item.damage = 117; + Item.damage = 97; Item.DamageType = DamageClass.Ranged; - Item.useTime = Item.useAnimation = 18; + Item.useTime = Item.useAnimation = 26; Item.noUseGraphic = true; Item.channel = true; Item.noMelee = true; @@ -35,22 +35,17 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 12f; Item.useStyle = ItemUseStyleID.Shoot; - Item.Calamity().canFirePointBlankShots = true; - Item.useAmmo = AmmoID.Bullet; } // Obviously we don't want multiple holdouts existing at the same time. public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] == 0; - // Spawning the holdout won't consume ammo. - public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] != 0; - // Makes the rotation of the mouse around the player sync in multiplayer. public override void HoldItem(Player player) => player.Calamity().mouseWorldListener = true; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, player.whoAmI); + Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI); // We set the rotation to the direction to the mouse so the first frame doesn't appear bugged out. holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero); diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index 84f95c7e74..a8cd3a9740 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -695,9 +695,9 @@ Leviatitan: { DisplayName: Leviatitan Tooltip: ''' - Converts musket balls into high velocity aqua blasts - Fires homing aberrations that shred enemy defense every 7th shot - to vomit a meteor that explodes on hit + Fires high velocity aqua blasts + Releases homing aberrations that shred enemy defense on every 6th shot + while holding to vomit a meteor that explodes on hit ''' } diff --git a/Projectiles/Ranged/AquaBlast.cs b/Projectiles/Ranged/AquaBlast.cs index de5536f071..91d85cc585 100644 --- a/Projectiles/Ranged/AquaBlast.cs +++ b/Projectiles/Ranged/AquaBlast.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.timeLeft = 600; Projectile.DamageType = DamageClass.Ranged; - Projectile.extraUpdates = 1; + Projectile.extraUpdates = 2; Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } @@ -46,31 +46,26 @@ namespace CalamityMod.Projectiles.Ranged Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == 1 ? 0f : MathHelper.Pi) + MathHelper.ToRadians(90) * Projectile.direction; - Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0.75f / 255f); - for (int i = 0; i < 2; i++) + Lighting.AddLight(Projectile.Center, Color.AliceBlue.ToVector3() * 0.5f); + + if (Projectile.timeLeft <= 580 && Projectile.timeLeft % 5 == 0) { - Vector2 dspeed = -Projectile.velocity * Main.rand.NextFloat(0.5f * 0.8f); - int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Water, 0f, 0f, 100, default, 1f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity = dspeed; - } - if (Projectile.timeLeft <= 580 && Projectile.timeLeft % 3 == 0) - { - Particle spark = new LineParticle(Projectile.Center - Projectile.velocity + Main.rand.NextVector2Circular(20, 20), -Projectile.velocity * Main.rand.NextFloat(0.2f, 1.8f), false, Main.rand.Next(9, 20 + 1), Main.rand.NextFloat(0.8f, 1.2f), Color.Lerp(Color.Cyan, Color.AliceBlue, Main.rand.NextFloat(0.35f)) * Main.rand.NextFloat(0.15f, 0.5f)); + Particle spark = new LineParticle(Projectile.Center - Projectile.velocity + Main.rand.NextVector2Circular(15, 15), -Projectile.velocity * Main.rand.NextFloat(0.2f, 1.8f), false, Main.rand.Next(9, 20 + 1), Main.rand.NextFloat(0.8f, 1.2f), Color.Lerp(Color.Cyan, Color.AliceBlue, Main.rand.NextFloat(0.35f)) * Main.rand.NextFloat(0.15f, 0.5f)); GeneralParticleHandler.SpawnParticle(spark); } if (Main.rand.NextBool(6)) { - Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(20, 20), 75, -Projectile.velocity.RotatedByRandom(0.1) * Main.rand.NextFloat(0.1f, 0.3f), 0, default, Main.rand.NextFloat(0.5f, 1.2f)); + Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(20, 20), 103, -Projectile.velocity.RotatedByRandom(0.1) * Main.rand.NextFloat(0.1f, 0.3f), 0, default, Main.rand.NextFloat(0.5f, 1.2f)); dust.noGravity = true; } } public override void OnKill(int timeLeft) { - for (int lol = 0; lol < 10; lol++) + for (int lol = 0; lol < 12; lol++) { - Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Water, 0f, 0f, 100, default, 1f); + Dust dust = Dust.NewDustPerfect(Projectile.Center, 103, new Vector2(7, 7).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1f)); + dust.scale = Main.rand.NextFloat(0.5f, 1.2f); } } } diff --git a/Projectiles/Ranged/AquaBlastToxic.cs b/Projectiles/Ranged/AquaBlastToxic.cs index 0edbad3be6..0d54103098 100644 --- a/Projectiles/Ranged/AquaBlastToxic.cs +++ b/Projectiles/Ranged/AquaBlastToxic.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.timeLeft = 600; Projectile.DamageType = DamageClass.Ranged; - Projectile.extraUpdates = 1; + Projectile.extraUpdates = 2; Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } @@ -48,35 +48,33 @@ namespace CalamityMod.Projectiles.Ranged Projectile.spriteDirection = Projectile.direction = (Projectile.velocity.X > 0).ToDirectionInt(); Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == 1 ? 0f : MathHelper.Pi) + MathHelper.ToRadians(90) * Projectile.direction; - Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0.35f / 255f, (255 - Projectile.alpha) * 0.4f / 255f); - if (Projectile.timeLeft <= 580 && Projectile.timeLeft % 3 == 0) + Lighting.AddLight(Projectile.Center, Color.Chartreuse.ToVector3() * 0.5f); + + if (Projectile.timeLeft <= 580 && Projectile.timeLeft % 5 == 0) { - Particle spark = new LineParticle(Projectile.Center - Projectile.velocity + Main.rand.NextVector2Circular(20, 20), -Projectile.velocity * Main.rand.NextFloat(0.2f, 1.8f), false, Main.rand.Next(9, 20 + 1), Main.rand.NextFloat(0.8f, 1.2f), Color.Chartreuse * Main.rand.NextFloat(0.15f, 0.5f)); + Particle spark = new LineParticle(Projectile.Center - Projectile.velocity + Main.rand.NextVector2Circular(15, 15), -Projectile.velocity * Main.rand.NextFloat(0.2f, 1.8f), false, Main.rand.Next(9, 20 + 1), Main.rand.NextFloat(0.8f, 1.2f), Color.Chartreuse * Main.rand.NextFloat(0.15f, 0.5f)); GeneralParticleHandler.SpawnParticle(spark); } if (Main.rand.NextBool(6)) { - Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(20, 20), 75, -Projectile.velocity.RotatedByRandom(0.1) * Main.rand.NextFloat(0.1f, 0.3f), 0, default, Main.rand.NextFloat(0.5f, 1.2f)); + Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(20, 20), 102, -Projectile.velocity.RotatedByRandom(0.1) * Main.rand.NextFloat(0.1f, 0.3f), 0, default, Main.rand.NextFloat(0.5f, 1.2f)); dust.noGravity = true; } } public override void OnKill(int timeLeft) { - for (int lol = 0; lol < 10; lol++) + for (int lol = 0; lol < 12; lol++) { - Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.GemEmerald, 0f, 0f, 100, default, 1f); - } - for (int i = 0; i <= 3; i++) - { - Particle skull = new DesertProwlerSkullParticle(Projectile.Center, new Vector2(2.5f, 2.5f).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1f), Main.rand.NextBool() ? Color.LightGreen: Color.Lime, Color.LimeGreen, Main.rand.NextFloat(0.2f, 0.9f), 175); - GeneralParticleHandler.SpawnParticle(skull); + Dust dust = Dust.NewDustPerfect(Projectile.Center, 102, new Vector2(7, 7).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1f)); + dust.scale = Main.rand.NextFloat(0.5f, 1.2f); } } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(BuffID.Venom, 120); + // Levi weapons are no longer venom themed + //target.AddBuff(BuffID.Venom, 120); } } } diff --git a/Projectiles/Ranged/LeviatitanHoldout.cs b/Projectiles/Ranged/LeviatitanHoldout.cs index 8c275eab72..ef2c863a44 100644 --- a/Projectiles/Ranged/LeviatitanHoldout.cs +++ b/Projectiles/Ranged/LeviatitanHoldout.cs @@ -6,6 +6,7 @@ using System.Text; using System.Threading.Tasks; using CalamityMod.Particles; using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Mono.Cecil; @@ -35,6 +36,9 @@ namespace CalamityMod.Items.Weapons.Ranged public ref float ShootingTimer => ref Projectile.ai[0]; public ref float ShotsFired => ref Projectile.ai[1]; public ref float ShootTimer => ref Projectile.ai[2]; + public int shotColor = 1; + public bool HasfiredMeteor = false; + public int time = 0; public override void HoldoutAI() { @@ -44,75 +48,87 @@ namespace CalamityMod.Items.Weapons.Ranged // The vector between the player and the mouse. Vector2 ownerToMouse = Owner.Calamity().mouseWorld - mountedCenter; - if (ShootingTimer >= HeldItem.useAnimation) { + HasfiredMeteor = false; // We use the velocity of this projectile as its direction vector. Vector2 direction = Projectile.velocity.SafeNormalize(Vector2.Zero); - Owner.PickAmmo(Owner.ActiveItem(), out _, out float itemShootSpeed, out int itemDamage, out float itemKnockback, out int rocketTypeShot); - + Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * 10; Vector2 smokeVel = Projectile.velocity.SafeNormalize(Vector2.UnitY) * 5; - if (Main.rand.NextBool(3)) - Projectile.NewProjectileDirect( - Projectile.GetSource_FromThis(), - GunTipPosition, - direction * itemShootSpeed, - ProjectileType(), - itemDamage, - itemKnockback, - Projectile.owner, - ownerToMouse.Length()); - else - Projectile.NewProjectileDirect( - Projectile.GetSource_FromThis(), - GunTipPosition, - direction * itemShootSpeed, - ProjectileType(), - itemDamage, - itemKnockback, - Projectile.owner, - ownerToMouse.Length()); - - // Inside here go all the things that dedicated servers shouldn't spend resources on. - // Like visuals and sounds. - if (!Main.dedServ) + if (Owner.Calamity().mouseRight) { - // By decreasing the offset length of the gun from the arms, we give an effect of recoil. - OffsetLengthFromArm = 18f; - - int smokeAmount = Main.rand.Next(8, 12 + 1); - for (int i = 0; i < smokeAmount; i++) + Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity, ProjectileType(), Projectile.damage * 4, Projectile.knockBack * 3, Projectile.owner, ownerToMouse.Length()); + if (!Main.dedServ) { - Particle smoke = new HeavySmokeParticle(GunTipPosition, smokeVel.RotatedByRandom(0.4f) * Main.rand.NextFloat(0.2f, 1f), Color.White, Main.rand.Next(40, 60 + 1), Main.rand.NextFloat(0.2f, 0.4f), 0.5f, Main.rand.NextFloat(-0.2f, 0.2f), Main.rand.NextBool(), required: true); - GeneralParticleHandler.SpawnParticle(smoke); + // By decreasing the offset length of the gun from the arms, we give an effect of recoil. + OffsetLengthFromArm = 9f; + + int smokeAmount = Main.rand.Next(8, 12 + 1); + for (int i = 0; i < smokeAmount; i++) + { + Particle smoke = new HeavySmokeParticle(GunTipPosition, smokeVel.RotatedByRandom(0.4f) * Main.rand.NextFloat(1.2f, 2f), Color.White, Main.rand.Next(40, 60 + 1), Main.rand.NextFloat(0.2f, 0.4f), 0.3f, Main.rand.NextFloat(-0.2f, 0.2f), Main.rand.NextBool(), required: true); + GeneralParticleHandler.SpawnParticle(smoke); + + } + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/LeviatitanRoar") { Volume = 0.5f }, GunTipPosition); + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/MagicRockSound") with { Pitch = -0.7f, Volume = 0.8f }, Projectile.Center); + } + HasfiredMeteor = true; + } + else + { + // Fire the projectiles + Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity.RotatedBy(MathHelper.ToRadians(2f * shotColor)), ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, ownerToMouse.Length()); + Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity.RotatedBy(MathHelper.ToRadians(-2f * shotColor)), ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, ownerToMouse.Length()); + // Swap which is the top and bottom with every shot + shotColor = (shotColor == 1 ? -1 : 1); + + // Inside here go all the things that dedicated servers shouldn't spend resources on. + // Like visuals and sounds. + if (!Main.dedServ) + { + // By decreasing the offset length of the gun from the arms, we give an effect of recoil. + OffsetLengthFromArm = 25f; + + int smokeAmount = Main.rand.Next(8, 12 + 1); + for (int i = 0; i < smokeAmount; i++) + { + Particle smoke = new HeavySmokeParticle(GunTipPosition, smokeVel.RotatedByRandom(0.4f) * Main.rand.NextFloat(0.2f, 1f), Color.White, Main.rand.Next(40, 60 + 1), Main.rand.NextFloat(0.2f, 0.4f), 0.3f, Main.rand.NextFloat(-0.2f, 0.2f), Main.rand.NextBool(), required: true); + GeneralParticleHandler.SpawnParticle(smoke); + + } + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/FlakKrakenShoot") { Pitch = 0.9f, Volume = 0.5f }, GunTipPosition); + SoundEngine.PlaySound(SoundID.Item108 with { Pitch = -0.5f, Volume = 0.8f }, Projectile.Center); } - SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/FlakKrakenShoot") { Pitch = 0.65f, Volume = 0.5f }, GunTipPosition); } + ShootingTimer = 0f; ShotsFired++; - if (ShotsFired == 7) + + if (ShotsFired == 6) { int monsterCount; monsterCount = 2; for (int a = 0; a < monsterCount; a++) { - float projSpeed = itemShootSpeed; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Owner.Center + Main.rand.NextVector2Circular(30, 30), (Owner.Calamity().mouseWorld - Owner.MountedCenter).SafeNormalize(Vector2.Zero) * projSpeed, ModContent.ProjectileType(), (int)(itemDamage * 1.5f), itemKnockback); - SoundEngine.PlaySound(SoundID.Zombie38 with { Volume = SoundID.Zombie38.Volume * 0.5f }, mountedCenter); + float projSpeed = 5; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Owner.Center + Main.rand.NextVector2Circular(30, 30), (Owner.Calamity().mouseWorld - Owner.MountedCenter).SafeNormalize(Vector2.Zero) * projSpeed, ModContent.ProjectileType(), (int)(Projectile.damage * 1.2f), Projectile.knockBack); } + SoundEngine.PlaySound(SoundID.Zombie38 with { Volume = SoundID.Zombie38.Volume * 0.5f }, mountedCenter); } - if (ShotsFired >= 8) + if (ShotsFired >= 6) ShotsFired = 0; } - ShootingTimer++; + if (!HasfiredMeteor || time % 3 == 0) + ShootingTimer++; + time++; } public override void OnSpawn(IEntitySource source) { base.OnSpawn(source); - SoundEngine.PlaySound(SoundID.Item108 with { Volume = 0.7f }, Projectile.Center); } } } diff --git a/Sounds/Item/LeviatitanRoar.ogg b/Sounds/Item/LeviatitanRoar.ogg new file mode 100644 index 0000000000000000000000000000000000000000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<{9Un#fwd|5Kr`kk7oq=a70oL)cIeKQE3b0^l5m(Fv~;=0YT zfEAkb+8~-<*GB%Mw^ddgy3WcY7H)AN|2`KXZP5Sz4H&PV-PoZBk8TsSTMf1X^6>ND zYS)hH?N#@5WtH``+vvXVj(BDHgg zZr7}c5E&L2m{@=mMf`eSpqtglRv(1aO2Hr|h>D7JTZw|(mIL%tR;K1~dMVaXAh6B= zoS00h*2$rWf<|8#s|>LMDJt5}{gh5u1<~lL=yWTH8tV*f;QN-n@k6Xp&pKQewW0DJ zafe8X7^yGg^1qC%CnHaRkTceFPNN_y8F~1U5Pp3@ybCWyB_jh6YZOv!v1YVE#TqLp zWzATe06?P=DSiM_tK-sP1>pR)FTaS$81*LU;Y19FEfrBuK?M~G05FkKqo+<|(Tjpu zhqG7-016=1;Vf1H0H~;t0cxBMi{1$U&Jiub5V`;k4*~t>{poA;0|3zN{!!^h-UR%; dw>t>n08PN(M|(g32LJ#70000000000001j)g!cdd literal 0 HcmV?d00001 From ebf404e9768fd7ddcb3b765c9c03e46ed85734ff Mon Sep 17 00:00:00 2001 From: mochi-angel Date: Fri, 20 Sep 2024 11:05:49 -0700 Subject: [PATCH 003/133] No more holdout + visual updates --- Items/Weapons/Ranged/Leviatitan.cs | 100 ++++++++++--- ...ods.CalamityMod.Items.Weapons.Ranged.hjson | 4 +- .../Mods.CalamityMod.Projectiles.Ranged.hjson | 3 + Projectiles/Ranged/AquaBlast.cs | 98 ++++++++++--- Projectiles/Ranged/AquaBlast.png | Bin 1494 -> 19177 bytes Projectiles/Ranged/AquaBlastToxic.cs | 80 ----------- Projectiles/Ranged/AquaBlastToxic.png | Bin 1556 -> 0 bytes Projectiles/Ranged/LeviatitanAberration.cs | 41 ++---- Projectiles/Ranged/LeviatitanExplosion.cs | 30 ++++ Projectiles/Ranged/LeviatitanHoldout.cs | 134 ------------------ Projectiles/Ranged/LeviatitanMeteor.cs | 103 ++++++++++++++ 11 files changed, 315 insertions(+), 278 deletions(-) delete mode 100644 Projectiles/Ranged/AquaBlastToxic.cs delete mode 100644 Projectiles/Ranged/AquaBlastToxic.png create mode 100644 Projectiles/Ranged/LeviatitanExplosion.cs delete mode 100644 Projectiles/Ranged/LeviatitanHoldout.cs create mode 100644 Projectiles/Ranged/LeviatitanMeteor.cs diff --git a/Items/Weapons/Ranged/Leviatitan.cs b/Items/Weapons/Ranged/Leviatitan.cs index 40242f1024..76d735c82f 100644 --- a/Items/Weapons/Ranged/Leviatitan.cs +++ b/Items/Weapons/Ranged/Leviatitan.cs @@ -1,4 +1,5 @@ -using System.Diagnostics.Metrics; +using System; +using System.Diagnostics.Metrics; using CalamityMod.Particles; using CalamityMod.Projectiles.Magic; using CalamityMod.Projectiles.Ranged; @@ -16,41 +17,108 @@ namespace CalamityMod.Items.Weapons.Ranged public class Leviatitan : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; + // Every sixth shot fires homing Aberrations, then resets the counter to 2. + // This is intentional so you don't get the Aberrations instantly when you start firing and have to play around it. + private int shotCounter = 1; + public override void SetStaticDefaults() + { + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + } public override void SetDefaults() { Item.width = 82; Item.height = 28; - Item.damage = 97; + Item.damage = 121; Item.DamageType = DamageClass.Ranged; - Item.useTime = Item.useAnimation = 26; - Item.noUseGraphic = true; - Item.channel = true; + Item.useTime = Item.useAnimation = 18; //Try not to change this if you can help it Item.noMelee = true; Item.knockBack = 5f; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; - Item.UseSound = new SoundStyle("CalamityMod/Sounds/Item/DudFire") with { Volume = .4f, Pitch = -.7f, PitchVariance = 0.1f }; + Item.UseSound = new SoundStyle("CalamityMod/Sounds/Item/FlakKrakenShoot") { Pitch = 0.65f, Volume = 0.4f }; Item.autoReuse = true; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 12f; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 13f; Item.useStyle = ItemUseStyleID.Shoot; + Item.useAmmo = AmmoID.Bullet; + Item.Calamity().canFirePointBlankShots = true; } - // Obviously we don't want multiple holdouts existing at the same time. - public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] == 0; + public override Vector2? HoldoutOffset() => new Vector2(-10, 0); - // Makes the rotation of the mouse around the player sync in multiplayer. - public override void HoldItem(Player player) => player.Calamity().mouseWorldListener = true; + public override bool AltFunctionUse(Player player) + { + return true; + } + public override bool CanUseItem(Player player) + { + Item.UseSound = player.altFunctionUse == 2 ? SoundID.NPCHit56 : new SoundStyle("CalamityMod/Sounds/Item/FlakKrakenShoot") { Pitch = 0.65f, Volume = 0.3f }; + return base.CanUseItem(player); + } + public override float UseSpeedMultiplier(Player player) => player.altFunctionUse == 2 ? (1f / 3f) : 1f; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI); - - // We set the rotation to the direction to the mouse so the first frame doesn't appear bugged out. - holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero); + // Reposition to the gun's tip. Calculated seperately due to the two different shot styles. + Vector2 boulderPos = position + new Vector2(74f, player.direction * (Math.Abs(velocity.SafeNormalize(Vector2.Zero).X) < 0.02f ? -2f : -8f)).RotatedBy(velocity.ToRotation()); + Vector2 shotPos = position + new Vector2(74f, player.direction * (Math.Abs(velocity.SafeNormalize(Vector2.Zero).X) < 0.02f ? -6f : 3f)).RotatedBy(velocity.ToRotation()); + if (player.altFunctionUse == 2) + { + int index = Projectile.NewProjectile(source, boulderPos, velocity * 0.7f, ModContent.ProjectileType(), (int)(damage * 2f), knockback, player.whoAmI); + } + else + { + Projectile.NewProjectile(source, shotPos, velocity, Item.shoot, damage, knockback, player.whoAmI); + } + if (shotCounter == 7) + { + SoundEngine.PlaySound(SoundID.Zombie38 with { Volume = SoundID.Zombie38.Volume * 0.5f }); + for (int i = 0; i <= 1; i++) + { + float projSpeed = Item.shootSpeed; + Projectile.NewProjectile(source, position + Main.rand.NextVector2Circular(150, 150), velocity * projSpeed, ModContent.ProjectileType(), (int)(damage * 1.3), knockback, player.whoAmI); + } + } + shotCounter++; + if (shotCounter > 7) + shotCounter = 2; return false; } + + //Thanks to Xyk's incredible recoil code, we give both left click and right click different recoils without having to use a holdout. + public override void UseStyle(Player player, Rectangle heldItemFrame) + { + player.ChangeDir(Math.Sign((player.Calamity().mouseWorld - player.Center).X)); + float itemRotation = player.compositeFrontArm.rotation + MathHelper.PiOver2 * player.gravDir; + + float pullback = 7f; + + float animProgress = 0.5f - player.itemTime / (float)player.itemTimeMax; + float rotation = (player.Center - player.Calamity().mouseWorld).ToRotation() * player.gravDir + MathHelper.PiOver2; + if (animProgress < 0.1f) + pullback -= (2.75f) * (float)Math.Pow((0.6f - animProgress) / 0.6f, 2); + + Vector2 itemPosition = player.MountedCenter + itemRotation.ToRotationVector2() * pullback; + Vector2 itemSize = new Vector2(52, 28); + Vector2 itemOrigin = new Vector2(-24, 4); + + CalamityUtils.CleanHoldStyle(player, itemRotation, itemPosition, itemSize, itemOrigin); + + base.UseStyle(player, heldItemFrame); + } + public override void UseItemFrame(Player player) + { + player.ChangeDir(Math.Sign((player.Calamity().mouseWorld - player.Center).X)); + + float animProgress = 0.5f - player.itemTime / (float)player.itemTimeMax; + float rotation = (player.Center - player.Calamity().mouseWorld).ToRotation() * player.gravDir + MathHelper.PiOver2; + if (animProgress < 0.4f) + rotation += (player.altFunctionUse == 2 ? -0.15f : 0) * (float)Math.Pow((0.6f - animProgress) / 0.6f, 2) * player.direction; + + player.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, rotation); + } } } + diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index 65c645dca9..92ad8e039f 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -685,8 +685,8 @@ Leviatitan: { Tooltip: ''' Fires high velocity aqua blasts - Releases homing aberrations that shred enemy defense on every 6th shot - while holding to vomit a meteor that explodes on hit + Releases homing aberrations that shred enemy defense every six shots + to vomit a meteor that explodes on hit ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson index 11209f6fc1..42979baa91 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson @@ -252,3 +252,6 @@ HellbornProj.DisplayName: Hell-born Gunblast HellbornShell.DisplayName: Hell's Shell RubicoPrimeMag.DisplayName: Rubico Prime Mag MegalodonShot.DisplayName: Megalodon Shot +LeviatitanAberration.DisplayName: Leviatitan Aberration +LeviatitanMeteor.DisplayName: Leviatitan Meteor +LeviatitanExplosion.DisplayName: Leviatitan Explosion diff --git a/Projectiles/Ranged/AquaBlast.cs b/Projectiles/Ranged/AquaBlast.cs index 91d85cc585..77fd2a7062 100644 --- a/Projectiles/Ranged/AquaBlast.cs +++ b/Projectiles/Ranged/AquaBlast.cs @@ -1,6 +1,13 @@ -using CalamityMod.Particles; +using System.Diagnostics.Contracts; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Particles; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -9,21 +16,23 @@ namespace CalamityMod.Projectiles.Ranged public class AquaBlast : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Ranged"; + public override void SetStaticDefaults() { - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Projectile.type] = 20; } + public int spreadDust = 0; public override void SetDefaults() { - Projectile.width = 12; - Projectile.height = 12; + Projectile.width = 36; + Projectile.height = 26; Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.penetrate = 1; Projectile.timeLeft = 600; - Projectile.DamageType = DamageClass.Ranged; Projectile.extraUpdates = 2; + Projectile.DamageType = DamageClass.Ranged; Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } @@ -31,15 +40,16 @@ namespace CalamityMod.Projectiles.Ranged { //Animation Projectile.frameCounter++; - if (Projectile.frameCounter > 5) + if (Projectile.frameCounter > 21) { Projectile.frame++; Projectile.frameCounter = 0; } - if (Projectile.frame > 3) + if (Projectile.frame > 19) { Projectile.frame = 0; } + Projectile.frame = Projectile.frameCounter / 4 % Main.projFrames[Projectile.type]; //Rotation Projectile.spriteDirection = Projectile.direction = (Projectile.velocity.X > 0).ToDirectionInt(); @@ -47,26 +57,76 @@ namespace CalamityMod.Projectiles.Ranged Lighting.AddLight(Projectile.Center, Color.AliceBlue.ToVector3() * 0.5f); - - if (Projectile.timeLeft <= 580 && Projectile.timeLeft % 5 == 0) + if (Projectile.timeLeft <= 593) { - Particle spark = new LineParticle(Projectile.Center - Projectile.velocity + Main.rand.NextVector2Circular(15, 15), -Projectile.velocity * Main.rand.NextFloat(0.2f, 1.8f), false, Main.rand.Next(9, 20 + 1), Main.rand.NextFloat(0.8f, 1.2f), Color.Lerp(Color.Cyan, Color.AliceBlue, Main.rand.NextFloat(0.35f)) * Main.rand.NextFloat(0.15f, 0.5f)); - GeneralParticleHandler.SpawnParticle(spark); - } - if (Main.rand.NextBool(6)) - { - Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(20, 20), 103, -Projectile.velocity.RotatedByRandom(0.1) * Main.rand.NextFloat(0.1f, 0.3f), 0, default, Main.rand.NextFloat(0.5f, 1.2f)); - dust.noGravity = true; + for (int i = 0; i < 2; i++) + { + SparkParticle spark = new SparkParticle(Projectile.Center - Projectile.velocity / 0.18f, Projectile.velocity * 0.01f, false, 5, 1.9f, Color.SeaGreen, true); + GeneralParticleHandler.SpawnParticle(spark); + } + if (Main.rand.NextBool(2)) + { + Gore bubble = Gore.NewGorePerfect(Projectile.GetSource_FromAI(), Projectile.position, Projectile.velocity * 0.2f + Main.rand.NextVector2Circular(1f, 1f), 411); + bubble.timeLeft = 6 + Main.rand.Next(7); + bubble.scale = Main.rand.NextFloat(0.6f, 0.8f); + bubble.type = Main.rand.NextBool(3) ? 412 : 411; + } + if (Main.rand.NextBool()) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(6 + spreadDust, 6 + spreadDust), !Main.rand.NextBool(5) ? 278 : 267, -Projectile.velocity * Main.rand.NextFloat(0.05f, 0.35f), 0, default, Main.rand.NextFloat(0.4f, 0.6f)); + dust.noGravity = true; + dust.color = !Main.rand.NextBool(5) ? Color.Aquamarine : Color.Aqua; + if (dust.type == 278) + dust.scale *= 0.7f; + } } } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(ModContent.BuffType(), 60); + } + public override void OnHitPlayer(Player target, Player.HurtInfo info) + { + target.AddBuff(ModContent.BuffType(), 60); + } + public override void OnSpawn(IEntitySource source) + { + Vector2 smokeVel = Projectile.velocity.SafeNormalize(Vector2.UnitY) * 5; + int smokeAmount = Main.rand.Next(8, 12 + 1); + for (int i = 0; i < smokeAmount; i++) + { + Particle smoke = new HeavySmokeParticle(Projectile.Center, smokeVel.RotatedByRandom(0.4f) * Main.rand.NextFloat(1.2f, 2f), Color.White, Main.rand.Next(40, 60 + 1), Main.rand.NextFloat(0.2f, 0.4f), 0.3f, Main.rand.NextFloat(-0.2f, 0.2f), Main.rand.NextBool(), required: true); + GeneralParticleHandler.SpawnParticle(smoke); + } + } public override void OnKill(int timeLeft) { - for (int lol = 0; lol < 12; lol++) + SoundEngine.PlaySound(SoundID.ShimmerWeak1 with { Pitch = 0.35f }, Projectile.Center); + for (int i = 0; i < 5; ++i) { - Dust dust = Dust.NewDustPerfect(Projectile.Center, 103, new Vector2(7, 7).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1f)); - dust.scale = Main.rand.NextFloat(0.5f, 1.2f); + int bloodLifetime = Main.rand.Next(22, 25); + float bloodScale = Main.rand.NextFloat(0.6f, 0.8f); + Color bloodColor = Color.Lerp(Color.SkyBlue, Color.Aquamarine, Main.rand.NextFloat()); + bloodColor = Color.Lerp(bloodColor, new Color(51, 22, 94), Main.rand.NextFloat(0.65f)); + + if (Main.rand.NextBool(20)) + bloodScale *= 2f; + + float randomSpeedMultiplier = Main.rand.NextFloat(1.25f, 2.25f); + Vector2 bloodVelocity = Main.rand.NextVector2Unit() * 2 * randomSpeedMultiplier; + bloodVelocity.Y -= 5f; + BloodParticle blood = new BloodParticle(Projectile.Center, bloodVelocity, bloodLifetime, bloodScale, bloodColor); + GeneralParticleHandler.SpawnParticle(blood); } + Particle blastRing = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Aquamarine * 0.8f, "CalamityMod/Particles/FlameExplosion", Vector2.One, Main.rand.NextFloat(-10, 10), 0f, 0.05f, 22); + GeneralParticleHandler.SpawnParticle(blastRing); + Particle blastRing2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Aqua * 0.8f, "CalamityMod/Particles/FlameExplosion", Vector2.One, Main.rand.NextFloat(-10, 10), 0f, 0.04f, 22); + GeneralParticleHandler.SpawnParticle(blastRing2); + Particle blastRing3 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.DeepSkyBlue, "CalamityMod/Particles/DetailedExplosion", Vector2.One, Main.rand.NextFloat(-10, 10), 0f, 0.2f, 22); + GeneralParticleHandler.SpawnParticle(blastRing3); + Particle orb2 = new GenericBloom(Projectile.Center, Vector2.Zero, Color.SkyBlue, 0.6f, 11, false, true); + GeneralParticleHandler.SpawnParticle(orb2); } } } diff --git a/Projectiles/Ranged/AquaBlast.png b/Proj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103098..0000000000 --- a/Projectiles/Ranged/AquaBlastToxic.cs +++ /dev/null @@ -1,80 +0,0 @@ -using CalamityMod.Graphics.Primitives; -using CalamityMod.Particles; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.Graphics.Shaders; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Ranged -{ - public class AquaBlastToxic : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Ranged"; - public override void SetStaticDefaults() - { - Main.projFrames[Projectile.type] = 4; - } - - public override void SetDefaults() - { - Projectile.width = 12; - Projectile.height = 12; - Projectile.friendly = true; - Projectile.ignoreWater = true; - Projectile.penetrate = 1; - Projectile.timeLeft = 600; - Projectile.DamageType = DamageClass.Ranged; - Projectile.extraUpdates = 2; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; - } - - public override void AI() - { - //Animation - Projectile.frameCounter++; - if (Projectile.frameCounter > 5) - { - Projectile.frame++; - Projectile.frameCounter = 0; - } - if (Projectile.frame > 3) - { - Projectile.frame = 0; - } - - //Rotation - Projectile.spriteDirection = Projectile.direction = (Projectile.velocity.X > 0).ToDirectionInt(); - Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == 1 ? 0f : MathHelper.Pi) + MathHelper.ToRadians(90) * Projectile.direction; - - Lighting.AddLight(Projectile.Center, Color.Chartreuse.ToVector3() * 0.5f); - - if (Projectile.timeLeft <= 580 && Projectile.timeLeft % 5 == 0) - { - Particle spark = new LineParticle(Projectile.Center - Projectile.velocity + Main.rand.NextVector2Circular(15, 15), -Projectile.velocity * Main.rand.NextFloat(0.2f, 1.8f), false, Main.rand.Next(9, 20 + 1), Main.rand.NextFloat(0.8f, 1.2f), Color.Chartreuse * Main.rand.NextFloat(0.15f, 0.5f)); - GeneralParticleHandler.SpawnParticle(spark); - } - if (Main.rand.NextBool(6)) - { - Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(20, 20), 102, -Projectile.velocity.RotatedByRandom(0.1) * Main.rand.NextFloat(0.1f, 0.3f), 0, default, Main.rand.NextFloat(0.5f, 1.2f)); - dust.noGravity = true; - } - } - - public override void OnKill(int timeLeft) - { - for (int lol = 0; lol < 12; lol++) - { - Dust dust = Dust.NewDustPerfect(Projectile.Center, 102, new Vector2(7, 7).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1f)); - dust.scale = Main.rand.NextFloat(0.5f, 1.2f); - } - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - // Levi weapons are no longer venom themed - //target.AddBuff(BuffID.Venom, 120); - } - } -} diff --git a/Projectiles/Ranged/AquaBlastToxic.png b/Projectiles/Ranged/AquaBlastToxic.png deleted file mode 100644 index db383de083241098c1497f99263902c377009260..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1556 zcmV+v2J88WP)Px)&PhZ;RA_${xKUx~jW6DKl4R_wT-2v#H{Kq-)@ETwk`e?kg` zD2POXP>TEm^ywp9AyJ?}1r8F8V>f}5KV;b#J3im}d^vk5X5YP?xm%liXB~vZ+hjbM zn`d|C{dk_44L&V>2SBO36#{%X^Bzh2dF>ehQ)AZxfF8QEyfoaI-TqQ}3mt+y`_$OA zGY87Jt`UL<)uk}mA*+)1PWn}nnO$=cyGM{2g34e3u(wVKu(YxUz|D8x3Zk*PRm$(L z3<8iVolHvy3S8J;_oc=3#BF`0Sc-i+1%$7%^3!u;b$ z01V{{02Jn4S_77z7_Xg~9aAC{#~T1_m(2Pv+_PhOW_Bz9SX(VC5l)WHZ^S#r?`5^F zO`3m~7w;<(a=oY4jIM2M9$J5Q@2#>A3F{aSdIV`CkX!@+isKDWZ@n~R;^1|~c3{~b zi5I=Mj*b{_J-%VQRkF34)wB0j@cIE^CCjR$$B>Uz=Y?;fGPYj!x_e-Z!;zI_xX5yi*U2yr~T|NTP%URUx~JP2~L zmeV1$?Sq)C(*DYzAbLieF{id1@>m=<&SYj&(s6uV?`{X0lJ>SSU3a$<)prWkYUx+W zojFE`kS`52_1W9XM`E#JA+Fa-X6&*SR|C07{t87bO{wVF{ms$o0AOPLie0ZGr6So} z?@L32rb_Pod1}4Wjd%LZ4oBHU?@KashkXg5<+c75$X$2;b3V5M$^DPm#FTmVZF6+* zQGp~oNY)U08L=4kIbZ56jmum8&&Xa!>|IW(#G197C+AE14>wP#Ip4Xb(h1I|M7a1n z6jz~Se~03BWY78jfqw8rIFIw?`;Af;rjY$DO~PwE^@BXC#I73;{(9Qw8rj8zG+g~4 zIoAIUML0%vz1VT5%VopF^zk6)Mv0y7h$PlE!W;a-^5Xq?B{D^bcltqf$sql@DO~|% zku_xfH#f{#<@}vV>%7(b>^_c%XTO>A@5$>!K+Ai3tD^=vdXntUml6@@Sw-FRCD;7# zb_c>M091olK>8OtJ%$h{5H_BlSk*HP;jq-_sUO7B?j6+np{5b^&>d! 0).ToDirectionInt(); @@ -56,33 +53,23 @@ namespace CalamityMod.Projectiles.Ranged { Projectile.frame = 0; } + for (int i = 0; i < 3; i++) + { + int bloodDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height / 2, DustID.Blood, 0f, 0f, 100, default, 1f); + Main.dust[bloodDust].noGravity = true; + Main.dust[bloodDust].velocity *= 0.5f; + Main.dust[bloodDust].velocity += Projectile.velocity * 0.1f; + } } public override void OnSpawn(IEntitySource source) { - int dustAmt = 36; - for (int dustIndex = 0; dustIndex < dustAmt; dustIndex++) + for (int i = 0; i < 36; i++) { - int randomDust = Utils.SelectRandom(Main.rand, new int[] - { - 33, - 89 - }); - Vector2 direction = Vector2.Normalize(Projectile.velocity) * new Vector2(Projectile.width / 2f, Projectile.height) * 0.75f; - direction = direction.RotatedBy((double)((dustIndex - (dustAmt / 2f - 1f)) * MathHelper.TwoPi / dustAmt), default) + Projectile.Center; - Vector2 dustVel = direction - Projectile.Center; - int water = Dust.NewDust(direction + dustVel, 0, 0, randomDust, dustVel.X * 1.75f, dustVel.Y * 1.75f, 100, default, 1.1f); - Main.dust[water].noGravity = true; - Main.dust[water].velocity = dustVel; + Dust minion = Dust.NewDustPerfect(Projectile.Center, DustID.MoonBoulder); + minion.velocity = (MathHelper.TwoPi * i / 36f).ToRotationVector2() * 9f; + minion.scale = Main.rand.NextFloat(1.4f, 1.6f); + minion.noGravity = true; } - Particle shootPulse = new DirectionalPulseRing(Projectile.Center, - Vector2.Zero, - Color.LimeGreen * 0.7f, - new Vector2(0.5f, 1f), - Projectile.rotation, - 0.1f, - 0.4f, - 20); - GeneralParticleHandler.SpawnParticle(shootPulse); } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { diff --git a/Projectiles/Ranged/LeviatitanExplosion.cs b/Projectiles/Ranged/LeviatitanExplosion.cs new file mode 100644 index 0000000000..fd318a87ec --- /dev/null +++ b/Projectiles/Ranged/LeviatitanExplosion.cs @@ -0,0 +1,30 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Ranged +{ + public class LeviatitanExplosion : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Ranged"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public Player Owner => Main.player[Projectile.owner]; + private static float ExplosionRadius = 112f; + + public override void SetDefaults() + { + //These shouldn't matter because its circular + Projectile.width = 112; + Projectile.height = 112; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Ranged; + Projectile.ignoreWater = true; + Projectile.tileCollide = false; + Projectile.penetrate = -1; + Projectile.timeLeft = 2; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 10; + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, ExplosionRadius, targetHitbox); + } +} diff --git a/Projectiles/Ranged/LeviatitanHoldout.cs b/Projectiles/Ranged/LeviatitanHoldout.cs deleted file mode 100644 index ef2c863a44..0000000000 --- a/Projectiles/Ranged/LeviatitanHoldout.cs +++ /dev/null @@ -1,134 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.Metrics; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using CalamityMod.Particles; -using CalamityMod.Projectiles.BaseProjectiles; -using CalamityMod.Projectiles.Melee; -using CalamityMod.Projectiles.Ranged; -using Microsoft.Xna.Framework; -using Mono.Cecil; -using Terraria; -using Terraria.Audio; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using static CalamityMod.Items.Weapons.Ranged.Leviatitan; -using static Terraria.ModLoader.ModContent; - -namespace CalamityMod.Items.Weapons.Ranged -{ - public class LeviatitanHoldout : BaseGunHoldoutProjectile - { - public override int AssociatedItemID => ItemType(); - public override string Texture => "CalamityMod/Items/Weapons/Ranged/Leviatitan"; - - - public override float MaxOffsetLengthFromArm => 38f; - public override float RecoilResolveSpeed => 0.1f; - public override float OffsetXUpwards => -10f; - public override float OffsetXDownwards => 2f; - public override float BaseOffsetY => -10f; - public override float OffsetYUpwards => 10f; - public override float OffsetYDownwards => 5f; - public ref float ShootingTimer => ref Projectile.ai[0]; - public ref float ShotsFired => ref Projectile.ai[1]; - public ref float ShootTimer => ref Projectile.ai[2]; - public int shotColor = 1; - public bool HasfiredMeteor = false; - public int time = 0; - - public override void HoldoutAI() - { - // The center of the player, taking into account if they have a mount or not. - Vector2 mountedCenter = Owner.MountedCenter; - - // The vector between the player and the mouse. - Vector2 ownerToMouse = Owner.Calamity().mouseWorld - mountedCenter; - - if (ShootingTimer >= HeldItem.useAnimation) - { - HasfiredMeteor = false; - // We use the velocity of this projectile as its direction vector. - Vector2 direction = Projectile.velocity.SafeNormalize(Vector2.Zero); - - Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * 10; - Vector2 smokeVel = Projectile.velocity.SafeNormalize(Vector2.UnitY) * 5; - - if (Owner.Calamity().mouseRight) - { - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity, ProjectileType(), Projectile.damage * 4, Projectile.knockBack * 3, Projectile.owner, ownerToMouse.Length()); - if (!Main.dedServ) - { - // By decreasing the offset length of the gun from the arms, we give an effect of recoil. - OffsetLengthFromArm = 9f; - - int smokeAmount = Main.rand.Next(8, 12 + 1); - for (int i = 0; i < smokeAmount; i++) - { - Particle smoke = new HeavySmokeParticle(GunTipPosition, smokeVel.RotatedByRandom(0.4f) * Main.rand.NextFloat(1.2f, 2f), Color.White, Main.rand.Next(40, 60 + 1), Main.rand.NextFloat(0.2f, 0.4f), 0.3f, Main.rand.NextFloat(-0.2f, 0.2f), Main.rand.NextBool(), required: true); - GeneralParticleHandler.SpawnParticle(smoke); - - } - SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/LeviatitanRoar") { Volume = 0.5f }, GunTipPosition); - SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/MagicRockSound") with { Pitch = -0.7f, Volume = 0.8f }, Projectile.Center); - } - HasfiredMeteor = true; - } - else - { - // Fire the projectiles - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity.RotatedBy(MathHelper.ToRadians(2f * shotColor)), ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, ownerToMouse.Length()); - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity.RotatedBy(MathHelper.ToRadians(-2f * shotColor)), ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, ownerToMouse.Length()); - // Swap which is the top and bottom with every shot - shotColor = (shotColor == 1 ? -1 : 1); - - // Inside here go all the things that dedicated servers shouldn't spend resources on. - // Like visuals and sounds. - if (!Main.dedServ) - { - // By decreasing the offset length of the gun from the arms, we give an effect of recoil. - OffsetLengthFromArm = 25f; - - int smokeAmount = Main.rand.Next(8, 12 + 1); - for (int i = 0; i < smokeAmount; i++) - { - Particle smoke = new HeavySmokeParticle(GunTipPosition, smokeVel.RotatedByRandom(0.4f) * Main.rand.NextFloat(0.2f, 1f), Color.White, Main.rand.Next(40, 60 + 1), Main.rand.NextFloat(0.2f, 0.4f), 0.3f, Main.rand.NextFloat(-0.2f, 0.2f), Main.rand.NextBool(), required: true); - GeneralParticleHandler.SpawnParticle(smoke); - - } - SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/FlakKrakenShoot") { Pitch = 0.9f, Volume = 0.5f }, GunTipPosition); - SoundEngine.PlaySound(SoundID.Item108 with { Pitch = -0.5f, Volume = 0.8f }, Projectile.Center); - - } - } - - ShootingTimer = 0f; - ShotsFired++; - - if (ShotsFired == 6) - { - int monsterCount; - monsterCount = 2; - for (int a = 0; a < monsterCount; a++) - { - float projSpeed = 5; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Owner.Center + Main.rand.NextVector2Circular(30, 30), (Owner.Calamity().mouseWorld - Owner.MountedCenter).SafeNormalize(Vector2.Zero) * projSpeed, ModContent.ProjectileType(), (int)(Projectile.damage * 1.2f), Projectile.knockBack); - } - SoundEngine.PlaySound(SoundID.Zombie38 with { Volume = SoundID.Zombie38.Volume * 0.5f }, mountedCenter); - } - if (ShotsFired >= 6) - ShotsFired = 0; - } - if (!HasfiredMeteor || time % 3 == 0) - ShootingTimer++; - time++; - } - public override void OnSpawn(IEntitySource source) - { - base.OnSpawn(source); - } - } -} diff --git a/Projectiles/Ranged/LeviatitanMeteor.cs b/Projectiles/Ranged/LeviatitanMeteor.cs new file mode 100644 index 0000000000..1c728fd81e --- /dev/null +++ b/Projectiles/Ranged/LeviatitanMeteor.cs @@ -0,0 +1,103 @@ +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Particles; +using Terraria.DataStructures; +using System; + +namespace CalamityMod.Projectiles.Ranged +{ + public class LeviatitanMeteor : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Ranged"; + public override string Texture => "CalamityMod/Projectiles/Melee/AftershockRock"; + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; + ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + } + public override void SetDefaults() + { + Projectile.width = 38; + Projectile.height = 38; + Projectile.friendly = true; + Projectile.penetrate = 1; + Projectile.timeLeft = 600; + Projectile.DamageType = DamageClass.Ranged; + } + + public override void AI() + { + if (Projectile.velocity.Y < 25f) + Projectile.velocity.Y += 0.12f; + Projectile.rotation += Projectile.velocity.X * 0.05f; + + if (Projectile.timeLeft <= 594) + { + if (Main.rand.NextBool(3)) + { + MediumMistParticle SandCloud = new MediumMistParticle(Projectile.Center + new Vector2(25, 25).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 1.3f) * Projectile.scale, (-Projectile.velocity * 0.2f).RotatedByRandom(0.2f) + (new Vector2(3, 3).RotatedByRandom(100)), Color.Peru, Color.PeachPuff, Main.rand.NextFloat(0.4f, 1.3f), 120f, Main.rand.NextFloat(0.03f, -0.03f)); + GeneralParticleHandler.SpawnParticle(SandCloud); + } + int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.UnusedBrown, 0f, 0f, 100, default, Main.rand.NextFloat(0.75f, 1.2f)); + Main.dust[dust].velocity *= 0f; + } + } + public override void OnSpawn(IEntitySource source) + { + Vector2 smokeVel = Projectile.velocity.SafeNormalize(Vector2.UnitY) * 5; + int smokeAmount = Main.rand.Next(8, 12 + 1); + for (int i = 0; i < smokeAmount; i++) + { + Particle smoke = new HeavySmokeParticle(Projectile.Center, smokeVel.RotatedByRandom(0.4f) * Main.rand.NextFloat(1.2f, 2f), Color.White, Main.rand.Next(40, 60 + 1), Main.rand.NextFloat(0.2f, 0.4f), 0.3f, Main.rand.NextFloat(-0.2f, 0.2f), Main.rand.NextBool(), required: true); + GeneralParticleHandler.SpawnParticle(smoke); + + } + } + public override void OnKill(int timeLeft) + { + if (Projectile.owner == Main.myPlayer) + { + SoundStyle explo = new("CalamityMod/Sounds/Item/MineralMortarExplode"); + SoundEngine.PlaySound(explo with { Volume = 0.9f }, Projectile.Center); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0f); + for (int i = 0; i < 8; i++) + { + Vector2 randVel = new Vector2(12, 12).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 0.7f); + Particle smoke = new HeavySmokeParticle(Projectile.Center + randVel, randVel, Color.Peru, Main.rand.Next(25, 35 + 1), Main.rand.NextFloat(0.9f, 2.3f), 0.4f); + GeneralParticleHandler.SpawnParticle(smoke); + MediumMistParticle SandCloud = new MediumMistParticle(Projectile.Center, randVel * 0.8f, Color.Peru, Color.PeachPuff, Main.rand.NextFloat(0.4f, 1.3f), 120f, Main.rand.NextFloat(0.03f, -0.03f)); + GeneralParticleHandler.SpawnParticle(SandCloud); + } + int debriAmount = Main.rand.Next(10, 15 + 1); + for (int debriIndex = 0; debriIndex < debriAmount; debriIndex++) + { + float angle = MathHelper.TwoPi / debriAmount * debriIndex; + Vector2 velocity = angle.ToRotationVector2() * Main.rand.NextFloat(2f, 8f); + Particle debri = new StoneDebrisParticle(Projectile.Center, velocity, Color.Lerp(Color.White, Color.LightGray, Main.rand.NextFloat()), Main.rand.NextFloat(0.4f, 0.6f), Main.rand.Next(30, 45 + 1), Main.rand.NextFloat(MathHelper.Pi)); + GeneralParticleHandler.SpawnParticle(debri); + } + int mistAmount = Main.rand.Next(5, 8 + 1); + for (int mistIndex = 0; mistIndex < mistAmount; mistIndex++) + { + float angle = MathHelper.TwoPi / mistAmount * mistIndex; + Vector2 velocity = angle.ToRotationVector2() * Main.rand.NextFloat(5f, 15f); + Particle boomMist = new MediumMistParticle(Projectile.Center, velocity, Color.SaddleBrown * 0.8f, Color.Transparent, Main.rand.NextFloat(.6f, 1.4f), Main.rand.NextFloat(200f, 400f)); + GeneralParticleHandler.SpawnParticle(boomMist); + } + Particle blastRing2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Red, "CalamityMod/Particles/ShatteredExplosion", Vector2.One, Main.rand.NextFloat(-10, 10), Projectile.width / 5000f, Projectile.width / 200f, 29, true, 0.7f); + GeneralParticleHandler.SpawnParticle(blastRing2); + Particle blastRing = new CustomPulse(Projectile.Center, Vector2.Zero, Color.SaddleBrown * 0.8f, "CalamityMod/Particles/FlameExplosion", Vector2.One, Main.rand.NextFloat(-10, 10), Projectile.width / 5000f, Projectile.width / 300f, 29); + GeneralParticleHandler.SpawnParticle(blastRing); + } + } + public override bool PreDraw(ref Color lightColor) + { + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + return false; + } + } +} From 3ad0d7bfb630f56c39f9a7e6e15baf9416bb630e Mon Sep 17 00:00:00 2001 From: Xhack <72313282+energykid@users.noreply.github.com> Date: Sun, 22 Sep 2024 00:16:06 -0400 Subject: [PATCH 004/133] The basics --- Items/Weapons/Rogue/SamsaraSlicer.cs | 6 +- Projectiles/Rogue/SamsaraSlicerProjectile.cs | 214 ++++++------------- 2 files changed, 73 insertions(+), 147 deletions(-) diff --git a/Items/Weapons/Rogue/SamsaraSlicer.cs b/Items/Weapons/Rogue/SamsaraSlicer.cs index 1c35afd3bc..bf72b358e4 100644 --- a/Items/Weapons/Rogue/SamsaraSlicer.cs +++ b/Items/Weapons/Rogue/SamsaraSlicer.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Rogue [LegacyName("TerraDisk")] public class SamsaraSlicer : RogueWeapon { - public static float Speed = 12f; + public static float Speed = 20f; public override void SetDefaults() { @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.noUseGraphic = true; Item.useStyle = ItemUseStyleID.Swing; - Item.UseSound = SoundID.Item1; + Item.UseSound = SoundID.DD2_GoblinBomberThrow; Item.value = CalamityGlobalItem.RarityYellowBuyPrice; Item.rare = ItemRarityID.Yellow; @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.shootSpeed = Speed; } - public override float StealthVelocityMultiplier => 0.75f; + public override float StealthVelocityMultiplier => 1.5f; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { diff --git a/Projectiles/Rogue/SamsaraSlicerProjectile.cs b/Projectiles/Rogue/SamsaraSlicerProjectile.cs index e0c48554f8..7d6fbabe62 100644 --- a/Projectiles/Rogue/SamsaraSlicerProjectile.cs +++ b/Projectiles/Rogue/SamsaraSlicerProjectile.cs @@ -1,7 +1,11 @@ using System; +using CalamityMod.Particles; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.Audio; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -12,9 +16,11 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override string Texture => "CalamityMod/Items/Weapons/Rogue/SamsaraSlicer"; - private bool initialized = false; - private int Lifetime = 180; - private int ReboundTime = 45; + public float ReboundVelocity => 20; + public float StealthReboundVelocity => 30; + public int ReboundTime => 20; + + Vector2 oldVelocity; public override void SetStaticDefaults() { @@ -29,178 +35,98 @@ namespace CalamityMod.Projectiles.Rogue Projectile.friendly = true; Projectile.tileCollide = false; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; + Projectile.localNPCHitCooldown = 30; Projectile.penetrate = -1; Projectile.DamageType = RogueDamageClass.Instance; + Projectile.aiStyle = -1; + Projectile.ai[0] = -200; } public override void AI() { - Initialize(); - BoomerangAI(); - StealthStrikeAI(); - SpawnProjectilesNearEnemies(); - LightingandDust(); - } + Player player = Main.player[Projectile.owner]; - private void Initialize() - { - if (initialized) - return; + // Main movement - Lifetime = Projectile.Calamity().stealthStrike ? 360 : 180; - ReboundTime = Projectile.Calamity().stealthStrike ? 90 : 45; - Projectile.timeLeft = Lifetime; - initialized = true; - } - - private void BoomerangAI() - { - // Boomerang rotation - Projectile.rotation += 0.4f * Projectile.direction; - - // Boomerang sound - if (Projectile.soundDelay == 0) + if (Projectile.ai[0] < 0) { - Projectile.soundDelay = 8; - SoundEngine.PlaySound(SoundID.Item7, Projectile.position); - } + Projectile.ai[1]++; - // Returns after some number of frames in the air - if (Projectile.timeLeft < Lifetime - ReboundTime) - Projectile.ai[0] = 1f; - - if (Projectile.ai[0] == 1f) - { - //Ignore tiles and fly faster - Projectile.tileCollide = false; - Projectile.extraUpdates = 1; - - Player player = Main.player[Projectile.owner]; - float returnSpeed = 16f; - float acceleration = 1.4f; - Vector2 playerVec = player.Center - Projectile.Center; - float dist = playerVec.Length(); - - // Delete the projectile if it's excessively far away. - if (dist > 3000f) - Projectile.Kill(); - - playerVec.Normalize(); - playerVec *= returnSpeed; - - // Home back in on the player. - if (Projectile.velocity.X < playerVec.X) + if (Projectile.ai[1] > ReboundTime) { - Projectile.velocity.X += acceleration; - if (Projectile.velocity.X < 0f && playerVec.X > 0f) - Projectile.velocity.X += acceleration; - } - else if (Projectile.velocity.X > playerVec.X) - { - Projectile.velocity.X -= acceleration; - if (Projectile.velocity.X > 0f && playerVec.X < 0f) - Projectile.velocity.X -= acceleration; - } - if (Projectile.velocity.Y < playerVec.Y) - { - Projectile.velocity.Y += acceleration; - if (Projectile.velocity.Y < 0f && playerVec.Y > 0f) - Projectile.velocity.Y += acceleration; - } - else if (Projectile.velocity.Y > playerVec.Y) - { - Projectile.velocity.Y -= acceleration; - if (Projectile.velocity.Y > 0f && playerVec.Y < 0f) - Projectile.velocity.Y -= acceleration; - } + float lerp = (float)(Projectile.ai[1] - ReboundTime) * 0.01f; - // Delete the projectile if it touches its owner. - if (Main.myPlayer == Projectile.owner) - if (Projectile.Hitbox.Intersects(player.Hitbox)) + if (Projectile.Calamity().stealthStrike) + lerp = (float)(Projectile.ai[1] - ReboundTime) * 0.005f; + + Projectile.velocity = Vector2.Lerp(Projectile.velocity, Projectile.DirectionTo(player.Center) * (Projectile.Calamity().stealthStrike ? StealthReboundVelocity : ReboundVelocity), lerp); + + if (Projectile.Distance(player.Center) < Projectile.velocity.Length() * 1.4f) + { Projectile.Kill(); - } - } - - private void StealthStrikeAI() - { - if (!Projectile.Calamity().stealthStrike) - return; - - if (Projectile.timeLeft % 8f == 0f && Main.myPlayer == Projectile.owner) - { - int disk = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage / 4, Projectile.knockBack / 4f, Projectile.owner, Projectile.identity, Main.rand.NextFloat(0.02f, 0.1f)); - Main.projectile[disk].timeLeft *= 2; - Main.projectile[disk].aiStyle = -1; - } - } - - private void SpawnProjectilesNearEnemies() - { - if (!Projectile.friendly) - return; - - const float maxDistance = 300f; - bool homeIn = false; - - foreach (NPC npc in Main.ActiveNPCs) - { - if (npc.CanBeChasedBy(Projectile, false)) - { - float extraDistance = npc.width / 2 + npc.height / 2; - - bool canHit = true; - if (extraDistance < maxDistance) - canHit = Collision.CanHit(Projectile.Center, 1, 1, npc.Center, 1, 1); - - if (Vector2.Distance(npc.Center, Projectile.Center) < maxDistance + extraDistance && canHit) - { - homeIn = true; - break; } } } - if (homeIn) + // Frame pause + + Projectile.ai[0]--; + + if (Projectile.ai[0] == 0) { - if (Main.player[Projectile.owner].miscCounter % 50 == 0) + Projectile.velocity = oldVelocity; + + SoundEngine.PlaySound(SoundID.DD2_SkyDragonsFuryShot.WithPitchOffset(1f)); + + for (int i = 1; i <= 2; i++) { - int splitProj = ModContent.ProjectileType(); - if (Projectile.owner == Main.myPlayer) - { - float spread = 60f * 0.0174f; - double startAngle = Math.Atan2(Projectile.velocity.X, Projectile.velocity.Y) - spread / 2; - double deltaAngle = spread / 6f; - for (int i = 0; i < 6; i++) - { - Vector2 velocity = ((MathHelper.TwoPi * i / 6f) - MathHelper.PiOver2).ToRotationVector2() * 6f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), Projectile.damage / 2, Projectile.knockBack * 0.5f, Projectile.owner); - } - } + GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, new Vector2(i == 1 ? 2 : 6, 0).RotatedBy(Projectile.velocity.ToRotation()), Color.LimeGreen, "CalamityMod/Particles/BloomRing", new Vector2(0.5f, 1f), Projectile.velocity.ToRotation(), 0.1f, 0.5f - (i * 0.1f), 20)); + } + for (int i = 0; i <= 5; i++) + { + GeneralParticleHandler.SpawnParticle(new CustomSpark(Projectile.Center, new Vector2(Main.rand.NextFloat(-2f, 2f), Main.rand.NextFloat(-10f, 10f)).RotatedBy(Projectile.velocity.ToRotation()), "CalamityMod/Particles/ThinEndedLine", false, 10, Main.rand.NextFloat(0.3f, 1f), Main.rand.NextBool() ? new Color(1f, 0.8f, 0.1f) : Color.LimeGreen, new Vector2(Main.rand.NextFloat(0.4f, 1f), 1f))); } } - } + + if (Projectile.ai[0] <= 0 && Projectile.ai[0] > -4) + { + Projectile.extraUpdates = 1; + } + else + { + Projectile.extraUpdates = 0; + } - private void LightingandDust() - { - Lighting.AddLight(Projectile.Center, 0f, 0.75f, 0f); - if (!Main.rand.NextBool(5)) - return; - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.TerraBlade, Projectile.velocity.X, Projectile.velocity.Y); + Vector2 vel = Projectile.velocity; + if (Projectile.ai[0] > 0) + { + vel = oldVelocity * 1.5f; + } + + Projectile.rotation += MathHelper.ToRadians(vel.Length() * 1.5f); } public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + Asset tex = ModContent.Request(Texture); + + Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition, tex.Frame(), Color.White, Projectile.rotation, tex.Frame().Center(), 1f, SpriteEffects.None); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], new Color(0f, 0.6f, 0f, 0f), 2, ModContent.Request("CalamityMod/Items/Weapons/Rogue/SamsaraSlicerGlow").Value); return false; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - // Return to the player after striking an enemy. Stealth strikes don't return immediately. - if (!Projectile.Calamity().stealthStrike || Projectile.ai[1] > 3) - Projectile.ai[0] = 1f; - Projectile.ai[1]++; + // TODO: Latch effects + if (Projectile.ai[0] <= -200) + oldVelocity = Projectile.velocity * 2f; + else + oldVelocity = Projectile.velocity; + Projectile.ai[1] = ReboundTime - 15; + Projectile.velocity = Vector2.Zero; + Projectile.ai[0] = 5; + + SoundEngine.PlaySound(SoundID.DD2_WitherBeastCrystalImpact); } // Make it bounce on tiles. From 9ae26af7face7cb61f691fe08c9b5cc98667788d Mon Sep 17 00:00:00 2001 From: Xhack <72313282+energykid@users.noreply.github.com> Date: Sun, 22 Sep 2024 02:23:47 -0400 Subject: [PATCH 005/133] Main ability implemented --- Items/Weapons/Rogue/SamsaraSlicer.cs | 2 +- Projectiles/Rogue/SamsaraSlicerProjectile.cs | 128 ++++++++++++++++--- Projectiles/Rogue/SamsaraSlicerSmallDisk.cs | 84 +++++------- 3 files changed, 141 insertions(+), 73 deletions(-) diff --git a/Items/Weapons/Rogue/SamsaraSlicer.cs b/Items/Weapons/Rogue/SamsaraSlicer.cs index bf72b358e4..29249e3952 100644 --- a/Items/Weapons/Rogue/SamsaraSlicer.cs +++ b/Items/Weapons/Rogue/SamsaraSlicer.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 60; Item.height = 64; - Item.damage = 100; + Item.damage = 80; Item.knockBack = 4f; Item.useAnimation = Item.useTime = 30; Item.autoReuse = true; diff --git a/Projectiles/Rogue/SamsaraSlicerProjectile.cs b/Projectiles/Rogue/SamsaraSlicerProjectile.cs index 7d6fbabe62..abfc02187c 100644 --- a/Projectiles/Rogue/SamsaraSlicerProjectile.cs +++ b/Projectiles/Rogue/SamsaraSlicerProjectile.cs @@ -2,6 +2,7 @@ using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using MonoMod.Core.Utils; using ReLogic.Content; using Terraria; using Terraria.Audio; @@ -20,6 +21,10 @@ namespace CalamityMod.Projectiles.Rogue public float StealthReboundVelocity => 30; public int ReboundTime => 20; + public int SmallDiskDamage => 12; + + public bool initialized = false; + Vector2 oldVelocity; public override void SetStaticDefaults() @@ -33,17 +38,35 @@ namespace CalamityMod.Projectiles.Rogue Projectile.width = Projectile.height = 46; Projectile.ignoreWater = true; Projectile.friendly = true; - Projectile.tileCollide = false; + Projectile.tileCollide = true; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 30; Projectile.penetrate = -1; Projectile.DamageType = RogueDamageClass.Instance; Projectile.aiStyle = -1; Projectile.ai[0] = -200; + Projectile.ai[2] = -200; + } + + public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough, ref Vector2 hitboxCenterFrac) + { + width = 20; + height = 20; + + return base.TileCollideStyle(ref width, ref height, ref fallThrough, ref hitboxCenterFrac); } public override void AI() { + Lighting.AddLight(Projectile.Center, new Vector3(0.1f, 0.5f, 0.03f)); + + if (!initialized) + { + Projectile.ai[2] = -200; + Projectile.ai[0] = -200; + initialized = true; + } + Player player = Main.player[Projectile.owner]; // Main movement @@ -54,6 +77,8 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.ai[1] > ReboundTime) { + Projectile.tileCollide = false; + float lerp = (float)(Projectile.ai[1] - ReboundTime) * 0.01f; if (Projectile.Calamity().stealthStrike) @@ -70,7 +95,7 @@ namespace CalamityMod.Projectiles.Rogue // Frame pause - Projectile.ai[0]--; + if (Projectile.ai[0] > -150) Projectile.ai[0]--; if (Projectile.ai[0] == 0) { @@ -79,15 +104,12 @@ namespace CalamityMod.Projectiles.Rogue SoundEngine.PlaySound(SoundID.DD2_SkyDragonsFuryShot.WithPitchOffset(1f)); for (int i = 1; i <= 2; i++) - { GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, new Vector2(i == 1 ? 2 : 6, 0).RotatedBy(Projectile.velocity.ToRotation()), Color.LimeGreen, "CalamityMod/Particles/BloomRing", new Vector2(0.5f, 1f), Projectile.velocity.ToRotation(), 0.1f, 0.5f - (i * 0.1f), 20)); - } + for (int i = 0; i <= 5; i++) - { GeneralParticleHandler.SpawnParticle(new CustomSpark(Projectile.Center, new Vector2(Main.rand.NextFloat(-2f, 2f), Main.rand.NextFloat(-10f, 10f)).RotatedBy(Projectile.velocity.ToRotation()), "CalamityMod/Particles/ThinEndedLine", false, 10, Main.rand.NextFloat(0.3f, 1f), Main.rand.NextBool() ? new Color(1f, 0.8f, 0.1f) : Color.LimeGreen, new Vector2(Main.rand.NextFloat(0.4f, 1f), 1f))); - } } - + if (Projectile.ai[0] <= 0 && Projectile.ai[0] > -4) { Projectile.extraUpdates = 1; @@ -100,7 +122,28 @@ namespace CalamityMod.Projectiles.Rogue Vector2 vel = Projectile.velocity; if (Projectile.ai[0] > 0) { - vel = oldVelocity * 1.5f; + vel = new Vector2(18); + } + + if (Projectile.ai[2] > 0) + { + if (Projectile.ai[2] % 3 == 0) + { + SoundEngine.PlaySound(SoundID.Item23.WithPitchOffset(MathHelper.Lerp(1f, 0f, Projectile.ai[2] / 30)).WithVolumeScale(0.8f)); + } + + for (int i = 0; i <= 2; i++) + GeneralParticleHandler.SpawnParticle(new CustomSpark(Projectile.Center + new Vector2(25, 0).RotatedBy(oldVelocity.ToRotation()), new Vector2(Main.rand.NextFloat(-2f, 2f), Main.rand.NextFloat(-10f, 10f)).RotatedBy(oldVelocity.ToRotation()), "CalamityMod/Particles/ThinEndedLine", false, 10, Main.rand.NextFloat(0.3f, 1f), Main.rand.NextBool() ? new Color(1f, 0.8f, 0.1f) : Color.LimeGreen, new Vector2(Main.rand.NextFloat(0.4f, 1f), 1f))); + } + + if (Projectile.ai[2] > -150) + { + Projectile.ai[2]--; + } + + if (Projectile.ai[2] == 0) + { + Projectile.localNPCHitCooldown = 30; } Projectile.rotation += MathHelper.ToRadians(vel.Length() * 1.5f); @@ -110,23 +153,74 @@ namespace CalamityMod.Projectiles.Rogue { Asset tex = ModContent.Request(Texture); - Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition, tex.Frame(), Color.White, Projectile.rotation, tex.Frame().Center(), 1f, SpriteEffects.None); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], new Color(0f, 0.6f, 0f, 0f), 2, ModContent.Request("CalamityMod/Items/Weapons/Rogue/SamsaraSlicerGlow").Value); + float rand = 0; + if (Projectile.ai[2] > 0) + { + rand = 4; + } + + Vector2 randVec = new Vector2(Main.rand.NextFloat(-rand, rand), 0).RotatedBy(oldVelocity.ToRotation()); + + Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition + randVec, tex.Frame(), Color.White, Projectile.rotation, tex.Frame().Center(), 1f, SpriteEffects.None); + + if (Projectile.ai[2] < 0) + { + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], new Color(0f, 0.6f, 0f, 0f), 2, ModContent.Request("CalamityMod/Items/Weapons/Rogue/SamsaraSlicerGlow").Value); + } + else + { + //Main.EntitySpriteDraw(ModContent.Request("CalamityMod/Items/Weapons/Rogue/SamsaraSlicerGlow").Value, Projectile.Center - Main.screenPosition + randVec, tex.Frame(), new Color(0f, 1f, 0f, 0f), Projectile.rotation, tex.Frame().Center(), 1f, SpriteEffects.None); + + Main.EntitySpriteDraw(ModContent.Request("CalamityMod/Items/Weapons/Rogue/SamsaraSlicerGlow").Value, Projectile.Center - Main.screenPosition + randVec, tex.Frame(), new Color(0f, 1f, 0f, 0f), Projectile.rotation, tex.Frame().Center(), 1f, SpriteEffects.None); + } return false; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - // TODO: Latch effects - if (Projectile.ai[0] <= -200) - oldVelocity = Projectile.velocity * 2f; - else - oldVelocity = Projectile.velocity; - Projectile.ai[1] = ReboundTime - 15; + if (Projectile.velocity != Vector2.Zero) + { + if (Projectile.ai[0] <= -200) + oldVelocity = Projectile.velocity * 1.5f; + else if (Projectile.ai[1] < ReboundTime) + oldVelocity = Projectile.velocity * 0.8f; + else + oldVelocity = Projectile.velocity; + } + Projectile.ai[1] = ReboundTime - 10; Projectile.velocity = Vector2.Zero; Projectile.ai[0] = 5; SoundEngine.PlaySound(SoundID.DD2_WitherBeastCrystalImpact); + + if (Projectile.ai[2] == -200) + { + float lag = 20; + if (Projectile.Calamity().stealthStrike) lag = 40; + + Projectile.ai[0] = lag; + Projectile.ai[2] = lag; + + float g = 0f; + if (Main.rand.NextBool()) g = 45f; + + g -= 15f; + + float SpawnVel = 15; + if (Projectile.Calamity().stealthStrike) + SpawnVel = 20; + + if (!Main.dedServ) + { + for (float i = g; i < g + 360f; i += Projectile.Calamity().stealthStrike ? 45f : 90f) + { + Projectile proj = Projectile.NewProjectileDirect(new EntitySource_Parent(Projectile), Projectile.Center, new Vector2(SpawnVel, 0).RotatedBy(MathHelper.ToRadians(i)), + ModContent.ProjectileType(), SmallDiskDamage, 1f, Projectile.owner, Projectile.whoAmI); + (proj.ModProjectile as SamsaraSlicerSmallDisk).Parent = Projectile; + proj.Calamity().stealthStrike = Projectile.Calamity().stealthStrike; + } + } + } } // Make it bounce on tiles. @@ -144,7 +238,7 @@ namespace CalamityMod.Projectiles.Rogue { Projectile.velocity.Y = -oldVelocity.Y; } - Projectile.ai[0] = 1f; + return false; } } diff --git a/Projectiles/Rogue/SamsaraSlicerSmallDisk.cs b/Projectiles/Rogue/SamsaraSlicerSmallDisk.cs index 9d0c40de2b..d6fb4454e8 100644 --- a/Projectiles/Rogue/SamsaraSlicerSmallDisk.cs +++ b/Projectiles/Rogue/SamsaraSlicerSmallDisk.cs @@ -9,6 +9,7 @@ namespace CalamityMod.Projectiles.Rogue { public new string LocalizationCategory => "Projectiles.Rogue"; private double rotation = 0; + public Projectile Parent = null; public override void SetStaticDefaults() { ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10; @@ -19,78 +20,51 @@ namespace CalamityMod.Projectiles.Rogue { Projectile.width = 40; Projectile.height = 40; - Projectile.alpha = 75; Projectile.ignoreWater = true; Projectile.friendly = true; Projectile.tileCollide = false; Projectile.penetrate = -1; - Projectile.aiStyle = ProjAIStyleID.Boomerang; - Projectile.timeLeft = 60; - AIType = ProjectileID.WoodenBoomerang; + Projectile.aiStyle = -1; + Projectile.timeLeft = 200; Projectile.DamageType = RogueDamageClass.Instance; - Projectile.usesIDStaticNPCImmunity = true; - Projectile.idStaticNPCHitCooldown = 6; } public override void AI() { - StealthStrikeAI(); - LightingandDust(); - } - - private void StealthStrikeAI() - { - if (Projectile.aiStyle == 3) - return; - - Projectile.rotation += 0.4f * Projectile.direction; - - Projectile parent = Main.projectile[0]; - bool active = false; - foreach (Projectile p in Main.ActiveProjectiles) + if (Projectile.Calamity().stealthStrike) { - if (p.identity == Projectile.ai[0] && p.type == ModContent.ProjectileType()) + Projectile.localNPCHitCooldown = 3; + Projectile.usesLocalNPCImmunity = true; + } + + Projectile.ai[1]++; + + Projectile.rotation += MathHelper.ToRadians(12f); + + Projectile.velocity = Projectile.velocity.RotatedBy(MathHelper.ToRadians(8f)); + + float Vel = 15; + if (Projectile.Calamity().stealthStrike) Vel = 20; + + float length = 10; + if (Projectile.Calamity().stealthStrike) length = 15; + + if (Projectile.ai[1] > length && Parent != null) + { + Vel += (Projectile.ai[1] - length); + + Projectile.velocity = Vector2.Lerp(Projectile.velocity, Projectile.DirectionTo(Parent.Center) * Vel, Projectile.Calamity().stealthStrike ? 0.25f : 0.35f); + + if (Projectile.Distance(Parent.Center) < Projectile.velocity.Length() + 3) { - parent = p; - active = true; - break; + Projectile.Kill(); } } - - if (active) - { - Vector2 vector = parent.Center - Projectile.Center; - Projectile.Center = parent.Center + new Vector2(80, 0).RotatedBy(rotation); - double rotateAmt = (double)Projectile.ai[1]; - rotation += rotateAmt; - if (rotation >= 360) - { - rotation = 0; - } - Projectile.velocity.X = (vector.X > 0f) ? -0.000001f : 0f; - } - else - { - Projectile.Kill(); - } - - if (!parent.active) - { - Projectile.Kill(); - } - } - - private void LightingandDust() - { - Lighting.AddLight(Projectile.Center, 0f, 0.75f, 0f); - if (!Main.rand.NextBool(5)) - return; - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.TerraBlade, Projectile.velocity.X, Projectile.velocity.Y); } public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], new Color(0f, 1f, 0f, 0f), 2); return false; } } From e99df1599e7252074bd9f40d5399b9304bb83bd8 Mon Sep 17 00:00:00 2001 From: Xhack <72313282+energykid@users.noreply.github.com> Date: Sun, 22 Sep 2024 19:58:36 -0400 Subject: [PATCH 006/133] Polishing changes --- Projectiles/Rogue/SamsaraSlicerProjectile.cs | 75 +++++++++++++++++--- Projectiles/Rogue/SamsaraSlicerSmallDisk.cs | 70 ++++++++++++++++-- 2 files changed, 128 insertions(+), 17 deletions(-) diff --git a/Projectiles/Rogue/SamsaraSlicerProjectile.cs b/Projectiles/Rogue/SamsaraSlicerProjectile.cs index abfc02187c..c764789103 100644 --- a/Projectiles/Rogue/SamsaraSlicerProjectile.cs +++ b/Projectiles/Rogue/SamsaraSlicerProjectile.cs @@ -19,9 +19,11 @@ namespace CalamityMod.Projectiles.Rogue public float ReboundVelocity => 20; public float StealthReboundVelocity => 30; + public float StealthPauseTime => 55; public int ReboundTime => 20; - public int SmallDiskDamage => 12; + public int SmallDiskDamage => 8; + public int SmallDiskStealthDamage => 17; public bool initialized = false; @@ -88,6 +90,19 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.Distance(player.Center) < Projectile.velocity.Length() * 1.4f) { + for (int i = 0; i < Main.projectile.Length; i++) + { + Projectile proj = Main.projectile[i]; + + if (proj.type == ModContent.ProjectileType()) + { + if ((proj.ModProjectile as SamsaraSlicerSmallDisk).Parent == Projectile) + { + (Main.projectile[i].ModProjectile as SamsaraSlicerSmallDisk).Parent = null; + } + } + } + Projectile.Kill(); } } @@ -103,8 +118,26 @@ namespace CalamityMod.Projectiles.Rogue SoundEngine.PlaySound(SoundID.DD2_SkyDragonsFuryShot.WithPitchOffset(1f)); - for (int i = 1; i <= 2; i++) - GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, new Vector2(i == 1 ? 2 : 6, 0).RotatedBy(Projectile.velocity.ToRotation()), Color.LimeGreen, "CalamityMod/Particles/BloomRing", new Vector2(0.5f, 1f), Projectile.velocity.ToRotation(), 0.1f, 0.5f - (i * 0.1f), 20)); + + if (Projectile.Calamity().stealthStrike) + { + SoundEngine.PlaySound(SoundID.Item122.WithPitchOffset(1f), Projectile.Center); + + for (int i = 1; i <= 3; i++) + { + GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, oldVelocity * MathHelper.Lerp(2f, 1f, (float)i / 3f) / 4, Color.LimeGreen, "CalamityMod/Particles/SoftRoundExplosion", new Vector2(0.6f, 1f), oldVelocity.ToRotation(), 0.02f, 0.05f * i, 30)); + } + + for (int i = -10; i <= 20; i++) + { + GeneralParticleHandler.SpawnParticle(new CustomSpark(Projectile.Center, new Vector2(i * 2, 0).RotatedBy(Projectile.velocity.ToRotation()), "CalamityMod/Particles/ThinEndedLine", false, 10, Main.rand.NextFloat(0.3f, 1f), Main.rand.NextBool() ? new Color(1f, 0.8f, 0.1f) : Color.LimeGreen, new Vector2(Main.rand.NextFloat(0.4f, 1f), 1f))); + } + } + else + { + for (int i = 1; i <= 2; i++) + GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, new Vector2(i == 1 ? 2 : 6, 0).RotatedBy(Projectile.velocity.ToRotation()), Color.LimeGreen, "CalamityMod/Particles/BloomRing", new Vector2(0.5f, 1f), Projectile.velocity.ToRotation(), 0.1f, 0.5f - (i * 0.1f), 20)); + } for (int i = 0; i <= 5; i++) GeneralParticleHandler.SpawnParticle(new CustomSpark(Projectile.Center, new Vector2(Main.rand.NextFloat(-2f, 2f), Main.rand.NextFloat(-10f, 10f)).RotatedBy(Projectile.velocity.ToRotation()), "CalamityMod/Particles/ThinEndedLine", false, 10, Main.rand.NextFloat(0.3f, 1f), Main.rand.NextBool() ? new Color(1f, 0.8f, 0.1f) : Color.LimeGreen, new Vector2(Main.rand.NextFloat(0.4f, 1f), 1f))); @@ -125,6 +158,11 @@ namespace CalamityMod.Projectiles.Rogue vel = new Vector2(18); } + if (Projectile.ai[2] > -150) + { + Projectile.ai[2]--; + } + if (Projectile.ai[2] > 0) { if (Projectile.ai[2] % 3 == 0) @@ -135,10 +173,22 @@ namespace CalamityMod.Projectiles.Rogue for (int i = 0; i <= 2; i++) GeneralParticleHandler.SpawnParticle(new CustomSpark(Projectile.Center + new Vector2(25, 0).RotatedBy(oldVelocity.ToRotation()), new Vector2(Main.rand.NextFloat(-2f, 2f), Main.rand.NextFloat(-10f, 10f)).RotatedBy(oldVelocity.ToRotation()), "CalamityMod/Particles/ThinEndedLine", false, 10, Main.rand.NextFloat(0.3f, 1f), Main.rand.NextBool() ? new Color(1f, 0.8f, 0.1f) : Color.LimeGreen, new Vector2(Main.rand.NextFloat(0.4f, 1f), 1f))); } - + if (Projectile.ai[2] > -150) { - Projectile.ai[2]--; + if (Projectile.Calamity().stealthStrike) + { + float SpawnVel = 15; + + float g = Main.rand.NextFloat(360f); + + if (!Main.dedServ) + { + Projectile proj = Projectile.NewProjectileDirect(new EntitySource_Parent(Projectile), Projectile.Center, new Vector2(SpawnVel, 0).RotatedBy(MathHelper.ToRadians(g)), + ModContent.ProjectileType(), Projectile.Calamity().stealthStrike ? SmallDiskStealthDamage : SmallDiskDamage, 1f, Projectile.owner, Projectile.whoAmI); + (proj.ModProjectile as SamsaraSlicerSmallDisk).Parent = Projectile; + } + } } if (Projectile.ai[2] == 0) @@ -176,7 +226,7 @@ namespace CalamityMod.Projectiles.Rogue return false; } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { if (Projectile.velocity != Vector2.Zero) { @@ -196,13 +246,14 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.ai[2] == -200) { float lag = 20; - if (Projectile.Calamity().stealthStrike) lag = 40; + if (Projectile.Calamity().stealthStrike) lag = StealthPauseTime; Projectile.ai[0] = lag; Projectile.ai[2] = lag; - float g = 0f; - if (Main.rand.NextBool()) g = 45f; + Projectile.localNPCHitCooldown = (int)lag; + + float g = Main.rand.NextFloat(360f); g -= 15f; @@ -215,7 +266,7 @@ namespace CalamityMod.Projectiles.Rogue for (float i = g; i < g + 360f; i += Projectile.Calamity().stealthStrike ? 45f : 90f) { Projectile proj = Projectile.NewProjectileDirect(new EntitySource_Parent(Projectile), Projectile.Center, new Vector2(SpawnVel, 0).RotatedBy(MathHelper.ToRadians(i)), - ModContent.ProjectileType(), SmallDiskDamage, 1f, Projectile.owner, Projectile.whoAmI); + ModContent.ProjectileType(), Projectile.Calamity().stealthStrike ? SmallDiskStealthDamage : SmallDiskDamage, 1f, Projectile.owner, Projectile.whoAmI); (proj.ModProjectile as SamsaraSlicerSmallDisk).Parent = Projectile; proj.Calamity().stealthStrike = Projectile.Calamity().stealthStrike; } @@ -223,6 +274,10 @@ namespace CalamityMod.Projectiles.Rogue } } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + } + // Make it bounce on tiles. public override bool OnTileCollide(Vector2 oldVelocity) { diff --git a/Projectiles/Rogue/SamsaraSlicerSmallDisk.cs b/Projectiles/Rogue/SamsaraSlicerSmallDisk.cs index d6fb4454e8..233c6216a6 100644 --- a/Projectiles/Rogue/SamsaraSlicerSmallDisk.cs +++ b/Projectiles/Rogue/SamsaraSlicerSmallDisk.cs @@ -1,5 +1,6 @@ using Microsoft.Xna.Framework; using Terraria; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -25,46 +26,101 @@ namespace CalamityMod.Projectiles.Rogue Projectile.tileCollide = false; Projectile.penetrate = -1; Projectile.aiStyle = -1; - Projectile.timeLeft = 200; Projectile.DamageType = RogueDamageClass.Instance; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 3; } public override void AI() { + Player player = Main.player[Projectile.owner]; + if (Projectile.Calamity().stealthStrike) { Projectile.localNPCHitCooldown = 3; Projectile.usesLocalNPCImmunity = true; } + bool returning = false; + Projectile.ai[1]++; Projectile.rotation += MathHelper.ToRadians(12f); - Projectile.velocity = Projectile.velocity.RotatedBy(MathHelper.ToRadians(8f)); - float Vel = 15; if (Projectile.Calamity().stealthStrike) Vel = 20; float length = 10; if (Projectile.Calamity().stealthStrike) length = 15; - if (Projectile.ai[1] > length && Parent != null) + if (Projectile.ai[1] > length) { Vel += (Projectile.ai[1] - length); + if (Parent != null) + { + if (Parent.active) + { + Projectile.velocity = Vector2.Lerp(Projectile.velocity, Projectile.DirectionTo(Parent.Center) * Vel, Projectile.Calamity().stealthStrike ? 0.25f : 0.35f); - Projectile.velocity = Vector2.Lerp(Projectile.velocity, Projectile.DirectionTo(Parent.Center) * Vel, Projectile.Calamity().stealthStrike ? 0.25f : 0.35f); + if ((Projectile.Center + Projectile.velocity).Distance(Parent.Center) < Projectile.velocity.Length()) + { + Projectile.Kill(); + } + } + else returning = true; + } + else returning = true; + } - if (Projectile.Distance(Parent.Center) < Projectile.velocity.Length() + 3) + if (Parent != null) + { + Projectile.velocity = Projectile.velocity.RotatedBy(MathHelper.ToRadians(8f)); + } + + if (Parent != null && !returning) + { + Projectile.position += Parent.velocity; + } + + if (Parent != null) + { + if (!Parent.active) Parent = null; + } + + if (Parent == null) + { + Projectile.timeLeft = 5; + Projectile.position += player.velocity; + Projectile.velocity = Projectile.DirectionTo(player.Center) * 4f; + Projectile.scale *= 0.9f; + if (Projectile.Distance(player.Center) < Projectile.velocity.Length()) { Projectile.Kill(); } } } + public override void OnSpawn(IEntitySource source) + { + Parent = Main.projectile[(int)Projectile.ai[0]]; + } + + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + target.immune[Projectile.owner] = 0; + } + public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], new Color(0f, 1f, 0f, 0f), 2); + for (int i = 1; i < Projectile.oldPos.Length; i++) + { + Vector2 oldP1 = Projectile.oldPos[i]; + Vector2 oldP2 = Projectile.oldPos[i - 1]; + + Projectile.oldPos[i] = oldP2 + (oldP2.DirectionTo(oldP1) * MathHelper.Min(oldP2.Distance(oldP1), 5)); + } + + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], new Color(0.2f, 1f, 0f, 0f), 2); return false; } } From eee0d5a69f624d46195f519518d86640a7fba7b6 Mon Sep 17 00:00:00 2001 From: Xhack <72313282+energykid@users.noreply.github.com> Date: Sun, 22 Sep 2024 20:31:50 -0400 Subject: [PATCH 007/133] Finalize --- Items/Weapons/Rogue/SamsaraSlicer.cs | 8 ++++++++ Projectiles/Rogue/SamsaraSlicerProjectile.cs | 4 +--- Projectiles/Rogue/SamsaraSlicerSmallDisk.cs | 12 ++++++------ 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/Items/Weapons/Rogue/SamsaraSlicer.cs b/Items/Weapons/Rogue/SamsaraSlicer.cs index 29249e3952..a6cb2e84ef 100644 --- a/Items/Weapons/Rogue/SamsaraSlicer.cs +++ b/Items/Weapons/Rogue/SamsaraSlicer.cs @@ -40,6 +40,8 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + if (player.ownedProjectileCounts[type] > 4) return false; + int proj = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); if (player.Calamity().StealthStrikeAvailable() && proj.WithinBounds(Main.maxProjectiles)) { @@ -48,6 +50,12 @@ namespace CalamityMod.Items.Weapons.Rogue return false; } + public override bool CanUseItem(Player player) + { + if (player.ownedProjectileCounts[Item.shoot] > 4) return false; + return base.CanUseItem(player); + } + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request("CalamityMod/Items/Weapons/Rogue/SamsaraSlicerGlow").Value); diff --git a/Projectiles/Rogue/SamsaraSlicerProjectile.cs b/Projectiles/Rogue/SamsaraSlicerProjectile.cs index c764789103..e4e11c27af 100644 --- a/Projectiles/Rogue/SamsaraSlicerProjectile.cs +++ b/Projectiles/Rogue/SamsaraSlicerProjectile.cs @@ -165,7 +165,7 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.ai[2] > 0) { - if (Projectile.ai[2] % 3 == 0) + if (Projectile.ai[2] % (Projectile.Calamity().stealthStrike ? 3 : 5) == 0) { SoundEngine.PlaySound(SoundID.Item23.WithPitchOffset(MathHelper.Lerp(1f, 0f, Projectile.ai[2] / 30)).WithVolumeScale(0.8f)); } @@ -232,8 +232,6 @@ namespace CalamityMod.Projectiles.Rogue { if (Projectile.ai[0] <= -200) oldVelocity = Projectile.velocity * 1.5f; - else if (Projectile.ai[1] < ReboundTime) - oldVelocity = Projectile.velocity * 0.8f; else oldVelocity = Projectile.velocity; } diff --git a/Projectiles/Rogue/SamsaraSlicerSmallDisk.cs b/Projectiles/Rogue/SamsaraSlicerSmallDisk.cs index 233c6216a6..9e29cade13 100644 --- a/Projectiles/Rogue/SamsaraSlicerSmallDisk.cs +++ b/Projectiles/Rogue/SamsaraSlicerSmallDisk.cs @@ -33,6 +33,11 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { + if (Parent != null) + { + if (!Parent.active) Parent = null; + } + Player player = Main.player[Projectile.owner]; if (Projectile.Calamity().stealthStrike) @@ -72,7 +77,7 @@ namespace CalamityMod.Projectiles.Rogue else returning = true; } - if (Parent != null) + if (Parent != null && Parent.active) { Projectile.velocity = Projectile.velocity.RotatedBy(MathHelper.ToRadians(8f)); } @@ -82,11 +87,6 @@ namespace CalamityMod.Projectiles.Rogue Projectile.position += Parent.velocity; } - if (Parent != null) - { - if (!Parent.active) Parent = null; - } - if (Parent == null) { Projectile.timeLeft = 5; From 2981d6433cffd1be3702198d6710c7a5ef50d631 Mon Sep 17 00:00:00 2001 From: mochi-angel Date: Sun, 22 Sep 2024 21:47:11 -0700 Subject: [PATCH 008/133] Final adjustments --- Items/Weapons/Ranged/Leviatitan.cs | 2 +- Projectiles/Ranged/AquaBlast.cs | 36 ++++++++++++++------------ Projectiles/Ranged/LeviatitanMeteor.cs | 5 ++-- 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/Items/Weapons/Ranged/Leviatitan.cs b/Items/Weapons/Ranged/Leviatitan.cs index 76d735c82f..50eba4b098 100644 --- a/Items/Weapons/Ranged/Leviatitan.cs +++ b/Items/Weapons/Ranged/Leviatitan.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 28; Item.damage = 121; Item.DamageType = DamageClass.Ranged; - Item.useTime = Item.useAnimation = 18; //Try not to change this if you can help it + Item.useTime = Item.useAnimation = 18; //Try not to change this if you can help it. Item.noMelee = true; Item.knockBack = 5f; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; diff --git a/Projectiles/Ranged/AquaBlast.cs b/Projectiles/Ranged/AquaBlast.cs index 77fd2a7062..4f3777524d 100644 --- a/Projectiles/Ranged/AquaBlast.cs +++ b/Projectiles/Ranged/AquaBlast.cs @@ -22,6 +22,7 @@ namespace CalamityMod.Projectiles.Ranged Main.projFrames[Projectile.type] = 20; } public int spreadDust = 0; + public static int Lifetime = 600; public override void SetDefaults() { @@ -30,7 +31,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.penetrate = 1; - Projectile.timeLeft = 600; + Projectile.timeLeft = Lifetime; Projectile.extraUpdates = 2; Projectile.DamageType = DamageClass.Ranged; Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; @@ -57,28 +58,29 @@ namespace CalamityMod.Projectiles.Ranged Lighting.AddLight(Projectile.Center, Color.AliceBlue.ToVector3() * 0.5f); - if (Projectile.timeLeft <= 593) + //Trailing effects + if (Projectile.timeLeft <= Lifetime - 7) { for (int i = 0; i < 2; i++) { SparkParticle spark = new SparkParticle(Projectile.Center - Projectile.velocity / 0.18f, Projectile.velocity * 0.01f, false, 5, 1.9f, Color.SeaGreen, true); GeneralParticleHandler.SpawnParticle(spark); } - if (Main.rand.NextBool(2)) - { - Gore bubble = Gore.NewGorePerfect(Projectile.GetSource_FromAI(), Projectile.position, Projectile.velocity * 0.2f + Main.rand.NextVector2Circular(1f, 1f), 411); - bubble.timeLeft = 6 + Main.rand.Next(7); - bubble.scale = Main.rand.NextFloat(0.6f, 0.8f); - bubble.type = Main.rand.NextBool(3) ? 412 : 411; - } - if (Main.rand.NextBool()) - { - Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(6 + spreadDust, 6 + spreadDust), !Main.rand.NextBool(5) ? 278 : 267, -Projectile.velocity * Main.rand.NextFloat(0.05f, 0.35f), 0, default, Main.rand.NextFloat(0.4f, 0.6f)); - dust.noGravity = true; - dust.color = !Main.rand.NextBool(5) ? Color.Aquamarine : Color.Aqua; - if (dust.type == 278) - dust.scale *= 0.7f; - } + } + if (Main.rand.NextBool(2)) + { + Gore bubble = Gore.NewGorePerfect(Projectile.GetSource_FromAI(), Projectile.position, Projectile.velocity * 0.2f + Main.rand.NextVector2Circular(1f, 1f), 411); + bubble.timeLeft = 6 + Main.rand.Next(7); + bubble.scale = Main.rand.NextFloat(0.6f, 0.8f); + bubble.type = Main.rand.NextBool(3) ? 412 : 411; + } + if (Main.rand.NextBool()) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(6 + spreadDust, 6 + spreadDust), !Main.rand.NextBool(5) ? 278 : 267, -Projectile.velocity * Main.rand.NextFloat(0.05f, 0.35f), 0, default, Main.rand.NextFloat(0.4f, 0.6f)); + dust.noGravity = true; + dust.color = !Main.rand.NextBool(5) ? Color.Aquamarine : Color.Aqua; + if (dust.type == 278) + dust.scale *= 0.7f; } } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) diff --git a/Projectiles/Ranged/LeviatitanMeteor.cs b/Projectiles/Ranged/LeviatitanMeteor.cs index 1c728fd81e..ef3279a3ea 100644 --- a/Projectiles/Ranged/LeviatitanMeteor.cs +++ b/Projectiles/Ranged/LeviatitanMeteor.cs @@ -19,13 +19,14 @@ namespace CalamityMod.Projectiles.Ranged ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; ProjectileID.Sets.TrailingMode[Projectile.type] = 0; } + public static int Lifetime = 600; public override void SetDefaults() { Projectile.width = 38; Projectile.height = 38; Projectile.friendly = true; Projectile.penetrate = 1; - Projectile.timeLeft = 600; + Projectile.timeLeft = Lifetime; Projectile.DamageType = DamageClass.Ranged; } @@ -35,7 +36,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.velocity.Y += 0.12f; Projectile.rotation += Projectile.velocity.X * 0.05f; - if (Projectile.timeLeft <= 594) + if (Projectile.timeLeft <= Lifetime - 6) { if (Main.rand.NextBool(3)) { From 226ef6b8beb238e901f4a9c04ce17f25ba0fed78 Mon Sep 17 00:00:00 2001 From: mochi-angel Date: Sun, 22 Sep 2024 21:58:13 -0700 Subject: [PATCH 009/133] Removed unused sound --- Sounds/Item/LeviatitanRoar.ogg | Bin 20379 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 Sounds/Item/LeviatitanRoar.ogg diff --git a/Sounds/Item/LeviatitanRoar.ogg b/Sounds/Item/LeviatitanRoar.ogg deleted file mode 100644 index 983eadacf7cf5c579092d3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W1J<6A zQ_8`UOO<{9Un#fwd|5Kr`kk7oq=a70oL)cIeKQE3b0^l5m(Fv~;=0YT zfEAkb+8~-<*GB%Mw^ddgy3WcY7H)AN|2`KXZP5Sz4H&PV-PoZBk8TsSTMf1X^6>ND zYS)hH?N#@5WtH``+vvXVj(BDHgg zZr7}c5E&L2m{@=mMf`eSpqtglRv(1aO2Hr|h>D7JTZw|(mIL%tR;K1~dMVaXAh6B= zoS00h*2$rWf<|8#s|>LMDJt5}{gh5u1<~lL=yWTH8tV*f;QN-n@k6Xp&pKQewW0DJ zafe8X7^yGg^1qC%CnHaRkTceFPNN_y8F~1U5Pp3@ybCWyB_jh6YZOv!v1YVE#TqLp zWzATe06?P=DSiM_tK-sP1>pR)FTaS$81*LU;Y19FEfrBuK?M~G05FkKqo+<|(Tjpu zhqG7-016=1;Vf1H0H~;t0cxBMi{1$U&Jiub5V`;k4*~t>{poA;0|3zN{!!^h-UR%; dw>t>n08PN(M|(g32LJ#70000000000001j)g!cdd From f1f662f63063157beb9a44a98344394201631369 Mon Sep 17 00:00:00 2001 From: mochi-angel Date: Sun, 22 Sep 2024 22:35:52 -0700 Subject: [PATCH 010/133] Final changes for real this time I promise --- Items/Weapons/Ranged/Leviatitan.cs | 2 -- Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Items/Weapons/Ranged/Leviatitan.cs b/Items/Weapons/Ranged/Leviatitan.cs index 50eba4b098..a640da1b1d 100644 --- a/Items/Weapons/Ranged/Leviatitan.cs +++ b/Items/Weapons/Ranged/Leviatitan.cs @@ -1,9 +1,7 @@ using System; using System.Diagnostics.Metrics; using CalamityMod.Particles; -using CalamityMod.Projectiles.Magic; using CalamityMod.Projectiles.Ranged; -using CalamityMod.Projectiles.Rogue; using Microsoft.Build.Tasks; using Microsoft.Xna.Framework; using Terraria; diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index 92ad8e039f..5391564821 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -687,6 +687,7 @@ Leviatitan: { Fires high velocity aqua blasts Releases homing aberrations that shred enemy defense every six shots to vomit a meteor that explodes on hit + 'The L in LMG stands for Leviathan' ''' } From 8d0de798e4e7f50b146c4060eef3509b43d7668a Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Mon, 23 Sep 2024 22:50:51 +0700 Subject: [PATCH 011/133] couple misc things --- Items/Accessories/StatisVoidSash.cs | 1 + Items/CalamityGlobalItemTweaks.cs | 2 +- .../Mods.CalamityMod.Items.Accessories.hjson | 2 +- .../en-US/Mods.CalamityMod.Status.Death.hjson | 2 +- Projectiles/Magic/ForbiddenSunProjectile.cs | 24 ++++++------- Projectiles/Magic/ForbiddenSunburst.cs | 36 ++++++------------- Projectiles/Melee/OldLordClaymoreProj.cs | 5 +++ 7 files changed, 30 insertions(+), 42 deletions(-) diff --git a/Items/Accessories/StatisVoidSash.cs b/Items/Accessories/StatisVoidSash.cs index 8760d9bb52..6c22ab7e9b 100644 --- a/Items/Accessories/StatisVoidSash.cs +++ b/Items/Accessories/StatisVoidSash.cs @@ -42,6 +42,7 @@ namespace CalamityMod.Items.Accessories modPlayer.DashID = StatisVoidSashDash.ID; player.dashType = 0; player.spikedBoots = 2; + player.accFlipper = true; } public override void AddRecipes() diff --git a/Items/CalamityGlobalItemTweaks.cs b/Items/CalamityGlobalItemTweaks.cs index bfd3286fe7..52bf492742 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -126,7 +126,7 @@ namespace CalamityMod.Items { ItemID.GrenadeLauncher, Do(DamageExact(112)) }, { ItemID.Gungnir, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(92), ShootSpeedRatio(1.25f)) }, { ItemID.HallowedRepeater, Do(PointBlank, UseExact(12)) }, - { ItemID.Handgun, Do(PointBlank, UseExact(22)) }, + { ItemID.Handgun, Do(PointBlank, UseExact(20)) }, { ItemID.HellwingBow, Do(PointBlank, DamageExact(16)) }, { ItemID.HighVelocityBullet, Do(DamageExact(13)) }, { ItemID.HiveFive, Do(AutoReuse, DamageExact(27)) }, diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 099b559c1d..b3fe045eb6 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -1648,7 +1648,7 @@ StatisVoidSash: { Tooltip: ''' 32% increased jump speed, allows auto-jump, and negates fall damage - Can climb walls, dash, and dodge attacks + Can swim, climb walls, dash, and dodge attacks ''' HoldShiftTooltip: ''' diff --git a/Localization/en-US/Mods.CalamityMod.Status.Death.hjson b/Localization/en-US/Mods.CalamityMod.Status.Death.hjson index f6dc2c8748..b8dd397c36 100644 --- a/Localization/en-US/Mods.CalamityMod.Status.Death.hjson +++ b/Localization/en-US/Mods.CalamityMod.Status.Death.hjson @@ -48,7 +48,7 @@ ChaliceOfTheBloodGodUnequip: "{0} violated their pact with the Blood God." ChibiiDoggo: "{0} couldn't stand the sharp objects." CirrusSlap1: "{0} was slapped too hard." CirrusSlap2: "{0} forked around and found out." -CorpusAvertor: "{0} became the blood god's sacrifice." +CorpusAvertor: "{0} became the Blood God's sacrifice." CrushDepth1: "{0} was crushed by the pressure." CrushDepth2: "{0}'s lungs collapsed." CrushDepth3: "{0}'s bones crunched under the deep pressure." diff --git a/Projectiles/Magic/ForbiddenSunProjectile.cs b/Projectiles/Magic/ForbiddenSunProjectile.cs index 5fb8696413..6aaf251d2a 100644 --- a/Projectiles/Magic/ForbiddenSunProjectile.cs +++ b/Projectiles/Magic/ForbiddenSunProjectile.cs @@ -1,4 +1,5 @@ -using Terraria; +using Microsoft.Xna.Framework; +using Terraria; using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; @@ -28,15 +29,9 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { Projectile.rotation = Projectile.velocity.ToRotation(); - if (Projectile.frameCounter++ % 4 == 0) - { - Projectile.frame++; - } - if (Projectile.frame >= Main.projFrames[Projectile.type]) - { - Projectile.frame = 0; - } - Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.25f / 255f, (255 - Projectile.alpha) * 0.2f / 255f, (255 - Projectile.alpha) * 0.01f / 255f); + Projectile.frameCounter++; + Projectile.frame = Projectile.frameCounter / 4 % Main.projFrames[Projectile.type]; + Lighting.AddLight(Projectile.Center, 0.25f, 0.2f, 0.01f); if (Projectile.wet && !Projectile.lavaWet) { Projectile.Kill(); @@ -48,17 +43,18 @@ namespace CalamityMod.Projectiles.Magic } if (Main.rand.NextBool(4)) { - int forbid = Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, Main.rand.NextBool(3) ? 16 : 174, 0f, 0f); - Main.dust[forbid].noGravity = true; - Main.dust[forbid].velocity *= 0f; + Dust fire = Dust.NewDustDirect(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, Main.rand.NextBool(3) ? 16 : 174); + fire.noGravity = true; + fire.velocity *= 0f; } } public override void OnKill(int timeLeft) { + SoundEngine.PlaySound(SoundID.Item20, Projectile.Center); if (Projectile.owner == Main.myPlayer) { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); } } diff --git a/Projectiles/Magic/ForbiddenSunburst.cs b/Projectiles/Magic/ForbiddenSunburst.cs index 03785ec273..a14becc6ca 100644 --- a/Projectiles/Magic/ForbiddenSunburst.cs +++ b/Projectiles/Magic/ForbiddenSunburst.cs @@ -1,7 +1,5 @@ -using System; -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; -using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; @@ -35,11 +33,6 @@ namespace CalamityMod.Projectiles.Magic { Projectile.Kill(); } - if (Projectile.localAI[0] == 0f) - { - SoundEngine.PlaySound(SoundID.Item20, Projectile.Center); - Projectile.localAI[0] += 1f; - } float projTimer = 25f; if (Projectile.ai[0] > 180f) { @@ -52,31 +45,24 @@ namespace CalamityMod.Projectiles.Magic } projTimer *= 0.7f; Projectile.ai[0] += 4f; - int timerCounter = 0; - while ((float)timerCounter < projTimer) + float timerCounter = 0; + while (timerCounter < projTimer) { - float rando1 = (float)Main.rand.Next(-25, 26); - float rando2 = (float)Main.rand.Next(-25, 26); - float rando3 = (float)Main.rand.Next(9, 24); - float randoAdjuster = (float)Math.Sqrt((double)(rando1 * rando1 + rando2 * rando2)); - randoAdjuster = rando3 / randoAdjuster; - rando1 *= randoAdjuster; - rando2 *= randoAdjuster; - int orngDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Pixie, 0f, 0f, 100, default, 2.5f); - Dust dust = Main.dust[orngDust]; + Dust dust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.Pixie, Alpha: 100, Scale: 2.5f); dust.noGravity = true; - dust.position.X = Projectile.Center.X; - dust.position.Y = Projectile.Center.Y; - dust.position.X += (float)Main.rand.Next(-10, 11); - dust.position.Y += (float)Main.rand.Next(-10, 11); - dust.velocity.X = rando1; - dust.velocity.Y = rando2; + dust.position = Projectile.Center + Main.rand.NextVector2Circular(10f, 10f); + dust.velocity = Main.rand.NextVector2Circular(25f, 25f); timerCounter++; } } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.OnFire3, 300); + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + modifiers.HitDirectionOverride = (Projectile.Center.X < target.Center.X).ToDirectionInt(); + } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, ExplosionRadius, targetHitbox); } } diff --git a/Projectiles/Melee/OldLordClaymoreProj.cs b/Projectiles/Melee/OldLordClaymoreProj.cs index 2ad7609cef..9d32a7a7fb 100644 --- a/Projectiles/Melee/OldLordClaymoreProj.cs +++ b/Projectiles/Melee/OldLordClaymoreProj.cs @@ -331,5 +331,10 @@ namespace CalamityMod.Projectiles.Melee } public override void OnKill(int timeLeft) => Owner.fullRotation = 0f; + + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + modifiers.HitDirectionOverride = (Owner.Center.X < target.Center.X).ToDirectionInt(); + } } } From 48daf3d759642163d08f99adb0c9e05db3ab545d Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Mon, 23 Sep 2024 12:39:40 -0400 Subject: [PATCH 012/133] Several Elemental weapon resprites --- CalPlayer/DrawLayers/HeldItemGlowMaskLayer.cs | 6 ++++++ Items/Weapons/Melee/StarburstShiv.cs | 8 ++++++-- Items/Weapons/Melee/StarburstShiv.png | Bin 948 -> 2286 bytes Items/Weapons/Melee/StarburstShivGlow.png | Bin 0 -> 1826 bytes Items/Weapons/Ranged/ChromaticEruption.cs | 7 +++++-- Items/Weapons/Ranged/ChromaticEruption.png | Bin 1296 -> 3879 bytes .../Weapons/Ranged/ChromaticEruptionGlow.png | Bin 0 -> 2070 bytes Items/Weapons/Summon/LegionofCelestia.cs | 12 ++++++++++-- Items/Weapons/Summon/LegionofCelestia.png | Bin 1302 -> 3407 bytes Items/Weapons/Summon/LegionofCelestiaGlow.png | Bin 0 -> 2687 bytes .../Melee/Shortswords/StarburstShivProj.cs | 10 +++++----- .../Ranged/ChromaticEruptionHoldout.cs | 4 ++-- Projectiles/Summon/CelestialAxeMinion.cs | 10 +++------- Projectiles/Summon/CelestialAxeMinion.png | Bin 1208 -> 2419 bytes 14 files changed, 37 insertions(+), 20 deletions(-) create mode 100644 Items/Weapons/Melee/StarburstShivGlow.png create mode 100644 Items/Weapons/Ranged/ChromaticEruptionGlow.png create mode 100644 Items/Weapons/Summon/LegionofCelestiaGlow.png diff --git a/CalPlayer/DrawLayers/HeldItemGlowMaskLayer.cs b/CalPlayer/DrawLayers/HeldItemGlowMaskLayer.cs index 92ecc32019..184274f3b4 100644 --- a/CalPlayer/DrawLayers/HeldItemGlowMaskLayer.cs +++ b/CalPlayer/DrawLayers/HeldItemGlowMaskLayer.cs @@ -46,6 +46,8 @@ namespace CalamityMod.CalPlayer.DrawLayers glowMask = ModContent.Request("CalamityMod/Items/Weapons/Ranged/AuralisGlow").Value; else if (itemType == ModContent.ItemType()) glowMask = ModContent.Request("CalamityMod/Items/Weapons/Ranged/AuroraBlazerGlow").Value; + else if (itemType == ModContent.ItemType()) + glowMask = ModContent.Request("CalamityMod/Items/Weapons/Ranged/ChromaticEruptionGlow").Value; else if (itemType == ModContent.ItemType()) glowMask = ModContent.Request("CalamityMod/Items/Weapons/Ranged/CleansingBlazeGlow").Value; else if (itemType == ModContent.ItemType()) @@ -66,6 +68,8 @@ namespace CalamityMod.CalPlayer.DrawLayers glowMask = ModContent.Request("CalamityMod/Items/Weapons/Magic/FatesRevealGlow").Value; else if (itemType == ModContent.ItemType()) glowMask = ModContent.Request("CalamityMod/Items/Weapons/Melee/GreatswordofJudgementGlow").Value; + else if (itemType == ModContent.ItemType()) + glowMask = ModContent.Request("CalamityMod/Items/Weapons/Summon/LegionofCelestiaGlow").Value; else if (itemType == ModContent.ItemType()) glowMask = ModContent.Request("CalamityMod/Items/SummonItems/NecroplasmicBeaconGlow").Value; else if (itemType == ModContent.ItemType()) @@ -80,6 +84,8 @@ namespace CalamityMod.CalPlayer.DrawLayers glowMask = ModContent.Request("CalamityMod/Items/Weapons/DraedonsArsenal/PulseRifleGlow").Value; else if (itemType == ModContent.ItemType()) glowMask = ModContent.Request("CalamityMod/Items/Weapons/Magic/SoulPiercerGlow").Value; + else if (itemType == ModContent.ItemType()) + glowMask = ModContent.Request("CalamityMod/Items/Weapons/Melee/StarburstShivGlow").Value; else if (itemType == ModContent.ItemType()) glowMask = ModContent.Request("CalamityMod/Items/Weapons/Magic/SubsumingVortexSmallGlow").Value; else if (itemType == ModContent.ItemType()) diff --git a/Items/Weapons/Melee/StarburstShiv.cs b/Items/Weapons/Melee/StarburstShiv.cs index bc484097bc..333f89fb7d 100644 --- a/Items/Weapons/Melee/StarburstShiv.cs +++ b/Items/Weapons/Melee/StarburstShiv.cs @@ -1,5 +1,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Melee.Shortswords; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -13,8 +15,8 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - Item.width = 44; - Item.height = 44; + Item.width = 74; + Item.height = 94; Item.noMelee = true; Item.noUseGraphic = true; Item.autoReuse = true; @@ -32,6 +34,8 @@ namespace CalamityMod.Items.Weapons.Melee public override bool MeleePrefix() => true; + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) => Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request("CalamityMod/Items/Weapons/Melee/StarburstShivGlow").Value); + public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Weapons/Melee/StarburstShiv.png b/Items/Weapons/Melee/StarburstShiv.png index c7c7aa1288bbd5d1c9dcd6e003c7543b6772b816..6fc05ab7e64ab17a19ec2d892b08644e553d92bc 100644 GIT binary patch literal 2286 zcmXw52{hDg7ypkvV(PVoiBV}9q=_*}WXU@AElXJ@8A4Q+Vvxz(s}Dn%QCULvvA$%@ z+M8{L8Ebk?wi0Es#5838X8O+eoO7T1ob%js?|JU;_q*qbx3xAE6_ynS06-LNW@OLt z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cUoyG2orEcJ&y&xtRUby&IFM$AyYZ`sug6xGF98Y)R?fp7edGnz% zG+&+!;&MiZC+S+g^tq0|zH#rRUF)ti-T7l0xs=q{$Oi=W_Gh;=wK_@jgLYUw4^&J1 zs`(#0=KSG%JH}|BDdOn9_}Kup+9 literal 0 HcmV?d00001 diff --git a/Items/Weapons/Ranged/ChromaticEruption.cs b/Items/Weapons/Ranged/ChromaticEruption.cs index e0184292d8..0e25bea27c 100644 --- a/Items/Weapons/Ranged/ChromaticEruption.cs +++ b/Items/Weapons/Ranged/ChromaticEruption.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -19,8 +20,8 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - Item.width = 64; - Item.height = 34; + Item.width = 166; + Item.height = 60; Item.damage = 94; Item.DamageType = DamageClass.Ranged; Item.useAnimation = Item.useTime = 6; @@ -54,6 +55,8 @@ namespace CalamityMod.Items.Weapons.Ranged return false; } + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) => Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request("CalamityMod/Items/Weapons/Ranged/ChromaticEruptionGlow").Value); + public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Weapons/Ranged/ChromaticEruption.png b/Items/Weapons/Ranged/ChromaticEruption.png index d5748c99439f8009da79ee8b6638e83e1f551a4c..aba67996a9331e63140baf8684f06ff1adf272ea 100644 GIT binary patch literal 3879 zcmX9>c{tSF`~FBpM88O77mc--7_yY%MKm;)$&4%!8M4PTvdq{jH6TIp#EdP5n1)~Zp6hzfbFTBpxt{Aj_j8~7;BBofgajl6000nzUNM9J$%TL7 z693^pGYj+X?*yaVaPAjxTNe%x^>Kpl#5I`2 zjvBzLZc7In9~$PtV9)=2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(##`t9-_g$AI*6miu$huf|loBsRv(gc$SY zh4lc;N|@fCJI?85oy3TOYfvH6dF6h@oPro;(y;r1^bFJL z=WJ7^deKQFMwIed3(a{Y>qzLW@nA8g`wb-R7YggP0G+d`)R>Bw3>ag&h;gFw9ixot znzHcw79jdJiR3zBMAw`}qio}~{b5`%^3&ciQ`B!L3F8iZGPHd2uQvhEzNOK$r6$Uu>qvVGE6aiCZ<46YdN*bk#H_z8Fx5>TOHCj-QP1TmxmBH=1e9k83QUuVTfh>t!;f)ZbBVKVOL@GZ|cs zsd&kNF=kI!7rMtujOot22oeKH>?pCK8%yL9AW032PMZF6PT@xHwrQiS6P#q`!&~}{;V-)-4xH)`B8>NugKhtEZgsd!0jjp@=|bGkD%G?-0uQw7j@#zwM^4w+>C zx}0Q~kIB*8y-lZfH14r>qheC`c-L^L^E&5q>8Tl`P-7}y5<6q&8e67&%_gH<4C<~* z6zW#nndfiMe;R=EHktjlY#PxAbhmfzi`g@w##Fo{cE;?lH@?#<#aa_%p7+r8z&@GR zc{WgQ&9(c68dLF-*cr305JOI`IR{9u(GgP$slNsJO;x|Ott$qKAqD+AKZ@7v_r{c7 zdSb#}6RXvja`zWAgjdh{8i48V%;~Qt?w6=B6))NEjVVYkyUZysa%Ox|<)gwgv6bFI zjj4Ev8Z(K+n!n%kY5?%Tg2i1Qp!6wfOvOvom=3bu`;4pRB=a?+YMOUCe6_TaD{4%| zOa2G2cU04~+%E_K000hUSV?A0O#mtY000O800000007cclK=n!07*qoM6N<$g8U=; AYXATM literal 0 HcmV?d00001 diff --git a/Items/Weapons/Summon/LegionofCelestia.cs b/Items/Weapons/Summon/LegionofCelestia.cs index 76e3f857a6..d0a6ef0c1e 100644 --- a/Items/Weapons/Summon/LegionofCelestia.cs +++ b/Items/Weapons/Summon/LegionofCelestia.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -14,8 +15,8 @@ namespace CalamityMod.Items.Weapons.Summon public new string LocalizationCategory => "Items.Weapons.Summon"; public override void SetDefaults() { - Item.width = 36; - Item.height = 36; + Item.width = 100; + Item.height = 128; Item.damage = 57; Item.DamageType = DamageClass.Summon; Item.mana = 10; @@ -31,6 +32,11 @@ namespace CalamityMod.Items.Weapons.Summon Item.shootSpeed = 10f; } + public override void UseStyle(Player player, Rectangle heldItemFrame) + { + player.itemLocation += new Vector2(-20f * player.direction, 34f * player.gravDir).RotatedBy(player.itemRotation); + } + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.altFunctionUse != 2) @@ -45,6 +51,8 @@ namespace CalamityMod.Items.Weapons.Summon return false; } + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) => Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request("CalamityMod/Items/Weapons/Summon/LegionofCelestiaGlow").Value); + public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Weapons/Summon/LegionofCelestia.png b/Items/Weapons/Summon/LegionofCelestia.png index 06ae7fb2e68f44e53887a8de87bae815e5cb4f08..db5fd93c4a6b1b5acb594dfd305d155ea0c51a2e 100644 GIT binary patch literal 3407 zcmXw62{csg8^0N8ER`W;%3v&6Qns>}q!??q5sJcC!dNO2LQ>gch7qz15gE&rErs%B znZ;6B%i5QH88em{S^LlU&i|hC-shh4-uph=@Ao{8s8 zXfO}^zN6XM%oh9Z+8AE~D!awz06>6la@oKxG>4Y^&@cTOjP%(m|A z%BIy(^J~%#3QnI6nA#-KBk&#C>kl^d-e=U6yr0?nN?Q$CqBYH|Zo72Tb4nyO-|U{9 zaVkGG^l0S5 z264*@gTYTi@I#Elv`|6bT%@Rh!DJ>rk?+5~gK%WqHFrQ|qqYh+#4GK+F7fpCaFTRP zO^8);9V|Ul(q>PyU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JonM=j=dbTB+A#O!p+`|*N~XXizccrwWytpN;;O#==h8qRUl za;`_nibut>b|hzsiRO6KI;)C&Yi}!(y~zN)cx5x-Afk)*sCYBlbsqrJzQ1*tn{5L% zm9J{tf@dl$+Yf!`33}XXo#smE``48Ro4!>u4MlghXaL8~?J>nUhUkJlDkNjvD*%`p z8xKk{c3p-BFz$)h!5}$ZtjNqhw~C&%KCaZxqUd@xQz0Z1)7NVN4g6}kzhj8rvqy#G z%G5LfMsD?6lGGAC8bDln1^{E)w25S(0?7(FAtn-XffAC#H+leQ|LUk^T!g4dNN&jY z0?^soY+3n4C9Bt2lOB~db+8mcs7%If6%vKcAAfvXg+dwavo86b9{0z0f2U0d97(kxAf$Oe6I%3+1d;k6;G&I zEV23I9HK(fm8H(v*EOR9JoWo(VD306o*cQ=4;bGP{NLpmqA~cNBYjRPP-n8-LkybxHqVxa1h3+KJ2;bbwvw zuLCf8QO&E$H*~J7C=Cn`XPs$V`hOV)IghBQ@ZrWeF|d3|iX21qA1|o2!DSN06951J M07*qoM6N<$f~TitHUIzs diff --git a/Items/Weapons/Summon/LegionofCelestiaGlow.png b/Items/Weapons/Summon/LegionofCelestiaGlow.png new file mode 100644 index 0000000000000000000000000000000000000000..ce16e6cd0b444e6bf86542929052b62928f07cbe GIT binary patch literal 2687 zcmW+&2{=^UAHGtSGMI^KkR?$hgBg1hnX#1ZZx;zOV{2q*>_cUYohV~$EtZsotPy>x zK}K4b6cHbveP4=U{IBlwoclY^ea?CB`~J3blKy953^^=z7ytmsWfQD5XbIqml&m5%k^giOFGrJm?Ar>Ju!6;Q#D)yK;{f)GIrZ6FpK%76O6JR*x*l)<1 zk-vS-F}{Z-=u|~+or+o6Q)vLci28HXKl?VKeRz)tHX-4M!b=-J4M-awxT#jQeWfce_@qqC!odF&ocH`|zI&)tDfG;MN+uLGky`(lm*jwg_% zL;!dzOJdwOj`uw~0CXqiwFzX#P|5?O0O{{Rmk$8eM>~=Fb#Rp1PC)Bgt^Gjoq8d?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IQfz0vwMbk!akf)S1tD(Jk(09sADcKlBs^33c$|JY8RG zb#5=zgyn2em`BBKHz=f^$Wb*|E#{;RkABbqV=TdH(sPf7X*4m0Yv9hQIX<{^O`hpr|FTv4uP7c|{*` zIjN1gpT)K=0ty4E?7eO)S%yHv7g%~eZtnN8qsNUr<$Z|87FX~2%se!bm~M0iEI%J? z!fI916Pcp17=bL$uB-$rPht94J`@JVrWJ{02(rqq)!b@gF8}090yT>w&X=;P#;xZy zrDHIV6@ew3NsVnj|336GBNK-=e*O^bRPO~U`g134oCGn}DdCh6;l8HndZp(s-@*S_ zg@idTI_1!D{{wrF8%D9vwZBE-?~y@hLoP+C@9TdA86%OlcAa9?sg=7GyY+qCdZ>0i z>uFN#T(1ZSiu0OPs_4i4e{9!oa4t{wN=gH5jN4oo|x$?dy3x<4uPWWD{Po-}ZUoOs8N{)fMg z46Zte^iwrLK$drt&jOZs*tf;%HI7cl-* zFD6^ub~|iw7<5wL=TX(1e&RwhI9K(jc+XQ4#U7naesos7V~^{Yt!boWg6cSUZxr-! eyzFUi4k&_iK5* ModContent.ItemType(); - public override float MaxOffsetLengthFromArm => 15f; + public override float MaxOffsetLengthFromArm => 40f; public override float OffsetXUpwards => -10f; - public override float BaseOffsetY => -5f; + public override float BaseOffsetY => -12f; public override float OffsetYDownwards => 10f; public ref float ShotCooldown => ref Projectile.ai[0]; diff --git a/Projectiles/Summon/CelestialAxeMinion.cs b/Projectiles/Summon/CelestialAxeMinion.cs index ef8d7d91cb..0701bef64a 100644 --- a/Projectiles/Summon/CelestialAxeMinion.cs +++ b/Projectiles/Summon/CelestialAxeMinion.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetDefaults() { - Projectile.width = 52; - Projectile.height = 52; + Projectile.width = 100; + Projectile.height = 110; Projectile.netImportant = true; Projectile.friendly = true; Projectile.ignoreWater = true; @@ -33,6 +33,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.minion = true; Projectile.tileCollide = false; Projectile.extraUpdates = 1; + Projectile.scale = 0.75f; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 30; Projectile.DamageType = DamageClass.Summon; @@ -68,11 +69,6 @@ namespace CalamityMod.Projectiles.Summon } } - public override Color? GetAlpha(Color lightColor) - { - return new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, Projectile.alpha); - } - public override bool PreDraw(ref Color lightColor) { Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; diff --git a/Projectiles/Summon/CelestialAxeMinion.png b/Projectiles/Summon/CelestialAxeMinion.png index d5862b9ec773919ab8200ee58f9284e9281b611b..7ac940983ffbde87a7d0e62f4287fbf03c2e8d5c 100644 GIT binary patch literal 2419 zcmV-(35@oMP)vu({j_S zi!r`-;6wx^Iyge0cKPBGWM*v}g-Ntn{`DI_4C|MEl?_|YNTJ*^Jxh$Ac$~|h zR)Q>~A);X}tNqOvZw%wb5h@mHhv^KCfZQTh;b-p4H856|49dQtW@(>U8%ZJ*HLnu@*Vg%YZ)GjZ_r2w3u9crJ=AtlJ_s}+P34)NNd z_Pq;22u^^$d{aT`gkG$YIYou5_{3Jfc@Sj3D%?1+JdS|c5h~yL#QHOz0FV&!p?*AW z{7KybO#n-f)mJG=G{W~Th{{O;wiUuN0IF;i4AU7LlX)?%gjhJ6AT1&M z;Ki-#`DbnoPr6hvROu=u(7|P3W@|{zxGR4N5&z(R&A)xj|^U8xC zfA`lgUJ4#suj`BwWcAAx2uCc`p189hZcP*ut0+>T zN)#hbo_@~IF5ff2IPGFWweXvt{v5^&&+;yu;ROLCiU|P`@8IGV%0rO21X=xuq5lY? zA_(DG0SN)~`GMdTB3{2(Wm#V=F9lSo*)Ok!@{MnyeZZDO?6c(v?U17&o}oO(xMBkm z2muKJOOVGup{sC+U`PmvXDF{Jh+7pwJk$wCn5)-68^%k;i6JNWAgJQBn@`1=Co5fr z!|dNQHjn+-2Skwlh!HBDDuBFvccuM82rq1eVkOAx7uJqW5S2h6!X$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z*PabK@vuY#NnU-!JOB9QH{L zz4umm6Lls^^0tL{0`PwK>v4U3RMGXGrZyMgui3NxEyupDD4$FP`C6EkJhin4V0`3U zV0#!zOEk(S)#;r&321Cy=K}oZ`8nl4-=5ZD1`(BYd?dgP&>kV2bl}~1W{>hK7@?V1g zyUK@X&hrw6)2^4xI*G1J0X9F->;kx>-n1fF*12w6CyBgwRBy3j&X^1EZn}S3PPBZ8 zdT>f+yk2t7kEP88IM>n83D7<_2f&NdbfV?wqw4>%+W&R{xNzDhS^Lr8w4P|$5d9lp W+flMAT*%1)0000 Date: Mon, 23 Sep 2024 20:44:39 -0700 Subject: [PATCH 013/133] Fixed inconsistent melee speed breaking non-Hellkite custom melee weapons Also nerfed Grand Dad Angel forced me to... --- Items/Weapons/Melee/GrandDad.cs | 2 +- Projectiles/Melee/BasherHoldout.cs | 1 + Projectiles/Melee/CometQuasherHoldout.cs | 1 + Projectiles/Melee/EarthHoldout.cs | 1 + Projectiles/Melee/GrandDadHoldout.cs | 1 + Projectiles/Melee/GrandGuardianHoldout.cs | 1 + Projectiles/Melee/MajesticGuardHoldout.cs | 1 + Projectiles/Melee/StellarStrikerHoldout.cs | 1 + 8 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Items/Weapons/Melee/GrandDad.cs b/Items/Weapons/Melee/GrandDad.cs index cc2366d230..fbd699748c 100644 --- a/Items/Weapons/Melee/GrandDad.cs +++ b/Items/Weapons/Melee/GrandDad.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 124; Item.height = 124; - Item.damage = 2777; // Feel free to change these 7s as balance requires. The other 7s should stay + Item.damage = 1977; // Feel free to change these 7s as balance requires. The other 7s should stay - Update: no more 2777... :( Item.DamageType = TrueMeleeDamageClass.Instance; Item.useAnimation = 77; Item.useTime = 77; diff --git a/Projectiles/Melee/BasherHoldout.cs b/Projectiles/Melee/BasherHoldout.cs index ba66ea6ada..6f40f5d2d1 100644 --- a/Projectiles/Melee/BasherHoldout.cs +++ b/Projectiles/Melee/BasherHoldout.cs @@ -60,6 +60,7 @@ namespace CalamityMod.Projectiles.Melee public override void UseStyle() { + AnimationProgress = Animation % useAnim; DrawUnconditionally = false; if (CanHit || postSwing) diff --git a/Projectiles/Melee/CometQuasherHoldout.cs b/Projectiles/Melee/CometQuasherHoldout.cs index 6565539d1e..0c77a63ce3 100644 --- a/Projectiles/Melee/CometQuasherHoldout.cs +++ b/Projectiles/Melee/CometQuasherHoldout.cs @@ -59,6 +59,7 @@ namespace CalamityMod.Projectiles.Melee public override void UseStyle() { + AnimationProgress = Animation % useAnim; DrawUnconditionally = false; if (CanHit || postSwing) diff --git a/Projectiles/Melee/EarthHoldout.cs b/Projectiles/Melee/EarthHoldout.cs index 6b2b95708d..736c25be17 100644 --- a/Projectiles/Melee/EarthHoldout.cs +++ b/Projectiles/Melee/EarthHoldout.cs @@ -61,6 +61,7 @@ namespace CalamityMod.Projectiles.Melee public override void UseStyle() { + AnimationProgress = Animation % useAnim; DrawUnconditionally = false; float rate = Main.GlobalTimeWrappedHourly * 19; diff --git a/Projectiles/Melee/GrandDadHoldout.cs b/Projectiles/Melee/GrandDadHoldout.cs index 8b3969866c..869acbd228 100644 --- a/Projectiles/Melee/GrandDadHoldout.cs +++ b/Projectiles/Melee/GrandDadHoldout.cs @@ -63,6 +63,7 @@ namespace CalamityMod.Projectiles.Melee public override void UseStyle() { + AnimationProgress = Animation % useAnim; DrawUnconditionally = false; if (CanHit || postSwing) diff --git a/Projectiles/Melee/GrandGuardianHoldout.cs b/Projectiles/Melee/GrandGuardianHoldout.cs index a5ea462ba3..d26ded3fa7 100644 --- a/Projectiles/Melee/GrandGuardianHoldout.cs +++ b/Projectiles/Melee/GrandGuardianHoldout.cs @@ -63,6 +63,7 @@ namespace CalamityMod.Projectiles.Melee public override void UseStyle() { + AnimationProgress = Animation % useAnim; DrawUnconditionally = false; if (CanHit || postSwing) diff --git a/Projectiles/Melee/MajesticGuardHoldout.cs b/Projectiles/Melee/MajesticGuardHoldout.cs index 56368fa447..36024f29ad 100644 --- a/Projectiles/Melee/MajesticGuardHoldout.cs +++ b/Projectiles/Melee/MajesticGuardHoldout.cs @@ -58,6 +58,7 @@ namespace CalamityMod.Projectiles.Melee public override void UseStyle() { + AnimationProgress = Animation % useAnim; DrawUnconditionally = false; if (CanHit || postSwing) diff --git a/Projectiles/Melee/StellarStrikerHoldout.cs b/Projectiles/Melee/StellarStrikerHoldout.cs index 6476911dcf..6af8c3b7d9 100644 --- a/Projectiles/Melee/StellarStrikerHoldout.cs +++ b/Projectiles/Melee/StellarStrikerHoldout.cs @@ -60,6 +60,7 @@ namespace CalamityMod.Projectiles.Melee public override void UseStyle() { + AnimationProgress = Animation % useAnim; DrawUnconditionally = false; if (CanHit || postSwing) From 21392cccdd0311034cc2d0451c1c7c513961c9fe Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Tue, 24 Sep 2024 00:43:54 -0500 Subject: [PATCH 014/133] Fixed Harpies, Demons, Voodoo Demons, and Red Devils spam firing their projectiles when hit. --- .../RegularEnemies/RevengeanceAndDeathAI.cs | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/NPCs/VanillaNPCAIOverrides/RegularEnemies/RevengeanceAndDeathAI.cs b/NPCs/VanillaNPCAIOverrides/RegularEnemies/RevengeanceAndDeathAI.cs index b983ecd7e8..7ec2bdf1e9 100644 --- a/NPCs/VanillaNPCAIOverrides/RegularEnemies/RevengeanceAndDeathAI.cs +++ b/NPCs/VanillaNPCAIOverrides/RegularEnemies/RevengeanceAndDeathAI.cs @@ -6162,16 +6162,17 @@ PrepareToShoot: if (Main.netMode != NetmodeID.MultiplayerClient) { - if (npc.justHit || !Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) - npc.ai[0] = 0f; - if (npc.type == NPCID.Harpy) { + float featherShootCutOffValue = CalamityWorld.revenge ? 90f : 60f; + if (npc.justHit || !Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + npc.ai[0] = featherShootCutOffValue + 1f; + if (npc.ai[0] >= HarpyFeatherGateValue) { npc.ai[0] = 0f; } - else if (npc.ai[0] % 30f == 0f && npc.ai[0] <= (CalamityWorld.revenge ? 90f : 60f)) + else if (npc.ai[0] % 30f == 0f && npc.ai[0] <= featherShootCutOffValue) { npc.ai[0] += 1f; if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) @@ -6195,11 +6196,15 @@ PrepareToShoot: if (npc.type == NPCID.Demon || npc.type == NPCID.VoodooDemon) { + float scytheShootCutOffValue = CalamityWorld.revenge ? 80f : 60f; + if (npc.justHit || !Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + npc.ai[0] = scytheShootCutOffValue + 1f; + if (npc.ai[0] >= DemonScytheGateValue) { npc.ai[0] = 0f; } - else if (npc.ai[0] % 20f == 0f && npc.ai[0] <= (CalamityWorld.revenge ? 80f : 60f)) + else if (npc.ai[0] % 20f == 0f && npc.ai[0] <= scytheShootCutOffValue) { npc.ai[0] += 1f; if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) @@ -6223,11 +6228,15 @@ PrepareToShoot: if (npc.type == NPCID.RedDevil) { + float tridentShootCutOffValue = 80f; + if (npc.justHit || !Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + npc.ai[0] = tridentShootCutOffValue + 1f; + if (npc.ai[0] >= RedDevilTridentGateValue) { npc.ai[0] = 0f; } - else if (npc.ai[0] % 20f == 0f && npc.ai[0] <= 80f) + else if (npc.ai[0] % 20f == 0f && npc.ai[0] <= tridentShootCutOffValue) { npc.ai[0] += 1f; if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) From 607544aa7bf22a45cdc748351621cced92f35a7f Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <142704082+CongratsIsTrash@users.noreply.github.com> Date: Tue, 24 Sep 2024 10:39:11 -0400 Subject: [PATCH 015/133] CultistIsResistantTo on Leviatitan aberration --- Projectiles/Ranged/LeviatitanAberration.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Projectiles/Ranged/LeviatitanAberration.cs b/Projectiles/Ranged/LeviatitanAberration.cs index 077afea76b..836c490874 100644 --- a/Projectiles/Ranged/LeviatitanAberration.cs +++ b/Projectiles/Ranged/LeviatitanAberration.cs @@ -22,6 +22,7 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { Main.projFrames[Projectile.type] = 4; + ProjectileID.Sets.CultistIsResistantTo[Type] = true; } public override void SetDefaults() { From 82dbcf8f039222ac026602b2f629683b8a36868b Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Tue, 24 Sep 2024 20:58:30 -0400 Subject: [PATCH 016/133] Added many new bestiary entries for vanilla NPCs There will be more after this, just want to push an initial commit --- .../Mods.CalamityMod.Bestiary.Vanilla.hjson | 74 ++++++++++++++++ NPCs/CalamityGlobalNPC.cs | 84 +++++++++++++++++-- 2 files changed, 152 insertions(+), 6 deletions(-) create mode 100644 Localization/en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson diff --git a/Localization/en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson b/Localization/en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson new file mode 100644 index 0000000000..8e46440e13 --- /dev/null +++ b/Localization/en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson @@ -0,0 +1,74 @@ +// Put their internal name here +NPCName: { + Dryad: Dryads practice the art of Life Magic, pioneered by Silva. She is connected with nature and can analyze its purity worldwide. She sells seeds, too! + Mechanic: The Mechanic was imprisoned for sticking her nose where she shouldn't. She sells wiring and tools for putting together anything imaginable. + EmpressButterfly: These familiars conjured by the Empress draw power from their surroundings and later bring it to their master. They remind her of a lost loved one, and should one perish in the chaos of night, she shall unleash her full fury upon the attacker. + DemonEye: "{$CommonEntries.DemonEye}" + CataractEye: "{$CommonEntries.DemonEye}" + DialatedEye: "{$CommonEntries.DemonEye}" + SleepyEye: "{$CommonEntries.DemonEye}" + GreenEye: "{$CommonEntries.DemonEye}" + PurpleEye: "{$CommonEntries.DemonEye}" + Wraith: Souls belonging to devotees of Gods were once sealed inside the Wall of Flesh. Now, they roam the night in search of vengeance. + BloodNautilus: The intense red glow of the Blood Moon becomes even greater in contact with water, making aquatic creatures affected more strongly than their land counterparts. This enormous shelled water demon directly feeds off that energy, responding brutally to being pestered. + DiggerHead: Exposure to the effects of godly magicks flowing throughout the cracks of the world causes unusual rapid growths in giant worms. + GraniteGolem: These strong magicked constructs were utilized in mines for carrying heavy ores and machinery. They continue to inhabit the mines deep below, even after their abandonment. + GreekSkeleton: Marble caves were used as arenas during the Deific Era. Fighters looking for glory flocked to them, but now only their bodies populate the area. + DesertBeast: Minor draconic offshoots who thrive in arid climates, the Basilisk's hardened bodies make them formidable threats. + DuneSplicerHead: The largest worm native to the Desert. Even strengthened by divine magicks, they fall short of the Scourge, and run amok in a hunger induced frenzy. + SandShark: "{$CommonEntries.SandShark}" + SandsharkCorrupt: "{$CommonEntries.SandShark}" + SandsharkCrimson: "{$CommonEntries.SandShark}" + SandsharkHallow: "{$CommonEntries.SandShark}" + MeteorHead: When meteorites strike the surface, their fragments lay scattered for the taking. Some pieces have a higher mana density, coming to life and attacking anything nearby. + AngryBones: "{$CommonEntries.AngryBones}" + AngryBonesBig: "{$CommonEntries.AngryBones}" + AngryBonesBigMuscle: "{$CommonEntries.AngryBones}" + AngryBonesBigHelmet: "{$CommonEntries.AngryBones}" + BlueArmoredBones: "{$CommonEntries.BlueArmoredBones}" + BlueArmoredBonesMace: "{$CommonEntries.BlueArmoredBones}" + BlueArmoredBonesNoPants: "{$CommonEntries.BlueArmoredBones}" + BlueArmoredBonesSword: "{$CommonEntries.BlueArmoredBones}" + HellArmoredBones: "{$CommonEntries.HellArmoredBones}" + HellArmoredBonesSpikeShield: "{$CommonEntries.HellArmoredBones}" + HellArmoredBonesMace: "{$CommonEntries.HellArmoredBones}" + HellArmoredBonesSword: "{$CommonEntries.HellArmoredBones}" + RustyArmoredBonesAxe: "{$CommonEntries.RustyArmoredBones}" + RustyArmoredBonesFlail: "{$CommonEntries.RustyArmoredBones}" + RustyArmoredBonesSword: "{$CommonEntries.RustyArmoredBones}" + RustyArmoredBonesSwordNoArmor: "{$CommonEntries.RustyArmoredBones}" + SkeletonSniper: Part of Yharim's military force in their past lives, these eagle-eyed sharpshooters let nothing escape their crosshairs, even when their place of operation were these cramped halls. + TacticalSkeleton: Part of Yharim's military force in their past lives, with thick armor and mighty boomsticks, they were the frontline against the invader that massacred the guards in these halls. + SkeletonCommando: Part of Yharim's military force in their past lives, their rocket-powered rage could wipe out entire crowds of escapees had they ever once dared to step out of their cells. + BoneLee: This Onyx Kinsman was apprehended by Yharim's troops, and after countless failed escape attempts, used as an example to other prisoners. + Paladin: Several Godseeker Knights were assigned to guard the Dungeon, yet not even they could fight against, much less see their killer. Word of the massacre that happened in these halls never got out, the wails of the dead forever silenced. + DiabolistRed: "{$CommonEntries.Diabolist}" + DiabolistWhite: "{$CommonEntries.Diabolist}" + Necromancer: "{$CommonEntries.Necromancer}" + NecromancerArmored: "{$CommonEntries.Necromancer}" + RaggedCaster: "{$CommonEntries.RaggedCaster}" + RaggedCasterOpenCoat: "{$CommonEntries.RaggedCaster}" + DungeonGuardian: The Old Man is cursed to never leave nor enter the Dungeon, much less die. Whoever crosses paths with him and dares to descend into those halls shall not pass! + BoneSerpentHead: A primitive necromantic construct built by Demons using stolen magic by Azafure. They protect the Demon's territory fiercely. + Demon: Despite being a primitive civilization, demons populate most of the underworld. Unlike their lesser brothers, they cast shadow magic rather than hell magic. + VoodooDemon: Demons have several religious practices, specially sacrifices. They worship the Wall of Flesh ever since it started roaming the underworld, using offerings to draw it closer. + RedDevil: Conjuring potent spears of dark magic, these elite demons look after the adventurer that destroyed their perceived deity. + WyvernHead: Deeply in tune with the magic of the world, these serpentine dragons guard the skyward ruins of Chrysadia on behalf of the Storm Dragon. Now, their duty calls louder as divine essence surges through the land. + SeekerHead: Godly magicks have unleashed the dark influences that gave birth to the Eater of Worlds, producing smaller, but just as deadly worms. + DesertDjinn: Buried in these caves lie cryptic artifacts older than Ilmeris, their origins swept away by the sands of time. Corrupted by divine magicks, the once friendly djinns within them now reemerge, full of hostility. + ChaosElemental: Manifestations of the unstable Essence of the Hallow, they erratically make chase with an uncontrollable surge of luminous power. + MartianSaucerCore: Following the destruction of their planet by otherworldly creatures, the Martians' military evolved at an unprecedented rate. They were prepared to fight back any future threats, and also pillage any other worlds they could find. + TorchGod: An unknown entity responsible for a torch's eternal flicker, however easily angered by the unsightly, ungrateful abuse of torch placement. +} + +CommonEntries: { + DemonEye: That suspicious feeling of being watched may very well come true in the dark of night, when the Eye of Cthulhu's minions roam the skies. + SandShark: Sand Sharks lived in the shallow waters of Ilmeris, hiding beneath the sand. They were thankfully well equipped to deal with the fallout of the Incineration. + AngryBones: Cursed with undeath, the former prisoners of the Dungeon roam endlessly through its halls, seeking a victim for their unending fury. + BlueArmoredBones: Mercenaries hired by Yharim to guard the Dungeon, the Marching Bones were disciplined and relentless, sundering any escapees that decided to rise against their jailors. + HellArmoredBones: Mercenaries hired by Yharim to guard the Dungeon hailing from Azafure, the fiery glow of the Molten Legion is unmistakable. If anyone ever tried to hide, their red-hot armaments would melt the hideout immediately. + RustyArmoredBones: Mercenaries hired by Yharim to guard the Dungeon hailing from Underground factions, the Rusted Company's weapons are jagged and rough through use and neglect. The brutality they employed on the field was enough to make many prisoners give up on freedom. + Diabolist: Mages of Azafure who bear the Diabolic Sigil, wielding flames as intense as any in the underworld. They were effective at blocking passageways and at making prisoners talk. + Necromancer: These sorcerers were trained in Azafure and bore the Necromantic Sign. Much like they terrorized prisoners with the bodies of their friends, so do they terrorize the Dungeon now. + RaggedCaster: Casters directly from the Dragon Cult, their cursed magic leaves their victims helplessly lost in utter darkness. They perished attempting to contain the onslaught that happened beneath their halls. +} diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 69299c1688..184d3b7f03 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -45,9 +45,11 @@ using CalamityMod.NPCs.Providence; using CalamityMod.NPCs.Ravager; using CalamityMod.NPCs.SlimeGod; using CalamityMod.NPCs.StormWeaver; +using CalamityMod.NPCs.SunkenSea; using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses; using CalamityMod.NPCs.VanillaNPCAIOverrides.RegularEnemies; +using CalamityMod.Packets; using CalamityMod.Particles; using CalamityMod.Projectiles; using CalamityMod.Projectiles.Magic; @@ -81,8 +83,6 @@ using Terraria.ModLoader.Utilities; using Terraria.UI.Chat; using Terraria.Utilities; using static Terraria.ModLoader.ModContent; -using CalamityMod.NPCs.SunkenSea; -using CalamityMod.Packets; namespace CalamityMod.NPCs { @@ -8943,17 +8943,89 @@ namespace CalamityMod.NPCs #endregion #region Bestiary - public override void SetBestiary(NPC npc, Terraria.GameContent.Bestiary.BestiaryDatabase database, Terraria.GameContent.Bestiary.BestiaryEntry bestiaryEntry) + public override void SetBestiary(NPC npc, BestiaryDatabase database, BestiaryEntry bestiaryEntry) { - // Create a string array containing all an NPC's debuff resistances - string[] elements = new string[5] + // Replace vanilla bestiary flavor text for certain NPCs + // These are ordered by their order in the bestiary, if you're wondering why it seems so arbitrary lmao + switch (npc.netID) { + case NPCID.Dryad: + case NPCID.Mechanic: + case NPCID.EmpressButterfly: + case NPCID.DemonEye: + case NPCID.CataractEye: + case NPCID.DialatedEye: + case NPCID.SleepyEye: + case NPCID.GreenEye: + case NPCID.PurpleEye: + case NPCID.Wraith: + case NPCID.BloodNautilus: + case NPCID.DiggerHead: + case NPCID.GraniteGolem: + case NPCID.GreekSkeleton: + case NPCID.DesertBeast: + case NPCID.DuneSplicerHead: + case NPCID.SandShark: + case NPCID.SandsharkCorrupt: + case NPCID.SandsharkCrimson: + case NPCID.SandsharkHallow: + case NPCID.MeteorHead: + case NPCID.AngryBones: + case NPCID.AngryBonesBig: + case NPCID.AngryBonesBigMuscle: + case NPCID.AngryBonesBigHelmet: + case NPCID.BlueArmoredBones: + case NPCID.BlueArmoredBonesMace: + case NPCID.BlueArmoredBonesNoPants: + case NPCID.BlueArmoredBonesSword: + case NPCID.HellArmoredBones: + case NPCID.HellArmoredBonesSpikeShield: + case NPCID.HellArmoredBonesMace: + case NPCID.HellArmoredBonesSword: + case NPCID.RustyArmoredBonesAxe: + case NPCID.RustyArmoredBonesFlail: + case NPCID.RustyArmoredBonesSword: + case NPCID.RustyArmoredBonesSwordNoArmor: + case NPCID.SkeletonSniper: + case NPCID.TacticalSkeleton: + case NPCID.SkeletonCommando: + case NPCID.BoneLee: + case NPCID.Paladin: + case NPCID.DiabolistRed: + case NPCID.DiabolistWhite: + case NPCID.Necromancer: + case NPCID.NecromancerArmored: + case NPCID.RaggedCaster: + case NPCID.RaggedCasterOpenCoat: + case NPCID.DungeonGuardian: + case NPCID.BoneSerpentHead: + case NPCID.Demon: + case NPCID.VoodooDemon: + case NPCID.RedDevil: + case NPCID.WyvernHead: + case NPCID.SeekerHead: + case NPCID.DesertDjinn: + case NPCID.ChaosElemental: + case NPCID.MartianSaucerCore: + case NPCID.TorchGod: + FlavorTextBestiaryInfoElement f = new("Hi CS0120"); + bestiaryEntry.Info.RemoveAll(i => i.GetType() == f.GetType()); + bestiaryEntry.Info.Add(new FlavorTextBestiaryInfoElement(CalamityUtils.GetTextValue($"Bestiary.Vanilla.{Lang.GetNPCName(npc.netID).Key}"))); + break; + default: + break; + + } + + // Create a string array containing all an NPC's debuff resistances + string[] elements = + [ NPCDebuffResistText(npc.Calamity().VulnerableToHeat, CalamityUtils.GetTextValue("UI.DebuffSystem.Heat")), NPCDebuffResistText(npc.Calamity().VulnerableToSickness, CalamityUtils.GetTextValue("UI.DebuffSystem.Sickness")), NPCDebuffResistText(npc.Calamity().VulnerableToCold, CalamityUtils.GetTextValue("UI.DebuffSystem.Cold")), NPCDebuffResistText(npc.Calamity().VulnerableToElectricity, CalamityUtils.GetTextValue("UI.DebuffSystem.Electricity")), NPCDebuffResistText(npc.Calamity().VulnerableToWater, CalamityUtils.GetTextValue("UI.DebuffSystem.Water")) - }; + ]; // Insert the debuff info into the NPC's bestiary entry bestiaryEntry.Info.Insert(0, new BestiaryDebuffInfo(elements)); From a77a3799d3e0ff48f6d40f3e5b22aab49227e8f2 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Wed, 25 Sep 2024 08:19:18 -0500 Subject: [PATCH 017/133] Buffed vanilla enemy HP by 25% (exceptions can be made, but I didn't want to make any yet because I couldn't think of any that made too much sense). --- NPCs/CalamityGlobalNPC.cs | 1090 +++++++++++++++++++------------------ 1 file changed, 551 insertions(+), 539 deletions(-) diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 184d3b7f03..6118b775b0 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -172,6 +172,9 @@ namespace CalamityMod.NPCs // Boss Zen distance private const float BossZenDistance = 6400f; + // Buff most vanilla enemy HP by 25% + private const double EnemyHPMultiplier = 1.25; + // Used to nerf desert prehardmode enemies pre-Desert Scourge private const double DesertEnemyStatMultiplier = 0.75; @@ -2581,550 +2584,559 @@ namespace CalamityMod.NPCs if (Main.expertMode) AdjustExpertModeStatScaling(npc); - // Nerf a shitload of Master Mode enemies - // HP is nerfed by 25% (this nerf is higher due to the player not dealing any more damage in Master) - // Damage is nerfed by 15% (this nerf is lower due to the player having 100% effective defense in Master) - if (Main.masterMode) + // Adjust a ton of enemy stats + switch (npc.type) { - switch (npc.type) - { - case NPCID.AngryBones: - case NPCID.AngryBonesBig: - case NPCID.AngryBonesBigHelmet: - case NPCID.AngryBonesBigMuscle: - case NPCID.BigBoned: - case NPCID.ShortBones: - case NPCID.AnomuraFungus: - case NPCID.Antlion: - case NPCID.WalkingAntlion: - case NPCID.GiantWalkingAntlion: - case NPCID.LarvaeAntlion: - case NPCID.FlyingAntlion: - case NPCID.GiantFlyingAntlion: - case NPCID.BabySlime: - case NPCID.BlackSlime: - case NPCID.BlazingWheel: - case NPCID.BloodCrawler: - case NPCID.BloodCrawlerWall: - case NPCID.BlueJellyfish: - case NPCID.GreenJellyfish: - case NPCID.PinkJellyfish: - case NPCID.BloodJelly: - case NPCID.FungoFish: - case NPCID.BlueSlime: - case NPCID.BoneSerpentBody: - case NPCID.BoneSerpentHead: - case NPCID.BoneSerpentTail: - case NPCID.CaveBat: - case NPCID.CochinealBeetle: - case NPCID.Crab: - case NPCID.Crawdad: - case NPCID.Crawdad2: - case NPCID.Crimera: - case NPCID.BigCrimera: - case NPCID.LittleCrimera: - case NPCID.CursedSkull: - case NPCID.CyanBeetle: - case NPCID.Demon: - case NPCID.DemonEye: - case NPCID.CataractEye: - case NPCID.CataractEye2: - case NPCID.DemonEye2: - case NPCID.DemonEyeOwl: - case NPCID.DemonEyeSpaceship: - case NPCID.DialatedEye: - case NPCID.DialatedEye2: - case NPCID.GreenEye: - case NPCID.GreenEye2: - case NPCID.PurpleEye: - case NPCID.PurpleEye2: - case NPCID.SleepyEye: - case NPCID.SleepyEye2: - case NPCID.DevourerBody: - case NPCID.DevourerHead: - case NPCID.DevourerTail: - case NPCID.DoctorBones: - case NPCID.DungeonSlime: - case NPCID.EaterofSouls: - case NPCID.BigEater: - case NPCID.LittleEater: - case NPCID.FaceMonster: - case NPCID.ArmedZombieEskimo: - case NPCID.ZombieEskimo: - case NPCID.FungiBulb: - case NPCID.Ghost: - case NPCID.GiantShelly: - case NPCID.GiantShelly2: - case NPCID.GiantWormBody: - case NPCID.GiantWormHead: - case NPCID.GiantWormTail: - case NPCID.Gnome: - case NPCID.GoblinScout: - case NPCID.GraniteFlyer: - case NPCID.GraniteGolem: - case NPCID.GreenSlime: - case NPCID.Harpy: - case NPCID.Hellbat: - case NPCID.GreekSkeleton: - case NPCID.Hornet: - case NPCID.HornetFatty: - case NPCID.HornetHoney: - case NPCID.HornetLeafy: - case NPCID.HornetSpikey: - case NPCID.HornetStingy: - case NPCID.BigHornetFatty: - case NPCID.BigHornetHoney: - case NPCID.BigHornetLeafy: - case NPCID.BigHornetSpikey: - case NPCID.BigHornetStingy: - case NPCID.BigMossHornet: - case NPCID.GiantMossHornet: - case NPCID.LittleHornetFatty: - case NPCID.LittleHornetHoney: - case NPCID.LittleHornetLeafy: - case NPCID.LittleHornetSpikey: - case NPCID.LittleHornetStingy: - case NPCID.LittleMossHornet: - case NPCID.MossHornet: - case NPCID.TinyMossHornet: - case NPCID.IceBat: - case NPCID.IceSlime: - case NPCID.JungleBat: - case NPCID.JungleSlime: - case NPCID.LacBeetle: - case NPCID.LavaSlime: - case NPCID.MaggotZombie: - case NPCID.ManEater: - case NPCID.MeteorHead: - case NPCID.MotherSlime: - case NPCID.MushiLadybug: - case NPCID.Nymph: - case NPCID.Pinky: - case NPCID.Piranha: - case NPCID.PurpleSlime: - case NPCID.Raven: - case NPCID.RedSlime: - case NPCID.Salamander: - case NPCID.Salamander2: - case NPCID.Salamander3: - case NPCID.Salamander4: - case NPCID.Salamander5: - case NPCID.Salamander6: - case NPCID.Salamander7: - case NPCID.Salamander8: - case NPCID.Salamander9: - case NPCID.SandSlime: - case NPCID.SeaSnail: - case NPCID.Shark: - case NPCID.ShimmerSlime: - case NPCID.Skeleton: - case NPCID.SkeletonAlien: - case NPCID.SkeletonAstonaut: - case NPCID.SkeletonTopHat: - case NPCID.ArmoredSkeleton: - case NPCID.BigHeadacheSkeleton: - case NPCID.BigMisassembledSkeleton: - case NPCID.BigPantlessSkeleton: - case NPCID.BigSkeleton: - case NPCID.BoneThrowingSkeleton: - case NPCID.BoneThrowingSkeleton2: - case NPCID.BoneThrowingSkeleton3: - case NPCID.BoneThrowingSkeleton4: - case NPCID.HeadacheSkeleton: - case NPCID.HeavySkeleton: - case NPCID.MisassembledSkeleton: - case NPCID.PantlessSkeleton: - case NPCID.SmallMisassembledSkeleton: - case NPCID.SmallHeadacheSkeleton: - case NPCID.SmallSkeleton: - case NPCID.SmallPantlessSkeleton: - case NPCID.SporeSkeleton: - case NPCID.TacticalSkeleton: - case NPCID.SkeletonSniper: - case NPCID.SkeletonCommando: - case NPCID.DarkCaster: - case NPCID.FireImp: - case NPCID.Snatcher: - case NPCID.SnowFlinx: - case NPCID.SpikeBall: - case NPCID.SpikedIceSlime: - case NPCID.SpikedJungleSlime: - case NPCID.SporeBat: - case NPCID.ZombieMushroom: - case NPCID.ZombieMushroomHat: - case NPCID.Squid: - case NPCID.Tim: - case NPCID.TombCrawlerBody: - case NPCID.TombCrawlerHead: - case NPCID.TombCrawlerTail: - case NPCID.UndeadMiner: - case NPCID.UndeadViking: - case NPCID.VoodooDemon: - case NPCID.Vulture: - case NPCID.WallCreeper: - case NPCID.WallCreeperWall: - case NPCID.YellowSlime: - case NPCID.Zombie: - case NPCID.ZombieDoctor: - case NPCID.ZombieElf: - case NPCID.ZombieElfBeard: - case NPCID.ZombieElfGirl: - case NPCID.ZombieMerman: - case NPCID.ZombiePixie: - case NPCID.ZombieRaincoat: - case NPCID.ZombieSuperman: - case NPCID.ZombieSweater: - case NPCID.ZombieXmas: - case NPCID.ArmedTorchZombie: - case NPCID.ArmedZombie: - case NPCID.ArmedZombieCenx: - case NPCID.ArmedZombiePincussion: - case NPCID.ArmedZombieSlimed: - case NPCID.ArmedZombieSwamp: - case NPCID.ArmedZombieTwiggy: - case NPCID.BaldZombie: - case NPCID.BigBaldZombie: - case NPCID.BigFemaleZombie: - case NPCID.BigPincushionZombie: - case NPCID.BigRainZombie: - case NPCID.BigSlimedZombie: - case NPCID.BigSwampZombie: - case NPCID.BigTwiggyZombie: - case NPCID.BigZombie: - case NPCID.BloodZombie: - case NPCID.FemaleZombie: - case NPCID.PincushionZombie: - case NPCID.SlimedZombie: - case NPCID.SmallBaldZombie: - case NPCID.SmallFemaleZombie: - case NPCID.SmallPincushionZombie: - case NPCID.SmallRainZombie: - case NPCID.SmallSlimedZombie: - case NPCID.SmallSwampZombie: - case NPCID.SmallTwiggyZombie: - case NPCID.SmallZombie: - case NPCID.SwampZombie: - case NPCID.TorchZombie: - case NPCID.TwiggyZombie: - case NPCID.AnglerFish: - case NPCID.AngryTrapper: - case NPCID.Arapaima: - case NPCID.ArmoredViking: - case NPCID.DesertBeast: - case NPCID.BlackRecluse: - case NPCID.BlackRecluseWall: - case NPCID.BloodFeeder: - case NPCID.Mummy: - case NPCID.BloodMummy: - case NPCID.DarkMummy: - case NPCID.LightMummy: - case NPCID.BlueArmoredBones: - case NPCID.BlueArmoredBonesMace: - case NPCID.BlueArmoredBonesNoPants: - case NPCID.BlueArmoredBonesSword: - case NPCID.BoneLee: - case NPCID.ChaosElemental: - case NPCID.Clinger: - case NPCID.BigMimicCorruption: - case NPCID.BigMimicCrimson: - case NPCID.BigMimicHallow: - case NPCID.BigMimicJungle: - case NPCID.CorruptSlime: - case NPCID.Corruptor: - case NPCID.Crimslime: - case NPCID.BigCrimslime: - case NPCID.LittleCrimslime: - case NPCID.CrimsonAxe: - case NPCID.CultistArcherBlue: - case NPCID.CultistArcherWhite: - case NPCID.CultistDevote: - case NPCID.CursedHammer: - case NPCID.Derpling: - case NPCID.Herpling: - case NPCID.DesertDjinn: - case NPCID.DiabolistRed: - case NPCID.DiabolistWhite: - case NPCID.DiggerBody: - case NPCID.DiggerHead: - case NPCID.DiggerTail: - case NPCID.DesertGhoul: - case NPCID.DesertGhoulCorruption: - case NPCID.DesertGhoulCrimson: - case NPCID.DesertGhoulHallow: - case NPCID.DuneSplicerBody: - case NPCID.DuneSplicerHead: - case NPCID.DuneSplicerTail: - case NPCID.DungeonSpirit: - case NPCID.EnchantedSword: - case NPCID.FloatyGross: - case NPCID.FlyingSnake: - case NPCID.Gastropod: - case NPCID.GiantBat: - case NPCID.GiantCursedSkull: - case NPCID.GiantFlyingFox: - case NPCID.GiantFungiBulb: - case NPCID.GiantTortoise: - case NPCID.IceTortoise: - case NPCID.HellArmoredBones: - case NPCID.HellArmoredBonesMace: - case NPCID.HellArmoredBonesSpikeShield: - case NPCID.HellArmoredBonesSword: - case NPCID.HoppinJack: - case NPCID.IceElemental: - case NPCID.Mimic: - case NPCID.IceMimic: - case NPCID.PresentMimic: - case NPCID.IchorSticker: - case NPCID.IcyMerman: - case NPCID.IlluminantBat: - case NPCID.IlluminantSlime: - case NPCID.JungleCreeper: - case NPCID.JungleCreeperWall: - case NPCID.DesertLamiaDark: - case NPCID.DesertLamiaLight: - case NPCID.Lavabat: - case NPCID.Lihzahrd: - case NPCID.LihzahrdCrawler: - case NPCID.Medusa: - case NPCID.Moth: - case NPCID.Necromancer: - case NPCID.NecromancerArmored: - case NPCID.Paladin: - case NPCID.PigronCorruption: - case NPCID.PigronCrimson: - case NPCID.PigronHallow: - case NPCID.Pixie: - case NPCID.PossessedArmor: - case NPCID.RaggedCaster: - case NPCID.RaggedCasterOpenCoat: - case NPCID.RedDevil: - case NPCID.RockGolem: - case NPCID.RuneWizard: - case NPCID.RustyArmoredBonesAxe: - case NPCID.RustyArmoredBonesFlail: - case NPCID.RustyArmoredBonesSword: - case NPCID.RustyArmoredBonesSwordNoArmor: - case NPCID.DesertScorpionWalk: - case NPCID.DesertScorpionWall: - case NPCID.SkeletonArcher: - case NPCID.Slimeling: - case NPCID.Slimer: - case NPCID.Slimer2: - case NPCID.ToxicSludge: - case NPCID.Unicorn: - case NPCID.WanderingEye: - case NPCID.Werewolf: - case NPCID.Wolf: - case NPCID.SeekerBody: - case NPCID.SeekerHead: - case NPCID.SeekerTail: - case NPCID.Wraith: - case NPCID.WyvernBody: - case NPCID.WyvernBody2: - case NPCID.WyvernBody3: - case NPCID.WyvernHead: - case NPCID.WyvernLegs: - case NPCID.WyvernTail: - case NPCID.BloodEelBody: - case NPCID.BloodEelHead: - case NPCID.BloodEelTail: - case NPCID.BloodSquid: - case NPCID.ChatteringTeethBomb: - case NPCID.Clown: - case NPCID.CorruptBunny: - case NPCID.CorruptGoldfish: - case NPCID.CorruptPenguin: - case NPCID.Drippler: - case NPCID.GoblinShark: - case NPCID.TheGroom: - case NPCID.TheBride: - case NPCID.CrimsonBunny: - case NPCID.CrimsonGoldfish: - case NPCID.CrimsonPenguin: - case NPCID.EyeballFlyingFish: - case NPCID.Dandelion: - case NPCID.AngryNimbus: - case NPCID.FlyingFish: - case NPCID.IceGolem: - case NPCID.RainbowSlime: - case NPCID.UmbrellaSlime: - case NPCID.Tumbleweed: - case NPCID.SandShark: - case NPCID.SandsharkCorrupt: - case NPCID.SandsharkCrimson: - case NPCID.SandsharkHallow: - case NPCID.SandElemental: - case NPCID.BloodNautilus: - case NPCID.GoblinArcher: - case NPCID.GoblinPeon: - case NPCID.GoblinSorcerer: - case NPCID.GoblinSummoner: - case NPCID.GoblinThief: - case NPCID.GoblinWarrior: - case NPCID.MisterStabby: - case NPCID.SnowBalla: - case NPCID.SnowmanGangsta: - case NPCID.Parrot: - case NPCID.PirateCaptain: - case NPCID.PirateCorsair: - case NPCID.PirateCrossbower: - case NPCID.PirateDeadeye: - case NPCID.PirateDeckhand: - case NPCID.PirateGhost: - case NPCID.PirateShipCannon: - case NPCID.MothronSpawn: - case NPCID.Mothron: - case NPCID.Butcher: - case NPCID.CreatureFromTheDeep: - case NPCID.DeadlySphere: - case NPCID.DrManFly: - case NPCID.Eyezor: - case NPCID.Frankenstein: - case NPCID.Fritz: - case NPCID.Nailhead: - case NPCID.Psycho: - case NPCID.Reaper: - case NPCID.ThePossessed: - case NPCID.SwampThing: - case NPCID.Vampire: - case NPCID.VampireBat: - case NPCID.BrainScrambler: - case NPCID.GigaZapper: - case NPCID.MartianWalker: - case NPCID.GrayGrunt: - case NPCID.MartianDrone: - case NPCID.MartianEngineer: - case NPCID.MartianOfficer: - case NPCID.RayGunner: - case NPCID.Scutlix: - case NPCID.ScutlixRider: - case NPCID.MartianTurret: - case NPCID.HeadlessHorseman: - case NPCID.Hellhound: - case NPCID.Splinterling: - case NPCID.Poltergeist: - case NPCID.Scarecrow1: - case NPCID.Scarecrow2: - case NPCID.Scarecrow3: - case NPCID.Scarecrow4: - case NPCID.Scarecrow5: - case NPCID.Scarecrow6: - case NPCID.Scarecrow7: - case NPCID.Scarecrow8: - case NPCID.Scarecrow9: - case NPCID.Scarecrow10: - case NPCID.ElfArcher: - case NPCID.ElfCopter: - case NPCID.Flocko: - case NPCID.GingerbreadMan: - case NPCID.Krampus: - case NPCID.Nutcracker: - case NPCID.NutcrackerSpinning: - case NPCID.Yeti: - case NPCID.NebulaBeast: - case NPCID.NebulaBrain: - case NPCID.NebulaHeadcrab: - case NPCID.NebulaSoldier: - case NPCID.SolarCorite: - case NPCID.SolarCrawltipedeBody: - case NPCID.SolarCrawltipedeHead: - case NPCID.SolarCrawltipedeTail: - case NPCID.SolarDrakomire: - case NPCID.SolarDrakomireRider: - case NPCID.SolarSolenian: - case NPCID.SolarSpearman: - case NPCID.SolarSroller: - case NPCID.StardustCellBig: - case NPCID.StardustCellSmall: - case NPCID.StardustJellyfishBig: - case NPCID.StardustWormBody: - case NPCID.StardustWormHead: - case NPCID.StardustWormTail: - case NPCID.StardustSoldier: - case NPCID.StardustSpiderBig: - case NPCID.StardustSpiderSmall: - case NPCID.VortexHornet: - case NPCID.VortexHornetQueen: - case NPCID.VortexLarva: - case NPCID.VortexRifleman: - case NPCID.VortexSoldier: - case NPCID.DD2DarkMageT1: - case NPCID.DD2DarkMageT3: - case NPCID.DD2OgreT2: - case NPCID.DD2OgreT3: - case NPCID.MartianSaucerCore: - case NPCID.MartianSaucerCannon: - case NPCID.MartianSaucerTurret: - case NPCID.DD2SkeletonT1: - case NPCID.DD2SkeletonT3: - case NPCID.DD2DrakinT2: - case NPCID.DD2DrakinT3: - case NPCID.DD2GoblinBomberT1: - case NPCID.DD2GoblinBomberT2: - case NPCID.DD2GoblinBomberT3: - case NPCID.DD2GoblinT1: - case NPCID.DD2GoblinT2: - case NPCID.DD2GoblinT3: - case NPCID.DD2JavelinstT1: - case NPCID.DD2JavelinstT2: - case NPCID.DD2JavelinstT3: - case NPCID.DD2KoboldFlyerT2: - case NPCID.DD2KoboldFlyerT3: - case NPCID.DD2KoboldWalkerT2: - case NPCID.DD2KoboldWalkerT3: - case NPCID.DD2LightningBugT3: - case NPCID.DD2WitherBeastT2: - case NPCID.DD2WitherBeastT3: - case NPCID.DD2WyvernT1: - case NPCID.DD2WyvernT2: - case NPCID.DD2WyvernT3: - case NPCID.AncientCultistSquidhead: - case NPCID.SlimeSpiked: + case NPCID.AngryBones: + case NPCID.AngryBonesBig: + case NPCID.AngryBonesBigHelmet: + case NPCID.AngryBonesBigMuscle: + case NPCID.BigBoned: + case NPCID.ShortBones: + case NPCID.AnomuraFungus: + case NPCID.Antlion: + case NPCID.WalkingAntlion: + case NPCID.GiantWalkingAntlion: + case NPCID.LarvaeAntlion: + case NPCID.FlyingAntlion: + case NPCID.GiantFlyingAntlion: + case NPCID.BabySlime: + case NPCID.BlackSlime: + case NPCID.BlazingWheel: + case NPCID.BloodCrawler: + case NPCID.BloodCrawlerWall: + case NPCID.BlueJellyfish: + case NPCID.GreenJellyfish: + case NPCID.PinkJellyfish: + case NPCID.BloodJelly: + case NPCID.FungoFish: + case NPCID.BlueSlime: + case NPCID.BoneSerpentBody: + case NPCID.BoneSerpentHead: + case NPCID.BoneSerpentTail: + case NPCID.CaveBat: + case NPCID.CochinealBeetle: + case NPCID.Crab: + case NPCID.Crawdad: + case NPCID.Crawdad2: + case NPCID.Crimera: + case NPCID.BigCrimera: + case NPCID.LittleCrimera: + case NPCID.CursedSkull: + case NPCID.CyanBeetle: + case NPCID.Demon: + case NPCID.DemonEye: + case NPCID.CataractEye: + case NPCID.CataractEye2: + case NPCID.DemonEye2: + case NPCID.DemonEyeOwl: + case NPCID.DemonEyeSpaceship: + case NPCID.DialatedEye: + case NPCID.DialatedEye2: + case NPCID.GreenEye: + case NPCID.GreenEye2: + case NPCID.PurpleEye: + case NPCID.PurpleEye2: + case NPCID.SleepyEye: + case NPCID.SleepyEye2: + case NPCID.DevourerBody: + case NPCID.DevourerHead: + case NPCID.DevourerTail: + case NPCID.DoctorBones: + case NPCID.DungeonSlime: + case NPCID.EaterofSouls: + case NPCID.BigEater: + case NPCID.LittleEater: + case NPCID.FaceMonster: + case NPCID.ArmedZombieEskimo: + case NPCID.ZombieEskimo: + case NPCID.FungiBulb: + case NPCID.Ghost: + case NPCID.GiantShelly: + case NPCID.GiantShelly2: + case NPCID.GiantWormBody: + case NPCID.GiantWormHead: + case NPCID.GiantWormTail: + case NPCID.Gnome: + case NPCID.GoblinScout: + case NPCID.GraniteFlyer: + case NPCID.GraniteGolem: + case NPCID.GreenSlime: + case NPCID.Harpy: + case NPCID.Hellbat: + case NPCID.GreekSkeleton: + case NPCID.Hornet: + case NPCID.HornetFatty: + case NPCID.HornetHoney: + case NPCID.HornetLeafy: + case NPCID.HornetSpikey: + case NPCID.HornetStingy: + case NPCID.BigHornetFatty: + case NPCID.BigHornetHoney: + case NPCID.BigHornetLeafy: + case NPCID.BigHornetSpikey: + case NPCID.BigHornetStingy: + case NPCID.BigMossHornet: + case NPCID.GiantMossHornet: + case NPCID.LittleHornetFatty: + case NPCID.LittleHornetHoney: + case NPCID.LittleHornetLeafy: + case NPCID.LittleHornetSpikey: + case NPCID.LittleHornetStingy: + case NPCID.LittleMossHornet: + case NPCID.MossHornet: + case NPCID.TinyMossHornet: + case NPCID.IceBat: + case NPCID.IceSlime: + case NPCID.JungleBat: + case NPCID.JungleSlime: + case NPCID.LacBeetle: + case NPCID.LavaSlime: + case NPCID.MaggotZombie: + case NPCID.ManEater: + case NPCID.MeteorHead: + case NPCID.MotherSlime: + case NPCID.MushiLadybug: + case NPCID.Nymph: + case NPCID.Pinky: + case NPCID.Piranha: + case NPCID.PurpleSlime: + case NPCID.Raven: + case NPCID.RedSlime: + case NPCID.Salamander: + case NPCID.Salamander2: + case NPCID.Salamander3: + case NPCID.Salamander4: + case NPCID.Salamander5: + case NPCID.Salamander6: + case NPCID.Salamander7: + case NPCID.Salamander8: + case NPCID.Salamander9: + case NPCID.SandSlime: + case NPCID.SeaSnail: + case NPCID.Shark: + case NPCID.ShimmerSlime: + case NPCID.Skeleton: + case NPCID.SkeletonAlien: + case NPCID.SkeletonAstonaut: + case NPCID.SkeletonTopHat: + case NPCID.ArmoredSkeleton: + case NPCID.BigHeadacheSkeleton: + case NPCID.BigMisassembledSkeleton: + case NPCID.BigPantlessSkeleton: + case NPCID.BigSkeleton: + case NPCID.BoneThrowingSkeleton: + case NPCID.BoneThrowingSkeleton2: + case NPCID.BoneThrowingSkeleton3: + case NPCID.BoneThrowingSkeleton4: + case NPCID.HeadacheSkeleton: + case NPCID.HeavySkeleton: + case NPCID.MisassembledSkeleton: + case NPCID.PantlessSkeleton: + case NPCID.SmallMisassembledSkeleton: + case NPCID.SmallHeadacheSkeleton: + case NPCID.SmallSkeleton: + case NPCID.SmallPantlessSkeleton: + case NPCID.SporeSkeleton: + case NPCID.TacticalSkeleton: + case NPCID.SkeletonSniper: + case NPCID.SkeletonCommando: + case NPCID.DarkCaster: + case NPCID.FireImp: + case NPCID.Snatcher: + case NPCID.SnowFlinx: + case NPCID.SpikeBall: + case NPCID.SpikedIceSlime: + case NPCID.SpikedJungleSlime: + case NPCID.SporeBat: + case NPCID.ZombieMushroom: + case NPCID.ZombieMushroomHat: + case NPCID.Squid: + case NPCID.Tim: + case NPCID.TombCrawlerBody: + case NPCID.TombCrawlerHead: + case NPCID.TombCrawlerTail: + case NPCID.UndeadMiner: + case NPCID.UndeadViking: + case NPCID.VoodooDemon: + case NPCID.Vulture: + case NPCID.WallCreeper: + case NPCID.WallCreeperWall: + case NPCID.YellowSlime: + case NPCID.Zombie: + case NPCID.ZombieDoctor: + case NPCID.ZombieElf: + case NPCID.ZombieElfBeard: + case NPCID.ZombieElfGirl: + case NPCID.ZombieMerman: + case NPCID.ZombiePixie: + case NPCID.ZombieRaincoat: + case NPCID.ZombieSuperman: + case NPCID.ZombieSweater: + case NPCID.ZombieXmas: + case NPCID.ArmedTorchZombie: + case NPCID.ArmedZombie: + case NPCID.ArmedZombieCenx: + case NPCID.ArmedZombiePincussion: + case NPCID.ArmedZombieSlimed: + case NPCID.ArmedZombieSwamp: + case NPCID.ArmedZombieTwiggy: + case NPCID.BaldZombie: + case NPCID.BigBaldZombie: + case NPCID.BigFemaleZombie: + case NPCID.BigPincushionZombie: + case NPCID.BigRainZombie: + case NPCID.BigSlimedZombie: + case NPCID.BigSwampZombie: + case NPCID.BigTwiggyZombie: + case NPCID.BigZombie: + case NPCID.BloodZombie: + case NPCID.FemaleZombie: + case NPCID.PincushionZombie: + case NPCID.SlimedZombie: + case NPCID.SmallBaldZombie: + case NPCID.SmallFemaleZombie: + case NPCID.SmallPincushionZombie: + case NPCID.SmallRainZombie: + case NPCID.SmallSlimedZombie: + case NPCID.SmallSwampZombie: + case NPCID.SmallTwiggyZombie: + case NPCID.SmallZombie: + case NPCID.SwampZombie: + case NPCID.TorchZombie: + case NPCID.TwiggyZombie: + case NPCID.AnglerFish: + case NPCID.AngryTrapper: + case NPCID.Arapaima: + case NPCID.ArmoredViking: + case NPCID.DesertBeast: + case NPCID.BlackRecluse: + case NPCID.BlackRecluseWall: + case NPCID.BloodFeeder: + case NPCID.Mummy: + case NPCID.BloodMummy: + case NPCID.DarkMummy: + case NPCID.LightMummy: + case NPCID.BlueArmoredBones: + case NPCID.BlueArmoredBonesMace: + case NPCID.BlueArmoredBonesNoPants: + case NPCID.BlueArmoredBonesSword: + case NPCID.BoneLee: + case NPCID.ChaosElemental: + case NPCID.Clinger: + case NPCID.BigMimicCorruption: + case NPCID.BigMimicCrimson: + case NPCID.BigMimicHallow: + case NPCID.BigMimicJungle: + case NPCID.CorruptSlime: + case NPCID.Corruptor: + case NPCID.Crimslime: + case NPCID.BigCrimslime: + case NPCID.LittleCrimslime: + case NPCID.CrimsonAxe: + case NPCID.CultistArcherBlue: + case NPCID.CultistArcherWhite: + case NPCID.CultistDevote: + case NPCID.CursedHammer: + case NPCID.Derpling: + case NPCID.Herpling: + case NPCID.DesertDjinn: + case NPCID.DiabolistRed: + case NPCID.DiabolistWhite: + case NPCID.DiggerBody: + case NPCID.DiggerHead: + case NPCID.DiggerTail: + case NPCID.DesertGhoul: + case NPCID.DesertGhoulCorruption: + case NPCID.DesertGhoulCrimson: + case NPCID.DesertGhoulHallow: + case NPCID.DuneSplicerBody: + case NPCID.DuneSplicerHead: + case NPCID.DuneSplicerTail: + case NPCID.DungeonSpirit: + case NPCID.EnchantedSword: + case NPCID.FloatyGross: + case NPCID.FlyingSnake: + case NPCID.Gastropod: + case NPCID.GiantBat: + case NPCID.GiantCursedSkull: + case NPCID.GiantFlyingFox: + case NPCID.GiantFungiBulb: + case NPCID.GiantTortoise: + case NPCID.IceTortoise: + case NPCID.HellArmoredBones: + case NPCID.HellArmoredBonesMace: + case NPCID.HellArmoredBonesSpikeShield: + case NPCID.HellArmoredBonesSword: + case NPCID.HoppinJack: + case NPCID.IceElemental: + case NPCID.Mimic: + case NPCID.IceMimic: + case NPCID.PresentMimic: + case NPCID.IchorSticker: + case NPCID.IcyMerman: + case NPCID.IlluminantBat: + case NPCID.IlluminantSlime: + case NPCID.JungleCreeper: + case NPCID.JungleCreeperWall: + case NPCID.DesertLamiaDark: + case NPCID.DesertLamiaLight: + case NPCID.Lavabat: + case NPCID.Lihzahrd: + case NPCID.LihzahrdCrawler: + case NPCID.Medusa: + case NPCID.Moth: + case NPCID.Necromancer: + case NPCID.NecromancerArmored: + case NPCID.Paladin: + case NPCID.PigronCorruption: + case NPCID.PigronCrimson: + case NPCID.PigronHallow: + case NPCID.Pixie: + case NPCID.PossessedArmor: + case NPCID.RaggedCaster: + case NPCID.RaggedCasterOpenCoat: + case NPCID.RedDevil: + case NPCID.RockGolem: + case NPCID.RuneWizard: + case NPCID.RustyArmoredBonesAxe: + case NPCID.RustyArmoredBonesFlail: + case NPCID.RustyArmoredBonesSword: + case NPCID.RustyArmoredBonesSwordNoArmor: + case NPCID.DesertScorpionWalk: + case NPCID.DesertScorpionWall: + case NPCID.SkeletonArcher: + case NPCID.Slimeling: + case NPCID.Slimer: + case NPCID.Slimer2: + case NPCID.ToxicSludge: + case NPCID.Unicorn: + case NPCID.WanderingEye: + case NPCID.Werewolf: + case NPCID.Wolf: + case NPCID.SeekerBody: + case NPCID.SeekerHead: + case NPCID.SeekerTail: + case NPCID.Wraith: + case NPCID.WyvernBody: + case NPCID.WyvernBody2: + case NPCID.WyvernBody3: + case NPCID.WyvernHead: + case NPCID.WyvernLegs: + case NPCID.WyvernTail: + case NPCID.BloodEelBody: + case NPCID.BloodEelHead: + case NPCID.BloodEelTail: + case NPCID.BloodSquid: + case NPCID.ChatteringTeethBomb: + case NPCID.Clown: + case NPCID.CorruptBunny: + case NPCID.CorruptGoldfish: + case NPCID.CorruptPenguin: + case NPCID.Drippler: + case NPCID.GoblinShark: + case NPCID.TheGroom: + case NPCID.TheBride: + case NPCID.CrimsonBunny: + case NPCID.CrimsonGoldfish: + case NPCID.CrimsonPenguin: + case NPCID.EyeballFlyingFish: + case NPCID.Dandelion: + case NPCID.AngryNimbus: + case NPCID.FlyingFish: + case NPCID.IceGolem: + case NPCID.RainbowSlime: + case NPCID.UmbrellaSlime: + case NPCID.Tumbleweed: + case NPCID.SandShark: + case NPCID.SandsharkCorrupt: + case NPCID.SandsharkCrimson: + case NPCID.SandsharkHallow: + case NPCID.SandElemental: + case NPCID.BloodNautilus: + case NPCID.GoblinArcher: + case NPCID.GoblinPeon: + case NPCID.GoblinSorcerer: + case NPCID.GoblinSummoner: + case NPCID.GoblinThief: + case NPCID.GoblinWarrior: + case NPCID.MisterStabby: + case NPCID.SnowBalla: + case NPCID.SnowmanGangsta: + case NPCID.Parrot: + case NPCID.PirateCaptain: + case NPCID.PirateCorsair: + case NPCID.PirateCrossbower: + case NPCID.PirateDeadeye: + case NPCID.PirateDeckhand: + case NPCID.PirateGhost: + case NPCID.PirateShipCannon: + case NPCID.MothronSpawn: + case NPCID.Mothron: + case NPCID.Butcher: + case NPCID.CreatureFromTheDeep: + case NPCID.DeadlySphere: + case NPCID.DrManFly: + case NPCID.Eyezor: + case NPCID.Frankenstein: + case NPCID.Fritz: + case NPCID.Nailhead: + case NPCID.Psycho: + case NPCID.Reaper: + case NPCID.ThePossessed: + case NPCID.SwampThing: + case NPCID.Vampire: + case NPCID.VampireBat: + case NPCID.BrainScrambler: + case NPCID.GigaZapper: + case NPCID.MartianWalker: + case NPCID.GrayGrunt: + case NPCID.MartianDrone: + case NPCID.MartianEngineer: + case NPCID.MartianOfficer: + case NPCID.RayGunner: + case NPCID.Scutlix: + case NPCID.ScutlixRider: + case NPCID.MartianTurret: + case NPCID.HeadlessHorseman: + case NPCID.Hellhound: + case NPCID.Splinterling: + case NPCID.Poltergeist: + case NPCID.Scarecrow1: + case NPCID.Scarecrow2: + case NPCID.Scarecrow3: + case NPCID.Scarecrow4: + case NPCID.Scarecrow5: + case NPCID.Scarecrow6: + case NPCID.Scarecrow7: + case NPCID.Scarecrow8: + case NPCID.Scarecrow9: + case NPCID.Scarecrow10: + case NPCID.ElfArcher: + case NPCID.ElfCopter: + case NPCID.Flocko: + case NPCID.GingerbreadMan: + case NPCID.Krampus: + case NPCID.Nutcracker: + case NPCID.NutcrackerSpinning: + case NPCID.Yeti: + case NPCID.NebulaBeast: + case NPCID.NebulaBrain: + case NPCID.NebulaHeadcrab: + case NPCID.NebulaSoldier: + case NPCID.SolarCorite: + case NPCID.SolarCrawltipedeBody: + case NPCID.SolarCrawltipedeHead: + case NPCID.SolarCrawltipedeTail: + case NPCID.SolarDrakomire: + case NPCID.SolarDrakomireRider: + case NPCID.SolarSolenian: + case NPCID.SolarSpearman: + case NPCID.SolarSroller: + case NPCID.StardustCellBig: + case NPCID.StardustCellSmall: + case NPCID.StardustJellyfishBig: + case NPCID.StardustWormBody: + case NPCID.StardustWormHead: + case NPCID.StardustWormTail: + case NPCID.StardustSoldier: + case NPCID.StardustSpiderBig: + case NPCID.StardustSpiderSmall: + case NPCID.VortexHornet: + case NPCID.VortexHornetQueen: + case NPCID.VortexLarva: + case NPCID.VortexRifleman: + case NPCID.VortexSoldier: + case NPCID.DD2DarkMageT1: + case NPCID.DD2DarkMageT3: + case NPCID.DD2OgreT2: + case NPCID.DD2OgreT3: + case NPCID.MartianSaucerCore: + case NPCID.MartianSaucerCannon: + case NPCID.MartianSaucerTurret: + case NPCID.DD2SkeletonT1: + case NPCID.DD2SkeletonT3: + case NPCID.DD2DrakinT2: + case NPCID.DD2DrakinT3: + case NPCID.DD2GoblinBomberT1: + case NPCID.DD2GoblinBomberT2: + case NPCID.DD2GoblinBomberT3: + case NPCID.DD2GoblinT1: + case NPCID.DD2GoblinT2: + case NPCID.DD2GoblinT3: + case NPCID.DD2JavelinstT1: + case NPCID.DD2JavelinstT2: + case NPCID.DD2JavelinstT3: + case NPCID.DD2KoboldFlyerT2: + case NPCID.DD2KoboldFlyerT3: + case NPCID.DD2KoboldWalkerT2: + case NPCID.DD2KoboldWalkerT3: + case NPCID.DD2LightningBugT3: + case NPCID.DD2WitherBeastT2: + case NPCID.DD2WitherBeastT3: + case NPCID.DD2WyvernT1: + case NPCID.DD2WyvernT2: + case NPCID.DD2WyvernT3: + case NPCID.AncientCultistSquidhead: + case NPCID.SlimeSpiked: + + // Buff enemy HP by 25% + npc.lifeMax = (int)Math.Round(npc.lifeMax * EnemyHPMultiplier); + + // Nerf a shitload of Master Mode enemies + // HP is nerfed by 25% (this nerf is higher due to the player not dealing any more damage in Master) + // Damage is nerfed by 15% (this nerf is lower due to the player having 100% effective defense in Master) + if (Main.masterMode) + { AdjustMasterModeStatScaling(npc); npc.defDamage = npc.damage; - break; + } - case NPCID.KingSlime: - case NPCID.EyeofCthulhu: - case NPCID.EaterofWorldsHead: - case NPCID.EaterofWorldsBody: - case NPCID.EaterofWorldsTail: - case NPCID.BrainofCthulhu: - case NPCID.Creeper: - case NPCID.QueenBee: - case NPCID.SkeletronHead: - case NPCID.SkeletronHand: - case NPCID.Deerclops: - case NPCID.WallofFlesh: - case NPCID.WallofFleshEye: - case NPCID.QueenSlimeBoss: - case NPCID.Retinazer: - case NPCID.Spazmatism: - case NPCID.TheDestroyer: - case NPCID.TheDestroyerBody: - case NPCID.TheDestroyerTail: - case NPCID.SkeletronPrime: - case NPCID.PrimeCannon: - case NPCID.PrimeLaser: - case NPCID.PrimeSaw: - case NPCID.PrimeVice: - case NPCID.Plantera: - case NPCID.PlanterasTentacle: - case NPCID.Golem: - case NPCID.GolemHead: - case NPCID.GolemHeadFree: - case NPCID.GolemFistLeft: - case NPCID.GolemFistRight: - case NPCID.HallowBoss: - case NPCID.DukeFishron: - case NPCID.CultistBoss: - case NPCID.MoonLordCore: - case NPCID.MoonLordFreeEye: - case NPCID.MoonLordHand: - case NPCID.MoonLordHead: + break; + + case NPCID.KingSlime: + case NPCID.EyeofCthulhu: + case NPCID.EaterofWorldsHead: + case NPCID.EaterofWorldsBody: + case NPCID.EaterofWorldsTail: + case NPCID.BrainofCthulhu: + case NPCID.Creeper: + case NPCID.QueenBee: + case NPCID.SkeletronHead: + case NPCID.SkeletronHand: + case NPCID.Deerclops: + case NPCID.WallofFlesh: + case NPCID.WallofFleshEye: + case NPCID.QueenSlimeBoss: + case NPCID.Retinazer: + case NPCID.Spazmatism: + case NPCID.TheDestroyer: + case NPCID.TheDestroyerBody: + case NPCID.TheDestroyerTail: + case NPCID.SkeletronPrime: + case NPCID.PrimeCannon: + case NPCID.PrimeLaser: + case NPCID.PrimeSaw: + case NPCID.PrimeVice: + case NPCID.Plantera: + case NPCID.PlanterasTentacle: + case NPCID.Golem: + case NPCID.GolemHead: + case NPCID.GolemHeadFree: + case NPCID.GolemFistLeft: + case NPCID.GolemFistRight: + case NPCID.HallowBoss: + case NPCID.DukeFishron: + case NPCID.CultistBoss: + case NPCID.MoonLordCore: + case NPCID.MoonLordFreeEye: + case NPCID.MoonLordHand: + case NPCID.MoonLordHead: + + if (Main.masterMode) AdjustMasterModeStatScaling(npc, true); - break; - } + + break; } } #endregion From 5e4a8797029c327ff80315d6f317d5fb5dd3f1cd Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Thu, 26 Sep 2024 02:47:02 +0700 Subject: [PATCH 018/133] prevented double evil seed sale --- NPCs/CalamityGlobalTownNPC.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index 391fc74071..126fce9af5 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -1164,8 +1164,8 @@ namespace CalamityMod.NPCs .AddWithCustomValue(ItemID.NaturesGift, Item.buyPrice(gold: 10)) .Add(ItemType()) .AddWithCustomValue(ItemID.Grapes, Item.buyPrice(gold: 2, silver: 50), Condition.HappyEnough, Condition.DownedSkeletron) - .Add(ItemID.CorruptSeeds, Condition.CrimsonWorld, Condition.InGraveyard) - .Add(ItemID.CrimsonSeeds, Condition.CorruptWorld, Condition.InGraveyard); + .Add(ItemID.CorruptSeeds, Condition.CrimsonWorld, Condition.InGraveyard, Condition.PreHardmode) + .Add(ItemID.CrimsonSeeds, Condition.CorruptWorld, Condition.InGraveyard, Condition.PreHardmode); // Vanilla sells these in Hardmode, we just make them available at all times } if (type == NPCID.GoblinTinkerer) From b6c0ea14264b280e188a8ec85029acd58ad2cdf6 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Wed, 25 Sep 2024 19:45:54 -0400 Subject: [PATCH 019/133] Bone Serpent and Harpy entries --- Localization/en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson | 3 ++- NPCs/CalamityGlobalNPC.cs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Localization/en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson b/Localization/en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson index 8e46440e13..38322b783d 100644 --- a/Localization/en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson +++ b/Localization/en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson @@ -49,11 +49,12 @@ NPCName: { RaggedCaster: "{$CommonEntries.RaggedCaster}" RaggedCasterOpenCoat: "{$CommonEntries.RaggedCaster}" DungeonGuardian: The Old Man is cursed to never leave nor enter the Dungeon, much less die. Whoever crosses paths with him and dares to descend into those halls shall not pass! - BoneSerpentHead: A primitive necromantic construct built by Demons using stolen magic by Azafure. They protect the Demon's territory fiercely. + BoneSerpentHead: Mighty serpents once ruled hell, but long ago shed their obsidian scales and became naught but skeletal husks. Subdued by Demons with stolen Azafurian spells, they now protect the demonic territory fiercely. Demon: Despite being a primitive civilization, demons populate most of the underworld. Unlike their lesser brothers, they cast shadow magic rather than hell magic. VoodooDemon: Demons have several religious practices, specially sacrifices. They worship the Wall of Flesh ever since it started roaming the underworld, using offerings to draw it closer. RedDevil: Conjuring potent spears of dark magic, these elite demons look after the adventurer that destroyed their perceived deity. WyvernHead: Deeply in tune with the magic of the world, these serpentine dragons guard the skyward ruins of Chrysadia on behalf of the Storm Dragon. Now, their duty calls louder as divine essence surges through the land. + Harpy: Winged, demi-human creatures from distant southward mountains who came to inhabit Chrysadia after its tragic downfall. They defend their new territory fiercely against invaders with their razor-sharp feathers. SeekerHead: Godly magicks have unleashed the dark influences that gave birth to the Eater of Worlds, producing smaller, but just as deadly worms. DesertDjinn: Buried in these caves lie cryptic artifacts older than Ilmeris, their origins swept away by the sands of time. Corrupted by divine magicks, the once friendly djinns within them now reemerge, full of hostility. ChaosElemental: Manifestations of the unstable Essence of the Hallow, they erratically make chase with an uncontrollable surge of luminous power. diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 6118b775b0..0f1875ea56 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -9015,6 +9015,7 @@ namespace CalamityMod.NPCs case NPCID.VoodooDemon: case NPCID.RedDevil: case NPCID.WyvernHead: + case NPCID.Harpy: case NPCID.SeekerHead: case NPCID.DesertDjinn: case NPCID.ChaosElemental: From 7adc6c209f4330c6576946431efef3ccfecbd606 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Thu, 26 Sep 2024 23:00:49 +0700 Subject: [PATCH 020/133] scarlet devil tooltip revision --- Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson index 39b4651db3..74798b1f01 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson @@ -958,7 +958,7 @@ ScarletDevil: { DisplayName: Scarlet Devil Tooltip: ''' - Throws an ultra high velocity spear, which creates more projectiles that home in + Throws an ultra high velocity spear, which leaves a trail of homing bullets The spear creates a Scarlet Blast upon hitting an enemy Stealth strikes grant you lifesteal and summon a star of projectiles upon hitting an enemy 'Divine Spear "Spear the Gungnir"' From 4b9f57847de86fcd8365a56cbd7528c89531e141 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Fri, 27 Sep 2024 01:30:03 +0700 Subject: [PATCH 021/133] deferred sg item resprites --- Items/LoreItems/LoreSlimeGod.png | Bin 410 -> 565 bytes .../Furniture/BossRelics/SlimeGodRelic.png | Bin 922 -> 1303 bytes Tiles/Furniture/BossRelics/SlimeGodRelic.png | Bin 1169 -> 1107 bytes 3 files changed, 0 insertions(+), 0 deletions(-) diff --git a/Items/LoreItems/LoreSlime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4R{vQdNvs3YvN zF@F-W`}G_UVp5-Kpz}Z zMmz&VpI>R!(rSiBLY?)}lTi;~ocqa1Y@6EUm){SM5!VC36EurD_D~TGRC^Sa(oC{X z_ey#qv~|(+X14kfR7X4mL^Gk8(vut>C4c5&f^#eEOYP1quGI;KnLn7-$t6AO+tezE z5zhk&#CZQKk4)2zQYY{{%-MQ2Th8bSGStapP#v)`p|9(D<60p4NHx;a5#4)HKcZzK z>>SZaPpjfuAT|}Vot|@@`%our&a3{}Z-|7LE|mIbfd3wdO$788*TD3Bbk(8iLpZo% z6!EXRo&{p-)neu8zs88?fQ0M0!P*yfjttfpi}bla0SrepZ{wNY4*&oF07*qoM6N<$ Ff&d1@Bx3*o delta 1149 zcmV-@1cLk12$2bpBYyw^b5ch_0Itp)=>Px(OG!jQRA_ ztXtQ_n2m!_h;rM;eS8sP_?*yWHv!bX zONH~->n?27=9|ESlZl4N?y?Sc?OWNkZY2_yfQXf;Hs4GkC-cTDuHBM}kH~$|%IhFY zYVAVXyKhO%%r*cxKGpWdOO}LuD4*X+z9xyx(#m#M?tg#n+><`$@edACB;KTf3#X#DZtxrRe;>GwfWD0?mS_4 ze(#^|NbS(n`>EuI8%g=`;Sk8nPgaKG4+ zvDK}vq5NPovHB?*P9Jj{pXqELbFID4>wo|J*s}N8`bOgq_rB!XV(dh6?{{RBF|`v5 z)kfXB@6YxfOEb_n~b5$j`M3Pqv}_4OZD6UJB(Od&+Np>HJS40CtQH zZzKS}wu(te(GV$pV`Zb56ne)f*-S2pjIG&3SW#-?iGLD+=3l*iLyCq-&_^WupAc!E zv*`6ZBZcqbm7!G|Ev@b9+2881fx8L7>fHeVR#%sM_Lrg|vZEdCsJH$F(#|!>%6ihU P00000NkvXXu0mjfEQ3!v From bdb03f214af8dfa180bd8996210481813f2aecfb Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Thu, 26 Sep 2024 17:07:22 -0400 Subject: [PATCH 022/133] Added several vanilla boss bestiary entries Other minor fixes: * Added a comma in Paladin and a hyphen in Dune Splicer * Lowercased all instances of "god" and "dragon" --- .../Mods.CalamityMod.Bestiary.Vanilla.hjson | 19 +++++++++++++++---- NPCs/CalamityGlobalNPC.cs | 11 +++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/Localization/en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson b/Localization/en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson index 38322b783d..578ca2422d 100644 --- a/Localization/en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson +++ b/Localization/en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson @@ -9,13 +9,13 @@ NPCName: { SleepyEye: "{$CommonEntries.DemonEye}" GreenEye: "{$CommonEntries.DemonEye}" PurpleEye: "{$CommonEntries.DemonEye}" - Wraith: Souls belonging to devotees of Gods were once sealed inside the Wall of Flesh. Now, they roam the night in search of vengeance. + Wraith: Souls belonging to devotees of gods were once sealed inside the Wall of Flesh. Now, they roam the night in search of vengeance. BloodNautilus: The intense red glow of the Blood Moon becomes even greater in contact with water, making aquatic creatures affected more strongly than their land counterparts. This enormous shelled water demon directly feeds off that energy, responding brutally to being pestered. DiggerHead: Exposure to the effects of godly magicks flowing throughout the cracks of the world causes unusual rapid growths in giant worms. GraniteGolem: These strong magicked constructs were utilized in mines for carrying heavy ores and machinery. They continue to inhabit the mines deep below, even after their abandonment. GreekSkeleton: Marble caves were used as arenas during the Deific Era. Fighters looking for glory flocked to them, but now only their bodies populate the area. DesertBeast: Minor draconic offshoots who thrive in arid climates, the Basilisk's hardened bodies make them formidable threats. - DuneSplicerHead: The largest worm native to the Desert. Even strengthened by divine magicks, they fall short of the Scourge, and run amok in a hunger induced frenzy. + DuneSplicerHead: The largest worm native to the Desert. Even strengthened by divine magicks, they fall short of the Scourge, and run amok in a hunger-induced frenzy. SandShark: "{$CommonEntries.SandShark}" SandsharkCorrupt: "{$CommonEntries.SandShark}" SandsharkCrimson: "{$CommonEntries.SandShark}" @@ -41,7 +41,7 @@ NPCName: { TacticalSkeleton: Part of Yharim's military force in their past lives, with thick armor and mighty boomsticks, they were the frontline against the invader that massacred the guards in these halls. SkeletonCommando: Part of Yharim's military force in their past lives, their rocket-powered rage could wipe out entire crowds of escapees had they ever once dared to step out of their cells. BoneLee: This Onyx Kinsman was apprehended by Yharim's troops, and after countless failed escape attempts, used as an example to other prisoners. - Paladin: Several Godseeker Knights were assigned to guard the Dungeon, yet not even they could fight against, much less see their killer. Word of the massacre that happened in these halls never got out, the wails of the dead forever silenced. + Paladin: Several Godseeker Knights were assigned to guard the Dungeon, yet not even they could fight against, much less see, their killer. Word of the massacre that happened in these halls never got out, the wails of the dead forever silenced. DiabolistRed: "{$CommonEntries.Diabolist}" DiabolistWhite: "{$CommonEntries.Diabolist}" Necromancer: "{$CommonEntries.Necromancer}" @@ -54,12 +54,23 @@ NPCName: { VoodooDemon: Demons have several religious practices, specially sacrifices. They worship the Wall of Flesh ever since it started roaming the underworld, using offerings to draw it closer. RedDevil: Conjuring potent spears of dark magic, these elite demons look after the adventurer that destroyed their perceived deity. WyvernHead: Deeply in tune with the magic of the world, these serpentine dragons guard the skyward ruins of Chrysadia on behalf of the Storm Dragon. Now, their duty calls louder as divine essence surges through the land. - Harpy: Winged, demi-human creatures from distant southward mountains who came to inhabit Chrysadia after its tragic downfall. They defend their new territory fiercely against invaders with their razor-sharp feathers. + Harpy: Winged, demi-human creatures from distant southward mountains who came to inhabit Chrysadia after its tragic downfall. They defend their new territory fiercely against invaders with their razor-sharp feathers. SeekerHead: Godly magicks have unleashed the dark influences that gave birth to the Eater of Worlds, producing smaller, but just as deadly worms. DesertDjinn: Buried in these caves lie cryptic artifacts older than Ilmeris, their origins swept away by the sands of time. Corrupted by divine magicks, the once friendly djinns within them now reemerge, full of hostility. ChaosElemental: Manifestations of the unstable Essence of the Hallow, they erratically make chase with an uncontrollable surge of luminous power. MartianSaucerCore: Following the destruction of their planet by otherworldly creatures, the Martians' military evolved at an unprecedented rate. They were prepared to fight back any future threats, and also pillage any other worlds they could find. TorchGod: An unknown entity responsible for a torch's eternal flicker, however easily angered by the unsightly, ungrateful abuse of torch placement. + EyeofCthulhu: A gargantuan monster of unknown origins, responsible for plaguing the night with Demon Eyes. It was given the title of "Cthulhu", which means "Great Beast" in the language of dragons. + BrainofCthulhu: The death of a god often birthed great monsters due to the volatile nature of godly essence. The culling of such abominations used to be cause for songs and festivities, but now, they only give birth to disappointments. + SkeletronHead: A demonic construct that bursts out of the Old Man when necessary and the most dangerous part of the curse laid by the Dragon Cult. They hoped to stop all intruders with it, but one was too cunning even for them. + WallofFlesh: Originally created by Azafurian mages as a gambit to seal away godly essence, the towering wall broke free after the city's destruction. Its existence was problematic, but its demise has ushered even greater instability upon the world. + QueenSlimeBoss: After fleeing the initial battle, the Slime God attempted to rebuild its Paladins with the emerged energy of the Hallow. However, it was ensnared by its own creation, unable to control the vast and unstable power of it. + Retinazer: A pair of mechanical eyes built by Draedon for reconnaissance and assassination, Retinazer focuses its energy into firing powerful lasers. + Spazmatism: A pair of mechanical eyes built by Draedon for reconnaissance and assassination, Spazmatism chases at high speed, exhaling cursed flames. + TheDestroyer: Despite being made with repurposed mining equipment, the Destroyer was built for fighting other deities in single combat, decorated in laser-armed probes, which detach from its body when damaged. + SkeletronPrime: Built with the express purpose of inciting fear into the hearts of any god worshiper, this machine has more arms than ever before, and a variety of fierce weapons. + Plantera: A creation of the Vernal Pass meant to replace Braelor in his absence. They harnessed dead animal souls to give it life, but the span of such magic was far larger than anticipated. It didn't take long for the Plantera to grow out of control and slaughter its masters. + HallowBoss: Despite their parentage, children of gods do not inherit a shred of their power. The Empress chose to claim power for herself by siphoning it from other places and beings. She found a perfect candidate in the Hallow due to its unstable nature, and is now transformed into a mighty fae. } CommonEntries: { diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 0f1875ea56..de1f38fb6b 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -9021,6 +9021,17 @@ namespace CalamityMod.NPCs case NPCID.ChaosElemental: case NPCID.MartianSaucerCore: case NPCID.TorchGod: + case NPCID.EyeofCthulhu: + case NPCID.BrainofCthulhu: + case NPCID.SkeletronHead: + case NPCID.WallofFlesh: + case NPCID.QueenSlimeBoss: + case NPCID.Retinazer: + case NPCID.Spazmatism: + case NPCID.TheDestroyer: + case NPCID.SkeletronPrime: + case NPCID.Plantera: + case NPCID.HallowBoss: FlavorTextBestiaryInfoElement f = new("Hi CS0120"); bestiaryEntry.Info.RemoveAll(i => i.GetType() == f.GetType()); bestiaryEntry.Info.Add(new FlavorTextBestiaryInfoElement(CalamityUtils.GetTextValue($"Bestiary.Vanilla.{Lang.GetNPCName(npc.netID).Key}"))); From 15d0fc1caad38e84f8883ca3896cc083a492751b Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Thu, 26 Sep 2024 20:25:02 -0700 Subject: [PATCH 023/133] fixed digger gfb drops showing in bestiary --- NPCs/NormalNPCs/ArmoredDiggerHead.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NPCs/NormalNPCs/ArmoredDiggerHead.cs b/NPCs/NormalNPCs/ArmoredDiggerHead.cs index d25ec0ad3b..59b8c93ccf 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerHead.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerHead.cs @@ -490,8 +490,8 @@ namespace CalamityMod.NPCs.NormalNPCs { npcLoot.Add(ModContent.ItemType(), 1, 4, 8); npcLoot.Add(ModContent.ItemType(), 1, 4, 8); - npcLoot.AddIf(() => Main.zenithWorld, ModContent.ItemType(), 1, 3, 6); - npcLoot.AddIf(() => Main.zenithWorld, ModContent.ItemType(), 10); + npcLoot.AddIf(() => Main.zenithWorld, ModContent.ItemType(), 1, 3, 6, ui: false); + npcLoot.AddIf(() => Main.zenithWorld, ModContent.ItemType(), 10, ui: false); } public override void ModifyTypeName(ref string typeName) From 0ed0277351efc718989ecfa73ee57abd4f8bcd0a Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Fri, 27 Sep 2024 11:28:11 -0400 Subject: [PATCH 024/133] Donor renamed from Bewearium to Vyster by request --- CalamityLists.cs | 2 +- NPCs/CalamityGlobalTownNPC.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CalamityLists.cs b/CalamityLists.cs index 4c52812920..0d4790f528 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -390,7 +390,7 @@ namespace CalamityMod "Spider region", "WinterTire", "Nycro", - "Bewearium", + "Vyster", // previously "Bewearium" "William", "HellGoat2", "116taj", diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index 126fce9af5..581fae52d5 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -244,7 +244,7 @@ namespace CalamityMod.NPCs "Merasmus", // <@!288066987819663360> (spiderprovidence) "Habolo", // <@!163028025494077441> (hellgoat2) "Ortho", // <@!264984390910738432> (worcuus) - "Chris Tallballs", // <@!770211589076418571> (bewearium) + "Chris Tallballs", // <@!770211589076418571> (vysterx) (previously: bewearium) "Syethas", // <@!325413275066171393> (cosmicstariight) "Nextdoor Psycho", // <@!173261518572486656> (nextdoorpsycho) }; From 84b19a79e80d24e0a8126673926dec3e50042af9 Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Thu, 26 Sep 2024 19:23:08 -0700 Subject: [PATCH 025/133] Added Stohne --- ILEditing/ILChangesLoading.cs | 1 + ILEditing/MechanicILChanges.cs | 59 ++++++++++++++++++ Items/Placeables/Stohne.cs | 16 +++++ Items/Placeables/Stohne.png | Bin 0 -> 238 bytes .../Mods.CalamityMod.Items.Placeables.hjson | 5 ++ NPCs/NormalNPCs/Bohldohr.cs | 4 +- Systems/RecipeSystem.cs | 9 ++- Tiles/Stohne.cs | 38 +++++++++++ Tiles/Stohne.png | Bin 0 -> 10593 bytes Utilities/TileUtils.cs | 1 + 10 files changed, 131 insertions(+), 2 deletions(-) create mode 100644 Items/Placeables/Stohne.cs create mode 100644 Items/Placeables/Stohne.png create mode 100644 Tiles/Stohne.cs create mode 100644 Tiles/Stohne.png diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index 109b245104..12298f9f48 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -178,6 +178,7 @@ namespace CalamityMod.ILEditing On_WorldGen.MakeDungeon += LimitDungeonEntranceXPosition; IL_WorldGen.DungeonHalls += LimitDungeonHallsXPosition; IL_WorldGen.MakeDungeon += ChangeDungeonSpikeQuantities; + Terraria.GameContent.Biomes.On_JunglePass.GenerateFinishingTouches += AddStohne; // Removal of vanilla stupidity IL_Player.UpdateBuffs += RemoveFeralBiteRandomDebuffs; diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index 9d02639183..a216c92684 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -41,6 +41,7 @@ using Terraria.Chat; using Terraria.DataStructures; using Terraria.GameContent; using Terraria.GameContent.Achievements; +using Terraria.GameContent.Biomes; using Terraria.GameContent.Drawing; using Terraria.GameContent.Events; using Terraria.GameContent.Liquid; @@ -56,6 +57,7 @@ using Terraria.Localization; using Terraria.ModLoader; using Terraria.ModLoader.IO; using Terraria.UI.Gamepad; +using Terraria.WorldBuilding; using static Terraria.WaterfallManager; namespace CalamityMod.ILEditing @@ -1895,5 +1897,62 @@ namespace CalamityMod.ILEditing } } #endregion + + #region Add Stohne to the Jungle + public static void AddStohne(Terraria.GameContent.Biomes.On_JunglePass.orig_GenerateFinishingTouches orig, JunglePass self, GenerationProgress progress, int oldX, int oldY) + { + int anchorX = oldX; + int anchorY = oldY; + double worldScale = (double)Main.maxTilesX / 4200.0 * 1.5; + // Generate mud + for (int i = 0; (double)i <= 20.0 * worldScale; i++) + { + progress.Set((60.0 + (double)i / worldScale) * 0.01); + anchorX += WorldGen.genRand.Next((int)(-5.0 * worldScale), (int)(6.0 * worldScale)); + anchorY += WorldGen.genRand.Next((int)(-5.0 * worldScale), (int)(6.0 * worldScale)); + WorldGen.TileRunner(anchorX, anchorY, WorldGen.genRand.Next(40, 100), WorldGen.genRand.Next(300, 500), TileID.Mud); + } + for (int j = 0; (double)j <= 10.0 * worldScale; j++) + { + progress.Set((80.0 + (double)j / worldScale * 2.0) * 0.01); + anchorX = oldX + WorldGen.genRand.Next((int)(-600.0 * worldScale), (int)(600.0 * worldScale)); + anchorY = oldY + WorldGen.genRand.Next((int)(-200.0 * worldScale), (int)(200.0 * worldScale)); + while (anchorX < 1 || anchorX >= Main.maxTilesX - 1 || anchorY < 1 || anchorY >= Main.maxTilesY - 1 || Main.tile[anchorX, anchorY].TileType != TileID.Mud) + { + anchorX = oldX + WorldGen.genRand.Next((int)(-600.0 * worldScale), (int)(600.0 * worldScale)); + anchorY = oldY + WorldGen.genRand.Next((int)(-200.0 * worldScale), (int)(200.0 * worldScale)); + } + for (int k = 0; (double)k < 8.0 * worldScale; k++) + { + anchorX += WorldGen.genRand.Next(-30, 31); + anchorY += WorldGen.genRand.Next(-30, 31); + int type = -1; + if (WorldGen.genRand.NextBool(7)) + { + type = -2; + } + WorldGen.TileRunner(anchorX, anchorY, WorldGen.genRand.Next(10, 20), WorldGen.genRand.Next(30, 70), type); + } + } + int stoneType = ModContent.TileType(); + for (int l = 0; (double)l <= 300.0 * worldScale; l++) + { + anchorX = oldX + WorldGen.genRand.Next((int)(-600.0 * worldScale), (int)(600.0 * worldScale)); + anchorY = oldY + WorldGen.genRand.Next((int)(-200.0 * worldScale), (int)(200.0 * worldScale)); + while (anchorX < 1 || anchorX >= Main.maxTilesX - 1 || anchorY < 1 || anchorY >= Main.maxTilesY - 1 || Main.tile[anchorX, anchorY].TileType != 59) + { + anchorX = oldX + WorldGen.genRand.Next((int)(-600.0 * worldScale), (int)(600.0 * worldScale)); + anchorY = oldY + WorldGen.genRand.Next((int)(-200.0 * worldScale), (int)(200.0 * worldScale)); + } + WorldGen.TileRunner(anchorX, anchorY, WorldGen.genRand.Next(4, 10), WorldGen.genRand.Next(5, 30), stoneType); + // Generate Gems + if (WorldGen.genRand.NextBool(4)) + { + int gem = WorldGen.genRand.Next(63, 69); + WorldGen.TileRunner(anchorX + WorldGen.genRand.Next(-1, 2), anchorY + WorldGen.genRand.Next(-1, 2), WorldGen.genRand.Next(3, 7), WorldGen.genRand.Next(4, 8), gem); + } + } + } + #endregion } } diff --git a/Items/Placeables/Stohne.cs b/Items/Placeables/Stohne.cs new file mode 100644 index 0000000000..1e17d1f9ee --- /dev/null +++ b/Items/Placeables/Stohne.cs @@ -0,0 +1,16 @@ +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables +{ + public class Stohne : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetStaticDefaults() + { + Item.ResearchUnlockCount = 100; + } + + public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); + } +} diff --git a/Items/Placeables/Stohne.png b/Items/Placeables/Stohne.png new file mode 100644 index 0000000000000000000000000000000000000000..60d4e9c891dbe3d5aa6601f03f7237b437a6574a GIT binary patch literal 238 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|s0G|+7V?l;^d4>`#hF%MXXO>_%)r2R7=#&*=dVZs3VM6GIEH8hm-YwpF&MJAq`xToFTFm>bN9-9>pwOz z@H2=_lvZ4HP{Q9~9#h0q-*Sf| U?p{zX4>Xp+)78&qol`;+06=<3;Q#;t literal 0 HcmV?d00001 diff --git a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson index 6249501795..7df35008a0 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson @@ -3320,6 +3320,11 @@ SpineSapling: { Tooltip: Plants Giant Spine saplings on Brimstone Slag } +Stohne: { + DisplayName: Stohne + Tooltip: "" +} + SulphurousSand: { DisplayName: Sulphurous Sand Tooltip: "" diff --git a/NPCs/NormalNPCs/Bohldohr.cs b/NPCs/NormalNPCs/Bohldohr.cs index 222b7849e5..b48e26de4c 100644 --- a/NPCs/NormalNPCs/Bohldohr.cs +++ b/NPCs/NormalNPCs/Bohldohr.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.SummonItems; using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs; using CalamityMod.NPCs.Other; @@ -99,6 +100,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void ModifyNPCLoot(NPCLoot npcLoot) { npcLoot.Add(ItemID.LihzahrdBrick, 1, 10, 26); + npcLoot.Add(ModContent.ItemType(), 1, 10, 26); npcLoot.Add(ItemID.LunarTabletFragment, 7, 10, 26); npcLoot.Add(ItemID.LihzahrdPowerCell, 50); npcLoot.AddIf(() => DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs && Main.zenithWorld, ModContent.ItemType(), 2, ui: false); diff --git a/Systems/RecipeSystem.cs b/Systems/RecipeSystem.cs index 083c723721..e2e260a317 100644 --- a/Systems/RecipeSystem.cs +++ b/Systems/RecipeSystem.cs @@ -258,7 +258,8 @@ namespace CalamityMod.Systems ItemID.EbonstoneBlock, ItemID.CrimstoneBlock, ItemID.PearlstoneBlock, - ItemType() + ItemType(), + ItemType() }); AnyStoneBlock = RecipeGroup.RegisterGroup("AnyStoneBlock", group); @@ -502,6 +503,12 @@ namespace CalamityMod.Systems AddTile(TileID.DyeVat). Register(); + // Stohne smelts into Lihzahrd Bricks + Recipe.Create(ItemID.LihzahrdBrick). + AddIngredient(ItemType()). + AddTile(TileID.LihzahrdFurnace). + Register(); + // Earlier Rocket Is for early rocket weapons Recipe.Create(ItemID.RocketI, 100). AddRecipeGroup("IronBar"). diff --git a/Tiles/Stohne.cs b/Tiles/Stohne.cs new file mode 100644 index 0000000000..64bf509eda --- /dev/null +++ b/Tiles/Stohne.cs @@ -0,0 +1,38 @@ +using CalamityMod.Systems; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles +{ + public class Stohne : ModTile + { + + public override void SetStaticDefaults() + { + Main.tileSolid[Type] = true; + Main.tileBlockLight[Type] = true; + HitSound = SoundID.Tink; + AddMapEntry(new Color(117, 42, 14)); + DustType = DustID.Lihzahrd; + + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithOres(Type); + + TileID.Sets.Stone[Type] = true; + TileID.Sets.Conversion.Stone[Type] = true; + TileID.Sets.CanBeClearedDuringOreRunner[Type] = true; + TileID.Sets.HasSlopeFrames[Type] = true; + + this.RegisterUniversalMerge(TileID.Dirt, "CalamityMod/Tiles/Merges/DirtMerge"); + this.RegisterUniversalMerge(TileID.Stone, "CalamityMod/Tiles/Merges/StoneMerge"); + this.RegisterUniversalMerge(TileID.Mud, "CalamityMod/Tiles/Merges/MudMerge"); + } + + public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) + { + return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame); + } + } +} diff --git a/Tiles/Stohne.png b/Tiles/Stohne.png new file mode 100644 index 0000000000000000000000000000000000000000..d053c4c58d03d221908453de36d3ae977ad8b722 GIT binary patch literal 10593 zcmZvicRZW@+x~;9yS3`3Mr)P3%O+KV(AH{EEB4-sQjOZXYSip9OH#FJ?-DCU?MO;R z)UFkzq(qEF`04j~?tY&?etEr;>-z7?=ej=EaUSRUIA0p-YqOrebRGZzus*o2VGID! zjh~)d{dM;Amu{oP_xHiiSoubT__#<#yG9}hYuJ=}|#{kbnL)H(sG@W*tR;`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), }); /// From 2bd48050478b7c0450896ab0d7a4a7882f73d52a Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Fri, 27 Sep 2024 21:39:56 -0700 Subject: [PATCH 026/133] Smooth Navy resprite + Added Ancient Smooth Navy --- .../AncientSmoothNavystone.cs | 25 +++++++++++++ .../AncientSmoothNavystone.png | Bin 0 -> 264 bytes .../FurnitureEutrophic/SmoothNavystone.cs | 1 + .../FurnitureEutrophic/SmoothNavystone.png | Bin 264 -> 215 bytes .../Mods.CalamityMod.Items.Placeables.hjson | 5 +++ .../AncientSmoothNavystone.cs | 33 ++++++++++++++++++ .../AncientSmoothNavystone.png | Bin 0 -> 16195 bytes Tiles/FurnitureEutrophic/SmoothNavystone.cs | 17 ++++++--- Tiles/FurnitureEutrophic/SmoothNavystone.png | Bin 16195 -> 9689 bytes Utilities/TileUtils.cs | 1 + 10 files changed, 77 insertions(+), 5 deletions(-) create mode 100644 Items/Placeables/FurnitureEutrophic/AncientSmoothNavystone.cs create mode 100644 Items/Placeables/FurnitureEutrophic/AncientSmoothNavystone.png create mode 100644 Tiles/FurnitureEutrophic/AncientSmoothNavystone.cs create mode 100644 Tiles/FurnitureEutrophic/AncientSmoothNavystone.png diff --git a/Items/Placeables/FurnitureEutrophic/AncientSmoothNavystone.cs b/Items/Placeables/FurnitureEutrophic/AncientSmoothNavystone.cs new file mode 100644 index 0000000000..03e455c165 --- /dev/null +++ b/Items/Placeables/FurnitureEutrophic/AncientSmoothNavystone.cs @@ -0,0 +1,25 @@ +using CalamityMod.Items.Placeables.Walls; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureEutrophic +{ + public class AncientSmoothNavystone : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetStaticDefaults() + { + Item.ResearchUnlockCount = 100; + } + + public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); + + /*public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(4). + AddTile(TileID.WorkBenches). + Register(); + }*/ + } +} diff --git a/Items/Placeables/FurnitureEutrophic/AncientSmoothNavystone.png b/Items/Placeables/FurnitureEutrophic/AncientSmoothNavystone.png new file mode 100644 index 0000000000000000000000000000000000000000..27551b932a1cb68d219364e3f4f2e946e37d55ae GIT binary patch literal 264 zcmV+j0r&oiP)E!3|%BpFg%ig}mgE|{4oG|m{t0Xb-QlnH+}&j;ycs*+`J3` O0000(); } public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); diff --git a/Items/Placeables/FurnitureEutrophic/SmoothNavystone.png b/Items/Placeables/FurnitureEutrophic/SmoothNavystone.png index 27551b932a1cb68d219364e3f4f2e946e37d55ae..c1cfbd43f030510bfb3240e4cd87f6701b261690 100644 GIT binary patch delta 199 zcmeBRy3RO3qMn7Bfq~)e-A6${im^Dz-HBn{IhmJ04okYDuOkD)#(wTUiL5}rN`Oy@ ztF~7>zq*E)q4U@OKPLVE@40$u?d{txeRHiU+sso+ uG)_C`k~+m$W9_V)jYn?qvIZP`cbB0qL920V;(~ObK@6U*elF{r5}E)?TSP?QzuW@gblLzc!f{Zp2(RY;ruCaAP`Y1Z z0Q!<7@ty$0xT4{5GEAVRubh=y(_BQE$C2)7j^OYT({@UCh7SOnK!1hIIDyi!kj{|^ y?{y-a?~k7c{7qo>{4oG|m{t0Xb-QlnH+}&j;ycs*+`J3`0000?vR|s z=!T8=_L1lNJKjG$JPw8XzOU>0#Q8bT^9p>bDu3mM&PegF6#2KpuA4z1rUfGq=@)O!##nNsBeqZawaa}o}f1MA{7)%%vy@f_La+; z3}6OoC|hnibCRN;`-4lLREqw&8T7+`LqzS=O^@a}BO3PDjB}_>S|c$3`C=*y7I)D~ z#@lb2U?1yQ(ZQrbPINH8athD$A_eUAVKa2m?&mD~C5_2m;+R*ZM<$AFm`17Sca?Tm z8+TbeQoSqXu5||VtLu5dDUi|J2&Cls@tGMAs6ad{|A89e{MNHn(mQ)QWtfi|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kl zLOR`#gEcaXPHdBaK+&psH};;QPfw_ZxO#6hGo=$bJD7+-a9!9?fIo$Jog2{?f(QU= z+^o0(`h899n9L#bGo3b048}H~0UHvmJxvStY5Bmm<&Zh6`U6#L{W}qVn^^j7$m#DpqxY#;My{dhS{(I;oWNim xTyQh4a_T;vZYj&Z@e42(fViBlZWl*^V+83FF>gDmfos_y#mB0MJXxbR{|{A~I)?xN literal 0 HcmV?d00001 diff --git a/Tiles/FurnitureEutrophic/SmoothNavystone.cs b/Tiles/FurnitureEutrophic/SmoothNavystone.cs index 6f71592d07..ce85324b05 100644 --- a/Tiles/FurnitureEutrophic/SmoothNavystone.cs +++ b/Tiles/FurnitureEutrophic/SmoothNavystone.cs @@ -1,4 +1,5 @@  +using CalamityMod.Systems; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -11,23 +12,29 @@ namespace CalamityMod.Tiles.FurnitureEutrophic public override void SetStaticDefaults() { Main.tileSolid[Type] = true; - Main.tileMergeDirt[Type] = true; Main.tileBlockLight[Type] = true; CalamityUtils.MergeWithGeneral(Type); CalamityUtils.MergeSmoothTiles(Type); CalamityUtils.MergeDecorativeTiles(Type); + CalamityUtils.MergeWithAbyss(Type); CalamityUtils.MergeWithDesert(Type); TileID.Sets.ChecksForMerge[Type] = true; + TileID.Sets.HasSlopeFrames[Type] = true; HitSound = SoundID.Tink; - AddMapEntry(new Color(39, 48, 53)); + DustType = 96; + AddMapEntry(new Color(44, 57, 64)); } - public override bool CreateDust(int i, int j, ref int type) + public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); - return false; + return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame); + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; } } } diff --git a/Tiles/FurnitureEutrophic/SmoothNavystone.png b/Tiles/FurnitureEutrophic/SmoothN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{HP0;Xp5g z?YH;D0YOfE=fq-21XP7yz+8iOkSe>N!b+X!$dpA0&-9c*6z3 z>&cUe_a}&+(&hAO(sTMdD&VJ?_UEh}G=WP=JbUxShA%<)6yGOcnO5@bW2zn{?3hInKh0A-(O5ZrZs7uS*>hp3}4cSikzh_e_6z_(MawcP{g z1ivoOKN#s8A8KvDULTbx)o>U)I;{C4Nf6M&^dL|I`8wHSc^AzH(p3!Wp&DG>-hHI& zH-9R#EaW6P#lT<-$27L;H=|9Peo)(cnH4;I65)BoqbR6wAcj8_6g{W~ZJXhZ;ega^ zycjPq9eoZ6p?Q&u@6o`0i$IKG%LhS|wEwF{VqhoVo2xp^5|PBaJNRQONeG1S!;wQh z?=jsq9YN<`w@8=s^?zW}#r+TasLwNGHgH0sU*6w9Q&*cBtSTeC_gzcqIwhXOf&Wkl zLOR`#gEcaXPHdBaK+&psH};;QPfw_ZxO#6hGo=$bJD7+-a9!9?fIo$Jog2{?f(QU= z+^o0(`h899n9L#bGo3b048}H~0UHvmJxvStY5Bmm<&Zh6`U6#L{W}qVn^^j7$m#DpqxY#;My{dhS{(I;oWNim xTyQh4a_T;vZYj&Z@e42(fViBlZWl*^V+83FF>gDmfos_y#mB0MJXxbR{|{A~I)?xN diff --git a/Utilities/TileUtils.cs b/Utilities/TileUtils.cs index 82e2d53f2c..7650bf46f2 100644 --- a/Utilities/TileUtils.cs +++ b/Utilities/TileUtils.cs @@ -560,6 +560,7 @@ namespace CalamityMod SetMerge(type, TileID.MarbleBlock); SetMerge(type, TileID.GraniteBlock); //Calam + SetMerge(type, TileType()); SetMerge(type, TileType()); SetMerge(type, TileType()); SetMerge(type, TileType()); From 25e1febe93f9f758d8e3cf07399e15dfd6ce912e Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Sat, 28 Sep 2024 03:53:32 -0700 Subject: [PATCH 027/133] photo LC flares home on nearest npc instead of final in array --- Projectiles/Ranged/ExoLight.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Projectiles/Ranged/ExoLight.cs b/Projectiles/Ranged/ExoLight.cs index d1db382e64..2cf433a89a 100644 --- a/Projectiles/Ranged/ExoLight.cs +++ b/Projectiles/Ranged/ExoLight.cs @@ -82,10 +82,19 @@ namespace CalamityMod.Projectiles.Ranged Projectile.scale = MathHelper.Lerp(0.001f, 1f, Utils.GetLerpValue(0f, 25f, Time, true)); if (Projectile.localAI[0] == 0f) { + float currentDist = 25000f; foreach (NPC n in Main.ActiveNPCs) { if (n.CanBeChasedBy(Projectile.GetSource_FromThis(), false)) - NPCDestination = n.Center + n.velocity * 5f; + { + Vector2 potentialDest = n.Center + n.velocity * 5f; + float newDist = potentialDest.Distance(Projectile.Center); + if (newDist < currentDist) + { + currentDist = newDist; + NPCDestination = potentialDest; + } + } } InitialCenter = Projectile.Center; Projectile.localAI[0] = 1f; From 42dfd297f2dbc9a2a06892ccfd8a2d2dce41f69d Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sat, 28 Sep 2024 16:01:09 -0400 Subject: [PATCH 028/133] Rest of the boss entries --- .../en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson | 9 +++++++++ NPCs/CalamityGlobalNPC.cs | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/Localization/en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson b/Localization/en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson index 578ca2422d..94ad7ba534 100644 --- a/Localization/en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson +++ b/Localization/en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson @@ -71,6 +71,15 @@ NPCName: { SkeletronPrime: Built with the express purpose of inciting fear into the hearts of any god worshiper, this machine has more arms than ever before, and a variety of fierce weapons. Plantera: A creation of the Vernal Pass meant to replace Braelor in his absence. They harnessed dead animal souls to give it life, but the span of such magic was far larger than anticipated. It didn't take long for the Plantera to grow out of control and slaughter its masters. HallowBoss: Despite their parentage, children of gods do not inherit a shred of their power. The Empress chose to claim power for herself by siphoning it from other places and beings. She found a perfect candidate in the Hallow due to its unstable nature, and is now transformed into a mighty fae. + Golem: A remarkable display of ingenuity constructed by the Lihzahrd race. Seeking light after they hid away in their temple out of shame for driving their goddess away, they built this construct. Powered by solar energy cells, it is ready to guard the Temple. + DukeFishron: An aquatic-evolved species which lives in isolation in the depths of the ocean. Despite their shortcomings, they still share blood with the dragons of old, claiming near complete dominion over the oceans. Legends claim it only surfaces in search of a rare, savory type of worm. + CultistBoss: The fanatical leader of the Dragon Cult, hell-bent on resurrecting a dragon. He upholds their sacred duty of keeping the cosmic behemoth sealed far away on the moon, an oath he swore to long ago when he pledged himself in their service. + CultistDevote: Utterly devoted, Lunatic Devotees are so paranoid over the prospect of their ritual failing that they stay unflinching even when threatened with death. Fear only makes them work harder. + LunarTowerNebula: The second pillar, created to spawn beings from beyond that filled the Minds of all with gloom. These troops specialized in disabling the enemy's intelligence, ensuring no countermeasures could be planned against the dominator. + LunarTowerSolar: The fourth and last pillar, created as Sunlight bled and marked doom. A miniscule shard of its power was used to make it, and yet its spawns accompanied the dominator directly in his conquest against the dragons. + LunarTowerVortex: The first pillar, created as black Storm clouds on the horizon loomed. While the dominator fought the mightiest of dragons, the spawns of this pillar focused on exterminating any mundane life they could find, appearing in seemingly infinite droves. + LunarTowerStardust: The third Pillar, created as Life rose to fight, but was given no room. Its spawns found particular utility in searching and picking off stronger beings that could pose a threat to the creatures of the Vortex. + MoonLordCore: The cosmic behemoth that brought Terraria to its knees 800 years ago, freed from its lunar prison in a weakened state. It had the power to siphon and dominate souls, including those possessed by dragons, permanently wounding them. It hails from an incomprehensible fissure of broken spacetime which leeches energy from our dimension to sustain itself. } CommonEntries: { diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index de1f38fb6b..494d521f31 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -9032,6 +9032,15 @@ namespace CalamityMod.NPCs case NPCID.SkeletronPrime: case NPCID.Plantera: case NPCID.HallowBoss: + case NPCID.Golem: + case NPCID.DukeFishron: + case NPCID.CultistBoss: + case NPCID.CultistDevote: + case NPCID.LunarTowerNebula: + case NPCID.LunarTowerSolar: + case NPCID.LunarTowerVortex: + case NPCID.LunarTowerStardust: + case NPCID.MoonLordCore: FlavorTextBestiaryInfoElement f = new("Hi CS0120"); bestiaryEntry.Info.RemoveAll(i => i.GetType() == f.GetType()); bestiaryEntry.Info.Add(new FlavorTextBestiaryInfoElement(CalamityUtils.GetTextValue($"Bestiary.Vanilla.{Lang.GetNPCName(npc.netID).Key}"))); From 06bdd146e7d43d543b3354afd8352ae0c865d074 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sat, 28 Sep 2024 16:43:51 -0400 Subject: [PATCH 029/133] More ! --- Localization/en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson | 7 +++++++ NPCs/CalamityGlobalNPC.cs | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/Localization/en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson b/Localization/en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson index 94ad7ba534..6d2ab4da17 100644 --- a/Localization/en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson +++ b/Localization/en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson @@ -14,6 +14,8 @@ NPCName: { DiggerHead: Exposure to the effects of godly magicks flowing throughout the cracks of the world causes unusual rapid growths in giant worms. GraniteGolem: These strong magicked constructs were utilized in mines for carrying heavy ores and machinery. They continue to inhabit the mines deep below, even after their abandonment. GreekSkeleton: Marble caves were used as arenas during the Deific Era. Fighters looking for glory flocked to them, but now only their bodies populate the area. + UndeadViking: After the Crusade left the continent in shambles, many factions attempted to conquer it. These vikings were one such group, but the icy winds of the tundra made short work of them. + IcyMerman: Mermen rarely stray far from the ocean, favoring the vast waters where their revered Elemental now lives in. Those that do can become lost, wander into cold caverns, and become icy undead fish men. DesertBeast: Minor draconic offshoots who thrive in arid climates, the Basilisk's hardened bodies make them formidable threats. DuneSplicerHead: The largest worm native to the Desert. Even strengthened by divine magicks, they fall short of the Scourge, and run amok in a hunger-induced frenzy. SandShark: "{$CommonEntries.SandShark}" @@ -55,9 +57,14 @@ NPCName: { RedDevil: Conjuring potent spears of dark magic, these elite demons look after the adventurer that destroyed their perceived deity. WyvernHead: Deeply in tune with the magic of the world, these serpentine dragons guard the skyward ruins of Chrysadia on behalf of the Storm Dragon. Now, their duty calls louder as divine essence surges through the land. Harpy: Winged, demi-human creatures from distant southward mountains who came to inhabit Chrysadia after its tragic downfall. They defend their new territory fiercely against invaders with their razor-sharp feathers. + MartianProbe: Sensing growing power on the planet, otherworldly beings send space-age technology to scan for valuable resources. SeekerHead: Godly magicks have unleashed the dark influences that gave birth to the Eater of Worlds, producing smaller, but just as deadly worms. DesertDjinn: Buried in these caves lie cryptic artifacts older than Ilmeris, their origins swept away by the sands of time. Corrupted by divine magicks, the once friendly djinns within them now reemerge, full of hostility. ChaosElemental: Manifestations of the unstable Essence of the Hallow, they erratically make chase with an uncontrollable surge of luminous power. + GoblinThief: Thieves forcefully conscripted in the Goblin Army in exchange for freedom, these pesky foes specialize in nimble movement and close-quarters combat. + GoblinSummoner: Goblins that reach such a mastery over the arcane are treated like royalty, prize jewels of their society. Warlocks in particular conjure unfathomable shadowflame ghasts through a powerful hex. + GoblinSorcerer: Goblins struggle to manipulate magic, only scantily capable of conjuring the simplest of spells. Those that can have the potential for manipulating magicked shadow energy through a form of hexing. + PirateCaptain: A pirate captain's love for riches is only rivaled by his desire to explore! Word that the Crusade had seemingly ended spread fast across the world, and abundances to plunder in this continent attracted this sea dweller and his motley crew. MartianSaucerCore: Following the destruction of their planet by otherworldly creatures, the Martians' military evolved at an unprecedented rate. They were prepared to fight back any future threats, and also pillage any other worlds they could find. TorchGod: An unknown entity responsible for a torch's eternal flicker, however easily angered by the unsightly, ungrateful abuse of torch placement. EyeofCthulhu: A gargantuan monster of unknown origins, responsible for plaguing the night with Demon Eyes. It was given the title of "Cthulhu", which means "Great Beast" in the language of dragons. diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 494d521f31..4689478a2e 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -8975,6 +8975,8 @@ namespace CalamityMod.NPCs case NPCID.DiggerHead: case NPCID.GraniteGolem: case NPCID.GreekSkeleton: + case NPCID.UndeadViking: + case NPCID.IcyMerman: case NPCID.DesertBeast: case NPCID.DuneSplicerHead: case NPCID.SandShark: @@ -9016,9 +9018,14 @@ namespace CalamityMod.NPCs case NPCID.RedDevil: case NPCID.WyvernHead: case NPCID.Harpy: + case NPCID.MartianProbe: case NPCID.SeekerHead: case NPCID.DesertDjinn: case NPCID.ChaosElemental: + case NPCID.GoblinThief: + case NPCID.GoblinSummoner: + case NPCID.GoblinSorcerer: + case NPCID.PirateCaptain: case NPCID.MartianSaucerCore: case NPCID.TorchGod: case NPCID.EyeofCthulhu: From e40537151c0dd186d6e64cc15a34b0edbef28fb9 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sun, 29 Sep 2024 11:27:55 -0400 Subject: [PATCH 030/133] Mining Astral Ore pre-Deus now has a 50% chance to give 1 Starblight Soot instead of always giving 1-2 --- .../en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson | 14 +++++++------- Tiles/Ores/AstralOre.cs | 7 ++++++- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Localization/en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson b/Localization/en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson index 6d2ab4da17..48147b2f72 100644 --- a/Localization/en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson +++ b/Localization/en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson @@ -14,8 +14,8 @@ NPCName: { DiggerHead: Exposure to the effects of godly magicks flowing throughout the cracks of the world causes unusual rapid growths in giant worms. GraniteGolem: These strong magicked constructs were utilized in mines for carrying heavy ores and machinery. They continue to inhabit the mines deep below, even after their abandonment. GreekSkeleton: Marble caves were used as arenas during the Deific Era. Fighters looking for glory flocked to them, but now only their bodies populate the area. - UndeadViking: After the Crusade left the continent in shambles, many factions attempted to conquer it. These vikings were one such group, but the icy winds of the tundra made short work of them. - IcyMerman: Mermen rarely stray far from the ocean, favoring the vast waters where their revered Elemental now lives in. Those that do can become lost, wander into cold caverns, and become icy undead fish men. + UndeadViking: After the Crusade left the continent in shambles, many factions attempted to conquer it. These vikings were one such group, but the icy winds of the tundra made short work of them. + IcyMerman: Mermen rarely stray far from the ocean, favoring the vast waters where their revered Elemental now lives in. Those that do can become lost, wander into cold caverns, and become icy undead fish men. DesertBeast: Minor draconic offshoots who thrive in arid climates, the Basilisk's hardened bodies make them formidable threats. DuneSplicerHead: The largest worm native to the Desert. Even strengthened by divine magicks, they fall short of the Scourge, and run amok in a hunger-induced frenzy. SandShark: "{$CommonEntries.SandShark}" @@ -57,14 +57,14 @@ NPCName: { RedDevil: Conjuring potent spears of dark magic, these elite demons look after the adventurer that destroyed their perceived deity. WyvernHead: Deeply in tune with the magic of the world, these serpentine dragons guard the skyward ruins of Chrysadia on behalf of the Storm Dragon. Now, their duty calls louder as divine essence surges through the land. Harpy: Winged, demi-human creatures from distant southward mountains who came to inhabit Chrysadia after its tragic downfall. They defend their new territory fiercely against invaders with their razor-sharp feathers. - MartianProbe: Sensing growing power on the planet, otherworldly beings send space-age technology to scan for valuable resources. + MartianProbe: Sensing growing power on the planet, otherworldly beings send space-age technology to scan for valuable resources. SeekerHead: Godly magicks have unleashed the dark influences that gave birth to the Eater of Worlds, producing smaller, but just as deadly worms. DesertDjinn: Buried in these caves lie cryptic artifacts older than Ilmeris, their origins swept away by the sands of time. Corrupted by divine magicks, the once friendly djinns within them now reemerge, full of hostility. ChaosElemental: Manifestations of the unstable Essence of the Hallow, they erratically make chase with an uncontrollable surge of luminous power. - GoblinThief: Thieves forcefully conscripted in the Goblin Army in exchange for freedom, these pesky foes specialize in nimble movement and close-quarters combat. - GoblinSummoner: Goblins that reach such a mastery over the arcane are treated like royalty, prize jewels of their society. Warlocks in particular conjure unfathomable shadowflame ghasts through a powerful hex. - GoblinSorcerer: Goblins struggle to manipulate magic, only scantily capable of conjuring the simplest of spells. Those that can have the potential for manipulating magicked shadow energy through a form of hexing. - PirateCaptain: A pirate captain's love for riches is only rivaled by his desire to explore! Word that the Crusade had seemingly ended spread fast across the world, and abundances to plunder in this continent attracted this sea dweller and his motley crew. + GoblinThief: Thieves forcefully conscripted in the Goblin Army in exchange for freedom, these pesky foes specialize in nimble movement and close-quarters combat. + GoblinSummoner: Goblins that reach such a mastery over the arcane are treated like royalty, prize jewels of their society. Warlocks in particular conjure unfathomable shadowflame ghasts through a powerful hex. + GoblinSorcerer: Goblins struggle to manipulate magic, only scantily capable of conjuring the simplest of spells. Those that can have the potential for manipulating magicked shadow energy through a form of hexing. + PirateCaptain: A pirate captain's love for riches is only rivaled by his desire to explore! Word that the Crusade had seemingly ended spread fast across the world, and abundances to plunder in this continent attracted this sea dweller and his motley crew. MartianSaucerCore: Following the destruction of their planet by otherworldly creatures, the Martians' military evolved at an unprecedented rate. They were prepared to fight back any future threats, and also pillage any other worlds they could find. TorchGod: An unknown entity responsible for a torch's eternal flicker, however easily angered by the unsightly, ungrateful abuse of torch placement. EyeofCthulhu: A gargantuan monster of unknown origins, responsible for plaguing the night with Demon Eyes. It was given the title of "Cthulhu", which means "Great Beast" in the language of dragons. diff --git a/Tiles/Ores/AstralOre.cs b/Tiles/Ores/AstralOre.cs index 0b1f23af65..481d793184 100644 --- a/Tiles/Ores/AstralOre.cs +++ b/Tiles/Ores/AstralOre.cs @@ -74,7 +74,12 @@ namespace CalamityMod.Tiles.Ores public override IEnumerable GetItemDrops(int i, int j) { if (!DownedBossSystem.downedAstrumDeus) - yield return new Item(ModContent.ItemType(), Main.rand.Next(1, 2 + 1)); + { + if (Main.rand.NextBool()) + yield return new Item(ModContent.ItemType()); + else + yield return new Item(0); + } else yield return new Item(ModContent.ItemType()); } From 94e369e56c226a4228f892875ea0206207abef6b Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sun, 29 Sep 2024 13:06:42 -0400 Subject: [PATCH 031/133] Reduce explosive resist for pre-HM worms * This includes Eater of Worlds' vanilla resist * Also added TNT Barrel to the explosive list --- CalamityLists.cs | 3 ++- ILEditing/BalancingILChanges.cs | 28 ++++++++++++++++++++++++++++ ILEditing/ILChangesLoading.cs | 1 + NPCs/CalamityGlobalNPC.cs | 3 ++- 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/CalamityLists.cs b/CalamityLists.cs index 0d4790f528..95095a5a6a 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -2205,7 +2205,8 @@ namespace CalamityMod ProjectileID.Bee, ProjectileID.GiantBee, ProjectileType(), - ProjectileID.ScarabBomb + ProjectileID.ScarabBomb, + ProjectileID.TNTBarrel }; ZeroContactDamageNPCList = new List diff --git a/ILEditing/BalancingILChanges.cs b/ILEditing/BalancingILChanges.cs index 50ef9a6f68..8c02f23240 100644 --- a/ILEditing/BalancingILChanges.cs +++ b/ILEditing/BalancingILChanges.cs @@ -464,6 +464,34 @@ namespace CalamityMod.ILEditing } #endregion + #region Reduce Eater of Worlds Grenade Resist + private static void ReduceEoWGrenadeResist(ILContext il) + { + // Reduce Expert+ Eater of Worlds' resist to explosives from 80% to 60%. + var cursor = new ILCursor(il); + + // Of course, this is 800 lines into Projectile.Damage, so we must do funky things. + for (int f = 0; f < 2; f++) + { + if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdcI4(1002))) + { + LogFailure("Reduce EoW Grenade Resist", "Could not move to the resist factor."); + return; + } + } + if (!cursor.TryGotoNext(MoveType.After, i => i.MatchDiv())) + { + LogFailure("Reduce EoW Grenade Resist", "Could not move to the resist factor."); + return; + } + + // Remove the instruction dividing by 5, and replace it with an instruction multiplying by 0.4. + cursor.RemoveRange(2); + cursor.EmitLdcR4(0.4f); + cursor.EmitMul(); + } + #endregion + #region Terrarian Projectile Limitation for Extra Updates private static void LimitTerrarianProjectiles(ILContext il) { diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index 12298f9f48..7e68c85e65 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -138,6 +138,7 @@ namespace CalamityMod.ILEditing // Damage and health balance On_Main.DamageVar_float_int_float += AdjustDamageVariance; IL_NPC.ScaleStats_ApplyExpertTweaks += RemoveExpertHardmodeScaling; + IL_Projectile.Damage += ReduceEoWGrenadeResist; IL_Projectile.AI_099_2 += LimitTerrarianProjectiles; IL_Player.UpdateBuffs += NerfSharpeningStation; IL_Player.UpdateBuffs += NerfBeetleScaleMail; diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 4689478a2e..00da0e990d 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -5909,12 +5909,13 @@ namespace CalamityMod.NPCs if (CalamityLists.GrenadeResistIDs.Contains(projectile.type)) { // Eater of Worlds has a vanilla resist in Expert+, this gives it to him in Normal mode + // Note that Calamity reduces the vanilla resist from 80% to 60% bool hasResist = CalamityLists.EaterofWorldsIDs.Contains(npc.type) && !Main.expertMode; // Add a resist for BoC's creepers and Prehardmode worm bosses if (npc.type == NPCID.Creeper || CalamityLists.DesertScourgeIDs.Contains(npc.type) || CalamityLists.PerforatorIDs.Contains(npc.type)) hasResist = true; if (hasResist) - modifiers.SourceDamage *= 0.2f; + modifiers.SourceDamage *= 0.4f; } if (CalamityLists.pierceResistList.Contains(npc.type)) From a2633e81ff15608bc6d88bd000bf368fe3bb59af Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 29 Sep 2024 14:11:42 -0400 Subject: [PATCH 032/133] Exhuming now supports stackable items --- UI/CalamitasEnchantments/CalamitasEnchantUI.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs index d4aa053294..0af121ab93 100644 --- a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs +++ b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs @@ -176,8 +176,13 @@ namespace CalamityMod.UI.CalamitasEnchants // Increase the cost of enchanting significantly if doing so would upgrade the item directly. if (SelectedEnchantment.HasValue && SelectedEnchantment.Value.Name == CalamityUtils.GetText(EnchantmentManager.ExhumedNamePath)) + { cost = (int)MathHelper.Min(cost, Item.buyPrice(5)) * 5; + // 29SEP2024: Ozzatron: exhuming stackable items scales the cost with the stack size + cost *= CurrentlyHeldItem.stack; + } + // Make it 20% cheaper if the player has the Discount Card or Greedy Ring if (Main.LocalPlayer.discountAvailable) cost = (int)(cost * 0.8); @@ -374,7 +379,9 @@ namespace CalamityMod.UI.CalamitasEnchants bool IsExhuming = SelectedEnchantment.Value.Name == CalamityUtils.GetText(EnchantmentManager.ExhumedNamePath); + // 29SEP2024: Ozzatron: exhuming stackable items produces a stack of the same size int oldPrefix = CurrentlyHeldItem.prefix; + int oldStack = CurrentlyHeldItem.stack; CurrentlyHeldItem.SetDefaults(CurrentlyHeldItem.type); CurrentlyHeldItem.Prefix(oldPrefix); CurrentlyHeldItem = CurrentlyHeldItem.Clone(); @@ -383,6 +390,7 @@ namespace CalamityMod.UI.CalamitasEnchants { CurrentlyHeldItem.SetDefaults(EnchantmentManager.ItemUpgradeRelationship[CurrentlyHeldItem.type]); CurrentlyHeldItem.Prefix(oldPrefix); + CurrentlyHeldItem.stack = oldStack; } else { From b1eec62cf35c8801fb530610eac402d1ec42266d Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Fri, 27 Sep 2024 04:16:06 -0700 Subject: [PATCH 033/133] animated most worms in the bestiary --- .../Bestiary/AquaticScourge_Bestiary.png | Bin 6012 -> 0 bytes .../Bestiary/ArmoredDigger_Bestiary.png | Bin 3608 -> 0 bytes .../Bestiary/AstrumDeus_Bestiary.png | Bin 9287 -> 0 bytes .../Bestiary/CosmicGuardian_Bestiary.png | Bin 5059 -> 0 bytes .../Bestiary/DevourerofGods_Bestiary.png | Bin 10131 -> 0 bytes .../Bestiary/EidolonWyrm_Bestiary.png | Bin 3621 -> 0 bytes ExtraTextures/Bestiary/GulperEel_Bestiary.png | Bin 3216 -> 0 bytes ExtraTextures/Bestiary/Oarfish_Bestiary.png | Bin 2239 -> 0 bytes .../Bestiary/PerforatorLarge_Bestiary.png | Bin 8474 -> 0 bytes .../Bestiary/PerforatorMedium_Bestiary.png | Bin 7062 -> 0 bytes .../Bestiary/PerforatorSmall_Bestiary.png | Bin 5340 -> 0 bytes .../Bestiary/PrimordialWyrm_Bestiary.png | Bin 13865 -> 0 bytes .../Bestiary/StormWeaver_Bestiary.png | Bin 5899 -> 0 bytes ExtraTextures/Bestiary/Thanatos_Bestiary.png | Bin 8247 -> 0 bytes NPCs/Abyss/EidolonWyrmHead.cs | 12 +++- NPCs/Abyss/GulperEelBody.cs | 4 +- NPCs/Abyss/GulperEelBody.png | Bin 769 -> 442 bytes NPCs/Abyss/GulperEelBodyAlt.cs | 4 +- NPCs/Abyss/GulperEelBodyAlt.png | Bin 743 -> 425 bytes NPCs/Abyss/GulperEelBodyAltGlow.png | Bin 407 -> 245 bytes NPCs/Abyss/GulperEelBodyGlow.png | Bin 354 -> 233 bytes NPCs/Abyss/GulperEelHead.cs | 17 +++++- NPCs/Abyss/GulperEelHead.png | Bin 1397 -> 613 bytes NPCs/Abyss/GulperEelHeadGlow.png | Bin 287 -> 238 bytes NPCs/Abyss/GulperEelTail.cs | 4 +- NPCs/Abyss/GulperEelTail.png | Bin 723 -> 376 bytes NPCs/Abyss/GulperEelTailGlow.png | Bin 264 -> 221 bytes NPCs/Abyss/OarfishHead.cs | 12 +++- NPCs/AquaticScourge/AquaticScourgeHead.cs | 9 ++- NPCs/AstrumDeus/AstrumDeusHead.cs | 7 ++- NPCs/DevourerofGods/CosmicGuardianHead.cs | 7 ++- NPCs/DevourerofGods/DevourerofGodsHead.cs | 5 +- NPCs/ExoMechs/Thanatos/ThanatosHead.cs | 26 +++++++- NPCs/NormalNPCs/ArmoredDiggerHead.cs | 12 +++- NPCs/Perforator/PerforatorHeadLarge.cs | 4 +- NPCs/Perforator/PerforatorHeadMedium.cs | 4 +- NPCs/Perforator/PerforatorHeadSmall.cs | 5 +- NPCs/PrimordialWyrm/PrimordialWyrmHead.cs | 5 +- NPCs/StormWeaver/StormWeaverHead.cs | 5 +- Utilities/NPCUtils.cs | 56 +++++++++++++++++- 40 files changed, 171 insertions(+), 27 deletions(-) delete mode 100644 ExtraTextures/Bestiary/AquaticScourge_Bestiary.png delete mode 100644 ExtraTextures/Bestiary/ArmoredDigger_Bestiary.png delete mode 100644 ExtraTextures/Bestiary/AstrumDeus_Bestiary.png delete mode 100644 ExtraTextures/Bestiary/CosmicGuardian_Bestiary.png delete mode 100644 ExtraTextures/Bestiary/DevourerofGods_Bestiary.png delete mode 100644 ExtraTextures/Bestiary/EidolonWyrm_Bestiary.png delete mode 100644 ExtraTextures/Bestiary/GulperEel_Bestiary.png delete mode 100644 ExtraTextures/Bestiary/Oarfish_Bestiary.png delete mode 100644 ExtraTextures/Bestiary/PerforatorLarge_Bestiary.png delete mode 100644 ExtraTextures/Bestiary/PerforatorMedium_Bestiary.png delete mode 100644 ExtraTextures/Bestiary/PerforatorSmall_Bestiary.png delete mode 100644 ExtraTextures/Bestiary/PrimordialWyrm_Bestiary.png delete mode 100644 ExtraTextures/Bestiary/StormWeaver_Bestiary.png delete mode 100644 ExtraTextures/Bestiary/Thanatos_Bestiary.png diff --git a/ExtraTextures/Bestiary/AquaticScourge_Bestiary.png b/ExtraTextures/Bestiary/AquaticScourge_Bestiary.png deleted file mode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KzkU|#TAE7>8gWX27MMkk8C1`}<*z!UJ z5?qfqHlGi?m`tLu;s9AH5u|`~ZGwVJ zq6Onh5g!|Hd(ai%J1V-Qh!1EHe61S9`aB$qzqPlT_V;G$UygvA3c**_PjSCPln*12 z{?c!CeDVXQ^1!aDLlVbxT&4)2d(z{tnHV$I3i8plZUP*kj1Sm^iVdRR&`KEhL-+$<7COOG6fV&4)TWZ z#j6HY@m;s(b0&2Hcu#OO6=S;$lDG|_F0jFR> zO|_k1{Pt_hV2>)^nWkp_ya(SL#t);eKvzwcrQ6!;#)RxD%kfp<;zYK2^#5L2=}M89z-YG` zxfk&_Ru-@}hQLbiE@nPTaXcw=|9Uer!qqK+7r&6HqNFiy*~Y?8rrlrTTv#%QT-O|L zsoWVBj>yQ8J{j748qXO*3XHYgpDT1S7IsZnc}*U{CpZ_M@|3tWyzR3|bW41*-yoT_0Idu1)^`PDzY|ptOS`$?XM|L@NvU zONzF2RK0&y;|!|*PmZy*kG*Pa?v74Nbmj2`t+718d&GnjD=;4VFmkPDPXWr}si%R7 z7!DubZ+))5MEaXc+3{tatS^^r-fHO=cBd87@1Q?bTU8u81c9 zNRqEh`EFa_ur;DCRj6w%-}t&8=TQ*}&Et(ErMc(6@VUi&tt`TvfKTXq5LHEUBW?td z{55(z$?r`#)Ow3ed(?4a5gqX#G!LQi;szn+CQbU*Y-wJSc+XEKkM@N?1<%Ulh3D&$ z75cWi{(?j&h9=;*p?;k+JHs{^=p2zhwnwi~xDkL|xS3DsII@!5NMwN08VpnTjQNIt zS_uXT{Hw>bbxf*C{_X7#Anvc&9Q;!QJ5uA?oXh^>pLqVuusG$7rMAFm&VQes7G@Ar J9MCiAe*ir<>4*RT diff --git a/ExtraTextures/Bestiary/ArmoredDigger_Bestiary.png b/ExtraTextures/Bestiary/ArmoredDigger_Bestiary.png deleted file mode 100644 index e0fb638d677a48a702c73475bbcb26ac759ccf23..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3608 zcme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ures/Bestiary/AstrumDeus_Bestiary.png b/ExtraTextures/Bestiary/AstrumDeus_Bestiary.png deleted file mode 100644 index 58dd541f697546d195ba0eaa7df6cabc70f8333d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9287 zcmV-NB)Hp&P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>DBiu_S!oid+f0t+mTaFIAhd--SyprJKN19Nm`C-*GZBrAcxJtqeJgL zd3Uq^-{X#N)~7$|7n}7npMFBKe!?jyH|xk%S6tq#)4`MEP}0GZWP#Z-2ak?@{BOLl z-CED@KWpaXBAq))<|iFINfww*bMT>#9dqqIt~qdRvrgwul77;`w}?Hjc-v#Xv`;6= zrZTyM%eiB#c%Hno3)<5=}TW|*5ADQo6Wk9?dI%5#C-c_u3A0j_~nr=eXjja-|EhKDl$B+N7-5SSs5qK@gRS37f`XkM{M2bCu z6!<1l6FPJ`ySsTr&R=>@m)Ic%znt_6T*AI&--XTN)6RKKvle&WG|M0F`TYMhYYFzu zz0Ysf@%<9IDu5_xh4Mqu=b!k%z0F#Uaoa`cFhuMgw%>QhtP*_aYxnIq@BJ@rw#QNu ze2RSe$bRrG0AUefXmP%H&R;dl!xvxKEG}+9s9GXa3M?MR3n~sR$?`JT!6ORQpMCN( zo3$Fp;@EM8?&7xnUvAc)z3rA}T_cWslQ3R(=Go0U^7XsF)o#t`>sFJ)*M6VaNF<D0JLB|LwEStah0ld+97PQiTBC0O!J1<&X}(e58YK0bP{{g059YC*5+}s_RGR zr)!M`QEPF!oIhC}20OSMHFkH^uJ%%6T5X_8pEJhq6@5^^jN_MAUmd$~ym-v%J!C}iQ{_ied40*)fqb1Ckm>fmypH=p;1&EuL= zi<)C^B!>kZha5ZR?lH26)Er$-9vv|{ywLkfLiFD_)U`{*V~ITjg7@*iNs@V3b?_JO+1qTq_aClq9*g(B?t*6B=M*ZOwO02S z5e%i4^A9D4xv{lfxxC&NUsq%i#q0a!Gd_||=c-2EIh1>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? diff --git a/ExtraTextures/Bestiary/CosmicGuardian_Bestiary.png b/ExtraTextures/Bestiary/CosmicGuardian_Bestiary.png deleted file mode 100644 index 9f46bc28365a6a9d0981f0b6db433c35bae3c79d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5059 zcmeHL`9BkY`Y?86rnHCUW0L zRIY}W5EZFUpMT@~{k&hV_w#-|&+GO4@_xUbU!GJOE7LPvB3vviEN9G+#F@eM_-T8Z9I{=FBT>tG8$Aa~;ZU8)a` zzRLVnD!kUdwB5Y0-zqoUiQlHV1U18o(l!1nwN?kX)OszTG`alk7VC_UYeD_$^02h{ zFB_b#6Lp<_Pn(7Cg(ewCvFFDo9UCTBN%sC8FGjoveW5cz z=;_$F3;1u$AJ!%OHqDS(!x6xe`5^Paz?|DQRdBpRg7=o6z*@vs0}wM|6>UW^KDIGSmA;t7p;x1xoA8-yr-LG4sh*T;`TX|15_G`&!H-F>5b3cfBI8BBEBF?Kfm0{1sXZsE)qpKEa^s8+1+TrpvPo?9DP?qJXX-S^Wjcx zkDbxd6>{1yA38)JH9!q(mFh8)gt@l1n!V2_CJ`7aBnhB5-ufVZ{+A9)Y{#K#A;F}> zGJrn*7TL4@(YT8EsbTZGo$7h4M$xezXAwOhTDI}A3PsVQAmlel083>>xr_EBs6V|m z{$raUV49()SL2YWH#9o883l`)#Ieil%ECUn5s1{C6`y`a=(~H3 ztO3n8axRjZ=S!HcpV&sFqD!YRe;_L4Hit-3!5uYvO3LTYDalS@H7ZK2k(}O9T;ml0 z%O@_c35BSsi=C!v8H4JMJ+8fst8e`5VjLjPM3!Hr$0xnw!>P!ie09X1JtLf@&&+hk zMKuF4>%k6gj~h6#^F$acW1vY~mEb2&@TOUT_)>-tJZW%sCzj=zwQ{Z$bRH;peOCk4 z;c}Ml@PpO4JppF!C(Y|vZ0(s}#?(+Cr0w((W@d(xy=Q@#cg4?O%^slyfSuJ{aN=KeU``Q4L6pOzX`Qhmykt$ z)-3*cVen3A-G zH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pi>BgF2=?hCwcj0eES#5 zBR`8b@;x!xuncee_7y0rnNa0CVR4vgxp=q8SD8z|SWh+v(zxWN0N`IQO(;C_?c)6s zfbtrU4gTYfKhpdY-!vGgr{>5nJfZ<9-4&z^h2ruxH+)3%XETL8~J}Z z51#ed63TIm@_b+KWE0UoGyV=s0R!vvR?%3?!iBr4r+43UZFPZ4h-Lvij(Ac?ujwOn z-?0*xZMdK$8~QeDDXT4XB~^YKJ%bO&jO;k&+i0v680?Ke-DJ*0TFoca((!&4(8`kq zqUf6gmjfp5J&1T=fAE?C66e>Q!5YU18pF*G+^#0DjJ=X@INfnwDcDQLMU;L?M8^aY@5j;8n?&%1-#zDt z8(g3wdGF`=q(lI{0peQgzu+8u{jgmVM>Uk(oSF6%vd%$hCeQAnvOfb z!mtqTdUI@R%keLY+@PVLkLw?x1GR^-@yu(PY(z%{&|UhxO_Wes*L68QKjVDau|XRq z!KSqwjC5=eUMf&BQsTf#{At6$rIV>(Yhibx;kYuLLpcJXiq&jP^qjPFX!ZR+Q}G%q zekoyAa+wc+0thWuac@A@bFr=J(7svo;$r|0_@xviAGU$M?go_rCr@MSJ(ltkf~ zF?RimEA%IDyyr9_@?mBHgU4Atw7+~Ed|y!d35zh9(S{YjvAgzwHx_dnPF{5(ra_zu z-;Hq+a!Q-^I$R?kG|Iy3g*1onZ{~Pb<4Slz*UmF5c4lA{`RT6RU!8VevjE7aV=;;a z_8JHsak=?&@mL|mr3OceeSI0oIYig=3lW_`+eYZP->H_lxS5BJ)rtsAWO(>sen#)V z1^WA@fQN9o4j)^ze2G6>Tlg0xxv24q6)1#}H)4w7Rkf8nb&*_F)Ft!Qt+mDq1m%fZnK0cX?WlDXg5s*keESCnm;0HsUA6j~TL1l-n3-4^*BE-n{|8WEsHFe^ diff --git a/ExtraTextures/Bestiary/DevourerofGods_Bestiary.png b/ExtraTextures/Bestiary/DevourerofGods_Bestiary.png deleted file mode 100644 index abe0519bc46749ec1c233e6188b1fdeea2076938..0000000000000000000000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k(l13r=e^IbJ2349`pB(R$(^|+?2|ag2lvaQJZlJlPAc0h2KF(&Y8t1)N>1vUA z9b4*s*uLGQ3&xH73kPXAeT{;ZdY3Y|wXX5``NxU{^jt(P@liy!uRQ#|C(_L=c|CL# zC5H#L8enJi+2}f+yZ`N9Az8}%vz|P}>EdA<>Z1fTK3vJx!S?U)soUg2s7XLQ8{UFG zfv@lA4B@n&7KFblV;7ibzzP}l<8m2I5s_gecDC+bBasDk1!{cnF;%XTeB|MlnSyV8WOM%1({N3 zhN;R}2M$`F_6XZMTDyfpKkATJbsBauC0wJ=a1eG?0yhs!)bd%#5k1$6WU!O<0Wqt|GxUK-p1_%k<-@|5;Yv0C*XP#V)onl ztM`AfY&Z*b5yQN1f0W3;M~uP)#Gajlk3}-xePFu?;aJ^#Kq@Q{_c%SoGjdO_$%2!6 z{_bp!$pJuW%2EZ=)*>>TAq7Q`4g=Mp`KO`840C%kqsu-cx75V+ViHGoejB)+S+<$za6lGOqs-(<<{|Bs`1rGoK diff --git a/ExtraTextures/Bestiary/EidolonWyrm_Bestiary.png b/ExtraTextures/Bestiary/EidolonWyrm_Bestiary.png deleted file mode 100644 index fa399c67e74708f98dd61c153863fec2d9ff3e29..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3621 zcmeHJ`#aN*7oX-**xW{$DEc5Xweik1p8FIoL|m)&T|gK&BY!f36}(cKoAG4En%B8 zwk=^Nc-tSM1@7M_kr;x#HK^k4-mlw%=xHmQ6$tbsQ)(kX301QFb5rRRCQJHGTz|CvG+qWMwWXy(b$NW<}ZAE@W)jJ{CC$0||g#<)>ee(3TN zfUAoARJx>LZpp2!9{at;TiWC+An)P4{QLw03&$UQot@p?5c>@RXm|I6&lrje(2cFGR_tAvHs>Y@!2P17O8E1tSFa#|n<<|h-^;--h-BDRge{^u$1-yQY~o*ia`okt5=ZNf>}q_-Xo3XoH?KOe*%tMMxH^hR?NJBMo( zN@2-G3puH_!UqUVyynHi=VYZ@-{kE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~)ev%w`fFgrAw-)rLcMLke;V8^jC{ae{DMoPK*JrU%pJJL!g^jy|!-SiMmwo&4?v0TFPxe*O(7IxZbY^Lz?z<(uaZ&E^z5F)P zi{>{QI#Q?si=JYZT1*2B8aWj8L4W3q*9a4%-(%GnV%v$>2+tGc#(p;^C9g?C%-Y-L z&jQmqS||6xTD$7qsC~TI4!~X>2aOI4P+Ke+j%aX+0LxgIZaB?fHfm~y(f?}NF{ZLB z0<-g{pjlB-vZ=u+!*{YWtlHp4l(D$M$K1C@X~wjvRm+{h>RlaeMFA$in8bX??W}V& zL7H4^(Gy=&J*GV{gV(j36#;~Q7AHbAj^JMyksIyChZK!2Cu8cAao}|FQ=$KHuElZd zO!7DT?+2>u?{8%m>M}0E%kLi7EjC@snpw4&nFB07zp}}|diDu3~L6e4l8!P=nt<53QqQupD`md#K4QGe9RSMEtCD=-k L&c(LE+CTX}q(bk! diff --git a/ExtraTextures/Bestiary/GulperEel_Bestiary.png b/ExtraTextures/Bestiary/GulperEel_Bestiary.png deleted file mode 100644 index 85eab7d9dbe407db82148867cabfe2a3f8ffacc7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3216 zcmeHJ`#aN*7az-QqgW#eq435kX%tB|CdRS}ZF38odq{JQytbgPC{ha4{o!fJs^TT;P=R79`fBKXZL;(TK+lZQWur?nF9P+>BVQ+OxHFUr_d+{5OIBy$O6F6*>s^1VpnteP-+bTR>-) z#nc51O9WezE`mVYoBu+nE$9J7a3iFw%u)6cuKl-CqdwNb=;7dEEB-nsaJkM(VNaGR zIPF=Zl2bM>Z*}+QnLEEm3fiVbu=8%yC}6*I0`&Uqrp^gD9*-xxfY}*X+MBh6VI}Is z4-OX6_>S-F??k05GuT?6Z0;2q|G{snW7VPz^A%?$jFeq!KIW%)FpNcd%>zzgcVG;a z#iVEJQH=^dj>@sXyU)P(IFu9OaIK?q_-QEIuLn5GhF9(AF(b&SVCrpO*soF$*_=mG z@H~!o*uAlNl^36A$DGG`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syTfD9YtXyocsv(6X zgft1OdS%V|z#IarX2e7gs(e8F)_!JrXzO$$ae+9PjyFmzN_u-Pzn}LuUP*+w(9?4V z-(F-mwEsp)H|5xOH`dZg64CE0aBhCegV`hut6HQMZ2DuWj`Z zG`S~PUKavwiXtCZ&L~pH)e)iqT2}jcANwfFT5e4p@oRIMO^e2hFi6+Q1gpTwpNsY8f~@ww0)q!m*A zp{z57$t8`BA$A(v$mr3dSoa|<2+`F~({skf3hFyy+HvJDgt!>A$vpVb5dWsAI=8jJ z4VNi=iAWtfz#z7I%kQIvcJPn@MQd-H;-xRn#^e=IN6|m&gky_lOp_!;M8@s7pzP`| z`Vb=eThnYczJrPH3zLHNQnQMWp3W zE82I<_(d%13kTSW&3)B}M@CPWN?2RUzo;AJKZtwE7-%jvld&}L@bX9OEX>6qC$1<6 z8vG=D^ts@H_IL&5;2Rv@H~*aR;ys0OUMhl;>ZazjJI-TwVR z*^|b`IyUP>2^kkBoXwPNRfaEBROgA(6Vwr0v-he83JvjVuQ(Jdu#YzDy4K#z8e$^S{{|}sU!gAnWuqb5;Uy#iJ0=#)!f{8W3`C}|@nE^77h0mz zG*4eAlYm?}gwilOoQAh^(BBDp69ch~uIwo|xdndTyr_z);}87(2dyxt&CAi};{OHw CU=ykU diff --git a/ExtraTextures/Bestiary/Oarfish_Bestiary.png b/ExtraTextures/Bestiary/Oarfish_Bestiary.png deleted file mode 100644 index acc08a6575cb23cec83c76761e39771faf5ddf5e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2239 zcmeAS@N?(olHy`uVBq!ia0vp^i-0(qgBeI3-?;7vkYX$ja(7}_cTVOdki(Mh=B*-uL|HuXm!Qa_cfsxEv;1OBOz`%DHgc*IvldRx`*+cW$^OU`vm~Z> zKbUsZCw>3^{^uFh-xSm?h1G&9DA5C>HZ_J<*O9FP^3MjQfhEOP%oknh7V| zjvi&67ZN7C{YS?%6G8py+_pC7a+TU7bl(e>SJb$8XLY)>Y?{NERPQ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!#49&#Vw%Xf{!IBhx*wWvFkSsLIMe8tI0KJ3o(@4;aHa!$*0q#x+@ zca3610WzUXXkkNi z+d+);VTAmg&Hm1JDV|a|+}QojY{6V8rBSFoEFJ2CElk>^N82-_;uPNiHG5C0tMJcF z_~&^O1hr6S^R`SfilJy=>!77w9(T1|0Q^IoKVP|9g5qL9E013R*;l8NJH8}9r1QGH zBTC(lV?cvY%JewC8zZ)t#ch`-wiUyS643G|7AHT50)sBH!a`Mv2p!#yLjw-?EstrQ z+ZZSASQJWcSu|jAGYpnX;nZUHWF-B&cfj;dAxyQgyzz%^r;Cxo>L%q4D`4za$33L$3{9 z{gTTEpX>|DN9$bP_hdU*3aQ%mh5)@8XOiW=N#GnqGs>M7N6*-Jyaw>w(vJ6j>_EmR zMM`n|4MRv>s}qQQrXzmG~wF%AtL81!mJ(s+RIwfEG6`vEh; za2noWy78Op42X5O{h=3G&M6Tm+*j191LHwhhA}we00Rnzf>V*Ns`83Qz$h=&2$RgD zuEh$1l#%cPNeT+K3oc&FC{0Ei$z}Ancme$wSNcG((N)U3s6>>)2P$-M^U@90uHh$5 zcZk2gbit-}x#xMI2@bdM5%~Piq!`GE%N}F8blX!~X0)bA^R{O!sid1%(1Q!4WZ(G5 zfNQqm!EtQC&>jvX_nXCRBzkOi=f(#PG%IqTp%$;g>E5&WyWv|;cd5M^=jHQMdTkCP zv|Xb4P9)gI&QDjfbb0>4^-C+NQkXWIBy98X=wa7-fEEz$SK|HCPKdp%@1@MH57>tF zFfT*8s`$eAU+!)A@cP>D_=L!r`R)YxrvnY*6Y*7P&JIy>C1N@EiuZ#oy0d@1FXftY YYv@Z(Cf7sN|NT8{sp(_t(T^kl2P@q2YXATM diff --git a/ExtraTextures/Bestiary/PerforatorMedium_Bestiary.png b/ExtraTextures/Bestiary/PerforatorMedium_Bestiary.png deleted file mode 100644 index 4598f54e7a6c90a651c5c6440b50e34de28edae4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7062 zc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A z`ck?)rD$4ZK7KO=o|hrmv!Ke}5W5sCst$@OFfqki3!AebP`UM*v<6Npie^M9&@G|T z50vy5S_EiCZ-W9(3ascT4eX+o{nl8)Rj7!pSSeZByF?zP7yWExie0{n9uO94Q^YyC zBva~NydP=km(I>?5U=kIzVD8w^xNK>(GmU&t^z5r9y1nfvm^WyCO6e01M3_J zw?FzKGG&+>Qh`(gE+B&*l-vgJCGY-{(TO-Ne&sx TWo?}J?*qxy$ilEuADi$WqY?Zh diff --git a/ExtraTextures/Bestiary/PrimordialWyrm_Bestiary.png b/ExtraTextures/Bestiary/PrimordialWyrm_Bestiary.png deleted file mode 100644 index 4adc7140e5a7b8463cb22605eeee8262d9f8a40f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13865 zcmeIZg;N~77cRW`;)^@%0tE^bcM7cF?!_tY#ibNy7k77u;ts`1VR5Ip7A>VkinTAa z$k*S@_fOop_snE6d6JW4&Pg(Pk~y*3no7h3^aKC^fLKLYUKaqsfd5O(K&*erxZEl0 zzYN1$R|yVioMrs}uYm0U(|`d0Ey;xURyY6v7C>8FU*R84Nk+%a_>A|31V6o+AZHLl zS?9HjhqQ9Fa`cS()V1&3T@f6oLIZQu2XIt|_cQ}|`YQAEl>Sfg|H=Qe!2jtMSZ{f3 z`?pU3KDwHEPycrdK<_`iXaD?(@1bn$4FHe~{V!pRxmVi)0D@I2@-Y1Xi?c#Po7z5d z1$R@oj-S7uo>sqn{9ObzVNnh)&?@xi2BirYPus$w_d9dIZd2uFW*rIe0GqXJLEz8x zs>NJesgK!aGNTM=xv9s0h<)2w(aV=+lK(&8(Dwd4-h}Pdg@^xt7xMxZFUEt(tRuyd zYOQkU_wWDyov@W69vHx~HT~36IvWDCiR>lw)5YO8{;d=cDpx2gr^Vs#Piziu95ebK z2+J{giEZ`4f?ch)Y%1-6Oq1jK&WB)NObK)9Vpgk zAygZOA}d<&nlnNiIpyWA^n^DsVGDvA+g!AK`{gTC6UV3XTWP!*H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VK96hlq)Zbz&t%@vn7IZ93OgTRO30M( zxxnXv!R3|ewJOBF!9 VyM}hL^M7GEDhitNjqukI{~z~mO%MP8 diff --git a/ExtraTextures/Bestiary/StormWeaver_Bestiary.png b/ExtraTextures/Bestiary/StormWeaver_Bestiary.png deleted file mode 100644 index 05e198b74b5ab52e878fc612de073c1bfc1be5b1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5899 zcmeHL`8(8s^I!K(mfT0~n_cT#N32}SS~rPUmKBm?k+yQDh~&x}>t@{~S90V&*DC8s zmm{r^%2|9=-#&lF_xXP3d0sQm%=64V^UUj+`C(G+(Ux57BJ3a#hzn_D=J?Oj{$ZY# z;h%oV+@kT%(BT~|O+n2Rv8{g&V*tVy0RpvVa-8`vfj|r(dz7>Jzc?pYOjF57QVaoA zHaCR18XJ4Niko;kMQIx(8hRuKUnWN1$aha2$9BC>k+H}(&3=z7e39GUwzafHY8;rH z{#W7u<^Lz}zjOlk?!O-Rw6Dudc2gc+Do^3=gfDNx;w-_+G1f9H)%a zWp-Qz;cp7oviCDZAn(~7D)>6yT?J@a^lXp`@n?n;#=I~l?t3Uq;)2O@{E)$Qe|W_4 zDHSq4#gNW#E+Y$w$3-!HB-~XiPMhT0`QdaZ1sH}304AhoR*8w-JgEk8UCk}a%yXQU zQj0q?v}r7Rgai=&Mz7(L0&_AE109Pl2zvc7f?0x2fH%2V(C*k+3u}SRTKZ+qbT;`|C zGD8tw0AmFD0`NuNpswUBoS=Xb9AUh!lbIQEdP6mio3_^lj?>8UazyF3G_Uu{On=+M z!RTgeWBzKVXE=$sBd(&o@6m;PL_HEr>Jv zEptQxAX5*tqYssm7kSA?rzgUVn*p8zU9zoQ+M~lr8S4wa_PtMTzkT4%g3mS{G^@X^ z(63*3IFEi0KU9`~JUc5J+G9&+mR<9>7E)!RgS%>OGODY1TQZ!1PO_p6ON!3emj1kj zkuDB;hvkXyj9PKBgz#EUhUD$1vU1U9+&?08L^PE9T3T(ePuOj!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?W4-N#ZZ$s$9<>mk{r~L)Unqq+yoz}J66^d(7`R!V$ z(0|m&37qKz0=p8BvDY`D=qFd=3tqiIoPvSA`E?GTY`!G-oJ9ltfsEoP^^MRA48;kP z7(e}uGQ*J1B)7URr4HcT3YqlefUh+w=fi!cqF%8Q28l)VsX~OBL6#sK?I!eg__=Yq ze_1wM1#n9ESfOw(zbTO^-66+^E4SUt8?sr=nS8-hhtG$u>4;@G2y8lT4lDD5Y}WU& z1+%THwmoqAR3(Fp93)m=d%-ZtYcF$+C#ia3(7i^b?_bN#GhrfpRg?P+!Je?T9{TM> zxTU|fs^xAwhQ5^MZ4hFj0pMM+%;52AP{n1DrEIM)O!#jV1CtU~5Qd_uq%jHGq}L%D zfQ|hpX-L~x1-*Ps69>(apZp>4-QBB@d>PMQLK~8aCkLB<=`g^ItdUgF&;R}#k>+T# JW>ZY!{{Xs9EOY<> diff --git a/ExtraTextures/Bestiary/Thanatos_Bestiary.png b/ExtraTextures/Bestiary/Thanatos_Bestiary.png deleted file mode 100644 index 63f8dc97a9e0d965101f656e8ba96695ce240e9e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8247 zcmeI1hcg^p)bI(BL=U2OtG5s(Y91x*uCjVB(PK%75-cH!UZU)>O0=-LSS`A!!CEC& z7bI9^mFT^_dH;-WzW2=Ba_-E%Gxywk&YU^FSOa}+DsonGA|fIx5Kz;Ih=>^UZ=Qdj zD_TRHhwO(+KW+^UMrpxmn4xn) z$F2Z}fM6ZN`YDgimx(Ql9WJsw$h7%VDzG;DHG>t`vntJ6*Bt9afXm_ z#GhnJxE%kQm%ke1IETWWX?hH8>BTxif&yn=_kZk8KJfBNA9SwI(#CV2eKl(om?f$c z0~Fa)9Vmh>7#;juSs6Xy-`@V{Fo5gZmH)+O=f?T`t^8%(*G$o+0ktpDN98lLFU$9zuAuslw;bvYj1tq!p{kmwupW6xX z(pb-5$NoF>7dP4^X6>~R?fg~#SUAs&sCb@ zf6~W=N7pwbt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RS1B8RcJOC*C=27bY7}_)w(QNe17n2gtfo~;nhbQMzJpwnC~=y!KWy? zb)D%t`w@Sjnz7%1a89AdU$c@rh`_96;w#4)Zhrj}pPUUS2wIqPb$p!ct{6U(7DAEx zHV8?U`d<-CL=fxGXNmX`FDYf-LuR=wylwOB{1%OM@Ggt6y+pw$qtkJD!+QI5NW~7k{aq# z@?h`-e!0M0-{-V3l@l4jhwgbk!1aWDrRxGaERh=?u(PqskIq0@T;MB5-mt_iJt};! zTp1W-JjKrWk~8D&FhF=$Gnv*|Cn^%Z6GU3H5Tc!z7)&=DIOIPJ=&8+u0GTOkYksc0 z3!vJikf%xy&kCZh7T;;25dmX1^)>UJ)k}t=bPytAEVl$x*cPg02}vBz3ObE8jX!=3 z9I^8zi{+72Mr)tj0m)a1&9?iGvu@Yc{KXb2K>u-+oAPa4J(G6{O!=pJn|j!@{<=Bi zNu3N!S){@grjf74{q8khU?N;6D@%L{`MWEV^$(-b{rX2R8ppQ&yWvq7+mc)5f*ZGI e_l@S=-Xo~2(5SS{F8?o&1wGf-tWtmR@qYk;BL=Ym diff --git a/NPCs/Abyss/EidolonWyrmHead.cs b/NPCs/Abyss/EidolonWyrmHead.cs index 87e85a233e..2f16beb288 100644 --- a/NPCs/Abyss/EidolonWyrmHead.cs +++ b/NPCs/Abyss/EidolonWyrmHead.cs @@ -41,7 +41,6 @@ namespace CalamityMod.NPCs.Abyss { NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { - CustomTexturePath = "CalamityMod/ExtraTextures/Bestiary/EidolonWyrm_Bestiary", PortraitPositionXOverride = 40 }; value.Position.X += 40; @@ -419,8 +418,19 @@ namespace CalamityMod.NPCs.Abyss return null; } + public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) + { + if (NPC.IsABestiaryIconDummy) + { + return CalamityUtils.DrawAnimatedBestiaryWorm(spriteBatch, NPC, drawColor, TextureAssets.Npc[Type].Value, TextureAssets.Npc[ModContent.NPCType()].Value, TextureAssets.Npc[ModContent.NPCType()].Value, 2, 26, 0.6f, new Vector2(70, 30), 2, 20); + } + return true; + } + public override void PostDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { + if (NPC.IsABestiaryIconDummy) + return; SpriteEffects spriteEffects = SpriteEffects.None; if (NPC.spriteDirection == 1) { diff --git a/NPCs/Abyss/GulperEelBody.cs b/NPCs/Abyss/GulperEelBody.cs index 29a0c69184..f5b5530c64 100644 --- a/NPCs/Abyss/GulperEelBody.cs +++ b/NPCs/Abyss/GulperEelBody.cs @@ -133,9 +133,9 @@ namespace CalamityMod.NPCs.Abyss NPC.position.Y = NPC.position.Y + targetYDirection; if (targetXDirection < 0f) - NPC.spriteDirection = 1; - else if (targetXDirection > 0f) NPC.spriteDirection = -1; + else if (targetXDirection > 0f) + NPC.spriteDirection = 1; } } diff --git a/NPCs/Abyss/GulperEelBody.png b/NPCs/Abyss/GulperEelBody.png index fb79dc639f6e2236d22bb6e642afd23b1c67e9b7..5d161785195b5288a1648b023e21b4f0481daa59 100644 GIT binary patch delta 427 zcmZo<+r>OVvYwfNfg#}z=T;!aSRCZ;#IWw1%u67LCEd~2k%3`jKlh(RRv=$4z$e6& zgM&j})>ueLQbW()#yQ44Hv8vh>3Nl5@wNRxC6UbQ8G#g6NswRge;8ocbVlbqP?WR4 zBeIx*f$uN~Gak=hkpi@k-?QGuF~q}r?NrBU%?bjnt^tq#>f3~zlAE(9=h!oS4yVvK z;R8D9=QmB+^zBOYE#1DH+q=rlRHr(84Ciw;!#uU)zzwM8S#Re8TC*U@;l{cfyDX&khhJIJqOo}E;^(IyDsw6(7{zz2WnQpX-%6jM z+J+^gQ`zP@OLx+wmxYZlv}>kJ5z$dxC!nibc~F(z;gP9xXEDqF9Sm(|!5^l|H?6O3 z)erwNk>TB@)->+tl1yu(-PfHg-_+E_?xONT-_BVj5wo^z?s_Ggf&arLBUx_Bj!%e7E%@Xuin5 z1FjoZ>3VGofZ6gn0A4+LotVG&{C?uvI+WEBt@*4J*8$faaFKOy2-liFJZb=^qfe=H zHUbz7I*Iwkb$>vd?19!+V*J*#tBLyym9Q_?UXl}1-i4G`{1?S{KuEEt>x%$vRQFTo z%`II3;Hc3C!t=rZC?w@vNclgViLLU!=p%~ffL+5`QD#IP!D(ccA%sd!+IfDGPl7Uc8+K zey@Ewvr!G}4=hsN75_#49r#-h9=9hBW%3;GRijyJsn8n9MR6REVp34JYMOCzW!%Zl z#QMc5Z+{70tFCh*SM8Iv1G5yz0b!$uuZ~wI<~tkBimwB+6wd+e1-+rMN918o4lHTD3QisJvZG(9s+dywq|^j1^& z&VPD8+Yvzf`)+(aDVaFRI`Q7xBRiDpgwWczomYwjiN9f|zG?4|WO5u3DNcwX_@mCC m+m8T_d;P?CsPZEB4*UYD@-7NwD0000 0f) NPC.spriteDirection = -1; + else if (targetXDirection > 0f) + NPC.spriteDirection = 1; } } diff --git a/NPCs/Abyss/GulperEelBodyAlt.png b/NPCs/Abyss/GulperEelBodyAlt.png index b913ecfe7279789495a152de44c2915d1b13ac62..f7788755bcfc7f211a0b06023f37a6b6304659f4 100644 GIT binary patch delta 410 zcmaFPx{`T|6dMN<>S090Z4I|1o;L3hXV#Lf5uNh zVa@`N$YKTtzQZ8Qcszea3PU{u!!J)4#}E(ity8-BniT|CTpgzT|Np>9M?5D_-MPXz6_>{4wtV>aphw?%zL-wm1@~$7`_?71 zM&J1`XG89tD|TP{b$@MFXm!wf)5 z5TDjuu{8n#j0>k%I|*?7k<%8q@;ZV)Z;AkSkcetV_xpnGd15P68k0@A9=FW#ec<5{ xy(MW-N-$xFg=Mu>Vj&(21X{r-Vgx=RW%6$^;A@22WQ%mvv4FO#nJ=qcs2k delta 730 zcmV<00ww*a1Lp;h8Gi-<00374`G)`i00DDSM?wIu&K&6g00N;&L_t(&f$f=3YZE~j z#(&#NQR5#{47CNdpf?L%)Pi`ay$JOnUKJ010uSOh@aDl!kdNR=kD><)66v8}sfa>j zG$Ii~)HX3K#6$X+&fA^rM%F*s91G6hmQMPS<%-3pwVb_{T(q9>#qNpV0?Vi zQC_T2*NZIUr@FypU7* zLiaq8H0gIh*oe&-(2`z(&vB_jN-}drvS`9m<#Q?^&Nl~!nbd^J?k^uGhS zcP$jJmP(4jb3n>RRil54^f;i}MYW9ZWmKQ?araP@B0UaR6ar> z@!wXX!+-UFZLoE`|9rr8K*&kou7qW{92tt`Z#^J7yVC7B6t%mZ z6zOw7yAr-#1*@o(w&wvpl8XN#eGWtsRpaeQ^>9Q zCIFSSA^;`a{vGU M07*qoM6N<$g4QEko&W#< diff --git a/NPCs/Abyss/GulperEelBodyAltGlow.png b/NPCs/Abyss/GulperEelBodyAltGlow.png index 363279be795b5db6425091abc287372f5c9f324d..f12ca359454b9afb9747b473c8e77e43cef27dbb 100644 GIT binary patch delta 228 zcmbQv{FQNnWIZzj14F_c&aFU-u{g-xiDBJ2nU_EgOS+@4BLl<6e(pbstUx|bfKQ0) zyvnejo2CE%Uk((g=)SuEq^=~$FZloe{|pXVE588woCO|{#S9F5he4R}c>anMpkR`x zi(`m~_uDIuTn7|*Tmp~Z`G0Pz6xZAo;aG`J9eBVukg} z3^gCVH2h{XSJw~a-SFw7C-I`70X#8|1!kSmOEm{en#)d X1F6ivOZs_%)-iax`njxgN@xNAs#;f7 delta 392 zcmV;30eAlO0ha@i8Gi-<00374`G)`i00DDSM?wIu&K&6g00B`+L_t(&f$f<)PQ)+} zKwkiXv@InHB^?}q?Wv$eLUf#gW=}xF8TJ6QY(>unpreC`j)n?>ghDlfH4DNX_XeUz>-BPDVg1^{qq;FExHq8bKu<6y zSm543@;pG{Z1WTD4OFa2{*GlnSl-&3tCw=q94VUhcihK-CJO=Zes|RatnQynxvqs` zP#X~5W~adSn1A?h+#ATY8VxD6I(2VA69aR5-?|@2Bzp{$HsRhtju;S3_6P0_)DBpq z&O-N3>i|5zjDXJ*x>ElaxHk};g~B{Pos8wO=&7_YJOjT_=YbT|rxGD`Efh(P4w#-& myEl*{3z?o$yEjm=<^%JiKN7qf*@FN8002ovPDHLkU;%V&0pbFX8Gi-<00374`G)`i00DDSM?wIu&K&6g00A6HL_t(&f$f<+4uUWk zhTj?!!^Glds+*hK#MNDI;R(Ej2XOT!cmo`_e>Dd(DtF z2-5-2>!SDhYA$s6DW#K!mxlz&PB0P?IB0I-@r98bv% zdIoN4*+d@!0PFq5>4Z$7X8>Bf@5;=fGIH_;MrY3t1Ff^c1_m;w7SiEb$Oh-Tc0TS} z_lJ|;JdwNs<1?V|aKn$CZbcAkS*|v$24lfkLY0lK;@SfEN&( kF&)`o^aaTqU>NGW0e_GyqYwM=Bme*a07*qoM6N<$f@I{FA^-pY diff --git a/NPCs/Abyss/GulperEelHead.cs b/NPCs/Abyss/GulperEelHead.cs index 161506e481..731eb900cf 100644 --- a/NPCs/Abyss/GulperEelHead.cs +++ b/NPCs/Abyss/GulperEelHead.cs @@ -33,7 +33,6 @@ namespace CalamityMod.NPCs.Abyss NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { Scale = 0.75f, - CustomTexturePath = "CalamityMod/ExtraTextures/Bestiary/GulperEel_Bestiary", PortraitPositionXOverride = 40, PortraitPositionYOverride = 20 }; @@ -157,9 +156,9 @@ namespace CalamityMod.NPCs.Abyss } if (NPC.velocity.X < 0f) - NPC.spriteDirection = 1; - else if (NPC.velocity.X > 0f) NPC.spriteDirection = -1; + else if (NPC.velocity.X > 0f) + NPC.spriteDirection = 1; if (Main.player[NPC.target].dead) NPC.TargetClosest(false); @@ -339,8 +338,20 @@ namespace CalamityMod.NPCs.Abyss return null; } + public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) + { + if (NPC.IsABestiaryIconDummy) + { + Texture2D mainBody = TextureAssets.Npc[ModContent.NPCType()].Value; + return CalamityUtils.DrawAnimatedBestiaryWorm(spriteBatch, NPC, drawColor, TextureAssets.Npc[Type].Value, [TextureAssets.Npc[ModContent.NPCType()].Value, mainBody, mainBody], 3, 26, 0.4f, new Vector2(0, 20), 3, 10); + } + return true; + } + public override void PostDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { + if (NPC.IsABestiaryIconDummy) + return; SpriteEffects spriteEffects = SpriteEffects.None; if (NPC.spriteDirection == 1) { diff --git a/NPCs/Abyss/GulperEelHead.png b/NPCs/Abyss/GulperEelHead.png index b840a7904d3960af986dd11f6e26d40466648f8e..9b4a5926eb0c2aaa7c76cd13fb5e485e95634c13 100644 GIT binary patch delta 599 zcmV-d0;v7<3grZl8Gi!+008s3MEL*!00DDSM?wIu&K&6g000DMK}|sb0I`n?{9y$E z001XYOjJb@5*a*0Tpt}XC@wz;2nhMJ8+l$&u$p*BU29)`kDhr}|No}|002C3&;tMf z01b3fPE-H?|NsC0|NsC0|Nj6z=pu#y000SaNLh0L01m?d0Dlg{0mpBsWB>pGu1Q2e zR9Hu~my520AP__m@YVMJzxQ$&Hrm+crm#-ZMR86uOHtGC`l3+PPEPU!rlKq23&eOu zya4Q}$`i;%?XUqMT#A({fsGtoSNoYh{80+!{717Q1APm$TTZ4^)lYr1;gS{?<= zR1b<|OKB?-bSI$d1EjPRadZd3?P-x@M;KK-03w_LW`FkG6F{_lUeq(d*EN3^phvFk zGTCxY)8oN725^a>krGUTNMbj(hC3p002ovPDHLkV1oE!{m%dZ delta 1389 zcmV-z1(N#Z1oaA#8Gi-<006{iw95bh00DDSM?wIu&K&6g00l2eL_t(&f$f_?XdG1- z$A6o;X|hQ*2}x{2Y71(hDg;q0s0Ss82Wt_Lwn(AUiwB|TL8*vGQM6zLJ@jC(;3ZM4 zXnXKbtOwCnr7hT|1jR~1+H`9YO?I0!lJzk8cQaq+&Fm)I!hg=>cbVO{Z)TS7|Gn>f z?|U;TmPt#?1^{ktY6sxo$;$;t*A&3`_{HVkDwLWVa@Cv2E#;ozviv>w_xSpqJ9TWu zf36ggr+~1QA08S6U}M)7U%yOalka<_$3oRBkSevKd_TRm9)P*os|A4e&aS}zt!*0t z-&hEYMs;;{p?~+CnVAXwz3LSxdknZNe|cnxpmtGL-{>6|EFNH4UmnRcwk&wZxT`-9 z0|m++11wldmX_r$HZT10!xw?~tf}#wV1E9;0>I|3hXJ@SbOIrHwIouQA_zG{t5_J29^>oAGXNyLg!88Mt%M2oBj83jfLbWuu^VsyBB~D z-+B^&U4Q#}eZRl7Z7To=kDTZHJtJbw^=0Yhx663#JTqmT7Hu_U8Lv{#z=Dj?*$ z!xMuQxna503*qvB_$#ndtc6`GH|33IUVa^bZ$5r6@OrAqrPG<1?Gr2h>p9Q-^rWw& z>)C~4uY3o<_JL=Y^#_(4rRL`HK%5j1`RU2fDzv5hO>f@6sk@SYtB5Q5q|+H7j(-XW z`Q~3|e!FRZ29`#nyOP2J&RMs+1&qfv5pDSur%FKV}QB$wsw8y!&!luCRRu$I%D#9H{w+g|4E z=?$+=YlmI9*38!T#p5sT29}P6_$bhE_m&jE$ly5un%ma{Fp<3kKwIY>>gs#)R(z5gwY){qM^wK8darBzMEDzakM-=@(oO5}516iKJoddJ$j6)7V0_L8uQ^uPaxJ|ykBN2000000NkvXXu0mjfZG5|o diff --git a/NPCs/Abyss/GulperEelHeadGlow.png b/NPCs/Abyss/GulperEelHeadGlow.png index f7d7b57f39bdf1012d254451d3e3a184734c6fc8..bd708820e280d49175e55561e4fa22b649713b91 100644 GIT binary patch delta 221 zcmbQw^p0_YWIZzj1HNS%G|>0G|-o zpPQxURfhflzZ@v=Yd7-?kh+o}zu^D>|1&sft^5Mya~60+7BevL9R^{>4{A0DIdCpu z31HG-oWkJs*WnLCXmf;pg8%QGtC^Gc6rcNlU~Qd3ZB3>CvxaKpZ>Gj5y|;ly`p!Um O7(8A5T-G@yGywofu}uH~ delta 271 zcmV+q0r39r0iObp8Gi-<006{iw95bh00DDSM?wIu&K&6g007xZL_t(&f$iF{4Z<)K zgy9Q8Fa&)@Nd-%=1ryLP0|U@d&@l=KZ!rUnWUb8PPQ2T)}A$QG5ab000000Dk}g0000WrNRA%UQ5N3 zs-@x--<62*0G-}lq2!8BAVyy(OHatLm%z8(Cl`AO^msc@-L#b??Kd}X(0Y3aSmHO+ z2}qJ=%bg_YaXEk9@_M9Wv73PV=G~jGoA!0*=!PWuKNOz;r_tOvjpoK_6aZ{{0yhpF VpN!`>GXMYp00>D%PDHLkV1g(ralZfn diff --git a/NPCs/Abyss/GulperEelTail.cs b/NPCs/Abyss/GulperEelTail.cs index e06996e52c..b19d2c37e4 100644 --- a/NPCs/Abyss/GulperEelTail.cs +++ b/NPCs/Abyss/GulperEelTail.cs @@ -133,9 +133,9 @@ namespace CalamityMod.NPCs.Abyss NPC.position.Y = NPC.position.Y + targetYDirection; if (targetXDirection < 0f) - NPC.spriteDirection = 1; - else if (targetXDirection > 0f) NPC.spriteDirection = -1; + else if (targetXDirection > 0f) + NPC.spriteDirection = 1; } } diff --git a/NPCs/Abyss/GulperEelTail.png b/NPCs/Abyss/GulperEelTail.png index acade0c0a0f7d27bc6ee9b87f740ef6464e374c0..bda0f5f11cff251edb1257e22b4c6f5ee751c163 100644 GIT binary patch delta 360 zcmcc2`h#hLWIZzj1H-n~S1W)NV{wqX6T`Z5GB1G~mUKs7M+SzC{oH>NS%G}%0G|+7 z4h{}^Sz`@7dmHB%_tbJ@Pnz%Z x>}2@S@Z(|+lYsoH{VzJ1tu7S*&EBxi-#*ONbkiK)UqJ6Mc)I$ztaD0e0sv0sk8%J2 delta 710 zcmV;%0y+Ko0@DSM8Gi-<004no8kztA00DDSM?wIu&K&6g00NCkL_t(&f$f<;Z__{+ zho3`)DrrJPloV0514|{?7+^;okr3h|@Co<|tW10YCKeE4>sT?d01`stk5maEl&C08 zl(aNW10Bp@UL0S1Ij6P@w(~5F+jE-U)A#q@omH)Ni9a|1*MD!_1>kUJAArS`B>=v? z{{TR}vBosIoo3+okNShD_q978<)s1`jYd<)3ui)&`j0tl8z3fZh$%53rsTSKp$tr# zI5^x1`B8((j)6+8t^nR_z6h)Zovr&Xeb=|2-2v=1qElI10bn@n&vc)VegnPU_gLP@ zlv*|vp8*}yenGE+xI3_rUjt#+Ncuh?t`01u-oX41_}4^EA;FYJNu`f4HxM?B z;!YnSKL%`TpHjIBz;Lh^?Gw#NehiG^j9-+O8VX>r-wAxCmNdCE0C*>JvLid~nHTbF zKoAqACp1ZudIQQn#6|kRLeYIL@bhRe^?(2Et3T%eG*&MwfKKZxFz>_@gf<|EiSyNE s0DkQ4Izi(~6?b*oZ6`DHLh23t2Cf(%jZaE`^#A|>07*qoM6N<$f?0Y-UjP6A diff --git a/NPCs/Abyss/GulperEelTailGlow.png b/NPCs/Abyss/GulperEelTailGlow.png index b07de25a2df6b79ebcd998a89ab1cfd606edd83d..3ef3b136e787d73e88dd4e6231f3d4312badcafe 100644 GIT binary patch delta 204 zcmeBRy3060vYwfNfni(gs}(?su{g-xiDBJ2nU_EgOS+@4BLl<6e(pbstUx|zfKQ0) z&&|^FD#L)hopB0HK#I8}$S?T+e}?O)c!6peI14-?iy0XB4ude`@%$AjKtVrG7sn6} z@3-d+xfm39oC9zFmXB(EaKXyuM9`brn_O#7d~pBTv@yYHufk=vkLQ;0ni=z4V4rBV yf%WqWu{#;fH6F5eN)EhexX8Ge`B;17ZPC=9^3^qn!(f6&t;ucLK6V#d`d?E delta 247 zcmVCL_t(&f$i4M4T3Nn z#qozRaR`GO-~!Iz)dAeX3EaY)7q0H$0&XC22v2%yL_!Sh4_h0*p9?gEKkXwAB&1dN zo^U_SKOUd0Z@~`}ViNUkUobVC`{<0l(;P$g2{3`wMsFb}R&X0-pMZA@9nY(`aaCR= zNz1ZvtrWG5{x5-+?uzpr2w_Q}kfckqP<#7Q8!kOu_6Y>Pw};)v?e_i?ZTBQF2op%n x(n3y>{&%uZz`S}rZA1$J000000002++nzKc8HjYO@jL(k002ovPDHLkV1l48W(WWP diff --git a/NPCs/Abyss/OarfishHead.cs b/NPCs/Abyss/OarfishHead.cs index 4dcae8c4f4..20a9467a9b 100644 --- a/NPCs/Abyss/OarfishHead.cs +++ b/NPCs/Abyss/OarfishHead.cs @@ -5,7 +5,9 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent; using Terraria.GameContent.Bestiary; using Terraria.ID; using Terraria.ModLoader; @@ -28,7 +30,6 @@ namespace CalamityMod.NPCs.Abyss { NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { - CustomTexturePath = "CalamityMod/ExtraTextures/Bestiary/Oarfish_Bestiary", PortraitPositionYOverride = 20 }; value.Position.X += 20; @@ -365,5 +366,14 @@ namespace CalamityMod.NPCs.Abyss if (hurtInfo.Damage > 0) target.AddBuff(ModContent.BuffType(), 90); } + + public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) + { + if (NPC.IsABestiaryIconDummy) + { + return CalamityUtils.DrawAnimatedBestiaryWorm(spriteBatch, NPC, drawColor, TextureAssets.Npc[Type].Value, TextureAssets.Npc[ModContent.NPCType()].Value, 11, 10, 0.6f, Vector2.Zero, 3, 10); + } + return true; + } } } diff --git a/NPCs/AquaticScourge/AquaticScourgeHead.cs b/NPCs/AquaticScourge/AquaticScourgeHead.cs index a711c22a36..49ef5b1e5c 100644 --- a/NPCs/AquaticScourge/AquaticScourgeHead.cs +++ b/NPCs/AquaticScourge/AquaticScourgeHead.cs @@ -16,6 +16,7 @@ using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; +using CalamityMod.NPCs.Abyss; using CalamityMod.NPCs.AcidRain; using CalamityMod.NPCs.CalamityAIs.CalamityBossAIs; using CalamityMod.NPCs.TownNPCs; @@ -42,8 +43,7 @@ namespace CalamityMod.NPCs.AquaticScourge NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { Scale = 0.6f, - PortraitScale = 0.6f, - CustomTexturePath = "CalamityMod/ExtraTextures/Bestiary/AquaticScourge_Bestiary" + PortraitScale = 0.6f }; value.Position.X += 40f; value.Position.Y += 20f; @@ -135,6 +135,11 @@ namespace CalamityMod.NPCs.AquaticScourge public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { + if (NPC.IsABestiaryIconDummy) + { + return CalamityUtils.DrawAnimatedBestiaryWorm(spriteBatch, NPC, drawColor, TextureAssets.Npc[Type].Value, TextureAssets.Npc[ModContent.NPCType()].Value, TextureAssets.Npc[ModContent.NPCType()].Value, 10, 12, 0.6f, new Vector2(20, 30), 3, 10); + } + SpriteEffects spriteEffects = SpriteEffects.None; if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; diff --git a/NPCs/AstrumDeus/AstrumDeusHead.cs b/NPCs/AstrumDeus/AstrumDeusHead.cs index c69395c57b..ed832e6006 100644 --- a/NPCs/AstrumDeus/AstrumDeusHead.cs +++ b/NPCs/AstrumDeus/AstrumDeusHead.cs @@ -17,6 +17,7 @@ using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; +using CalamityMod.NPCs.Abyss; using CalamityMod.NPCs.CalamityAIs.CalamityBossAIs; using CalamityMod.UI.VanillaBossBars; using CalamityMod.World; @@ -57,8 +58,7 @@ namespace CalamityMod.NPCs.AstrumDeus NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { Scale = 0.70f, - PortraitScale = 0.75f, - CustomTexturePath = "CalamityMod/ExtraTextures/Bestiary/AstrumDeus_Bestiary" + PortraitScale = 0.75f }; value.Position.X += 55f; value.Position.Y += 23f; @@ -157,7 +157,10 @@ namespace CalamityMod.NPCs.AstrumDeus public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { if (NPC.IsABestiaryIconDummy) + { NPC.Opacity = 1f; + return CalamityUtils.DrawAnimatedBestiaryWorm(spriteBatch, NPC, drawColor, TextureAssets.Npc[Type].Value, TextureAssets.Npc[ModContent.NPCType()].Value, AstrumDeusBody.AltTexture.Value, 7, 26, 0.3f, new Vector2(0, 10), 5, 10, 4); + } SpriteEffects spriteEffects = SpriteEffects.None; if (NPC.spriteDirection == 1) diff --git a/NPCs/DevourerofGods/CosmicGuardianHead.cs b/NPCs/DevourerofGods/CosmicGuardianHead.cs index 661f9761eb..bc2501a11f 100644 --- a/NPCs/DevourerofGods/CosmicGuardianHead.cs +++ b/NPCs/DevourerofGods/CosmicGuardianHead.cs @@ -33,7 +33,6 @@ namespace CalamityMod.NPCs.DevourerofGods { Scale = 0.75f, PortraitScale = 0.75f, - CustomTexturePath = "CalamityMod/ExtraTextures/Bestiary/CosmicGuardian_Bestiary", PortraitPositionXOverride = 40, PortraitPositionYOverride = 40 }; @@ -365,6 +364,12 @@ namespace CalamityMod.NPCs.DevourerofGods Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / 2)); + + if (NPC.IsABestiaryIconDummy) + { + return CalamityUtils.DrawAnimatedBestiaryWorm(spriteBatch, NPC, drawColor, texture2D15, TextureAssets.Npc[ModContent.NPCType()].Value, 8, 26, 0.2f, new Vector2(-10, 0), 4, 5); + } + Vector2 distFromHead3 = NPC.Center - screenPos; distFromHead3 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * NPC.scale / 2f; distFromHead3 += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index e6028ace8f..d0c7be7f34 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -168,7 +168,6 @@ namespace CalamityMod.NPCs.DevourerofGods { Scale = 0.6f, PortraitScale = 0.6f, - CustomTexturePath = "CalamityMod/ExtraTextures/Bestiary/DevourerofGods_Bestiary", PortraitPositionXOverride = 60, PortraitPositionYOverride = 40 }; @@ -2633,7 +2632,9 @@ namespace CalamityMod.NPCs.DevourerofGods Texture2D texture2D15 = useOtherTextures ? Phase2Texture.Value : TextureAssets.Npc[NPC.type].Value; Vector2 halfSizeTexture = new Vector2(texture2D15.Width / 2, texture2D15.Height / 2); if (NPC.IsABestiaryIconDummy) - NPC.frame = texture2D15.Frame(); + { + return CalamityUtils.DrawAnimatedBestiaryWorm(spriteBatch, NPC, drawColor, texture2D15, DevourerofGodsBody.Phase2Texture.Value, 4, 26, 0.5f, new Vector2(30, 10), 2, 20); + } Vector2 drawLocation = NPC.Center - screenPos; drawLocation -= new Vector2(texture2D15.Width, texture2D15.Height) * NPC.scale / 2f; diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index ef027b0b35..66b5aac316 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -144,7 +144,6 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { Scale = 0.65f, PortraitScale = 0.6f, - CustomTexturePath = "CalamityMod/ExtraTextures/Bestiary/Thanatos_Bestiary", PortraitPositionXOverride = 40 }; value.Position.X += 52f; @@ -1116,6 +1115,31 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos Texture2D texture = TextureAssets.Npc[NPC.type].Value; Vector2 vector = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2); + // Reimplementation of CalamityUtils.DrawAnimatedBestiaryWorm but tweaked due to Thanatos' animations + if (NPC.IsABestiaryIconDummy) + { + NPC.frame = texture.Frame(); + // Buffers the segment position and rotations + float offset = -0.2f; + float startX = 60; + float startY = 70; + int segmentSpacing = 40; + int animationSpeed = 5; + // Draw the body segments + for (int i = 3; i > 0; i--) + { + // The first segment is slightly closer to keep up with the head + float bodyOffset = i == 1 ? i * segmentSpacing * 0.4f : i * segmentSpacing - segmentSpacing * 0.5f; + + Texture2D toUse = i % 2 == 1 ? TextureAssets.Npc[ModContent.NPCType()].Value : TextureAssets.Npc[ModContent.NPCType()].Value; + spriteBatch.Draw(toUse, NPC.position + new Vector2(startX + bodyOffset, MathF.Sin((Main.GlobalTimeWrappedHourly + offset * i) * animationSpeed) * 2 + startY), toUse.Frame(1, 5, 0, 0), NPC.GetAlpha(drawColor), NPC.rotation - MathHelper.PiOver2 - MathF.Cos((Main.GlobalTimeWrappedHourly + offset * i) * animationSpeed) * MathHelper.PiOver4 * 0.075f, new Vector2(toUse.Width / 2, toUse.Width / 10), NPC.scale, SpriteEffects.None, 0f); + } + // Draw the head + spriteBatch.Draw(texture, NPC.position + new Vector2(startX + 24, MathF.Sin(Main.GlobalTimeWrappedHourly * animationSpeed) * 2 + startY), texture.Frame(1, 5, 0, 0), NPC.GetAlpha(drawColor), NPC.rotation - MathHelper.PiOver2 - MathF.Cos(Main.GlobalTimeWrappedHourly * animationSpeed) * MathHelper.PiOver4 * 0.075f, new Vector2(texture.Width * 0.5f, texture.Height / 5), NPC.scale, SpriteEffects.None, 0f); + + return false; + } + Vector2 center = NPC.Center - screenPos; center -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; center += vector * NPC.scale + new Vector2(0f, NPC.gfxOffY); diff --git a/NPCs/NormalNPCs/ArmoredDiggerHead.cs b/NPCs/NormalNPCs/ArmoredDiggerHead.cs index 59b8c93ccf..33ee0968e7 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerHead.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerHead.cs @@ -5,10 +5,11 @@ using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Summon; using CalamityMod.World; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; +using Terraria.GameContent; using Terraria.GameContent.Bestiary; -using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; @@ -23,7 +24,6 @@ namespace CalamityMod.NPCs.NormalNPCs { NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { - CustomTexturePath = "CalamityMod/ExtraTextures/Bestiary/ArmoredDigger_Bestiary", PortraitPositionXOverride = 40, PortraitPositionYOverride = 40 }; @@ -511,5 +511,13 @@ namespace CalamityMod.NPCs.NormalNPCs } else return null; } + public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) + { + if (NPC.IsABestiaryIconDummy) + { + return CalamityUtils.DrawAnimatedBestiaryWorm(spriteBatch, NPC, drawColor, TextureAssets.Npc[Type].Value, TextureAssets.Npc[ModContent.NPCType()].Value, 4, 26, 0.6f, new Vector2(10, -10), 4, 16); + } + return true; + } } } diff --git a/NPCs/Perforator/PerforatorHeadLarge.cs b/NPCs/Perforator/PerforatorHeadLarge.cs index 28d91fd296..44935f2b57 100644 --- a/NPCs/Perforator/PerforatorHeadLarge.cs +++ b/NPCs/Perforator/PerforatorHeadLarge.cs @@ -35,7 +35,6 @@ namespace CalamityMod.NPCs.Perforator { Scale = 0.75f, PortraitScale = 0.75f, - CustomTexturePath = "CalamityMod/ExtraTextures/Bestiary/PerforatorLarge_Bestiary", PortraitPositionXOverride = 40, PortraitPositionYOverride = 40 }; @@ -533,7 +532,10 @@ namespace CalamityMod.NPCs.Perforator public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { if (NPC.IsABestiaryIconDummy) + { NPC.Opacity = 1f; + return CalamityUtils.DrawAnimatedBestiaryWorm(spriteBatch, NPC, drawColor, TextureAssets.Npc[Type].Value, TextureAssets.Npc[ModContent.NPCType()].Value, PerforatorBodyLarge.AltTexture.Value, 3, 40, 0.3f, Vector2.Zero, 3, 10); + } SpriteEffects spriteEffects = SpriteEffects.None; if (NPC.spriteDirection == 1) diff --git a/NPCs/Perforator/PerforatorHeadMedium.cs b/NPCs/Perforator/PerforatorHeadMedium.cs index c6814bab0f..d04beef3f3 100644 --- a/NPCs/Perforator/PerforatorHeadMedium.cs +++ b/NPCs/Perforator/PerforatorHeadMedium.cs @@ -31,7 +31,6 @@ namespace CalamityMod.NPCs.Perforator { Scale = 0.7f, PortraitScale = 0.7f, - CustomTexturePath = "CalamityMod/ExtraTextures/Bestiary/PerforatorMedium_Bestiary", PortraitPositionXOverride = 40, PortraitPositionYOverride = 40 }; @@ -458,7 +457,10 @@ namespace CalamityMod.NPCs.Perforator public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { if (NPC.IsABestiaryIconDummy) + { NPC.Opacity = 1f; + return CalamityUtils.DrawAnimatedBestiaryWorm(spriteBatch, NPC, drawColor, TextureAssets.Npc[Type].Value, TextureAssets.Npc[ModContent.NPCType()].Value, 5, 30, 0.6f, Vector2.Zero, 5, 10); + } SpriteEffects spriteEffects = SpriteEffects.None; if (NPC.spriteDirection == 1) diff --git a/NPCs/Perforator/PerforatorHeadSmall.cs b/NPCs/Perforator/PerforatorHeadSmall.cs index b8fd5aa87e..ceda2e5f25 100644 --- a/NPCs/Perforator/PerforatorHeadSmall.cs +++ b/NPCs/Perforator/PerforatorHeadSmall.cs @@ -2,6 +2,7 @@ using System.IO; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Events; +using CalamityMod.NPCs.Abyss; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -35,7 +36,6 @@ namespace CalamityMod.NPCs.Perforator { Scale = 0.8f, PortraitScale = 0.8f, - CustomTexturePath = "CalamityMod/ExtraTextures/Bestiary/PerforatorSmall_Bestiary", PortraitPositionXOverride = 40, PortraitPositionYOverride = 60 }; @@ -491,7 +491,10 @@ namespace CalamityMod.NPCs.Perforator public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { if (NPC.IsABestiaryIconDummy) + { NPC.Opacity = 1f; + return CalamityUtils.DrawAnimatedBestiaryWorm(spriteBatch, NPC, drawColor, TextureAssets.Npc[Type].Value, TextureAssets.Npc[ModContent.NPCType()].Value, 5, 22, 0.6f, new Vector2(-20, -20), 4, 10); + } SpriteEffects spriteEffects = SpriteEffects.None; if (NPC.spriteDirection == 1) diff --git a/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs b/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs index 4480a90eec..36b5028b83 100644 --- a/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs +++ b/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs @@ -13,6 +13,7 @@ using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.NPCs.Abyss; using CalamityMod.NPCs.NormalNPCs; +using CalamityMod.NPCs.Perforator; using CalamityMod.Sounds; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -93,7 +94,6 @@ namespace CalamityMod.NPCs.PrimordialWyrm Scale = 0.50f, PortraitScale = 0.6f, PortraitPositionXOverride = 40, - CustomTexturePath = "CalamityMod/ExtraTextures/Bestiary/PrimordialWyrm_Bestiary" }; value.Position.X += 55; value.Position.Y += 5; @@ -1426,7 +1426,10 @@ namespace CalamityMod.NPCs.PrimordialWyrm public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { if (NPC.IsABestiaryIconDummy) + { NPC.Opacity = 1f; + return CalamityUtils.DrawAnimatedBestiaryWorm(spriteBatch, NPC, drawColor, TextureAssets.Npc[Type].Value, TextureAssets.Npc[ModContent.NPCType()].Value, TextureAssets.Npc[ModContent.NPCType()].Value, 3, 18, 0.4f, new Vector2(130, 60), 3, 10); + } SpriteEffects spriteEffects = SpriteEffects.None; if (NPC.spriteDirection == 1) diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index 6a639fc6a6..1bed8eb1bf 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -14,6 +14,7 @@ using CalamityMod.Items.Potions; using CalamityMod.Items.TreasureBags; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.NPCs.Perforator; using CalamityMod.Projectiles.Boss; using CalamityMod.Projectiles.Enemy; using CalamityMod.Sounds; @@ -70,7 +71,6 @@ namespace CalamityMod.NPCs.StormWeaver { Scale = 0.85f, PortraitScale = 0.75f, - CustomTexturePath = "CalamityMod/ExtraTextures/Bestiary/StormWeaver_Bestiary", PortraitPositionXOverride = 40, PortraitPositionYOverride = 40 }; @@ -825,7 +825,10 @@ namespace CalamityMod.NPCs.StormWeaver public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { if (NPC.IsABestiaryIconDummy) + { NPC.Opacity = 1f; + return CalamityUtils.DrawAnimatedBestiaryWorm(spriteBatch, NPC, drawColor, TextureAssets.Npc[Type].Value, TextureAssets.Npc[ModContent.NPCType()].Value, 6, 24, 0.8f, Vector2.Zero, 3, 26, 10, 0.15f); + } SpriteEffects spriteEffects = SpriteEffects.None; if (NPC.spriteDirection == 1) diff --git a/Utilities/NPCUtils.cs b/Utilities/NPCUtils.cs index a5ec20c2dd..b55e199191 100644 --- a/Utilities/NPCUtils.cs +++ b/Utilities/NPCUtils.cs @@ -809,6 +809,60 @@ namespace CalamityMod } } + public static bool DrawAnimatedBestiaryWorm(SpriteBatch spriteBatch, NPC npc, Color drawColor, Texture2D headTexture, Texture2D bodyTexture, int segmentCount, int segmentSpacing, float rotationStrength, Vector2 baseOffset, int animationSpeed, float range, float headOffset = 0, float headSpeedOffset = 0) + { + DrawAnimatedBestiaryWorm(spriteBatch, npc, drawColor, headTexture, [bodyTexture], segmentCount, segmentSpacing, rotationStrength, baseOffset, animationSpeed, range, headOffset, headSpeedOffset); + return false; + } + + public static bool DrawAnimatedBestiaryWorm(SpriteBatch spriteBatch, NPC npc, Color drawColor, Texture2D headTexture, Texture2D bodyTexture, Texture2D bodyTextureAlt, int segmentCount, int segmentSpacing, float rotationStrength, Vector2 baseOffset, int animationSpeed, float range, float headOffset = 0, float headSpeedOffset = 0) + { + DrawAnimatedBestiaryWorm(spriteBatch, npc, drawColor, headTexture, [bodyTexture, bodyTextureAlt], segmentCount, segmentSpacing, rotationStrength, baseOffset, animationSpeed, range, headOffset, headSpeedOffset); + return false; + } + + ///

+ /// Draws animated wiggly worms for the Bestiary + /// + /// The PreDraw's SpriteBatch + /// The NPC to draw + /// The NPC's drawColor + /// The worm's head texture + /// The worm's body textures + /// The amount of segments that should be added + /// The spacing between segments + /// How strongly the worm rotates. Higher values cause it to make sharper turns + /// Moves around the position of the worm + /// How fast the worm moves + /// How far up and down the worm moves + /// How far to bash (move) the head horizontally in case the automated math is too off or the worm's head extends past its neck joint + /// Offsets the animation progression for the head. Meant to pair with headOffset + /// + public static bool DrawAnimatedBestiaryWorm(SpriteBatch spriteBatch, NPC npc, Color drawColor, Texture2D headTexture, Texture2D[] bodyTextures, int segmentCount, int segmentSpacing, float rotationStrength, Vector2 baseOffset, int animationSpeed, float range, float headOffset = 0, float headSpeedOffset = 0) + { + npc.frame = headTexture.Frame(); + // Buffers the segment position and rotations + float offset = -0.2f; + float startX = baseOffset.X; + float startY = baseOffset.Y; + // Draw the body segments + for (int i = segmentCount; i > 0; i--) + { + // The first segment is slightly closer to keep up with the head + float bodyOffset = i == 1 ? i * segmentSpacing * 0.4f : i * segmentSpacing - segmentSpacing * 0.5f; + + // If there's only one texture passed in, use it for all segments + // If two are passed in, alternate between them + // If more are passed in, each iteration must correspond to a texture + Texture2D toUse = bodyTextures.Length == 1 ? bodyTextures[0] : bodyTextures.Length == 2 ? (i % 2 == 0 ? bodyTextures[0] : bodyTextures[1]) : bodyTextures[i - 1]; + spriteBatch.Draw(toUse, npc.position + new Vector2(startX + bodyOffset, MathF.Sin((Main.GlobalTimeWrappedHourly + offset * i) * animationSpeed) * range + startY), toUse.Frame(1, 1, 0, 0), npc.GetAlpha(drawColor), npc.rotation - MathHelper.PiOver2 - MathF.Cos((Main.GlobalTimeWrappedHourly + offset * i) * animationSpeed) * MathHelper.PiOver4 * rotationStrength, toUse.Size () / 2, npc.scale, SpriteEffects.None, 0f); + } + // Draw the head + spriteBatch.Draw(headTexture, npc.position + new Vector2(startX + headOffset, MathF.Sin((Main.GlobalTimeWrappedHourly - headSpeedOffset) * animationSpeed) * range + startY), npc.frame, npc.GetAlpha(drawColor), npc.rotation - MathHelper.PiOver2 - MathF.Cos((Main.GlobalTimeWrappedHourly - headSpeedOffset) * animationSpeed) * MathHelper.PiOver4 * rotationStrength, new Vector2(headTexture.Width * 0.5f, headTexture.Height), npc.scale, SpriteEffects.None, 0f); + + return false; + } + #region Boss Spawning /// /// Shortcut for the generic boss summon message. @@ -824,7 +878,7 @@ namespace CalamityMod } else if (Main.netMode == NetmodeID.Server) { - ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasAwoken", new object[] { Main.npc[npcIndex].GetTypeNetName() }), new Color(175, 75, 255)); + ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasAwoken", [Main.npc[npcIndex].GetTypeNetName()]), new Color(175, 75, 255)); } } From 4e533c14dc0130ee29e5adf0f687bd6e51ce3b08 Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Sat, 28 Sep 2024 02:23:34 -0700 Subject: [PATCH 034/133] vanilla worms --- .../Bestiary/SeaSerpent_Bestiary.png | Bin 2544 -> 0 bytes NPCs/Abyss/GulperEelHead.cs | 2 +- NPCs/CalamityGlobalNPC.cs | 131 +++++++++++++++++- NPCs/Perforator/PerforatorHeadMedium.cs | 2 +- NPCs/SunkenSea/SandProwler.cs | 24 +++- Utilities/NPCUtils.cs | 16 ++- 6 files changed, 164 insertions(+), 11 deletions(-) delete mode 100644 ExtraTextures/Bestiary/SeaSerpent_Bestiary.png diff --git a/ExtraTextures/Bestiary/SeaSerpent_Bestiary.png b/ExtraTextures/Bestiary/SeaSerpent_Bestiary.png deleted file mode 100644 index 55dd91d297358f8900735c67b33433063d2aaaaa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2544 zcmeHJ{Wsh99{+rkkcc2cbSfs<8VS?s&|Q@EE0RW95Ak?t&1kt2t%_S6HsmYpdbrw7 zU8$#P>WW6^W*MfVsM6l1RP`!HNt3BoJ!~GTkBa7I`!ja;I_LF%o%j2^e|o*n`7?%Z_p*2d<0tTZXki@uvfSJO?hT zD0d8Z0y4sa!}b5)0O7B(bVI@>qJWqa0GJQ_M(9?WA`t+iR36(eLg0V1rbJr1i@+I@ zsCuwojf_LEe$!Ww8a?&)VH{}5O5jes>^YNT2PS?6@ilMj z|D7=(ehB($J*NAHve)5O_B#uZYF7&(8+$rJmastAKf-Lg0Oq@dHFN2k-ms>1@-|BL z3u$8b@N?fL1|kaSP7fK|2Hug1xCo~{CkLBgh0Je+8&8W!7kysY1gecC0|Zl;epJ)c z8JjYxtpcQdd+GYSr*2-?uRbUbw!MVU>9E9%ETpbxpXKl>DjqY3g?#?Dm%6O%U#82rpg*p zYkr}g_KzqUdalCjBgn_^ot#*hTU;Bs_qs6Sz3v`B@3RYFOB_O8c+HB;j-geySKX2P z95$7L>tPa=BNVAj!FdO1Jbv>4z+~o(3x1E^rDH@RlV{l zp8ypk(hP#0eYxh>Vl3B&5{eX`?VE1?DK)`@?0dRv%|3Wy_=M-o_Y2Ez`3pyK%i^u5 zX-PB%+YQL(+{%pSW$2FtoWBrbBhv>r2ho-VnE}TR( zS)Wi)PqD^$3$@oY$B|)s(sT>8z&ZIn;_r?0SIl9o6R@gjP#k~#b>l?@G zy?Glr9Y$S_O9-p}7`ItLnwmV{wx$8C@kGFBuFfwdfKvAMN&i(7#N|E35Wn$V^Z9b> zKT+fx<`N5tggQtyT@%s=i~HWU&mm9`V0Ql)Pj@B@V;(qqqWdt3TVE~BYUR_Fhb^u< z0ivgV^g=%({ytJba%yUeTA~2llZxf8OeaOA5nM7EHp2ss_uLd4UT1&y2zNRCHqd62 zcl1jem>GJ7!7MitHd?b)k@!mxEVFBmuKN4+T>q$IJwi!Fg{@mkGvEU?N7Wnt?{ zMZuJbh&{H<=zgMP`q{?}uOS~3b#R(~GxIr^2o&&^rc)@kW;XyG~+ucnUMa-8X^Jd0ZcoC@AYa?gI4nS3XMzS|&K9n;*3E0;C zv{T&7C&E7pw(i?!3l9g)y!_9AmG&_B;9Gw(P=?b4Sl2A?y%QmROe_`Ux_{Rb79aO! zz2dLMEd>q0ar&G)y|!Td2RmPGC6;Qk)|ru<2!p(~i(ZR|z>W*cca~@k#J-k&m9IY% z-{jlCUPOR9Zo#mona7>L_jxl-;%!N2#()].Value; - return CalamityUtils.DrawAnimatedBestiaryWorm(spriteBatch, NPC, drawColor, TextureAssets.Npc[Type].Value, [TextureAssets.Npc[ModContent.NPCType()].Value, mainBody, mainBody], 3, 26, 0.4f, new Vector2(0, 20), 3, 10); + return CalamityUtils.DrawAnimatedBestiaryWorm(spriteBatch, NPC, drawColor, TextureAssets.Npc[Type].Value, [TextureAssets.Npc[ModContent.NPCType()].Value, mainBody, mainBody], 3, 26, 0.3f, new Vector2(0, 20), 3, 10, 0, 0.1f); } return true; } diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 00da0e990d..b4316f4589 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -6964,6 +6964,28 @@ namespace CalamityMod.NPCs public override bool PreDraw(NPC npc, SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { + if (npc.IsABestiaryIconDummy) + { + switch (npc.netID) + { + case NPCID.DiggerHead: + case NPCID.GiantWormHead: + case NPCID.EaterofWorldsHead: + case NPCID.WyvernHead: + case NPCID.StardustWormHead: + case NPCID.SolarCrawltipedeHead: + case NPCID.CultistDragonHead: + case NPCID.TheDestroyer: + case NPCID.LeechHead: + case NPCID.DevourerHead: + case NPCID.TombCrawlerHead: + case NPCID.DuneSplicerHead: + case NPCID.BloodEelHead: + case NPCID.BoneSerpentHead: + case NPCID.SeekerHead: + return DrawVanillaBestiaryWorms(spriteBatch, npc, drawColor); + } + } if (npc.type != NPCID.BrainofCthulhu && (npc.type != NPCID.DukeFishron || npc.ai[0] <= 9f) && npc.active) { if (CalamityClientConfig.Instance.DebuffDisplay && (npc.boss || BossHealthBarManager.MinibossHPBarList.Contains(npc.type) || BossHealthBarManager.OneToMany.ContainsKey(npc.type) || CalamityLists.needsDebuffIconDisplayList.Contains(npc.type))) @@ -7356,7 +7378,7 @@ namespace CalamityMod.NPCs } // Destroyer drawing and laser telegraphs - else if (CalamityLists.DestroyerIDs.Contains(npc.type)) + else if (CalamityLists.DestroyerIDs.Contains(npc.type) && !npc.IsABestiaryIconDummy) { Texture2D npcTexture = TextureAssets.Npc[npc.type].Value; int frameHeight = npcTexture.Height / Main.npcFrameCount[npc.type]; @@ -8037,6 +8059,91 @@ namespace CalamityMod.NPCs newColor.A = (byte)((float)newColor.A * A); return newColor; } + + public static bool DrawVanillaBestiaryWorms(SpriteBatch spriteBatch, NPC npc, Color drawColor) + { + npc.Opacity = 1; + int segments = 6; + int spacing = 20; + int bashLength = 0; + float bashSpeed = 0f; + int speed = 3; + float rotation = 0.6f; + Texture2D wyvernArm = TextureAssets.Npc[NPCID.WyvernLegs].Value; + Texture2D wyvernBody = TextureAssets.Npc[NPCID.WyvernBody].Value; + switch (npc.netID) + { + case NPCID.DiggerHead: + return CalamityUtils.DrawAnimatedBestiaryWorm(spriteBatch, npc, drawColor, TextureAssets.Npc[npc.type].Value, TextureAssets.Npc[npc.type + 1].Value, segments, 24, 0.4f, Vector2.Zero, speed, 10, 10, 0.2f); + case NPCID.GiantWormHead: + return CalamityUtils.DrawAnimatedBestiaryWorm(spriteBatch, npc, drawColor, TextureAssets.Npc[npc.type].Value, TextureAssets.Npc[npc.type + 1].Value, 8, 14, 0.6f, new Vector2(20, 0), 4, 10, 6, 0.18f); + case NPCID.EaterofWorldsHead: + return CalamityUtils.DrawAnimatedBestiaryWorm(spriteBatch, npc, drawColor, TextureAssets.Npc[npc.type].Value, TextureAssets.Npc[npc.type + 1].Value, segments, 34, 0.2f, new Vector2(30, 0), speed, 10, 16, 0.24f); + case NPCID.WyvernHead: + return CalamityUtils.DrawAnimatedBestiaryWorm(spriteBatch, npc, drawColor, TextureAssets.Npc[npc.type].Value, [wyvernArm, wyvernBody, wyvernBody, wyvernBody], 4, 28, 0.1f, new Vector2(36, 0), speed, 6, 50, 0.3f, true); + case NPCID.StardustWormHead: + return CalamityUtils.DrawAnimatedBestiaryWorm(spriteBatch, npc, drawColor, TextureAssets.Npc[npc.type].Value, TextureAssets.Npc[npc.type + 1].Value, 8, 14, rotation, new Vector2(0, 10), 4, 10, 6, 0.18f); + case NPCID.SolarCrawltipedeHead: + return CalamityUtils.DrawAnimatedBestiaryWorm(spriteBatch, npc, drawColor, TextureAssets.Npc[npc.type].Value, TextureAssets.Npc[npc.type + 1].Value, segments, spacing, rotation, Vector2.Zero, 6, 10, 16, 0.22f); + case NPCID.CultistDragonHead: + return DrawSpecialBestiaryWorm(spriteBatch, npc, drawColor); + case NPCID.TheDestroyer: + return DrawSpecialBestiaryWorm(spriteBatch, npc, drawColor); + case NPCID.LeechHead: + return CalamityUtils.DrawAnimatedBestiaryWorm(spriteBatch, npc, drawColor, TextureAssets.Npc[npc.type].Value, TextureAssets.Npc[npc.type + 1].Value, 8, 14, 0.6f, new Vector2(20, 0), 4, 10, 6, 0.18f); + case NPCID.DevourerHead: + return CalamityUtils.DrawAnimatedBestiaryWorm(spriteBatch, npc, drawColor, TextureAssets.Npc[npc.type].Value, TextureAssets.Npc[npc.type + 1].Value, segments, spacing, rotation, Vector2.Zero, speed, 20, 10, 0.2f); + case NPCID.TombCrawlerHead: + return CalamityUtils.DrawAnimatedBestiaryWorm(spriteBatch, npc, drawColor, TextureAssets.Npc[npc.type].Value, TextureAssets.Npc[npc.type + 1].Value, 9, 14, rotation, Vector2.Zero, speed, 20, 6, 0.14f); + case NPCID.DuneSplicerHead: + return CalamityUtils.DrawAnimatedBestiaryWorm(spriteBatch, npc, drawColor, TextureAssets.Npc[npc.type].Value, TextureAssets.Npc[npc.type + 1].Value, segments, 28, 0.4f, Vector2.Zero, speed, 10, bashLength, bashSpeed); + case NPCID.BloodEelHead: + return CalamityUtils.DrawAnimatedBestiaryWorm(spriteBatch, npc, drawColor, TextureAssets.Npc[npc.type].Value, TextureAssets.Npc[npc.type + 1].Value, 6, 22, 0.1f, Vector2.Zero, speed, 6, 20, 0.2f, true); + case NPCID.BoneSerpentHead: + return CalamityUtils.DrawAnimatedBestiaryWorm(spriteBatch, npc, drawColor, TextureAssets.Npc[npc.type].Value, TextureAssets.Npc[npc.type + 1].Value, 9, 16, rotation, Vector2.Zero, speed, 10, 30, 0.4f); + case NPCID.SeekerHead: + return CalamityUtils.DrawAnimatedBestiaryWorm(spriteBatch, npc, drawColor, TextureAssets.Npc[npc.type].Value, TextureAssets.Npc[npc.type + 1].Value, segments, spacing, rotation, Vector2.Zero, speed, 20, 10, 0.2f); + } + return true; + } + + public static bool DrawSpecialBestiaryWorm(SpriteBatch spriteBatch, NPC npc, Color drawColor) + { + // This is solely for The Destroyer and the Phantasm Dragon due to having more than 1 frame each but only for specific segments + bool dragon = npc.type == NPCID.CultistDragonHead; + Texture2D headTexture = TextureAssets.Npc[npc.type].Value; + // Dragon head has 3 frames, Destroyer has 1 + int frameAmt = dragon ? 3 : 1; + npc.frame = TextureAssets.Npc[npc.type].Frame(1, frameAmt, 0, 0); + Vector2 baseOffset = new Vector2(dragon ? 0 : 20, dragon ? 0 : 20); + // Buffers the segment position and rotations + float offset = -0.2f; + float startX = baseOffset.X; + float startY = baseOffset.Y; + int segmentSpacing = dragon ? 32 : 38; + int animationSpeed = 3; + int range = 10; + int headOffset = dragon ? 40 : 20; + float headSpeedOffset = dragon ? 0.2f : 0.16f; + float rotationStrength = 0.2f; + // Draw the body segments + for (int i = 4; i > 0; i--) + { + // The first segment is slightly closer to keep up with the head + float bodyOffset = i == 1 ? i * segmentSpacing * 0.4f : i * segmentSpacing - segmentSpacing * 0.5f; + + // Second dragon segment uses the arm, rest use the normal body + Texture2D toUse = i == 2 ? TextureAssets.Npc[NPCID.CultistDragonBody1].Value : TextureAssets.Npc[NPCID.CultistDragonBody2].Value; + // If it's The Destroyer instead use his texture and increase the frame count to two + if (!dragon) + toUse = TextureAssets.Npc[NPCID.TheDestroyerBody].Value; + int bodyFrameAmt = dragon ? 1 : 2; + spriteBatch.Draw(toUse, npc.position + new Vector2(startX + bodyOffset, MathF.Sin((Main.GlobalTimeWrappedHourly + offset * i) * animationSpeed) * range + startY), toUse.Frame(1, bodyFrameAmt, 0, 0), npc.GetAlpha(drawColor), npc.rotation - MathHelper.PiOver2 - MathF.Cos((Main.GlobalTimeWrappedHourly + offset * i) * animationSpeed) * MathHelper.PiOver4 * rotationStrength, new Vector2(toUse.Width * 0.5f, toUse.Height * 0.5f / bodyFrameAmt), npc.scale, SpriteEffects.FlipHorizontally, 0f); + } + // Draw the head + spriteBatch.Draw(headTexture, npc.position + new Vector2(startX + headOffset, MathF.Sin((Main.GlobalTimeWrappedHourly - headSpeedOffset) * animationSpeed) * range + startY), npc.frame, npc.GetAlpha(drawColor), npc.rotation - MathHelper.PiOver2 - MathF.Cos((Main.GlobalTimeWrappedHourly - headSpeedOffset) * animationSpeed) * MathHelper.PiOver4 * rotationStrength, new Vector2(headTexture.Width * 0.5f, headTexture.Height / (float)frameAmt), npc.scale, SpriteEffects.FlipHorizontally, 0f); + return false; + } #endregion #region Any Events @@ -9082,6 +9189,28 @@ namespace CalamityMod.NPCs { bestiaryEntry.AddTags(BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.SurfaceMushroom); } + + // Remove the static portraits from vanilla worms so that Calamity's worm movement can be added in PreDraw + switch (npc.netID) + { + case NPCID.DiggerHead: + case NPCID.GiantWormHead: + case NPCID.EaterofWorldsHead: + case NPCID.WyvernHead: + case NPCID.StardustWormHead: + case NPCID.SolarCrawltipedeHead: + case NPCID.CultistDragonHead: + case NPCID.TheDestroyer: + case NPCID.LeechHead: + case NPCID.DevourerHead: + case NPCID.TombCrawlerHead: + case NPCID.DuneSplicerHead: + case NPCID.BloodEelHead: + case NPCID.BoneSerpentHead: + case NPCID.SeekerHead: + NPCID.Sets.NPCBestiaryDrawOffset[npc.type] = NPCID.Sets.NPCBestiaryDrawOffset[npc.type] with { CustomTexturePath = null }; + break; + } } public static string NPCDebuffResistText(bool? effectiveness, string name) diff --git a/NPCs/Perforator/PerforatorHeadMedium.cs b/NPCs/Perforator/PerforatorHeadMedium.cs index d04beef3f3..4f5ffd2b01 100644 --- a/NPCs/Perforator/PerforatorHeadMedium.cs +++ b/NPCs/Perforator/PerforatorHeadMedium.cs @@ -459,7 +459,7 @@ namespace CalamityMod.NPCs.Perforator if (NPC.IsABestiaryIconDummy) { NPC.Opacity = 1f; - return CalamityUtils.DrawAnimatedBestiaryWorm(spriteBatch, NPC, drawColor, TextureAssets.Npc[Type].Value, TextureAssets.Npc[ModContent.NPCType()].Value, 5, 30, 0.6f, Vector2.Zero, 5, 10); + return CalamityUtils.DrawAnimatedBestiaryWorm(spriteBatch, NPC, drawColor, TextureAssets.Npc[Type].Value, TextureAssets.Npc[ModContent.NPCType()].Value, 5, 34, 0.3f, Vector2.Zero, 5, 6); } SpriteEffects spriteEffects = SpriteEffects.None; diff --git a/NPCs/SunkenSea/SandProwler.cs b/NPCs/SunkenSea/SandProwler.cs index 57a4fb4d21..09779c6af3 100644 --- a/NPCs/SunkenSea/SandProwler.cs +++ b/NPCs/SunkenSea/SandProwler.cs @@ -52,7 +52,6 @@ namespace CalamityMod.NPCs.SunkenSea { NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { - CustomTexturePath = "CalamityMod/ExtraTextures/Bestiary/SeaSerpent_Bestiary", PortraitPositionXOverride = 40, PortraitPositionYOverride = 20 }; @@ -583,6 +582,29 @@ namespace CalamityMod.NPCs.SunkenSea public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { Texture2D segmentSprite = TextureAssets.Npc[Type].Value; + if (NPC.IsABestiaryIconDummy) + { + NPC.frame = segmentSprite.Frame(); + // Buffers the segment position and rotations + float offset = -0.2f; + float startX = 0; + float startY = 0; + int segmentSpacing = 16; + int animationSpeed = 5; + // Draw the body segments + for (int i = 7; i > 0; i--) + { + // The first segment is slightly closer to keep up with the head + float bodyOffset = i == 1 ? i * segmentSpacing * 0.4f : i * segmentSpacing - segmentSpacing * 0.5f; + + Texture2D toUse = i == 1 ? BodySprite1.Value : i == 2 ? BodySprite2.Value : i % 2 == 0 ? BodySprite3.Value : BodySprite4.Value; + spriteBatch.Draw(toUse, NPC.position + new Vector2(startX + bodyOffset, MathF.Sin((Main.GlobalTimeWrappedHourly + offset * i) * animationSpeed) * 2 + startY), toUse.Frame(1, 1, 0, 0), NPC.GetAlpha(drawColor), NPC.rotation - MathHelper.PiOver2 - MathF.Cos((Main.GlobalTimeWrappedHourly + offset * i) * animationSpeed) * MathHelper.PiOver4 * 0.075f, new Vector2(toUse.Width / 2, toUse.Width / 2), NPC.scale, SpriteEffects.None, 0f); + } + // Draw the head + spriteBatch.Draw(segmentSprite, NPC.position + new Vector2(startX, MathF.Sin(Main.GlobalTimeWrappedHourly * animationSpeed) * 2 + startY), segmentSprite.Frame(1, 11, 0, 0), NPC.GetAlpha(drawColor), NPC.rotation - MathHelper.PiOver2 - MathF.Cos(Main.GlobalTimeWrappedHourly * animationSpeed) * MathHelper.PiOver4 * 0.075f, new Vector2(segmentSprite.Width * 0.5f, segmentSprite.Height / 11), NPC.scale, SpriteEffects.None, 0f); + + return false; + } switch (NPC.ai[3]) { case 0: diff --git a/Utilities/NPCUtils.cs b/Utilities/NPCUtils.cs index b55e199191..987e59f425 100644 --- a/Utilities/NPCUtils.cs +++ b/Utilities/NPCUtils.cs @@ -809,15 +809,15 @@ namespace CalamityMod } } - public static bool DrawAnimatedBestiaryWorm(SpriteBatch spriteBatch, NPC npc, Color drawColor, Texture2D headTexture, Texture2D bodyTexture, int segmentCount, int segmentSpacing, float rotationStrength, Vector2 baseOffset, int animationSpeed, float range, float headOffset = 0, float headSpeedOffset = 0) + public static bool DrawAnimatedBestiaryWorm(SpriteBatch spriteBatch, NPC npc, Color drawColor, Texture2D headTexture, Texture2D bodyTexture, int segmentCount, int segmentSpacing, float rotationStrength, Vector2 baseOffset, int animationSpeed, float range, float headOffset = 0, float headSpeedOffset = 0, bool flip = false) { - DrawAnimatedBestiaryWorm(spriteBatch, npc, drawColor, headTexture, [bodyTexture], segmentCount, segmentSpacing, rotationStrength, baseOffset, animationSpeed, range, headOffset, headSpeedOffset); + DrawAnimatedBestiaryWorm(spriteBatch, npc, drawColor, headTexture, [bodyTexture], segmentCount, segmentSpacing, rotationStrength, baseOffset, animationSpeed, range, headOffset, headSpeedOffset, flip); return false; } - public static bool DrawAnimatedBestiaryWorm(SpriteBatch spriteBatch, NPC npc, Color drawColor, Texture2D headTexture, Texture2D bodyTexture, Texture2D bodyTextureAlt, int segmentCount, int segmentSpacing, float rotationStrength, Vector2 baseOffset, int animationSpeed, float range, float headOffset = 0, float headSpeedOffset = 0) + public static bool DrawAnimatedBestiaryWorm(SpriteBatch spriteBatch, NPC npc, Color drawColor, Texture2D headTexture, Texture2D bodyTexture, Texture2D bodyTextureAlt, int segmentCount, int segmentSpacing, float rotationStrength, Vector2 baseOffset, int animationSpeed, float range, float headOffset = 0, float headSpeedOffset = 0, bool flip = false) { - DrawAnimatedBestiaryWorm(spriteBatch, npc, drawColor, headTexture, [bodyTexture, bodyTextureAlt], segmentCount, segmentSpacing, rotationStrength, baseOffset, animationSpeed, range, headOffset, headSpeedOffset); + DrawAnimatedBestiaryWorm(spriteBatch, npc, drawColor, headTexture, [bodyTexture, bodyTextureAlt], segmentCount, segmentSpacing, rotationStrength, baseOffset, animationSpeed, range, headOffset, headSpeedOffset, flip); return false; } @@ -837,14 +837,16 @@ namespace CalamityMod /// How far up and down the worm moves /// How far to bash (move) the head horizontally in case the automated math is too off or the worm's head extends past its neck joint /// Offsets the animation progression for the head. Meant to pair with headOffset + /// If the sprites should be flipped. Used for worms viewed from the side like Wyverns /// - public static bool DrawAnimatedBestiaryWorm(SpriteBatch spriteBatch, NPC npc, Color drawColor, Texture2D headTexture, Texture2D[] bodyTextures, int segmentCount, int segmentSpacing, float rotationStrength, Vector2 baseOffset, int animationSpeed, float range, float headOffset = 0, float headSpeedOffset = 0) + public static bool DrawAnimatedBestiaryWorm(SpriteBatch spriteBatch, NPC npc, Color drawColor, Texture2D headTexture, Texture2D[] bodyTextures, int segmentCount, int segmentSpacing, float rotationStrength, Vector2 baseOffset, int animationSpeed, float range, float headOffset = 0, float headSpeedOffset = 0, bool flip = false) { npc.frame = headTexture.Frame(); // Buffers the segment position and rotations float offset = -0.2f; float startX = baseOffset.X; float startY = baseOffset.Y; + SpriteEffects fx = flip ? SpriteEffects.FlipHorizontally : SpriteEffects.None; // Draw the body segments for (int i = segmentCount; i > 0; i--) { @@ -855,10 +857,10 @@ namespace CalamityMod // If two are passed in, alternate between them // If more are passed in, each iteration must correspond to a texture Texture2D toUse = bodyTextures.Length == 1 ? bodyTextures[0] : bodyTextures.Length == 2 ? (i % 2 == 0 ? bodyTextures[0] : bodyTextures[1]) : bodyTextures[i - 1]; - spriteBatch.Draw(toUse, npc.position + new Vector2(startX + bodyOffset, MathF.Sin((Main.GlobalTimeWrappedHourly + offset * i) * animationSpeed) * range + startY), toUse.Frame(1, 1, 0, 0), npc.GetAlpha(drawColor), npc.rotation - MathHelper.PiOver2 - MathF.Cos((Main.GlobalTimeWrappedHourly + offset * i) * animationSpeed) * MathHelper.PiOver4 * rotationStrength, toUse.Size () / 2, npc.scale, SpriteEffects.None, 0f); + spriteBatch.Draw(toUse, npc.position + new Vector2(startX + bodyOffset, MathF.Sin((Main.GlobalTimeWrappedHourly + offset * i) * animationSpeed) * range + startY), toUse.Frame(1, 1, 0, 0), npc.GetAlpha(drawColor), npc.rotation - MathHelper.PiOver2 - MathF.Cos((Main.GlobalTimeWrappedHourly + offset * i) * animationSpeed) * MathHelper.PiOver4 * rotationStrength, toUse.Size () / 2, npc.scale, fx, 0f); } // Draw the head - spriteBatch.Draw(headTexture, npc.position + new Vector2(startX + headOffset, MathF.Sin((Main.GlobalTimeWrappedHourly - headSpeedOffset) * animationSpeed) * range + startY), npc.frame, npc.GetAlpha(drawColor), npc.rotation - MathHelper.PiOver2 - MathF.Cos((Main.GlobalTimeWrappedHourly - headSpeedOffset) * animationSpeed) * MathHelper.PiOver4 * rotationStrength, new Vector2(headTexture.Width * 0.5f, headTexture.Height), npc.scale, SpriteEffects.None, 0f); + spriteBatch.Draw(headTexture, npc.position + new Vector2(startX + headOffset, MathF.Sin((Main.GlobalTimeWrappedHourly - headSpeedOffset) * animationSpeed) * range + startY), npc.frame, npc.GetAlpha(drawColor), npc.rotation - MathHelper.PiOver2 - MathF.Cos((Main.GlobalTimeWrappedHourly - headSpeedOffset) * animationSpeed) * MathHelper.PiOver4 * rotationStrength, new Vector2(headTexture.Width * 0.5f, headTexture.Height), npc.scale, fx, 0f); return false; } From 1d866b7750b824142381f9e9b63934ad891ebb29 Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Sat, 28 Sep 2024 04:24:27 -0700 Subject: [PATCH 035/133] disabled animations when not hovering/opened --- NPCs/CalamityGlobalNPC.cs | 18 ++++++++++++++++-- NPCs/ExoMechs/Thanatos/ThanatosHead.cs | 5 +++-- NPCs/SunkenSea/SandProwler.cs | 5 +++-- Utilities/NPCUtils.cs | 5 +++-- 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index b4316f4589..fc28d4788e 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -395,6 +395,9 @@ namespace CalamityMod.NPCs // Variable for if enemy has been recently hit by an ArcZap public int arcZapCooldown = 0; + + // Animates worms in the bestiary but only when their entry is being looked at + public float bestiaryWormTimer = 0; #endregion #region Instance Per Entity and TML 1.4 Cloning @@ -6642,6 +6645,16 @@ namespace CalamityMod.NPCs if (npc.type == NPCID.SkeletronPrime || npc.type == NPCType()) npc.frameCounter = 0D; } + // Increment the bestiary worm timer when hovering over the NPC or having their entry open. Pauses otherwise + if (npc.IsABestiaryIconDummy) + { + bestiaryWormTimer += 0.02f; + // Resets after an hour. No sane human being is looking at a bestiary entry for an hour straight + if (bestiaryWormTimer > 4320) + { + bestiaryWormTimer = 0; + } + } } // Debuff visuals. Alphabetical order as per usual, please @@ -8112,6 +8125,7 @@ namespace CalamityMod.NPCs // This is solely for The Destroyer and the Phantasm Dragon due to having more than 1 frame each but only for specific segments bool dragon = npc.type == NPCID.CultistDragonHead; Texture2D headTexture = TextureAssets.Npc[npc.type].Value; + float wormTimer = npc.Calamity().bestiaryWormTimer; // Dragon head has 3 frames, Destroyer has 1 int frameAmt = dragon ? 3 : 1; npc.frame = TextureAssets.Npc[npc.type].Frame(1, frameAmt, 0, 0); @@ -8138,10 +8152,10 @@ namespace CalamityMod.NPCs if (!dragon) toUse = TextureAssets.Npc[NPCID.TheDestroyerBody].Value; int bodyFrameAmt = dragon ? 1 : 2; - spriteBatch.Draw(toUse, npc.position + new Vector2(startX + bodyOffset, MathF.Sin((Main.GlobalTimeWrappedHourly + offset * i) * animationSpeed) * range + startY), toUse.Frame(1, bodyFrameAmt, 0, 0), npc.GetAlpha(drawColor), npc.rotation - MathHelper.PiOver2 - MathF.Cos((Main.GlobalTimeWrappedHourly + offset * i) * animationSpeed) * MathHelper.PiOver4 * rotationStrength, new Vector2(toUse.Width * 0.5f, toUse.Height * 0.5f / bodyFrameAmt), npc.scale, SpriteEffects.FlipHorizontally, 0f); + spriteBatch.Draw(toUse, npc.position + new Vector2(startX + bodyOffset, MathF.Sin((wormTimer + offset * i) * animationSpeed) * range + startY), toUse.Frame(1, bodyFrameAmt, 0, 0), npc.GetAlpha(drawColor), npc.rotation - MathHelper.PiOver2 - MathF.Cos((wormTimer + offset * i) * animationSpeed) * MathHelper.PiOver4 * rotationStrength, new Vector2(toUse.Width * 0.5f, toUse.Height * 0.5f / bodyFrameAmt), npc.scale, SpriteEffects.FlipHorizontally, 0f); } // Draw the head - spriteBatch.Draw(headTexture, npc.position + new Vector2(startX + headOffset, MathF.Sin((Main.GlobalTimeWrappedHourly - headSpeedOffset) * animationSpeed) * range + startY), npc.frame, npc.GetAlpha(drawColor), npc.rotation - MathHelper.PiOver2 - MathF.Cos((Main.GlobalTimeWrappedHourly - headSpeedOffset) * animationSpeed) * MathHelper.PiOver4 * rotationStrength, new Vector2(headTexture.Width * 0.5f, headTexture.Height / (float)frameAmt), npc.scale, SpriteEffects.FlipHorizontally, 0f); + spriteBatch.Draw(headTexture, npc.position + new Vector2(startX + headOffset, MathF.Sin((wormTimer - headSpeedOffset) * animationSpeed) * range + startY), npc.frame, npc.GetAlpha(drawColor), npc.rotation - MathHelper.PiOver2 - MathF.Cos((wormTimer - headSpeedOffset) * animationSpeed) * MathHelper.PiOver4 * rotationStrength, new Vector2(headTexture.Width * 0.5f, headTexture.Height / (float)frameAmt), npc.scale, SpriteEffects.FlipHorizontally, 0f); return false; } #endregion diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index 66b5aac316..bcfbfda135 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -1125,6 +1125,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos float startY = 70; int segmentSpacing = 40; int animationSpeed = 5; + float wormTimer = NPC.Calamity().bestiaryWormTimer; // Draw the body segments for (int i = 3; i > 0; i--) { @@ -1132,10 +1133,10 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos float bodyOffset = i == 1 ? i * segmentSpacing * 0.4f : i * segmentSpacing - segmentSpacing * 0.5f; Texture2D toUse = i % 2 == 1 ? TextureAssets.Npc[ModContent.NPCType()].Value : TextureAssets.Npc[ModContent.NPCType()].Value; - spriteBatch.Draw(toUse, NPC.position + new Vector2(startX + bodyOffset, MathF.Sin((Main.GlobalTimeWrappedHourly + offset * i) * animationSpeed) * 2 + startY), toUse.Frame(1, 5, 0, 0), NPC.GetAlpha(drawColor), NPC.rotation - MathHelper.PiOver2 - MathF.Cos((Main.GlobalTimeWrappedHourly + offset * i) * animationSpeed) * MathHelper.PiOver4 * 0.075f, new Vector2(toUse.Width / 2, toUse.Width / 10), NPC.scale, SpriteEffects.None, 0f); + spriteBatch.Draw(toUse, NPC.position + new Vector2(startX + bodyOffset, MathF.Sin((wormTimer + offset * i) * animationSpeed) * 2 + startY), toUse.Frame(1, 5, 0, 0), NPC.GetAlpha(drawColor), NPC.rotation - MathHelper.PiOver2 - MathF.Cos((wormTimer + offset * i) * animationSpeed) * MathHelper.PiOver4 * 0.075f, new Vector2(toUse.Width / 2, toUse.Width / 10), NPC.scale, SpriteEffects.None, 0f); } // Draw the head - spriteBatch.Draw(texture, NPC.position + new Vector2(startX + 24, MathF.Sin(Main.GlobalTimeWrappedHourly * animationSpeed) * 2 + startY), texture.Frame(1, 5, 0, 0), NPC.GetAlpha(drawColor), NPC.rotation - MathHelper.PiOver2 - MathF.Cos(Main.GlobalTimeWrappedHourly * animationSpeed) * MathHelper.PiOver4 * 0.075f, new Vector2(texture.Width * 0.5f, texture.Height / 5), NPC.scale, SpriteEffects.None, 0f); + spriteBatch.Draw(texture, NPC.position + new Vector2(startX + 24, MathF.Sin(wormTimer * animationSpeed) * 2 + startY), texture.Frame(1, 5, 0, 0), NPC.GetAlpha(drawColor), NPC.rotation - MathHelper.PiOver2 - MathF.Cos(wormTimer * animationSpeed) * MathHelper.PiOver4 * 0.075f, new Vector2(texture.Width * 0.5f, texture.Height / 5), NPC.scale, SpriteEffects.None, 0f); return false; } diff --git a/NPCs/SunkenSea/SandProwler.cs b/NPCs/SunkenSea/SandProwler.cs index 09779c6af3..46ec02e744 100644 --- a/NPCs/SunkenSea/SandProwler.cs +++ b/NPCs/SunkenSea/SandProwler.cs @@ -591,6 +591,7 @@ namespace CalamityMod.NPCs.SunkenSea float startY = 0; int segmentSpacing = 16; int animationSpeed = 5; + float wormTimer = NPC.Calamity().bestiaryWormTimer; // Draw the body segments for (int i = 7; i > 0; i--) { @@ -598,10 +599,10 @@ namespace CalamityMod.NPCs.SunkenSea float bodyOffset = i == 1 ? i * segmentSpacing * 0.4f : i * segmentSpacing - segmentSpacing * 0.5f; Texture2D toUse = i == 1 ? BodySprite1.Value : i == 2 ? BodySprite2.Value : i % 2 == 0 ? BodySprite3.Value : BodySprite4.Value; - spriteBatch.Draw(toUse, NPC.position + new Vector2(startX + bodyOffset, MathF.Sin((Main.GlobalTimeWrappedHourly + offset * i) * animationSpeed) * 2 + startY), toUse.Frame(1, 1, 0, 0), NPC.GetAlpha(drawColor), NPC.rotation - MathHelper.PiOver2 - MathF.Cos((Main.GlobalTimeWrappedHourly + offset * i) * animationSpeed) * MathHelper.PiOver4 * 0.075f, new Vector2(toUse.Width / 2, toUse.Width / 2), NPC.scale, SpriteEffects.None, 0f); + spriteBatch.Draw(toUse, NPC.position + new Vector2(startX + bodyOffset, MathF.Sin((wormTimer + offset * i) * animationSpeed) * 2 + startY), toUse.Frame(1, 1, 0, 0), NPC.GetAlpha(drawColor), NPC.rotation - MathHelper.PiOver2 - MathF.Cos((wormTimer + offset * i) * animationSpeed) * MathHelper.PiOver4 * 0.075f, new Vector2(toUse.Width / 2, toUse.Width / 2), NPC.scale, SpriteEffects.None, 0f); } // Draw the head - spriteBatch.Draw(segmentSprite, NPC.position + new Vector2(startX, MathF.Sin(Main.GlobalTimeWrappedHourly * animationSpeed) * 2 + startY), segmentSprite.Frame(1, 11, 0, 0), NPC.GetAlpha(drawColor), NPC.rotation - MathHelper.PiOver2 - MathF.Cos(Main.GlobalTimeWrappedHourly * animationSpeed) * MathHelper.PiOver4 * 0.075f, new Vector2(segmentSprite.Width * 0.5f, segmentSprite.Height / 11), NPC.scale, SpriteEffects.None, 0f); + spriteBatch.Draw(segmentSprite, NPC.position + new Vector2(startX, MathF.Sin(wormTimer * animationSpeed) * 2 + startY), segmentSprite.Frame(1, 11, 0, 0), NPC.GetAlpha(drawColor), NPC.rotation - MathHelper.PiOver2 - MathF.Cos(wormTimer * animationSpeed) * MathHelper.PiOver4 * 0.075f, new Vector2(segmentSprite.Width * 0.5f, segmentSprite.Height / 11), NPC.scale, SpriteEffects.None, 0f); return false; } diff --git a/Utilities/NPCUtils.cs b/Utilities/NPCUtils.cs index 987e59f425..77b8af6dbd 100644 --- a/Utilities/NPCUtils.cs +++ b/Utilities/NPCUtils.cs @@ -847,6 +847,7 @@ namespace CalamityMod float startX = baseOffset.X; float startY = baseOffset.Y; SpriteEffects fx = flip ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + float wormTimer = npc.Calamity().bestiaryWormTimer; // Draw the body segments for (int i = segmentCount; i > 0; i--) { @@ -857,10 +858,10 @@ namespace CalamityMod // If two are passed in, alternate between them // If more are passed in, each iteration must correspond to a texture Texture2D toUse = bodyTextures.Length == 1 ? bodyTextures[0] : bodyTextures.Length == 2 ? (i % 2 == 0 ? bodyTextures[0] : bodyTextures[1]) : bodyTextures[i - 1]; - spriteBatch.Draw(toUse, npc.position + new Vector2(startX + bodyOffset, MathF.Sin((Main.GlobalTimeWrappedHourly + offset * i) * animationSpeed) * range + startY), toUse.Frame(1, 1, 0, 0), npc.GetAlpha(drawColor), npc.rotation - MathHelper.PiOver2 - MathF.Cos((Main.GlobalTimeWrappedHourly + offset * i) * animationSpeed) * MathHelper.PiOver4 * rotationStrength, toUse.Size () / 2, npc.scale, fx, 0f); + spriteBatch.Draw(toUse, npc.position + new Vector2(startX + bodyOffset, MathF.Sin((wormTimer + offset * i) * animationSpeed) * range + startY), toUse.Frame(1, 1, 0, 0), npc.GetAlpha(drawColor), npc.rotation - MathHelper.PiOver2 - MathF.Cos((wormTimer + offset * i) * animationSpeed) * MathHelper.PiOver4 * rotationStrength, toUse.Size () / 2, npc.scale, fx, 0f); } // Draw the head - spriteBatch.Draw(headTexture, npc.position + new Vector2(startX + headOffset, MathF.Sin((Main.GlobalTimeWrappedHourly - headSpeedOffset) * animationSpeed) * range + startY), npc.frame, npc.GetAlpha(drawColor), npc.rotation - MathHelper.PiOver2 - MathF.Cos((Main.GlobalTimeWrappedHourly - headSpeedOffset) * animationSpeed) * MathHelper.PiOver4 * rotationStrength, new Vector2(headTexture.Width * 0.5f, headTexture.Height), npc.scale, fx, 0f); + spriteBatch.Draw(headTexture, npc.position + new Vector2(startX + headOffset, MathF.Sin((wormTimer - headSpeedOffset) * animationSpeed) * range + startY), npc.frame, npc.GetAlpha(drawColor), npc.rotation - MathHelper.PiOver2 - MathF.Cos((wormTimer - headSpeedOffset) * animationSpeed) * MathHelper.PiOver4 * rotationStrength, new Vector2(headTexture.Width * 0.5f, headTexture.Height), npc.scale, fx, 0f); return false; } From 1c34d0457b9be5ed64b31d28b99d16d2b83ffbb9 Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Tue, 17 Sep 2024 02:32:05 -0700 Subject: [PATCH 036/133] DA left click rift ability --- ...Mods.CalamityMod.Items.Weapons.Melee.hjson | 2 + .../Mods.CalamityMod.Projectiles.Melee.hjson | 3 +- .../Melee/DeathsAscensionProjectile.cs | 20 +++++- Projectiles/Melee/DeathsAscensionRift.cs | 63 +++++++++++++++++++ Projectiles/Melee/DeathsAscensionSwing.cs | 23 ++++++- 5 files changed, 105 insertions(+), 6 deletions(-) create mode 100644 Projectiles/Melee/DeathsAscensionRift.cs diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index 718a849052..317205b112 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -337,6 +337,8 @@ DeathsAscension: { DisplayName: Death's Ascension Tooltip: ''' + Performs powerful soul-infused swings that create rifts on enemy hits which spew out swirls of scythes + Up to 4 rifts can exist at once Press to launch a barrage of homing scythes 'It feels just right in your grip... [c/660066:But the hands that wield it are not yours'] diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson index 8c875aa522..b1ab70b219 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson @@ -80,6 +80,7 @@ DarklightGreatswordSlashCreator.DisplayName: Darklight Greatsword Slash Creator DarkMasterBeam.DisplayName: Dark Master Beam DarkMasterClone.DisplayName: Dark Terrarian DeathsAscensionProjectile.DisplayName: Ascended Scythe +DeathsAscensionRift.DisplayName: Rift DecaysRetort.DisplayName: Decay's Retort DecaysRetortDash.DisplayName: Evisceration Lunge DemonBlast.DisplayName: Devil Fork @@ -111,6 +112,7 @@ Exoboom.DisplayName: Exoplasma Explosion ExtantAbhorrence.DisplayName: Extant Abhorrence ExtantAbhorrenceMonolith.DisplayName: Abhorrent Monolith FallenBlast.DisplayName: Fallen Paladin's Wrath +FallenExplosionSmall.DisplayName: Fallen Hammer Blast FallenPaladinsHammerEcho.DisplayName: Fallen Paladin's Hammer Echo FallenPaladinsHammerProj.DisplayName: Fallen Paladin's Hammer Feather.DisplayName: Feather @@ -298,4 +300,3 @@ WulfrumScrew.DisplayName: Wulfrum Screw WulfrumScrewdriverProj.DisplayName: Wulfrum Screwdriver YinYoDark.DisplayName: Dark Shard YinYoLight.DisplayName: Light Shard -FallenExplosionSmall.DisplayName: Fallen Hammer Blast diff --git a/Projectiles/Melee/DeathsAscensionProjectile.cs b/Projectiles/Melee/DeathsAscensionProjectile.cs index e5aea1d2fb..1ca641787a 100644 --- a/Projectiles/Melee/DeathsAscensionProjectile.cs +++ b/Projectiles/Melee/DeathsAscensionProjectile.cs @@ -1,4 +1,5 @@ -using CalamityMod.Buffs.DamageOverTime; +using System; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Projectiles.Healing; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -43,7 +44,22 @@ namespace CalamityMod.Projectiles.Melee Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.ShadowbeamStaff, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); } - CalamityUtils.HomeInOnNPC(Projectile, true, 900f, 18f, 20f); + if (Projectile.ai[2] <= 0) + { + CalamityUtils.HomeInOnNPC(Projectile, true, 1200f, 18f, 20f); + } + else + { + Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitY).RotatedBy(0.05f) * Projectile.velocity.Length(); + Projectile.ai[2]--; + } + + // Rift scythes cant pierce once when they start homing + if (Projectile.ai[2] == 1) + { + Projectile.penetrate = 1; + Projectile.localNPCHitCooldown = 1; + } } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Melee/DeathsAscensionRift.cs b/Projectiles/Melee/DeathsAscensionRift.cs new file mode 100644 index 0000000000..b2c905a2e0 --- /dev/null +++ b/Projectiles/Melee/DeathsAscensionRift.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using CalamityMod.CalPlayer; +using CalamityMod.Graphics.Metaballs; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + + +namespace CalamityMod.Projectiles.Melee +{ + public class DeathsAscensionRift : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Melee"; + + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public override void SetDefaults() + { + Projectile.width = 50; + Projectile.height = 50; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.timeLeft = 600; + Projectile.penetrate = -1; + Projectile.tileCollide = false; + } + + public override void AI() + { + int ballAmt = 20; + for (int i = 0; i < ballAmt; i++) + { + float offset = i * 5; + float sizeRandomness = MathHelper.Lerp(10, 0, (float)(i / (float)ballAmt)); + float positionRandomness = 20; + float scale = (MathHelper.Lerp(90, 10, (float)(i / (float)ballAmt)) + Main.rand.NextFloat(-sizeRandomness, sizeRandomness)) * Utils.GetLerpValue(600, 590, Projectile.timeLeft, true); ; + StreamGougeMetaball.SpawnParticle(Projectile.Center + Vector2.UnitY * (offset + Main.rand.NextFloat(-positionRandomness, positionRandomness)) , Vector2.Zero, scale); + StreamGougeMetaball.SpawnParticle(Projectile.Center + Vector2.UnitY * -(offset + Main.rand.NextFloat(-positionRandomness, positionRandomness)), Vector2.Zero, scale); + } + + if (Projectile.ai[0]++ % 60 == 0) + { + SoundEngine.PlaySound(SoundID.Item104 with { Pitch = 0.4f }, Projectile.Center); + SoundEngine.PlaySound(SoundID.Item71 with { Pitch = -0.4f }, Projectile.Center); + int scytheAmt = 4; + float speed = 30; + for (int i = 0; i < scytheAmt; i++) + { + Vector2 scytheVelocity = Vector2.UnitY.RotatedBy(MathHelper.Lerp(0, 3 * MathHelper.PiOver2, (float)(i / (float)(scytheAmt - 1))) + Projectile.ai[1]) * speed; + int revolveTime = 70; + int p = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, scytheVelocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.1f), Projectile.knockBack, Projectile.owner, ai2: revolveTime); + Main.projectile[p].penetrate = -1; + } + } + + Projectile.ai[1] += 0.1f; + } + public override bool? CanCutTiles() => false; + } +} diff --git a/Projectiles/Melee/DeathsAscensionSwing.cs b/Projectiles/Melee/DeathsAscensionSwing.cs index 40c38d118f..377fd0c2ed 100644 --- a/Projectiles/Melee/DeathsAscensionSwing.cs +++ b/Projectiles/Melee/DeathsAscensionSwing.cs @@ -1,4 +1,6 @@ -using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Graphics.Metaballs; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -47,8 +49,8 @@ namespace CalamityMod.Projectiles.Melee Projectile.tileCollide = false; Projectile.DamageType = TrueMeleeNoSpeedDamageClass.Instance; Projectile.ownerHitCheck = true; - Projectile.usesIDStaticNPCImmunity = true; - Projectile.idStaticNPCHitCooldown = 8; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 8; Projectile.frameCounter = 0; } @@ -112,6 +114,8 @@ namespace CalamityMod.Projectiles.Melee Owner.heldProj = Projectile.whoAmI; Owner.itemTime = 2; Owner.itemAnimation = 2; + + Projectile.ai[2]--; } // This hurt my soul to do, but because the swing is done with a sprite animation, tracking specific visual rotation of the weapon is nigh impossible @@ -162,5 +166,18 @@ namespace CalamityMod.Projectiles.Melee // Deal damage only once it starts swinging down and then going back up public override bool? CanDamage() => ((frameX == 0 && frameY >= 3) || frameX == 1); + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + if (Projectile.ai[2] <= 0 && Main.player[Projectile.owner].ownedProjectileCounts[ModContent.ProjectileType()] < 4) + { + Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center + Main.rand.NextVector2Circular(48, 48), Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + SoundEngine.PlaySound(SoundID.Item165 with { Pitch = -1 }, Projectile.Center); + Projectile.ai[2] = 20; + float screenShakePower = 3 * Utils.GetLerpValue(1300f, 0f, target.Distance(Main.LocalPlayer.Center), true); + if (Main.LocalPlayer.Calamity().GeneralScreenShakePower < screenShakePower) + Main.LocalPlayer.Calamity().GeneralScreenShakePower = screenShakePower; + } + } } } From 90c31b565fccfc6c43b32f4e9be2debfd6fc6fb2 Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Fri, 20 Sep 2024 18:07:45 -0700 Subject: [PATCH 037/133] significantly less messy --- Items/Weapons/Melee/DeathsAscension.cs | 6 +++ ...Mods.CalamityMod.Items.Weapons.Melee.hjson | 5 +- .../Melee/DeathsAscensionProjectile.cs | 10 +--- Projectiles/Melee/DeathsAscensionRift.cs | 50 +++++++++++++++---- Projectiles/Melee/DeathsAscensionSwing.cs | 4 +- 5 files changed, 51 insertions(+), 24 deletions(-) diff --git a/Items/Weapons/Melee/DeathsAscension.cs b/Items/Weapons/Melee/DeathsAscension.cs index 9377704d1e..91a171a7fc 100644 --- a/Items/Weapons/Melee/DeathsAscension.cs +++ b/Items/Weapons/Melee/DeathsAscension.cs @@ -86,6 +86,12 @@ namespace CalamityMod.Items.Weapons.Melee float SpeedY = velocity.Y + Main.rand.NextFloat(-spreadfactor, spreadfactor + 1); Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, (int)(damage * 0.125f), knockback, player.whoAmI); } + + foreach (Projectile p in Main.ActiveProjectiles) + { + if (p.type == ModContent.ProjectileType() && p.owner == player.whoAmI) + p.ai[0] = 1f; + } } else { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index 317205b112..05b3656b63 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -337,9 +337,10 @@ DeathsAscension: { DisplayName: Death's Ascension Tooltip: ''' - Performs powerful soul-infused swings that create rifts on enemy hits which spew out swirls of scythes - Up to 4 rifts can exist at once + Performs powerful soul-infused swings that create up to 4 rifts on enemy hits Press to launch a barrage of homing scythes + All active rifts will fire scythes along with you + Rift scythes orbit the rift when enemies are near and home when enemies are far 'It feels just right in your grip... [c/660066:But the hands that wield it are not yours'] ''' diff --git a/Projectiles/Melee/DeathsAscensionProjectile.cs b/Projectiles/Melee/DeathsAscensionProjectile.cs index 1ca641787a..029d9b6c7c 100644 --- a/Projectiles/Melee/DeathsAscensionProjectile.cs +++ b/Projectiles/Melee/DeathsAscensionProjectile.cs @@ -50,15 +50,7 @@ namespace CalamityMod.Projectiles.Melee } else { - Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitY).RotatedBy(0.05f) * Projectile.velocity.Length(); - Projectile.ai[2]--; - } - - // Rift scythes cant pierce once when they start homing - if (Projectile.ai[2] == 1) - { - Projectile.penetrate = 1; - Projectile.localNPCHitCooldown = 1; + Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitY).RotatedBy(0.1f) * 20; } } diff --git a/Projectiles/Melee/DeathsAscensionRift.cs b/Projectiles/Melee/DeathsAscensionRift.cs index b2c905a2e0..c6d07715b4 100644 --- a/Projectiles/Melee/DeathsAscensionRift.cs +++ b/Projectiles/Melee/DeathsAscensionRift.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using CalamityMod.CalPlayer; using CalamityMod.Graphics.Metaballs; using Microsoft.Xna.Framework; +using Mono.Cecil; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -23,9 +24,11 @@ namespace CalamityMod.Projectiles.Melee Projectile.height = 50; Projectile.friendly = true; Projectile.ignoreWater = true; - Projectile.timeLeft = 600; + Projectile.timeLeft = 300; Projectile.penetrate = -1; Projectile.tileCollide = false; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 30; } public override void AI() @@ -36,24 +39,49 @@ namespace CalamityMod.Projectiles.Melee float offset = i * 5; float sizeRandomness = MathHelper.Lerp(10, 0, (float)(i / (float)ballAmt)); float positionRandomness = 20; - float scale = (MathHelper.Lerp(90, 10, (float)(i / (float)ballAmt)) + Main.rand.NextFloat(-sizeRandomness, sizeRandomness)) * Utils.GetLerpValue(600, 590, Projectile.timeLeft, true); ; + float scale = (MathHelper.Lerp(90, 10, (float)(i / (float)ballAmt)) + Main.rand.NextFloat(-sizeRandomness, sizeRandomness)) * Utils.GetLerpValue(300, 290, Projectile.timeLeft, true); ; StreamGougeMetaball.SpawnParticle(Projectile.Center + Vector2.UnitY * (offset + Main.rand.NextFloat(-positionRandomness, positionRandomness)) , Vector2.Zero, scale); StreamGougeMetaball.SpawnParticle(Projectile.Center + Vector2.UnitY * -(offset + Main.rand.NextFloat(-positionRandomness, positionRandomness)), Vector2.Zero, scale); } - - if (Projectile.ai[0]++ % 60 == 0) + // When the weapon is swung fire scythes from the rift + if (Projectile.ai[0] >= 1) { SoundEngine.PlaySound(SoundID.Item104 with { Pitch = 0.4f }, Projectile.Center); SoundEngine.PlaySound(SoundID.Item71 with { Pitch = -0.4f }, Projectile.Center); - int scytheAmt = 4; - float speed = 30; - for (int i = 0; i < scytheAmt; i++) + + // If an enemy is close enough, do orbital scythes + NPC n = CalamityUtils.ClosestNPCAt(Projectile.Center, 320, true, true); + if (n != null) { - Vector2 scytheVelocity = Vector2.UnitY.RotatedBy(MathHelper.Lerp(0, 3 * MathHelper.PiOver2, (float)(i / (float)(scytheAmt - 1))) + Projectile.ai[1]) * speed; - int revolveTime = 70; - int p = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, scytheVelocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.1f), Projectile.knockBack, Projectile.owner, ai2: revolveTime); - Main.projectile[p].penetrate = -1; + int scytheAmt = 4; + float speed = 30; + for (int i = 0; i < scytheAmt; i++) + { + Vector2 scytheVelocity = Vector2.UnitY.RotatedBy(MathHelper.Lerp(0, 3 * MathHelper.PiOver2, (float)(i / (float)(scytheAmt - 1))) + Projectile.ai[1]) * speed; + if (Projectile.owner == Main.myPlayer) + { + int p = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, scytheVelocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.125f), Projectile.knockBack, Projectile.owner, ai2: 1); + Main.projectile[p].penetrate = -1; + Main.projectile[p].timeLeft = 65; + } + } } + // Otherwise shoot at the cursor + else + { + Vector2 direction = Projectile.Center.DirectionTo(Main.MouseWorld) * 12; + int spreadfactor = 9; + for (int index = 0; index < 4; ++index) + { + float SpeedX = direction.X + Main.rand.NextFloat(-spreadfactor, spreadfactor + 1); + float SpeedY = direction.Y + Main.rand.NextFloat(-spreadfactor, spreadfactor + 1); if (Projectile.owner == Main.myPlayer) + { + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, SpeedX, SpeedY, ModContent.ProjectileType(), (int)(Projectile.damage * 0.125f), Projectile.knockBack, Projectile.owner); + + } + } + } + Projectile.ai[0] = 0; } Projectile.ai[1] += 0.1f; diff --git a/Projectiles/Melee/DeathsAscensionSwing.cs b/Projectiles/Melee/DeathsAscensionSwing.cs index 377fd0c2ed..3be2c1b32f 100644 --- a/Projectiles/Melee/DeathsAscensionSwing.cs +++ b/Projectiles/Melee/DeathsAscensionSwing.cs @@ -171,9 +171,9 @@ namespace CalamityMod.Projectiles.Melee { if (Projectile.ai[2] <= 0 && Main.player[Projectile.owner].ownedProjectileCounts[ModContent.ProjectileType()] < 4) { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center + Main.rand.NextVector2Circular(48, 48), Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center + Main.rand.NextVector2Circular(48, 48), Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, ai1: Main.rand.NextFloat(0, 3f)); SoundEngine.PlaySound(SoundID.Item165 with { Pitch = -1 }, Projectile.Center); - Projectile.ai[2] = 20; + Projectile.ai[2] = 40; float screenShakePower = 3 * Utils.GetLerpValue(1300f, 0f, target.Distance(Main.LocalPlayer.Center), true); if (Main.LocalPlayer.Calamity().GeneralScreenShakePower < screenShakePower) Main.LocalPlayer.Calamity().GeneralScreenShakePower = screenShakePower; From 8734241230a73a40552dc07962a7ccb9c95bbaa8 Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Sat, 21 Sep 2024 01:49:35 -0700 Subject: [PATCH 038/133] only orbitals on spawn --- Items/Weapons/Melee/DeathsAscension.cs | 19 +++- ...Mods.CalamityMod.Items.Weapons.Melee.hjson | 5 +- .../Melee/DeathsAscensionProjectile.cs | 31 ++++-- Projectiles/Melee/DeathsAscensionRift.cs | 97 +++++++++++-------- Projectiles/Melee/DeathsAscensionSwing.cs | 13 +-- 5 files changed, 102 insertions(+), 63 deletions(-) diff --git a/Items/Weapons/Melee/DeathsAscension.cs b/Items/Weapons/Melee/DeathsAscension.cs index 91a171a7fc..819a5ab932 100644 --- a/Items/Weapons/Melee/DeathsAscension.cs +++ b/Items/Weapons/Melee/DeathsAscension.cs @@ -12,6 +12,18 @@ namespace CalamityMod.Items.Weapons.Melee public class DeathsAscension : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; + + public const int RiftLifeTime = 600; + + public const float OrbitalScytheDamageMult = 0.4f; + + public const float RiftScytheDamageMult = 0.125f; + + public const int RiftOrbitalAmount = 4; + + public const int ScytheShotAmount = 4; + + public override void SetStaticDefaults() { ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; @@ -80,17 +92,18 @@ namespace CalamityMod.Items.Weapons.Melee int spreadfactor = 9; if (player.altFunctionUse == 2f) { - for (int index = 0; index < 4; ++index) + for (int index = 0; index < ScytheShotAmount; ++index) { float SpeedX = velocity.X + Main.rand.NextFloat(-spreadfactor, spreadfactor + 1); float SpeedY = velocity.Y + Main.rand.NextFloat(-spreadfactor, spreadfactor + 1); Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, (int)(damage * 0.125f), knockback, player.whoAmI); } + // Tell the rift(s) to shoot foreach (Projectile p in Main.ActiveProjectiles) { - if (p.type == ModContent.ProjectileType() && p.owner == player.whoAmI) - p.ai[0] = 1f; + if (p.type == ModContent.ProjectileType() && p.owner == player.whoAmI && p.ai[0] <= 0) + p.ai[0] = 10f; // Cooldown before scythes can be shot again because right click code is cool and shoots twice without this } } else diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index 05b3656b63..445f9558dd 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -337,10 +337,9 @@ DeathsAscension: { DisplayName: Death's Ascension Tooltip: ''' - Performs powerful soul-infused swings that create up to 4 rifts on enemy hits + Performs powerful soul-infused swings that creates a rift orbited by scythes on enemy hits Press to launch a barrage of homing scythes - All active rifts will fire scythes along with you - Rift scythes orbit the rift when enemies are near and home when enemies are far + The rift will fire scythes along with you 'It feels just right in your grip... [c/660066:But the hands that wield it are not yours'] ''' diff --git a/Projectiles/Melee/DeathsAscensionProjectile.cs b/Projectiles/Melee/DeathsAscensionProjectile.cs index 029d9b6c7c..52e243df5b 100644 --- a/Projectiles/Melee/DeathsAscensionProjectile.cs +++ b/Projectiles/Melee/DeathsAscensionProjectile.cs @@ -1,11 +1,9 @@ -using System; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Projectiles.Healing; +using CalamityMod.Items.Weapons.Melee; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Melee { public class DeathsAscensionProjectile : ModProjectile, ILocalizedModType @@ -22,7 +20,7 @@ namespace CalamityMod.Projectiles.Melee { Projectile.width = 102; Projectile.height = 82; - Projectile.aiStyle = ProjAIStyleID.Sickle; + Projectile.aiStyle = -1; Projectile.friendly = true; Projectile.DamageType = DamageClass.Melee; Projectile.tileCollide = false; @@ -32,7 +30,6 @@ namespace CalamityMod.Projectiles.Melee Projectile.ignoreWater = true; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 30; - AIType = ProjectileID.DeathSickle; } public override void AI() @@ -44,25 +41,41 @@ namespace CalamityMod.Projectiles.Melee Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.ShadowbeamStaff, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); } + int startLife = Projectile.ai[2] > 0 ? DeathsAscension.RiftLifeTime : 180; + // Player scythes just home if (Projectile.ai[2] <= 0) { - CalamityUtils.HomeInOnNPC(Projectile, true, 1200f, 18f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 900f, 18f, 20f); + Projectile.velocity *= 0.96f; } + // Rift scythes have orbital motion else { Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitY).RotatedBy(0.1f) * 20; } + // Smoothly disappear + if (Projectile.timeLeft < 60) + { + Projectile.alpha += 3; + } + // Rotation direction stuff from the vanilla Death Sickle + if (Projectile.velocity.X < 0f) + { + Projectile.spriteDirection = -1; + } + Projectile.rotation += (float)Projectile.direction * 0.05f; + Projectile.rotation += (float)Projectile.direction * 0.5f * ((float)Projectile.timeLeft / startLife); } public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor * Projectile.Opacity, 2); return false; } public override Color? GetAlpha(Color lightColor) { - return new Color(150, 0, 200, 0); + return new Color(150, 0, 200, 0) * Projectile.Opacity; } } } diff --git a/Projectiles/Melee/DeathsAscensionRift.cs b/Projectiles/Melee/DeathsAscensionRift.cs index c6d07715b4..b844b8ba93 100644 --- a/Projectiles/Melee/DeathsAscensionRift.cs +++ b/Projectiles/Melee/DeathsAscensionRift.cs @@ -1,15 +1,11 @@ -using System; -using System.Collections.Generic; -using CalamityMod.CalPlayer; -using CalamityMod.Graphics.Metaballs; +using CalamityMod.Graphics.Metaballs; +using CalamityMod.Items.Weapons.Melee; using Microsoft.Xna.Framework; -using Mono.Cecil; using Terraria; using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; - namespace CalamityMod.Projectiles.Melee { public class DeathsAscensionRift : ModProjectile, ILocalizedModType @@ -24,7 +20,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.height = 50; Projectile.friendly = true; Projectile.ignoreWater = true; - Projectile.timeLeft = 300; + Projectile.timeLeft = DeathsAscension.RiftLifeTime; Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.usesLocalNPCImmunity = true; @@ -33,59 +29,76 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { + // Metaball visuals int ballAmt = 20; for (int i = 0; i < ballAmt; i++) { + // How far balls are between each other float offset = i * 5; + // Allows the rift to be rotated + Vector2 rotationOffset = Vector2.UnitY.RotatedBy(Projectile.rotation) * i; + // How random the sizing can get. Randomness is decreased as the balls get smaller float sizeRandomness = MathHelper.Lerp(10, 0, (float)(i / (float)ballAmt)); + // How random the positioning can get float positionRandomness = 20; - float scale = (MathHelper.Lerp(90, 10, (float)(i / (float)ballAmt)) + Main.rand.NextFloat(-sizeRandomness, sizeRandomness)) * Utils.GetLerpValue(300, 290, Projectile.timeLeft, true); ; - StreamGougeMetaball.SpawnParticle(Projectile.Center + Vector2.UnitY * (offset + Main.rand.NextFloat(-positionRandomness, positionRandomness)) , Vector2.Zero, scale); - StreamGougeMetaball.SpawnParticle(Projectile.Center + Vector2.UnitY * -(offset + Main.rand.NextFloat(-positionRandomness, positionRandomness)), Vector2.Zero, scale); + // Size decreases with each iteration as the balls are spawned further out. They also have some slight bubbly randomness and will scale in while the rift is spawning + float scale = (MathHelper.Lerp(90, 10, (float)(i / (float)ballAmt)) + Main.rand.NextFloat(-sizeRandomness, sizeRandomness)) * Utils.GetLerpValue(DeathsAscension.RiftLifeTime, DeathsAscension.RiftLifeTime - 10, Projectile.timeLeft, true); + // Spawn the metaballs. The first moves downwards while the other moves upwards + StreamGougeMetaball.SpawnParticle(Projectile.Center + Vector2.UnitY * (offset + Main.rand.NextFloat(-positionRandomness, positionRandomness)) + rotationOffset , Vector2.Zero, scale); + StreamGougeMetaball.SpawnParticle(Projectile.Center + Vector2.UnitY * -(offset + Main.rand.NextFloat(-positionRandomness, positionRandomness)) - rotationOffset, Vector2.Zero, scale); } + + // Spawn orbital scythes on spawn. These last until the rift dies. + if (Projectile.ai[2] == 0) + { + int scytheAmt = DeathsAscension.RiftOrbitalAmount; + float speed = 30; + for (int i = 0; i < scytheAmt; i++) + { + Vector2 scytheVelocity = Vector2.UnitY.RotatedBy(MathHelper.Lerp(0, 3 * MathHelper.PiOver2, (float)(i / (float)(scytheAmt - 1))) + Projectile.ai[1]) * speed; + if (Projectile.owner == Main.myPlayer) + { + int p = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, scytheVelocity, ModContent.ProjectileType(), (int)(Projectile.damage * DeathsAscension.OrbitalScytheDamageMult), Projectile.knockBack, Projectile.owner, ai2: 1); + + Main.projectile[p].penetrate = -1; + Main.projectile[p].timeLeft = DeathsAscension.RiftLifeTime; + } + } + Projectile.ai[2] = 1; + } + // When the weapon is swung fire scythes from the rift - if (Projectile.ai[0] >= 1) + if (Projectile.ai[0] == 10) { SoundEngine.PlaySound(SoundID.Item104 with { Pitch = 0.4f }, Projectile.Center); SoundEngine.PlaySound(SoundID.Item71 with { Pitch = -0.4f }, Projectile.Center); - // If an enemy is close enough, do orbital scythes - NPC n = CalamityUtils.ClosestNPCAt(Projectile.Center, 320, true, true); - if (n != null) + Vector2 direction = Projectile.Center.DirectionTo(Main.MouseWorld) * 12; + int spreadfactor = 9; + for (int index = 0; index < DeathsAscension.ScytheShotAmount; ++index) { - int scytheAmt = 4; - float speed = 30; - for (int i = 0; i < scytheAmt; i++) + float SpeedX = direction.X + Main.rand.NextFloat(-spreadfactor, spreadfactor + 1); + float SpeedY = direction.Y + Main.rand.NextFloat(-spreadfactor, spreadfactor + 1); + if (Projectile.owner == Main.myPlayer) { - Vector2 scytheVelocity = Vector2.UnitY.RotatedBy(MathHelper.Lerp(0, 3 * MathHelper.PiOver2, (float)(i / (float)(scytheAmt - 1))) + Projectile.ai[1]) * speed; - if (Projectile.owner == Main.myPlayer) - { - int p = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, scytheVelocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.125f), Projectile.knockBack, Projectile.owner, ai2: 1); - Main.projectile[p].penetrate = -1; - Main.projectile[p].timeLeft = 65; - } + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, SpeedX, SpeedY, ModContent.ProjectileType(), (int)(Projectile.damage * DeathsAscension.RiftScytheDamageMult), Projectile.knockBack, Projectile.owner); } } - // Otherwise shoot at the cursor - else - { - Vector2 direction = Projectile.Center.DirectionTo(Main.MouseWorld) * 12; - int spreadfactor = 9; - for (int index = 0; index < 4; ++index) - { - float SpeedX = direction.X + Main.rand.NextFloat(-spreadfactor, spreadfactor + 1); - float SpeedY = direction.Y + Main.rand.NextFloat(-spreadfactor, spreadfactor + 1); if (Projectile.owner == Main.myPlayer) - { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, SpeedX, SpeedY, ModContent.ProjectileType(), (int)(Projectile.damage * 0.125f), Projectile.knockBack, Projectile.owner); - - } - } - } - Projectile.ai[0] = 0; } - + + // Controls the rotational offset of orbital scythes Projectile.ai[1] += 0.1f; + + // Decrement scythe cooldown timer + if (Projectile.ai[0] > 0) + { + Projectile.ai[0]--; + } + } + + public override void OnKill(int timeLeft) + { + SoundEngine.PlaySound(CalPlayer.CalamityPlayer.DrownSound, Projectile.Center); } - public override bool? CanCutTiles() => false; } } diff --git a/Projectiles/Melee/DeathsAscensionSwing.cs b/Projectiles/Melee/DeathsAscensionSwing.cs index 3be2c1b32f..379f042834 100644 --- a/Projectiles/Melee/DeathsAscensionSwing.cs +++ b/Projectiles/Melee/DeathsAscensionSwing.cs @@ -1,6 +1,4 @@ -using CalamityMod.Graphics.Metaballs; -using CalamityMod.Items.Weapons.Melee; -using CalamityMod.Particles; +using CalamityMod.Items.Weapons.Melee; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -157,7 +155,8 @@ namespace CalamityMod.Projectiles.Melee Vector2 origin = texture.Size() / new Vector2(2f, 6f) * 0.5f; Rectangle frame = texture.Frame(2, 6, frameX, frameY); SpriteEffects spriteEffects = Projectile.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - Main.EntitySpriteDraw(texture, position, frame, lightColor, Projectile.rotation, origin, Projectile.scale, spriteEffects, 0); + Color playerPos = Lighting.GetColor(Main.LocalPlayer.position.ToTileCoordinates()); + Main.EntitySpriteDraw(texture, position, frame, playerPos, Projectile.rotation, origin, Projectile.scale, spriteEffects, 0); Main.EntitySpriteDraw(glowTexture.Value, position, frame, Color.White, Projectile.rotation, origin, Projectile.scale, spriteEffects, 0); return false; } @@ -169,9 +168,11 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - if (Projectile.ai[2] <= 0 && Main.player[Projectile.owner].ownedProjectileCounts[ModContent.ProjectileType()] < 4) + int maxRifts = 1; + if (Projectile.ai[2] <= 0 && Main.player[Projectile.owner].ownedProjectileCounts[ModContent.ProjectileType()] < maxRifts) { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center + Main.rand.NextVector2Circular(48, 48), Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, ai1: Main.rand.NextFloat(0, 3f)); + int p = Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center + Main.rand.NextVector2Circular(28, 28), Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, ai1: Main.rand.NextFloat(0, 3f)); + Main.projectile[p].rotation = Main.rand.NextFloat(-MathHelper.TwoPi, MathHelper.TwoPi); SoundEngine.PlaySound(SoundID.Item165 with { Pitch = -1 }, Projectile.Center); Projectile.ai[2] = 40; float screenShakePower = 3 * Utils.GetLerpValue(1300f, 0f, target.Distance(Main.LocalPlayer.Center), true); From 2f719065e5ba85666179d9c9ee3f88f76b38aed4 Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Sun, 29 Sep 2024 13:53:33 -0700 Subject: [PATCH 039/133] surface npc idle frames --- Items/Critters/ShroombleItem.png | Bin 301 -> 299 bytes NPCs/NormalNPCs/CladCrab.cs | 4 ++-- NPCs/NormalNPCs/CladCrab.png | Bin 2511 -> 2803 bytes NPCs/NormalNPCs/Shroomble.cs | 4 ++-- NPCs/NormalNPCs/Shroomble.png | Bin 798 -> 877 bytes 5 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Items/Critters/ShroombleItem.png b/Items/Critters/ShroombleItem.png index 67a5e736dce00f1598410481b48d78a28ca89c53..e34c2f2d46a3944bae5c6837b93342c76c4a72c7 100644 GIT binary patch delta 170 zcmV;b09F630;>X$iGRTW01m+cxRGn^0001hNkl%aW_Z#jv}gOb$v4v8KZ+D?jQv8io8b>hGdYtD)rA8cY zY8?zxrqfY85h)+J^0O3CeO`V+t);YfBSm^23edfap!aer;$HjoKoxzGEC^fD0@Yi& zR1F9|%lQF78KhYj+DP{nFlrL-#NK0rV~V`F20fPkf?rT_o` zNgyBq001MF5|Mlb zI_i~d%uDJ`shiWE!De}lW-+gpI5AV86#23BQ& zLL3>O!vVY>swFxL?smtcB?42TJ^s=A@q_+;Z#2pP4~O@6K*G@by9K|!f$^QZtEELx<>070Ex6L1cUP=_e` zBmkWO31w(NNx<2{&u73^CQHxcGaw(fVgS5-Oc1C;e-ju`9h?c!sW+UD4_h3Co4Deg zIWWqz#RQwmu-)#jzi7qTmsKtdf}fuTe|_2d{G|0WYeAK*&ri_L&pD7_!DyMF48a9Z zwn1k>LkN%7vJHTu?cH&(+#66f7^U4-KG>W2tu)zSZ{~TcKlJ3Gmq8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2jkOIY~_)_NG^V>b*m01sFo zj33t@TI*p@;{ayMP*5z|15bZG1cFjtm<0?<|A#$yt@RX$QE27_IKI$t*1DmyV3;8W zzPCi!zusCmJ3j|n{q^^*CN7yU=AeM4qboV&b^rrV;$%A zVn)GctPwrHD8Av*CTX$2Q(!Z?AeI`hgrXHaR898;*c)pu)2}ygWE3&upv}sA zM`eMbW!SCq!NAoeZFI$vts3-O^I-d< z7tNpu5I;4jQwAu+kpX|g0=A(-HLz+H zFj}@nWBc$WYyCwKlwcp8n1^QOc>oELBoh?U@L`BFnt|F|Ep-TFa6p?mq1DX1rQg|i z41gfFU$0XzlSAouwhx1#C9(hv2W}`>+dh2x&-}ae20000< KMNUMnLSTYaKm2z9 diff --git a/NPCs/NormalNPCs/Shroomble.cs b/NPCs/NormalNPCs/Shroomble.cs index 45548a73dc..5527aa4cfc 100644 --- a/NPCs/NormalNPCs/Shroomble.cs +++ b/NPCs/NormalNPCs/Shroomble.cs @@ -16,7 +16,7 @@ namespace CalamityMod.NPCs.NormalNPCs { public override void SetStaticDefaults() { - Main.npcFrameCount[NPC.type] = 7; + Main.npcFrameCount[NPC.type] = 8; Main.npcCatchable[NPC.type] = true; NPCID.Sets.CountsAsCritter[NPC.type] = true; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() @@ -130,7 +130,7 @@ namespace CalamityMod.NPCs.NormalNPCs if (NPC.velocity.X == 0f) { - NPC.frame.Y = frameHeight * 1; + NPC.frame.Y = 0; NPC.frameCounter = 0.0; return; } diff --git a/NPCs/NormalNPCs/Shroomble.png b/NPCs/NormalNPCs/Shroomble.png index 5388a66e890ffee6609ec1798879420d4942052c..d459a2529a3ecf1bf1af49a18139808bbf6feec0 100644 GIT binary patch delta 748 zcmVVi|K~z{r)t5n* zqc98w1DOzV{|k?cFSQ+GWU=f18xohFpDfid>Bq9vn;HC zS%(5hRMxt3tN_VF&pk*%9Jud1wVHuoE%}q=pm|x+sY#5KbdYi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--- ILEditing/BalancingILChanges.cs | 5 ++--- Items/Accessories/ProfanedSoulCrystal.cs | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ILEditing/BalancingILChanges.cs b/ILEditing/BalancingILChanges.cs index 8c02f23240..b431d906a3 100644 --- a/ILEditing/BalancingILChanges.cs +++ b/ILEditing/BalancingILChanges.cs @@ -1,6 +1,5 @@ using System; using CalamityMod.Balancing; -using CalamityMod.Items.Accessories; using Mono.Cecil.Cil; using MonoMod.Cil; using Terraria; @@ -16,8 +15,8 @@ namespace CalamityMod.ILEditing private static bool AdjustShimmerRequirements(On_ShimmerTransforms.orig_IsItemTransformLocked orig, int type) { - //Rod of Harmony / psc requires Draedong and SCal dead instead of Moon Lord. - if (type == ItemID.RodofDiscord || type == ModContent.ItemType()) + //Rod of Harmony requires Draedong and SCal dead instead of Moon Lord. + if (type == ItemID.RodofDiscord) { return !DownedBossSystem.downedCalamitas || !DownedBossSystem.downedExoMechs; } diff --git a/Items/Accessories/ProfanedSoulCrystal.cs b/Items/Accessories/ProfanedSoulCrystal.cs index 6b1abc7d86..f73429b6d8 100644 --- a/Items/Accessories/ProfanedSoulCrystal.cs +++ b/Items/Accessories/ProfanedSoulCrystal.cs @@ -522,6 +522,7 @@ namespace CalamityMod.Items.Accessories AddIngredient(50). AddIngredient(100). AddTile(). + AddDecraftCondition(CalamityConditions.DownedSupremeCalamitas, CalamityConditions.DownedExoMechs). Register(); } } From a698cec06100d0f2a9457ce5a30257967e319211 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 29 Sep 2024 17:09:39 -0400 Subject: [PATCH 041/133] fix broken EoW grenade IL edit --- ILEditing/BalancingILChanges.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ILEditing/BalancingILChanges.cs b/ILEditing/BalancingILChanges.cs index b431d906a3..3162a2dc91 100644 --- a/ILEditing/BalancingILChanges.cs +++ b/ILEditing/BalancingILChanges.cs @@ -478,14 +478,15 @@ namespace CalamityMod.ILEditing return; } } - if (!cursor.TryGotoNext(MoveType.After, i => i.MatchDiv())) + if (!cursor.TryGotoNext(MoveType.AfterLabel, i => i.MatchDiv())) { LogFailure("Reduce EoW Grenade Resist", "Could not move to the resist factor."); return; } - // Remove the instruction dividing by 5, and replace it with an instruction multiplying by 0.4. - cursor.RemoveRange(2); + // Remove the division instruction, then pop the 5 off the stack to destroy it. Replace it with loading a 0.4 and then multiplying by it. + cursor.Remove(); + cursor.EmitPop(); cursor.EmitLdcR4(0.4f); cursor.EmitMul(); } From d18d5bb16636f23416d9ac6d784bcc1702a7071f Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Sun, 29 Sep 2024 14:41:03 -0700 Subject: [PATCH 042/133] Crown Jewel (item) resprite --- Items/Accessories/CrownJewel.png | Bin 474 -> 319 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/Items/Accessories/CrownJewel.png b/Items/Accessories/CrownJewel.png index 326c657ab4d560083e982a1663d2ff64f1d0e547..76ebab01801817fb16894ebe3a84594d302cea00 100644 GIT binary patch delta 303 zcmcb`yq{@;WIZzj1B0Sx#ZDl_SRCZ;#IWw1%u67LCEd~2k%3`jKlh(RRv=#@z$e6Y zzPd?>f|jwQ*8gg`=a$a@UnTzEYygzpwxX&MNO6<|`33)n0ETanMpkR}yi(`mJaPOsu^?ZjFINSm+lHLK0ij7mK~zYIy_UUB0zni;&jJymCMIh_+|B|U z6ANQQZM6w453ny_XnY1=KpudGj+VsA8Vf^VVk3zq#)1T+1PnhGGk4dST|?vS*X$0= z%%1t?&YkO_)jU20;Ji`+U^t&|$k6M;Z0{BD0KV3${WyLGpns4x_&?+cX;3HvFkY`V z0JlK^z};kO4CpUrMq5^3lRG0W*`7Aay8s+rzNj9(Y9^`l>oXJb&2Msd#6l{b#-w#0 zfQWbfRC>EVF=v>lhfVH|SYG1Y*PceLGXOf*PsV`IHz%;Y7r7_irqDkCl9feGM3(7qq)X@C~lDKYb&-3$Gb~$1PNRx`!3{<=~%GJz?-4mzc zaiEVBiYO-4N=~5Vy;go6%kIJ_kR}z+<#$2b&lD$Xy=L*ToonCgF zZc~25aTL^-KyrhmZVs*Z?#s>NTB+y(v_ED>2 zi`*vLM(Vs0^5o?rP&Hhwq-wa)a+O(a+RDA!`~m2>qG?Kho`?Vd002ovPDHLkV1j0n B++_d& From 9939a21f370697db2a36dd44b772704596455797 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sun, 29 Sep 2024 18:33:39 -0400 Subject: [PATCH 043/133] Long overdue RPC nerf --- Items/Weapons/Magic/RainbowPartyCannon.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Magic/RainbowPartyCannon.cs b/Items/Weapons/Magic/RainbowPartyCannon.cs index caeb8f03cb..e496dd6214 100644 --- a/Items/Weapons/Magic/RainbowPartyCannon.cs +++ b/Items/Weapons/Magic/RainbowPartyCannon.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 52; Item.height = 30; - Item.damage = 225; + Item.damage = 175; Item.DamageType = DamageClass.Magic; Item.mana = 25; Item.crit += 4; From ea707be670c2b30eb2cd664b40c936a210187a34 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Mon, 23 Sep 2024 19:46:13 +0900 Subject: [PATCH 044/133] Basic System and BlendSheet Generation Done --- Systems/TileMerging/DataStructures.cs | 231 ++++++++++++++ Systems/TileMerging/TileBlendMergeSystem.cs | 249 ++++++++++++++++ .../TileMerging/TileBlendMergeSystem_Draw.cs | 36 +++ .../TileBlendMergeSystem_GlobalTile.cs | 65 ++++ .../TileBlendMergeSystem_SheetLookup.cs | 281 ++++++++++++++++++ .../TileBlendMergeSystem_TileFrame.cs | 36 +++ 6 files changed, 898 insertions(+) create mode 100644 Systems/TileMerging/DataStructures.cs create mode 100644 Systems/TileMerging/TileBlendMergeSystem.cs create mode 100644 Systems/TileMerging/TileBlendMergeSystem_Draw.cs create mode 100644 Systems/TileMerging/TileBlendMergeSystem_GlobalTile.cs create mode 100644 Systems/TileMerging/TileBlendMergeSystem_SheetLookup.cs create mode 100644 Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs diff --git a/Systems/TileMerging/DataStructures.cs b/Systems/TileMerging/DataStructures.cs new file mode 100644 index 0000000000..1827bf7d87 --- /dev/null +++ b/Systems/TileMerging/DataStructures.cs @@ -0,0 +1,231 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Terraria; +using Terraria.DataStructures; + +namespace CalamityMod.Systems +{ + // bit to relative tile pos for reference + // MSB 0->7 LSB + // 4 0 5 + // 2 X 3 + // 6 1 7 + + // NE N NW + // + // E □ W + // + // SE S SW + + public enum MergeSideFlags : byte + { + None = 0, + + Up = 0b1000_0000, + Down = 0b0100_0000, + Right = 0b0010_0000, + Left = 0b0001_0000, + UpLeft = 0b0000_1000, + UpRight = 0b0000_0100, + DownLeft = 0b0000_0010, + DownRight = 0b0000_0001, + + AllSide = 0b1111_1111, + + // Special Shapes + Shape_AllSide = AllSide, + ShapeCorner_UpLeft = UpLeft, + ShapeCorner_UpRight = UpRight, + ShapeCorner_DownLeft = DownLeft, + ShapeCorner_DownRight = DownRight, + + // I Shapes + + ShapeI_Up = Up | UpLeft | UpRight, + ShapeI_Up_End = Up, + ShapeI_Up_LeftEnd = Up | UpRight, + ShapeI_Up_RightEnd = Up | UpLeft, + + ShapeI_Down = Down | DownLeft | DownRight, + ShapeI_Down_End = Down, + ShapeI_Down_LeftEnd = Down | DownRight, + ShapeI_Down_RightEnd = Down | DownLeft, + + ShapeI_Left = Left | UpLeft | DownLeft, + ShapeI_Left_End = Left, + ShapeI_Left_UpEnd = Left | DownLeft, + ShapeI_Left_DownEnd = Left | UpLeft, + + ShapeI_Right = Right | UpRight | DownRight, + ShapeI_Right_End = Right, + ShapeI_Right_UpEnd = Right | DownRight, + ShapeI_Right_DownEnd = Right | UpRight, + + // L Shapes + + ShapeL_UpLeft = ShapeI_Up | ShapeI_Left, + ShapeL_UpLeft_End = ShapeI_Up_End | ShapeI_Left_End | UpLeft, + ShapeL_UpLeft_RightEnd = ShapeI_Up_RightEnd | ShapeI_Left, + ShapeL_UpLeft_DownEnd = ShapeI_Up | ShapeI_Left_DownEnd, + + ShapeL_UpRight = ShapeI_Up | ShapeI_Right, + ShapeL_UpRight_End = ShapeI_Up_End | ShapeI_Right_End | UpRight, + ShapeL_UpRight_LeftEnd = ShapeI_Up_End | ShapeI_Right, + ShapeL_UpRight_DownEnd = ShapeI_Up | ShapeI_Right_End, + + ShapeL_DownLeft = ShapeI_Down | ShapeI_Left, + ShapeL_DownLeft_End = ShapeI_Down_End | ShapeI_Left_End | DownLeft, + ShapeL_DownLeft_RightEnd = ShapeI_Down_End | ShapeI_Left, + ShapeL_DownLeft_UpEnd = ShapeI_Down | ShapeI_Left_End, + + ShapeL_DownRight = ShapeI_Down | ShapeI_Right, + ShapeL_DownRight_End = ShapeI_Down_End | ShapeI_Right_End | DownRight, + ShapeL_DownRight_LeftEnd = ShapeI_Down_End | ShapeI_Right, + ShapeL_DownRight_UpEnd = ShapeI_Down | ShapeI_Right_End, + + // U Shapes + + ShapeU_UpEmpty = ShapeI_Left | ShapeI_Right | ShapeI_Down, + ShapeU_UpEmpty_End = ShapeI_Left_End | ShapeI_Right_End | ShapeI_Down, + ShapeU_UpEmpty_LeftEnd = ShapeI_Left_End | ShapeI_Right | ShapeI_Down, + ShapeU_UpEmpty_RightEnd = ShapeI_Left | ShapeI_Right_End | ShapeI_Down, + + ShapeU_DownEmpty = ShapeI_Left | ShapeI_Right | ShapeI_Up, + ShapeU_DownEmpty_End = ShapeI_Left_End | ShapeI_Right_End | ShapeI_Up, + ShapeU_DownEmpty_LeftEnd = ShapeI_Left_End | ShapeI_Right | ShapeI_Up, + ShapeU_DownEmpty_RightEnd = ShapeI_Left | ShapeI_Right_End | ShapeI_Up, + + ShapeU_LeftEmpty = ShapeI_Up | ShapeI_Down | ShapeI_Right, + ShapeU_LeftEmpty_End = ShapeI_Up_End | ShapeI_Down_End | ShapeI_Right, + ShapeU_LeftEmpty_UpEnd = ShapeI_Up_End | ShapeI_Down | ShapeI_Right, + ShapeU_LeftEmpty_DownEnd = ShapeI_Up | ShapeI_Down_End | ShapeI_Right, + + ShapeU_RightEmpty = ShapeI_Up | ShapeI_Down | ShapeI_Left, + ShapeU_RightEmpty_End = ShapeI_Up | ShapeI_Down | ShapeI_Left, + ShapeU_RightEmpty_UpEnd = ShapeI_Up_End | ShapeI_Down | ShapeI_Left, + ShapeU_RightEmpty_DownEnd = ShapeI_Up | ShapeI_Down_End | ShapeI_Left, + } + + public enum MergeTextureID : byte + { + Everything = 0, + + AbyssGravel, + Ash, + AstralDirt, + AstralSand, + AstralSandstone, + AstralSnow, + BrimstoneSlag, + Cloud, + Dirt, + EutrophicSand, + HardenedSand, + HardenedSulphurousSandstone, + Luminite, + Mud, + Navystone, + PyreMantle, + RainCloud, + Sand, + Sandstone, + SnowCloud, + Snow, + Stone, + SulphurousSand, + SulphurousSandstone, + SulphurousShale, + Voidstone + } + + public struct TileBlendingData : ITileData + { + private byte SheetIndex0; + private byte SheetIndex1; + private byte SheetIndex2; + private byte SheetIndex3; + private byte SheetIndex4; + private byte SheetIndex5; + private byte SheetIndex6; + private byte SheetIndex7; + + private byte Data0; + private byte Data1; + private byte Data2; + private byte Data3; + private byte Data4; + private byte Data5; + private byte Data6; + private byte Data7; + + public void Clear() + { + for (int i = 0; i<8; i++) + { + SetData(i, 0); + SetSheetIndex(i, TileBlendMergeSystem.EmptySheetIndex); + } + } + + public void SetData(int idx, byte data) + { + if (idx == 0) Data0 = data; + else if (idx == 1) Data1 = data; + else if (idx == 2) Data2 = data; + else if (idx == 3) Data3 = data; + else if (idx == 4) Data4 = data; + else if (idx == 5) Data5 = data; + else if (idx == 6) Data6 = data; + else if (idx == 7) Data7 = data; + else throw new IndexOutOfRangeException(); + } + + public readonly byte GetData(int idx) + { + return idx switch + { + 0 => Data0, + 1 => Data1, + 2 => Data2, + 3 => Data3, + 4 => Data4, + 5 => Data5, + 6 => Data6, + 7 => Data7, + _ => throw new IndexOutOfRangeException() + }; + } + + public void SetSheetIndex(int idx, byte sheetIdx) + { + if (idx == 0) SheetIndex0 = sheetIdx; + else if (idx == 1) SheetIndex1 = sheetIdx; + else if (idx == 2) SheetIndex2 = sheetIdx; + else if (idx == 3) SheetIndex3 = sheetIdx; + else if (idx == 4) SheetIndex4 = sheetIdx; + else if (idx == 5) SheetIndex5 = sheetIdx; + else if (idx == 6) SheetIndex6 = sheetIdx; + else if (idx == 7) SheetIndex7 = sheetIdx; + else throw new IndexOutOfRangeException(); + } + + public readonly byte GetSheetIndex(int idx) + { + return idx switch + { + 0 => SheetIndex0, + 1 => SheetIndex1, + 2 => SheetIndex2, + 3 => SheetIndex3, + 4 => SheetIndex4, + 5 => SheetIndex5, + 6 => SheetIndex6, + 7 => SheetIndex7, + _ => throw new IndexOutOfRangeException() + }; + } + } +} diff --git a/Systems/TileMerging/TileBlendMergeSystem.cs b/Systems/TileMerging/TileBlendMergeSystem.cs new file mode 100644 index 0000000000..da0f40340f --- /dev/null +++ b/Systems/TileMerging/TileBlendMergeSystem.cs @@ -0,0 +1,249 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Graphics; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using MonoMod.Utils; +using ReLogic.Content; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using static CalamityMod.NPCs.SunkenSea.PolypPanasea; + +namespace CalamityMod.Systems +{ + [Autoload(Side = ModSide.Client)] + public sealed partial class TileBlendMergeSystem : ModSystem + { + public const byte EmptySheetIndex = 0; + public const int VariantCount = 3; + + public const int BakedBlendTextureWidth = 18 * 16; + public const int BakedBlendTextureHeight = 18 * 16; + + private static Asset[] _MergeTextures; + private static ManagedRenderTarget[,] _BakedBlendTextures; + private static int _MaxTilesX; + private static int _MaxTilesY; + + private static IEnumerable AllMergeTextureIDs => Enum.GetValues().Where(v => v != MergeTextureID.Everything); + + #region Load/Unload + public override void OnModLoad() + { + _MergeTextures = new Asset[256]; + _BakedBlendTextures = new ManagedRenderTarget[256, 3]; + + foreach (var idValue in AllMergeTextureIDs) + { + var name = Enum.GetName(idValue); + var ID = (int)idValue; + _MergeTextures[ID] = ModContent.Request($"CalamityMod/Tiles/Merges/{name}Merge"); + + Main.QueueMainThreadAction(() => + { + for (int v = 0; v < VariantCount; v++) + _BakedBlendTextures[ID, v] = new ManagedRenderTarget(false, BlendSheetRTCondition); + }); + } + } + + public override void PostSetupContent() + { + CalamityMod.Instance.Logger.Error("PostSetupContent"); + } + + private static void SetupMergeData() + { + CalamityMod.Instance.Logger.Error("SetupMerge"); + Main.QueueMainThreadAction(() => + { + foreach (var id in AllMergeTextureIDs) + { + BakeBlendTexture(id, _MergeTextures[(int)id].Value); + } + }); + } + + public override void Unload() + { + if (_MergeTextures is not null) + { + Array.Clear(_MergeTextures); + } + + if (_BakedBlendTextures is not null) + { + foreach (var rt in _BakedBlendTextures) + { + if (rt is null) + continue; + + if (rt.IsDisposed) + continue; + + rt.Dispose(); + } + + Array.Clear(_BakedBlendTextures); + } + + _MergeTextures = null; + _BakedBlendTextures = null; + } + #endregion + + #region World Load/Unload + public override void OnWorldLoad() + { + _MaxTilesX = Main.maxTilesX; + _MaxTilesY = Main.maxTilesY; + } + + public override void OnWorldUnload() + { + _MaxTilesX = 0; + _MaxTilesY = 0; + } + #endregion + + #region Public API + public static void ReplaceTexture(MergeTextureID textureID, Texture2D texture) + { + if (textureID == MergeTextureID.Everything) + throw new ArgumentOutOfRangeException(nameof(textureID), "MergeTextureID.Everything is not allowed to use in here!"); + + if (!Enum.IsDefined(textureID)) + throw new ArgumentOutOfRangeException(nameof(textureID), $"{textureID} is Invalid MergeTextureID!"); + + BakeBlendTexture(textureID, texture); + } + #endregion + + #region Sheet Baking Process + private static void BakeBlendTexture(MergeTextureID textureToBake, Texture2D texture) + { + if (!Enum.IsDefined(textureToBake)) + throw new ArgumentOutOfRangeException(nameof(textureToBake), $"{textureToBake} is Invalid MergeTextureID!"); + + if (texture == null) + throw new ArgumentNullException(nameof(texture), "Texture is Null!"); + + if (texture.IsDisposed) + throw new ArgumentException(paramName: nameof(texture), message: "Texture is Disposed!"); + + for (int v = 0; v < VariantCount; v++) + { + var renderTarget = _BakedBlendTextures[(int)textureToBake, v]; + var graphicsDevice = Main.instance.GraphicsDevice; + graphicsDevice.SetRenderTarget(renderTarget); + graphicsDevice.Clear(Color.Transparent); + + Main.spriteBatch.SafeBegin(SpriteSortMode.Immediate, BatchSetting.AlphaBlend, null, Matrix.Identity, () => + { + for (int i = 0; i < 256; i++) + { + int y = Math.DivRem(i, 16, out int x); + var drawPos = new Vector2(18 * x, 18 * y); + + var mergeSides = (MergeSideFlags)i; + + // Easy cases, It match on Shape Lookup Sheet + if (_ShapeLookup.TryGetValue(mergeSides, out var rects)) + { + Main.spriteBatch.Draw(texture, drawPos, rects[v], Color.White, 0.0f, Vector2.Zero, 1.0f, SpriteEffects.None, 0.0f); + continue; + } + + var extractedShapes = ConsumeMergeSides(mergeSides); + foreach (var shape in extractedShapes) + { + if (_ShapeLookup.TryGetValue(shape, out var shapeRects)) + { + Main.spriteBatch.Draw(texture, drawPos, shapeRects[v], Color.White, 0.0f, Vector2.Zero, 1.0f, SpriteEffects.None, 0.0f); + } + } + } + }); + + graphicsDevice.SetRenderTarget(null); + +#if DEBUG + var pngPath = $"C:\\baked\\{textureToBake}_{v}.png"; + var fs = File.Open(pngPath, FileMode.Create, FileAccess.ReadWrite); + renderTarget.Target.SaveAsPng(fs, BakedBlendTextureWidth, BakedBlendTextureHeight); + fs.Close(); + fs.Dispose(); +#endif + } + } + + private static IEnumerable ConsumeMergeSides(MergeSideFlags sideFlags) + { + if (sideFlags == MergeSideFlags.None) + yield break; + + IEnumerable> shapes = [ + _U_Shapes, + _L_Shapes, + _I_Shapes, // I shape includes up, down, left, right + _Corner_Shapes + ]; + + foreach (var shapeGroup in shapes) + { + foreach (var shape in shapeGroup.OrderByDescending(HotFlagCount)) + { + if ((shape & sideFlags) == shape) + { + // Consume Shape it given and push the extracted shape + sideFlags &= ~shape; + yield return shape; + } + } + + if (sideFlags == MergeSideFlags.None) + yield break; + } + yield break; + } + #endregion + + #region Utils + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static bool InValidRange(int i, int j) + { + if (i < 0 || i >= _MaxTilesX) return false; + if (j < 0 || j >= _MaxTilesY) return false; + return true; + } + + private static RenderTarget2D BlendSheetRTCondition(int width, int height) + { + return new(Main.instance.GraphicsDevice, BakedBlendTextureWidth, BakedBlendTextureHeight); + } + + private static int HotFlagCount(MergeSideFlags flags) + { + var count = 0; + for(int i = 0; i<8; i++) + { + var flag = (MergeSideFlags)(1 << i); + if (flag == (flags & flag)) + { + count++; + } + } + return count; + } + #endregion + } +} diff --git a/Systems/TileMerging/TileBlendMergeSystem_Draw.cs b/Systems/TileMerging/TileBlendMergeSystem_Draw.cs new file mode 100644 index 0000000000..c4a654961e --- /dev/null +++ b/Systems/TileMerging/TileBlendMergeSystem_Draw.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.Xna.Framework.Graphics; +using Terraria.DataStructures; +using Terraria; +using Terraria.ModLoader; +using Microsoft.Xna.Framework; + +namespace CalamityMod.Systems +{ + public sealed partial class TileBlendMergeSystem : ModSystem + { + private static void DrawEffects(int i, int j, int type, SpriteBatch spriteBatch, ref TileDrawInfo drawData) + { + if (!InValidRange(i, j)) + return; + + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); + Vector2 drawPos = new Vector2(i * 16, j * 16) - Main.screenPosition + zero; + Color drawColor = drawData.tileLight; + for (int idx = 0; idx < 8; idx++) + { + var data = drawData.tileCache.Get().GetData(idx); + var sheetIdx = drawData.tileCache.Get().GetSheetIndex(idx); + if (sheetIdx == EmptySheetIndex) + continue; + + //var rect = new Rectangle(x, y, 16, 16); + //spriteBatch.Draw(texture, drawPos, rect, drawColor, rotation: 0.0f, origin: default, scale: 1.0f, SpriteEffects.None, layerDepth: 0.0f); + } + } + } +} diff --git a/Systems/TileMerging/TileBlendMergeSystem_GlobalTile.cs b/Systems/TileMerging/TileBlendMergeSystem_GlobalTile.cs new file mode 100644 index 0000000000..cb9326338a --- /dev/null +++ b/Systems/TileMerging/TileBlendMergeSystem_GlobalTile.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public sealed partial class TileBlendMergeSystem : ModSystem + { + #region Don't mind this, This is a small GlobalTile for hooks + [Autoload(Side = ModSide.Client)] + private class FancyTileMergeGlobalTile : GlobalTile + { + public Dictionary _TypesCounter = new(); + + [SuppressMessage("Simplify Method Call", "IDE0002", Justification = "Leave this alone for Consistency")] + public override void PostSetupTileMerge() + { + TileBlendMergeSystem.SetupMergeData(); + } + + public override bool TileFrame(int i, int j, int type, ref bool resetFrame, ref bool noBreak) + { + if (_TypesCounter.ContainsKey(type)) + _TypesCounter[type]++; + else + _TypesCounter[type] = 1; + + TileBlendMergeSystem.TileFrame(i, j, type); + return base.TileFrame(i, j, type, ref resetFrame, ref noBreak); + } + + public override void DrawEffects(int i, int j, int type, SpriteBatch spriteBatch, ref TileDrawInfo drawData) + { + TileBlendMergeSystem.DrawEffects(i, j, type, spriteBatch, ref drawData); + } + + public override void AnimateTile() + { + Main.NewText($"- {_TypesCounter.Count} - "); + foreach (var entry in _TypesCounter) + { + + var mod = TileLoader.GetTile(entry.Key); + if (mod is not null) + { + Main.NewText($"{mod.Name} {entry.Value}"); + } + else + { + Main.NewText($"{entry.Key} {entry.Value}"); + } + } + _TypesCounter.Clear(); + } + } + #endregion + } +} diff --git a/Systems/TileMerging/TileBlendMergeSystem_SheetLookup.cs b/Systems/TileMerging/TileBlendMergeSystem_SheetLookup.cs new file mode 100644 index 0000000000..4d815d5d92 --- /dev/null +++ b/Systems/TileMerging/TileBlendMergeSystem_SheetLookup.cs @@ -0,0 +1,281 @@ +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using Microsoft.Xna.Framework; +using Terraria.ModLoader; + +using static CalamityMod.Systems.MergeSideFlags; + +namespace CalamityMod.Systems +{ + public sealed partial class TileBlendMergeSystem : ModSystem + { + #region Sheet Rects + // I HATE THIS GAME I HATE THIS GAME I HATE THIS GAME I HATE THIS GAME I HATE THIS GAME + // I HATE THIS GAME I HATE THIS GAME I HATE THIS GAME I HATE THIS GAME I HATE THIS GAME + // I HATE THIS GAME I HATE THIS GAME I HATE THIS GAME I HATE THIS GAME I HATE THIS GAME + + // + // I shapes (16 variants) + // + + private static readonly Rectangle[] _I_Up = Create3RectsDirX(1, 2); + private static readonly Rectangle[] _I_Up_End = Create3RectsDirX(8, 6); + private static readonly Rectangle[] _I_Up_LeftEnd = Create3RectsDirY(6, 6); + private static readonly Rectangle[] _I_Up_RightEnd = Create3RectsDirY(7, 6); + + private static readonly Rectangle[] _I_Down = Create3RectsDirX(1, 0); + private static readonly Rectangle[] _I_Down_End = Create3RectsDirX(8, 3); + private static readonly Rectangle[] _I_Down_LeftEnd = Create3RectsDirY(6, 3); + private static readonly Rectangle[] _I_Down_RightEnd = Create3RectsDirY(7, 3); + + private static readonly Rectangle[] _I_Left = Create3RectsDirY(4, 0); + private static readonly Rectangle[] _I_Left_End = Create3RectsDirY(8, 0); + private static readonly Rectangle[] _I_Left_UpEnd = Create3RectsDirX(3, 9); + private static readonly Rectangle[] _I_Left_DownEnd = Create3RectsDirX(3, 10); + + private static readonly Rectangle[] _I_Right = Create3RectsDirY(0, 0); + private static readonly Rectangle[] _I_Right_End = Create3RectsDirY(5, 0); + private static readonly Rectangle[] _I_Right_UpEnd = Create3RectsDirX(0, 9); + private static readonly Rectangle[] _I_Right_DownEnd = Create3RectsDirX(0, 10); + + // + // L shapes (16 variants) + // + + private static readonly Rectangle[] _L_UpLeft = Create3RectsDirX(0, 5, increment: 2); + private static readonly Rectangle[] _L_UpLeft_End = Create3RectsDirX(0, 7, increment: 2); + private static readonly Rectangle[] _L_UpLeft_RightEnd = Create3RectsDirY(11, 3, increment: 2); + private static readonly Rectangle[] _L_UpLeft_DownEnd = Create3RectsDirY(13, 3, increment: 2); + + + private static readonly Rectangle[] _L_UpRight = Create3RectsDirX(1, 5, increment: 2); + private static readonly Rectangle[] _L_UpRight_End = Create3RectsDirX(1, 7, increment: 2); + private static readonly Rectangle[] _L_UpRight_LeftEnd = Create3RectsDirY(12, 3, increment: 2); + private static readonly Rectangle[] _L_UpRight_DownEnd = Create3RectsDirY(14, 3, increment: 2); + + + private static readonly Rectangle[] _L_DownLeft = Create3RectsDirX(0, 6, increment: 2); + private static readonly Rectangle[] _L_DownLeft_End = Create3RectsDirX(0, 8, increment: 2); + private static readonly Rectangle[] _L_DownLeft_RightEnd = Create3RectsDirY(11, 4, increment: 2); + private static readonly Rectangle[] _L_DownLeft_UpEnd = Create3RectsDirY(13, 4, increment: 2); + + + private static readonly Rectangle[] _L_DownRight = Create3RectsDirX(1, 6, increment: 2); + private static readonly Rectangle[] _L_DownRight_End = Create3RectsDirX(1, 8, increment: 2); + private static readonly Rectangle[] _L_DownRight_LeftEnd = Create3RectsDirY(12, 4, increment: 2); + private static readonly Rectangle[] _L_DownRight_UpEnd = Create3RectsDirY(14, 4, increment: 2); + + // + // U shapes (16 variants) + // + + private static readonly Rectangle[] _U_UpEmpty = Create3RectsDirX(8, 5); + private static readonly Rectangle[] _U_UpEmpty_End = Create3RectsDirX(8, 8); + private static readonly Rectangle[] _U_UpEmpty_LeftEnd = Create3RectsDirX(8, 10); + private static readonly Rectangle[] _U_UpEmpty_RightEnd = Create3RectsDirX(11, 10); + + private static readonly Rectangle[] _U_DownEmpty = Create3RectsDirX(8, 4); + private static readonly Rectangle[] _U_DownEmpty_End = Create3RectsDirX(8, 7); + private static readonly Rectangle[] _U_DownEmpty_LeftEnd = Create3RectsDirX(8, 9); + private static readonly Rectangle[] _U_DownEmpty_RightEnd = Create3RectsDirX(11, 9); + + private static readonly Rectangle[] _U_LeftEmpty = Create3RectsDirY(7, 0); + private static readonly Rectangle[] _U_LeftEmpty_End = Create3RectsDirY(10, 0); + private static readonly Rectangle[] _U_LeftEmpty_UpEnd = Create3RectsDirY(12, 0); + private static readonly Rectangle[] _U_LeftEmpty_DownEnd = Create3RectsDirY(14, 0); + + private static readonly Rectangle[] _U_RightEmpty = Create3RectsDirY(6, 0); + private static readonly Rectangle[] _U_RightEmpty_End = Create3RectsDirY(9, 0); + private static readonly Rectangle[] _U_RightEmpty_UpEnd = Create3RectsDirY(11, 0); + private static readonly Rectangle[] _U_RightEmpty_DownEnd = Create3RectsDirY(13, 0); + + // + // Special shapes (5 variants) + // + + private static readonly Rectangle[] _AllClosed = Create3RectsDirX(1, 1); + private static readonly Rectangle[] _Corner_UpLeft = Create3RectsDirX(1, 4, increment: 2); + private static readonly Rectangle[] _Corner_UpRight = Create3RectsDirX(0, 4, increment: 2); + private static readonly Rectangle[] _Corner_DownLeft = Create3RectsDirX(1, 3, increment: 2); + private static readonly Rectangle[] _Corner_DownRight = Create3RectsDirX(0, 3, increment: 2); + + // TOTAL: 53 + #endregion + + #region Sheet Lookup + private static readonly Dictionary _ShapeLookup = new() + { + // Special Shapes: 5 + [Shape_AllSide] = _AllClosed, + [ShapeCorner_UpLeft] = _Corner_UpLeft, + [ShapeCorner_UpRight] = _Corner_UpRight, + [ShapeCorner_DownLeft] = _Corner_DownLeft, + [ShapeCorner_DownRight] = _Corner_DownRight, + + // I Shape: 16 + [ShapeI_Up] = _I_Up, + [ShapeI_Up_End] = _I_Up_End, + [ShapeI_Up_RightEnd] = _I_Up_RightEnd, + [ShapeI_Up_LeftEnd] = _I_Up_LeftEnd, + + [ShapeI_Down] = _I_Down, + [ShapeI_Down_End] = _I_Down_End, + [ShapeI_Down_RightEnd] = _I_Down_RightEnd, + [ShapeI_Down_LeftEnd] = _I_Down_LeftEnd, + + [ShapeI_Left] = _I_Left, + [ShapeI_Left_End] = _I_Left_End, + [ShapeI_Left_DownEnd] = _I_Left_DownEnd, + [ShapeI_Left_UpEnd] = _I_Left_UpEnd, + + [ShapeI_Right] = _I_Right, + [ShapeI_Right_End] = _I_Right_End, + [ShapeI_Right_DownEnd] = _I_Right_DownEnd, + [ShapeI_Right_UpEnd] = _I_Right_UpEnd, + + // L Shape: 16 + [ShapeL_UpLeft] = _L_UpLeft, + [ShapeL_UpLeft_End] = _L_UpLeft_End, + [ShapeL_UpLeft_RightEnd] = _L_UpLeft_RightEnd, + [ShapeL_UpLeft_DownEnd] = _L_UpLeft_DownEnd, + + [ShapeL_UpRight] = _L_UpRight, + [ShapeL_UpRight_End] = _L_UpRight_End, + [ShapeL_UpRight_LeftEnd] = _L_UpRight_LeftEnd, + [ShapeL_UpRight_DownEnd] = _L_UpRight_DownEnd, + + [ShapeL_DownLeft] = _L_DownLeft, + [ShapeL_DownLeft_End] = _L_DownLeft_End, + [ShapeL_DownLeft_RightEnd] = _L_DownLeft_RightEnd, + [ShapeL_DownLeft_UpEnd] = _L_DownLeft_UpEnd, + + [ShapeL_DownRight] = _L_DownRight, + [ShapeL_DownRight_End] = _L_DownRight_End, + [ShapeL_DownRight_LeftEnd] = _L_DownRight_LeftEnd, + [ShapeL_DownRight_UpEnd] = _L_DownRight_UpEnd, + + // U Shape: 16 + [ShapeU_UpEmpty] = _U_UpEmpty, + [ShapeU_UpEmpty_End] = _U_UpEmpty_End, + [ShapeU_UpEmpty_LeftEnd] = _U_UpEmpty_LeftEnd, + [ShapeU_UpEmpty_RightEnd] = _U_UpEmpty_RightEnd, + + [ShapeU_DownEmpty] = _U_DownEmpty, + [ShapeU_DownEmpty_End] = _U_DownEmpty_End, + [ShapeU_DownEmpty_LeftEnd] = _U_DownEmpty_LeftEnd, + [ShapeU_DownEmpty_RightEnd] = _U_DownEmpty_RightEnd, + + [ShapeU_LeftEmpty] = _U_LeftEmpty, + [ShapeU_LeftEmpty_End] = _U_LeftEmpty_End, + [ShapeU_LeftEmpty_UpEnd] = _U_LeftEmpty_UpEnd, + [ShapeU_LeftEmpty_DownEnd] = _U_LeftEmpty_DownEnd, + + [ShapeU_RightEmpty] = _U_RightEmpty, + [ShapeU_RightEmpty_End] = _U_RightEmpty_End, + [ShapeU_RightEmpty_UpEnd] = _U_RightEmpty_UpEnd, + [ShapeU_RightEmpty_DownEnd] = _U_RightEmpty_DownEnd, + }; + + #endregion + + #region Shape Lookup + + private static readonly IReadOnlyCollection _Corner_Shapes = [ + ShapeCorner_UpLeft, + ShapeCorner_UpRight, + ShapeCorner_DownLeft, + ShapeCorner_DownRight + ]; + + private static readonly IReadOnlyCollection _I_Shapes = [ + ShapeI_Up, + ShapeI_Up_End, + ShapeI_Up_LeftEnd, + ShapeI_Up_RightEnd, + + ShapeI_Down, + ShapeI_Down_End, + ShapeI_Down_LeftEnd, + ShapeI_Down_RightEnd, + + ShapeI_Left, + ShapeI_Left_End, + ShapeI_Left_UpEnd, + ShapeI_Left_DownEnd, + + ShapeI_Right, + ShapeI_Right_End, + ShapeI_Right_UpEnd, + ShapeI_Right_DownEnd, + ]; + + private static readonly IReadOnlyCollection _L_Shapes = [ + ShapeL_UpLeft, + ShapeL_UpLeft_End, + ShapeL_UpLeft_RightEnd, + ShapeL_UpLeft_DownEnd, + + ShapeL_UpRight, + ShapeL_UpRight_End, + ShapeL_UpRight_LeftEnd, + ShapeL_UpRight_DownEnd, + + ShapeL_DownLeft, + ShapeL_DownLeft_End, + ShapeL_DownLeft_RightEnd, + ShapeL_DownLeft_UpEnd, + + ShapeL_DownRight, + ShapeL_DownRight_End, + ShapeL_DownRight_LeftEnd, + ShapeL_DownRight_UpEnd + ]; + + private static readonly IReadOnlyCollection _U_Shapes = [ + ShapeU_UpEmpty, + ShapeU_UpEmpty_End, + ShapeU_UpEmpty_LeftEnd, + ShapeU_UpEmpty_RightEnd, + + ShapeU_DownEmpty, + ShapeU_DownEmpty_End, + ShapeU_DownEmpty_LeftEnd, + ShapeU_DownEmpty_RightEnd, + + ShapeU_LeftEmpty, + ShapeU_LeftEmpty_End, + ShapeU_LeftEmpty_UpEnd, + ShapeU_LeftEmpty_DownEnd, + + ShapeU_RightEmpty, + ShapeU_RightEmpty_End, + ShapeU_RightEmpty_UpEnd, + ShapeU_RightEmpty_DownEnd + ]; + #endregion + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static Rectangle CreateRect(int sheetX, int sheetY) + { + return new Rectangle(sheetX * 18, sheetY * 18, 16, 16); + } + + private static Rectangle[] Create3RectsDirX(int leftSheetX, int leftSheetY, int increment = 1) + { + return [ + CreateRect(leftSheetX, leftSheetY), + CreateRect(leftSheetX + (1 * increment), leftSheetY), + CreateRect(leftSheetX + (2 * increment), leftSheetY) + ]; + } + + private static Rectangle[] Create3RectsDirY(int topSheetX, int topSheetY, int increment = 1) + { + return [ + CreateRect(topSheetX, topSheetY), + CreateRect(topSheetX, topSheetY + (1 * increment)), + CreateRect(topSheetX, topSheetY + (2 * increment)) + ]; + } + } +} diff --git a/Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs b/Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs new file mode 100644 index 0000000000..afc238684c --- /dev/null +++ b/Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public sealed partial class TileBlendMergeSystem : ModSystem + { + private static void TileFrame(int i, int j, int type) + { + if (!InValidRange(i, j)) + return; + + var slot = i + (_MaxTilesX * j); + + var tile = Main.tile[i, j]; + var left = CalamityUtils.ParanoidTileRetrieval(i - 1, j); + var right = CalamityUtils.ParanoidTileRetrieval(i + 1, j); + + var up = CalamityUtils.ParanoidTileRetrieval(i, j - 1); + var upLeft = CalamityUtils.ParanoidTileRetrieval(i - 1, j - 1); + var upRight = CalamityUtils.ParanoidTileRetrieval(i + 1, j - 1); + + var down = CalamityUtils.ParanoidTileRetrieval(i, j + 1); + var downLeft = CalamityUtils.ParanoidTileRetrieval(i - 1, j + 1); + var downRight = CalamityUtils.ParanoidTileRetrieval(i + 1, j + 1); + + tile.Get().Clear(); + } + } +} From e350547cca3bd9134ce550048a4a7f1e639d1aac Mon Sep 17 00:00:00 2001 From: Flowaria Date: Wed, 25 Sep 2024 00:04:29 +0900 Subject: [PATCH 045/133] Disabled UniversalMerge --- Systems/TileFramingSystem.cs | 12 ++++++------ Utilities/TileUtils.cs | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Systems/TileFramingSystem.cs b/Systems/TileFramingSystem.cs index 7030a6f136..d84a527711 100644 --- a/Systems/TileFramingSystem.cs +++ b/Systems/TileFramingSystem.cs @@ -79,10 +79,10 @@ namespace CalamityMod.Systems #region Sealed Global Tile private sealed class MergeableTileGlobalTile : GlobalTile { - public override void PostDraw(int i, int j, int type, SpriteBatch spriteBatch) - { - DrawUniversalMergeFrames(i, j, GetOrCreateTileAdjacencies(type)); - } + //public override void PostDraw(int i, int j, int type, SpriteBatch spriteBatch) + //{ + // DrawUniversalMergeFrames(i, j, GetOrCreateTileAdjacencies(type)); + //} public override bool TileFrame(int i, int j, int type, ref bool resetFrame, ref bool noBreak) { @@ -98,8 +98,8 @@ namespace CalamityMod.Systems if (type == TileID.Vines || type == TileID.CrimsonVines || type == TileID.HallowedVines || type == ModContent.TileType()) VineFrame(i, j); - foreach (var adjacency in GetOrCreateTileAdjacencies(type)) - GetAdjacencyData(i, j, adjacency); + //foreach (var adjacency in GetOrCreateTileAdjacencies(type)) + //GetAdjacencyData(i, j, adjacency); return base.TileFrame(i, j, type, ref resetFrame, ref noBreak); } diff --git a/Utilities/TileUtils.cs b/Utilities/TileUtils.cs index 7650bf46f2..2d19acf19b 100644 --- a/Utilities/TileUtils.cs +++ b/Utilities/TileUtils.cs @@ -319,7 +319,8 @@ namespace CalamityMod // As this must be defined in a static class, it's out here in CalamityUtils. public static void RegisterUniversalMerge(this ModTile tile, int mergeType, string blendSheetPath) { - TileFramingSystem.RegisterUniversalMerge(tile.Type, mergeType, blendSheetPath); + //TileFramingSystem.RegisterUniversalMerge(tile.Type, mergeType, blendSheetPath); + TileBlendMergeSystem.RegisterMerge(tile.Type, mergeType); } /// From 9ede19448398e5bec211490e0a84dfbc984d637f Mon Sep 17 00:00:00 2001 From: Flowaria Date: Wed, 25 Sep 2024 02:54:34 +0900 Subject: [PATCH 046/133] Wow a Progress --- Systems/TileMerging/DataStructures.cs | 24 +- Systems/TileMerging/TileBlendMergeSystem.cs | 223 ++++++++++++------ .../TileMerging/TileBlendMergeSystem_Draw.cs | 29 ++- .../TileBlendMergeSystem_GlobalTile.cs | 31 --- .../TileBlendMergeSystem_SheetLookup.cs | 17 +- .../TileBlendMergeSystem_TileFrame.cs | 108 +++++++-- 6 files changed, 289 insertions(+), 143 deletions(-) diff --git a/Systems/TileMerging/DataStructures.cs b/Systems/TileMerging/DataStructures.cs index 1827bf7d87..b5c381a8cb 100644 --- a/Systems/TileMerging/DataStructures.cs +++ b/Systems/TileMerging/DataStructures.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Systems // // SE S SW - public enum MergeSideFlags : byte + public enum BlendSideFlags : byte { None = 0, @@ -104,15 +104,13 @@ namespace CalamityMod.Systems ShapeU_LeftEmpty_DownEnd = ShapeI_Up | ShapeI_Down_End | ShapeI_Right, ShapeU_RightEmpty = ShapeI_Up | ShapeI_Down | ShapeI_Left, - ShapeU_RightEmpty_End = ShapeI_Up | ShapeI_Down | ShapeI_Left, + ShapeU_RightEmpty_End = ShapeI_Up_End | ShapeI_Down_End | ShapeI_Left, ShapeU_RightEmpty_UpEnd = ShapeI_Up_End | ShapeI_Down | ShapeI_Left, ShapeU_RightEmpty_DownEnd = ShapeI_Up | ShapeI_Down_End | ShapeI_Left, } - public enum MergeTextureID : byte + public enum BlendTextureID : byte { - Everything = 0, - AbyssGravel, Ash, AstralDirt, @@ -138,7 +136,9 @@ namespace CalamityMod.Systems SulphurousSand, SulphurousSandstone, SulphurousShale, - Voidstone + Voidstone, + + None = byte.MaxValue, } public struct TileBlendingData : ITileData @@ -227,5 +227,17 @@ namespace CalamityMod.Systems _ => throw new IndexOutOfRangeException() }; } + + public void Set(int idx, byte sheetIdx, byte data) + { + SetSheetIndex(idx, sheetIdx); + SetData(idx, data); + } + + public readonly void Get(int idx, out byte sheetIdx, out byte data) + { + sheetIdx = GetSheetIndex(idx); + data = GetData(idx); + } } } diff --git a/Systems/TileMerging/TileBlendMergeSystem.cs b/Systems/TileMerging/TileBlendMergeSystem.cs index da0f40340f..b8d3236d36 100644 --- a/Systems/TileMerging/TileBlendMergeSystem.cs +++ b/Systems/TileMerging/TileBlendMergeSystem.cs @@ -5,15 +5,22 @@ using System.IO; using System.Linq; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using System.Security.Cryptography.X509Certificates; using System.Text; using System.Threading.Tasks; using CalamityMod.Graphics; +using CalamityMod.Tiles.Abyss; +using CalamityMod.Tiles.Astral; +using CalamityMod.Tiles.AstralDesert; +using CalamityMod.Tiles.AstralSnow; +using CalamityMod.Tiles.SunkenSea; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using MonoMod.Utils; using ReLogic.Content; using Terraria; using Terraria.DataStructures; +using Terraria.GameContent.Drawing; using Terraria.ID; using Terraria.ModLoader; using static CalamityMod.NPCs.SunkenSea.PolypPanasea; @@ -23,66 +30,74 @@ namespace CalamityMod.Systems [Autoload(Side = ModSide.Client)] public sealed partial class TileBlendMergeSystem : ModSystem { - public const byte EmptySheetIndex = 0; + #region Constants + public const byte EmptySheetIndex = byte.MaxValue; public const int VariantCount = 3; - public const int BakedBlendTextureWidth = 18 * 16; - public const int BakedBlendTextureHeight = 18 * 16; + public const int BlendTextureXCount = 16; + public const int BlendTextureYCount = 16; + public const int BlendTextureWidth = 18 * BlendTextureXCount; + public const int BlendTextureHeight = 18 * BlendTextureYCount; + #endregion - private static Asset[] _MergeTextures; - private static ManagedRenderTarget[,] _BakedBlendTextures; - private static int _MaxTilesX; - private static int _MaxTilesY; + private static bool[,] _TileBlendable; // dimension: [TileTypeCount, AllBlendTextureCount] + private static BlendTextureID[] _TileTypeBlendTexture; // dimension: [TileTypeCount] + private static Asset[] _BaseBlendTextures; // dimension: [256] + private static RenderTarget2D[,] _BlendTextures; // dimension: [256, 3] - private static IEnumerable AllMergeTextureIDs => Enum.GetValues().Where(v => v != MergeTextureID.Everything); + private static IEnumerable AllBlendTextureIDs => Enum.GetValues().Where(v => v != BlendTextureID.None); + private static int AllBlendTextureCount => AllBlendTextureIDs.Count(); #region Load/Unload public override void OnModLoad() { - _MergeTextures = new Asset[256]; - _BakedBlendTextures = new ManagedRenderTarget[256, 3]; + var tileCount = TileLoader.TileCount; + _TileBlendable = new bool[tileCount, AllBlendTextureCount]; + _TileTypeBlendTexture = new BlendTextureID[tileCount]; + _BaseBlendTextures = new Asset[256]; + _BlendTextures = new RenderTarget2D[256, 3]; - foreach (var idValue in AllMergeTextureIDs) + foreach (var idValue in AllBlendTextureIDs) { var name = Enum.GetName(idValue); var ID = (int)idValue; - _MergeTextures[ID] = ModContent.Request($"CalamityMod/Tiles/Merges/{name}Merge"); + + //TODO: Rename asset path and name to "Blend" + _BaseBlendTextures[ID] = ModContent.Request($"CalamityMod/Tiles/Merges/{name}Merge"); + _TileTypeBlendTexture[BlendTextureIDToTileType(idValue)] = idValue; Main.QueueMainThreadAction(() => { for (int v = 0; v < VariantCount; v++) - _BakedBlendTextures[ID, v] = new ManagedRenderTarget(false, BlendSheetRTCondition); + _BlendTextures[ID, v] = CreateBlendRT(); }); } - } - public override void PostSetupContent() - { - CalamityMod.Instance.Logger.Error("PostSetupContent"); + // Draw Code + On_TileDrawing.DrawSingleTile += OnDrawSingleTile; } private static void SetupMergeData() { - CalamityMod.Instance.Logger.Error("SetupMerge"); Main.QueueMainThreadAction(() => { - foreach (var id in AllMergeTextureIDs) + foreach (var id in AllBlendTextureIDs) { - BakeBlendTexture(id, _MergeTextures[(int)id].Value); + BakeBlendTexture(id, _BaseBlendTextures[(int)id].Value); } }); } public override void Unload() { - if (_MergeTextures is not null) + if (_BaseBlendTextures is not null) { - Array.Clear(_MergeTextures); + Array.Clear(_BaseBlendTextures); } - if (_BakedBlendTextures is not null) + if (_BlendTextures is not null) { - foreach (var rt in _BakedBlendTextures) + foreach (var rt in _BlendTextures) { if (rt is null) continue; @@ -93,43 +108,73 @@ namespace CalamityMod.Systems rt.Dispose(); } - Array.Clear(_BakedBlendTextures); + Array.Clear(_BlendTextures); } - _MergeTextures = null; - _BakedBlendTextures = null; - } - #endregion - - #region World Load/Unload - public override void OnWorldLoad() - { - _MaxTilesX = Main.maxTilesX; - _MaxTilesY = Main.maxTilesY; - } - - public override void OnWorldUnload() - { - _MaxTilesX = 0; - _MaxTilesY = 0; + _TileBlendable = null; + _BaseBlendTextures = null; + _BlendTextures = null; } #endregion #region Public API - public static void ReplaceTexture(MergeTextureID textureID, Texture2D texture) + public static void RegisterMerge(int myType, int blendTileType) { - if (textureID == MergeTextureID.Everything) + + if (myType == blendTileType) + return; + + if (!_TileTypeBlendTexture.IndexInRange(myType)) + return; + + if (!_TileTypeBlendTexture.IndexInRange(blendTileType)) + return; + + var blendTextureID = _TileTypeBlendTexture[blendTileType]; + if (blendTextureID == BlendTextureID.None) + return; + + _TileBlendable[myType, (int)blendTextureID] = true; + CalamityUtils.SetMerge(myType, blendTileType, true); + } + + public static void RegisterMerge(int myType, BlendTextureID blendTextureID) + { + if (blendTextureID == BlendTextureID.None) + return; + + if (!Enum.IsDefined(blendTextureID)) + return; + + if (!_TileTypeBlendTexture.IndexInRange(myType)) + return; + + var blendTileType = BlendTextureIDToTileType(blendTextureID); + if (myType == blendTileType) // Self blending should never be case, That will be extremely heavy to render! + return; + + _TileBlendable[myType, (int)blendTextureID] = true; + CalamityUtils.SetMerge(myType, blendTileType, true); + } + + public static void ReplaceMergeTexture(BlendTextureID textureID, Texture2D texture) + { + if (textureID == BlendTextureID.None) throw new ArgumentOutOfRangeException(nameof(textureID), "MergeTextureID.Everything is not allowed to use in here!"); if (!Enum.IsDefined(textureID)) throw new ArgumentOutOfRangeException(nameof(textureID), $"{textureID} is Invalid MergeTextureID!"); - BakeBlendTexture(textureID, texture); + // It's baking moment + Main.QueueMainThreadAction(() => + { + BakeBlendTexture(textureID, texture); + }); } #endregion #region Sheet Baking Process - private static void BakeBlendTexture(MergeTextureID textureToBake, Texture2D texture) + private static void BakeBlendTexture(BlendTextureID textureToBake, Texture2D texture) { if (!Enum.IsDefined(textureToBake)) throw new ArgumentOutOfRangeException(nameof(textureToBake), $"{textureToBake} is Invalid MergeTextureID!"); @@ -142,7 +187,7 @@ namespace CalamityMod.Systems for (int v = 0; v < VariantCount; v++) { - var renderTarget = _BakedBlendTextures[(int)textureToBake, v]; + var renderTarget = _BlendTextures[(int)textureToBake, v]; var graphicsDevice = Main.instance.GraphicsDevice; graphicsDevice.SetRenderTarget(renderTarget); graphicsDevice.Clear(Color.Transparent); @@ -151,12 +196,10 @@ namespace CalamityMod.Systems { for (int i = 0; i < 256; i++) { - int y = Math.DivRem(i, 16, out int x); - var drawPos = new Vector2(18 * x, 18 * y); + var drawPos = SideDataToPositionInSheet((byte)i); + var mergeSides = (BlendSideFlags)i; - var mergeSides = (MergeSideFlags)i; - - // Easy cases, It match on Shape Lookup Sheet + // Easy cases, It match on Shape Lookup Sheet Directly if (_ShapeLookup.TryGetValue(mergeSides, out var rects)) { Main.spriteBatch.Draw(texture, drawPos, rects[v], Color.White, 0.0f, Vector2.Zero, 1.0f, SpriteEffects.None, 0.0f); @@ -175,23 +218,15 @@ namespace CalamityMod.Systems }); graphicsDevice.SetRenderTarget(null); - -#if DEBUG - var pngPath = $"C:\\baked\\{textureToBake}_{v}.png"; - var fs = File.Open(pngPath, FileMode.Create, FileAccess.ReadWrite); - renderTarget.Target.SaveAsPng(fs, BakedBlendTextureWidth, BakedBlendTextureHeight); - fs.Close(); - fs.Dispose(); -#endif } } - private static IEnumerable ConsumeMergeSides(MergeSideFlags sideFlags) + private static IEnumerable ConsumeMergeSides(BlendSideFlags sideFlags) { - if (sideFlags == MergeSideFlags.None) + if (sideFlags == BlendSideFlags.None) yield break; - IEnumerable> shapes = [ + IEnumerable> shapes = [ _U_Shapes, _L_Shapes, _I_Shapes, // I shape includes up, down, left, right @@ -210,7 +245,7 @@ namespace CalamityMod.Systems } } - if (sideFlags == MergeSideFlags.None) + if (sideFlags == BlendSideFlags.None) yield break; } yield break; @@ -218,25 +253,17 @@ namespace CalamityMod.Systems #endregion #region Utils - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static bool InValidRange(int i, int j) + private static RenderTarget2D CreateBlendRT() { - if (i < 0 || i >= _MaxTilesX) return false; - if (j < 0 || j >= _MaxTilesY) return false; - return true; + return new(Main.instance.GraphicsDevice, BlendTextureWidth, BlendTextureHeight); } - private static RenderTarget2D BlendSheetRTCondition(int width, int height) - { - return new(Main.instance.GraphicsDevice, BakedBlendTextureWidth, BakedBlendTextureHeight); - } - - private static int HotFlagCount(MergeSideFlags flags) + private static int HotFlagCount(BlendSideFlags flags) { var count = 0; for(int i = 0; i<8; i++) { - var flag = (MergeSideFlags)(1 << i); + var flag = (BlendSideFlags)(1 << i); if (flag == (flags & flag)) { count++; @@ -244,6 +271,52 @@ namespace CalamityMod.Systems } return count; } + + private static int BlendTextureIDToTileType(BlendTextureID id) + { + return id switch + { + BlendTextureID.AbyssGravel => ModContent.TileType(), + BlendTextureID.Ash => TileID.Ash, + BlendTextureID.AstralDirt => ModContent.TileType(), + BlendTextureID.AstralSand => ModContent.TileType(), + BlendTextureID.AstralSandstone => ModContent.TileType(), + BlendTextureID.AstralSnow => ModContent.TileType(), + BlendTextureID.BrimstoneSlag => ModContent.TileType(), + BlendTextureID.Cloud => TileID.Cloud, + BlendTextureID.Dirt => TileID.Dirt, + BlendTextureID.EutrophicSand => ModContent.TileType(), + BlendTextureID.HardenedSand => TileID.HardenedSand, + BlendTextureID.HardenedSulphurousSandstone => ModContent.TileType(), + BlendTextureID.Luminite => TileID.LunarOre, + BlendTextureID.Mud => TileID.Mud, + BlendTextureID.Navystone => ModContent.TileType(), + BlendTextureID.PyreMantle => ModContent.TileType(), + BlendTextureID.RainCloud => TileID.RainCloud, + BlendTextureID.Sand => TileID.Sand, + BlendTextureID.Sandstone => TileID.Sandstone, + BlendTextureID.SnowCloud => TileID.SnowCloud, + BlendTextureID.Snow => TileID.SnowBlock, + BlendTextureID.Stone => TileID.Stone, + BlendTextureID.SulphurousSand => ModContent.TileType(), + BlendTextureID.SulphurousSandstone => ModContent.TileType(), + BlendTextureID.SulphurousShale => ModContent.TileType(), + BlendTextureID.Voidstone => ModContent.TileType(), + _ => throw new ArgumentOutOfRangeException(nameof(id), $"{id} is not valid index!") + }; + } + + private static Rectangle SideDataToSheetRect(byte data) + { + int y = Math.DivRem(data, 16, out int x); + return new Rectangle(x * 18, y * 18, 16, 16); + } + + private static Vector2 SideDataToPositionInSheet(byte data) + { + int y = Math.DivRem(data, 16, out int x); + return new Vector2(x * 18, y * 18); + } #endregion } } diff --git a/Systems/TileMerging/TileBlendMergeSystem_Draw.cs b/Systems/TileMerging/TileBlendMergeSystem_Draw.cs index c4a654961e..0377b51522 100644 --- a/Systems/TileMerging/TileBlendMergeSystem_Draw.cs +++ b/Systems/TileMerging/TileBlendMergeSystem_Draw.cs @@ -8,28 +8,35 @@ using Terraria.DataStructures; using Terraria; using Terraria.ModLoader; using Microsoft.Xna.Framework; +using Terraria.GameContent.Drawing; namespace CalamityMod.Systems { public sealed partial class TileBlendMergeSystem : ModSystem { - private static void DrawEffects(int i, int j, int type, SpriteBatch spriteBatch, ref TileDrawInfo drawData) + private static void OnDrawSingleTile(On_TileDrawing.orig_DrawSingleTile orig, TileDrawing self, TileDrawInfo drawData, bool solidLayer, int waterStyleOverride, Vector2 screenPosition, Vector2 screenOffset, int tileX, int tileY) { - if (!InValidRange(i, j)) + orig(self, drawData, solidLayer, waterStyleOverride, screenPosition, screenOffset, tileX, tileY); + + var tile = drawData.tileCache; + + Color drawColor = drawData.tileLight; + if (drawColor.R <= 0 && drawColor.G <= 0 && drawColor.B <= 0) return; - Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); - Vector2 drawPos = new Vector2(i * 16, j * 16) - Main.screenPosition + zero; - Color drawColor = drawData.tileLight; + Vector2 drawPos = new Vector2(tileX * 16, tileY * 16) - screenPosition + screenOffset; + var blendingData = tile.Get(); for (int idx = 0; idx < 8; idx++) { - var data = drawData.tileCache.Get().GetData(idx); - var sheetIdx = drawData.tileCache.Get().GetSheetIndex(idx); - if (sheetIdx == EmptySheetIndex) - continue; + blendingData.Get(idx, out var sheetIdx, out var data); - //var rect = new Rectangle(x, y, 16, 16); - //spriteBatch.Draw(texture, drawPos, rect, drawColor, rotation: 0.0f, origin: default, scale: 1.0f, SpriteEffects.None, layerDepth: 0.0f); + // Break here as standard for TileBlendingData is 0->Count fill, so further fields should be also Invalid + if (sheetIdx == EmptySheetIndex) + break; + + var rect = SideDataToSheetRect(data); + var variant = Math.Clamp(tile.TileFrameNumber, 0, 2); + Main.spriteBatch.Draw(_BlendTextures[sheetIdx, variant], drawPos, rect, drawColor, rotation: 0.0f, origin: default, scale: 1.0f, SpriteEffects.None, layerDepth: 0.0f); } } } diff --git a/Systems/TileMerging/TileBlendMergeSystem_GlobalTile.cs b/Systems/TileMerging/TileBlendMergeSystem_GlobalTile.cs index cb9326338a..e20ad5757d 100644 --- a/Systems/TileMerging/TileBlendMergeSystem_GlobalTile.cs +++ b/Systems/TileMerging/TileBlendMergeSystem_GlobalTile.cs @@ -17,8 +17,6 @@ namespace CalamityMod.Systems [Autoload(Side = ModSide.Client)] private class FancyTileMergeGlobalTile : GlobalTile { - public Dictionary _TypesCounter = new(); - [SuppressMessage("Simplify Method Call", "IDE0002", Justification = "Leave this alone for Consistency")] public override void PostSetupTileMerge() { @@ -27,38 +25,9 @@ namespace CalamityMod.Systems public override bool TileFrame(int i, int j, int type, ref bool resetFrame, ref bool noBreak) { - if (_TypesCounter.ContainsKey(type)) - _TypesCounter[type]++; - else - _TypesCounter[type] = 1; - TileBlendMergeSystem.TileFrame(i, j, type); return base.TileFrame(i, j, type, ref resetFrame, ref noBreak); } - - public override void DrawEffects(int i, int j, int type, SpriteBatch spriteBatch, ref TileDrawInfo drawData) - { - TileBlendMergeSystem.DrawEffects(i, j, type, spriteBatch, ref drawData); - } - - public override void AnimateTile() - { - Main.NewText($"- {_TypesCounter.Count} - "); - foreach (var entry in _TypesCounter) - { - - var mod = TileLoader.GetTile(entry.Key); - if (mod is not null) - { - Main.NewText($"{mod.Name} {entry.Value}"); - } - else - { - Main.NewText($"{entry.Key} {entry.Value}"); - } - } - _TypesCounter.Clear(); - } } #endregion } diff --git a/Systems/TileMerging/TileBlendMergeSystem_SheetLookup.cs b/Systems/TileMerging/TileBlendMergeSystem_SheetLookup.cs index 4d815d5d92..a0c14a5614 100644 --- a/Systems/TileMerging/TileBlendMergeSystem_SheetLookup.cs +++ b/Systems/TileMerging/TileBlendMergeSystem_SheetLookup.cs @@ -3,12 +3,15 @@ using System.Runtime.CompilerServices; using Microsoft.Xna.Framework; using Terraria.ModLoader; -using static CalamityMod.Systems.MergeSideFlags; +using static CalamityMod.Systems.BlendSideFlags; namespace CalamityMod.Systems { public sealed partial class TileBlendMergeSystem : ModSystem { + // Welcome to Hardcoded hell + // Do NOT change anything in here unless you understand absolutely everything + #region Sheet Rects // I HATE THIS GAME I HATE THIS GAME I HATE THIS GAME I HATE THIS GAME I HATE THIS GAME // I HATE THIS GAME I HATE THIS GAME I HATE THIS GAME I HATE THIS GAME I HATE THIS GAME @@ -103,7 +106,7 @@ namespace CalamityMod.Systems #endregion #region Sheet Lookup - private static readonly Dictionary _ShapeLookup = new() + private static readonly Dictionary _ShapeLookup = new() { // Special Shapes: 5 [Shape_AllSide] = _AllClosed, @@ -180,14 +183,14 @@ namespace CalamityMod.Systems #region Shape Lookup - private static readonly IReadOnlyCollection _Corner_Shapes = [ + private static readonly IReadOnlyCollection _Corner_Shapes = [ ShapeCorner_UpLeft, ShapeCorner_UpRight, ShapeCorner_DownLeft, ShapeCorner_DownRight ]; - private static readonly IReadOnlyCollection _I_Shapes = [ + private static readonly IReadOnlyCollection _I_Shapes = [ ShapeI_Up, ShapeI_Up_End, ShapeI_Up_LeftEnd, @@ -209,7 +212,7 @@ namespace CalamityMod.Systems ShapeI_Right_DownEnd, ]; - private static readonly IReadOnlyCollection _L_Shapes = [ + private static readonly IReadOnlyCollection _L_Shapes = [ ShapeL_UpLeft, ShapeL_UpLeft_End, ShapeL_UpLeft_RightEnd, @@ -231,7 +234,7 @@ namespace CalamityMod.Systems ShapeL_DownRight_UpEnd ]; - private static readonly IReadOnlyCollection _U_Shapes = [ + private static readonly IReadOnlyCollection _U_Shapes = [ ShapeU_UpEmpty, ShapeU_UpEmpty_End, ShapeU_UpEmpty_LeftEnd, @@ -254,6 +257,7 @@ namespace CalamityMod.Systems ]; #endregion + #region Utils [MethodImpl(MethodImplOptions.AggressiveInlining)] private static Rectangle CreateRect(int sheetX, int sheetY) { @@ -277,5 +281,6 @@ namespace CalamityMod.Systems CreateRect(topSheetX, topSheetY + (2 * increment)) ]; } + #endregion } } diff --git a/Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs b/Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs index afc238684c..4859833922 100644 --- a/Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs +++ b/Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using CalamityMod.Items.Potions.Alcohol; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -13,24 +14,103 @@ namespace CalamityMod.Systems { private static void TileFrame(int i, int j, int type) { - if (!InValidRange(i, j)) + if (!WorldGen.InWorld(i, j)) return; - var slot = i + (_MaxTilesX * j); - - var tile = Main.tile[i, j]; - var left = CalamityUtils.ParanoidTileRetrieval(i - 1, j); - var right = CalamityUtils.ParanoidTileRetrieval(i + 1, j); - - var up = CalamityUtils.ParanoidTileRetrieval(i, j - 1); - var upLeft = CalamityUtils.ParanoidTileRetrieval(i - 1, j - 1); - var upRight = CalamityUtils.ParanoidTileRetrieval(i + 1, j - 1); - - var down = CalamityUtils.ParanoidTileRetrieval(i, j + 1); - var downLeft = CalamityUtils.ParanoidTileRetrieval(i - 1, j + 1); - var downRight = CalamityUtils.ParanoidTileRetrieval(i + 1, j + 1); + var tile = Main.tile[i, j]; + if (!tile.HasTile) // Is this even possible? But I'm doing this for sanity check anyways + return; tile.Get().Clear(); + + int tileType = tile.TileType; + int left = GetTileType(i - 1, j); + int right = GetTileType(i + 1, j); + + int up = GetTileType(i, j - 1); + int upLeft = GetTileType(i - 1, j - 1); + int upRight = GetTileType(i + 1, j - 1); + + int down = GetTileType(i, j + 1); + int downLeft = GetTileType(i - 1, j + 1); + int downRight = GetTileType(i + 1, j + 1); + + var blendTexturesSurrounding = PopulateBlendTileTypes(left, right, up, upLeft, upRight, down, downLeft, downRight); + var blendDataUniqueIndex = 0; + foreach (var blendTextureID in blendTexturesSurrounding) + { + if (!_TileBlendable[tileType, (int)blendTextureID]) + continue; + + BlendSideFlags sideFlags = BlendSideFlags.None; + + CalculateSide(tileType, left, blendTextureID, BlendSideFlags.Left, ref sideFlags, out var leftMerged); + CalculateSide(tileType, right, blendTextureID, BlendSideFlags.Right, ref sideFlags, out var rightMerged); + CalculateSide(tileType, up, blendTextureID, BlendSideFlags.Up, ref sideFlags, out var upMerged); + CalculateSide(tileType, down, blendTextureID, BlendSideFlags.Down, ref sideFlags, out var downMerged); + + if (upMerged && leftMerged) CalculateSide(tileType, upLeft, blendTextureID, BlendSideFlags.UpLeft, ref sideFlags, out _); + if (upMerged && rightMerged) CalculateSide(tileType, upRight, blendTextureID, BlendSideFlags.UpRight, ref sideFlags, out _); + if (downMerged && leftMerged) CalculateSide(tileType, downLeft, blendTextureID, BlendSideFlags.DownLeft, ref sideFlags, out _); + if (downMerged && rightMerged) CalculateSide(tileType, downRight, blendTextureID, BlendSideFlags.DownRight, ref sideFlags, out _); + + if (sideFlags != BlendSideFlags.None) + { + tile.Get().Set(blendDataUniqueIndex, (byte)blendTextureID, (byte)sideFlags); + blendDataUniqueIndex++; + } + } + } + + private static void CalculateSide(int type, int sideType, BlendTextureID blendingWith, BlendSideFlags flagToAdd, ref BlendSideFlags flags, out bool sideMerged) + { + sideMerged = false; + + if (sideType < 0) + return; + + var canBeMerged = Main.tileMerge[type][sideType]; + if (Main.tileBlendAll[type]) + { + sideMerged = canBeMerged && !TileID.Sets.BlockMergesWithMergeAllBlock[sideType]; + } + else + { + sideMerged = canBeMerged; + } + + var blendTextureID = _TileTypeBlendTexture[sideType]; + if (sideMerged && (blendTextureID == blendingWith)) + { + flags |= flagToAdd; + } + } + + private static HashSet PopulateBlendTileTypes(params int[] types) + { + var hashSet = new HashSet(); + foreach (var type in types) + { + if (type < 0) + continue; + + var blendTextureID = _TileTypeBlendTexture[type]; + if (blendTextureID != BlendTextureID.None) + hashSet.Add(blendTextureID); + } + return hashSet; + } + + private static int GetTileType(int i, int j) + { + if (!WorldGen.InWorld(i, j)) + return -1; + + var tile = Main.tile[i, j]; + if (!tile.HasTile) + return -1; + + return tile.TileType; } } } From 8abfba6a19504f4961d086ed00fa4b5746655722 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Fri, 27 Sep 2024 22:50:14 +0900 Subject: [PATCH 047/133] Progress2 - Introduce TileBlendTexture Type --- Systems/TileMerging/DataStructures.cs | 34 +-- Systems/TileMerging/TileBlendMergeSystem.cs | 243 ++---------------- .../TileMerging/TileBlendMergeSystem_Draw.cs | 7 +- .../TileBlendMergeSystem_TileFrame.cs | 238 +++++++++++++++-- Systems/TileMerging/TileBlendTexture.cs | 92 +++++++ Systems/TileMerging/TileBlendTextureLoader.cs | 41 +++ .../TileMerging/TileBlendTexture_Baking.cs | 119 +++++++++ ...etLookup.cs => TileBlendTexture_Lookup.cs} | 12 +- Tiles/Merges/AbyssGravelMerge.cs | 16 ++ Tiles/Merges/AshMerge.cs | 15 ++ Tiles/Merges/AstralDirtMerge.cs | 16 ++ Tiles/Merges/AstralSandMerge.cs | 16 ++ Tiles/Merges/AstralSandstoneMerge.cs | 16 ++ Tiles/Merges/AstralSnowMerge.cs | 15 ++ Tiles/Merges/BrimstoneSlagMerge.cs | 16 ++ Tiles/Merges/CloudMerge.cs | 16 ++ Tiles/Merges/DirtMerge.cs | 15 ++ Tiles/Merges/EutrophicSandMerge.cs | 16 ++ Tiles/Merges/HardenedSandMerge.cs | 15 ++ .../HardenedSulphurousSandstoneMerge.cs | 16 ++ Tiles/Merges/LuminiteMerge.cs | 15 ++ Tiles/Merges/MudMerge.cs | 15 ++ Tiles/Merges/NavystoneMerge.cs | 16 ++ Tiles/Merges/PearlstoneMerge.cs | 15 ++ Tiles/Merges/PyreMantleMerge.cs | 16 ++ Tiles/Merges/RainCloudMerge.cs | 15 ++ Tiles/Merges/SandMerge.cs | 15 ++ Tiles/Merges/SandstoneMerge.cs | 15 ++ Tiles/Merges/SnowCloudMerge.cs | 15 ++ Tiles/Merges/SnowMerge.cs | 15 ++ Tiles/Merges/StoneMerge.cs | 15 ++ Tiles/Merges/SulphurousSandMerge.cs | 16 ++ Tiles/Merges/SulphurousSandstoneMerge.cs | 16 ++ Tiles/Merges/SulphurousShaleMerge.cs | 16 ++ Tiles/Merges/VoidstoneMerge.cs | 16 ++ 35 files changed, 913 insertions(+), 292 deletions(-) create mode 100644 Systems/TileMerging/TileBlendTexture.cs create mode 100644 Systems/TileMerging/TileBlendTextureLoader.cs create mode 100644 Systems/TileMerging/TileBlendTexture_Baking.cs rename Systems/TileMerging/{TileBlendMergeSystem_SheetLookup.cs => TileBlendTexture_Lookup.cs} (98%) create mode 100644 Tiles/Merges/AbyssGravelMerge.cs create mode 100644 Tiles/Merges/AshMerge.cs create mode 100644 Tiles/Merges/AstralDirtMerge.cs create mode 100644 Tiles/Merges/AstralSandMerge.cs create mode 100644 Tiles/Merges/AstralSandstoneMerge.cs create mode 100644 Tiles/Merges/AstralSnowMerge.cs create mode 100644 Tiles/Merges/BrimstoneSlagMerge.cs create mode 100644 Tiles/Merges/CloudMerge.cs create mode 100644 Tiles/Merges/DirtMerge.cs create mode 100644 Tiles/Merges/EutrophicSandMerge.cs create mode 100644 Tiles/Merges/HardenedSandMerge.cs create mode 100644 Tiles/Merges/HardenedSulphurousSandstoneMerge.cs create mode 100644 Tiles/Merges/LuminiteMerge.cs create mode 100644 Tiles/Merges/MudMerge.cs create mode 100644 Tiles/Merges/NavystoneMerge.cs create mode 100644 Tiles/Merges/PearlstoneMerge.cs create mode 100644 Tiles/Merges/PyreMantleMerge.cs create mode 100644 Tiles/Merges/RainCloudMerge.cs create mode 100644 Tiles/Merges/SandMerge.cs create mode 100644 Tiles/Merges/SandstoneMerge.cs create mode 100644 Tiles/Merges/SnowCloudMerge.cs create mode 100644 Tiles/Merges/SnowMerge.cs create mode 100644 Tiles/Merges/StoneMerge.cs create mode 100644 Tiles/Merges/SulphurousSandMerge.cs create mode 100644 Tiles/Merges/SulphurousSandstoneMerge.cs create mode 100644 Tiles/Merges/SulphurousShaleMerge.cs create mode 100644 Tiles/Merges/VoidstoneMerge.cs diff --git a/Systems/TileMerging/DataStructures.cs b/Systems/TileMerging/DataStructures.cs index b5c381a8cb..b0dc21c61c 100644 --- a/Systems/TileMerging/DataStructures.cs +++ b/Systems/TileMerging/DataStructures.cs @@ -109,38 +109,6 @@ namespace CalamityMod.Systems ShapeU_RightEmpty_DownEnd = ShapeI_Up | ShapeI_Down_End | ShapeI_Left, } - public enum BlendTextureID : byte - { - AbyssGravel, - Ash, - AstralDirt, - AstralSand, - AstralSandstone, - AstralSnow, - BrimstoneSlag, - Cloud, - Dirt, - EutrophicSand, - HardenedSand, - HardenedSulphurousSandstone, - Luminite, - Mud, - Navystone, - PyreMantle, - RainCloud, - Sand, - Sandstone, - SnowCloud, - Snow, - Stone, - SulphurousSand, - SulphurousSandstone, - SulphurousShale, - Voidstone, - - None = byte.MaxValue, - } - public struct TileBlendingData : ITileData { private byte SheetIndex0; @@ -166,7 +134,7 @@ namespace CalamityMod.Systems for (int i = 0; i<8; i++) { SetData(i, 0); - SetSheetIndex(i, TileBlendMergeSystem.EmptySheetIndex); + SetSheetIndex(i, TileBlendTextureLoader.EmptySlot); } } diff --git a/Systems/TileMerging/TileBlendMergeSystem.cs b/Systems/TileMerging/TileBlendMergeSystem.cs index b8d3236d36..8c8cd5a990 100644 --- a/Systems/TileMerging/TileBlendMergeSystem.cs +++ b/Systems/TileMerging/TileBlendMergeSystem.cs @@ -17,6 +17,7 @@ using CalamityMod.Tiles.SunkenSea; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using MonoMod.Utils; +using Newtonsoft.Json.Linq; using ReLogic.Content; using Terraria; using Terraria.DataStructures; @@ -30,47 +31,21 @@ namespace CalamityMod.Systems [Autoload(Side = ModSide.Client)] public sealed partial class TileBlendMergeSystem : ModSystem { - #region Constants - public const byte EmptySheetIndex = byte.MaxValue; - public const int VariantCount = 3; - - public const int BlendTextureXCount = 16; - public const int BlendTextureYCount = 16; - public const int BlendTextureWidth = 18 * BlendTextureXCount; - public const int BlendTextureHeight = 18 * BlendTextureYCount; - #endregion - private static bool[,] _TileBlendable; // dimension: [TileTypeCount, AllBlendTextureCount] - private static BlendTextureID[] _TileTypeBlendTexture; // dimension: [TileTypeCount] - private static Asset[] _BaseBlendTextures; // dimension: [256] - private static RenderTarget2D[,] _BlendTextures; // dimension: [256, 3] - - private static IEnumerable AllBlendTextureIDs => Enum.GetValues().Where(v => v != BlendTextureID.None); - private static int AllBlendTextureCount => AllBlendTextureIDs.Count(); + private static byte[] _TileTypeBlendTexture; // dimension: [TileTypeCount] #region Load/Unload public override void OnModLoad() { var tileCount = TileLoader.TileCount; - _TileBlendable = new bool[tileCount, AllBlendTextureCount]; - _TileTypeBlendTexture = new BlendTextureID[tileCount]; - _BaseBlendTextures = new Asset[256]; - _BlendTextures = new RenderTarget2D[256, 3]; + var blendTextureCount = TileBlendTextureLoader.Count; + _TileBlendable = new bool[tileCount, TileBlendTextureLoader.Count]; + _TileTypeBlendTexture = new byte[tileCount]; - foreach (var idValue in AllBlendTextureIDs) + for (int i = 0; i($"CalamityMod/Tiles/Merges/{name}Merge"); - _TileTypeBlendTexture[BlendTextureIDToTileType(idValue)] = idValue; - - Main.QueueMainThreadAction(() => - { - for (int v = 0; v < VariantCount; v++) - _BlendTextures[ID, v] = CreateBlendRT(); - }); + var blendTexture = TileBlendTextureLoader.Registry[i]; + _TileTypeBlendTexture[blendTexture.TileType] = (byte)i; } // Draw Code @@ -81,39 +56,16 @@ namespace CalamityMod.Systems { Main.QueueMainThreadAction(() => { - foreach (var id in AllBlendTextureIDs) + foreach (var blendTexture in TileBlendTextureLoader.AllTextures) { - BakeBlendTexture(id, _BaseBlendTextures[(int)id].Value); + blendTexture.BakeBlendTexture(blendTexture.TextureAsset.Value); } }); } public override void Unload() { - if (_BaseBlendTextures is not null) - { - Array.Clear(_BaseBlendTextures); - } - - if (_BlendTextures is not null) - { - foreach (var rt in _BlendTextures) - { - if (rt is null) - continue; - - if (rt.IsDisposed) - continue; - - rt.Dispose(); - } - - Array.Clear(_BlendTextures); - } - _TileBlendable = null; - _BaseBlendTextures = null; - _BlendTextures = null; } #endregion @@ -131,192 +83,31 @@ namespace CalamityMod.Systems return; var blendTextureID = _TileTypeBlendTexture[blendTileType]; - if (blendTextureID == BlendTextureID.None) + if (blendTextureID == 0) return; - _TileBlendable[myType, (int)blendTextureID] = true; + _TileBlendable[myType, blendTextureID] = true; CalamityUtils.SetMerge(myType, blendTileType, true); } - public static void RegisterMerge(int myType, BlendTextureID blendTextureID) + public static void RegisterMerge(int myType, TileBlendTexture blendTexture) { - if (blendTextureID == BlendTextureID.None) + if (blendTexture == null) return; - if (!Enum.IsDefined(blendTextureID)) + if (blendTexture.Slot <= 0) return; if (!_TileTypeBlendTexture.IndexInRange(myType)) return; - var blendTileType = BlendTextureIDToTileType(blendTextureID); + var blendTileType = blendTexture.TileType; if (myType == blendTileType) // Self blending should never be case, That will be extremely heavy to render! return; - _TileBlendable[myType, (int)blendTextureID] = true; + _TileBlendable[myType, blendTexture.Slot] = true; CalamityUtils.SetMerge(myType, blendTileType, true); } - - public static void ReplaceMergeTexture(BlendTextureID textureID, Texture2D texture) - { - if (textureID == BlendTextureID.None) - throw new ArgumentOutOfRangeException(nameof(textureID), "MergeTextureID.Everything is not allowed to use in here!"); - - if (!Enum.IsDefined(textureID)) - throw new ArgumentOutOfRangeException(nameof(textureID), $"{textureID} is Invalid MergeTextureID!"); - - // It's baking moment - Main.QueueMainThreadAction(() => - { - BakeBlendTexture(textureID, texture); - }); - } - #endregion - - #region Sheet Baking Process - private static void BakeBlendTexture(BlendTextureID textureToBake, Texture2D texture) - { - if (!Enum.IsDefined(textureToBake)) - throw new ArgumentOutOfRangeException(nameof(textureToBake), $"{textureToBake} is Invalid MergeTextureID!"); - - if (texture == null) - throw new ArgumentNullException(nameof(texture), "Texture is Null!"); - - if (texture.IsDisposed) - throw new ArgumentException(paramName: nameof(texture), message: "Texture is Disposed!"); - - for (int v = 0; v < VariantCount; v++) - { - var renderTarget = _BlendTextures[(int)textureToBake, v]; - var graphicsDevice = Main.instance.GraphicsDevice; - graphicsDevice.SetRenderTarget(renderTarget); - graphicsDevice.Clear(Color.Transparent); - - Main.spriteBatch.SafeBegin(SpriteSortMode.Immediate, BatchSetting.AlphaBlend, null, Matrix.Identity, () => - { - for (int i = 0; i < 256; i++) - { - var drawPos = SideDataToPositionInSheet((byte)i); - var mergeSides = (BlendSideFlags)i; - - // Easy cases, It match on Shape Lookup Sheet Directly - if (_ShapeLookup.TryGetValue(mergeSides, out var rects)) - { - Main.spriteBatch.Draw(texture, drawPos, rects[v], Color.White, 0.0f, Vector2.Zero, 1.0f, SpriteEffects.None, 0.0f); - continue; - } - - var extractedShapes = ConsumeMergeSides(mergeSides); - foreach (var shape in extractedShapes) - { - if (_ShapeLookup.TryGetValue(shape, out var shapeRects)) - { - Main.spriteBatch.Draw(texture, drawPos, shapeRects[v], Color.White, 0.0f, Vector2.Zero, 1.0f, SpriteEffects.None, 0.0f); - } - } - } - }); - - graphicsDevice.SetRenderTarget(null); - } - } - - private static IEnumerable ConsumeMergeSides(BlendSideFlags sideFlags) - { - if (sideFlags == BlendSideFlags.None) - yield break; - - IEnumerable> shapes = [ - _U_Shapes, - _L_Shapes, - _I_Shapes, // I shape includes up, down, left, right - _Corner_Shapes - ]; - - foreach (var shapeGroup in shapes) - { - foreach (var shape in shapeGroup.OrderByDescending(HotFlagCount)) - { - if ((shape & sideFlags) == shape) - { - // Consume Shape it given and push the extracted shape - sideFlags &= ~shape; - yield return shape; - } - } - - if (sideFlags == BlendSideFlags.None) - yield break; - } - yield break; - } - #endregion - - #region Utils - private static RenderTarget2D CreateBlendRT() - { - return new(Main.instance.GraphicsDevice, BlendTextureWidth, BlendTextureHeight); - } - - private static int HotFlagCount(BlendSideFlags flags) - { - var count = 0; - for(int i = 0; i<8; i++) - { - var flag = (BlendSideFlags)(1 << i); - if (flag == (flags & flag)) - { - count++; - } - } - return count; - } - - private static int BlendTextureIDToTileType(BlendTextureID id) - { - return id switch - { - BlendTextureID.AbyssGravel => ModContent.TileType(), - BlendTextureID.Ash => TileID.Ash, - BlendTextureID.AstralDirt => ModContent.TileType(), - BlendTextureID.AstralSand => ModContent.TileType(), - BlendTextureID.AstralSandstone => ModContent.TileType(), - BlendTextureID.AstralSnow => ModContent.TileType(), - BlendTextureID.BrimstoneSlag => ModContent.TileType(), - BlendTextureID.Cloud => TileID.Cloud, - BlendTextureID.Dirt => TileID.Dirt, - BlendTextureID.EutrophicSand => ModContent.TileType(), - BlendTextureID.HardenedSand => TileID.HardenedSand, - BlendTextureID.HardenedSulphurousSandstone => ModContent.TileType(), - BlendTextureID.Luminite => TileID.LunarOre, - BlendTextureID.Mud => TileID.Mud, - BlendTextureID.Navystone => ModContent.TileType(), - BlendTextureID.PyreMantle => ModContent.TileType(), - BlendTextureID.RainCloud => TileID.RainCloud, - BlendTextureID.Sand => TileID.Sand, - BlendTextureID.Sandstone => TileID.Sandstone, - BlendTextureID.SnowCloud => TileID.SnowCloud, - BlendTextureID.Snow => TileID.SnowBlock, - BlendTextureID.Stone => TileID.Stone, - BlendTextureID.SulphurousSand => ModContent.TileType(), - BlendTextureID.SulphurousSandstone => ModContent.TileType(), - BlendTextureID.SulphurousShale => ModContent.TileType(), - BlendTextureID.Voidstone => ModContent.TileType(), - _ => throw new ArgumentOutOfRangeException(nameof(id), $"{id} is not valid index!") - }; - } - - private static Rectangle SideDataToSheetRect(byte data) - { - int y = Math.DivRem(data, 16, out int x); - return new Rectangle(x * 18, y * 18, 16, 16); - } - - private static Vector2 SideDataToPositionInSheet(byte data) - { - int y = Math.DivRem(data, 16, out int x); - return new Vector2(x * 18, y * 18); - } #endregion } } diff --git a/Systems/TileMerging/TileBlendMergeSystem_Draw.cs b/Systems/TileMerging/TileBlendMergeSystem_Draw.cs index 0377b51522..dc234518e1 100644 --- a/Systems/TileMerging/TileBlendMergeSystem_Draw.cs +++ b/Systems/TileMerging/TileBlendMergeSystem_Draw.cs @@ -31,12 +31,13 @@ namespace CalamityMod.Systems blendingData.Get(idx, out var sheetIdx, out var data); // Break here as standard for TileBlendingData is 0->Count fill, so further fields should be also Invalid - if (sheetIdx == EmptySheetIndex) + if (sheetIdx == TileBlendTextureLoader.EmptySlot) break; - var rect = SideDataToSheetRect(data); + var rect = TileBlendTexture.SideDataToSheetRect(data); + var texture = TileBlendTextureLoader.Registry[sheetIdx]; var variant = Math.Clamp(tile.TileFrameNumber, 0, 2); - Main.spriteBatch.Draw(_BlendTextures[sheetIdx, variant], drawPos, rect, drawColor, rotation: 0.0f, origin: default, scale: 1.0f, SpriteEffects.None, layerDepth: 0.0f); + Main.spriteBatch.Draw(texture.BlendTextures[variant], drawPos, rect, drawColor, rotation: 0.0f, origin: default, scale: 1.0f, SpriteEffects.None, layerDepth: 0.0f); } } } diff --git a/Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs b/Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs index 4859833922..40c0d2bc9f 100644 --- a/Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs +++ b/Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs @@ -4,7 +4,9 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using CalamityMod.Items.Potions.Alcohol; +using Extensions; using Terraria; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -43,16 +45,7 @@ namespace CalamityMod.Systems continue; BlendSideFlags sideFlags = BlendSideFlags.None; - - CalculateSide(tileType, left, blendTextureID, BlendSideFlags.Left, ref sideFlags, out var leftMerged); - CalculateSide(tileType, right, blendTextureID, BlendSideFlags.Right, ref sideFlags, out var rightMerged); - CalculateSide(tileType, up, blendTextureID, BlendSideFlags.Up, ref sideFlags, out var upMerged); - CalculateSide(tileType, down, blendTextureID, BlendSideFlags.Down, ref sideFlags, out var downMerged); - - if (upMerged && leftMerged) CalculateSide(tileType, upLeft, blendTextureID, BlendSideFlags.UpLeft, ref sideFlags, out _); - if (upMerged && rightMerged) CalculateSide(tileType, upRight, blendTextureID, BlendSideFlags.UpRight, ref sideFlags, out _); - if (downMerged && leftMerged) CalculateSide(tileType, downLeft, blendTextureID, BlendSideFlags.DownLeft, ref sideFlags, out _); - if (downMerged && rightMerged) CalculateSide(tileType, downRight, blendTextureID, BlendSideFlags.DownRight, ref sideFlags, out _); + CalculateSides(blendTextureID, i, j, ref sideFlags); if (sideFlags != BlendSideFlags.None) { @@ -62,40 +55,212 @@ namespace CalamityMod.Systems } } - private static void CalculateSide(int type, int sideType, BlendTextureID blendingWith, BlendSideFlags flagToAdd, ref BlendSideFlags flags, out bool sideMerged) + private static void CalculateSides(int blendingWith, int i, int j, ref BlendSideFlags flags) { - sideMerged = false; + var hasCenter = TryGetTile(i, j, out var centerTile, out var center); - if (sideType < 0) - return; + bool leftMerged = false; + bool rightMerged = false; + bool upMerged = false; + bool downMerged = false; - var canBeMerged = Main.tileMerge[type][sideType]; + #region Basic 4 Direction Merges + + bool hasLeft = TryGetTile(i - 1, j, out var leftTile, out var leftType); + if (hasLeft && HasLeftMerge(centerTile, leftTile)) + { + leftMerged = true; + if (_TileTypeBlendTexture[leftType] == blendingWith) + { + flags |= BlendSideFlags.Left; + } + } + + bool hasRight = TryGetTile(i + 1, j, out var rightTile, out var rightType); + if (hasRight && HasRightMerge(centerTile, rightTile)) + { + rightMerged = true; + if (_TileTypeBlendTexture[rightType] == blendingWith) + { + flags |= BlendSideFlags.Right; + } + } + + bool hasUp = TryGetTile(i, j - 1, out var upTile, out var upType); + if (hasUp && HasUpMerge(centerTile, upTile)) + { + upMerged = true; + if (_TileTypeBlendTexture[upType] == blendingWith) + { + flags |= BlendSideFlags.Up; + } + } + + bool hasDown = TryGetTile(i, j + 1, out var downTile, out var downType); + if (hasDown && HasDownMerge(centerTile, downTile)) + { + downMerged = true; + if (_TileTypeBlendTexture[downType] == blendingWith) + { + flags |= BlendSideFlags.Down; + } + } + + #endregion + + #region Diagonal Direction Merges + + bool hasUpLeft = TryGetTile(i - 1, j - 1, out var upLeftTile, out var upLeftType); + if (hasUpLeft && upMerged && leftMerged && HasRightMerge(upLeftTile, upTile) && HasDownMerge(upLeftTile, leftTile)) + { + if (_TileTypeBlendTexture[upLeftType] == blendingWith) + { + flags |= BlendSideFlags.UpLeft; + } + } + + bool hasUpRight = TryGetTile(i + 1, j - 1, out var upRightTile, out var upRightType); + if (hasUpRight && upMerged && rightMerged && HasLeftMerge(upRightTile, upTile) && HasDownMerge(upRightTile, leftTile)) + { + if (_TileTypeBlendTexture[upRightType] == blendingWith) + { + flags |= BlendSideFlags.UpRight; + } + } + + bool hasDownLeft = TryGetTile(i - 1, j + 1, out var downLeftTile, out var downLeftType); + if (hasDownLeft && downMerged && leftMerged && HasRightMerge(downLeftTile, downTile) && HasUpMerge(downLeftTile, leftTile)) + { + if (_TileTypeBlendTexture[downLeftType] == blendingWith) + { + flags |= BlendSideFlags.DownLeft; + } + } + + bool hasDownRight = TryGetTile(i + 1, j + 1, out var downRightTile, out var downRightType); + if (hasDownRight && downMerged && rightMerged && HasLeftMerge(downRightTile, downTile) && HasUpMerge(downLeftTile, leftTile)) + { + if (_TileTypeBlendTexture[downRightType] == blendingWith) + { + flags |= BlendSideFlags.DownRight; + } + } + + #endregion + } + + + + private static bool HasLeftMerge(Tile tileOnCenter, Tile tileOnLeft) + { + if (!IsMergable(tileOnCenter.TileType, tileOnLeft.TileType)) return false; + if (!HasLeftSolid(tileOnCenter)) return false; + if (!HasRightSolid(tileOnLeft)) return false; + + return true; + } + + private static bool HasRightMerge(Tile tileOnCenter, Tile tileOnRight) + { + if (!IsMergable(tileOnCenter.TileType, tileOnRight.TileType)) return false; + if (!HasRightSolid(tileOnCenter)) return false; + if (!HasLeftSolid(tileOnRight)) return false; + + return true; + } + + private static bool HasUpMerge(Tile tileOnCenter, Tile tileOnUp) + { + if (!IsMergable(tileOnCenter.TileType, tileOnUp.TileType)) return false; + if (!HasUpSolid(tileOnCenter)) return false; + if (!HasDownSolid(tileOnUp)) return false; + + return true; + } + + private static bool HasDownMerge(Tile tileOnCenter, Tile tileOnDown) + { + if (!IsMergable(tileOnCenter.TileType, tileOnDown.TileType)) return false; + if (!HasDownSolid(tileOnCenter)) return false; + if (!HasUpSolid(tileOnDown)) return false; + + return true; + } + + private static bool HasLeftSolid(Tile tile) + { + return tile.BlockType switch + { + BlockType.Solid => true, + BlockType.SlopeUpLeft => true, + BlockType.SlopeDownLeft => true, + _ => false + }; + } + + private static bool HasRightSolid(Tile tile) + { + return tile.BlockType switch + { + BlockType.Solid => true, + BlockType.SlopeUpRight => true, + BlockType.SlopeDownRight => true, + _ => false + }; + } + + private static bool HasUpSolid(Tile tile) + { + return tile.BlockType switch + { + BlockType.Solid => true, + BlockType.HalfBlock => true, + BlockType.SlopeUpLeft => true, + BlockType.SlopeUpRight => true, + _ => false + }; + } + + private static bool HasDownSolid(Tile tile) + { + return tile.BlockType switch + { + BlockType.Solid => true, + BlockType.SlopeDownLeft => true, + BlockType.SlopeDownRight => true, + _ => false + }; + } + + private static bool IsMergable(int type, int otherType) + { + if (type < 0 || otherType < 0) + return false; + + if (type == otherType) + return true; + + var canBeMerged = Main.tileMerge[type][otherType]; if (Main.tileBlendAll[type]) { - sideMerged = canBeMerged && !TileID.Sets.BlockMergesWithMergeAllBlock[sideType]; + return canBeMerged && !TileID.Sets.BlockMergesWithMergeAllBlock[otherType]; } else { - sideMerged = canBeMerged; - } - - var blendTextureID = _TileTypeBlendTexture[sideType]; - if (sideMerged && (blendTextureID == blendingWith)) - { - flags |= flagToAdd; + return canBeMerged; } } - private static HashSet PopulateBlendTileTypes(params int[] types) + private static HashSet PopulateBlendTileTypes(params int[] types) { - var hashSet = new HashSet(); + var hashSet = new HashSet(); foreach (var type in types) { if (type < 0) continue; var blendTextureID = _TileTypeBlendTexture[type]; - if (blendTextureID != BlendTextureID.None) + if (blendTextureID != TileBlendTextureLoader.EmptySlot) hashSet.Add(blendTextureID); } return hashSet; @@ -112,5 +277,26 @@ namespace CalamityMod.Systems return tile.TileType; } + + private static bool TryGetTile(int i, int j, out Tile tile, out int type) + { + if (!WorldGen.InWorld(i, j)) + { + tile = default; + type = -1; + return false; + } + + tile = Main.tile[i, j]; + if (!tile.HasTile) + { + tile = default; + type = -1; + return false; + } + + type = tile.TileType; + return true; + } } } diff --git a/Systems/TileMerging/TileBlendTexture.cs b/Systems/TileMerging/TileBlendTexture.cs new file mode 100644 index 0000000000..6244022cd7 --- /dev/null +++ b/Systems/TileMerging/TileBlendTexture.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.DataStructures; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + [Autoload(Side = ModSide.Client)] + public abstract partial class TileBlendTexture : ModTexturedType + { + #region Constants + public const byte EmptySheetIndex = byte.MaxValue; + public const int VariantCount = 3; + + public const int BlendTextureXCount = 16; + public const int BlendTextureYCount = 16; + public const int BlendTextureWidth = 18 * BlendTextureXCount; + public const int BlendTextureHeight = 18 * BlendTextureYCount; + #endregion + + #region Properties + public Asset TextureAsset { get; private set; } + public int Slot { get; private set; } + public RenderTarget2D[] BlendTextures { get; private set; } // dimension: [3] + #endregion + + #region Overrides + public abstract int TileType { get; } + #endregion + + protected sealed override void Register() + { + Slot = TileBlendTextureLoader.Register(this); + TextureAsset = ModContent.Request(Texture); + BlendTextures = new RenderTarget2D[3]; + + Main.QueueMainThreadAction(() => + { + for (int v = 0; v < VariantCount; v++) + BlendTextures[v] = new(Main.instance.GraphicsDevice, BlendTextureWidth, BlendTextureHeight); + }); + } + + public sealed override void SetupContent() + { + SetStaticDefaults(); + } + + public sealed override void Unload() + { + if (BlendTextures is not null) + { + foreach (var rt in BlendTextures) + { + if (rt is null) + continue; + + if (rt.IsDisposed) + continue; + + rt.Dispose(); + } + + Array.Clear(BlendTextures); + BlendTextures = null; + } + + PostUnload(); + } + + public virtual void PostUnload() + { + + } + + public void ReplaceBlendSheet(Texture2D texture) + { + // It's baking moment + Main.QueueMainThreadAction(() => + { + BakeBlendTexture(texture); + }); + } + } +} diff --git a/Systems/TileMerging/TileBlendTextureLoader.cs b/Systems/TileMerging/TileBlendTextureLoader.cs new file mode 100644 index 0000000000..4d5294873a --- /dev/null +++ b/Systems/TileMerging/TileBlendTextureLoader.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + internal sealed class TileBlendTextureLoader : ModSystem + { + internal const int EmptySlot = 255; + + internal static TileBlendTexture[] Registry { get; private set; } + internal static IEnumerable AllTextures => Registry.Take(Count); + internal static int Count => _UniqueSlot; + + private static int _UniqueSlot = 0; + + public override void Load() + { + Registry = new TileBlendTexture[256]; + } + + public override void Unload() + { + Registry = null; + } + + internal static int Register(TileBlendTexture sheet) + { + var slot = _UniqueSlot++; + Registry[slot] = sheet; + return slot; + } + } +} diff --git a/Systems/TileMerging/TileBlendTexture_Baking.cs b/Systems/TileMerging/TileBlendTexture_Baking.cs new file mode 100644 index 0000000000..e78ea42f8a --- /dev/null +++ b/Systems/TileMerging/TileBlendTexture_Baking.cs @@ -0,0 +1,119 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public abstract partial class TileBlendTexture : ModTexturedType + { + #region Sheet Baking Process + public void BakeBlendTexture(Texture2D texture) + { + if (texture == null) + throw new ArgumentNullException(nameof(texture), "Texture is Null!"); + + if (texture.IsDisposed) + throw new ArgumentException(paramName: nameof(texture), message: "Texture is Disposed!"); + + for (int v = 0; v < VariantCount; v++) + { + var renderTarget = BlendTextures[v]; + var graphicsDevice = Main.instance.GraphicsDevice; + graphicsDevice.SetRenderTarget(renderTarget); + graphicsDevice.Clear(Color.Transparent); + + Main.spriteBatch.SafeBegin(SpriteSortMode.Immediate, BatchSetting.AlphaBlend, null, Matrix.Identity, () => + { + for (int i = 0; i < 256; i++) + { + var drawPos = SideDataToPositionInSheet((byte)i); + var mergeSides = (BlendSideFlags)i; + + // Easy cases, It match on Shape Lookup Sheet Directly + if (_ShapeLookup.TryGetValue(mergeSides, out var rects)) + { + Main.spriteBatch.Draw(texture, drawPos, rects[v], Color.White, 0.0f, Vector2.Zero, 1.0f, SpriteEffects.None, 0.0f); + continue; + } + + var extractedShapes = ConsumeMergeSides(mergeSides); + foreach (var shape in extractedShapes) + { + if (_ShapeLookup.TryGetValue(shape, out var shapeRects)) + { + Main.spriteBatch.Draw(texture, drawPos, shapeRects[v], Color.White, 0.0f, Vector2.Zero, 1.0f, SpriteEffects.None, 0.0f); + } + } + } + }); + + graphicsDevice.SetRenderTarget(null); + } + } + + private static IEnumerable ConsumeMergeSides(BlendSideFlags sideFlags) + { + if (sideFlags == BlendSideFlags.None) + yield break; + + IEnumerable> shapes = [ + _U_Shapes, + _L_Shapes, + _I_Shapes, // I shape includes up, down, left, right + _Corner_Shapes + ]; + + foreach (var shapeGroup in shapes) + { + foreach (var shape in shapeGroup.OrderByDescending(HotFlagCount)) + { + if ((shape & sideFlags) == shape) + { + // Consume Shape it given and push the extracted shape + sideFlags &= ~shape; + yield return shape; + } + } + + if (sideFlags == BlendSideFlags.None) + yield break; + } + yield break; + } + #endregion + + #region Utils + private static int HotFlagCount(BlendSideFlags flags) + { + var count = 0; + for (int i = 0; i < 8; i++) + { + var flag = (BlendSideFlags)(1 << i); + if (flag == (flags & flag)) + { + count++; + } + } + return count; + } + + public static Rectangle SideDataToSheetRect(byte data) + { + int y = Math.DivRem(data, 16, out int x); + return new Rectangle(x * 18, y * 18, 16, 16); + } + + public static Vector2 SideDataToPositionInSheet(byte data) + { + int y = Math.DivRem(data, 16, out int x); + return new Vector2(x * 18, y * 18); + } + #endregion + } +} diff --git a/Systems/TileMerging/TileBlendMergeSystem_SheetLookup.cs b/Systems/TileMerging/TileBlendTexture_Lookup.cs similarity index 98% rename from Systems/TileMerging/TileBlendMergeSystem_SheetLookup.cs rename to Systems/TileMerging/TileBlendTexture_Lookup.cs index a0c14a5614..7560337edf 100644 --- a/Systems/TileMerging/TileBlendMergeSystem_SheetLookup.cs +++ b/Systems/TileMerging/TileBlendTexture_Lookup.cs @@ -1,5 +1,9 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; +using System.Linq; using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; using Microsoft.Xna.Framework; using Terraria.ModLoader; @@ -7,7 +11,7 @@ using static CalamityMod.Systems.BlendSideFlags; namespace CalamityMod.Systems { - public sealed partial class TileBlendMergeSystem : ModSystem + public abstract partial class TileBlendTexture : ModTexturedType { // Welcome to Hardcoded hell // Do NOT change anything in here unless you understand absolutely everything @@ -141,12 +145,12 @@ namespace CalamityMod.Systems [ShapeL_UpLeft_End] = _L_UpLeft_End, [ShapeL_UpLeft_RightEnd] = _L_UpLeft_RightEnd, [ShapeL_UpLeft_DownEnd] = _L_UpLeft_DownEnd, - + [ShapeL_UpRight] = _L_UpRight, [ShapeL_UpRight_End] = _L_UpRight_End, [ShapeL_UpRight_LeftEnd] = _L_UpRight_LeftEnd, [ShapeL_UpRight_DownEnd] = _L_UpRight_DownEnd, - + [ShapeL_DownLeft] = _L_DownLeft, [ShapeL_DownLeft_End] = _L_DownLeft_End, [ShapeL_DownLeft_RightEnd] = _L_DownLeft_RightEnd, diff --git a/Tiles/Merges/AbyssGravelMerge.cs b/Tiles/Merges/AbyssGravelMerge.cs new file mode 100644 index 0000000000..30a16d02bd --- /dev/null +++ b/Tiles/Merges/AbyssGravelMerge.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Systems; +using CalamityMod.Tiles.Abyss; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.Merges +{ + public sealed class AbyssGravelMerge : TileBlendTexture + { + public override int TileType => ModContent.TileType(); + } +} diff --git a/Tiles/Merges/AshMerge.cs b/Tiles/Merges/AshMerge.cs new file mode 100644 index 0000000000..0e40adacc3 --- /dev/null +++ b/Tiles/Merges/AshMerge.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Systems; +using Terraria.ID; + +namespace CalamityMod.Tiles.Merges +{ + public sealed class AshMerge : TileBlendTexture + { + public override int TileType => TileID.Ash; + } +} diff --git a/Tiles/Merges/AstralDirtMerge.cs b/Tiles/Merges/AstralDirtMerge.cs new file mode 100644 index 0000000000..bd375f30ce --- /dev/null +++ b/Tiles/Merges/AstralDirtMerge.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Systems; +using CalamityMod.Tiles.Astral; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.Merges +{ + public sealed class AstralDirtMerge : TileBlendTexture + { + public override int TileType => ModContent.TileType(); + } +} diff --git a/Tiles/Merges/AstralSandMerge.cs b/Tiles/Merges/AstralSandMerge.cs new file mode 100644 index 0000000000..993c97bb4e --- /dev/null +++ b/Tiles/Merges/AstralSandMerge.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Systems; +using CalamityMod.Tiles.AstralDesert; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.Merges +{ + public sealed class AstralSandMerge : TileBlendTexture + { + public override int TileType => ModContent.TileType(); + } +} diff --git a/Tiles/Merges/AstralSandstoneMerge.cs b/Tiles/Merges/AstralSandstoneMerge.cs new file mode 100644 index 0000000000..83be67fd5b --- /dev/null +++ b/Tiles/Merges/AstralSandstoneMerge.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Systems; +using CalamityMod.Tiles.AstralDesert; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.Merges +{ + public sealed class AstralSandstoneMerge : TileBlendTexture + { + public override int TileType => ModContent.TileType(); + } +} diff --git a/Tiles/Merges/AstralSnowMerge.cs b/Tiles/Merges/AstralSnowMerge.cs new file mode 100644 index 0000000000..8b3719fbda --- /dev/null +++ b/Tiles/Merges/AstralSnowMerge.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Systems; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.Merges +{ + public sealed class AstralSnowMerge : TileBlendTexture + { + public override int TileType => ModContent.TileType(); + } +} diff --git a/Tiles/Merges/BrimstoneSlagMerge.cs b/Tiles/Merges/BrimstoneSlagMerge.cs new file mode 100644 index 0000000000..e6839eab2c --- /dev/null +++ b/Tiles/Merges/BrimstoneSlagMerge.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Systems; +using CalamityMod.Tiles.Crags; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.Merges +{ + public sealed class BrimstoneSlagMerge : TileBlendTexture + { + public override int TileType => ModContent.TileType(); + } +} diff --git a/Tiles/Merges/CloudMerge.cs b/Tiles/Merges/CloudMerge.cs new file mode 100644 index 0000000000..486a71992f --- /dev/null +++ b/Tiles/Merges/CloudMerge.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Systems; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.Merges +{ + public sealed class CloudMerge : TileBlendTexture + { + public override int TileType => TileID.Cloud; + } +} diff --git a/Tiles/Merges/DirtMerge.cs b/Tiles/Merges/DirtMerge.cs new file mode 100644 index 0000000000..4b7fdf821f --- /dev/null +++ b/Tiles/Merges/DirtMerge.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Systems; +using Terraria.ID; + +namespace CalamityMod.Tiles.Merges +{ + public sealed class DirtMerge : TileBlendTexture + { + public override int TileType => TileID.Dirt; + } +} diff --git a/Tiles/Merges/EutrophicSandMerge.cs b/Tiles/Merges/EutrophicSandMerge.cs new file mode 100644 index 0000000000..84f5014349 --- /dev/null +++ b/Tiles/Merges/EutrophicSandMerge.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Systems; +using CalamityMod.Tiles.SunkenSea; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.Merges +{ + public sealed class EutrophicSandMerge : TileBlendTexture + { + public override int TileType => ModContent.TileType(); + } +} diff --git a/Tiles/Merges/HardenedSandMerge.cs b/Tiles/Merges/HardenedSandMerge.cs new file mode 100644 index 0000000000..d82124c471 --- /dev/null +++ b/Tiles/Merges/HardenedSandMerge.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Systems; +using Terraria.ID; + +namespace CalamityMod.Tiles.Merges +{ + public sealed class HardenedSandMerge : TileBlendTexture + { + public override int TileType => TileID.HardenedSand; + } +} diff --git a/Tiles/Merges/HardenedSulphurousSandstoneMerge.cs b/Tiles/Merges/HardenedSulphurousSandstoneMerge.cs new file mode 100644 index 0000000000..11c38bb34b --- /dev/null +++ b/Tiles/Merges/HardenedSulphurousSandstoneMerge.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Systems; +using CalamityMod.Tiles.Abyss; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.Merges +{ + public sealed class HardenedSulphurousSandstoneMerge : TileBlendTexture + { + public override int TileType => ModContent.TileType(); + } +} diff --git a/Tiles/Merges/LuminiteMerge.cs b/Tiles/Merges/LuminiteMerge.cs new file mode 100644 index 0000000000..b98f1566ac --- /dev/null +++ b/Tiles/Merges/LuminiteMerge.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Systems; +using Terraria.ID; + +namespace CalamityMod.Tiles.Merges +{ + public sealed class LuminiteMerge : TileBlendTexture + { + public override int TileType => TileID.LunarOre; + } +} diff --git a/Tiles/Merges/MudMerge.cs b/Tiles/Merges/MudMerge.cs new file mode 100644 index 0000000000..85b2fcc6fa --- /dev/null +++ b/Tiles/Merges/MudMerge.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Systems; +using Terraria.ID; + +namespace CalamityMod.Tiles.Merges +{ + public sealed class MudMerge : TileBlendTexture + { + public override int TileType => TileID.Mud; + } +} diff --git a/Tiles/Merges/NavystoneMerge.cs b/Tiles/Merges/NavystoneMerge.cs new file mode 100644 index 0000000000..fc4331fe19 --- /dev/null +++ b/Tiles/Merges/NavystoneMerge.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Systems; +using CalamityMod.Tiles.SunkenSea; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.Merges +{ + public sealed class NavystoneMerge : TileBlendTexture + { + public override int TileType => ModContent.TileType(); + } +} diff --git a/Tiles/Merges/PearlstoneMerge.cs b/Tiles/Merges/PearlstoneMerge.cs new file mode 100644 index 0000000000..9e6a376cfd --- /dev/null +++ b/Tiles/Merges/PearlstoneMerge.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Systems; +using Terraria.ID; + +namespace CalamityMod.Tiles.Merges +{ + public sealed class PearlstoneMerge : TileBlendTexture + { + public override int TileType => TileID.Pearlstone; + } +} diff --git a/Tiles/Merges/PyreMantleMerge.cs b/Tiles/Merges/PyreMantleMerge.cs new file mode 100644 index 0000000000..73458c5c7c --- /dev/null +++ b/Tiles/Merges/PyreMantleMerge.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Systems; +using CalamityMod.Tiles.Abyss; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.Merges +{ + public sealed class PyreMantleMerge : TileBlendTexture + { + public override int TileType => ModContent.TileType(); + } +} diff --git a/Tiles/Merges/RainCloudMerge.cs b/Tiles/Merges/RainCloudMerge.cs new file mode 100644 index 0000000000..a741cf99cb --- /dev/null +++ b/Tiles/Merges/RainCloudMerge.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Systems; +using Terraria.ID; + +namespace CalamityMod.Tiles.Merges +{ + public sealed class RainCloudMerge : TileBlendTexture + { + public override int TileType => TileID.RainCloud; + } +} diff --git a/Tiles/Merges/SandMerge.cs b/Tiles/Merges/SandMerge.cs new file mode 100644 index 0000000000..f52a18a8ff --- /dev/null +++ b/Tiles/Merges/SandMerge.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Systems; +using Terraria.ID; + +namespace CalamityMod.Tiles.Merges +{ + public sealed class SandMerge : TileBlendTexture + { + public override int TileType => TileID.Sand; + } +} diff --git a/Tiles/Merges/SandstoneMerge.cs b/Tiles/Merges/SandstoneMerge.cs new file mode 100644 index 0000000000..3bf4d424f6 --- /dev/null +++ b/Tiles/Merges/SandstoneMerge.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Systems; +using Terraria.ID; + +namespace CalamityMod.Tiles.Merges +{ + public sealed class SandstoneMerge : TileBlendTexture + { + public override int TileType => TileID.Sandstone; + } +} diff --git a/Tiles/Merges/SnowCloudMerge.cs b/Tiles/Merges/SnowCloudMerge.cs new file mode 100644 index 0000000000..be9736bf56 --- /dev/null +++ b/Tiles/Merges/SnowCloudMerge.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Systems; +using Terraria.ID; + +namespace CalamityMod.Tiles.Merges +{ + public sealed class SnowCloudMerge : TileBlendTexture + { + public override int TileType => TileID.SnowCloud; + } +} diff --git a/Tiles/Merges/SnowMerge.cs b/Tiles/Merges/SnowMerge.cs new file mode 100644 index 0000000000..374ddd1d15 --- /dev/null +++ b/Tiles/Merges/SnowMerge.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Systems; +using Terraria.ID; + +namespace CalamityMod.Tiles.Merges +{ + public sealed class SnowMerge : TileBlendTexture + { + public override int TileType => TileID.SnowBlock; + } +} diff --git a/Tiles/Merges/StoneMerge.cs b/Tiles/Merges/StoneMerge.cs new file mode 100644 index 0000000000..1ce0e06c10 --- /dev/null +++ b/Tiles/Merges/StoneMerge.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Systems; +using Terraria.ID; + +namespace CalamityMod.Tiles.Merges +{ + public sealed class StoneMerge : TileBlendTexture + { + public override int TileType => TileID.Stone; + } +} diff --git a/Tiles/Merges/SulphurousSandMerge.cs b/Tiles/Merges/SulphurousSandMerge.cs new file mode 100644 index 0000000000..ff3e1e2664 --- /dev/null +++ b/Tiles/Merges/SulphurousSandMerge.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Systems; +using CalamityMod.Tiles.Abyss; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.Merges +{ + public sealed class SulphurousSandMerge : TileBlendTexture + { + public override int TileType => ModContent.TileType(); + } +} diff --git a/Tiles/Merges/SulphurousSandstoneMerge.cs b/Tiles/Merges/SulphurousSandstoneMerge.cs new file mode 100644 index 0000000000..ad3648857a --- /dev/null +++ b/Tiles/Merges/SulphurousSandstoneMerge.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Systems; +using CalamityMod.Tiles.Abyss; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.Merges +{ + public sealed class SulphurousSandstoneMerge : TileBlendTexture + { + public override int TileType => ModContent.TileType(); + } +} diff --git a/Tiles/Merges/SulphurousShaleMerge.cs b/Tiles/Merges/SulphurousShaleMerge.cs new file mode 100644 index 0000000000..9fc08075c5 --- /dev/null +++ b/Tiles/Merges/SulphurousShaleMerge.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Systems; +using CalamityMod.Tiles.Abyss; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.Merges +{ + public sealed class SulphurousShaleMerge : TileBlendTexture + { + public override int TileType => ModContent.TileType(); + } +} diff --git a/Tiles/Merges/VoidstoneMerge.cs b/Tiles/Merges/VoidstoneMerge.cs new file mode 100644 index 0000000000..0f827eafc6 --- /dev/null +++ b/Tiles/Merges/VoidstoneMerge.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Systems; +using CalamityMod.Tiles.Abyss; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.Merges +{ + public sealed class VoidstoneMerge : TileBlendTexture + { + public override int TileType => ModContent.TileType(); + } +} From 7e0906a4b52cbb2e051d6c49d762349759ca3a5c Mon Sep 17 00:00:00 2001 From: Flowaria Date: Fri, 27 Sep 2024 23:00:04 +0900 Subject: [PATCH 048/133] Added RegisterMerge Generic form Override --- Systems/TileMerging/TileBlendMergeSystem.cs | 6 ++++++ Systems/TileMerging/TileBlendTextureLoader.cs | 1 + Tiles/Abyss/PlantyMush.cs | 13 ++++++++++--- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Systems/TileMerging/TileBlendMergeSystem.cs b/Systems/TileMerging/TileBlendMergeSystem.cs index 8c8cd5a990..66e6489e1e 100644 --- a/Systems/TileMerging/TileBlendMergeSystem.cs +++ b/Systems/TileMerging/TileBlendMergeSystem.cs @@ -108,6 +108,12 @@ namespace CalamityMod.Systems _TileBlendable[myType, blendTexture.Slot] = true; CalamityUtils.SetMerge(myType, blendTileType, true); } + + public static void RegisterMerge(int myType) where T : TileBlendTexture + { + var blendTexture = ModContent.GetInstance(); + RegisterMerge(myType, blendTexture); + } #endregion } } diff --git a/Systems/TileMerging/TileBlendTextureLoader.cs b/Systems/TileMerging/TileBlendTextureLoader.cs index 4d5294873a..a398c7fab3 100644 --- a/Systems/TileMerging/TileBlendTextureLoader.cs +++ b/Systems/TileMerging/TileBlendTextureLoader.cs @@ -29,6 +29,7 @@ namespace CalamityMod.Systems public override void Unload() { Registry = null; + _UniqueSlot = 0; } internal static int Register(TileBlendTexture sheet) diff --git a/Tiles/Abyss/PlantyMush.cs b/Tiles/Abyss/PlantyMush.cs index 378a4400bd..7f3fadde47 100644 --- a/Tiles/Abyss/PlantyMush.cs +++ b/Tiles/Abyss/PlantyMush.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using CalamityMod.Systems; using CalamityMod.Tiles.Abyss.AbyssAmbient; +using CalamityMod.Tiles.Merges; using CalamityMod.Walls; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -33,9 +34,15 @@ namespace CalamityMod.Tiles.Abyss AddMapEntry(new Color(84, 102, 39), CalamityUtils.GetItemName()); HitSound = MineSound; - this.RegisterUniversalMerge(TileID.Dirt, "CalamityMod/Tiles/Merges/DirtMerge"); - this.RegisterUniversalMerge(TileID.Stone, "CalamityMod/Tiles/Merges/StoneMerge"); - this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/AbyssGravelMerge"); + // Old Syntax + //this.RegisterUniversalMerge(TileID.Dirt, "CalamityMod/Tiles/Merges/DirtMerge"); + //this.RegisterUniversalMerge(TileID.Stone, "CalamityMod/Tiles/Merges/StoneMerge"); + //this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/AbyssGravelMerge"); + + // New Syntax + TileBlendMergeSystem.RegisterMerge(Type); + TileBlendMergeSystem.RegisterMerge(Type); + TileBlendMergeSystem.RegisterMerge(Type); } int animationFrameWidth = 234; From 17e9331db9c8826a42b14cfb7ddc9f0f7d377039 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Fri, 27 Sep 2024 23:17:23 +0900 Subject: [PATCH 049/133] Fixed Abyss Gravel Issue --- Systems/TileMerging/TileBlendMergeSystem.cs | 24 ++++++++++--------- .../TileBlendMergeSystem_TileFrame.cs | 18 +++++++------- Systems/TileMerging/TileBlendTexture.cs | 16 ++++++++++++- 3 files changed, 37 insertions(+), 21 deletions(-) diff --git a/Systems/TileMerging/TileBlendMergeSystem.cs b/Systems/TileMerging/TileBlendMergeSystem.cs index 66e6489e1e..5a1609b9aa 100644 --- a/Systems/TileMerging/TileBlendMergeSystem.cs +++ b/Systems/TileMerging/TileBlendMergeSystem.cs @@ -32,20 +32,22 @@ namespace CalamityMod.Systems public sealed partial class TileBlendMergeSystem : ModSystem { private static bool[,] _TileBlendable; // dimension: [TileTypeCount, AllBlendTextureCount] - private static byte[] _TileTypeBlendTexture; // dimension: [TileTypeCount] + private static byte[] _TileTypeToBlendTextureSlot; // dimension: [TileTypeCount] #region Load/Unload public override void OnModLoad() { var tileCount = TileLoader.TileCount; var blendTextureCount = TileBlendTextureLoader.Count; - _TileBlendable = new bool[tileCount, TileBlendTextureLoader.Count]; - _TileTypeBlendTexture = new byte[tileCount]; + _TileBlendable = new bool[tileCount, blendTextureCount]; + _TileTypeToBlendTextureSlot = new byte[tileCount]; + + Array.Fill(_TileTypeToBlendTextureSlot, (byte)TileBlendTextureLoader.EmptySlot); for (int i = 0; i TextureAsset { get; private set; } public int Slot { get; private set; } public RenderTarget2D[] BlendTextures { get; private set; } // dimension: [3] #endregion + + #region Overrides public abstract int TileType { get; } #endregion + + #region Setups protected sealed override void Register() { Slot = TileBlendTextureLoader.Register(this); @@ -79,9 +85,17 @@ namespace CalamityMod.Systems { } + #endregion - public void ReplaceBlendSheet(Texture2D texture) + + + public void RebuildBlendSheet(Texture2D texture = null) { + if (texture is null) + { + texture = TextureAsset.Value; + } + // It's baking moment Main.QueueMainThreadAction(() => { From 5282c504999c6e6a6555bb57bec98cabd1a78b1b Mon Sep 17 00:00:00 2001 From: Flowaria Date: Fri, 27 Sep 2024 23:19:57 +0900 Subject: [PATCH 050/133] Rolled back PlantyMush code change --- Tiles/Abyss/PlantyMush.cs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Tiles/Abyss/PlantyMush.cs b/Tiles/Abyss/PlantyMush.cs index 7f3fadde47..378a4400bd 100644 --- a/Tiles/Abyss/PlantyMush.cs +++ b/Tiles/Abyss/PlantyMush.cs @@ -1,7 +1,6 @@ using System.Collections.Generic; using CalamityMod.Systems; using CalamityMod.Tiles.Abyss.AbyssAmbient; -using CalamityMod.Tiles.Merges; using CalamityMod.Walls; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -34,15 +33,9 @@ namespace CalamityMod.Tiles.Abyss AddMapEntry(new Color(84, 102, 39), CalamityUtils.GetItemName()); HitSound = MineSound; - // Old Syntax - //this.RegisterUniversalMerge(TileID.Dirt, "CalamityMod/Tiles/Merges/DirtMerge"); - //this.RegisterUniversalMerge(TileID.Stone, "CalamityMod/Tiles/Merges/StoneMerge"); - //this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/AbyssGravelMerge"); - - // New Syntax - TileBlendMergeSystem.RegisterMerge(Type); - TileBlendMergeSystem.RegisterMerge(Type); - TileBlendMergeSystem.RegisterMerge(Type); + this.RegisterUniversalMerge(TileID.Dirt, "CalamityMod/Tiles/Merges/DirtMerge"); + this.RegisterUniversalMerge(TileID.Stone, "CalamityMod/Tiles/Merges/StoneMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/AbyssGravelMerge"); } int animationFrameWidth = 234; From dca8fb2fd57d18db152bcf40c3c681310b7510dd Mon Sep 17 00:00:00 2001 From: Flowaria Date: Fri, 27 Sep 2024 23:20:20 +0900 Subject: [PATCH 051/133] Marked RegisterUniversalMerge as Obsolete --- Systems/TileMerging/TileBlendMergeSystem.cs | 1 - Utilities/TileUtils.cs | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Systems/TileMerging/TileBlendMergeSystem.cs b/Systems/TileMerging/TileBlendMergeSystem.cs index 5a1609b9aa..9268ef4978 100644 --- a/Systems/TileMerging/TileBlendMergeSystem.cs +++ b/Systems/TileMerging/TileBlendMergeSystem.cs @@ -24,7 +24,6 @@ using Terraria.DataStructures; using Terraria.GameContent.Drawing; using Terraria.ID; using Terraria.ModLoader; -using static CalamityMod.NPCs.SunkenSea.PolypPanasea; namespace CalamityMod.Systems { diff --git a/Utilities/TileUtils.cs b/Utilities/TileUtils.cs index 2d19acf19b..9f9685e2df 100644 --- a/Utilities/TileUtils.cs +++ b/Utilities/TileUtils.cs @@ -317,6 +317,7 @@ namespace CalamityMod // Extension shorthand for the Tile Framing System Universal Merges. // As this must be defined in a static class, it's out here in CalamityUtils. + [Obsolete("Use TileBlendMergeSystem.RegisterMerge Instead")] public static void RegisterUniversalMerge(this ModTile tile, int mergeType, string blendSheetPath) { //TileFramingSystem.RegisterUniversalMerge(tile.Type, mergeType, blendSheetPath); From a93594dff8fcd75c4795b316c7064a93fd961870 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Fri, 27 Sep 2024 23:25:51 +0900 Subject: [PATCH 052/133] Removed UniversalMerge in TileFramingSystem --- Systems/TileFramingSystem.cs | 539 ----------------------------------- 1 file changed, 539 deletions(-) diff --git a/Systems/TileFramingSystem.cs b/Systems/TileFramingSystem.cs index d84a527711..e55bedb771 100644 --- a/Systems/TileFramingSystem.cs +++ b/Systems/TileFramingSystem.cs @@ -43,47 +43,12 @@ namespace CalamityMod.Systems } #endregion - #region Merge Frame Data - public sealed class MergeFrameData - { - public byte[,] AdjacencyData { get; } - - public int TileID { get; } - - public int FrameOffsetX { get; } - - public int FrameOffsetY { get; } - - public Asset BlendSheet { get; } - - public MergeFrameData(byte[,] adjacencyData, int tileId, string blendSheetPath, int frameOffsetX = 0, int frameOffsetY = 0) - { - AdjacencyData = adjacencyData; - TileID = tileId; - FrameOffsetX = frameOffsetX; - FrameOffsetY = frameOffsetY; - - if (!cachedBlendSheets.TryGetValue(blendSheetPath, out var blendSheet)) - { - blendSheet = cachedBlendSheets[blendSheetPath] = ModContent.Request(blendSheetPath); - } - - BlendSheet = blendSheet; - } - } - #endregion - // This tiny GlobalTile exists for two purposes: // 1 - Ensure merge data is loaded and cached // 2 - Properly and automatically render merges in all cases for all tiles #region Sealed Global Tile private sealed class MergeableTileGlobalTile : GlobalTile { - //public override void PostDraw(int i, int j, int type, SpriteBatch spriteBatch) - //{ - // DrawUniversalMergeFrames(i, j, GetOrCreateTileAdjacencies(type)); - //} - public override bool TileFrame(int i, int j, int type, ref bool resetFrame, ref bool noBreak) { // Custom plant framing @@ -98,9 +63,6 @@ namespace CalamityMod.Systems if (type == TileID.Vines || type == TileID.CrimsonVines || type == TileID.HallowedVines || type == ModContent.TileType()) VineFrame(i, j); - //foreach (var adjacency in GetOrCreateTileAdjacencies(type)) - //GetAdjacencyData(i, j, adjacency); - return base.TileFrame(i, j, type, ref resetFrame, ref noBreak); } } @@ -108,8 +70,6 @@ namespace CalamityMod.Systems // CONSIDER -- This is a triangle array, but does it need to be? Main.tileMerge is a triangle array as well public static bool[][] tileMergeTypes; - private static Dictionary> tileAdjacencyMap = []; - private static Dictionary> cachedBlendSheets = []; #region Plant Stuff private static ushort[] PlantTypes = @@ -206,12 +166,6 @@ namespace CalamityMod.Systems VineToGrass = null; tileMergeTypes = null; - - tileAdjacencyMap?.Clear(); - tileAdjacencyMap = null; - - cachedBlendSheets?.Clear(); - cachedBlendSheets = null; } #endregion @@ -2109,498 +2063,5 @@ namespace CalamityMod.Systems CustomMergeFrameExplicit(x, y, myType, mergeType, out _, out _, out _, out _, forceSameDown, forceSameUp, forceSameLeft, forceSameRight, true); } #endregion - - #region Universal Merge Code - // Code responsible for the 'Universal Tile Merge' code created to get around the issues with merging brimstone tile framing - // It'll work for any tile regardless of framing and could in theory be added to vanilla tiles as well if desired - // A single tile could also be set to blend with multiple other tiles, though a new adjacency data array will be needed for each tile type it'll merge with as well as a new call of each function so it's probably not the best - - // I chose to use bytes and byte masks to store and check the merge data so that the fully merge conditional tree wouldn't need to be called every frame for every tile - // Not sure if this is the best option, I thought it would minimise the amount of data required to store the adjacency info while being reasonably efficient - // Apologies for how unreadable this makes the code, I did my best to comment what each part of the merge tree in DrawUniversalMergeFrames is responsible for to compensate for this but it's still not ideal - // - Alta - - internal static void RegisterUniversalMerge(int tileId, int mergeType, string blendSheetPath) - { - SetUpUniversalMerge(tileId, mergeType, blendSheetPath, out var data); - GetOrCreateTileAdjacencies(tileId).Add(data); - } - - private static List GetOrCreateTileAdjacencies(int tileId) - { - if (!tileAdjacencyMap.TryGetValue(tileId, out var adjacencies)) - tileAdjacencyMap[tileId] = adjacencies = []; - - return adjacencies; - } - - /// - /// Call this in SetStaticDefaults. Used to set up the adjacency data array with the correct dimensions. - /// - internal static void SetUpUniversalMerge(int myType, int mergeType, string blendSheetPath, out MergeFrameData adjacencyData) - { - CalamityUtils.SetMerge(myType, mergeType, true); - adjacencyData = new MergeFrameData(new byte[Main.tile.Width, Main.tile.Height], mergeType, blendSheetPath); - } - - /// - /// Call this in PostDraw. Uses adjacency data generated by GetAdjacencyData to draw the correct blend state over a given tile, regardless of what tile frame that tile is using - /// - internal static void DrawUniversalMergeFrames(int x, int y, List mergeFrames) - { - var shadingColour = Lighting.GetColor(x, y); - var myTile = Main.tile[x, y]; - - foreach (var frame in mergeFrames) - { - // If it hasn't yet been initialized somehow... for some reason. - if (frame is null) - continue; - - DrawUniversalMergeFrames(x, y, frame, shadingColour, myTile); - } - } - - internal static void DrawUniversalMergeFrames(int x, int y, MergeFrameData mergeFrameData, Color shadingColour, Tile myTile) - { - var adjacencyData = mergeFrameData.AdjacencyData; - var blendLayer = mergeFrameData.BlendSheet.Value; - var frameOffsetX = mergeFrameData.FrameOffsetX; - var frameOffsetY = mergeFrameData.FrameOffsetY; - - var zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); - var drawOffset = new Vector2(x * 16 - Main.screenPosition.X, y * 16 - Main.screenPosition.Y) + zero; - - // Used for blending with metatiles/composite tiles (as in the tile being blended with is a metatile, not this tile) - var subFrameX = frameOffsetX * 270; - var subFrameY = frameOffsetY * 198; - - var thisTileData = adjacencyData[x, y]; - - // Get tile variant number - var randomFrame = myTile.TileFrameNumber; - var randomFrameX18 = randomFrame * 18; - var randomFrameX36 = randomFrame * 36; - - // Couple of commonly used masks - // bit to relative tile pos for reference - // 4 0 5 - // 3 X 1 - // 7 2 6 - - byte maskAdjSides = 0b11110000; - byte maskAdjCorners = 0b00001111; - - #region Merge Checks & Drawing - // Switch statement for the mutually exclusive states - switch (thisTileData & maskAdjSides) - { - case 0b11110000: - // All sides - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(18 + randomFrameX18 + subFrameX, 18 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - return; - - case 0b01110000: - // All except north - switch (thisTileData & 0b00001100) - { - case 0b00001100: - // Extend to both north corners - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(144 + randomFrameX18 + subFrameX, 90 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - return; - case 0b00001000: - // Extend to northwest corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(198 + randomFrameX18 + subFrameX, 180 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - return; - case 0b00000100: - // Extend to northeast corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(144 + randomFrameX18 + subFrameX, 180 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - return; - default: - // Extend to neither corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(144 + randomFrameX18 + subFrameX, 144 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - return; - } - - case 0b10110000: - // All except east - switch (thisTileData & 0b00000110) - { - case 0b00000110: - // Extend to both east corners - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(108 + subFrameX, randomFrameX18 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - return; - case 0b00000100: - // Extend to northeast corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(234 + subFrameX, randomFrameX18 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - return; - case 0b00000010: - // Extend to southeast corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(198 + subFrameX, randomFrameX18 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - return; - default: - // Extend to neither corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(162 + subFrameX, randomFrameX18 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - return; - } - - case 0b11010000: - // All except south - switch (thisTileData & 0b00000011) - { - case 0b00000011: - // Extend to both south corners - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(144 + randomFrameX18 + subFrameX, 72 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - return; - case 0b00000010: - // Extend to southeast corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(144 + randomFrameX18 + subFrameX, 162 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - return; - case 0b00000001: - // Extend to southwest corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(198 + randomFrameX18 + subFrameX, 162 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - return; - default: - // Extend to neither corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(144 + randomFrameX18 + subFrameX, 126 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - return; - } - - case 0b11100000: - // All except west - switch (thisTileData & 0b00001001) - { - case 0b00001001: - // Extend to both west corners - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(126 + subFrameX, randomFrameX18 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - return; - case 0b00000001: - // Extend to southwest corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(216 + subFrameX, randomFrameX18 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - return; - case 0b00001000: - // Extend to northwest corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(252 + subFrameX, randomFrameX18 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - return; - default: - // Extend to neither corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(180 + subFrameX, randomFrameX18 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - return; - } - - case 0b10010000: - // North & West edges - if ((thisTileData & 0b01100010) == 0b00000010) - { - // Blending tile at southeast corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(randomFrameX36 + subFrameX, 54 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - } - - switch (thisTileData & 0b00000101) - { - case 0b00000101: - // Extend to both corners - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(randomFrameX36 + subFrameX, 90 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - return; - case 0b00000100: - // Extend to northeast corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(234 + subFrameX, 54 + randomFrameX36 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - return; - case 0b00000001: - // Extend to southwest corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(198 + subFrameX, 54 + randomFrameX36 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - return; - default: - // Extend to neither corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(randomFrameX36 + subFrameX, 126 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - return; - } - case 0b11000000: - // North & East edges - if ((thisTileData & 0b00110001) == 0b00000001) - { - // Blending tile at southwest corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(18 + randomFrameX36 + subFrameX, 54 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - } - - switch (thisTileData & 0b00001010) - { - case 0b00001010: - // Extend to both corners - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(18 + randomFrameX36 + subFrameX, 90 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - return; - case 0b00001000: - // Extend to northwest corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(252 + subFrameX, 54 + randomFrameX36 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - return; - case 0b00000010: - // Extend to southeast corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(216 + subFrameX, 54 + randomFrameX36 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - return; - default: - // Extend to neither corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(18 + randomFrameX36 + subFrameX, 126 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - return; - } - - case 0b01100000: - // South & East edges - if ((thisTileData & 0b10011000) == 0b00001000) - { - // Blending tile at northwest corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(18 + randomFrameX36 + subFrameX, 72 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - } - - switch (thisTileData & 0b00000101) - { - case 0b00000101: - // Extend to both corners - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(18 + randomFrameX36 + subFrameX, 108 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - return; - case 0b00000100: - // Extend to northeast corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(216 + subFrameX, 72 + randomFrameX36 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - return; - case 0b00000001: - // Extend to southwest corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(252 + subFrameX, 72 + randomFrameX36 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - return; - default: - // Extend to neither corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(18 + randomFrameX36 + subFrameX, 144 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - return; - } - - case 0b00110000: - // South & West edges - if ((thisTileData & 0b11000100) == 0b00000100) - { - // Blending tile at northeast corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(randomFrameX36 + subFrameX, 72 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - } - - switch (thisTileData & 0b00001010) - { - case 0b00001010: - // Extend to both corners - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(randomFrameX36, 108 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - return; - case 0b00001000: - // Extend to northwest corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(198 + subFrameX, 72 + randomFrameX36 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - return; - case 0b00000010: - // Extend to southeast corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(234 + subFrameX, 72 + randomFrameX36 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - return; - default: - // Extend to neither corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(randomFrameX36 + subFrameX, 144 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - return; - } - } - - // Handle edges and corners, which due to how they can be overlayed in so many ways kind of need their own way of doing things - // North Edge - if ((thisTileData & 0b11010000) == 0b10000000) - { - switch (thisTileData & 0b00001100) - { - case 0b00000000: - // Narrow - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(144 + randomFrameX18 + subFrameX, 108 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - break; - case 0b00001000: - // Extends to Northwest corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(126 + subFrameX, 108 + randomFrameX18 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - break; - case 0b00000100: - // Extends to Northeast corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(108 + subFrameX, 108 + randomFrameX18 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - break; - default: - // Extends to both corners - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(18 + randomFrameX18 + subFrameX, 36 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - break; - } - } - - // East Edge - if ((thisTileData & 0b11100000) == 0b01000000) - { - switch (thisTileData & 0b00000110) - { - case 0b00000000: - // Narrow - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(90 + subFrameX, randomFrameX18 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - break; - case 0b00000100: - // Extends to Northeast corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(randomFrameX18 + subFrameX, 180 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - break; - case 0b00000010: - // Extends to Southeast corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(randomFrameX18 + subFrameX, 162 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - break; - default: - // Extends to both corners - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(0 + subFrameX, randomFrameX18 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - break; - } - } - - // South Edge - if ((thisTileData & 0b01110000) == 0b00100000) - { - switch (thisTileData & 0b00000011) - { - case 0b00000000: - // Narrow - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(144 + randomFrameX18 + subFrameX, 54 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - break; - case 0b00000010: - // Extends to Southeast corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(108 + subFrameX, 54 + randomFrameX18 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - break; - case 0b00000001: - // Extends to Southwest corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(126 + subFrameX, 54 + randomFrameX18 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - break; - default: - // Extends to both corners - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(18 + randomFrameX18 + subFrameX, 0 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - break; - } - } - - // West Edge - if ((thisTileData & 0b10110000) == 0b00010000) - { - switch (thisTileData & 0b00001001) - { - case 0b00000000: - // Narrow - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(144 + subFrameX, randomFrameX18 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - break; - case 0b00000001: - // Extends to Southwest corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(54 + randomFrameX18 + subFrameX, 162 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - break; - case 0b00001000: - // Extends to Northwest corner - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(54 + randomFrameX18 + subFrameX, 180 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - break; - default: - // Extends to both corners - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(72 + subFrameX, randomFrameX18 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - break; - } - } - - // Northwest Corner - if ((thisTileData & 0b10011000) == 0b00001000) - { - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(18 + randomFrameX36 + subFrameX, 72 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - } - - // Northeast Corner - if ((thisTileData & 0b11000100) == 0b00000100) - { - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(randomFrameX36 + subFrameX, 72 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - } - - // Southeast Corner - if ((thisTileData & 0b01100010) == 0b00000010) - { - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(randomFrameX36 + subFrameX, 54 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - } - - // Southwest Corner - if ((thisTileData & 0b00110001) == 0b00000001) - { - Main.spriteBatch.Draw(blendLayer, drawOffset, new Rectangle?(new Rectangle(18 + randomFrameX36 + subFrameX, 54 + subFrameY, 18, 18)), shadingColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - } - #endregion - } - - /// - /// Call this in TileFrame. Used to generate adjacency data used in DrawUniversalMergeFrames. Tiles using this need a 2d byte array - /// - internal static void GetAdjacencyData(int x, int y, MergeFrameData data) - { - var blendType = data.TileID; - - // bit to relative tile pos for reference - // 4 0 5 - // 3 X 1 - // 7 2 6 - // 01234567 - ref byte adjacencyData = ref data.AdjacencyData[x, y]; - adjacencyData = 0b00000000; - - if (x < 0 || x >= Main.maxTilesX) - return; - if (y < 0 || y >= Main.maxTilesY) - return; - - var tile = Main.tile[x, y]; - var north = Main.tile[x, y - 1]; - var south = Main.tile[x, y + 1]; - var west = Main.tile[x - 1, y]; - var east = Main.tile[x + 1, y]; - var southwest = Main.tile[x - 1, y + 1]; - var southeast = Main.tile[x + 1, y + 1]; - var northwest = Main.tile[x - 1, y - 1]; - var northeast = Main.tile[x + 1, y - 1]; - - // North - if (GetBlendSpecific(tile, north, blendType, false) && (north.Slope == 0 || north.Slope == SlopeType.SlopeDownLeft || north.Slope == SlopeType.SlopeDownRight)) - adjacencyData |= 0b10000000; - // East - if (GetBlendSpecific(tile, east, blendType, false) && (east.Slope == 0 || east.Slope == SlopeType.SlopeDownLeft || east.Slope == SlopeType.SlopeUpLeft)) - adjacencyData |= 0b01000000; - // South - if (GetBlendSpecific(tile, south, blendType, false) && (south.Slope == 0 || south.Slope == SlopeType.SlopeUpLeft || south.Slope == SlopeType.SlopeUpRight)) - adjacencyData |= 0b00100000; - // West - if (GetBlendSpecific(tile, west, blendType, false) && (west.Slope == 0 || west.Slope == SlopeType.SlopeDownRight || west.Slope == SlopeType.SlopeUpRight)) - adjacencyData |= 0b00010000; - // Northwest - if (GetCornerBlendCondition(tile, northwest, north, west, blendType) && (northwest.Slope == 0 || northwest.Slope == SlopeType.SlopeDownRight) && - (north.Slope == 0 || north.Slope == SlopeType.SlopeDownLeft || north.Slope == SlopeType.SlopeUpLeft) && - (west.Slope == 0 || west.Slope == SlopeType.SlopeUpLeft || west.Slope == SlopeType.SlopeUpRight)) - adjacencyData |= 0b00001000; - // Northeast - if (GetCornerBlendCondition(tile, northeast, north, east, blendType) && (northeast.Slope == 0 || northeast.Slope == SlopeType.SlopeDownLeft) && - (north.Slope == 0 || north.Slope == SlopeType.SlopeDownRight || north.Slope == SlopeType.SlopeUpRight) && - (east.Slope == 0 || east.Slope == SlopeType.SlopeUpLeft || east.Slope == SlopeType.SlopeUpRight)) - adjacencyData |= 0b00000100; - // Southeast - if (GetCornerBlendCondition(tile, southeast, south, east, blendType) && !southeast.IsHalfBlock && (southeast.Slope == 0 || southeast.Slope == SlopeType.SlopeUpLeft) && - (south.Slope == 0 || south.Slope == SlopeType.SlopeDownRight || south.Slope == SlopeType.SlopeUpRight) && - (east.Slope == 0 || east.Slope == SlopeType.SlopeDownLeft || east.Slope == SlopeType.SlopeDownRight)) - adjacencyData |= 0b00000010; - // Southwest - if (GetCornerBlendCondition(tile, southwest, south, west, blendType) && !southwest.IsHalfBlock && (southwest.Slope == 0 || southwest.Slope == SlopeType.SlopeUpRight) && - (south.Slope == 0 || south.Slope == SlopeType.SlopeDownLeft || south.Slope == SlopeType.SlopeUpLeft) && - (west.Slope == 0 || west.Slope == SlopeType.SlopeDownLeft || west.Slope == SlopeType.SlopeDownRight)) - adjacencyData |= 0b00000001; - } - - /// - /// Used to get the correct corner adjacency data because it's more complex than the simpler cardinal directions - /// - private static bool GetCornerBlendCondition(Tile myTile, Tile mergeTileCorner, Tile mergeTileEdgeA, Tile mergeTileEdgeB, int blendType) - { - int cornerType = mergeTileCorner.TileType; - int edgeAType = mergeTileEdgeA.TileType; - int edgeBType = mergeTileEdgeB.TileType; - - var isBlendTypeAdjacent = cornerType == blendType || edgeAType == blendType || edgeBType == blendType; - var areAllAdjacentsBlendable = GetBlendSpecific(myTile, mergeTileCorner, blendType, true) && GetBlendSpecific(myTile, mergeTileEdgeA, blendType, true) && GetBlendSpecific(myTile, mergeTileEdgeB, blendType, true); - - return isBlendTypeAdjacent && areAllAdjacentsBlendable; - } - #endregion } } From 02402f5c3e9861f211de1916e08ee4263f644a92 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Sat, 28 Sep 2024 00:00:14 +0900 Subject: [PATCH 053/133] Fixed XNA related Issues --- Systems/TileMerging/TileBlendMergeSystem.cs | 9 ++-- Systems/TileMerging/TileBlendTexture.cs | 47 ++++++++++--------- .../TileMerging/TileBlendTexture_Baking.cs | 9 ++++ 3 files changed, 37 insertions(+), 28 deletions(-) diff --git a/Systems/TileMerging/TileBlendMergeSystem.cs b/Systems/TileMerging/TileBlendMergeSystem.cs index 9268ef4978..e049840d03 100644 --- a/Systems/TileMerging/TileBlendMergeSystem.cs +++ b/Systems/TileMerging/TileBlendMergeSystem.cs @@ -55,13 +55,10 @@ namespace CalamityMod.Systems private static void SetupMergeData() { - Main.QueueMainThreadAction(() => + foreach (var blendTexture in TileBlendTextureLoader.AllTextures) { - foreach (var blendTexture in TileBlendTextureLoader.AllTextures) - { - blendTexture.BakeBlendTexture(blendTexture.TextureAsset.Value); - } - }); + blendTexture.BakeBlendTexture(blendTexture.TextureAsset.Value); + } } public override void Unload() diff --git a/Systems/TileMerging/TileBlendTexture.cs b/Systems/TileMerging/TileBlendTexture.cs index fd7beebb55..50e7f15efa 100644 --- a/Systems/TileMerging/TileBlendTexture.cs +++ b/Systems/TileMerging/TileBlendTexture.cs @@ -50,7 +50,15 @@ namespace CalamityMod.Systems Main.QueueMainThreadAction(() => { for (int v = 0; v < VariantCount; v++) - BlendTextures[v] = new(Main.instance.GraphicsDevice, BlendTextureWidth, BlendTextureHeight); + BlendTextures[v] = new( + Main.instance.GraphicsDevice, + BlendTextureWidth, + BlendTextureHeight, + mipMap: false, + preferredFormat: SurfaceFormat.Color, + preferredDepthFormat: DepthFormat.None, + preferredMultiSampleCount: 0, + usage: RenderTargetUsage.PreserveContents); }); } @@ -61,22 +69,25 @@ namespace CalamityMod.Systems public sealed override void Unload() { - if (BlendTextures is not null) + Main.QueueMainThreadAction(() => { - foreach (var rt in BlendTextures) + if (BlendTextures is not null) { - if (rt is null) - continue; + foreach (var rt in BlendTextures) + { + if (rt is null) + continue; - if (rt.IsDisposed) - continue; + if (rt.IsDisposed) + continue; - rt.Dispose(); + rt.Dispose(); + } + + Array.Clear(BlendTextures); + BlendTextures = null; } - - Array.Clear(BlendTextures); - BlendTextures = null; - } + }); PostUnload(); } @@ -91,16 +102,8 @@ namespace CalamityMod.Systems public void RebuildBlendSheet(Texture2D texture = null) { - if (texture is null) - { - texture = TextureAsset.Value; - } - - // It's baking moment - Main.QueueMainThreadAction(() => - { - BakeBlendTexture(texture); - }); + texture ??= TextureAsset.Value; + BakeBlendTexture(texture); } } } diff --git a/Systems/TileMerging/TileBlendTexture_Baking.cs b/Systems/TileMerging/TileBlendTexture_Baking.cs index e78ea42f8a..b7ea24ccb7 100644 --- a/Systems/TileMerging/TileBlendTexture_Baking.cs +++ b/Systems/TileMerging/TileBlendTexture_Baking.cs @@ -14,6 +14,15 @@ namespace CalamityMod.Systems { #region Sheet Baking Process public void BakeBlendTexture(Texture2D texture) + { + // It's baking moment + Main.QueueMainThreadAction(() => + { + BakeBlendTexture_Inner(texture); + }); + } + + private void BakeBlendTexture_Inner(Texture2D texture) { if (texture == null) throw new ArgumentNullException(nameof(texture), "Texture is Null!"); From 2fe2339cb3631d4f501fc4374bfca25c34231678 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Sat, 28 Sep 2024 12:24:07 +0900 Subject: [PATCH 054/133] Improved TileFraming Performance --- .../TileBlendMergeSystem_TileFrame.cs | 133 +++++++++++------- Systems/TileMerging/TileBlendTextureLoader.cs | 2 +- 2 files changed, 83 insertions(+), 52 deletions(-) diff --git a/Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs b/Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs index b1798608bb..17dede3ae8 100644 --- a/Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs +++ b/Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs @@ -10,6 +10,8 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using BlendSidesReg = System.Collections.Generic.Dictionary; + namespace CalamityMod.Systems { public sealed partial class TileBlendMergeSystem : ModSystem @@ -20,42 +22,30 @@ namespace CalamityMod.Systems return; var tile = Main.tile[i, j]; + tile.Get().Clear(); + if (!tile.HasTile) // Is this even possible? But I'm doing this for sanity check anyways return; - tile.Get().Clear(); - - int tileType = tile.TileType; - int left = GetTileType(i - 1, j); - int right = GetTileType(i + 1, j); - - int up = GetTileType(i, j - 1); - int upLeft = GetTileType(i - 1, j - 1); - int upRight = GetTileType(i + 1, j - 1); - - int down = GetTileType(i, j + 1); - int downLeft = GetTileType(i - 1, j + 1); - int downRight = GetTileType(i + 1, j + 1); - - var blendTexturesSurrounding = PopulateBlendTileTypes(left, right, up, upLeft, upRight, down, downLeft, downRight); var blendDataUniqueIndex = 0; - foreach (var blendTextureID in blendTexturesSurrounding) - { - if (!_TileBlendable[tileType, (int)blendTextureID]) - continue; + var blendSidesReg = PopulateBlendSidesReg(i, j, tile.TileType); - BlendSideFlags sideFlags = BlendSideFlags.None; - CalculateSides(blendTextureID, i, j, ref sideFlags); + CalculateSides(i, j, in blendSidesReg); + + foreach (var pair in blendSidesReg) + { + var blendTextureSlot = pair.Key; + var sideFlags = pair.Value; if (sideFlags != BlendSideFlags.None) { - tile.Get().Set(blendDataUniqueIndex, (byte)blendTextureID, (byte)sideFlags); + tile.Get().Set(blendDataUniqueIndex, (byte)blendTextureSlot, (byte)sideFlags); blendDataUniqueIndex++; } } } - private static void CalculateSides(int blendingWith, int i, int j, ref BlendSideFlags flags) + private static void CalculateSides(int i, int j, in BlendSidesReg blendSidesReg) { var hasCenter = TryGetTile(i, j, out var centerTile, out var center); @@ -70,9 +60,11 @@ namespace CalamityMod.Systems if (hasLeft && HasLeftMerge(centerTile, leftTile)) { leftMerged = true; - if (_TileTypeToBlendTextureSlot[leftType] == blendingWith) + + var blendTextureSlot = _TileTypeToBlendTextureSlot[leftType]; + if (blendSidesReg.ContainsKey(blendTextureSlot)) { - flags |= BlendSideFlags.Left; + blendSidesReg[blendTextureSlot] |= BlendSideFlags.Left; } } @@ -80,9 +72,11 @@ namespace CalamityMod.Systems if (hasRight && HasRightMerge(centerTile, rightTile)) { rightMerged = true; - if (_TileTypeToBlendTextureSlot[rightType] == blendingWith) + + var blendTextureSlot = _TileTypeToBlendTextureSlot[rightType]; + if (blendSidesReg.ContainsKey(blendTextureSlot)) { - flags |= BlendSideFlags.Right; + blendSidesReg[blendTextureSlot] |= BlendSideFlags.Right; } } @@ -90,9 +84,11 @@ namespace CalamityMod.Systems if (hasUp && HasUpMerge(centerTile, upTile)) { upMerged = true; - if (_TileTypeToBlendTextureSlot[upType] == blendingWith) + + var blendTextureSlot = _TileTypeToBlendTextureSlot[upType]; + if (blendSidesReg.ContainsKey(blendTextureSlot)) { - flags |= BlendSideFlags.Up; + blendSidesReg[blendTextureSlot] |= BlendSideFlags.Up; } } @@ -100,9 +96,11 @@ namespace CalamityMod.Systems if (hasDown && HasDownMerge(centerTile, downTile)) { downMerged = true; - if (_TileTypeToBlendTextureSlot[downType] == blendingWith) + + var blendTextureSlot = _TileTypeToBlendTextureSlot[downType]; + if (blendSidesReg.ContainsKey(blendTextureSlot)) { - flags |= BlendSideFlags.Down; + blendSidesReg[blendTextureSlot] |= BlendSideFlags.Down; } } @@ -113,44 +111,47 @@ namespace CalamityMod.Systems bool hasUpLeft = TryGetTile(i - 1, j - 1, out var upLeftTile, out var upLeftType); if (hasUpLeft && upMerged && leftMerged && HasRightMerge(upLeftTile, upTile) && HasDownMerge(upLeftTile, leftTile)) { - if (_TileTypeToBlendTextureSlot[upLeftType] == blendingWith) + var blendTextureSlot = _TileTypeToBlendTextureSlot[upLeftType]; + if (blendSidesReg.ContainsKey(blendTextureSlot)) { - flags |= BlendSideFlags.UpLeft; + blendSidesReg[blendTextureSlot] |= BlendSideFlags.UpLeft; } } bool hasUpRight = TryGetTile(i + 1, j - 1, out var upRightTile, out var upRightType); if (hasUpRight && upMerged && rightMerged && HasLeftMerge(upRightTile, upTile) && HasDownMerge(upRightTile, leftTile)) { - if (_TileTypeToBlendTextureSlot[upRightType] == blendingWith) + var blendTextureSlot = _TileTypeToBlendTextureSlot[upRightType]; + if (blendSidesReg.ContainsKey(blendTextureSlot)) { - flags |= BlendSideFlags.UpRight; + blendSidesReg[blendTextureSlot] |= BlendSideFlags.UpRight; } } bool hasDownLeft = TryGetTile(i - 1, j + 1, out var downLeftTile, out var downLeftType); if (hasDownLeft && downMerged && leftMerged && HasRightMerge(downLeftTile, downTile) && HasUpMerge(downLeftTile, leftTile)) { - if (_TileTypeToBlendTextureSlot[downLeftType] == blendingWith) + var blendTextureSlot = _TileTypeToBlendTextureSlot[downLeftType]; + if (blendSidesReg.ContainsKey(blendTextureSlot)) { - flags |= BlendSideFlags.DownLeft; + blendSidesReg[blendTextureSlot] |= BlendSideFlags.DownLeft; } } bool hasDownRight = TryGetTile(i + 1, j + 1, out var downRightTile, out var downRightType); if (hasDownRight && downMerged && rightMerged && HasLeftMerge(downRightTile, downTile) && HasUpMerge(downLeftTile, leftTile)) { - if (_TileTypeToBlendTextureSlot[downRightType] == blendingWith) + var blendTextureSlot = _TileTypeToBlendTextureSlot[downRightType]; + if (blendSidesReg.ContainsKey(blendTextureSlot)) { - flags |= BlendSideFlags.DownRight; + blendSidesReg[blendTextureSlot] |= BlendSideFlags.DownRight; } } #endregion } - - + #region Merge Utilities private static bool HasLeftMerge(Tile tileOnCenter, Tile tileOnLeft) { if (!IsMergable(tileOnCenter.TileType, tileOnLeft.TileType)) return false; @@ -251,19 +252,48 @@ namespace CalamityMod.Systems } } - private static HashSet PopulateBlendTileTypes(params int[] types) + private static BlendSidesReg PopulateBlendSidesReg(int i, int j, int centerType) { - var hashSet = new HashSet(); - foreach (var type in types) - { - if (type < 0) - continue; + var reg = new BlendSidesReg(); - var blendTextureID = _TileTypeToBlendTextureSlot[type]; - if (blendTextureID != TileBlendTextureLoader.EmptySlot) - hashSet.Add(blendTextureID); + int left = GetTileType(i - 1, j); + int right = GetTileType(i + 1, j); + + int up = GetTileType(i, j - 1); + int upLeft = GetTileType(i - 1, j - 1); + int upRight = GetTileType(i + 1, j - 1); + + int down = GetTileType(i, j + 1); + int downLeft = GetTileType(i - 1, j + 1); + int downRight = GetTileType(i + 1, j + 1); + + void Populate(int sideType) + { + if (sideType < 0) + return; + + var blendTextureSlot = _TileTypeToBlendTextureSlot[sideType]; + if (blendTextureSlot == TileBlendTextureLoader.EmptySlot) + return; + + if (_TileBlendable[centerType, blendTextureSlot]) + { + reg[blendTextureSlot] = BlendSideFlags.None; + } } - return hashSet; + + Populate(left); + Populate(right); + + Populate(up); + Populate(upLeft); + Populate(upRight); + + Populate(down); + Populate(downLeft); + Populate(downRight); + + return reg; } private static int GetTileType(int i, int j) @@ -298,5 +328,6 @@ namespace CalamityMod.Systems type = tile.TileType; return true; } + #endregion } } diff --git a/Systems/TileMerging/TileBlendTextureLoader.cs b/Systems/TileMerging/TileBlendTextureLoader.cs index a398c7fab3..01b3e9ddf3 100644 --- a/Systems/TileMerging/TileBlendTextureLoader.cs +++ b/Systems/TileMerging/TileBlendTextureLoader.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Systems public override void Load() { - Registry = new TileBlendTexture[256]; + Registry = new TileBlendTexture[EmptySlot + 1]; } public override void Unload() From 38aaa18736333bcce370baa4267cf77f49d764bd Mon Sep 17 00:00:00 2001 From: Flowaria Date: Sat, 28 Sep 2024 12:28:54 +0900 Subject: [PATCH 055/133] Internal Naming Changes --- Systems/TileMerging/DataStructures.cs | 4 +++- Systems/TileMerging/TileBlendMergeSystem_Draw.cs | 6 +++--- Systems/TileMerging/TileBlendTexture_Baking.cs | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Systems/TileMerging/DataStructures.cs b/Systems/TileMerging/DataStructures.cs index b0dc21c61c..9b50c6e743 100644 --- a/Systems/TileMerging/DataStructures.cs +++ b/Systems/TileMerging/DataStructures.cs @@ -111,6 +111,8 @@ namespace CalamityMod.Systems public struct TileBlendingData : ITileData { + public const int Length = 8; + private byte SheetIndex0; private byte SheetIndex1; private byte SheetIndex2; @@ -131,7 +133,7 @@ namespace CalamityMod.Systems public void Clear() { - for (int i = 0; i<8; i++) + for (int i = 0; i(); - for (int idx = 0; idx < 8; idx++) + var blendingData = tile.Get(); // Since we are not editing the value, we can just copy the values from here + for (int idx = 0; idx < TileBlendingData.Length; idx++) { blendingData.Get(idx, out var sheetIdx, out var data); @@ -34,7 +34,7 @@ namespace CalamityMod.Systems if (sheetIdx == TileBlendTextureLoader.EmptySlot) break; - var rect = TileBlendTexture.SideDataToSheetRect(data); + var rect = TileBlendTexture.SideFlagsToSheetRect(data); var texture = TileBlendTextureLoader.Registry[sheetIdx]; var variant = Math.Clamp(tile.TileFrameNumber, 0, 2); Main.spriteBatch.Draw(texture.BlendTextures[variant], drawPos, rect, drawColor, rotation: 0.0f, origin: default, scale: 1.0f, SpriteEffects.None, layerDepth: 0.0f); diff --git a/Systems/TileMerging/TileBlendTexture_Baking.cs b/Systems/TileMerging/TileBlendTexture_Baking.cs index b7ea24ccb7..7fa2775f52 100644 --- a/Systems/TileMerging/TileBlendTexture_Baking.cs +++ b/Systems/TileMerging/TileBlendTexture_Baking.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Systems { for (int i = 0; i < 256; i++) { - var drawPos = SideDataToPositionInSheet((byte)i); + var drawPos = SideFlagsToPositionInSheet((byte)i); var mergeSides = (BlendSideFlags)i; // Easy cases, It match on Shape Lookup Sheet Directly @@ -112,13 +112,13 @@ namespace CalamityMod.Systems return count; } - public static Rectangle SideDataToSheetRect(byte data) + public static Rectangle SideFlagsToSheetRect(byte data) { int y = Math.DivRem(data, 16, out int x); return new Rectangle(x * 18, y * 18, 16, 16); } - public static Vector2 SideDataToPositionInSheet(byte data) + public static Vector2 SideFlagsToPositionInSheet(byte data) { int y = Math.DivRem(data, 16, out int x); return new Vector2(x * 18, y * 18); From 74018e24bf3453254e5cbcc060331f5d7cc73790 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Sat, 28 Sep 2024 12:36:13 +0900 Subject: [PATCH 056/133] Added Slot related Exception --- Systems/TileMerging/TileBlendTexture.cs | 7 +++---- Systems/TileMerging/TileBlendTextureLoader.cs | 6 ++++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Systems/TileMerging/TileBlendTexture.cs b/Systems/TileMerging/TileBlendTexture.cs index 50e7f15efa..da7b7ba41d 100644 --- a/Systems/TileMerging/TileBlendTexture.cs +++ b/Systems/TileMerging/TileBlendTexture.cs @@ -26,15 +26,13 @@ namespace CalamityMod.Systems #endregion - #region Properties public Asset TextureAsset { get; private set; } - public int Slot { get; private set; } + public int Slot { get; private set; } = -1; public RenderTarget2D[] BlendTextures { get; private set; } // dimension: [3] #endregion - #region Overrides public abstract int TileType { get; } #endregion @@ -99,11 +97,12 @@ namespace CalamityMod.Systems #endregion - + #region Public API public void RebuildBlendSheet(Texture2D texture = null) { texture ??= TextureAsset.Value; BakeBlendTexture(texture); } + #endregion } } diff --git a/Systems/TileMerging/TileBlendTextureLoader.cs b/Systems/TileMerging/TileBlendTextureLoader.cs index 01b3e9ddf3..3409a1a0ee 100644 --- a/Systems/TileMerging/TileBlendTextureLoader.cs +++ b/Systems/TileMerging/TileBlendTextureLoader.cs @@ -34,6 +34,12 @@ namespace CalamityMod.Systems internal static int Register(TileBlendTexture sheet) { + if (sheet.Slot >= 0) + throw new ArgumentException("Argument has already registered to System", nameof(sheet)); + + if (_UniqueSlot >= EmptySlot) + throw new InvalidOperationException($"Slots are all used up to {EmptySlot}, We can't allocate more!"); + var slot = _UniqueSlot++; Registry[slot] = sheet; return slot; From dfc19e790f38c3df72b0fcce52b103ce4ecb5e04 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Sat, 28 Sep 2024 12:36:26 +0900 Subject: [PATCH 057/133] Mark BakeBlendTexture as internal --- Systems/TileMerging/TileBlendTexture_Baking.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Systems/TileMerging/TileBlendTexture_Baking.cs b/Systems/TileMerging/TileBlendTexture_Baking.cs index 7fa2775f52..0bdf470c16 100644 --- a/Systems/TileMerging/TileBlendTexture_Baking.cs +++ b/Systems/TileMerging/TileBlendTexture_Baking.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Systems public abstract partial class TileBlendTexture : ModTexturedType { #region Sheet Baking Process - public void BakeBlendTexture(Texture2D texture) + internal void BakeBlendTexture(Texture2D texture) { // It's baking moment Main.QueueMainThreadAction(() => From 99df40c0355a5d7a6d7c4d71bf5794a6e2fc8d74 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Sat, 28 Sep 2024 12:48:36 +0900 Subject: [PATCH 058/133] Moved MergeSide Consume Table onto Lookup --- .../TileMerging/TileBlendTexture_Baking.cs | 25 ++-------------- .../TileMerging/TileBlendTexture_Lookup.cs | 29 +++++++++++++++++++ 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/Systems/TileMerging/TileBlendTexture_Baking.cs b/Systems/TileMerging/TileBlendTexture_Baking.cs index 0bdf470c16..f2fa9c35da 100644 --- a/Systems/TileMerging/TileBlendTexture_Baking.cs +++ b/Systems/TileMerging/TileBlendTexture_Baking.cs @@ -71,16 +71,9 @@ namespace CalamityMod.Systems if (sideFlags == BlendSideFlags.None) yield break; - IEnumerable> shapes = [ - _U_Shapes, - _L_Shapes, - _I_Shapes, // I shape includes up, down, left, right - _Corner_Shapes - ]; - - foreach (var shapeGroup in shapes) + foreach (var shapeGroup in _ShapeConsumeMap) { - foreach (var shape in shapeGroup.OrderByDescending(HotFlagCount)) + foreach (var shape in shapeGroup) { if ((shape & sideFlags) == shape) { @@ -98,20 +91,6 @@ namespace CalamityMod.Systems #endregion #region Utils - private static int HotFlagCount(BlendSideFlags flags) - { - var count = 0; - for (int i = 0; i < 8; i++) - { - var flag = (BlendSideFlags)(1 << i); - if (flag == (flags & flag)) - { - count++; - } - } - return count; - } - public static Rectangle SideFlagsToSheetRect(byte data) { int y = Math.DivRem(data, 16, out int x); diff --git a/Systems/TileMerging/TileBlendTexture_Lookup.cs b/Systems/TileMerging/TileBlendTexture_Lookup.cs index 7560337edf..8fd90fccb3 100644 --- a/Systems/TileMerging/TileBlendTexture_Lookup.cs +++ b/Systems/TileMerging/TileBlendTexture_Lookup.cs @@ -1,6 +1,8 @@ using System; using System.Collections.Generic; +using System.Collections.Immutable; using System.Linq; +using System.Numerics; using System.Runtime.CompilerServices; using System.Text; using System.Threading.Tasks; @@ -259,6 +261,19 @@ namespace CalamityMod.Systems ShapeU_RightEmpty_UpEnd, ShapeU_RightEmpty_DownEnd ]; + + /// + /// An Descend Ordered Consume Lookup Table + /// [U -> L -> I -> Corner] Order + /// [Most flags -> Least flags] Order + /// + private static readonly IReadOnlyCollection> _ShapeConsumeMap = [ + _U_Shapes.OrderByDescending(HotFlagCount).ToImmutableArray(), + _L_Shapes.OrderByDescending(HotFlagCount).ToImmutableArray(), + _I_Shapes.OrderByDescending(HotFlagCount).ToImmutableArray(), + // I shape includes up, down, left, right. So we don't need to consume them manually + _Corner_Shapes, + ]; #endregion #region Utils @@ -285,6 +300,20 @@ namespace CalamityMod.Systems CreateRect(topSheetX, topSheetY + (2 * increment)) ]; } + + private static int HotFlagCount(BlendSideFlags flags) + { + var count = 0; + for (int i = 0; i < 8; i++) + { + var flag = (BlendSideFlags)(1 << i); + if (flag == (flags & flag)) + { + count++; + } + } + return count; + } #endregion } } From 67ec00c9398be14643dd0c7dd434f4d2d62443bc Mon Sep 17 00:00:00 2001 From: Flowaria Date: Sat, 28 Sep 2024 20:24:00 +0900 Subject: [PATCH 059/133] Improved Corner Framing --- .../TileBlendMergeSystem_TileFrame.cs | 79 ++++++++++++++++++- 1 file changed, 78 insertions(+), 1 deletion(-) diff --git a/Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs b/Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs index 17dede3ae8..97b67986b9 100644 --- a/Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs +++ b/Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Systems private static void CalculateSides(int i, int j, in BlendSidesReg blendSidesReg) { - var hasCenter = TryGetTile(i, j, out var centerTile, out var center); + _ = TryGetTile(i, j, out var centerTile, out _); bool leftMerged = false; bool rightMerged = false; @@ -108,9 +108,16 @@ namespace CalamityMod.Systems #region Diagonal Direction Merges + bool upLeftMerged = false; + bool upRightMerged = false; + bool downLeftMerged = false; + bool downRightMerged = false; + bool hasUpLeft = TryGetTile(i - 1, j - 1, out var upLeftTile, out var upLeftType); if (hasUpLeft && upMerged && leftMerged && HasRightMerge(upLeftTile, upTile) && HasDownMerge(upLeftTile, leftTile)) { + upLeftMerged = true; + var blendTextureSlot = _TileTypeToBlendTextureSlot[upLeftType]; if (blendSidesReg.ContainsKey(blendTextureSlot)) { @@ -121,6 +128,8 @@ namespace CalamityMod.Systems bool hasUpRight = TryGetTile(i + 1, j - 1, out var upRightTile, out var upRightType); if (hasUpRight && upMerged && rightMerged && HasLeftMerge(upRightTile, upTile) && HasDownMerge(upRightTile, leftTile)) { + upRightMerged = true; + var blendTextureSlot = _TileTypeToBlendTextureSlot[upRightType]; if (blendSidesReg.ContainsKey(blendTextureSlot)) { @@ -131,6 +140,8 @@ namespace CalamityMod.Systems bool hasDownLeft = TryGetTile(i - 1, j + 1, out var downLeftTile, out var downLeftType); if (hasDownLeft && downMerged && leftMerged && HasRightMerge(downLeftTile, downTile) && HasUpMerge(downLeftTile, leftTile)) { + downLeftMerged = true; + var blendTextureSlot = _TileTypeToBlendTextureSlot[downLeftType]; if (blendSidesReg.ContainsKey(blendTextureSlot)) { @@ -141,6 +152,8 @@ namespace CalamityMod.Systems bool hasDownRight = TryGetTile(i + 1, j + 1, out var downRightTile, out var downRightType); if (hasDownRight && downMerged && rightMerged && HasLeftMerge(downRightTile, downTile) && HasUpMerge(downLeftTile, leftTile)) { + downRightMerged = true; + var blendTextureSlot = _TileTypeToBlendTextureSlot[downRightType]; if (blendSidesReg.ContainsKey(blendTextureSlot)) { @@ -149,6 +162,70 @@ namespace CalamityMod.Systems } #endregion + + #region Special Corner Cases + foreach (var kv in blendSidesReg) + { + var slot = kv.Key; + var sides = kv.Value; + + // Up + if (sides.HasFlag(BlendSideFlags.Up)) + { + if (leftMerged && upLeftMerged && _TileBlendable[leftType, slot] && _TileBlendable[upLeftType, slot]) + { + blendSidesReg[slot] |= BlendSideFlags.UpLeft; + } + + if (rightMerged && upRightMerged && _TileBlendable[rightType, slot] && _TileBlendable[upRightType, slot]) + { + blendSidesReg[slot] |= BlendSideFlags.UpRight; + } + } + + // Down + if (sides.HasFlag(BlendSideFlags.Down)) + { + if (leftMerged && downLeftMerged && _TileBlendable[leftType, slot] && _TileBlendable[downLeftType, slot]) + { + blendSidesReg[slot] |= BlendSideFlags.DownLeft; + } + + if (rightMerged && downRightMerged && _TileBlendable[rightType, slot] && _TileBlendable[downRightType, slot]) + { + blendSidesReg[slot] |= BlendSideFlags.DownRight; + } + } + + // Left + if (sides.HasFlag(BlendSideFlags.Left)) + { + if (upLeftMerged && upMerged && _TileBlendable[upLeftType, slot] && _TileBlendable[upType, slot]) + { + blendSidesReg[slot] |= BlendSideFlags.UpLeft; + } + + if (downLeftMerged && downMerged && _TileBlendable[downLeftType, slot] && _TileBlendable[downType, slot]) + { + blendSidesReg[slot] |= BlendSideFlags.DownLeft; + } + } + + // Right + if (sides.HasFlag(BlendSideFlags.Right)) + { + if (upRightMerged && upMerged && _TileBlendable[upRightType, slot] && _TileBlendable[upType, slot]) + { + blendSidesReg[slot] |= BlendSideFlags.UpRight; + } + + if (downRightMerged && downMerged && _TileBlendable[downRightType, slot] && _TileBlendable[downType, slot]) + { + blendSidesReg[slot] |= BlendSideFlags.DownRight; + } + } + } + #endregion } #region Merge Utilities From fc5d39e05a9edad1403aa57837a3bc8e0a669ea6 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Sat, 28 Sep 2024 23:21:28 +0900 Subject: [PATCH 060/133] Set the Corner Blend be more loosen --- .../TileBlendMergeSystem_TileFrame.cs | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs b/Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs index 97b67986b9..121ebe7eed 100644 --- a/Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs +++ b/Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs @@ -172,12 +172,12 @@ namespace CalamityMod.Systems // Up if (sides.HasFlag(BlendSideFlags.Up)) { - if (leftMerged && upLeftMerged && _TileBlendable[leftType, slot] && _TileBlendable[upLeftType, slot]) + if (leftMerged && upLeftMerged && IsBlendableOrSame(leftType, slot) && IsBlendableOrSame(upLeftType, slot)) { blendSidesReg[slot] |= BlendSideFlags.UpLeft; } - if (rightMerged && upRightMerged && _TileBlendable[rightType, slot] && _TileBlendable[upRightType, slot]) + if (rightMerged && upRightMerged && IsBlendableOrSame(rightType, slot) && IsBlendableOrSame(upRightType, slot)) { blendSidesReg[slot] |= BlendSideFlags.UpRight; } @@ -186,12 +186,12 @@ namespace CalamityMod.Systems // Down if (sides.HasFlag(BlendSideFlags.Down)) { - if (leftMerged && downLeftMerged && _TileBlendable[leftType, slot] && _TileBlendable[downLeftType, slot]) + if (leftMerged && downLeftMerged && IsBlendableOrSame(leftType, slot) && IsBlendableOrSame(downLeftType, slot)) { blendSidesReg[slot] |= BlendSideFlags.DownLeft; } - if (rightMerged && downRightMerged && _TileBlendable[rightType, slot] && _TileBlendable[downRightType, slot]) + if (rightMerged && downRightMerged && IsBlendableOrSame(rightType, slot) && IsBlendableOrSame(downRightType, slot)) { blendSidesReg[slot] |= BlendSideFlags.DownRight; } @@ -200,12 +200,12 @@ namespace CalamityMod.Systems // Left if (sides.HasFlag(BlendSideFlags.Left)) { - if (upLeftMerged && upMerged && _TileBlendable[upLeftType, slot] && _TileBlendable[upType, slot]) + if (upLeftMerged && upMerged && IsBlendableOrSame(upLeftType, slot) && IsBlendableOrSame(upType, slot)) { blendSidesReg[slot] |= BlendSideFlags.UpLeft; } - if (downLeftMerged && downMerged && _TileBlendable[downLeftType, slot] && _TileBlendable[downType, slot]) + if (downLeftMerged && downMerged && IsBlendableOrSame(downLeftType, slot) && IsBlendableOrSame(downType, slot)) { blendSidesReg[slot] |= BlendSideFlags.DownLeft; } @@ -214,12 +214,12 @@ namespace CalamityMod.Systems // Right if (sides.HasFlag(BlendSideFlags.Right)) { - if (upRightMerged && upMerged && _TileBlendable[upRightType, slot] && _TileBlendable[upType, slot]) + if (upRightMerged && upMerged && IsBlendableOrSame(upRightType, slot) && IsBlendableOrSame(upType, slot)) { blendSidesReg[slot] |= BlendSideFlags.UpRight; } - if (downRightMerged && downMerged && _TileBlendable[downRightType, slot] && _TileBlendable[downType, slot]) + if (downRightMerged && downMerged && IsBlendableOrSame(downRightType, slot) && IsBlendableOrSame(downType, slot)) { blendSidesReg[slot] |= BlendSideFlags.DownRight; } @@ -229,6 +229,13 @@ namespace CalamityMod.Systems } #region Merge Utilities + private static bool IsBlendableOrSame(int tileType, int blendTextureSlot) + { + if (_TileBlendable[tileType, blendTextureSlot]) return true; + if (_TileTypeToBlendTextureSlot[tileType] == blendTextureSlot) return true; + return false; + } + private static bool HasLeftMerge(Tile tileOnCenter, Tile tileOnLeft) { if (!IsMergable(tileOnCenter.TileType, tileOnLeft.TileType)) return false; From f8c91ba224ac4dbaf4b0efbbd378a5bd0eedaf24 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Sun, 29 Sep 2024 12:56:51 +0900 Subject: [PATCH 061/133] Added LooselyFillDiagonal Option --- Systems/TileMerging/TileBlendMergeSystem.cs | 13 ++++++++----- .../TileMerging/TileBlendMergeSystem_TileFrame.cs | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Systems/TileMerging/TileBlendMergeSystem.cs b/Systems/TileMerging/TileBlendMergeSystem.cs index e049840d03..e404badf5d 100644 --- a/Systems/TileMerging/TileBlendMergeSystem.cs +++ b/Systems/TileMerging/TileBlendMergeSystem.cs @@ -31,6 +31,7 @@ namespace CalamityMod.Systems public sealed partial class TileBlendMergeSystem : ModSystem { private static bool[,] _TileBlendable; // dimension: [TileTypeCount, AllBlendTextureCount] + private static bool[,] _TileBlendLooselyFillDiagonal; // dimension: [TileTypeCount, AllBlendTextureCount] private static byte[] _TileTypeToBlendTextureSlot; // dimension: [TileTypeCount] #region Load/Unload @@ -39,6 +40,7 @@ namespace CalamityMod.Systems var tileCount = TileLoader.TileCount; var blendTextureCount = TileBlendTextureLoader.Count; _TileBlendable = new bool[tileCount, blendTextureCount]; + _TileBlendLooselyFillDiagonal = new bool[tileCount, blendTextureCount]; _TileTypeToBlendTextureSlot = new byte[tileCount]; Array.Fill(_TileTypeToBlendTextureSlot, (byte)TileBlendTextureLoader.EmptySlot); @@ -68,9 +70,8 @@ namespace CalamityMod.Systems #endregion #region Public API - public static void RegisterMerge(int myType, int blendTileType) + public static void RegisterMerge(int myType, int blendTileType, bool looselyFillDiagonal = false) { - if (myType == blendTileType) return; @@ -85,10 +86,11 @@ namespace CalamityMod.Systems return; _TileBlendable[myType, blendTextureSlot] = true; + _TileBlendLooselyFillDiagonal[myType, blendTextureSlot] = looselyFillDiagonal; CalamityUtils.SetMerge(myType, blendTileType, true); } - public static void RegisterMerge(int myType, TileBlendTexture blendTexture) + public static void RegisterMerge(int myType, TileBlendTexture blendTexture, bool looselyFillDiagonal = false) { if (blendTexture == null) return; @@ -104,13 +106,14 @@ namespace CalamityMod.Systems return; _TileBlendable[myType, blendTexture.Slot] = true; + _TileBlendLooselyFillDiagonal[myType, blendTexture.Slot] = looselyFillDiagonal; CalamityUtils.SetMerge(myType, blendTileType, true); } - public static void RegisterMerge(int myType) where T : TileBlendTexture + public static void RegisterMerge(int myType, bool looselyFillDiagonal = false) where T : TileBlendTexture { var blendTexture = ModContent.GetInstance(); - RegisterMerge(myType, blendTexture); + RegisterMerge(myType, blendTexture, looselyFillDiagonal); } #endregion } diff --git a/Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs b/Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs index 121ebe7eed..91c3dc1963 100644 --- a/Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs +++ b/Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs @@ -232,7 +232,7 @@ namespace CalamityMod.Systems private static bool IsBlendableOrSame(int tileType, int blendTextureSlot) { if (_TileBlendable[tileType, blendTextureSlot]) return true; - if (_TileTypeToBlendTextureSlot[tileType] == blendTextureSlot) return true; + if (!_TileBlendLooselyFillDiagonal[tileType, blendTextureSlot] && _TileTypeToBlendTextureSlot[tileType] == blendTextureSlot) return true; return false; } From 3fdc59d90ff9b0b20cb8c68d996e8900b2308672 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Sun, 29 Sep 2024 12:58:02 +0900 Subject: [PATCH 062/133] Unload Arrays --- Systems/TileMerging/TileBlendMergeSystem.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Systems/TileMerging/TileBlendMergeSystem.cs b/Systems/TileMerging/TileBlendMergeSystem.cs index e404badf5d..6d5e593dd0 100644 --- a/Systems/TileMerging/TileBlendMergeSystem.cs +++ b/Systems/TileMerging/TileBlendMergeSystem.cs @@ -66,6 +66,8 @@ namespace CalamityMod.Systems public override void Unload() { _TileBlendable = null; + _TileBlendLooselyFillDiagonal = null; + _TileTypeToBlendTextureSlot = null; } #endregion From c4838e0fd305afdda98751e6657c5e950602f4c2 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Mon, 30 Sep 2024 07:30:22 +0900 Subject: [PATCH 063/133] Replaced Series of Data/SheetIndex into packed ulong --- Systems/TileMerging/DataStructures.cs | 86 +++++++++------------------ 1 file changed, 27 insertions(+), 59 deletions(-) diff --git a/Systems/TileMerging/DataStructures.cs b/Systems/TileMerging/DataStructures.cs index 9b50c6e743..b1973b92b8 100644 --- a/Systems/TileMerging/DataStructures.cs +++ b/Systems/TileMerging/DataStructures.cs @@ -5,6 +5,7 @@ using System.Text; using System.Threading.Tasks; using Terraria; using Terraria.DataStructures; +using static System.Runtime.InteropServices.JavaScript.JSType; namespace CalamityMod.Systems { @@ -113,23 +114,8 @@ namespace CalamityMod.Systems { public const int Length = 8; - private byte SheetIndex0; - private byte SheetIndex1; - private byte SheetIndex2; - private byte SheetIndex3; - private byte SheetIndex4; - private byte SheetIndex5; - private byte SheetIndex6; - private byte SheetIndex7; - - private byte Data0; - private byte Data1; - private byte Data2; - private byte Data3; - private byte Data4; - private byte Data5; - private byte Data6; - private byte Data7; + private ulong SheetIndexPacked; // 8 bytes + private ulong DataPacked; // 8 bytes public void Clear() { @@ -142,60 +128,42 @@ namespace CalamityMod.Systems public void SetData(int idx, byte data) { - if (idx == 0) Data0 = data; - else if (idx == 1) Data1 = data; - else if (idx == 2) Data2 = data; - else if (idx == 3) Data3 = data; - else if (idx == 4) Data4 = data; - else if (idx == 5) Data5 = data; - else if (idx == 6) Data6 = data; - else if (idx == 7) Data7 = data; - else throw new IndexOutOfRangeException(); + if (idx < 0 || idx >= Length) + throw new IndexOutOfRangeException(); + + var shift = idx * 8; + ulong value = (ulong)(data << shift); + ulong mask = (ulong)(0xFF << shift); + DataPacked = (DataPacked ^ (mask & DataPacked)) | value; } public readonly byte GetData(int idx) { - return idx switch - { - 0 => Data0, - 1 => Data1, - 2 => Data2, - 3 => Data3, - 4 => Data4, - 5 => Data5, - 6 => Data6, - 7 => Data7, - _ => throw new IndexOutOfRangeException() - }; + if (idx < 0 || idx >= Length) + throw new IndexOutOfRangeException(); + + var shift = idx * 8; + return (byte)((DataPacked >> shift) & 0xFF); } public void SetSheetIndex(int idx, byte sheetIdx) { - if (idx == 0) SheetIndex0 = sheetIdx; - else if (idx == 1) SheetIndex1 = sheetIdx; - else if (idx == 2) SheetIndex2 = sheetIdx; - else if (idx == 3) SheetIndex3 = sheetIdx; - else if (idx == 4) SheetIndex4 = sheetIdx; - else if (idx == 5) SheetIndex5 = sheetIdx; - else if (idx == 6) SheetIndex6 = sheetIdx; - else if (idx == 7) SheetIndex7 = sheetIdx; - else throw new IndexOutOfRangeException(); + if (idx < 0 || idx >= Length) + throw new IndexOutOfRangeException(); + + var shift = idx * 8; + ulong value = (ulong)(sheetIdx << shift); + ulong mask = (ulong)(0xFF << shift); + SheetIndexPacked = (SheetIndexPacked ^ (mask & SheetIndexPacked)) | value; } public readonly byte GetSheetIndex(int idx) { - return idx switch - { - 0 => SheetIndex0, - 1 => SheetIndex1, - 2 => SheetIndex2, - 3 => SheetIndex3, - 4 => SheetIndex4, - 5 => SheetIndex5, - 6 => SheetIndex6, - 7 => SheetIndex7, - _ => throw new IndexOutOfRangeException() - }; + if (idx < 0 || idx >= Length) + throw new IndexOutOfRangeException(); + + var shift = idx * 8; + return (byte)((SheetIndexPacked >> shift) & 0xFF); } public void Set(int idx, byte sheetIdx, byte data) From 3ffa2230ca011be42f536888d9ae82617addc76c Mon Sep 17 00:00:00 2001 From: Flowaria Date: Mon, 30 Sep 2024 07:34:14 +0900 Subject: [PATCH 064/133] the fuck is this --- Systems/TileMerging/DataStructures.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Systems/TileMerging/DataStructures.cs b/Systems/TileMerging/DataStructures.cs index b1973b92b8..7273b5bf41 100644 --- a/Systems/TileMerging/DataStructures.cs +++ b/Systems/TileMerging/DataStructures.cs @@ -5,7 +5,6 @@ using System.Text; using System.Threading.Tasks; using Terraria; using Terraria.DataStructures; -using static System.Runtime.InteropServices.JavaScript.JSType; namespace CalamityMod.Systems { From 652513c5f666537c3d5d06d6e50843d934c363a5 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Mon, 30 Sep 2024 08:14:33 +0900 Subject: [PATCH 065/133] Fixed faulty type casting --- Systems/TileMerging/DataStructures.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Systems/TileMerging/DataStructures.cs b/Systems/TileMerging/DataStructures.cs index 7273b5bf41..2a326cca3f 100644 --- a/Systems/TileMerging/DataStructures.cs +++ b/Systems/TileMerging/DataStructures.cs @@ -131,8 +131,8 @@ namespace CalamityMod.Systems throw new IndexOutOfRangeException(); var shift = idx * 8; - ulong value = (ulong)(data << shift); - ulong mask = (ulong)(0xFF << shift); + ulong value = ((ulong)data) << shift; + ulong mask = ((ulong)0xFF) << shift; DataPacked = (DataPacked ^ (mask & DataPacked)) | value; } @@ -151,8 +151,8 @@ namespace CalamityMod.Systems throw new IndexOutOfRangeException(); var shift = idx * 8; - ulong value = (ulong)(sheetIdx << shift); - ulong mask = (ulong)(0xFF << shift); + ulong value = ((ulong)sheetIdx) << shift; + ulong mask = ((ulong)0xFF) << shift; SheetIndexPacked = (SheetIndexPacked ^ (mask & SheetIndexPacked)) | value; } From 9b2c21252660587770c06a1fe550d5da783a470b Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 29 Sep 2024 20:33:18 -0400 Subject: [PATCH 066/133] Binary twiddling methods for block type checking --- .../TileBlendMergeSystem_TileFrame.cs | 60 +++++++------------ 1 file changed, 20 insertions(+), 40 deletions(-) diff --git a/Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs b/Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs index 91c3dc1963..242a68ffc7 100644 --- a/Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs +++ b/Systems/TileMerging/TileBlendMergeSystem_TileFrame.cs @@ -1,12 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using CalamityMod.Items.Potions.Alcohol; -using Extensions; +using System.Runtime.CompilerServices; using Terraria; -using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -272,49 +265,36 @@ namespace CalamityMod.Systems return true; } - private static bool HasLeftSolid(Tile tile) - { - return tile.BlockType switch - { - BlockType.Solid => true, - BlockType.SlopeUpLeft => true, - BlockType.SlopeDownLeft => true, - _ => false - }; - } + // BlockType.Solid, BlockType.SlopeUpLeft, BlockType.SlopeDownLeft + // 024 + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static bool HasLeftSolid(Tile tile) => ((int)tile.BlockType & 1) == 0; + // BlockType.Solid, BlockType.DownRight, BlockType.SlopeUpRight + // 035 (there is no way to optimize this) + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static bool HasRightSolid(Tile tile) { - return tile.BlockType switch - { - BlockType.Solid => true, - BlockType.SlopeUpRight => true, - BlockType.SlopeDownRight => true, - _ => false - }; + int b = (int)tile.BlockType; + return b == 0 || b == 3 || b == 5; } + // BlockType.Solid, BlockType.HalfBlock, BlockType.SlopeUpLeft, BlockType.SlopeUpRight + // 0145 + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static bool HasUpSolid(Tile tile) { - return tile.BlockType switch - { - BlockType.Solid => true, - BlockType.HalfBlock => true, - BlockType.SlopeUpLeft => true, - BlockType.SlopeUpRight => true, - _ => false - }; + int b = (int)tile.BlockType; + return b < 2 || b > 3; } + // BlockType.Solid, BlockType.SlopeDownLeft, BlockType.SlopeDownRight + // 023 + [MethodImpl(MethodImplOptions.AggressiveInlining)] private static bool HasDownSolid(Tile tile) { - return tile.BlockType switch - { - BlockType.Solid => true, - BlockType.SlopeDownLeft => true, - BlockType.SlopeDownRight => true, - _ => false - }; + int b = (int)tile.BlockType; + return (b & 4) == 0 && b != 1; } private static bool IsMergable(int type, int otherType) From 57aff17ac5cf9d9edf1883930319bcb04a46e9fe Mon Sep 17 00:00:00 2001 From: Flowaria Date: Mon, 16 Sep 2024 19:04:47 +0900 Subject: [PATCH 067/133] Organized Systems in Subfolders --- Systems/{ => Graphic}/CalamityModWaterStyle.cs | 0 Systems/{ => Graphic}/HellBackgroundSystem.cs | 0 Systems/{ => Graphic}/LavaRendering.cs | 0 Systems/{ => Graphic}/LightingEffectsSystem.cs | 0 Systems/{ => Graphic}/ModLavaStyle.cs | 0 Systems/{ => Mechanic}/DifficultyModeSystem.cs | 0 Systems/{ => Mechanic}/NerfExpertDebuffsSystem.cs | 0 Systems/{ => Mechanic}/RecipeSystem.cs | 0 Systems/{ => Mechanic}/SpeedrunTimerStoppingSystem.cs | 0 Systems/{ => Mechanic}/TilePingerSystem.cs | 0 Systems/{ => Mechanic}/WorldSelectionDifficultySystem.cs | 0 Systems/{ => ProgressionAndEvent}/AnyBossesOrEventsCheckSystem.cs | 0 Systems/{ => ProgressionAndEvent}/BossRushDialogueSystem.cs | 0 Systems/{ => ProgressionAndEvent}/DownedBossSystem.cs | 0 Systems/{ => Sound}/GungeonMusicSystem.cs | 0 Systems/{ => Sound}/MusicEventSystem.cs | 0 Systems/{ => Sound}/ORDERSystem.cs | 0 Systems/{ => Sound}/SingularSoundInstanceSystem.cs | 0 Systems/{ => Tile}/BiomeTileCounterSystem.cs | 0 Systems/{ => Tile}/SulphuricWaterSafeZoneSystem.cs | 0 Systems/{ => Tile}/TempTilesManagerSystem.cs | 0 Systems/{ => Tile}/TileFramingSystem.cs | 0 Systems/{ => World}/BestiaryRegistrySystem.cs | 0 Systems/{ => World}/MiscWorldStateSystem.cs | 0 Systems/{ => World}/WorldMiscUpdateSystem.cs | 0 Systems/{ => World}/WorldgenManagementSystem.cs | 0 26 files changed, 0 insertions(+), 0 deletions(-) rename Systems/{ => Graphic}/CalamityModWaterStyle.cs (100%) rename Systems/{ => Graphic}/HellBackgroundSystem.cs (100%) rename Systems/{ => Graphic}/LavaRendering.cs (100%) rename Systems/{ => Graphic}/LightingEffectsSystem.cs (100%) rename Systems/{ => Graphic}/ModLavaStyle.cs (100%) rename Systems/{ => Mechanic}/DifficultyModeSystem.cs (100%) rename Systems/{ => Mechanic}/NerfExpertDebuffsSystem.cs (100%) rename Systems/{ => Mechanic}/RecipeSystem.cs (100%) rename Systems/{ => Mechanic}/SpeedrunTimerStoppingSystem.cs (100%) rename Systems/{ => Mechanic}/TilePingerSystem.cs (100%) rename Systems/{ => Mechanic}/WorldSelectionDifficultySystem.cs (100%) rename Systems/{ => ProgressionAndEvent}/AnyBossesOrEventsCheckSystem.cs (100%) rename Systems/{ => ProgressionAndEvent}/BossRushDialogueSystem.cs (100%) rename Systems/{ => ProgressionAndEvent}/DownedBossSystem.cs (100%) rename Systems/{ => Sound}/GungeonMusicSystem.cs (100%) rename Systems/{ => Sound}/MusicEventSystem.cs (100%) rename Systems/{ => Sound}/ORDERSystem.cs (100%) rename Systems/{ => Sound}/SingularSoundInstanceSystem.cs (100%) rename Systems/{ => Tile}/BiomeTileCounterSystem.cs (100%) rename Systems/{ => Tile}/SulphuricWaterSafeZoneSystem.cs (100%) rename Systems/{ => Tile}/TempTilesManagerSystem.cs (100%) rename Systems/{ => Tile}/TileFramingSystem.cs (100%) rename Systems/{ => World}/BestiaryRegistrySystem.cs (100%) rename Systems/{ => World}/MiscWorldStateSystem.cs (100%) rename Systems/{ => World}/WorldMiscUpdateSystem.cs (100%) rename Systems/{ => World}/WorldgenManagementSystem.cs (100%) diff --git a/Systems/CalamityModWaterStyle.cs b/Systems/Graphic/CalamityModWaterStyle.cs similarity index 100% rename from Systems/CalamityModWaterStyle.cs rename to Systems/Graphic/CalamityModWaterStyle.cs diff --git a/Systems/HellBackgroundSystem.cs b/Systems/Graphic/HellBackgroundSystem.cs similarity index 100% rename from Systems/HellBackgroundSystem.cs rename to Systems/Graphic/HellBackgroundSystem.cs diff --git a/Systems/LavaRendering.cs b/Systems/Graphic/LavaRendering.cs similarity index 100% rename from Systems/LavaRendering.cs rename to Systems/Graphic/LavaRendering.cs diff --git a/Systems/LightingEffectsSystem.cs b/Systems/Graphic/LightingEffectsSystem.cs similarity index 100% rename from Systems/LightingEffectsSystem.cs rename to Systems/Graphic/LightingEffectsSystem.cs diff --git a/Systems/ModLavaStyle.cs b/Systems/Graphic/ModLavaStyle.cs similarity index 100% rename from Systems/ModLavaStyle.cs rename to Systems/Graphic/ModLavaStyle.cs diff --git a/Systems/DifficultyModeSystem.cs b/Systems/Mechanic/DifficultyModeSystem.cs similarity index 100% rename from Systems/DifficultyModeSystem.cs rename to Systems/Mechanic/DifficultyModeSystem.cs diff --git a/Systems/NerfExpertDebuffsSystem.cs b/Systems/Mechanic/NerfExpertDebuffsSystem.cs similarity index 100% rename from Systems/NerfExpertDebuffsSystem.cs rename to Systems/Mechanic/NerfExpertDebuffsSystem.cs diff --git a/Systems/RecipeSystem.cs b/Systems/Mechanic/RecipeSystem.cs similarity index 100% rename from Systems/RecipeSystem.cs rename to Systems/Mechanic/RecipeSystem.cs diff --git a/Systems/SpeedrunTimerStoppingSystem.cs b/Systems/Mechanic/SpeedrunTimerStoppingSystem.cs similarity index 100% rename from Systems/SpeedrunTimerStoppingSystem.cs rename to Systems/Mechanic/SpeedrunTimerStoppingSystem.cs diff --git a/Systems/TilePingerSystem.cs b/Systems/Mechanic/TilePingerSystem.cs similarity index 100% rename from Systems/TilePingerSystem.cs rename to Systems/Mechanic/TilePingerSystem.cs diff --git a/Systems/WorldSelectionDifficultySystem.cs b/Systems/Mechanic/WorldSelectionDifficultySystem.cs similarity index 100% rename from Systems/WorldSelectionDifficultySystem.cs rename to Systems/Mechanic/WorldSelectionDifficultySystem.cs diff --git a/Systems/AnyBossesOrEventsCheckSystem.cs b/Systems/ProgressionAndEvent/AnyBossesOrEventsCheckSystem.cs similarity index 100% rename from Systems/AnyBossesOrEventsCheckSystem.cs rename to Systems/ProgressionAndEvent/AnyBossesOrEventsCheckSystem.cs diff --git a/Systems/BossRushDialogueSystem.cs b/Systems/ProgressionAndEvent/BossRushDialogueSystem.cs similarity index 100% rename from Systems/BossRushDialogueSystem.cs rename to Systems/ProgressionAndEvent/BossRushDialogueSystem.cs diff --git a/Systems/DownedBossSystem.cs b/Systems/ProgressionAndEvent/DownedBossSystem.cs similarity index 100% rename from Systems/DownedBossSystem.cs rename to Systems/ProgressionAndEvent/DownedBossSystem.cs diff --git a/Systems/GungeonMusicSystem.cs b/Systems/Sound/GungeonMusicSystem.cs similarity index 100% rename from Systems/GungeonMusicSystem.cs rename to Systems/Sound/GungeonMusicSystem.cs diff --git a/Systems/MusicEventSystem.cs b/Systems/Sound/MusicEventSystem.cs similarity index 100% rename from Systems/MusicEventSystem.cs rename to Systems/Sound/MusicEventSystem.cs diff --git a/Systems/ORDERSystem.cs b/Systems/Sound/ORDERSystem.cs similarity index 100% rename from Systems/ORDERSystem.cs rename to Systems/Sound/ORDERSystem.cs diff --git a/Systems/SingularSoundInstanceSystem.cs b/Systems/Sound/SingularSoundInstanceSystem.cs similarity index 100% rename from Systems/SingularSoundInstanceSystem.cs rename to Systems/Sound/SingularSoundInstanceSystem.cs diff --git a/Systems/BiomeTileCounterSystem.cs b/Systems/Tile/BiomeTileCounterSystem.cs similarity index 100% rename from Systems/BiomeTileCounterSystem.cs rename to Systems/Tile/BiomeTileCounterSystem.cs diff --git a/Systems/SulphuricWaterSafeZoneSystem.cs b/Systems/Tile/SulphuricWaterSafeZoneSystem.cs similarity index 100% rename from Systems/SulphuricWaterSafeZoneSystem.cs rename to Systems/Tile/SulphuricWaterSafeZoneSystem.cs diff --git a/Systems/TempTilesManagerSystem.cs b/Systems/Tile/TempTilesManagerSystem.cs similarity index 100% rename from Systems/TempTilesManagerSystem.cs rename to Systems/Tile/TempTilesManagerSystem.cs diff --git a/Systems/TileFramingSystem.cs b/Systems/Tile/TileFramingSystem.cs similarity index 100% rename from Systems/TileFramingSystem.cs rename to Systems/Tile/TileFramingSystem.cs diff --git a/Systems/BestiaryRegistrySystem.cs b/Systems/World/BestiaryRegistrySystem.cs similarity index 100% rename from Systems/BestiaryRegistrySystem.cs rename to Systems/World/BestiaryRegistrySystem.cs diff --git a/Systems/MiscWorldStateSystem.cs b/Systems/World/MiscWorldStateSystem.cs similarity index 100% rename from Systems/MiscWorldStateSystem.cs rename to Systems/World/MiscWorldStateSystem.cs diff --git a/Systems/WorldMiscUpdateSystem.cs b/Systems/World/WorldMiscUpdateSystem.cs similarity index 100% rename from Systems/WorldMiscUpdateSystem.cs rename to Systems/World/WorldMiscUpdateSystem.cs diff --git a/Systems/WorldgenManagementSystem.cs b/Systems/World/WorldgenManagementSystem.cs similarity index 100% rename from Systems/WorldgenManagementSystem.cs rename to Systems/World/WorldgenManagementSystem.cs From 33fe2f58edb8fbfc32ffd9a85fd18afe470fc03b Mon Sep 17 00:00:00 2001 From: Flowaria Date: Mon, 16 Sep 2024 19:19:08 +0900 Subject: [PATCH 068/133] Move HairDye Shader Binding to each item class --- CalamityMod.cs | 23 ----------------------- Items/Dyes/HairDye/AdrenalineHairDye.cs | 21 ++++++++++++++++++++- Items/Dyes/HairDye/RageHairDye.cs | 21 ++++++++++++++++++++- Items/Dyes/HairDye/StealthHairDye.cs | 24 +++++++++++++++++++++++- Items/Dyes/HairDye/WingTimeHairDye.cs | 24 +++++++++++++++++++++++- 5 files changed, 86 insertions(+), 27 deletions(-) diff --git a/CalamityMod.cs b/CalamityMod.cs index aba4ba43e2..aff2dacad3 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -421,29 +421,6 @@ namespace CalamityMod 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(), 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)))); - GameShaders.Hair.BindShader(ModContent.ItemType(), new LegacyHairShaderData().UseLegacyMethod((Player player, Color newColor, ref bool lighting) => Color.Lerp(player.hairColor, new Color(255, 83, 48), ((float)player.Calamity().rage / (float)player.Calamity().rageMax)))); - GameShaders.Hair.BindShader(ModContent.ItemType(), new LegacyHairShaderData().UseLegacyMethod((Player player, Color newColor, ref bool lighting) => - { - float flightTimeInterpolant = player.wingTime / player.wingTimeMax; - if (player.mount.Active) - flightTimeInterpolant = 1f; - else if (float.IsInfinity(flightTimeInterpolant) || float.IsNaN(flightTimeInterpolant)) - flightTimeInterpolant = 0f; - - return Color.Lerp(player.hairColor, new Color(139, 205, 255), flightTimeInterpolant); - })); - GameShaders.Hair.BindShader(ModContent.ItemType(), new LegacyHairShaderData().UseLegacyMethod((Player player, Color newColor, ref bool lighting) => - { - float stealthInterpolant = player.Calamity().rogueStealth / player.Calamity().rogueStealthMax; - if (float.IsInfinity(stealthInterpolant) || float.IsNaN(stealthInterpolant)) - stealthInterpolant = 0f; - - return Color.Lerp(player.hairColor, new Color(186, 85, 211), stealthInterpolant); - })); - InvasionProgressUIManager.LoadGUIs(); } #endregion diff --git a/Items/Dyes/HairDye/AdrenalineHairDye.cs b/Items/Dyes/HairDye/AdrenalineHairDye.cs index f87b4b3831..8b529b6484 100644 --- a/Items/Dyes/HairDye/AdrenalineHairDye.cs +++ b/Items/Dyes/HairDye/AdrenalineHairDye.cs @@ -1,4 +1,7 @@ -using Terraria; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.GameContent.Dyes; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -7,6 +10,22 @@ namespace CalamityMod.Items.Dyes.HairDye public class AdrenalineHairDye : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Dyes"; + + public override void SetStaticDefaults() + { + if (!Main.dedServ) + { + GameShaders.Hair.BindShader(Type, new LegacyHairShaderData().UseLegacyMethod(UpdateHairDye)); + } + } + + private static Color UpdateHairDye(Player player, Color newColor, ref bool lighting) + { + var calPlayer = player.Calamity(); + var adrenalineP = calPlayer.adrenaline / calPlayer.adrenalineMax; + return Color.Lerp(player.hairColor, new Color(0, 255, 171), adrenalineP); + } + public override void SetDefaults() { Item.width = 20; diff --git a/Items/Dyes/HairDye/RageHairDye.cs b/Items/Dyes/HairDye/RageHairDye.cs index be7670346c..1cba915954 100644 --- a/Items/Dyes/HairDye/RageHairDye.cs +++ b/Items/Dyes/HairDye/RageHairDye.cs @@ -1,4 +1,7 @@ -using Terraria; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.GameContent.Dyes; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -7,6 +10,22 @@ namespace CalamityMod.Items.Dyes.HairDye public class RageHairDye : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Dyes"; + + public override void SetStaticDefaults() + { + if (!Main.dedServ) + { + GameShaders.Hair.BindShader(Type, new LegacyHairShaderData().UseLegacyMethod(UpdateHairDye)); + } + } + + private static Color UpdateHairDye(Player player, Color newColor, ref bool lighting) + { + var calPlayer = player.Calamity(); + var rageP = calPlayer.rage / calPlayer.rageMax; + return Color.Lerp(player.hairColor, new Color(255, 83, 48), rageP); + } + public override void SetDefaults() { Item.width = 20; diff --git a/Items/Dyes/HairDye/StealthHairDye.cs b/Items/Dyes/HairDye/StealthHairDye.cs index 8f96f7df2b..ecf18ab40a 100644 --- a/Items/Dyes/HairDye/StealthHairDye.cs +++ b/Items/Dyes/HairDye/StealthHairDye.cs @@ -1,4 +1,7 @@ -using Terraria; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.GameContent.Dyes; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -7,6 +10,25 @@ namespace CalamityMod.Items.Dyes.HairDye public class StealthHairDye : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Dyes"; + + public override void SetStaticDefaults() + { + if (!Main.dedServ) + { + GameShaders.Hair.BindShader(Type, new LegacyHairShaderData().UseLegacyMethod(UpdateHairDye)); + } + } + + private static Color UpdateHairDye(Player player, Color newColor, ref bool lighting) + { + float stealthP = player.Calamity().rogueStealth / player.Calamity().rogueStealthMax; + + if (float.IsInfinity(stealthP) || float.IsNaN(stealthP)) + stealthP = 0f; + + return Color.Lerp(player.hairColor, new Color(186, 85, 211), stealthP); + } + public override void SetDefaults() { Item.width = 20; diff --git a/Items/Dyes/HairDye/WingTimeHairDye.cs b/Items/Dyes/HairDye/WingTimeHairDye.cs index 4083db0f6f..d4de5e8574 100644 --- a/Items/Dyes/HairDye/WingTimeHairDye.cs +++ b/Items/Dyes/HairDye/WingTimeHairDye.cs @@ -1,4 +1,7 @@ -using Terraria; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.GameContent.Dyes; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -7,6 +10,25 @@ namespace CalamityMod.Items.Dyes.HairDye public class WingTimeHairDye : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Dyes"; + + public override void SetStaticDefaults() + { + if (!Main.dedServ) + { + GameShaders.Hair.BindShader(Type, new LegacyHairShaderData().UseLegacyMethod(UpdateHairDye)); + } + } + + private static Color UpdateHairDye(Player player, Color newColor, ref bool lighting) + { + float wingP = player.wingTime / player.wingTimeMax; + + if (player.mount.Active) wingP = 1f; + else if (float.IsInfinity(wingP) || float.IsNaN(wingP)) wingP = 0f; + + return Color.Lerp(player.hairColor, new Color(139, 205, 255), wingP); + } + public override void SetDefaults() { Item.width = 20; From a70a7081f19ce0ee598669b95e769d4a8242c3c1 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Mon, 16 Sep 2024 19:32:55 +0900 Subject: [PATCH 069/133] Added SkyEffectLoaderSystem --- CalamityMod.cs | 43 --------------- Systems/Graphic/SkyEffectLoaderSystem.cs | 69 ++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 43 deletions(-) create mode 100644 Systems/Graphic/SkyEffectLoaderSystem.cs diff --git a/CalamityMod.cs b/CalamityMod.cs index aff2dacad3..7ad258acfd 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -342,49 +342,6 @@ namespace CalamityMod ChadPrime = ModContent.Request("CalamityMod/ExtraTextures/ChadPrime", AssetRequestMode.AsyncLoad); ChadPrimeEyeGlowmask = ModContent.Request("CalamityMod/ExtraTextures/ChadPrimeHeadGlow", AssetRequestMode.AsyncLoad); - // TODO -- Sky shaders should probably be loaded in a ModSystem - Filters.Scene["CalamityMod:DevourerofGodsHead"] = new Filter(new DoGScreenShaderData("FilterMiniTower").UseColor(0.4f, 0.1f, 1.0f).UseOpacity(0.5f), EffectPriority.VeryHigh); - SkyManager.Instance["CalamityMod:DevourerofGodsHead"] = new DoGSky(); - - Filters.Scene["CalamityMod:CalamitasRun3"] = new Filter(new CalScreenShaderData("FilterMiniTower").UseColor(1.1f, 0.3f, 0.3f).UseOpacity(0.6f), EffectPriority.VeryHigh); - SkyManager.Instance["CalamityMod:CalamitasRun3"] = new CalSky(); - - Filters.Scene["CalamityMod:PlaguebringerGoliath"] = new Filter(new PbGScreenShaderData("FilterMiniTower").UseColor(0.2f, 0.6f, 0.2f).UseOpacity(0.35f), EffectPriority.VeryHigh); - SkyManager.Instance["CalamityMod:PlaguebringerGoliath"] = new PbGSky(); - - Filters.Scene["CalamityMod:Yharon"] = new Filter(new YScreenShaderData("FilterMiniTower").UseColor(1f, 0.4f, 0f).UseOpacity(0.75f), EffectPriority.VeryHigh); - SkyManager.Instance["CalamityMod:Yharon"] = new YSky(); - - Filters.Scene["CalamityMod:Leviathan"] = new Filter(new LevScreenShaderData("FilterMiniTower").UseColor(0f, 0f, 0.5f).UseOpacity(0.5f), EffectPriority.VeryHigh); - SkyManager.Instance["CalamityMod:Leviathan"] = new LevSky(); - - Filters.Scene["CalamityMod:SupremeCalamitas"] = new Filter(new SCalScreenShaderData("FilterMiniTower").UseColor(Color.Transparent).UseOpacity(0f), EffectPriority.VeryHigh); - SkyManager.Instance["CalamityMod:SupremeCalamitas"] = new SCalSky(); - - Filters.Scene["CalamityMod:Signus"] = new Filter(new SignusScreenShaderData("FilterMiniTower").UseColor(0.35f, 0.1f, 0.55f).UseOpacity(0.35f), EffectPriority.VeryHigh); - SkyManager.Instance["CalamityMod:Signus"] = new SignusSky(); - - Filters.Scene["CalamityMod:BossRush"] = new Filter(new BossRushScreenShader("FilterMiniTower").UseOpacity(0.75f), EffectPriority.VeryHigh); - SkyManager.Instance["CalamityMod:BossRush"] = new BossRushSky(); - - Filters.Scene["CalamityMod:ExoMechs"] = new Filter(new ExoMechsScreenShaderData("FilterMiniTower").UseColor(ExoMechsSky.DrawColor).UseOpacity(0.25f), EffectPriority.VeryHigh); - SkyManager.Instance["CalamityMod:ExoMechs"] = new ExoMechsSky(); - - Filters.Scene["CalamityMod:MonolithAccursed"] = new Filter(new MonolithScreenShaderData("FilterMiniTower").UseColor(1.1f, 0.3f, 0.3f).UseOpacity(0.65f), EffectPriority.VeryHigh); - SkyManager.Instance["CalamityMod:MonolithAccursed"] = new MonolithSky(); - - // Normal intensity is 4f - Texture2D DistortionTexture = ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/BlobbyNoise", AssetRequestMode.ImmediateLoad).Value; - Filters.Scene["CalamityMod:DrunkCrabulon"] = new Filter(new DrunkCrabScreenShaderData("FilterHeatDistortion").UseImage(DistortionTexture, 0, null).UseIntensity(20f), EffectPriority.VeryHigh); - - Filters.Scene["CalamityMod:BrimstoneCrag"] = new Filter(new MonolithScreenShaderData("FilterMiniTower").UseColor(0f, 0f, 0f).UseOpacity(0f), EffectPriority.VeryHigh); - SkyManager.Instance["CalamityMod:BrimstoneCrag"] = new BrimstoneCragSky(); - - SkyManager.Instance["CalamityMod:Astral"] = new AstralSky(); - SkyManager.Instance["CalamityMod:SulphurSea"] = new SulphurSeaSky(); - SkyManager.Instance["CalamityMod:Cryogen"] = new CryogenSky(); - SkyManager.Instance["CalamityMod:StormWeaverFlash"] = new StormWeaverFlashSky(); - CalamityShaders.LoadShaders(); // This must be done separately from immediate loading, as loading is now multithreaded. diff --git a/Systems/Graphic/SkyEffectLoaderSystem.cs b/Systems/Graphic/SkyEffectLoaderSystem.cs new file mode 100644 index 0000000000..07ed6e0aac --- /dev/null +++ b/Systems/Graphic/SkyEffectLoaderSystem.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.NPCs.CalClone; +using CalamityMod.NPCs.DevourerofGods; +using CalamityMod.NPCs.Leviathan; +using CalamityMod.NPCs.PlaguebringerGoliath; +using CalamityMod.NPCs.Signus; +using CalamityMod.NPCs.Yharon; +using CalamityMod.Skies; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria.Graphics.Effects; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + [Autoload(Side = ModSide.Client)] + internal sealed class SkyEffectLoaderSystem : ModSystem + { + public override void Load() + { + Filters.Scene["CalamityMod:DevourerofGodsHead"] = new Filter(new DoGScreenShaderData("FilterMiniTower").UseColor(0.4f, 0.1f, 1.0f).UseOpacity(0.5f), EffectPriority.VeryHigh); + SkyManager.Instance["CalamityMod:DevourerofGodsHead"] = new DoGSky(); + + Filters.Scene["CalamityMod:CalamitasRun3"] = new Filter(new CalScreenShaderData("FilterMiniTower").UseColor(1.1f, 0.3f, 0.3f).UseOpacity(0.6f), EffectPriority.VeryHigh); + SkyManager.Instance["CalamityMod:CalamitasRun3"] = new CalSky(); + + Filters.Scene["CalamityMod:PlaguebringerGoliath"] = new Filter(new PbGScreenShaderData("FilterMiniTower").UseColor(0.2f, 0.6f, 0.2f).UseOpacity(0.35f), EffectPriority.VeryHigh); + SkyManager.Instance["CalamityMod:PlaguebringerGoliath"] = new PbGSky(); + + Filters.Scene["CalamityMod:Yharon"] = new Filter(new YScreenShaderData("FilterMiniTower").UseColor(1f, 0.4f, 0f).UseOpacity(0.75f), EffectPriority.VeryHigh); + SkyManager.Instance["CalamityMod:Yharon"] = new YSky(); + + Filters.Scene["CalamityMod:Leviathan"] = new Filter(new LevScreenShaderData("FilterMiniTower").UseColor(0f, 0f, 0.5f).UseOpacity(0.5f), EffectPriority.VeryHigh); + SkyManager.Instance["CalamityMod:Leviathan"] = new LevSky(); + + Filters.Scene["CalamityMod:SupremeCalamitas"] = new Filter(new SCalScreenShaderData("FilterMiniTower").UseColor(Color.Transparent).UseOpacity(0f), EffectPriority.VeryHigh); + SkyManager.Instance["CalamityMod:SupremeCalamitas"] = new SCalSky(); + + Filters.Scene["CalamityMod:Signus"] = new Filter(new SignusScreenShaderData("FilterMiniTower").UseColor(0.35f, 0.1f, 0.55f).UseOpacity(0.35f), EffectPriority.VeryHigh); + SkyManager.Instance["CalamityMod:Signus"] = new SignusSky(); + + Filters.Scene["CalamityMod:BossRush"] = new Filter(new BossRushScreenShader("FilterMiniTower").UseOpacity(0.75f), EffectPriority.VeryHigh); + SkyManager.Instance["CalamityMod:BossRush"] = new BossRushSky(); + + Filters.Scene["CalamityMod:ExoMechs"] = new Filter(new ExoMechsScreenShaderData("FilterMiniTower").UseColor(ExoMechsSky.DrawColor).UseOpacity(0.25f), EffectPriority.VeryHigh); + SkyManager.Instance["CalamityMod:ExoMechs"] = new ExoMechsSky(); + + Filters.Scene["CalamityMod:MonolithAccursed"] = new Filter(new MonolithScreenShaderData("FilterMiniTower").UseColor(1.1f, 0.3f, 0.3f).UseOpacity(0.65f), EffectPriority.VeryHigh); + SkyManager.Instance["CalamityMod:MonolithAccursed"] = new MonolithSky(); + + // Normal intensity is 4f + Texture2D DistortionTexture = ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/BlobbyNoise", AssetRequestMode.ImmediateLoad).Value; + Filters.Scene["CalamityMod:DrunkCrabulon"] = new Filter(new DrunkCrabScreenShaderData("FilterHeatDistortion").UseImage(DistortionTexture, 0, null).UseIntensity(20f), EffectPriority.VeryHigh); + + Filters.Scene["CalamityMod:BrimstoneCrag"] = new Filter(new MonolithScreenShaderData("FilterMiniTower").UseColor(0f, 0f, 0f).UseOpacity(0f), EffectPriority.VeryHigh); + SkyManager.Instance["CalamityMod:BrimstoneCrag"] = new BrimstoneCragSky(); + + SkyManager.Instance["CalamityMod:Astral"] = new AstralSky(); + SkyManager.Instance["CalamityMod:SulphurSea"] = new SulphurSeaSky(); + SkyManager.Instance["CalamityMod:Cryogen"] = new CryogenSky(); + SkyManager.Instance["CalamityMod:StormWeaverFlash"] = new StormWeaverFlashSky(); + } + } +} From 68db5578360f4189d7a4093c25c627ea6ec335e4 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Mon, 16 Sep 2024 19:40:53 +0900 Subject: [PATCH 070/133] Moved DRValues to CalamityGlobalNPC --- CalamityMod.cs | 125 ---------------------------------- ModSupport/ModCalls.cs | 6 +- NPCs/CalamityGlobalNPC.cs | 139 +++++++++++++++++++++++++++++++++++++- 3 files changed, 140 insertions(+), 130 deletions(-) diff --git a/CalamityMod.cs b/CalamityMod.cs index 7ad258acfd..9201fbc682 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -139,9 +139,6 @@ namespace CalamityMod public static Asset ChadPrime; public static Asset ChadPrimeEyeGlowmask; - // DR data structure - public static SortedDictionary DRValues; - // Boss Kill Time data structure public static SortedDictionary bossKillTimes; @@ -282,7 +279,6 @@ namespace CalamityMod BossHealthBarManager.Load(this); EnchantmentManager.LoadAllEnchantments(); VanillaArmorChangeManager.Load(); - SetupVanillaDR(); SetupBossKillTimes(); SchematicManager.Load(); @@ -407,9 +403,6 @@ namespace CalamityMod wikithis = null; AstralSky = null; - - DRValues?.Clear(); - DRValues = null; bossKillTimes?.Clear(); bossKillTimes = null; @@ -490,124 +483,6 @@ namespace CalamityMod } #endregion - #region Vanilla Enemy DR - private void SetupVanillaDR() - { - DRValues = new SortedDictionary { - { NPCID.AngryBonesBig, 0.2f }, - { NPCID.AngryBonesBigHelmet, 0.2f }, - { NPCID.AngryBonesBigMuscle, 0.2f }, - { NPCID.AnomuraFungus, 0.1f }, - { NPCID.Antlion, 0.1f }, - { NPCID.Arapaima, 0.1f }, - { NPCID.ArmoredSkeleton, 0.15f }, - { NPCID.ArmoredViking, 0.1f }, - { NPCID.BigMimicCorruption, 0.3f }, - { NPCID.BigMimicCrimson, 0.3f }, - { NPCID.BigMimicHallow, 0.3f }, - { NPCID.BigMimicJungle, 0.3f }, // unused vanilla enemy - { NPCID.BlueArmoredBones, 0.2f }, - { NPCID.BlueArmoredBonesMace, 0.2f }, - { NPCID.BlueArmoredBonesNoPants, 0.2f }, - { NPCID.BlueArmoredBonesSword, 0.2f }, - { NPCID.BoneLee, 0.2f }, - { NPCID.Crab, 0.05f }, - { NPCID.Crawdad, 0.2f }, - { NPCID.Crawdad2, 0.2f }, - { NPCID.CultistBoss, 0.15f }, - { NPCID.Deerclops, 0.05f }, - { NPCID.DD2Betsy, 0.1f }, - { NPCID.DD2OgreT2, 0.1f }, - { NPCID.DD2OgreT3, 0.15f }, - { NPCID.DeadlySphere, 0.4f }, - { NPCID.DiabolistRed, 0.2f }, - { NPCID.DiabolistWhite, 0.2f }, - { NPCID.DukeFishron, 0.15f }, - { NPCID.DungeonGuardian, 0.9f }, - { NPCID.DungeonSpirit, 0.2f }, - { NPCID.ElfCopter, 0.15f }, - { NPCID.Everscream, 0.1f }, - { NPCID.FlyingAntlion, 0.05f }, - { NPCID.GiantCursedSkull, 0.2f }, - { NPCID.GiantShelly, 0.2f }, - { NPCID.GiantShelly2, 0.2f }, - { NPCID.GiantTortoise, 0.35f }, - { NPCID.Golem, 0.25f }, - { NPCID.GolemFistLeft, 0.25f }, - { NPCID.GolemFistRight, 0.25f }, - { NPCID.GolemHead, 0.25f }, - { NPCID.GolemHeadFree, 0.25f }, - { NPCID.GraniteFlyer, 0.1f }, - { NPCID.GraniteGolem, 0.15f }, - { NPCID.GreekSkeleton, 0.1f }, - { NPCID.HellArmoredBones, 0.2f }, - { NPCID.HellArmoredBonesMace, 0.2f }, - { NPCID.HellArmoredBonesSpikeShield, 0.2f }, - { NPCID.HellArmoredBonesSword, 0.2f }, - { NPCID.IceGolem, 0.1f }, - { NPCID.IceQueen, 0.1f }, - { NPCID.IceTortoise, 0.35f }, - { NPCID.HeadlessHorseman, 0.05f }, - { NPCID.MartianDrone, 0.2f }, - { NPCID.MartianSaucer, 0.2f }, - { NPCID.MartianSaucerCannon, 0.2f }, - { NPCID.MartianSaucerCore, 0.2f }, - { NPCID.MartianSaucerTurret, 0.2f }, - { NPCID.MartianTurret, 0.2f }, - { NPCID.MartianWalker, 0.35f }, - { NPCID.Mimic, 0.3f }, - { NPCID.MoonLordCore, 0.15f }, - { NPCID.MoonLordHand, 0.15f }, - { NPCID.MoonLordHead, 0.15f }, - { NPCID.Mothron, 0.2f }, - { NPCID.MothronEgg, 0.5f }, - { NPCID.MourningWood, 0.1f }, - { NPCID.Necromancer, 0.2f }, - { NPCID.NecromancerArmored, 0.2f }, - { NPCID.Paladin, 0.45f }, - { NPCID.PirateCaptain, 0.05f }, - { NPCID.PirateShipCannon, 0.15f }, - { NPCID.Plantera, 0.15f }, - { NPCID.PlanterasTentacle, 0.1f }, - { NPCID.HallowBoss, 0.15f }, - { NPCID.PossessedArmor, 0.25f }, - { NPCID.PresentMimic, 0.3f }, - { NPCID.PrimeCannon, 0.2f }, - { NPCID.PrimeLaser, 0.2f }, - { NPCID.PrimeSaw, 0.2f }, - { NPCID.PrimeVice, 0.2f }, - { NPCID.Probe, 0.2f }, - { NPCID.Pumpking, 0.1f }, - { NPCID.QueenBee, 0.05f }, - { NPCID.RaggedCaster, 0.2f }, - { NPCID.RaggedCasterOpenCoat, 0.2f }, - { NPCID.Retinazer, 0.2f }, - { NPCID.RustyArmoredBonesAxe, 0.2f }, - { NPCID.RustyArmoredBonesFlail, 0.2f }, - { NPCID.RustyArmoredBonesSword, 0.2f }, - { NPCID.RustyArmoredBonesSwordNoArmor, 0.2f }, - { NPCID.SandElemental, 0.1f }, - { NPCID.SantaNK1, 0.35f }, - { NPCID.SeaSnail, 0.05f }, - { NPCID.SkeletonArcher, 0.1f }, - { NPCID.SkeletonCommando, 0.2f }, - { NPCID.SkeletonSniper, 0.2f }, - { NPCID.SkeletronHand, 0.05f }, - { NPCID.SkeletronHead, 0.05f }, - { NPCID.SkeletronPrime, 0.2f }, - { NPCID.Spazmatism, 0.2f }, - { NPCID.TacticalSkeleton, 0.2f }, - { NPCID.TheDestroyer, 0.1f }, - { NPCID.TheDestroyerBody, 0.2f }, - { NPCID.TheDestroyerTail, 0.35f }, - { NPCID.TheHungry, 0.1f }, - { NPCID.UndeadViking, 0.1f }, - { NPCID.WalkingAntlion, 0.1f }, - { NPCID.WallofFlesh, 0.5f }, - }; - } - #endregion - #region Boss Kill Times private void SetupBossKillTimes() { diff --git a/ModSupport/ModCalls.cs b/ModSupport/ModCalls.cs index 4ced41b143..d154133dee 100644 --- a/ModSupport/ModCalls.cs +++ b/ModSupport/ModCalls.cs @@ -719,9 +719,9 @@ namespace CalamityMod // Sets the damage reduction for an NPC type public static float SetDamageReduction(int npcID, float dr) { - CalamityMod.DRValues.TryGetValue(npcID, out float oldDR); - CalamityMod.DRValues.Remove(npcID); - CalamityMod.DRValues.Add(npcID, dr); + CalamityGlobalNPC.DRValues.TryGetValue(npcID, out float oldDR); + CalamityGlobalNPC.DRValues.Remove(npcID); + CalamityGlobalNPC.DRValues.Add(npcID, dr); return oldDR; } // Sets a specific NPC's damage reduction diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index fc28d4788e..ce5d318457 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -89,6 +89,15 @@ namespace CalamityMod.NPCs public partial class CalamityGlobalNPC : GlobalNPC { #region Variables + + /// + /// Damage Reduction Lookup Table + /// + public static SortedDictionary DRValues { get; set; } + + /// + /// Damage Reduction Value + /// public float DR { get; set; } = 0f; /// @@ -1207,6 +1216,132 @@ namespace CalamityMod.NPCs } #endregion + #region Load/Unload + public override void Load() + { + #region Setup Vanilla DR Values + DRValues = new SortedDictionary { + { NPCID.AngryBonesBig, 0.2f }, + { NPCID.AngryBonesBigHelmet, 0.2f }, + { NPCID.AngryBonesBigMuscle, 0.2f }, + { NPCID.AnomuraFungus, 0.1f }, + { NPCID.Antlion, 0.1f }, + { NPCID.Arapaima, 0.1f }, + { NPCID.ArmoredSkeleton, 0.15f }, + { NPCID.ArmoredViking, 0.1f }, + { NPCID.BigMimicCorruption, 0.3f }, + { NPCID.BigMimicCrimson, 0.3f }, + { NPCID.BigMimicHallow, 0.3f }, + { NPCID.BigMimicJungle, 0.3f }, // unused vanilla enemy + { NPCID.BlueArmoredBones, 0.2f }, + { NPCID.BlueArmoredBonesMace, 0.2f }, + { NPCID.BlueArmoredBonesNoPants, 0.2f }, + { NPCID.BlueArmoredBonesSword, 0.2f }, + { NPCID.BoneLee, 0.2f }, + { NPCID.Crab, 0.05f }, + { NPCID.Crawdad, 0.2f }, + { NPCID.Crawdad2, 0.2f }, + { NPCID.CultistBoss, 0.15f }, + { NPCID.Deerclops, 0.05f }, + { NPCID.DD2Betsy, 0.1f }, + { NPCID.DD2OgreT2, 0.1f }, + { NPCID.DD2OgreT3, 0.15f }, + { NPCID.DeadlySphere, 0.4f }, + { NPCID.DiabolistRed, 0.2f }, + { NPCID.DiabolistWhite, 0.2f }, + { NPCID.DukeFishron, 0.15f }, + { NPCID.DungeonGuardian, 0.9f }, + { NPCID.DungeonSpirit, 0.2f }, + { NPCID.ElfCopter, 0.15f }, + { NPCID.Everscream, 0.1f }, + { NPCID.FlyingAntlion, 0.05f }, + { NPCID.GiantCursedSkull, 0.2f }, + { NPCID.GiantShelly, 0.2f }, + { NPCID.GiantShelly2, 0.2f }, + { NPCID.GiantTortoise, 0.35f }, + { NPCID.Golem, 0.25f }, + { NPCID.GolemFistLeft, 0.25f }, + { NPCID.GolemFistRight, 0.25f }, + { NPCID.GolemHead, 0.25f }, + { NPCID.GolemHeadFree, 0.25f }, + { NPCID.GraniteFlyer, 0.1f }, + { NPCID.GraniteGolem, 0.15f }, + { NPCID.GreekSkeleton, 0.1f }, + { NPCID.HellArmoredBones, 0.2f }, + { NPCID.HellArmoredBonesMace, 0.2f }, + { NPCID.HellArmoredBonesSpikeShield, 0.2f }, + { NPCID.HellArmoredBonesSword, 0.2f }, + { NPCID.IceGolem, 0.1f }, + { NPCID.IceQueen, 0.1f }, + { NPCID.IceTortoise, 0.35f }, + { NPCID.HeadlessHorseman, 0.05f }, + { NPCID.MartianDrone, 0.2f }, + { NPCID.MartianSaucer, 0.2f }, + { NPCID.MartianSaucerCannon, 0.2f }, + { NPCID.MartianSaucerCore, 0.2f }, + { NPCID.MartianSaucerTurret, 0.2f }, + { NPCID.MartianTurret, 0.2f }, + { NPCID.MartianWalker, 0.35f }, + { NPCID.Mimic, 0.3f }, + { NPCID.MoonLordCore, 0.15f }, + { NPCID.MoonLordHand, 0.15f }, + { NPCID.MoonLordHead, 0.15f }, + { NPCID.Mothron, 0.2f }, + { NPCID.MothronEgg, 0.5f }, + { NPCID.MourningWood, 0.1f }, + { NPCID.Necromancer, 0.2f }, + { NPCID.NecromancerArmored, 0.2f }, + { NPCID.Paladin, 0.45f }, + { NPCID.PirateCaptain, 0.05f }, + { NPCID.PirateShipCannon, 0.15f }, + { NPCID.Plantera, 0.15f }, + { NPCID.PlanterasTentacle, 0.1f }, + { NPCID.HallowBoss, 0.15f }, + { NPCID.PossessedArmor, 0.25f }, + { NPCID.PresentMimic, 0.3f }, + { NPCID.PrimeCannon, 0.2f }, + { NPCID.PrimeLaser, 0.2f }, + { NPCID.PrimeSaw, 0.2f }, + { NPCID.PrimeVice, 0.2f }, + { NPCID.Probe, 0.2f }, + { NPCID.Pumpking, 0.1f }, + { NPCID.QueenBee, 0.05f }, + { NPCID.RaggedCaster, 0.2f }, + { NPCID.RaggedCasterOpenCoat, 0.2f }, + { NPCID.Retinazer, 0.2f }, + { NPCID.RustyArmoredBonesAxe, 0.2f }, + { NPCID.RustyArmoredBonesFlail, 0.2f }, + { NPCID.RustyArmoredBonesSword, 0.2f }, + { NPCID.RustyArmoredBonesSwordNoArmor, 0.2f }, + { NPCID.SandElemental, 0.1f }, + { NPCID.SantaNK1, 0.35f }, + { NPCID.SeaSnail, 0.05f }, + { NPCID.SkeletonArcher, 0.1f }, + { NPCID.SkeletonCommando, 0.2f }, + { NPCID.SkeletonSniper, 0.2f }, + { NPCID.SkeletronHand, 0.05f }, + { NPCID.SkeletronHead, 0.05f }, + { NPCID.SkeletronPrime, 0.2f }, + { NPCID.Spazmatism, 0.2f }, + { NPCID.TacticalSkeleton, 0.2f }, + { NPCID.TheDestroyer, 0.1f }, + { NPCID.TheDestroyerBody, 0.2f }, + { NPCID.TheDestroyerTail, 0.35f }, + { NPCID.TheHungry, 0.1f }, + { NPCID.UndeadViking, 0.1f }, + { NPCID.WalkingAntlion, 0.1f }, + { NPCID.WallofFlesh, 0.5f }, + }; + #endregion + } + + public override void Unload() + { + DRValues?.Clear(); + DRValues = null; + } + #endregion + #region Set Defaults public override void SetStaticDefaults() { @@ -1231,9 +1366,9 @@ namespace CalamityMod.NPCs // Apply DR to vanilla NPCs. // This also applies DR to other mods' NPCs who have set up their NPCs to have DR. - if (CalamityMod.DRValues.ContainsKey(npc.type)) + if (DRValues.ContainsKey(npc.type)) { - CalamityMod.DRValues.TryGetValue(npc.type, out float newDR); + DRValues.TryGetValue(npc.type, out float newDR); DR = newDR; } From 68a625bc4d7b86cdc4d52fe59ce1290770b1bc43 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Mon, 16 Sep 2024 19:52:05 +0900 Subject: [PATCH 071/133] Added MountsBalancingSystem --- CalamityMod.cs | 12 --------- Systems/Mechanic/MountsBalancingSystem.cs | 33 +++++++++++++++++++++++ 2 files changed, 33 insertions(+), 12 deletions(-) create mode 100644 Systems/Mechanic/MountsBalancingSystem.cs diff --git a/CalamityMod.cs b/CalamityMod.cs index 9201fbc682..38530a26c3 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -250,13 +250,6 @@ namespace CalamityMod CalamityGlobalItem.LoadTweaks(); CalamityGlobalProjectile.LoadTweaks(); - // Mount balancing occurs during runtime and is undone when Calamity is unloaded. - Mount.mounts[MountID.Unicorn].dashSpeed *= CalamityPlayer.UnicornSpeedNerfPower; - Mount.mounts[MountID.Unicorn].runSpeed *= CalamityPlayer.UnicornSpeedNerfPower; - - // Buff DCU's pickaxe power to equal PML pickaxe capabilities - Mount.drillPickPower = 225; - // Make Graveyard biomes require more Gravestones SceneMetrics.GraveyardTileMax = 60; SceneMetrics.GraveyardTileMin = 40; @@ -438,11 +431,6 @@ namespace CalamityMod GeneralParticleHandler.Unload(); } - Mount.mounts[MountID.Unicorn].dashSpeed /= CalamityPlayer.UnicornSpeedNerfPower; - Mount.mounts[MountID.Unicorn].runSpeed /= CalamityPlayer.UnicornSpeedNerfPower; - - Mount.drillPickPower = 210; - SceneMetrics.GraveyardTileMax = 36; SceneMetrics.GraveyardTileMin = 16; SceneMetrics.GraveyardTileThreshold = 28; diff --git a/Systems/Mechanic/MountsBalancingSystem.cs b/Systems/Mechanic/MountsBalancingSystem.cs new file mode 100644 index 0000000000..9a67d0890a --- /dev/null +++ b/Systems/Mechanic/MountsBalancingSystem.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.CalPlayer; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + internal sealed class MountsBalancingSystem : ModSystem + { + public override void Load() + { + // Mount balancing occurs during runtime and is undone when Calamity is unloaded. + Mount.mounts[MountID.Unicorn].dashSpeed *= CalamityPlayer.UnicornSpeedNerfPower; + Mount.mounts[MountID.Unicorn].runSpeed *= CalamityPlayer.UnicornSpeedNerfPower; + + // Buff DCU's pickaxe power to equal PML pickaxe capabilities + Mount.drillPickPower = 225; + } + + public override void Unload() + { + Mount.mounts[MountID.Unicorn].dashSpeed /= CalamityPlayer.UnicornSpeedNerfPower; + Mount.mounts[MountID.Unicorn].runSpeed /= CalamityPlayer.UnicornSpeedNerfPower; + + Mount.drillPickPower = 210; + } + } +} From ed0e7644e7e193264ae3c9e2e7de2863fa6ddea1 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Mon, 16 Sep 2024 20:08:49 +0900 Subject: [PATCH 072/133] Moved TextureLoading Into ExtraTextureRefs and SkyTextureRefs --- Backgrounds/AstralDesertSurfaceBGStyle.cs | 9 +-- Backgrounds/AstralSnowSurfaceBGStyle.cs | 17 ++--- Backgrounds/AstralSurfaceBGStyle.cs | 19 +++--- CalamityMod.cs | 75 +-------------------- ExtraTextures/ExtraTextureRefs.cs | 47 +++++++++++++ NPCs/CalamityGlobalNPC.cs | 17 +++-- Projectiles/CalamityGlobalProjectile.cs | 3 +- Skies/AstralMonolithSky.cs | 2 +- Skies/AstralSky.cs | 2 +- Skies/SkyTextureRefs.cs | 80 +++++++++++++++++++++++ Skies/SulphurSeaSky.cs | 6 +- 11 files changed, 169 insertions(+), 108 deletions(-) create mode 100644 ExtraTextures/ExtraTextureRefs.cs create mode 100644 Skies/SkyTextureRefs.cs diff --git a/Backgrounds/AstralDesertSurfaceBGStyle.cs b/Backgrounds/AstralDesertSurfaceBGStyle.cs index 181f0d7222..6fb209d35d 100644 --- a/Backgrounds/AstralDesertSurfaceBGStyle.cs +++ b/Backgrounds/AstralDesertSurfaceBGStyle.cs @@ -5,6 +5,7 @@ using Terraria.Graphics.Effects; using Terraria; using Terraria.ModLoader; using Microsoft.Xna.Framework; +using CalamityMod.Skies; namespace CalamityMod.Backgrounds { @@ -80,7 +81,7 @@ namespace CalamityMod.Backgrounds var bgParallax = 0.4; var bgTopY = (int)(backgroundTopMagicNumber * 1800.0 + 1500.0) + (int)scAdj + pushBGTopHack; bgScale *= bgGlobalScaleMultiplier; - var bgWidthScaled = (int)((float)CalamityMod.AstralDesertSurfaceMiddle.Width * bgScale); + var bgWidthScaled = (int)((float)SkyTextureRefs.AstralDesertSurfaceMiddle.Width * bgScale); SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1.2f / (float)bgParallax); var bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2)); if (Main.gameMenu) @@ -91,7 +92,7 @@ namespace CalamityMod.Backgrounds { for (int i = 0; i < bgLoops; i++) { - Main.spriteBatch.Draw(CalamityMod.AstralDesertSurfaceMiddle, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, CalamityMod.AstralDesertSurfaceMiddle.Width, CalamityMod.AstralDesertSurfaceMiddle.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralDesertSurfaceMiddle, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralDesertSurfaceMiddle.Width, SkyTextureRefs.AstralDesertSurfaceMiddle.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); } } @@ -99,7 +100,7 @@ namespace CalamityMod.Backgrounds bgParallax = 0.43; bgTopY = (int)(backgroundTopMagicNumber * 1950.0 + 1750.0) + (int)scAdj + pushBGTopHack; bgScale *= bgGlobalScaleMultiplier; - bgWidthScaled = (int)((float)CalamityMod.AstralDesertSurfaceClose.Width * bgScale); + bgWidthScaled = (int)((float)SkyTextureRefs.AstralDesertSurfaceClose.Width * bgScale); SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float)bgParallax); bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2)); if (Main.gameMenu) @@ -113,7 +114,7 @@ namespace CalamityMod.Backgrounds { for (int i = 0; i < bgLoops; i++) { - Main.spriteBatch.Draw(CalamityMod.AstralDesertSurfaceClose, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, CalamityMod.AstralDesertSurfaceClose.Width, CalamityMod.AstralDesertSurfaceClose.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralDesertSurfaceClose, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralDesertSurfaceClose.Width, SkyTextureRefs.AstralDesertSurfaceClose.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); } } } diff --git a/Backgrounds/AstralSnowSurfaceBGStyle.cs b/Backgrounds/AstralSnowSurfaceBGStyle.cs index 239fc427b3..aad9d204b6 100644 --- a/Backgrounds/AstralSnowSurfaceBGStyle.cs +++ b/Backgrounds/AstralSnowSurfaceBGStyle.cs @@ -6,6 +6,7 @@ using Terraria; using Terraria.ModLoader; using Microsoft.Xna.Framework; using Terraria.GameContent.UI.States; +using CalamityMod.Skies; namespace CalamityMod.Backgrounds { @@ -82,7 +83,7 @@ namespace CalamityMod.Backgrounds var bgParallax = 0.4; var bgTopY = (int)(backgroundTopMagicNumber * 1800.0 + 1500.0) + (int)scAdj + pushBGTopHack; bgScale *= bgGlobalScaleMultiplier; - var bgWidthScaled = (int)((float)CalamityMod.AstralSnowSurfaceMiddle.Width * bgScale); + var bgWidthScaled = (int)((float)SkyTextureRefs.AstralSnowSurfaceMiddle.Width * bgScale); SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1.2f / (float)bgParallax); var bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2)); if (Main.gameMenu) @@ -93,7 +94,7 @@ namespace CalamityMod.Backgrounds { for (int i = 0; i < bgLoops; i++) { - Main.spriteBatch.Draw(CalamityMod.AstralSnowSurfaceMiddle, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, CalamityMod.AstralSnowSurfaceMiddle.Width, CalamityMod.AstralSnowSurfaceMiddle.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralSnowSurfaceMiddle, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSnowSurfaceMiddle.Width, SkyTextureRefs.AstralSnowSurfaceMiddle.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); } } @@ -101,7 +102,7 @@ namespace CalamityMod.Backgrounds bgParallax = 0.43; bgTopY = (int)(backgroundTopMagicNumber * 1950.0 + 1750.0) + (int)scAdj + pushBGTopHack; bgScale *= bgGlobalScaleMultiplier; - bgWidthScaled = (int)((float)CalamityMod.AstralSurfaceClose.Width * bgScale); + bgWidthScaled = (int)((float)SkyTextureRefs.AstralSurfaceClose.Width * bgScale); SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float)bgParallax); bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2)); if (Main.gameMenu) @@ -115,15 +116,15 @@ namespace CalamityMod.Backgrounds { for (int i = 0; i < bgLoops; i++) { - Main.spriteBatch.Draw(CalamityMod.AstralSurfaceClose, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, CalamityMod.AstralSurfaceClose.Width, CalamityMod.AstralSurfaceClose.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); - Main.spriteBatch.Draw(CalamityMod.AstralSurfaceCloseGlow, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, CalamityMod.AstralSurfaceCloseGlow.Width, CalamityMod.AstralSurfaceCloseGlow.Height), new Color(Color.White.R * 0.7f, Color.White.G * 0.7f, Color.White.B * 0.7f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceClose, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceClose.Width, SkyTextureRefs.AstralSurfaceClose.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceCloseGlow, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceCloseGlow.Width, SkyTextureRefs.AstralSurfaceCloseGlow.Height), new Color(Color.White.R * 0.7f, Color.White.G * 0.7f, Color.White.B * 0.7f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); } } bgScale = 1.34f; bgParallax = 0.49; bgTopY = (int)(backgroundTopMagicNumber * 2100.0 + 2000.0) + (int)scAdj + pushBGTopHack; bgScale *= bgGlobalScaleMultiplier; - bgWidthScaled = (int)(CalamityMod.AstralSurfaceFront.Width * bgScale); + bgWidthScaled = (int)(SkyTextureRefs.AstralSurfaceFront.Width * bgScale); SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float)bgParallax); bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2)); if (Main.gameMenu) @@ -137,8 +138,8 @@ namespace CalamityMod.Backgrounds { for (int i = 0; i < bgLoops; i++) { - Main.spriteBatch.Draw(CalamityMod.AstralSurfaceFront, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, CalamityMod.AstralSurfaceFront.Width, CalamityMod.AstralSurfaceFront.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); - Main.spriteBatch.Draw(CalamityMod.AstralSurfaceFrontGlow, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, CalamityMod.AstralSurfaceFrontGlow.Width, CalamityMod.AstralSurfaceFrontGlow.Height), new Color(Color.White.R * 0.9f, Color.White.G * 0.9f, Color.White.B * 0.9f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceFront, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceFront.Width, SkyTextureRefs.AstralSurfaceFront.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceFrontGlow, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceFrontGlow.Width, SkyTextureRefs.AstralSurfaceFrontGlow.Height), new Color(Color.White.R * 0.9f, Color.White.G * 0.9f, Color.White.B * 0.9f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); } } } diff --git a/Backgrounds/AstralSurfaceBGStyle.cs b/Backgrounds/AstralSurfaceBGStyle.cs index bc53eed640..06810d6f3d 100644 --- a/Backgrounds/AstralSurfaceBGStyle.cs +++ b/Backgrounds/AstralSurfaceBGStyle.cs @@ -5,6 +5,7 @@ using System; using Terraria.Graphics.Effects; using Terraria; using Terraria.ModLoader; +using CalamityMod.Skies; namespace CalamityMod.Backgrounds { @@ -86,7 +87,7 @@ namespace CalamityMod.Backgrounds var bgParallax = 0.4; //The parallax of the background layer var bgTopY = (int)(backgroundTopMagicNumber * 1800.0 + 1500.0) + (int)scAdj + pushBGTopHack; //the Y position of the background bgScale *= bgGlobalScaleMultiplier; //Scale of the background - var bgWidthScaled = (int)((float)CalamityMod.AstralSurfaceMiddle.Width * bgScale); //The Width of the bg texture scaled to the correct size + var bgWidthScaled = (int)((float)SkyTextureRefs.AstralSurfaceMiddle.Width * bgScale); //The Width of the bg texture scaled to the correct size SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1.2f / (float)bgParallax); var bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2)); //The starting position of the background layer if (Main.gameMenu) @@ -98,8 +99,8 @@ namespace CalamityMod.Backgrounds for (int i = 0; i < bgLoops; i++) { //Draw the texture and its glowmask to each loop of the texture - Main.spriteBatch.Draw(CalamityMod.AstralSurfaceMiddle, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, CalamityMod.AstralSurfaceMiddle.Width, CalamityMod.AstralSurfaceMiddle.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); - Main.spriteBatch.Draw(CalamityMod.AstralSurfaceMiddleGlow, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, CalamityMod.AstralSurfaceMiddleGlow.Width, CalamityMod.AstralSurfaceMiddleGlow.Height), new Color(Color.White.R * 0.5f, Color.White.G * 0.5f, Color.White.B * 0.5f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceMiddle, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceMiddle.Width, SkyTextureRefs.AstralSurfaceMiddle.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceMiddleGlow, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceMiddleGlow.Width, SkyTextureRefs.AstralSurfaceMiddleGlow.Height), new Color(Color.White.R * 0.5f, Color.White.G * 0.5f, Color.White.B * 0.5f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); } } @@ -109,7 +110,7 @@ namespace CalamityMod.Backgrounds bgParallax = 0.43; bgTopY = (int)(backgroundTopMagicNumber * 1950.0 + 1750.0) + (int)scAdj + pushBGTopHack; bgScale *= bgGlobalScaleMultiplier; - bgWidthScaled = (int)((float)CalamityMod.AstralSurfaceClose.Width * bgScale); + bgWidthScaled = (int)((float)SkyTextureRefs.AstralSurfaceClose.Width * bgScale); SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float)bgParallax); bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2)); if (Main.gameMenu) @@ -123,8 +124,8 @@ namespace CalamityMod.Backgrounds { for (int i = 0; i < bgLoops; i++) { - Main.spriteBatch.Draw(CalamityMod.AstralSurfaceClose, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, CalamityMod.AstralSurfaceClose.Width, CalamityMod.AstralSurfaceClose.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); - Main.spriteBatch.Draw(CalamityMod.AstralSurfaceCloseGlow, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, CalamityMod.AstralSurfaceCloseGlow.Width, CalamityMod.AstralSurfaceCloseGlow.Height), new Color(Color.White.R * 0.7f, Color.White.G * 0.7f, Color.White.B * 0.7f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceClose, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceClose.Width, SkyTextureRefs.AstralSurfaceClose.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceCloseGlow, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceCloseGlow.Width, SkyTextureRefs.AstralSurfaceCloseGlow.Height), new Color(Color.White.R * 0.7f, Color.White.G * 0.7f, Color.White.B * 0.7f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); } } @@ -134,7 +135,7 @@ namespace CalamityMod.Backgrounds bgParallax = 0.49; bgTopY = (int)(backgroundTopMagicNumber * 2100.0 + 2000.0) + (int)scAdj + pushBGTopHack; bgScale *= bgGlobalScaleMultiplier; - bgWidthScaled = (int)(CalamityMod.AstralSurfaceFront.Width * bgScale); + bgWidthScaled = (int)(SkyTextureRefs.AstralSurfaceFront.Width * bgScale); SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float)bgParallax); bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2)); if (Main.gameMenu) @@ -148,8 +149,8 @@ namespace CalamityMod.Backgrounds { for (int i = 0; i < bgLoops; i++) { - Main.spriteBatch.Draw(CalamityMod.AstralSurfaceFront, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, CalamityMod.AstralSurfaceFront.Width, CalamityMod.AstralSurfaceFront.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); - Main.spriteBatch.Draw(CalamityMod.AstralSurfaceFrontGlow, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, CalamityMod.AstralSurfaceFrontGlow.Width, CalamityMod.AstralSurfaceFrontGlow.Height), new Color(Color.White.R * 0.9f, Color.White.G * 0.9f, Color.White.B * 0.9f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceFront, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceFront.Width, SkyTextureRefs.AstralSurfaceFront.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceFrontGlow, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceFrontGlow.Width, SkyTextureRefs.AstralSurfaceFrontGlow.Height), new Color(Color.White.R * 0.9f, Color.White.G * 0.9f, Color.White.B * 0.9f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); } } } diff --git a/CalamityMod.cs b/CalamityMod.cs index 38530a26c3..8c371bf009 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -89,33 +89,6 @@ namespace CalamityMod public static Asset carpetOriginal; - // Astral Sky/BG - public static Texture2D AstralSky; - public static Texture2D AstralSurfaceFront; - public static Texture2D AstralSurfaceFrontGlow; - public static Texture2D AstralSurfaceClose; - public static Texture2D AstralSurfaceCloseGlow; - public static Texture2D AstralSurfaceMiddle; - public static Texture2D AstralSurfaceMiddleGlow; - - // Astral Desert Sky/BG - public static Texture2D AstralDesertSurfaceClose; - public static Texture2D AstralDesertSurfaceMiddle; - - // Astral Snow Sky/BG - public static Texture2D AstralSnowSurfaceMiddle; - - // Sulphur Sea Sky/BG - public static Texture2D SulphurSeaSky; - public static Texture2D SulphurSeaSkyFront; - public static Texture2D SulphurSeaSurface; - - // Destroyer glowmasks - public static Asset[] DestroyerGlowmasks = new Asset[3]; - - // Probe glowmask - public static Asset ProbeGlowmask; - // Holds the Texture Arrays for all the lava textures. // These are used for the lava styles. They are seperate from Textureasset.Instance._liquidTexture as they will conflict with ModWaterStyle // Can hold up to 255 lava styles (more than enough) (excluding the normal lava texture which is liquidTexture 1) @@ -131,14 +104,6 @@ namespace CalamityMod public static float[] lavaAlpha = new float[1]; - // Wall of Flesh glowmasks - public static Asset WallOfFleshEyeGlowmask; - public static Asset WallOfFleshDemonSickleTexture; - - // Master Rev+ Skeletron Prime - public static Asset ChadPrime; - public static Asset ChadPrimeEyeGlowmask; - // Boss Kill Time data structure public static SortedDictionary bossKillTimes; @@ -287,50 +252,13 @@ namespace CalamityMod private void LoadClient() { - // Astral Sky/BG - AstralSky = ModContent.Request("CalamityMod/Skies/AstralSky", AssetRequestMode.ImmediateLoad).Value; - AstralSurfaceFront = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceFront", AssetRequestMode.ImmediateLoad).Value; - AstralSurfaceFrontGlow = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceFrontGlow", AssetRequestMode.ImmediateLoad).Value; - AstralSurfaceClose = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceClose", AssetRequestMode.ImmediateLoad).Value; - AstralSurfaceCloseGlow = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceCloseGlow", AssetRequestMode.ImmediateLoad).Value; - AstralSurfaceMiddle = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceMiddle", AssetRequestMode.ImmediateLoad).Value; - AstralSurfaceMiddleGlow = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceMiddleGlow", AssetRequestMode.ImmediateLoad).Value; - - //Astral Desert Sky/BG - AstralDesertSurfaceClose = ModContent.Request("CalamityMod/Backgrounds/AstralDesertSurfaceClose", AssetRequestMode.ImmediateLoad).Value; - AstralDesertSurfaceMiddle = ModContent.Request("CalamityMod/Backgrounds/AstralDesertSurfaceMiddle", AssetRequestMode.ImmediateLoad).Value; - - //Astral Snow Sky/BG - AstralSnowSurfaceMiddle = ModContent.Request("CalamityMod/Backgrounds/AstralSnowSurfaceMiddle", AssetRequestMode.ImmediateLoad).Value; - - // Sulpher Sea Sky/BG - SulphurSeaSky = ModContent.Request("CalamityMod/Skies/SulphurSeaSky", AssetRequestMode.ImmediateLoad).Value; - SulphurSeaSkyFront = ModContent.Request("CalamityMod/Skies/SulphurSeaSkyFront", AssetRequestMode.ImmediateLoad).Value; - SulphurSeaSurface = ModContent.Request("CalamityMod/Skies/SulphurSeaSurface", AssetRequestMode.ImmediateLoad).Value; - - // Destroyer glowmasks - DestroyerGlowmasks[0] = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerHeadGlow", AssetRequestMode.AsyncLoad); - DestroyerGlowmasks[1] = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerBodyGlow", AssetRequestMode.AsyncLoad); - DestroyerGlowmasks[2] = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerTailGlow", AssetRequestMode.AsyncLoad); - // Lava Texture LavaTextures.liquid[0] = LiquidRenderer.Instance._liquidTextures[1]; LavaTextures.slope[0] = TextureAssets.LiquidSlope[1]; LavaTextures.block[0] = TextureAssets.Liquid[1]; var waterfallTexture = (Asset[])typeof(WaterfallManager).GetField("waterfallTexture", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public).GetValue(Main.instance.waterfallManager); LavaTextures.fall[0] = waterfallTexture[1]; - - // Probe glowmask - ProbeGlowmask = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/ProbeGlow", AssetRequestMode.AsyncLoad); - - // Wall of Flesh glowmasks - WallOfFleshEyeGlowmask = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/WallOfFleshEyeTelegraphGlow", AssetRequestMode.AsyncLoad); - WallOfFleshDemonSickleTexture = ModContent.Request("CalamityMod/Projectiles/Melee/ForbiddenOathbladeProjectile", AssetRequestMode.AsyncLoad); - - // Master Rev+ Skeletron Prime textures - ChadPrime = ModContent.Request("CalamityMod/ExtraTextures/ChadPrime", AssetRequestMode.AsyncLoad); - ChadPrimeEyeGlowmask = ModContent.Request("CalamityMod/ExtraTextures/ChadPrimeHeadGlow", AssetRequestMode.AsyncLoad); - + CalamityShaders.LoadShaders(); // This must be done separately from immediate loading, as loading is now multithreaded. @@ -395,7 +323,6 @@ namespace CalamityMod varia = null; wikithis = null; - AstralSky = null; bossKillTimes?.Clear(); bossKillTimes = null; diff --git a/ExtraTextures/ExtraTextureRefs.cs b/ExtraTextures/ExtraTextureRefs.cs new file mode 100644 index 0000000000..f11a5c393d --- /dev/null +++ b/ExtraTextures/ExtraTextureRefs.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria.ModLoader; + +namespace CalamityMod.ExtraTextures +{ + [Autoload(Side = ModSide.Client)] + internal sealed class ExtraTextureRefs : ModSystem + { + // Destroyer glowmasks + public static Asset[] DestroyerGlowmasks = new Asset[3]; + public static Asset ProbeGlowmask; + + // Master Rev+ Skeletron Prime + public static Asset ChadPrime; + public static Asset ChadPrimeEyeGlowmask; + + // WoF, These are not "exactly" the ExtraTextures. But + public static Asset WallOfFleshEyeGlowmask; + public static Asset WallOfFleshDemonSickleTexture; + + public override void Load() + { + DestroyerGlowmasks[0] = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerHeadGlow", AssetRequestMode.AsyncLoad); + DestroyerGlowmasks[1] = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerBodyGlow", AssetRequestMode.AsyncLoad); + DestroyerGlowmasks[2] = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerTailGlow", AssetRequestMode.AsyncLoad); + + ProbeGlowmask = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/ProbeGlow", AssetRequestMode.AsyncLoad); + + ChadPrime = ModContent.Request("CalamityMod/ExtraTextures/ChadPrime", AssetRequestMode.AsyncLoad); + ChadPrimeEyeGlowmask = ModContent.Request("CalamityMod/ExtraTextures/ChadPrimeHeadGlow", AssetRequestMode.AsyncLoad); + + WallOfFleshEyeGlowmask = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/WallOfFleshEyeTelegraphGlow", AssetRequestMode.AsyncLoad); + WallOfFleshDemonSickleTexture = ModContent.Request("CalamityMod/Projectiles/Melee/ForbiddenOathbladeProjectile", AssetRequestMode.AsyncLoad); + } + + public override void Unload() + { + + } + } +} diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index ce5d318457..998057bee0 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -83,6 +83,9 @@ using Terraria.ModLoader.Utilities; using Terraria.UI.Chat; using Terraria.Utilities; using static Terraria.ModLoader.ModContent; +using CalamityMod.NPCs.SunkenSea; +using CalamityMod.Packets; +using CalamityMod.ExtraTextures; namespace CalamityMod.NPCs { @@ -7652,7 +7655,7 @@ namespace CalamityMod.NPCs } } - Texture2D glowTexture = CalamityClientConfig.Instance.NewVanillaTextures ? CalamityMod.DestroyerGlowmasks[0].Value : TextureAssets.Dest[0].Value; + Texture2D glowTexture = CalamityClientConfig.Instance.NewVanillaTextures ? ExtraTextureRefs.DestroyerGlowmasks[0].Value : TextureAssets.Dest[0].Value; switch (npc.type) { default: @@ -7660,11 +7663,11 @@ namespace CalamityMod.NPCs break; case NPCID.TheDestroyerBody: - glowTexture = CalamityClientConfig.Instance.NewVanillaTextures ? CalamityMod.DestroyerGlowmasks[1].Value : TextureAssets.Dest[1].Value; + glowTexture = CalamityClientConfig.Instance.NewVanillaTextures ? ExtraTextureRefs.DestroyerGlowmasks[1].Value : TextureAssets.Dest[1].Value; break; case NPCID.TheDestroyerTail: - glowTexture = CalamityClientConfig.Instance.NewVanillaTextures ? CalamityMod.DestroyerGlowmasks[2].Value : TextureAssets.Dest[2].Value; + glowTexture = CalamityClientConfig.Instance.NewVanillaTextures ? ExtraTextureRefs.DestroyerGlowmasks[2].Value : TextureAssets.Dest[2].Value; break; } @@ -7677,7 +7680,7 @@ namespace CalamityMod.NPCs else if (npc.type == NPCID.Probe && CalamityClientConfig.Instance.NewVanillaTextures) { float eyeTelegraphGateValue = (NPC.IsMechQueenUp ? DestroyerAI.ProbeLaserGateValue_Mechdusa : BossRushEvent.BossRushActive ? DestroyerAI.ProbeLaserGateValue_BossRush : revenge ? DestroyerAI.ProbeLaserGateValue_Rev : DestroyerAI.ProbeLaserGateValue) - DestroyerAI.ProbeLaserTelegraphTime; - Texture2D glowTexture = CalamityMod.ProbeGlowmask.Value; + Texture2D glowTexture = ExtraTextureRefs.ProbeGlowmask.Value; Vector2 halfSize = npc.frame.Size() / 2; SpriteEffects spriteEffects = SpriteEffects.None; if (npc.spriteDirection == -1) @@ -7988,7 +7991,7 @@ namespace CalamityMod.NPCs float eyeTelegraphGateValue = WallOfFleshAI.LaserShootGateValue - WallOfFleshAI.LaserShootTelegraphTime; if (npc.localAI[1] > eyeTelegraphGateValue || npc.localAI[2] > 0f || enraged) { - Texture2D glowTexture = CalamityClientConfig.Instance.NewVanillaTextures ? CalamityMod.WallOfFleshEyeGlowmask.Value : TextureAssets.Npc[npc.type].Value; + Texture2D glowTexture = CalamityClientConfig.Instance.NewVanillaTextures ? ExtraTextureRefs.WallOfFleshEyeGlowmask.Value : TextureAssets.Npc[npc.type].Value; Vector2 halfSize = npc.frame.Size() / 2; SpriteEffects spriteEffects = SpriteEffects.None; if (npc.spriteDirection == 1) @@ -8010,7 +8013,7 @@ namespace CalamityMod.NPCs // His afterimages I can't get to work, so fuck it else if (npc.type == NPCID.SkeletronPrime || npc.type == NPCType()) { - Texture2D npcTexture = (masterMode && revenge && npc.type == NPCID.SkeletronPrime) ? CalamityMod.ChadPrime.Value : TextureAssets.Npc[npc.type].Value; + Texture2D npcTexture = (masterMode && revenge && npc.type == NPCID.SkeletronPrime) ? ExtraTextureRefs.ChadPrime.Value : TextureAssets.Npc[npc.type].Value; int frameHeight = npcTexture.Height / Main.npcFrameCount[npc.type]; npc.frame.Y = (int)newAI[3]; @@ -8077,7 +8080,7 @@ namespace CalamityMod.NPCs { int alpha = 192; eyesColor = npc.type == NPCType() ? new Color(150, 100, 255, alpha) : new Color(255, 255, 0, alpha); - Texture2D glowTexture = npc.type == NPCID.SkeletronPrime ? CalamityMod.ChadPrimeEyeGlowmask.Value : SkeletronPrime2.EyeTexture.Value; + Texture2D glowTexture = npc.type == NPCID.SkeletronPrime ? ExtraTextureRefs.ChadPrimeEyeGlowmask.Value : SkeletronPrime2.EyeTexture.Value; spriteBatch.Draw(glowTexture, npc.Center - screenPos + new Vector2(0, npc.gfxOffY), npc.frame, eyesColor, npc.rotation, npc.frame.Size() / 2, npc.scale, spriteEffects, 0f); } else diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 30ed8405b5..d2d63771fe 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -8,6 +8,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Dusts; using CalamityMod.EntitySources; using CalamityMod.Events; +using CalamityMod.ExtraTextures; using CalamityMod.Items.Accessories; using CalamityMod.Items.Potions.Alcohol; using CalamityMod.NPCs; @@ -4570,7 +4571,7 @@ namespace CalamityMod.Projectiles if (Main.wofNPCIndex < 0 || !Main.npc[Main.wofNPCIndex].active || Main.npc[Main.wofNPCIndex].life <= 0 || projectile.tileCollide) return true; - Texture2D texture = CalamityMod.WallOfFleshDemonSickleTexture.Value; + Texture2D texture = ExtraTextureRefs.WallOfFleshDemonSickleTexture.Value; int frameHeight = texture.Height / Main.projFrames[projectile.type]; int frameY = frameHeight * projectile.frame; Rectangle rectangle = new Rectangle(0, frameY, texture.Width, frameHeight); diff --git a/Skies/AstralMonolithSky.cs b/Skies/AstralMonolithSky.cs index 11135236e0..4b94ddb22d 100644 --- a/Skies/AstralMonolithSky.cs +++ b/Skies/AstralMonolithSky.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Skies float whateverTheFuckThisVariableIsSupposedToBe = 3.40282347E+38f; if (maxDepth >= whateverTheFuckThisVariableIsSupposedToBe && minDepth < whateverTheFuckThisVariableIsSupposedToBe) { - spriteBatch.Draw(CalamityMod.AstralSky, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.White * opacity); + spriteBatch.Draw(SkyTextureRefs.AstralSky, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.White * opacity); // Terraria's conditions. if (Main.netMode != NetmodeID.Server) diff --git a/Skies/AstralSky.cs b/Skies/AstralSky.cs index 7290303387..e2a14e830a 100644 --- a/Skies/AstralSky.cs +++ b/Skies/AstralSky.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Skies float whateverTheFuckThisVariableIsSupposedToBe = 3.40282347E+38f; if (maxDepth >= whateverTheFuckThisVariableIsSupposedToBe && minDepth < whateverTheFuckThisVariableIsSupposedToBe) { - spriteBatch.Draw(CalamityMod.AstralSky, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.White * opacity); + spriteBatch.Draw(SkyTextureRefs.AstralSky, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.White * opacity); // Terraria's conditions. if (Main.netMode != NetmodeID.Server) diff --git a/Skies/SkyTextureRefs.cs b/Skies/SkyTextureRefs.cs new file mode 100644 index 0000000000..f5f99bf456 --- /dev/null +++ b/Skies/SkyTextureRefs.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria.ModLoader; + +namespace CalamityMod.Skies +{ + [Autoload(Side = ModSide.Client)] + internal sealed class SkyTextureRefs : ModSystem + { + // Astral Sky/BG + public static Texture2D AstralSky; + public static Texture2D AstralSurfaceFront; + public static Texture2D AstralSurfaceFrontGlow; + public static Texture2D AstralSurfaceClose; + public static Texture2D AstralSurfaceCloseGlow; + public static Texture2D AstralSurfaceMiddle; + public static Texture2D AstralSurfaceMiddleGlow; + + // Astral Desert Sky/BG + public static Texture2D AstralDesertSurfaceClose; + public static Texture2D AstralDesertSurfaceMiddle; + + // Astral Snow Sky/BG + public static Texture2D AstralSnowSurfaceMiddle; + + // Sulphur Sea Sky/BG + public static Texture2D SulphurSeaSky; + public static Texture2D SulphurSeaSkyFront; + public static Texture2D SulphurSeaSurface; + + public override void Load() + { + // Astral Sky/BG + AstralSky = ModContent.Request("CalamityMod/Skies/AstralSky", AssetRequestMode.ImmediateLoad).Value; + AstralSurfaceFront = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceFront", AssetRequestMode.ImmediateLoad).Value; + AstralSurfaceFrontGlow = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceFrontGlow", AssetRequestMode.ImmediateLoad).Value; + AstralSurfaceClose = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceClose", AssetRequestMode.ImmediateLoad).Value; + AstralSurfaceCloseGlow = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceCloseGlow", AssetRequestMode.ImmediateLoad).Value; + AstralSurfaceMiddle = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceMiddle", AssetRequestMode.ImmediateLoad).Value; + AstralSurfaceMiddleGlow = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceMiddleGlow", AssetRequestMode.ImmediateLoad).Value; + + //Astral Desert Sky/BG + AstralDesertSurfaceClose = ModContent.Request("CalamityMod/Backgrounds/AstralDesertSurfaceClose", AssetRequestMode.ImmediateLoad).Value; + AstralDesertSurfaceMiddle = ModContent.Request("CalamityMod/Backgrounds/AstralDesertSurfaceMiddle", AssetRequestMode.ImmediateLoad).Value; + + //Astral Snow Sky/BG + AstralSnowSurfaceMiddle = ModContent.Request("CalamityMod/Backgrounds/AstralSnowSurfaceMiddle", AssetRequestMode.ImmediateLoad).Value; + + // Sulpher Sea Sky/BG + SulphurSeaSky = ModContent.Request("CalamityMod/Skies/SulphurSeaSky", AssetRequestMode.ImmediateLoad).Value; + SulphurSeaSkyFront = ModContent.Request("CalamityMod/Skies/SulphurSeaSkyFront", AssetRequestMode.ImmediateLoad).Value; + SulphurSeaSurface = ModContent.Request("CalamityMod/Skies/SulphurSeaSurface", AssetRequestMode.ImmediateLoad).Value; + } + + public override void Unload() + { + AstralSky = null; + AstralSurfaceFront = null; + AstralSurfaceFrontGlow = null; + AstralSurfaceClose = null; + AstralSurfaceCloseGlow = null; + AstralSurfaceMiddle = null; + AstralSurfaceMiddleGlow = null; + + AstralDesertSurfaceClose = null; + AstralDesertSurfaceMiddle = null; + + AstralSnowSurfaceMiddle = null; + + SulphurSeaSky = null; + SulphurSeaSkyFront = null; + SulphurSeaSurface = null; + } + } +} diff --git a/Skies/SulphurSeaSky.cs b/Skies/SulphurSeaSky.cs index bd8c4f1233..b639a28362 100644 --- a/Skies/SulphurSeaSky.cs +++ b/Skies/SulphurSeaSky.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Skies public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth) { if (maxDepth >= 4f && minDepth < 4f) - spriteBatch.Draw(CalamityMod.SulphurSeaSky, new Rectangle(0, (int)(-Main.screenPosition.Y / 6f) + 1300, Main.screenWidth, Main.screenHeight), Color.Lerp(Main.ColorOfTheSkies, Color.LightSeaGreen, 0.33f) * 0.2f * opacity); + spriteBatch.Draw(SkyTextureRefs.SulphurSeaSky, new Rectangle(0, (int)(-Main.screenPosition.Y / 6f) + 1300, Main.screenWidth, Main.screenHeight), Color.Lerp(Main.ColorOfTheSkies, Color.LightSeaGreen, 0.33f) * 0.2f * opacity); // Small worlds, default draw height int sulphurSeaHeight = (World.SulphurousSea.YStart + (int)Main.worldSurface) / 2; @@ -58,7 +58,7 @@ namespace CalamityMod.Skies // This changes the speed of the parralax, the closer the layer to the player the faster it should be. if (maxDepth >= 1f && minDepth < 1f) { - Texture2D texture = CalamityMod.SulphurSeaSkyFront; + Texture2D texture = SkyTextureRefs.SulphurSeaSkyFront; // Keep in mind that y paralex should always be half of x's or it will feel odd compared to how terraria does it. // Keep in mind when you change screen parralax it affects the y offset for the bg in the world. @@ -84,7 +84,7 @@ namespace CalamityMod.Skies if (maxDepth >= 3f && minDepth < 3f) { - Texture2D texture = CalamityMod.SulphurSeaSurface; + Texture2D texture = SkyTextureRefs.SulphurSeaSurface; int x = (int)(Main.screenPosition.X * ScreenParralaxMultiplier); x %= (int)(texture.Width * Scale); From fece37b80840eb7248afa7da58c5dc8e6aa37458 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Mon, 16 Sep 2024 20:17:06 +0900 Subject: [PATCH 073/133] Added GraveyardBiomeSystem --- Systems/Mechanic/GraveyardBiomeSystem.cs | 31 ++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Systems/Mechanic/GraveyardBiomeSystem.cs diff --git a/Systems/Mechanic/GraveyardBiomeSystem.cs b/Systems/Mechanic/GraveyardBiomeSystem.cs new file mode 100644 index 0000000000..39fffc0b75 --- /dev/null +++ b/Systems/Mechanic/GraveyardBiomeSystem.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + internal sealed class GraveyardBiomeSystem : ModSystem + { + // For now it literally adjust the graveyard count required for GraveyardBiome + // But we can add something later on /shrug + + public override void Load() + { + // Make Graveyard biomes require more Gravestones + SceneMetrics.GraveyardTileMax = 60; + SceneMetrics.GraveyardTileMin = 40; + SceneMetrics.GraveyardTileThreshold = 52; + } + + public override void Unload() + { + SceneMetrics.GraveyardTileMax = 36; + SceneMetrics.GraveyardTileMin = 16; + SceneMetrics.GraveyardTileThreshold = 28; + } + } +} From 8e636d7cf869ccbaee23ab3b6f5cd62767a391e1 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Mon, 16 Sep 2024 20:17:17 +0900 Subject: [PATCH 074/133] Changed CalamityList into ModSystem --- CalamityLists.cs | 7 +++---- CalamityMod.cs | 13 ------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/CalamityLists.cs b/CalamityLists.cs index 95095a5a6a..575e58a6a1 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -77,8 +77,7 @@ using static Terraria.ModLoader.ModContent; namespace CalamityMod { - // TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks. - public class CalamityLists + public sealed class CalamityLists : ModSystem { public static IList donatorList; public static List projectileDestroyExceptionList; @@ -158,7 +157,7 @@ namespace CalamityMod public static List VeneratedLocketBanlist; //To ban projectiles from locket, mainly spikeballs altho Toasty asked me to add mod calls for adding stuff like Dreamtastic - public static void LoadLists() + public override void Load() { donatorList = new List() { @@ -2716,7 +2715,7 @@ namespace CalamityMod }; } - public static void UnloadLists() + public override void Unload() { donatorList = null; projectileDestroyExceptionList = null; diff --git a/CalamityMod.cs b/CalamityMod.cs index 8c371bf009..c7fe32a264 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -208,18 +208,10 @@ namespace CalamityMod // Initialize the EnemyStats struct as early as it is safe to do so NPCStats.Load(); - // Initialize Calamity Lists so they may be used elsewhere immediately - CalamityLists.LoadLists(); - // Initialize Calamity Balance, since it is tightly coupled with the remaining lists CalamityGlobalItem.LoadTweaks(); CalamityGlobalProjectile.LoadTweaks(); - // Make Graveyard biomes require more Gravestones - SceneMetrics.GraveyardTileMax = 60; - SceneMetrics.GraveyardTileMin = 40; - SceneMetrics.GraveyardTileThreshold = 52; - if (!Main.dedServ) { LoadClient(); @@ -330,7 +322,6 @@ namespace CalamityMod Attunement.Unload(); EnchantmentManager.UnloadAllEnchantments(); VanillaArmorChangeManager.Unload(); - CalamityLists.UnloadLists(); NPCStats.Unload(); CalamityGlobalItem.UnloadTweaks(); CalamityGlobalProjectile.UnloadTweaks(); @@ -358,10 +349,6 @@ namespace CalamityMod GeneralParticleHandler.Unload(); } - SceneMetrics.GraveyardTileMax = 36; - SceneMetrics.GraveyardTileMin = 16; - SceneMetrics.GraveyardTileThreshold = 28; - carpetOriginal = null; Instance = null; From d968373aaad5afa4098acb93ad5b6218749b65a0 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Mon, 16 Sep 2024 20:19:46 +0900 Subject: [PATCH 075/133] Changed CalamityShaders into ModSystem --- CalamityMod.cs | 2 -- Effects/CalamityShaders.cs | 60 ++++++++++++++++++++------------------ 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/CalamityMod.cs b/CalamityMod.cs index c7fe32a264..12aa77b445 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -250,8 +250,6 @@ namespace CalamityMod LavaTextures.block[0] = TextureAssets.Liquid[1]; var waterfallTexture = (Asset[])typeof(WaterfallManager).GetField("waterfallTexture", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public).GetValue(Main.instance.waterfallManager); LavaTextures.fall[0] = waterfallTexture[1]; - - CalamityShaders.LoadShaders(); // This must be done separately from immediate loading, as loading is now multithreaded. // However, render targets and certain other graphical objects can only be created on the main thread. diff --git a/Effects/CalamityShaders.cs b/Effects/CalamityShaders.cs index a8976ede23..aef889b2ac 100644 --- a/Effects/CalamityShaders.cs +++ b/Effects/CalamityShaders.cs @@ -4,11 +4,13 @@ using ReLogic.Content; using Terraria; using Terraria.Graphics.Effects; using Terraria.Graphics.Shaders; +using Terraria.ModLoader; namespace CalamityMod.Effects { // TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks. - public class CalamityShaders + [Autoload(Side = ModSide.Client)] + public sealed class CalamityShaders : ModSystem { private const string ShaderPath = "Effects/"; internal const string CalamityShaderPrefix = "CalamityMod:"; @@ -204,34 +206,7 @@ namespace CalamityMod.Effects internal static Effect TeslaTrailShader; #endregion - // Shorthand to register a loaded shader in Terraria's graphics engine - // All shaders registered this way are accessible under GameShaders.Misc - // They will use the prefix described above - private static void RegisterMiscShader(Effect shader, string passName, string registrationName) - { - Ref shaderPointer = new(shader); - MiscShaderData passParamRegistration = new(shaderPointer, passName); - GameShaders.Misc[$"{CalamityShaderPrefix}{registrationName}"] = passParamRegistration; - } - - private static void RegisterSceneFilter(ScreenShaderData passReg, string registrationName, EffectPriority priority = EffectPriority.High) - { - string prefixedRegistrationName = $"{CalamityShaderPrefix}{registrationName}"; - Filters.Scene[prefixedRegistrationName] = new Filter(passReg, priority); - Filters.Scene[prefixedRegistrationName].Load(); - } - - // Shorthand to register a loaded shader in Terraria's graphics engine - // All shaders registered this way are accessible under Filters.Scene - // They will use the prefix described above - private static void RegisterScreenShader(Effect shader, string passName, string registrationName, EffectPriority priority = EffectPriority.High) - { - Ref shaderPointer = new(shader); - ScreenShaderData passParamRegistration = new(shaderPointer, passName); - RegisterSceneFilter(passParamRegistration, registrationName, priority); - } - - public static void LoadShaders() + public override void Load() { if (Main.dedServ) return; @@ -437,5 +412,32 @@ namespace CalamityMod.Effects RegisterMiscShader(TeslaTrailShader, "TrailPass", "TeslaTrail"); #endregion } + + // Shorthand to register a loaded shader in Terraria's graphics engine + // All shaders registered this way are accessible under GameShaders.Misc + // They will use the prefix described above + private static void RegisterMiscShader(Effect shader, string passName, string registrationName) + { + Ref shaderPointer = new(shader); + MiscShaderData passParamRegistration = new(shaderPointer, passName); + GameShaders.Misc[$"{CalamityShaderPrefix}{registrationName}"] = passParamRegistration; + } + + private static void RegisterSceneFilter(ScreenShaderData passReg, string registrationName, EffectPriority priority = EffectPriority.High) + { + string prefixedRegistrationName = $"{CalamityShaderPrefix}{registrationName}"; + Filters.Scene[prefixedRegistrationName] = new Filter(passReg, priority); + Filters.Scene[prefixedRegistrationName].Load(); + } + + // Shorthand to register a loaded shader in Terraria's graphics engine + // All shaders registered this way are accessible under Filters.Scene + // They will use the prefix described above + private static void RegisterScreenShader(Effect shader, string passName, string registrationName, EffectPriority priority = EffectPriority.High) + { + Ref shaderPointer = new(shader); + ScreenShaderData passParamRegistration = new(shaderPointer, passName); + RegisterSceneFilter(passParamRegistration, registrationName, priority); + } } } From b8ca89dd58b193597d857775546de9c9ffb09863 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Mon, 16 Sep 2024 20:43:17 +0900 Subject: [PATCH 076/133] Changed External Mod Loading into ExternalMods ModSystem --- Buffs/Mounts/AndromedaBuff.cs | 2 +- CalPlayer/CalamityPlayer.cs | 2 +- CalPlayer/CalamityPlayerMiscEffects.cs | 4 +- CalamityMod.cs | 102 +---------------- Events/BossRushEvent.cs | 2 +- ILEditing/ILChangesLoading.cs | 2 +- ILEditing/MechanicILChanges.cs | 4 +- Items/CalamityGlobalItemTweaks.cs | 2 +- Items/Fishing/GlimmeringGemfish.cs | 2 +- Items/Fishing/StuffedFish.cs | 2 +- Items/TreasureBags/MiscGrabBags/StarterBag.cs | 2 +- ModSupport/ExternalMods.cs | 108 ++++++++++++++++++ ModSupport/WeakReferenceSupport.cs | 31 ++--- NPCs/TownNPCs/FAP.cs | 2 +- .../WorldSelectionDifficultySystem.cs | 2 +- Utilities/WorldgenUtils.cs | 2 +- World/AstralBiome.cs | 4 +- World/DraedonStructures.cs | 2 +- World/Planets/Planetoid.cs | 2 +- 19 files changed, 145 insertions(+), 134 deletions(-) create mode 100644 ModSupport/ExternalMods.cs diff --git a/Buffs/Mounts/AndromedaBuff.cs b/Buffs/Mounts/AndromedaBuff.cs index e352ea4940..34b4fb6ce9 100644 --- a/Buffs/Mounts/AndromedaBuff.cs +++ b/Buffs/Mounts/AndromedaBuff.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Buffs.Mounts public override void Update(Player player, ref int buffIndex) { // Disables crouching with the Crouch, Crawl, and Roll Mod - Mod crouchMod = CalamityMod.Instance.crouchMod; + Mod crouchMod = ExternalMods.crouchMod; if (crouchMod != null) { // Mod Call inputs diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index ff3a3e3c14..3545ef2d27 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -5001,7 +5001,7 @@ namespace CalamityMod.CalPlayer CalamityMod.SpeedrunTimer.Restart(); bool showWikiMessage = CalamityClientConfig.Instance.WikiStatusMessage; - bool showVCMMMessage = CalamityClientConfig.Instance.VCMMStatusMessage && !CalamityMod.Instance.VCMMAvailable; + bool showVCMMMessage = CalamityClientConfig.Instance.VCMMStatusMessage && !ExternalMods.VCMMAvailable; bool showStartupMessages = showWikiMessage || showVCMMMessage; // Set a random delay between 12 and 20 seconds. When this delay hits zero, startup messages display diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 858759d482..5bb0b081e5 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -2866,7 +2866,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 && CalamityServerConfig.Instance.FasterBaseSpeed) + if (ExternalMods.overhaul is null && CalamityServerConfig.Instance.FasterBaseSpeed) Player.moveSpeed += BalancingConstants.DefaultMoveSpeedBoost; // Reduce how slow Chilled makes the player, because it's cancerous right now @@ -4319,7 +4319,7 @@ namespace CalamityMod.CalPlayer CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Misc.WikiStatus2"); } - if (CalamityClientConfig.Instance.VCMMStatusMessage && !CalamityMod.Instance.VCMMAvailable) + if (CalamityClientConfig.Instance.VCMMStatusMessage && !ExternalMods.VCMMAvailable) { CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Misc.VCMMStatus"); } diff --git a/CalamityMod.cs b/CalamityMod.cs index 12aa77b445..22560e9c82 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -124,39 +124,6 @@ namespace CalamityMod internal static CalamityMod Instance; - // TODO -- Mod references should be contained in a ModSystem (example name "ModLoadedChecker") - - // This is Calamity's official music mod, CalamityModMusic. It is now a hard dependency. - internal Mod musicMod = null; - internal bool MusicAvailable => musicMod is not null; - - // This is Vanilla Calamity Mod Music, internally named UnCalamityModMusic. - // VCMM is an official music add-on. Unlike the main music mod, it is not a dependency. - internal Mod vcmm = null; - internal bool VCMMAvailable => vcmm is not null; - - // Please keep this in alphabetical order so it's easy to read - internal Mod ancientsAwakened = null; - internal Mod biomeLava = null; - internal Mod bossChecklist = null; - internal Mod coloredDamageTypes = null; - internal Mod crouchMod = null; - internal Mod dialogueTweak = null; - internal Mod fargos = null; - internal Mod luminance = null; - internal Mod magicStorage = null; - internal Mod overhaul = null; - internal Mod redemption = null; - internal Mod soa = null; - internal Mod subworldLibrary = null; - internal Mod summonersAssociation = null; - internal Mod thorium = null; - internal Mod varia = null; - internal Mod wikithis = null; - - //hell background - //private List loadCache; - #region Load public override void Load() { @@ -164,47 +131,6 @@ namespace CalamityMod carpetOriginal = TextureAssets.FlyingCarpet; - // If any of these mods aren't loaded, it will simply keep them as null. - musicMod = null; - ModLoader.TryGetMod("CalamityModMusic", out musicMod); - vcmm = null; - ModLoader.TryGetMod("UnCalamityModMusic", out vcmm); - - ancientsAwakened = null; - ModLoader.TryGetMod("AAMod", out ancientsAwakened); - biomeLava = null; - ModLoader.TryGetMod("BiomeLava", out biomeLava); - bossChecklist = null; - ModLoader.TryGetMod("BossChecklist", out bossChecklist); - coloredDamageTypes = null; - ModLoader.TryGetMod("ColoredDamageTypes", out coloredDamageTypes); - crouchMod = null; - ModLoader.TryGetMod("CrouchMod", out crouchMod); - dialogueTweak = null; - ModLoader.TryGetMod("DialogueTweak", out dialogueTweak); - fargos = null; - ModLoader.TryGetMod("Fargowiltas", out fargos); - luminance = null; - ModLoader.TryGetMod("Luminance", out luminance); - magicStorage = null; - ModLoader.TryGetMod("MagicStorage", out magicStorage); - overhaul = null; - ModLoader.TryGetMod("TerrariaOverhaul", out overhaul); - redemption = null; - ModLoader.TryGetMod("Redemption", out redemption); - soa = null; - ModLoader.TryGetMod("SacredTools", out soa); - subworldLibrary = null; - ModLoader.TryGetMod("SubworldLibrary", out subworldLibrary); - summonersAssociation = null; - ModLoader.TryGetMod("SummonersAssociation", out summonersAssociation); - thorium = null; - ModLoader.TryGetMod("ThoriumMod", out thorium); - varia = null; - ModLoader.TryGetMod("Varia", out varia); - wikithis = null; - ModLoader.TryGetMod("Wikithis", out wikithis); - // Initialize the EnemyStats struct as early as it is safe to do so NPCStats.Load(); @@ -234,7 +160,6 @@ namespace CalamityMod //lava LavaRendering.instance = new LavaRendering(); - WeakReferenceSupport.LavaStytleToBiomeLava(); Attunement.Load(); BalancingChangesManager.Load(); @@ -292,27 +217,6 @@ namespace CalamityMod #region Unload public override void Unload() { - musicMod = null; - vcmm = null; - - ancientsAwakened = null; - biomeLava = null; - bossChecklist = null; - coloredDamageTypes = null; - crouchMod = null; - dialogueTweak = null; - fargos = null; - luminance = null; - magicStorage = null; - overhaul = null; - redemption = null; - soa = null; - subworldLibrary = null; - summonersAssociation = null; - thorium = null; - varia = null; - wikithis = null; - bossKillTimes?.Clear(); bossKillTimes = null; @@ -486,17 +390,15 @@ namespace CalamityMod #region Music // This function returns an available Calamity Music Mod track, or null if the Calamity Music Mod is not available. - public int? GetMusicFromMusicMod(string songFilename) => MusicAvailable ? MusicLoader.GetMusicSlot(musicMod, "Sounds/Music/" + songFilename) : null; + public int? GetMusicFromMusicMod(string songFilename) => ExternalMods.MusicAvailable ? MusicLoader.GetMusicSlot(ExternalMods.musicMod, "Sounds/Music/" + songFilename) : null; // This function returns an available VCMM track, or null if VCMM is not available. // Unlike the main Music Mod, VCMM is hierarchical. - public int? GetMusicFromVCMM(string songPath) => VCMMAvailable ? MusicLoader.GetMusicSlot(vcmm, "Assets/" + songPath) : null; + public int? GetMusicFromVCMM(string songPath) => ExternalMods.VCMMAvailable ? MusicLoader.GetMusicSlot(ExternalMods.vcmm, "Assets/" + songPath) : null; #endregion #region Mod Support - public override void PostSetupContent() => WeakReferenceSupport.Setup(); - public override object Call(params object[] args) => ModCalls.Call(args); #endregion diff --git a/Events/BossRushEvent.cs b/Events/BossRushEvent.cs index db51f2cc3a..832fb0c1bc 100644 --- a/Events/BossRushEvent.cs +++ b/Events/BossRushEvent.cs @@ -489,7 +489,7 @@ namespace CalamityMod.Events return -1; } int tier = CurrentTier; - if (CalamityMod.Instance.MusicAvailable) + if (ExternalMods.MusicAvailable) { // Boss Rush music for tier 5 doesn't exist if (tier > 4) diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index 7e68c85e65..ed937d04e1 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -91,7 +91,7 @@ namespace CalamityMod.ILEditing IL_Player.ApplyLifeAndOrMana += ManaSicknessAndChaliceBufferHeal; //LavaStyles - if (CalamityMod.Instance.biomeLava == null) + if (ExternalMods.biomeLava == null) { //Rendering/Drawing IL_Main.DoDraw += DoDrawLavas; diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index a216c92684..1b5c6c7e4a 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -1246,7 +1246,7 @@ namespace CalamityMod.ILEditing lightColor.Y = Math.Max(lightColor.Y, G); lightColor.Z = Math.Max(lightColor.Z, B); } - else if (tile.LiquidType == LiquidID.Lava && CalamityMod.Instance.biomeLava == null) + else if (tile.LiquidType == LiquidID.Lava && ExternalMods.biomeLava == null) { Vector3 lavaLight = new Vector3(0.55f, 0.33f, 0.11f); @@ -1332,7 +1332,7 @@ namespace CalamityMod.ILEditing { CalamityWaterLoader.DrawColorSetup(x, y, Main.waterStyle, ref initialColor); } - else if (liquidType == LiquidID.Lava && CalamityMod.Instance.biomeLava == null) + else if (liquidType == LiquidID.Lava && ExternalMods.biomeLava == null) { LavaStylesLoader.DrawColorSetup(x, y, CalamityMod.LavaStyle, ref initialColor); } diff --git a/Items/CalamityGlobalItemTweaks.cs b/Items/CalamityGlobalItemTweaks.cs index 52bf492742..bf06608b99 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items public partial class CalamityGlobalItem : GlobalItem { // 02AUG2023: Ozzatron: Having Overhaul enabled turns off all scaling changes, per direct request from Mirsario on 8/2/23. - private static bool DisableScalingForOverhaul => CalamityMod.Instance.overhaul is not null; + private static bool DisableScalingForOverhaul => ExternalMods.overhaul is not null; #region Database and Initialization internal static SortedDictionary currentTweaks = null; diff --git a/Items/Fishing/GlimmeringGemfish.cs b/Items/Fishing/GlimmeringGemfish.cs index d27cbb552c..9f0e775bf1 100644 --- a/Items/Fishing/GlimmeringGemfish.cs +++ b/Items/Fishing/GlimmeringGemfish.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Fishing itemLoot.Add(ItemID.Amber, 8, gemMin, gemMax); // Add Thorium gems if Thorium is loaded. - Mod thorium = CalamityMod.Instance.thorium; + Mod thorium = ExternalMods.thorium; if (thorium is null) return; diff --git a/Items/Fishing/StuffedFish.cs b/Items/Fishing/StuffedFish.cs index 477c139969..de2ab4cb5e 100644 --- a/Items/Fishing/StuffedFish.cs +++ b/Items/Fishing/StuffedFish.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Items.Fishing itemLoot.AddIf(() => Main.hardMode, ItemID.HallowedSeeds, 20, seedMin, seedMax); // Add Thorium Marine Kelp if Thorium is loaded. - Mod thorium = CalamityMod.Instance.thorium; + Mod thorium = ExternalMods.thorium; if (thorium is null) return; diff --git a/Items/TreasureBags/MiscGrabBags/StarterBag.cs b/Items/TreasureBags/MiscGrabBags/StarterBag.cs index 2972a10c58..dc3ff0f33f 100644 --- a/Items/TreasureBags/MiscGrabBags/StarterBag.cs +++ b/Items/TreasureBags/MiscGrabBags/StarterBag.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Items.TreasureBags.MiscGrabBags itemLoot.Add(ItemID.Chest, 1, 3, 3); // Calamity title theme music box (if music mod is enabled) - Mod musicMod = CalamityMod.Instance.musicMod; + Mod musicMod = ExternalMods.musicMod; if (musicMod is not null) itemLoot.Add(musicMod.Find("CalamityMusicbox").Type); diff --git a/ModSupport/ExternalMods.cs b/ModSupport/ExternalMods.cs new file mode 100644 index 0000000000..7518e201c1 --- /dev/null +++ b/ModSupport/ExternalMods.cs @@ -0,0 +1,108 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod +{ + public sealed class ExternalMods : ModSystem + { + // This is Calamity's official music mod, CalamityModMusic. It is now a hard dependency. + internal static Mod musicMod = null; + internal static bool MusicAvailable => musicMod is not null; + + // This is Vanilla Calamity Mod Music, internally named UnCalamityModMusic. + // VCMM is an official music add-on. Unlike the main music mod, it is not a dependency. + internal static Mod vcmm = null; + internal static bool VCMMAvailable => vcmm is not null; + + // Please keep this in alphabetical order so it's easy to read + internal static Mod ancientsAwakened = null; + internal static Mod biomeLava = null; + internal static Mod bossChecklist = null; + internal static Mod coloredDamageTypes = null; + internal static Mod crouchMod = null; + internal static Mod dialogueTweak = null; + internal static Mod fargos = null; + internal static Mod luminance = null; + internal static Mod magicStorage = null; + internal static Mod overhaul = null; + internal static Mod redemption = null; + internal static Mod soa = null; + internal static Mod subworldLibrary = null; + internal static Mod summonersAssociation = null; + internal static Mod thorium = null; + internal static Mod varia = null; + internal static Mod wikithis = null; + + public override void Load() + { + musicMod = null; + ModLoader.TryGetMod("CalamityModMusic", out musicMod); + vcmm = null; + ModLoader.TryGetMod("UnCalamityModMusic", out vcmm); + + ancientsAwakened = null; + ModLoader.TryGetMod("AAMod", out ancientsAwakened); + biomeLava = null; + ModLoader.TryGetMod("BiomeLava", out biomeLava); + bossChecklist = null; + ModLoader.TryGetMod("BossChecklist", out bossChecklist); + coloredDamageTypes = null; + ModLoader.TryGetMod("ColoredDamageTypes", out coloredDamageTypes); + crouchMod = null; + ModLoader.TryGetMod("CrouchMod", out crouchMod); + dialogueTweak = null; + ModLoader.TryGetMod("DialogueTweak", out dialogueTweak); + fargos = null; + ModLoader.TryGetMod("Fargowiltas", out fargos); + luminance = null; + ModLoader.TryGetMod("Luminance", out luminance); + magicStorage = null; + ModLoader.TryGetMod("MagicStorage", out magicStorage); + overhaul = null; + ModLoader.TryGetMod("TerrariaOverhaul", out overhaul); + redemption = null; + ModLoader.TryGetMod("Redemption", out redemption); + soa = null; + ModLoader.TryGetMod("SacredTools", out soa); + subworldLibrary = null; + ModLoader.TryGetMod("SubworldLibrary", out subworldLibrary); + summonersAssociation = null; + ModLoader.TryGetMod("SummonersAssociation", out summonersAssociation); + thorium = null; + ModLoader.TryGetMod("ThoriumMod", out thorium); + varia = null; + ModLoader.TryGetMod("Varia", out varia); + wikithis = null; + ModLoader.TryGetMod("Wikithis", out wikithis); + } + + public override void Unload() + { + musicMod = null; + vcmm = null; + + ancientsAwakened = null; + biomeLava = null; + bossChecklist = null; + coloredDamageTypes = null; + crouchMod = null; + dialogueTweak = null; + fargos = null; + luminance = null; + magicStorage = null; + overhaul = null; + redemption = null; + soa = null; + subworldLibrary = null; + summonersAssociation = null; + thorium = null; + varia = null; + wikithis = null; + } + } +} diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 09ef96dcb9..0cec821f71 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -118,7 +118,7 @@ namespace CalamityMod public static readonly Func DownedBossRush = () => DownedBossSystem.downedBossRush; } - internal class WeakReferenceSupport + internal class WeakReferenceSupport : ModSystem { public const string CalamityWikiURLOld = "calamitymod.wiki.gg"; public const string CalamityWikiURL = "https://calamitymod.wiki.gg/wiki/{}"; @@ -188,8 +188,9 @@ namespace CalamityMod // { "Xeroc", 26f }, }; - public static void Setup() + public override void PostSetupContent() { + LavaStyleToBiomeLava(); BossChecklistSupport(); FargosSupport(); DialogueTweakSupport(); @@ -206,10 +207,10 @@ namespace CalamityMod } #region BiomeLava - public static void LavaStytleToBiomeLava() + public static void LavaStyleToBiomeLava() { CalamityMod calamity = GetInstance(); - Mod biomelava = calamity.biomeLava; + Mod biomelava = ExternalMods.biomeLava; if (biomelava == null) return; @@ -262,7 +263,7 @@ namespace CalamityMod return; CalamityMod calamity = GetInstance(); - Mod wiki = calamity.wikithis; + Mod wiki = ExternalMods.wikithis; if (wiki is null) return; @@ -350,15 +351,15 @@ namespace CalamityMod // Wrapper function to detect if a subworld is in use for Subworld Library. internal static bool InAnySubworld() { - if (CalamityMod.Instance.subworldLibrary is null) + if (ExternalMods.subworldLibrary is null) return false; foreach (Mod mod in ModLoader.Mods) { - if (mod.Name.Equals(CalamityMod.Instance.subworldLibrary.Name)) + if (mod.Name.Equals(ExternalMods.subworldLibrary.Name)) continue; - bool anySubworldForMod = (CalamityMod.Instance.subworldLibrary.Call("AnyActive", mod) as bool?) ?? false; + bool anySubworldForMod = (ExternalMods.subworldLibrary.Call("AnyActive", mod) as bool?) ?? false; if (anySubworldForMod) return true; } @@ -386,8 +387,8 @@ namespace CalamityMod private static void BossChecklistSupport() { - CalamityMod calamity = GetInstance(); - Mod bossChecklist = calamity.bossChecklist; + CalamityMod calamity = CalamityMod.Instance; + Mod bossChecklist = ExternalMods.bossChecklist; if (bossChecklist is null) return; @@ -1111,7 +1112,7 @@ namespace CalamityMod #region Fargo's Mutant Mod private static void FargosSupport() { - Mod fargos = GetInstance().fargos; + Mod fargos = ExternalMods.fargos; if (fargos is null) return; @@ -1141,7 +1142,7 @@ namespace CalamityMod #region Dialogue Tweaks private static void DialogueTweakSupport() { - Mod dialogueMod = GetInstance().dialogueTweak; + Mod dialogueMod = ExternalMods.dialogueTweak; if (dialogueMod != null) { dialogueMod.Call("ReplaceShopButtonIcon", NPCType(), "Head"); @@ -1152,7 +1153,7 @@ namespace CalamityMod #region Summoner's Association private static void SummonersAssociationSupport() { - Mod sAssociation = GetInstance().summonersAssociation; + Mod sAssociation = ExternalMods.summonersAssociation; if (sAssociation is null) return; @@ -1294,7 +1295,7 @@ namespace CalamityMod public static void ColoredDamageTypesSupport() { - Mod coloredDamageTypes = GetInstance().coloredDamageTypes; + Mod coloredDamageTypes = ExternalMods.coloredDamageTypes; if (coloredDamageTypes is null) return; @@ -1321,7 +1322,7 @@ namespace CalamityMod public static void LuminanceSupport() { - Mod luminance = GetInstance().luminance; + Mod luminance = ExternalMods.luminance; if (luminance is null) return; diff --git a/NPCs/TownNPCs/FAP.cs b/NPCs/TownNPCs/FAP.cs index a8a071f222..de0920664a 100644 --- a/NPCs/TownNPCs/FAP.cs +++ b/NPCs/TownNPCs/FAP.cs @@ -873,7 +873,7 @@ namespace CalamityMod.NPCs.TownNPCs public override void AddShops() { - Mod musicMod = CalamityMod.Instance.musicMod; + Mod musicMod = ExternalMods.musicMod; musicMod.TryFind("Interlude1MusicBox", out ModItem interlude1Box); musicMod.TryFind("Interlude2MusicBox", out ModItem interlude2Box); musicMod.TryFind("Interlude3MusicBox", out ModItem interlude3Box); diff --git a/Systems/Mechanic/WorldSelectionDifficultySystem.cs b/Systems/Mechanic/WorldSelectionDifficultySystem.cs index 73621eb404..7193069b77 100644 --- a/Systems/Mechanic/WorldSelectionDifficultySystem.cs +++ b/Systems/Mechanic/WorldSelectionDifficultySystem.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Systems // The difficulty the world uses will be the latest applicable one, so these are added in order from easiest to hardest // These colors are all picked from the wiki's colors for each Difficulty combo // Calamity's own difficulties aren't added if the Luminance mod is on, as it adds its own world system - if (CalamityMod.Instance.luminance == null) + if (ExternalMods.luminance == null) { WorldDifficulties.Add(new WorldDifficulty(CalamityUtils.GetTextValue("UI.Revengeance"), GetRevengeance, new(211, 42, 42))); WorldDifficulties.Add(new WorldDifficulty(CalamityUtils.GetTextValue("UI.Death"), GetDeath, new(192, 64, 219))); diff --git a/Utilities/WorldgenUtils.cs b/Utilities/WorldgenUtils.cs index 508f5595f1..f8162760c3 100644 --- a/Utilities/WorldgenUtils.cs +++ b/Utilities/WorldgenUtils.cs @@ -216,7 +216,7 @@ namespace CalamityMod paddedArea.Inflate(padding, padding); // If Fargo's Mutant Mod is loaded, add to their Indestructible Rectangle list, which prevents structures from being trashed by Fargo's terrain tools. - Mod fargos = CalamityMod.Instance.fargos; + Mod fargos = ExternalMods.fargos; fargos?.Call("AddIndestructibleRectangle", paddedArea); } } diff --git a/World/AstralBiome.cs b/World/AstralBiome.cs index b38c4b12b4..5b99807bfe 100644 --- a/World/AstralBiome.cs +++ b/World/AstralBiome.cs @@ -75,7 +75,7 @@ namespace CalamityMod.World public static void PlaceAstralMeteor() { - Mod ancientsAwakened = CalamityMod.Instance.ancientsAwakened; + Mod ancientsAwakened = ExternalMods.ancientsAwakened; // This flag is also used to determine whether players are nearby. bool meteorDropped = true; @@ -222,7 +222,7 @@ namespace CalamityMod.World // Pre-cache a list of Magic Storage tiles to avoid, for performance reasons // It is plausible that only StorageComponent and StorageConnector are needed, but I aint gonna risk corrupting worlds // or crashes as containers can do some serious shit as seen with the Abyss chests - Shade - Mod magicStorage = CalamityMod.Instance.magicStorage; + Mod magicStorage = ExternalMods.magicStorage; IList MSTilesToAvoid = new List(16); if (magicStorage is not null) { diff --git a/World/DraedonStructures.cs b/World/DraedonStructures.cs index 69a981f3fc..22e924564b 100644 --- a/World/DraedonStructures.cs +++ b/World/DraedonStructures.cs @@ -568,7 +568,7 @@ namespace CalamityMod.World contents.Insert(8, new ChestItem(ItemID.CrimsonPlanterBox, WorldGen.genRand.Next(5, 9 + 1))); // Add Thorium Marine Kelp if Thorium is loaded. - Mod thorium = CalamityMod.Instance.thorium; + Mod thorium = ExternalMods.thorium; if (thorium is not null) { var marineKelpPlanterBox = thorium.Find("MarineKelpPlanterBox"); diff --git a/World/Planets/Planetoid.cs b/World/Planets/Planetoid.cs index 90d5bcd15f..5e9684fb5b 100644 --- a/World/Planets/Planetoid.cs +++ b/World/Planets/Planetoid.cs @@ -103,7 +103,7 @@ namespace CalamityMod.World.Planets public static bool InvalidSkyPlacementArea(Rectangle area) { - Mod varia = CalamityMod.Instance.varia; + Mod varia = ExternalMods.varia; for (int i = area.Left; i < area.Right; i++) { for (int j = area.Top; j < area.Bottom; j++) From 802ab3cac189d0d3fa5de32e4a36e2b2d3526a57 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Mon, 16 Sep 2024 21:00:14 +0900 Subject: [PATCH 077/133] Moving Utils Related to World into CalamityWorld --- CalamityMod.cs | 10 -- Events/AcidRainEvent.cs | 2 +- Events/BossRushEvent.cs | 3 +- Items/Tools/ClimateChange/AridArtifact.cs | 7 +- Items/Tools/ClimateChange/TorrentialTear.cs | 7 +- NPCs/CalamityAIs/CalamityBossAIs/OldDukeAI.cs | 4 +- NPCs/Cryogen/Cryogen.cs | 4 +- NPCs/DesertScourge/DesertScourgeHead.cs | 2 +- NPCs/DevourerofGods/DevourerofGodsHead.cs | 2 +- NPCs/GreatSandShark/GreatSandShark.cs | 2 +- NPCs/Polterghast/Polterghast.cs | 2 +- NPCs/Providence/Providence.cs | 2 +- NPCs/StormWeaver/StormWeaverHead.cs | 6 +- NPCs/SupremeCalamitas/SupremeCalamitas.cs | 2 +- NPCs/Yharon/Yharon.cs | 2 +- Systems/World/WorldMiscUpdateSystem.cs | 2 +- Utilities/MiscUtils.cs | 104 --------------- World/CalamityWorld.cs | 120 ++++++++++++++++++ 18 files changed, 146 insertions(+), 137 deletions(-) diff --git a/CalamityMod.cs b/CalamityMod.cs index 22560e9c82..5e2eca8c55 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -433,16 +433,6 @@ namespace CalamityMod } #endregion - #region Stop Rain - public static void StopRain() - { - if (!Main.raining) - return; - Main.raining = false; - CalamityNetcode.SyncWorld(); - } - #endregion - #region Netcode public override void HandlePacket(BinaryReader reader, int whoAmI) => CalamityNetcode.HandlePacket(this, reader, whoAmI); #endregion diff --git a/Events/AcidRainEvent.cs b/Events/AcidRainEvent.cs index 39bb24bb3e..25f9aef855 100644 --- a/Events/AcidRainEvent.cs +++ b/Events/AcidRainEvent.cs @@ -331,7 +331,7 @@ namespace CalamityMod.Events DownedBossSystem.downedAquaticScourgeAcidRain = DownedBossSystem.downedAquaticScourge; } HasTriedToSummonOldDuke = false; - CalamityMod.StopRain(); + CalamityWorld.StopRain(); } CalamityNetcode.SyncWorld(); diff --git a/Events/BossRushEvent.cs b/Events/BossRushEvent.cs index 832fb0c1bc..97891ab0d8 100644 --- a/Events/BossRushEvent.cs +++ b/Events/BossRushEvent.cs @@ -39,6 +39,7 @@ using CalamityMod.Projectiles.Typeless; using CalamityMod.Skies; using CalamityMod.Systems; using CalamityMod.UI.DraedonSummoning; +using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -590,7 +591,7 @@ namespace CalamityMod.Events // Change time as necessary. if (Bosses[BossRushStage].ToChangeTimeTo != TimeChangeContext.None) - CalamityUtils.ChangeTime(Bosses[BossRushStage].ToChangeTimeTo == TimeChangeContext.Day); + CalamityWorld.ResetTime(Bosses[BossRushStage].ToChangeTimeTo == TimeChangeContext.Day); // Play a special boss roar sound by default. if (!Bosses[BossRushStage].UsesSpecialSound) diff --git a/Items/Tools/ClimateChange/AridArtifact.cs b/Items/Tools/ClimateChange/AridArtifact.cs index 3e83a71ec6..9949af0295 100644 --- a/Items/Tools/ClimateChange/AridArtifact.cs +++ b/Items/Tools/ClimateChange/AridArtifact.cs @@ -1,4 +1,5 @@ -using Terraria; +using CalamityMod.World; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -39,9 +40,9 @@ namespace CalamityMod.Items.Tools.ClimateChange return true; if (SandstormEvent.Happening) - CalamityUtils.StopSandstorm(); + CalamityWorld.StopSandstorm(); else - CalamityUtils.StartSandstorm(); + CalamityWorld.StartSandstorm(); return true; } diff --git a/Items/Tools/ClimateChange/TorrentialTear.cs b/Items/Tools/ClimateChange/TorrentialTear.cs index ed9eb51f0b..ff849c21b1 100644 --- a/Items/Tools/ClimateChange/TorrentialTear.cs +++ b/Items/Tools/ClimateChange/TorrentialTear.cs @@ -1,4 +1,5 @@ -using Terraria; +using CalamityMod.World; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -37,11 +38,11 @@ namespace CalamityMod.Items.Tools.ClimateChange if (!Main.raining) { - CalamityUtils.StartRain(torrentialTear: true, worldSync: true); + CalamityWorld.StartRain(adjustSeverity: true, worldSync: true); } else { - CalamityUtils.StopRain(clearWeather: false, worldSync: true); + CalamityWorld.StopRain(clearWeather: false, worldSync: true); } return true; diff --git a/NPCs/CalamityAIs/CalamityBossAIs/OldDukeAI.cs b/NPCs/CalamityAIs/CalamityBossAIs/OldDukeAI.cs index a4b0716412..ffc189ab5e 100644 --- a/NPCs/CalamityAIs/CalamityBossAIs/OldDukeAI.cs +++ b/NPCs/CalamityAIs/CalamityBossAIs/OldDukeAI.cs @@ -70,9 +70,9 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), redLight, greenLight, 0f); if (CalamityServerConfig.Instance.BossesStopWeather) - CalamityMod.StopRain(); + CalamityWorld.StopRain(); else if (!Main.raining && !BossRushEvent.BossRushActive) - CalamityUtils.StartRain(); + CalamityWorld.StartRain(); // Adjust stats int setDamage = npc.defDamage; diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index e3d1a476fd..8aad1f3755 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -265,9 +265,9 @@ namespace CalamityMod.NPCs.Cryogen } if (CalamityServerConfig.Instance.BossesStopWeather) - CalamityMod.StopRain(); + CalamityWorld.StopRain(); else if (!Main.raining && !BossRushEvent.BossRushActive) - CalamityUtils.StartRain(); + CalamityWorld.StartRain(); if (!player.active || player.dead) { diff --git a/NPCs/DesertScourge/DesertScourgeHead.cs b/NPCs/DesertScourge/DesertScourgeHead.cs index faf604d439..36b16e13de 100644 --- a/NPCs/DesertScourge/DesertScourgeHead.cs +++ b/NPCs/DesertScourge/DesertScourgeHead.cs @@ -943,7 +943,7 @@ namespace CalamityMod.NPCs.DesertScourge CalamityUtils.DisplayLocalizedText(key2, messageColor2); if (!Terraria.GameContent.Events.Sandstorm.Happening) - CalamityUtils.StartSandstorm(); + CalamityWorld.StartSandstorm(); } // Mark Desert Scourge as dead. diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index d0c7be7f34..d4a2ae9c2b 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -354,7 +354,7 @@ namespace CalamityMod.NPCs.DevourerofGods // Stop rain if (CalamityServerConfig.Instance.BossesStopWeather) - CalamityMod.StopRain(); + CalamityWorld.StopRain(); // Get a target (time is checked in the second check to ensure a new target isn't being set constantly) if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) diff --git a/NPCs/GreatSandShark/GreatSandShark.cs b/NPCs/GreatSandShark/GreatSandShark.cs index c0d7469cc5..05e4e6f881 100644 --- a/NPCs/GreatSandShark/GreatSandShark.cs +++ b/NPCs/GreatSandShark/GreatSandShark.cs @@ -118,7 +118,7 @@ namespace CalamityMod.NPCs.GreatSandShark if (!Terraria.GameContent.Events.Sandstorm.Happening) { - CalamityUtils.StartSandstorm(); + CalamityWorld.StartSandstorm(); CalamityNetcode.SyncWorld(); } diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index 20138b1ba8..1dd4f7614a 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -308,7 +308,7 @@ namespace CalamityMod.NPCs.Polterghast // Stop rain if (CalamityServerConfig.Instance.BossesStopWeather) - CalamityMod.StopRain(); + CalamityWorld.StopRain(); // Set time left if (NPC.timeLeft < 1800) diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 432b21f36e..5d7518325b 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -634,7 +634,7 @@ namespace CalamityMod.NPCs.Providence // Prevent lag by stopping rain if (CalamityServerConfig.Instance.BossesStopWeather) - CalamityMod.StopRain(); + CalamityWorld.StopRain(); // Set target biome type if (biomeType == 0) diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index 1bed8eb1bf..4b5d48116f 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -178,9 +178,9 @@ namespace CalamityMod.NPCs.StormWeaver bool expertMode = Main.expertMode || bossRush; if (CalamityServerConfig.Instance.BossesStopWeather) - CalamityMod.StopRain(); + CalamityWorld.StopRain(); else if (!Main.raining && !bossRush) - CalamityUtils.StartRain(); + CalamityWorld.StartRain(); float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -817,7 +817,7 @@ namespace CalamityMod.NPCs.StormWeaver if (Main.netMode == NetmodeID.MultiplayerClient || (Main.netMode == NetmodeID.SinglePlayer && Main.gameMenu) || calamityGlobalNPC.newAI[1] > 0f || bossRush) return; - CalamityUtils.StartRain(true, true); + CalamityWorld.StartRain(true, true); calamityGlobalNPC.newAI[1] = 1f; } } diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 36ee5887fd..4be82eeaae 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -457,7 +457,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } if (CalamityServerConfig.Instance.BossesStopWeather) - CalamityMod.StopRain(); + CalamityWorld.StopRain(); bool bossRush = BossRushEvent.BossRushActive; bool expertMode = Main.expertMode || bossRush; diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index ce447fe3be..5165eb775f 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -198,7 +198,7 @@ namespace CalamityMod.NPCs.Yharon // Stop rain if (CalamityServerConfig.Instance.BossesStopWeather) - CalamityMod.StopRain(); + CalamityWorld.StopRain(); // Variables bool bossRush = BossRushEvent.BossRushActive; diff --git a/Systems/World/WorldMiscUpdateSystem.cs b/Systems/World/WorldMiscUpdateSystem.cs index eb8fc619f6..d9baa823af 100644 --- a/Systems/World/WorldMiscUpdateSystem.cs +++ b/Systems/World/WorldMiscUpdateSystem.cs @@ -99,7 +99,7 @@ namespace CalamityMod.Systems // Disable sandstorms if the Desert Scourge is still alive and Hardmode hasn't begun. if (!DownedBossSystem.downedDesertScourge && Main.netMode != NetmodeID.MultiplayerClient && !Main.hardMode) - CalamityUtils.StopSandstorm(); + CalamityWorld.StopSandstorm(); // Attempt to summon lab critters manually since they refuse to exist when using vanilla's spawn methods. // This needs to check all players since the method only runs server-side. diff --git a/Utilities/MiscUtils.cs b/Utilities/MiscUtils.cs index 9283578090..27cb806879 100644 --- a/Utilities/MiscUtils.cs +++ b/Utilities/MiscUtils.cs @@ -39,7 +39,6 @@ namespace CalamityMod return -1; } - public static bool ChangeIngredientStack(this Recipe r, int itemID, int stack) { int idx = r.IngredientIndex(itemID); @@ -198,109 +197,6 @@ namespace CalamityMod sfx.Volume = MathHelper.Clamp(sfx.Volume * volumeMultiplier, 0f, 1f); } - public static void StartRain(bool torrentialTear = false, bool maxSeverity = false, bool worldSync = true) - { - int framesInDay = 86400; - int framesInHour = framesInDay / 24; - Main.rainTime = Main.rand.Next(framesInHour * 8, framesInDay); - if (Main.rand.NextBool(3)) - { - Main.rainTime += Main.rand.Next(0, framesInHour); - } - if (Main.rand.NextBool(4)) - { - Main.rainTime += Main.rand.Next(0, framesInHour * 2); - } - if (Main.rand.NextBool(5)) - { - Main.rainTime += Main.rand.Next(0, framesInHour * 2); - } - if (Main.rand.NextBool(6)) - { - Main.rainTime += Main.rand.Next(0, framesInHour * 3); - } - if (Main.rand.NextBool(7)) - { - Main.rainTime += Main.rand.Next(0, framesInHour * 4); - } - if (Main.rand.NextBool(8)) - { - Main.rainTime += Main.rand.Next(0, framesInHour * 5); - } - float randRainExtender = 1f; - if (Main.rand.NextBool()) - { - randRainExtender += 0.05f; - } - if (Main.rand.NextBool(3)) - { - randRainExtender += 0.1f; - } - if (Main.rand.NextBool(4)) - { - randRainExtender += 0.15f; - } - if (Main.rand.NextBool(5)) - { - randRainExtender += 0.2f; - } - Main.rainTime = (int)(Main.rainTime * randRainExtender); - Main.raining = true; - if (torrentialTear) - TorrentialTear.AdjustRainSeverity(maxSeverity); - - if (worldSync) - CalamityNetcode.SyncWorld(); - } - - public static void StopRain(bool clearWeather = false, bool worldSync = true) - { - if (clearWeather) - Main.StopRain(); - else - Main.raining = false; - - if (worldSync) - CalamityNetcode.SyncWorld(); - } - - public static void StartSandstorm() - { - if (Main.netMode != NetmodeID.MultiplayerClient && !Sandstorm.Happening) - { - // If it's not windy enough, make it windy enough for a sandstorm - // 0.6f is the minimum for vanilla but Calamity changes it to 0.2f - // Windy days occur when wind speed is at least 0.5f (0.4f in vanilla) so this should never cause a windy day - float windSpeed = 0f; - if (Main.windSpeedCurrent == 0f) - { - windSpeed = Main.rand.NextFloat(0.3f, 0.4f) * (Main.rand.Next(0, 2) * 2 - 1); - } - else if (Main.windSpeedCurrent < 0.3f && Main.windSpeedCurrent > 0f) - { - windSpeed = Main.rand.NextFloat(0.3f, 0.4f); - } - else if (Main.windSpeedCurrent > -0.3f && Main.windSpeedCurrent < 0f) - { - windSpeed = Main.rand.NextFloat(-0.4f, -0.3f); - } - if (windSpeed != 0f) - { - Main.windSpeedCurrent = windSpeed < 0f ? -0.3f : 0.3f; - Main.windSpeedTarget = windSpeed; - } - Sandstorm.StartSandstorm(); - } - } - - public static void StopSandstorm() - { - if (Main.netMode != NetmodeID.MultiplayerClient && Sandstorm.Happening) - { - Sandstorm.StopSandstorm(); - } - } - public static void AddWithCondition(this List list, T type, bool condition) { if (condition) diff --git a/World/CalamityWorld.cs b/World/CalamityWorld.cs index 731bba40fd..1f481d23c4 100644 --- a/World/CalamityWorld.cs +++ b/World/CalamityWorld.cs @@ -1,4 +1,5 @@ using System.Reflection; +using CalamityMod.Items.Tools.ClimateChange; using CalamityMod.NPCs.ExoMechs; using CalamityMod.NPCs.ExoMechs.Apollo; using CalamityMod.NPCs.ExoMechs.Ares; @@ -7,7 +8,10 @@ using CalamityMod.NPCs.ExoMechs.Thanatos; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; +using Terraria.GameContent.Events; +using Terraria.ID; using Terraria.ModLoader; +using Terraria.Utilities; namespace CalamityMod.World { @@ -98,5 +102,121 @@ namespace CalamityMod.World public static Vector2 CavernLabCenter; #endregion + + #region Rain Utils + public static void StartRain(bool adjustSeverity = false, bool maxSeverity = false, bool worldSync = true) + { + int framesInDay = 86400; + int framesInHour = framesInDay / 24; + Main.rainTime = Main.rand.Next(framesInHour * 8, framesInDay); + if (Main.rand.NextBool(3)) + { + Main.rainTime += Main.rand.Next(0, framesInHour); + } + if (Main.rand.NextBool(4)) + { + Main.rainTime += Main.rand.Next(0, framesInHour * 2); + } + if (Main.rand.NextBool(5)) + { + Main.rainTime += Main.rand.Next(0, framesInHour * 2); + } + if (Main.rand.NextBool(6)) + { + Main.rainTime += Main.rand.Next(0, framesInHour * 3); + } + if (Main.rand.NextBool(7)) + { + Main.rainTime += Main.rand.Next(0, framesInHour * 4); + } + if (Main.rand.NextBool(8)) + { + Main.rainTime += Main.rand.Next(0, framesInHour * 5); + } + float randRainExtender = 1f; + if (Main.rand.NextBool()) + { + randRainExtender += 0.05f; + } + if (Main.rand.NextBool(3)) + { + randRainExtender += 0.1f; + } + if (Main.rand.NextBool(4)) + { + randRainExtender += 0.15f; + } + if (Main.rand.NextBool(5)) + { + randRainExtender += 0.2f; + } + Main.rainTime = (int)(Main.rainTime * randRainExtender); + Main.raining = true; + if (adjustSeverity) + TorrentialTear.AdjustRainSeverity(maxSeverity); + + if (worldSync) + CalamityNetcode.SyncWorld(); + } + + public static void StopRain(bool clearWeather = false, bool worldSync = true) + { + if (clearWeather) + Main.StopRain(); + else + Main.raining = false; + + if (worldSync) + CalamityNetcode.SyncWorld(); + } + #endregion + + #region Sandstorm Utils + public static void StartSandstorm() + { + if (Main.netMode != NetmodeID.MultiplayerClient && !Sandstorm.Happening) + { + // If it's not windy enough, make it windy enough for a sandstorm + // 0.6f is the minimum for vanilla but Calamity changes it to 0.2f + // Windy days occur when wind speed is at least 0.5f (0.4f in vanilla) so this should never cause a windy day + float windSpeed = 0f; + if (Main.windSpeedCurrent == 0f) + { + windSpeed = Main.rand.NextFloat(0.3f, 0.4f) * (Main.rand.Next(0, 2) * 2 - 1); + } + else if (Main.windSpeedCurrent < 0.3f && Main.windSpeedCurrent > 0f) + { + windSpeed = Main.rand.NextFloat(0.3f, 0.4f); + } + else if (Main.windSpeedCurrent > -0.3f && Main.windSpeedCurrent < 0f) + { + windSpeed = Main.rand.NextFloat(-0.4f, -0.3f); + } + if (windSpeed != 0f) + { + Main.windSpeedCurrent = windSpeed < 0f ? -0.3f : 0.3f; + Main.windSpeedTarget = windSpeed; + } + Sandstorm.StartSandstorm(); + } + } + + public static void StopSandstorm() + { + if (Main.netMode != NetmodeID.MultiplayerClient && Sandstorm.Happening) + { + Sandstorm.StopSandstorm(); + } + } + #endregion + + #region Time Utils + public static void ResetTime(bool changeToDay) + { + Main.time = 0D; + Main.dayTime = changeToDay; + CalamityNetcode.SyncWorld(); + } + #endregion } } From a66fe1f08a16a6a25b45041dfcf75b17eebfc98b Mon Sep 17 00:00:00 2001 From: Flowaria Date: Mon, 16 Sep 2024 21:40:12 +0900 Subject: [PATCH 078/133] GeneralParticleHandler as ModSystem, Added ReflectionUtil for Types Loading --- CalamityMod.cs | 4 +-- Particles/GeneralParticleHandler.cs | 55 +++++++++++++---------------- Utilities/ReflectionHelper.cs | 48 +++++++++++++++++++++++++ 3 files changed, 74 insertions(+), 33 deletions(-) diff --git a/CalamityMod.cs b/CalamityMod.cs index 5e2eca8c55..eb38f1db96 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -134,14 +134,13 @@ namespace CalamityMod // Initialize the EnemyStats struct as early as it is safe to do so NPCStats.Load(); - // Initialize Calamity Balance, since it is tightly coupled with the remaining lists + // Initialize Calamity Balance, since it is tightly coupled with the remaining systems CalamityGlobalItem.LoadTweaks(); CalamityGlobalProjectile.LoadTweaks(); if (!Main.dedServ) { LoadClient(); - GeneralParticleHandler.Load(); PrimitiveRenderer.Initialize(); ForegroundDrawing.ForegroundManager.Load(); @@ -248,7 +247,6 @@ namespace CalamityMod if (!Main.dedServ) { TextureAssets.FlyingCarpet = carpetOriginal; - GeneralParticleHandler.Unload(); } carpetOriginal = null; diff --git a/Particles/GeneralParticleHandler.cs b/Particles/GeneralParticleHandler.cs index 3fb0a7190c..13ad1b1785 100644 --- a/Particles/GeneralParticleHandler.cs +++ b/Particles/GeneralParticleHandler.cs @@ -9,11 +9,12 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.Core; +using Terraria.ModLoader.IO; namespace CalamityMod.Particles { - // TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks. - public static class GeneralParticleHandler + [Autoload(Side = ModSide.Client)] + public sealed class GeneralParticleHandler : ModSystem { private static List particles; private static Queue particlesToSpawnNextFrame; @@ -28,45 +29,39 @@ namespace CalamityMod.Particles private static List batchedNonPremultipliedParticles; private static List batchedAdditiveBlendParticles; - public static void LoadModParticleInstances() + public override void PostSetupContent() { Type baseParticleType = typeof(Particle); - foreach (Mod mod in ModLoader.Mods) + ReflectionHelper.IterateEveryModsTypes(action: type => { - foreach (Type type in AssemblyManager.GetLoadableTypes(mod.Code)) - { - if (type.IsSubclassOf(baseParticleType) && !type.IsAbstract && type != baseParticleType) - { - int ID = particleTypes.Count; //Get the ID of the particle - particleTypes[type] = ID; + int ID = particleTypes.Count; //Get the ID of the particle + particleTypes[type] = ID; - Particle instance = (Particle)FormatterServices.GetUninitializedObject(type); - particleInstances.Add(instance); + Particle instance = (Particle)Activator.CreateInstance(type); + particleInstances.Add(instance); - string texturePath = type.Namespace.Replace('.', '/') + "/" + type.Name; - if (instance.Texture != "") - texturePath = instance.Texture; - particleTextures[ID] = ModContent.Request(texturePath, AssetRequestMode.ImmediateLoad).Value; - } - } - } + string texturePath = type.Namespace.Replace('.', '/') + "/" + type.Name; + if (instance.Texture != "") + texturePath = instance.Texture; + particleTextures[ID] = ModContent.Request(texturePath, AssetRequestMode.ImmediateLoad).Value; + }); } - internal static void Load() + public override void Load() { - particles = new List(); - particlesToSpawnNextFrame = new Queue(); - particlesToKill = new List(); - particleTypes = new Dictionary(); - particleTextures = new Dictionary(); - particleInstances = new List(); + particles = []; + particlesToSpawnNextFrame = []; + particlesToKill = []; + particleTypes = []; + particleTextures = []; + particleInstances = []; - batchedAlphaBlendParticles = new List(); - batchedNonPremultipliedParticles = new List(); - batchedAdditiveBlendParticles = new List(); + batchedAlphaBlendParticles = []; + batchedNonPremultipliedParticles = []; + batchedAdditiveBlendParticles = []; } - internal static void Unload() + public override void Unload() { particles = null; particlesToSpawnNextFrame = null; diff --git a/Utilities/ReflectionHelper.cs b/Utilities/ReflectionHelper.cs index cad3cd63bd..22634d419f 100644 --- a/Utilities/ReflectionHelper.cs +++ b/Utilities/ReflectionHelper.cs @@ -6,6 +6,10 @@ using System.Reflection.Emit; using System.Text; using System.Threading.Tasks; using Terraria.GameContent; +using Terraria.ModLoader.Core; +using Terraria.ModLoader; +using System.Collections; +using CalamityMod.Particles; namespace CalamityMod { @@ -58,5 +62,49 @@ namespace CalamityMod return (Func)getterMethod.CreateDelegate(typeof(Func)); } + + public static IEnumerable GetEveryModsTypes() + { + return ModLoader.Mods.SelectMany(mod => AssemblyManager.GetLoadableTypes(mod.Code)); + } + + public static void IterateEveryModsTypes(bool includeBaseType = false, Action action = null) + { + // WHY???? + if (action is null) + return; + + Type baseType = typeof(T); + var types = GetEveryModsTypes(); + foreach (var type in types) + { + if (type.IsSubclassOf(baseType) && !type.IsAbstract && (!includeBaseType && type != baseType)) + { + action.Invoke(type); + } + } + } + + public static IEnumerable GetCalamityModTypes() + { + return AssemblyManager.GetLoadableTypes(CalamityMod.Instance.Code); + } + + public static void IterateCalamityModTypes(bool includeBaseType, Action action) + { + // WHY???? + if (action is null) + return; + + Type baseType = typeof(T); + var types = GetCalamityModTypes(); + foreach (var type in types) + { + if (type.IsSubclassOf(baseType) && !type.IsAbstract && (!includeBaseType && type != baseType)) + { + action.Invoke(type); + } + } + } } } From af52e191743ee458042bcace382b73417ebf55a4 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Tue, 17 Sep 2024 23:08:41 +0900 Subject: [PATCH 079/133] BossHeadIcon loading is now on their bosstype --- CalamityMod.cs | 35 ++--------------------- NPCs/CalamityGlobalNPC.cs | 5 +++- NPCs/Cryogen/Cryogen.cs | 11 +++---- NPCs/DevourerofGods/DevourerofGodsBody.cs | 6 ++-- NPCs/DevourerofGods/DevourerofGodsHead.cs | 11 +++---- NPCs/DevourerofGods/DevourerofGodsTail.cs | 11 +++---- NPCs/ExoMechs/Apollo/Apollo.cs | 11 +++---- NPCs/ExoMechs/Artemis/Artemis.cs | 11 +++---- NPCs/ExoMechs/Thanatos/ThanatosBody1.cs | 11 +++---- NPCs/ExoMechs/Thanatos/ThanatosBody2.cs | 11 +++---- NPCs/ExoMechs/Thanatos/ThanatosHead.cs | 11 +++---- NPCs/ExoMechs/Thanatos/ThanatosTail.cs | 11 +++---- NPCs/HiveMind/HiveMind.cs | 11 +++---- NPCs/Polterghast/Polterghast.cs | 11 +++---- NPCs/StormWeaver/StormWeaverHead.cs | 11 +++---- NPCs/SupremeCalamitas/SupremeCalamitas.cs | 19 ++++-------- 16 files changed, 63 insertions(+), 134 deletions(-) diff --git a/CalamityMod.cs b/CalamityMod.cs index eb38f1db96..9f99cc2fe5 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -84,9 +84,6 @@ namespace CalamityMod public static int ghostKillCount = 0; public static int sharkKillCount = 0; - // Boss Head Icons - public static int chadPrimeIcon; - public static Asset carpetOriginal; // Holds the Texture Arrays for all the lava textures. @@ -122,13 +119,12 @@ namespace CalamityMod public static bool ExternalFlag_DisableDefenseDamage = false; #endregion - internal static CalamityMod Instance; + internal static CalamityMod Instance => _Instance ??= ModContent.GetInstance(); + private static CalamityMod _Instance; #region Load public override void Load() { - Instance = this; - carpetOriginal = TextureAssets.FlyingCarpet; // Initialize the EnemyStats struct as early as it is safe to do so @@ -148,7 +144,6 @@ namespace CalamityMod WeakReferenceSupport.WikiThisSupport(); } - CooldownRegistry.Load(); BossRushEvent.Load(); // TODO -- As ModBossBarStyle is a ModType, its Load function does not need to be called directly here. BossHealthBarManager.Load(this); @@ -187,28 +182,6 @@ namespace CalamityMod ChargeMeterUI.Load(); FlightBar.Load(); - // TODO -- Is this not possible to place in ModNPC.Load or ModNPC.SetStaticDefaults ? - // Centralizing head texture registration like this seems absurdly stiff - Apollo.LoadHeadIcons(); - Artemis.LoadHeadIcons(); - Cryogen.LoadHeadIcons(); - DevourerofGodsHead.LoadHeadIcons(); - DevourerofGodsBody.LoadHeadIcons(); - DevourerofGodsTail.LoadHeadIcons(); - HiveMind.LoadHeadIcons(); - Polterghast.LoadHeadIcons(); - StormWeaverHead.LoadHeadIcons(); - SupremeCalamitas.LoadHeadIcons(); - ThanatosHead.LoadHeadIcons(); - ThanatosBody1.LoadHeadIcons(); - 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); - InvasionProgressUIManager.LoadGUIs(); } #endregion @@ -231,7 +204,6 @@ namespace CalamityMod InvasionProgressUIManager.UnloadGUIs(); BossRushEvent.Unload(); SchematicManager.Unload(); - CooldownRegistry.Unload(); PlayerDashManager.Unload(); Main.QueueMainThreadAction(() => @@ -250,8 +222,7 @@ namespace CalamityMod } carpetOriginal = null; - - Instance = null; + _Instance = null; base.Unload(); } #endregion diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 998057bee0..b93934cc0c 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -1222,6 +1222,9 @@ namespace CalamityMod.NPCs #region Load/Unload public override void Load() { + string chadPrimeIconPath = "CalamityMod/ExtraTextures/ChadPrime_Head_Boss"; + chadPrimeIcon = CalamityMod.Instance.AddBossHeadTexture(chadPrimeIconPath, -1); + #region Setup Vanilla DR Values DRValues = new SortedDictionary { { NPCID.AngryBonesBig, 0.2f }, @@ -3601,7 +3604,7 @@ namespace CalamityMod.NPCs if (CalamityWorld.revenge || BossRushEvent.BossRushActive) { if (npc.type == NPCID.SkeletronPrime && (Main.masterMode || BossRushEvent.BossRushActive)) - index = CalamityMod.chadPrimeIcon; + index = chadPrimeIcon; if (npc.type == NPCID.DukeFishron && (CalamityWorld.death || BossRushEvent.BossRushActive)) { diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index 8aad1f3755..01a7bfa054 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -66,16 +66,13 @@ namespace CalamityMod.NPCs.Cryogen public static int cryoIconIndex; public static int pyroIconIndex; - internal static void LoadHeadIcons() + public override void Load() { string cryoIconPath = "CalamityMod/NPCs/Cryogen/Cryogen_Phase1_Head_Boss"; string pyroIconPath = "CalamityMod/NPCs/Cryogen/Pyrogen_Head_Boss"; - - CalamityMod.Instance.AddBossHeadTexture(cryoIconPath, -1); - cryoIconIndex = ModContent.GetModBossHeadSlot(cryoIconPath); - - CalamityMod.Instance.AddBossHeadTexture(pyroIconPath, -1); - pyroIconIndex = ModContent.GetModBossHeadSlot(pyroIconPath); + + cryoIconIndex = CalamityMod.Instance.AddBossHeadTexture(cryoIconPath, -1); + pyroIconIndex = CalamityMod.Instance.AddBossHeadTexture(pyroIconPath, -1); } public override void SetStaticDefaults() diff --git a/NPCs/DevourerofGods/DevourerofGodsBody.cs b/NPCs/DevourerofGods/DevourerofGodsBody.cs index 3bdcc568fc..b78344a2d5 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody.cs @@ -25,12 +25,10 @@ namespace CalamityMod.NPCs.DevourerofGods { public static int phase2IconIndex; - internal static void LoadHeadIcons() + public override void Load() { string phase2IconPath = "CalamityMod/NPCs/DevourerofGods/DevourerofGodsBodyS_Head_Boss"; - - CalamityMod.Instance.AddBossHeadTexture(phase2IconPath, -1); - phase2IconIndex = ModContent.GetModBossHeadSlot(phase2IconPath); + phase2IconIndex = CalamityMod.Instance.AddBossHeadTexture(phase2IconPath, -1); } private const float LaserVelocityMultiplierMin = 0.5f; diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index d4a2ae9c2b..3532c04d4d 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -56,16 +56,13 @@ namespace CalamityMod.NPCs.DevourerofGods public static Asset Phase2Texture_Glow; public static Asset Phase2Texture_Glow2; - internal static void LoadHeadIcons() + public override void Load() { string phase1IconPath = "CalamityMod/NPCs/DevourerofGods/DevourerofGodsHead_Head_Boss"; string phase2IconPath = "CalamityMod/NPCs/DevourerofGods/DevourerofGodsHeadS_Head_Boss"; - - CalamityMod.Instance.AddBossHeadTexture(phase1IconPath, -1); - phase1IconIndex = ModContent.GetModBossHeadSlot(phase1IconPath); - - CalamityMod.Instance.AddBossHeadTexture(phase2IconPath, -1); - phase2IconIndex = ModContent.GetModBossHeadSlot(phase2IconPath); + + phase1IconIndex = CalamityMod.Instance.AddBossHeadTexture(phase1IconPath, -1); + phase2IconIndex = CalamityMod.Instance.AddBossHeadTexture(phase2IconPath, -1); } // Laser velocity diff --git a/NPCs/DevourerofGods/DevourerofGodsTail.cs b/NPCs/DevourerofGods/DevourerofGodsTail.cs index 895ded17e2..fe52904f8a 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTail.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTail.cs @@ -31,16 +31,13 @@ namespace CalamityMod.NPCs.DevourerofGods public static Asset Phase2Texture_Glow; public static Asset Phase2Texture_Glow2; - internal static void LoadHeadIcons() + public override void Load() { string phase1IconPath = "CalamityMod/NPCs/DevourerofGods/DevourerofGodsTail_Head_Boss"; string phase2IconPath = "CalamityMod/NPCs/DevourerofGods/DevourerofGodsTailS_Head_Boss"; - - CalamityMod.Instance.AddBossHeadTexture(phase1IconPath, -1); - phase1IconIndex = ModContent.GetModBossHeadSlot(phase1IconPath); - - CalamityMod.Instance.AddBossHeadTexture(phase2IconPath, -1); - phase2IconIndex = ModContent.GetModBossHeadSlot(phase2IconPath); + + phase1IconIndex = CalamityMod.Instance.AddBossHeadTexture(phase1IconPath, -1); + phase2IconIndex = CalamityMod.Instance.AddBossHeadTexture(phase2IconPath, -1); } private int invinceTime = 720; diff --git a/NPCs/ExoMechs/Apollo/Apollo.cs b/NPCs/ExoMechs/Apollo/Apollo.cs index 67238d32a2..fa2a0044dc 100644 --- a/NPCs/ExoMechs/Apollo/Apollo.cs +++ b/NPCs/ExoMechs/Apollo/Apollo.cs @@ -32,16 +32,13 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo public static Asset GlowTexture; - internal static void LoadHeadIcons() + public override void Load() { string phase1IconPath = "CalamityMod/NPCs/ExoMechs/Apollo/ApolloHead"; string phase2IconPath = "CalamityMod/NPCs/ExoMechs/Apollo/ApolloPhase2Head"; - - CalamityMod.Instance.AddBossHeadTexture(phase1IconPath, -1); - phase1IconIndex = ModContent.GetModBossHeadSlot(phase1IconPath); - - CalamityMod.Instance.AddBossHeadTexture(phase2IconPath, -1); - phase2IconIndex = ModContent.GetModBossHeadSlot(phase2IconPath); + + phase1IconIndex = CalamityMod.Instance.AddBossHeadTexture(phase1IconPath, -1); + phase2IconIndex = CalamityMod.Instance.AddBossHeadTexture(phase2IconPath, -1); } public enum Phase diff --git a/NPCs/ExoMechs/Artemis/Artemis.cs b/NPCs/ExoMechs/Artemis/Artemis.cs index 70737fc4e4..cbd0ba8e18 100644 --- a/NPCs/ExoMechs/Artemis/Artemis.cs +++ b/NPCs/ExoMechs/Artemis/Artemis.cs @@ -44,16 +44,13 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis public static Asset GlowTexture; - internal static void LoadHeadIcons() + public override void Load() { string phase1IconPath = "CalamityMod/NPCs/ExoMechs/Artemis/ArtemisHead"; string phase2IconPath = "CalamityMod/NPCs/ExoMechs/Artemis/ArtemisPhase2Head"; - - CalamityMod.Instance.AddBossHeadTexture(phase1IconPath, -1); - phase1IconIndex = ModContent.GetModBossHeadSlot(phase1IconPath); - - CalamityMod.Instance.AddBossHeadTexture(phase2IconPath, -1); - phase2IconIndex = ModContent.GetModBossHeadSlot(phase2IconPath); + + phase1IconIndex = CalamityMod.Instance.AddBossHeadTexture(phase1IconPath, -1); + phase2IconIndex = CalamityMod.Instance.AddBossHeadTexture(phase2IconPath, -1); } public enum Phase diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs index 889dec6b6d..acf7edb991 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs @@ -23,16 +23,13 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public static int normalIconIndex; public static int vulnerableIconIndex; - internal static void LoadHeadIcons() + public override void Load() { string normalIconPath = "CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosNormalBody"; string vulnerableIconPath = "CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosVulnerableBody"; - - CalamityMod.Instance.AddBossHeadTexture(normalIconPath, -1); - normalIconIndex = ModContent.GetModBossHeadSlot(normalIconPath); - - CalamityMod.Instance.AddBossHeadTexture(vulnerableIconPath, -1); - vulnerableIconIndex = ModContent.GetModBossHeadSlot(vulnerableIconPath); + + normalIconIndex = CalamityMod.Instance.AddBossHeadTexture(normalIconPath, -1); + vulnerableIconIndex = CalamityMod.Instance.AddBossHeadTexture(vulnerableIconPath, -1); } // Whether the body is venting heat or not, it is vulnerable to damage during venting diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs index d657a52918..60dfba869b 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs @@ -23,16 +23,13 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public static int normalIconIndex; public static int vulnerableIconIndex; - internal static void LoadHeadIcons() + public override void Load() { string normalIconPath = "CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosNormalBody2"; string vulnerableIconPath = "CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosVulnerableBody2"; - - CalamityMod.Instance.AddBossHeadTexture(normalIconPath, -1); - normalIconIndex = ModContent.GetModBossHeadSlot(normalIconPath); - - CalamityMod.Instance.AddBossHeadTexture(vulnerableIconPath, -1); - vulnerableIconIndex = ModContent.GetModBossHeadSlot(vulnerableIconPath); + + normalIconIndex = CalamityMod.Instance.AddBossHeadTexture(normalIconPath, -1); + vulnerableIconIndex = CalamityMod.Instance.AddBossHeadTexture(vulnerableIconPath, -1); } // Whether the body is venting heat or not, it is vulnerable to damage during venting diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index bcfbfda135..41787b1f86 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -47,16 +47,13 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public static Asset ReticleTopTexture; public static Asset ReticleBottomTexture; - internal static void LoadHeadIcons() + public override void Load() { string normalIconPath = "CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosNormalHead"; string vulnerableIconPath = "CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosVulnerableHead"; - - CalamityMod.Instance.AddBossHeadTexture(normalIconPath, -1); - normalIconIndex = ModContent.GetModBossHeadSlot(normalIconPath); - - CalamityMod.Instance.AddBossHeadTexture(vulnerableIconPath, -1); - vulnerableIconIndex = ModContent.GetModBossHeadSlot(vulnerableIconPath); + + normalIconIndex = CalamityMod.Instance.AddBossHeadTexture(normalIconPath, -1); + vulnerableIconIndex = CalamityMod.Instance.AddBossHeadTexture(vulnerableIconPath, -1); } public enum Phase diff --git a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs index 004df1e829..05054f02de 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs @@ -23,16 +23,13 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public static int normalIconIndex; public static int vulnerableIconIndex; - internal static void LoadHeadIcons() + public override void Load() { string normalIconPath = "CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosNormalTail"; string vulnerableIconPath = "CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosVulnerableTail"; - - CalamityMod.Instance.AddBossHeadTexture(normalIconPath, -1); - normalIconIndex = ModContent.GetModBossHeadSlot(normalIconPath); - - CalamityMod.Instance.AddBossHeadTexture(vulnerableIconPath, -1); - vulnerableIconIndex = ModContent.GetModBossHeadSlot(vulnerableIconPath); + + normalIconIndex = CalamityMod.Instance.AddBossHeadTexture(normalIconPath, -1); + vulnerableIconIndex = CalamityMod.Instance.AddBossHeadTexture(vulnerableIconPath, -1); } // Whether the tail is venting heat or not, it is vulnerable to damage during venting diff --git a/NPCs/HiveMind/HiveMind.cs b/NPCs/HiveMind/HiveMind.cs index bd6e05f57b..5d863f1b6d 100644 --- a/NPCs/HiveMind/HiveMind.cs +++ b/NPCs/HiveMind/HiveMind.cs @@ -44,16 +44,13 @@ namespace CalamityMod.NPCs.HiveMind public static int normalIconIndex; public static int phase2IconIndex; - internal static void LoadHeadIcons() + public override void Load() { string normalIconPath = "CalamityMod/NPCs/HiveMind/HiveMind_Head_Boss"; string phase2IconPath = "CalamityMod/NPCs/HiveMind/HiveMindP2_Head_Boss"; - - CalamityMod.Instance.AddBossHeadTexture(normalIconPath, -1); - normalIconIndex = ModContent.GetModBossHeadSlot(normalIconPath); - - CalamityMod.Instance.AddBossHeadTexture(phase2IconPath, -1); - phase2IconIndex = ModContent.GetModBossHeadSlot(phase2IconPath); + + normalIconIndex = CalamityMod.Instance.AddBossHeadTexture(normalIconPath, -1); + phase2IconIndex = CalamityMod.Instance.AddBossHeadTexture(phase2IconPath, -1); } // This block of values can be modified in SetDefaults() based on difficulty mode or something diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index 1dd4f7614a..8ed15fa562 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -39,17 +39,14 @@ namespace CalamityMod.NPCs.Polterghast { public static int phase1IconIndex; public static int phase3IconIndex; - - internal static void LoadHeadIcons() + + public override void Load() { string phase1IconPath = "CalamityMod/NPCs/Polterghast/Polterghast_Head_Boss"; string phase3IconPath = "CalamityMod/NPCs/Polterghast/Necroplasm_Head_Boss"; - CalamityMod.Instance.AddBossHeadTexture(phase1IconPath, -1); - phase1IconIndex = ModContent.GetModBossHeadSlot(phase1IconPath); - - CalamityMod.Instance.AddBossHeadTexture(phase3IconPath, -1); - phase3IconIndex = ModContent.GetModBossHeadSlot(phase3IconPath); + phase1IconIndex = CalamityMod.Instance.AddBossHeadTexture(phase1IconPath); + phase3IconIndex = CalamityMod.Instance.AddBossHeadTexture(phase3IconPath); } private const int DespawnTimerMax = 900; diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index 4b5d48116f..af485f9299 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -38,16 +38,13 @@ namespace CalamityMod.NPCs.StormWeaver public static int normalIconIndex; public static int vulnerableIconIndex; - internal static void LoadHeadIcons() + public override void Load() { string normalIconPath = "CalamityMod/NPCs/StormWeaver/StormWeaverHead_Head_Boss"; string vulnerableIconPath = "CalamityMod/NPCs/StormWeaver/StormWeaverHeadNaked_Head_Boss"; - - CalamityMod.Instance.AddBossHeadTexture(normalIconPath, -1); - normalIconIndex = ModContent.GetModBossHeadSlot(normalIconPath); - - CalamityMod.Instance.AddBossHeadTexture(vulnerableIconPath, -1); - vulnerableIconIndex = ModContent.GetModBossHeadSlot(vulnerableIconPath); + + normalIconIndex = CalamityMod.Instance.AddBossHeadTexture(normalIconPath, -1); + vulnerableIconIndex = CalamityMod.Instance.AddBossHeadTexture(vulnerableIconPath, -1); } private const float BoltAngleSpread = 280; diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 4be82eeaae..4b8ab51bea 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -226,24 +226,17 @@ namespace CalamityMod.NPCs.SupremeCalamitas public static Asset ForcefieldTexture; // TODO -- This is cumbersome. Change it to be better in 1.4. - internal static void LoadHeadIcons() + public override void Load() { string hoodedIconPath = "CalamityMod/NPCs/SupremeCalamitas/HoodedHeadIcon"; string hoodlessIconPath = "CalamityMod/NPCs/SupremeCalamitas/HoodlessHeadIcon"; string cirrusIconPath = "CalamityMod/NPCs/SupremeCalamitas/CirrusHeadIcon"; string cirrusIconP2Path = "CalamityMod/NPCs/SupremeCalamitas/CirrusHeadIcon2"; - - CalamityMod.Instance.AddBossHeadTexture(hoodedIconPath, -1); - hoodedHeadIconIndex = ModContent.GetModBossHeadSlot(hoodedIconPath); - - CalamityMod.Instance.AddBossHeadTexture(hoodlessIconPath, -1); - hoodlessHeadIconIndex = ModContent.GetModBossHeadSlot(hoodlessIconPath); - - CalamityMod.Instance.AddBossHeadTexture(cirrusIconPath, -1); - cirrusHeadIconIndex = ModContent.GetModBossHeadSlot(cirrusIconPath); - - CalamityMod.Instance.AddBossHeadTexture(cirrusIconP2Path, -1); - cirrusHeadIconP2Index = ModContent.GetModBossHeadSlot(cirrusIconP2Path); + + hoodedHeadIconIndex = CalamityMod.Instance.AddBossHeadTexture(hoodedIconPath, -1); + hoodlessHeadIconIndex = CalamityMod.Instance.AddBossHeadTexture(hoodlessIconPath, -1); + cirrusHeadIconIndex = CalamityMod.Instance.AddBossHeadTexture(cirrusIconPath, -1); + cirrusHeadIconP2Index = CalamityMod.Instance.AddBossHeadTexture(cirrusIconP2Path, -1); } public override void SetStaticDefaults() From a46621b11adf74788924807b066c3bb90d70bc13 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Tue, 17 Sep 2024 23:08:53 +0900 Subject: [PATCH 080/133] Fixing Dependency Issues --- CalamityLists.cs | 4 ++-- Cooldowns/CooldownRegistry.cs | 8 ++++---- Effects/CalamityShaders.cs | 5 +---- ExtraTextures/ExtraTextureRefs.cs | 2 +- ModSupport/WeakReferenceSupport.cs | 1 - Skies/SkyTextureRefs.cs | 2 +- 6 files changed, 9 insertions(+), 13 deletions(-) diff --git a/CalamityLists.cs b/CalamityLists.cs index 575e58a6a1..8e7ccf1725 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -77,7 +77,7 @@ using static Terraria.ModLoader.ModContent; namespace CalamityMod { - public sealed class CalamityLists : ModSystem + public class CalamityLists : ModSystem { public static IList donatorList; public static List projectileDestroyExceptionList; @@ -157,7 +157,7 @@ namespace CalamityMod public static List VeneratedLocketBanlist; //To ban projectiles from locket, mainly spikeballs altho Toasty asked me to add mod calls for adding stuff like Dreamtastic - public override void Load() + public override void OnModLoad() { donatorList = new List() { diff --git a/Cooldowns/CooldownRegistry.cs b/Cooldowns/CooldownRegistry.cs index 53822657c1..d74cf6cd11 100644 --- a/Cooldowns/CooldownRegistry.cs +++ b/Cooldowns/CooldownRegistry.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader.Core; namespace CalamityMod.Cooldowns { // TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks. - public class CooldownRegistry + public sealed class CooldownRegistry : ModSystem { // Indexed by ushort netID. Contains every registered cooldown. // Cooldowns are given netIDs when they are registered. @@ -18,7 +18,7 @@ namespace CalamityMod.Cooldowns private static Dictionary nameToNetID = null; - public static void Load() + public override void Load() { registry = new Cooldown[defaultSize]; nameToNetID = new Dictionary(defaultSize); @@ -60,7 +60,7 @@ namespace CalamityMod.Cooldowns #endregion } - public static void RegisterModCooldowns() + public override void OnModLoad() { Type baseHandlerType = typeof(CooldownHandler); foreach (Mod mod in ModLoader.Mods) @@ -87,7 +87,7 @@ namespace CalamityMod.Cooldowns } } - public static void Unload() + public override void Unload() { registry = null; nameToNetID?.Clear(); diff --git a/Effects/CalamityShaders.cs b/Effects/CalamityShaders.cs index aef889b2ac..2aa2e72970 100644 --- a/Effects/CalamityShaders.cs +++ b/Effects/CalamityShaders.cs @@ -206,11 +206,8 @@ namespace CalamityMod.Effects internal static Effect TeslaTrailShader; #endregion - public override void Load() + public override void PostSetupContent() { - if (Main.dedServ) - return; - AssetRepository calAss = CalamityMod.Instance.Assets; // Shorthand to load shaders immediately. diff --git a/ExtraTextures/ExtraTextureRefs.cs b/ExtraTextures/ExtraTextureRefs.cs index f11a5c393d..29ffcdbfbe 100644 --- a/ExtraTextures/ExtraTextureRefs.cs +++ b/ExtraTextures/ExtraTextureRefs.cs @@ -24,7 +24,7 @@ namespace CalamityMod.ExtraTextures public static Asset WallOfFleshEyeGlowmask; public static Asset WallOfFleshDemonSickleTexture; - public override void Load() + public override void OnModLoad() { DestroyerGlowmasks[0] = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerHeadGlow", AssetRequestMode.AsyncLoad); DestroyerGlowmasks[1] = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerBodyGlow", AssetRequestMode.AsyncLoad); diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 0cec821f71..1ab1bd5b2d 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -200,7 +200,6 @@ namespace CalamityMod // done here to assure that all other mods have already loaded so that Calamity can automatically grab any of these types they may have if (!Main.dedServ) { - GeneralParticleHandler.LoadModParticleInstances(); CooldownRegistry.RegisterModCooldowns(); PopupGUIManager.LoadGUIs(); } diff --git a/Skies/SkyTextureRefs.cs b/Skies/SkyTextureRefs.cs index f5f99bf456..78a59e674e 100644 --- a/Skies/SkyTextureRefs.cs +++ b/Skies/SkyTextureRefs.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Skies public static Texture2D SulphurSeaSkyFront; public static Texture2D SulphurSeaSurface; - public override void Load() + public override void OnModLoad() { // Astral Sky/BG AstralSky = ModContent.Request("CalamityMod/Skies/AstralSky", AssetRequestMode.ImmediateLoad).Value; From b2c34a89884d5e1988f5b6f63f62d04819724ef0 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Tue, 17 Sep 2024 23:13:05 +0900 Subject: [PATCH 081/133] UI as ModSystem --- CalamityMod.cs | 10 ---------- UI/DraedonsArsenal/ChargeMeterUI.cs | 8 ++++---- UI/FlightBar/FlightBar.cs | 8 ++++---- UI/Rippers/RipperUI.cs | 8 ++++---- UI/StealthUI.cs | 8 ++++---- 5 files changed, 16 insertions(+), 26 deletions(-) diff --git a/CalamityMod.cs b/CalamityMod.cs index 9f99cc2fe5..68783e37c7 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -177,11 +177,6 @@ namespace CalamityMod Main.OnPreDraw += PrepareRenderTargets; }); - RipperUI.Load(); - StealthUI.Load(); - ChargeMeterUI.Load(); - FlightBar.Load(); - InvasionProgressUIManager.LoadGUIs(); } #endregion @@ -211,11 +206,6 @@ namespace CalamityMod Main.OnPreDraw -= PrepareRenderTargets; }); - RipperUI.Unload(); - StealthUI.Unload(); - ChargeMeterUI.Unload(); - FlightBar.Unload(); - if (!Main.dedServ) { TextureAssets.FlyingCarpet = carpetOriginal; diff --git a/UI/DraedonsArsenal/ChargeMeterUI.cs b/UI/DraedonsArsenal/ChargeMeterUI.cs index b3c159411e..3ece55f181 100644 --- a/UI/DraedonsArsenal/ChargeMeterUI.cs +++ b/UI/DraedonsArsenal/ChargeMeterUI.cs @@ -9,8 +9,8 @@ using Terraria.ModLoader; namespace CalamityMod.UI.DraedonsArsenal { - // TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks. - public class ChargeMeterUI + [Autoload(Side = ModSide.Client)] + public sealed class ChargeMeterUI : ModSystem { // These values were handpicked on a 1080p screen by Ozzatron. Please disregard the bizarre precision. internal const float DefaultChargePosX = 50.104603f; @@ -20,14 +20,14 @@ namespace CalamityMod.UI.DraedonsArsenal private static Vector2? dragOffset = null; private static Texture2D edgeTexture, barTexture; - internal static void Load() + public override void OnModLoad() { edgeTexture = ModContent.Request("CalamityMod/UI/DraedonsArsenal/ChargeMeterBorder", AssetRequestMode.ImmediateLoad).Value; barTexture = ModContent.Request("CalamityMod/UI/DraedonsArsenal/ChargeMeter", AssetRequestMode.ImmediateLoad).Value; Reset(); } - internal static void Unload() + public override void Unload() { Reset(); edgeTexture = barTexture = null; diff --git a/UI/FlightBar/FlightBar.cs b/UI/FlightBar/FlightBar.cs index a2afefa36f..4823060fdc 100644 --- a/UI/FlightBar/FlightBar.cs +++ b/UI/FlightBar/FlightBar.cs @@ -12,8 +12,8 @@ using Terraria.ModLoader; namespace CalamityMod.UI { - // TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks. - public class FlightBar + [Autoload(Side = ModSide.Client)] + public sealed class FlightBar : ModSystem { // These values were handpicked on a 1080p screen by Amber. Please disregard the bizarre precision. internal const float DefaultFlightPosX = 40.9375f; @@ -63,7 +63,7 @@ namespace CalamityMod.UI return result; } - internal static void Load() + public override void OnModLoad() { borderTexture = ModContent.Request("CalamityMod/UI/FlightBar/FlightBarBorder", AssetRequestMode.ImmediateLoad).Value; flightBarAnimTexture = ModContent.Request("CalamityMod/UI/FlightBar/FlightBarAnim", AssetRequestMode.ImmediateLoad).Value; @@ -74,7 +74,7 @@ namespace CalamityMod.UI Reset(); } - internal static void Unload() + public override void Unload() { Reset(); borderTexture = flightBarAnimTexture = barTexture = disabledBarTexture = infiniteBarTexture = limitedBarTexture = null; diff --git a/UI/Rippers/RipperUI.cs b/UI/Rippers/RipperUI.cs index 2f9cce458e..8340a270cb 100644 --- a/UI/Rippers/RipperUI.cs +++ b/UI/Rippers/RipperUI.cs @@ -11,8 +11,8 @@ using Terraria.ModLoader; namespace CalamityMod.UI.Rippers { - // TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks. - public static class RipperUI + [Autoload(Side = ModSide.Client)] + public sealed class RipperUI : ModSystem { // These values were handpicked on a 1080p screen by Ozzatron. Please disregard the bizarre precision. public const float DefaultRagePosX = 35.77406f; @@ -51,7 +51,7 @@ namespace CalamityMod.UI.Rippers private static Texture2D adrenBarTex, adrenBorderTex, adrenBorderTexFull, adrenAnimTex, draedonBarTex, draedonAnimTex; private static Texture2D electrolyteGelTex, starlightFuelTex, ectoheartTex; - internal static void Load() + public override void OnModLoad() { rageBarTex = ModContent.Request("CalamityMod/UI/Rippers/RageBar", AssetRequestMode.ImmediateLoad).Value; rageBorderTex = ModContent.Request("CalamityMod/UI/Rippers/RageBarBorder", AssetRequestMode.ImmediateLoad).Value; @@ -79,7 +79,7 @@ namespace CalamityMod.UI.Rippers Reset(); } - internal static void Unload() + public override void Unload() { Reset(); rageBarTex = rageBorderTex = rageAnimTex = null; diff --git a/UI/StealthUI.cs b/UI/StealthUI.cs index 5abcc3896f..b695187eac 100644 --- a/UI/StealthUI.cs +++ b/UI/StealthUI.cs @@ -10,8 +10,8 @@ using static Microsoft.Xna.Framework.Input.Keys; namespace CalamityMod.UI { - // TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks. - public class StealthUI + [Autoload(Side = ModSide.Client)] + public sealed class StealthUI : ModSystem { // These values were handpicked on a 1080p screen by Ozzatron. Please disregard the bizarre precision. internal const float DefaultStealthPosX = 50.104603f; @@ -21,7 +21,7 @@ namespace CalamityMod.UI private static Vector2? dragOffset = null; private static Texture2D edgeTexture, indicatorTexture, barTexture, fullBarTexture; - internal static void Load() + public override void OnModLoad() { edgeTexture = ModContent.Request("CalamityMod/UI/MiscTextures/StealthMeter", AssetRequestMode.ImmediateLoad).Value; indicatorTexture = ModContent.Request("CalamityMod/UI/MiscTextures/StealthMeterStrikeIndicator", AssetRequestMode.ImmediateLoad).Value; @@ -30,7 +30,7 @@ namespace CalamityMod.UI Reset(); } - internal static void Unload() + public override void Unload() { Reset(); edgeTexture = indicatorTexture = barTexture = fullBarTexture = null; From f3c6b858793b5d5d072ba4b1bdb7c3c562bea08f Mon Sep 17 00:00:00 2001 From: Flowaria Date: Tue, 17 Sep 2024 23:18:16 +0900 Subject: [PATCH 082/133] Removed Load calling on BossHealthBarManager --- CalamityMod.cs | 1 - UI/BossHealthBarManager.cs | 30 +++++++++++++++--------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/CalamityMod.cs b/CalamityMod.cs index 68783e37c7..cf6fad7bbf 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -146,7 +146,6 @@ namespace CalamityMod BossRushEvent.Load(); // TODO -- As ModBossBarStyle is a ModType, its Load function does not need to be called directly here. - BossHealthBarManager.Load(this); EnchantmentManager.LoadAllEnchantments(); VanillaArmorChangeManager.Load(); SetupBossKillTimes(); diff --git a/UI/BossHealthBarManager.cs b/UI/BossHealthBarManager.cs index a7a0ad791c..04257ee00b 100644 --- a/UI/BossHealthBarManager.cs +++ b/UI/BossHealthBarManager.cs @@ -93,7 +93,7 @@ namespace CalamityMod.UI public delegate bool NPCSpecialHPGetRequirement(NPC npc); public delegate long NPCSpecialHPGetFunction(NPC npc, bool checkingForMaxLife); - internal static void Load(Mod mod) + public override void SetStaticDefaults() { Bars = new List(); @@ -175,6 +175,20 @@ namespace CalamityMod.UI SetupRequirementsList(); } + public override void Unload() + { + BossMainHPBar = null; + BossComboHPBar = null; + BossSeperatorBar = null; + HPBarFont = null; + Bars = null; + BossExclusionList = null; + MinibossHPBarList = null; + OneToMany = null; + EntityExtensionHandler = null; + SpecialHPRequirements = null; + } + public static void SetupBossExclusionList() { BossExclusionList = new List @@ -348,20 +362,6 @@ namespace CalamityMod.UI } #pragma warning restore IDE0028 // Simplify collection initialization - public override void Unload() - { - BossMainHPBar = null; - BossComboHPBar = null; - BossSeperatorBar = null; - HPBarFont = null; - Bars = null; - BossExclusionList = null; - MinibossHPBarList = null; - OneToMany = null; - EntityExtensionHandler = null; - SpecialHPRequirements = null; - } - public override void Update(IBigProgressBar currentBar, ref BigProgressBarInfo info) { foreach (NPC n in Main.ActiveNPCs) From 821e49bc364f456c8d152da3b2be747767ae786c Mon Sep 17 00:00:00 2001 From: Flowaria Date: Tue, 17 Sep 2024 23:20:01 +0900 Subject: [PATCH 083/133] BossRushEvent as ModSystem --- CalamityMod.cs | 3 --- Events/BossRushEvent.cs | 7 +++---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/CalamityMod.cs b/CalamityMod.cs index cf6fad7bbf..eedd074901 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -144,8 +144,6 @@ namespace CalamityMod WeakReferenceSupport.WikiThisSupport(); } - BossRushEvent.Load(); - // TODO -- As ModBossBarStyle is a ModType, its Load function does not need to be called directly here. EnchantmentManager.LoadAllEnchantments(); VanillaArmorChangeManager.Load(); SetupBossKillTimes(); @@ -196,7 +194,6 @@ namespace CalamityMod PopupGUIManager.UnloadGUIs(); InvasionProgressUIManager.UnloadGUIs(); - BossRushEvent.Unload(); SchematicManager.Unload(); PlayerDashManager.Unload(); diff --git a/Events/BossRushEvent.cs b/Events/BossRushEvent.cs index 97891ab0d8..cc76cb9048 100644 --- a/Events/BossRushEvent.cs +++ b/Events/BossRushEvent.cs @@ -52,8 +52,7 @@ using ArtemisBoss = CalamityMod.NPCs.ExoMechs.Artemis.Artemis; namespace CalamityMod.Events { - // TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks. - public class BossRushEvent + public sealed class BossRushEvent : ModSystem { public enum TimeChangeContext { @@ -137,7 +136,7 @@ namespace CalamityMod.Events public static readonly SoundStyle VictorySound = new("CalamityMod/Sounds/Custom/BossRush/BossRushVictory"); #region Loading and Unloading - public static void Load() + public override void OnModLoad() { BossIDsAfterDeath = new Dictionary(); @@ -456,7 +455,7 @@ namespace CalamityMod.Events }; } - public static void Unload() + public override void Unload() { Bosses = null; BossIDsAfterDeath = null; From e6bc30669197ca2c1a9c19ec640962b8da109118 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Tue, 17 Sep 2024 23:26:14 +0900 Subject: [PATCH 084/133] WeakRef as Full ModSystem, Fixes Dependency Issues --- CalamityMod.cs | 3 --- ModSupport/WeakReferenceSupport.cs | 12 ++++++------ Systems/Mechanic/GraveyardBiomeSystem.cs | 2 +- Systems/Mechanic/MountsBalancingSystem.cs | 2 +- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/CalamityMod.cs b/CalamityMod.cs index eedd074901..1f757687d1 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -139,9 +139,6 @@ namespace CalamityMod LoadClient(); PrimitiveRenderer.Initialize(); ForegroundDrawing.ForegroundManager.Load(); - - // Wikithis support - WeakReferenceSupport.WikiThisSupport(); } EnchantmentManager.LoadAllEnchantments(); diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 1ab1bd5b2d..ae167ac5f7 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -197,16 +197,16 @@ namespace CalamityMod SummonersAssociationSupport(); ColoredDamageTypesSupport(); LuminanceSupport(); - // done here to assure that all other mods have already loaded so that Calamity can automatically grab any of these types they may have + if (!Main.dedServ) { - CooldownRegistry.RegisterModCooldowns(); + WikiThisSupport(); PopupGUIManager.LoadGUIs(); } } #region BiomeLava - public static void LavaStyleToBiomeLava() + private static void LavaStyleToBiomeLava() { CalamityMod calamity = GetInstance(); Mod biomelava = ExternalMods.biomeLava; @@ -255,7 +255,7 @@ namespace CalamityMod #region WikiThis // This is a separate function because it only runs clientside - public static void WikiThisSupport() + private static void WikiThisSupport() { // Wikithis is a clientside mod if (Main.netMode == NetmodeID.Server) @@ -1292,7 +1292,7 @@ namespace CalamityMod private static Color StealthDamageColor = new(185, 105, 250); private static Color StealthCritColor = new(144, 33, 235); - public static void ColoredDamageTypesSupport() + private static void ColoredDamageTypesSupport() { Mod coloredDamageTypes = ExternalMods.coloredDamageTypes; if (coloredDamageTypes is null) @@ -1319,7 +1319,7 @@ namespace CalamityMod private static void RegisterWorldInfoIcon(Mod luminance, string texturePath, string hoverTextKey, Func shouldAppear, byte priority) => luminance.Call("RegisterWorldInfoIcon", texturePath, hoverTextKey, shouldAppear, priority); - public static void LuminanceSupport() + private static void LuminanceSupport() { Mod luminance = ExternalMods.luminance; if (luminance is null) diff --git a/Systems/Mechanic/GraveyardBiomeSystem.cs b/Systems/Mechanic/GraveyardBiomeSystem.cs index 39fffc0b75..b1104f87ba 100644 --- a/Systems/Mechanic/GraveyardBiomeSystem.cs +++ b/Systems/Mechanic/GraveyardBiomeSystem.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Systems // For now it literally adjust the graveyard count required for GraveyardBiome // But we can add something later on /shrug - public override void Load() + public override void OnModLoad() { // Make Graveyard biomes require more Gravestones SceneMetrics.GraveyardTileMax = 60; diff --git a/Systems/Mechanic/MountsBalancingSystem.cs b/Systems/Mechanic/MountsBalancingSystem.cs index 9a67d0890a..4a71442443 100644 --- a/Systems/Mechanic/MountsBalancingSystem.cs +++ b/Systems/Mechanic/MountsBalancingSystem.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Systems { internal sealed class MountsBalancingSystem : ModSystem { - public override void Load() + public override void OnModLoad() { // Mount balancing occurs during runtime and is undone when Calamity is unloaded. Mount.mounts[MountID.Unicorn].dashSpeed *= CalamityPlayer.UnicornSpeedNerfPower; From 53d6bba8c2b9fce74d81ab3cd2d0609abca49464 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Tue, 17 Sep 2024 23:55:31 +0900 Subject: [PATCH 085/133] Fixed AcidRain Dependency Issue --- CalamityLists.cs | 6 +++--- CalamityMod.cs | 5 +++++ Events/AcidRainEvent.cs | 2 +- UI/BossHealthBarManager.cs | 26 ++++++++++++++++---------- 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/CalamityLists.cs b/CalamityLists.cs index 8e7ccf1725..192a9b3ef1 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -77,7 +77,7 @@ using static Terraria.ModLoader.ModContent; namespace CalamityMod { - public class CalamityLists : ModSystem + public static class CalamityLists { public static IList donatorList; public static List projectileDestroyExceptionList; @@ -157,7 +157,7 @@ namespace CalamityMod public static List VeneratedLocketBanlist; //To ban projectiles from locket, mainly spikeballs altho Toasty asked me to add mod calls for adding stuff like Dreamtastic - public override void OnModLoad() + public static void Load() { donatorList = new List() { @@ -2715,7 +2715,7 @@ namespace CalamityMod }; } - public override void Unload() + public static void Unload() { donatorList = null; projectileDestroyExceptionList = null; diff --git a/CalamityMod.cs b/CalamityMod.cs index 1f757687d1..3889d4a7d8 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -127,6 +127,9 @@ namespace CalamityMod { carpetOriginal = TextureAssets.FlyingCarpet; + // I hate this I hate thisI hate thisIhatethisIhatethisIhatethisIhatethisIhatethisIhatethis + CalamityLists.Load(); + // Initialize the EnemyStats struct as early as it is safe to do so NPCStats.Load(); @@ -181,6 +184,8 @@ namespace CalamityMod bossKillTimes?.Clear(); bossKillTimes = null; + CalamityLists.Unload(); + BalancingChangesManager.Unload(); Attunement.Unload(); EnchantmentManager.UnloadAllEnchantments(); diff --git a/Events/AcidRainEvent.cs b/Events/AcidRainEvent.cs index 25f9aef855..3ca687018d 100644 --- a/Events/AcidRainEvent.cs +++ b/Events/AcidRainEvent.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Events public static Dictionary PossibleMinibossesPolter = new(); - public static List AllMinibosses => PossibleMinibossesAS.Select(miniboss => miniboss.Key).ToList().Concat(PossibleMinibossesPolter.Select(miniboss => miniboss.Key)).Distinct().ToList(); + public static List AllMinibosses => PossibleMinibossesAS.Select(miniboss => miniboss.Key).Concat(PossibleMinibossesPolter.Select(miniboss => miniboss.Key)).Distinct().ToList(); public static bool AnyRainMinibosses { diff --git a/UI/BossHealthBarManager.cs b/UI/BossHealthBarManager.cs index 04257ee00b..021fe2f7e6 100644 --- a/UI/BossHealthBarManager.cs +++ b/UI/BossHealthBarManager.cs @@ -25,6 +25,7 @@ using CalamityMod.NPCs.SunkenSea; using CalamityMod.NPCs.SupremeCalamitas; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using MonoMod.Utils; using ReLogic.Content; using ReLogic.Graphics; using Terraria; @@ -93,6 +94,14 @@ namespace CalamityMod.UI public delegate bool NPCSpecialHPGetRequirement(NPC npc); public delegate long NPCSpecialHPGetFunction(NPC npc, bool checkingForMaxLife); + public override void Load() + { + BossExclusionList = []; + MinibossHPBarList = []; + EntityExtensionHandler = []; + SpecialHPRequirements = []; + } + public override void SetStaticDefaults() { Bars = new List(); @@ -191,8 +200,7 @@ namespace CalamityMod.UI public static void SetupBossExclusionList() { - BossExclusionList = new List - { + BossExclusionList.AddRange([ NPCID.None, NPCID.MoonLordFreeEye, NPCID.MoonLordHead, @@ -220,14 +228,13 @@ namespace CalamityMod.UI NPCType(), NPCType(), NPCType(), - NPCType(), - }; + NPCType() + ]); } public static void SetupMinibossHPBarList() { - MinibossHPBarList = new List - { + MinibossHPBarList.AddRange([ // DD2 Event. NPCID.DD2Betsy, NPCID.DD2OgreT2, @@ -285,12 +292,12 @@ namespace CalamityMod.UI NPCType(), NPCType(), NPCType() - }; + ]); } public static void SetupExtensionHandlerList() { - EntityExtensionHandler = new Dictionary() + EntityExtensionHandler.AddRange(new Dictionary() { [NPCID.EaterofWorldsHead] = new BossEntityExtension(CalamityUtils.GetText("UI.ExtensionName.Segments"), NPCID.EaterofWorldsHead, NPCID.EaterofWorldsBody, NPCID.EaterofWorldsTail), [NPCID.BrainofCthulhu] = new BossEntityExtension(CalamityUtils.GetText("UI.ExtensionName.Creepers"), NPCID.Creeper), @@ -300,7 +307,7 @@ namespace CalamityMod.UI [NPCID.PirateShip] = new BossEntityExtension(CalamityUtils.GetText("UI.ExtensionName.Cannons"), NPCID.PirateShipCannon), [NPCType()] = new BossEntityExtension(CalamityUtils.GetText("UI.ExtensionName.DarkEnergy"), NPCType()), [NPCType()] = new BossEntityExtension(CalamityUtils.GetText("UI.ExtensionName.BodyParts"), NPCType(), NPCType(), NPCType(), NPCType()), - }; + }); } // Collection simplification looks horrendous in the context of delegate creation. @@ -308,7 +315,6 @@ namespace CalamityMod.UI #pragma warning disable IDE0028 // Simplify collection initialization public static void SetupRequirementsList() { - SpecialHPRequirements = new Dictionary(); SpecialHPRequirements.Add(npc => npc.Calamity().SplittingWorm, (npc, checkingForMaxLife) => { // Go across the entire worm and accumulate life. The expectation is that the boss follows the linked-list-esque standard From a10830576400588aa5776ad4d42b86688955d0e5 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Tue, 17 Sep 2024 23:56:20 +0900 Subject: [PATCH 086/133] Added Justification Message for GeneralParticleHandler - GetUninitializedObject is normally should not allowed, but this is special case --- Particles/GeneralParticleHandler.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Particles/GeneralParticleHandler.cs b/Particles/GeneralParticleHandler.cs index 13ad1b1785..5781c50b2a 100644 --- a/Particles/GeneralParticleHandler.cs +++ b/Particles/GeneralParticleHandler.cs @@ -23,7 +23,6 @@ namespace CalamityMod.Particles //Static list for details concerning every particle type internal static Dictionary particleTypes; internal static Dictionary particleTextures; - private static List particleInstances; //Lists used when drawing particles batched private static List batchedAlphaBlendParticles; private static List batchedNonPremultipliedParticles; @@ -37,8 +36,13 @@ namespace CalamityMod.Particles int ID = particleTypes.Count; //Get the ID of the particle particleTypes[type] = ID; - Particle instance = (Particle)Activator.CreateInstance(type); - particleInstances.Add(instance); + // Flow: 2024/08/17 + // 'UnintializedObject' is allowed to use here as it's only read for Texture + // But Do NOT EVER use it's instance as it's literally Uninitialized. + // It might cause unintended behaviour if we do that. +#pragma warning disable SYSLIB0050 + Particle instance = (Particle)FormatterServices.GetUninitializedObject(type); +#pragma warning restore SYSLIB0050 string texturePath = type.Namespace.Replace('.', '/') + "/" + type.Name; if (instance.Texture != "") @@ -54,7 +58,6 @@ namespace CalamityMod.Particles particlesToKill = []; particleTypes = []; particleTextures = []; - particleInstances = []; batchedAlphaBlendParticles = []; batchedNonPremultipliedParticles = []; @@ -68,7 +71,6 @@ namespace CalamityMod.Particles particlesToKill = null; particleTypes = null; particleTextures = null; - particleInstances = null; batchedAlphaBlendParticles = null; batchedNonPremultipliedParticles = null; From 9bfc1eaba1ca87eb414558bec4f79858ae8f9956 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Wed, 18 Sep 2024 00:06:17 +0900 Subject: [PATCH 087/133] Updated Comments --- CalamityMod.cs | 2 +- Particles/GeneralParticleHandler.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CalamityMod.cs b/CalamityMod.cs index 3889d4a7d8..590d8779bd 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -127,7 +127,7 @@ namespace CalamityMod { carpetOriginal = TextureAssets.FlyingCarpet; - // I hate this I hate thisI hate thisIhatethisIhatethisIhatethisIhatethisIhatethisIhatethis + // Initialize the CalamityLists as this is coupled in tons of other type CalamityLists.Load(); // Initialize the EnemyStats struct as early as it is safe to do so diff --git a/Particles/GeneralParticleHandler.cs b/Particles/GeneralParticleHandler.cs index 5781c50b2a..d37925abd5 100644 --- a/Particles/GeneralParticleHandler.cs +++ b/Particles/GeneralParticleHandler.cs @@ -36,9 +36,9 @@ namespace CalamityMod.Particles int ID = particleTypes.Count; //Get the ID of the particle particleTypes[type] = ID; - // Flow: 2024/08/17 - // 'UnintializedObject' is allowed to use here as it's only read for Texture - // But Do NOT EVER use it's instance as it's literally Uninitialized. + // Flow: 2024/09/17 + // 'UnintializedObject' is allowed to use here as it's only read for Texture string Property + // But do NOT EVER use it's instance as they are literally Uninitialized. // It might cause unintended behaviour if we do that. #pragma warning disable SYSLIB0050 Particle instance = (Particle)FormatterServices.GetUninitializedObject(type); From 8a7bbdc80e93b9f3d47d07b69d49f73ed6a79d54 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Wed, 18 Sep 2024 00:27:13 +0900 Subject: [PATCH 088/133] Moved AuricCarpet Replacement to ExtraTextureRefs --- CalPlayer/CalamityPlayerMiscEffects.cs | 5 +++-- CalamityMod.cs | 10 ---------- ExtraTextures/ExtraTextureRefs.cs | 14 +++++++++++++- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 5bb0b081e5..b17575ad8e 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -13,6 +13,7 @@ using CalamityMod.CustomRecipes; using CalamityMod.DataStructures; using CalamityMod.Dusts; using CalamityMod.Events; +using CalamityMod.ExtraTextures; using CalamityMod.Items; using CalamityMod.Items.Accessories; using CalamityMod.Items.Ammo; @@ -787,8 +788,8 @@ namespace CalamityMod.CalPlayer // Update Carpet textures if (Main.netMode != NetmodeID.Server && Player.whoAmI == Main.myPlayer) { - Asset carpetAuric = ModContent.Request("CalamityMod/ExtraTextures/AuricCarpet"); - Asset carpetOriginal = CalamityMod.carpetOriginal; + Asset carpetAuric = ExtraTextureRefs.FlyingCarpetAuric; + Asset carpetOriginal = ExtraTextureRefs.FlyingCarpetVanilla; TextureAssets.FlyingCarpet = (auricSet ? carpetAuric : carpetOriginal); } diff --git a/CalamityMod.cs b/CalamityMod.cs index 590d8779bd..72b70bacf1 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -84,8 +84,6 @@ namespace CalamityMod public static int ghostKillCount = 0; public static int sharkKillCount = 0; - public static Asset carpetOriginal; - // Holds the Texture Arrays for all the lava textures. // These are used for the lava styles. They are seperate from Textureasset.Instance._liquidTexture as they will conflict with ModWaterStyle // Can hold up to 255 lava styles (more than enough) (excluding the normal lava texture which is liquidTexture 1) @@ -125,8 +123,6 @@ namespace CalamityMod #region Load public override void Load() { - carpetOriginal = TextureAssets.FlyingCarpet; - // Initialize the CalamityLists as this is coupled in tons of other type CalamityLists.Load(); @@ -204,12 +200,6 @@ namespace CalamityMod Main.OnPreDraw -= PrepareRenderTargets; }); - if (!Main.dedServ) - { - TextureAssets.FlyingCarpet = carpetOriginal; - } - - carpetOriginal = null; _Instance = null; base.Unload(); } diff --git a/ExtraTextures/ExtraTextureRefs.cs b/ExtraTextures/ExtraTextureRefs.cs index 29ffcdbfbe..9928fb7067 100644 --- a/ExtraTextures/ExtraTextureRefs.cs +++ b/ExtraTextures/ExtraTextureRefs.cs @@ -5,6 +5,8 @@ using System.Text; using System.Threading.Tasks; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; +using Terraria; +using Terraria.GameContent; using Terraria.ModLoader; namespace CalamityMod.ExtraTextures @@ -24,6 +26,10 @@ namespace CalamityMod.ExtraTextures public static Asset WallOfFleshEyeGlowmask; public static Asset WallOfFleshDemonSickleTexture; + // Flying Carpet Replacements + public static Asset FlyingCarpetVanilla; + public static Asset FlyingCarpetAuric; + public override void OnModLoad() { DestroyerGlowmasks[0] = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerHeadGlow", AssetRequestMode.AsyncLoad); @@ -37,11 +43,17 @@ namespace CalamityMod.ExtraTextures WallOfFleshEyeGlowmask = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/WallOfFleshEyeTelegraphGlow", AssetRequestMode.AsyncLoad); WallOfFleshDemonSickleTexture = ModContent.Request("CalamityMod/Projectiles/Melee/ForbiddenOathbladeProjectile", AssetRequestMode.AsyncLoad); + + FlyingCarpetVanilla = TextureAssets.FlyingCarpet; + FlyingCarpetAuric = ModContent.Request("CalamityMod/ExtraTextures/AuricCarpet", AssetRequestMode.AsyncLoad); } public override void Unload() { - + if (!Main.dedServ) + { + TextureAssets.FlyingCarpet = FlyingCarpetVanilla; + } } } } From b44522d10abea163263f69946e6dbc752ae148d2 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Wed, 18 Sep 2024 00:30:27 +0900 Subject: [PATCH 089/133] Replaced DestroyerGlowmasks to each segments name variable --- ExtraTextures/ExtraTextureRefs.cs | 10 ++++++---- NPCs/CalamityGlobalNPC.cs | 6 +++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ExtraTextures/ExtraTextureRefs.cs b/ExtraTextures/ExtraTextureRefs.cs index 9928fb7067..b00b82d6b6 100644 --- a/ExtraTextures/ExtraTextureRefs.cs +++ b/ExtraTextures/ExtraTextureRefs.cs @@ -15,7 +15,9 @@ namespace CalamityMod.ExtraTextures internal sealed class ExtraTextureRefs : ModSystem { // Destroyer glowmasks - public static Asset[] DestroyerGlowmasks = new Asset[3]; + public static Asset DestroyerHeadGlowmask; + public static Asset DestroyerBodyGlowmask; + public static Asset DestroyerTailGlowmask; public static Asset ProbeGlowmask; // Master Rev+ Skeletron Prime @@ -32,9 +34,9 @@ namespace CalamityMod.ExtraTextures public override void OnModLoad() { - DestroyerGlowmasks[0] = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerHeadGlow", AssetRequestMode.AsyncLoad); - DestroyerGlowmasks[1] = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerBodyGlow", AssetRequestMode.AsyncLoad); - DestroyerGlowmasks[2] = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerTailGlow", AssetRequestMode.AsyncLoad); + DestroyerHeadGlowmask = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerHeadGlow", AssetRequestMode.AsyncLoad); + DestroyerBodyGlowmask = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerBodyGlow", AssetRequestMode.AsyncLoad); + DestroyerTailGlowmask = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerTailGlow", AssetRequestMode.AsyncLoad); ProbeGlowmask = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/ProbeGlow", AssetRequestMode.AsyncLoad); diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index b93934cc0c..5053ff924d 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -7658,7 +7658,7 @@ namespace CalamityMod.NPCs } } - Texture2D glowTexture = CalamityClientConfig.Instance.NewVanillaTextures ? ExtraTextureRefs.DestroyerGlowmasks[0].Value : TextureAssets.Dest[0].Value; + Texture2D glowTexture = CalamityClientConfig.Instance.NewVanillaTextures ? ExtraTextureRefs.DestroyerHeadGlowmask.Value : TextureAssets.Dest[0].Value; switch (npc.type) { default: @@ -7666,11 +7666,11 @@ namespace CalamityMod.NPCs break; case NPCID.TheDestroyerBody: - glowTexture = CalamityClientConfig.Instance.NewVanillaTextures ? ExtraTextureRefs.DestroyerGlowmasks[1].Value : TextureAssets.Dest[1].Value; + glowTexture = CalamityClientConfig.Instance.NewVanillaTextures ? ExtraTextureRefs.DestroyerBodyGlowmask.Value : TextureAssets.Dest[1].Value; break; case NPCID.TheDestroyerTail: - glowTexture = CalamityClientConfig.Instance.NewVanillaTextures ? ExtraTextureRefs.DestroyerGlowmasks[2].Value : TextureAssets.Dest[2].Value; + glowTexture = CalamityClientConfig.Instance.NewVanillaTextures ? ExtraTextureRefs.DestroyerTailGlowmask.Value : TextureAssets.Dest[2].Value; break; } From 07b67b5e8e82a7a5204754022f866de195314c08 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Wed, 18 Sep 2024 00:45:17 +0900 Subject: [PATCH 090/133] SpeedrunTimer as separate System --- CalPlayer/CalamityPlayer.cs | 4 +- CalamityMod.cs | 3 -- NPCs/CalamityGlobalNPC.cs | 2 +- .../Mechanic/SpeedrunTimerStoppingSystem.cs | 10 ----- Systems/Mechanic/SpeedrunTimerSystem.cs | 43 +++++++++++++++++++ UI/SpeedrunTimerUI.cs | 10 ++--- 6 files changed, 49 insertions(+), 23 deletions(-) delete mode 100644 Systems/Mechanic/SpeedrunTimerStoppingSystem.cs create mode 100644 Systems/Mechanic/SpeedrunTimerSystem.cs diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 3545ef2d27..855748bb5a 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -1405,7 +1405,7 @@ namespace CalamityMod.CalPlayer boost.AddWithCondition("HasCraftedDraedonsForge", HasCraftedDraedonsForge); // Calculate the new total time of all sessions at the instant of this player save. - TimeSpan newSessionTotal = previousSessionTotal.Add(CalamityMod.SpeedrunTimer.Elapsed); + TimeSpan newSessionTotal = previousSessionTotal.Add(SpeedrunTimerSystem.Elapsed); long totalTicks = newSessionTotal.Ticks; // Save all cooldowns which are marked as persisting through save/load. @@ -4998,7 +4998,7 @@ 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 (CalamityClientConfig.Instance.SpeedrunTimer) - CalamityMod.SpeedrunTimer.Restart(); + SpeedrunTimerSystem.Restart(); bool showWikiMessage = CalamityClientConfig.Instance.WikiStatusMessage; bool showVCMMMessage = CalamityClientConfig.Instance.VCMMStatusMessage && !ExternalMods.VCMMAvailable; diff --git a/CalamityMod.cs b/CalamityMod.cs index 72b70bacf1..44d0e9c15c 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -102,9 +102,6 @@ namespace CalamityMod // Boss Kill Time data structure public static SortedDictionary bossKillTimes; - // Speedrun timer - internal static Stopwatch SpeedrunTimer = new Stopwatch(); - #region External Flags // External flag to disable non-Revengeance boss AI edits // This can be edited by other mods using reflection to prevent compatibility issues diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 5053ff924d..66c7b01159 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -8516,7 +8516,7 @@ namespace CalamityMod.NPCs CalamityPlayer mp = player.Calamity(); mp.lastSplitType = newBossTypeJustDowned; - mp.lastSplit = mp.previousSessionTotal.Add(CalamityMod.SpeedrunTimer.Elapsed); + mp.lastSplit = mp.previousSessionTotal.Add(SpeedrunTimerSystem.Elapsed); } } } diff --git a/Systems/Mechanic/SpeedrunTimerStoppingSystem.cs b/Systems/Mechanic/SpeedrunTimerStoppingSystem.cs deleted file mode 100644 index 0923a54879..0000000000 --- a/Systems/Mechanic/SpeedrunTimerStoppingSystem.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Terraria.ModLoader; - -namespace CalamityMod.Systems -{ - // TODO -- Expand this ModSystem to contain the Speedrun Timer itself, as well as the UI. - public class SpeedrunTimerStoppingSystem : ModSystem - { - public override void PreSaveAndQuit() => CalamityMod.SpeedrunTimer?.Stop(); - } -} diff --git a/Systems/Mechanic/SpeedrunTimerSystem.cs b/Systems/Mechanic/SpeedrunTimerSystem.cs new file mode 100644 index 0000000000..0a62f90e60 --- /dev/null +++ b/Systems/Mechanic/SpeedrunTimerSystem.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.CalPlayer; +using Terraria.ModLoader; +using static System.Net.Mime.MediaTypeNames; + +namespace CalamityMod.Systems +{ + internal sealed class SpeedrunTimerSystem : ModSystem + { + public static TimeSpan Elapsed => _SpeedrunTimer.Elapsed; + + private static Stopwatch _SpeedrunTimer = new(); + + private const string FormatStringForDay = @"hh\:mm\:ss\.ff"; + private const string FormatString = @"d\:hh\:mm\:ss\.ff"; + + public static void Restart() + { + _SpeedrunTimer.Restart(); + } + + public static string GetTimerText(CalamityPlayer player) + { + string formatStr = @"hh\:mm\:ss\.ff"; + string formatStrDays = @"d\:hh\:mm\:ss\.ff"; + TimeSpan totalTime = Elapsed.Add(player.previousSessionTotal); + return totalTime.ToString(totalTime.Days > 0 ? formatStrDays : formatStr); + } + + public static string GetSplitText(CalamityPlayer player) + { + TimeSpan split = player.lastSplit; + return split.ToString(split.Days > 0 ? FormatStringForDay : FormatString); + } + + public override void PreSaveAndQuit() => _SpeedrunTimer?.Stop(); + } +} diff --git a/UI/SpeedrunTimerUI.cs b/UI/SpeedrunTimerUI.cs index 7835193f47..19eb113455 100644 --- a/UI/SpeedrunTimerUI.cs +++ b/UI/SpeedrunTimerUI.cs @@ -23,6 +23,7 @@ using CalamityMod.NPCs.Ravager; using CalamityMod.NPCs.Signus; using CalamityMod.NPCs.SlimeGod; using CalamityMod.NPCs.Yharon; +using CalamityMod.Systems; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -32,7 +33,6 @@ using Terraria.ModLoader; namespace CalamityMod.UI { - // TODO -- Combine with SpeedrunTimerStoppingSystem, which should be renamed and call the UI draw code in this file. public class SpeedrunTimerUI { // These values put the Speedrun Timer roughly at the top center of a 1080p screen. @@ -63,10 +63,7 @@ namespace CalamityMod.UI CalamityPlayer calamityPlayer = player.Calamity(); // Main timer - string formatStr = @"hh\:mm\:ss\.ff"; - string formatStrDays = @"d\:hh\:mm\:ss\.ff"; - TimeSpan totalTime = CalamityMod.SpeedrunTimer.Elapsed.Add(calamityPlayer.previousSessionTotal); - string text = totalTime.ToString(totalTime.Days > 0 ? formatStrDays : formatStr); + string text = SpeedrunTimerSystem.GetTimerText(calamityPlayer); float scale = 2f; Utils.DrawBorderStringFourWay(Main.spriteBatch, FontAssets.MouseText.Value, text, screenPos.X, screenPos.Y, Color.White, Color.Black, default, scale); @@ -74,8 +71,7 @@ namespace CalamityMod.UI return; // Latest split - TimeSpan split = calamityPlayer.lastSplit; - text = split.ToString(split.Days > 0 ? formatStrDays : formatStr); + text = SpeedrunTimerSystem.GetSplitText(calamityPlayer); scale = 1f; float lineTwoX = screenPos.X + SplitHorizontalOffset; float lineTwoY = screenPos.Y + SplitVerticalOffset; From d398265e8af8cc02ae628b83225c6be81ebda7f5 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Wed, 18 Sep 2024 01:08:39 +0900 Subject: [PATCH 091/133] Moved NaturalSpawn Boss System Into Separate GlobalNPC --- CalamityMod.cs | 4 - NPCs/CalamityGlobalNPCLoot.cs | 86 ----------------- NPCs/CalamityNaturalSpawnBossNPC.cs | 145 ++++++++++++++++++++++++++++ 3 files changed, 145 insertions(+), 90 deletions(-) create mode 100644 NPCs/CalamityNaturalSpawnBossNPC.cs diff --git a/CalamityMod.cs b/CalamityMod.cs index 44d0e9c15c..8df569c055 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -80,10 +80,6 @@ namespace CalamityMod // These should all be moved to other files, whether that's CalamityLists or brand new ModSystems. // It is best to have a ton of small ModSystems. - // Boss Spawners - public static int ghostKillCount = 0; - public static int sharkKillCount = 0; - // Holds the Texture Arrays for all the lava textures. // These are used for the lava styles. They are seperate from Textureasset.Instance._liquidTexture as they will conflict with ModWaterStyle // Can hold up to 255 lava styles (more than enough) (excluding the normal lava texture which is liquidTexture 1) diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index 3b1fd71f2d..639b336815 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -1767,9 +1767,6 @@ DukeEditFailed: if (npc.AnyInteractions()) SplittingWormBestiaryUpdate(npc); - // Check whether bosses should be spawned naturally as a result of this NPC's death. - CheckBossSpawn(npc); - // Determine whether this NPC is the second Twin killed in a fight, regardless of which Twin it is. bool lastTwinStanding = false; if (npc.type == NPCID.Retinazer) @@ -2138,88 +2135,5 @@ DukeEditFailed: return true; } #endregion - - #region Check Boss Spawn - // TODO -- not loot code, should be moved eventually - private void CheckBossSpawn(NPC npc) - { - if ((npc.type == ModContent.NPCType() || npc.type == ModContent.NPCType() || npc.type == ModContent.NPCType() || - npc.type == ModContent.NPCType()) && !NPC.AnyNPCs(ModContent.NPCType()) && !DownedBossSystem.downedPolterghast) - { - CalamityMod.ghostKillCount++; - if (CalamityMod.ghostKillCount == 10) - { - string key = "Mods.CalamityMod.Status.Boss.GhostBossText2"; - Color messageColor = Color.Cyan; - - CalamityUtils.DisplayLocalizedText(key, messageColor); - } - else if (CalamityMod.ghostKillCount == 20) - { - string key = "Mods.CalamityMod.Status.Boss.GhostBossText3"; - Color messageColor = Color.Cyan; - - CalamityUtils.DisplayLocalizedText(key, messageColor); - } - - if (CalamityMod.ghostKillCount >= 30 && Main.netMode != NetmodeID.MultiplayerClient) - { - int lastPlayer = npc.lastInteraction; - - if (!Main.player[lastPlayer].active || Main.player[lastPlayer].dead) - { - lastPlayer = npc.FindClosestPlayer(); - } - - if (lastPlayer >= 0) - { - SoundEngine.PlaySound(Polterghast.Polterghast.SpawnSound, Main.player[lastPlayer].Center); - NPC.SpawnOnPlayer(lastPlayer, ModContent.NPCType()); - CalamityMod.ghostKillCount = 0; - } - } - } - - bool normalShark = npc.type == NPCID.SandShark || npc.type == NPCID.SandsharkHallow || npc.type == NPCID.SandsharkCorrupt || npc.type == NPCID.SandsharkCrimson; - if (NPC.downedPlantBoss && (normalShark || (npc.type == ModContent.NPCType() && Main.zenithWorld)) && !NPC.AnyNPCs(ModContent.NPCType())) - { - CalamityMod.sharkKillCount++; - if (CalamityMod.sharkKillCount == 4) - { - string key = "Mods.CalamityMod.Status.Boss.SandSharkText"; - Color messageColor = Color.Goldenrod; - - CalamityUtils.DisplayLocalizedText(key, messageColor); - } - else if (CalamityMod.sharkKillCount == 8) - { - string key = "Mods.CalamityMod.Status.Boss.SandSharkText2"; - Color messageColor = Color.Goldenrod; - - CalamityUtils.DisplayLocalizedText(key, messageColor); - } - if (CalamityMod.sharkKillCount >= 10 && Main.netMode != NetmodeID.MultiplayerClient) - { - if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active) - { - SoundEngine.PlaySound(Mauler.RoarSound, Main.player[Main.myPlayer].Center); - } - - int lastPlayer = npc.lastInteraction; - - if (!Main.player[lastPlayer].active || Main.player[lastPlayer].dead) - { - lastPlayer = npc.FindClosestPlayer(); - } - - if (lastPlayer >= 0) - { - NPC.SpawnOnPlayer(lastPlayer, ModContent.NPCType()); - CalamityMod.sharkKillCount = -5; - } - } - } - } - #endregion } } diff --git a/NPCs/CalamityNaturalSpawnBossNPC.cs b/NPCs/CalamityNaturalSpawnBossNPC.cs new file mode 100644 index 0000000000..8de7c431c4 --- /dev/null +++ b/NPCs/CalamityNaturalSpawnBossNPC.cs @@ -0,0 +1,145 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.NPCs.AcidRain; +using CalamityMod.NPCs.Astral; +using CalamityMod.NPCs.NormalNPCs; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.NPCs +{ + public sealed class CalamityNaturalSpawnBossNPC : GlobalNPC + { + public override bool InstancePerEntity => false; + + public static int ghostKillCount = 0; + public static int sharkKillCount = 0; + + private static int[] _PolterghastTriggerNPCS; + private static int[] _GreatSharkTriggerNPCS; + + public override void SetStaticDefaults() + { + _PolterghastTriggerNPCS = [ + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType() + ]; + + _GreatSharkTriggerNPCS = [ + NPCID.SandShark, + NPCID.SandsharkHallow, + NPCID.SandsharkCorrupt, + NPCID.SandsharkCrimson, + // ModContent.NPCType() Uncomment this once we have one + ]; + } + + public override void OnKill(NPC npc) + { + CheckPolterghastCondition(npc); + CheckGreatSandSharkCondition(npc); + } + + private static void CheckPolterghastCondition(NPC slainedNPC) + { + if (DownedBossSystem.downedPolterghast) + return; + + if (NPC.AnyNPCs(ModContent.NPCType())) + return; + + if (!_PolterghastTriggerNPCS.Contains(slainedNPC.type)) + return; + + ghostKillCount++; + if (ghostKillCount == 10) + { + string key = "Mods.CalamityMod.Status.Boss.GhostBossText2"; + Color messageColor = Color.Cyan; + + CalamityUtils.DisplayLocalizedText(key, messageColor); + } + else if (ghostKillCount == 20) + { + string key = "Mods.CalamityMod.Status.Boss.GhostBossText3"; + Color messageColor = Color.Cyan; + + CalamityUtils.DisplayLocalizedText(key, messageColor); + } + + if (ghostKillCount >= 30 && Main.netMode != NetmodeID.MultiplayerClient) + { + int lastPlayer = slainedNPC.lastInteraction; + + if (!Main.player[lastPlayer].active || Main.player[lastPlayer].dead) + { + lastPlayer = slainedNPC.FindClosestPlayer(); + } + + if (lastPlayer >= 0) + { + SoundEngine.PlaySound(Polterghast.Polterghast.SpawnSound, Main.player[lastPlayer].Center); + NPC.SpawnOnPlayer(lastPlayer, ModContent.NPCType()); + ghostKillCount = 0; + } + } + } + + private static void CheckGreatSandSharkCondition(NPC slainedNPC) + { + if (!NPC.downedPlantBoss) + return; + + if (NPC.AnyNPCs(ModContent.NPCType())) + return; + + var fusionShark = slainedNPC.type == ModContent.NPCType() && Main.zenithWorld; + if (!_GreatSharkTriggerNPCS.Contains(slainedNPC.type) && !fusionShark) + return; + + sharkKillCount++; + if (sharkKillCount == 4) + { + string key = "Mods.CalamityMod.Status.Boss.SandSharkText"; + Color messageColor = Color.Goldenrod; + + CalamityUtils.DisplayLocalizedText(key, messageColor); + } + else if (sharkKillCount == 8) + { + string key = "Mods.CalamityMod.Status.Boss.SandSharkText2"; + Color messageColor = Color.Goldenrod; + + CalamityUtils.DisplayLocalizedText(key, messageColor); + } + if (sharkKillCount >= 10 && Main.netMode != NetmodeID.MultiplayerClient) + { + if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active) + { + SoundEngine.PlaySound(Mauler.RoarSound, Main.player[Main.myPlayer].Center); + } + + int lastPlayer = slainedNPC.lastInteraction; + + if (!Main.player[lastPlayer].active || Main.player[lastPlayer].dead) + { + lastPlayer = slainedNPC.FindClosestPlayer(); + } + + if (lastPlayer >= 0) + { + NPC.SpawnOnPlayer(lastPlayer, ModContent.NPCType()); + sharkKillCount = -5; + } + } + } + } +} From cbe6752bd9f3d5ed1428846164151446a51feedc Mon Sep 17 00:00:00 2001 From: Flowaria Date: Wed, 18 Sep 2024 01:10:53 +0900 Subject: [PATCH 092/133] Added Proper Unload --- NPCs/CalamityNaturalSpawnBossNPC.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/NPCs/CalamityNaturalSpawnBossNPC.cs b/NPCs/CalamityNaturalSpawnBossNPC.cs index 8de7c431c4..7d49b2e894 100644 --- a/NPCs/CalamityNaturalSpawnBossNPC.cs +++ b/NPCs/CalamityNaturalSpawnBossNPC.cs @@ -26,6 +26,9 @@ namespace CalamityMod.NPCs public override void SetStaticDefaults() { + ghostKillCount = 0; + sharkKillCount = 0; + _PolterghastTriggerNPCS = [ ModContent.NPCType(), ModContent.NPCType(), @@ -37,11 +40,16 @@ namespace CalamityMod.NPCs NPCID.SandShark, NPCID.SandsharkHallow, NPCID.SandsharkCorrupt, - NPCID.SandsharkCrimson, - // ModContent.NPCType() Uncomment this once we have one + NPCID.SandsharkCrimson ]; } + public override void Unload() + { + _PolterghastTriggerNPCS = null; + _GreatSharkTriggerNPCS = null; + } + public override void OnKill(NPC npc) { CheckPolterghastCondition(npc); @@ -101,8 +109,8 @@ namespace CalamityMod.NPCs if (NPC.AnyNPCs(ModContent.NPCType())) return; - var fusionShark = slainedNPC.type == ModContent.NPCType() && Main.zenithWorld; - if (!_GreatSharkTriggerNPCS.Contains(slainedNPC.type) && !fusionShark) + var fusionFeeder = slainedNPC.type == ModContent.NPCType() && Main.zenithWorld; + if (!_GreatSharkTriggerNPCS.Contains(slainedNPC.type) && !fusionFeeder) return; sharkKillCount++; From 40b269ee30fdc8438a2f724ac455c5c1cda579e1 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Wed, 18 Sep 2024 01:27:12 +0900 Subject: [PATCH 093/133] CalamityList And BalancingChangesManager as ModSystem --- Balancing/BalancingChangesManager.cs | 7 +++---- CalamityLists.cs | 6 +++--- CalamityMod.cs | 7 ------- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/Balancing/BalancingChangesManager.cs b/Balancing/BalancingChangesManager.cs index 3e10e83716..fafcb926b9 100644 --- a/Balancing/BalancingChangesManager.cs +++ b/Balancing/BalancingChangesManager.cs @@ -26,8 +26,7 @@ using static Terraria.ModLoader.ModContent; namespace CalamityMod.Balancing { - // TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks. - public static class BalancingChangesManager + public sealed class BalancingChangesManager : ModSystem { internal static List UniversalBalancingChanges = null; internal static List NPCSpecificBalancingChanges = null; @@ -36,7 +35,7 @@ namespace CalamityMod.Balancing // For ease of change, changes that are not exclusive to one specific weapon are not bundled into one line if they share the same resistance factor. // To give an example of this, Thanatos having a 50% resist to Chicken Cannon and Prismatic Breaker should be two distinct lines with a 0.5x factor instead of hamfisting them all // into one single resist that may have to be split later. - internal static void Load() + public override void SetStaticDefaults() { // Dirty shorthand for true melee resists, because they're super common and other class resists aren't. IBalancingRule ResistTrueMelee(float f) => new ClassResistBalancingRule(f, TrueMeleeDamageClass.Instance); @@ -522,7 +521,7 @@ namespace CalamityMod.Balancing #endregion } - internal static void Unload() + public override void Unload() { UniversalBalancingChanges = null; NPCSpecificBalancingChanges = null; diff --git a/CalamityLists.cs b/CalamityLists.cs index 192a9b3ef1..dfc7d9cfb2 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -77,7 +77,7 @@ using static Terraria.ModLoader.ModContent; namespace CalamityMod { - public static class CalamityLists + public sealed class CalamityLists : ModSystem { public static IList donatorList; public static List projectileDestroyExceptionList; @@ -157,7 +157,7 @@ namespace CalamityMod public static List VeneratedLocketBanlist; //To ban projectiles from locket, mainly spikeballs altho Toasty asked me to add mod calls for adding stuff like Dreamtastic - public static void Load() + public override void OnModLoad() { donatorList = new List() { @@ -2715,7 +2715,7 @@ namespace CalamityMod }; } - public static void Unload() + public override void Unload() { donatorList = null; projectileDestroyExceptionList = null; diff --git a/CalamityMod.cs b/CalamityMod.cs index 8df569c055..39a6be1dcc 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -116,9 +116,6 @@ namespace CalamityMod #region Load public override void Load() { - // Initialize the CalamityLists as this is coupled in tons of other type - CalamityLists.Load(); - // Initialize the EnemyStats struct as early as it is safe to do so NPCStats.Load(); @@ -142,7 +139,6 @@ namespace CalamityMod LavaRendering.instance = new LavaRendering(); Attunement.Load(); - BalancingChangesManager.Load(); BaseIdleHoldoutProjectile.LoadAll(); PlayerDashManager.Load(); } @@ -173,9 +169,6 @@ namespace CalamityMod bossKillTimes?.Clear(); bossKillTimes = null; - CalamityLists.Unload(); - - BalancingChangesManager.Unload(); Attunement.Unload(); EnchantmentManager.UnloadAllEnchantments(); VanillaArmorChangeManager.Unload(); From 64a0223fcccadaa7c07dd53392a2fd7ff41affcd Mon Sep 17 00:00:00 2001 From: Flowaria Date: Wed, 18 Sep 2024 01:38:52 +0900 Subject: [PATCH 094/133] InvasionProgressUIManager as ModSystem --- CalamityMod.cs | 3 --- UI/InvasionProgressUIManager.cs | 26 +++++++++++++------------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/CalamityMod.cs b/CalamityMod.cs index 39a6be1dcc..dffe7863ae 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -158,8 +158,6 @@ namespace CalamityMod { Main.OnPreDraw += PrepareRenderTargets; }); - - InvasionProgressUIManager.LoadGUIs(); } #endregion @@ -177,7 +175,6 @@ namespace CalamityMod CalamityGlobalProjectile.UnloadTweaks(); PopupGUIManager.UnloadGUIs(); - InvasionProgressUIManager.UnloadGUIs(); SchematicManager.Unload(); PlayerDashManager.Unload(); diff --git a/UI/InvasionProgressUIManager.cs b/UI/InvasionProgressUIManager.cs index 4c037c5a74..73d9af3532 100644 --- a/UI/InvasionProgressUIManager.cs +++ b/UI/InvasionProgressUIManager.cs @@ -2,14 +2,15 @@ using System.Collections.Generic; using System.Linq; using Microsoft.Xna.Framework.Graphics; +using Terraria.ModLoader; using Terraria.ModLoader.Core; namespace CalamityMod.UI { - // TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks. - public static class InvasionProgressUIManager + [Autoload(Side = ModSide.Client)] + public sealed class InvasionProgressUIManager : ModSystem { - private static readonly List gUIs = new List(); + private static readonly List gUIs = []; public static int TotalGUIsActive => gUIs.Count(gui => gui.IsActive); public static bool AnyGUIsActive => TotalGUIsActive > 0; public static InvasionProgressUI GetActiveGUI => gUIs.FirstOrDefault(gui => gui.IsActive); @@ -23,19 +24,18 @@ namespace CalamityMod.UI } } - public static void LoadGUIs() + public override void OnModLoad() { // Look through every type in the mod, and check if it's derived from InvasionProgressUI. If it is, create a copy and save it in the static list. - Type[] types = AssemblyManager.GetLoadableTypes(CalamityMod.Instance.Code); - foreach (Type type in types) + ReflectionHelper.IterateCalamityModTypes(includeBaseType: false, type => { - // Don't load abstract classes since they cannot have instances. - if (type.IsAbstract) - continue; - if (type.IsSubclassOf(typeof(InvasionProgressUI))) - gUIs.Add(Activator.CreateInstance(type) as InvasionProgressUI); - } + gUIs.Add(Activator.CreateInstance(type) as InvasionProgressUI); + }); + } + + public override void Unload() + { + gUIs?.Clear(); } - public static void UnloadGUIs() => gUIs.Clear(); } } From 6c313fe4dc4af49c85957d8ad1fc22ffe959b796 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Wed, 18 Sep 2024 01:40:07 +0900 Subject: [PATCH 095/133] SchematicManager as ModSystem --- CalamityMod.cs | 2 -- Schematics/SchematicManager.cs | 8 ++++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CalamityMod.cs b/CalamityMod.cs index dffe7863ae..c8789b9cbc 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -133,7 +133,6 @@ namespace CalamityMod EnchantmentManager.LoadAllEnchantments(); VanillaArmorChangeManager.Load(); SetupBossKillTimes(); - SchematicManager.Load(); //lava LavaRendering.instance = new LavaRendering(); @@ -175,7 +174,6 @@ namespace CalamityMod CalamityGlobalProjectile.UnloadTweaks(); PopupGUIManager.UnloadGUIs(); - SchematicManager.Unload(); PlayerDashManager.Unload(); Main.QueueMainThreadAction(() => diff --git a/Schematics/SchematicManager.cs b/Schematics/SchematicManager.cs index 44eb788302..1779d963b0 100644 --- a/Schematics/SchematicManager.cs +++ b/Schematics/SchematicManager.cs @@ -10,8 +10,7 @@ using Terraria.ModLoader; namespace CalamityMod.Schematics { - // TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks. - public static class SchematicManager + public sealed class SchematicManager : ModSystem { internal const string RustedWorkshopKey = "Rusted Workshop"; internal const string RustedWorkshopFilename = "Schematics/RustedWorkshop.csch"; @@ -96,7 +95,7 @@ namespace CalamityMod.Schematics public delegate void PilePlacementFunction(int x, int y, Rectangle placeInArea); #region Load/Unload - internal static void Load() + public override void OnModLoad() { PilePlacementMaps = new Dictionary(); TileMaps = new Dictionary @@ -152,7 +151,8 @@ namespace CalamityMod.Schematics ["Sulphurous Scrap 7"] = CalamitySchematicIO.LoadSchematic("Schematics/SulphurousScrap7.csch").ShaveOffEdge(), }; } - internal static void Unload() + + public override void Unload() { TileMaps = null; PilePlacementMaps = null; From 8aca68a99e9efde27517074c1efa1488f68ce6f5 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Wed, 18 Sep 2024 01:55:42 +0900 Subject: [PATCH 096/133] EnchantmentManager as ModSystem, LoadClient goes byebye --- CalamityMod.cs | 31 +++++++------------ .../EnchantmentManager.cs | 7 ++--- 2 files changed, 14 insertions(+), 24 deletions(-) diff --git a/CalamityMod.cs b/CalamityMod.cs index c8789b9cbc..9114e1694e 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -125,12 +125,21 @@ namespace CalamityMod if (!Main.dedServ) { - LoadClient(); + // Lava Texture + LavaTextures.liquid[0] = LiquidRenderer.Instance._liquidTextures[1]; + LavaTextures.slope[0] = TextureAssets.LiquidSlope[1]; + LavaTextures.block[0] = TextureAssets.Liquid[1]; + var waterfallTexture = (Asset[])typeof(WaterfallManager).GetField("waterfallTexture", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public).GetValue(Main.instance.waterfallManager); + LavaTextures.fall[0] = waterfallTexture[1]; + PrimitiveRenderer.Initialize(); ForegroundDrawing.ForegroundManager.Load(); + + // This must be done separately from immediate loading, as loading is now multithreaded. + // However, render targets and certain other graphical objects can only be created on the main thread. + Main.QueueMainThreadAction(() => Main.OnPreDraw += PrepareRenderTargets); } - EnchantmentManager.LoadAllEnchantments(); VanillaArmorChangeManager.Load(); SetupBossKillTimes(); @@ -141,23 +150,6 @@ namespace CalamityMod BaseIdleHoldoutProjectile.LoadAll(); PlayerDashManager.Load(); } - - private void LoadClient() - { - // Lava Texture - LavaTextures.liquid[0] = LiquidRenderer.Instance._liquidTextures[1]; - LavaTextures.slope[0] = TextureAssets.LiquidSlope[1]; - LavaTextures.block[0] = TextureAssets.Liquid[1]; - var waterfallTexture = (Asset[])typeof(WaterfallManager).GetField("waterfallTexture", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public).GetValue(Main.instance.waterfallManager); - LavaTextures.fall[0] = waterfallTexture[1]; - - // This must be done separately from immediate loading, as loading is now multithreaded. - // However, render targets and certain other graphical objects can only be created on the main thread. - Main.QueueMainThreadAction(() => - { - Main.OnPreDraw += PrepareRenderTargets; - }); - } #endregion #region Unload @@ -167,7 +159,6 @@ namespace CalamityMod bossKillTimes = null; Attunement.Unload(); - EnchantmentManager.UnloadAllEnchantments(); VanillaArmorChangeManager.Unload(); NPCStats.Unload(); CalamityGlobalItem.UnloadTweaks(); diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index ea58ed2b90..86de4cc8d0 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -16,8 +16,7 @@ using Terraria.ModLoader; namespace CalamityMod.UI.CalamitasEnchants { - // TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks. - public static class EnchantmentManager + public sealed class EnchantmentManager : ModSystem { internal const int ClearEnchantmentID = -18591774; internal const string ExhumedNamePath = "UI.Exhumed.DisplayName"; @@ -145,7 +144,7 @@ namespace CalamityMod.UI.CalamitasEnchants EnchantmentList.Add(new Enchantment(name, description, id, iconTexturePathElement, creationEffect, holdEffect, requirement)); } - internal static void LoadAllEnchantments() + public override void OnModLoad() { EnchantmentList = new List { @@ -322,7 +321,7 @@ namespace CalamityMod.UI.CalamitasEnchants }; } - internal static void UnloadAllEnchantments() + public override void Unload() { EnchantmentList = null; ItemUpgradeRelationship = null; From b9ba682e5285bb10c00924a128ed76e19e1efb9a Mon Sep 17 00:00:00 2001 From: Flowaria Date: Wed, 18 Sep 2024 02:06:14 +0900 Subject: [PATCH 097/133] ForegroundManager goes byebye --- CalamityMod.cs | 1 - ForegroundDrawing/ForegroundManager.cs | 53 -------------------------- ILEditing/ILChangesLoading.cs | 2 - ILEditing/MechanicILChanges.cs | 17 --------- 4 files changed, 73 deletions(-) delete mode 100644 ForegroundDrawing/ForegroundManager.cs diff --git a/CalamityMod.cs b/CalamityMod.cs index 9114e1694e..5db30ffa7e 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -133,7 +133,6 @@ namespace CalamityMod LavaTextures.fall[0] = waterfallTexture[1]; PrimitiveRenderer.Initialize(); - ForegroundDrawing.ForegroundManager.Load(); // This must be done separately from immediate loading, as loading is now multithreaded. // However, render targets and certain other graphical objects can only be created on the main thread. diff --git a/ForegroundDrawing/ForegroundManager.cs b/ForegroundDrawing/ForegroundManager.cs deleted file mode 100644 index 88259a63b5..0000000000 --- a/ForegroundDrawing/ForegroundManager.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.Serialization; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria; -using Terraria.ModLoader; -using Terraria.ModLoader.Core; - -namespace CalamityMod.ForegroundDrawing -{ - interface IForegroundTile - { - void ForegroundDraw(int x, int y, SpriteBatch spriteBatch); - } - - public static class ForegroundManager - { - private static List _foregroundElements; - private static int _foregroundElementCount; - - internal static void Load() - { - _foregroundElements = new List(1000); - _foregroundElementCount = 0; - } - - public static void AddForegroundDrawingPoint(int x, int y) - { - _foregroundElements.Add(new Point(x, y)); - _foregroundElementCount++; - } - - - public static void DrawTiles() - { - for (int i = 0; i < _foregroundElementCount; i++) - { - ushort type = Main.tile[_foregroundElements[i]].TileType; - if (TileLoader.GetTile(type) is IForegroundTile fgTile) - fgTile.ForegroundDraw(_foregroundElements[i].X, _foregroundElements[i].Y, Main.spriteBatch); - } - } - - public static void ClearTiles() - { - _foregroundElements.Clear(); - _foregroundElementCount = 0; - } - } -} diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index ed937d04e1..6a95de896b 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -40,11 +40,9 @@ namespace CalamityMod.ILEditing // Graphics IL_Main.DoDraw += AdditiveDrawing; IL_Main.DoDraw += DrawFloralParadiseFog; - On_Main.DrawGore += DrawForegroundStuff; On_Main.DrawCursor += UseCoolFireCursorEffect; On_Main.SortDrawCacheWorms += DrawFusableParticles; On_Main.DrawInfernoRings += DrawForegroundParticles; - On_TileDrawing.PreDrawTiles += ClearForegroundStuff; On_TileDrawing.Draw += ClearTilePings; On_CommonCode.ModifyItemDropFromNPC += ColorBlightedGel; diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index 1b5c6c7e4a..3be2411085 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -1517,23 +1517,6 @@ namespace CalamityMod.ILEditing } #endregion - #region Foreground tiles drawing - private static void DrawForegroundStuff(Terraria.On_Main.orig_DrawGore orig, Main self) - { - orig(self); - if (Main.PlayerLoaded && !Main.gameMenu) - ForegroundManager.DrawTiles(); - } - - private static void ClearForegroundStuff(On_TileDrawing.orig_PreDrawTiles orig, TileDrawing self, bool solidLayer, bool forRenderTargets, bool intoRenderTargets) - { - orig(self, solidLayer, forRenderTargets, intoRenderTargets); - - if (!solidLayer && (intoRenderTargets || Lighting.UpdateEveryFrame)) - ForegroundManager.ClearTiles(); - } - #endregion - #region Tile ping overlay private static void ClearTilePings(On_TileDrawing.orig_Draw orig, TileDrawing self, bool solidLayer, bool forRenderTargets, bool intoRenderTargets, int waterStyleOverride) { From d9195c3ef4d9cb4abd24f8a41c18855a32a64816 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Wed, 18 Sep 2024 13:21:41 +0900 Subject: [PATCH 098/133] Attunement as AttunementSystem --- CalamityMod.cs | 2 - DataStructures/Attunement.cs | 18 ------ Items/Weapons/Melee/BrokenBiomeBlade.cs | 28 ++++++--- Items/Weapons/Melee/FourSeasonsGalaxia.cs | 26 ++++++--- Items/Weapons/Melee/OmegaBiomeBlade.cs | 28 ++++++--- Items/Weapons/Melee/TrueBiomeBlade.cs | 28 ++++++--- Projectiles/Melee/BiomeBladeHoldout.cs | 17 +++--- Projectiles/Melee/BrokenBiomeBladeHoldout.cs | 11 ++-- Projectiles/Melee/GalaxiaHoldout.cs | 51 +++++++---------- Projectiles/Melee/TrueBiomeBladeHoldout.cs | 13 +++-- Systems/Mechanic/AttunementSystem.cs | 60 ++++++++++++++++++++ 11 files changed, 182 insertions(+), 100 deletions(-) create mode 100644 Systems/Mechanic/AttunementSystem.cs diff --git a/CalamityMod.cs b/CalamityMod.cs index 5db30ffa7e..a6132981da 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -145,7 +145,6 @@ namespace CalamityMod //lava LavaRendering.instance = new LavaRendering(); - Attunement.Load(); BaseIdleHoldoutProjectile.LoadAll(); PlayerDashManager.Load(); } @@ -157,7 +156,6 @@ namespace CalamityMod bossKillTimes?.Clear(); bossKillTimes = null; - Attunement.Unload(); VanillaArmorChangeManager.Unload(); NPCStats.Unload(); CalamityGlobalItem.UnloadTweaks(); diff --git a/DataStructures/Attunement.cs b/DataStructures/Attunement.cs index 10b5087a54..11a9f82344 100644 --- a/DataStructures/Attunement.cs +++ b/DataStructures/Attunement.cs @@ -22,24 +22,6 @@ namespace CalamityMod.DataStructures // TODO -- Attunements should be managed by an Attunement ModSystem public abstract class Attunement { - public static Attunement[] attunementArray; - - public static void Load() - { - attunementArray = new Attunement[] { - new DefaultAttunement(), new HotAttunement(), new ColdAttunement(), new TropicalAttunement(), new EvilAttunement(), - new TrueDefaultAttunement(), new TrueHotAttunement(), new TrueColdAttunement(), new TrueTropicalAttunement(), new TrueEvilAttunement(), new HolyAttunement(), new AstralAttunement(), new MarineAttunement(), - new WhirlwindAttunement(), new FlailBladeAttunement(), new SuperPogoAttunement(), new ShockwaveAttunement(), - new PhoenixAttunement(), new AriesAttunement(), new PolarisAttunement(), new AndromedaAttunement(), - null - }; - } - - public static void Unload() - { - attunementArray = null; - } - public AttunementID id; public virtual LocalizedText AttunementName => CalamityUtils.GetText($"Attunement.{GetType().Name}.Name"); diff --git a/Items/Weapons/Melee/BrokenBiomeBlade.cs b/Items/Weapons/Melee/BrokenBiomeBlade.cs index ebd82fb459..d11e875d7a 100644 --- a/Items/Weapons/Melee/BrokenBiomeBlade.cs +++ b/Items/Weapons/Melee/BrokenBiomeBlade.cs @@ -6,6 +6,7 @@ using CalamityMod.DataStructures; using CalamityMod.Items.Materials; using CalamityMod.Particles; using CalamityMod.Projectiles.Melee; +using CalamityMod.Systems; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -169,8 +170,8 @@ namespace CalamityMod.Items.Weapons.Melee int attunement1 = tag.GetInt("mainAttunement"); int attunement2 = tag.GetInt("secondaryAttunement"); - mainAttunement = Attunement.attunementArray[attunement1 != -1 ? attunement1 : Attunement.attunementArray.Length - 1]; - secondaryAttunement = Attunement.attunementArray[attunement2 != -1 ? attunement2 : Attunement.attunementArray.Length - 1]; + mainAttunement = AttunementSystem.FindOrNull(attunement1); + secondaryAttunement = AttunementSystem.FindOrNull(attunement2); if (mainAttunement == secondaryAttunement) secondaryAttunement = null; @@ -180,14 +181,14 @@ namespace CalamityMod.Items.Weapons.Melee public override void NetSend(BinaryWriter writer) { - writer.Write(mainAttunement != null ? (byte)mainAttunement.id : Attunement.attunementArray.Length - 1); - writer.Write(secondaryAttunement != null ? (byte)secondaryAttunement.id : Attunement.attunementArray.Length - 1); + writer.Write(mainAttunement != null ? (byte)mainAttunement.id : AttunementSystem.EmptyID); + writer.Write(secondaryAttunement != null ? (byte)secondaryAttunement.id : AttunementSystem.EmptyID); } public override void NetReceive(BinaryReader reader) { - mainAttunement = Attunement.attunementArray[reader.ReadInt32()]; - secondaryAttunement = Attunement.attunementArray[reader.ReadInt32()]; + mainAttunement = AttunementSystem.FindOrNull(reader.ReadInt32()); + secondaryAttunement = AttunementSystem.FindOrNull(reader.ReadInt32()); } #endregion @@ -199,10 +200,21 @@ namespace CalamityMod.Items.Weapons.Melee public void SafeCheckAttunements() { if (mainAttunement != null) - mainAttunement = Attunement.attunementArray[(int)MathHelper.Clamp((float)mainAttunement.id, (float)AttunementID.Default, (float)AttunementID.Evil)]; + mainAttunement = AttunementSystem.FindOrNull(ClampAttunementRange((int)mainAttunement.id)); if (secondaryAttunement != null) - secondaryAttunement = Attunement.attunementArray[(int)MathHelper.Clamp((float)secondaryAttunement.id, (float)AttunementID.Default, (float)AttunementID.Evil)]; + secondaryAttunement = AttunementSystem.FindOrNull(ClampAttunementRange((int)secondaryAttunement.id)); + } + + private static int ClampAttunementRange(int input) + { + if (input < (int)AttunementID.Default) + return (int)AttunementID.Default; + + if (input > (int)AttunementID.Evil) + return (int)AttunementID.Evil; + + return input; } public override void HoldItem(Player player) diff --git a/Items/Weapons/Melee/FourSeasonsGalaxia.cs b/Items/Weapons/Melee/FourSeasonsGalaxia.cs index f2a0223988..3c2fcc8916 100644 --- a/Items/Weapons/Melee/FourSeasonsGalaxia.cs +++ b/Items/Weapons/Melee/FourSeasonsGalaxia.cs @@ -6,6 +6,7 @@ using CalamityMod.DataStructures; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Melee; using CalamityMod.Rarities; +using CalamityMod.Systems; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -167,17 +168,17 @@ namespace CalamityMod.Items.Weapons.Melee { int attunement1 = tag.GetInt("mainAttunement"); - mainAttunement = Attunement.attunementArray[attunement1 != -1 ? attunement1 : Attunement.attunementArray.Length - 1]; + mainAttunement = AttunementSystem.FindOrNull(attunement1); } public override void NetSend(BinaryWriter writer) { - writer.Write(mainAttunement != null ? (byte)mainAttunement.id : Attunement.attunementArray.Length - 1); + writer.Write(mainAttunement != null ? (byte)mainAttunement.id : AttunementSystem.EmptyID); } public override void NetReceive(BinaryReader reader) { - mainAttunement = Attunement.attunementArray[reader.ReadInt32()]; + mainAttunement = AttunementSystem.FindOrNull(reader.ReadInt32()); } #endregion @@ -201,10 +202,21 @@ namespace CalamityMod.Items.Weapons.Melee public void SafeCheckAttunements() { if (mainAttunement == null) - mainAttunement = Attunement.attunementArray[(int)AttunementID.Phoenix]; + mainAttunement = AttunementSystem.FindOrNull(AttunementID.Phoenix); else - mainAttunement = Attunement.attunementArray[(int)MathHelper.Clamp((float)mainAttunement.id, (float)AttunementID.Phoenix, (float)AttunementID.Andromeda)]; + mainAttunement = AttunementSystem.FindOrNull(ClampAttunementRange((int)mainAttunement.id)); + } + + private static int ClampAttunementRange(int input) + { + if (input < (int)AttunementID.Phoenix) + return (int)AttunementID.Phoenix; + + if (input > (int)AttunementID.Andromeda) + return (int)AttunementID.Andromeda; + + return input; } public override void HoldItem(Player player) @@ -261,7 +273,7 @@ namespace CalamityMod.Items.Weapons.Melee public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) { if (mainAttunement == null) - mainAttunement = Attunement.attunementArray[(int)AttunementID.Phoenix]; + mainAttunement = AttunementSystem.FindOrNull(AttunementID.Phoenix); Texture2D itemTexture = Request((mainAttunement.id == AttunementID.Polaris || mainAttunement.id == AttunementID.Andromeda) ? "CalamityMod/Items/Weapons/Melee/GalaxiaDusk" : "CalamityMod/Items/Weapons/Melee/GalaxiaDawn").Value; Texture2D outlineTexture = Request((mainAttunement.id == AttunementID.Polaris || mainAttunement.id == AttunementID.Andromeda) ? "CalamityMod/Items/Weapons/Melee/GalaxiaDuskOutline" : "CalamityMod/Items/Weapons/Melee/GalaxiaDawnOutline").Value; @@ -285,7 +297,7 @@ namespace CalamityMod.Items.Weapons.Melee public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) { if (mainAttunement == null) - mainAttunement = Attunement.attunementArray[(int)AttunementID.Phoenix]; + mainAttunement = AttunementSystem.FindOrNull(AttunementID.Phoenix); Texture2D itemTexture = Request((mainAttunement.id == AttunementID.Polaris || mainAttunement.id == AttunementID.Andromeda) ? "CalamityMod/Items/Weapons/Melee/GalaxiaDusk" : "CalamityMod/Items/Weapons/Melee/GalaxiaDawn").Value; Texture2D outlineTexture = Request((mainAttunement.id == AttunementID.Polaris || mainAttunement.id == AttunementID.Andromeda) ? "CalamityMod/Items/Weapons/Melee/GalaxiaDuskOutline" : "CalamityMod/Items/Weapons/Melee/GalaxiaDawnOutline").Value; diff --git a/Items/Weapons/Melee/OmegaBiomeBlade.cs b/Items/Weapons/Melee/OmegaBiomeBlade.cs index d1240a1454..4f1e694b40 100644 --- a/Items/Weapons/Melee/OmegaBiomeBlade.cs +++ b/Items/Weapons/Melee/OmegaBiomeBlade.cs @@ -6,6 +6,7 @@ using CalamityMod.DataStructures; using CalamityMod.Items.Materials; using CalamityMod.Particles; using CalamityMod.Projectiles.Melee; +using CalamityMod.Systems; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -217,8 +218,8 @@ namespace CalamityMod.Items.Weapons.Melee int attunement1 = tag.GetInt("mainAttunement"); int attunement2 = tag.GetInt("secondaryAttunement"); - mainAttunement = Attunement.attunementArray[attunement1 != -1 ? attunement1 : Attunement.attunementArray.Length - 1]; - secondaryAttunement = Attunement.attunementArray[attunement2 != -1 ? attunement2 : Attunement.attunementArray.Length - 1]; + mainAttunement = AttunementSystem.FindOrNull(attunement1); + secondaryAttunement = AttunementSystem.FindOrNull(attunement2); if (mainAttunement == secondaryAttunement) secondaryAttunement = null; @@ -228,14 +229,14 @@ namespace CalamityMod.Items.Weapons.Melee public override void NetSend(BinaryWriter writer) { - writer.Write(mainAttunement != null ? (byte)mainAttunement.id : Attunement.attunementArray.Length - 1); - writer.Write(secondaryAttunement != null ? (byte)secondaryAttunement.id : Attunement.attunementArray.Length - 1); + writer.Write(mainAttunement != null ? (byte)mainAttunement.id : AttunementSystem.EmptyID); + writer.Write(secondaryAttunement != null ? (byte)secondaryAttunement.id : AttunementSystem.EmptyID); } public override void NetReceive(BinaryReader reader) { - mainAttunement = Attunement.attunementArray[reader.ReadInt32()]; - secondaryAttunement = Attunement.attunementArray[reader.ReadInt32()]; + mainAttunement = AttunementSystem.FindOrNull(reader.ReadInt32()); + secondaryAttunement = AttunementSystem.FindOrNull(reader.ReadInt32()); } #endregion @@ -251,10 +252,21 @@ namespace CalamityMod.Items.Weapons.Melee public void SafeCheckAttunements() { if (mainAttunement != null) - mainAttunement = Attunement.attunementArray[(int)MathHelper.Clamp((float)mainAttunement.id, (float)AttunementID.Whirlwind, (float)AttunementID.Shockwave)]; + mainAttunement = AttunementSystem.FindOrNull(ClampAttunementRange((int)mainAttunement.id)); if (secondaryAttunement != null) - secondaryAttunement = Attunement.attunementArray[(int)MathHelper.Clamp((float)secondaryAttunement.id, (float)AttunementID.Whirlwind, (float)AttunementID.Shockwave)]; + secondaryAttunement = AttunementSystem.FindOrNull(ClampAttunementRange((int)secondaryAttunement.id)); + } + + private static int ClampAttunementRange(int input) + { + if (input < (int)AttunementID.Whirlwind) + return (int)AttunementID.Whirlwind; + + if (input > (int)AttunementID.Shockwave) + return (int)AttunementID.Shockwave; + + return input; } public override void HoldItem(Player player) diff --git a/Items/Weapons/Melee/TrueBiomeBlade.cs b/Items/Weapons/Melee/TrueBiomeBlade.cs index d465084ed8..59bcf8b91f 100644 --- a/Items/Weapons/Melee/TrueBiomeBlade.cs +++ b/Items/Weapons/Melee/TrueBiomeBlade.cs @@ -6,6 +6,7 @@ using CalamityMod.DataStructures; using CalamityMod.Items.Materials; using CalamityMod.Particles; using CalamityMod.Projectiles.Melee; +using CalamityMod.Systems; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -192,8 +193,8 @@ namespace CalamityMod.Items.Weapons.Melee int attunement1 = tag.GetInt("mainAttunement"); int attunement2 = tag.GetInt("secondaryAttunement"); - mainAttunement = Attunement.attunementArray[attunement1 != -1 ? attunement1 : Attunement.attunementArray.Length - 1]; - secondaryAttunement = Attunement.attunementArray[attunement2 != -1 ? attunement2 : Attunement.attunementArray.Length - 1]; + mainAttunement = AttunementSystem.FindOrNull(attunement1); + secondaryAttunement = AttunementSystem.FindOrNull(attunement2); if (mainAttunement == secondaryAttunement) secondaryAttunement = null; @@ -203,14 +204,14 @@ namespace CalamityMod.Items.Weapons.Melee public override void NetSend(BinaryWriter writer) { - writer.Write(mainAttunement != null ? (byte)mainAttunement.id : Attunement.attunementArray.Length - 1); - writer.Write(secondaryAttunement != null ? (byte)secondaryAttunement.id : Attunement.attunementArray.Length - 1); + writer.Write(mainAttunement != null ? (byte)mainAttunement.id : AttunementSystem.EmptyID); + writer.Write(secondaryAttunement != null ? (byte)secondaryAttunement.id : AttunementSystem.EmptyID); } public override void NetReceive(BinaryReader reader) { - mainAttunement = Attunement.attunementArray[reader.ReadInt32()]; - secondaryAttunement = Attunement.attunementArray[reader.ReadInt32()]; + mainAttunement = AttunementSystem.FindOrNull(reader.ReadInt32()); + secondaryAttunement = AttunementSystem.FindOrNull(reader.ReadInt32()); } #endregion @@ -226,10 +227,21 @@ namespace CalamityMod.Items.Weapons.Melee public void SafeCheckAttunements() { if (mainAttunement != null) - mainAttunement = Attunement.attunementArray[(int)MathHelper.Clamp((float)mainAttunement.id, (float)AttunementID.TrueDefault, (float)AttunementID.Marine)]; + mainAttunement = AttunementSystem.FindOrNull(ClampAttunementRange((int)mainAttunement.id)); if (secondaryAttunement != null) - secondaryAttunement = Attunement.attunementArray[(int)MathHelper.Clamp((float)secondaryAttunement.id, (float)AttunementID.TrueDefault, (float)AttunementID.Marine)]; + secondaryAttunement = AttunementSystem.FindOrNull(ClampAttunementRange((int)secondaryAttunement.id)); + } + + private static int ClampAttunementRange(int input) + { + if (input < (int)AttunementID.TrueDefault) + return (int)AttunementID.TrueDefault; + + if (input > (int)AttunementID.Marine) + return (int)AttunementID.Marine; + + return input; } public override void HoldItem(Player player) diff --git a/Projectiles/Melee/BiomeBladeHoldout.cs b/Projectiles/Melee/BiomeBladeHoldout.cs index c87f35d666..b0540193eb 100644 --- a/Projectiles/Melee/BiomeBladeHoldout.cs +++ b/Projectiles/Melee/BiomeBladeHoldout.cs @@ -2,6 +2,7 @@ using CalamityMod.DataStructures; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Particles; +using CalamityMod.Systems; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -127,22 +128,22 @@ namespace CalamityMod.Projectiles.Melee bool astral = Owner.Calamity().ZoneAstral; bool marine = Owner.Calamity().ZoneAbyss || Owner.Calamity().ZoneSunkenSea; - Attunement attunement = Attunement.attunementArray[(int)AttunementID.TrueDefault]; + Attunement attunement = AttunementSystem.FindOrNull(AttunementID.TrueDefault); if (desert || hell) - attunement = Attunement.attunementArray[(int)AttunementID.TrueHot]; + attunement = AttunementSystem.FindOrNull(AttunementID.TrueHot); if (snow) - attunement = Attunement.attunementArray[(int)AttunementID.TrueCold]; + attunement = AttunementSystem.FindOrNull(AttunementID.TrueCold); if (jungle || ocean) - attunement = Attunement.attunementArray[(int)AttunementID.TrueTropical]; + attunement = AttunementSystem.FindOrNull(AttunementID.TrueTropical); if (evil) - attunement = Attunement.attunementArray[(int)AttunementID.TrueEvil]; + attunement = AttunementSystem.FindOrNull(AttunementID.TrueEvil); if (hallow) - attunement = Attunement.attunementArray[(int)AttunementID.Holy]; + attunement = AttunementSystem.FindOrNull(AttunementID.Holy); if (astral) - attunement = Attunement.attunementArray[(int)AttunementID.Astral]; + attunement = AttunementSystem.FindOrNull(AttunementID.Astral); if (marine) - attunement = Attunement.attunementArray[(int)AttunementID.Marine]; + attunement = AttunementSystem.FindOrNull(AttunementID.Marine); //If the owner already had the attunement , break out of it (And unswap) if (item.secondaryAttunement == attunement) diff --git a/Projectiles/Melee/BrokenBiomeBladeHoldout.cs b/Projectiles/Melee/BrokenBiomeBladeHoldout.cs index 08f7b76c91..d7a67b80e0 100644 --- a/Projectiles/Melee/BrokenBiomeBladeHoldout.cs +++ b/Projectiles/Melee/BrokenBiomeBladeHoldout.cs @@ -2,6 +2,7 @@ using CalamityMod.DataStructures; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Particles; +using CalamityMod.Systems; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -126,23 +127,23 @@ namespace CalamityMod.Projectiles.Melee bool hell = Owner.ZoneUnderworldHeight; bool ocean = Owner.ZoneBeach || Owner.Calamity().ZoneSulphur; - Attunement attunement = Attunement.attunementArray[(int)AttunementID.Default]; + Attunement attunement = AttunementSystem.FindOrNull(AttunementID.Default); if (desert || hell) { - attunement = Attunement.attunementArray[(int)AttunementID.Hot]; + attunement = AttunementSystem.FindOrNull(AttunementID.Hot); } if (snow) { - attunement = Attunement.attunementArray[(int)AttunementID.Cold]; + attunement = AttunementSystem.FindOrNull(AttunementID.Cold); } if (jungle || ocean) { - attunement = Attunement.attunementArray[(int)AttunementID.Tropical]; + attunement = AttunementSystem.FindOrNull(AttunementID.Tropical); } if (evil) { - attunement = Attunement.attunementArray[(int)AttunementID.Evil]; + attunement = AttunementSystem.FindOrNull(AttunementID.Evil); } //If the owner already had the attunement , break out of it (And unswap) diff --git a/Projectiles/Melee/GalaxiaHoldout.cs b/Projectiles/Melee/GalaxiaHoldout.cs index 14426ffbcf..03485e975a 100644 --- a/Projectiles/Melee/GalaxiaHoldout.cs +++ b/Projectiles/Melee/GalaxiaHoldout.cs @@ -3,6 +3,7 @@ using CalamityMod.DataStructures; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Particles; using CalamityMod.Sounds; +using CalamityMod.Systems; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -87,41 +88,31 @@ namespace CalamityMod.Projectiles.Melee if (CycleDirection == -1) //Cycles goes Phoenix => Aries => Polaris => Andromeda { - switch (item.mainAttunement.id) + attunement = item.mainAttunement.id switch { - case AttunementID.Phoenix: //Switching to the aries attunement. - attunement = Attunement.attunementArray[(int)AttunementID.Aries]; - break; - case AttunementID.Aries: //Switching to the polaris attunement. - attunement = Attunement.attunementArray[(int)AttunementID.Polaris]; - break; - case AttunementID.Polaris: //Switching to the andromeda attunement. - attunement = Attunement.attunementArray[(int)AttunementID.Andromeda]; - break; - case AttunementID.Andromeda: //Switching to the phoenix attunement. - default: - attunement = Attunement.attunementArray[(int)AttunementID.Phoenix]; - break; - } + //Switching to the aries attunement. + AttunementID.Phoenix => AttunementSystem.FindOrNull(AttunementID.Aries), + //Switching to the polaris attunement. + AttunementID.Aries => AttunementSystem.FindOrNull(AttunementID.Polaris), + //Switching to the andromeda attunement. + AttunementID.Polaris => AttunementSystem.FindOrNull(AttunementID.Andromeda), + //Switching to the phoenix attunement. + _ => AttunementSystem.FindOrNull(AttunementID.Phoenix), + }; } else //Cycles goes Phoenix <= Aries <= Polaris <= Andromeda { - switch (item.mainAttunement.id) + attunement = item.mainAttunement.id switch { - case AttunementID.Phoenix: //Switching to the andromeda attunement. - attunement = Attunement.attunementArray[(int)AttunementID.Andromeda]; - break; - case AttunementID.Andromeda: //Switching to the polaris attunement. - attunement = Attunement.attunementArray[(int)AttunementID.Polaris]; - break; - case AttunementID.Polaris: //Switching to the aries attunement. - attunement = Attunement.attunementArray[(int)AttunementID.Aries]; - break; - case AttunementID.Aries: //Switching to the phoenix attunement. - default: - attunement = Attunement.attunementArray[(int)AttunementID.Phoenix]; - break; - } + //Switching to the andromeda attunement. + AttunementID.Phoenix => AttunementSystem.FindOrNull(AttunementID.Andromeda), + //Switching to the polaris attunement. + AttunementID.Andromeda => AttunementSystem.FindOrNull(AttunementID.Polaris), + //Switching to the aries attunement. + AttunementID.Polaris => AttunementSystem.FindOrNull(AttunementID.Aries), + //Switching to the phoenix attunement. + _ => AttunementSystem.FindOrNull(AttunementID.Phoenix), + }; } switch (attunement.id) diff --git a/Projectiles/Melee/TrueBiomeBladeHoldout.cs b/Projectiles/Melee/TrueBiomeBladeHoldout.cs index 2c3099f71d..3e84af2225 100644 --- a/Projectiles/Melee/TrueBiomeBladeHoldout.cs +++ b/Projectiles/Melee/TrueBiomeBladeHoldout.cs @@ -3,6 +3,7 @@ using CalamityMod.DataStructures; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Particles; using CalamityMod.Sounds; +using CalamityMod.Systems; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -138,17 +139,17 @@ namespace CalamityMod.Projectiles.Melee bool astral = Owner.Calamity().ZoneAstral; bool marine = Owner.Calamity().ZoneAbyss || Owner.Calamity().ZoneSunkenSea; - Attunement attunement = Attunement.attunementArray[(int)AttunementID.Whirlwind]; + Attunement attunement = AttunementSystem.FindOrNull(AttunementID.Whirlwind); if (desert || hell) - attunement = Attunement.attunementArray[(int)AttunementID.SuperPogo]; + attunement = AttunementSystem.FindOrNull(AttunementID.SuperPogo); if (jungle || ocean || snow) //Check put after the desert check so ocean doesnt get overriden as desert - attunement = Attunement.attunementArray[(int)AttunementID.FlailBlade]; + attunement = AttunementSystem.FindOrNull(AttunementID.FlailBlade); if (evil) //Evil check separated so that it overrides corrupted beach & snow biomes - attunement = Attunement.attunementArray[(int)AttunementID.SuperPogo]; + attunement = AttunementSystem.FindOrNull(AttunementID.SuperPogo); if (astral || marine) - attunement = Attunement.attunementArray[(int)AttunementID.Shockwave]; + attunement = AttunementSystem.FindOrNull(AttunementID.Shockwave); if (hallow) - attunement = Attunement.attunementArray[(int)AttunementID.Whirlwind]; //Putting holy check at the end so it may override hallowed variants of biomes + attunement = AttunementSystem.FindOrNull(AttunementID.Whirlwind); //Putting holy check at the end so it may override hallowed variants of biomes //If the owner already had the attunement , break out of it (And unswap) if (item.secondaryAttunement == attunement) diff --git a/Systems/Mechanic/AttunementSystem.cs b/Systems/Mechanic/AttunementSystem.cs new file mode 100644 index 0000000000..0471e0d769 --- /dev/null +++ b/Systems/Mechanic/AttunementSystem.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.DataStructures; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public sealed class AttunementSystem : ModSystem + { + public static Attunement[] Registry; + public static Attunement Empty => Registry[EmptyID]; + public static int EmptyID => Registry.Length - 1; + + public override void OnModLoad() + { + // This probably could be replaced to ReflectionHelper.IterateCalamityModTypes + Registry = [ + + // Broken Biome Blade + new DefaultAttunement(), new HotAttunement(), new ColdAttunement(), new TropicalAttunement(), new EvilAttunement(), + + // Biome Blade + new TrueDefaultAttunement(), new TrueHotAttunement(), new TrueColdAttunement(), new TrueTropicalAttunement(), new TrueEvilAttunement(), new HolyAttunement(), new AstralAttunement(), new MarineAttunement(), + + // True Biome Blade + new WhirlwindAttunement(), new FlailBladeAttunement(), new SuperPogoAttunement(), new ShockwaveAttunement(), + + // Galaxia + new PhoenixAttunement(), new AriesAttunement(), new PolarisAttunement(), new AndromedaAttunement(), + + // Empty Slot + null + ]; + } + + public override void Unload() + { + Registry = null; + } + + public static Attunement FindOrNull(int index) + { + if (index < 0) + return Empty; + + if (index >= Registry.Length) + return Empty; + + return Registry[index]; + } + + public static Attunement FindOrNull(AttunementID id) + { + return FindOrNull((int)id); + } + } +} From e790e35fdd4b345324700b5b51df340d65381f4a Mon Sep 17 00:00:00 2001 From: Flowaria Date: Wed, 18 Sep 2024 13:54:04 +0900 Subject: [PATCH 099/133] Adding Obsolete safety for Historical code --- ILEditing/VanillaStupidityFixingILChanges.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/ILEditing/VanillaStupidityFixingILChanges.cs b/ILEditing/VanillaStupidityFixingILChanges.cs index 510c5dd121..cc864957f2 100644 --- a/ILEditing/VanillaStupidityFixingILChanges.cs +++ b/ILEditing/VanillaStupidityFixingILChanges.cs @@ -1086,6 +1086,7 @@ namespace CalamityMod.ILEditing // 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 + [/*TotallyNot*/Obsolete("Leave this alone, This is a Historical Property", error: true)] private static void StoreWindGrid(On_TileDrawing.orig_Update orig, TileDrawing self) { orig(self); From c9f5c78f6c608e5ff325552bbbe00f5e09943c59 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Wed, 18 Sep 2024 13:56:13 +0900 Subject: [PATCH 100/133] LavaRendering as Standalone System --- CalamityMod.cs | 25 ----- ILEditing/MechanicILChanges.cs | 79 +++++++-------- ...avaRendering.cs => LavaRenderingSystem.cs} | 96 ++++++++++++------- Systems/Graphic/ModLavaStyle.cs | 43 +++++---- 4 files changed, 124 insertions(+), 119 deletions(-) rename Systems/Graphic/{LavaRendering.cs => LavaRenderingSystem.cs} (92%) diff --git a/CalamityMod.cs b/CalamityMod.cs index a6132981da..a3bb879365 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -80,21 +80,6 @@ namespace CalamityMod // These should all be moved to other files, whether that's CalamityLists or brand new ModSystems. // It is best to have a ton of small ModSystems. - // Holds the Texture Arrays for all the lava textures. - // These are used for the lava styles. They are seperate from Textureasset.Instance._liquidTexture as they will conflict with ModWaterStyle - // Can hold up to 255 lava styles (more than enough) (excluding the normal lava texture which is liquidTexture 1) - public struct LavaTextures - { - public static Asset[] liquid = new Asset[1]; - public static Asset[] slope = new Asset[1]; - public static Asset[] block = new Asset[1]; - public static Asset[] fall = new Asset[1]; - } - - public static int LavaStyle; - - public static float[] lavaAlpha = new float[1]; - // Boss Kill Time data structure public static SortedDictionary bossKillTimes; @@ -125,13 +110,6 @@ namespace CalamityMod if (!Main.dedServ) { - // Lava Texture - LavaTextures.liquid[0] = LiquidRenderer.Instance._liquidTextures[1]; - LavaTextures.slope[0] = TextureAssets.LiquidSlope[1]; - LavaTextures.block[0] = TextureAssets.Liquid[1]; - var waterfallTexture = (Asset[])typeof(WaterfallManager).GetField("waterfallTexture", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public).GetValue(Main.instance.waterfallManager); - LavaTextures.fall[0] = waterfallTexture[1]; - PrimitiveRenderer.Initialize(); // This must be done separately from immediate loading, as loading is now multithreaded. @@ -142,9 +120,6 @@ namespace CalamityMod VanillaArmorChangeManager.Load(); SetupBossKillTimes(); - //lava - LavaRendering.instance = new LavaRendering(); - BaseIdleHoldoutProjectile.LoadAll(); PlayerDashManager.Load(); } diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index 3be2411085..c2376bb142 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -9,7 +9,6 @@ using CalamityMod.CalPlayer; using CalamityMod.DataStructures; using CalamityMod.Events; using CalamityMod.FluidSimulation; -using CalamityMod.ForegroundDrawing; using CalamityMod.Items.Accessories; using CalamityMod.Items.Accessories.Vanity; using CalamityMod.Items.Dyes; @@ -888,7 +887,7 @@ namespace CalamityMod.ILEditing return; } cursor.EmitDelegate(() => { - LavaRendering.instance.DrawLavas(isBackground: true); + LavaRenderingSystem.Instance.DrawLavas(isBackground: true); }); if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdsfld
("drawToScreen"), i => i.MatchBrfalse(out _), i => i.MatchLdarg0(), i => i.MatchLdcI4(0), i => i.MatchCall
("DrawWaters"))) { @@ -896,7 +895,7 @@ namespace CalamityMod.ILEditing return; } cursor.EmitDelegate(() => { - LavaRendering.instance.DrawLavas(); + LavaRenderingSystem.Instance.DrawLavas(); }); } @@ -909,7 +908,7 @@ namespace CalamityMod.ILEditing return; } cursor.EmitDelegate(() => { - LavaRendering.instance.DrawLavas(); + LavaRenderingSystem.Instance.DrawLavas(); }); } @@ -922,7 +921,7 @@ namespace CalamityMod.ILEditing return; } cursor.EmitDelegate(() => { - LavaRendering.instance.DrawLavas(isBackground: true); + LavaRenderingSystem.Instance.DrawLavas(isBackground: true); }); } @@ -935,7 +934,7 @@ namespace CalamityMod.ILEditing return; } cursor.EmitDelegate(() => { - LavaRendering.alphaSave = CalamityMod.lavaAlpha.ToArray(); + LavaRenderingSystem.LavaAlpha.CopyTo(LavaRenderingSystem.AlphaSave, 0); }); if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcI4(0), i => i.MatchStloc(34), i => i.MatchBr(out _), i => i.MatchLdloc(34), i => i.MatchLdcI4(1), i => i.MatchBeq(out _))) { @@ -946,7 +945,7 @@ namespace CalamityMod.ILEditing cursor.EmitDelegate((CaptureBiome biome) => { for (int i = 0; i < 1; i++) { - CalamityMod.lavaAlpha[i] = ((i == CalamityMod.LavaStyle) ? 1f : 0f); + LavaRenderingSystem.LavaAlpha[i] = ((i == LavaRenderingSystem.LavaStyle) ? 1f : 0f); } }); if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdarg0(), i => i.MatchLdcI4(1), i => i.MatchLdsfld
("waterStyle"), i => i.MatchLdcR4(1), i => i.MatchLdcI4(1), i => i.MatchCall
("DrawLiquid"))) @@ -955,7 +954,7 @@ namespace CalamityMod.ILEditing return; } cursor.EmitDelegate(() => { - LavaRendering.instance.DrawLiquid(bg: true, CalamityMod.LavaStyle); + LavaRenderingSystem.Instance.DrawLiquid(bg: true, LavaRenderingSystem.LavaStyle); }); if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdarg0(), i => i.MatchLdcI4(1), i => i.MatchLdsfld
("bloodMoon"), i => i.MatchBrtrue(out _), i => i.MatchLdloc(8), i => i.MatchLdfld("WaterStyle"), i => i.MatchBr(out _), i => i.MatchLdcI4(9), i => i.MatchLdcR4(1), i => i.MatchLdcI4(1), i => i.MatchCall
("DrawLiquid"))) { @@ -963,7 +962,7 @@ namespace CalamityMod.ILEditing return; } cursor.EmitDelegate(() => { - LavaRendering.instance.DrawLiquid(bg: true, CalamityMod.LavaStyle); + LavaRenderingSystem.Instance.DrawLiquid(bg: true, LavaRenderingSystem.LavaStyle); }); if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdarg0(), i => i.MatchLdcI4(0), i => i.MatchLdsfld
("waterStyle"), i => i.MatchLdcR4(1), i => i.MatchLdcI4(1), i => i.MatchCall
("DrawLiquid"))) { @@ -971,7 +970,7 @@ namespace CalamityMod.ILEditing return; } cursor.EmitDelegate(() => { - LavaRendering.instance.DrawLiquid(bg: false, CalamityMod.LavaStyle); + LavaRenderingSystem.Instance.DrawLiquid(bg: false, LavaRenderingSystem.LavaStyle); }); if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdarg0(), i => i.MatchLdcI4(0), i => i.MatchLdloc(8), i => i.MatchLdfld("WaterStyle"), i => i.MatchLdcR4(1), i => i.MatchLdcI4(1), i => i.MatchCall
("DrawLiquid"))) { @@ -979,7 +978,7 @@ namespace CalamityMod.ILEditing return; } cursor.EmitDelegate(() => { - LavaRendering.instance.DrawLiquid(bg: false, CalamityMod.LavaStyle); + LavaRenderingSystem.Instance.DrawLiquid(bg: false, LavaRenderingSystem.LavaStyle); }); if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdloc2(), i => i.MatchStsfld
("liquidAlpha"))) { @@ -987,7 +986,7 @@ namespace CalamityMod.ILEditing return; } cursor.EmitDelegate(() => { - CalamityMod.lavaAlpha = LavaRendering.alphaSave; + LavaRenderingSystem.AlphaSave.CopyTo(LavaRenderingSystem.LavaAlpha, 0); }); } @@ -1005,7 +1004,7 @@ namespace CalamityMod.ILEditing cursor.EmitLdloc(13); cursor.EmitLdloc(14); cursor.EmitDelegate((Vector2 unscaledPosition, Vector2 vector, int j, int i, Tile tile) => { - LavaRendering.instance.DrawTile_LiquidBehindTile(solidLayer: false, inFrontOfPlayers: false, -1, unscaledPosition, vector, j, i, tile); + LavaRenderingSystem.Instance.DrawTile_LiquidBehindTile(solidLayer: false, inFrontOfPlayers: false, -1, unscaledPosition, vector, j, i, tile); }); } #endregion @@ -1028,7 +1027,7 @@ namespace CalamityMod.ILEditing cursor.EmitLdarg3(); cursor.EmitLdloc2(); //Initiated Liquid Draw Cache (needed for the Type parameter) cursor.EmitLdfld(typeof(LiquidRenderer).GetNestedType("LiquidDrawCache", BindingFlags.NonPublic).GetRuntimeField("Type")); - cursor.EmitDelegate>((IsVisible, style, type) => IsVisible && ((type == 1 && style >= LavaRendering.instance.WaterStyleMaxCount + 1) || (type != 1 && style <= LavaRendering.instance.WaterStyleMaxCount))); + cursor.EmitDelegate>((IsVisible, style, type) => IsVisible && ((type == 1 && style >= LavaRenderingSystem.Instance.WaterStyleMaxCount + 1) || (type != 1 && style <= LavaRenderingSystem.Instance.WaterStyleMaxCount))); //Lava alpha color, if the liquid drawn is lava, multiply num by the water alpha if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdloc(2), i => i.MatchLdfld(typeof(LiquidRenderer).GetNestedType("LiquidDrawCache", BindingFlags.NonPublic).GetRuntimeField("Type")), i => i.MatchStloc(8))) @@ -1056,7 +1055,11 @@ namespace CalamityMod.ILEditing cursor.EmitLdarg3(); cursor.EmitLdloc2(); //Initiated Liquid Draw Cache (needed for the Type parameter) cursor.EmitLdfld(typeof(LiquidRenderer).GetNestedType("LiquidDrawCache", BindingFlags.NonPublic).GetRuntimeField("Type")); - cursor.EmitDelegate>((initialTexture, style, type) => (style >= LavaRendering.instance.WaterStyleMaxCount + 1 && type == LiquidID.Lava) ? CalamityMod.LavaTextures.liquid[style - LavaRendering.instance.WaterStyleMaxCount - 1].Value : initialTexture); + cursor.EmitDelegate>((initialTexture, style, type) => + (style >= LavaRenderingSystem.Instance.WaterStyleMaxCount + 1 && type == LiquidID.Lava) + ? LavaRenderingSystem.Textures.liquid[style - LavaRenderingSystem.Instance.WaterStyleMaxCount - 1].Value + : initialTexture + ); } private void BlockLavaDrawingForSlopes(On_TileDrawing.orig_DrawTile_LiquidBehindTile orig, TileDrawing self, bool solidLayer, bool inFrontOfPlayers, int waterStyleOverride, Vector2 screenPosition, Vector2 screenOffset, int tileX, int tileY, Tile tileCache) @@ -1138,13 +1141,13 @@ namespace CalamityMod.ILEditing LogFailure("Ambient lava bubble replacer", "Could not locate the bubble newdust parameters"); return; } - cursor.EmitDelegate>(type => LavaRendering.dustLava()); + cursor.EmitDelegate>(type => LavaRenderingSystem.dustLava()); if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdcI4(16), i => i.MatchLdcI4(8), i => i.MatchLdcI4(35))) { LogFailure("Ambient lava bubble replacer", "Could not locate the surface bubble newdust parameters"); return; } - cursor.EmitDelegate>(type2 => LavaRendering.dustLava()); + cursor.EmitDelegate>(type2 => LavaRenderingSystem.dustLava()); } private void LavaDropletReplacer(ILContext il) @@ -1155,7 +1158,7 @@ namespace CalamityMod.ILEditing LogFailure("Ambient lava droplet replacer", "Could not locate the lava droplet newgore parameters"); return; } - cursor.EmitDelegate>(type => LavaRendering.goreLava()); + cursor.EmitDelegate>(type => LavaRenderingSystem.goreLava()); } private void SplashEntityLava(ILContext il) @@ -1166,13 +1169,13 @@ namespace CalamityMod.ILEditing LogFailure("Entity Lava Splashing (Item, Projectile, NPC, Player)", "Could not locate the first lava bubble splashing"); return; } - cursor.EmitDelegate>(type => LavaRendering.dustLava()); + cursor.EmitDelegate>(type => LavaRenderingSystem.dustLava()); if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdfld("width"), i => i.MatchLdcI4(12), i => i.MatchAdd(), i => i.MatchLdcI4(24), i => i.MatchLdcI4(35))) { LogFailure("Entity Lava Splashing (Item, Projectile, NPC, Player)", "Could not locate the second lava bubble splashing"); return; } - cursor.EmitDelegate>(type2 => LavaRendering.dustLava()); + cursor.EmitDelegate>(type2 => LavaRenderingSystem.dustLava()); } private void PlayerDebuffEdit(ILContext il) @@ -1188,7 +1191,7 @@ namespace CalamityMod.ILEditing cursor.EmitLdloc(161); cursor.EmitDelegate((Player player, int onFiretime) => { - LavaStylesLoader.InflictDebuff(player, CalamityMod.LavaStyle, onFiretime); + LavaStylesLoader.InflictDebuff(player, LavaRenderingSystem.LavaStyle, onFiretime); }); } #endregion @@ -1196,7 +1199,7 @@ namespace CalamityMod.ILEditing #region Other private Color WaterfallGlowmaskEditor(On_WaterfallManager.orig_StylizeColor orig, float alpha, int maxSteps, int waterfallType, int y, int s, Tile tileCache, Color aColor) { - if (CalamityMod.LavaStyle != 0 && !LavaStylesLoader.Get(CalamityMod.LavaStyle).LavafallGlowmask()) + if (LavaRenderingSystem.LavaStyle != 0 && !LavaStylesLoader.Get(LavaRenderingSystem.LavaStyle).LavafallGlowmask()) { return aColor; } @@ -1209,7 +1212,7 @@ namespace CalamityMod.ILEditing private void LavaFallRedrawer(On_WaterfallManager.orig_Draw orig, WaterfallManager self, SpriteBatch spriteBatch) { orig.Invoke(self, spriteBatch); - LavaRendering.instance.InitialDrawLavafall(self); + LavaRenderingSystem.Instance.InitialDrawLavafall(self); } #endregion @@ -1250,28 +1253,28 @@ namespace CalamityMod.ILEditing { Vector3 lavaLight = new Vector3(0.55f, 0.33f, 0.11f); - float R = CalamityMod.LavaStyle == 0 ? lavaLight.X : 0f; - float G = CalamityMod.LavaStyle == 0 ? lavaLight.Y : 0f; - float B = CalamityMod.LavaStyle == 0 ? lavaLight.Z : 0f; - LavaStylesLoader.ModifyLightSetup(x, y, CalamityMod.LavaStyle, ref R, ref G, ref B); + float R = LavaRenderingSystem.LavaStyle == 0 ? lavaLight.X : 0f; + float G = LavaRenderingSystem.LavaStyle == 0 ? lavaLight.Y : 0f; + float B = LavaRenderingSystem.LavaStyle == 0 ? lavaLight.Z : 0f; + LavaStylesLoader.ModifyLightSetup(x, y, LavaRenderingSystem.LavaStyle, ref R, ref G, ref B); for (int styleIndex = 0; styleIndex < LavaStylesLoader.TotalCount; styleIndex++) { - if (CalamityMod.lavaAlpha[styleIndex] > 0f && styleIndex != CalamityMod.LavaStyle) + if (LavaRenderingSystem.LavaAlpha[styleIndex] > 0f && styleIndex != LavaRenderingSystem.LavaStyle) { float r = styleIndex == 0 ? lavaLight.X : 0f; float g = styleIndex == 0 ? lavaLight.Y : 0f; float b = styleIndex == 0 ? lavaLight.Z : 0f; LavaStylesLoader.ModifyLightSetup(x, y, styleIndex, ref r, ref g, ref b); - float r2 = CalamityMod.LavaStyle == 0 ? lavaLight.X : 0f; - float g2 = CalamityMod.LavaStyle == 0 ? lavaLight.Y : 0f; - float b2 = CalamityMod.LavaStyle == 0 ? lavaLight.Z : 0f; - LavaStylesLoader.ModifyLightSetup(x, y, CalamityMod.LavaStyle, ref r2, ref g2, ref b2); + float r2 = LavaRenderingSystem.LavaStyle == 0 ? lavaLight.X : 0f; + float g2 = LavaRenderingSystem.LavaStyle == 0 ? lavaLight.Y : 0f; + float b2 = LavaRenderingSystem.LavaStyle == 0 ? lavaLight.Z : 0f; + LavaStylesLoader.ModifyLightSetup(x, y, LavaRenderingSystem.LavaStyle, ref r2, ref g2, ref b2); - R = float.Lerp(r, r2, CalamityMod.lavaAlpha[CalamityMod.LavaStyle]); - G = float.Lerp(g, g2, CalamityMod.lavaAlpha[CalamityMod.LavaStyle]); - B = float.Lerp(b, b2, CalamityMod.lavaAlpha[CalamityMod.LavaStyle]); + R = float.Lerp(r, r2, LavaRenderingSystem.LavaAlpha[LavaRenderingSystem.LavaStyle]); + G = float.Lerp(g, g2, LavaRenderingSystem.LavaAlpha[LavaRenderingSystem.LavaStyle]); + B = float.Lerp(b, b2, LavaRenderingSystem.LavaAlpha[LavaRenderingSystem.LavaStyle]); } } @@ -1297,7 +1300,7 @@ namespace CalamityMod.ILEditing float r = 0.55f; float g = 0.33f; float b = 0.11f; - LavaStylesLoader.ModifyLightSetup(x, y, CalamityMod.LavaStyle, ref r, ref g, ref b); + LavaStylesLoader.ModifyLightSetup(x, y, LavaRenderingSystem.LavaStyle, ref r, ref g, ref b); if (!(r == 0 && g == 0 && b == 0)) { float r8; @@ -1334,7 +1337,7 @@ namespace CalamityMod.ILEditing } else if (liquidType == LiquidID.Lava && ExternalMods.biomeLava == null) { - LavaStylesLoader.DrawColorSetup(x, y, CalamityMod.LavaStyle, ref initialColor); + LavaStylesLoader.DrawColorSetup(x, y, LavaRenderingSystem.LavaStyle, ref initialColor); } }); } @@ -1390,7 +1393,7 @@ namespace CalamityMod.ILEditing // Reason: Flag6 is "IsWater" flag, and since we don't modified that behaviour "yet" it will never be triggered here // Fix this when there will be new lava style with dynamic color changes else if (tileCache.LiquidType == LiquidID.Lava) - LavaStylesLoader.DrawColorSetup(x, y, CalamityMod.LavaStyle, ref initialColor); + LavaStylesLoader.DrawColorSetup(x, y, LavaRenderingSystem.LavaStyle, ref initialColor); }); // And now remaining TotalCount is now could pass to local variable diff --git a/Systems/Graphic/LavaRendering.cs b/Systems/Graphic/LavaRenderingSystem.cs similarity index 92% rename from Systems/Graphic/LavaRendering.cs rename to Systems/Graphic/LavaRenderingSystem.cs index 8dc526e169..4ba8d372d8 100644 --- a/Systems/Graphic/LavaRendering.cs +++ b/Systems/Graphic/LavaRenderingSystem.cs @@ -7,7 +7,9 @@ using System.Text; using System.Threading.Tasks; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; +using Terraria.GameContent; using Terraria.GameContent.Liquid; using Terraria.Graphics; using Terraria.ID; @@ -16,18 +18,42 @@ using static Terraria.WaterfallManager; namespace CalamityMod.Systems { - public class LavaRendering : ModSystem + [Autoload(Side = ModSide.Client)] + public sealed class LavaRenderingSystem : ModSystem { //Welcome to Calamity's lava rendering. Prepare your eyes - public static LavaRendering instance; + public static LavaRenderingSystem Instance; + + public static int LavaStyle; + public static float[] LavaAlpha = new float[1]; + internal static float[] AlphaSave = new float[1]; + + // Holds the Texture Arrays for all the lava textures. + // These are used for the lava styles. They are seperate from Textureasset.Instance._liquidTexture as they will conflict with ModWaterStyle + // Can hold up to 255 lava styles (more than enough) (excluding the normal lava texture which is liquidTexture 1) + public struct Textures + { + public static Asset[] liquid = new Asset[1]; + public static Asset[] slope = new Asset[1]; + public static Asset[] block = new Asset[1]; + public static Asset[] fall = new Asset[1]; + } public int WaterStyleMaxCount = ModContent.GetContent().Count() + LoaderManager.Get().VanillaCount; - internal static float[] alphaSave; - public override void Load() { - LavaRendering.alphaSave = new float[CalamityMod.lavaAlpha.Length]; + Instance = this; + } + + public override void OnModLoad() + { + // Lava Texture + Textures.liquid[0] = LiquidRenderer.Instance._liquidTextures[1]; + Textures.slope[0] = TextureAssets.LiquidSlope[1]; + Textures.block[0] = TextureAssets.Liquid[1]; + var waterfallTexture = (Asset[])typeof(WaterfallManager).GetField("waterfallTexture", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public).GetValue(Main.instance.waterfallManager); + Textures.fall[0] = waterfallTexture[1]; } public void DrawLavas(bool isBackground = false) @@ -35,17 +61,17 @@ namespace CalamityMod.Systems Main.drewLava = false; if (!isBackground) { - CalamityMod.LavaStyle = 0; + LavaStyle = 0; LavaStylesLoader.IsLavaActive(); for (int i = 0; i < 1; i++) { - if (CalamityMod.LavaStyle != i) + if (LavaStyle != i) { - CalamityMod.lavaAlpha[i] = Math.Max(CalamityMod.lavaAlpha[i] - 0.2f, 0f); + LavaAlpha[i] = Math.Max(LavaAlpha[i] - 0.2f, 0f); } else { - CalamityMod.lavaAlpha[i] = Math.Min(CalamityMod.lavaAlpha[i] + 0.2f, 1f); + LavaAlpha[i] = Math.Min(LavaAlpha[i] + 0.2f, 1f); } } LavaStylesLoader.UpdateLiquidAlphas(); @@ -53,18 +79,18 @@ namespace CalamityMod.Systems bool flag = false; for (int j = 0; j < LavaStylesLoader.TotalCount; j++) { - if (CalamityMod.lavaAlpha[j] > 0f && j != CalamityMod.LavaStyle) + if (LavaAlpha[j] > 0f && j != LavaStyle) { - DrawLiquid(isBackground, j, isBackground ? 1f : CalamityMod.lavaAlpha[j], drawSinglePassLiquids: false); + DrawLiquid(isBackground, j, isBackground ? 1f : LavaAlpha[j], drawSinglePassLiquids: false); flag = true; } } - DrawLiquid(isBackground, CalamityMod.LavaStyle, flag ? CalamityMod.lavaAlpha[CalamityMod.LavaStyle] : 1f); + DrawLiquid(isBackground, LavaStyle, flag ? LavaAlpha[LavaStyle] : 1f); } protected internal void DrawLiquid(bool bg = false, int lavaStyle = 0, float Alpha = 1f, bool drawSinglePassLiquids = true) { - if (!Lighting.NotRetro) + if (!Lighting.NotRetro) // Is Retro { oldDrawLava(bg, lavaStyle, Alpha); return; @@ -362,12 +388,12 @@ namespace CalamityMod.Systems color3.G = (byte)((color2.G * 3 + color4.G * 2) / 5); color3.B = (byte)((color2.B * 3 + color4.B * 2) / 5); color3.A = (byte)((color2.A * 3 + color4.A * 2) / 5); - Main.spriteBatch.Draw(CalamityMod.LavaTextures.block[num4].Value, vector2 - Main.screenPosition + new Vector2((float)num20, (float)num21) + vector, (Rectangle?)new Rectangle(value.X + num20, value.Y + num21, width, height), color3, 0f, default(Vector2), 1f, (SpriteEffects)0, 0f); + Main.spriteBatch.Draw(Textures.block[num4].Value, vector2 - Main.screenPosition + new Vector2((float)num20, (float)num21) + vector, (Rectangle?)new Rectangle(value.X + num20, value.Y + num21, width, height), color3, 0f, default(Vector2), 1f, (SpriteEffects)0, 0f); } } else { - Main.spriteBatch.Draw(CalamityMod.LavaTextures.block[num4].Value, vector2 - Main.screenPosition + vector, (Rectangle?)value, color, 0f, default(Vector2), 1f, (SpriteEffects)0, 0f); + Main.spriteBatch.Draw(Textures.block[num4].Value, vector2 - Main.screenPosition + vector, (Rectangle?)value, color, 0f, default(Vector2), 1f, (SpriteEffects)0, 0f); } } else @@ -376,7 +402,7 @@ namespace CalamityMod.Systems { value.X += (int)(Main.wFrame * 18f); } - Main.spriteBatch.Draw(CalamityMod.LavaTextures.block[num4].Value, vector2 - Main.screenPosition + vector, (Rectangle?)value, color, 0f, default(Vector2), 1f, (SpriteEffects)0, 0f); + Main.spriteBatch.Draw(Textures.block[num4].Value, vector2 - Main.screenPosition + vector, (Rectangle?)value, color, 0f, default(Vector2), 1f, (SpriteEffects)0, 0f); } if (!Main.tile[j, i + 1].IsHalfBlock) { @@ -389,7 +415,7 @@ namespace CalamityMod.Systems num19 = (float)(int)color.A * num9; color = new((int)(byte)num16, (int)(byte)num17, (int)(byte)num18, (int)(byte)num19); vector2 = new((float)(j * 16), (float)(i * 16 + 16)); - Main.spriteBatch.Draw(CalamityMod.LavaTextures.block[num4].Value, vector2 - Main.screenPosition + vector, (Rectangle?)new Rectangle(0, 4, 16, 8), color, 0f, default(Vector2), 1f, (SpriteEffects)0, 0f); + Main.spriteBatch.Draw(Textures.block[num4].Value, vector2 - Main.screenPosition + vector, (Rectangle?)new Rectangle(0, 4, 16, 8), color, 0f, default(Vector2), 1f, (SpriteEffects)0, 0f); float num22 = 6f; float num24 = 0.75f; num22 = 4f; @@ -404,7 +430,7 @@ namespace CalamityMod.Systems float num26 = 1f - (float)m / num22; num26 *= num24; vector2 = new((float)(j * 16), (float)(num25 * 16 - 2)); - Main.spriteBatch.Draw(CalamityMod.LavaTextures.block[num4].Value, vector2 - Main.screenPosition + vector, (Rectangle?)new Rectangle(0, 18, 16, 16), color * num26, 0f, default(Vector2), 1f, (SpriteEffects)0, 0f); + Main.spriteBatch.Draw(Textures.block[num4].Value, vector2 - Main.screenPosition + vector, (Rectangle?)new Rectangle(0, 18, 16, 16), color * num26, 0f, default(Vector2), 1f, (SpriteEffects)0, 0f); } } } @@ -550,11 +576,11 @@ namespace CalamityMod.Systems } if (waterStyleOverride != -1) { - CalamityMod.LavaStyle = waterStyleOverride; + LavaStyle = waterStyleOverride; } if (num2 == 0) { - num2 = CalamityMod.LavaStyle; + num2 = LavaStyle; } Lighting.GetCornerColors(tileX, tileY, out var vertices); Vector2 vector = new((float)(tileX * 16), (float)(tileY * 16)); @@ -653,7 +679,7 @@ namespace CalamityMod.Systems { for (int i = 0; i < LavaStylesLoader.TotalCount; i++) { - if (CalamityMod.lavaAlpha[i] > 0f && i != num2) + if (LavaAlpha[i] > 0f && i != num2) { DrawPartialLiquid(!solidLayer, tileCache, ref position, ref liquidSize, i, ref vertices); flag7 = true; @@ -662,7 +688,7 @@ namespace CalamityMod.Systems } } VertexColors colors = vertices; - float num7 = (flag7 ? CalamityMod.lavaAlpha[num2] : 1f); + float num7 = (flag7 ? LavaAlpha[num2] : 1f); ref Color bottomLeftColor2 = ref colors.BottomLeftColor; bottomLeftColor2 *= num7; ref Color bottomRightColor2 = ref colors.BottomRightColor; @@ -684,23 +710,23 @@ namespace CalamityMod.Systems } if (flag || num == 0) { - Main.tileBatch.Draw(CalamityMod.LavaTextures.block[liquidType].Value, position, liquidSize, colors, default(Vector2), 1f, (SpriteEffects)0); + Main.tileBatch.Draw(Textures.block[liquidType].Value, position, liquidSize, colors, default(Vector2), 1f, (SpriteEffects)0); return; } liquidSize.X += 18 * (num - 1); switch (num) { case 1: - Main.tileBatch.Draw(CalamityMod.LavaTextures.slope[liquidType].Value, position, liquidSize, colors, Vector2.Zero, 1f, (SpriteEffects)0); + Main.tileBatch.Draw(Textures.slope[liquidType].Value, position, liquidSize, colors, Vector2.Zero, 1f, (SpriteEffects)0); break; case 2: - Main.tileBatch.Draw(CalamityMod.LavaTextures.slope[liquidType].Value, position, liquidSize, colors, Vector2.Zero, 1f, (SpriteEffects)0); + Main.tileBatch.Draw(Textures.slope[liquidType].Value, position, liquidSize, colors, Vector2.Zero, 1f, (SpriteEffects)0); break; case 3: - Main.tileBatch.Draw(CalamityMod.LavaTextures.slope[liquidType].Value, position, liquidSize, colors, Vector2.Zero, 1f, (SpriteEffects)0); + Main.tileBatch.Draw(Textures.slope[liquidType].Value, position, liquidSize, colors, Vector2.Zero, 1f, (SpriteEffects)0); break; case 4: - Main.tileBatch.Draw(CalamityMod.LavaTextures.slope[liquidType].Value, position, liquidSize, colors, Vector2.Zero, 1f, (SpriteEffects)0); + Main.tileBatch.Draw(Textures.slope[liquidType].Value, position, liquidSize, colors, Vector2.Zero, 1f, (SpriteEffects)0); break; } } @@ -709,9 +735,9 @@ namespace CalamityMod.Systems { for (int i = 0; i < LavaStylesLoader.TotalCount; i++) { - if (CalamityMod.lavaAlpha[i] > 0f) + if (LavaAlpha[i] > 0f) { - DrawLavafall(waterfallManager, i, CalamityMod.lavaAlpha[i]); + DrawLavafall(waterfallManager, i, LavaAlpha[i]); } } } @@ -1117,8 +1143,8 @@ namespace CalamityMod.Systems private void DrawLavafall(int waterfallType, int x, int y, float opacity, Vector2 position, Rectangle sourceRect, Color color, SpriteEffects effects) { - Texture2D value = CalamityMod.LavaTextures.fall[waterfallType].Value; - Main.spriteBatch.Draw(value, position, (Rectangle?)sourceRect, color, 0f, default(Vector2), 1f, effects, 0f); + Texture2D value = Textures.fall[waterfallType].Value; + Main.spriteBatch.Draw(value, position, (Rectangle?)sourceRect, color, 0f, default, 1f, effects, 0f); } private static float GetLavafallAlpha(float Alpha, int maxSteps, int y, int s, Tile tileCache) @@ -1133,9 +1159,9 @@ namespace CalamityMod.Systems public static int dustLava() { - if (CalamityMod.LavaStyle >= 1) + if (LavaStyle >= 1) { - return LavaStylesLoader.Get(CalamityMod.LavaStyle).GetSplashDust(); + return LavaStylesLoader.Get(LavaStyle).GetSplashDust(); } else { @@ -1146,9 +1172,9 @@ namespace CalamityMod.Systems //just better as a method rather than hardcoded type values public static int goreLava() { - if (CalamityMod.LavaStyle >= 1) + if (LavaStyle >= 1) { - return LavaStylesLoader.Get(CalamityMod.LavaStyle).GetDropletGore(); + return LavaStylesLoader.Get(LavaStyle).GetDropletGore(); } else { diff --git a/Systems/Graphic/ModLavaStyle.cs b/Systems/Graphic/ModLavaStyle.cs index 84d229559a..bc015799fb 100644 --- a/Systems/Graphic/ModLavaStyle.cs +++ b/Systems/Graphic/ModLavaStyle.cs @@ -127,11 +127,12 @@ namespace CalamityMod.Systems { orig.Invoke(unloading); int totalCount = TotalCount; - Array.Resize(ref CalamityMod.LavaTextures.liquid, totalCount); - Array.Resize(ref CalamityMod.LavaTextures.block, totalCount); - Array.Resize(ref CalamityMod.LavaTextures.slope, totalCount); - Array.Resize(ref CalamityMod.LavaTextures.fall, totalCount); - Array.Resize(ref CalamityMod.lavaAlpha, totalCount); + Array.Resize(ref LavaRenderingSystem.Textures.liquid, totalCount); + Array.Resize(ref LavaRenderingSystem.Textures.block, totalCount); + Array.Resize(ref LavaRenderingSystem.Textures.slope, totalCount); + Array.Resize(ref LavaRenderingSystem.Textures.fall, totalCount); + Array.Resize(ref LavaRenderingSystem.LavaAlpha, totalCount); + Array.Resize(ref LavaRenderingSystem.AlphaSave, totalCount); } private static readonly List _content = []; @@ -157,10 +158,10 @@ namespace CalamityMod.Systems foreach (ModLavaStyle item in Content) { int Slot = item.Slot; - CalamityMod.LavaTextures.liquid[Slot] = ModContent.Request(item.Texture, (AssetRequestMode)2); - CalamityMod.LavaTextures.block[Slot] = ModContent.Request(item.BlockTexture, (AssetRequestMode)2); - CalamityMod.LavaTextures.slope[Slot] = ModContent.Request(item.SlopeTexture, (AssetRequestMode)2); - CalamityMod.LavaTextures.fall[Slot] = ModContent.Request(item.WaterfallTexture, (AssetRequestMode)2); + LavaRenderingSystem.Textures.liquid[Slot] = ModContent.Request(item.Texture, AssetRequestMode.AsyncLoad); + LavaRenderingSystem.Textures.block[Slot] = ModContent.Request(item.BlockTexture, AssetRequestMode.AsyncLoad); + LavaRenderingSystem.Textures.slope[Slot] = ModContent.Request(item.SlopeTexture, AssetRequestMode.AsyncLoad); + LavaRenderingSystem.Textures.fall[Slot] = ModContent.Request(item.WaterfallTexture, AssetRequestMode.AsyncLoad); } } @@ -182,34 +183,34 @@ namespace CalamityMod.Systems public static void UpdateLiquidAlphas() { - if (CalamityMod.LavaStyle >= VanillaCount) + if (LavaRenderingSystem.LavaStyle >= VanillaCount) { for (int i = 0; i < VanillaCount; i++) { - CalamityMod.lavaAlpha[i] -= 0.2f; - if (CalamityMod.lavaAlpha[i] < 0f) + LavaRenderingSystem.LavaAlpha[i] -= 0.2f; + if (LavaRenderingSystem.LavaAlpha[i] < 0f) { - CalamityMod.lavaAlpha[i] = 0f; + LavaRenderingSystem.LavaAlpha[i] = 0f; } } } foreach (ModLavaStyle item in Content) { int type = item.Slot; - if (CalamityMod.LavaStyle == type) + if (LavaRenderingSystem.LavaStyle == type) { - CalamityMod.lavaAlpha[type] += 0.2f; - if (CalamityMod.lavaAlpha[type] > 1f) + LavaRenderingSystem.LavaAlpha[type] += 0.2f; + if (LavaRenderingSystem.LavaAlpha[type] > 1f) { - CalamityMod.lavaAlpha[type] = 1f; + LavaRenderingSystem.LavaAlpha[type] = 1f; } } else { - CalamityMod.lavaAlpha[type] -= 0.2f; - if (CalamityMod.lavaAlpha[type] < 0f) + LavaRenderingSystem.LavaAlpha[type] -= 0.2f; + if (LavaRenderingSystem.LavaAlpha[type] < 0f) { - CalamityMod.lavaAlpha[type] = 0f; + LavaRenderingSystem.LavaAlpha[type] = 0f; } } } @@ -253,7 +254,7 @@ namespace CalamityMod.Systems bool? flag = lavaStyle?.IsLavaActive(); if (flag != null && flag == true) { - CalamityMod.LavaStyle = lavaStyle.Slot; + LavaRenderingSystem.LavaStyle = lavaStyle.Slot; } } } From fb2e4ada15a983f7cb3a8a76f894846812d63be8 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Wed, 18 Sep 2024 18:58:41 +0900 Subject: [PATCH 101/133] PlayerDashManager as ModSystem --- CalPlayer/Dashes/PlayerDashManager.cs | 20 ++++++-------------- CalamityMod.cs | 2 -- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/CalPlayer/Dashes/PlayerDashManager.cs b/CalPlayer/Dashes/PlayerDashManager.cs index 724292f85f..a6c77c8abc 100644 --- a/CalPlayer/Dashes/PlayerDashManager.cs +++ b/CalPlayer/Dashes/PlayerDashManager.cs @@ -1,12 +1,12 @@ using System; using System.Collections.Generic; using Terraria; +using Terraria.ModLoader; using Terraria.ModLoader.Core; namespace CalamityMod.CalPlayer.Dashes { - // TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks. - public static class PlayerDashManager + public sealed class PlayerDashManager : ModSystem { internal static Dictionary DashIdentificationTable = new(); @@ -41,28 +41,20 @@ namespace CalamityMod.CalPlayer.Dashes } - internal static void Load() + public override void OnModLoad() { DashIdentificationTable = new(); - Type baseType = typeof(PlayerDashEffect); - Type[] types = AssemblyManager.GetLoadableTypes(CalamityMod.Instance.Code); - foreach (Type type in types) + ReflectionHelper.IterateCalamityModTypes(includeBaseType: false, type => { - // Ignore any types which are not dash effects or are abstract. - // This eliminates the PlayerDashEffect template type, which cannot have instances. - if (!type.IsSubclassOf(baseType) || type.IsAbstract) - continue; - - // Use reflection to get the static ID manually. This shouldn't be a performance problem, as this only happens at load-time. string id = (string)type.GetProperty("ID").GetValue(null); PlayerDashEffect dashEffect = (PlayerDashEffect)Activator.CreateInstance(type); DashIdentificationTable[id] = dashEffect; - } + }); } - internal static void Unload() + public override void Unload() { DashIdentificationTable = null; } diff --git a/CalamityMod.cs b/CalamityMod.cs index a3bb879365..2dc98c60c5 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -121,7 +121,6 @@ namespace CalamityMod SetupBossKillTimes(); BaseIdleHoldoutProjectile.LoadAll(); - PlayerDashManager.Load(); } #endregion @@ -137,7 +136,6 @@ namespace CalamityMod CalamityGlobalProjectile.UnloadTweaks(); PopupGUIManager.UnloadGUIs(); - PlayerDashManager.Unload(); Main.QueueMainThreadAction(() => { From 493d49da38392961c3fa8f0420a5688abc7bd319 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Wed, 18 Sep 2024 19:02:30 +0900 Subject: [PATCH 102/133] VanillaArmorChangeManager as ModSystem --- CalPlayer/Dashes/PlayerDashManager.cs | 2 +- CalamityMod.cs | 3 --- .../VanillaArmorChangeManager.cs | 22 +++++++++---------- UI/InvasionProgressUIManager.cs | 2 +- Utilities/ReflectionHelper.cs | 6 ++--- 5 files changed, 16 insertions(+), 19 deletions(-) diff --git a/CalPlayer/Dashes/PlayerDashManager.cs b/CalPlayer/Dashes/PlayerDashManager.cs index a6c77c8abc..9a53d12e8f 100644 --- a/CalPlayer/Dashes/PlayerDashManager.cs +++ b/CalPlayer/Dashes/PlayerDashManager.cs @@ -44,7 +44,7 @@ namespace CalamityMod.CalPlayer.Dashes public override void OnModLoad() { DashIdentificationTable = new(); - ReflectionHelper.IterateCalamityModTypes(includeBaseType: false, type => + ReflectionHelper.IterateCalamityTypes(includeBaseType: false, type => { string id = (string)type.GetProperty("ID").GetValue(null); diff --git a/CalamityMod.cs b/CalamityMod.cs index 2dc98c60c5..8984d69317 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -117,7 +117,6 @@ namespace CalamityMod Main.QueueMainThreadAction(() => Main.OnPreDraw += PrepareRenderTargets); } - VanillaArmorChangeManager.Load(); SetupBossKillTimes(); BaseIdleHoldoutProjectile.LoadAll(); @@ -129,8 +128,6 @@ namespace CalamityMod { bossKillTimes?.Clear(); bossKillTimes = null; - - VanillaArmorChangeManager.Unload(); NPCStats.Unload(); CalamityGlobalItem.UnloadTweaks(); CalamityGlobalProjectile.UnloadTweaks(); diff --git a/Items/VanillaArmorChanges/VanillaArmorChangeManager.cs b/Items/VanillaArmorChanges/VanillaArmorChangeManager.cs index fd242a29e5..3fa5f9bd4d 100644 --- a/Items/VanillaArmorChanges/VanillaArmorChangeManager.cs +++ b/Items/VanillaArmorChanges/VanillaArmorChangeManager.cs @@ -4,29 +4,29 @@ using System.Linq; using System.Runtime.Serialization; using Terraria; using Terraria.ID; +using Terraria.ModLoader; using Terraria.ModLoader.Core; namespace CalamityMod.Items.VanillaArmorChanges { // TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks. - public static class VanillaArmorChangeManager + public class VanillaArmorChangeManager : ModSystem { internal static List ArmorChanges; - internal static void Load() + public override void OnModLoad() { - ArmorChanges = new List(); - Type[] types = AssemblyManager.GetLoadableTypes(CalamityMod.Instance.Code); - foreach (Type type in types) + ArmorChanges = []; + ReflectionHelper.IterateCalamityTypes(includeBaseType: false, type => { - if (!type.IsSubclassOf(typeof(VanillaArmorChange)) || type.IsAbstract) - continue; - - ArmorChanges.Add((VanillaArmorChange)FormatterServices.GetUninitializedObject(type)); - } + ArmorChanges.Add((VanillaArmorChange)Activator.CreateInstance(type)); + }); } - internal static void Unload() => ArmorChanges = null; + public override void Unload() + { + ArmorChanges = null; + } public static void ApplySetBonusTooltipChanges(Item checkItem, ref string setBonusText) { diff --git a/UI/InvasionProgressUIManager.cs b/UI/InvasionProgressUIManager.cs index 73d9af3532..95aa42ccee 100644 --- a/UI/InvasionProgressUIManager.cs +++ b/UI/InvasionProgressUIManager.cs @@ -27,7 +27,7 @@ namespace CalamityMod.UI public override void OnModLoad() { // Look through every type in the mod, and check if it's derived from InvasionProgressUI. If it is, create a copy and save it in the static list. - ReflectionHelper.IterateCalamityModTypes(includeBaseType: false, type => + ReflectionHelper.IterateCalamityTypes(includeBaseType: false, type => { gUIs.Add(Activator.CreateInstance(type) as InvasionProgressUI); }); diff --git a/Utilities/ReflectionHelper.cs b/Utilities/ReflectionHelper.cs index 22634d419f..53e328ede4 100644 --- a/Utilities/ReflectionHelper.cs +++ b/Utilities/ReflectionHelper.cs @@ -85,19 +85,19 @@ namespace CalamityMod } } - public static IEnumerable GetCalamityModTypes() + public static IEnumerable GetCalamityTypes() { return AssemblyManager.GetLoadableTypes(CalamityMod.Instance.Code); } - public static void IterateCalamityModTypes(bool includeBaseType, Action action) + public static void IterateCalamityTypes(bool includeBaseType, Action action) { // WHY???? if (action is null) return; Type baseType = typeof(T); - var types = GetCalamityModTypes(); + var types = GetCalamityTypes(); foreach (var type in types) { if (type.IsSubclassOf(baseType) && !type.IsAbstract && (!includeBaseType && type != baseType)) From 1050972ce95686f80538871511ba7db2376ae414 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Wed, 18 Sep 2024 19:07:01 +0900 Subject: [PATCH 103/133] Updated IterateCalamityTypes Overload --- CalPlayer/Dashes/PlayerDashManager.cs | 2 +- CalamityNetcode.cs | 14 +++++--------- .../VanillaArmorChangeManager.cs | 2 +- UI/InvasionProgressUIManager.cs | 2 +- Utilities/ReflectionHelper.cs | 2 +- 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/CalPlayer/Dashes/PlayerDashManager.cs b/CalPlayer/Dashes/PlayerDashManager.cs index 9a53d12e8f..38fa36d109 100644 --- a/CalPlayer/Dashes/PlayerDashManager.cs +++ b/CalPlayer/Dashes/PlayerDashManager.cs @@ -44,7 +44,7 @@ namespace CalamityMod.CalPlayer.Dashes public override void OnModLoad() { DashIdentificationTable = new(); - ReflectionHelper.IterateCalamityTypes(includeBaseType: false, type => + ReflectionHelper.IterateCalamityTypes(action: type => { string id = (string)type.GetProperty("ID").GetValue(null); diff --git a/CalamityNetcode.cs b/CalamityNetcode.cs index 1888f34647..72a8847ebc 100644 --- a/CalamityNetcode.cs +++ b/CalamityNetcode.cs @@ -33,16 +33,12 @@ namespace CalamityMod { _PacketRegistry = new CalamityPacket[256]; // This should allow to use 0-255 range (full byte range) - var types = ModLoader.Mods.SelectMany(mod => AssemblyManager.GetLoadableTypes(mod.Code)); - foreach (var type in types) + ReflectionHelper.IterateEveryModsTypes(action: type => { try { - if (type.IsAbstract || !type.IsSubclassOf(typeof(CalamityPacket))) - continue; - if (Activator.CreateInstance(type) is not CalamityPacket packetHandler) - continue; + return; var msgType = packetHandler.MessageType; var existingHandler = _PacketRegistry[msgType]; @@ -52,7 +48,7 @@ namespace CalamityMod $" [Failed On: '{type.FullName}'" + $" Current Owner: '{existingHandler.GetType().FullName}'," + $" msgTypeToRegister: '{msgType}']"); - continue; + return; } _PacketRegistry[packetHandler.MessageType] = packetHandler; @@ -81,9 +77,9 @@ namespace CalamityMod catch (Exception e) { CalamityMod.Instance.Logger.Error($"Exception was thrown while loading for Packets! {e}"); - continue; + return; } - } + }); } public override void OnModUnload() diff --git a/Items/VanillaArmorChanges/VanillaArmorChangeManager.cs b/Items/VanillaArmorChanges/VanillaArmorChangeManager.cs index 3fa5f9bd4d..8292206e0b 100644 --- a/Items/VanillaArmorChanges/VanillaArmorChangeManager.cs +++ b/Items/VanillaArmorChanges/VanillaArmorChangeManager.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.VanillaArmorChanges public override void OnModLoad() { ArmorChanges = []; - ReflectionHelper.IterateCalamityTypes(includeBaseType: false, type => + ReflectionHelper.IterateCalamityTypes(action: type => { ArmorChanges.Add((VanillaArmorChange)Activator.CreateInstance(type)); }); diff --git a/UI/InvasionProgressUIManager.cs b/UI/InvasionProgressUIManager.cs index 95aa42ccee..c349471eb3 100644 --- a/UI/InvasionProgressUIManager.cs +++ b/UI/InvasionProgressUIManager.cs @@ -27,7 +27,7 @@ namespace CalamityMod.UI public override void OnModLoad() { // Look through every type in the mod, and check if it's derived from InvasionProgressUI. If it is, create a copy and save it in the static list. - ReflectionHelper.IterateCalamityTypes(includeBaseType: false, type => + ReflectionHelper.IterateCalamityTypes(action: type => { gUIs.Add(Activator.CreateInstance(type) as InvasionProgressUI); }); diff --git a/Utilities/ReflectionHelper.cs b/Utilities/ReflectionHelper.cs index 53e328ede4..e1aff58a66 100644 --- a/Utilities/ReflectionHelper.cs +++ b/Utilities/ReflectionHelper.cs @@ -90,7 +90,7 @@ namespace CalamityMod return AssemblyManager.GetLoadableTypes(CalamityMod.Instance.Code); } - public static void IterateCalamityTypes(bool includeBaseType, Action action) + public static void IterateCalamityTypes(bool includeBaseType = false, Action action = null) { // WHY???? if (action is null) From e94aa9212e8c5daaa9ceaf4db87e3148046266cb Mon Sep 17 00:00:00 2001 From: Flowaria Date: Wed, 18 Sep 2024 19:11:18 +0900 Subject: [PATCH 104/133] PopupGUIManager as ModSystem --- CalamityMod.cs | 2 -- ModSupport/WeakReferenceSupport.cs | 1 - UI/PopupGUIManager.cs | 27 ++++++++++++--------------- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/CalamityMod.cs b/CalamityMod.cs index 8984d69317..2444c56c95 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -132,8 +132,6 @@ namespace CalamityMod CalamityGlobalItem.UnloadTweaks(); CalamityGlobalProjectile.UnloadTweaks(); - PopupGUIManager.UnloadGUIs(); - Main.QueueMainThreadAction(() => { Main.OnPreDraw -= PrepareRenderTargets; diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index ae167ac5f7..7d171a83df 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -201,7 +201,6 @@ namespace CalamityMod if (!Main.dedServ) { WikiThisSupport(); - PopupGUIManager.LoadGUIs(); } } diff --git a/UI/PopupGUIManager.cs b/UI/PopupGUIManager.cs index 0f472693a9..0e37676da0 100644 --- a/UI/PopupGUIManager.cs +++ b/UI/PopupGUIManager.cs @@ -8,10 +8,10 @@ using Terraria.ModLoader.Core; namespace CalamityMod.UI { - // TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks. - public static class PopupGUIManager + [Autoload(Side = ModSide.Client)] + public sealed class PopupGUIManager : ModSystem { - private static readonly List gUIs = new List(); + private static readonly List gUIs = []; public static bool GUIActive(PopupGUI gui) => gui.Active || gui.FadeTime > 0; public static bool AnyGUIsActive => gUIs.Any(GUIActive); public static PopupGUI GetActiveGUI => gUIs.FirstOrDefault(GUIActive); @@ -57,21 +57,18 @@ namespace CalamityMod.UI gUIs.First(gui => gui.GetType() == type).Active = !gUIs.First(gui => gui.GetType() == type).Active; } - public static void LoadGUIs() + public override void OnModLoad() { // Look through every type in the mod, and check if it's derived from PopupGUI. If it is, create a copy and save it in the static list. - foreach (Mod mod in ModLoader.Mods) + ReflectionHelper.IterateEveryModsTypes(action: type => { - foreach (Type type in AssemblyManager.GetLoadableTypes(mod.Code)) - { - // Don't load abstract classes since they cannot have instances. - if (type.IsAbstract) - continue; - if (type.IsSubclassOf(typeof(PopupGUI))) - gUIs.Add(Activator.CreateInstance(type) as PopupGUI); - } - } + gUIs.Add(Activator.CreateInstance(type) as PopupGUI); + }); + } + + public override void Unload() + { + gUIs?.Clear(); } - public static void UnloadGUIs() => gUIs.Clear(); } } From 73c31f9d862dabecd41dd5a58b7f2f03e838a7e7 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Wed, 18 Sep 2024 19:18:38 +0900 Subject: [PATCH 105/133] Removed BaseIdleHoldoutProjectile.LoadAll --- CalamityMod.cs | 2 -- .../BaseIdleHoldoutProjectile.cs | 28 ++++++------------- Projectiles/Melee/BladecrestOathswordProj.cs | 2 ++ Projectiles/Melee/OldLordClaymoreProj.cs | 2 ++ 4 files changed, 12 insertions(+), 22 deletions(-) diff --git a/CalamityMod.cs b/CalamityMod.cs index 2444c56c95..a5b522c8bb 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -118,8 +118,6 @@ namespace CalamityMod } SetupBossKillTimes(); - - BaseIdleHoldoutProjectile.LoadAll(); } #endregion diff --git a/Projectiles/BaseProjectiles/BaseIdleHoldoutProjectile.cs b/Projectiles/BaseProjectiles/BaseIdleHoldoutProjectile.cs index 34d117b2e6..a8658220ca 100644 --- a/Projectiles/BaseProjectiles/BaseIdleHoldoutProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseIdleHoldoutProjectile.cs @@ -16,29 +16,17 @@ namespace CalamityMod.Projectiles.BaseProjectiles // The projectile type cannot be directly discerned at load time (Using Activator.CreateInstance will create an associated projectile with an ID of 0) and as // such this property exists as a direct means of retrieving it. Not ideal, but it works. public abstract int IntendedProjectileType { get; } - public static Dictionary ItemProjectileRelationship = new(); + public static Dictionary ItemProjectileRelationship = []; - // TODO -- There is no reason this load hook should need to be called from CalamityMod. - // All subclasses of this should be ILoadable and should load themselves. - public static void LoadAll() + public override void SetStaticDefaults() { - ItemProjectileRelationship = new Dictionary(); + ItemProjectileRelationship[AssociatedItemID] = IntendedProjectileType; + } - // Look through every type in the mod, and check if it's derived from BaseIdleHoldoutProjectile. - // If it is, cache it into the item/projectile relationship cache. - Type[] types = AssemblyManager.GetLoadableTypes(CalamityMod.Instance.Code); - foreach (Type type in types) - { - // Don't load abstract classes; they cannot have instances. - if (type.IsAbstract) - continue; - - if (type.IsSubclassOf(typeof(BaseIdleHoldoutProjectile))) - { - BaseIdleHoldoutProjectile instance = Activator.CreateInstance(type) as BaseIdleHoldoutProjectile; - ItemProjectileRelationship[instance.AssociatedItemID] = instance.IntendedProjectileType; - } - } + public override void Unload() + { + ItemProjectileRelationship?.Clear(); + ItemProjectileRelationship = null; } public static void CheckForEveryHoldout(Player player) diff --git a/Projectiles/Melee/BladecrestOathswordProj.cs b/Projectiles/Melee/BladecrestOathswordProj.cs index b962bf36c3..4b0fdfee15 100644 --- a/Projectiles/Melee/BladecrestOathswordProj.cs +++ b/Projectiles/Melee/BladecrestOathswordProj.cs @@ -36,6 +36,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { + base.SetStaticDefaults(); // DO NOT REMOVE THIS + ProjectileID.Sets.TrailingMode[Projectile.type] = 2; ProjectileID.Sets.TrailCacheLength[Projectile.type] = 3; } diff --git a/Projectiles/Melee/OldLordClaymoreProj.cs b/Projectiles/Melee/OldLordClaymoreProj.cs index 9d32a7a7fb..a15390c1b4 100644 --- a/Projectiles/Melee/OldLordClaymoreProj.cs +++ b/Projectiles/Melee/OldLordClaymoreProj.cs @@ -41,6 +41,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { + base.SetStaticDefaults(); // DO NOT REMOVE THIS + ProjectileID.Sets.TrailingMode[Projectile.type] = 2; ProjectileID.Sets.TrailCacheLength[Projectile.type] = 3; } From a428a3056e05ebfc1ad579ef6d47e1fa52da2ceb Mon Sep 17 00:00:00 2001 From: Flowaria Date: Wed, 18 Sep 2024 19:23:42 +0900 Subject: [PATCH 106/133] PrimitiveRenderer as ModSystem --- CalamityMod.cs | 2 -- Graphics/Primitives/PrimitiveRenderer.cs | 6 ++++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CalamityMod.cs b/CalamityMod.cs index a5b522c8bb..b9a5c30903 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -110,8 +110,6 @@ namespace CalamityMod if (!Main.dedServ) { - PrimitiveRenderer.Initialize(); - // This must be done separately from immediate loading, as loading is now multithreaded. // However, render targets and certain other graphical objects can only be created on the main thread. Main.QueueMainThreadAction(() => Main.OnPreDraw += PrepareRenderTargets); diff --git a/Graphics/Primitives/PrimitiveRenderer.cs b/Graphics/Primitives/PrimitiveRenderer.cs index 928c64bfd4..66fa36a79d 100644 --- a/Graphics/Primitives/PrimitiveRenderer.cs +++ b/Graphics/Primitives/PrimitiveRenderer.cs @@ -5,6 +5,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Graphics.Shaders; +using Terraria.ModLoader; namespace CalamityMod.Graphics.Primitives { @@ -19,7 +20,8 @@ namespace CalamityMod.Graphics.Primitives /// If you wish to use pixelation, you MUST make the NPC/Projectile inherit and use instead of predraw..
/// You can also optionally specify a render layer with . It is by default. ///
- public static class PrimitiveRenderer + [Autoload(Side = ModSide.Client)] + public sealed class PrimitiveRenderer : ModSystem { #region Static Members private static DynamicVertexBuffer VertexBuffer; @@ -46,7 +48,7 @@ namespace CalamityMod.Graphics.Primitives private static short IndicesIndex; - internal static void Initialize() + public override void OnModLoad() { Main.QueueMainThreadAction(() => { From fca410936238de5b0e0216e66cc79aa7d51cc4b8 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Wed, 18 Sep 2024 19:28:13 +0900 Subject: [PATCH 107/133] Moved ChadPrime HeadLoading into ExtraTextureRefs --- ExtraTextures/ExtraTextureRefs.cs | 10 ++++++++++ NPCs/CalamityGlobalNPC.cs | 5 +---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ExtraTextures/ExtraTextureRefs.cs b/ExtraTextures/ExtraTextureRefs.cs index b00b82d6b6..e998316328 100644 --- a/ExtraTextures/ExtraTextureRefs.cs +++ b/ExtraTextures/ExtraTextureRefs.cs @@ -32,6 +32,16 @@ namespace CalamityMod.ExtraTextures public static Asset FlyingCarpetVanilla; public static Asset FlyingCarpetAuric; + // Boss Heads + // I know it's not exactly the "Texture" but it belongs to ExtraTextures so 🤷 + public static int BossHeadIndex_ChadPrime; + + public override void Load() + { + string chadPrimeIconPath = "CalamityMod/ExtraTextures/ChadPrime_Head_Boss"; + BossHeadIndex_ChadPrime = CalamityMod.Instance.AddBossHeadTexture(chadPrimeIconPath, -1); + } + public override void OnModLoad() { DestroyerHeadGlowmask = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerHeadGlow", AssetRequestMode.AsyncLoad); diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 66c7b01159..559621670e 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -1222,9 +1222,6 @@ namespace CalamityMod.NPCs #region Load/Unload public override void Load() { - string chadPrimeIconPath = "CalamityMod/ExtraTextures/ChadPrime_Head_Boss"; - chadPrimeIcon = CalamityMod.Instance.AddBossHeadTexture(chadPrimeIconPath, -1); - #region Setup Vanilla DR Values DRValues = new SortedDictionary { { NPCID.AngryBonesBig, 0.2f }, @@ -3604,7 +3601,7 @@ namespace CalamityMod.NPCs if (CalamityWorld.revenge || BossRushEvent.BossRushActive) { if (npc.type == NPCID.SkeletronPrime && (Main.masterMode || BossRushEvent.BossRushActive)) - index = chadPrimeIcon; + index = ExtraTextureRefs.BossHeadIndex_ChadPrime; if (npc.type == NPCID.DukeFishron && (CalamityWorld.death || BossRushEvent.BossRushActive)) { From 470f9bcbdaabf13c84ec609952e9b78ccf4413ca Mon Sep 17 00:00:00 2001 From: Flowaria Date: Thu, 19 Sep 2024 19:28:51 +0900 Subject: [PATCH 108/133] Moved BossKillTime to CalamityGlobalNPC --- CalamityMod.cs | 169 ------------------ .../CalamityBossAIs/AquaticScourgeAI.cs | 2 +- NPCs/CalamityGlobalNPC.cs | 105 ++++++++++- 3 files changed, 104 insertions(+), 172 deletions(-) diff --git a/CalamityMod.cs b/CalamityMod.cs index b9a5c30903..7f74621536 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -1,72 +1,14 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; -using CalamityMod.Balancing; -using CalamityMod.CalPlayer; -using CalamityMod.CalPlayer.Dashes; -using CalamityMod.Cooldowns; -using CalamityMod.DataStructures; -using CalamityMod.Effects; -using CalamityMod.Events; using CalamityMod.FluidSimulation; -using CalamityMod.Graphics.Primitives; using CalamityMod.Items; -using CalamityMod.Items.Dyes.HairDye; -using CalamityMod.Items.VanillaArmorChanges; -using CalamityMod.NPCs.AquaticScourge; -using CalamityMod.NPCs.AstrumAureus; -using CalamityMod.NPCs.AstrumDeus; -using CalamityMod.NPCs.BrimstoneElemental; -using CalamityMod.NPCs.Bumblebirb; -using CalamityMod.NPCs.CalClone; -using CalamityMod.NPCs.CeaselessVoid; -using CalamityMod.NPCs.Crabulon; -using CalamityMod.NPCs.Cryogen; -using CalamityMod.NPCs.DesertScourge; -using CalamityMod.NPCs.DevourerofGods; -using CalamityMod.NPCs.ExoMechs.Apollo; -using CalamityMod.NPCs.ExoMechs.Ares; -using CalamityMod.NPCs.ExoMechs.Artemis; -using CalamityMod.NPCs.ExoMechs.Thanatos; -using CalamityMod.NPCs.HiveMind; -using CalamityMod.NPCs.Leviathan; -using CalamityMod.NPCs.OldDuke; -using CalamityMod.NPCs.Perforator; -using CalamityMod.NPCs.PlaguebringerGoliath; -using CalamityMod.NPCs.Polterghast; -using CalamityMod.NPCs.PrimordialWyrm; -using CalamityMod.NPCs.ProfanedGuardians; -using CalamityMod.NPCs.Providence; -using CalamityMod.NPCs.Ravager; -using CalamityMod.NPCs.Signus; -using CalamityMod.NPCs.SlimeGod; -using CalamityMod.NPCs.StormWeaver; -using CalamityMod.NPCs.SupremeCalamitas; -using CalamityMod.NPCs.Yharon; using CalamityMod.Particles; using CalamityMod.Projectiles; -using CalamityMod.Projectiles.BaseProjectiles; -using CalamityMod.Schematics; -using CalamityMod.Skies; -using CalamityMod.Systems; -using CalamityMod.UI; -using CalamityMod.UI.CalamitasEnchants; -using CalamityMod.UI.DraedonsArsenal; -using CalamityMod.UI.Rippers; -using CalamityMod.Waters; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; using Terraria; -using Terraria.GameContent; -using Terraria.GameContent.Dyes; -using Terraria.GameContent.Liquid; -using Terraria.Graphics.Effects; -using Terraria.Graphics.Shaders; -using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.Config; @@ -76,13 +18,6 @@ namespace CalamityMod { public class CalamityMod : Mod { - // TODO -- A huge amount of random floating variables exist here. - // These should all be moved to other files, whether that's CalamityLists or brand new ModSystems. - // It is best to have a ton of small ModSystems. - - // Boss Kill Time data structure - public static SortedDictionary bossKillTimes; - #region External Flags // External flag to disable non-Revengeance boss AI edits // This can be edited by other mods using reflection to prevent compatibility issues @@ -114,16 +49,12 @@ namespace CalamityMod // However, render targets and certain other graphical objects can only be created on the main thread. Main.QueueMainThreadAction(() => Main.OnPreDraw += PrepareRenderTargets); } - - SetupBossKillTimes(); } #endregion #region Unload public override void Unload() { - bossKillTimes?.Clear(); - bossKillTimes = null; NPCStats.Unload(); CalamityGlobalItem.UnloadTweaks(); CalamityGlobalProjectile.UnloadTweaks(); @@ -167,106 +98,6 @@ namespace CalamityMod } #endregion - #region Boss Kill Times - private void SetupBossKillTimes() - { - // Kill times are measured exactly in frames. - // 60 frames = 1 second - // 3600 frames = 1 minute - bossKillTimes = new SortedDictionary { - // - // VANILLA BOSSES - // - { NPCID.KingSlime, 5400 }, // 1:30 (90 seconds) - { NPCID.EyeofCthulhu, 5400 }, // 1:30 (90 seconds) - { NPCID.EaterofWorldsHead, 7200 }, // 2:00 (120 seconds) - { NPCID.EaterofWorldsBody, 7200 }, - { NPCID.EaterofWorldsTail, 7200 }, - { NPCID.BrainofCthulhu, 7200 }, // 2:00 (120 seconds, total length of fight including Creepers phase) - { NPCID.Creeper, 1800 }, // 0:30 (30 seconds, length of Creepers phase) - { NPCID.Deerclops, 5400 }, // 1:30 (90 seconds) - { NPCID.QueenBee, 7200 }, // 2:00 (120 seconds) - { NPCID.SkeletronHead, 9000 }, // 2:30 (150 seconds) - { NPCID.WallofFlesh, 7200 }, // 2:00 (120 seconds) - { NPCID.WallofFleshEye, 7200 }, - { NPCID.QueenSlimeBoss, 7200 }, // 2:00 (120 seconds) - { NPCID.Spazmatism, 10800 }, // 3:00 (180 seconds) - { NPCID.Retinazer, 10800 }, - { NPCID.TheDestroyer, 10800 }, // 3:00 (180 seconds) - { NPCID.TheDestroyerBody, 10800 }, - { NPCID.TheDestroyerTail, 10800 }, - { NPCID.SkeletronPrime, 10800 }, // 3:00 (180 seconds) - { NPCID.Plantera, 10800 }, // 3:00 (180 seconds) - { NPCID.HallowBoss, 10800 }, // 3:00 (180 seconds) - { NPCID.Golem, 9000 }, // 2:30 (150 seconds) - { NPCID.GolemHead, 3600 }, // 1:00 (60 seconds) - { NPCID.DukeFishron, 9000 }, // 2:30 (150 seconds) - { NPCID.CultistBoss, 9000 }, // 2:30 (150 seconds) - { NPCID.MoonLordCore, 14400 }, // 4:00 (240 seconds) - { NPCID.MoonLordHand, 7200 }, // 2:00 (120 seconds) - { NPCID.MoonLordHead, 7200 }, // 2:00 (120 seconds) - - // - // CALAMITY BOSSES - // - { ModContent.NPCType(), 5400 }, // 1:30 (90 seconds) - { ModContent.NPCType(), 5400 }, - { ModContent.NPCType(), 5400 }, - { ModContent.NPCType(), 5400 }, // 1:30 (90 seconds) - { ModContent.NPCType(), 7200 }, // 2:00 (120 seconds) - { ModContent.NPCType(), 7200 }, // 2:00 (120 seconds) - { ModContent.NPCType(), 9000 }, // 2:30 (150 seconds) -- total length of Slime God fight - { ModContent.NPCType(), 4500 }, // 1:15 (75 seconds) - { ModContent.NPCType(), 4500 }, // 1:15 (75 seconds) - { ModContent.NPCType(), 4500 }, // 1:15 (75 seconds) -- split slimes should spawn at 1:15 and die at around 2:30 - { ModContent.NPCType(), 4500 }, // 1:15 (75 seconds) - { ModContent.NPCType(), 10800 }, // 3:00 (180 seconds) - { ModContent.NPCType(), 9000 }, // 2:30 (150 seconds) - { ModContent.NPCType(), 9000 }, - { ModContent.NPCType(), 9000 }, - { ModContent.NPCType(), 9000 }, - { ModContent.NPCType(), 10800 }, // 3:00 (180 seconds) - { ModContent.NPCType(), 14400 }, // 4:00 (240 seconds) - { ModContent.NPCType(), 10800 }, // 3:00 (180 seconds) - { ModContent.NPCType(), 10800 }, - { ModContent.NPCType(), 10800 }, // 3:00 (180 seconds) - { ModContent.NPCType(), 7200 }, // 2:00 (120 seconds) -- first phase is 1:00 - { ModContent.NPCType(), 7200 }, - { ModContent.NPCType(), 7200 }, - { ModContent.NPCType(), 10800 }, // 3:00 (180 seconds) - { ModContent.NPCType(), 10800 }, // 3:00 (180 seconds) - { ModContent.NPCType(), 5400 }, // 1:30 (90 seconds) - { ModContent.NPCType(), 7200 }, // 2:00 (120 seconds) - { ModContent.NPCType(), 14400 }, // 4:00 (240 seconds) - { ModContent.NPCType(), 10800 }, // 3:00 (180 seconds) - { ModContent.NPCType(), 1200 }, // 0:20 (20 seconds) - { ModContent.NPCType(), 8100 }, // 2:15 (135 seconds) - { ModContent.NPCType(), 8100 }, - { ModContent.NPCType(), 8100 }, - { ModContent.NPCType(), 7200 }, // 2:00 (120 seconds) - { ModContent.NPCType(), 10800 }, // 3:00 (180 seconds) - { ModContent.NPCType(), 10800 }, // 3:00 (180 seconds) - { ModContent.NPCType(), 14400 }, // 4:00 (240 seconds) - { ModContent.NPCType(), 14400 }, // DoG Phase 1 is 1:30, DoG Phase 2 is 2:30 - { ModContent.NPCType(), 14400 }, - { ModContent.NPCType(), 14700 }, // 4:05 (245 seconds) -- he spends 5 seconds invincible where you can't do anything - { ModContent.NPCType(), 21600 }, // 6:00 (360 seconds) - { ModContent.NPCType(), 21600 }, - { ModContent.NPCType(), 21600 }, // 6:00 (360 seconds) - { ModContent.NPCType(), 21600 }, - { ModContent.NPCType(), 21600 }, - { ModContent.NPCType(), 21600 }, - { ModContent.NPCType(), 21600 }, - { ModContent.NPCType(), 21600 }, // 6:00 (360 seconds) - { ModContent.NPCType(), 21600 }, - { ModContent.NPCType(), 21600 }, - { ModContent.NPCType(), 21600 }, - { ModContent.NPCType(), 18000 }, // 5:00 (300 seconds) - { ModContent.NPCType(), 18000 } // 5:00 (300 seconds) - }; - } - #endregion - #region Music // This function returns an available Calamity Music Mod track, or null if the Calamity Music Mod is not available. diff --git a/NPCs/CalamityAIs/CalamityBossAIs/AquaticScourgeAI.cs b/NPCs/CalamityAIs/CalamityBossAIs/AquaticScourgeAI.cs index 2ddd4e677e..b4b7b4b27b 100644 --- a/NPCs/CalamityAIs/CalamityBossAIs/AquaticScourgeAI.cs +++ b/NPCs/CalamityAIs/CalamityBossAIs/AquaticScourgeAI.cs @@ -53,7 +53,7 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs // Kiss my motherfucking ass you piece of shit game npc.timeLeft *= 20; npc.npcSlots = 16f; - CalamityMod.bossKillTimes.TryGetValue(npc.type, out int revKillTime); + CalamityGlobalNPC.BossKillTimes.TryGetValue(npc.type, out int revKillTime); calamityGlobalNPC.KillTime = revKillTime; calamityGlobalNPC.newAI[0] = 1f; nonHostile = false; diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 559621670e..5fac01944d 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -93,6 +93,11 @@ namespace CalamityMod.NPCs { #region Variables + /// + /// Boss Kill Time data structure + /// + public static SortedDictionary BossKillTimes; + /// /// Damage Reduction Lookup Table /// @@ -1342,12 +1347,109 @@ namespace CalamityMod.NPCs { DRValues?.Clear(); DRValues = null; + + BossKillTimes?.Clear(); + BossKillTimes = null; } #endregion #region Set Defaults public override void SetStaticDefaults() { + #region Setup Boss Kill Time + BossKillTimes = new SortedDictionary { + // + // VANILLA BOSSES + // + { NPCID.KingSlime, 5400 }, // 1:30 (90 seconds) + { NPCID.EyeofCthulhu, 5400 }, // 1:30 (90 seconds) + { NPCID.EaterofWorldsHead, 7200 }, // 2:00 (120 seconds) + { NPCID.EaterofWorldsBody, 7200 }, + { NPCID.EaterofWorldsTail, 7200 }, + { NPCID.BrainofCthulhu, 7200 }, // 2:00 (120 seconds, total length of fight including Creepers phase) + { NPCID.Creeper, 1800 }, // 0:30 (30 seconds, length of Creepers phase) + { NPCID.Deerclops, 5400 }, // 1:30 (90 seconds) + { NPCID.QueenBee, 7200 }, // 2:00 (120 seconds) + { NPCID.SkeletronHead, 9000 }, // 2:30 (150 seconds) + { NPCID.WallofFlesh, 7200 }, // 2:00 (120 seconds) + { NPCID.WallofFleshEye, 7200 }, + { NPCID.QueenSlimeBoss, 7200 }, // 2:00 (120 seconds) + { NPCID.Spazmatism, 10800 }, // 3:00 (180 seconds) + { NPCID.Retinazer, 10800 }, + { NPCID.TheDestroyer, 10800 }, // 3:00 (180 seconds) + { NPCID.TheDestroyerBody, 10800 }, + { NPCID.TheDestroyerTail, 10800 }, + { NPCID.SkeletronPrime, 10800 }, // 3:00 (180 seconds) + { NPCID.Plantera, 10800 }, // 3:00 (180 seconds) + { NPCID.HallowBoss, 10800 }, // 3:00 (180 seconds) + { NPCID.Golem, 9000 }, // 2:30 (150 seconds) + { NPCID.GolemHead, 3600 }, // 1:00 (60 seconds) + { NPCID.DukeFishron, 9000 }, // 2:30 (150 seconds) + { NPCID.CultistBoss, 9000 }, // 2:30 (150 seconds) + { NPCID.MoonLordCore, 14400 }, // 4:00 (240 seconds) + { NPCID.MoonLordHand, 7200 }, // 2:00 (120 seconds) + { NPCID.MoonLordHead, 7200 }, // 2:00 (120 seconds) + + // + // CALAMITY BOSSES + // + { NPCType(), 5400 }, // 1:30 (90 seconds) + { NPCType(), 5400 }, + { NPCType(), 5400 }, + { NPCType(), 5400 }, // 1:30 (90 seconds) + { NPCType(), 7200 }, // 2:00 (120 seconds) + { NPCType(), 7200 }, // 2:00 (120 seconds) + { NPCType(), 9000 }, // 2:30 (150 seconds) -- total length of Slime God fight + { NPCType(), 4500 }, // 1:15 (75 seconds) + { NPCType(), 4500 }, // 1:15 (75 seconds) + { NPCType(), 4500 }, // 1:15 (75 seconds) -- split slimes should spawn at 1:15 and die at around 2:30 + { NPCType(), 4500 }, // 1:15 (75 seconds) + { NPCType(), 10800 }, // 3:00 (180 seconds) + { NPCType(), 9000 }, // 2:30 (150 seconds) + { NPCType(), 9000 }, + { NPCType(), 9000 }, + { NPCType(), 9000 }, + { NPCType(), 10800 }, // 3:00 (180 seconds) + { NPCType(), 14400 }, // 4:00 (240 seconds) + { NPCType(), 10800 }, // 3:00 (180 seconds) + { NPCType(), 10800 }, + { NPCType(), 10800 }, // 3:00 (180 seconds) + { NPCType(), 7200 }, // 2:00 (120 seconds) -- first phase is 1:00 + { NPCType(), 7200 }, + { NPCType(), 7200 }, + { NPCType(), 10800 }, // 3:00 (180 seconds) + { NPCType(), 10800 }, // 3:00 (180 seconds) + { NPCType(), 5400 }, // 1:30 (90 seconds) + { NPCType(), 7200 }, // 2:00 (120 seconds) + { NPCType(), 14400 }, // 4:00 (240 seconds) + { NPCType(), 10800 }, // 3:00 (180 seconds) + { NPCType(), 1200 }, // 0:20 (20 seconds) + { NPCType(), 8100 }, // 2:15 (135 seconds) + { NPCType(), 8100 }, + { NPCType(), 8100 }, + { NPCType(), 7200 }, // 2:00 (120 seconds) + { NPCType(), 10800 }, // 3:00 (180 seconds) + { NPCType(), 10800 }, // 3:00 (180 seconds) + { NPCType(), 14400 }, // 4:00 (240 seconds) + { NPCType(), 14400 }, // DoG Phase 1 is 1:30, DoG Phase 2 is 2:30 + { NPCType(), 14400 }, + { NPCType(), 14700 }, // 4:05 (245 seconds) -- he spends 5 seconds invincible where you can't do anything + { NPCType(), 21600 }, // 6:00 (360 seconds) + { NPCType(), 21600 }, + { NPCType(), 21600 }, // 6:00 (360 seconds) + { NPCType(), 21600 }, + { NPCType(), 21600 }, + { NPCType(), 21600 }, + { NPCType(), 21600 }, + { NPCType(), 21600 }, // 6:00 (360 seconds) + { NPCType(), 21600 }, + { NPCType(), 21600 }, + { NPCType(), 21600 }, + { NPCType(), 18000 }, // 5:00 (300 seconds) + { NPCType(), 18000 } // 5:00 (300 seconds) + }; + #endregion + // Set Plantera to be able to update oldPos[x] // This is only used for her Rev+ AI charge attacks NPCID.Sets.TrailingMode[NPCID.Plantera] = 1; @@ -1376,9 +1478,8 @@ namespace CalamityMod.NPCs } // Aquatic Scourge sets kill time in AI, not here. - if (CalamityMod.bossKillTimes.ContainsKey(npc.type) && !CalamityLists.AquaticScourgeIDs.Contains(npc.type)) + if (BossKillTimes.TryGetValue(npc.type, out int revKillTime) && !CalamityLists.AquaticScourgeIDs.Contains(npc.type)) { - CalamityMod.bossKillTimes.TryGetValue(npc.type, out int revKillTime); KillTime = revKillTime; } From 40dbc653273b854c89b63eca31d2173651f101f2 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Thu, 19 Sep 2024 19:40:29 +0900 Subject: [PATCH 109/133] Moved SaveConfig to CalamityClientConfig --- CalamityConfig.cs | 19 ++++++++++++++++++ CalamityMod.cs | 20 ------------------- UI/DraedonsArsenal/ChargeMeterUI.cs | 4 ++-- UI/FlightBar/FlightBar.cs | 4 ++-- UI/Rippers/RipperUI.cs | 8 ++++---- UI/StealthUI.cs | 4 ++-- .../SulphurousWaterMeterUI.cs | 4 ++-- 7 files changed, 31 insertions(+), 32 deletions(-) diff --git a/CalamityConfig.cs b/CalamityConfig.cs index 00b5eed916..660857cee5 100644 --- a/CalamityConfig.cs +++ b/CalamityConfig.cs @@ -1,4 +1,5 @@ using System.ComponentModel; +using System.Reflection; using System.Runtime.Serialization; using CalamityMod.UI; using CalamityMod.UI.DraedonsArsenal; @@ -25,6 +26,24 @@ namespace CalamityMod ParticleLimit = (int)Utils.Clamp(ParticleLimit, MinParticleLimit, MaxParticleLimit); } + internal static void SaveConfig() + { + // 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. + try + { + MethodInfo saveMethodInfo = typeof(ConfigManager).GetMethod("Save", BindingFlags.Static | BindingFlags.NonPublic); + if (saveMethodInfo is not null) + saveMethodInfo.Invoke(null, [Instance]); + else + CalamityMod.Instance.Logger.Error("TML ConfigManager.Save reflection failed. Method signature has changed. Notify Calamity Devs if you see this in your log."); + } + catch + { + CalamityMod.Instance.Logger.Error("An error occurred while manually saving Calamity mod configuration. This may be due to a complex mod conflict. It is safe to ignore this error."); + } + } + #region Multi-Threading Settings [Header("Multithreading")] diff --git a/CalamityMod.cs b/CalamityMod.cs index 7f74621536..04444e41f5 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -78,26 +78,6 @@ namespace CalamityMod } #endregion Render Target Management - #region Force ModConfig save (Reflection) - 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. - try - { - MethodInfo saveMethodInfo = typeof(ConfigManager).GetMethod("Save", BindingFlags.Static | BindingFlags.NonPublic); - if (saveMethodInfo is not null) - saveMethodInfo.Invoke(null, new object[] { cfg }); - else - Instance.Logger.Error("TML ConfigManager.Save reflection failed. Method signature has changed. Notify Calamity Devs if you see this in your log."); - } - catch - { - Instance.Logger.Error("An error occurred while manually saving Calamity mod configuration. This may be due to a complex mod conflict. It is safe to ignore this error."); - } - } - #endregion - #region Music // This function returns an available Calamity Music Mod track, or null if the Calamity Music Mod is not available. diff --git a/UI/DraedonsArsenal/ChargeMeterUI.cs b/UI/DraedonsArsenal/ChargeMeterUI.cs index 3ece55f181..af52bdb329 100644 --- a/UI/DraedonsArsenal/ChargeMeterUI.cs +++ b/UI/DraedonsArsenal/ChargeMeterUI.cs @@ -65,7 +65,7 @@ namespace CalamityMod.UI.DraedonsArsenal changed = true; } if (changed) - CalamityMod.SaveConfig(CalamityClientConfig.Instance); + CalamityClientConfig.SaveConfig(); } // If the Charge Meter is turned off or the player is not holding an item, stop. @@ -132,7 +132,7 @@ namespace CalamityMod.UI.DraedonsArsenal if (ms.LeftButton == ButtonState.Released) { dragOffset = null; - CalamityMod.SaveConfig(CalamityClientConfig.Instance); + CalamityClientConfig.SaveConfig(); } } } diff --git a/UI/FlightBar/FlightBar.cs b/UI/FlightBar/FlightBar.cs index 4823060fdc..f344bc517c 100644 --- a/UI/FlightBar/FlightBar.cs +++ b/UI/FlightBar/FlightBar.cs @@ -125,7 +125,7 @@ namespace CalamityMod.UI } if (changed) - CalamityMod.SaveConfig(CalamityClientConfig.Instance); + CalamityClientConfig.SaveConfig(); return; } @@ -175,7 +175,7 @@ namespace CalamityMod.UI if (ms.LeftButton == ButtonState.Released) { dragOffset = null; - CalamityMod.SaveConfig(CalamityClientConfig.Instance); + CalamityClientConfig.SaveConfig(); } } } diff --git a/UI/Rippers/RipperUI.cs b/UI/Rippers/RipperUI.cs index 8340a270cb..424310e6ec 100644 --- a/UI/Rippers/RipperUI.cs +++ b/UI/Rippers/RipperUI.cs @@ -146,7 +146,7 @@ namespace CalamityMod.UI.Rippers changed = true; } if (changed) - CalamityMod.SaveConfig(CalamityClientConfig.Instance); + CalamityClientConfig.SaveConfig(); } if (modPlayer.AdrenalineEnabled) @@ -165,7 +165,7 @@ namespace CalamityMod.UI.Rippers changed = true; } if (changed) - CalamityMod.SaveConfig(CalamityClientConfig.Instance); + CalamityClientConfig.SaveConfig(); } #region Mouse Interaction @@ -225,7 +225,7 @@ namespace CalamityMod.UI.Rippers if (ms.LeftButton == ButtonState.Released) { rageDragOffset = null; - CalamityMod.SaveConfig(CalamityClientConfig.Instance); + CalamityClientConfig.SaveConfig(); } } else if (adrenHover) @@ -267,7 +267,7 @@ namespace CalamityMod.UI.Rippers if (ms.LeftButton == ButtonState.Released) { adrenDragOffset = null; - CalamityMod.SaveConfig(CalamityClientConfig.Instance); + CalamityClientConfig.SaveConfig(); } } #endregion diff --git a/UI/StealthUI.cs b/UI/StealthUI.cs index b695187eac..42c9269e04 100644 --- a/UI/StealthUI.cs +++ b/UI/StealthUI.cs @@ -76,7 +76,7 @@ namespace CalamityMod.UI } if (changed) - CalamityMod.SaveConfig(CalamityClientConfig.Instance); + CalamityClientConfig.SaveConfig(); } Rectangle mouseHitbox = new Rectangle((int)Main.MouseScreen.X, (int)Main.MouseScreen.Y, 8, 8); @@ -139,7 +139,7 @@ namespace CalamityMod.UI if (ms.LeftButton == ButtonState.Released) { dragOffset = null; - CalamityMod.SaveConfig(CalamityClientConfig.Instance); + CalamityClientConfig.SaveConfig(); } } } diff --git a/UI/SulphurousWaterMeter/SulphurousWaterMeterUI.cs b/UI/SulphurousWaterMeter/SulphurousWaterMeterUI.cs index 97a3df2f64..04b5b562da 100644 --- a/UI/SulphurousWaterMeter/SulphurousWaterMeterUI.cs +++ b/UI/SulphurousWaterMeter/SulphurousWaterMeterUI.cs @@ -70,7 +70,7 @@ namespace CalamityMod.UI.SulphurousWaterMeter } if (changed) - CalamityMod.SaveConfig(CalamityClientConfig.Instance); + CalamityClientConfig.SaveConfig(); } Rectangle mouseHitbox = new Rectangle((int)Main.MouseScreen.X, (int)Main.MouseScreen.Y, 8, 8); @@ -123,7 +123,7 @@ namespace CalamityMod.UI.SulphurousWaterMeter if (ms.LeftButton == ButtonState.Released) { dragOffset = null; - CalamityMod.SaveConfig(CalamityClientConfig.Instance); + CalamityClientConfig.SaveConfig(); } } else From 01d033423170cd51e25bad161892eb9566c1bf07 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Thu, 19 Sep 2024 20:19:05 +0900 Subject: [PATCH 110/133] NRE Fix on BossKillTimes --- NPCs/CalamityGlobalNPC.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 5fac01944d..a9351018f6 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -86,6 +86,7 @@ using static Terraria.ModLoader.ModContent; using CalamityMod.NPCs.SunkenSea; using CalamityMod.Packets; using CalamityMod.ExtraTextures; +using MonoMod.Utils; namespace CalamityMod.NPCs { @@ -1341,6 +1342,10 @@ namespace CalamityMod.NPCs { NPCID.WallofFlesh, 0.5f }, }; #endregion + + // Somehow the SetStatic is called few times before SetStaticDefaults + // So We Initialize the Dictionary first. And Push Data later (At SetStaticDefaults) + BossKillTimes = []; } public override void Unload() @@ -1356,8 +1361,9 @@ namespace CalamityMod.NPCs #region Set Defaults public override void SetStaticDefaults() { - #region Setup Boss Kill Time - BossKillTimes = new SortedDictionary { + #region Add Entries to BossKillTimes + BossKillTimes.AddRange(new Dictionary(){ + // // VANILLA BOSSES // @@ -1447,7 +1453,7 @@ namespace CalamityMod.NPCs { NPCType(), 21600 }, { NPCType(), 18000 }, // 5:00 (300 seconds) { NPCType(), 18000 } // 5:00 (300 seconds) - }; + }); #endregion // Set Plantera to be able to update oldPos[x] From a7bbd1458e4f4bac9562601951357ea1fe254a85 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Thu, 19 Sep 2024 20:31:52 +0900 Subject: [PATCH 111/133] Fovenator: Fixed Boss Head Loading --- NPCs/NormalNPCs/Foveanator.cs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/NPCs/NormalNPCs/Foveanator.cs b/NPCs/NormalNPCs/Foveanator.cs index 801be02d26..99a94b5677 100644 --- a/NPCs/NormalNPCs/Foveanator.cs +++ b/NPCs/NormalNPCs/Foveanator.cs @@ -22,7 +22,6 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.NormalNPCs { - [AutoloadBossHead] public class Foveanator : ModNPC { public static int phase1IconIndex; @@ -30,16 +29,13 @@ namespace CalamityMod.NPCs.NormalNPCs public static Asset GlowTexture; - internal static void LoadHeadIcons() + public override void Load() { string phase1IconPath = "CalamityMod/NPCs/NormalNPCs/Foveanator_Head_Boss"; string phase2IconPath = "CalamityMod/NPCs/NormalNPCs/Foveanator_Phase2_Head_Boss"; - - CalamityMod.Instance.AddBossHeadTexture(phase1IconPath, -1); - phase1IconIndex = ModContent.GetModBossHeadSlot(phase1IconPath); - - CalamityMod.Instance.AddBossHeadTexture(phase2IconPath, -1); - phase2IconIndex = ModContent.GetModBossHeadSlot(phase2IconPath); + + phase1IconIndex = CalamityMod.Instance.AddBossHeadTexture(phase1IconPath, -1); + phase2IconIndex = CalamityMod.Instance.AddBossHeadTexture(phase2IconPath, -1); } public override void SetStaticDefaults() From 63c9a8299070111bc57cafbdfe821bbf19153302 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Thu, 19 Sep 2024 20:36:31 +0900 Subject: [PATCH 112/133] Cryogen: Removed AutoloadBossHead Attribute --- NPCs/Cryogen/Cryogen.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index 01a7bfa054..ff3fb30f3c 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -38,7 +38,6 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.Cryogen { - [AutoloadBossHead] [LongDistanceNetSync] // Cryogen follows you forever like Queen Bee in vanilla, So we need this to sync it's position on minimap public class Cryogen : ModNPC { From 27ac430a576a9307fa2b05afb1bb0d60cf3702e9 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Fri, 20 Sep 2024 14:08:17 +0900 Subject: [PATCH 113/133] Loading WaterStyleMaxCount later --- Systems/Graphic/LavaRenderingSystem.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Systems/Graphic/LavaRenderingSystem.cs b/Systems/Graphic/LavaRenderingSystem.cs index 4ba8d372d8..84d5f6cce2 100644 --- a/Systems/Graphic/LavaRenderingSystem.cs +++ b/Systems/Graphic/LavaRenderingSystem.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Systems public static Asset[] fall = new Asset[1]; } - public int WaterStyleMaxCount = ModContent.GetContent().Count() + LoaderManager.Get().VanillaCount; + public int WaterStyleMaxCount = 0; public override void Load() { @@ -48,6 +48,8 @@ namespace CalamityMod.Systems public override void OnModLoad() { + WaterStyleMaxCount = ModContent.GetContent().Count() + LoaderManager.Get().VanillaCount; + // Lava Texture Textures.liquid[0] = LiquidRenderer.Instance._liquidTextures[1]; Textures.slope[0] = TextureAssets.LiquidSlope[1]; From 19ad35237efbe255d31ae14b1b51335eb2bfcd2e Mon Sep 17 00:00:00 2001 From: Flowaria Date: Fri, 20 Sep 2024 14:08:29 +0900 Subject: [PATCH 114/133] Added Comment on ExtraExtureRefs --- ExtraTextures/ExtraTextureRefs.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ExtraTextures/ExtraTextureRefs.cs b/ExtraTextures/ExtraTextureRefs.cs index e998316328..47ab6f46e1 100644 --- a/ExtraTextures/ExtraTextureRefs.cs +++ b/ExtraTextures/ExtraTextureRefs.cs @@ -42,6 +42,8 @@ namespace CalamityMod.ExtraTextures BossHeadIndex_ChadPrime = CalamityMod.Instance.AddBossHeadTexture(chadPrimeIconPath, -1); } + + // TODO: - Every other ExtraTextures Reference could be move in here public override void OnModLoad() { DestroyerHeadGlowmask = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerHeadGlow", AssetRequestMode.AsyncLoad); From 15ce7dc89f843dbfd5bc8e6118cf7ad63d7564da Mon Sep 17 00:00:00 2001 From: Cameron Ewell Date: Sun, 29 Sep 2024 15:30:09 -0400 Subject: [PATCH 115/133] Minor text improvements to ModSystem PR --- ExtraTextures/ExtraTextureRefs.cs | 2 +- ILEditing/VanillaStupidityFixingILChanges.cs | 2 +- Items/VanillaArmorChanges/VanillaArmorChangeManager.cs | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ExtraTextures/ExtraTextureRefs.cs b/ExtraTextures/ExtraTextureRefs.cs index 47ab6f46e1..724db66b6e 100644 --- a/ExtraTextures/ExtraTextureRefs.cs +++ b/ExtraTextures/ExtraTextureRefs.cs @@ -33,7 +33,7 @@ namespace CalamityMod.ExtraTextures public static Asset FlyingCarpetAuric; // Boss Heads - // I know it's not exactly the "Texture" but it belongs to ExtraTextures so 🤷 + // I know it's not exactly a Texture2D but it belongs to ExtraTextures. public static int BossHeadIndex_ChadPrime; public override void Load() diff --git a/ILEditing/VanillaStupidityFixingILChanges.cs b/ILEditing/VanillaStupidityFixingILChanges.cs index cc864957f2..6085b032f0 100644 --- a/ILEditing/VanillaStupidityFixingILChanges.cs +++ b/ILEditing/VanillaStupidityFixingILChanges.cs @@ -1086,7 +1086,7 @@ namespace CalamityMod.ILEditing // 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 - [/*TotallyNot*/Obsolete("Leave this alone, This is a Historical Property", error: true)] + [/*TotallyNot*/Obsolete("This function serves no purpose and is included in the Calamity source code for historic value.", error: true)] private static void StoreWindGrid(On_TileDrawing.orig_Update orig, TileDrawing self) { orig(self); diff --git a/Items/VanillaArmorChanges/VanillaArmorChangeManager.cs b/Items/VanillaArmorChanges/VanillaArmorChangeManager.cs index 8292206e0b..591bb65d2d 100644 --- a/Items/VanillaArmorChanges/VanillaArmorChangeManager.cs +++ b/Items/VanillaArmorChanges/VanillaArmorChangeManager.cs @@ -9,7 +9,6 @@ using Terraria.ModLoader.Core; namespace CalamityMod.Items.VanillaArmorChanges { - // TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks. public class VanillaArmorChangeManager : ModSystem { internal static List ArmorChanges; From de6f206e035e86b31a88bafb87bf589705f271b0 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Mon, 30 Sep 2024 15:08:54 +0900 Subject: [PATCH 116/133] SkyTextures now Loads Asyncronously --- Backgrounds/AstralDesertSurfaceBGStyle.cs | 8 ++-- Backgrounds/AstralSnowSurfaceBGStyle.cs | 16 +++---- Backgrounds/AstralSurfaceBGStyle.cs | 18 ++++---- Skies/AstralMonolithSky.cs | 2 +- Skies/AstralSky.cs | 2 +- Skies/SkyTextureRefs.cs | 52 +++++++++++------------ Skies/SulphurSeaSky.cs | 6 +-- 7 files changed, 52 insertions(+), 52 deletions(-) diff --git a/Backgrounds/AstralDesertSurfaceBGStyle.cs b/Backgrounds/AstralDesertSurfaceBGStyle.cs index 6fb209d35d..d5ef0d60c7 100644 --- a/Backgrounds/AstralDesertSurfaceBGStyle.cs +++ b/Backgrounds/AstralDesertSurfaceBGStyle.cs @@ -81,7 +81,7 @@ namespace CalamityMod.Backgrounds var bgParallax = 0.4; var bgTopY = (int)(backgroundTopMagicNumber * 1800.0 + 1500.0) + (int)scAdj + pushBGTopHack; bgScale *= bgGlobalScaleMultiplier; - var bgWidthScaled = (int)((float)SkyTextureRefs.AstralDesertSurfaceMiddle.Width * bgScale); + var bgWidthScaled = (int)((float)SkyTextureRefs.AstralDesertSurfaceMiddle.Value.Width * bgScale); SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1.2f / (float)bgParallax); var bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2)); if (Main.gameMenu) @@ -92,7 +92,7 @@ namespace CalamityMod.Backgrounds { for (int i = 0; i < bgLoops; i++) { - Main.spriteBatch.Draw(SkyTextureRefs.AstralDesertSurfaceMiddle, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralDesertSurfaceMiddle.Width, SkyTextureRefs.AstralDesertSurfaceMiddle.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralDesertSurfaceMiddle.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralDesertSurfaceMiddle.Value.Width, SkyTextureRefs.AstralDesertSurfaceMiddle.Value.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); } } @@ -100,7 +100,7 @@ namespace CalamityMod.Backgrounds bgParallax = 0.43; bgTopY = (int)(backgroundTopMagicNumber * 1950.0 + 1750.0) + (int)scAdj + pushBGTopHack; bgScale *= bgGlobalScaleMultiplier; - bgWidthScaled = (int)((float)SkyTextureRefs.AstralDesertSurfaceClose.Width * bgScale); + bgWidthScaled = (int)((float)SkyTextureRefs.AstralDesertSurfaceClose.Value.Width * bgScale); SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float)bgParallax); bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2)); if (Main.gameMenu) @@ -114,7 +114,7 @@ namespace CalamityMod.Backgrounds { for (int i = 0; i < bgLoops; i++) { - Main.spriteBatch.Draw(SkyTextureRefs.AstralDesertSurfaceClose, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralDesertSurfaceClose.Width, SkyTextureRefs.AstralDesertSurfaceClose.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralDesertSurfaceClose.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralDesertSurfaceClose.Value.Width, SkyTextureRefs.AstralDesertSurfaceClose.Value.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); } } } diff --git a/Backgrounds/AstralSnowSurfaceBGStyle.cs b/Backgrounds/AstralSnowSurfaceBGStyle.cs index aad9d204b6..7300b8c7e3 100644 --- a/Backgrounds/AstralSnowSurfaceBGStyle.cs +++ b/Backgrounds/AstralSnowSurfaceBGStyle.cs @@ -83,7 +83,7 @@ namespace CalamityMod.Backgrounds var bgParallax = 0.4; var bgTopY = (int)(backgroundTopMagicNumber * 1800.0 + 1500.0) + (int)scAdj + pushBGTopHack; bgScale *= bgGlobalScaleMultiplier; - var bgWidthScaled = (int)((float)SkyTextureRefs.AstralSnowSurfaceMiddle.Width * bgScale); + var bgWidthScaled = (int)((float)SkyTextureRefs.AstralSnowSurfaceMiddle.Value.Width * bgScale); SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1.2f / (float)bgParallax); var bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2)); if (Main.gameMenu) @@ -94,7 +94,7 @@ namespace CalamityMod.Backgrounds { for (int i = 0; i < bgLoops; i++) { - Main.spriteBatch.Draw(SkyTextureRefs.AstralSnowSurfaceMiddle, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSnowSurfaceMiddle.Width, SkyTextureRefs.AstralSnowSurfaceMiddle.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralSnowSurfaceMiddle.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSnowSurfaceMiddle.Value.Width, SkyTextureRefs.AstralSnowSurfaceMiddle.Value.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); } } @@ -102,7 +102,7 @@ namespace CalamityMod.Backgrounds bgParallax = 0.43; bgTopY = (int)(backgroundTopMagicNumber * 1950.0 + 1750.0) + (int)scAdj + pushBGTopHack; bgScale *= bgGlobalScaleMultiplier; - bgWidthScaled = (int)((float)SkyTextureRefs.AstralSurfaceClose.Width * bgScale); + bgWidthScaled = (int)((float)SkyTextureRefs.AstralSurfaceClose.Value.Width * bgScale); SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float)bgParallax); bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2)); if (Main.gameMenu) @@ -116,15 +116,15 @@ namespace CalamityMod.Backgrounds { for (int i = 0; i < bgLoops; i++) { - Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceClose, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceClose.Width, SkyTextureRefs.AstralSurfaceClose.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); - Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceCloseGlow, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceCloseGlow.Width, SkyTextureRefs.AstralSurfaceCloseGlow.Height), new Color(Color.White.R * 0.7f, Color.White.G * 0.7f, Color.White.B * 0.7f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceClose.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceClose.Value.Width, SkyTextureRefs.AstralSurfaceClose.Value.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceCloseGlow.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceCloseGlow.Value.Width, SkyTextureRefs.AstralSurfaceCloseGlow.Value.Height), new Color(Color.White.R * 0.7f, Color.White.G * 0.7f, Color.White.B * 0.7f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); } } bgScale = 1.34f; bgParallax = 0.49; bgTopY = (int)(backgroundTopMagicNumber * 2100.0 + 2000.0) + (int)scAdj + pushBGTopHack; bgScale *= bgGlobalScaleMultiplier; - bgWidthScaled = (int)(SkyTextureRefs.AstralSurfaceFront.Width * bgScale); + bgWidthScaled = (int)(SkyTextureRefs.AstralSurfaceFront.Value.Width * bgScale); SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float)bgParallax); bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2)); if (Main.gameMenu) @@ -138,8 +138,8 @@ namespace CalamityMod.Backgrounds { for (int i = 0; i < bgLoops; i++) { - Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceFront, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceFront.Width, SkyTextureRefs.AstralSurfaceFront.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); - Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceFrontGlow, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceFrontGlow.Width, SkyTextureRefs.AstralSurfaceFrontGlow.Height), new Color(Color.White.R * 0.9f, Color.White.G * 0.9f, Color.White.B * 0.9f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceFront.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceFront.Value.Width, SkyTextureRefs.AstralSurfaceFront.Value.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceFrontGlow.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceFrontGlow.Value.Width, SkyTextureRefs.AstralSurfaceFrontGlow.Value.Height), new Color(Color.White.R * 0.9f, Color.White.G * 0.9f, Color.White.B * 0.9f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); } } } diff --git a/Backgrounds/AstralSurfaceBGStyle.cs b/Backgrounds/AstralSurfaceBGStyle.cs index 06810d6f3d..c32d475687 100644 --- a/Backgrounds/AstralSurfaceBGStyle.cs +++ b/Backgrounds/AstralSurfaceBGStyle.cs @@ -87,7 +87,7 @@ namespace CalamityMod.Backgrounds var bgParallax = 0.4; //The parallax of the background layer var bgTopY = (int)(backgroundTopMagicNumber * 1800.0 + 1500.0) + (int)scAdj + pushBGTopHack; //the Y position of the background bgScale *= bgGlobalScaleMultiplier; //Scale of the background - var bgWidthScaled = (int)((float)SkyTextureRefs.AstralSurfaceMiddle.Width * bgScale); //The Width of the bg texture scaled to the correct size + var bgWidthScaled = (int)((float)SkyTextureRefs.AstralSurfaceMiddle.Value.Width * bgScale); //The Width of the bg texture scaled to the correct size SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1.2f / (float)bgParallax); var bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2)); //The starting position of the background layer if (Main.gameMenu) @@ -99,8 +99,8 @@ namespace CalamityMod.Backgrounds for (int i = 0; i < bgLoops; i++) { //Draw the texture and its glowmask to each loop of the texture - Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceMiddle, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceMiddle.Width, SkyTextureRefs.AstralSurfaceMiddle.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); - Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceMiddleGlow, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceMiddleGlow.Width, SkyTextureRefs.AstralSurfaceMiddleGlow.Height), new Color(Color.White.R * 0.5f, Color.White.G * 0.5f, Color.White.B * 0.5f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceMiddle.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceMiddle.Value.Width, SkyTextureRefs.AstralSurfaceMiddle.Value.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceMiddleGlow.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + MiddleBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceMiddleGlow.Value.Width, SkyTextureRefs.AstralSurfaceMiddleGlow.Value.Height), new Color(Color.White.R * 0.5f, Color.White.G * 0.5f, Color.White.B * 0.5f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); } } @@ -110,7 +110,7 @@ namespace CalamityMod.Backgrounds bgParallax = 0.43; bgTopY = (int)(backgroundTopMagicNumber * 1950.0 + 1750.0) + (int)scAdj + pushBGTopHack; bgScale *= bgGlobalScaleMultiplier; - bgWidthScaled = (int)((float)SkyTextureRefs.AstralSurfaceClose.Width * bgScale); + bgWidthScaled = (int)((float)SkyTextureRefs.AstralSurfaceClose.Value.Width * bgScale); SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float)bgParallax); bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2)); if (Main.gameMenu) @@ -124,8 +124,8 @@ namespace CalamityMod.Backgrounds { for (int i = 0; i < bgLoops; i++) { - Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceClose, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceClose.Width, SkyTextureRefs.AstralSurfaceClose.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); - Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceCloseGlow, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceCloseGlow.Width, SkyTextureRefs.AstralSurfaceCloseGlow.Height), new Color(Color.White.R * 0.7f, Color.White.G * 0.7f, Color.White.B * 0.7f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceClose.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceClose.Value.Width, SkyTextureRefs.AstralSurfaceClose.Value.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceCloseGlow.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + CloseBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceCloseGlow.Value.Width, SkyTextureRefs.AstralSurfaceCloseGlow.Value.Height), new Color(Color.White.R * 0.7f, Color.White.G * 0.7f, Color.White.B * 0.7f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); } } @@ -135,7 +135,7 @@ namespace CalamityMod.Backgrounds bgParallax = 0.49; bgTopY = (int)(backgroundTopMagicNumber * 2100.0 + 2000.0) + (int)scAdj + pushBGTopHack; bgScale *= bgGlobalScaleMultiplier; - bgWidthScaled = (int)(SkyTextureRefs.AstralSurfaceFront.Width * bgScale); + bgWidthScaled = (int)(SkyTextureRefs.AstralSurfaceFront.Value.Width * bgScale); SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float)bgParallax); bgStartX = (int)(0.0 - Math.IEEERemainder((double)Main.screenPosition.X * bgParallax, bgWidthScaled) - (double)(bgWidthScaled / 2)); if (Main.gameMenu) @@ -149,8 +149,8 @@ namespace CalamityMod.Backgrounds { for (int i = 0; i < bgLoops; i++) { - Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceFront, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceFront.Width, SkyTextureRefs.AstralSurfaceFront.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); - Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceFrontGlow, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceFrontGlow.Width, SkyTextureRefs.AstralSurfaceFrontGlow.Height), new Color(Color.White.R * 0.9f, Color.White.G * 0.9f, Color.White.B * 0.9f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceFront.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceFront.Value.Width, SkyTextureRefs.AstralSurfaceFront.Value.Height), ColorOfSurfaceBackgroundsModified, 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(SkyTextureRefs.AstralSurfaceFrontGlow.Value, new Vector2(bgStartX + bgWidthScaled * i, bgTopY + FrontBGYOffset), new Rectangle(0, 0, SkyTextureRefs.AstralSurfaceFrontGlow.Value.Width, SkyTextureRefs.AstralSurfaceFrontGlow.Value.Height), new Color(Color.White.R * 0.9f, Color.White.G * 0.9f, Color.White.B * 0.9f, COSBMAplha.A), 0f, default(Vector2), bgScale, SpriteEffects.None, 0f); } } } diff --git a/Skies/AstralMonolithSky.cs b/Skies/AstralMonolithSky.cs index 4b94ddb22d..07dad080e5 100644 --- a/Skies/AstralMonolithSky.cs +++ b/Skies/AstralMonolithSky.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Skies float whateverTheFuckThisVariableIsSupposedToBe = 3.40282347E+38f; if (maxDepth >= whateverTheFuckThisVariableIsSupposedToBe && minDepth < whateverTheFuckThisVariableIsSupposedToBe) { - spriteBatch.Draw(SkyTextureRefs.AstralSky, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.White * opacity); + spriteBatch.Draw(SkyTextureRefs.AstralSky.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.White * opacity); // Terraria's conditions. if (Main.netMode != NetmodeID.Server) diff --git a/Skies/AstralSky.cs b/Skies/AstralSky.cs index e2a14e830a..3c8d2caa0c 100644 --- a/Skies/AstralSky.cs +++ b/Skies/AstralSky.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Skies float whateverTheFuckThisVariableIsSupposedToBe = 3.40282347E+38f; if (maxDepth >= whateverTheFuckThisVariableIsSupposedToBe && minDepth < whateverTheFuckThisVariableIsSupposedToBe) { - spriteBatch.Draw(SkyTextureRefs.AstralSky, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.White * opacity); + spriteBatch.Draw(SkyTextureRefs.AstralSky.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.White * opacity); // Terraria's conditions. if (Main.netMode != NetmodeID.Server) diff --git a/Skies/SkyTextureRefs.cs b/Skies/SkyTextureRefs.cs index 78a59e674e..6e27c10ae5 100644 --- a/Skies/SkyTextureRefs.cs +++ b/Skies/SkyTextureRefs.cs @@ -13,48 +13,48 @@ namespace CalamityMod.Skies internal sealed class SkyTextureRefs : ModSystem { // Astral Sky/BG - public static Texture2D AstralSky; - public static Texture2D AstralSurfaceFront; - public static Texture2D AstralSurfaceFrontGlow; - public static Texture2D AstralSurfaceClose; - public static Texture2D AstralSurfaceCloseGlow; - public static Texture2D AstralSurfaceMiddle; - public static Texture2D AstralSurfaceMiddleGlow; + public static Asset AstralSky; + public static Asset AstralSurfaceFront; + public static Asset AstralSurfaceFrontGlow; + public static Asset AstralSurfaceClose; + public static Asset AstralSurfaceCloseGlow; + public static Asset AstralSurfaceMiddle; + public static Asset AstralSurfaceMiddleGlow; // Astral Desert Sky/BG - public static Texture2D AstralDesertSurfaceClose; - public static Texture2D AstralDesertSurfaceMiddle; + public static Asset AstralDesertSurfaceClose; + public static Asset AstralDesertSurfaceMiddle; // Astral Snow Sky/BG - public static Texture2D AstralSnowSurfaceMiddle; + public static Asset AstralSnowSurfaceMiddle; // Sulphur Sea Sky/BG - public static Texture2D SulphurSeaSky; - public static Texture2D SulphurSeaSkyFront; - public static Texture2D SulphurSeaSurface; + public static Asset SulphurSeaSky; + public static Asset SulphurSeaSkyFront; + public static Asset SulphurSeaSurface; public override void OnModLoad() { // Astral Sky/BG - AstralSky = ModContent.Request("CalamityMod/Skies/AstralSky", AssetRequestMode.ImmediateLoad).Value; - AstralSurfaceFront = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceFront", AssetRequestMode.ImmediateLoad).Value; - AstralSurfaceFrontGlow = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceFrontGlow", AssetRequestMode.ImmediateLoad).Value; - AstralSurfaceClose = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceClose", AssetRequestMode.ImmediateLoad).Value; - AstralSurfaceCloseGlow = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceCloseGlow", AssetRequestMode.ImmediateLoad).Value; - AstralSurfaceMiddle = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceMiddle", AssetRequestMode.ImmediateLoad).Value; - AstralSurfaceMiddleGlow = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceMiddleGlow", AssetRequestMode.ImmediateLoad).Value; + AstralSky = ModContent.Request("CalamityMod/Skies/AstralSky"); + AstralSurfaceFront = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceFront"); + AstralSurfaceFrontGlow = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceFrontGlow"); + AstralSurfaceClose = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceClose"); + AstralSurfaceCloseGlow = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceCloseGlow"); + AstralSurfaceMiddle = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceMiddle"); + AstralSurfaceMiddleGlow = ModContent.Request("CalamityMod/Backgrounds/AstralSurfaceMiddleGlow"); //Astral Desert Sky/BG - AstralDesertSurfaceClose = ModContent.Request("CalamityMod/Backgrounds/AstralDesertSurfaceClose", AssetRequestMode.ImmediateLoad).Value; - AstralDesertSurfaceMiddle = ModContent.Request("CalamityMod/Backgrounds/AstralDesertSurfaceMiddle", AssetRequestMode.ImmediateLoad).Value; + AstralDesertSurfaceClose = ModContent.Request("CalamityMod/Backgrounds/AstralDesertSurfaceClose"); + AstralDesertSurfaceMiddle = ModContent.Request("CalamityMod/Backgrounds/AstralDesertSurfaceMiddle"); //Astral Snow Sky/BG - AstralSnowSurfaceMiddle = ModContent.Request("CalamityMod/Backgrounds/AstralSnowSurfaceMiddle", AssetRequestMode.ImmediateLoad).Value; + AstralSnowSurfaceMiddle = ModContent.Request("CalamityMod/Backgrounds/AstralSnowSurfaceMiddle"); // Sulpher Sea Sky/BG - SulphurSeaSky = ModContent.Request("CalamityMod/Skies/SulphurSeaSky", AssetRequestMode.ImmediateLoad).Value; - SulphurSeaSkyFront = ModContent.Request("CalamityMod/Skies/SulphurSeaSkyFront", AssetRequestMode.ImmediateLoad).Value; - SulphurSeaSurface = ModContent.Request("CalamityMod/Skies/SulphurSeaSurface", AssetRequestMode.ImmediateLoad).Value; + SulphurSeaSky = ModContent.Request("CalamityMod/Skies/SulphurSeaSky"); + SulphurSeaSkyFront = ModContent.Request("CalamityMod/Skies/SulphurSeaSkyFront"); + SulphurSeaSurface = ModContent.Request("CalamityMod/Skies/SulphurSeaSurface"); } public override void Unload() diff --git a/Skies/SulphurSeaSky.cs b/Skies/SulphurSeaSky.cs index b639a28362..2c85b7fa4d 100644 --- a/Skies/SulphurSeaSky.cs +++ b/Skies/SulphurSeaSky.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Skies public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth) { if (maxDepth >= 4f && minDepth < 4f) - spriteBatch.Draw(SkyTextureRefs.SulphurSeaSky, new Rectangle(0, (int)(-Main.screenPosition.Y / 6f) + 1300, Main.screenWidth, Main.screenHeight), Color.Lerp(Main.ColorOfTheSkies, Color.LightSeaGreen, 0.33f) * 0.2f * opacity); + spriteBatch.Draw(SkyTextureRefs.SulphurSeaSky.Value, new Rectangle(0, (int)(-Main.screenPosition.Y / 6f) + 1300, Main.screenWidth, Main.screenHeight), Color.Lerp(Main.ColorOfTheSkies, Color.LightSeaGreen, 0.33f) * 0.2f * opacity); // Small worlds, default draw height int sulphurSeaHeight = (World.SulphurousSea.YStart + (int)Main.worldSurface) / 2; @@ -58,7 +58,7 @@ namespace CalamityMod.Skies // This changes the speed of the parralax, the closer the layer to the player the faster it should be. if (maxDepth >= 1f && minDepth < 1f) { - Texture2D texture = SkyTextureRefs.SulphurSeaSkyFront; + Texture2D texture = SkyTextureRefs.SulphurSeaSkyFront.Value; // Keep in mind that y paralex should always be half of x's or it will feel odd compared to how terraria does it. // Keep in mind when you change screen parralax it affects the y offset for the bg in the world. @@ -84,7 +84,7 @@ namespace CalamityMod.Skies if (maxDepth >= 3f && minDepth < 3f) { - Texture2D texture = SkyTextureRefs.SulphurSeaSurface; + Texture2D texture = SkyTextureRefs.SulphurSeaSurface.Value; int x = (int)(Main.screenPosition.X * ScreenParralaxMultiplier); x %= (int)(texture.Width * Scale); From 0d1613125b01ef271d6742e1f1e7c538d0eb31d8 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Sun, 15 Sep 2024 18:06:34 +0900 Subject: [PATCH 117/133] GlowMaskTree/PalmTree First iteration --- ILEditing/ILChangesLoading.cs | 3 + ILEditing/MechanicILChanges.cs | 117 ++++++++++++++++++++++ Tiles/Astral/AstralTree.cs | 9 +- Tiles/Astral/AstralTree_Branches_Glow.png | Bin 0 -> 659 bytes Tiles/Astral/AstralTree_Glow.png | Bin 0 -> 1962 bytes Tiles/Astral/AstralTree_Tops_Glow.png | Bin 0 -> 1051 bytes Tiles/GlowMaskCactus.cs | 17 ++++ Tiles/GlowMaskPalmTree.cs | 19 ++++ Tiles/GlowMaskTree.cs | 26 +++++ 9 files changed, 188 insertions(+), 3 deletions(-) create mode 100644 Tiles/Astral/AstralTree_Branches_Glow.png create mode 100644 Tiles/Astral/AstralTree_Glow.png create mode 100644 Tiles/Astral/AstralTree_Tops_Glow.png create mode 100644 Tiles/GlowMaskCactus.cs create mode 100644 Tiles/GlowMaskPalmTree.cs create mode 100644 Tiles/GlowMaskTree.cs diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index 6a95de896b..4de6041910 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -52,6 +52,9 @@ namespace CalamityMod.ILEditing On_Player.ApplyEquipVanity_Item += DyeableShadersRenderer.CheckVanityDetour; On_Player.UpdateArmorSets += DyeableShadersRenderer.CheckArmorSetsDetour; + // Graphics (ModPlant stuff) + IL_TileDrawing.DrawTrees += DrawTreeGlowMask; + // NPC behavior IL_Main.UpdateTime += PermitNighttimeTownNPCSpawning; On_Main.UpdateTime_SpawnTownNPCs += AlterTownNPCSpawnRate; diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index c2376bb142..1fb994c9c7 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -1940,5 +1940,122 @@ namespace CalamityMod.ILEditing } } #endregion + + #region Hellscape for GlowMask ModPlants + + #region GlowMask Trees + private static void DrawTreeGlowMask(ILContext il) + { + var cursor = new ILCursor(il); + ApplyTreeGlowMaskSubParts(cursor, "GlowMaskTree-Top", "GetTreeTopTexture", (glowMaskTree) => + { + return new GlowMaskPlantDrawInfo() + { + Texture = glowMaskTree.GetTopGlowTextures().Value, + Color = Color.White + }; + }); + + ApplyTreeGlowMaskSubParts(cursor, "GlowMaskTree-R", "GetTreeBranchTexture", (glowMaskTree) => + { + return new GlowMaskPlantDrawInfo() + { + Texture = glowMaskTree.GetBranchGlowTextures().Value, + Color = Color.White + }; + }); + + ApplyTreeGlowMaskSubParts(cursor, "GlowMaskTree-L", "GetTreeBranchTexture", (glowMaskTree) => + { + return new GlowMaskPlantDrawInfo() + { + Texture = glowMaskTree.GetBranchGlowTextures().Value, + Color = Color.White + }; + }); + + ApplyTreeGlowMaskSubParts(cursor, "GlowMaskPalmTree-Top", "GetTreeTopTexture", (glowMaskPalmTree) => + { + return new GlowMaskPlantDrawInfo() + { + Texture = glowMaskPalmTree.GetTopGlowTextures().Value, + Color = Color.White + }; + }); + } + + private static void ApplyTreeGlowMaskSubParts(ILCursor cursor, string debugSubpartName, string getTextureMethodName, Func onPlantDrawn) where PlantType : IPlant + { + if (!cursor.TryGotoNext(MoveType.Before, x => x.MatchCallOrCallvirt(getTextureMethodName))) + { + LogFailure("GlowMask Tree Rendering", $"Could not locate First {getTextureMethodName} call ({debugSubpartName})"); + return; + } + + cursor.Index -= 1; // 1 Instruction Backward should be TreeStyle LdLoc + if (!cursor.Next.MatchLdloc(out var colorLocaIdx)) + { + LogFailure("GlowMask Tree Rendering", $"Could not locate Ldloc for TreeStyleIndex ({debugSubpartName})"); + return; + } + + cursor.Index -= 2; // 2 (total 3) Instruction Backward should be TreeStyle LdLoc + if (!cursor.Next.MatchLdloc(out var treeStyleLocaIdx)) + { + LogFailure("GlowMask Tree Rendering", $"Could not locate Ldloc for TreeStyleIndex ({debugSubpartName})"); + return; + } + + if (!cursor.TryGotoNext(MoveType.Before, x => x.MatchCallOrCallvirt("Draw"))) + { + LogFailure("GlowMask Tree Rendering", $"Could not locate DrawCall ({debugSubpartName})"); + return; + } + + cursor.EmitLdarg0(); // self + cursor.EmitLdloc(treeStyleLocaIdx); // TreeStyle + cursor.EmitLdloc(colorLocaIdx); + cursor.EmitDelegate(( + SpriteBatch spriteBatch, + Texture2D texture, + Vector2 position, + Rectangle? sourceRectangle, + Color color, + float rotation, + Vector2 origin, + float scale, + SpriteEffects effects, + float layerDepth, + + TileDrawing self, + int style, + int colorId) => + { + spriteBatch.Draw(texture, position, sourceRectangle, color, rotation, origin, scale, effects, layerDepth); + + // Spooky Hardcoded Index: style above 100 is modded tile + if (style < 100) + return; + + int lookup = style - 100; + if (PlantLoader.Get(TileID.Trees, lookup) is not PlantType plant) + return; + + GlowMaskPlantDrawInfo? drawInfo = onPlantDrawn?.Invoke(plant) ?? default; + if (drawInfo.HasValue) + { + var info = drawInfo.Value; + spriteBatch.Draw(info.Texture, position, sourceRectangle, info.Color, rotation, origin, scale, effects, layerDepth); + } + }); + cursor.Next.OpCode = OpCodes.Nop; // remove next drawcall + } + #endregion + + #region GlowMask Cactus + + #endregion + + #endregion } } diff --git a/Tiles/Astral/AstralTree.cs b/Tiles/Astral/AstralTree.cs index 9bc4e6c1d6..1a32541d6c 100644 --- a/Tiles/Astral/AstralTree.cs +++ b/Tiles/Astral/AstralTree.cs @@ -14,7 +14,7 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.Astral { - public class AstralTree : ModTree + public class AstralTree : GlowMaskTree { public override void SetStaticDefaults() { @@ -32,7 +32,12 @@ namespace CalamityMod.Tiles.Astral SpecialGroupMaximumSaturationValue = 1f }; + public override Asset GetTexture() => ModContent.Request("CalamityMod/Tiles/Astral/AstralTree"); + public override Asset GetGlowTexture() => ModContent.Request("CalamityMod/Tiles/Astral/AstralTree_Glow"); + public override Asset GetBranchTextures() => ModContent.Request("CalamityMod/Tiles/Astral/AstralTree_Branches"); + public override Asset GetBranchGlowTextures() => ModContent.Request("CalamityMod/Tiles/Astral/AstralTree_Branches_Glow"); public override Asset GetTopTextures() => ModContent.Request("CalamityMod/Tiles/Astral/AstralTree_Tops"); + public override Asset GetTopGlowTextures() => ModContent.Request("CalamityMod/Tiles/Astral/AstralTree_Tops_Glow"); public override void SetTreeFoliageSettings(Tile tile, ref int xoffset, ref int treeFrame, ref int floorY, ref int topTextureFrameWidth, ref int topTextureFrameHeight) { @@ -40,8 +45,6 @@ namespace CalamityMod.Tiles.Astral //treeFrame = (i + j * j) % 3; } - public override Asset GetBranchTextures() => ModContent.Request("CalamityMod/Tiles/Astral/AstralTree_Branches"); - public override Asset GetTexture() => ModContent.Request("CalamityMod/Tiles/Astral/AstralTree"); public override int DropWood() => ModContent.ItemType(); public override int CreateDust() => ModContent.DustType(); diff --git a/Tiles/Astral/AstralTree_Branches_Glow.png b/Tiles/Astral/AstralTree_Branches_Glow.png new file mode 100644 index 0000000000000000000000000000000000000000..2b3ef6685e454b684527bfc9b7cd17ede46c2892 GIT binary patch literal 659 zcmeAS@N?(olHy`uVBq!ia0vp^AwXQm!3HFE#h6V5QjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn~YUU{dyUaSW-5dwbW=>xhFy+e3|OaV{G+YzW-&f#DIa2)DLvPng&ua{>MY z#f;=c#R|b}$C--uCk{-Q`NKEOtWusMJ0-l_Tz~T2n=NmFrZ;e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#LE1x2uR#)g=Pg?&7n zk*e6GKUYaJ_=rG9Z)@v=;}@JZaLe31X?M^#<^A33#cApF_7dmra+_P8vHblfJ?;KE zplt|X(HQ$XYEJn2`aSveK6ShQr*3>N>h(G1H&@7#9U?tT>i#b8zw}N2ea+N3RkJVZ z8y7m2y*Xs6JmdfNZ`Wrpk3W}wyp2oLIKOw*?;ppqGk>4uU%%w~+VdM1$FH%JdG%`g zhOhr7-UwLuXw|K&=l6L`{qf!3{$|Nh-dN?C=i_Uf|Nl|%?fw6*x%TocU$$Lkzk{--->*|NeRi>&Me@3b&7WWW zSNdF`hJ1P3zkAu%*ioRG${~ivwgq*ZL>F|2CUUy!rOtBrD+~T|ch5+XkO! z=&tM8vMn6c75Uh{D1qLukTj|M#0gr_sg{(Zl5=2qw>a?hp!kP{Ph0m z&F}vI_G#}_-nd+?bkF^Qi@&Dd!L^DPB1k_T>g7zFEx&JlTxaf$pLcA&+`SJB>x_b_ zFQYR3{ygb5F95o_Ay6`?<+p@yx&&TX->4&HtUj_q)2w=NXo+F>MU8eEg>7 zAFOZoD~;Nt~wLsKd0kJ zr{({sc^QSTmQ1LnY`}U>3!hvBM^4RH#a_`1)*E*Irrt@|f zzr0{sTDLVU;??J=pp>vPU?bZ@%SWjavv2&IV`Xn%yK>^pBW+xsj1md&vc-#pq#2%F zII}f*U#t<(b(@l%Ti@J(WgwjwZ{EZ&_hPAITw)yt6y!^d@J#ddWzYh$IiQLz1y2UC NJYD@<);T3K0RVq2`iuYo literal 0 HcmV?d00001 diff --git a/Tiles/GlowMaskCactus.cs b/Tiles/GlowMaskCactus.cs new file mode 100644 index 0000000000..156bafa65b --- /dev/null +++ b/Tiles/GlowMaskCactus.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles +{ + public abstract class GlowMaskCactus : ModCactus + { + public abstract Asset GetFruitGlowTexture(); + public abstract Asset GetGlowTexture(); + } +} diff --git a/Tiles/GlowMaskPalmTree.cs b/Tiles/GlowMaskPalmTree.cs new file mode 100644 index 0000000000..beb847c2f3 --- /dev/null +++ b/Tiles/GlowMaskPalmTree.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria.GameContent; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles +{ + public abstract class GlowMaskPalmTree : ModPalmTree + { + public abstract Asset GetOasisTopGlowTextures(); + public abstract Asset GetGlowTexture(); + public abstract Asset GetTopGlowTextures(); + } +} diff --git a/Tiles/GlowMaskTree.cs b/Tiles/GlowMaskTree.cs new file mode 100644 index 0000000000..7617864f96 --- /dev/null +++ b/Tiles/GlowMaskTree.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Numerics; +using System.Text; +using System.Threading.Tasks; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles +{ + public struct GlowMaskPlantDrawInfo + { + public Texture2D Texture; + public Color Color; + } + + public abstract class GlowMaskTree : ModTree + { + public abstract Asset GetGlowTexture(); + public abstract Asset GetTopGlowTextures(); + public abstract Asset GetBranchGlowTextures(); + } +} From 3698a35389e80e966c24cbd182ad2f3e7cfbd752 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Sun, 15 Sep 2024 21:06:50 +0900 Subject: [PATCH 118/133] Cactus and Tree Trunks GlowMask Implemented --- ILEditing/ILChangesLoading.cs | 1 + ILEditing/MechanicILChanges.cs | 145 +++++++++++++++++++--- Tiles/Astral/AstralTree.cs | 5 + Tiles/AstralDesert/AstralCactus.cs | 11 +- Tiles/AstralDesert/AstralPalmTree.cs | 10 +- Tiles/AstralDesert/AstralPalmTreeGlow.png | Bin 0 -> 2371 bytes Tiles/CalamityGlobalTile.cs | 46 ------- Tiles/GlowMaskCactus.cs | 4 + Tiles/GlowMaskPalmTree.cs | 3 + Tiles/GlowMaskTree.cs | 2 + 10 files changed, 159 insertions(+), 68 deletions(-) create mode 100644 Tiles/AstralDesert/AstralPalmTreeGlow.png diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index 4de6041910..5a00a3e7a3 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -54,6 +54,7 @@ namespace CalamityMod.ILEditing // Graphics (ModPlant stuff) IL_TileDrawing.DrawTrees += DrawTreeGlowMask; + On_TileDrawing.DrawBasicTile += DrawTreeTrunkAndCactusGlowMask; // NPC behavior IL_Main.UpdateTime += PermitNighttimeTownNPCSpawning; diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index 1fb994c9c7..9cdfb1ec1b 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -1835,8 +1835,8 @@ namespace CalamityMod.ILEditing return; var glowMask = glowMaskTile.GlowMask; - int xPos = drawData.tileFrameX + drawData.addFrX; - int yPos = drawData.tileFrameY + drawData.addFrY; + var xPos = drawData.tileFrameX + drawData.addFrX; + var yPos = drawData.tileFrameY + drawData.addFrY; if (glowMask.HasContentInFramePos(xPos, yPos)) { ref Tile tileCache = ref drawData.tileCache; @@ -1876,7 +1876,7 @@ namespace CalamityMod.ILEditing } else { - Vector2 drawPos = new Vector2(tileX * 16, tileY * 16 + 2) - screenPosition + screenOffset; + Vector2 drawPos = new Vector2(tileX * 16, tileY * 16) - screenPosition + screenOffset; Rectangle drawRect = new Rectangle(xPos, yPos, 16, 16); Main.spriteBatch.Draw(glowMask.Texture, drawPos, drawRect, drawColor, 0.0f, default, 1.0f, drawData.tileSpriteEffect, 0.0f); } @@ -1942,49 +1942,156 @@ namespace CalamityMod.ILEditing #endregion #region Hellscape for GlowMask ModPlants + private void DrawTreeTrunkAndCactusGlowMask(On_TileDrawing.orig_DrawBasicTile orig, TileDrawing self, Vector2 screenPosition, Vector2 screenOffset, int tileX, int tileY, TileDrawInfo drawData, Rectangle normalTileRect, Vector2 normalTilePosition) + { + orig(self, screenPosition, screenOffset, tileX, tileY, drawData, normalTileRect, normalTilePosition); + + var type = drawData.typeCache; + + #region GlowMask Cactus + if (type == TileID.Cactus) + { + var frameX = drawData.tileFrameX; + var frameY = drawData.tileFrameY; + var xPos = drawData.tileFrameX + drawData.addFrX; + var yPos = drawData.tileFrameY + drawData.addFrY; + + WorldGen.GetCactusType(tileX, tileY, frameX, frameY, out var sandType); + if (PlantLoader.Get(TileID.Cactus, sandType) is GlowMaskCactus glowCacti) + { + Vector2 drawPos = new Vector2(tileX * 16, tileY * 16) - screenPosition + screenOffset; + Rectangle drawRect = new Rectangle(xPos, yPos, 16, 16); + + // Fruit Check + var isFruit = drawData.tileFrameX == 204 || drawData.tileFrameY == 202; + var textureToDraw = isFruit ? glowCacti.GetFruitGlowTexture() : glowCacti.GetGlowTexture(); + var texture = textureToDraw?.Value; + if (texture is not null) + Main.spriteBatch.Draw(texture, drawPos, drawRect, glowCacti.GetGlowColor(tileX, tileY), 0.0f, default, 1.0f, drawData.tileSpriteEffect, 0.0f); + } + return; + } + #endregion + + #region GlowMask Tree Trunk + else if (type == TileID.Trees) + { + var xPos = drawData.tileFrameX + drawData.addFrX; + var yPos = drawData.tileFrameY + drawData.addFrY; + + WorldGen.GetTreeBottom(tileX, tileY, out var groundX, out var groundY); + Tile tile = Main.tile[groundX, groundY]; + if (PlantLoader.Get(TileID.Trees, tile.TileType) is GlowMaskTree glowTree) + { + Vector2 drawPos = new Vector2(tileX * 16, tileY * 16) - screenPosition + screenOffset; + Rectangle drawRect = new Rectangle(xPos, yPos, 16, 16); + + var texture = glowTree.GetGlowTexture()?.Value; + if (texture is not null) + Main.spriteBatch.Draw(texture, drawPos, drawRect, glowTree.GetGlowColor(tileX, tileY), 0.0f, default, 1.0f, drawData.tileSpriteEffect, 0.0f); + } + return; + } + #endregion + + #region GlowMask PlamTree Trunk + else if (type == TileID.PalmTree) + { + var xPos = drawData.tileFrameX + drawData.addFrX; + var yPos = drawData.tileFrameY + drawData.addFrY; + + WorldGen.GetTreeBottom(tileX, tileY, out var groundX, out var groundY); + Tile tile = Main.tile[groundX, groundY]; + if (PlantLoader.Get(TileID.PalmTree, tile.TileType) is GlowMaskPalmTree glowTree) + { + Rectangle drawRect = new Rectangle(xPos, yPos, 16, 16); + + var texture = glowTree.GetGlowTexture()?.Value; + if (texture is not null) + Main.spriteBatch.Draw(texture, normalTilePosition, drawRect, glowTree.GetGlowColor(tileX, tileY), 0.0f, default, 1.0f, drawData.tileSpriteEffect, 0.0f); + } + return; + } + #endregion + } - #region GlowMask Trees private static void DrawTreeGlowMask(ILContext il) { var cursor = new ILCursor(il); - ApplyTreeGlowMaskSubParts(cursor, "GlowMaskTree-Top", "GetTreeTopTexture", (glowMaskTree) => + + if (!cursor.TryGotoNext(MoveType.After, x => x.MatchLdfld("X"))) + { + LogFailure("GlowMask Tree Rendering", "Unable to Locate Ldfld for Point::X"); + return; + } + + if (!cursor.Next.MatchStloc(out var xLocaIdx)) + { + LogFailure("GlowMask Tree Rendering", "Unable to Locate Stloc Index for Point::X"); + return; + } + + if (!cursor.TryGotoNext(MoveType.After, x => x.MatchLdfld("Y"))) + { + LogFailure("GlowMask Tree Rendering", "Unable to Locate Ldfld for Point::Y"); + return; + } + + if (!cursor.Next.MatchStloc(out var yLocaIdx)) + { + LogFailure("GlowMask Tree Rendering", "Unable to Locate Stloc Index for Point::Y"); + return; + } + + ApplyTreeGlowMaskSubParts(cursor, "GlowMaskTree-Top", "GetTreeTopTexture", xLocaIdx, yLocaIdx, + (glowMaskTree, tileX, tileY) => { return new GlowMaskPlantDrawInfo() { Texture = glowMaskTree.GetTopGlowTextures().Value, - Color = Color.White + Color = glowMaskTree.GetGlowColor(tileX, tileY) }; }); - ApplyTreeGlowMaskSubParts(cursor, "GlowMaskTree-R", "GetTreeBranchTexture", (glowMaskTree) => + ApplyTreeGlowMaskSubParts(cursor, "GlowMaskTree-R", "GetTreeBranchTexture", xLocaIdx, yLocaIdx, + (glowMaskTree, tileX, tileY) => { return new GlowMaskPlantDrawInfo() { Texture = glowMaskTree.GetBranchGlowTextures().Value, - Color = Color.White + Color = glowMaskTree.GetGlowColor(tileX, tileY) }; }); - ApplyTreeGlowMaskSubParts(cursor, "GlowMaskTree-L", "GetTreeBranchTexture", (glowMaskTree) => + ApplyTreeGlowMaskSubParts(cursor, "GlowMaskTree-L", "GetTreeBranchTexture", xLocaIdx, yLocaIdx, + (glowMaskTree, tileX, tileY) => { return new GlowMaskPlantDrawInfo() { Texture = glowMaskTree.GetBranchGlowTextures().Value, - Color = Color.White + Color = glowMaskTree.GetGlowColor(tileX, tileY) }; }); - ApplyTreeGlowMaskSubParts(cursor, "GlowMaskPalmTree-Top", "GetTreeTopTexture", (glowMaskPalmTree) => + ApplyTreeGlowMaskSubParts(cursor, "GlowMaskPalmTree-Top", "GetTreeTopTexture", xLocaIdx, yLocaIdx, + (glowMaskPalmTree, tileX, tileY) => { return new GlowMaskPlantDrawInfo() { Texture = glowMaskPalmTree.GetTopGlowTextures().Value, - Color = Color.White + Color = glowMaskPalmTree.GetGlowColor(tileX, tileY) }; }); } - private static void ApplyTreeGlowMaskSubParts(ILCursor cursor, string debugSubpartName, string getTextureMethodName, Func onPlantDrawn) where PlantType : IPlant + #region GlowMask Patch SubParts + private static void ApplyTreeGlowMaskSubParts( + ILCursor cursor, + string debugSubpartName, + string getTextureMethodName, + int xLocaIdx, + int yLocaIdx, + Func onPlantDrawn) where PlantType : IPlant { if (!cursor.TryGotoNext(MoveType.Before, x => x.MatchCallOrCallvirt(getTextureMethodName))) { @@ -2015,6 +2122,8 @@ namespace CalamityMod.ILEditing cursor.EmitLdarg0(); // self cursor.EmitLdloc(treeStyleLocaIdx); // TreeStyle cursor.EmitLdloc(colorLocaIdx); + cursor.EmitLdloc(xLocaIdx); + cursor.EmitLdloc(yLocaIdx); cursor.EmitDelegate(( SpriteBatch spriteBatch, Texture2D texture, @@ -2029,7 +2138,9 @@ namespace CalamityMod.ILEditing TileDrawing self, int style, - int colorId) => + int colorId, + int tileX, + int tileY) => { spriteBatch.Draw(texture, position, sourceRectangle, color, rotation, origin, scale, effects, layerDepth); @@ -2041,7 +2152,7 @@ namespace CalamityMod.ILEditing if (PlantLoader.Get(TileID.Trees, lookup) is not PlantType plant) return; - GlowMaskPlantDrawInfo? drawInfo = onPlantDrawn?.Invoke(plant) ?? default; + GlowMaskPlantDrawInfo? drawInfo = onPlantDrawn?.Invoke(plant, tileX, tileY) ?? default; if (drawInfo.HasValue) { var info = drawInfo.Value; @@ -2052,10 +2163,6 @@ namespace CalamityMod.ILEditing } #endregion - #region GlowMask Cactus - - #endregion - #endregion } } diff --git a/Tiles/Astral/AstralTree.cs b/Tiles/Astral/AstralTree.cs index 1a32541d6c..d25a8c0c50 100644 --- a/Tiles/Astral/AstralTree.cs +++ b/Tiles/Astral/AstralTree.cs @@ -39,6 +39,11 @@ namespace CalamityMod.Tiles.Astral public override Asset GetTopTextures() => ModContent.Request("CalamityMod/Tiles/Astral/AstralTree_Tops"); public override Asset GetTopGlowTextures() => ModContent.Request("CalamityMod/Tiles/Astral/AstralTree_Tops_Glow"); + public override Color GetGlowColor(int i, int j) + { + return Color.White * 0.5f; + } + public override void SetTreeFoliageSettings(Tile tile, ref int xoffset, ref int treeFrame, ref int floorY, ref int topTextureFrameWidth, ref int topTextureFrameHeight) { //What does this code do? diff --git a/Tiles/AstralDesert/AstralCactus.cs b/Tiles/AstralDesert/AstralCactus.cs index fa99db5039..df6feb6eba 100644 --- a/Tiles/AstralDesert/AstralCactus.cs +++ b/Tiles/AstralDesert/AstralCactus.cs @@ -1,10 +1,11 @@ -using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; using Terraria.ModLoader; namespace CalamityMod.Tiles.AstralDesert { - public class AstralCactus : ModCactus + public class AstralCactus : GlowMaskCactus { public override void SetStaticDefaults() { @@ -14,9 +15,15 @@ namespace CalamityMod.Tiles.AstralDesert //Idk what to make with the glowmask public override Asset GetTexture() => ModContent.Request("CalamityMod/Tiles/AstralDesert/AstralCactus"); + public override Asset GetGlowTexture() => ModContent.Request("CalamityMod/Tiles/AstralDesert/AstralCactusGlow"); //What is a FruitTexture public override Asset GetFruitTexture() => null; + public override Asset GetFruitGlowTexture() => null; + public override Color GetGlowColor(int i, int j) + { + return Color.White; + } } } diff --git a/Tiles/AstralDesert/AstralPalmTree.cs b/Tiles/AstralDesert/AstralPalmTree.cs index 4ccdbe2be0..21ee3c83f1 100644 --- a/Tiles/AstralDesert/AstralPalmTree.cs +++ b/Tiles/AstralDesert/AstralPalmTree.cs @@ -13,7 +13,7 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.AstralDesert { - public class AstralPalmTree : ModPalmTree + public class AstralPalmTree : GlowMaskPalmTree { public override void SetStaticDefaults() { @@ -32,12 +32,20 @@ namespace CalamityMod.Tiles.AstralDesert }; public override Asset GetTexture() => ModContent.Request("CalamityMod/Tiles/AstralDesert/AstralPalmTree"); + public override Asset GetGlowTexture() => ModContent.Request("CalamityMod/Tiles/AstralDesert/AstralPalmTreeGlow"); public override Asset GetTopTextures() => ModContent.Request("CalamityMod/Tiles/AstralDesert/AstralPalmTree_Tops"); + public override Asset GetTopGlowTextures() => null; //I don't know what this means. Why do palm trees have branches?? Since when. Will ask spriters for an oasis alt later public override Asset GetOasisTopTextures() => ModContent.Request("CalamityMod/Tiles/AstralDesert/AstralPalmTree_OasisTops"); + public override Asset GetOasisTopGlowTextures() => null; + + public override Color GetGlowColor(int i, int j) + { + return Color.White; + } public override int DropWood() => ModContent.ItemType(); diff --git a/Tiles/AstralDesert/AstralPalmTreeGlow.png b/Tiles/AstralDesert/AstralPalmTreeGlow.png new file mode 100644 index 0000000000000000000000000000000000000000..0b205600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}6BJ~3iZO}mP}J=fk)*8NQXulE+=*T3<_?g~r4&I&rs7G@5r z6CdAot%~gZ<^(Hh{^vk%b-gwF)uujm^WON@L%!i(Y>fTsiOvkagV_$o{bA?rmYGYx zd*pMTaN}HZZFudc$KCIjCMP}!D*9q8Q(5wzbLY^?yUv|lTYE;G_KY*H8k+LK2I}#` z`tvy-x~|4gJ^RMfb^WPV439S6uXJy&KXS>KMa~{05I^!vKVfdEN=)=`b&J(+a+sgxH_3!Unp5M!A zlZTV%7U06g9Lib7?7**mvQB*gcwe zlkYcF|0ornv2MDy%!O+y=%w81NPPsd7v$*qT@Bjb+ literal 0 HcmV?d00001 diff --git a/Tiles/CalamityGlobalTile.cs b/Tiles/CalamityGlobalTile.cs index a40f0dd4fe..d805d126a9 100644 --- a/Tiles/CalamityGlobalTile.cs +++ b/Tiles/CalamityGlobalTile.cs @@ -39,52 +39,6 @@ namespace CalamityMod.Tiles Main.tileOreFinderPriority[TileID.LunarOre] = 900; } - public override void PostDraw(int i, int j, int type, SpriteBatch spriteBatch) - { - // Guaranteed not null at this point - Tile tile = Main.tile[i, j]; - - // This function is only for Astral Cactus. If the tile isn't even cactus, forget about it. - if (type != TileID.Cactus) - return; - - Vector2 zero = new Vector2(Main.offScreenRange, Main.offScreenRange); - if (Main.drawToScreen) - zero = Vector2.Zero; - int frameX = tile.TileFrameX; - int frameY = tile.TileFrameY; - - // Search down the cactus to find out whether the block it is planted in is Astral Sand. - int xTile = i; - if (frameX == 36) // Cactus segment which splits left - xTile--; - if (frameX == 54) // Cactus segment which splits right - xTile++; - if (frameX == 108) // Cactus segment which splits both directions - xTile += (frameY == 18) ? -1 : 1; - - int yTile = j; - bool slidingDownCactus = Main.tile[xTile, yTile] != null && Main.tile[xTile, yTile].TileType == TileID.Cactus && Main.tile[xTile, yTile].HasTile; - while (!Main.tile[xTile, yTile].HasTile || !Main.tileSolid[Main.tile[xTile, yTile].TileType] || !slidingDownCactus) - { - if (Main.tile[xTile, yTile].TileType == TileID.Cactus && Main.tile[xTile, yTile].HasTile) - { - slidingDownCactus = true; - } - yTile++; - // Cacti are assumed to be no more than 20 blocks tall. - if (yTile > i + 20) - break; - } - bool astralCactus = Main.tile[xTile, yTile].TileType == (ushort)ModContent.TileType(); - - // If it is actually astral cactus, then draw its glowmask. - if (astralCactus) - { - spriteBatch.Draw(ModContent.Request("CalamityMod/Tiles/AstralDesert/AstralCactusGlow").Value, new Vector2((float)(i * 16 - (int)Main.screenPosition.X), (float)(j * 16 - (int)Main.screenPosition.Y)) + zero, new Rectangle((int)frameX, (int)frameY, 16, 18), Color.White * 0.75f, 0f, default, 1f, SpriteEffects.None, 0f); - } - } - public override void KillTile(int i, int j, int type, ref bool fail, ref bool effectOnly, ref bool noItem) { Tile tile = Main.tile[i, j]; diff --git a/Tiles/GlowMaskCactus.cs b/Tiles/GlowMaskCactus.cs index 156bafa65b..7232b67601 100644 --- a/Tiles/GlowMaskCactus.cs +++ b/Tiles/GlowMaskCactus.cs @@ -3,8 +3,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; +using Terraria.GameContent.RGB; using Terraria.ModLoader; namespace CalamityMod.Tiles @@ -13,5 +15,7 @@ namespace CalamityMod.Tiles { public abstract Asset GetFruitGlowTexture(); public abstract Asset GetGlowTexture(); + + public abstract Color GetGlowColor(int i, int j); } } diff --git a/Tiles/GlowMaskPalmTree.cs b/Tiles/GlowMaskPalmTree.cs index beb847c2f3..ce30f5374c 100644 --- a/Tiles/GlowMaskPalmTree.cs +++ b/Tiles/GlowMaskPalmTree.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; using Terraria.GameContent; @@ -15,5 +16,7 @@ namespace CalamityMod.Tiles public abstract Asset GetOasisTopGlowTextures(); public abstract Asset GetGlowTexture(); public abstract Asset GetTopGlowTextures(); + + public abstract Color GetGlowColor(int i, int j); } } diff --git a/Tiles/GlowMaskTree.cs b/Tiles/GlowMaskTree.cs index 7617864f96..8e252b39e2 100644 --- a/Tiles/GlowMaskTree.cs +++ b/Tiles/GlowMaskTree.cs @@ -22,5 +22,7 @@ namespace CalamityMod.Tiles public abstract Asset GetGlowTexture(); public abstract Asset GetTopGlowTextures(); public abstract Asset GetBranchGlowTextures(); + + public abstract Color GetGlowColor(int i, int j); } } From aacc77e817116af1b4ddcbe2e6c1e0fff7b9ddd3 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Sun, 15 Sep 2024 21:13:03 +0900 Subject: [PATCH 119/133] Much more segmented region macro / Optimized IL Operations --- ILEditing/MechanicILChanges.cs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index 9cdfb1ec1b..a4fc70f16e 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -1942,6 +1942,8 @@ namespace CalamityMod.ILEditing #endregion #region Hellscape for GlowMask ModPlants + + #region Tree Trunk / Cactus GlowMask private void DrawTreeTrunkAndCactusGlowMask(On_TileDrawing.orig_DrawBasicTile orig, TileDrawing self, Vector2 screenPosition, Vector2 screenOffset, int tileX, int tileY, TileDrawInfo drawData, Rectangle normalTileRect, Vector2 normalTilePosition) { orig(self, screenPosition, screenOffset, tileX, tileY, drawData, normalTileRect, normalTilePosition); @@ -2014,7 +2016,9 @@ namespace CalamityMod.ILEditing } #endregion } + #endregion + #region Tree Parts GlowMask private static void DrawTreeGlowMask(ILContext il) { var cursor = new ILCursor(il); @@ -2083,6 +2087,7 @@ namespace CalamityMod.ILEditing }; }); } + #endregion #region GlowMask Patch SubParts private static void ApplyTreeGlowMaskSubParts( @@ -2099,14 +2104,7 @@ namespace CalamityMod.ILEditing return; } - cursor.Index -= 1; // 1 Instruction Backward should be TreeStyle LdLoc - if (!cursor.Next.MatchLdloc(out var colorLocaIdx)) - { - LogFailure("GlowMask Tree Rendering", $"Could not locate Ldloc for TreeStyleIndex ({debugSubpartName})"); - return; - } - - cursor.Index -= 2; // 2 (total 3) Instruction Backward should be TreeStyle LdLoc + cursor.Index -= 3; // 3 Instruction Backward should be TreeStyle LdLoc if (!cursor.Next.MatchLdloc(out var treeStyleLocaIdx)) { LogFailure("GlowMask Tree Rendering", $"Could not locate Ldloc for TreeStyleIndex ({debugSubpartName})"); @@ -2119,9 +2117,7 @@ namespace CalamityMod.ILEditing return; } - cursor.EmitLdarg0(); // self cursor.EmitLdloc(treeStyleLocaIdx); // TreeStyle - cursor.EmitLdloc(colorLocaIdx); cursor.EmitLdloc(xLocaIdx); cursor.EmitLdloc(yLocaIdx); cursor.EmitDelegate(( @@ -2136,9 +2132,7 @@ namespace CalamityMod.ILEditing SpriteEffects effects, float layerDepth, - TileDrawing self, int style, - int colorId, int tileX, int tileY) => { From c390c2b6c87d27b51327e55a2fe5ecbe43af98ee Mon Sep 17 00:00:00 2001 From: Flowaria Date: Sun, 15 Sep 2024 21:29:05 +0900 Subject: [PATCH 120/133] static --- ILEditing/MechanicILChanges.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index a4fc70f16e..726e3932f0 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -1944,7 +1944,7 @@ namespace CalamityMod.ILEditing #region Hellscape for GlowMask ModPlants #region Tree Trunk / Cactus GlowMask - private void DrawTreeTrunkAndCactusGlowMask(On_TileDrawing.orig_DrawBasicTile orig, TileDrawing self, Vector2 screenPosition, Vector2 screenOffset, int tileX, int tileY, TileDrawInfo drawData, Rectangle normalTileRect, Vector2 normalTilePosition) + private static void DrawTreeTrunkAndCactusGlowMask(On_TileDrawing.orig_DrawBasicTile orig, TileDrawing self, Vector2 screenPosition, Vector2 screenOffset, int tileX, int tileY, TileDrawInfo drawData, Rectangle normalTileRect, Vector2 normalTilePosition) { orig(self, screenPosition, screenOffset, tileX, tileY, drawData, normalTileRect, normalTilePosition); From 95daffba606567f6c0a6b9ef32078bfff9cb1670 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Sun, 15 Sep 2024 23:41:33 +0900 Subject: [PATCH 121/133] Migrated AstralPlants to GlowMaskPlants --- Tiles/AstralDesert/AstralCactus.cs | 2 +- Tiles/AstralSnow/AstralSnowTree.cs | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Tiles/AstralDesert/AstralCactus.cs b/Tiles/AstralDesert/AstralCactus.cs index df6feb6eba..d297df1600 100644 --- a/Tiles/AstralDesert/AstralCactus.cs +++ b/Tiles/AstralDesert/AstralCactus.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Tiles.AstralDesert public override Asset GetTexture() => ModContent.Request("CalamityMod/Tiles/AstralDesert/AstralCactus"); public override Asset GetGlowTexture() => ModContent.Request("CalamityMod/Tiles/AstralDesert/AstralCactusGlow"); - //What is a FruitTexture + // TODO: Fruit Texture for Astral Cactus (it's for Pink Prickly Pear) public override Asset GetFruitTexture() => null; public override Asset GetFruitGlowTexture() => null; diff --git a/Tiles/AstralSnow/AstralSnowTree.cs b/Tiles/AstralSnow/AstralSnowTree.cs index f36ecac3c4..b083e386bb 100644 --- a/Tiles/AstralSnow/AstralSnowTree.cs +++ b/Tiles/AstralSnow/AstralSnowTree.cs @@ -14,7 +14,7 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.AstralSnow { - public class AstralSnowTree : ModTree + public class AstralSnowTree : GlowMaskTree { public override void SetStaticDefaults() { @@ -32,7 +32,17 @@ namespace CalamityMod.Tiles.AstralSnow SpecialGroupMaximumSaturationValue = 1f }; + public override Asset GetTexture() => ModContent.Request("CalamityMod/Tiles/AstralSnow/AstralSnowTree"); + public override Asset GetGlowTexture() => null; + public override Asset GetBranchTextures() => ModContent.Request("CalamityMod/Tiles/AstralSnow/AstralSnowTree_Branches"); + public override Asset GetBranchGlowTextures() => null; public override Asset GetTopTextures() => ModContent.Request("CalamityMod/Tiles/AstralSnow/AstralSnowTree_Tops"); + public override Asset GetTopGlowTextures() => null; + + public override Color GetGlowColor(int i, int j) + { + return Color.White * 0.5f; + } public override void SetTreeFoliageSettings(Tile tile, ref int xoffset, ref int treeFrame, ref int floorY, ref int topTextureFrameWidth, ref int topTextureFrameHeight) { @@ -40,10 +50,6 @@ namespace CalamityMod.Tiles.AstralSnow //treeFrame = (i + j * j) % 6; } - public override Asset GetBranchTextures() => ModContent.Request("CalamityMod/Tiles/AstralSnow/AstralSnowTree_Branches"); - - public override Asset GetTexture() => ModContent.Request("CalamityMod/Tiles/AstralSnow/AstralSnowTree"); - public override int DropWood() => ModContent.ItemType(); public override int CreateDust() => ModContent.DustType(); From 4467ef5d531bb9cc5c928ec3d3ea2cd5ae4a3200 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Mon, 16 Sep 2024 19:41:08 +0700 Subject: [PATCH 122/133] palm and snow tree glowmasks --- Tiles/AstralDesert/AstralPalmSaplingGlow.png | Bin 0 -> 285 bytes Tiles/AstralDesert/AstralPalmTreeGlow.png | Bin 2371 -> 1008 bytes .../AstralPalmTree_OasisTopsGlow.png | Bin 0 -> 1167 bytes .../AstralDesert/AstralPalmTree_TopsGlow.png | Bin 0 -> 876 bytes Tiles/AstralSnow/AstralSnowTreeGlow.png | Bin 0 -> 3630 bytes .../AstralSnow/AstralSnowTreeSaplingGlow.png | Bin 0 -> 342 bytes .../AstralSnowTree_BranchesGlow.png | Bin 0 -> 759 bytes Tiles/AstralSnow/AstralSnowTree_TopsGlow.png | Bin 0 -> 3072 bytes 8 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 Tiles/AstralDesert/AstralPalmSaplingGlow.png create mode 100644 Tiles/AstralDesert/AstralPalmTree_OasisTopsGlow.png create mode 100644 Tiles/AstralDesert/AstralPalmTree_TopsGlow.png create mode 100644 Tiles/AstralSnow/AstralSnowTreeGlow.png create mode 100644 Tiles/AstralSnow/AstralSnowTreeSaplingGlow.png create mode 100644 Tiles/AstralSnow/AstralSnowTree_BranchesGlow.png create mode 100644 Tiles/AstralSnow/AstralSnowTree_TopsGlow.png diff --git a/Tiles/AstralDesert/AstralPalmSaplingGlow.png b/Tiles/AstralDesert/AstralPalmSaplingGlow.png new file mode 100644 index 0000000000000000000000000000000000000000..2d52fe0746c983e92906558c77df2a49c8369951 GIT binary patch literal 285 zcmeAS@N?(olHy`uVBq!ia0vp^WJpOJ!Bx_JX`X{ ziXH~{1i@tqtPeQERr*rd)EsmU@VNG}JeqVYXwsvaozL&b-#-6$o#8Kw#rvcrSNE>z z=#=neTBXFv5z*FhFmNJImjoeZgjUD4-QN!P9e?^R+_wDoqJ?6y|D@UGZoFRgaPmCa zbCX*q-0FMycSS_;v0smmP5xz*x3#~`V48`qXsXU}{=fwH4RJd=MK9RxGRjzUZSlvw zoQk*8dQ0D4ia+}E?UWMU?`3tpeDxa1q<_3~H@m2Rh~lsX`j^4e)z4*} HQ$iB}Yeaaf literal 0 HcmV?d00001 diff --git a/Tiles/AstralDesert/AstralPalmTreeGlow.png b/Tiles/AstralDesert/AstralPalmTreeGlow.png index 0b205600a0b2d803390574592a480eb82720a588..5542321a50345d41e936d3912df57d7e577e7c7f 100644 GIT binary patch delta 987 zcmV<110?*z67UC*BYy+7NklX207L&GzTzCVNCqOim&`}?X9TPUn#-6puJ3IGXb0@8LJpO0C@visQt379* z&B251@sQSsA66Pe)3&eSGdBGzppxu!%BBsPw*5J^qwnP^;C~L}6pCMu?uVKA>f4V^ z#+d9S`%~>EJ6CRBil!bu316$#ttvlD?MihiwJSxS)Gq#(DO;61WnIkEN}2#UF9Dgt zbDSf&0xZqD(t?)DPxm0#&Y)T|e6qWJ_c&ZRq|fg!f5OkHGyXrj+pp2?`#0gMnO*!1 zdTx#B3&^=rcYktRT4@W-?g4UC${HBC_*w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7S4}5+tvEIOyq}DCIojL5O8B$+0mk)}W z)uzVm?eeU?vc_jmJohZw@3sx3ch_1fPBci)3LyViW}qik*W-}SANn?SR0%IT=dO=n z5I$ptTX?d(qW!o#HRVdXtUo|-q4wZs?;I;%*m|t=UZe4}r_Un@+9aCurz)r?rzSJ- zOKIMzuhwLK+~sP@PFZam?6_(PId`Y?N?B9WF>4^>Fnji||0I41wtG_2ob;1NllpA43s+S*jhD5dAD~TU5K$26VOMmk0+Wmd=2QHoKU2ySczw_c+PxzdI6LrCr zoikrA>pZa3T`5+03QJ;v#HasIWwVL9pVr)pJ+#T>eu(08ZQ*~{k-8)R`hFmll;+)gNrI|xVA62@$~IR@>FNh;)Tp`_{ppu z*n62@UD_7+VEgqsit}6BJ~3iZO}mP}J=fk)*8NQXulE+=*T3<_?g~r4&I&rs7G@5r z6CdAot%~gZ<^(Hh{^vk%b-gwF)uujm^WON@L%!i(Y>fTsiOvkagV_$o{bA?rmYGYx zd*pMTaN}HZZFudc$KCIjCMP}!D*9q8Q(5wzbLY^?yUv|lTYE;G_KY*H8k+LK2I}#` z`tvy-x~|4gJ^RMfb^WPV439S6uXJy&KXS>KMa~{05I^!vKVfdEN=)=`b&J(+a+sgxH_3!Unp5M!A zlZTV%7U06g9Lib7?7**mvQB*gcwe zlkYcF|0ornv2MDy%!O+y=%w81NPPsd7v$*qT@Bjb+ diff --git a/Tiles/AstralDesert/AstralPalmTree_OasisTopsGlow.png b/Tiles/AstralDesert/AstralPalmTree_OasisTopsGlow.png new file mode 100644 index 0000000000000000000000000000000000000000..1c5c9e36a709d3a7db5481272ee224b100fd0544 GIT binary patch literal 1167 zcmeAS@N?(olHy`uVBq!ia0y~yV2lB>lQ`Ibq>Ny;D+2>dsHcl#NJZS++Z%JQBuF$o zT(UHkF)g7b#*$HAFXwlsi8%y)^(rKewies|{Hb-wQ3 zdHrjGef@uw92yuJT^?A>OyXcjkmWx37=G)6&4;10(v37}4nb+V%l7>OY;fqTw8 zo1Hskc3J=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nVHv_3b~@gsIj{Ah6d|p*R5W zmD4{uMLmJxFGVe69hKGylVHAxl#GD`aLWQ3T+zI}dzFi`d5)Zc!k7_h8Jmyfcz&0@ zg%Bv)=Y7_64(+I%3jddsS=>I;=QhAFuauwtj+~#ete9PJGgj!Oi!$z&8-}~7zSO?& zzIEdNIjIoj{EVEiOc_CxO-tk^a397zw+6;niZ`Z%epaffi7%Z8;H=!zSa!fdkRSDQ zu7Ze}K((?n;M#G(=DS~wxd$8ta^z~{WbXpNt#z5TNeO|XE+0Vl3Jz^$+>NmV;2^T8 xmw$mI-FxuHiUM_Vq^rnU34sRxzfawj5J|gM{JuZvtKdHnaMs@0uF@8L``;Nd!gl}w literal 0 HcmV?d00001 diff --git a/Tiles/AstralSnow/AstralSnowTreeSaplingGlow.png b/Tiles/AstralSnow/AstralSnowTreeSaplingGlow.png new file mode 100644 index 0000000000000000000000000000000000000000..3b598878604e7d7e490610fe89826f5b5c2b6094 GIT binary patch literal 342 zcmV-c0jd6pP)_tOz@j7{dVAs7fCbxwP?g4Msd z`UIRGF6E^YrH|;$L!?52mX3Oi$dIH|8L?S|>M=&C!wKmhFpt6V*u6~`z;2{=X$muc zpR+gKNTGU+4SJ91O_~WV-9)ryz#&g4ga{=eO66gN*wxb?iE2b{?a&6r;9&V(TxMy#(tqYCDiz^MEakt5%>14Vb~!Dk=DeO zZ%f>xb};B(J-TwK-T|lbC38*Xnl!&~=xV1_qgQXVzBM2Nu#=FY+6|UjAG4dG6J>hjmUFcDwp$b}q2~V)t&{ z?qzfB_boB2d{Y=~R(OBo%A?bxj;NLEoVoGXYwqbBht291<|pd@Hl>vt&BzxMDLe3p z<*3GX$DP3P}@s0`~C7Fnjp#FdV-b;F!p0ajuPvi~B&KSx7(xL*M3wO^28Y=I~{JS2dlWZiqC%x{YN8duIZALY4w zAWb?-I_$!&NA};-of9i~N?z(~w(sJ$3dwpP!)Ep2pP0Rx#-5{1NR~&}IA_Ppb7wgN zU6uEdw{`C!3rFWgcN!L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:21 +0900 Subject: [PATCH 123/133] Applied GlowMask Texture to Astral Palm/Snow Tree --- Tiles/AstralDesert/AstralPalmTree.cs | 4 ++-- Tiles/AstralSnow/AstralSnowTree.cs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Tiles/AstralDesert/AstralPalmTree.cs b/Tiles/AstralDesert/AstralPalmTree.cs index 21ee3c83f1..024ad8bc1b 100644 --- a/Tiles/AstralDesert/AstralPalmTree.cs +++ b/Tiles/AstralDesert/AstralPalmTree.cs @@ -35,12 +35,12 @@ namespace CalamityMod.Tiles.AstralDesert public override Asset GetGlowTexture() => ModContent.Request("CalamityMod/Tiles/AstralDesert/AstralPalmTreeGlow"); public override Asset GetTopTextures() => ModContent.Request("CalamityMod/Tiles/AstralDesert/AstralPalmTree_Tops"); - public override Asset GetTopGlowTextures() => null; + public override Asset GetTopGlowTextures() => ModContent.Request("CalamityMod/Tiles/AstralDesert/AstralPalmTree_TopsGlow"); //I don't know what this means. Why do palm trees have branches?? Since when. Will ask spriters for an oasis alt later public override Asset GetOasisTopTextures() => ModContent.Request("CalamityMod/Tiles/AstralDesert/AstralPalmTree_OasisTops"); - public override Asset GetOasisTopGlowTextures() => null; + public override Asset GetOasisTopGlowTextures() => ModContent.Request("CalamityMod/Tiles/AstralDesert/AstralPalmTree_OasisTopsGlow"); public override Color GetGlowColor(int i, int j) { diff --git a/Tiles/AstralSnow/AstralSnowTree.cs b/Tiles/AstralSnow/AstralSnowTree.cs index b083e386bb..54956a950d 100644 --- a/Tiles/AstralSnow/AstralSnowTree.cs +++ b/Tiles/AstralSnow/AstralSnowTree.cs @@ -33,15 +33,15 @@ namespace CalamityMod.Tiles.AstralSnow }; public override Asset GetTexture() => ModContent.Request("CalamityMod/Tiles/AstralSnow/AstralSnowTree"); - public override Asset GetGlowTexture() => null; + public override Asset GetGlowTexture() => ModContent.Request("CalamityMod/Tiles/AstralSnow/AstralSnowTreeGlow"); public override Asset GetBranchTextures() => ModContent.Request("CalamityMod/Tiles/AstralSnow/AstralSnowTree_Branches"); - public override Asset GetBranchGlowTextures() => null; + public override Asset GetBranchGlowTextures() => ModContent.Request("CalamityMod/Tiles/AstralSnow/AstralSnowTree_BranchesGlow"); public override Asset GetTopTextures() => ModContent.Request("CalamityMod/Tiles/AstralSnow/AstralSnowTree_Tops"); - public override Asset GetTopGlowTextures() => null; + public override Asset GetTopGlowTextures() => ModContent.Request("CalamityMod/Tiles/AstralSnow/AstralSnowTree_TopsGlow"); public override Color GetGlowColor(int i, int j) { - return Color.White * 0.5f; + return Color.White; } public override void SetTreeFoliageSettings(Tile tile, ref int xoffset, ref int treeFrame, ref int floorY, ref int topTextureFrameWidth, ref int topTextureFrameHeight) From fe3eb3f7db638210d642c5e016f94de6b17dbdb3 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Mon, 16 Sep 2024 21:49:54 +0900 Subject: [PATCH 124/133] Renamed GlowTexture for AstralTree for Consistency --- Tiles/Astral/AstralTree.cs | 6 +++--- .../{AstralTree_Glow.png => AstralTreeGlow.png} | Bin ...ranches_Glow.png => AstralTree_BranchesGlow.png} | Bin ...alTree_Tops_Glow.png => AstralTree_TopsGlow.png} | Bin 4 files changed, 3 insertions(+), 3 deletions(-) rename Tiles/Astral/{AstralTree_Glow.png => AstralTreeGlow.png} (100%) rename Tiles/Astral/{AstralTree_Branches_Glow.png => AstralTree_BranchesGlow.png} (100%) rename Tiles/Astral/{AstralTree_Tops_Glow.png => AstralTree_TopsGlow.png} (100%) diff --git a/Tiles/Astral/AstralTree.cs b/Tiles/Astral/AstralTree.cs index d25a8c0c50..fa38a3c09c 100644 --- a/Tiles/Astral/AstralTree.cs +++ b/Tiles/Astral/AstralTree.cs @@ -33,11 +33,11 @@ namespace CalamityMod.Tiles.Astral }; public override Asset GetTexture() => ModContent.Request("CalamityMod/Tiles/Astral/AstralTree"); - public override Asset GetGlowTexture() => ModContent.Request("CalamityMod/Tiles/Astral/AstralTree_Glow"); + public override Asset GetGlowTexture() => ModContent.Request("CalamityMod/Tiles/Astral/AstralTreeGlow"); public override Asset GetBranchTextures() => ModContent.Request("CalamityMod/Tiles/Astral/AstralTree_Branches"); - public override Asset GetBranchGlowTextures() => ModContent.Request("CalamityMod/Tiles/Astral/AstralTree_Branches_Glow"); + public override Asset GetBranchGlowTextures() => ModContent.Request("CalamityMod/Tiles/Astral/AstralTree_BranchesGlow"); public override Asset GetTopTextures() => ModContent.Request("CalamityMod/Tiles/Astral/AstralTree_Tops"); - public override Asset GetTopGlowTextures() => ModContent.Request("CalamityMod/Tiles/Astral/AstralTree_Tops_Glow"); + public override Asset GetTopGlowTextures() => ModContent.Request("CalamityMod/Tiles/Astral/AstralTree_TopsGlow"); public override Color GetGlowColor(int i, int j) { diff --git a/Tiles/Astral/AstralTree_Glow.png b/Tiles/Astral/AstralTreeGlow.png similarity index 100% rename from Tiles/Astral/AstralTree_Glow.png rename to Tiles/Astral/AstralTreeGlow.png diff --git a/Tiles/Astral/AstralTree_Branches_Glow.png b/Tiles/Astral/AstralTree_BranchesGlow.png similarity index 100% rename from Tiles/Astral/AstralTree_Branches_Glow.png rename to Tiles/Astral/AstralTree_BranchesGlow.png diff --git a/Tiles/Astral/AstralTree_Tops_Glow.png b/Tiles/Astral/AstralTree_TopsGlow.png similarity index 100% rename from Tiles/Astral/AstralTree_Tops_Glow.png rename to Tiles/Astral/AstralTree_TopsGlow.png From 842b28e132349f8d000735ad673f0545528ff99c Mon Sep 17 00:00:00 2001 From: Flowaria Date: Mon, 16 Sep 2024 21:54:00 +0900 Subject: [PATCH 125/133] Placeholder: Applied GlowColor Animation to AstralTrees --- Tiles/Astral/AstralTree.cs | 12 ++++++++++-- Tiles/AstralDesert/AstralPalmTree.cs | 12 ++++++++++-- Tiles/AstralSnow/AstralSnowTree.cs | 12 ++++++++++-- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/Tiles/Astral/AstralTree.cs b/Tiles/Astral/AstralTree.cs index fa38a3c09c..e65767fa7f 100644 --- a/Tiles/Astral/AstralTree.cs +++ b/Tiles/Astral/AstralTree.cs @@ -1,4 +1,5 @@ -using CalamityMod.Dusts; +using System; +using CalamityMod.Dusts; using CalamityMod.Gores.Trees; using CalamityMod.Items.Materials; using CalamityMod.NPCs.Astral; @@ -41,7 +42,14 @@ namespace CalamityMod.Tiles.Astral public override Color GetGlowColor(int i, int j) { - return Color.White * 0.5f; + float brightness = 1f; + float declareThisHereToPreventRunningTheSameCalculationMultipleTimes = Main.GameUpdateCount * 0.012f; + brightness *= MathF.Sin(i / 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes); + brightness *= MathF.Sin(j / 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes); + brightness *= MathF.Sin(i * 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes); + brightness *= MathF.Sin(j * 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes); + brightness = MathHelper.Clamp(brightness, 0.0f, 1.0f); + return Color.White * MathHelper.Lerp(0.1f, 1.0f, brightness); } public override void SetTreeFoliageSettings(Tile tile, ref int xoffset, ref int treeFrame, ref int floorY, ref int topTextureFrameWidth, ref int topTextureFrameHeight) diff --git a/Tiles/AstralDesert/AstralPalmTree.cs b/Tiles/AstralDesert/AstralPalmTree.cs index 024ad8bc1b..0c25cbe285 100644 --- a/Tiles/AstralDesert/AstralPalmTree.cs +++ b/Tiles/AstralDesert/AstralPalmTree.cs @@ -1,4 +1,5 @@ -using CalamityMod.Dusts; +using System; +using CalamityMod.Dusts; using CalamityMod.Gores.Trees; using CalamityMod.Items.Materials; using Microsoft.Xna.Framework; @@ -44,7 +45,14 @@ namespace CalamityMod.Tiles.AstralDesert public override Color GetGlowColor(int i, int j) { - return Color.White; + float brightness = 1f; + float declareThisHereToPreventRunningTheSameCalculationMultipleTimes = Main.GameUpdateCount * 0.012f; + brightness *= MathF.Sin(i / 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes); + brightness *= MathF.Sin(j / 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes); + brightness *= MathF.Sin(i * 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes); + brightness *= MathF.Sin(j * 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes); + brightness = MathHelper.Clamp(brightness, 0.0f, 1.0f); + return Color.White * MathHelper.Lerp(0.05f, 0.75f, brightness); } public override int DropWood() => ModContent.ItemType(); diff --git a/Tiles/AstralSnow/AstralSnowTree.cs b/Tiles/AstralSnow/AstralSnowTree.cs index 54956a950d..1343ccb1af 100644 --- a/Tiles/AstralSnow/AstralSnowTree.cs +++ b/Tiles/AstralSnow/AstralSnowTree.cs @@ -1,4 +1,5 @@ -using CalamityMod.Dusts; +using System; +using CalamityMod.Dusts; using CalamityMod.Gores.Trees; using CalamityMod.Items.Materials; using CalamityMod.NPCs.Astral; @@ -41,7 +42,14 @@ namespace CalamityMod.Tiles.AstralSnow public override Color GetGlowColor(int i, int j) { - return Color.White; + float brightness = 1f; + float declareThisHereToPreventRunningTheSameCalculationMultipleTimes = Main.GameUpdateCount * 0.012f; + brightness *= MathF.Sin(i / 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes); + brightness *= MathF.Sin(j / 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes); + brightness *= MathF.Sin(i * 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes); + brightness *= MathF.Sin(j * 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes); + brightness = MathHelper.Clamp(brightness, 0.0f, 1.0f); + return Color.White * MathHelper.Lerp(0.35f, 1.0f, brightness); } public override void SetTreeFoliageSettings(Tile tile, ref int xoffset, ref int treeFrame, ref int floorY, ref int topTextureFrameWidth, ref int topTextureFrameHeight) From 3ae93de3433d62ea33b674c9c0cbbff89bcc1cac Mon Sep 17 00:00:00 2001 From: Flowaria Date: Mon, 16 Sep 2024 23:15:47 +0900 Subject: [PATCH 126/133] Implemented PalmTree Top part GlowMask --- ILEditing/MechanicILChanges.cs | 69 ++++++++++++++++++++++++++++++++-- 1 file changed, 66 insertions(+), 3 deletions(-) diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index 726e3932f0..cea7369a19 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -2077,19 +2077,22 @@ namespace CalamityMod.ILEditing }; }); - ApplyTreeGlowMaskSubParts(cursor, "GlowMaskPalmTree-Top", "GetTreeTopTexture", xLocaIdx, yLocaIdx, + ApplyPalmTreeGlowMaskSubParts(cursor, "GlowMaskPalmTree-Top", "GetTreeTopTexture", xLocaIdx, yLocaIdx, (glowMaskPalmTree, tileX, tileY) => { return new GlowMaskPlantDrawInfo() { - Texture = glowMaskPalmTree.GetTopGlowTextures().Value, + Texture = WorldGen.IsPalmOasisTree(tileX) ? + glowMaskPalmTree.GetOasisTopGlowTextures().Value : + glowMaskPalmTree.GetTopGlowTextures().Value, + Color = glowMaskPalmTree.GetGlowColor(tileX, tileY) }; }); } #endregion - #region GlowMask Patch SubParts + #region GlowMask Patch Tree SubParts private static void ApplyTreeGlowMaskSubParts( ILCursor cursor, string debugSubpartName, @@ -2157,6 +2160,66 @@ namespace CalamityMod.ILEditing } #endregion + #region GlowMask Patch PalmTree SubParts + private static void ApplyPalmTreeGlowMaskSubParts( + ILCursor cursor, + string debugSubpartName, + string getTextureMethodName, + int xLocaIdx, + int yLocaIdx, + Func onPlantDrawn) + { + if (!cursor.TryGotoNext(MoveType.Before, x => x.MatchCallOrCallvirt(getTextureMethodName))) + { + LogFailure("GlowMask Tree Rendering", $"Could not locate First {getTextureMethodName} call ({debugSubpartName})"); + return; + } + + if (!cursor.TryGotoNext(MoveType.Before, x => x.MatchCallOrCallvirt("Draw"))) + { + LogFailure("GlowMask Tree Rendering", $"Could not locate DrawCall ({debugSubpartName})"); + return; + } + + cursor.EmitLdloc(xLocaIdx); + cursor.EmitLdloc(yLocaIdx); + cursor.EmitDelegate(( + SpriteBatch spriteBatch, + Texture2D texture, + Vector2 position, + Rectangle? sourceRectangle, + Color color, + float rotation, + Vector2 origin, + float scale, + SpriteEffects effects, + float layerDepth, + + int tileX, + int tileY) => + { + spriteBatch.Draw(texture, position, sourceRectangle, color, rotation, origin, scale, effects, layerDepth); + + // TODO: This can be replace to read style and biome index from ilcode + // ... When we can figure out how to extract info from them + // Check TileDrawing.DrawTrees for context + WorldGen.GetTreeBottom(tileX, tileY, out var sandX, out var sandY); + var sandType = Main.tile[sandX, sandY].TileType; + + if (PlantLoader.Get(TileID.PalmTree, sandType) is not PlantType plant) + return; + + GlowMaskPlantDrawInfo? drawInfo = onPlantDrawn?.Invoke(plant, tileX, tileY) ?? default; + if (drawInfo.HasValue) + { + var info = drawInfo.Value; + spriteBatch.Draw(info.Texture, position, sourceRectangle, info.Color, rotation, origin, scale, effects, layerDepth); + } + }); + cursor.Next.OpCode = OpCodes.Nop; // remove next drawcall + } + #endregion + #endregion } } From cf755a90bf306d150fb9b62587e6edf92c8aef2e Mon Sep 17 00:00:00 2001 From: Flowaria Date: Mon, 16 Sep 2024 23:26:26 +0900 Subject: [PATCH 127/133] Removed using --- ILEditing/MechanicILChanges.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index cea7369a19..41d5fc8efd 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -35,7 +35,6 @@ using Mono.Cecil.Cil; using MonoMod.Cil; using ReLogic.Content; using Terraria; -using Terraria.Audio; using Terraria.Chat; using Terraria.DataStructures; using Terraria.GameContent; From c125c6498cea110336810a91a00aa6fe1705c5db Mon Sep 17 00:00:00 2001 From: Flowaria Date: Tue, 17 Sep 2024 00:47:48 +0900 Subject: [PATCH 128/133] Disabled Culling for Tree/Cactus/PalmTree tile --- ILEditing/ILChangesLoading.cs | 1 + ILEditing/MechanicILChanges.cs | 43 ++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index 5a00a3e7a3..9eb8eac935 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -53,6 +53,7 @@ namespace CalamityMod.ILEditing On_Player.UpdateArmorSets += DyeableShadersRenderer.CheckArmorSetsDetour; // Graphics (ModPlant stuff) + IL_TileDrawing.DrawSingleTile += DisableCullingForTreeAndCactus; IL_TileDrawing.DrawTrees += DrawTreeGlowMask; On_TileDrawing.DrawBasicTile += DrawTreeTrunkAndCactusGlowMask; diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index 41d5fc8efd..27e94a3d09 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -2017,6 +2017,49 @@ namespace CalamityMod.ILEditing } #endregion + #region Disable Tree/Cactus Culling + private static void DisableCullingForTreeAndCactus(ILContext il) + { + // Justification: + // Culling for Tree/Cactus should be disabled to simplify the GlowMask rendering on Plants + // Without this We would need to setup more ilchanges to properly gather draw position + // Furthermore we might need to clone the whole vanilla code for tree rendering + // + // And disable culling for pitch black tree/cactus would not affect the performance that much as it's really niche case + + var cursor = new ILCursor(il); + + int visibleFlagIndex = 0; + if (!cursor.TryGotoNext(MoveType.Before, + [ + x => x.MatchLdloc(out visibleFlagIndex), + x => x.MatchLdarg(out _), + x => x.MatchLdfld(out _), + x => x.MatchCallOrCallvirt("IsVisible") + ])) + { + LogFailure("Disable Tree And Cactus Culling", "Unable to Locate IsVisible Call"); + return; + } + + if (!cursor.TryGotoPrev(MoveType.Before, x => x.MatchBrfalse(out _))) + { + LogFailure("Disable Tree And Cactus Culling", "Unable to Locate Brfalse.s"); + return; + } + + cursor.EmitLdarg1(); // TileDrawInfo drawInfo + cursor.EmitDelegate((TileDrawInfo drawInfo) => + { + var type = drawInfo.typeCache; + return type == TileID.Cactus || type == TileID.Trees || type == TileID.PalmTree; + }); + cursor.EmitLdloc(visibleFlagIndex); + cursor.EmitOr(); // visible || isTree || isCactus || isPalmTree + cursor.EmitStloc(visibleFlagIndex); + } + #endregion + #region Tree Parts GlowMask private static void DrawTreeGlowMask(ILContext il) { From 01c53d795336dbd0cc709f95646b2da49b5543c4 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Sat, 28 Sep 2024 22:14:33 +0900 Subject: [PATCH 129/133] Fixed Compile Error --- ILEditing/MechanicILChanges.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index 27e94a3d09..2e30fd97ca 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -35,6 +35,7 @@ using Mono.Cecil.Cil; using MonoMod.Cil; using ReLogic.Content; using Terraria; +using Terraria.Audio; using Terraria.Chat; using Terraria.DataStructures; using Terraria.GameContent; From 7df7abb6d3b08081bf0423ab2052843ef2e55879 Mon Sep 17 00:00:00 2001 From: Cameron Ewell Date: Sun, 29 Sep 2024 16:44:04 -0400 Subject: [PATCH 130/133] Fix region names to be cleaner English --- ILEditing/MechanicILChanges.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index 2e30fd97ca..d166ad55a1 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -1996,7 +1996,7 @@ namespace CalamityMod.ILEditing } #endregion - #region GlowMask PlamTree Trunk + #region GlowMask Palm Tree Trunk else if (type == TileID.PalmTree) { var xPos = drawData.tileFrameX + drawData.addFrX; @@ -2135,7 +2135,7 @@ namespace CalamityMod.ILEditing } #endregion - #region GlowMask Patch Tree SubParts + #region GlowMask Patch Tree Sub Parts private static void ApplyTreeGlowMaskSubParts( ILCursor cursor, string debugSubpartName, @@ -2203,7 +2203,7 @@ namespace CalamityMod.ILEditing } #endregion - #region GlowMask Patch PalmTree SubParts + #region GlowMask Patch Palm Tree Sub Parts private static void ApplyPalmTreeGlowMaskSubParts( ILCursor cursor, string debugSubpartName, From 0212b4af88d71a33d1e0711f7be4d3035c6b4a25 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Mon, 30 Sep 2024 15:00:15 +0900 Subject: [PATCH 131/133] Changed TreeGlowMask IL Change to more reliable one --- ILEditing/MechanicILChanges.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index d166ad55a1..c964b7a2bc 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -2150,10 +2150,15 @@ namespace CalamityMod.ILEditing return; } - cursor.Index -= 3; // 3 Instruction Backward should be TreeStyle LdLoc - if (!cursor.Next.MatchLdloc(out var treeStyleLocaIdx)) + if (!cursor.TryGotoPrev([x => x.MatchLdcI4(out var styleEq) && styleEq == 14, x => x.MatchBneUn(out _)])) { - LogFailure("GlowMask Tree Rendering", $"Could not locate Ldloc for TreeStyleIndex ({debugSubpartName})"); + LogFailure("GlowMask Tree Rendering", $"Could not locate Bne.Un for TreeStyleIndex ({debugSubpartName})"); + return; + } + + if (!cursor.Prev.MatchLdloc(out var treeStyleLocaIdx)) + { + LogFailure("GlowMask Tree Rendering", $"Prev Instruction is not a LdLoc. Cannot locate TreeStyleIndex ({debugSubpartName})"); return; } From efc1fcef47372c35065c611653cac86a9d4d3dd5 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Mon, 30 Sep 2024 18:47:13 +0900 Subject: [PATCH 132/133] Fixed Issue: SpineSappling no longer spawns SpineTree one block below --- Tiles/Crags/Tree/SpineSapling.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Tiles/Crags/Tree/SpineSapling.cs b/Tiles/Crags/Tree/SpineSapling.cs index e1af1f142c..50ce8eee4e 100644 --- a/Tiles/Crags/Tree/SpineSapling.cs +++ b/Tiles/Crags/Tree/SpineSapling.cs @@ -49,12 +49,9 @@ namespace CalamityMod.Tiles.Crags.Tree { if (WorldGen.genRand.NextBool(20)) { - bool isPlayerNear = WorldGen.PlayerLOS(i, j); - - if (isPlayerNear && Main.tile[i, j + 1].TileType != ModContent.TileType()) - { - SpineTree.Spawn(i, j + 1, 22, 28, true); - } + // if below tile is somewhat not sappling (only possible if it's from below part) + if (Main.tile[i, j + 1].TileType != Type) + SpineTree.Spawn(i, j, 22, 28, true); } } From e086ab5284ccfb3d21c0493d6e7c79655ad1fbd5 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Mon, 30 Sep 2024 18:47:35 +0900 Subject: [PATCH 133/133] Fixed Issue: Added 5 x Height Dimension check for SpineTree Grow --- Tiles/Crags/Tree/SpineTree.cs | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Tiles/Crags/Tree/SpineTree.cs b/Tiles/Crags/Tree/SpineTree.cs index a5ab31f444..51c98ce0e4 100644 --- a/Tiles/Crags/Tree/SpineTree.cs +++ b/Tiles/Crags/Tree/SpineTree.cs @@ -62,13 +62,6 @@ namespace CalamityMod.Tiles.Crags.Tree public static bool Spawn(int i, int j, int minSize = 5, int maxSize = 18, bool saplingExists = false) { - //if this tree grew from a sapling, then kill the sapling its growing from - if (saplingExists) - { - WorldGen.KillTile(i, j, false, false, true); - WorldGen.KillTile(i, j - 1, false, false, true); - } - //set the minimum and maximum height the tree can grow to int height = Main.rand.Next(minSize, maxSize); for (int k = 1; k < height; ++k) @@ -85,6 +78,20 @@ namespace CalamityMod.Tiles.Crags.Tree return false; } + // something is blocking from growing the tree... + var sapplingType = ModContent.TileType(); + if (!WorldGen.EmptyTileCheck(i - 2, i + 2, j - height, j, sapplingType)) + { + return false; + } + + //if this tree grew from a sapling, then kill the sapling its growing from + if (saplingExists) + { + WorldGen.KillTile(i, j, false, false, true); + WorldGen.KillTile(i, j - 1, false, false, true); + } + //make sure the block is valid for the tree to place on if ((SolidTopTile(i, j + 1) || SolidTile(i, j + 1)) && !Framing.GetTileSafely(i, j).HasTile) {