From a6232f3e476173bf284b2d8c7cd8ff0fb689a119 Mon Sep 17 00:00:00 2001 From: IbanPlay <56191483+IbanPlay@users.noreply.github.com> Date: Tue, 25 Jan 2022 03:43:04 +0100 Subject: [PATCH] Homestuck reference --- Items/Weapons/Melee/FourSeasonsGalaxia.cs | 25 +++++- Projectiles/Melee/GalaxiaCancer.png | Bin 0 -> 498 bytes Projectiles/Melee/GalaxiaCapricorn.png | Bin 0 -> 563 bytes Projectiles/Melee/GalaxiaProjectiles.cs | 97 ++++++++++++++++++++++ 4 files changed, 119 insertions(+), 3 deletions(-) create mode 100644 Projectiles/Melee/GalaxiaCancer.png create mode 100644 Projectiles/Melee/GalaxiaCapricorn.png diff --git a/Items/Weapons/Melee/FourSeasonsGalaxia.cs b/Items/Weapons/Melee/FourSeasonsGalaxia.cs index f7fc9379ee..866ce21e4a 100644 --- a/Items/Weapons/Melee/FourSeasonsGalaxia.cs +++ b/Items/Weapons/Melee/FourSeasonsGalaxia.cs @@ -59,6 +59,13 @@ namespace CalamityMod.Items.Weapons.Melee public static int FlailBladeAttunement_Reach = 600; public static float FlailBladeAttunement_ChainDamageReduction = 0.5f; public static float FlailBladeAttunement_OnHitBoltDamageReduction = 0.5f; + + public static int CancerPassiveDamage = 400; + public static int CancerPassiveLifeSteal = 1; + public static float CancerPassiveLifeStealProc = 0.4f; + public static int CapricornPassiveDebuffTime = 200; + + #endregion public override string Texture => "CalamityMod/Items/Weapons/Melee/GalaxiaExtra"; //Just in case the player SOMEHOW gets to swing galaxia itself. Sprite also used as the base for other attacks @@ -102,7 +109,7 @@ namespace CalamityMod.Items.Weapons.Melee if (l.text.StartsWith("FUNCTION_PASSIVE")) { AttunementInfo info = GetAttunementInfo(mainAttunement); - l.overrideColor = info.color; + l.overrideColor = info.passive_color; l.text = info.passive_desc; } @@ -182,13 +189,13 @@ namespace CalamityMod.Items.Weapons.Melee case Attunement.Whirlwind: case Attunement.FlailBlade: AttunementInfo.passive_name = "Capricorn's Blessing"; - AttunementInfo.passive_desc = "IDK"; + AttunementInfo.passive_desc = "Periodically releases a ring of weakening stars around your cursor when attacking"; AttunementInfo.passive_color = new Color(76, 137, 237); break; case Attunement.SuperPogo: case Attunement.Shockwave: AttunementInfo.passive_name = "Cancer's Blessing"; - AttunementInfo.passive_desc = "IDK"; + AttunementInfo.passive_desc = "Periodically releases a ring of lifestealing stars around yourself when attacking"; AttunementInfo.passive_color = new Color(203, 25, 119); break; default: @@ -366,9 +373,21 @@ namespace CalamityMod.Items.Weapons.Melee { case Attunement.SuperPogo: case Attunement.Shockwave: + if (UseTimer % 500 == 449) + { + Main.PlaySound(SoundID.Item78); + Projectile.NewProjectile(player.Center, Vector2.Zero, ProjectileType(), CancerPassiveDamage, 0f, player.whoAmI, 0f); + UseTimer++; + } break; case Attunement.FlailBlade: case Attunement.Whirlwind: + if (UseTimer % 500 == 449) + { + Main.PlaySound(SoundID.Item78); + Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, ProjectileType(), 0, 0f, player.whoAmI, 1f); + UseTimer++; + } break; default: break; diff --git a/Projectiles/Melee/GalaxiaCancer.png b/Projectiles/Melee/GalaxiaCancer.png new file mode 100644 index 0000000000000000000000000000000000000000..e25a8538f5edee09eee7fcea92beb1e39b664918 GIT binary patch literal 498 zcmVPx$tVu*cR9J=8n9Fg)FbqUjncU+J;u2JXsR~qrOG*hY!4(iH!6l>wxr1D|F^Hi^ zY2uNQy?{S`_ymFwI~c_nZIjhUvd3f(rhiWMJK1~fX2UQP+uvGm@hWvJ6i6+RVf|$4 z6iH2{zKSFX`XyE&MIvLe8MzQbU%Ro0+)~k!BFUR+&j|htVwThy073|(z34AeBx$e7 zlH?t5Oza&yk)o7u_5dIvHV#gJb7EX=Bd|2t~qpkhPINyPx_J>}Ndl?_<^{GO1P9+8b>)u{K|` zg#AZ;zWEgZM1*}kuqulvk_sW5%2)heM?xezYwMPn&MrQa{()0|iLp>Q oN!<0E%>Vh=Qpc;$V%-w^0nazE+++r34FCWD07*qoM6N<$g0fWIKmY&$ literal 0 HcmV?d00001 diff --git a/Projectiles/Melee/GalaxiaCapricorn.png b/Projectiles/Melee/GalaxiaCapricorn.png new file mode 100644 index 0000000000000000000000000000000000000000..e353db0053939c58eb688ee1d8902a33b871c33e GIT binary patch literal 563 zcmV-30?hr1P)Px$?MXyIR9J=On9X&<#6OT$W* z%^^=PmwlGB{`tIGt+X130YPuUZjkCb*elAK<-gnQCT{2JWs%oEYBdZ4$!vq&%a}v3 z$6%H8UH)@PH%IstW6bRVpzr&Scz~I$#pfv3B>NHk6T$`msX5`QNy0^un3=IjiS6TY z1^-KEV%9hV0JBtWEH_D*Uwi<@m{VdAsg1OEmCx$L*5>y_O%mo8a`vu)k)%VgNYu`_3;oP0r(n->UbsoZ6iJ`NCPe$bcW-27IY0d)oCBI|s?;7~=D(G97iY|$qS$4YDUOfC7=D*)T@kOq_y^i0?8I`dG{Msxi-%b6t>Rb!5l6}LIUD{XMj+Vn(6*LCX(_RSGqQcL8rM{!RU>1WQv^i;Ds!oNr%x;SSOEn5Hp002ovPDHLkV1f*? B495Tf literal 0 HcmV?d00001 diff --git a/Projectiles/Melee/GalaxiaProjectiles.cs b/Projectiles/Melee/GalaxiaProjectiles.cs index 17df9c720d..b19ca0fdc1 100644 --- a/Projectiles/Melee/GalaxiaProjectiles.cs +++ b/Projectiles/Melee/GalaxiaProjectiles.cs @@ -104,6 +104,103 @@ namespace CalamityMod.Projectiles.Melee } } + // Passive ring of star + + public class GalaxiaTropicRing : ModProjectile + { + public Player Owner => Main.player[projectile.owner]; + public ref float Mode => ref projectile.ai[0]; + public ref float Fade => ref projectile.ai[1]; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Star Ring"); + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 30; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.timeLeft = 300; + projectile.melee = true; + projectile.tileCollide = false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (Mode == 0f && Main.rand.NextBool < FourSeasonsGalaxia.CancerPassiveLifeStealProc) + { + Owner.statLife += FourSeasonsGalaxia.CancerPassiveLifeSteal; + Owner.HealEffect(FourSeasonsGalaxia.CancerPassiveLifeSteal); + } + else + { + target.AddBuff(BuffType(), FourSeasonsGalaxia.CapricornPassiveDebuffTime); + } + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + return Collision.CheckAABBvAABBCollision(targetHitbox.TopLeft(), targetHitbox.Size(), projectile.Center - Vector2.One * 95 * projectile.scale, Vector2.One * 190 * projectile.scale); + } + + public override void AI() + { + Fade = projectile.timeLeft > 250 ? (float)Math.Sin((300 - projectile.timeLeft) / 50f * MathHelper.PiOver2) * 0.6f + 0.4f : projectile.timeLeft > 50 ? 1f : (float)Math.Sin((projectile.timeLeft) / 50f * MathHelper.PiOver2); + Lighting.AddLight(projectile.Center, 0.75f, 1f, 0.24f); + + } + + public Vector2 starPosition(int MaxStars, int StarIndex, float diameter) + { + float starHeight = (float)Math.Sin(Main.GlobalTime * 3 + StarIndex * MathHelper.TwoPi / (float)MaxStars); + float starWidth = (float)Math.Cos(Main.GlobalTime * 3 + StarIndex * MathHelper.TwoPi / (float)MaxStars); + + return projectile.Center + projectile.rotation.ToRotationVector2() * starWidth * (projectile.scale * diameter * 0.4f) + (projectile.rotation + MathHelper.PiOver2).ToRotationVector2() * starHeight * (projectile.scale * diameter * 0.4f); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D sigil = GetTexture(Mode == 0 ? "CalamityMod/Projectiles/Melee/GalaxiaCancer" : "CalamityMod/Projectiles/Melee/GalaxiaCapricorn"); //OMG Karkat and Gamzee from homestuck i am a big fan + Texture2D ring = GetTexture("CalamityMod/Particles/BloomRing"); + Texture2D starTexture = GetTexture("CalamityMod/Particles/Sparkle"); + Texture2D lineTexture = GetTexture("CalamityMod/Particles/BloomLine"); + Texture2D bloomTexture = GetTexture("CalamityMod/Particles/BloomCircle"); + + Color ringColor = Mode == 0 ? new Color(255, 0, 0) * Fade : new Color(66, 0, 176) * Fade; + + spriteBatch.End(); + spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + + spriteBatch.Draw(bloomTexture, projectile.Center - Main.screenPosition, null, ringColor * 0.5f, 0, bloomTexture.Size() / 2f, 2.5f, SpriteEffects.None, 0); + spriteBatch.Draw(ring, projectile.Center - Main.screenPosition, null, ringColor * 0.8f, 0f, ring.Size() / 2f, projectile.scale, 0f, 0f); + + spriteBatch.Draw(sigil, projectile.Center - Main.screenPosition, null, ringColor * MathHelper.Lerp(0.7f, 0f, ((Main.GlobalTime * 5f) % 10) / 10f), 0f, sigil.Size() / 2f, projectile.scale + ((Main.GlobalTime * 5f) % 10) / 10f * 2f, 0f, 0f) ; + spriteBatch.Draw(sigil, projectile.Center - Main.screenPosition, null, Color.White * Fade, 0f, sigil.Size() / 2f, projectile.scale, 0f, 0f); + + for (int i = 0; i < 5; i++) + { + + Vector2 starPos = starPosition(5, i, ring.Width); + + Vector2 LineVector = starPosition(5, i + 1, ring.Width) - starPos; + float rot = LineVector.ToRotation() + MathHelper.PiOver2; + Vector2 origin = new Vector2(lineTexture.Width / 2f, lineTexture.Height); + Vector2 scale = new Vector2(0.3f, LineVector.Length() / lineTexture.Height); + + spriteBatch.Draw(lineTexture, starPos - Main.screenPosition, null, Color.White * Fade * 0.7f, rot, origin, scale, SpriteEffects.None, 0); + + spriteBatch.Draw(bloomTexture, starPos - Main.screenPosition, null, ringColor * 0.5f, 0, bloomTexture.Size() / 2f, 0.1f, SpriteEffects.None, 0); + spriteBatch.Draw(starTexture, starPos - Main.screenPosition, null, ringColor * 0.5f, Main.GlobalTime * 5 + MathHelper.PiOver4 * i, starTexture.Size() / 2f ,1f, SpriteEffects.None, 0); + spriteBatch.Draw(starTexture, starPos - Main.screenPosition, null, Color.White * Fade, Main.GlobalTime * 5, starTexture.Size() / 2f, 1.4f, SpriteEffects.None, 0); + } + + return false; + } + } + //Phoenix's pride aka Whirlwind attunement