From 94de52dd1b1db49825e9d5609d1c3d094544124f Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sun, 10 Nov 2019 15:29:32 -0500 Subject: [PATCH] added radiator enemy --- NPCs/AcidRain/Radiator.cs | 86 +++++++++++++++++++++++++++++++++++++ NPCs/AcidRain/Radiator.png | Bin 0 -> 1124 bytes 2 files changed, 86 insertions(+) create mode 100644 NPCs/AcidRain/Radiator.cs create mode 100644 NPCs/AcidRain/Radiator.png diff --git a/NPCs/AcidRain/Radiator.cs b/NPCs/AcidRain/Radiator.cs new file mode 100644 index 0000000000..4813d0dd23 --- /dev/null +++ b/NPCs/AcidRain/Radiator.cs @@ -0,0 +1,86 @@ +using CalamityMod.Items.Pets; +using CalamityMod.Items.Placeables.Banners; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using System; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using CalamityMod.Buffs.StatDebuffs; +namespace CalamityMod.NPCs.AcidRain +{ + public class Radiator : ModNPC + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Radiator"); + Main.npcFrameCount[npc.type] = 4; + } + + public override void SetDefaults() + { + npc.aiStyle = 67; + npc.damage = 50; + npc.width = 24; + npc.height = 24; + npc.defense = 5; + npc.lifeMax = 200; + npc.knockBackResist = 0f; + for (int k = 0; k < npc.buffImmune.Length; k++) + { + npc.buffImmune[k] = true; + } + npc.value = Item.buyPrice(0, 0, 5, 0); + npc.lavaImmune = false; + npc.noGravity = false; + npc.noTileCollide = false; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + //npc.catchItem = (Main.rand.NextBool(20)) ? (short)ModContent.ItemType() : ItemID.None; + aiType = NPCID.GlowingSnail; + animationType = NPCID.GlowingSnail; + //banner = npc.type; + //bannerItem = ModContent.ItemType(); + } + + public override void AI() + { + Lighting.AddLight(npc.Center, 0.3f, 1.5f, 0.3f); + + int auraSize = 200; //roughly 12 blocks (half the size of Wither Beast aura) + Player player = Main.player[Main.myPlayer]; + if (!player.dead && player.active && (double) (player.Center - npc.Center).Length() < auraSize) + { + player.AddBuff(ModContent.BuffType(), 3, false); + player.AddBuff(BuffID.Poisoned, 2, false); + } + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + if (spawnInfo.playerSafe || !spawnInfo.player.Calamity().ZoneSulphur || !Main.raining) + { + return 0f; + } + return 0.1f; + } + + public override void HitEffect(int hitDirection, double damage) + { + for (int k = 0; k < 5; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 75, hitDirection, -1f, 0, default, 1f); + } + } + + /*public override void OnCatchNPC(Player player, Item item) + { + try + { + } catch + { + return; + } + }*/ + } +} diff --git a/NPCs/AcidRain/Radiator.png b/NPCs/AcidRain/Radiator.png new file mode 100644 index 0000000000000000000000000000000000000000..cab779ed68d77671235803c39aaca294b1d51387 GIT binary patch literal 1124 zcmV-q1e^PbP)Px#AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy24YJ`L;(K){{a7>y{D4^00Xi~L_t(&-tC%8NEJ~W#(y`YM2zfZ zQHmjGxG(~tlpc!+AqrY(n+V#pDksjUkzAG?8@qyx zYL^-rkDhA-VA+Z{0Ib+QY20ACzZ-y>eb-_ip!34r$0Nr78Z+K75*Z_Q-;0UO?Tdqk zvEcaj{R{xB*E|T?@6`eDW6O9fQyMc};Ufn+e;Lp5mk~i3)ineeH?8jg;KlR%M&`;? zs610=FwwVrD*&f&+y(Np$6imoVI;E3Y4&vQ`WbtHm{6wY`vRsOJ{<(|V`}Z$8UQLz z>;>TJ;DB)-{~2klUzY_qe4y0`7=LXtqfBRpMggb{XNw(YtCKE4SeFb27bqkOmGatV`17KUr&M@*;_D^QKVIHQgY2brivF6c@;l0+im?}B$MQ4HndF?b;A$uf_Igz-UX?5Zxvc@jM#m@ zYtMA}*CHVAV_fQ8s2MVuII=R(EmH9iKYRRRM9?U2+FuE{eT*`divPCbWGquUe|_*B zPy#D!A5Obw$rm`RrxqQd0qLLq{@|iP1CwSwoApke2uqGFEd|t8o|GM zP3mh>q)0JG6kXF33f-aSs`2@+&)7;)|~O4^}kzolJ}suxOcXP)4$ zXqh|nl9(u;oq0l`6)nN#Z%TJ(p5XF1w!cxPQuR-UR{?H+BY4Y5WQ@q?h>3{5>1~c> zLXeNq*MwY^qRR9)6XA3G^EHu%P}QI6+a7y?d`|iAL$ewA-|&W!-~5X9_=|BhKL7v# q5_CmabVXQ6MmkS&X=QG7VRUJ4ZU8ZaSnTfr0000