From 15d2947c33a56b758c1f8dadfc33ab5b262ca823 Mon Sep 17 00:00:00 2001 From: FyloZ Date: Fri, 5 Jun 2020 16:06:36 -0400 Subject: [PATCH] Networking stuff for the Dune Wyrm. Changed Crystal Skull and Red Hot Shackle's sprites --- Content/Decimation.cs | 53 ++++-------- Content/Items/Accessories/CrystalSkull.cs | 10 +-- Content/Items/Accessories/CrystalSkull.png | Bin 524 -> 549 bytes Content/Items/Accessories/RedHotShackle.cs | 1 + Content/Items/Accessories/RedHotShackle.png | Bin 315 -> 381 bytes Content/NPCs/Arachnus/Arachnus.cs | 78 +++++++++++------- .../AncientTombCrawler/AncientTombCrawler.cs | 31 +++++++ Content/NPCs/DuneWyrm/DuneWyrm.cs | 37 ++++++++- Content/Projectiles/Ammonite.cs | 12 +-- Content/Projectiles/Ammonite.png | Bin 375 -> 534 bytes Lib/NPCs/Worm.cs | 12 ++- 11 files changed, 153 insertions(+), 81 deletions(-) diff --git a/Content/Decimation.cs b/Content/Decimation.cs index 5f6d9d5..ec85d42 100644 --- a/Content/Decimation.cs +++ b/Content/Decimation.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.IO; using Decimation.Content.NPCs.Arachnus; using Decimation.Content.NPCs.DuneWyrm; +using Decimation.Content.NPCs.DuneWyrm.AncientTombCrawler; using Decimation.Content.UI; using Decimation.Lib.Util; using Microsoft.Xna.Framework; @@ -15,8 +16,6 @@ namespace Decimation.Content { public class Decimation : Mod { - public static Decimation Instance { set; get; } - public static AmuletSlotState amuletSlotState; private UserInterface amuletSlotInterface; @@ -26,7 +25,7 @@ namespace Decimation.Content { Instance = this; - Properties = new ModProperties() + Properties = new ModProperties { Autoload = true, AutoloadGores = true, @@ -36,6 +35,8 @@ namespace Decimation.Content References.mod = this; } + public static Decimation Instance { set; get; } + public override void Load() { if (!Main.dedServ) @@ -104,22 +105,11 @@ namespace Decimation.Content public override void AddRecipeGroups() { - RecipeGroup gems = new RecipeGroup(() => Lang.misc[37] + " Gem", new int[] - { - ItemID.Amethyst, - ItemID.Topaz, - ItemID.Emerald, - ItemID.Sapphire, - ItemID.Ruby, - ItemID.Diamond, - }); + RecipeGroup gems = new RecipeGroup(() => Lang.misc[37] + " Gem", ItemID.Amethyst, ItemID.Topaz, + ItemID.Emerald, ItemID.Sapphire, ItemID.Ruby, ItemID.Diamond); - RecipeGroup threads = new RecipeGroup(() => Lang.misc[37] + " Thread", new int[] - { - ItemID.BlackThread, - ItemID.GreenThread, - ItemID.PinkThread - }); + RecipeGroup threads = new RecipeGroup(() => Lang.misc[37] + " Thread", ItemID.BlackThread, + ItemID.GreenThread, ItemID.PinkThread); RecipeGroup.RegisterGroup("AnyGem", gems); RecipeGroup.RegisterGroup("AnyThread", threads); @@ -133,20 +123,15 @@ namespace Decimation.Content { case DecimationModMessageType.Arachnus: Arachnus arachnus = (Arachnus) Main.npc[reader.ReadInt32()].modNPC; - if (arachnus != null && arachnus.npc.active) - { - arachnus.HandlePacket(reader); - } - + if (arachnus != null && arachnus.npc.active) arachnus.HandlePacket(reader); break; - case DecimationModMessageType.DuneWorm: + case DecimationModMessageType.DuneWyrm: DuneWyrmHead duneWyrm = (DuneWyrmHead) Main.npc[reader.ReadInt32()].modNPC; - if (duneWyrm != null && duneWyrm.npc.active) - { - // TODO multiplayer - // duneWyrm.HandlePacket(reader); - } - + if (duneWyrm != null && duneWyrm.npc.active) duneWyrm.HandlePacket(reader); + break; + case DecimationModMessageType.AncientTombCrawler: + AncientTombCrawler tombCrawler = (AncientTombCrawler) Main.npc[reader.ReadInt32()].modNPC; + if (tombCrawler != null && tombCrawler.npc.active) tombCrawler.HandlePacket(reader); break; case DecimationModMessageType.SpawnBoss: int type = reader.ReadInt32(); @@ -155,17 +140,15 @@ namespace Decimation.Content if (Main.netMode != 1) NPC.SpawnOnPlayer(player, type); break; - default: - ErrorLogger.Log("DecimationMod: Unknown Message type: " + msgType); - break; } } } - enum DecimationModMessageType : byte + internal enum DecimationModMessageType : byte { Arachnus, - DuneWorm, + DuneWyrm, + AncientTombCrawler, SpawnBoss } } \ No newline at end of file diff --git a/Content/Items/Accessories/CrystalSkull.cs b/Content/Items/Accessories/CrystalSkull.cs index d494d20..b2c4855 100644 --- a/Content/Items/Accessories/CrystalSkull.cs +++ b/Content/Items/Accessories/CrystalSkull.cs @@ -15,11 +15,11 @@ namespace Decimation.Content.Items.Accessories protected override void InitAccessory() { - item.width = 24; - item.height = 24; + item.width = 35; + item.height = 22; item.rare = Rarity.Green.GetRarityValue(); - this.item.value = Item.buyPrice(0, 0, 0, 10); - this.item.defense = 2; + item.value = Item.buyPrice(0, 0, 0, 10); + item.defense = 2; } protected override List GetAdditionalRecipes() @@ -39,7 +39,5 @@ namespace Decimation.Content.Items.Accessories player.AddBuff(BuffID.Thorns, 1); Lighting.AddLight(player.Center, new Vector3(0.9f * 0.6f, 0.9f * 0.1f, 0.9f)); } - - } } \ No newline at end of file diff --git a/Content/Items/Accessories/CrystalSkull.png b/Content/Items/Accessories/CrystalSkull.png index 4f3b294329bd270c434a11dfc6def100f3c53805..983f072aeb2494c91c07b494585b86ff06e4b30e 100644 GIT binary patch literal 549 zcmV+=0^0qFP)po2uxqRb{|YnUvLpjTSdsB=!2=d^xz#>{KC5jU^+FvAENH&a(IAXgv_9D z47wv=Ap!FyEJXA<1i?c4*Fk((P~(UaLKlBP(h^J^Og|$RKT3$1`sU*fnZe;0^+<58 z`FVLU*rm_jd;-&Z9^FCl3CyQ3pC4QC2rRF`2l4TZPanbbjIIDM4ND{czd^)dA%j27 z3`WP?-#-=XgEwFPfN2v|Q80b_A|!-hA!7fL1I+&*&IzVrX$M!x=qU(+)xpx7fsg{2 zk3G#mLuODqMnMviTVP<$$yJW8W+5*~+JU8|%mjTDeI%tBSjY^lW1#MD zU$_^Xt6VH~QG5hT{jicWqih3M9+rz>%vqc)xNj_g^)PB)`q2-fprXyLJ#JPM7I(!Gk--6n5IRD!0dvj8T1l(U>pOp6&gZ> n;uX1EAgGo^1&Eg3AaD!-UD7khf*a76%81h6V-(5CY<2CWd$*_29t+ zpehCs`p*#m>_5YQW(N8HAR$9;OkH}&M2EHR8%s5q> zPa3Ge)zif>B%<~0^s{_T1_CXXC)VD1aZ=*mf8A6W^WA?L4ev@dpL0Bw_T78=6Ti;D{g}6i4(u}y&^-Q;1Oqe3hHD%6{?-KlO_=zvjX%z?i zflUUPvyM#+-#Ed&@dMihhRH4x%mHrNYBCH44VCM6!Zk++lCK|s;K*5+uD-9F~^vw9g+m=73D z5k8tx%3aEM;)tli;(rXaH`n!7F`x3E8>4?pmcf37b$`}F!RzOKp96+6gQu&X%Q~lo FCIEA;)J*^Y diff --git a/Content/Items/Accessories/RedHotShackle.cs b/Content/Items/Accessories/RedHotShackle.cs index d01379e..a1b35ae 100644 --- a/Content/Items/Accessories/RedHotShackle.cs +++ b/Content/Items/Accessories/RedHotShackle.cs @@ -23,6 +23,7 @@ namespace Decimation.Content.Items.Accessories item.value = Item.buyPrice(0, 0, 2); item.defense = 1; } + protected override List GetAdditionalRecipes() { ModRecipe recipe = GetNewModRecipe(this, 1, new List() { TileID.Furnaces }, true); diff --git a/Content/Items/Accessories/RedHotShackle.png b/Content/Items/Accessories/RedHotShackle.png index b165b8ab17f56a2b123b87aefc29e74657ab0499..2f18ac54d0db8f7b10a1ccadf1b5e805758c71af 100644 GIT binary patch delta 365 zcmV-z0h0c^0{sGz8Gi-<007{3J@^0s0YXVcK~zXfwN){0!axwbYoOo(2qc$zK$Hre zKp7->MScKP_yE5MNVwz$2v<=akkS%)L5k2g;+V0OiC0F*=Vq+CJU{1E-Q^+E7thL3Dxo zR4aG67>$6_Wl`MT1!$?xHwyot-a zxXMQ-U~?zpd%DN+ITKsq9Pf|D`{)F;u@ccuswv}Xjv*G_jo$sc2b8LH0&4n#Oin=i5FIcD~vtROmp_TmW(eR0=8H0L==yVQG7&8q7kn;nfnE8%qIJHVbWWBPxG zgJW@%ISzEXwoahZSyJ+i)(4C6O#{v3VTI8MEM_IXyMkK@egVa-g1ffld(r>^002ov LPDHLkV1fVuv?r`e delta 299 zcmey%w3}&yWIZzj1H<)|XHNmCgaDrqS0MfWj8oeGw6rro{J(+WKM*%GG$bS>{09k~ zIrINNL&N_wX&~N~En6HM92y!J7(fVu8!QXR)Ed*xoZJS%tRb@h4;*KZYq(O)8?!<8 z^D2h_r3b#wZIbVw&{M>!*U+^-@Tu6@nHQ+sdF{jWoy~3Dv8e*r cW46hb8E`0U{L1%e7SI6zopr00}^Lj{pDw diff --git a/Content/NPCs/Arachnus/Arachnus.cs b/Content/NPCs/Arachnus/Arachnus.cs index 2301331..7dea76e 100644 --- a/Content/NPCs/Arachnus/Arachnus.cs +++ b/Content/NPCs/Arachnus/Arachnus.cs @@ -54,9 +54,9 @@ namespace Decimation.Content.NPCs.Arachnus public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale); - npc.damage = (int)(npc.damage * 0.6f); - npc.defense = (int)(npc.defense + numPlayers * 2); + npc.lifeMax = (int) (npc.lifeMax * 0.625f * bossLifeScale); + npc.damage = (int) (npc.damage * 0.6f); + npc.defense = (int) (npc.defense + numPlayers * 2); } private bool CheckDispawn() @@ -77,19 +77,20 @@ namespace Decimation.Content.NPCs.Arachnus { // Rotate to player Vector2 moveTo = Main.player[npc.target].Center - npc.Center; - float angle = (float)Math.Atan2(moveTo.Y, moveTo.X); - npc.rotation = (float)(angle + Math.PI * 0.5f); + float angle = (float) Math.Atan2(moveTo.Y, moveTo.X); + npc.rotation = (float) (angle + Math.PI * 0.5f); // Move Vector2 move = moveTo; - float magnitude = (float)Math.Sqrt(move.X * move.X + move.Y * move.Y); + float magnitude = (float) Math.Sqrt(move.X * move.X + move.Y * move.Y); if (magnitude > speed) { move *= speed / magnitude; } + float turnResistance = 50f; move = (npc.velocity * turnResistance + move) / (turnResistance + 1f); - magnitude = (float)Math.Sqrt(move.X * move.X + move.Y * move.Y); + magnitude = (float) Math.Sqrt(move.X * move.X + move.Y * move.Y); if (magnitude > speed) { move *= speed / magnitude; @@ -104,17 +105,23 @@ namespace Decimation.Content.NPCs.Arachnus if (counter % 60 == 0) { int validBlockCount = 0; - for (int i = (int)(-50 + npc.Center.X / 16f); i <= (int)(50 + npc.Center.X / 16f); i++) + for (int i = (int) (-50 + npc.Center.X / 16f); i <= (int) (50 + npc.Center.X / 16f); i++) { - for (int j = (int)(-50 + npc.Center.Y / 16f); j <= (int)(50 + npc.Center.Y / 16f); j++) + for (int j = (int) (-50 + npc.Center.Y / 16f); j <= (int) (50 + npc.Center.Y / 16f); j++) { if (i >= 0 && i <= Main.maxTilesX && j >= 0 && j <= Main.maxTilesY) { - if (Main.tile[i, j].type == ModContent.TileType() || (Main.tile[i, j].type == ModContent.TileType() || Main.tile[i, j].type == ModContent.TileType() || Main.tile[i, j].type == ModContent.TileType()) || Main.tile[i, j].type == ModContent.TileType() || Main.tile[i, j].type == ModContent.TileType()) + if (Main.tile[i, j].type == ModContent.TileType() || + (Main.tile[i, j].type == ModContent.TileType() || + Main.tile[i, j].type == ModContent.TileType() || + Main.tile[i, j].type == ModContent.TileType()) || + Main.tile[i, j].type == ModContent.TileType() || + Main.tile[i, j].type == ModContent.TileType()) validBlockCount++; } } } + if (validBlockCount < 15) tooFarFromShrine = true; else @@ -130,7 +137,10 @@ namespace Decimation.Content.NPCs.Arachnus private void CheckEnraged() { - npc.ai[2] = !Main.player[npc.target].ZoneUnderworldHeight || !Collision.CanHit(npc.Center, 0, 0, Main.player[npc.target].Center, 0, 0) || CheckForShrine() ? 1 : 0; + npc.ai[2] = !Main.player[npc.target].ZoneUnderworldHeight || + !Collision.CanHit(npc.Center, 0, 0, Main.player[npc.target].Center, 0, 0) || CheckForShrine() + ? 1 + : 0; } public override void AI() @@ -152,8 +162,8 @@ namespace Decimation.Content.NPCs.Arachnus // Normal ai if (npc.ai[0] == 0) { - float mouthX = (float)(((npc.height) / 2) * Math.Cos(npc.rotation - Math.PI * 0.5f)) + npc.Center.X; - float mouthY = (float)(((npc.height) / 2) * Math.Sin(npc.rotation - Math.PI * 0.5f)) + npc.Center.Y; + float mouthX = (float) (((npc.height) / 2) * Math.Cos(npc.rotation - Math.PI * 0.5f)) + npc.Center.X; + float mouthY = (float) (((npc.height) / 2) * Math.Sin(npc.rotation - Math.PI * 0.5f)) + npc.Center.Y; //Counter if (npc.life <= npc.lifeMax / 2) counterMax = 1500; @@ -172,32 +182,39 @@ namespace Decimation.Content.NPCs.Arachnus npc.ai[1] = 1; } // Increase speed - else if (counter > 1320 && counter <= 1500 || (Main.expertMode && counter > 600 && counter < 800 && npc.life <= npc.lifeMax / 4)) + else if (counter > 1320 && counter <= 1500 || + (Main.expertMode && counter > 600 && counter < 800 && npc.life <= npc.lifeMax / 4)) { if (counter == 1321) { - Main.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0); - if (Main.netMode == 2) - GetPacket(ArachnusMessageType.RoarSound).Send(); + if (Main.netMode == NetmodeID.SinglePlayer) + Main.PlaySound(SoundID.Roar, (int) npc.position.X, (int) npc.position.Y, 0); + if (Main.netMode == NetmodeID.Server) GetPacket(ArachnusMessageType.RoarSound).Send(); } + npc.ai[1] = 2; } else npc.ai[1] = 99; if (counter % 40 == 0 && npc.ai[1] == 0 && Main.netMode != 1) { - float speedX = (float)(6 * Math.Cos(npc.rotation - Math.PI * 0.5f)) * 2; - float speedY = (float)(6 * Math.Sin(npc.rotation - Math.PI * 0.5f)) * 2; - Projectile.NewProjectile(new Vector2(mouthX, mouthY), new Vector2(speedX, speedY), ModContent.ProjectileType(), 30, 0f); + float speedX = (float) (6 * Math.Cos(npc.rotation - Math.PI * 0.5f)) * 2; + float speedY = (float) (6 * Math.Sin(npc.rotation - Math.PI * 0.5f)) * 2; + Projectile.NewProjectile(new Vector2(mouthX, mouthY), new Vector2(speedX, speedY), + ModContent.ProjectileType(), 30, 0f); } else if (counter % 5 == 0 && npc.ai[1] == 1) { if (Main.netMode != 1) { - float speedX = (float)(7 * Math.Cos(npc.rotation - Math.PI * 0.5f)); - float speedY = (float)(7 * Math.Sin(npc.rotation - Math.PI * 0.5f)); - Projectile.NewProjectile(new Vector2(mouthX, mouthY), new Vector2(speedX, speedY), npc.ai[2] == 1 ? ModContent.ProjectileType() : ModContent.ProjectileType(), 30, 0f, 255); + float speedX = (float) (7 * Math.Cos(npc.rotation - Math.PI * 0.5f)); + float speedY = (float) (7 * Math.Sin(npc.rotation - Math.PI * 0.5f)); + Projectile.NewProjectile(new Vector2(mouthX, mouthY), new Vector2(speedX, speedY), + npc.ai[2] == 1 + ? ModContent.ProjectileType() + : ModContent.ProjectileType(), 30, 0f, 255); } + Main.PlaySound(SoundID.Item34, npc.position); if (Main.netMode == 2) GetPacket(ArachnusMessageType.FlamesSound).Send(); @@ -245,6 +262,7 @@ namespace Decimation.Content.NPCs.Arachnus writer.Write(counterMax); writer.Write(speed); } + public override void ReceiveExtraAI(BinaryReader reader) { counter = reader.ReadInt32(); @@ -255,18 +273,19 @@ namespace Decimation.Content.NPCs.Arachnus private ModPacket GetPacket(ArachnusMessageType type) { ModPacket packet = mod.GetPacket(); - packet.Write((byte)DecimationModMessageType.Arachnus); + packet.Write((byte) DecimationModMessageType.Arachnus); packet.Write(npc.whoAmI); - packet.Write((byte)type); + packet.Write((byte) type); return packet; } + public void HandlePacket(BinaryReader reader) { - ArachnusMessageType type = (ArachnusMessageType)reader.ReadByte(); + ArachnusMessageType type = (ArachnusMessageType) reader.ReadByte(); switch (type) { case ArachnusMessageType.RoarSound: - Main.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0); + Main.PlaySound(SoundID.Roar, (int) npc.position.X, (int) npc.position.Y, 0); break; case ArachnusMessageType.FlamesSound: Main.PlaySound(SoundID.Item34, npc.position); @@ -280,6 +299,7 @@ namespace Decimation.Content.NPCs.Arachnus { target.AddBuff(ModContent.BuffType(), 900); } + base.OnHitPlayer(target, damage, crit); } @@ -288,7 +308,7 @@ namespace Decimation.Content.NPCs.Arachnus npc.frameCounter += 3f; if (npc.frameCounter >= 40) npc.frameCounter = 0; - npc.frame.Y = ((int)npc.frameCounter / 10) * frameHeight; + npc.frame.Y = ((int) npc.frameCounter / 10) * frameHeight; } public override void NPCLoot() @@ -356,4 +376,4 @@ namespace Decimation.Content.NPCs.Arachnus FlamesSound } } -} +} \ No newline at end of file diff --git a/Content/NPCs/DuneWyrm/AncientTombCrawler/AncientTombCrawler.cs b/Content/NPCs/DuneWyrm/AncientTombCrawler/AncientTombCrawler.cs index abab822..ff3ccc1 100644 --- a/Content/NPCs/DuneWyrm/AncientTombCrawler/AncientTombCrawler.cs +++ b/Content/NPCs/DuneWyrm/AncientTombCrawler/AncientTombCrawler.cs @@ -1,3 +1,4 @@ +using System.IO; using Decimation.Content.Items.Misc.Souls; using Decimation.Lib.NPCs; using Microsoft.Xna.Framework; @@ -142,5 +143,35 @@ namespace Decimation.Content.NPCs.DuneWyrm.AncientTombCrawler npc.HitSound = SoundID.NPCHit1; undergroundSound = mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/Earthquake"); } + + protected override void SendSoundPacket() + { + GetPacket(AncientTombCrawlerMessageType.UndergroundSound).Send(); + } + + private ModPacket GetPacket(AncientTombCrawlerMessageType type) + { + ModPacket packet = mod.GetPacket(); + packet.Write((byte) DecimationModMessageType.AncientTombCrawler); + packet.Write(npc.whoAmI); + packet.Write((byte) type); + return packet; + } + + public void HandlePacket(BinaryReader reader) + { + AncientTombCrawlerMessageType type = (AncientTombCrawlerMessageType) reader.ReadByte(); + switch (type) + { + case AncientTombCrawlerMessageType.UndergroundSound: + Main.PlaySound(undergroundSound, npc.Center); + break; + } + } + } + + public enum AncientTombCrawlerMessageType + { + UndergroundSound } } \ No newline at end of file diff --git a/Content/NPCs/DuneWyrm/DuneWyrm.cs b/Content/NPCs/DuneWyrm/DuneWyrm.cs index 70e9145..17b719c 100644 --- a/Content/NPCs/DuneWyrm/DuneWyrm.cs +++ b/Content/NPCs/DuneWyrm/DuneWyrm.cs @@ -15,7 +15,6 @@ namespace Decimation.Content.NPCs.DuneWyrm [AutoloadBossHead] internal class DuneWyrmHead : DuneWyrm { - private int _attackCounter; private int _previousTile = -1; private bool _spawnedAncientTombCrawler; @@ -65,12 +64,14 @@ namespace Decimation.Content.NPCs.DuneWyrm public override void SendExtraAI(BinaryWriter writer) { - writer.Write(_attackCounter); + writer.Write(_previousTile); + writer.Write(_spawnedAncientTombCrawler); } public override void ReceiveExtraAI(BinaryReader reader) { - _attackCounter = reader.ReadInt32(); + _previousTile = reader.ReadInt32(); + _spawnedAncientTombCrawler = reader.ReadBoolean(); } public override void CustomBehavior() @@ -289,5 +290,35 @@ namespace Decimation.Content.NPCs.DuneWyrm npc.HitSound = SoundID.NPCHit1; undergroundSound = mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/Earthquake"); } + + protected override void SendSoundPacket() + { + GetPacket(DuneWyrmMessageType.UndergroundSound).Send(); + } + + private ModPacket GetPacket(DuneWyrmMessageType type) + { + ModPacket packet = mod.GetPacket(); + packet.Write((byte) DecimationModMessageType.DuneWyrm); + packet.Write(npc.whoAmI); + packet.Write((byte) type); + return packet; + } + + public void HandlePacket(BinaryReader reader) + { + DuneWyrmMessageType type = (DuneWyrmMessageType) reader.ReadByte(); + switch (type) + { + case DuneWyrmMessageType.UndergroundSound: + Main.PlaySound(undergroundSound, npc.Center); + break; + } + } + } + + public enum DuneWyrmMessageType + { + UndergroundSound } } \ No newline at end of file diff --git a/Content/Projectiles/Ammonite.cs b/Content/Projectiles/Ammonite.cs index a1a42cd..7e2f70b 100644 --- a/Content/Projectiles/Ammonite.cs +++ b/Content/Projectiles/Ammonite.cs @@ -6,12 +6,12 @@ namespace Decimation.Content.Projectiles { protected override void Init() { - this.projectile.CloneDefaults(ProjectileID.SpikyBall); - this.projectile.damage = 30; - this.projectile.width = 10; - this.projectile.height = 16; - this.projectile.friendly = false; - this.projectile.hostile = true; + projectile.CloneDefaults(ProjectileID.SpikyBall); + projectile.damage = 30; + projectile.width = 36; + projectile.height = 32; + projectile.friendly = false; + projectile.hostile = true; } } } \ No newline at end of file diff --git a/Content/Projectiles/Ammonite.png b/Content/Projectiles/Ammonite.png index 58cf7df092956e44d19dae6513917c2170a2e115..f3d71e714cb88630324f80e695bb199befa5807c 100644 GIT binary patch literal 534 zcmV+x0_pvUP)M{J6H5R7NOTL8u*73*0qKND=1sF6(z@@)GL1AhlIoGav&3s^yrVuO^vP61||Y za@msSZa}7Z?i)%f9$knXI5}NG=g|CV{eygvz7r*>Vv~G2NK7t3C(_z z(7zGHV*q5>zPEpD#CCT!oKpeU(w_PpeA_iU4@E18w~h&@cNoVhLWl>M(&&(xo?4w^LeU7~TEbl6GqNJYzt=FK zQ9FuE`uI=|y(FkIpEYL@a$@u*7Jow*_UJ3dI Yf2LV8WRktT00000NkvXXu0mjf0D-siwEzGB literal 375 zcmV--0f_#IP)Rr8TkU1SEO@5^QX|fR*R4;sQ1{l6U|~JOQ<#rX*-+tRQHvodJdi3PsIdN`CfViN|_0|GnFj?ME-&%AgWK#Z_%BX4Fn-U6}!8= zj#HOgxoqr^1i8;$$_&GaK&g328W3Nu3=o|=3iNB^Q$8l5UZ0*1Q`zLwvPSpNhmv0_ zpEyE|UWz|M%3W{v;jD8~y7=_B1XSsK^PhvBAqg~|z614zKpe_{eqa8?@?V@{zXPZ( VMiJ?InE(I)07*qoM6N<$f&f#mp(g+U diff --git a/Lib/NPCs/Worm.cs b/Lib/NPCs/Worm.cs index 673bb9a..dbcdbc9 100644 --- a/Lib/NPCs/Worm.cs +++ b/Lib/NPCs/Worm.cs @@ -3,6 +3,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; +using Terraria.ID; using Terraria.ModLoader; namespace Decimation.Lib.NPCs @@ -233,8 +234,13 @@ namespace Decimation.Lib.NPCs { if (!flies && npc.behindTiles && npc.soundDelay == 0) { - npc.soundDelay = 120; - Main.PlaySound(undergroundSound, npc.position); + if (Main.netMode != NetmodeID.MultiplayerClient) + { + npc.soundDelay = 120; + + Main.PlaySound(undergroundSound, npc.position); + if(Main.netMode == NetmodeID.Server) SendSoundPacket(); + } } num193 = (float) Math.Sqrt(num191 * num191 + num192 * num192); @@ -440,5 +446,7 @@ namespace Decimation.Lib.NPCs 0f ); } + + protected abstract void SendSoundPacket(); } } \ No newline at end of file