From 7662c8cf8f9971c25ccdfd84e0e08125723fbb9e Mon Sep 17 00:00:00 2001 From: Xyk Date: Wed, 5 Mar 2025 19:16:00 -0800 Subject: [PATCH] Luxor's Gift Rework --- CalPlayer/CalamityPlayer.cs | 2 + CalPlayer/CalamityPlayerOnHit.cs | 6 + Items/Accessories/LuxorsGift.cs | 37 ++- Items/Accessories/LuxorsGift.png | Bin 989 -> 1290 bytes Items/CalamityGlobalItem.cs | 78 ------ .../Mods.CalamityMod.Items.Accessories.hjson | 5 +- ...ods.CalamityMod.Projectiles.Typeless.hjson | 4 +- Projectiles/Magic/LuxorsGiftMagic.cs | 107 +++++--- Projectiles/Magic/LuxorsGiftMagic.png | Bin 344 -> 550 bytes Projectiles/Melee/LuxorsGiftMelee.cs | 126 ++++----- Projectiles/Melee/LuxorsGiftMelee.png | Bin 275 -> 668 bytes Projectiles/Ranged/LuxorsGiftRanged.cs | 124 +++++---- Projectiles/Ranged/LuxorsGiftRanged.png | Bin 328 -> 584 bytes Projectiles/Rogue/LuxorsGiftRogue.cs | 148 +++++------ Projectiles/Rogue/LuxorsGiftRogue.png | Bin 401 -> 663 bytes Projectiles/Summon/LuxorsGiftSummon.cs | 148 +++++------ Projectiles/Summon/LuxorsGiftSummon.png | Bin 390 -> 513 bytes Projectiles/Typeless/Luxor.cs | 251 ++++++++++++++++++ Projectiles/Typeless/Luxor.png | Bin 0 -> 4297 bytes Projectiles/Typeless/LuxorsGiftClassless.cs | 94 +++++++ Projectiles/Typeless/LuxorsGiftClassless.png | Bin 0 -> 3405 bytes 21 files changed, 718 insertions(+), 412 deletions(-) create mode 100644 Projectiles/Typeless/Luxor.cs create mode 100644 Projectiles/Typeless/Luxor.png create mode 100644 Projectiles/Typeless/LuxorsGiftClassless.cs create mode 100644 Projectiles/Typeless/LuxorsGiftClassless.png diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 0a201a8a45..f945166455 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -709,6 +709,7 @@ namespace CalamityMod.CalPlayer #region Accessory public bool shieldOfTheHighRulerDashVelocityBoosted = false; public bool luxorsGift = false; + public bool luxorHit = false; public bool fungalSymbiote = false; public bool trinketOfChi = false; public bool gladiatorSword = false; @@ -2770,6 +2771,7 @@ namespace CalamityMod.CalPlayer #region Buffs, Debuffs, Counters, and Nonsense heldGaelsLastFrame = false; gaelSwipes = 0; + luxorHit = false; arsenalCooldown = 0; andromedaState = AndromedaPlayerState.Inactive; planarSpeedBoost = 0; diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 1766744907..62ee93be7f 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -146,6 +146,9 @@ namespace CalamityMod.CalPlayer // Ursa Sergeant slash cooldown is reset on kill if (ursaSergeant && target.life <= 0 && target.realLife == -1) ursaSergeantCooldown = (int)MathHelper.Clamp(ursaSergeantCooldown - 180, 0, 300); + + if (luxorsGift) + luxorHit = true; // Transformer gives +2 blobs on kill, which are stored then given to you one by one (so it can't spawn more than one on a single frame) if (transformer && Player.Calamity().transformerCooldown == 0 && target.life <= 0 && target.realLife == -1) @@ -307,6 +310,9 @@ namespace CalamityMod.CalPlayer if (ursaSergeant && target.life <= 0 && target.realLife == -1) ursaSergeantCooldown = (int)MathHelper.Clamp(ursaSergeantCooldown - UrsaSergeant.CooldownReducedPerKill, 0, UrsaSergeant.MaxCooldown); + if (luxorsGift && proj.type != ModContent.ProjectileType() && proj.type != ModContent.ProjectileType() && proj.type != ModContent.ProjectileType() && proj.type != ModContent.ProjectileType() && proj.type != ModContent.ProjectileType() && proj.type != ModContent.ProjectileType()) + luxorHit = true; + // Transformer gives +2 blobs on kill, which are stored then given to you one by one (so it can't spawn more than one on a single frame) if (transformer && Player.Calamity().transformerCooldown == 0 && target.life <= 0 && target.realLife == -1) { diff --git a/Items/Accessories/LuxorsGift.cs b/Items/Accessories/LuxorsGift.cs index bd3acd5dff..f2f6c4ffa8 100644 --- a/Items/Accessories/LuxorsGift.cs +++ b/Items/Accessories/LuxorsGift.cs @@ -1,17 +1,43 @@ -using CalamityMod.CalPlayer; +using System; +using CalamityMod.CalPlayer; +using CalamityMod.Cooldowns; +using CalamityMod.NPCs; +using CalamityMod.NPCs.NormalNPCs; +using CalamityMod.Projectiles.Typeless; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; namespace CalamityMod.Items.Accessories { public class LuxorsGift : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public const int meleeAttackSpeed = 100; + public const int rangedAttackSpeed = 25; + public const int magicAttackSpeed = 75; + public const int summonerAttackSpeed = 140; + public const int rogueAttackSpeed = 36; // Rogue has a 12 frame delay between it's two shots, so it's actaully a bit slower than you'd think + public const int classlessAttackSpeed = 50; + + public const int meleeDamage = 16; + public const int rangedDamage = 5; + public const int magicDamage = 13; + public const int summonerDamage = 22; + public const int rogueDamage = 8; + public const int classlessDamage = 9; + + public const int luxArmorPen = 35; // Remember kids, If a Shark Tooth Necklace approaches you, run away and contact your nearest trusted adult public override void SetDefaults() { - Item.width = 58; - Item.height = 48; + Item.width = 66; + Item.height = 46; Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; Item.rare = ItemRarityID.Orange; Item.accessory = true; @@ -21,6 +47,11 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.luxorsGift = true; + + if (player.ownedProjectileCounts[ProjectileType()] < 1 && !player.dead) + { + Projectile lux = Projectile.NewProjectileDirect(player.GetSource_FromThis(), player.Center, Vector2.Zero, ProjectileType(), 0, 0f, player.whoAmI); + } } } } diff --git a/Items/Accessories/LuxorsGift.png b/Items/Accessories/LuxorsGift.png index f47ea32f110e5ab8025e4edeed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LNkvXXu0mjf=`h)Q diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 900fbab16d..3375430db0 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -343,84 +343,6 @@ namespace CalamityMod.Items player.statMana = 0; } - if (modPlayer.luxorsGift && !item.channel) - { - // useTime 9 = 0.9 useTime 2 = 0.2 - float damageMult = 1f; - if (item.useTime < 10) - damageMult -= (10 - item.useTime) / 10f; - - float newDamage = damage * damageMult; - - if (player.whoAmI == Main.myPlayer) - { - if (item.CountsAsClass()) - { - int meleeDamage = (int)(newDamage * 0.25f); - - if (meleeDamage >= 1) - { - int projectile = Projectile.NewProjectile(playerSource, position, velocity * 0.5f, ModContent.ProjectileType(), (int)meleeDamage, 0f, player.whoAmI); - if (projectile.WithinBounds(Main.maxProjectiles)) - Main.projectile[projectile].DamageType = DamageClass.Generic; - } - } - else if (item.CountsAsClass()) - { - int throwingDamage = (int)(newDamage * 0.2f); - - if (throwingDamage >= 1) - { - int projectile = Projectile.NewProjectile(playerSource, position, velocity, ModContent.ProjectileType(), (int)throwingDamage, 0f, player.whoAmI); - if (projectile.WithinBounds(Main.maxProjectiles)) - Main.projectile[projectile].DamageType = DamageClass.Generic; - } - } - else if (item.CountsAsClass()) - { - // This projectile is channeled and has no cooldown unless the gun fires - // The damage of the projectile is also always the max damage of the weapon, and the shot damage is calculated based off of that - // You can see how this may cause issues - // The projectile is fired inside of the scope's code instead - if (type != ModContent.ProjectileType()) - { - int rangedDamage = (int)(newDamage * 0.15f); - - if (rangedDamage >= 1) - { - int projectile = Projectile.NewProjectile(playerSource, position, velocity * 1.5f, ModContent.ProjectileType(), (int)rangedDamage, 0f, player.whoAmI); - if (projectile.WithinBounds(Main.maxProjectiles)) - Main.projectile[projectile].DamageType = DamageClass.Generic; - } - } - } - else if (item.CountsAsClass()) - { - int magicDamage = (int)(newDamage * 0.3f); - - if (magicDamage >= 1) - { - int projectile = Projectile.NewProjectile(playerSource, position, velocity, ModContent.ProjectileType(), (int)magicDamage, 0f, player.whoAmI); - if (projectile.WithinBounds(Main.maxProjectiles)) - Main.projectile[projectile].DamageType = DamageClass.Generic; - } - } - else if (item.CountsAsClass() && player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) - { - if (damage >= 1) - { - int summonDamage = item.damage; - - int projectile = Projectile.NewProjectile(playerSource, position, Vector2.Zero, ModContent.ProjectileType(), summonDamage, 0f, player.whoAmI); - if (projectile.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[projectile].DamageType = DamageClass.Generic; - Main.projectile[projectile].originalDamage = item.damage; - } - } - } - } - } if (modPlayer.bloodflareMage && modPlayer.canFireBloodflareMageProjectile) { if (item.CountsAsClass() && !item.channel) diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 324611eead..c9df6d6cf0 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -1055,8 +1055,9 @@ LuxorsGift: { DisplayName: Luxor's Gift Tooltip: ''' - Weapons fire unique projectiles based on their damage type - Some weapons are unable to receive this bonus + Summons a scarab launcher that follows you closely + The scarab fires different projectiles at enemies depending on what class the held weapon belongs to + When not in use, the scarab will condense itself into a small orb of light ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson index 98b90a5e98..6cb0e05a6f 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson @@ -80,6 +80,8 @@ JewelSpike.DisplayName: Spike KelvinCatalystStar.DisplayName: Kelvin Catalyst Star LeviAmberDash.DisplayName: Riptide Slam LunicBeam.DisplayName: Lunic Seeker +Luxor.DisplayName: Luxor +LuxorsGiftClassless.DisplayName: Luxor's Classless MagnusBeam.DisplayName: Magnus Seeker MagnusBoom.DisplayName: Nebula Blast MythrilFlare.DisplayName: Mythril Flare @@ -98,6 +100,7 @@ PlaguePulse.DisplayName: Plague Pulse PoisonousSeawater.DisplayName: Seawater PscTransformAnimation.DisplayName: Psc Transform Animation PscTransformRocks.DisplayName: Psc Transform Rocks +PuddleSplash.DisplayName: Puddle Splash ReaverOrb.DisplayName: Reaver Orb ReaverThornBase.DisplayName: Thorn RedLabSeeker.DisplayName: Seeking Mechanism @@ -145,4 +148,3 @@ YanmeisKnifeSlash.DisplayName: Yanmei's Knife YellowLabSeeker.DisplayName: Seeking Mechanism VoidofExtinctionCrit.DisplayName: Void of Extinction Crit XykDeathAnim.DisplayName: Xyk Death Animation -PuddleSplash.DisplayName: Puddle Splash diff --git a/Projectiles/Magic/LuxorsGiftMagic.cs b/Projectiles/Magic/LuxorsGiftMagic.cs index aaeb7a4d68..ada0659e91 100644 --- a/Projectiles/Magic/LuxorsGiftMagic.cs +++ b/Projectiles/Magic/LuxorsGiftMagic.cs @@ -1,5 +1,8 @@ using System; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -14,69 +17,87 @@ namespace CalamityMod.Projectiles.Magic ProjectileID.Sets.TrailCacheLength[Type] = 10; ProjectileID.Sets.TrailingMode[Type] = 1; } - + public float velLerp => Utils.GetLerpValue(1, 8, Projectile.velocity.Length(), true); public override void SetDefaults() { Projectile.width = 18; - Projectile.height = 18; + Projectile.height = 36; Projectile.friendly = true; Projectile.DamageType = DamageClass.Magic; Projectile.penetrate = 2; - Projectile.alpha = 255; - Projectile.timeLeft = 240; + Projectile.timeLeft = 360; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; + Projectile.localNPCHitCooldown = -1; + Projectile.extraUpdates = 2; + Projectile.tileCollide = false; } - public override void AI() { + Lighting.AddLight(Projectile.Center, Color.Gold.ToVector3() * 0.35f); Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; - if (Projectile.localAI[0] == 0f) + if (Projectile.timeLeft == 360) + Projectile.velocity *= 0.1f; + if (Projectile.velocity.Length() < 8) + Projectile.velocity *= 1.01f; + /* + Vector2 dustVel = (Projectile.rotation - MathHelper.PiOver2).ToRotationVector2().RotatedByRandom(0.5f) * Main.rand.NextFloat(0.8f, 1.3f); + Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(4, 4), ModContent.DustType(), dustVel * Main.rand.NextFloat(0.5f, 1.2f)); + dust.noGravity = !Main.rand.NextBool(3); + dust.scale = Main.rand.NextFloat(0.45f, 0.6f); + dust.color = Color.Gold; + dust.noLightEmittence = true; + */ + if (Projectile.timeLeft > 30) { - Projectile.scale -= 0.01f; - Projectile.alpha += 15; - if (Projectile.alpha >= 250) + for (int i = 0; i < 2; i++) { - Projectile.alpha = 255; - Projectile.localAI[0] = 1f; - } - } - else if (Projectile.localAI[0] == 1f) - { - Projectile.scale += 0.01f; - Projectile.alpha -= 15; - if (Projectile.alpha <= 0) - { - Projectile.alpha = 0; - Projectile.localAI[0] = 0f; - } - } - Projectile.localAI[1] += 1f; - if (Projectile.localAI[1] == 3f) - { - for (int l = 0; l < 12; l++) - { - Vector2 dustRotate = Vector2.UnitX * (float)-(float)Projectile.width / 2f; - dustRotate += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default) * new Vector2(8f, 16f); - dustRotate = dustRotate.RotatedBy((double)(Projectile.rotation - 1.57079637f), default); - int dusty = Dust.NewDust(Projectile.Center, 0, 0, DustID.CopperCoin, 0f, 0f, 160, default, 1f); - Main.dust[dusty].scale = 1.1f; - Main.dust[dusty].noGravity = true; - Main.dust[dusty].position = Projectile.Center + dustRotate; - Main.dust[dusty].velocity = Projectile.velocity * 0.1f; - Main.dust[dusty].velocity = Vector2.Normalize(Projectile.Center - Projectile.velocity * 3f - Main.dust[dusty].position) * 1.25f; + Vector2 offset = (MathHelper.TwoPi * i / 2f).ToRotationVector2().RotatedBy(Projectile.timeLeft * 0.1f) * 35 * velLerp; + Vector2 dustVel = (Projectile.rotation - MathHelper.PiOver2).ToRotationVector2().RotatedByRandom(0.1f) * Main.rand.NextFloat(5.5f, 6.5f); + Dust dust = Dust.NewDustPerfect(Projectile.Center + offset, 278, dustVel); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(0.4f, 0.5f); + dust.color = Color.Gold; + dust.noLightEmittence = true; } } } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - Projectile.velocity *= 0.25f; + float minMult = 0.5f; + int hitsToMinMult = 3; + float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); + modifiers.SourceDamage *= damageMult; + for (int g = 0; g < 4; g++) + { + for (int i = 0; i < 2; i++) + { + Vector2 offset = (MathHelper.TwoPi * i / 2f).ToRotationVector2().RotatedBy(Projectile.timeLeft * 0.1f) * 35 * velLerp; + Vector2 dustVel = (Projectile.rotation - MathHelper.PiOver2).ToRotationVector2(); + Dust dust = Dust.NewDustPerfect(Projectile.Center + offset, ModContent.DustType(), dustVel.RotatedByRandom(0.3f) * Main.rand.NextFloat(5.5f, 9.5f)); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(1.2f, 1.5f); + dust.color = Color.Gold; + dust.noLightEmittence = true; + } + } } - + public override bool OnTileCollide(Vector2 oldVelocity) + { + return false; + } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 10 + 65 * velLerp, targetHitbox); public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); + Asset tex = ModContent.Request(Texture); + Color drawColor = Color.Gold; + float fade = Utils.GetLerpValue(0, 90, Projectile.timeLeft, true); + + for (int i = 0; i < 2; i++) + { + Vector2 drawOffset = (MathHelper.TwoPi * i / 2f).ToRotationVector2().RotatedBy(Projectile.timeLeft * 0.1f) * 45 * velLerp; + Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition + drawOffset, null, drawColor with { A = 0 } * 0.6f * (float)Math.Pow(fade, 3), Projectile.rotation, tex.Size() * 0.5f, Projectile.scale, SpriteEffects.None); + } + Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition, null, Color.White * fade, Projectile.rotation, tex.Size() * 0.5f, new Vector2(1 - 0.3f * velLerp, 1 + 0.8f * velLerp) * Projectile.scale, SpriteEffects.None); return false; } } diff --git a/Projectiles/Magic/LuxorsGiftMagic.png b/Projectiles/Magic/LuxorsGiftMagic.png index e3e09a3ae8c437db91a8a8a17db122e9faf20f4c..90f9061be131d859f38e49234893a57b91211bdf 100644 GIT binary patch delta 512 zcmV+b0{{Kk0;U9zFn<69XF*Lt006O%3;baP0005DNklv3g4pz3RR-*LPMIeV{(lo0FwJ@U30S@8GKkAo z^SXg)s=0^-O2YvxooE?DTqu7QOfg(BW(U(J&qCxw86fg7K!Y&4@Cz*Px^^y@e)dHR z97ZgkeuDXb_#iHl;<*M1qvm8Vf3*P{n5ID(DIb8)(DWiT4`TCy{g5z$=RK%ATs;Go zV+|v(h5l~@^M4sGRzhfWpx+LrRx{RvY3k=SC=Ca%d>J6Ivgs9=j}Bh@iGgXc&8T{* z=OUO3U;vh~VX*|uQ?NXUE)N4VNZB}I>-Bv|N*7gxq+~cii#^(mAECy4rYs0`aEIrXKW!J0Nfq7k)t$7H{7Y&A#L$B9D%B88- z?Z9;7okJ*kY3CvsKrcCAB_Vp94+B(l(GW7|s>)R`W>5vTLVy^~#{uZ)wbv0TU`z;5 z$wdqd04{c!WKts=7XSbN4rN$LW=%~1DgXcg2mk;800000(o>TF0000ibdcsBy|W#PzV$VB-{bn zJAg!hLZC>fs3XDPdI1OtN5B@tPhh$mO4&v6-84IYUuI@^>p-Jq)=Qt`>;3`&Xs?cr zYJEv(^rRgxJaD(gtNvs7!j1pq|orq5*Nh<|h>y6%vq8IB$?QlmtF zqXI^5;K2>N?~RJ8T%T+l07xG5zDfWveFz`|tbKK-}TT1i5gKWkDXs8svP z#AwiX$un0Y60sXP0x4ND^Iem*l7y0gGJiwL54u`0ZiY~j*_&+62X6p*wkZ4Wn%pS~ zJmth&fBQ2;6e|Bd{7yb2`$W`v7w0ni9T98wPR5AtXzFbbF$NPX00000NkvXXu0mjf Da!Q8| diff --git a/Projectiles/Melee/LuxorsGiftMelee.cs b/Projectiles/Melee/LuxorsGiftMelee.cs index 83d423e61e..1d102d26d6 100644 --- a/Projectiles/Melee/LuxorsGiftMelee.cs +++ b/Projectiles/Melee/LuxorsGiftMelee.cs @@ -1,5 +1,9 @@ -using CalamityMod.Dusts; +using System; +using CalamityMod.Dusts; +using CalamityMod.Particles; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -15,100 +19,82 @@ namespace CalamityMod.Projectiles.Melee ProjectileID.Sets.TrailCacheLength[Type] = 10; ProjectileID.Sets.TrailingMode[Type] = 1; } - public override void SetDefaults() { - Projectile.width = 20; - Projectile.height = 20; + Projectile.width = 30; + Projectile.height = 38; Projectile.friendly = true; Projectile.DamageType = DamageClass.Melee; - Projectile.penetrate = 3; - Projectile.alpha = 255; - Projectile.timeLeft = 300; + Projectile.penetrate = -1; // Works like 2 + Projectile.timeLeft = 180; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; + Projectile.localNPCHitCooldown = -1; + Projectile.extraUpdates = 2; } - public override void AI() { - if (Projectile.localAI[0] == 0f) + Lighting.AddLight(Projectile.Center, Color.Red.ToVector3() * 0.35f); + Projectile.scale = (Projectile.ai[0] == 5 ? 0.5f : 0.75f); + Projectile.velocity *= 0.973f; + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + + if (Projectile.ai[0] == 5) { - Projectile.scale -= 0.01f; - Projectile.alpha += 15; - if (Projectile.alpha >= 250) + if (Projectile.timeLeft % 9 == 0 && Projectile.timeLeft > 30) { - Projectile.alpha = 255; - Projectile.localAI[0] = 1f; + Vector2 dustVel = -(Projectile.rotation - MathHelper.PiOver2).ToRotationVector2().RotatedByRandom(0.5f) * Main.rand.NextFloat(0.8f, 1.3f); + Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(5, 5), ModContent.DustType(), dustVel * Main.rand.NextFloat(0.5f, 1.2f)); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(0.45f, 0.6f); + dust.color = Color.Red; + dust.alpha = 120; + dust.noLightEmittence = true; } } - else if (Projectile.localAI[0] == 1f) + else if (Projectile.timeLeft % 4 == 0 && Projectile.timeLeft > 30) { - Projectile.scale += 0.01f; - Projectile.alpha -= 15; - if (Projectile.alpha <= 0) - { - Projectile.alpha = 0; - Projectile.localAI[0] = 0f; - } + Vector2 dustVel = -(Projectile.rotation - MathHelper.PiOver2).ToRotationVector2().RotatedByRandom(0.5f) * Main.rand.NextFloat(0.8f, 1.3f); + Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(8, 8), ModContent.DustType(), dustVel * Main.rand.NextFloat(0.5f, 1.2f)); + dust.noGravity = !Main.rand.NextBool(3); + dust.scale = Main.rand.NextFloat(0.45f, 0.6f); + dust.color = Color.Red; + dust.noLightEmittence = true; } - Projectile.localAI[1] += 1f; - if (Projectile.localAI[1] == 3f) + if (Projectile.timeLeft > 90 && Projectile.timeLeft < 177 && Projectile.timeLeft % 2 == 0 && Projectile.ai[0] == 0) { - for (int l = 0; l < 12; l++) - { - Vector2 dustRotate = Vector2.UnitX * (float)-(float)Projectile.width / 2f; - dustRotate += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default) * new Vector2(8f, 16f); - dustRotate = dustRotate.RotatedBy((double)(Projectile.rotation - 1.57079637f), default); - int spawnDust = Dust.NewDust(Projectile.Center, 0, 0, (int)CalamityDusts.Brimstone, 0f, 0f, 160, default, 1f); - Main.dust[spawnDust].scale = 1.1f; - Main.dust[spawnDust].noGravity = true; - Main.dust[spawnDust].position = Projectile.Center + dustRotate; - Main.dust[spawnDust].velocity = Projectile.velocity * 0.1f; - Main.dust[spawnDust].velocity = Vector2.Normalize(Projectile.Center - Projectile.velocity * 3f - Main.dust[spawnDust].position) * 1.25f; - } + Particle spark = new GlowSparkParticle(Projectile.Center - Projectile.velocity.SafeNormalize(Vector2.UnitX) * 2, -Projectile.velocity.SafeNormalize(Vector2.UnitX) * 2, false, 14, 0.02f, Color.Red * 0.45f, new Vector2(1.4f, 1f), true, false, 0.6f); + GeneralParticleHandler.SpawnParticle(spark); } } - - public override Color? GetAlpha(Color lightColor) + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - if (Projectile.timeLeft < 85) - { - byte b2 = (byte)(Projectile.timeLeft * 3); - byte a2 = (byte)(100f * ((float)b2 / 255f)); - return new Color((int)b2, (int)b2, (int)b2, (int)a2); - } - return new Color(255, 255, 255, 100); + float minMult = 0.5f; + int hitsToMinMult = 3; + float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); + modifiers.SourceDamage *= damageMult; + if (Projectile.numHits >= 1 && Projectile.timeLeft > 70) + Projectile.timeLeft = 70; } - public override bool OnTileCollide(Vector2 oldVelocity) { - SoundEngine.PlaySound(SoundID.Item10, Projectile.position); - for (int l = 0; l < 12; l++) - { - Vector2 dustRotate = Vector2.UnitX * (float)-(float)Projectile.width / 2f; - dustRotate += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default) * new Vector2(8f, 16f); - dustRotate = dustRotate.RotatedBy((double)(Projectile.rotation - 1.57079637f), default); - int spawnDust = Dust.NewDust(Projectile.Center, 0, 0, (int)CalamityDusts.Brimstone, 0f, 0f, 160, default, 1f); - Main.dust[spawnDust].scale = 1.1f; - Main.dust[spawnDust].noGravity = true; - Main.dust[spawnDust].position = Projectile.Center + dustRotate; - Main.dust[spawnDust].velocity = Projectile.velocity * 0.1f; - Main.dust[spawnDust].velocity = Vector2.Normalize(Projectile.Center - Projectile.velocity * 3f - Main.dust[spawnDust].position) * 1.25f; - } - if (Projectile.velocity.X != oldVelocity.X) - { - Projectile.velocity.X = -oldVelocity.X; - } - if (Projectile.velocity.Y != oldVelocity.Y) - { - Projectile.velocity.Y = -oldVelocity.Y; - } + Projectile.velocity = oldVelocity * 0.85f; return false; } - + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => (Projectile.ai[0] == 5 || Projectile.numHits >= 2) ? false : CalamityUtils.CircularHitboxCollision(Projectile.Center, 20, targetHitbox); public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); + Asset tex = ModContent.Request(Texture); + Color drawColor = Color.Red; + float fade = Utils.GetLerpValue(0, 90, Projectile.timeLeft, true); + + + for (int i = 0; i < 8; i++) + { + Vector2 drawOffset = (MathHelper.TwoPi * i / 8f).ToRotationVector2() * 2f; + Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition + drawOffset, null, drawColor with { A = 0 } * 0.4f * (float)Math.Pow(fade, 3), Projectile.rotation, tex.Size() * 0.5f, Projectile.scale, SpriteEffects.None); + } + Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition, null, Color.White * fade, Projectile.rotation, tex.Size() * 0.5f, Projectile.scale, SpriteEffects.None); + //CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } } diff --git a/Projectiles/Melee/LuxorsGiftMelee.png b/Projectiles/Melee/LuxorsGiftMelee.png index 7fc8375ae339b5cb61d44a6f6d46352587632cbf..d773032b8265895fca8d5cb93f1df39d1aee2b13 100644 GIT binary patch literal 668 zcmV;N0%QG&P)Px#1ZP1_K>z@;j|==^1poj7EJ;K`R9HvNn7vC|Q5eSGh=b5UGDNaSYTc9$0YSk* zGIY2_q2M1NxH6?Lzp_+^(5)bG01kmY|@&N5X|uxVUu4+FW%hr~Tm z4H0rS0MY9{avl>gKJU%OT|B6wPPN^ zZ;bLU$J%+=xd4OWGf+!kPjgE7>v%!Vv7VASuoTRK%q?@>4u64Xas)PI67=73no~Ln zYP+DkUN-#r9SG}NppH*-p1osEDxIq!*aYSH0C3f7-w(q*&{cbR3E=y>HaN+$a~#!n zO{0GO1ke%Xa(aAeshlgPQl0>qbIQf7ZU7!nuG%`*^5WXiisvlPU8lowpj!V7`rpSt z?+ZL8bJFUJg7dW%(Dm>01;dl3q3!2({Ts;BiM8-jJu7?1+NnN=Imy_+?05Dj`<9bR zpUc|0M~-dZvJY?a(}?-qyTx@n*P_#z{0QQo^iC7+=Z|AbJMY(zTDt$WQz|pZ4;~!n z3i*mB)%`2ZXTF0000Px#%}GQ-R5*>bld%oLFc3w*5iK*YK#&*#Dk=&a#QkDDAx|58X^ zJq!Spv#oX3r*r3BMmKEVAtx>l8vwxlcn${j9L>`i5;Ywy^G=_CgPM`_hQzl;qGlwz Z;SW%JS}pQCk}3cI002ovPDHLkV1g(cZIJ)~ diff --git a/Projectiles/Ranged/LuxorsGiftRanged.cs b/Projectiles/Ranged/LuxorsGiftRanged.cs index 07ef96b9fc..1c71157927 100644 --- a/Projectiles/Ranged/LuxorsGiftRanged.cs +++ b/Projectiles/Ranged/LuxorsGiftRanged.cs @@ -1,4 +1,8 @@ -using Microsoft.Xna.Framework; +using System; +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -17,87 +21,79 @@ namespace CalamityMod.Projectiles.Ranged public override void SetDefaults() { - Projectile.width = 14; - Projectile.height = 14; + Projectile.width = 38; + Projectile.height = 38; Projectile.friendly = true; Projectile.DamageType = DamageClass.Ranged; Projectile.penetrate = 1; - Projectile.alpha = 255; - Projectile.timeLeft = 180; + Projectile.timeLeft = 300; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + Projectile.extraUpdates = 5; } - - public override Color? GetAlpha(Color lightColor) - { - if (Projectile.timeLeft < 85) - { - byte b2 = (byte)(Projectile.timeLeft * 3); - byte a2 = (byte)(100f * ((float)b2 / 255f)); - return new Color((int)b2, (int)b2, (int)b2, (int)a2); - } - return new Color(255, 255, 255, 100); - } - public override void AI() { - if (Projectile.localAI[0] == 0f) - { - Projectile.scale -= 0.01f; - Projectile.alpha += 15; - if (Projectile.alpha >= 250) - { - Projectile.alpha = 255; - Projectile.localAI[0] = 1f; - } - } - else if (Projectile.localAI[0] == 1f) - { - Projectile.scale += 0.01f; - Projectile.alpha -= 15; - if (Projectile.alpha <= 0) - { - Projectile.alpha = 0; - Projectile.localAI[0] = 0f; - } - } + Lighting.AddLight(Projectile.Center, Color.Cyan.ToVector3() * 0.35f); Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; - Projectile.localAI[1] += 1f; - if (Projectile.localAI[1] == 3f) + if (Projectile.timeLeft == 300) + Projectile.velocity *= 0.5f; + if (Projectile.timeLeft > 30) { - for (int l = 0; l < 12; l++) + for (int i = 0; i < 2; i++) { - Vector2 offset = Vector2.UnitX * (float)-(float)Projectile.width / 2f; - offset += -Vector2.UnitY.RotatedBy((double)(l * MathHelper.Pi / 6f), default) * new Vector2(8f, 16f); - offset = offset.RotatedBy((double)(Projectile.rotation - MathHelper.PiOver2), default); - int electric = Dust.NewDust(Projectile.Center, 0, 0, DustID.IceTorch, 0f, 0f, 160, default, 1f); - Main.dust[electric].scale = 1.1f; - Main.dust[electric].noGravity = true; - Main.dust[electric].position = Projectile.Center + offset; - Main.dust[electric].velocity = Projectile.velocity * 0.1f; - Main.dust[electric].velocity = Vector2.Normalize(Projectile.Center - Projectile.velocity * 3f - Main.dust[electric].position) * 1.25f; + Vector2 dustPos = Projectile.Center + Projectile.velocity.RotatedBy(MathHelper.PiOver2) * (i == 0 ? -3 : 3); + Vector2 dustVel = (Projectile.rotation - MathHelper.PiOver2).ToRotationVector2().RotatedByRandom(0.2f) * Main.rand.NextFloat(2.5f, 8.5f); + Dust dust = Dust.NewDustPerfect(dustPos + Main.rand.NextVector2Circular(2, 2), Main.rand.NextBool() ? 278 : ModContent.DustType(), dustVel * Main.rand.NextFloat(0.5f, 1.2f)); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(0.3f, 0.4f); + dust.color = Color.Cyan; + dust.noLightEmittence = true; } } } - - public override void OnKill(int timeLeft) + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - Projectile.ExpandHitboxBy(16); - Projectile.maxPenetrate = Projectile.penetrate = -1; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; - Projectile.Damage(); - SoundEngine.PlaySound(SoundID.Item92, Projectile.position); - int dustAmt = Main.rand.Next(10, 20); - for (int d = 0; d < dustAmt; d++) + float minMult = 0.5f; + int hitsToMinMult = 3; + float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); + modifiers.SourceDamage *= damageMult; + + for (int i = 0; i < 12; i++) { - int electric = Dust.NewDust(Projectile.Center - Projectile.velocity / 2f, 0, 0, DustID.IceTorch, 0f, 0f, 100, default, 2f); - Main.dust[electric].velocity *= 2f; - Main.dust[electric].noGravity = true; + Vector2 dustVel = (Projectile.rotation - MathHelper.PiOver2).ToRotationVector2().RotatedByRandom(0.2f) * Main.rand.NextFloat(2.5f, 8.5f); + Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(11, 11), Main.rand.NextBool() ? 278 : ModContent.DustType(), dustVel * Main.rand.NextFloat(0.3f, 1.7f)); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(0.8f, 1.1f); + dust.color = Color.Cyan; + dust.noLightEmittence = true; } } - + public override bool OnTileCollide(Vector2 oldVelocity) + { + for (int i = 0; i < 12; i++) + { + Vector2 dustVel = (Projectile.rotation - MathHelper.PiOver2).ToRotationVector2().RotatedByRandom(0.2f) * Main.rand.NextFloat(2.5f, 8.5f); + Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(11, 11), Main.rand.NextBool() ? 278 : ModContent.DustType(), dustVel * Main.rand.NextFloat(0.3f, 1.7f)); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(0.8f, 1.1f); + dust.color = Color.Cyan; + dust.noLightEmittence = true; + } + return true; + } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 20, targetHitbox); public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); + Asset tex = ModContent.Request(Texture); + Color drawColor = Color.Cyan; + float fade = Utils.GetLerpValue(0, 90, Projectile.timeLeft, true); + + for (int i = 0; i < 8; i++) + { + Vector2 drawOffset = (MathHelper.TwoPi * i / 8f).ToRotationVector2() * 2f; + Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition + drawOffset, null, drawColor with { A = 0 } * 0.4f * (float)Math.Pow(fade, 3), Projectile.rotation, tex.Size() * 0.5f, Projectile.scale, SpriteEffects.None); + } + Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition, null, Color.White * fade, Projectile.rotation, tex.Size() * 0.5f, Projectile.scale, SpriteEffects.None); return false; } } diff --git a/Projectiles/Ranged/LuxorsGiftRanged.png b/Projectiles/Ranged/LuxorsGiftRanged.png index 21c519768f4ced89e76493e6d0270e6d252b4389..4537405b029743ed9134a34963c34583e97fb62f 100644 GIT binary patch literal 584 zcmV-O0=NB%P)Px#1ZP1_K>z@;j|==^1poj6*hxe|R9HvtmoH2LQ5?q)H;<&w;4It>qEVa_qD_+) zAz=b7W}DGwwkRY?V$r0V!AQY@Q8BoqID=CYxT)Ol`};9@?Bvf8?hZfO<8v?E?!E85 z-@S+Cm`vuInxOXkWQ6TH0_@)5RO+c1b@kdOxgH!P>)8TXOQ-vKh7S{4s9+r(({DRl z?7OgE6YI8;GBv(nLbLF07(S@L)kj!J2l=7{ye3_o*hvx9m291nRGC&DgP%AV;XMl{ zqoigv%6+*aJf4Du8BQ|tL6Z9fJ%=~qfi=d-Y4a1LCOoq?@?UUp30^C~7mIN17LMD@ zUEYLn{|0YH-M+?DVuycMr&OV^J_SqCGV}8nSWv4}rLfa777rxGUvjf-P}g`>f_tdK zYIUAo!MSNT`3xskU_q*JE(9~?B!*x_OtS109$I6v2MT*g$c)#?LNn3r8(97FA1#w4 z5y8moxY$?LoU*5SC^0)WE?bk7D(kdYs#Scp+SN0CkeD5kq*S3)X_v{^;o8Lh2i7aj z2WC~@?|o41_sI~vN^38a{cr#bL1NaaK{+`%!T*U_rwH{V;RGKiW}O}y%{rga8IAi+ z@&6jrt{ea4tu`QrAhARsKy5&{G%-#40k0*AJOv_R8vpTF0000Px$0!c(cR5*>rlr0XzKoEsL2#z2L2f#E{AnH&U1VNBsH~j%aW^0m)t&BZ|!i-18(v&U^>F=E@wAnqZykwK4$X zVgUfVKLzeyneUqVqDZ>7TJNKct5<5S%y&)K9a*aqQg660OLX%nSo+b&l|VcbvX?qV z-%GaYm6{iwzW4X5UbRL|06hLRA>~D= 250) - { - Projectile.alpha = 255; - Projectile.localAI[0] = 1f; - } - } - else if (Projectile.localAI[0] == 1f) - { - Projectile.scale += 0.01f; - Projectile.alpha -= 15; - if (Projectile.alpha <= 0) - { - Projectile.alpha = 0; - Projectile.localAI[0] = 0f; - } - } - Projectile.localAI[1] += 1f; - if (Projectile.localAI[1] == 3f) - { - for (int l = 0; l < 12; l++) - { - Vector2 rotation = Vector2.UnitX * (float)-(float)Projectile.width / 2f; - rotation += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default) * new Vector2(8f, 16f); - rotation = rotation.RotatedBy((double)(Projectile.rotation - 1.57079637f), default); - int dusty = Dust.NewDust(Projectile.Center, 0, 0, DustID.ShadowbeamStaff, 0f, 0f, 160, default, 1f); - Main.dust[dusty].scale = 1.1f; - Main.dust[dusty].noGravity = true; - Main.dust[dusty].position = Projectile.Center + rotation; - Main.dust[dusty].velocity = Projectile.velocity * 0.1f; - Main.dust[dusty].velocity = Vector2.Normalize(Projectile.Center - Projectile.velocity * 3f - Main.dust[dusty].position) * 1.25f; - } - } - } - - public override Color? GetAlpha(Color lightColor) - { - if (Projectile.timeLeft < 85) - { - byte b2 = (byte)(Projectile.timeLeft * 3); - byte a2 = (byte)(100f * ((float)b2 / 255f)); - return new Color((int)b2, (int)b2, (int)b2, (int)a2); - } - return new Color(255, 255, 255, 100); - } - - public override bool OnTileCollide(Vector2 oldVelocity) - { - Projectile.penetrate--; - if (Projectile.penetrate <= 0) - { - Projectile.Kill(); + Projectile.velocity.Y += 0.04f; + if (Projectile.velocity.Y > 0) + Projectile.velocity.X *= 0.99f; } else { - if (Projectile.velocity.X != oldVelocity.X) - { - Projectile.velocity.X = -oldVelocity.X; - } - if (Projectile.velocity.Y != oldVelocity.Y) - { - Projectile.velocity.Y = -oldVelocity.Y; - } + Projectile.velocity.Y += 0.06f; + if (Projectile.velocity.Y > 0) + Projectile.velocity.X *= 0.985f; } + if (Projectile.timeLeft > 60) + { + Vector2 dustVel = (Projectile.rotation - MathHelper.PiOver2).ToRotationVector2().RotatedByRandom(0.05f) * Main.rand.NextFloat(0.1f, 0.3f); + Dust dust = Dust.NewDustPerfect(Projectile.Center, 278, dustVel); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(0.4f, 0.5f); + dust.color = Color.Magenta; + dust.noLightEmittence = true; + } + } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + float minMult = 0.4f; + int hitsToMinMult = 3; + float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); + modifiers.SourceDamage *= damageMult; + + Projectile.velocity = Utils.DirectionTo(target.Center, Projectile.Center).RotatedByRandom(0.2f) * 7; + Projectile.velocity.X *= 0.2f; + Projectile.velocity.Y *= 1.2f; + + for (int i = 0; i < 8; i++) + { + Dust c = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType()); + c.velocity = (MathHelper.TwoPi * i / 8f).ToRotationVector2().RotatedBy(MathHelper.PiOver4) * 4.5f * (i % 2 == 0 ? 0.78f : 1f); + c.scale = Main.rand.NextFloat(0.6f, 0.7f) * (i % 2 == 0 ? 2.2f : 1.8f); + c.noGravity = true; + c.color = Color.Magenta; + c.noLightEmittence = true; + } + } + public override bool OnTileCollide(Vector2 oldVelocity) + { + if (Projectile.numHits == 0) + Projectile.numHits = 1; + if (Projectile.velocity.X != oldVelocity.X) + { + Projectile.velocity.X = -oldVelocity.X; + } + if (Projectile.velocity.Y != oldVelocity.Y) + { + Projectile.velocity.Y = -oldVelocity.Y; + } + Projectile.velocity *= 0.92f; + for (int i = 0; i < Main.maxNPCs; i++) + Projectile.localNPCImmunity[i] = 0; return false; } - + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 30, targetHitbox); public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); + Asset tex = ModContent.Request(Texture); + Color drawColor = Color.Magenta; + float fade = Utils.GetLerpValue(0, 90, Projectile.timeLeft, true); + + for (int i = 0; i < 8; i++) + { + Vector2 drawOffset = (MathHelper.TwoPi * i / 8f).ToRotationVector2() * 2f; + Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition + drawOffset, null, drawColor with { A = 0 } * 0.4f * (float)Math.Pow(fade, 3), Projectile.rotation, tex.Size() * 0.5f, Projectile.scale, SpriteEffects.None); + } + Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition, null, Color.White * fade, Projectile.rotation, tex.Size() * 0.5f, Projectile.scale, SpriteEffects.None); return false; } } diff --git a/Projectiles/Rogue/LuxorsGiftRogue.png b/Projectiles/Rogue/LuxorsGiftRogue.png index 2ffc26c9c7415ba6e215dfc0b3ea206f180e5777..c64245ed6534c8a502eb85a21f9a3f3f71bcfff9 100644 GIT binary patch literal 663 zcmV;I0%-k-P)Px#1ZP1_K>z@;j|==^1poj7CrLy>R9HvtSglXPKpeec$WW**FbIaB2EmXS1V|*a z1c_rnFq=Z4HnRZ3AqkdA+TZD2YacLw&udC=+ZX~N~o!h&$iVSo>N~hAfh&8-(G7jbbPMQ;Xj9Gb{-{m-axfV z672Uz67D#~ceK^U0LV`nV-#^GqTfJYS_zLYei0m>|IfK?phrAzcf64=pM&eIN>4H^ zT1AX|T*{$MugLV7qlm}do8zFobp-BJ2?1Zr?A#M37gan;KbHxc1UZtQ+x3 z4RNjRp#;AbvR*7!FTnN98L<32zg3fJJSHBIsUeu2+`}yReC!M?(?a~GCcdd5j@2U+ zVJd<=!qnu|XiOEMN4VzFGtv{Xe-NUlhy>r5UZFR-RY1ZRMM6&`{V|9uER0bkG<1Do zjR}M3r^Y>3adv#%;dOiJC=vbC=<^Mnap--_&*ipzMD!JLq4zc1+k}8IiiAeY>WEU` xWUCi=**7yr0000EWmrjOO-%qQ00008000000002eQPx$OG!jQR7i=vmaR?$K@^3*B~=(+gBO4%ML~k8M4)TxAmES$iGxsAgISG;@KR}Ulp1*-=l7KN*z>GB zDyNPVdwuzp=Qmt=EVL8|S1RhQJbh)_a7d*>N@KlIKNYc{_twdIT`v{t8Q#T|XWvn( zue@wOcF%pKrKqP^-b$JJ?Cs=b<63=Nd577?bL#z92q{bLaT-ri&*RvC$KjCb6`otC vo?`U?-#MO6u7SK#QGW+ "Projectiles.Summon"; private int dust = 3; - + public NPC targeted; + public int attackTime = 0; public override void SetStaticDefaults() { - ProjectileID.Sets.MinionTargettingFeature[Type] = true; ProjectileID.Sets.TrailCacheLength[Type] = 10; ProjectileID.Sets.TrailingMode[Type] = 1; } @@ -21,96 +26,85 @@ namespace CalamityMod.Projectiles.Summon public override void SetDefaults() { Projectile.width = 14; - Projectile.height = 14; - Projectile.netImportant = true; + Projectile.height = 46; Projectile.friendly = true; - Projectile.ignoreWater = true; - Projectile.minionSlots = 0f; - Projectile.timeLeft = 180000; - Projectile.penetrate = -1; - Projectile.tileCollide = false; - Projectile.timeLeft *= 5; - Projectile.minion = true; + Projectile.penetrate = -1; // 3 + Projectile.timeLeft = 600; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; - Projectile.DamageType = DamageClass.Summon; + Projectile.extraUpdates = 2; + Projectile.tileCollide = false; } - public override void AI() { - Player player = Main.player[Projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); - if (dust > 0) - { - int dustAmt = 36; - for (int i = 0; i < dustAmt; i++) - { - Vector2 rotate = Vector2.Normalize(Projectile.velocity) * new Vector2((float)Projectile.width / 2f, (float)Projectile.height) * 0.75f; - rotate = rotate.RotatedBy((double)((float)(i - (dustAmt / 2 - 1)) * 6.28318548f / (float)dustAmt), default) + Projectile.Center; - Vector2 faceDirection = rotate - Projectile.Center; - int dust = Dust.NewDust(rotate + faceDirection, 0, 0, DustID.TerraBlade, faceDirection.X * 1.75f, faceDirection.Y * 1.75f, 100, default, 1.1f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity = faceDirection; - } - dust--; - } - if (Projectile.localAI[0] == 0f) - { - Projectile.scale -= 0.01f; - Projectile.alpha += 15; - if (Projectile.alpha >= 250) - { - Projectile.alpha = 255; - Projectile.localAI[0] = 1f; - } - } - else if (Projectile.localAI[0] == 1f) - { - Projectile.scale += 0.01f; - Projectile.alpha -= 15; - if (Projectile.alpha <= 0) - { - Projectile.alpha = 0; - Projectile.localAI[0] = 0f; - } - } - - bool isMinion = Projectile.type == ModContent.ProjectileType(); - if (isMinion) - { - if (!modPlayer.luxorsGift || player.dead) - { - Projectile.Kill(); - } - } - - Projectile.ChargingMinionAI(700f, 1000f, 2200f, 150f, 0, 40f, 9f, 4f, new Vector2(0f, -60f), 40f, 9f, true, true); - + Lighting.AddLight(Projectile.Center, Color.Lime.ToVector3() * 0.35f); Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; - } + if (targeted == null || !targeted.active || targeted.life <= 0) + targeted = Projectile.Center.ClosestNPCAt(500); + if (targeted != null && attackTime == 0) + { + CalamityUtils.HomeInOnSelectedNPC(Projectile, targeted, true, 0.8f, 12, 0.93f, 0.99f); + } + if (attackTime > 0) + { + attackTime--; + Projectile.velocity = Projectile.velocity.RotatedBy(0.09f * (Projectile.numHits % 2 == 0 ? -1 : 1)); + if (Projectile.velocity.Length() < 12) + Projectile.velocity *= 1.025f; + } + if (Projectile.timeLeft % 2 == 0) + { + bool sparkly = Main.rand.NextBool(3); + Vector2 dustVel = -(Projectile.rotation - MathHelper.PiOver2).ToRotationVector2().RotatedByRandom(0.5f) * Main.rand.NextFloat(0.8f, 1.3f); + Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(8, 8), sparkly ? 278 : ModContent.DustType(), dustVel * Main.rand.NextFloat(0.5f, 1.2f)); + dust.noGravity = !sparkly; + dust.scale = Main.rand.NextFloat(0.45f, 0.6f) * (sparkly ? 1.6f : 1); + dust.color = Color.Lime; + dust.noLightEmittence = true; + dust.velocity *= (sparkly ? 1 : 8); + } + + Particle spark = new CustomSpark(Projectile.Center - Projectile.velocity * 0.5f, -Projectile.velocity * 0.01f, "CalamityMod/Particles/BloomCircle", false, 9, 0.18f, Color.Lime * 0.7f, new Vector2(0.9f, 1.2f), true, false, 0.4f); + GeneralParticleHandler.SpawnParticle(spark); + } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - modifiers.DisableCrit(); - if (!Collision.CanHit(Projectile, Main.player[Projectile.owner])) - modifiers.SourceDamage *= 0.75f; // Minion deals 75% damage if it doesn't have line of sight with its owner - } + float minMult = 0.5f; + int hitsToMinMult = 3; + float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); + modifiers.SourceDamage *= damageMult; - public override Color? GetAlpha(Color lightColor) - { - if (Projectile.timeLeft < 85) + attackTime = 45; + + if (Projectile.numHits >= 2) { - byte b2 = (byte)(Projectile.timeLeft * 3); - byte a2 = (byte)(100f * ((float)b2 / 255f)); - return new Color((int)b2, (int)b2, (int)b2, (int)a2); + for (int i = 0; i < 12; i++) + { + Vector2 dustVel = -(Projectile.rotation - MathHelper.PiOver2).ToRotationVector2().RotatedByRandom(0.8f) * Main.rand.NextFloat(6f, 14f); + Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(8, 8), ModContent.DustType(), dustVel); + dust.noGravity = Main.rand.NextBool(); + dust.scale = Main.rand.NextFloat(0.65f, 1.2f); + dust.color = Color.Lime; + dust.noLightEmittence = true; + } } - return new Color(255, 255, 255, 100); } - + public override bool? CanHitNPC(NPC target) => (targeted != null && target == targeted && attackTime == 0) ? null : false; + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 8, targetHitbox); public override bool PreDraw(ref Color lightColor) { - var dye = Main.player[Projectile.owner]?.cMinion ?? 0; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2, armorShaderToUse: dye); + Asset tex = ModContent.Request(Texture); + Color drawColor = Color.Lime; + float fade = Utils.GetLerpValue(0, 90, Projectile.timeLeft, true); + + + for (int i = 0; i < 8; i++) + { + Vector2 drawOffset = (MathHelper.TwoPi * i / 8f).ToRotationVector2() * 2f; + Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition + drawOffset, null, drawColor with { A = 0 } * 0.4f * (float)Math.Pow(fade, 3), Projectile.rotation, tex.Size() * 0.5f, Projectile.scale, SpriteEffects.None); + } + Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition, null, Color.White * fade, Projectile.rotation, tex.Size() * 0.5f, Projectile.scale, SpriteEffects.None); return false; } } diff --git a/Projectiles/Summon/LuxorsGiftSummon.png b/Projectiles/Summon/LuxorsGiftSummon.png index 0c2d362ed38114b8d688657ee086a9e03f577770..8a4c550a8074019b3df8a0d082a7357bb329021c 100644 GIT binary patch delta 500 zcmVPx#1ZP1_K>z@;j|==^ z1poj6kx4{BR7gv;mAy&>K@^2=OqvB#rZNyjQyCDo5UcnAqJ=@ML<07frdorAcD{jN zD)FcB4N?UgMMx?Y38XSMCc@fC%$%9KhKWOPX7j<}%q}||=6}weofv6&$JA3p5R_=> z8^MI~e`8GiJh;U3w41TdG2gbz(xfk&8}N4)P`G zg>$Sk`Zc!b6!Ko4AWCjZDWXflF<*6U&8i9QxS5oYq zAanH&pXxT@ChV)qr-9*Ww!c!43G2id9qyxQP5%xrGPOOpS1rPsVC_Q=%Ih$PeXKuV zkSQ<2zx_#goce$7K6*0aka%6?TL^27mocWazYA}vWNjUXs_O8Kl#`nqCfBFo&Q%>w zWCrd+;NMDjO*Bsw)&8wGrE{+kGls+wjDKRQ@dh#0iROLOQRkLVlVu{&58S$gf%)E9 qwg3PC4rN$LW=%~1DgXcg2mk;800000(o>TF0000Px$KuJVFR7i=j0>SE5} zJndaul_Z7!mkaOR<9B)YeiHo6wRN4UZ3qQF_j`Ty zQj9p|oZ- "Projectiles.Typeless"; + public Player Owner => Main.player[Projectile.owner]; + public CalamityPlayer moddedOwner => Owner.Calamity(); + public Color usedColor = Color.White; + public DamageClass lastDamageClass = null; + public ref float time => ref Projectile.ai[0]; + public ref float attackTimer => ref Projectile.ai[1]; + public ref float idleTimer => ref Projectile.localAI[0]; + public int classType = 0; // 0 = Classless, 1 = Melee, 2 = Ranged, 3 = Mage, 4 = Summoner, 5 = Rogue + public Vector2 tipPosition => Projectile.Center + (Projectile.rotation - MathHelper.PiOver2).ToRotationVector2() * 15; + + public float fxFade = 0; // The glow visuals multiplier + public float postFireBoost = 0; // The glow increases right when you fire, then quickly fades + public float followSpeed = 6; // The speed Luxor follows you, lower is faster + public bool rogueChain = true; // Used for rogue's double projectile shot + public override void SetDefaults() + { + Projectile.width = 114; + Projectile.height = 38; + Projectile.ignoreWater = true; + Projectile.timeLeft = 300; + Projectile.tileCollide = false; + Projectile.friendly = true; + Projectile.penetrate = -1; + } + + public override void AI() + { + Color classColor = Color.White; + DamageClass itemClass = Owner.HeldItem.DamageType; + if (itemClass == null) + { + Projectile.Kill(); + return; + } + else if (itemClass.CountsAsClass()) + { classColor = Color.Red; classType = 1; } + else if (itemClass.CountsAsClass()) + { classColor = Color.Cyan; classType = 2; } + else if (itemClass.CountsAsClass()) + { classColor = Color.Gold; classType = 3; } + else if (itemClass.CountsAsClass()) + { classColor = Color.Lime; classType = 4; } + else if (itemClass.CountsAsClass()) + { classColor = Color.Magenta; classType = 5; } + else + { classColor = Color.Gray; classType = 0; }; + + if (time == 0 || itemClass != lastDamageClass) + { + Projectile.netUpdate = true; + attackTimer = 60; // 60 frame attack delay on spawn or swapping class weapons + } + lastDamageClass = itemClass; + + float rate = Main.GlobalTimeWrappedHourly * 7; + List eColors = new List() + { + Color.Lerp(classColor, Color.White, 0.15f), + Color.Lerp(classColor, Color.Black, 0.15f) + }; + + int colorIndex = (int)(rate / 2 % eColors.Count); + Color currentColor = eColors[colorIndex]; + Color nextColor = eColors[(colorIndex + 1) % eColors.Count]; + usedColor = Color.Lerp(currentColor, nextColor, rate % 2f > 1f ? 1f : rate % 1f); + + Projectile.velocity = Utils.DirectionTo(Projectile.Center, Owner.Calamity().mouseWorld); + + Vector2 destination = Vector2.Lerp(Owner.Center - Projectile.velocity * (70 + 100 * Utils.GetLerpValue(0, 110, attackTimer, true)), Owner.Center + Vector2.UnitY * -40, Utils.GetLerpValue(280, 300, idleTimer, true)); + Projectile.velocity = (destination - Projectile.Center) / followSpeed; + + Projectile.rotation = Utils.DirectionTo(Projectile.Center, Owner.Calamity().mouseWorld).ToRotation() + MathHelper.PiOver2; + + fxFade = (float)Math.Pow(Utils.GetLerpValue(30, 0, attackTimer, true), 3) + postFireBoost; + + if (idleTimer >= 280) + { + if (moddedOwner.luxorHit) + { + if (idleTimer > 320) + idleTimer = 320; + idleTimer -= 1; + } + else + { + fxFade = 1; + attackTimer = 40; + } + } + else + { + + } + + if (attackTimer == 0 && moddedOwner.luxorHit) + { + int attackSpeed = 0; + int attackDamage = 0; + int projType = 0; + switch (classType) + { + case 0: attackSpeed = LuxorsGift.classlessAttackSpeed; attackDamage = LuxorsGift.classlessDamage; projType = ModContent.ProjectileType(); break; + case 1: attackSpeed = LuxorsGift.meleeAttackSpeed; attackDamage = LuxorsGift.meleeDamage; projType = ModContent.ProjectileType(); break; + case 2: attackSpeed = LuxorsGift.rangedAttackSpeed; attackDamage = LuxorsGift.rangedDamage; projType = ModContent.ProjectileType(); break; + case 3: attackSpeed = LuxorsGift.magicAttackSpeed; attackDamage = LuxorsGift.magicDamage; projType = ModContent.ProjectileType(); break; + case 4: attackSpeed = LuxorsGift.summonerAttackSpeed; attackDamage = LuxorsGift.summonerDamage; projType = ModContent.ProjectileType(); break; + case 5: attackSpeed = LuxorsGift.rogueAttackSpeed; attackDamage = LuxorsGift.rogueDamage; projType = ModContent.ProjectileType(); break; + } + float powerMult = Utils.GetLerpValue(-120, 140, attackSpeed, true); // An intensity multiplier based on the fire rate of the mode + if (Main.zenithWorld) // Just like old times + { + attackSpeed = 0; + attackDamage = Math.Max(1, (int)(Owner.HeldItem.damage * Utils.Remap(Owner.HeldItem.useAnimation, 3, 120, 0.025f, 1f, false))); + } + + for (int i = 0; i < (int)(20 * powerMult); i++) // Firing dust + { + Vector2 dustVel = (Projectile.rotation - MathHelper.PiOver2).ToRotationVector2().RotatedByRandom(0.5f) * 12 * powerMult; + Dust dust = Dust.NewDustPerfect(tipPosition, ModContent.DustType(), dustVel * Main.rand.NextFloat(0.5f, 1.2f)); + dust.noGravity = !Main.rand.NextBool(3); + dust.scale = Main.rand.NextFloat(0.75f, 1.4f) * powerMult; + dust.color = usedColor; + dust.noLightEmittence = true; + } + if (classType == 1) // Melee shotgun + { + for (int i = -1; i <= 1; i++) + { + Projectile proj = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), tipPosition, Utils.DirectionTo(tipPosition, Owner.Calamity().mouseWorld).RotatedBy(-0.12f * i * Main.rand.NextFloat(0.7f, 1f)) * (12 - Main.rand.NextFloat(0f, 0.6f) - Math.Abs(i)), projType, (int)(Owner.GetDamage(itemClass).ApplyTo(attackDamage)), 0f, Owner.whoAmI); + proj.ArmorPenetration = LuxorsGift.luxArmorPen; + } + for (int i = 0; i < 5; i++) // These are visual + { + Projectile proj = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), tipPosition, Utils.DirectionTo(tipPosition, Owner.Calamity().mouseWorld).RotatedByRandom(0.4f) * (12 - Main.rand.NextFloat(2f, 5f)), projType, (int)(Owner.GetDamage(itemClass).ApplyTo(attackDamage)), 0f, Owner.whoAmI, 5); + proj.timeLeft = 95; + } + } + else // Everything else + { + Projectile proj = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), tipPosition, Utils.DirectionTo(tipPosition, Owner.Calamity().mouseWorld) * 12, projType, (int)(Owner.GetDamage(itemClass).ApplyTo(attackDamage)), 0f, Owner.whoAmI); + proj.ArmorPenetration = LuxorsGift.luxArmorPen; + if (classType == 5) // Rogue has gravity so velocity is adjusted a bit + proj.velocity.Y -= 1.5f; + } + + SoundStyle blam = new("CalamityMod/Sounds/Item/GunShotSmall"); + SoundEngine.PlaySound(blam with { Volume = 0.35f, Pitch = Main.rand.NextFloat(0.6f, 0.8f) }, tipPosition); + SoundEngine.PlaySound(SoundID.DD2_WitherBeastCrystalImpact with { Volume = 0.7f, Pitch = 0.2f }, tipPosition); + + if (classType == 5 && rogueChain) + { + rogueChain = false; + attackTimer = attackSpeed / 3; + } + else + { + attackTimer = attackSpeed; + moddedOwner.luxorHit = false; + if (!CalamityClientConfig.Instance.Photosensitivity) + postFireBoost = 1.7f; + idleTimer = 0; + rogueChain = true; + } + Projectile.netUpdate = true; + } + if (attackTimer > 0) + attackTimer--; + if (postFireBoost > 0) // Quickly fade out the increased poost fire visuals + postFireBoost -= 0.2f; + + if (time % 2 == 0 && false) + { + Vector2 dustVel = new Vector2(10, 10).RotatedByRandom(100); + Dust dust = Dust.NewDustPerfect(Owner.Center + dustVel, ModContent.DustType(), dustVel * Main.rand.NextFloat(0.1f, 0.4f)); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(0.5f, 0.7f); + dust.color = usedColor; + dust.noLightEmittence = true; + } + + float idleFade = Utils.GetLerpValue(280, 300, idleTimer, true); + Lighting.AddLight(tipPosition, Color.Lerp(usedColor, Color.Lerp(usedColor, Color.White, 0.5f), idleFade).ToVector3() * (0.5f * MathHelper.Lerp(fxFade, 1, 0.55f) + 0.35f * idleFade)); + + if (moddedOwner.luxorsGift) + Projectile.timeLeft++; + else + Projectile.Kill(); + if (Owner.dead) + Projectile.Kill(); + + time++; + if (!moddedOwner.luxorHit) + idleTimer++; + } + public override bool PreDraw(ref Color lightColor) + { + Asset tex = ModContent.Request(Texture); + Texture2D bTexture = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; + Texture2D cTexture = ModContent.Request("CalamityMod/Particles/Light").Value; + float idleFade = (float)Math.Pow(Utils.GetLerpValue(280, 300, idleTimer, true), 5); + Color drawColor = usedColor; + Color bodyColor = Color.Lerp(lightColor, Color.Gold with { A = 0 }, idleFade); + float drawMult = Math.Max(idleFade, fxFade); + + if (idleFade == 0) + { + for (int i = 0; i < 18; i++) // Backglow + { + Vector2 drawOffset = (MathHelper.TwoPi * i / 18f).ToRotationVector2() * 6 * drawMult; + Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition + drawOffset, null, drawColor with { A = 0 } * 0.2f * drawMult, Projectile.rotation, tex.Size() * 0.5f, Projectile.scale, SpriteEffects.None); + } + } + // Main body + Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition, null, bodyColor * (1 - idleFade), Projectile.rotation, tex.Size() * 0.5f, new Vector2(1 - 0.85f * idleFade, 1f) * Projectile.scale, SpriteEffects.None); + for (int i = 0; i < 4; i++) // Glow orb + { + Main.EntitySpriteDraw(bTexture, Vector2.Lerp(tipPosition, Projectile.Center, idleFade) - Main.screenPosition, null, drawColor with { A = 0 } * 0.35f * drawMult, time * 0.13f * (i + 1), bTexture.Size() * 0.5f, new Vector2(1 + i * 0.15f, i - 0.3f * i) * Projectile.scale * MathHelper.Lerp(0.33f, 0.22f, idleFade) * drawMult, SpriteEffects.None); + } + // Glow orb center + Main.EntitySpriteDraw(cTexture, Vector2.Lerp(tipPosition, Projectile.Center, idleFade) - Main.screenPosition, null, Color.White with { A = 0 } * 0.75f * drawMult, Projectile.rotation, cTexture.Size() * 0.5f, Projectile.scale * MathHelper.Lerp(0.4f, 0.3f, idleFade) * drawMult, SpriteEffects.None); + return false; + } + public override bool? CanDamage() => false; + } +} diff --git a/Projectiles/Typeless/Luxor.png b/Projectiles/Typeless/Luxor.png new file mode 100644 index 0000000000000000000000000000000000000000..6962d76a0d7e0ec4e8f5fc839df117cfaa1a1c6c GIT binary patch literal 4297 zcmV;)5H|0LP)f6 zXi@@54ZTQ_E-Enz5K6$103tR-RB%L5k){YTDBysjLy@r}iiH7DvFijGMAUI`6dRUF zWUU$Bym{}eS9UO(Z2>7`&z9wUXbV-Il#&6`Y8GKGQ04S2&F6MJnWNa;Ck|;8QE#r9r;7G||@X{|> z%+C|c55>;RS}qbKr-&IQTvLXPlM{>K&(BTgi^a?^4mXV>;xX8n8Ce|RasXz}{8imI52H3ZN4bfe_i~WlJ|C&UW9+{8AKoW!}eExnGFE2re(F+`iE_46#!l9 z0Z_aBhs|Iw0E)7{bq;-T9=d#9QpDmcXDh4R++0fmpKB>E=%LdZt9g$j;($`3&Zthxi`{{&gM}5&R^+h%b~yM9Zd3AWW9ETgVfL z1(`yIK=_}U_z%PWq}jQaiQ4!P(3V&Nr6C$XejWfQDiI(Fdt@un?|lo#M+5oIi_w{w zo%_#%{(V=tO#a9gB!7-$M?^BX5>d|Vn*3S!?g~$*UQipUPL&zMmg;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~X(SK=*Nx?1YrE1vr1z;T#Ac`yWWj0!@+vT5WxM z5CAhCIL(>y)Nlb!(&dYqW8ash3c%S)6T(`o`uEf7@fpRj0QJ5d536j)TL7g1vP=CA zq$Hp|*@2ZM$a2+@sz==bS)kUs?R%2qudiDTqzB|+$6+9y=36BtJ62j273Ste+N*yJ zzIItFwAQEgR=++x_C4Eg-xou&0Hpx3OZ^t)+{r~L=)R1w%CsTskR%WqIGu_0Oqs}0sH{11axCTXKcKpcYlnO&$OMkT#}XgCWO^Pv)u&Qu?S*#ZDQx>{(Ut3p_21Wz&$!<3R<_&fh>a)Tm3zTGqKC51T%31Dh zlU)6pfEMVh)o$Q-u5rsDZ7^6%RnlZF^hkXb0NeJrMxN`7kpxf*AO{*qNyk1)`)xAh zYnTP70g}c1^S%e5EKJJ;0T941cCQ4|6GGOfiK2m4909m#(vsMC>Yw5y0oA`0wbuvK zH}Pem>R-0UaslK(1u5AB*(V>lG`5@os^bE`rOF-i_>u)XP`(4{{Rh5`+$*jC+J(1( z&a7^Tyf?1s#@P6F!@<{10asjsQF-4o;=nnAe z2i<1&cW=4PYztJNWRTY$d$1@zFdhI0x~3Lpc>-jxre)cNwR$o;7f zxA5Lu>yDvhl}huq1*c;p9VclEPs<{KtbE7)FnVzAv`9Teo|qiD4hNor7Z*xa-N0KzEDJ`^s7M z58FQkg0*&20C{%mGaw}k)Jg+rE!A3_tXkHoWXM;}COt{@_Z5Ir02x63w-Qh*ZH;A` rWC&EY<+W94)z<(@0i>t=`3CZDfmfrO1)WEV00000NkvXXu0mjf)$tZ2 literal 0 HcmV?d00001 diff --git a/Projectiles/Typeless/LuxorsGiftClassless.cs b/Projectiles/Typeless/LuxorsGiftClassless.cs new file mode 100644 index 0000000000..79ba8f85d7 --- /dev/null +++ b/Projectiles/Typeless/LuxorsGiftClassless.cs @@ -0,0 +1,94 @@ +using System; +using CalamityMod.Dusts; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class LuxorsGiftClassless : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Typeless"; + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Type] = 10; + ProjectileID.Sets.TrailingMode[Type] = 1; + } + public override void SetDefaults() + { + Projectile.width = 30; + Projectile.height = 38; + Projectile.friendly = true; + Projectile.penetrate = -1; + Projectile.timeLeft = 300; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + Projectile.extraUpdates = 6; + Projectile.tileCollide = false; + } + public override void AI() + { + Lighting.AddLight(Projectile.Center, Color.White.ToVector3() * 0.35f); + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + + if (Projectile.timeLeft < 294) + { + Particle spark = new GlowSparkParticle(Projectile.Center - Projectile.velocity, -Projectile.velocity * 0.3f, false, 18, 0.03f * (1 + Utils.GetLerpValue(270, 300, Projectile.timeLeft, true)), Color.Gray * 0.45f, new Vector2(1.1f * (1 + Utils.GetLerpValue(270, 300, Projectile.timeLeft, true)), 1.3f), true, false, 0.3f); + GeneralParticleHandler.SpawnParticle(spark); + } + } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + float minMult = 0.1f; + int hitsToMinMult = 7; + float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); + modifiers.SourceDamage *= damageMult; + + for (int i = 0; i < Math.Max(6 - Projectile.numHits, 1); i++) + { + Particle spark = new GlowSparkParticle(Projectile.Center, Projectile.velocity.RotatedByRandom(0.5f), false, 8, 0.02f, Color.White * 0.75f, new Vector2(0.8f, 1.3f), true, false, 1f); + GeneralParticleHandler.SpawnParticle(spark); + + for (int y = 0; y < 2; y++) + { + SparkParticle spark2 = new SparkParticle(Projectile.Center, Projectile.velocity.RotatedByRandom(0.5f) * Main.rand.NextFloat(0.8f, 1.3f), false, 35, 0.5f, Color.White); + GeneralParticleHandler.SpawnParticle(spark2); + } + } + } + public override bool OnTileCollide(Vector2 oldVelocity) + { + if (Projectile.velocity.X != oldVelocity.X) + { + Projectile.velocity.X = -oldVelocity.X; + } + if (Projectile.velocity.Y != oldVelocity.Y) + { + Projectile.velocity.Y = -oldVelocity.Y; + } + return false; + } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 20, targetHitbox); + public override bool PreDraw(ref Color lightColor) + { + Asset tex = ModContent.Request(Texture); + Color drawColor = Color.Gray; + float fade = Utils.GetLerpValue(0, 90, Projectile.timeLeft, true); + + + for (int i = 0; i < 8; i++) + { + Vector2 drawOffset = (MathHelper.TwoPi * i / 8f).ToRotationVector2() * 2f; + Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition + drawOffset, null, drawColor with { A = 0 } * 0.4f * (float)Math.Pow(fade, 3), Projectile.rotation, tex.Size() * 0.5f, Projectile.scale, SpriteEffects.None); + } + Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition, null, Color.White * fade, Projectile.rotation, tex.Size() * 0.5f, Projectile.scale, SpriteEffects.None); + //CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); + return false; + } + } +} diff --git a/Projectiles/Typeless/LuxorsGiftClassless.png b/Projectiles/Typeless/LuxorsGiftClassless.png new file mode 100644 index 0000000000000000000000000000000000000000..923a4e34aae118c1818618de25bb8fb3554d9ba0 GIT binary patch literal 3405 zcmV-T4YKlyP)f6 zXi@@54ZTQ_E-Enz5K6$103tR-RB%L5k){YTDBysjLy@r}iiH7DvFijGMAUI`6dRUF zWUU$Bym{}eS9UO(Z2>7`&z9wUXbV-Il#&6`Y8GKGQ04S2&F6MJnWNa;Ck|;8QE#r9r;7G||@X{|> z%+C|c55>;RS}qbKr-&IQTvLXPlM{>K&(BTgi^a?^4m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