From c1f853a9f0279cd3ce503b2fb2fd980bcab8be22 Mon Sep 17 00:00:00 2001 From: NalydddNobel Date: Fri, 30 Dec 2022 14:10:14 -0800 Subject: [PATCH] misc changes --- Items/Weapons/Melee/PhaseDisc.cs | 2 +- NPCs/AequusNPC.cs | 10 +++ NPCs/Friendly/Critter/OblivisionCritter.cs | 4 +- NPCs/GlobalNPCs/SpawnsManager.cs | 37 ++++++++-- NPCs/Monsters/Sky/GaleStreams/RedSprite.cs | 6 +- NPCs/Monsters/Sky/GaleStreams/SpaceSquid.cs | 64 ++++++++++++++++-- .../Sky/GaleStreams/SpaceSquidFriendly.png | Bin 0 -> 1241 bytes .../RedSpriteProjs/RedSpriteThunderClap.cs | 2 +- Tiles/AequusTile.cs | 1 - 9 files changed, 106 insertions(+), 20 deletions(-) create mode 100644 NPCs/Monsters/Sky/GaleStreams/SpaceSquidFriendly.png diff --git a/Items/Weapons/Melee/PhaseDisc.cs b/Items/Weapons/Melee/PhaseDisc.cs index 010a25817..79d25a0ec 100644 --- a/Items/Weapons/Melee/PhaseDisc.cs +++ b/Items/Weapons/Melee/PhaseDisc.cs @@ -54,7 +54,7 @@ public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, public override void AddRecipes() { CreateRecipe() - .AddIngredient(ItemID.LightDisc, 5) + .AddIngredient() .AddIngredient() .AddIngredient() .AddTile(TileID.MythrilAnvil) diff --git a/NPCs/AequusNPC.cs b/NPCs/AequusNPC.cs index ad11d280f..b882da26e 100644 --- a/NPCs/AequusNPC.cs +++ b/NPCs/AequusNPC.cs @@ -422,6 +422,16 @@ public override void PostAI(NPC npc) public override void DrawEffects(NPC npc, ref Color drawColor) { + if (npc.HasBuff()) + { + if (Main.GameUpdateCount % 9 == 0) + { + var d = Dust.NewDustDirect(npc.position, npc.width, npc.height, DustID.IceRod, Scale: Main.rand.NextFloat(0.6f, 1f)); + d.velocity = npc.velocity * 0.5f; + d.noGravity = true; + d.fadeIn = d.scale + 0.5f; + } + } if (npc.HasBuff()) { byte a = drawColor.A; diff --git a/NPCs/Friendly/Critter/OblivisionCritter.cs b/NPCs/Friendly/Critter/OblivisionCritter.cs index 129a57840..1bfc4c908 100644 --- a/NPCs/Friendly/Critter/OblivisionCritter.cs +++ b/NPCs/Friendly/Critter/OblivisionCritter.cs @@ -1,5 +1,4 @@ -using Aequus.Items.Consumables.Critters; -using Aequus.Particles.Dusts; +using Aequus.Particles.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -20,7 +19,6 @@ public class OblivisionCritter : ModNPC public override void SetStaticDefaults() { Main.npcFrameCount[Type] = 10; - Main.npcCatchable[Type] = true; NPCID.Sets.CountsAsCritter[Type] = true; NPCID.Sets.TrailingMode[Type] = 7; NPCID.Sets.TrailCacheLength[Type] = 14; diff --git a/NPCs/GlobalNPCs/SpawnsManager.cs b/NPCs/GlobalNPCs/SpawnsManager.cs index b318bdee6..9eb144896 100644 --- a/NPCs/GlobalNPCs/SpawnsManager.cs +++ b/NPCs/GlobalNPCs/SpawnsManager.cs @@ -2,6 +2,7 @@ using Aequus.Biomes.Glimmer; using Aequus.Common.ModPlayers; using Aequus.NPCs.Friendly.Critter; +using Aequus.NPCs.Friendly.Town; using Aequus.NPCs.Monsters.CrabCrevice; using Aequus.NPCs.Monsters.Night; using Aequus.NPCs.Monsters.Night.Glimmer; @@ -40,10 +41,18 @@ public override void EditSpawnRate(Player player, ref int spawnRate, ref int max maxSpawns = 0; return; } - if (player.ZoneSkyHeight && GaleStreamsBiome.TimeForMeteorSpawns()) + if (player.ZoneSkyHeight) { - spawnRate /= 2; - maxSpawns *= 2; + if (GaleStreamsBiome.TimeForMeteorSpawns()) + { + spawnRate /= 2; + maxSpawns *= 2; + } + if (IsClose(player)) + { + spawnRate *= 3; + maxSpawns /= 3; + } } if (player.GetModPlayer().ZoneGaleStreams) { @@ -109,8 +118,11 @@ public static void GaleStreamsEnemies(IDictionary pool, NPCSpawnInfo AdjustSpawns(pool, MathHelper.Lerp(1f, 0.25f, SpawnCondition.Sky.Chance)); if (Aequus.HardmodeTier && !(IsClose(spawnInfo.Player) || IsClose(spawnInfo.Player))) { - pool.Add(ModContent.NPCType(), 0.06f * SpawnCondition.Sky.Chance); - pool.Add(ModContent.NPCType(), 0.06f * SpawnCondition.Sky.Chance); + //pool.Add(ModContent.NPCType(), 0.06f * SpawnCondition.Sky.Chance); + if (!AequusWorld.downedSpaceSquid) + { + pool.Add(ModContent.NPCType(), 0.06f * SpawnCondition.Sky.Chance); + } } if (!NPC.AnyNPCs(ModContent.NPCType())) pool.Add(ModContent.NPCType(), 1f * SpawnCondition.Sky.Chance); @@ -163,6 +175,21 @@ public override void EditSpawnPool(IDictionary pool, NPCSpawnInfo sp { GaleStreamsEnemies(pool, spawnInfo); } + if (spawnInfo.Player.ZoneSkyHeight) + { + if (AequusWorld.downedSpaceSquid && !IsClose(spawnInfo.Player)) + { + if (Main.tile[spawnInfo.SpawnTileX, spawnInfo.SpawnTileY + 1].IsFullySolid()) + { + pool.Add(ModContent.NPCType(), 0.1f); + AequusHelpers.dustDebug(spawnInfo.SpawnTileX, spawnInfo.SpawnTileY + 1, DustID.CursedTorch); + } + else + { + AequusHelpers.dustDebug(spawnInfo.SpawnTileX, spawnInfo.SpawnTileY + 1); + } + } + } if (!Main.dayTime && surface) { if (GlimmerBiome.EventActive) diff --git a/NPCs/Monsters/Sky/GaleStreams/RedSprite.cs b/NPCs/Monsters/Sky/GaleStreams/RedSprite.cs index f17c8b9c0..a436ede45 100644 --- a/NPCs/Monsters/Sky/GaleStreams/RedSprite.cs +++ b/NPCs/Monsters/Sky/GaleStreams/RedSprite.cs @@ -72,12 +72,8 @@ public override void SetStaticDefaults() SpecificallyImmuneTo = new int[] { BuffID.OnFire, - BuffID.CursedInferno, - BuffID.Ichor, - BuffID.ShadowFlame, + BuffID.OnFire3, BuffID.Bleeding, - BuffID.Frostburn, - BuffID.Frostburn2, } }); diff --git a/NPCs/Monsters/Sky/GaleStreams/SpaceSquid.cs b/NPCs/Monsters/Sky/GaleStreams/SpaceSquid.cs index 0dc6a808e..590920d9f 100644 --- a/NPCs/Monsters/Sky/GaleStreams/SpaceSquid.cs +++ b/NPCs/Monsters/Sky/GaleStreams/SpaceSquid.cs @@ -1,5 +1,6 @@ using Aequus; using Aequus.Biomes; +using Aequus.Buffs.Debuffs; using Aequus.Graphics; using Aequus.Items.Armor.Vanity; using Aequus.Items.Misc; @@ -62,13 +63,12 @@ public override void SetStaticDefaults() { SpecificallyImmuneTo = new int[] { - BuffID.OnFire, - BuffID.CursedInferno, - BuffID.Ichor, - BuffID.ShadowFlame, BuffID.Bleeding, BuffID.Frostburn, BuffID.Frostburn2, + BuffID.Chilled, + BuffID.Frozen, + ModContent.BuffType(), } }); @@ -922,4 +922,60 @@ public Vector2 GetEyePos(Vector2 position) return position + new Vector2(NPC.direction == 1 ? NPC.width - 4f : 4f, NPC.height / 2f - 2f); } } + + public class SpaceSquidFriendly : ModNPC + { + public override void SetStaticDefaults() + { + NPCID.Sets.NPCBestiaryDrawOffset[Type] = new NPCID.Sets.NPCBestiaryDrawModifiers(0) { Hide = true, }; + NPCID.Sets.ActsLikeTownNPC[Type] = true; + } + + public override void SetDefaults() + { + NPC.width = 64; + NPC.height = 48; + NPC.friendly = true; + NPC.lifeMax = 2500; + NPC.defense = 10; + NPC.damage = 15; + NPC.dontTakeDamage = true; + NPC.dontTakeDamageFromHostiles = true; + NPC.aiStyle = -1; + NPC.knockBackResist = 0f; + NPC.behindTiles = true; + } + + public override bool CanChat() => true; + + public override void AI() + { + } + + public override string GetChat() + { + return $"HELLO {Main.LocalPlayer.name}. EXCUSE TONE OF VOICE - AS USING [[⏁⍀⏃⋏⌇⌰⏃⏁⍜⍀]] TO TRANSLATE VOICE INTO TERRARIAN VOICE."; + } + + public override void SetChatButtons(ref string button, ref string button2) + { + button = "Option 1"; + button2 = "Rematch"; + } + + public override void OnChatButtonClicked(bool firstButton, ref bool shop) + { + if (!firstButton) + { + NPC.KillEffects(); + NPC.active = false; + NPC.NewNPCDirect(NPC.GetSource_NaturalSpawn(), NPC.Center, ModContent.NPCType()); + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) + { + return true; + } + } } \ No newline at end of file diff --git a/NPCs/Monsters/Sky/GaleStreams/SpaceSquidFriendly.png b/NPCs/Monsters/Sky/GaleStreams/SpaceSquidFriendly.png new file mode 100644 index 0000000000000000000000000000000000000000..3bb403585ea4becde50965d8052081fe82f53413 GIT binary patch literal 1241 zcmV;~1Sb25P)z?KNoHQ000+sMObuGZ)S9NVRB^vM@&RePDdbiWpW@hE;Mn4q~QPn00?w&PDe*f zL^A*Y002sWDIWj;00d`2O+f$vv5yP?Vt07#8Q*PoDi4{&v*oPJUtt zuJVcJ21DCBJ3}&pLvXghq!Z`w^ZjW1)tk`>4#AZL$M>Uvyn*EgJ9$6|Zld74`4dmv-4DF{B6&!z^4{s(948c_n zG&(pbAgM%j*Et}#Mgj7ljCJ^;1top1)Sk%$L2$udTzWbD&vc^vgta0sy>IPI$QKuo zPrZ`GiTY+&UfhcRWP9l%Dn;!?_yy~U4aU!D#m57t(rV@FmaZ&1pIE}#C zwJvv@2jaZyjkxGqNA1zZXI9ccT&a2?E!spXCytZnJzo&#)p;XMBQ44x&Z)5AhCfd) zocZ;OcZ)OcAN*eOc@v29s@6DecQ>qjwXHnw3lop@8jFeh;u3|xSwAhCX&5l9vs!Q+qc$}X?yMhaZZH=cYORjnRNJTFPYagzD@g4P2;s~e}8mu z0&!kNtrqYnAZfLOwl7~@TQaSJNTxgObiA}m(t1?{t0SeVMI4#P(Fn^Wja~A1cSJlsQci0ecGw};JQ_5ZHumP zxlb+ecA&;}uHxXf9z94dtwp)V)Bg1Rtp(zo3JdPW^()Dx$6G(A^!rK$;=Jz7)p})buidJ5MUC^y zOPqBTLt3%55|v9{tCe98=T$A@q`O((nTPc+Z9rV_@)E}h$i4fN+dFIbVO!t*0&!k> zNt1}Pj-$NKh**iQJ)Q$`ZYjN=M4EKPtykDut8$+?;ly$BG=sS6Qi!tt_lDe>Vtt;@ z`b*G=(+uKTN$WLhU9sHWQTm?N?FMnBl1R|5q_;Q9CC*wyt>l%q8^o2$N=DR`^47TA z-nv%1L0qY#u7H;~Yb~9sonreD+{}X0g6uUg1Xt)&48=van8MB-00000NkvXXu0mjf DmWNcB literal 0 HcmV?d00001 diff --git a/Projectiles/Monster/RedSpriteProjs/RedSpriteThunderClap.cs b/Projectiles/Monster/RedSpriteProjs/RedSpriteThunderClap.cs index 8f18c9e4e..c20ce7461 100644 --- a/Projectiles/Monster/RedSpriteProjs/RedSpriteThunderClap.cs +++ b/Projectiles/Monster/RedSpriteProjs/RedSpriteThunderClap.cs @@ -48,7 +48,7 @@ public override void AI() } Projectile.ai[0] = Math.Max(minimumLength, Projectile.ai[0]); float maxLength = Projectile.ai[0] + 96f; - if ((Main.player[Main.myPlayer].Center - center).Length() < 1000f) + if ((Main.player[Main.myPlayer].Center - new Vector2(center.X, center.Y + Projectile.ai[0])).Length() < 1000f) { if ((int)Projectile.localAI[0] == 0) { diff --git a/Tiles/AequusTile.cs b/Tiles/AequusTile.cs index 06a337a37..d35ce1a86 100644 --- a/Tiles/AequusTile.cs +++ b/Tiles/AequusTile.cs @@ -64,7 +64,6 @@ public override void Load() CheckCircles = new List(); Circles = new List(); PylonColors = new Dictionary>(); - LoadHooks(); }