From 9719be3e09af813c2190ce7e2d39d1b0ad2765e5 Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Tue, 20 Feb 2024 00:13:46 -0800 Subject: [PATCH] Added Festering Remains, no chum yet --- .../en-US/Mods.CalamityMod.NPCs.hjson | 1 + NPCs/SunkenSea/AlphaSeaMinnow.cs | 1 - NPCs/SunkenSea/FesteringRemains.cs | 101 ++++++++++++++++++ NPCs/SunkenSea/FesteringRemains.png | Bin 0 -> 1065 bytes NPCs/SunkenSea/HauntedChum.png | Bin 0 -> 790 bytes NPCs/SunkenSea/HauntedChumMouth.png | Bin 0 -> 768 bytes NPCs/SunkenSea/SandProwler.cs | 2 - Particles/ChumBone.cs | 53 +++++++++ Particles/ChumBone1.png | Bin 0 -> 383 bytes Particles/ChumBone2.png | Bin 0 -> 387 bytes 10 files changed, 155 insertions(+), 3 deletions(-) create mode 100644 NPCs/SunkenSea/FesteringRemains.cs create mode 100644 NPCs/SunkenSea/FesteringRemains.png create mode 100644 NPCs/SunkenSea/HauntedChum.png create mode 100644 NPCs/SunkenSea/HauntedChumMouth.png create mode 100644 Particles/ChumBone.cs create mode 100644 Particles/ChumBone1.png create mode 100644 Particles/ChumBone2.png diff --git a/Localization/en-US/Mods.CalamityMod.NPCs.hjson b/Localization/en-US/Mods.CalamityMod.NPCs.hjson index d21231805d..ad88e78584 100644 --- a/Localization/en-US/Mods.CalamityMod.NPCs.hjson +++ b/Localization/en-US/Mods.CalamityMod.NPCs.hjson @@ -265,6 +265,7 @@ BabyGhostBell.DisplayName: Baby Ghost Bell BlindedAngler.DisplayName: Blinded Angler Clam.DisplayName: Clam EutrophicRay.DisplayName: Eutrophic Ray +FesteringRemains.DisplayName: Festering Remains GhostBell.DisplayName: Ghost Bell GiantClam.DisplayName: Giant Clam Clamitas: Clamitas diff --git a/NPCs/SunkenSea/AlphaSeaMinnow.cs b/NPCs/SunkenSea/AlphaSeaMinnow.cs index 0ec3ad7c64..66c7fb0b69 100644 --- a/NPCs/SunkenSea/AlphaSeaMinnow.cs +++ b/NPCs/SunkenSea/AlphaSeaMinnow.cs @@ -1,7 +1,6 @@ using CalamityMod.BiomeManagers; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Critters; -using System; using Terraria; using Terraria.GameContent.Bestiary; using Terraria.ID; diff --git a/NPCs/SunkenSea/FesteringRemains.cs b/NPCs/SunkenSea/FesteringRemains.cs new file mode 100644 index 0000000000..d18c85872e --- /dev/null +++ b/NPCs/SunkenSea/FesteringRemains.cs @@ -0,0 +1,101 @@ +using CalamityMod.BiomeManagers; +using CalamityMod.Items.Placeables.Banners; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.GameContent.Bestiary; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ModLoader.Utilities; +using Terraria.DataStructures; +using CalamityMod.Particles; +using System.Collections.Generic; + +namespace CalamityMod.NPCs.SunkenSea +{ + public class FesteringRemains : ModNPC + { + List bones = new List(); + public override void SetDefaults() + { + NPC.width = 52; + NPC.height = 36; + NPC.defense = 0; + NPC.lifeMax = 200; + NPC.aiStyle = -1; + AIType = -1; + NPC.HitSound = SoundID.NPCHit1; + NPC.DeathSound = SoundID.NPCDeath1; + //Banner = NPC.type; + //BannerItem = ModContent.ItemType(); + NPC.chaseable = false; + SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; + } + + public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) + { + bestiaryEntry.Info.AddRange(new IBestiaryInfoElement[] + { + new FlavorTextBestiaryInfoElement("Mods.CalamityMod.Bestiary.HauntedChum") + }); + } + public override void OnSpawn(IEntitySource source) + { + int boneCount = Main.rand.Next(5, 8); + for (int i = 0; i < boneCount; i++) + { + int extraDistX = 120; + int extraDistY = 40; + Vector2 bonePos = NPC.Center + new Vector2(Main.rand.Next(-extraDistX, extraDistX + 1), Main.rand.Next(-extraDistY, extraDistY + 1)); + for (int j = 0; j < 50; j++) + { + Tile tilePos = CalamityUtils.ParanoidTileRetrieval((int)bonePos.X / 16, (int)bonePos.Y / 16); + if (tilePos.HasTile) + { + bonePos = NPC.Center + new Vector2(Main.rand.Next(-extraDistX, extraDistX + 1), Main.rand.Next(-extraDistY, extraDistY + 1)); + } + } + Particle bone = new ChumBone(bonePos, Vector2.Zero, NPC.GetAlpha(Color.White), Main.rand.NextFloat(-MathHelper.PiOver4, MathHelper.PiOver4), Main.rand.NextFloat(0.8f, 1.6f), 4, Main.rand.NextBool(), Main.rand.NextBool()); + GeneralParticleHandler.SpawnParticle(bone); + bones.Add(bone); + } + NPC.TargetClosest(); + } + + public override void AI() + { + NPC.damage = 0; + NPC.TargetClosest(); + Player target = Main.player[NPC.target]; + if (target != null && target.active && target.Distance(NPC.Center) < 80) + { + if (NPC.ai[0] == 0) + { + //int head = NPC.NewNPC(NPC.GetSource_FromThis(), (int)NPC.Center.X, (int)NPC.Center.Y - 200, NPCID.HeadacheSkeleton, ai3: NPC.whoAmI); + //NPC.ai[0] = 1; + //NPC.ai[1] = head; + } + } + for (int i = 0; i < bones.Count; i++) + { + bones[i].Time = 2; + } + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + if (spawnInfo.Player.Calamity().ZoneSunkenSeaShores && !spawnInfo.Water && !spawnInfo.Player.Calamity().clamity) + { + return SpawnCondition.CaveJellyfish.Chance * 0.6f; + } + return 0f; + } + + public override void HitEffect(NPC.HitInfo hit) + { + for (int k = 0; k < 5; k++) + { + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); + } + } + } +} diff --git a/NPCs/SunkenSea/FesteringRemains.png b/NPCs/SunkenSea/FesteringRemains.png new file mode 100644 index 0000000000000000000000000000000000000000..75b78502a49574f3e8555a686e63257e67b7e016 GIT binary patch literal 1065 zcmV+^1lIeBP)Px#1ZP1_K>z@;j|==^1poj8xk*GpR9HvtnLkVuVHm~>w56q`QV6A~+VWRX6QM>- zh=YkCMh7KfH%@L$?rhFXY)(!piHn2AFo{8;Bp@bW6GOlfX~6)cMQLfV-aX$v_4?74 zs!RvJi!f!y0lWHIV5*L?=XTe0=o+xf4IRKf zLk(UpvS;u-R>6 zwUK~b%j;=ECYHV;NjM(UMgp29axE(J8w@F?uwO399fb@88j;DZOkQ_3zM+-P1hTJJ z-1DrZX(X~~i<7X0it*r&w*V=;|8XHB@nEbiKYOaEz-OL{Lv)Q~0y$_nHb=r`L z?IhlC<90XpXWxoD#<+%fZ*xV!?!=lQbDu=l^SkPhG(_GkEF$HaBC;{oQZk*vzHF+- z=|nojVJ2&31rF%!5H;%W6lq*ToQLFloGSu$E6yVu6XVE%cF|?X^~>$rNHF+x5=m3; z#%d%9eGy$xcV3}D!)y_&dW+SHRKWLiTZIGGPBs>oeX{vNDFzAv=4jwHr2)Y{a5K`Nat%g|I< z80himn;|rKHyA{cmyrmPYdT(Oc^)A&C7U69-?Qh_NCk9B;~6^R^I+h#*mh*M|rCk;PU9G)m;xiM&E#2jjd#q>i|+b`%V1h);fr9kF_@wcB8d_b_XPwZj@K zHfQmDM82}}>$;UfNdj6oZfh1bzpx|>t^LS#NrM{FQvZw&LvmM>yPr(4ZYaa!O&uLWjXD3ml;1|?5W>~9Nva+OW#Frp!o={FmMkjIXBr3L^101jnX jNoGw=04e|g00;m8000000Mb*F00000NkvXXu0mjf!5!+F literal 0 HcmV?d00001 diff --git a/NPCs/SunkenSea/HauntedChum.png b/NPCs/SunkenSea/HauntedChum.png new file mode 100644 index 0000000000000000000000000000000000000000..11b9e1f220aef2449886733798674063a620fd7e GIT binary patch literal 790 zcmV+x1L^#UP)|00001b5ch_0Itp) z=>Px#1ZP1_K>z@;j|==^1poj7rb$FWR9HvVm&aNFSc#{~9yt&zm-c7ujt)G*j4yPZz_X4Nz?PiBiC(`Zqf z?AQ>^)K>`BS7#EH8j+F7=yJ+#nu%XVc3By z-a{aBb0KPtB)l)uBx`+@N`b%9X^?-{W5}*jyQF1@V1`fL6+Q_@j?4VhM_HMfl-)r? zG{coMYS(Be)GwdMXXSpHeEQ-g$mnZ`?H?Q+1l7dGVqiM64AKmD2|IAW*8*~P9y>b< z?lKb~^WpUrI2qskT+>}P(%*+c$yl-NGSwKn#7vEkfq$&^CenwFCw%`ohY&*OrbJh(;u2s6fd6?66fF-AW_79E$*$eWbO7YY_-C557JuUF38Sz`r^EiS<5sX#a8 z(d0Lf^ZNbx4SxUK4>?J070nDe9KQiAHy?(Ge{M+t000hUSV?A0O#mtY000O800000 U007cclK=n!07*qoM6N<$f~%5h*8l(j literal 0 HcmV?d00001 diff --git a/NPCs/SunkenSea/HauntedChumMouth.png b/NPCs/SunkenSea/HauntedChumMouth.png new file mode 100644 index 0000000000000000000000000000000000000000..6fa25c049e830af53a183daf217a6682b0f32ba0 GIT binary patch literal 768 zcmV+b1ONPqP)Px#1ZP1_K>z@;j|==^1poj7kV!;AR9HvVmQ7C+VHAb?G1D?F#dd}U5#k3`RBWOq z7^AWfb;s6U;MSFU;>v|PSFHF8#)JhM6Qc_g6F1!uLogySqBfGld?9y+mZcDQrkXgeC zczLUa3r5lz#1nZTe)skZoP;E!dQa$Oj!eJVReWJ+8tVG1(LhY424dny9M|8NIf>XV z$}d8#e*EE|iFjX60j)HiknyA`E5%yHfp^mhzdK1tt*;0PyOd;lGy<~vUO>A=WIQz( zR)-(|B}GK4W+@_4HA{6ZJ6FjgbJgL80o3rkb&w6RU=2G_DX}*EJ83dmd7s-?oWQ&E zzaOYFSBD}YjS}PbT2jH)uvV9qC85jI^{-k!dGrwe;PF%V)id&5cBmZ{&`RTbs9U#E zBt4zT!Y}79!I$2@fwNv62wUFq{v*6OHUTHmwOiuz&lcbp&K-w`$EV=0UM#_5S`_!* zZR{cD{u(@?Qe_)fin6uDMT z-@5`|e*PLxab-y-6S#r1T|?Y|gcM0f(=u^;!(B_NW;TrrHaDev8~#+*ZE~l2Oc)CN y0Zgd{=TF0000 0f) NPC.realLife = (int)NPC.ai[2]; diff --git a/Particles/ChumBone.cs b/Particles/ChumBone.cs new file mode 100644 index 0000000000..b366177b6c --- /dev/null +++ b/Particles/ChumBone.cs @@ -0,0 +1,53 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Particles +{ + public class ChumBone : Particle + { + public override string Texture => "CalamityMod/Particles/ChumBone1"; + + public override bool UseCustomDraw => true; + public override bool SetLifetime => true; + + private bool direction; + private bool variant; + public static string Texture2 => "CalamityMod/Particles/ChumBone2"; + + public ChumBone(Vector2 position, Vector2 velocity, Color color, float rotation, float scale, int lifeTime, bool variant, bool direction) + { + Position = position; + Velocity = velocity; + Scale = scale; + Lifetime = lifeTime; + Rotation = rotation; + Color = color; + } + + public override void Update() + { + // Gravity + Tile below = CalamityUtils.ParanoidTileRetrieval((int)(Position.X / 16), (int)(Position.Y / 16)); + if (!below.HasTile || !below.IsTileSolid() || below.Slope > 0) + { + if (Velocity.Y < 10) + { + Velocity.Y += 1; + } + } + else + { + Velocity.Y = 0; + } + } + + public override void CustomDraw(SpriteBatch spriteBatch) + { + Texture2D tex = variant ? ModContent.Request(Texture2).Value : ModContent.Request(Texture).Value; + SpriteEffects spriteDir = direction ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(tex, Position - Main.screenPosition, null, Color, Rotation, new Vector2(tex.Width / 2, tex.Height), Scale, spriteDir, 0); + } + } +} diff --git a/Particles/ChumBone1.png b/Particles/ChumBone1.png new file mode 100644 index 0000000000000000000000000000000000000000..86bff0e329327e933584eb072e86319a67ce2abe GIT binary patch literal 383 zcmeAS@N?(olHy`uVBq!ia0vp^Ahs9>8<6~|#v2Qy7>k44ofy`glX(f`u%tWsIx;Y9 z?C1WI$O@F>_jGX#vG7k$X=wVwVQp~s;7Q(P^)>&0$-Bhw{3mlJooTWQgIjiOsDZPu ztCY{?jsKWutEevKc=rBQEsxLSJSBk!-=gBJOvUqTck(auEK~MtRhaBBV|I71U`wa@ z#Qy2cj4g=_Pt0cgc6ji5dwhb=mQI~dr;HMg{huFyaLdHi(lhoI)hf8%tdd&Ls6(SyeUe2HJ z>(bigJn{SftK4&OV;3$pc>MA7_k`^p93Pv1>fftnx!hC}^T5P=Pv@_!O$luL>g+dM zX5@dD*~_@BvB5<+@ui^H{rPtP8D{eoD+^3WQetLicx)8CXL45AZeURHrABzB`T8`hV*YRv}b;?l|- z!S~rDe*AhXE-^WuSze!A;xL0oNrGYvkH@w~!D(f6{~KSVrZyhgFmbi?jQtsxoD6tb z9#|;fZTsWmZ@@fF>*8fToCUQ!r!~kPY9SK@QD3${GQ(&%UXZzJgBz+_YcuC>UY^{O(PAO+b1*UH1{o2 znZbWL(O`B%!=C^q;{?sGm!HdPm<7st1xUqZEx7HnP+mfUVS#1Z4)eg(Il$oJOO5bM b^YvxW0