From b643db56337b72ee86e3e33b086901baa72471e2 Mon Sep 17 00:00:00 2001 From: Memes <114233643+Mr-Memes@users.noreply.github.com> Date: Fri, 14 Jul 2023 15:45:46 +0200 Subject: [PATCH 1/4] Added Astral Vengeance. --- Buffs/Summon/AstralVengeanceBuff.cs | 35 +++ Buffs/Summon/AstralVengeanceBuff.png | Bin 0 -> 557 bytes CalPlayer/CalamityPlayer.cs | 2 + .../Lasers/AstralVengeanceBeamEnd.png | Bin 0 -> 631 bytes .../Lasers/AstralVengeanceBeamMiddle.png | Bin 0 -> 576 bytes .../Lasers/AstralVengeanceBeamStart.png | Bin 0 -> 589 bytes Items/Weapons/Summon/AstralVengeance.cs | 58 ++++ Items/Weapons/Summon/AstralVengeance.png | Bin 0 -> 886 bytes .../en-US/Mods.CalamityMod.Buffs.hjson | 5 + ...ods.CalamityMod.Items.Weapons.Summon.hjson | 5 + .../Mods.CalamityMod.Projectiles.Summon.hjson | 4 +- Projectiles/Summon/AstralVengeanceBeam.cs | 88 ++++++ Projectiles/Summon/AstralVengeanceSummon.cs | 276 ++++++++++++++++++ Projectiles/Summon/AstralVengeanceSummon.png | Bin 0 -> 3387 bytes 14 files changed, 472 insertions(+), 1 deletion(-) create mode 100644 Buffs/Summon/AstralVengeanceBuff.cs create mode 100644 Buffs/Summon/AstralVengeanceBuff.png create mode 100644 ExtraTextures/Lasers/AstralVengeanceBeamEnd.png create mode 100644 ExtraTextures/Lasers/AstralVengeanceBeamMiddle.png create mode 100644 ExtraTextures/Lasers/AstralVengeanceBeamStart.png create mode 100644 Items/Weapons/Summon/AstralVengeance.cs create mode 100644 Items/Weapons/Summon/AstralVengeance.png create mode 100644 Projectiles/Summon/AstralVengeanceBeam.cs create mode 100644 Projectiles/Summon/AstralVengeanceSummon.cs create mode 100644 Projectiles/Summon/AstralVengeanceSummon.png diff --git a/Buffs/Summon/AstralVengeanceBuff.cs b/Buffs/Summon/AstralVengeanceBuff.cs new file mode 100644 index 0000000000..b7ff46674f --- /dev/null +++ b/Buffs/Summon/AstralVengeanceBuff.cs @@ -0,0 +1,35 @@ +using CalamityMod.CalPlayer; +using CalamityMod.Projectiles.Summon; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.Summon +{ + public class AstralVengeanceBuff : ModBuff + { + public override void SetStaticDefaults() + { + Main.buffNoTimeDisplay[Type] = true; + Main.buffNoSave[Type] = true; + //Main.persistentBuff[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + CalamityPlayer modPlayer = player.Calamity(); + if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) + { + modPlayer.astralVengeance = true; + } + if (!modPlayer.astralVengeance) + { + player.DelBuff(buffIndex); + buffIndex--; + } + else + { + player.buffTime[buffIndex] = 18000; + } + } + } +} diff --git a/Buffs/Summon/AstralVengeanceBuff.png b/Buffs/Summon/AstralVengeanceBuff.png new file mode 100644 index 0000000000000000000000000000000000000000..3fe4646b6c192e65ded5f709d182a159759e1110 GIT binary patch literal 557 zcmV+|0@D47P)Px$=Sf6CR9J=Ompe!UK@f(&h;|}Ti-@RTq47+mU>XrDl2Q;s#7B`Ti1sQ7K>~uY zSH#M~C?bep84DXN4A{xVG=hqd!Utk!5sS+t+$I+vMY8DMBsaG=v;RM{b91i7W*-1A zPuE#0h{k503!tWwK}*2}WB~>SqX78ZTWt$2?;Zg#Q`cUMc=C*o%S983=b#fk`HRS7jt)fLG1 zf%>L4pg5N*Gr_)@0ASJxmJQ(K@BR4!&_IEr4R}NActh*ob}$h?%hy9W1cFlpf>U2_ zpwcMn0|KYq7ubFPFxsE{&DDh9_^J*loRWY;9DNlK2xDO?%vGq2zYBd8kn<~y4wU<< zGEU6ZKA@uN3jDeg3cl)y+IPZy4af{9lg!BCApq&vcv%Nh{Z5eXCvR1Wlf2MvCUk-* zakH~vvr8_e`qf;Q>ibZbl9LzKwSEe8wHN@LD7hDg@}~4UI25JSNlK<-6;)Rt-v|17 vt#e%K9xA!;&wd%X+zlQ8Uf(kR^XvE%_2s74%FLJ*00000NkvXXu0mjf)a&`U literal 0 HcmV?d00001 diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index d414451302..2847fc2bba 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -979,6 +979,7 @@ namespace CalamityMod.CalPlayer public bool AresCannons = false; public bool celestialDragons = false; public bool KalandraMirror = false; + public bool astralVengeance = false; public List PendingProjectilesToRespawn = new List(); @@ -2017,6 +2018,7 @@ namespace CalamityMod.CalPlayer AresCannons = false; celestialDragons = false; KalandraMirror = false; + astralVengeance = false; disableVoodooSpawns = false; disablePerfCystSpawns = false; diff --git a/ExtraTextures/Lasers/AstralVengeanceBeamEnd.png b/ExtraTextures/Lasers/AstralVengeanceBeamEnd.png new file mode 100644 index 0000000000000000000000000000000000000000..86cf285cf16026fcbd17dcee166057c9495278fa GIT binary patch literal 631 zcmV--0*L*IP)EX>4Tx04R}tkvm8OK^TO;BuYdS3sZ<#ToJ7lL`AfdD2iYp#0b6$?=B_^xij2F zY%B%afQ667sD+KSwidR6Aou{WwXssP5jp=&0tsSVSoULfXV{$ue<5R9Ze1@}cFu`U zM6}ttc`f)tkY->QpKiL@==6Akn&a~hpIUEwR95YCe~#wlvTK4*6CN?MPEL49cyJ?^ zRlFx0GFSAZ@R@M8BNr5YP`Xj#SHKNBzO?ZrxOWUn!|60`4f#Qb49Zm4dfZ`KCE&y@AGsQg7vbPVONgT}@rX{sDBQ zC3~^PyBn%|`}a(_zaLc7a+^z{`h5TZ00v@9M??Vs00000GbeoW00009a7bBm001r{ z001r{0eGc9b^rhX2XskIMF-~x4FLcp%^5o<0001XNkl=Ofq{X6VXmhNBeFOX1D(OBg`*Y@ehXP(`3^n5P#eJPp}!AdB}%}{>;EAo z1a&Rg3^kX5;rGDAAtRAxEX>4Tx04R}tkvm8OK^TO;BuYdS3sZ<#ToJ7lL`AfdD2iYp#0b6$?=B_^xij2F zY%B%afQ667sD+KSwidR6Aou{WwXssP5jp=&0tsSVSoULfXV{$ue<5R9Ze1@}cFu`U zM6}ttc`f)tkY->QpKiL@==6Akn&a~hpIUEwR95YCe~#wlvTK4*6CN?MPEL49cyJ?^ zRlFx0GFSAZ@R@M8BNr5YP`Xj#SHKNBzO?ZrxOWUn!|60`4f#Qb49Zm4dfZ`KCE&y@AGsQg7vbPVONgT}@rX{sDBQ zC3~^PyBn%|`}a(_zaLc7a+^z{`h5TZ00v@9M??Vs00000GbeoW00009a7bBm001r{ z001r{0eGc9b^rhX2XskIMF-~x4FLf=E)6#Y0000#Nkl=Ofq{X6VXmhNBeFOX1D(OBg`*aZS~zOqsD+~zj#@YpECc{N#|J3qp-UqG O0000;0004kX+uL$Nkc;* zaB^>EX>4Tx04R}tkvm8OK^TO;BuYdS3sZ<#ToJ7lL`AfdD2iYp#0b6$?=B_^xij2F zY%B%afQ667sD+KSwidR6Aou{WwXssP5jp=&0tsSVSoULfXV{$ue<5R9Ze1@}cFu`U zM6}ttc`f)tkY->QpKiL@==6Akn&a~hpIUEwR95YCe~#wlvTK4*6CN?MPEL49cyJ?^ zRlFx0GFSAZ@R@M8BNr5YP`Xj#SHKNBzO?ZrxOWUn!|60`4f#Qb49Zm4dfZ`KCE&y@AGsQg7vbPVONgT}@rX{sDBQ zC3~^PyBn%|`}a(_zaLc7a+^z{`h5TZ00v@9M??Vs00000GbeoW00009a7bBm001r{ z001r{0eGc9b^rhX2XskIMF-~x4FLolfp "Items.Weapons.Summon"; + + public static float EnemyDetectionDistance = 1200f; + public static int IFrames = 10; + + // In frames. + public static float TimeBeforeCharging = 45f; + public static float TimeCharging = 60f; + public static float TimeShooting = 120f; + + public override void SetDefaults() + { + Item.damage = 185; + Item.useTime = Item.useAnimation = 30; + Item.knockBack = 4f; + Item.mana = 10; + Item.shoot = ModContent.ProjectileType(); + + Item.width = 42; + Item.height = 42; + Item.noMelee = true; + Item.autoReuse = true; + Item.Calamity().donorItem = true; + Item.DamageType = DamageClass.Summon; + Item.useStyle = ItemUseStyleID.Swing; + Item.UseSound = SoundID.Item15; + Item.rare = ModContent.RarityType(); + Item.value = CalamityGlobalItem.Rarity12BuyPrice; + } + + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + { + int minion = Projectile.NewProjectile(source, Main.MouseWorld, Main.rand.NextVector2Circular(2f, 2f), ModContent.ProjectileType(), damage, knockback, player.whoAmI); + + if (Main.projectile.IndexInRange(minion)) + Main.projectile[minion].originalDamage = Item.OriginalDamage; + + return false; + } + + public override void AddRecipes() + { + base.AddRecipes(); + } + } +} diff --git a/Items/Weapons/Summon/AstralVengeance.png b/Items/Weapons/Summon/AstralVengeance.png new file mode 100644 index 0000000000000000000000000000000000000000..0898fc0cca83b0da2b8d74a8c4761a3ff159542e GIT binary patch literal 886 zcmV-+1Bv{JP)Px&FiAu~R9J=Wn9WNRaTv!xqpRt<>uamFxkl2PmIX#ohoDFg1xZ8~qeGWS>Ykxs z5Gd85Q-yy(l3nu;Ee!u6L-wdC5 z-exq`StW(XP4^4j9sv4$-f)ylwOHrI{n1nXL)re~*$TNnpBI2T*Q*q#n-A}r`Y(|N zn?wzjmR$tEH`E6};*lHx=H8Ade$MOyWgQsR{R6Wzz$Ve{w6`<>@aS=!;`j7+gR;JMsYY3g|0dB$Nme(0cmY5~VVPo=Y?l~*+3Qv88;5A* zv=nDc1mMT~902x%F2yb+g`kl0Y|RFsuBizy-hewNf8+N0Fc>7IcL%%t0GzGTNqL4k zm5U^+&z-E$?TchP7VW-~0l-2;*W8&THtqIQ0D{3Or31;duYUeSS(ooG2cV|s834i1Hx1x>Xbi9r z(N$-?BQp;G&6WT_cs``q+uyYTMjaG6PhauwNdfUvhN1q>K2`R=bT<&qmh)@JdnCg1L&Fh0>J0NR^Wdk zx>AxmoVgmn^nx=C2FXa(kH0tFKjtdY0D5NvfI(7ZeWF4#BTetUw+zu`bu=1DnIDCu+vU*!e131_5r9E5H$F)N z7+#nK43g2vMU!=i3PF)0B^_8!QaVjWT6Rp5k(vvuX|P(7BFhlf9GQ8h|0Sc59G}$Z zOCcj~WM6_lmwpWCbE(OksV%*3wXz;jsgEMbZbwSGPGV*Ph)zVv=Ege!7+#o;d{Y~P zs7>l&b8DlL<)Yt_{N=Z3A2zDUy8bD&3{fpwCtB(QYmcq "Projectiles.Summon"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public override Texture2D LaserBeginTexture => ModContent.Request("CalamityMod/ExtraTextures/Lasers/AstralVengeanceBeamStart", AssetRequestMode.ImmediateLoad).Value; + public override Texture2D LaserMiddleTexture => ModContent.Request("CalamityMod/ExtraTextures/Lasers/AstralVengeanceBeamMiddle", AssetRequestMode.ImmediateLoad).Value; + public override Texture2D LaserEndTexture => ModContent.Request("CalamityMod/ExtraTextures/Lasers/AstralVengeanceBeamEnd", AssetRequestMode.ImmediateLoad).Value; + + public override float Lifetime => AstralVengeance.TimeShooting; + public override float MaxLaserLength => AstralVengeance.EnemyDetectionDistance * 2f; + public override float MaxScale => 1f; + + public float Opacity = .33f; + public override Color LightCastColor => Color.White * Opacity; + public override Color LaserOverlayColor => Color.White * Opacity; + + public ref float MinionID => ref Projectile.ai[1]; + public Projectile Minion => Main.projectile[(int)MinionID]; + public ref float TargetID => ref Projectile.ai[2]; + public NPC Target => Main.npc[(int)TargetID]; + + public override void SetStaticDefaults() => ProjectileID.Sets.MinionShot[Type] = true; + + public override void SetDefaults() + { + Projectile.localNPCHitCooldown = AstralVengeance.IFrames; + Projectile.timeLeft = (int)Lifetime; + Projectile.penetrate = -1; + + Projectile.width = Projectile.height = 20; + Projectile.alpha = 254; + Projectile.DamageType = DamageClass.Summon; + Projectile.usesLocalNPCImmunity = true; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.tileCollide = false; + } + + public override void ExtraBehavior() + { + Projectile.velocity = Minion.rotation.ToRotationVector2(); + + if (Target is null) + Projectile.Kill(); + + if (Main.rand.NextBool(4)) + { + SparkParticle energyEffect = new SparkParticle(Projectile.Center + Vector2.Lerp(Projectile.velocity, Projectile.velocity * MaxLaserLength, Main.rand.NextFloat(1f)) + Main.rand.NextVector2Circular(30f, 30f), + Projectile.velocity * Main.rand.NextFloat(8f, 12f), + false, + 20, + Main.rand.NextFloat(1f, 1.5f), + Color.Cyan); + GeneralParticleHandler.SpawnParticle(energyEffect); + } + + GenericBloom bloomEnergyEffect = new GenericBloom(Projectile.Center, + Minion.velocity, + Color.Cyan with { A = 6 }, + 0.6f, + (int)(Lifetime / 4f)); + GeneralParticleHandler.SpawnParticle(bloomEnergyEffect); + } + + public override void AttachToSomething() + { + Projectile.Center = Minion.Center; + if (Minion is null) + { + Projectile.Kill(); + Projectile.netUpdate = true; + } + } + } +} diff --git a/Projectiles/Summon/AstralVengeanceSummon.cs b/Projectiles/Summon/AstralVengeanceSummon.cs new file mode 100644 index 0000000000..bb41530cc6 --- /dev/null +++ b/Projectiles/Summon/AstralVengeanceSummon.cs @@ -0,0 +1,276 @@ +using System; +using System.IO; +using CalamityMod.Buffs.Summon; +using CalamityMod.CalPlayer; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Particles; +using CalamityMod.Sounds; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Summon +{ + public class AstralVengeanceSummon : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Summon"; + + public Player Owner => Main.player[Projectile.owner]; + public CalamityPlayer ModdedOwner => Owner.Calamity(); + public NPC Target => Projectile.Center.MinionHoming(AstralVengeance.EnemyDetectionDistance, Owner); + public ref float TimerToShoot => ref Projectile.ai[0]; + public ref float RotationInterpolant => ref Projectile.ai[1]; + public ref float AnimationSpeed => ref Projectile.ai[2]; + public int LaserSwingDirection = 0; + public bool DecidedSwingDirection = false; + public bool HasReachedSwingRotationStart = false; + public bool HasShotLaser = false; + + public override void SetStaticDefaults() + { + Main.projFrames[Type] = 4; + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 12000; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; + } + + public override void SetDefaults() + { + Projectile.minionSlots = 1; + Projectile.penetrate = -1; + + Projectile.width = Projectile.height = 52; + Projectile.DamageType = DamageClass.Summon; + Projectile.friendly = true; + Projectile.minion = true; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + } + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(LaserSwingDirection); + writer.Write(DecidedSwingDirection); + writer.Write(HasReachedSwingRotationStart); + writer.Write(HasShotLaser); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + LaserSwingDirection = reader.ReadInt32(); + DecidedSwingDirection = reader.ReadBoolean(); + HasReachedSwingRotationStart = reader.ReadBoolean(); + HasShotLaser = reader.ReadBoolean(); + } + + public override void AI() + { + CheckMinionExistence(); + DoAnimation(); + Projectile.MinionAntiClump(.1f); + + if (Target is not null) + { + TimerToShoot++; + + // When the minion detects a target, before it starts charging it'll line up to the target. + if (TimerToShoot <= AstralVengeance.TimeBeforeCharging) + { + FollowPlayer(); + Projectile.rotation = Projectile.rotation.AngleTowards(Projectile.DirectionTo(Target.Center).ToRotation(), .05f); + AnimationSpeed = 5f; + + SoundStyle laserCharge = new SoundStyle("CalamityMod/Sounds/Custom/ExoMechs/AresLaserArmCharge") { Volume = .1f, Pitch = .8f, PitchVariance = .2f }; + SoundEngine.PlaySound(laserCharge, Projectile.Center); + } + + // When it lines up, the minion will stop following the owner and will stop in place. + // Now it'll start charging. + else if ((TimerToShoot > AstralVengeance.TimeBeforeCharging) && (TimerToShoot <= (AstralVengeance.TimeBeforeCharging + AstralVengeance.TimeCharging))) + { + Projectile.velocity *= .95f; + AnimationSpeed = Utils.Remap(TimerToShoot, AstralVengeance.TimeBeforeCharging, AstralVengeance.TimeBeforeCharging + AstralVengeance.TimeCharging, 5f, 2f); + + float scale = Projectile.width * Projectile.scale; + float relativeScale = scale / 72f; // The width of the projectile relative to the width of the particle. + GenericBloom bloomCharge = new GenericBloom(Projectile.Center, + Projectile.velocity, + Color.Cyan with { A = 10 }, + Utils.Remap(TimerToShoot, AstralVengeance.TimeBeforeCharging, AstralVengeance.TimeBeforeCharging + AstralVengeance.TimeCharging, relativeScale * 2f, relativeScale / 2f), + (int)AstralVengeance.TimeCharging); + GeneralParticleHandler.SpawnParticle(bloomCharge); + + Vector2 chargeDustSpawn = Projectile.Center + Main.rand.NextVector2Circular(scale * 1.2f, scale * 1.2f); + Dust chargeDust = Dust.NewDustPerfect(chargeDustSpawn, + 307, + chargeDustSpawn.DirectionTo(Projectile.Center) * Main.rand.NextFloat(5f, 8f)); + chargeDust.noGravity = true; + chargeDust.scale = chargeDust.velocity.Length() * .15f; + } + + // And the behaviour just before shooting and while shooting. + else + { + AnimationSpeed = 2f; + + // Randomly decided if the minion'll swing the laser "Left -> Right" or "Right -> Left". + // ...Or whatever perspective, you get me. + if (!DecidedSwingDirection) + { + LaserSwingDirection = Main.rand.NextBool().ToDirectionInt(); + DecidedSwingDirection = true; + Projectile.netUpdate = true; + } + + // The minion will now point at the direction it has decided. + float swingRotStart = Projectile.DirectionTo(Target.Center).ToRotation() + (MathHelper.PiOver4 / 2 * LaserSwingDirection); + if (!HasReachedSwingRotationStart) + { + Projectile.rotation = MathHelper.Lerp(Projectile.rotation, swingRotStart, RotationInterpolant); + RotationInterpolant += 1f / 30f; + if (RotationInterpolant < 1f) + return; + + HasReachedSwingRotationStart = true; + RotationInterpolant = 0f; + + int sparkAmount = 10; + for (int sparkIndex = 0; sparkIndex < sparkAmount; sparkIndex++) + { + float angle = MathHelper.TwoPi / sparkAmount * sparkIndex; + Vector2 velocity = angle.ToRotationVector2().RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(10f, 15f); + SparkParticle firingSparks = new SparkParticle(Projectile.Center, + velocity, + true, + 10, + velocity.Length() * .1f, + Color.Cyan); + GeneralParticleHandler.SpawnParticle(firingSparks); + } + + SoundEngine.PlaySound(CommonCalamitySounds.LaserCannonSound with { Volume = .3f, Pitch = .8f, PitchVariance = .2f }, Projectile.Center); + + Projectile.netUpdate = true; + } + + // And when it has reached the direction that was decided, + // the laser will be shot and the laser will be swong to the reverse rotation that was decided. + if (!HasReachedSwingRotationStart) + return; + + ShootLaser(); + Projectile.rotation = MathHelper.Lerp(swingRotStart, swingRotStart + (MathHelper.PiOver4 * -LaserSwingDirection), RotationInterpolant); + RotationInterpolant += 1f / AstralVengeance.TimeShooting; + + Dust shootDust = Dust.NewDustPerfect(Projectile.Center, 307, Main.rand.NextVector2Circular(Main.rand.NextFloat(10f, 15f), Main.rand.NextFloat(10f, 15f))); + shootDust.noGravity = true; + shootDust.scale = shootDust.velocity.Length() * .2f; + + // When it completes the full swing: repeat process and reset all targetting variables. + if (RotationInterpolant >= 1f) + ResetTargettingVariables(); + } + } + else + { + FollowPlayer(); + Projectile.rotation = (MathF.Sign(Projectile.velocity.X) == 1) ? 0f : MathHelper.Pi; + AnimationSpeed = 5f; + + ResetTargettingVariables(); + } + } + + public void CheckMinionExistence() + { + Owner.AddBuff(ModContent.BuffType(), 2); + if (Type != ModContent.ProjectileType()) + return; + + if (Owner.dead) + ModdedOwner.astralVengeance = false; + if (ModdedOwner.astralVengeance) + Projectile.timeLeft = 2; + } + + public void DoAnimation() + { + Projectile.frameCounter++; + if (Projectile.frameCounter % (1 + (int)AnimationSpeed) == 0) + Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type]; + } + + public void FollowPlayer() + { + // If the minion starts to get far, force the minion to go to you. + if (Projectile.WithinRange(Owner.Center, AstralVengeance.EnemyDetectionDistance) && !Projectile.WithinRange(Owner.Center, AstralVengeance.EnemyDetectionDistance / 4)) + { + Projectile.velocity = (Owner.Center - Projectile.Center) / 30f; + Projectile.netUpdate = true; + } + + // The minion will change directions to you if it's going away from you, meaning it'll just hover around you. + else if (!Projectile.WithinRange(Owner.Center, AstralVengeance.EnemyDetectionDistance / 8)) + { + Projectile.velocity = (Projectile.velocity * 37f + Projectile.SafeDirectionTo(Owner.Center) * 17f) / 40f; + Projectile.netUpdate = true; + } + + // Teleport to the owner if sufficiently far away. + if (!Projectile.WithinRange(Owner.Center, AstralVengeance.EnemyDetectionDistance)) + { + Projectile.Center = Owner.Center; + Projectile.velocity *= 0.3f; + Projectile.netUpdate = true; + } + } + + public void ShootLaser() + { + if (!HasShotLaser && Main.myPlayer == Projectile.owner) + { + int laser = Projectile.NewProjectile(Projectile.GetSource_FromThis(), + Projectile.Center, + Projectile.rotation.ToRotationVector2(), + ModContent.ProjectileType(), + Projectile.damage, + Projectile.knockBack, + Owner.whoAmI, + 0f, Projectile.whoAmI, Target.whoAmI); + + if (Main.projectile.IndexInRange(laser)) + Main.projectile[laser].originalDamage = Projectile.originalDamage; + + HasShotLaser = true; + Projectile.netUpdate = true; + } + } + + public void ResetTargettingVariables() + { + TimerToShoot = 0f; + LaserSwingDirection = 0; + RotationInterpolant = 0f; + DecidedSwingDirection = false; + HasReachedSwingRotationStart = false; + HasShotLaser = false; + Projectile.netUpdate = true; + } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = ModContent.Request(Texture).Value; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Vector2 origin = frame.Size() * 0.5f; + + Main.EntitySpriteDraw(texture, drawPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); + + return false; + } + + public override bool? CanDamage() => false; + } +} diff --git a/Projectiles/Summon/AstralVengeanceSummon.png b/Projectiles/Summon/AstralVengeanceSummon.png new file mode 100644 index 0000000000000000000000000000000000000000..19b3d223d41e206074ca3ee1a3aee79dd693af13 GIT binary patch literal 3387 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 Date: Fri, 14 Jul 2023 21:03:22 +0200 Subject: [PATCH 2/4] Stellar Torus Staff. --- ...alVengeanceBuff.cs => StellarTorusBuff.cs} | 8 ++--- ...VengeanceBuff.png => StellarTorusBuff.png} | Bin CalPlayer/CalamityPlayer.cs | 4 +-- ...nceBeamEnd.png => StellarTorusBeamEnd.png} | Bin ...mMiddle.png => StellarTorusBeamMiddle.png} | Bin ...eamStart.png => StellarTorusBeamStart.png} | Bin ...stralVengeance.cs => StellarTorusStaff.cs} | 6 ++-- ...ralVengeance.png => StellarTorusStaff.png} | Bin .../en-US/Mods.CalamityMod.Buffs.hjson | 2 +- ...ods.CalamityMod.Items.Weapons.Summon.hjson | 4 +-- .../Mods.CalamityMod.Projectiles.Summon.hjson | 4 +-- ...alVengeanceBeam.cs => StellarTorusBeam.cs} | 14 ++++---- ...ngeanceSummon.cs => StellarTorusSummon.cs} | 32 +++++++++--------- ...eanceSummon.png => StellarTorusSummon.png} | Bin 14 files changed, 37 insertions(+), 37 deletions(-) rename Buffs/Summon/{AstralVengeanceBuff.cs => StellarTorusBuff.cs} (81%) rename Buffs/Summon/{AstralVengeanceBuff.png => StellarTorusBuff.png} (100%) rename ExtraTextures/Lasers/{AstralVengeanceBeamEnd.png => StellarTorusBeamEnd.png} (100%) rename ExtraTextures/Lasers/{AstralVengeanceBeamMiddle.png => StellarTorusBeamMiddle.png} (100%) rename ExtraTextures/Lasers/{AstralVengeanceBeamStart.png => StellarTorusBeamStart.png} (100%) rename Items/Weapons/Summon/{AstralVengeance.cs => StellarTorusStaff.cs} (89%) rename Items/Weapons/Summon/{AstralVengeance.png => StellarTorusStaff.png} (100%) rename Projectiles/Summon/{AstralVengeanceBeam.cs => StellarTorusBeam.cs} (81%) rename Projectiles/Summon/{AstralVengeanceSummon.cs => StellarTorusSummon.cs} (86%) rename Projectiles/Summon/{AstralVengeanceSummon.png => StellarTorusSummon.png} (100%) diff --git a/Buffs/Summon/AstralVengeanceBuff.cs b/Buffs/Summon/StellarTorusBuff.cs similarity index 81% rename from Buffs/Summon/AstralVengeanceBuff.cs rename to Buffs/Summon/StellarTorusBuff.cs index b7ff46674f..76014bda39 100644 --- a/Buffs/Summon/AstralVengeanceBuff.cs +++ b/Buffs/Summon/StellarTorusBuff.cs @@ -5,7 +5,7 @@ using Terraria.ModLoader; namespace CalamityMod.Buffs.Summon { - public class AstralVengeanceBuff : ModBuff + public class StellarTorusBuff : ModBuff { public override void SetStaticDefaults() { @@ -17,11 +17,11 @@ namespace CalamityMod.Buffs.Summon public override void Update(Player player, ref int buffIndex) { CalamityPlayer modPlayer = player.Calamity(); - if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) + if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) { - modPlayer.astralVengeance = true; + modPlayer.StellarTorus = true; } - if (!modPlayer.astralVengeance) + if (!modPlayer.StellarTorus) { player.DelBuff(buffIndex); buffIndex--; diff --git a/Buffs/Summon/AstralVengeanceBuff.png b/Buffs/Summon/StellarTorusBuff.png similarity index 100% rename from Buffs/Summon/AstralVengeanceBuff.png rename to Buffs/Summon/StellarTorusBuff.png diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 2847fc2bba..b41317db2a 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -979,7 +979,7 @@ namespace CalamityMod.CalPlayer public bool AresCannons = false; public bool celestialDragons = false; public bool KalandraMirror = false; - public bool astralVengeance = false; + public bool StellarTorus = false; public List PendingProjectilesToRespawn = new List(); @@ -2018,7 +2018,7 @@ namespace CalamityMod.CalPlayer AresCannons = false; celestialDragons = false; KalandraMirror = false; - astralVengeance = false; + StellarTorus = false; disableVoodooSpawns = false; disablePerfCystSpawns = false; diff --git a/ExtraTextures/Lasers/AstralVengeanceBeamEnd.png b/ExtraTextures/Lasers/StellarTorusBeamEnd.png similarity index 100% rename from ExtraTextures/Lasers/AstralVengeanceBeamEnd.png rename to ExtraTextures/Lasers/StellarTorusBeamEnd.png diff --git a/ExtraTextures/Lasers/AstralVengeanceBeamMiddle.png b/ExtraTextures/Lasers/StellarTorusBeamMiddle.png similarity index 100% rename from ExtraTextures/Lasers/AstralVengeanceBeamMiddle.png rename to ExtraTextures/Lasers/StellarTorusBeamMiddle.png diff --git a/ExtraTextures/Lasers/AstralVengeanceBeamStart.png b/ExtraTextures/Lasers/StellarTorusBeamStart.png similarity index 100% rename from ExtraTextures/Lasers/AstralVengeanceBeamStart.png rename to ExtraTextures/Lasers/StellarTorusBeamStart.png diff --git a/Items/Weapons/Summon/AstralVengeance.cs b/Items/Weapons/Summon/StellarTorusStaff.cs similarity index 89% rename from Items/Weapons/Summon/AstralVengeance.cs rename to Items/Weapons/Summon/StellarTorusStaff.cs index a0e60710d2..03d841e6cb 100644 --- a/Items/Weapons/Summon/AstralVengeance.cs +++ b/Items/Weapons/Summon/StellarTorusStaff.cs @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Summon { - public class AstralVengeance : ModItem, ILocalizedModType + public class StellarTorusStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.useTime = Item.useAnimation = 30; Item.knockBack = 4f; Item.mana = 10; - Item.shoot = ModContent.ProjectileType(); + Item.shoot = ModContent.ProjectileType(); Item.width = 42; Item.height = 42; @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - int minion = Projectile.NewProjectile(source, Main.MouseWorld, Main.rand.NextVector2Circular(2f, 2f), ModContent.ProjectileType(), damage, knockback, player.whoAmI); + int minion = Projectile.NewProjectile(source, Main.MouseWorld, Main.rand.NextVector2Circular(2f, 2f), ModContent.ProjectileType(), damage, knockback, player.whoAmI); if (Main.projectile.IndexInRange(minion)) Main.projectile[minion].originalDamage = Item.OriginalDamage; diff --git a/Items/Weapons/Summon/AstralVengeance.png b/Items/Weapons/Summon/StellarTorusStaff.png similarity index 100% rename from Items/Weapons/Summon/AstralVengeance.png rename to Items/Weapons/Summon/StellarTorusStaff.png diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index f2590903a1..f64daeab67 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -1442,7 +1442,7 @@ KalandraMirrorBuff: { Description: Five ancient weapons will annihilate your enemies } -AstralVengeanceBuff: { +StellarTorusBuff: { Description: Mods.CalamityMod.Buffs.AstralVengeanceBuff.Description DisplayName: Astral Vengeance Buff } \ No newline at end of file diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson index abf1ec1ecb..dbece9949e 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson @@ -787,7 +787,7 @@ MirrorofKalandra: { ''' } -AstralVengeance: { +StellarTorusStaff: { Tooltip: "" - DisplayName: Astral Vengeance + DisplayName: Stellar Torus Staff } \ No newline at end of file diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson index aad3d63cd3..6f9a4694fb 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson @@ -307,5 +307,5 @@ WindRipperArrow.DisplayName: Wind Ripper Arrow HopeShredder.DisplayName: Hope Shredder HopeShredderArrow.DisplayName: Hope Shredder Arrow HopeShredderArrowSplit.DisplayName: Hope Shredder Split Arrow -AstralVengeanceSummon.DisplayName: Astral Vengeance Summon -AstralVengeanceBeam.DisplayName: Astral Vengeance Beam \ No newline at end of file +StellarTorusSummon.DisplayName: Stellar Torus Summon +StellarTorusBeam.DisplayName: Stellar Torus Beam \ No newline at end of file diff --git a/Projectiles/Summon/AstralVengeanceBeam.cs b/Projectiles/Summon/StellarTorusBeam.cs similarity index 81% rename from Projectiles/Summon/AstralVengeanceBeam.cs rename to Projectiles/Summon/StellarTorusBeam.cs index a6ba273e60..daa74e1f53 100644 --- a/Projectiles/Summon/AstralVengeanceBeam.cs +++ b/Projectiles/Summon/StellarTorusBeam.cs @@ -10,17 +10,17 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class AstralVengeanceBeam : BaseLaserbeamProjectile, ILocalizedModType + public class StellarTorusBeam : BaseLaserbeamProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Summon"; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - public override Texture2D LaserBeginTexture => ModContent.Request("CalamityMod/ExtraTextures/Lasers/AstralVengeanceBeamStart", AssetRequestMode.ImmediateLoad).Value; - public override Texture2D LaserMiddleTexture => ModContent.Request("CalamityMod/ExtraTextures/Lasers/AstralVengeanceBeamMiddle", AssetRequestMode.ImmediateLoad).Value; - public override Texture2D LaserEndTexture => ModContent.Request("CalamityMod/ExtraTextures/Lasers/AstralVengeanceBeamEnd", AssetRequestMode.ImmediateLoad).Value; + public override Texture2D LaserBeginTexture => ModContent.Request("CalamityMod/ExtraTextures/Lasers/StellarTorusBeamStart", AssetRequestMode.ImmediateLoad).Value; + public override Texture2D LaserMiddleTexture => ModContent.Request("CalamityMod/ExtraTextures/Lasers/StellarTorusBeamMiddle", AssetRequestMode.ImmediateLoad).Value; + public override Texture2D LaserEndTexture => ModContent.Request("CalamityMod/ExtraTextures/Lasers/StellarTorusBeamEnd", AssetRequestMode.ImmediateLoad).Value; - public override float Lifetime => AstralVengeance.TimeShooting; - public override float MaxLaserLength => AstralVengeance.EnemyDetectionDistance * 2f; + public override float Lifetime => StellarTorusStaff.TimeShooting; + public override float MaxLaserLength => StellarTorusStaff.EnemyDetectionDistance * 2f; public override float MaxScale => 1f; public float Opacity = .33f; @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetDefaults() { - Projectile.localNPCHitCooldown = AstralVengeance.IFrames; + Projectile.localNPCHitCooldown = StellarTorusStaff.IFrames; Projectile.timeLeft = (int)Lifetime; Projectile.penetrate = -1; diff --git a/Projectiles/Summon/AstralVengeanceSummon.cs b/Projectiles/Summon/StellarTorusSummon.cs similarity index 86% rename from Projectiles/Summon/AstralVengeanceSummon.cs rename to Projectiles/Summon/StellarTorusSummon.cs index bb41530cc6..b129915a34 100644 --- a/Projectiles/Summon/AstralVengeanceSummon.cs +++ b/Projectiles/Summon/StellarTorusSummon.cs @@ -14,13 +14,13 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class AstralVengeanceSummon : ModProjectile, ILocalizedModType + public class StellarTorusSummon : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Summon"; public Player Owner => Main.player[Projectile.owner]; public CalamityPlayer ModdedOwner => Owner.Calamity(); - public NPC Target => Projectile.Center.MinionHoming(AstralVengeance.EnemyDetectionDistance, Owner); + public NPC Target => Projectile.Center.MinionHoming(StellarTorusStaff.EnemyDetectionDistance, Owner); public ref float TimerToShoot => ref Projectile.ai[0]; public ref float RotationInterpolant => ref Projectile.ai[1]; public ref float AnimationSpeed => ref Projectile.ai[2]; @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Summon TimerToShoot++; // When the minion detects a target, before it starts charging it'll line up to the target. - if (TimerToShoot <= AstralVengeance.TimeBeforeCharging) + if (TimerToShoot <= StellarTorusStaff.TimeBeforeCharging) { FollowPlayer(); Projectile.rotation = Projectile.rotation.AngleTowards(Projectile.DirectionTo(Target.Center).ToRotation(), .05f); @@ -88,18 +88,18 @@ namespace CalamityMod.Projectiles.Summon // When it lines up, the minion will stop following the owner and will stop in place. // Now it'll start charging. - else if ((TimerToShoot > AstralVengeance.TimeBeforeCharging) && (TimerToShoot <= (AstralVengeance.TimeBeforeCharging + AstralVengeance.TimeCharging))) + else if ((TimerToShoot > StellarTorusStaff.TimeBeforeCharging) && (TimerToShoot <= (StellarTorusStaff.TimeBeforeCharging + StellarTorusStaff.TimeCharging))) { Projectile.velocity *= .95f; - AnimationSpeed = Utils.Remap(TimerToShoot, AstralVengeance.TimeBeforeCharging, AstralVengeance.TimeBeforeCharging + AstralVengeance.TimeCharging, 5f, 2f); + AnimationSpeed = Utils.Remap(TimerToShoot, StellarTorusStaff.TimeBeforeCharging, StellarTorusStaff.TimeBeforeCharging + StellarTorusStaff.TimeCharging, 5f, 2f); float scale = Projectile.width * Projectile.scale; float relativeScale = scale / 72f; // The width of the projectile relative to the width of the particle. GenericBloom bloomCharge = new GenericBloom(Projectile.Center, Projectile.velocity, Color.Cyan with { A = 10 }, - Utils.Remap(TimerToShoot, AstralVengeance.TimeBeforeCharging, AstralVengeance.TimeBeforeCharging + AstralVengeance.TimeCharging, relativeScale * 2f, relativeScale / 2f), - (int)AstralVengeance.TimeCharging); + Utils.Remap(TimerToShoot, StellarTorusStaff.TimeBeforeCharging, StellarTorusStaff.TimeBeforeCharging + StellarTorusStaff.TimeCharging, relativeScale * 2f, relativeScale / 2f), + (int)StellarTorusStaff .TimeCharging); GeneralParticleHandler.SpawnParticle(bloomCharge); Vector2 chargeDustSpawn = Projectile.Center + Main.rand.NextVector2Circular(scale * 1.2f, scale * 1.2f); @@ -162,7 +162,7 @@ namespace CalamityMod.Projectiles.Summon ShootLaser(); Projectile.rotation = MathHelper.Lerp(swingRotStart, swingRotStart + (MathHelper.PiOver4 * -LaserSwingDirection), RotationInterpolant); - RotationInterpolant += 1f / AstralVengeance.TimeShooting; + RotationInterpolant += 1f / StellarTorusStaff.TimeShooting; Dust shootDust = Dust.NewDustPerfect(Projectile.Center, 307, Main.rand.NextVector2Circular(Main.rand.NextFloat(10f, 15f), Main.rand.NextFloat(10f, 15f))); shootDust.noGravity = true; @@ -185,13 +185,13 @@ namespace CalamityMod.Projectiles.Summon public void CheckMinionExistence() { - Owner.AddBuff(ModContent.BuffType(), 2); - if (Type != ModContent.ProjectileType()) + Owner.AddBuff(ModContent.BuffType(), 2); + if (Type != ModContent.ProjectileType()) return; if (Owner.dead) - ModdedOwner.astralVengeance = false; - if (ModdedOwner.astralVengeance) + ModdedOwner.StellarTorus = false; + if (ModdedOwner.StellarTorus) Projectile.timeLeft = 2; } @@ -205,21 +205,21 @@ namespace CalamityMod.Projectiles.Summon public void FollowPlayer() { // If the minion starts to get far, force the minion to go to you. - if (Projectile.WithinRange(Owner.Center, AstralVengeance.EnemyDetectionDistance) && !Projectile.WithinRange(Owner.Center, AstralVengeance.EnemyDetectionDistance / 4)) + if (Projectile.WithinRange(Owner.Center, StellarTorusStaff.EnemyDetectionDistance) && !Projectile.WithinRange(Owner.Center, StellarTorusStaff.EnemyDetectionDistance / 4)) { Projectile.velocity = (Owner.Center - Projectile.Center) / 30f; Projectile.netUpdate = true; } // The minion will change directions to you if it's going away from you, meaning it'll just hover around you. - else if (!Projectile.WithinRange(Owner.Center, AstralVengeance.EnemyDetectionDistance / 8)) + else if (!Projectile.WithinRange(Owner.Center, StellarTorusStaff.EnemyDetectionDistance / 8)) { Projectile.velocity = (Projectile.velocity * 37f + Projectile.SafeDirectionTo(Owner.Center) * 17f) / 40f; Projectile.netUpdate = true; } // Teleport to the owner if sufficiently far away. - if (!Projectile.WithinRange(Owner.Center, AstralVengeance.EnemyDetectionDistance)) + if (!Projectile.WithinRange(Owner.Center, StellarTorusStaff.EnemyDetectionDistance)) { Projectile.Center = Owner.Center; Projectile.velocity *= 0.3f; @@ -234,7 +234,7 @@ namespace CalamityMod.Projectiles.Summon int laser = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.rotation.ToRotationVector2(), - ModContent.ProjectileType(), + ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Owner.whoAmI, diff --git a/Projectiles/Summon/AstralVengeanceSummon.png b/Projectiles/Summon/StellarTorusSummon.png similarity index 100% rename from Projectiles/Summon/AstralVengeanceSummon.png rename to Projectiles/Summon/StellarTorusSummon.png From 63530f8b41a42f622a0f6f00620337ab5407bdd0 Mon Sep 17 00:00:00 2001 From: Memes <114233643+Mr-Memes@users.noreply.github.com> Date: Fri, 14 Jul 2023 21:27:43 +0200 Subject: [PATCH 3/4] Tooltip, buff tooltip and more particles. --- Localization/en-US/Mods.CalamityMod.Buffs.hjson | 2 +- Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson | 2 +- Projectiles/Summon/StellarTorusBeam.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index f64daeab67..06447a2126 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -1443,6 +1443,6 @@ KalandraMirrorBuff: { } StellarTorusBuff: { - Description: Mods.CalamityMod.Buffs.AstralVengeanceBuff.Description DisplayName: Astral Vengeance Buff + Description: Summons a Torus Orbital that fries your foes } \ No newline at end of file diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson index dbece9949e..ba85a3b832 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson @@ -788,6 +788,6 @@ MirrorofKalandra: { } StellarTorusStaff: { - Tooltip: "" DisplayName: Stellar Torus Staff + Tooltip: Summons a Torus Orbital that fries foes with a telescoping light beam } \ No newline at end of file diff --git a/Projectiles/Summon/StellarTorusBeam.cs b/Projectiles/Summon/StellarTorusBeam.cs index daa74e1f53..ff57d04eff 100644 --- a/Projectiles/Summon/StellarTorusBeam.cs +++ b/Projectiles/Summon/StellarTorusBeam.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Summon if (Target is null) Projectile.Kill(); - if (Main.rand.NextBool(4)) + if (Main.rand.NextBool(3)) { SparkParticle energyEffect = new SparkParticle(Projectile.Center + Vector2.Lerp(Projectile.velocity, Projectile.velocity * MaxLaserLength, Main.rand.NextFloat(1f)) + Main.rand.NextVector2Circular(30f, 30f), Projectile.velocity * Main.rand.NextFloat(8f, 12f), From 0c9a1c0e63623aaa8793a753cfdf185c304b6513 Mon Sep 17 00:00:00 2001 From: Memes <114233643+Mr-Memes@users.noreply.github.com> Date: Fri, 14 Jul 2023 22:13:29 +0200 Subject: [PATCH 4/4] Added a recipe. --- Items/Weapons/Summon/StellarTorusStaff.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Items/Weapons/Summon/StellarTorusStaff.cs b/Items/Weapons/Summon/StellarTorusStaff.cs index 03d841e6cb..0ed006cb56 100644 --- a/Items/Weapons/Summon/StellarTorusStaff.cs +++ b/Items/Weapons/Summon/StellarTorusStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -52,7 +53,12 @@ namespace CalamityMod.Items.Weapons.Summon public override void AddRecipes() { - base.AddRecipes(); + CreateRecipe(). + AddIngredient(ItemID.XenoStaff). + AddIngredient(3). + AddIngredient(ItemID.FragmentStardust, 6). + AddTile(TileID.LunarCraftingStation). + Register(); } } }