added bucket zombie
(last one on this branch i swear)
This commit is contained in:
1 parent
efe5d3f89f
commit
097cc989ca
9 files changed
+133
-3
No files matched your search
+2
-1
@@ -1776,7 +1776,8 @@ namespace CalamityMod
|
||||
NPCID.SmallBaldZombie,
|
||||
NPCID.BigZombie,
|
||||
NPCID.SmallZombie,
|
||||
NPCID.MaggotZombie
|
||||
NPCID.MaggotZombie,
|
||||
NPCType<BucketZombie>()
|
||||
// halloween zombies not included because they don't drop shackles or zombie arms
|
||||
};
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 374 B |
Binary file not shown.
|
After Width: | Height: | Size: 325 B |
Binary file not shown.
|
After Width: | Height: | Size: 482 B |
Binary file not shown.
|
After Width: | Height: | Size: 550 B |
@@ -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
|
||||
|
||||
@@ -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<ModGore>("BucketZombie").Type, 1f);
|
||||
Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find<ModGore>("BucketZombie2").Type, 1f);
|
||||
Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find<ModGore>("BucketZombie3").Type, 1f);
|
||||
Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find<ModGore>("BucketZombie4").Type, 1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void ModifyNPCLoot(NPCLoot npcLoot)
|
||||
{
|
||||
// Copy over all loot from real Zombies
|
||||
List<IItemDropRule> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
@@ -1346,7 +1346,7 @@ PrepareToShoot:
|
||||
|
||||
if (npc.ai[3] < (float)aiGateValue && (Main.eclipse || !Main.dayTime || (double)npc.position.Y > Main.worldSurface * 16.0 || (Main.invasionType == InvasionID.GoblinArmy && (npcType == NPCID.Yeti || npcType == NPCID.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<RenegadeWarlock>() || 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<BucketZombie>()) && Main.rand.NextBool(1000))
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.ZombieMoan, npc.Center);
|
||||
}
|
||||
@@ -1947,6 +1947,10 @@ PrepareToShoot:
|
||||
{
|
||||
velocityMax = 1.05f;
|
||||
}
|
||||
if (npcType == ModContent.NPCType<BucketZombie>())
|
||||
{
|
||||
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<BucketZombie>())
|
||||
{
|
||||
velocityMax *= 1f + (1f - npc.scale);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user