From 097cc989ca49dd43f355512e6b003aafac51f77c Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Wed, 18 Sep 2024 02:14:30 -0700 Subject: [PATCH] added bucket zombie (last one on this branch i swear) --- CalamityLists.cs | 3 +- Gores/BucketZombie/BucketZombie.png | Bin 0 -> 374 bytes Gores/BucketZombie/BucketZombie2.png | Bin 0 -> 325 bytes Gores/BucketZombie/BucketZombie3.png | Bin 0 -> 482 bytes Gores/BucketZombie/BucketZombie4.png | Bin 0 -> 550 bytes .../en-US/Mods.CalamityMod.NPCs.hjson | 1 + NPCs/NormalNPCs/BucketZombie.cs | 124 ++++++++++++++++++ NPCs/NormalNPCs/BucketZombie.png | Bin 0 -> 1748 bytes .../RegularEnemies/RevengeanceAndDeathAI.cs | 8 +- 9 files changed, 133 insertions(+), 3 deletions(-) create mode 100644 Gores/BucketZombie/BucketZombie.png create mode 100644 Gores/BucketZombie/BucketZombie2.png create mode 100644 Gores/BucketZombie/BucketZombie3.png create mode 100644 Gores/BucketZombie/BucketZombie4.png create mode 100644 NPCs/NormalNPCs/BucketZombie.cs create mode 100644 NPCs/NormalNPCs/BucketZombie.png diff --git a/CalamityLists.cs b/CalamityLists.cs index ef301ee5e9..4c52812920 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -1776,7 +1776,8 @@ namespace CalamityMod NPCID.SmallBaldZombie, NPCID.BigZombie, NPCID.SmallZombie, - NPCID.MaggotZombie + NPCID.MaggotZombie, + NPCType() // halloween zombies not included because they don't drop shackles or zombie arms }; diff --git a/Gores/BucketZombie/BucketZombie.png b/Gores/BucketZombie/BucketZombie.png new file mode 100644 index 0000000000000000000000000000000000000000..ad58d14616f2b5896df05db2183adb6755d776d6 GIT binary patch literal 374 zcmeAS@N?(olHy`uVBq!ia0vp^0zfRp!3HFQtmCqP6k~CayA#8@b22Z19F}xPUq=Rp zjs4tz5?O(AY@RNTAr}70DGf}8g^3#6OiN}&9{jR-|Nj5Y8L44q8*c61U*DwBHeLUI zQ>L1MC*y%?=-a;>;H-foif-kQC8^JKl_^pP0qLim4tT5pLvk*i@%I< z^#YC=@^h2;migyZ@GRqx+s(Hukzt143K6!dE&=KP|Npf)u;mGF^dDYc~Vih8r#10f$+6coR$sxh%Yt5GtJkRK?}&{0Adih6g(M3 NdAjNn{1`uX?&ThFJI~i-?P-F))_$78=xkK6d(l0-H$3#(!-FEI$>${O(Wanm@5w z(8d1uXYMoUOp`+xddj{>$&6x*lN?TfNTyR27yb# PlR=cHtDnm{r-UW|R1$p4 literal 0 HcmV?d00001 diff --git a/Gores/BucketZombie/BucketZombie3.png b/Gores/BucketZombie/BucketZombie3.png new file mode 100644 index 0000000000000000000000000000000000000000..5706ea8e3da3114f4965129e0d7b5bf89cc2319b GIT binary patch literal 482 zcmeAS@N?(olHy`uVBq!ia0vp^B0wz0!3HD`IPL*ajKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCh9%ZE0$YWGpC{EdxS3`wFuBU0 ztT%n9WOUQdn(Ok7FHP^yYs!?Ekob&c_m`9R-zV6eS-PcIQDDIipHrS3KJ_!J7<~@M zNE}k-T{ba>r%dy2%#46nyw4Uir~kg!nEAy(G&PBN_lK|h;}h(z#-30*!Cd(8xBiNk zD_7@=&)8S`T5iU?!xI>nNiIl~HWKw|jN$qwsdH`Rd#44b1Cqqqp6#pQPF=_p5#g08 z-H=%_J;;9A(W9*g)!yHV=My`?`t6M!|FXoFMdv@KCrHT#+;24$oUmbc#S^U?OTEjk zHvBYTD3;WDj9l`-8DeQ^+BZyI9a_L6L-!0Rux?Opj|jqvUpAZ1AN0@?kEP)Px#1ZP1_K>z@;j|==^1poj6wn;=mR7gv`)xS#uVHgK+EfGbylq}5*Ga@*Xeo!>z zkQcSKw6@if&=hUa5N?qKMGg%uZDoW1fQ7iURixyQ2z6>H#z`n@lzi`=$ZKf2`wo8I z_rT+M-h1CWtwt7(o0mpn91aKMdHxFnDaqt5bh(Cbk8Jh{b4sC5f*tr(Fh3pm{fm(4 zGQ)~cYO6R9Scj}<492b!Fu1z~Dg912?)mbZ!Cd(cCMKsbu-l!mR{cQb9`6+9+?*&? zo=V=q{A&eXUYtR8bOuJwPat)oUI(q9@>$;kCM-JwIlm85Xzk=k##U?>D>7txxh z9&RB0k1979Oe&oNuh%0Ew4KmkG(o5In#wd9ZSN%cIiXHy-|O`T{IOoIVXk}!l7I5+ zgd+@Nfr3zO>&RkeAblTN!9CUg9{d-1M>?JO%$m(lbVR$S6*W81Xubgrl#ubweT&Qh o000hUSV?A0O#mtY000O800000007cclK=n!07*qoM6N<$g3ycUq5uE@ literal 0 HcmV?d00001 diff --git a/Localization/en-US/Mods.CalamityMod.NPCs.hjson b/Localization/en-US/Mods.CalamityMod.NPCs.hjson index 21097320aa..52c4a3888f 100644 --- a/Localization/en-US/Mods.CalamityMod.NPCs.hjson +++ b/Localization/en-US/Mods.CalamityMod.NPCs.hjson @@ -150,6 +150,7 @@ AuroraSpirit.DisplayName: Aurora Spirit BloodlettingServant.DisplayName: Bloodletting Servant BloomSlime.DisplayName: Bloom Slime Bohldohr.DisplayName: Bohldohr +BucketZombie.DisplayName: "{$NPCName.Zombie}" CladCrab.DisplayName: Clad Crab Cnidrion.DisplayName: Cnidrion CrawlerAmber.DisplayName: Amber Crawler diff --git a/NPCs/NormalNPCs/BucketZombie.cs b/NPCs/NormalNPCs/BucketZombie.cs new file mode 100644 index 0000000000..824b6ebfc2 --- /dev/null +++ b/NPCs/NormalNPCs/BucketZombie.cs @@ -0,0 +1,124 @@ +using System.Collections.Generic; +using CalamityMod.Projectiles.Summon; +using CalamityMod.World; +using Terraria; +using Terraria.Audio; +using Terraria.GameContent.Bestiary; +using Terraria.GameContent.ItemDropRules; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ModLoader.Utilities; +namespace CalamityMod.NPCs.NormalNPCs +{ + // This is intended to be a new variant for the vanilla Zombie + public class BucketZombie : ModNPC + { + public override void SetStaticDefaults() + { + Main.npcFrameCount[NPC.type] = 3; + NPCID.Sets.Zombies[Type] = true; + } + + public override void SetDefaults() + { + AIType = NPCID.Zombie; + AnimationType = NPCID.Zombie; + NPC.aiStyle = NPCAIStyleID.Fighter; + NPC.CloneDefaults(NPCID.Zombie); + NPC.lifeMax = 50; + NPC.defense = 15; + NPC.damage = 16; + NPC.knockBackResist = 0.45f; + NPC.value = Item.buyPrice(0, 0, 1, 0); + Banner = NPCID.Zombie; + BannerItem = ItemID.ZombieBanner; + NPC.Calamity().VulnerableToHeat = true; + NPC.Calamity().VulnerableToCold = true; + NPC.Calamity().VulnerableToSickness = true; + + // Scale stats in Expert and Master + CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); + CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); + } + + public override bool PreAI() + { + if (CalamityWorld.revenge) + { + VanillaNPCAIOverrides.RegularEnemies.RevengeanceAndDeathAI.BuffedFighterAI(NPC, Mod); + return false; + } + return true; + } + + public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) + { + bestiaryEntry.Info.AddRange(new IBestiaryInfoElement[] + { + BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime, + BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, + new FlavorTextBestiaryInfoElement("CommonBestiaryFlavor.Zombie") + }); + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + if (spawnInfo.PlayerSafe || spawnInfo.Player.Calamity().ZoneSulphur) + { + return 0f; + } + return SpawnCondition.OverworldNightMonster.Chance * 0.05f; + } + + 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); + } + if (NPC.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); + } + if (Main.netMode != NetmodeID.Server) + { + Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("BucketZombie").Type, 1f); + Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("BucketZombie2").Type, 1f); + Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("BucketZombie3").Type, 1f); + Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("BucketZombie4").Type, 1f); + } + } + } + + public override void ModifyNPCLoot(NPCLoot npcLoot) + { + // Copy over all loot from real Zombies + List zombieRules = Main.ItemDropsDB.GetRulesForNPCID(NPCID.Zombie, false); + foreach (var v in zombieRules) + { + npcLoot.Add(v); + } + npcLoot.Add(ItemID.EmptyBucket, 10); + } + + public override void ModifyHitByProjectile(Projectile projectile, ref NPC.HitModifiers modifiers) + { + // Takes greatly reduced damage from sentries because thats how it is in Plants versus Zombies + // Pumpoem will be none the wiser + if (projectile.IsMinionOrSentryRelated) + { + modifiers.SourceDamage *= 0.05f; + SoundEngine.PlaySound(SoundID.NPCHit4 with { Pitch = -1, Volume = 0.8f }, NPC.Center); + + // Just straight up reflect them in gfb + if (Main.zenithWorld) + { + projectile.velocity *= -1; + modifiers.SetMaxDamage(1); + } + } + } + } +} diff --git a/NPCs/NormalNPCs/BucketZombie.png b/NPCs/NormalNPCs/BucketZombie.png new file mode 100644 index 0000000000000000000000000000000000000000..9a24d612491e9b7ff1989db76c5edfe625ccd5c2 GIT binary patch literal 1748 zcmV;_1}piAP)Px#1ZP1_K>z@;j|==^1pojBWJyFpRCr$PoLy{FWf;f%LARE&vazlEfFVP4YzTrH zGy(z%c%cbdvJhk9g+@$>TzFxkiSbVK!bIYYiHRhVsPRIH$|aH@A(%*vii8!0ItH?_ zZnImvkFvJZ)Bkh+OZ#LeOm94AzQ3gT_qDXA=jZ!%&O`D0{w15YJc6vRk0Zy%l0`hR z85-#bavj4+`VfXlCW=RXoQ?OeF7N{M?Gf50w!KO@G=^t{lszPd$Tjh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ID.ElfArcher)) || (Main.invasionType == InvasionID.GoblinArmy && (npcType == NPCID.GoblinPeon || npcType == NPCID.GoblinThief || npcType == NPCID.GoblinWarrior || npcType == NPCID.GoblinArcher || npcType == NPCID.GoblinSummoner)) || (npcType == NPCID.GoblinScout || (Main.invasionType == InvasionID.PirateInvasion && npcType >= 212 && npcType <= 216)) || (Main.invasionType == InvasionID.MartianMadness && (npcType == NPCID.BrainScrambler || npcType == NPCID.RayGunner || npcType == NPCID.MartianOfficer || npcType == NPCID.GrayGrunt || npcType == NPCID.MartianEngineer || npcType == NPCID.GigaZapper || npcType == NPCID.Scutlix || npcType == NPCID.MartianWalker)) || (npcType == NPCID.AngryBones || npcType == NPCID.AngryBonesBig || npcType == NPCID.AngryBonesBigMuscle || npcType == NPCID.AngryBonesBigHelmet || npcType == NPCID.CorruptBunny || npcType == NPCID.Crab || npcType == NPCID.ArmoredSkeleton || npcType == NPCID.Mummy || npcType == NPCID.DarkMummy || npcType == NPCID.LightMummy || npcType == NPCID.SkeletonArcher || npcType == NPCID.ChaosElemental || npcType == ModContent.NPCType() || npcType == NPCID.CorruptPenguin || npcType == NPCID.FaceMonster || npcType == NPCID.SnowFlinx || npcType == NPCID.Lihzahrd || npcType == NPCID.LihzahrdCrawler || npcType == NPCID.IcyMerman || npcType == NPCID.CochinealBeetle || npcType == NPCID.CyanBeetle || npcType == NPCID.LacBeetle || npcType == NPCID.SeaSnail || npcType == NPCID.BloodCrawler || npcType == NPCID.IceGolem || npcType == NPCID.ZombieMushroom || npcType == NPCID.ZombieMushroomHat || npcType == NPCID.AnomuraFungus || npcType == NPCID.MushiLadybug || npcType == NPCID.SkeletonSniper || npcType == NPCID.TacticalSkeleton || npcType == NPCID.SkeletonCommando || npcType == NPCID.CultistArcherBlue || npcType == NPCID.CultistArcherWhite || npcType == NPCID.CrimsonBunny || npcType == NPCID.CrimsonPenguin || npcType == NPCID.NebulaSoldier || (npcType == NPCID.StardustSoldier && (npc.ai[1] >= 180f || npc.ai[1] < 90f))) || (npcType == NPCID.StardustSpiderBig || npcType == NPCID.VortexRifleman || npcType == NPCID.VortexSoldier || npcType == NPCID.VortexHornet || npcType == NPCID.VortexLarva || npcType == NPCID.WalkingAntlion || npcType == NPCID.SolarDrakomire || npcType == NPCID.SolarSolenian || (npcType >= 524 && npcType <= 527)) || npcType == NPCID.DesertLamiaLight || npcType == NPCID.DesertLamiaDark || npcType == NPCID.DesertScorpionWalk || npcType == NPCID.DesertBeast)) { - if ((npcType == NPCID.Zombie || npcType == NPCID.ZombieXmas || npcType == NPCID.ZombieSweater || npcType == NPCID.Skeleton || (npcType >= NPCID.BoneThrowingSkeleton && npcType <= NPCID.BoneThrowingSkeleton4) || npcType == NPCID.AngryBones || npcType == NPCID.AngryBonesBig || npcType == NPCID.AngryBonesBigHelmet || npcType == NPCID.AngryBonesBigMuscle || npcType == NPCID.ArmoredSkeleton || npcType == NPCID.SkeletonArcher || npcType == NPCID.BaldZombie || npcType == NPCID.UndeadViking || npcType == NPCID.ZombieEskimo || npcType == NPCID.Frankenstein || npcType == NPCID.PincushionZombie || npcType == NPCID.SlimedZombie || npcType == NPCID.SwampZombie || npcType == NPCID.TwiggyZombie || npcType == NPCID.ArmoredViking || npcType == NPCID.FemaleZombie || npcType == NPCID.HeadacheSkeleton || npcType == NPCID.MisassembledSkeleton || npcType == NPCID.PantlessSkeleton || npcType == NPCID.ZombieRaincoat || npcType == NPCID.SkeletonSniper || npcType == NPCID.TacticalSkeleton || npcType == NPCID.SkeletonCommando || npcType == NPCID.ZombieSuperman || npcType == NPCID.ZombiePixie || npcType == NPCID.ZombieDoctor || npcType == NPCID.GreekSkeleton) && Main.rand.NextBool(1000)) + if ((npcType == NPCID.Zombie || npcType == NPCID.ZombieXmas || npcType == NPCID.ZombieSweater || npcType == NPCID.Skeleton || (npcType >= NPCID.BoneThrowingSkeleton && npcType <= NPCID.BoneThrowingSkeleton4) || npcType == NPCID.AngryBones || npcType == NPCID.AngryBonesBig || npcType == NPCID.AngryBonesBigHelmet || npcType == NPCID.AngryBonesBigMuscle || npcType == NPCID.ArmoredSkeleton || npcType == NPCID.SkeletonArcher || npcType == NPCID.BaldZombie || npcType == NPCID.UndeadViking || npcType == NPCID.ZombieEskimo || npcType == NPCID.Frankenstein || npcType == NPCID.PincushionZombie || npcType == NPCID.SlimedZombie || npcType == NPCID.SwampZombie || npcType == NPCID.TwiggyZombie || npcType == NPCID.ArmoredViking || npcType == NPCID.FemaleZombie || npcType == NPCID.HeadacheSkeleton || npcType == NPCID.MisassembledSkeleton || npcType == NPCID.PantlessSkeleton || npcType == NPCID.ZombieRaincoat || npcType == NPCID.SkeletonSniper || npcType == NPCID.TacticalSkeleton || npcType == NPCID.SkeletonCommando || npcType == NPCID.ZombieSuperman || npcType == NPCID.ZombiePixie || npcType == NPCID.ZombieDoctor || npcType == NPCID.GreekSkeleton || npcType == ModContent.NPCType()) && Main.rand.NextBool(1000)) { SoundEngine.PlaySound(SoundID.ZombieMoan, npc.Center); } @@ -1947,6 +1947,10 @@ PrepareToShoot: { velocityMax = 1.05f; } + if (npcType == ModContent.NPCType()) + { + velocityMax = 0.85f; + } if (npcType == NPCID.BloodZombie) { float playerDistance = (Main.player[npc.target].Center - npc.Center).Length(); @@ -1965,7 +1969,7 @@ PrepareToShoot: } velocityMax *= 0.8f; } - if (npcType == NPCID.BloodZombie || npcType == NPCID.Zombie || npcType == NPCID.BaldZombie || npcType == NPCID.PincushionZombie || npcType == NPCID.SlimedZombie || npcType == NPCID.SwampZombie || npcType == NPCID.TwiggyZombie || npcType == NPCID.FemaleZombie || npcType == NPCID.ZombieRaincoat || npcType == NPCID.ZombieXmas || npcType == NPCID.ZombieSweater) + if (npcType == NPCID.BloodZombie || npcType == NPCID.Zombie || npcType == NPCID.BaldZombie || npcType == NPCID.PincushionZombie || npcType == NPCID.SlimedZombie || npcType == NPCID.SwampZombie || npcType == NPCID.TwiggyZombie || npcType == NPCID.FemaleZombie || npcType == NPCID.ZombieRaincoat || npcType == NPCID.ZombieXmas || npcType == NPCID.ZombieSweater || npcType == ModContent.NPCType()) { velocityMax *= 1f + (1f - npc.scale); }