From 4b9bd83f88cebdac15caaf63e414fc8fe214a223 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 29 May 2021 22:12:31 -0500 Subject: [PATCH 01/86] Added base stuff for the draedon summoner --- CalamityNetcode.cs | 4 + Items/DraedonMisc/AdvancedDisplay.cs | 64 ++++++++ Items/DraedonMisc/AdvancedDisplay.png | Bin 0 -> 472 bytes Items/DraedonMisc/AuricQuantumCoolingCell.cs | 69 ++++++++ Items/DraedonMisc/AuricQuantumCoolingCell.png | Bin 0 -> 887 bytes Items/DraedonMisc/CodebreakerBase.cs | 39 +++++ Items/DraedonMisc/CodebreakerBase.png | Bin 0 -> 550 bytes Items/DraedonMisc/DecryptionComputer.cs | 63 ++++++++ Items/DraedonMisc/DecryptionComputer.png | Bin 0 -> 476 bytes Items/DraedonMisc/LongRangedSensorArray.cs | 64 ++++++++ Items/DraedonMisc/LongRangedSensorArray.png | Bin 0 -> 882 bytes Items/DraedonMisc/VoltageRegulationSystem.cs | 65 ++++++++ Items/DraedonMisc/VoltageRegulationSystem.png | Bin 0 -> 591 bytes TileEntities/TECodebreaker.cs | 149 ++++++++++++++++++ .../CodebreakerAdvancedDisplay.png | Bin 0 -> 8538 bytes .../CodebreakerAuricQuantumCoolingCell.png | Bin 0 -> 4832 bytes .../CodebreakerDecryptionComputer.png | Bin 0 -> 10023 bytes .../CodebreakerLongRangedSensorArray.png | Bin 0 -> 13159 bytes Tiles/DraedonSummoner/CodebreakerTile.cs | 127 +++++++++++++++ Tiles/DraedonSummoner/CodebreakerTile.png | Bin 0 -> 14472 bytes .../CodebreakerVoltageRegulationSystem.png | Bin 0 -> 7418 bytes .../CodebreakerVoltageRegulationSystem2.png | Bin 0 -> 2654 bytes 22 files changed, 644 insertions(+) create mode 100644 Items/DraedonMisc/AdvancedDisplay.cs create mode 100644 Items/DraedonMisc/AdvancedDisplay.png create mode 100644 Items/DraedonMisc/AuricQuantumCoolingCell.cs create mode 100644 Items/DraedonMisc/AuricQuantumCoolingCell.png create mode 100644 Items/DraedonMisc/CodebreakerBase.cs create mode 100644 Items/DraedonMisc/CodebreakerBase.png create mode 100644 Items/DraedonMisc/DecryptionComputer.cs create mode 100644 Items/DraedonMisc/DecryptionComputer.png create mode 100644 Items/DraedonMisc/LongRangedSensorArray.cs create mode 100644 Items/DraedonMisc/LongRangedSensorArray.png create mode 100644 Items/DraedonMisc/VoltageRegulationSystem.cs create mode 100644 Items/DraedonMisc/VoltageRegulationSystem.png create mode 100644 TileEntities/TECodebreaker.cs create mode 100644 Tiles/DraedonSummoner/CodebreakerAdvancedDisplay.png create mode 100644 Tiles/DraedonSummoner/CodebreakerAuricQuantumCoolingCell.png create mode 100644 Tiles/DraedonSummoner/CodebreakerDecryptionComputer.png create mode 100644 Tiles/DraedonSummoner/CodebreakerLongRangedSensorArray.png create mode 100644 Tiles/DraedonSummoner/CodebreakerTile.cs create mode 100644 Tiles/DraedonSummoner/CodebreakerTile.png create mode 100644 Tiles/DraedonSummoner/CodebreakerVoltageRegulationSystem.png create mode 100644 Tiles/DraedonSummoner/CodebreakerVoltageRegulationSystem2.png diff --git a/CalamityNetcode.cs b/CalamityNetcode.cs index 88e29c1b2a..f0776c139e 100644 --- a/CalamityNetcode.cs +++ b/CalamityNetcode.cs @@ -150,6 +150,9 @@ namespace CalamityMod case CalamityModMessageType.LabHologramProjector: TELabHologramProjector.ReadSyncPacket(mod, reader); break; + case CalamityModMessageType.UpdateCodebreakerConstituents: + TECodebreaker.ReadConstituentsUpdateSync(mod, reader); + break; // // Boss Rush @@ -284,6 +287,7 @@ namespace CalamityMod ChargingStationItemChange, Turret, LabHologramProjector, + UpdateCodebreakerConstituents, // Boss Rush BossRushStage, diff --git a/Items/DraedonMisc/AdvancedDisplay.cs b/Items/DraedonMisc/AdvancedDisplay.cs new file mode 100644 index 0000000000..7dcefc9c72 --- /dev/null +++ b/Items/DraedonMisc/AdvancedDisplay.cs @@ -0,0 +1,64 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.DraedonSummoner; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Microsoft.Xna.Framework; +using CalamityMod.TileEntities; + +namespace CalamityMod.Items.DraedonMisc +{ + public class AdvancedDisplay : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Advanced Display"); + Tooltip.SetDefault("Can be placed in the Codebreaker"); + } + + public override void SetDefaults() + { + item.width = 52; + item.height = 52; + item.maxStack = 999; + item.consumable = true; + item.useStyle = ItemUseStyleID.SwingThrow; + item.rare = ItemRarityID.Pink; + item.useTime = item.useAnimation = 15; + } + + public override bool UseItem(Player player) => true; + + public override bool ConsumeItem(Player player) + { + Point placeTileCoords = Main.MouseWorld.ToTileCoordinates(); + Tile tile = CalamityUtils.ParanoidTileRetrieval(placeTileCoords.X, placeTileCoords.Y); + float checkDistance = ((Player.tileRangeX + Player.tileRangeY) / 2f + player.blockRange) * 16f; + + if (Main.myPlayer == player.whoAmI && player.WithinRange(Main.MouseWorld, checkDistance) && tile.active() && tile.type == ModContent.TileType()) + { + TECodebreaker codebreakerTileEntity = CalamityUtils.FindTileEntity(placeTileCoords.X, placeTileCoords.Y, CodebreakerTile.Width, CodebreakerTile.Height, CodebreakerTile.SheetSquare); + if (codebreakerTileEntity is null || codebreakerTileEntity.ContainsAdvancedDisplay) + return false; + + codebreakerTileEntity.ContainsAdvancedDisplay = true; + codebreakerTileEntity.SyncConstituents(); + return true; + } + + return false; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ModContent.ItemType(), 3); + recipe.AddIngredient(ItemID.Glass, 20); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this, 1); + recipe.AddRecipe(); + } + } +} diff --git a/Items/DraedonMisc/AdvancedDisplay.png b/Items/DraedonMisc/AdvancedDisplay.png new file mode 100644 index 0000000000000000000000000000000000000000..c0a76b9facf7aeb848798a4d8cfa4f47392a9a41 GIT binary patch literal 472 zcmV;}0Vn>6P)Nkl zJxjw-6o#KjE!0;0KvB@vRtthi9V`wO<0=U1EKdF!H-C$RKfnqOqKlg#D2m`viqenZ z6o+`QNpsVrt&sapH@PSGoIHKc2{q`UT)rSnyI1UhG5}s*o?SOb{yFKuN~ku3Tq>Ob zz-l!CSS@W1wSdQm`@nsD35u*%(}q8C^2V9!U0(^42YUb3|rqN z(^*^vdt3{GzW+7Eiz-Q%t5lgXT-VaQ+2xf8c<-Z=6p8PwP-fC6qtA}yXZWBdEuK^6nlb755`5YC-?&l6@5vR;j#t* O0000 true; + + public override bool ConsumeItem(Player player) + { + Point placeTileCoords = Main.MouseWorld.ToTileCoordinates(); + Tile tile = CalamityUtils.ParanoidTileRetrieval(placeTileCoords.X, placeTileCoords.Y); + float checkDistance = ((Player.tileRangeX + Player.tileRangeY) / 2f + player.blockRange) * 16f; + + if (Main.myPlayer == player.whoAmI && player.WithinRange(Main.MouseWorld, checkDistance) && tile.active() && tile.type == ModContent.TileType()) + { + TECodebreaker codebreakerTileEntity = CalamityUtils.FindTileEntity(placeTileCoords.X, placeTileCoords.Y, CodebreakerTile.Width, CodebreakerTile.Height, CodebreakerTile.SheetSquare); + if (codebreakerTileEntity is null || codebreakerTileEntity.ContainsCoolingCell) + return false; + + codebreakerTileEntity.ContainsCoolingCell = true; + codebreakerTileEntity.SyncConstituents(); + return true; + } + + return false; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddTile(ModContent.TileType()); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/DraedonMisc/AuricQuantumCoolingCell.png b/Items/DraedonMisc/AuricQuantumCoolingCell.png new file mode 100644 index 0000000000000000000000000000000000000000..ed57707d71fe08c4a7e7734eb915313f6d5cb63a GIT binary patch literal 887 zcmV--1Bm>IP)9B( z2&1e1P-ZN&f2gUMjtVkKl+6*z)^I0xwncWj`0Z)@PUpBl`T4o|@qC}>`98n*dA`5z z_jyiA8MU`R531JIfpcGfUMMwg)rO5J7&&zU44?n9q`yVw7P{4{C^iI=O%Jw!y zu;bnLN;(+m>MSr%7F0}@JW;mcVbIdnfO(RSKivyneER}OpE(tC5J(pyON{8>)tg(N z29r~h1^E8VLCli`jU9Ruth#$+%%1J-1Or{2G2e+3RfN5{zquYakl_1e< zzGO%E?SDRUIc5(eL7{*DJI~#4q2wxTs7HvM+Zr>Ipr&ru|8g{bVIMd*RsEkeNRp_r zaRXSr><;kv^h^Qv?pz)lSk>`(NeB7C&tmP}2cinSD7_>FmnN=9?OXQB3nOr=Z9X=xWBUQ{>iR0s zd*s*HyeD6H8GQAAH177-qr*M*vGyNxZ@i`|6SODd{h{sC#T{ z7syTIV$pYH^e3?CfnIR@n?BI?$W!3-7ax^$Si7<*)?T`7X~O5a+(Zt{(WSfRAH}< z|A2Xt)5Cwo94;1}IfCDys%uf*YHf*5O|8-8 z-H&rwd-{6mg_6I+7AySU5LEf+6|nxEC?gCF&z6hM6bzm{8#5+G^bcab0<_-{AAJA- N002ovPDHLkV1iN$uB`w7 literal 0 HcmV?d00001 diff --git a/Items/DraedonMisc/CodebreakerBase.cs b/Items/DraedonMisc/CodebreakerBase.cs new file mode 100644 index 0000000000..a6d5d5f160 --- /dev/null +++ b/Items/DraedonMisc/CodebreakerBase.cs @@ -0,0 +1,39 @@ +using Terraria.ModLoader; +using Terraria.ID; +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.DraedonSummoner; +using CalamityMod.Items.Placeables.DraedonStructures; + +namespace CalamityMod.Items.DraedonMisc +{ + public class CodebreakerBase : ModItem + { + public override void SetStaticDefaults() => DisplayName.SetDefault("Codebreaker Base"); + + public override void SetDefaults() + { + item.useStyle = ItemUseStyleID.SwingThrow; + item.useTurn = true; + item.useAnimation = 15; + item.useTime = 10; + item.autoReuse = true; + item.consumable = true; + item.width = 42; + item.height = 32; + item.maxStack = 999; + item.rare = ItemRarityID.Orange; + item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 20); + recipe.AddIngredient(ModContent.ItemType(), 35); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this, 1); + recipe.AddRecipe(); + } + } +} diff --git a/Items/DraedonMisc/CodebreakerBase.png b/Items/DraedonMisc/CodebreakerBase.png new file mode 100644 index 0000000000000000000000000000000000000000..eacc52b6c4d911324cf1790610a1a851c255a21e GIT binary patch literal 550 zcmV+>0@?kEP)I2I3c40t_*>isTnpLtue6K)f$m*cN}-@_s#K7c zHbF&=LR@4{;+))@nN+b{`mXZcPk3_PGc$&iYCL`dK#&Un=wJ2+Y4=7l0Q;S9Gj1Cy z^H;n6flSf@7s-c}nsxnLV=3mpeB8F)H7i+fh-USG5Y*Bne|LXj^FlPd>ggi}0Ohc1 zhW88y(~|Xu=%{Y)Ak|hqfB7orrDlU%V4{0~WU~Gc6_Vw!3czvikF^$y?Kc3Nwl=2v z2kk9jT&p)ykL}#FWc?#bluD^7A(57(c)efuTUWP8BI^y&i9V`jUN6t&UAky(4u3@C zEo28UCM*B6koAV>M2+57uD+QhU9;sR?8cr zqtt&oKbyL6W&ius`JZZD2x_vU^VZg_a_1NcZ(^det~c_FR)p1g1NvLP^j zw#zz^u1z6afBFo7gRgtB`Q6eYFiF-MqGmNB@i~*3ntq+e=0YXrg{&*xx>j{fyHqRY z4fsSfZ6Cd@lKQYK?S&xg7tzGGCzo7L5S@B0U7O;MqO6FQ4D23u2k<`-)k-2Mn)vQl oK2+UA true; + + public override bool ConsumeItem(Player player) + { + Point placeTileCoords = Main.MouseWorld.ToTileCoordinates(); + Tile tile = CalamityUtils.ParanoidTileRetrieval(placeTileCoords.X, placeTileCoords.Y); + float checkDistance = ((Player.tileRangeX + Player.tileRangeY) / 2f + player.blockRange) * 16f; + + if (Main.myPlayer == player.whoAmI && player.WithinRange(Main.MouseWorld, checkDistance) && tile.active() && tile.type == ModContent.TileType()) + { + TECodebreaker codebreakerTileEntity = CalamityUtils.FindTileEntity(placeTileCoords.X, placeTileCoords.Y, CodebreakerTile.Width, CodebreakerTile.Height, CodebreakerTile.SheetSquare); + if (codebreakerTileEntity is null || codebreakerTileEntity.ContainsDecryptionComputer) + return false; + + codebreakerTileEntity.ContainsDecryptionComputer = true; + codebreakerTileEntity.SyncConstituents(); + return true; + } + + return false; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 18); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ItemID.Glass, 5); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this, 1); + recipe.AddRecipe(); + } + } +} diff --git a/Items/DraedonMisc/DecryptionComputer.png b/Items/DraedonMisc/DecryptionComputer.png new file mode 100644 index 0000000000000000000000000000000000000000..bfe9dcbb2b99dbc80a1ec294a01ae3aff899193f GIT binary patch literal 476 zcmV<20VDp2P)?0004_Nkl1upsSXUrXj~LwaxpHtkuaN($Zq@-ZvHJzOq@yFbTKYYDsht#22B)7aPgz| zOOKXPjF<8(aFnCR)3@JU&mke@N>$#DlJ=Pr2cZ4@6nSuIPAAPAH*Lq={ewi`+uYs? zwOdygsm^DO(LWz(z0suJXinYF8l$N*s?k~0q|K&~AER&Wm(Z(bqr8)BAZ`%|>b0(? z`7tW=FRw#w@AxRxURzxU0>hH&hnpJ!y1kCfcuv&s=g+9{UOxl^gPO6vMf(Ky6h>8D+4-2y>9)#$Z>^dAq%Fz4sT zsK#V64w=a$t6tG_ATXOhqtlwy*%VA>?Kk>sXJjJ!`Tq6f6o8NOv(V=zgQnx!tTjf* zvw$`z_00DN^V(}Njb#KOqku(5-H0rX0DOM{m{;m)nUK|qSI!=z#Qc-EyEQB1%I(!^ zK(Mn?D7co^QT^O4tD9NdrYmCFU)6h5!=Z0k9W7U?k##HU_N>@v^dDo_UH=X7hq&I5 S1fSdh0000 true; + + public override bool ConsumeItem(Player player) + { + Point placeTileCoords = Main.MouseWorld.ToTileCoordinates(); + Tile tile = CalamityUtils.ParanoidTileRetrieval(placeTileCoords.X, placeTileCoords.Y); + float checkDistance = ((Player.tileRangeX + Player.tileRangeY) / 2f + player.blockRange) * 16f; + + if (Main.myPlayer == player.whoAmI && player.WithinRange(Main.MouseWorld, checkDistance) && tile.active() && tile.type == ModContent.TileType()) + { + TECodebreaker codebreakerTileEntity = CalamityUtils.FindTileEntity(placeTileCoords.X, placeTileCoords.Y, CodebreakerTile.Width, CodebreakerTile.Height, CodebreakerTile.SheetSquare); + if (codebreakerTileEntity is null || codebreakerTileEntity.ContainsSensorArray) + return false; + + codebreakerTileEntity.ContainsSensorArray = true; + codebreakerTileEntity.SyncConstituents(); + return true; + } + + return false; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ItemID.HallowedBar, 10); + recipe.AddIngredient(ItemID.Wire, 50); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this, 1); + recipe.AddRecipe(); + } + } +} diff --git a/Items/DraedonMisc/LongRangedSensorArray.png b/Items/DraedonMisc/LongRangedSensorArray.png new file mode 100644 index 0000000000000000000000000000000000000000..3b9a2bb067e04b012a374835f0eb5cde37d9b602 GIT binary patch literal 882 zcmV-&1C9KNP)LAs7>kT8v`E zLT#b6MeCv*>734;Y0C)Y(s$F$?R?zK)A!u>+|=QSH9j%vI-dFS8-T^0Q?*vEk4B;n zK&4s%peNMX9RoQ>^j)iM zm1|gUYOw#?|B?OdI!`<#nvN$t@7LfR01|zvZk78lIy-&|*e50Hj(AEuHa$BF!1vWJ zuJc8uts-C{p+onOu5#jq^J5o1uQL%5g54|^wuDqHkp!Sz+IFo+Ch2ublgWPi2y_W` zuAp=sq~6|$1F*YWb&U%dQJ0XG?l?^{rEBdCodEP4H4!cA2z8tkOzVnBvQ@QQPtBT) zmXOg(#FMViEGLXmlZRUMM4~SRKxwP!TJc2<9srujh<8la>GQ8_RvmzM0}%i+nMKce zSx3mvL%!>Tq+5@w-^ z=3fI)oVyJKlhK|sb)v262^IM2|-9`>77qWAnlS7*-t2F|4bxr*5nzT-9#o& z$y_=mBeIUrzja8+44tm`Ik^BbA|Z3<>J$Jg$}^JvOkN9H_7T$iWw~GV4piQFe(yw6 z_LB2nEw8x7+x1RZvW}2*^KSh&E(t(Z@Tt+(`VdV<6iX!Q{mtIqwb!#74-Q)0MD`IH zpP2Ma0MfsRgjjs?n&aoWOPcFs`m2PlQ8ESDEkQMozniH zGXUgsKV8I3iQ%CAOW3lHkRH&)^d7cI{-0LJZvaP6Mr0kKzaGVg;UW)Ew*UYD07*qo IM6N<$g5RE+HUIzs literal 0 HcmV?d00001 diff --git a/Items/DraedonMisc/VoltageRegulationSystem.cs b/Items/DraedonMisc/VoltageRegulationSystem.cs new file mode 100644 index 0000000000..860866a26c --- /dev/null +++ b/Items/DraedonMisc/VoltageRegulationSystem.cs @@ -0,0 +1,65 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.DraedonSummoner; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Microsoft.Xna.Framework; +using CalamityMod.TileEntities; + +namespace CalamityMod.Items.DraedonMisc +{ + public class VoltageRegulationSystem : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Voltage Regulation System"); + Tooltip.SetDefault("Can be placed in the Codebreaker"); + } + + public override void SetDefaults() + { + item.width = 52; + item.height = 52; + item.maxStack = 999; + item.consumable = true; + item.useStyle = ItemUseStyleID.SwingThrow; + item.rare = ItemRarityID.Purple; + item.Calamity().customRarity = CalamityRarity.Turquoise; + item.useTime = item.useAnimation = 15; + } + + public override bool UseItem(Player player) => true; + + public override bool ConsumeItem(Player player) + { + Point placeTileCoords = Main.MouseWorld.ToTileCoordinates(); + Tile tile = CalamityUtils.ParanoidTileRetrieval(placeTileCoords.X, placeTileCoords.Y); + float checkDistance = ((Player.tileRangeX + Player.tileRangeY) / 2f + player.blockRange) * 16f; + + if (Main.myPlayer == player.whoAmI && player.WithinRange(Main.MouseWorld, checkDistance) && tile.active() && tile.type == ModContent.TileType()) + { + TECodebreaker codebreakerTileEntity = CalamityUtils.FindTileEntity(placeTileCoords.X, placeTileCoords.Y, CodebreakerTile.Width, CodebreakerTile.Height, CodebreakerTile.SheetSquare); + if (codebreakerTileEntity is null || codebreakerTileEntity.ContainsVoltageRegulationSystem) + return false; + + codebreakerTileEntity.ContainsVoltageRegulationSystem = true; + codebreakerTileEntity.SyncConstituents(); + return true; + } + + return false; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ItemID.LunarBar, 5); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this, 1); + recipe.AddRecipe(); + } + } +} diff --git a/Items/DraedonMisc/VoltageRegulationSystem.png b/Items/DraedonMisc/VoltageRegulationSystem.png new file mode 100644 index 0000000000000000000000000000000000000000..4336750cba5dda8c04942ae16d285bed4a0e8db2 GIT binary patch literal 591 zcmV-V0X0006ONklW{#6~+C3w#FOz>Y_t^9_6l3mQ6TOo%kZn2>A& zv9LjA|3J(FuEly-?wL7zr*np{ntSHt?9O-ZoqO*%QZl!&2tcJ;2cX|=50mmr(`5&6 zes(&s-uI)!RKI&C?H~MKxKM&+Zt2O>#QcN(y@~ZIcS{bS|Lc5Wo*2G827yF#+Sv2Q zO#pVkwY;_>Erl zCM2#DjoN(x-mWZo@sHbIfVipZW!Gz4hOOD2D}#x~G-6PQIzPR*wBNm21)x=a2*A$f zCm?KCza4U6&@-n^SZ$4U->UQS&6<}dhBf&y7&0eVhNd?@0C2Yceqvsz2Q-;CSd@#| zxp`pxB+Umk0Cv@rNuD72VoswCM}}dG{20`;9}sd zC|`g3r>^Cxl3C+sqcKwkAnKiZ^=4}`4&b=c3!QDedYLy^99#_K+5tTKa|OWiRA~rt zlNjfi>n{c4-I14f-01;OsgB0#!Tz3SSmOO|+pCv(gXWp!_0`DaR-vHxi4M|#Te0d} d=(?FV_!pSx>(QT)e|7)>002ovPDHLkV1l6a9?1Xz literal 0 HcmV?d00001 diff --git a/TileEntities/TECodebreaker.cs b/TileEntities/TECodebreaker.cs new file mode 100644 index 0000000000..6e12016794 --- /dev/null +++ b/TileEntities/TECodebreaker.cs @@ -0,0 +1,149 @@ +using CalamityMod.Items.DraedonMisc; +using CalamityMod.Tiles.DraedonStructures; +using CalamityMod.Tiles.DraedonSummoner; +using Microsoft.Xna.Framework; +using System.IO; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ModLoader.IO; + +namespace CalamityMod.TileEntities +{ + public class TECodebreaker : ModTileEntity + { + public bool ContainsDecryptionComputer; + public bool ContainsSensorArray; + public bool ContainsAdvancedDisplay; + public bool ContainsVoltageRegulationSystem; + public bool ContainsCoolingCell; + public Vector2 Center => Position.ToWorldCoordinates(8f * CodebreakerTile.Width, 8f * CodebreakerTile.Height); + + // This guarantees that this tile entity will not persist if not placed directly on the top left corner of a Charging Station tile. + public override bool ValidTile(int i, int j) + { + Tile tile = CalamityUtils.ParanoidTileRetrieval(i, j); + return tile.active() && tile.type == ModContent.TileType() && tile.frameX == 0 && tile.frameY == 0; + } + + // This code is called as a hook when the player places the Charging Station tile so that the tile entity may be placed. + public override int Hook_AfterPlacement(int i, int j, int type, int style, int direction) + { + // If in multiplayer, tell the server to place the tile entity and DO NOT place it yourself. That would mismatch IDs. + // Also tell the server that you placed the 3x2 tiles that make up the Charging Station. + if (Main.netMode == NetmodeID.MultiplayerClient) + { + NetMessage.SendTileRange(Main.myPlayer, i, j, CodebreakerTile.Width, CodebreakerTile.Height); + NetMessage.SendData(MessageID.TileEntityPlacement, -1, -1, null, i, j, Type); + return -1; + } + + // If in single player, just place the tile entity, no problems. + return Place(i, j); + } + + // This code is called on dedicated servers only. It is the server-side response to MessageID.TileEntityPlacement. + // When the server receives such a message from a client, it sends a MessageID.TileEntitySharing to all clients. + // This will cause them to Place the tile entity locally at that position, all with exactly the same ID. + public override void OnNetPlace() => NetMessage.SendData(MessageID.TileEntitySharing, -1, -1, null, ID, Position.X, Position.Y); + + public void DropConstituents(int x, int y) + { + if (ContainsDecryptionComputer) + Item.NewItem(x * 16, y * 16, 32, 32, ModContent.ItemType()); + if (ContainsSensorArray) + Item.NewItem(x * 16, y * 16, 32, 32, ModContent.ItemType()); + if (ContainsAdvancedDisplay) + Item.NewItem(x * 16, y * 16, 32, 32, ModContent.ItemType()); + if (ContainsVoltageRegulationSystem) + Item.NewItem(x * 16, y * 16, 32, 32, ModContent.ItemType()); + if (ContainsCoolingCell) + Item.NewItem(x * 16, y * 16, 32, 32, ModContent.ItemType()); + } + + public void SyncConstituents() + { + // Don't bother sending packets in singleplayer. + if (Main.netMode == NetmodeID.SinglePlayer) + return; + + ModPacket packet = mod.GetPacket(); + packet.Write((byte)CalamityModMessageType.UpdateCodebreakerConstituents); + packet.Write(ID); + packet.Write(ContainsDecryptionComputer); + packet.Write(ContainsSensorArray); + packet.Write(ContainsAdvancedDisplay); + packet.Write(ContainsVoltageRegulationSystem); + packet.Write(ContainsCoolingCell); + } + + public static void ReadConstituentsUpdateSync(Mod mod, BinaryReader reader) + { + int id = reader.ReadInt32(); + bool exists = ByID.TryGetValue(id, out TileEntity tileEntity); + + // Continue reading to the end even if a tile entity with the given ID does not exist. + // Not doing this will cause errors/bugs. + bool containsDecryptionComputer = reader.ReadBoolean(); + bool containsSensorArray = reader.ReadBoolean(); + bool containsAdvancedDisplay = reader.ReadBoolean(); + bool containsVoltageRegulationSystem = reader.ReadBoolean(); + bool containsCoolingCell = reader.ReadBoolean(); + + // After doing reading, check again to see if the tile entity is actually there. + // If it isn't don't bother doing anything else. + if (!exists) + return; + + // Furthermore, verify to ensure that the tile entity is a valid one. + if (!(tileEntity is TECodebreaker codebreakerTileEntity)) + return; + + codebreakerTileEntity.ContainsDecryptionComputer = containsDecryptionComputer; + codebreakerTileEntity.ContainsSensorArray = containsSensorArray; + codebreakerTileEntity.ContainsAdvancedDisplay = containsAdvancedDisplay; + codebreakerTileEntity.ContainsVoltageRegulationSystem = containsVoltageRegulationSystem; + codebreakerTileEntity.ContainsCoolingCell = containsCoolingCell; + } + + public override TagCompound Save() + { + return new TagCompound + { + ["ContainsDecryptionComputer"] = ContainsDecryptionComputer, + ["ContainsSensorArray"] = ContainsSensorArray, + ["ContainsAdvancedDisplay"] = ContainsAdvancedDisplay, + ["ContainsVoltageRegulationSystem"] = ContainsVoltageRegulationSystem, + ["ContainsCoolingCell"] = ContainsCoolingCell + }; + } + + public override void Load(TagCompound tag) + { + ContainsDecryptionComputer = tag.GetBool("ContainsDecryptionComputer"); + ContainsSensorArray = tag.GetBool("ContainsSensorArray"); + ContainsAdvancedDisplay = tag.GetBool("ContainsAdvancedDisplay"); + ContainsVoltageRegulationSystem = tag.GetBool("ContainsVoltageRegulationSystem"); + ContainsCoolingCell = tag.GetBool("ContainsCoolingCell"); + } + + public override void NetSend(BinaryWriter writer, bool lightSend) + { + writer.Write(ContainsDecryptionComputer); + writer.Write(ContainsSensorArray); + writer.Write(ContainsAdvancedDisplay); + writer.Write(ContainsVoltageRegulationSystem); + writer.Write(ContainsCoolingCell); + } + + public override void NetReceive(BinaryReader reader, bool lightReceive) + { + ContainsDecryptionComputer = reader.ReadBoolean(); + ContainsSensorArray = reader.ReadBoolean(); + ContainsAdvancedDisplay = reader.ReadBoolean(); + ContainsVoltageRegulationSystem = reader.ReadBoolean(); + ContainsCoolingCell = reader.ReadBoolean(); + } + } +} diff --git a/Tiles/DraedonSummoner/CodebreakerAdvancedDisplay.png b/Tiles/DraedonSummoner/CodebreakerAdvancedDisplay.png new file mode 100644 index 0000000000000000000000000000000000000000..885308380670dce7acf17ece2b9f45b025d823d3 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kVp)vk{Gk$#K`(^wX z51DBXRkKiGSeibyvp;)4u77nlr13}3FG!BrZ{vZH`)hp2s>W@?3E04v+@LCpA1E(s z8soxiwvi&nG|@|rCZ=^glWJYPUN^+OWilK;oXaOlbH|GgAF@i#5BoeSk38d6Df-kcs+h{jTd?RDinx%eo@xg=6!ZB|SJIb! zFg_LQi7`OM(}iz*TpENM03Fu`-+@%~sEI^CUzjD@RE{IRqYL;*LZ^SuK2SA0!6bNH zP_!!SWcns&%DfAFF!FBl&){)%PYkF*%{dfnP=}Urk?+t zGnA>JZGTPPO(4&Bc*#ivKQ|}&X>N~Y3v)u*A6>2k0O-5*-vZpS$U(4JsaK#7eT?)D zcAU-C-piaCTdWK^Ek>o{l_O3DfP2X2^6 jd_5NYJ8t-8Swz(V`Nke)oE86O0&qO)VvGIp%;o<8Y0U+p literal 0 HcmV?d00001 diff --git a/Tiles/DraedonSummoner/CodebreakerAuricQuantumCoolingCell.png b/Tiles/DraedonSummoner/CodebreakerAuricQuantumCoolingCell.png new file mode 100644 index 0000000000000000000000000000000000000000..e098482c31bb0eed00dc3ab0ee815ccbdb2c19ec GIT binary patch literal 4832 zcmeI0cTkgQ9)RC3)D=Wg7g!a-T2Z8l(oL`g1PfS@CL|ImDfG(Ex3_cu>`Z2oOp^KXy?MUp_q+)=KWMyo z(aJ>tfW;DyP z4_ZGyAv>BZ?R)jJVQS>+=jWA_hPO}jCI)Q|l;~SpUf52)NIe&rrQjE)Czo&l^L)pO zRQtfZ35=Q7a$eVKw7Go}`^5I9qT}w%;`Y%;XUpq~MDYj3h|#@P66;K2zUjv0McfR6 zILB-&kZ{Y);>oVb)N|ZKhH^qQ29&53st%PNQyFTWYQO!_-jIC2>;S}&K)s<|JHt)D z5`=o@7}7xXotsUJueHy)bxzT_xwPx#@s95d{VmNT3)Zu-rPmqc&zdS=Ka(5<4qJ4> zb8+rek(j$_co>;LxB|Fyap+ed(~KsZGS)%8!Z~3ueYpLZgG9+7!lWw;&-m1>rdIYr zak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QnG}lYg>LniEq2UIy9sQ+={cvm{#e+ zO8I@zaYyz!MBuyDiD-FD5vn&Np;-V>eSFqyQ;P51$6%CNr^a^ntZ1o<3^RANGnoM; zxyi0-rhGF6SPf_?MS15ZyQ+{38;9aAkAR6aF(lP`q@|x-J67;Ur;#*xp%C2F5uNAY z!ZIA6DOp8-y;Z7v64**_(LhsK6xJXiQ8aHCiF6*%Sm$`w_Usi9&O!I9bofNjK|pE4 zt!Q=^R$OBPAhONa*6&5qx zn-ct+&PjrdcW7a$wdZPu8k`U%a>i)Ug5S0%>n#82n8g@&GauBridi}em=V51iOu}X z>Auz6;+T6pI3U0@2}<`$?=V8QI0XHc@T>oUV^6V#B)q6=lu> z@Gar4K&*i8BgD^o(MEDsCqJ1_*II%KqR%0kM1A=QJHW|!W0-Gq_x7J$KUsfSz3-Ei Wey)7?B6t7}us`l(Q+CYn=6?bDzVI;s literal 0 HcmV?d00001 diff --git a/Tiles/DraedonSummoner/CodebreakerLongRangedSensorArray.png b/Tiles/DraedonSummoner/CodebreakerLongRangedSensorArray.png new file mode 100644 index 0000000000000000000000000000000000000000..07d8351f6df8d79d5d85b7144fd4efb3481f49ee GIT binary patch literal 13159 zcmchecU)6x+WrqRf(nR=QUykEK&45IbjJcB)k5#Rhfe4)3l^k_NHYXW07W37Nl9o@ zMVg_vfYbm9z4zZaxVtm^zV1%>{NDXX{hXZSB+q%y{k^a2x((OTP-ZyBehdHr29;Yk z?t*_C0Kg9+M`*x*1z$7J1Ard^l^Z|b_eq&WHMyMCO?X>rwv>E2?%6Zu)wG|q2eeb$ zeduG#?Wx>nk0}W`bbJt_JV>PW;dP<+A!aFUYMwBw8dLXwErw$ja`}9yWmI5$k6X5|?S+@71IJI>r$J?2sL) zbIMSiv4qr5QG~bek-*OS7#*-9AZ9?JcG-82Ns*_$iqM4tm3_UyE5))KiE)7d7Mefo35`{-jME%#ZjOi^UgrZ|u<3 zG*FeS&Ib3%9tuG}dL)J$b9zchT}bwl;9O*r4-AaW5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76xJSl4==)D&pw7m1J6HO!;ml-i?8uA zL7KmS)%fgLdcfu_kuvD`ldfB)aLKWz=@(4126}GEXPdIc(cATUFJp3Lt7qOA#>fW_ z)Xf<9D5kr!y+i)5xIJ^g+|Vu+W~-#fYZM??X{jwY>%|4G+0gP-lex>jrkKK`%hMz& ztD7bWk3TWVHDi^^41S6}J7?d(ZdanI)yADoWhJ`bwWWR|JRZxBeNeRJT@*Jl)psSm z3qX`Kc}=4NPXU87*>f8n`7_Qhq(Fx%Jb`VOJY3>Ywe1%n8Ny2k4y5jTxn$8SjP#+} z6s7NeG@#L97tvzlzB33HPgYMwg??66fj0N=2AEbd?#L) zhj~;^mr1@TXOewwdN8?lV@6b_VotjCXU71dF_G3UIP0507|y|YRP8fk{H4GI#1giD zw$)nB@qv~9uF}U+^Wn4FA8&?1iUg~e^h7TBb@BXFahM?^sfRBAlvuJ z6`U28flE1y-35m}ZxQX9gxM|JQ`kEZ+I3KHzQ{>6`z=b@Z|Gh-w&O#I%vR$u*VTUg z6+UfOBD@7HG8CBqR*=jdHgoosUaI)#_!e&B_F*lqUxN=qxxh%!&)*ELCuDc6wqJ+1 zFjyY1e~Hc4La;(2in@+-2dpQfTp6=jcp8{*1jTYvPQhPW_{LkGF}%T6JR{_km$IHIwN z$A#Gb^jPo6#NSw5_j)EA{{UIQX|4}m465&QlYSe2G!_2o_~U2!j0OQw6(~F}s`$~P zKwL89^#ZAkt7#Y;O{9M1IaddKZ8V0h=Szy60zB0;GV*zDgBy3dAD{lk%F2Jd&Z)&;fyIgvDoXX=l*NNaV+x8&* zj8yaF%}WBzp|cfEY4+fp+99n=iA1NNL8Ec67G+WjIO68!dKpMUc^7zK().Hook_AfterPlacement, -1, 0, true); + + TileObjectData.addTile(Type); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("The Codebreaker"); + AddMapEntry(new Color(92, 107, 112), name); + animationFrameHeight = 144; + } + + public override bool CanExplode(int i, int j) => false; + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 182); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + // Drop the base of the codebreaker. + Item.NewItem(i * 16, j * 16, 32, 32, ModContent.ItemType()); + + Tile t = Main.tile[i, j]; + int left = i - t.frameX % (Width * SheetSquare) / SheetSquare; + int top = j - t.frameY % (Height * SheetSquare) / SheetSquare; + + TECodebreaker codebreakerTileEntity = CalamityUtils.FindTileEntity(i, j, Width, Height, SheetSquare); + + // Drop any any attached components. + codebreakerTileEntity?.DropConstituents(i, j); + + // And destroy the tile entity, if it exists. + codebreakerTileEntity?.Kill(left, top); + } + + // All tile drawcode is done manually because the tile's animation is controlled by a tile entity. + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) + { + // These offsets start as the tile offsets, i.e. which sub-tile of the FrameImportant structure this specific location is. + Tile t = Main.tile[i, j]; + int frameXPos = t.frameX; + int frameYPos = t.frameY; + + // Grab the tile entity because it stores the information regarding what is actually attached. + TECodebreaker codebreakerTileEntity = CalamityUtils.FindTileEntity(i, j, Width, Height, SheetSquare); + + Texture2D tex = ModContent.GetTexture("CalamityMod/Tiles/DraedonSummoner/CodebreakerTile"); + Texture2D computerTexture = ModContent.GetTexture("CalamityMod/Tiles/DraedonSummoner/CodebreakerDecryptionComputer"); + Texture2D sensorTexture = ModContent.GetTexture("CalamityMod/Tiles/DraedonSummoner/CodebreakerLongRangedSensorArray"); + Texture2D voltageRegulatorTexture = ModContent.GetTexture("CalamityMod/Tiles/DraedonSummoner/CodebreakerVoltageRegulationSystem"); + Texture2D voltageRegulatorTexture2 = ModContent.GetTexture("CalamityMod/Tiles/DraedonSummoner/CodebreakerVoltageRegulationSystem2"); + Texture2D coolingCellTexture = ModContent.GetTexture("CalamityMod/Tiles/DraedonSummoner/CodebreakerAuricQuantumCoolingCell"); + Vector2 offset = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + if (t.halfBrick()) + offset.Y += 8f; + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + offset; + Color drawColor = Lighting.GetColor(i, j); + Rectangle frame = new Rectangle(frameXPos, frameYPos, 16, 16); + + if ((!t.halfBrick() && t.slope() == 0) || t.halfBrick()) + { + spriteBatch.Draw(tex, drawPosition, frame, drawColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + + // Place secondary parts. + if (codebreakerTileEntity != null) + { + if (codebreakerTileEntity.ContainsDecryptionComputer) + spriteBatch.Draw(computerTexture, drawPosition, frame, drawColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + if (codebreakerTileEntity.ContainsSensorArray) + spriteBatch.Draw(sensorTexture, drawPosition, frame, drawColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + if (codebreakerTileEntity.ContainsAdvancedDisplay) + spriteBatch.Draw(coolingCellTexture, drawPosition, frame, drawColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + if (codebreakerTileEntity.ContainsVoltageRegulationSystem) + { + spriteBatch.Draw(voltageRegulatorTexture, drawPosition, frame, drawColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + spriteBatch.Draw(voltageRegulatorTexture2, drawPosition, frame, drawColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } + if (codebreakerTileEntity.ContainsCoolingCell) + spriteBatch.Draw(coolingCellTexture, drawPosition, frame, drawColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } + } + return false; + } + } +} diff --git a/Tiles/DraedonSummoner/CodebreakerTile.png b/Tiles/DraedonSummoner/CodebreakerTile.png new file mode 100644 index 0000000000000000000000000000000000000000..5b78410becd4576726aaf85b5d0e93612d509579 GIT binary patch literal 14472 zcmeHuX*iT^|Nn*LPRe~3S%!3{NGgeJgK4uSib7=HvleFTqfJFalB|=mChJ(UjBzJq zZ^$--Au$+Zvdj!KX8f<|d5+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55}Eum@Qw zCZmCob$Bs1se?U&{ojlDZ0*Aj6qAH0w+-8kyI+Rbu>mpRawpZ>G}~>>V$2Mo0{OT8 zPKoK6kvN)H@0~&p9RS9%0&G6qJZY-~@Z|P^V%zm;H^n$#9{W z$)2^JT;~o%L*B+I5$|W3I6lwuRgYn2IT`gAk>>&1@IO(zr(mo_3}WTeozp@9BoaRs z&$|zudC?Hgi9cL>sJeZI(kOqgJg=gnbHf&E34Mm33t`umHmuwg4Wkcg)X(Yb)_zIPJgxZD(AHS5hDW>~b!%t|2&)l!A**~VEn`vk z6XnUThLn^5QL};{9dBGodi8_BG12!XhD!vW0E&++NjDBKaJBhVVtIlfRdfOz0m@zdKT9nm5-1t!Rq z;gh`Pr%`;1w~9QC0Pw`@!yFfMNNf^(3jGH}=;tMoZFeqA` zAy@;yIxdA!(L0k@O-Nntb30Kj5+&YkuhD-8ALOY-qj-H~a&7P%F$1r;;Js>mtwz4~ m@^o@D;bQ!uOWEihf#^n?c27QT8TbuDz{J4(O8F({hyM?*C^ymo literal 0 HcmV?d00001 diff --git a/Tiles/DraedonSummoner/CodebreakerVoltageRegulationSystem.png b/Tiles/DraedonSummoner/CodebreakerVoltageRegulationSystem.png new file mode 100644 index 0000000000000000000000000000000000000000..86cffb899a7439ede65cdbb0141222d015fec2e0 GIT binary patch literal 7418 zcmeI1`8$;R|Ht2Bn`0?Q3R%ym7&>Jy6UJ5|vZX?HQJfgNu`?|y2}N1LAjv7&vTqF{ zO^mT*9gMOsV~oMXV7{aC{R=+V`RQ|c|8n0y-1l|eulMu$em!50>yEWBGd#c}$^!s6 zV02O6l6AEOfCK#-7wazioUIK2;>||-dRId-$s>3(F>8^}R3?XsxR}y^xZpLvd%V_v z{0??G?t|`a#hkbe(J+_VyWX~M3$5P$tq(VPEiHd}4*I*CU)dcHi=8wPZilK0@}rWv zzP%y%sJ^5|To0S+5AWi8^k1!u?q*ko>-=2Du{f=dD(YHfFa?J@FcZMEF%DuA+93X! z9JAaR9m&oVz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NH|)=74K`z zhKtM74;68cPf0;~vAF8gAK;$)prE**conyE4!la+pOm^w%1}vlihyD-k-hZ_Z-k*8!$VUlQ>MJ{j>F9?p(8$}!MzwTV z&9o2`?W1I3ZGISU%PMuzz%peX9g25@9{*Tk2DTH_-bZU7k6$b;!c1;k4#6U2f=kH> zCpdIlOCqsZK|u)S6sUEgE3m{|piui5&I--&gdTWp6&;R^w_tMcorp-UbzWB7=TYWuH5+I~TZWv7gtA z`4;xq9({(-*ERv*JlPe5QsTmz1KuIlmakh Date: Sun, 30 May 2021 14:03:09 -0500 Subject: [PATCH 02/86] Base for the decrypter system --- CalamityMod.cs | 7 + CalamityNetcode.cs | 4 + .../UI/DraedonDecrypterBackground.png | Bin 0 -> 2374 bytes ExtraTextures/UI/DraedonDecrypterScreen.png | Bin 0 -> 872 bytes .../UI/EncryptedSchematicSlot_Empty.png | Bin 0 -> 704 bytes .../UI/EncryptedSchematicSlot_Full.png | Bin 0 -> 1077 bytes Items/DraedonMisc/DecryptionComputer.cs | 3 +- Items/DraedonMisc/EncryptedSchematic.cs | 2 +- TileEntities/TECodebreaker.cs | 54 +++- TileEntities/TileEntityTimeHandler.cs | 8 + Tiles/DraedonSummoner/CodebreakerTile.cs | 31 +++ UI/DraedonDecryptUI.cs | 261 ++++++++++++++++++ Utilities/StringUtils.cs | 11 + 13 files changed, 377 insertions(+), 4 deletions(-) create mode 100644 ExtraTextures/UI/DraedonDecrypterBackground.png create mode 100644 ExtraTextures/UI/DraedonDecrypterScreen.png create mode 100644 ExtraTextures/UI/EncryptedSchematicSlot_Empty.png create mode 100644 ExtraTextures/UI/EncryptedSchematicSlot_Full.png create mode 100644 UI/DraedonDecryptUI.cs create mode 100644 Utilities/StringUtils.cs diff --git a/CalamityMod.cs b/CalamityMod.cs index 14f119ccc4..ec34a3c3be 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -879,6 +879,13 @@ namespace CalamityMod return true; }, InterfaceScaleType.None)); + // Codebreaker UI. + layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Codebreaker Decryption GUI", () => + { + DraedonDecryptUI.Draw(Main.spriteBatch); + return true; + }, InterfaceScaleType.None)); + // Popup GUIs. layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Popup GUIs", () => { diff --git a/CalamityNetcode.cs b/CalamityNetcode.cs index f0776c139e..b84d25c66d 100644 --- a/CalamityNetcode.cs +++ b/CalamityNetcode.cs @@ -153,6 +153,9 @@ namespace CalamityMod case CalamityModMessageType.UpdateCodebreakerConstituents: TECodebreaker.ReadConstituentsUpdateSync(mod, reader); break; + case CalamityModMessageType.UpdateCodebreakerContainedStuff: + TECodebreaker.ReadContainmentSync(mod, reader); + break; // // Boss Rush @@ -288,6 +291,7 @@ namespace CalamityMod Turret, LabHologramProjector, UpdateCodebreakerConstituents, + UpdateCodebreakerContainedStuff, // Boss Rush BossRushStage, diff --git a/ExtraTextures/UI/DraedonDecrypterBackground.png b/ExtraTextures/UI/DraedonDecrypterBackground.png new file mode 100644 index 0000000000000000000000000000000000000000..10ced3699fa15a3ee9db48286e4a8cc8353004f5 GIT binary patch literal 2374 zcmeAS@N?(olHy`uVBq!ia0y~yV4MKN3>?frkyY#$_5vx!;vjb?hIQv;UIIBR>5jgR z3=A9lx&I`xGB7YR1o(uw0>xQbSw&U#6y;P@lvNE4%uEeU#3J&GJZ&7ET)bS}f}EWa z!^0R3UX%a*zp1=<(cEc3Eu&yG1cpZloXs|O0p*&KAiv=MBO5RTe`i+(#wurlM`SSr z1K)lSX0%`pRsohBhdo^!Ln`9l-o2am$V0&4p{aMoqYsn6*GDcpeK$|)kjrA(qosQ1 zb{cpX#ysify3F#`e*2|=w;%D`)^bb`o$&YH{!5uJqE;P$UAlk&jWkZC)eSZ010ByT zo%^@q`RAuf94pw0EP50gHx$*>^)YMvt$$ngI9KNJ$y=Lm#j9|vG28U*xAn1G>6x=` zRc;GxI`B%N_#FI30_JbaZLxL9QfEB zKMAv3WA>Q9F=@8K29`!u4xlDZCU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$pkMb1+l~ z*BX33c%i(M6j;W=*ab#9zF!;KY&Ht8A_(=niS+_Gh+kV^4eGrvy}nqeiprIMygMaH z&E2V@^}%R9m1|I7y_JmIPf6q|{eL-#k!E!72w3;ND8MIR^n9k9tFIaIm%PC;8Bawq v;C@=iK?&v&%#RYBUoXu1VRSyq9n`cxKQO`C_MxKn00000NkvXXu0mjfOC9f{ literal 0 HcmV?d00001 diff --git a/Items/DraedonMisc/DecryptionComputer.cs b/Items/DraedonMisc/DecryptionComputer.cs index 6ccf6c2da9..3ce235cd49 100644 --- a/Items/DraedonMisc/DecryptionComputer.cs +++ b/Items/DraedonMisc/DecryptionComputer.cs @@ -13,7 +13,8 @@ namespace CalamityMod.Items.DraedonMisc public override void SetStaticDefaults() { DisplayName.SetDefault("Decryption Computer"); - Tooltip.SetDefault("Can be placed in the Codebreaker"); + Tooltip.SetDefault("Can be placed in the Codebreaker\n" + + "Allows you to decrypt schematics"); } public override void SetDefaults() diff --git a/Items/DraedonMisc/EncryptedSchematic.cs b/Items/DraedonMisc/EncryptedSchematic.cs index 917e9198b9..723e05f62f 100644 --- a/Items/DraedonMisc/EncryptedSchematic.cs +++ b/Items/DraedonMisc/EncryptedSchematic.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Items.DraedonMisc public override void SetStaticDefaults() { DisplayName.SetDefault("Encrypted Schematic"); - Tooltip.SetDefault("It's impossible to decipher"); // But not for long. + Tooltip.SetDefault("May be deciphered at the Codebreaker if it is upgraded enough"); } public override void SetDefaults() diff --git a/TileEntities/TECodebreaker.cs b/TileEntities/TECodebreaker.cs index 6e12016794..ef1d2a0bc4 100644 --- a/TileEntities/TECodebreaker.cs +++ b/TileEntities/TECodebreaker.cs @@ -1,5 +1,4 @@ using CalamityMod.Items.DraedonMisc; -using CalamityMod.Tiles.DraedonStructures; using CalamityMod.Tiles.DraedonSummoner; using Microsoft.Xna.Framework; using System.IO; @@ -13,6 +12,13 @@ namespace CalamityMod.TileEntities { public class TECodebreaker : ModTileEntity { + public int InputtedCellCount; + public bool HasSchematic; + + public int DecryptionCountdown; + public int DecryptionTotalTime => 1800; + public float DecryptionCompletion => 1f - DecryptionCountdown / (float)DecryptionTotalTime; + public bool ContainsDecryptionComputer; public bool ContainsSensorArray; public bool ContainsAdvancedDisplay; @@ -48,7 +54,9 @@ namespace CalamityMod.TileEntities // This will cause them to Place the tile entity locally at that position, all with exactly the same ID. public override void OnNetPlace() => NetMessage.SendData(MessageID.TileEntitySharing, -1, -1, null, ID, Position.X, Position.Y); - public void DropConstituents(int x, int y) + public override void Update() => UpdateTime(); + + public void DropConstituents(int x, int y) { if (ContainsDecryptionComputer) Item.NewItem(x * 16, y * 16, 32, 32, ModContent.ItemType()); @@ -107,6 +115,48 @@ namespace CalamityMod.TileEntities codebreakerTileEntity.ContainsCoolingCell = containsCoolingCell; } + public void SyncContainedStuff() + { + // Don't bother sending packets in singleplayer. + if (Main.netMode == NetmodeID.SinglePlayer) + return; + + ModPacket packet = mod.GetPacket(); + packet.Write((byte)CalamityModMessageType.UpdateCodebreakerContainedStuff); + packet.Write(ID); + packet.Write(InputtedCellCount); + packet.Write(HasSchematic); + } + + public static void ReadContainmentSync(Mod mod, BinaryReader reader) + { + int id = reader.ReadInt32(); + bool exists = ByID.TryGetValue(id, out TileEntity tileEntity); + + // Continue reading to the end even if a tile entity with the given ID does not exist. + // Not doing this will cause errors/bugs. + int cellCount = reader.ReadInt32(); + bool hasSchematic = reader.ReadBoolean(); + + // After doing reading, check again to see if the tile entity is actually there. + // If it isn't don't bother doing anything else. + if (!exists) + return; + + // Furthermore, verify to ensure that the tile entity is a valid one. + if (!(tileEntity is TECodebreaker codebreakerTileEntity)) + return; + + codebreakerTileEntity.InputtedCellCount = cellCount; + codebreakerTileEntity.HasSchematic = hasSchematic; + } + + public void UpdateTime() + { + if (DecryptionCountdown > 0) + DecryptionCountdown--; + } + public override TagCompound Save() { return new TagCompound diff --git a/TileEntities/TileEntityTimeHandler.cs b/TileEntities/TileEntityTimeHandler.cs index eadc860b7d..1c076e1428 100644 --- a/TileEntities/TileEntityTimeHandler.cs +++ b/TileEntities/TileEntityTimeHandler.cs @@ -19,6 +19,7 @@ namespace CalamityMod.TileEntities byte factoryType = ModContent.GetInstance().type; byte chargerType = ModContent.GetInstance().type; + byte codebreakerType = ModContent.GetInstance().type; var enumerator = TileEntity.ByID.Values.GetEnumerator(); do @@ -56,6 +57,13 @@ namespace CalamityMod.TileEntities // This makes sure they visually track targets in multiplayer. It will NOT fire projectiles; that code can only run server side. turret.UpdateAngle(); } + else if (te.type == codebreakerType) + { + // Specifically on multiplayer clients, manually update the time variables of the Codebreaker every frame. + // This is done so that clients can accurately gauge how complete decryptions are. + TECodebreaker codebreaker = (TECodebreaker)te; + codebreaker.UpdateTime(); + } } while (enumerator.MoveNext()); } } diff --git a/Tiles/DraedonSummoner/CodebreakerTile.cs b/Tiles/DraedonSummoner/CodebreakerTile.cs index f35288d432..db764cbc22 100644 --- a/Tiles/DraedonSummoner/CodebreakerTile.cs +++ b/Tiles/DraedonSummoner/CodebreakerTile.cs @@ -1,10 +1,12 @@ using CalamityMod.Items.DraedonMisc; using CalamityMod.TileEntities; +using CalamityMod.UI; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.DataStructures; using Terraria.Enums; +using Terraria.ID; using Terraria.ModLoader; using Terraria.ObjectData; @@ -75,6 +77,35 @@ namespace CalamityMod.Tiles.DraedonSummoner codebreakerTileEntity?.Kill(left, top); } + public override bool HasSmartInteract() => true; + + public override bool NewRightClick(int i, int j) + { + TECodebreaker codebreakerTileEntity = CalamityUtils.FindTileEntity(i, j, Width, Height, SheetSquare); + Player player = Main.LocalPlayer; + player.CancelSignsAndChests(); + + // If this is the tile the player is currently looking at, the associated tile entity doesn't really exist, or it's simply not upgraded enough, close the GUI. + if (codebreakerTileEntity is null || codebreakerTileEntity.ID == DraedonDecryptUI.ViewedTileEntityID || !codebreakerTileEntity.ContainsDecryptionComputer) + { + DraedonDecryptUI.ViewedTileEntityID = -1; + Main.PlaySound(SoundID.MenuClose); + } + + // Otherwise, open the decryption interface when it exists. This can be either opening the GUI from nothing, or just opening a separate codebreaker. + else if (codebreakerTileEntity != null) + { + // Play a sound depending on whether the player had another charger open previously. + Main.PlaySound(DraedonDecryptUI.ViewedTileEntityID == -1 ? SoundID.MenuOpen : SoundID.MenuTick); + DraedonDecryptUI.ViewedTileEntityID = codebreakerTileEntity.ID; + Main.playerInventory = true; + Main.recBigList = false; + } + + Recipe.FindRecipes(); + return true; + } + // All tile drawcode is done manually because the tile's animation is controlled by a tile entity. public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) { diff --git a/UI/DraedonDecryptUI.cs b/UI/DraedonDecryptUI.cs new file mode 100644 index 0000000000..c908be04ad --- /dev/null +++ b/UI/DraedonDecryptUI.cs @@ -0,0 +1,261 @@ +using CalamityMod.Items.DraedonMisc; +using CalamityMod.TileEntities; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.Text; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.UI.Chat; + +namespace CalamityMod.UI +{ + public static class DraedonDecryptUI + { + public static int ViewedTileEntityID = -1; + public static bool AwaitingDecryptionTextClose = false; + public static float VerificationButtonScale = 1f; + public static readonly Vector2 BackgroundCenter = new Vector2(500f, Main.screenHeight * 0.5f); + + public static Rectangle MouseScreenArea => Utils.CenteredRectangle(Main.MouseScreen, Vector2.One * 2f); + public static void Draw(SpriteBatch spriteBatch) + { + // If not viewing the specific tile entity's interface anymore, or if the ID is for some reason invalid + // don't do anything except resetting/update necessary information. + if (!TileEntity.ByID.ContainsKey(ViewedTileEntityID) || !(TileEntity.ByID[ViewedTileEntityID] is TECodebreaker codebreakerTileEntity)) + { + VerificationButtonScale = 1f; + ViewedTileEntityID = -1; + return; + } + + // If too far away from the tile entity, stop drawing. + if (!Main.LocalPlayer.WithinRange(codebreakerTileEntity.Center, 270f)) + { + VerificationButtonScale = 1f; + ViewedTileEntityID = -1; + return; + } + + // Draw the background. + Texture2D backgroundTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/DraedonDecrypterBackground"); + spriteBatch.Draw(backgroundTexture, BackgroundCenter, null, Color.White, 0f, backgroundTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); + + Rectangle backgroundArea = Utils.CenteredRectangle(BackgroundCenter, backgroundTexture.Size()); + if (MouseScreenArea.Intersects(backgroundArea)) + Main.blockMouse = Main.LocalPlayer.mouseInterface = true; + + Vector2 backgroundTopLeft = BackgroundCenter - backgroundTexture.Size() * 0.5f; + + // Draw the cell payment slot icon. + Texture2D emptyCellIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/PowerCellSlot_Empty"); + Texture2D occupiedCellIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/PowerCellSlot_Filled"); + Texture2D cellTexture = codebreakerTileEntity.InputtedCellCount > 0 ? occupiedCellIconTexture : emptyCellIconTexture; + Vector2 cellDrawCenter = backgroundTopLeft + Vector2.One * 60f; + + // Create a temporary item for drawing purposes. + // If cells are present, make the item reflect that. + Item temporaryPowerCell = new Item(); + temporaryPowerCell.SetDefaults(ModContent.ItemType()); + temporaryPowerCell.stack = codebreakerTileEntity.InputtedCellCount; + + CalamityUtils.DrawPowercellSlot(spriteBatch, temporaryPowerCell, cellDrawCenter, 1f); + HandleCellSlotInteractions(codebreakerTileEntity, temporaryPowerCell, cellDrawCenter, cellTexture.Size()); + + // Draw the schematic icon. + Vector2 schematicSlotDrawCenter = cellDrawCenter + Vector2.UnitY * 70f; + Texture2D emptySchematicIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/EncryptedSchematicSlot_Empty"); + Texture2D occupiedSchematicIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/EncryptedSchematicSlot_Full"); + + Texture2D schematicTexture = codebreakerTileEntity.HasSchematic ? occupiedSchematicIconTexture : emptySchematicIconTexture; + spriteBatch.Draw(schematicTexture, schematicSlotDrawCenter, null, Color.White, 0f, schematicTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); + HandleSchematicSlotInteractions(codebreakerTileEntity, schematicSlotDrawCenter, cellTexture.Size()); + + // Handle decryption costs. + if (codebreakerTileEntity.HasSchematic && codebreakerTileEntity.DecryptionCountdown == 0) + { + int cost = 30; + Vector2 costDisplayLocation = schematicSlotDrawCenter + Vector2.UnitY * 20f; + Vector2 costVerificationLocation = costDisplayLocation + Vector2.UnitY * 60f; + DisplayCostText(costDisplayLocation, cost); + + if (codebreakerTileEntity.InputtedCellCount >= cost) + DrawCostVerificationButton(codebreakerTileEntity, costVerificationLocation, cost); + } + + if (codebreakerTileEntity.DecryptionCountdown > 0 || AwaitingDecryptionTextClose) + { + Texture2D textPanelTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/DraedonDecrypterScreen"); + Vector2 textPanelCenter = backgroundTopLeft + Vector2.UnitX * backgroundTexture.Width + textPanelTexture.Size() * new Vector2(-0.5f, 0.5f); + spriteBatch.Draw(textPanelTexture, textPanelCenter, null, Color.White, 0f, textPanelTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); + + // Generate gibberish and use slowly insert the real text at the beginning. + // When decryption is done the gibberish will go away and only the underlying text will remain. + int textPadding = 6; + string trueMessage = "The FitnessGram Pacer Test is a multistage aerobic capacity test that progressively gets more difficult as it continues. The 20 meter pacer test will begin in 30 seconds. Line up at the start. The running speed starts slowly, but gets faster each minute after you hear this signal."; + StringBuilder text = new StringBuilder(codebreakerTileEntity.DecryptionCountdown == 0 ? trueMessage : CalamityUtils.GenerateRandomAlphanumericString(500)); + + for (int i = 0; i < trueMessage.Length; i++) + { + if (char.IsWhiteSpace(trueMessage[i])) + text[i] = trueMessage[i]; + } + for (int i = 0; i < (int)(trueMessage.Length * codebreakerTileEntity.DecryptionCompletion); i++) + text[i] = trueMessage[i]; + + Vector2 currentTextDrawPosition = backgroundTopLeft + Vector2.UnitX * backgroundTexture.Width - Vector2.UnitX * (textPanelTexture.Width - textPadding); + currentTextDrawPosition.Y += 6f; + foreach (string line in Utils.WordwrapString(text.ToString(), Main.fontMouseText, (int)(textPanelTexture.Width * 1.5 - textPadding * 2), 15, out _)) + { + if (string.IsNullOrEmpty(line)) + continue; + + ChatManager.DrawColorCodedStringWithShadow(spriteBatch, Main.fontMouseText, line, currentTextDrawPosition, Color.Cyan, 0f, Vector2.Zero, new Vector2(0.6f, 0.6f)); + currentTextDrawPosition.Y += 16; + } + } + } + + public static void HandleCellSlotInteractions(TECodebreaker codebreakerTileEntity, Item temporaryItem, Vector2 cellIconCenter, Vector2 area) + { + Rectangle clickArea = Utils.CenteredRectangle(cellIconCenter, area * 0.5f); + + // If the mouse is not in the specific area don't do anything else. + if (!MouseScreenArea.Intersects(clickArea)) + return; + + ref Item playerHandItem = ref Main.mouseItem; + + if (!temporaryItem.IsAir) + Main.HoverItem = temporaryItem; + + if (Main.mouseLeft && Main.mouseLeftRelease) + { + int powerCellID = ModContent.ItemType(); + short chargerStackDiff = 0; + bool shouldPlaySound = true; + + // If the player is holding shift and has space for the power cells, just spawn all of them on his or her face. + if (Main.keyState.PressingShift() && Main.LocalPlayer.ItemSpace(temporaryItem)) + { + DropHelper.DropItem(Main.LocalPlayer, powerCellID, temporaryItem.stack); + chargerStackDiff = (short)-temporaryItem.stack; + + // Do not play a sound in this situation. The player is going to pick up the dropped cells in a few frames, which will make sound. + shouldPlaySound = false; + } + + // If the slot is normally clicked, behavior depends on whether the player is holding power cells. + else + { + bool holdingPowercell = playerHandItem.type == powerCellID; + + // If the player's held power cells can be stacked on top of what's already in the charger, then stack them. + if (holdingPowercell && temporaryItem.stack < temporaryItem.maxStack) + { + int spaceLeft = temporaryItem.maxStack - temporaryItem.stack; + + // If the player has more cells than there is space left, insert as many as possible. Otherwise insert all the cells. + int cellsToInsert = Math.Min(playerHandItem.stack, spaceLeft); + chargerStackDiff = (short)cellsToInsert; + playerHandItem.stack -= cellsToInsert; + if (playerHandItem.stack == 0) + playerHandItem.TurnToAir(); + AwaitingDecryptionTextClose = false; + } + // If the player is holding nothing, then pick up all the power cells (if any exist). + else if (playerHandItem.IsAir && temporaryItem.stack > 0) + { + chargerStackDiff = (short)-temporaryItem.stack; + playerHandItem.SetDefaults(temporaryItem.type); + playerHandItem.stack = temporaryItem.stack; + temporaryItem.TurnToAir(); + AwaitingDecryptionTextClose = false; + } + } + + if (chargerStackDiff != 0) + { + if (shouldPlaySound) + Main.PlaySound(SoundID.Grab); + AwaitingDecryptionTextClose = false; + codebreakerTileEntity.InputtedCellCount += chargerStackDiff; + codebreakerTileEntity.SyncContainedStuff(); + } + } + + // Force the hover item to be drawn. + // Since HoverItem is active, we don't need to input anything into this method. + if (temporaryItem.stack > 0) + Main.instance.MouseTextHackZoom(string.Empty); + } + + public static void HandleSchematicSlotInteractions(TECodebreaker codebreakerTileEntity, Vector2 schematicIconCenter, Vector2 area) + { + Rectangle clickArea = Utils.CenteredRectangle(schematicIconCenter, area * 0.5f); + + // If the mouse is not in the specific area don't do anything else. + if (!MouseScreenArea.Intersects(clickArea)) + return; + + ref Item playerHandItem = ref Main.mouseItem; + + if (Main.mouseLeft && Main.mouseLeftRelease) + { + if (playerHandItem.IsAir && codebreakerTileEntity.HasSchematic) + { + playerHandItem.SetDefaults(ModContent.ItemType()); + codebreakerTileEntity.HasSchematic = false; + codebreakerTileEntity.DecryptionCountdown = 0; + codebreakerTileEntity.SyncContainedStuff(); + Main.PlaySound(SoundID.Grab); + AwaitingDecryptionTextClose = false; + } + else if (playerHandItem.type == ModContent.ItemType()) + { + playerHandItem.TurnToAir(); + codebreakerTileEntity.HasSchematic = true; + codebreakerTileEntity.SyncContainedStuff(); + Main.PlaySound(SoundID.Grab); + AwaitingDecryptionTextClose = false; + } + } + } + + public static void DisplayCostText(Vector2 drawPosition, int totalCellsCost) + { + string text = "Cost: "; + drawPosition.X -= 30f; + Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontMouseText, text, drawPosition.X, drawPosition.Y + 20f, Color.White * (Main.mouseTextColor / 255f), Color.Black, Vector2.Zero, 1f); + + Texture2D cellTexture = ModContent.GetTexture("CalamityMod/Items/DraedonMisc/PowerCell"); + Vector2 offsetDrawPosition = new Vector2(drawPosition.X + ChatManager.GetStringSize(Main.fontMouseText, text, Vector2.One, -1f).X + 25f, drawPosition.Y + 30f); + Main.spriteBatch.Draw(cellTexture, offsetDrawPosition, null, Color.White, 0f, cellTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); + Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontItemStack, totalCellsCost.ToString(), offsetDrawPosition.X - 11f, offsetDrawPosition.Y, Color.White, Color.Black, new Vector2(0.3f), 0.75f); + } + + public static void DrawCostVerificationButton(TECodebreaker codebreakerTileEntity, Vector2 drawPosition, int totalCellsCost) + { + Texture2D confirmationTexture = Main.cameraTexture[5]; + Rectangle clickArea = Utils.CenteredRectangle(drawPosition, confirmationTexture.Size() * VerificationButtonScale * 0.5f); + if (MouseScreenArea.Intersects(clickArea)) + { + VerificationButtonScale = MathHelper.Clamp(VerificationButtonScale + 0.035f, 1f, 1.35f); + if (Main.mouseLeft && Main.mouseLeftRelease) + { + Main.PlaySound(SoundID.Zombie, Main.LocalPlayer.Center, 67); + AwaitingDecryptionTextClose = true; + codebreakerTileEntity.InputtedCellCount -= totalCellsCost; + codebreakerTileEntity.DecryptionCountdown = codebreakerTileEntity.DecryptionTotalTime; + codebreakerTileEntity.SyncContainedStuff(); + } + } + else + VerificationButtonScale = MathHelper.Clamp(VerificationButtonScale - 0.05f, 1f, 1.35f); + + Main.spriteBatch.Draw(confirmationTexture, drawPosition, null, Color.White, 0f, confirmationTexture.Size() * 0.5f, VerificationButtonScale, SpriteEffects.None, 0f); + } + } +} diff --git a/Utilities/StringUtils.cs b/Utilities/StringUtils.cs new file mode 100644 index 0000000000..7bb54f1c34 --- /dev/null +++ b/Utilities/StringUtils.cs @@ -0,0 +1,11 @@ +using System.Linq; +using Terraria; + +namespace CalamityMod +{ + public static partial class CalamityUtils + { + internal static readonly string AlphanumericCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 "; + public static string GenerateRandomAlphanumericString(int length) => new string(Enumerable.Repeat(AlphanumericCharacters, length).Select(s => s[Main.rand.Next(s.Length)]).ToArray()); + } +} From 394b37f4bebcd5dd697f6bfe1e1746bdf7270faf Mon Sep 17 00:00:00 2001 From: Dominic Date: Mon, 31 May 2021 17:38:57 -0500 Subject: [PATCH 03/86] Schematic expansion stuff --- CalamityLists.cs | 13 ++++ CustomRecipes/ArsenalTierGatedRecipe.cs | 28 ++++++++ CustomRecipes/RecipeUnlockHandler.cs | 55 +++++++++++++++ Items/DraedonMisc/EncryptedSchematicHell.cs | 23 ++++++ ...hematic.png => EncryptedSchematicHell.png} | Bin Items/DraedonMisc/EncryptedSchematicIce.cs | 23 ++++++ Items/DraedonMisc/EncryptedSchematicIce.png | Bin 0 -> 611 bytes Items/DraedonMisc/EncryptedSchematicJungle.cs | 23 ++++++ .../DraedonMisc/EncryptedSchematicJungle.png | Bin 0 -> 611 bytes ...atic.cs => EncryptedSchematicPlanetoid.cs} | 6 +- .../EncryptedSchematicPlanetoid.png | Bin 0 -> 611 bytes .../EncryptedSchematicSunkenSea.cs | 24 +++++++ .../EncryptedSchematicSunkenSea.png | Bin 0 -> 611 bytes TileEntities/TECodebreaker.cs | 66 ++++++++++++++++-- UI/DraedonDecryptUI.cs | 38 +++++++--- World/CalamityWorld.cs | 10 +++ World/DraedonStructures.cs | 10 +-- 17 files changed, 295 insertions(+), 24 deletions(-) create mode 100644 CustomRecipes/ArsenalTierGatedRecipe.cs create mode 100644 CustomRecipes/RecipeUnlockHandler.cs create mode 100644 Items/DraedonMisc/EncryptedSchematicHell.cs rename Items/DraedonMisc/{EncryptedSchematic.png => EncryptedSchematicHell.png} (100%) create mode 100644 Items/DraedonMisc/EncryptedSchematicIce.cs create mode 100644 Items/DraedonMisc/EncryptedSchematicIce.png create mode 100644 Items/DraedonMisc/EncryptedSchematicJungle.cs create mode 100644 Items/DraedonMisc/EncryptedSchematicJungle.png rename Items/DraedonMisc/{EncryptedSchematic.cs => EncryptedSchematicPlanetoid.cs} (72%) create mode 100644 Items/DraedonMisc/EncryptedSchematicPlanetoid.png create mode 100644 Items/DraedonMisc/EncryptedSchematicSunkenSea.cs create mode 100644 Items/DraedonMisc/EncryptedSchematicSunkenSea.png diff --git a/CalamityLists.cs b/CalamityLists.cs index 3daa47a5bb..d787cb5500 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -5,6 +5,7 @@ using CalamityMod.Items.Accessories; using CalamityMod.Items.Accessories.Wings; using CalamityMod.Items.Ammo.FiniteUse; using CalamityMod.Items.Armor.Vanity; +using CalamityMod.Items.DraedonMisc; using CalamityMod.Items.Fishing.AstralCatches; using CalamityMod.Items.Fishing.BrimstoneCragCatches; using CalamityMod.Items.Fishing.FishingRods; @@ -155,6 +156,8 @@ namespace CalamityMod public static List ZeroMinionSlotExceptionList; public static List DontCopyOriginalMinionAIList; + public static Dictionary EncryptedSchematicIDRelationship; + public static void LoadLists() { donatorList = new List() @@ -2506,6 +2509,14 @@ namespace CalamityMod { ProjectileType() }; + + EncryptedSchematicIDRelationship = new Dictionary() + { + [1] = ItemType(), + [2] = ItemType(), + [3] = ItemType(), + [4] = ItemType(), + }; } public static void UnloadLists() @@ -2594,6 +2605,8 @@ namespace CalamityMod MinionsToNotResurrectList = null; ZeroMinionSlotExceptionList = null; DontCopyOriginalMinionAIList = null; + + EncryptedSchematicIDRelationship = null; } } } diff --git a/CustomRecipes/ArsenalTierGatedRecipe.cs b/CustomRecipes/ArsenalTierGatedRecipe.cs new file mode 100644 index 0000000000..9830216ac3 --- /dev/null +++ b/CustomRecipes/ArsenalTierGatedRecipe.cs @@ -0,0 +1,28 @@ +using Terraria.ModLoader; + +namespace CalamityMod.CustomRecipes +{ + public class ArsenalTierGatedRecipe : ModRecipe + { + public int Tier; + public ArsenalTierGatedRecipe(Mod mod, int tier) : base(mod) => Tier = tier; + + public override bool RecipeAvailable() + { + switch (Tier) + { + case 1: + return RecipeUnlockHandler.HasUnlockedT1ArsenalRecipes; + case 2: + return RecipeUnlockHandler.HasUnlockedT2ArsenalRecipes; + case 3: + return RecipeUnlockHandler.HasUnlockedT3ArsenalRecipes; + case 4: + return RecipeUnlockHandler.HasUnlockedT4ArsenalRecipes; + case 5: + return RecipeUnlockHandler.HasUnlockedT5ArsenalRecipes; + } + return false; + } + } +} \ No newline at end of file diff --git a/CustomRecipes/RecipeUnlockHandler.cs b/CustomRecipes/RecipeUnlockHandler.cs new file mode 100644 index 0000000000..b768573f22 --- /dev/null +++ b/CustomRecipes/RecipeUnlockHandler.cs @@ -0,0 +1,55 @@ +using System.Collections.Generic; +using System.IO; +using Terraria; + +namespace CalamityMod.CustomRecipes +{ + public static class RecipeUnlockHandler + { + public static bool HasUnlockedT1ArsenalRecipes = false; + public static bool HasUnlockedT2ArsenalRecipes = false; + public static bool HasUnlockedT3ArsenalRecipes = false; + public static bool HasUnlockedT4ArsenalRecipes = false; + public static bool HasUnlockedT5ArsenalRecipes = false; + + public static void Save(List boolTagContainer) + { + boolTagContainer.AddWithCondition("HasUnlockedT1ArsenalRecipes", HasUnlockedT1ArsenalRecipes); + boolTagContainer.AddWithCondition("HasUnlockedT2ArsenalRecipes", HasUnlockedT2ArsenalRecipes); + boolTagContainer.AddWithCondition("HasUnlockedT3ArsenalRecipes", HasUnlockedT3ArsenalRecipes); + boolTagContainer.AddWithCondition("HasUnlockedT4ArsenalRecipes", HasUnlockedT4ArsenalRecipes); + boolTagContainer.AddWithCondition("HasUnlockedT5ArsenalRecipes", HasUnlockedT5ArsenalRecipes); + } + + public static void Load(IList boolTagContainer) + { + HasUnlockedT1ArsenalRecipes = boolTagContainer.Contains("HasUnlockedT1ArsenalRecipes"); + HasUnlockedT2ArsenalRecipes = boolTagContainer.Contains("HasUnlockedT2ArsenalRecipes"); + HasUnlockedT3ArsenalRecipes = boolTagContainer.Contains("HasUnlockedT3ArsenalRecipes"); + HasUnlockedT4ArsenalRecipes = boolTagContainer.Contains("HasUnlockedT4ArsenalRecipes"); + HasUnlockedT5ArsenalRecipes = boolTagContainer.Contains("HasUnlockedT5ArsenalRecipes"); + } + + public static void SendData(BinaryWriter writer) + { + BitsByte flags = new BitsByte(); + flags[0] = HasUnlockedT1ArsenalRecipes; + flags[1] = HasUnlockedT2ArsenalRecipes; + flags[2] = HasUnlockedT3ArsenalRecipes; + flags[3] = HasUnlockedT4ArsenalRecipes; + flags[4] = HasUnlockedT5ArsenalRecipes; + + writer.Write(flags); + } + + public static void ReceiveData(BinaryReader reader) + { + BitsByte flags = reader.ReadByte(); + HasUnlockedT1ArsenalRecipes = flags[0]; + HasUnlockedT2ArsenalRecipes = flags[1]; + HasUnlockedT3ArsenalRecipes = flags[2]; + HasUnlockedT4ArsenalRecipes = flags[3]; + HasUnlockedT5ArsenalRecipes = flags[4]; + } + } +} \ No newline at end of file diff --git a/Items/DraedonMisc/EncryptedSchematicHell.cs b/Items/DraedonMisc/EncryptedSchematicHell.cs new file mode 100644 index 0000000000..0113e3f8f5 --- /dev/null +++ b/Items/DraedonMisc/EncryptedSchematicHell.cs @@ -0,0 +1,23 @@ +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.DraedonMisc +{ + public class EncryptedSchematicHell : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Encrypted Schematic"); + Tooltip.SetDefault("Requires a Codebreaker with a sophisticated display to decrypt"); + } + + public override void SetDefaults() + { + item.width = 42; + item.height = 42; + item.rare = ItemRarityID.Red; + item.Calamity().customRarity = CalamityRarity.DraedonRust; + item.maxStack = 1; + } + } +} diff --git a/Items/DraedonMisc/EncryptedSchematic.png b/Items/DraedonMisc/EncryptedSchematicHell.png similarity index 100% rename from Items/DraedonMisc/EncryptedSchematic.png rename to Items/DraedonMisc/EncryptedSchematicHell.png diff --git a/Items/DraedonMisc/EncryptedSchematicIce.cs b/Items/DraedonMisc/EncryptedSchematicIce.cs new file mode 100644 index 0000000000..c1797e3e2d --- /dev/null +++ b/Items/DraedonMisc/EncryptedSchematicIce.cs @@ -0,0 +1,23 @@ +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.DraedonMisc +{ + public class EncryptedSchematicIce : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Encrypted Schematic"); + Tooltip.SetDefault("Requires a Codebreaker with a complex voltage regulation system to decrypt"); + } + + public override void SetDefaults() + { + item.width = 42; + item.height = 42; + item.rare = ItemRarityID.Red; + item.Calamity().customRarity = CalamityRarity.DraedonRust; + item.maxStack = 1; + } + } +} diff --git a/Items/DraedonMisc/EncryptedSchematicIce.png b/Items/DraedonMisc/EncryptedSchematicIce.png new file mode 100644 index 0000000000000000000000000000000000000000..6cd561cb05192d8654317ef3a0d325e7d9512761 GIT binary patch literal 611 zcmV-p0-XJcP)Px%9Z5t%R9J=8m$6G6Q4q#|8!QflBZ8ndl1{QB*c@6VBACQl2&ZU~6oRC%yQ@>0 zA`(InZBir<5%LG<1yL)(MiA8NVnFmN!-;T(a2E6C$j;rmw+RH^*L*YYz1dy9{r0`t zfVAi>XjD&K`zJ2nrCR>rpKkUa5ljpWq$)VB_5g5R9~DIx-b5Gd?wNuk;czIL$3fRA zw&wtk6z%BGWB~Y8tF`61Fk1oOysRE`ipD7!m&d`r0SA8+RV8Qo`r0ZOah?v#Wf?F^ z*560J=HSJo1p1XPZ3)j$2(Oidi_e60S21tEA4ToJ;mr*I!=0V!uH+PGD5$XeF!`WS$}Beoh5_cvl6VeR@xgy1KgSYd2H<7g|BvY0LbU_ z0IaWklZmcCSUnZDU!E)pPkj~sKHEBfTol%Q)Vq^O1O3{MtJQl8a=DxY3)29s>%?>E z0UFAv*Oq?>tMckuTc=9Kz#Byy9!=_^O0PdkpeKkT$(sthpI*7vLY1`pr}L)58$}x) z4YOGQJ{%kXu;{#ak?jW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?{%bs9mU{E1!gGr+#^~ x=`XZ$ech6q@Mu){=l 1800; @@ -24,6 +24,51 @@ namespace CalamityMod.TileEntities public bool ContainsAdvancedDisplay; public bool ContainsVoltageRegulationSystem; public bool ContainsCoolingCell; + + public bool CanDecryptHeldSchematic + { + get + { + // You can't decrypt nothing. + if (HeldSchematicID == 0) + return false; + + int schematicType = CalamityLists.EncryptedSchematicIDRelationship[HeldSchematicID]; + if (schematicType == ModContent.ItemType()) + return ContainsDecryptionComputer; + if (schematicType == ModContent.ItemType()) + return ContainsDecryptionComputer && ContainsSensorArray; + if (schematicType == ModContent.ItemType()) + return ContainsDecryptionComputer && ContainsSensorArray && ContainsAdvancedDisplay; + if (schematicType == ModContent.ItemType()) + return ContainsDecryptionComputer && ContainsSensorArray && ContainsAdvancedDisplay && ContainsVoltageRegulationSystem; + + return false; + } + } + + public string UnderlyingSchematicText + { + get + { + // You can't decrypt nothing. + if (HeldSchematicID == 0) + return string.Empty; + + int schematicType = CalamityLists.EncryptedSchematicIDRelationship[HeldSchematicID]; + if (schematicType == ModContent.ItemType()) + return "test1"; + if (schematicType == ModContent.ItemType()) + return "test2"; + if (schematicType == ModContent.ItemType()) + return "test3"; + if (schematicType == ModContent.ItemType()) + return "test4"; + + return string.Empty; + } + } + public Vector2 Center => Position.ToWorldCoordinates(8f * CodebreakerTile.Width, 8f * CodebreakerTile.Height); // This guarantees that this tile entity will not persist if not placed directly on the top left corner of a Charging Station tile. @@ -56,7 +101,7 @@ namespace CalamityMod.TileEntities public override void Update() => UpdateTime(); - public void DropConstituents(int x, int y) + public void DropConstituents(int x, int y) { if (ContainsDecryptionComputer) Item.NewItem(x * 16, y * 16, 32, 32, ModContent.ItemType()); @@ -68,7 +113,10 @@ namespace CalamityMod.TileEntities Item.NewItem(x * 16, y * 16, 32, 32, ModContent.ItemType()); if (ContainsCoolingCell) Item.NewItem(x * 16, y * 16, 32, 32, ModContent.ItemType()); - } + + if (HeldSchematicID != 0) + Item.NewItem(x * 16, y * 16, 32, 32, CalamityLists.EncryptedSchematicIDRelationship[HeldSchematicID]); + } public void SyncConstituents() { @@ -125,7 +173,7 @@ namespace CalamityMod.TileEntities packet.Write((byte)CalamityModMessageType.UpdateCodebreakerContainedStuff); packet.Write(ID); packet.Write(InputtedCellCount); - packet.Write(HasSchematic); + packet.Write(HeldSchematicID); } public static void ReadContainmentSync(Mod mod, BinaryReader reader) @@ -136,7 +184,7 @@ namespace CalamityMod.TileEntities // Continue reading to the end even if a tile entity with the given ID does not exist. // Not doing this will cause errors/bugs. int cellCount = reader.ReadInt32(); - bool hasSchematic = reader.ReadBoolean(); + int schematicID = reader.ReadInt32(); // After doing reading, check again to see if the tile entity is actually there. // If it isn't don't bother doing anything else. @@ -148,7 +196,7 @@ namespace CalamityMod.TileEntities return; codebreakerTileEntity.InputtedCellCount = cellCount; - codebreakerTileEntity.HasSchematic = hasSchematic; + codebreakerTileEntity.HeldSchematicID = schematicID; } public void UpdateTime() @@ -165,7 +213,8 @@ namespace CalamityMod.TileEntities ["ContainsSensorArray"] = ContainsSensorArray, ["ContainsAdvancedDisplay"] = ContainsAdvancedDisplay, ["ContainsVoltageRegulationSystem"] = ContainsVoltageRegulationSystem, - ["ContainsCoolingCell"] = ContainsCoolingCell + ["ContainsCoolingCell"] = ContainsCoolingCell, + ["HeldSchematicID"] = HeldSchematicID }; } @@ -176,6 +225,7 @@ namespace CalamityMod.TileEntities ContainsAdvancedDisplay = tag.GetBool("ContainsAdvancedDisplay"); ContainsVoltageRegulationSystem = tag.GetBool("ContainsVoltageRegulationSystem"); ContainsCoolingCell = tag.GetBool("ContainsCoolingCell"); + HeldSchematicID = tag.GetInt("HeldSchematicID"); } public override void NetSend(BinaryWriter writer, bool lightSend) @@ -185,6 +235,7 @@ namespace CalamityMod.TileEntities writer.Write(ContainsAdvancedDisplay); writer.Write(ContainsVoltageRegulationSystem); writer.Write(ContainsCoolingCell); + writer.Write(HeldSchematicID); } public override void NetReceive(BinaryReader reader, bool lightReceive) @@ -194,6 +245,7 @@ namespace CalamityMod.TileEntities ContainsAdvancedDisplay = reader.ReadBoolean(); ContainsVoltageRegulationSystem = reader.ReadBoolean(); ContainsCoolingCell = reader.ReadBoolean(); + HeldSchematicID = reader.ReadInt32(); } } } diff --git a/UI/DraedonDecryptUI.cs b/UI/DraedonDecryptUI.cs index c908be04ad..428a9d6139 100644 --- a/UI/DraedonDecryptUI.cs +++ b/UI/DraedonDecryptUI.cs @@ -3,6 +3,7 @@ using CalamityMod.TileEntities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; +using System.Linq; using System.Text; using Terraria; using Terraria.DataStructures; @@ -69,12 +70,19 @@ namespace CalamityMod.UI Texture2D emptySchematicIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/EncryptedSchematicSlot_Empty"); Texture2D occupiedSchematicIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/EncryptedSchematicSlot_Full"); - Texture2D schematicTexture = codebreakerTileEntity.HasSchematic ? occupiedSchematicIconTexture : emptySchematicIconTexture; + Texture2D schematicTexture = codebreakerTileEntity.HeldSchematicID != 0 ? occupiedSchematicIconTexture : emptySchematicIconTexture; spriteBatch.Draw(schematicTexture, schematicSlotDrawCenter, null, Color.White, 0f, schematicTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); HandleSchematicSlotInteractions(codebreakerTileEntity, schematicSlotDrawCenter, cellTexture.Size()); + // Display some error text if the codebreaker isn't strong enough to decrypt the text. + if (codebreakerTileEntity.HeldSchematicID != 0 && !codebreakerTileEntity.CanDecryptHeldSchematic) + { + Vector2 errorDisplayLocation = schematicSlotDrawCenter + Vector2.UnitY * 20f; + DisplayNotStrongEnoughErrorText(errorDisplayLocation); + } + // Handle decryption costs. - if (codebreakerTileEntity.HasSchematic && codebreakerTileEntity.DecryptionCountdown == 0) + else if (codebreakerTileEntity.HeldSchematicID != 0 && codebreakerTileEntity.DecryptionCountdown == 0) { int cost = 30; Vector2 costDisplayLocation = schematicSlotDrawCenter + Vector2.UnitY * 20f; @@ -91,17 +99,20 @@ namespace CalamityMod.UI Vector2 textPanelCenter = backgroundTopLeft + Vector2.UnitX * backgroundTexture.Width + textPanelTexture.Size() * new Vector2(-0.5f, 0.5f); spriteBatch.Draw(textPanelTexture, textPanelCenter, null, Color.White, 0f, textPanelTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); - // Generate gibberish and use slowly insert the real text at the beginning. + // Generate gibberish and use slowly insert the real text. // When decryption is done the gibberish will go away and only the underlying text will remain. int textPadding = 6; - string trueMessage = "The FitnessGram Pacer Test is a multistage aerobic capacity test that progressively gets more difficult as it continues. The 20 meter pacer test will begin in 30 seconds. Line up at the start. The running speed starts slowly, but gets faster each minute after you hear this signal."; + string trueMessage = codebreakerTileEntity.UnderlyingSchematicText; StringBuilder text = new StringBuilder(codebreakerTileEntity.DecryptionCountdown == 0 ? trueMessage : CalamityUtils.GenerateRandomAlphanumericString(500)); + // Don't mess with whitespace characters. Doing so can cause the word-wrap to "jump" around. for (int i = 0; i < trueMessage.Length; i++) { if (char.IsWhiteSpace(trueMessage[i])) text[i] = trueMessage[i]; } + + // Insert the necessary amount of true text. for (int i = 0; i < (int)(trueMessage.Length * codebreakerTileEntity.DecryptionCompletion); i++) text[i] = trueMessage[i]; @@ -204,21 +215,23 @@ namespace CalamityMod.UI if (Main.mouseLeft && Main.mouseLeftRelease) { - if (playerHandItem.IsAir && codebreakerTileEntity.HasSchematic) + if (playerHandItem.IsAir && codebreakerTileEntity.HeldSchematicID != 0) { - playerHandItem.SetDefaults(ModContent.ItemType()); - codebreakerTileEntity.HasSchematic = false; + playerHandItem.SetDefaults(CalamityLists.EncryptedSchematicIDRelationship[codebreakerTileEntity.HeldSchematicID]); + codebreakerTileEntity.HeldSchematicID = 0; codebreakerTileEntity.DecryptionCountdown = 0; codebreakerTileEntity.SyncContainedStuff(); Main.PlaySound(SoundID.Grab); + AwaitingDecryptionTextClose = false; } - else if (playerHandItem.type == ModContent.ItemType()) + else if (CalamityLists.EncryptedSchematicIDRelationship.ContainsValue(playerHandItem.type)) { + codebreakerTileEntity.HeldSchematicID = CalamityLists.EncryptedSchematicIDRelationship.First(i => i.Value == Main.mouseItem.type).Key; playerHandItem.TurnToAir(); - codebreakerTileEntity.HasSchematic = true; codebreakerTileEntity.SyncContainedStuff(); Main.PlaySound(SoundID.Grab); + AwaitingDecryptionTextClose = false; } } @@ -257,5 +270,12 @@ namespace CalamityMod.UI Main.spriteBatch.Draw(confirmationTexture, drawPosition, null, Color.White, 0f, confirmationTexture.Size() * 0.5f, VerificationButtonScale, SpriteEffects.None, 0f); } + + public static void DisplayNotStrongEnoughErrorText(Vector2 drawPosition) + { + string text = "Encryption unsolveable: Upgrades required."; + drawPosition.X -= 30f; + Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontMouseText, text, drawPosition.X, drawPosition.Y + 20f, Color.IndianRed * (Main.mouseTextColor / 255f), Color.Black, Vector2.Zero, 1f); + } } } diff --git a/World/CalamityWorld.cs b/World/CalamityWorld.cs index 445f06248d..377a9dbcc3 100644 --- a/World/CalamityWorld.cs +++ b/World/CalamityWorld.cs @@ -1,4 +1,5 @@ using CalamityMod.CalPlayer; +using CalamityMod.CustomRecipes; using CalamityMod.DataStructures; using CalamityMod.Events; using CalamityMod.NPCs; @@ -456,6 +457,8 @@ namespace CalamityMod.World if (HasGeneratedLuminitePlanetoids) downed.Add("HasGeneratedLuminitePlanetoids"); + RecipeUnlockHandler.Save(downed); + return new TagCompound { { @@ -560,6 +563,8 @@ namespace CalamityMod.World encounteredOldDuke = downed.Contains("encounteredOldDuke"); HasGeneratedLuminitePlanetoids = downed.Contains("HasGeneratedLuminitePlanetoids"); + RecipeUnlockHandler.Load(downed); + abyssChasmBottom = tag.GetInt("abyssChasmBottom"); acidRainPoints = tag.GetInt("acidRainPoints"); Reforges = tag.GetInt("Reforges"); @@ -803,6 +808,9 @@ namespace CalamityMod.World writer.Write(flags8); writer.Write(flags9); writer.Write(flags10); + + RecipeUnlockHandler.SendData(writer); + writer.Write(abyssChasmBottom); writer.Write(acidRainPoints); writer.Write(Reforges); @@ -914,6 +922,8 @@ namespace CalamityMod.World _ = flags10[6]; _ = flags10[7]; + RecipeUnlockHandler.ReceiveData(reader); + abyssChasmBottom = reader.ReadInt32(); acidRainPoints = reader.ReadInt32(); Reforges = reader.ReadInt32(); diff --git a/World/DraedonStructures.cs b/World/DraedonStructures.cs index f10e8a59d7..00ecb4d969 100644 --- a/World/DraedonStructures.cs +++ b/World/DraedonStructures.cs @@ -227,7 +227,7 @@ namespace CalamityMod.World { contents.Insert(0, new ChestItem(ModContent.ItemType(), 1)); contents.Insert(1, new ChestItem(ModContent.ItemType(), 1)); - contents.Insert(2, new ChestItem(ModContent.ItemType(), 1)); + contents.Insert(2, new ChestItem(ModContent.ItemType(), 1)); } for (int i = 0; i < contents.Count; i++) { @@ -298,7 +298,7 @@ namespace CalamityMod.World if (!hasPlacedLogAndSchematic) { contents.Insert(0, new ChestItem(ModContent.ItemType(), 1)); - contents.Insert(1, new ChestItem(ModContent.ItemType(), 1)); + contents.Insert(1, new ChestItem(ModContent.ItemType(), 1)); } for (int i = 0; i < contents.Count; i++) { @@ -365,7 +365,7 @@ namespace CalamityMod.World if (!hasPlacedLogAndSchematic) { contents.Insert(0, new ChestItem(ModContent.ItemType(), 1)); - contents.Insert(1, new ChestItem(ModContent.ItemType(), 1)); + contents.Insert(1, new ChestItem(ModContent.ItemType(), 1)); } // If it's a frozen chest. if (type == TileID.Containers) @@ -448,7 +448,7 @@ namespace CalamityMod.World if (!hasPlacedLogAndSchematic) { contents.Insert(0, new ChestItem(ModContent.ItemType(), 1)); - contents.Insert(1, new ChestItem(ModContent.ItemType(), 1)); + contents.Insert(1, new ChestItem(ModContent.ItemType(), 1)); } for (int i = 0; i < contents.Count; i++) { @@ -541,7 +541,7 @@ namespace CalamityMod.World if (!hasPlacedLogAndSchematic) { contents.Insert(0, new ChestItem(ModContent.ItemType(), 1)); - contents.Insert(1, new ChestItem(ModContent.ItemType(), 1)); + contents.Insert(1, new ChestItem(ModContent.ItemType(), 1)); } for (int i = 0; i < contents.Count; i++) { From 470e4552050d0fe96c209489848f5e32b6ac2571 Mon Sep 17 00:00:00 2001 From: Dominic Date: Mon, 31 May 2021 17:39:59 -0500 Subject: [PATCH 04/86] Adjusted the screen a bit --- ExtraTextures/UI/DraedonDecrypterScreen.png | Bin 872 -> 928 bytes TileEntities/TECodebreaker.cs | 4 ++-- UI/DraedonDecryptUI.cs | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ExtraTextures/UI/DraedonDecrypterScreen.png b/ExtraTextures/UI/DraedonDecrypterScreen.png index f6571a52ed65cb5efd65eef1c75bae09c2035bf7..a3ff170c610769a74681d416ff0b5abeaa4a3f53 100644 GIT binary patch literal 928 zcmeAS@N?(olHy`uVBq!ia0y~yU{nCIZ*i~zNw&Z9y@3>Cage(c!@6@aFM%AEbVpxD z28NCO+nMIp_R1#K65fLo6SUOYeC?4QPHe*eq#)JQ-5hSR&PV;g4A_Aif; zJuCabjPLvBjDA*@lxLqmS?<}_+u!~+EvCWy_pP_bW7ozX+uG1@<~`G|nkqSYhU?#c ze6(8!RLa6}f=d>@Z10Z literal 872 zcmeAS@N?(olHy`uVBq!ia0vp^3m6y}893O0ER!X* 0) DecryptionCountdown--; - } + } public override TagCompound Save() { diff --git a/UI/DraedonDecryptUI.cs b/UI/DraedonDecryptUI.cs index 428a9d6139..c15fbe2c62 100644 --- a/UI/DraedonDecryptUI.cs +++ b/UI/DraedonDecryptUI.cs @@ -118,7 +118,7 @@ namespace CalamityMod.UI Vector2 currentTextDrawPosition = backgroundTopLeft + Vector2.UnitX * backgroundTexture.Width - Vector2.UnitX * (textPanelTexture.Width - textPadding); currentTextDrawPosition.Y += 6f; - foreach (string line in Utils.WordwrapString(text.ToString(), Main.fontMouseText, (int)(textPanelTexture.Width * 1.5 - textPadding * 2), 15, out _)) + foreach (string line in Utils.WordwrapString(text.ToString(), Main.fontMouseText, (int)(textPanelTexture.Width * 1.5 - textPadding * 2), 13, out _)) { if (string.IsNullOrEmpty(line)) continue; @@ -215,6 +215,7 @@ namespace CalamityMod.UI if (Main.mouseLeft && Main.mouseLeftRelease) { + Main.playerInventory = true; if (playerHandItem.IsAir && codebreakerTileEntity.HeldSchematicID != 0) { playerHandItem.SetDefaults(CalamityLists.EncryptedSchematicIDRelationship[codebreakerTileEntity.HeldSchematicID]); @@ -244,7 +245,7 @@ namespace CalamityMod.UI Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontMouseText, text, drawPosition.X, drawPosition.Y + 20f, Color.White * (Main.mouseTextColor / 255f), Color.Black, Vector2.Zero, 1f); Texture2D cellTexture = ModContent.GetTexture("CalamityMod/Items/DraedonMisc/PowerCell"); - Vector2 offsetDrawPosition = new Vector2(drawPosition.X + ChatManager.GetStringSize(Main.fontMouseText, text, Vector2.One, -1f).X + 25f, drawPosition.Y + 30f); + Vector2 offsetDrawPosition = new Vector2(drawPosition.X + ChatManager.GetStringSize(Main.fontMouseText, text, Vector2.One, -1f).X + 15f, drawPosition.Y + 30f); Main.spriteBatch.Draw(cellTexture, offsetDrawPosition, null, Color.White, 0f, cellTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontItemStack, totalCellsCost.ToString(), offsetDrawPosition.X - 11f, offsetDrawPosition.Y, Color.White, Color.Black, new Vector2(0.3f), 0.75f); } From d11adde14a45d2b6ce121e3577d47b335b11e296 Mon Sep 17 00:00:00 2001 From: Dominic Date: Mon, 31 May 2021 18:53:02 -0500 Subject: [PATCH 05/86] Recipe related stuff --- CalamityNetcode.cs | 4 + Items/DraedonMisc/AdvancedDisplay.cs | 3 +- Items/DraedonMisc/AuricQuantumCoolingCell.cs | 20 ++++- Items/DraedonMisc/DecryptionComputer.cs | 6 +- .../EncryptedSchematicSunkenSea.cs | 16 +++- Items/DraedonMisc/LongRangedSensorArray.cs | 3 +- Items/DraedonMisc/VoltageRegulationSystem.cs | 3 +- .../DraedonsArsenal/FrequencyManipulator.cs | 3 +- .../DraedonsArsenal/GalvanizingGlaive.cs | 3 +- Items/Weapons/DraedonsArsenal/GatlingLaser.cs | 3 +- Items/Weapons/DraedonsArsenal/GaussDagger.cs | 3 +- Items/Weapons/DraedonsArsenal/GaussPistol.cs | 3 +- Items/Weapons/DraedonsArsenal/GaussRifle.cs | 3 +- .../DraedonsArsenal/HydraulicVoltCrasher.cs | 3 +- Items/Weapons/DraedonsArsenal/LaserRifle.cs | 3 +- .../DraedonsArsenal/MatterModulator.cs | 3 +- .../Weapons/DraedonsArsenal/MountedScanner.cs | 3 +- Items/Weapons/DraedonsArsenal/Phaseslayer.cs | 3 +- Items/Weapons/DraedonsArsenal/PlasmaCaster.cs | 3 +- .../Weapons/DraedonsArsenal/PlasmaGrenade.cs | 3 +- Items/Weapons/DraedonsArsenal/PoleWarper.cs | 3 +- Items/Weapons/DraedonsArsenal/PulseDragon.cs | 3 +- Items/Weapons/DraedonsArsenal/PulsePistol.cs | 3 +- Items/Weapons/DraedonsArsenal/PulseRifle.cs | 3 +- .../DraedonsArsenal/PulseTurretRemote.cs | 3 +- Items/Weapons/DraedonsArsenal/SnakeEyes.cs | 3 +- .../StarSwallowerContainmentUnit.cs | 3 +- Items/Weapons/DraedonsArsenal/SystemBane.cs | 3 +- Items/Weapons/DraedonsArsenal/Taser.cs | 3 +- Items/Weapons/DraedonsArsenal/TeslaCannon.cs | 3 +- Items/Weapons/DraedonsArsenal/TrackingDisk.cs | 3 +- Items/Weapons/DraedonsArsenal/WavePounder.cs | 3 +- TileEntities/TECodebreaker.cs | 90 +++++++++++++++++-- Tiles/DraedonSummoner/CodebreakerTile.cs | 6 +- UI/DraedonDecryptUI.cs | 34 +++---- 35 files changed, 202 insertions(+), 58 deletions(-) diff --git a/CalamityNetcode.cs b/CalamityNetcode.cs index b84d25c66d..8bb0781921 100644 --- a/CalamityNetcode.cs +++ b/CalamityNetcode.cs @@ -156,6 +156,9 @@ namespace CalamityMod case CalamityModMessageType.UpdateCodebreakerContainedStuff: TECodebreaker.ReadContainmentSync(mod, reader); break; + case CalamityModMessageType.UpdateCodebreakerDecryptCountdown: + TECodebreaker.ReadDecryptCountdownSync(mod, reader); + break; // // Boss Rush @@ -292,6 +295,7 @@ namespace CalamityMod LabHologramProjector, UpdateCodebreakerConstituents, UpdateCodebreakerContainedStuff, + UpdateCodebreakerDecryptCountdown, // Boss Rush BossRushStage, diff --git a/Items/DraedonMisc/AdvancedDisplay.cs b/Items/DraedonMisc/AdvancedDisplay.cs index 7dcefc9c72..c203361438 100644 --- a/Items/DraedonMisc/AdvancedDisplay.cs +++ b/Items/DraedonMisc/AdvancedDisplay.cs @@ -5,6 +5,7 @@ using Terraria.ID; using Terraria.ModLoader; using Microsoft.Xna.Framework; using CalamityMod.TileEntities; +using CalamityMod.CustomRecipes; namespace CalamityMod.Items.DraedonMisc { @@ -51,7 +52,7 @@ namespace CalamityMod.Items.DraedonMisc public override void AddRecipes() { - ModRecipe recipe = new ModRecipe(mod); + ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 3); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ModContent.ItemType(), 3); diff --git a/Items/DraedonMisc/AuricQuantumCoolingCell.cs b/Items/DraedonMisc/AuricQuantumCoolingCell.cs index bbef3dc013..f6f737062e 100644 --- a/Items/DraedonMisc/AuricQuantumCoolingCell.cs +++ b/Items/DraedonMisc/AuricQuantumCoolingCell.cs @@ -1,11 +1,14 @@ -using CalamityMod.Items.Materials; +using CalamityMod.CustomRecipes; +using CalamityMod.Items.Materials; +using CalamityMod.TileEntities; using CalamityMod.Tiles.DraedonSummoner; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; using Microsoft.Xna.Framework; -using CalamityMod.TileEntities; +using System.Collections.Generic; +using System.Linq; namespace CalamityMod.Items.DraedonMisc { @@ -14,7 +17,9 @@ namespace CalamityMod.Items.DraedonMisc public override void SetStaticDefaults() { DisplayName.SetDefault("Auric Quantum Cooling Cell"); - Tooltip.SetDefault("Can be placed in the Codebreaker"); + Tooltip.SetDefault("Can be placed in the Codebreaker, completing it\n" + + "The completion of the Codebreaker allows you to make contact with its original creator\n" + + "Modified later"); } public override void SetDefaults() @@ -29,6 +34,13 @@ namespace CalamityMod.Items.DraedonMisc item.Calamity().customRarity = CalamityRarity.Violet; } + public override void ModifyTooltips(List tooltips) + { + var tt2 = tooltips.FirstOrDefault(x => x.Name == "Tooltip2" && x.mod == "Terraria"); + tt2.text = "Attempting to do so may have dire consequences"; + tt2.overrideColor = Color.DarkRed; + } + public override void Update(ref float gravity, ref float maxFallSpeed) { float brightness = Main.essScale * Main.rand.NextFloat(0.9f, 1.1f); @@ -59,7 +71,7 @@ namespace CalamityMod.Items.DraedonMisc public override void AddRecipes() { - ModRecipe recipe = new ModRecipe(mod); + ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 5); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); diff --git a/Items/DraedonMisc/DecryptionComputer.cs b/Items/DraedonMisc/DecryptionComputer.cs index 3ce235cd49..cdb032f728 100644 --- a/Items/DraedonMisc/DecryptionComputer.cs +++ b/Items/DraedonMisc/DecryptionComputer.cs @@ -5,6 +5,7 @@ using Terraria.ID; using Terraria.ModLoader; using Microsoft.Xna.Framework; using CalamityMod.TileEntities; +using CalamityMod.CustomRecipes; namespace CalamityMod.Items.DraedonMisc { @@ -14,7 +15,8 @@ namespace CalamityMod.Items.DraedonMisc { DisplayName.SetDefault("Decryption Computer"); Tooltip.SetDefault("Can be placed in the Codebreaker\n" + - "Allows you to decrypt schematics"); + "Allows you to decrypt schematics\n" + + "Doing so allows you to learn how to craft new things"); } public override void SetDefaults() @@ -52,7 +54,7 @@ namespace CalamityMod.Items.DraedonMisc public override void AddRecipes() { - ModRecipe recipe = new ModRecipe(mod); + ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 1); recipe.AddIngredient(ModContent.ItemType(), 18); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ItemID.Glass, 5); diff --git a/Items/DraedonMisc/EncryptedSchematicSunkenSea.cs b/Items/DraedonMisc/EncryptedSchematicSunkenSea.cs index 0d4e2de9a1..d30493d505 100644 --- a/Items/DraedonMisc/EncryptedSchematicSunkenSea.cs +++ b/Items/DraedonMisc/EncryptedSchematicSunkenSea.cs @@ -1,3 +1,5 @@ +using CalamityMod.CustomRecipes; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -9,7 +11,8 @@ namespace CalamityMod.Items.DraedonMisc { DisplayName.SetDefault("Schematic"); Tooltip.SetDefault("You can barely make out its text. It states:\n" + - "Something idk"); + "Something idk\n" + + "Having this item in your inventory permanently unlocks special equipment"); } public override void SetDefaults() @@ -20,5 +23,16 @@ namespace CalamityMod.Items.DraedonMisc item.Calamity().customRarity = CalamityRarity.DraedonRust; item.maxStack = 1; } + + public override void UpdateInventory(Player player) + { + // Since no decrypting is necessary for this item simply placing it in your inventory is sufficient enough to "learn" + // from it. + if (Main.myPlayer == player.whoAmI && !RecipeUnlockHandler.HasUnlockedT1ArsenalRecipes) + { + RecipeUnlockHandler.HasUnlockedT1ArsenalRecipes = true; + CalamityNetcode.SyncWorld(); + } + } } } diff --git a/Items/DraedonMisc/LongRangedSensorArray.cs b/Items/DraedonMisc/LongRangedSensorArray.cs index dc07195d59..e27d9f04c9 100644 --- a/Items/DraedonMisc/LongRangedSensorArray.cs +++ b/Items/DraedonMisc/LongRangedSensorArray.cs @@ -5,6 +5,7 @@ using Terraria.ID; using Terraria.ModLoader; using Microsoft.Xna.Framework; using CalamityMod.TileEntities; +using CalamityMod.CustomRecipes; namespace CalamityMod.Items.DraedonMisc { @@ -51,7 +52,7 @@ namespace CalamityMod.Items.DraedonMisc public override void AddRecipes() { - ModRecipe recipe = new ModRecipe(mod); + ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 2); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ItemID.HallowedBar, 10); diff --git a/Items/DraedonMisc/VoltageRegulationSystem.cs b/Items/DraedonMisc/VoltageRegulationSystem.cs index 860866a26c..5d74c89e67 100644 --- a/Items/DraedonMisc/VoltageRegulationSystem.cs +++ b/Items/DraedonMisc/VoltageRegulationSystem.cs @@ -5,6 +5,7 @@ using Terraria.ID; using Terraria.ModLoader; using Microsoft.Xna.Framework; using CalamityMod.TileEntities; +using CalamityMod.CustomRecipes; namespace CalamityMod.Items.DraedonMisc { @@ -52,7 +53,7 @@ namespace CalamityMod.Items.DraedonMisc public override void AddRecipes() { - ModRecipe recipe = new ModRecipe(mod); + ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 4); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ModContent.ItemType(), 5); diff --git a/Items/Weapons/DraedonsArsenal/FrequencyManipulator.cs b/Items/Weapons/DraedonsArsenal/FrequencyManipulator.cs index 7c4d99b2c1..cbf8d340f8 100644 --- a/Items/Weapons/DraedonsArsenal/FrequencyManipulator.cs +++ b/Items/Weapons/DraedonsArsenal/FrequencyManipulator.cs @@ -1,3 +1,4 @@ +using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.DraedonsArsenal; @@ -60,7 +61,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void AddRecipes() { - ModRecipe recipe = new ModRecipe(mod); + ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 2); recipe.AddIngredient(ModContent.ItemType(), 8); recipe.AddIngredient(ModContent.ItemType(), 12); recipe.AddIngredient(ItemID.HallowedBar, 10); diff --git a/Items/Weapons/DraedonsArsenal/GalvanizingGlaive.cs b/Items/Weapons/DraedonsArsenal/GalvanizingGlaive.cs index a55146abb1..cb6a599700 100644 --- a/Items/Weapons/DraedonsArsenal/GalvanizingGlaive.cs +++ b/Items/Weapons/DraedonsArsenal/GalvanizingGlaive.cs @@ -1,3 +1,4 @@ +using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; @@ -59,7 +60,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void AddRecipes() { - ModRecipe recipe = new ModRecipe(mod); + ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 3); recipe.AddIngredient(ModContent.ItemType(), 12); recipe.AddIngredient(ModContent.ItemType(), 18); recipe.AddIngredient(ModContent.ItemType(), 5); diff --git a/Items/Weapons/DraedonsArsenal/GatlingLaser.cs b/Items/Weapons/DraedonsArsenal/GatlingLaser.cs index 0b1bd13c12..f712a46951 100644 --- a/Items/Weapons/DraedonsArsenal/GatlingLaser.cs +++ b/Items/Weapons/DraedonsArsenal/GatlingLaser.cs @@ -1,3 +1,4 @@ +using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; @@ -63,7 +64,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void AddRecipes() { - ModRecipe recipe = new ModRecipe(mod); + ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 3); recipe.AddIngredient(ModContent.ItemType(), 15); recipe.AddIngredient(ModContent.ItemType(), 15); recipe.AddIngredient(ModContent.ItemType(), 5); diff --git a/Items/Weapons/DraedonsArsenal/GaussDagger.cs b/Items/Weapons/DraedonsArsenal/GaussDagger.cs index 780a838702..e222ef54bb 100644 --- a/Items/Weapons/DraedonsArsenal/GaussDagger.cs +++ b/Items/Weapons/DraedonsArsenal/GaussDagger.cs @@ -1,3 +1,4 @@ +using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; @@ -58,7 +59,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void AddRecipes() { - ModRecipe recipe = new ModRecipe(mod); + ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 1); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ModContent.ItemType(), 7); recipe.AddIngredient(ModContent.ItemType(), 4); diff --git a/Items/Weapons/DraedonsArsenal/GaussPistol.cs b/Items/Weapons/DraedonsArsenal/GaussPistol.cs index ff9b51e329..9abb103cc1 100644 --- a/Items/Weapons/DraedonsArsenal/GaussPistol.cs +++ b/Items/Weapons/DraedonsArsenal/GaussPistol.cs @@ -1,3 +1,4 @@ +using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using Terraria.ID; @@ -45,7 +46,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void AddRecipes() { - ModRecipe recipe = new ModRecipe(mod); + ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 2); recipe.AddIngredient(ModContent.ItemType(), 12); recipe.AddIngredient(ModContent.ItemType(), 8); recipe.AddIngredient(ItemID.HallowedBar, 10); diff --git a/Items/Weapons/DraedonsArsenal/GaussRifle.cs b/Items/Weapons/DraedonsArsenal/GaussRifle.cs index 9616aed0c3..03c924d9e0 100644 --- a/Items/Weapons/DraedonsArsenal/GaussRifle.cs +++ b/Items/Weapons/DraedonsArsenal/GaussRifle.cs @@ -1,3 +1,4 @@ +using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; @@ -52,7 +53,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void AddRecipes() { - ModRecipe recipe = new ModRecipe(mod); + ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 3); recipe.AddIngredient(ModContent.ItemType(), 18); recipe.AddIngredient(ModContent.ItemType(), 12); recipe.AddIngredient(ModContent.ItemType(), 5); diff --git a/Items/Weapons/DraedonsArsenal/HydraulicVoltCrasher.cs b/Items/Weapons/DraedonsArsenal/HydraulicVoltCrasher.cs index bce57c4285..fe90632bb0 100644 --- a/Items/Weapons/DraedonsArsenal/HydraulicVoltCrasher.cs +++ b/Items/Weapons/DraedonsArsenal/HydraulicVoltCrasher.cs @@ -1,3 +1,4 @@ +using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using Terraria; @@ -52,7 +53,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void AddRecipes() { - ModRecipe recipe = new ModRecipe(mod); + ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 2); recipe.AddIngredient(ModContent.ItemType(), 8); recipe.AddIngredient(ModContent.ItemType(), 12); recipe.AddIngredient(ItemID.HallowedBar, 10); diff --git a/Items/Weapons/DraedonsArsenal/LaserRifle.cs b/Items/Weapons/DraedonsArsenal/LaserRifle.cs index 8c7c871921..b94e59f66d 100644 --- a/Items/Weapons/DraedonsArsenal/LaserRifle.cs +++ b/Items/Weapons/DraedonsArsenal/LaserRifle.cs @@ -1,3 +1,4 @@ +using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; @@ -69,7 +70,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void AddRecipes() { - ModRecipe recipe = new ModRecipe(mod); + ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 4); recipe.AddIngredient(ModContent.ItemType(), 15); recipe.AddIngredient(ModContent.ItemType(), 15); recipe.AddIngredient(ModContent.ItemType(), 8); diff --git a/Items/Weapons/DraedonsArsenal/MatterModulator.cs b/Items/Weapons/DraedonsArsenal/MatterModulator.cs index 3a23cd49a4..a12dcd2ca8 100644 --- a/Items/Weapons/DraedonsArsenal/MatterModulator.cs +++ b/Items/Weapons/DraedonsArsenal/MatterModulator.cs @@ -1,3 +1,4 @@ +using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; @@ -57,7 +58,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void AddRecipes() { - ModRecipe recipe = new ModRecipe(mod); + ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 2); recipe.AddIngredient(ModContent.ItemType(), 12); recipe.AddIngredient(ModContent.ItemType(), 8); recipe.AddIngredient(ItemID.HallowedBar, 10); diff --git a/Items/Weapons/DraedonsArsenal/MountedScanner.cs b/Items/Weapons/DraedonsArsenal/MountedScanner.cs index 111768cff3..1e44b5a491 100644 --- a/Items/Weapons/DraedonsArsenal/MountedScanner.cs +++ b/Items/Weapons/DraedonsArsenal/MountedScanner.cs @@ -1,3 +1,4 @@ +using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; @@ -86,7 +87,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void AddRecipes() { - ModRecipe recipe = new ModRecipe(mod); + ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 2); recipe.AddIngredient(ModContent.ItemType(), 15); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ItemID.HallowedBar, 10); diff --git a/Items/Weapons/DraedonsArsenal/Phaseslayer.cs b/Items/Weapons/DraedonsArsenal/Phaseslayer.cs index 9ac5070780..4e2f86d9ad 100644 --- a/Items/Weapons/DraedonsArsenal/Phaseslayer.cs +++ b/Items/Weapons/DraedonsArsenal/Phaseslayer.cs @@ -1,3 +1,4 @@ +using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using CalamityMod.Tiles.Furniture.CraftingStations; @@ -71,7 +72,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void AddRecipes() { - ModRecipe recipe = new ModRecipe(mod); + ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 5); recipe.AddIngredient(ModContent.ItemType(), 15); recipe.AddIngredient(ModContent.ItemType(), 25); recipe.AddIngredient(ModContent.ItemType(), 2); diff --git a/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs b/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs index 670409b303..34156ec0f1 100644 --- a/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs +++ b/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs @@ -1,3 +1,4 @@ +using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; @@ -97,7 +98,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void AddRecipes() { - ModRecipe recipe = new ModRecipe(mod); + ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 4); recipe.AddIngredient(ModContent.ItemType(), 18); recipe.AddIngredient(ModContent.ItemType(), 12); recipe.AddIngredient(ModContent.ItemType(), 8); diff --git a/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs b/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs index 01199662ac..219a9b0513 100644 --- a/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs +++ b/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs @@ -1,3 +1,4 @@ +using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.DraedonsArsenal; @@ -59,7 +60,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void AddRecipes() { - ModRecipe recipe = new ModRecipe(mod); + ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 5); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ModContent.ItemType()); diff --git a/Items/Weapons/DraedonsArsenal/PoleWarper.cs b/Items/Weapons/DraedonsArsenal/PoleWarper.cs index 709fd95d9e..42b394c572 100644 --- a/Items/Weapons/DraedonsArsenal/PoleWarper.cs +++ b/Items/Weapons/DraedonsArsenal/PoleWarper.cs @@ -1,3 +1,4 @@ +using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using CalamityMod.Tiles.Furniture.CraftingStations; @@ -82,7 +83,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void AddRecipes() { - ModRecipe recipe = new ModRecipe(mod); + ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 5); recipe.AddIngredient(ModContent.ItemType(), 25); recipe.AddIngredient(ModContent.ItemType(), 15); recipe.AddIngredient(ModContent.ItemType(), 2); diff --git a/Items/Weapons/DraedonsArsenal/PulseDragon.cs b/Items/Weapons/DraedonsArsenal/PulseDragon.cs index f647169ffa..789738bc64 100644 --- a/Items/Weapons/DraedonsArsenal/PulseDragon.cs +++ b/Items/Weapons/DraedonsArsenal/PulseDragon.cs @@ -1,3 +1,4 @@ +using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; @@ -60,7 +61,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void AddRecipes() { - ModRecipe recipe = new ModRecipe(mod); + ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 4); recipe.AddIngredient(ModContent.ItemType(), 12); recipe.AddIngredient(ModContent.ItemType(), 18); recipe.AddIngredient(ModContent.ItemType(), 8); diff --git a/Items/Weapons/DraedonsArsenal/PulsePistol.cs b/Items/Weapons/DraedonsArsenal/PulsePistol.cs index 0659abbf32..7d44106546 100644 --- a/Items/Weapons/DraedonsArsenal/PulsePistol.cs +++ b/Items/Weapons/DraedonsArsenal/PulsePistol.cs @@ -1,3 +1,4 @@ +using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; @@ -54,7 +55,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void AddRecipes() { - ModRecipe recipe = new ModRecipe(mod); + ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 1); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ModContent.ItemType(), 7); recipe.AddIngredient(ModContent.ItemType(), 4); diff --git a/Items/Weapons/DraedonsArsenal/PulseRifle.cs b/Items/Weapons/DraedonsArsenal/PulseRifle.cs index a3284c60a7..8ea03df9cb 100644 --- a/Items/Weapons/DraedonsArsenal/PulseRifle.cs +++ b/Items/Weapons/DraedonsArsenal/PulseRifle.cs @@ -1,3 +1,4 @@ +using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using CalamityMod.Tiles.Furniture.CraftingStations; @@ -69,7 +70,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void AddRecipes() { - ModRecipe recipe = new ModRecipe(mod); + ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 4); recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddIngredient(ModContent.ItemType(), 2); diff --git a/Items/Weapons/DraedonsArsenal/PulseTurretRemote.cs b/Items/Weapons/DraedonsArsenal/PulseTurretRemote.cs index 9cc1ac8f71..2cdee979be 100644 --- a/Items/Weapons/DraedonsArsenal/PulseTurretRemote.cs +++ b/Items/Weapons/DraedonsArsenal/PulseTurretRemote.cs @@ -1,3 +1,4 @@ +using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; @@ -59,7 +60,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void AddRecipes() { - ModRecipe recipe = new ModRecipe(mod); + ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 3); recipe.AddIngredient(ModContent.ItemType(), 12); recipe.AddIngredient(ModContent.ItemType(), 18); recipe.AddIngredient(ModContent.ItemType(), 5); diff --git a/Items/Weapons/DraedonsArsenal/SnakeEyes.cs b/Items/Weapons/DraedonsArsenal/SnakeEyes.cs index 2051589a03..c7c273a56b 100644 --- a/Items/Weapons/DraedonsArsenal/SnakeEyes.cs +++ b/Items/Weapons/DraedonsArsenal/SnakeEyes.cs @@ -1,3 +1,4 @@ +using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Items.Weapons.Summon; using CalamityMod.Projectiles.DraedonsArsenal; @@ -55,7 +56,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void AddRecipes() { - ModRecipe recipe = new ModRecipe(mod); + ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 4); recipe.AddIngredient(ModContent.ItemType(), 18); recipe.AddIngredient(ModContent.ItemType(), 12); recipe.AddIngredient(ModContent.ItemType(), 8); diff --git a/Items/Weapons/DraedonsArsenal/StarSwallowerContainmentUnit.cs b/Items/Weapons/DraedonsArsenal/StarSwallowerContainmentUnit.cs index 162ed1187d..240c6542e2 100644 --- a/Items/Weapons/DraedonsArsenal/StarSwallowerContainmentUnit.cs +++ b/Items/Weapons/DraedonsArsenal/StarSwallowerContainmentUnit.cs @@ -1,3 +1,4 @@ +using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; @@ -57,7 +58,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void AddRecipes() { - ModRecipe recipe = new ModRecipe(mod); + ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 1); recipe.AddIngredient(ModContent.ItemType(), 8); recipe.AddIngredient(ModContent.ItemType(), 4); recipe.AddIngredient(ModContent.ItemType(), 4); diff --git a/Items/Weapons/DraedonsArsenal/SystemBane.cs b/Items/Weapons/DraedonsArsenal/SystemBane.cs index 43cb0cfddf..7006e28b91 100644 --- a/Items/Weapons/DraedonsArsenal/SystemBane.cs +++ b/Items/Weapons/DraedonsArsenal/SystemBane.cs @@ -1,3 +1,4 @@ +using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.DraedonsArsenal; @@ -60,7 +61,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void AddRecipes() { - ModRecipe recipe = new ModRecipe(mod); + ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 3); recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ModContent.ItemType(), 5); diff --git a/Items/Weapons/DraedonsArsenal/Taser.cs b/Items/Weapons/DraedonsArsenal/Taser.cs index 19f7a9c04a..d7115a06ec 100644 --- a/Items/Weapons/DraedonsArsenal/Taser.cs +++ b/Items/Weapons/DraedonsArsenal/Taser.cs @@ -1,3 +1,4 @@ +using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using Terraria; @@ -47,7 +48,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void AddRecipes() { - ModRecipe recipe = new ModRecipe(mod); + ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 1); recipe.AddIngredient(ModContent.ItemType(), 7); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ModContent.ItemType(), 4); diff --git a/Items/Weapons/DraedonsArsenal/TeslaCannon.cs b/Items/Weapons/DraedonsArsenal/TeslaCannon.cs index 30df63274a..2fdef1907f 100644 --- a/Items/Weapons/DraedonsArsenal/TeslaCannon.cs +++ b/Items/Weapons/DraedonsArsenal/TeslaCannon.cs @@ -1,3 +1,4 @@ +using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using CalamityMod.Tiles.Furniture.CraftingStations; @@ -70,7 +71,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void AddRecipes() { - ModRecipe recipe = new ModRecipe(mod); + ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 5); recipe.AddIngredient(ModContent.ItemType(), 25); recipe.AddIngredient(ModContent.ItemType(), 15); recipe.AddIngredient(ModContent.ItemType(), 2); diff --git a/Items/Weapons/DraedonsArsenal/TrackingDisk.cs b/Items/Weapons/DraedonsArsenal/TrackingDisk.cs index 08db5e5ffc..7452b6d22d 100644 --- a/Items/Weapons/DraedonsArsenal/TrackingDisk.cs +++ b/Items/Weapons/DraedonsArsenal/TrackingDisk.cs @@ -1,3 +1,4 @@ +using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.DraedonsArsenal; @@ -60,7 +61,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void AddRecipes() { - ModRecipe recipe = new ModRecipe(mod); + ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 1); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ModContent.ItemType(), 7); recipe.AddIngredient(ModContent.ItemType(), 4); diff --git a/Items/Weapons/DraedonsArsenal/WavePounder.cs b/Items/Weapons/DraedonsArsenal/WavePounder.cs index 4de1908432..44b34d9d0d 100644 --- a/Items/Weapons/DraedonsArsenal/WavePounder.cs +++ b/Items/Weapons/DraedonsArsenal/WavePounder.cs @@ -1,3 +1,4 @@ +using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.DraedonsArsenal; @@ -58,7 +59,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void AddRecipes() { - ModRecipe recipe = new ModRecipe(mod); + ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 4); recipe.AddIngredient(ModContent.ItemType(), 12); recipe.AddIngredient(ModContent.ItemType(), 18); recipe.AddIngredient(ModContent.ItemType(), 8); diff --git a/TileEntities/TECodebreaker.cs b/TileEntities/TECodebreaker.cs index baf7f7aafa..87c614e945 100644 --- a/TileEntities/TECodebreaker.cs +++ b/TileEntities/TECodebreaker.cs @@ -1,5 +1,7 @@ +using CalamityMod.CustomRecipes; using CalamityMod.Items.DraedonMisc; using CalamityMod.Tiles.DraedonSummoner; +using CalamityMod.UI; using Microsoft.Xna.Framework; using System.IO; using Terraria; @@ -16,7 +18,7 @@ namespace CalamityMod.TileEntities public int HeldSchematicID; public int DecryptionCountdown; - public int DecryptionTotalTime => 1800; + public int DecryptionTotalTime => 300; public float DecryptionCompletion => 1f - DecryptionCountdown / (float)DecryptionTotalTime; public bool ContainsDecryptionComputer; @@ -48,9 +50,9 @@ namespace CalamityMod.TileEntities } public string UnderlyingSchematicText - { - get - { + { + get + { // You can't decrypt nothing. if (HeldSchematicID == 0) return string.Empty; @@ -67,7 +69,7 @@ namespace CalamityMod.TileEntities return string.Empty; } - } + } public Vector2 Center => Position.ToWorldCoordinates(8f * CodebreakerTile.Width, 8f * CodebreakerTile.Height); @@ -199,10 +201,84 @@ namespace CalamityMod.TileEntities codebreakerTileEntity.HeldSchematicID = schematicID; } + public void SyncDecryptCountdown() + { + // Don't bother sending packets in singleplayer. + if (Main.netMode == NetmodeID.SinglePlayer) + return; + + ModPacket packet = mod.GetPacket(); + packet.Write((byte)CalamityModMessageType.UpdateCodebreakerDecryptCountdown); + packet.Write(ID); + packet.Write(DecryptionCountdown); + } + + public static void ReadDecryptCountdownSync(Mod mod, BinaryReader reader) + { + int id = reader.ReadInt32(); + bool exists = ByID.TryGetValue(id, out TileEntity tileEntity); + + // Continue reading to the end even if a tile entity with the given ID does not exist. + // Not doing this will cause errors/bugs. + int countdown = reader.ReadInt32(); + + // After doing reading, check again to see if the tile entity is actually there. + // If it isn't don't bother doing anything else. + if (!exists) + return; + + // Furthermore, verify to ensure that the tile entity is a valid one. + if (!(tileEntity is TECodebreaker codebreakerTileEntity)) + return; + + codebreakerTileEntity.DecryptionCountdown = countdown; + } + public void UpdateTime() { if (DecryptionCountdown > 0) + { DecryptionCountdown--; + + if (DecryptionCountdown == 0) + { + LearnFromHeldSchematic(out bool anythingChanged); + if (Main.netMode == NetmodeID.Server) + SyncDecryptCountdown(); + else if (anythingChanged && DraedonDecryptUI.AwaitingDecryptionTextClose) + CombatText.NewText(Main.LocalPlayer.Hitbox, Color.Cyan, "You learned how to create new things!", true); + } + } + } + + public void LearnFromHeldSchematic(out bool anythingChanged) + { + anythingChanged = false; + int schematicType = CalamityLists.EncryptedSchematicIDRelationship[HeldSchematicID]; + + if (!RecipeUnlockHandler.HasUnlockedT2ArsenalRecipes && schematicType == ModContent.ItemType()) + { + RecipeUnlockHandler.HasUnlockedT2ArsenalRecipes = true; + anythingChanged = true; + } + if (!RecipeUnlockHandler.HasUnlockedT3ArsenalRecipes && schematicType == ModContent.ItemType()) + { + RecipeUnlockHandler.HasUnlockedT3ArsenalRecipes = true; + anythingChanged = true; + } + if (!RecipeUnlockHandler.HasUnlockedT4ArsenalRecipes && schematicType == ModContent.ItemType()) + { + RecipeUnlockHandler.HasUnlockedT4ArsenalRecipes = true; + anythingChanged = true; + } + if (!RecipeUnlockHandler.HasUnlockedT5ArsenalRecipes && schematicType == ModContent.ItemType()) + { + RecipeUnlockHandler.HasUnlockedT5ArsenalRecipes = true; + anythingChanged = true; + } + + if (Main.netMode == NetmodeID.Server && anythingChanged) + CalamityNetcode.SyncWorld(); } public override TagCompound Save() @@ -214,6 +290,7 @@ namespace CalamityMod.TileEntities ["ContainsAdvancedDisplay"] = ContainsAdvancedDisplay, ["ContainsVoltageRegulationSystem"] = ContainsVoltageRegulationSystem, ["ContainsCoolingCell"] = ContainsCoolingCell, + ["InputtedCellCount"] = InputtedCellCount, ["HeldSchematicID"] = HeldSchematicID }; } @@ -225,6 +302,7 @@ namespace CalamityMod.TileEntities ContainsAdvancedDisplay = tag.GetBool("ContainsAdvancedDisplay"); ContainsVoltageRegulationSystem = tag.GetBool("ContainsVoltageRegulationSystem"); ContainsCoolingCell = tag.GetBool("ContainsCoolingCell"); + InputtedCellCount = tag.GetInt("InputtedCellCount"); HeldSchematicID = tag.GetInt("HeldSchematicID"); } @@ -235,6 +313,7 @@ namespace CalamityMod.TileEntities writer.Write(ContainsAdvancedDisplay); writer.Write(ContainsVoltageRegulationSystem); writer.Write(ContainsCoolingCell); + writer.Write(InputtedCellCount); writer.Write(HeldSchematicID); } @@ -245,6 +324,7 @@ namespace CalamityMod.TileEntities ContainsAdvancedDisplay = reader.ReadBoolean(); ContainsVoltageRegulationSystem = reader.ReadBoolean(); ContainsCoolingCell = reader.ReadBoolean(); + InputtedCellCount = reader.ReadInt32(); HeldSchematicID = reader.ReadInt32(); } } diff --git a/Tiles/DraedonSummoner/CodebreakerTile.cs b/Tiles/DraedonSummoner/CodebreakerTile.cs index db764cbc22..a9f0311086 100644 --- a/Tiles/DraedonSummoner/CodebreakerTile.cs +++ b/Tiles/DraedonSummoner/CodebreakerTile.cs @@ -111,8 +111,9 @@ namespace CalamityMod.Tiles.DraedonSummoner { // These offsets start as the tile offsets, i.e. which sub-tile of the FrameImportant structure this specific location is. Tile t = Main.tile[i, j]; + int left = i - t.frameX % (Width * SheetSquare) / SheetSquare; int frameXPos = t.frameX; - int frameYPos = t.frameY; + int frameYPos = t.frameY + Height * SheetSquare * (int)((Main.GlobalTime * 12f + left) % 8); // Grab the tile entity because it stores the information regarding what is actually attached. TECodebreaker codebreakerTileEntity = CalamityUtils.FindTileEntity(i, j, Width, Height, SheetSquare); @@ -120,6 +121,7 @@ namespace CalamityMod.Tiles.DraedonSummoner Texture2D tex = ModContent.GetTexture("CalamityMod/Tiles/DraedonSummoner/CodebreakerTile"); Texture2D computerTexture = ModContent.GetTexture("CalamityMod/Tiles/DraedonSummoner/CodebreakerDecryptionComputer"); Texture2D sensorTexture = ModContent.GetTexture("CalamityMod/Tiles/DraedonSummoner/CodebreakerLongRangedSensorArray"); + Texture2D displayTexture = ModContent.GetTexture("CalamityMod/Tiles/DraedonSummoner/CodebreakerAdvancedDisplay"); Texture2D voltageRegulatorTexture = ModContent.GetTexture("CalamityMod/Tiles/DraedonSummoner/CodebreakerVoltageRegulationSystem"); Texture2D voltageRegulatorTexture2 = ModContent.GetTexture("CalamityMod/Tiles/DraedonSummoner/CodebreakerVoltageRegulationSystem2"); Texture2D coolingCellTexture = ModContent.GetTexture("CalamityMod/Tiles/DraedonSummoner/CodebreakerAuricQuantumCoolingCell"); @@ -142,7 +144,7 @@ namespace CalamityMod.Tiles.DraedonSummoner if (codebreakerTileEntity.ContainsSensorArray) spriteBatch.Draw(sensorTexture, drawPosition, frame, drawColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); if (codebreakerTileEntity.ContainsAdvancedDisplay) - spriteBatch.Draw(coolingCellTexture, drawPosition, frame, drawColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + spriteBatch.Draw(displayTexture, drawPosition, frame, drawColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); if (codebreakerTileEntity.ContainsVoltageRegulationSystem) { spriteBatch.Draw(voltageRegulatorTexture, drawPosition, frame, drawColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); diff --git a/UI/DraedonDecryptUI.cs b/UI/DraedonDecryptUI.cs index c15fbe2c62..2a46d38444 100644 --- a/UI/DraedonDecryptUI.cs +++ b/UI/DraedonDecryptUI.cs @@ -56,23 +56,7 @@ namespace CalamityMod.UI Texture2D cellTexture = codebreakerTileEntity.InputtedCellCount > 0 ? occupiedCellIconTexture : emptyCellIconTexture; Vector2 cellDrawCenter = backgroundTopLeft + Vector2.One * 60f; - // Create a temporary item for drawing purposes. - // If cells are present, make the item reflect that. - Item temporaryPowerCell = new Item(); - temporaryPowerCell.SetDefaults(ModContent.ItemType()); - temporaryPowerCell.stack = codebreakerTileEntity.InputtedCellCount; - - CalamityUtils.DrawPowercellSlot(spriteBatch, temporaryPowerCell, cellDrawCenter, 1f); - HandleCellSlotInteractions(codebreakerTileEntity, temporaryPowerCell, cellDrawCenter, cellTexture.Size()); - - // Draw the schematic icon. Vector2 schematicSlotDrawCenter = cellDrawCenter + Vector2.UnitY * 70f; - Texture2D emptySchematicIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/EncryptedSchematicSlot_Empty"); - Texture2D occupiedSchematicIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/EncryptedSchematicSlot_Full"); - - Texture2D schematicTexture = codebreakerTileEntity.HeldSchematicID != 0 ? occupiedSchematicIconTexture : emptySchematicIconTexture; - spriteBatch.Draw(schematicTexture, schematicSlotDrawCenter, null, Color.White, 0f, schematicTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); - HandleSchematicSlotInteractions(codebreakerTileEntity, schematicSlotDrawCenter, cellTexture.Size()); // Display some error text if the codebreaker isn't strong enough to decrypt the text. if (codebreakerTileEntity.HeldSchematicID != 0 && !codebreakerTileEntity.CanDecryptHeldSchematic) @@ -127,6 +111,23 @@ namespace CalamityMod.UI currentTextDrawPosition.Y += 16; } } + + // Draw the schematic icon. + Texture2D emptySchematicIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/EncryptedSchematicSlot_Empty"); + Texture2D occupiedSchematicIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/EncryptedSchematicSlot_Full"); + + Texture2D schematicTexture = codebreakerTileEntity.HeldSchematicID != 0 ? occupiedSchematicIconTexture : emptySchematicIconTexture; + spriteBatch.Draw(schematicTexture, schematicSlotDrawCenter, null, Color.White, 0f, schematicTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); + HandleSchematicSlotInteractions(codebreakerTileEntity, schematicSlotDrawCenter, cellTexture.Size()); + + // Create a temporary item for drawing purposes. + // If cells are present, make the item reflect that. + Item temporaryPowerCell = new Item(); + temporaryPowerCell.SetDefaults(ModContent.ItemType()); + temporaryPowerCell.stack = codebreakerTileEntity.InputtedCellCount; + + CalamityUtils.DrawPowercellSlot(spriteBatch, temporaryPowerCell, cellDrawCenter, 1f); + HandleCellSlotInteractions(codebreakerTileEntity, temporaryPowerCell, cellDrawCenter, cellTexture.Size()); } public static void HandleCellSlotInteractions(TECodebreaker codebreakerTileEntity, Item temporaryItem, Vector2 cellIconCenter, Vector2 area) @@ -264,6 +265,7 @@ namespace CalamityMod.UI codebreakerTileEntity.InputtedCellCount -= totalCellsCost; codebreakerTileEntity.DecryptionCountdown = codebreakerTileEntity.DecryptionTotalTime; codebreakerTileEntity.SyncContainedStuff(); + codebreakerTileEntity.SyncDecryptCountdown(); } } else From cc4d1b778c86b0874f1394357c5c67c38f219525 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 2 Jun 2021 14:51:57 -0500 Subject: [PATCH 06/86] Various touch-ups --- CustomRecipes/ArsenalTierGatedRecipe.cs | 13 +- Effects/CalamityShaders.cs | 3 + Effects/Flame.fx | 72 ++++++++ Effects/Flame.xnb | Bin 0 -> 3520 bytes ExtraTextures/UI/ContactButton.png | Bin 0 -> 312 bytes ExtraTextures/UI/DraedonDecrypterScreen.png | Bin 928 -> 530 bytes Items/DraedonMisc/AdvancedDisplay.cs | 4 +- Items/DraedonMisc/AuricQuantumCoolingCell.cs | 10 +- Items/DraedonMisc/DecryptionComputer.cs | 4 +- Items/DraedonMisc/LongRangedSensorArray.cs | 2 +- Items/DraedonMisc/VoltageRegulationSystem.cs | 2 +- Projectiles/Boss/DraedonSummonLaser.cs | 105 +++++++++++ TileEntities/TECodebreaker.cs | 81 ++++++++- Tiles/CalamityGlobalTile.cs | 5 +- Tiles/DraedonSummoner/CodebreakerTile.cs | 29 +++- UI/DraedonDecryptUI.cs | 174 +++++++++++++------ Utilities/StringUtils.cs | 2 +- World/CalamityWorld.cs | 41 +++++ 18 files changed, 460 insertions(+), 87 deletions(-) create mode 100644 Effects/Flame.fx create mode 100644 Effects/Flame.xnb create mode 100644 ExtraTextures/UI/ContactButton.png create mode 100644 Projectiles/Boss/DraedonSummonLaser.cs diff --git a/CustomRecipes/ArsenalTierGatedRecipe.cs b/CustomRecipes/ArsenalTierGatedRecipe.cs index 9830216ac3..af51c51a2d 100644 --- a/CustomRecipes/ArsenalTierGatedRecipe.cs +++ b/CustomRecipes/ArsenalTierGatedRecipe.cs @@ -1,14 +1,23 @@ -using Terraria.ModLoader; +using CalamityMod.World; +using Terraria.ModLoader; namespace CalamityMod.CustomRecipes { public class ArsenalTierGatedRecipe : ModRecipe { public int Tier; - public ArsenalTierGatedRecipe(Mod mod, int tier) : base(mod) => Tier = tier; + public bool AllowedInOldWorlds; + public ArsenalTierGatedRecipe(Mod mod, int tier, bool allowedInOldWorlds = false) : base(mod) + { + Tier = tier; + AllowedInOldWorlds = allowedInOldWorlds; + } public override bool RecipeAvailable() { + if (AllowedInOldWorlds && !CalamityWorld.IsWorldAfterDraedonUpdate) + return true; + switch (Tier) { case 1: diff --git a/Effects/CalamityShaders.cs b/Effects/CalamityShaders.cs index 407dc6b42c..1f5a46de9b 100644 --- a/Effects/CalamityShaders.cs +++ b/Effects/CalamityShaders.cs @@ -13,6 +13,7 @@ namespace CalamityMod.Effects public static Effect TentacleShader; public static Effect LightDistortionShader; public static Effect FadedUVMapStreakShader; + public static Effect FlameStreakShader; public static void LoadShaders() { @@ -23,6 +24,7 @@ namespace CalamityMod.Effects TentacleShader = CalamityMod.Instance.GetEffect("Effects/TentacleShader"); LightDistortionShader = CalamityMod.Instance.GetEffect("Effects/DistortionShader"); FadedUVMapStreakShader = CalamityMod.Instance.GetEffect("Effects/FadedUVMapStreak"); + FlameStreakShader = CalamityMod.Instance.GetEffect("Effects/Flame"); Filters.Scene["CalamityMod:Astral"] = new Filter(new AstralScreenShaderData(new Ref(AstralFogShader), "AstralPass").UseColor(0.18f, 0.08f, 0.24f), EffectPriority.VeryHigh); @@ -32,6 +34,7 @@ namespace CalamityMod.Effects GameShaders.Misc["CalamityMod:SubsumingTentacle"] = new MiscShaderData(new Ref(TentacleShader), "BurstPass"); GameShaders.Misc["CalamityMod:LightDistortion"] = new MiscShaderData(new Ref(LightDistortionShader), "DistortionPass"); GameShaders.Misc["CalamityMod:TrailStreak"] = new MiscShaderData(new Ref(FadedUVMapStreakShader), "TrailPass"); + GameShaders.Misc["CalamityMod:Flame"] = new MiscShaderData(new Ref(FlameStreakShader), "TrailPass"); } } } diff --git a/Effects/Flame.fx b/Effects/Flame.fx new file mode 100644 index 0000000000..2fa2e1ffe6 --- /dev/null +++ b/Effects/Flame.fx @@ -0,0 +1,72 @@ +sampler uImage0 : register(s0); +sampler uImage1 : register(s1); +float3 uColor; +float3 uSecondaryColor; +float uOpacity; +float uSaturation; +float uRotation; +float uTime; +float4 uSourceRect; +float2 uWorldPosition; +float uDirection; +float3 uLightSource; +float2 uImageSize0; +float2 uImageSize1; +matrix uWorldViewProjection; + +struct VertexShaderInput +{ + float4 Position : POSITION0; + float4 Color : COLOR0; + float2 TextureCoordinates : TEXCOORD0; +}; + +struct VertexShaderOutput +{ + float4 Position : SV_POSITION; + float4 Color : COLOR0; + float2 TextureCoordinates : TEXCOORD0; +}; + +VertexShaderOutput VertexShaderFunction(in VertexShaderInput input) +{ + VertexShaderOutput output = (VertexShaderOutput) 0; + float4 pos = mul(input.Position, uWorldViewProjection); + output.Position = pos; + + output.Color = input.Color; + output.TextureCoordinates = input.TextureCoordinates; + + return output; +} + +// The X coordinate is the trail completion, the Y coordinate is the same as any other. +// This is simply how the primitive TextCoord is layed out in the C# code. +float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0 +{ + float4 color = input.Color; + float2 coords = input.TextureCoordinates; + + // Read the fade map as a streak. + float4 fadeMapColor = tex2D(uImage1, float2(frac(coords.y + cos(uTime) * 0.01), frac(coords.x - uTime * 1.4 * uSaturation))); + fadeMapColor.r *= pow(coords.x, 0.2); + + float opacity = lerp(1.45, 1.95, fadeMapColor.r) * color.a; + opacity *= pow(sin(coords.y * 3.141), lerp(1, 6, pow(coords.x, 2))); + opacity *= pow(sin(coords.x * 3.141), 0.4); + opacity *= fadeMapColor.r * 1.5 + 1; + opacity *= lerp(0.4, 0.9, fadeMapColor.r); + + float3 transformColor = lerp(float3(1, 205 / 255.0, 119 / 255.0), float3(1, 76 / 255.0, 79 / 255.0), fadeMapColor.r); + color.rgb = lerp(color.rgb, transformColor, fadeMapColor.r); + return color * opacity * 1.6; +} + +technique Technique1 +{ + pass TrailPass + { + VertexShader = compile vs_2_0 VertexShaderFunction(); + PixelShader = compile ps_2_0 PixelShaderFunction(); + } +} diff --git a/Effects/Flame.xnb b/Effects/Flame.xnb new file mode 100644 index 0000000000000000000000000000000000000000..6065bbc9346a2550f432e2448044916f219500c1 GIT binary patch literal 3520 zcmb_eU5Hy%5T2W4cT>AH#UH4!U@8bz){tFyCB?Q`o9)kHYU3uU`ykZY?A<0do4ej5 zc3XXjKZPy&5Pu$21S9%T5|MrI2cgt`5V5e;J{H=C3j0`UL6Cxw>o@1zlbpsbNb4k% zJ2U5-IWu$4Jts5I?LOXTtZX7O-ZKsqa*kcL=PHqzk{Q|SnDf?g+c_3V*rke9szmn8 z%~`q1v}Mj(&Tx1=^ghR2$QN?u;qW2LDHrV0&ap_8Kf~cfwOFY-*3ObutvF_JIGm~; zDHd|iS|>90F{`vQHa41@iyg5>X07q)`1q5=WNblpziqs6cC%3BkFmjRFZrc>4;}&V zkW@RrK}gl9dGn|hC54&jj7p)486gg5fGZkC*)$UkK&d9|qU}(}=Zprpoe$?;Ocg&$M^jO+M8#-~km*sP%KA~%?5$2xfK zNp;$;NVKel@x^uU{fy5P<}Ex`jbCb5UIR^qCQ0UHSDl=FAYzm1TqlLZHJaQUKNJT|G}Roo{}!;KZ4h=S1QfYq0FPzVH+wN9MWS-eQ z1oa>TVPg#IpzwbDM8STnfIYR9n8fxu22Fep$Yliu+nx- z+B=g>@I7Hrs-g1ar+R<6k97|XCV{YIR>zs)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play.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.DraedonMisc public override void SetStaticDefaults() { DisplayName.SetDefault("Advanced Display"); - Tooltip.SetDefault("Can be placed in the Codebreaker"); + Tooltip.SetDefault("Can be placed on the Codebreaker"); } public override void SetDefaults() @@ -24,7 +24,7 @@ namespace CalamityMod.Items.DraedonMisc item.maxStack = 999; item.consumable = true; item.useStyle = ItemUseStyleID.SwingThrow; - item.rare = ItemRarityID.Pink; + item.rare = ItemRarityID.Yellow; item.useTime = item.useAnimation = 15; } diff --git a/Items/DraedonMisc/AuricQuantumCoolingCell.cs b/Items/DraedonMisc/AuricQuantumCoolingCell.cs index f6f737062e..db332c62e6 100644 --- a/Items/DraedonMisc/AuricQuantumCoolingCell.cs +++ b/Items/DraedonMisc/AuricQuantumCoolingCell.cs @@ -9,6 +9,7 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; using System.Collections.Generic; using System.Linq; +using CalamityMod.World; namespace CalamityMod.Items.DraedonMisc { @@ -19,7 +20,7 @@ namespace CalamityMod.Items.DraedonMisc DisplayName.SetDefault("Auric Quantum Cooling Cell"); Tooltip.SetDefault("Can be placed in the Codebreaker, completing it\n" + "The completion of the Codebreaker allows you to make contact with its original creator\n" + - "Modified later"); + "Attempting to do so may have dire consequences"); } public override void SetDefaults() @@ -36,9 +37,7 @@ namespace CalamityMod.Items.DraedonMisc public override void ModifyTooltips(List tooltips) { - var tt2 = tooltips.FirstOrDefault(x => x.Name == "Tooltip2" && x.mod == "Terraria"); - tt2.text = "Attempting to do so may have dire consequences"; - tt2.overrideColor = Color.DarkRed; + tooltips.FirstOrDefault(x => x.Name == "Tooltip2" && x.mod == "Terraria").overrideColor = Color.DarkRed; } public override void Update(ref float gravity, ref float maxFallSpeed) @@ -71,7 +70,8 @@ namespace CalamityMod.Items.DraedonMisc public override void AddRecipes() { - ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 5); + // Old worlds can craft the cell immediately for the sake of being able to easily fight Draedon in endgame worlds. + ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 5, true); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); diff --git a/Items/DraedonMisc/DecryptionComputer.cs b/Items/DraedonMisc/DecryptionComputer.cs index cdb032f728..d4e7c94efe 100644 --- a/Items/DraedonMisc/DecryptionComputer.cs +++ b/Items/DraedonMisc/DecryptionComputer.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Items.DraedonMisc public override void SetStaticDefaults() { DisplayName.SetDefault("Decryption Computer"); - Tooltip.SetDefault("Can be placed in the Codebreaker\n" + - "Allows you to decrypt schematics\n" + + Tooltip.SetDefault("Can be placed on the Codebreaker\n" + + "Allows you to decrypt advanced schematics\n" + "Doing so allows you to learn how to craft new things"); } diff --git a/Items/DraedonMisc/LongRangedSensorArray.cs b/Items/DraedonMisc/LongRangedSensorArray.cs index e27d9f04c9..49d9c9c6f4 100644 --- a/Items/DraedonMisc/LongRangedSensorArray.cs +++ b/Items/DraedonMisc/LongRangedSensorArray.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.DraedonMisc public override void SetStaticDefaults() { DisplayName.SetDefault("Long Ranged Sensor Array"); - Tooltip.SetDefault("Can be placed in the Codebreaker"); + Tooltip.SetDefault("Can be placed on the Codebreaker"); } public override void SetDefaults() diff --git a/Items/DraedonMisc/VoltageRegulationSystem.cs b/Items/DraedonMisc/VoltageRegulationSystem.cs index 5d74c89e67..cb3b13ed3d 100644 --- a/Items/DraedonMisc/VoltageRegulationSystem.cs +++ b/Items/DraedonMisc/VoltageRegulationSystem.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.DraedonMisc public override void SetStaticDefaults() { DisplayName.SetDefault("Voltage Regulation System"); - Tooltip.SetDefault("Can be placed in the Codebreaker"); + Tooltip.SetDefault("Can be placed on the Codebreaker"); } public override void SetDefaults() diff --git a/Projectiles/Boss/DraedonSummonLaser.cs b/Projectiles/Boss/DraedonSummonLaser.cs new file mode 100644 index 0000000000..83788f4e79 --- /dev/null +++ b/Projectiles/Boss/DraedonSummonLaser.cs @@ -0,0 +1,105 @@ +using CalamityMod.World; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System.Collections.Generic; +using Terraria; +using Terraria.Graphics.Shaders; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Boss +{ + public class DraedonSummonLaser : ModProjectile + { + internal static readonly Color[] ExoPalette = new Color[] + { + new Color(250, 255, 112), + new Color(211, 235, 108), + new Color(166, 240, 105), + new Color(105, 240, 220), + new Color(64, 130, 145), + new Color(145, 96, 145), + new Color(242, 112, 73), + new Color(199, 62, 62), + }; + + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public PrimitiveTrail RayDrawer = null; + private const int Lifetime = CalamityWorld.DraedonSummonCountdownMax - 150; + + public override void SetStaticDefaults() => DisplayName.SetDefault("Giant Fuck-off Deathray of Doom"); + + public override void SetDefaults() + { + projectile.width = projectile.height = 24; + projectile.hostile = true; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.hide = true; + projectile.timeLeft = Lifetime; + } + + public override bool CanDamage() => projectile.timeLeft < Lifetime - 30; + + public override void AI() + { + if (projectile.localAI[0] == 0f) + { + for (int i = 0; i < 36; i++) + { + Dust exoDust = Dust.NewDustPerfect(projectile.BottomRight, 267); + exoDust.color = CalamityUtils.MulticolorLerp(i / 36f, ExoPalette); + exoDust.velocity = (MathHelper.TwoPi * i / 36f).ToRotationVector2() * new Vector2(3f, 1.45f) - Vector2.UnitY * 2f; + exoDust.scale = 2.8f; + exoDust.fadeIn = Main.rand.NextFloat(0.8f, 1.85f); + exoDust.noGravity = true; + } + + for (int i = 0; i < 10; i++) + { + Dust exoDust = Dust.NewDustPerfect(projectile.BottomRight, 267); + exoDust.color = CalamityUtils.MulticolorLerp(Main.rand.NextFloat(), ExoPalette); + exoDust.velocity = Main.rand.NextVector2Circular(2f, 2f); + exoDust.scale = 4f; + exoDust.fadeIn = 2f; + exoDust.noGravity = true; + } + projectile.localAI[0] = 1f; + } + + Lighting.AddLight(projectile.Center, Color.White.ToVector3()); + projectile.scale = Utils.InverseLerp(-1f, 15f, projectile.timeLeft, true) * Utils.InverseLerp(Lifetime + 1f, Lifetime - 15f, projectile.timeLeft, true); + } + + private float PrimitiveWidthFunction(float completionRatio) + { + return Utils.InverseLerp(1f, 0.96f, completionRatio, true) * Utils.InverseLerp(0f, 0.016f, completionRatio, true) * projectile.scale * 20f; + } + + private Color PrimitiveColorFunction(float completionRatio) + { + return CalamityUtils.MulticolorLerp((Main.GlobalTime * 0.67f - completionRatio * 3f) % 1f, ExoPalette) * 1.2f; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + if (RayDrawer is null) + RayDrawer = new PrimitiveTrail(PrimitiveWidthFunction, PrimitiveColorFunction, specialShader: GameShaders.Misc["CalamityMod:Flame"]); + + GameShaders.Misc["CalamityMod:Flame"].UseImage("Images/Misc/Perlin"); + + Vector2[] basePoints = new Vector2[8]; + for (int i = 0; i < basePoints.Length; i++) + basePoints[i] = projectile.Center - Vector2.UnitY * i / basePoints.Length * 3800f; + + Vector2 overallOffset = projectile.Size * 0.5f - Main.screenPosition; + RayDrawer.Draw(basePoints, overallOffset, 92); + return false; + } + + public override void DrawBehind(int index, List drawCacheProjsBehindNPCsAndTiles, List drawCacheProjsBehindNPCs, List drawCacheProjsBehindProjectiles, List drawCacheProjsOverWiresUI) + { + drawCacheProjsBehindNPCsAndTiles.Add(index); + } + } +} diff --git a/TileEntities/TECodebreaker.cs b/TileEntities/TECodebreaker.cs index 87c614e945..0df9a9e309 100644 --- a/TileEntities/TECodebreaker.cs +++ b/TileEntities/TECodebreaker.cs @@ -1,7 +1,6 @@ using CalamityMod.CustomRecipes; using CalamityMod.Items.DraedonMisc; using CalamityMod.Tiles.DraedonSummoner; -using CalamityMod.UI; using Microsoft.Xna.Framework; using System.IO; using Terraria; @@ -15,11 +14,48 @@ namespace CalamityMod.TileEntities public class TECodebreaker : ModTileEntity { public int InputtedCellCount; + public int InitialCellCountBeforeDecrypting; public int HeldSchematicID; public int DecryptionCountdown; - public int DecryptionTotalTime => 300; + public int DecryptionTotalTime + { + get + { + // Decryption takes 35 minutes typically. + int decryptTime = 126000; + + // However, if this codebreaker has a quantum cell, it only takes 1 minute. + if (ContainsCoolingCell) + decryptTime = 3600; + return decryptTime; + } + } + + public int DecryptionCellCost + { + get + { + // You can't decrypt nothing. + if (HeldSchematicID == 0 || !CalamityLists.EncryptedSchematicIDRelationship.ContainsKey(HeldSchematicID)) + return 0; + + int schematicType = CalamityLists.EncryptedSchematicIDRelationship[HeldSchematicID]; + if (schematicType == ModContent.ItemType()) + return 500; + if (schematicType == ModContent.ItemType()) + return 950; + if (schematicType == ModContent.ItemType()) + return 1750; + if (schematicType == ModContent.ItemType()) + return 5000; + + return 0; + } + } + public float DecryptionCompletion => 1f - DecryptionCountdown / (float)DecryptionTotalTime; + public bool ReadyToSummonDreadon => ContainsCoolingCell; public bool ContainsDecryptionComputer; public bool ContainsSensorArray; @@ -32,7 +68,7 @@ namespace CalamityMod.TileEntities get { // You can't decrypt nothing. - if (HeldSchematicID == 0) + if (HeldSchematicID == 0 || !CalamityLists.EncryptedSchematicIDRelationship.ContainsKey(HeldSchematicID)) return false; int schematicType = CalamityLists.EncryptedSchematicIDRelationship[HeldSchematicID]; @@ -54,7 +90,7 @@ namespace CalamityMod.TileEntities get { // You can't decrypt nothing. - if (HeldSchematicID == 0) + if (HeldSchematicID == 0 || !CalamityLists.EncryptedSchematicIDRelationship.ContainsKey(HeldSchematicID)) return string.Empty; int schematicType = CalamityLists.EncryptedSchematicIDRelationship[HeldSchematicID]; @@ -72,6 +108,7 @@ namespace CalamityMod.TileEntities } public Vector2 Center => Position.ToWorldCoordinates(8f * CodebreakerTile.Width, 8f * CodebreakerTile.Height); + public const int MaxCellCapacity = 9999; // This guarantees that this tile entity will not persist if not placed directly on the top left corner of a Charging Station tile. public override bool ValidTile(int i, int j) @@ -116,7 +153,7 @@ namespace CalamityMod.TileEntities if (ContainsCoolingCell) Item.NewItem(x * 16, y * 16, 32, 32, ModContent.ItemType()); - if (HeldSchematicID != 0) + if (CalamityLists.EncryptedSchematicIDRelationship.ContainsKey(HeldSchematicID)) Item.NewItem(x * 16, y * 16, 32, 32, CalamityLists.EncryptedSchematicIDRelationship[HeldSchematicID]); } @@ -175,6 +212,7 @@ namespace CalamityMod.TileEntities packet.Write((byte)CalamityModMessageType.UpdateCodebreakerContainedStuff); packet.Write(ID); packet.Write(InputtedCellCount); + packet.Write(InitialCellCountBeforeDecrypting); packet.Write(HeldSchematicID); } @@ -186,6 +224,7 @@ namespace CalamityMod.TileEntities // Continue reading to the end even if a tile entity with the given ID does not exist. // Not doing this will cause errors/bugs. int cellCount = reader.ReadInt32(); + int cellCountBeforeDecrypting = reader.ReadInt32(); int schematicID = reader.ReadInt32(); // After doing reading, check again to see if the tile entity is actually there. @@ -198,6 +237,7 @@ namespace CalamityMod.TileEntities return; codebreakerTileEntity.InputtedCellCount = cellCount; + codebreakerTileEntity.InitialCellCountBeforeDecrypting = cellCountBeforeDecrypting; codebreakerTileEntity.HeldSchematicID = schematicID; } @@ -240,12 +280,26 @@ namespace CalamityMod.TileEntities { DecryptionCountdown--; + // Gradually consume cells. + if (DecryptionCountdown % 5 == 4) + { + InputtedCellCount = InitialCellCountBeforeDecrypting - (int)(DecryptionCellCost * DecryptionCompletion); + if (Main.netMode != NetmodeID.MultiplayerClient) + SyncContainedStuff(); + } + if (DecryptionCountdown == 0) { + // Reset the cell count prior to decrypting. + InitialCellCountBeforeDecrypting = 0; + LearnFromHeldSchematic(out bool anythingChanged); if (Main.netMode == NetmodeID.Server) + { SyncDecryptCountdown(); - else if (anythingChanged && DraedonDecryptUI.AwaitingDecryptionTextClose) + SyncContainedStuff(); + } + else if (anythingChanged) CombatText.NewText(Main.LocalPlayer.Hitbox, Color.Cyan, "You learned how to create new things!", true); } } @@ -254,6 +308,11 @@ namespace CalamityMod.TileEntities public void LearnFromHeldSchematic(out bool anythingChanged) { anythingChanged = false; + + // Do nothing if no valid schematic is inputted at the moment. + if (!CalamityLists.EncryptedSchematicIDRelationship.ContainsKey(HeldSchematicID)) + return; + int schematicType = CalamityLists.EncryptedSchematicIDRelationship[HeldSchematicID]; if (!RecipeUnlockHandler.HasUnlockedT2ArsenalRecipes && schematicType == ModContent.ItemType()) @@ -291,7 +350,9 @@ namespace CalamityMod.TileEntities ["ContainsVoltageRegulationSystem"] = ContainsVoltageRegulationSystem, ["ContainsCoolingCell"] = ContainsCoolingCell, ["InputtedCellCount"] = InputtedCellCount, - ["HeldSchematicID"] = HeldSchematicID + ["HeldSchematicID"] = HeldSchematicID, + ["DecryptionCountdown"] = DecryptionCountdown, + ["InitialCellCountBeforeDecrypting"] = InitialCellCountBeforeDecrypting }; } @@ -304,6 +365,8 @@ namespace CalamityMod.TileEntities ContainsCoolingCell = tag.GetBool("ContainsCoolingCell"); InputtedCellCount = tag.GetInt("InputtedCellCount"); HeldSchematicID = tag.GetInt("HeldSchematicID"); + DecryptionCountdown = tag.GetInt("DecryptionCountdown"); + InitialCellCountBeforeDecrypting = tag.GetInt("InitialCellCountBeforeDecrypting"); } public override void NetSend(BinaryWriter writer, bool lightSend) @@ -315,6 +378,8 @@ namespace CalamityMod.TileEntities writer.Write(ContainsCoolingCell); writer.Write(InputtedCellCount); writer.Write(HeldSchematicID); + writer.Write(DecryptionCountdown); + writer.Write(InitialCellCountBeforeDecrypting); } public override void NetReceive(BinaryReader reader, bool lightReceive) @@ -326,6 +391,8 @@ namespace CalamityMod.TileEntities ContainsCoolingCell = reader.ReadBoolean(); InputtedCellCount = reader.ReadInt32(); HeldSchematicID = reader.ReadInt32(); + DecryptionCountdown = reader.ReadInt32(); + InitialCellCountBeforeDecrypting = reader.ReadInt32(); } } } diff --git a/Tiles/CalamityGlobalTile.cs b/Tiles/CalamityGlobalTile.cs index c8971770ab..09dd4c1be5 100644 --- a/Tiles/CalamityGlobalTile.cs +++ b/Tiles/CalamityGlobalTile.cs @@ -8,6 +8,7 @@ using CalamityMod.Tiles.Astral; using CalamityMod.Tiles.AstralDesert; using CalamityMod.Tiles.Crags; using CalamityMod.Tiles.DraedonStructures; +using CalamityMod.Tiles.DraedonSummoner; using CalamityMod.Tiles.Ores; using CalamityMod.Tiles.SunkenSea; using CalamityMod.World; @@ -587,8 +588,10 @@ namespace CalamityMod.Tiles int[] invincibleTiles = new int[] { ModContent.TileType(), - ModContent.TileType() + ModContent.TileType(), + ModContent.TileType() }; + // Prevent tiles below invincible tiles from being destroyed. This is like chests in vanilla. if (CalamityUtils.ParanoidTileRetrieval(i, j - 1).active() && CalamityUtils.ParanoidTileRetrieval(i, j).type != diff --git a/Tiles/DraedonSummoner/CodebreakerTile.cs b/Tiles/DraedonSummoner/CodebreakerTile.cs index a9f0311086..3249d5c21b 100644 --- a/Tiles/DraedonSummoner/CodebreakerTile.cs +++ b/Tiles/DraedonSummoner/CodebreakerTile.cs @@ -51,7 +51,19 @@ namespace CalamityMod.Tiles.DraedonSummoner public override bool CanExplode(int i, int j) => false; - public override bool CreateDust(int i, int j, ref int type) + // Prevent the tile from being destroyed while it's busy decrypting. + // If it's destroyed the tile entity would be too and the resources used on decryption would be lost for nothing. + public override bool CanKillTile(int i, int j, ref bool blockDamaged) + { + TECodebreaker codebreakerTileEntity = CalamityUtils.FindTileEntity(i, j, Width, Height, SheetSquare); + if (codebreakerTileEntity is null) + return true; + if (codebreakerTileEntity.DecryptionCountdown > 0) + return false; + return true; + } + + public override bool CreateDust(int i, int j, ref int type) { Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 182); return false; @@ -135,23 +147,22 @@ namespace CalamityMod.Tiles.DraedonSummoner if ((!t.halfBrick() && t.slope() == 0) || t.halfBrick()) { spriteBatch.Draw(tex, drawPosition, frame, drawColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); - + // Place secondary parts. if (codebreakerTileEntity != null) { if (codebreakerTileEntity.ContainsDecryptionComputer) spriteBatch.Draw(computerTexture, drawPosition, frame, drawColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + if (codebreakerTileEntity.ContainsVoltageRegulationSystem) + spriteBatch.Draw(voltageRegulatorTexture2, drawPosition, frame, drawColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); if (codebreakerTileEntity.ContainsSensorArray) spriteBatch.Draw(sensorTexture, drawPosition, frame, drawColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); - if (codebreakerTileEntity.ContainsAdvancedDisplay) - spriteBatch.Draw(displayTexture, drawPosition, frame, drawColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); - if (codebreakerTileEntity.ContainsVoltageRegulationSystem) - { - spriteBatch.Draw(voltageRegulatorTexture, drawPosition, frame, drawColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); - spriteBatch.Draw(voltageRegulatorTexture2, drawPosition, frame, drawColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); - } if (codebreakerTileEntity.ContainsCoolingCell) spriteBatch.Draw(coolingCellTexture, drawPosition, frame, drawColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + if (codebreakerTileEntity.ContainsVoltageRegulationSystem) + spriteBatch.Draw(voltageRegulatorTexture, drawPosition, frame, drawColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + if (codebreakerTileEntity.ContainsAdvancedDisplay) + spriteBatch.Draw(displayTexture, drawPosition, frame, drawColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); } } return false; diff --git a/UI/DraedonDecryptUI.cs b/UI/DraedonDecryptUI.cs index 2a46d38444..8c5222e5b8 100644 --- a/UI/DraedonDecryptUI.cs +++ b/UI/DraedonDecryptUI.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.DraedonMisc; using CalamityMod.TileEntities; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -18,6 +19,7 @@ namespace CalamityMod.UI public static int ViewedTileEntityID = -1; public static bool AwaitingDecryptionTextClose = false; public static float VerificationButtonScale = 1f; + public static float ContactButtonScale = 1f; public static readonly Vector2 BackgroundCenter = new Vector2(500f, Main.screenHeight * 0.5f); public static Rectangle MouseScreenArea => Utils.CenteredRectangle(Main.MouseScreen, Vector2.One * 2f); @@ -28,6 +30,7 @@ namespace CalamityMod.UI if (!TileEntity.ByID.ContainsKey(ViewedTileEntityID) || !(TileEntity.ByID[ViewedTileEntityID] is TECodebreaker codebreakerTileEntity)) { VerificationButtonScale = 1f; + ContactButtonScale = 1f; ViewedTileEntityID = -1; return; } @@ -36,10 +39,20 @@ namespace CalamityMod.UI if (!Main.LocalPlayer.WithinRange(codebreakerTileEntity.Center, 270f)) { VerificationButtonScale = 1f; + ContactButtonScale = 1f; ViewedTileEntityID = -1; return; } + // Close the UI if the inventory is no longer open. + if (!Main.playerInventory) + { + VerificationButtonScale = 1f; + ContactButtonScale = 1f; + ViewedTileEntityID = -1; + return; + } + // Draw the background. Texture2D backgroundTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/DraedonDecrypterBackground"); spriteBatch.Draw(backgroundTexture, BackgroundCenter, null, Color.White, 0f, backgroundTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); @@ -61,14 +74,14 @@ namespace CalamityMod.UI // Display some error text if the codebreaker isn't strong enough to decrypt the text. if (codebreakerTileEntity.HeldSchematicID != 0 && !codebreakerTileEntity.CanDecryptHeldSchematic) { - Vector2 errorDisplayLocation = schematicSlotDrawCenter + Vector2.UnitY * 20f; + Vector2 errorDisplayLocation = schematicSlotDrawCenter + Vector2.UnitY * 10f; DisplayNotStrongEnoughErrorText(errorDisplayLocation); } // Handle decryption costs. else if (codebreakerTileEntity.HeldSchematicID != 0 && codebreakerTileEntity.DecryptionCountdown == 0) { - int cost = 30; + int cost = codebreakerTileEntity.DecryptionCellCost; Vector2 costDisplayLocation = schematicSlotDrawCenter + Vector2.UnitY * 20f; Vector2 costVerificationLocation = costDisplayLocation + Vector2.UnitY * 60f; DisplayCostText(costDisplayLocation, cost); @@ -77,40 +90,12 @@ namespace CalamityMod.UI DrawCostVerificationButton(codebreakerTileEntity, costVerificationLocation, cost); } + Vector2 summonButtonCenter = backgroundTopLeft + new Vector2(140f, backgroundTexture.Height - 55f); + if (codebreakerTileEntity.ReadyToSummonDreadon) + HandleDraedonSummonButton(codebreakerTileEntity, summonButtonCenter); + if (codebreakerTileEntity.DecryptionCountdown > 0 || AwaitingDecryptionTextClose) - { - Texture2D textPanelTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/DraedonDecrypterScreen"); - Vector2 textPanelCenter = backgroundTopLeft + Vector2.UnitX * backgroundTexture.Width + textPanelTexture.Size() * new Vector2(-0.5f, 0.5f); - spriteBatch.Draw(textPanelTexture, textPanelCenter, null, Color.White, 0f, textPanelTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); - - // Generate gibberish and use slowly insert the real text. - // When decryption is done the gibberish will go away and only the underlying text will remain. - int textPadding = 6; - string trueMessage = codebreakerTileEntity.UnderlyingSchematicText; - StringBuilder text = new StringBuilder(codebreakerTileEntity.DecryptionCountdown == 0 ? trueMessage : CalamityUtils.GenerateRandomAlphanumericString(500)); - - // Don't mess with whitespace characters. Doing so can cause the word-wrap to "jump" around. - for (int i = 0; i < trueMessage.Length; i++) - { - if (char.IsWhiteSpace(trueMessage[i])) - text[i] = trueMessage[i]; - } - - // Insert the necessary amount of true text. - for (int i = 0; i < (int)(trueMessage.Length * codebreakerTileEntity.DecryptionCompletion); i++) - text[i] = trueMessage[i]; - - Vector2 currentTextDrawPosition = backgroundTopLeft + Vector2.UnitX * backgroundTexture.Width - Vector2.UnitX * (textPanelTexture.Width - textPadding); - currentTextDrawPosition.Y += 6f; - foreach (string line in Utils.WordwrapString(text.ToString(), Main.fontMouseText, (int)(textPanelTexture.Width * 1.5 - textPadding * 2), 13, out _)) - { - if (string.IsNullOrEmpty(line)) - continue; - - ChatManager.DrawColorCodedStringWithShadow(spriteBatch, Main.fontMouseText, line, currentTextDrawPosition, Color.Cyan, 0f, Vector2.Zero, new Vector2(0.6f, 0.6f)); - currentTextDrawPosition.Y += 16; - } - } + HandleDecryptionStuff(codebreakerTileEntity, backgroundTexture, backgroundTopLeft, schematicSlotDrawCenter + Vector2.UnitY * 80f); // Draw the schematic icon. Texture2D emptySchematicIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/EncryptedSchematicSlot_Empty"); @@ -132,7 +117,7 @@ namespace CalamityMod.UI public static void HandleCellSlotInteractions(TECodebreaker codebreakerTileEntity, Item temporaryItem, Vector2 cellIconCenter, Vector2 area) { - Rectangle clickArea = Utils.CenteredRectangle(cellIconCenter, area * 0.5f); + Rectangle clickArea = Utils.CenteredRectangle(cellIconCenter, area); // If the mouse is not in the specific area don't do anything else. if (!MouseScreenArea.Intersects(clickArea)) @@ -143,17 +128,17 @@ namespace CalamityMod.UI if (!temporaryItem.IsAir) Main.HoverItem = temporaryItem; - if (Main.mouseLeft && Main.mouseLeftRelease) + if (Main.mouseLeft && Main.mouseLeftRelease && codebreakerTileEntity.DecryptionCountdown <= 0) { int powerCellID = ModContent.ItemType(); - short chargerStackDiff = 0; + short cellStackDiff = 0; bool shouldPlaySound = true; - // If the player is holding shift and has space for the power cells, just spawn all of them on his or her face. + // If the player is holding shift and has space for the power cells, just spawn all of them on his or her face, up to the max-stack limit. if (Main.keyState.PressingShift() && Main.LocalPlayer.ItemSpace(temporaryItem)) { - DropHelper.DropItem(Main.LocalPlayer, powerCellID, temporaryItem.stack); - chargerStackDiff = (short)-temporaryItem.stack; + cellStackDiff = (short)-Math.Min(temporaryItem.stack, temporaryItem.maxStack); + DropHelper.DropItem(Main.LocalPlayer, powerCellID, -cellStackDiff); // Do not play a sound in this situation. The player is going to pick up the dropped cells in a few frames, which will make sound. shouldPlaySound = false; @@ -164,36 +149,39 @@ namespace CalamityMod.UI { bool holdingPowercell = playerHandItem.type == powerCellID; - // If the player's held power cells can be stacked on top of what's already in the charger, then stack them. - if (holdingPowercell && temporaryItem.stack < temporaryItem.maxStack) + // If the player's held power cells can be stacked on top of what's already in the codeberaker, then stack them. + if (holdingPowercell && temporaryItem.stack < TECodebreaker.MaxCellCapacity) { - int spaceLeft = temporaryItem.maxStack - temporaryItem.stack; + int spaceLeft = TECodebreaker.MaxCellCapacity - temporaryItem.stack; // If the player has more cells than there is space left, insert as many as possible. Otherwise insert all the cells. int cellsToInsert = Math.Min(playerHandItem.stack, spaceLeft); - chargerStackDiff = (short)cellsToInsert; + cellStackDiff = (short)cellsToInsert; playerHandItem.stack -= cellsToInsert; if (playerHandItem.stack == 0) playerHandItem.TurnToAir(); AwaitingDecryptionTextClose = false; } - // If the player is holding nothing, then pick up all the power cells (if any exist). + // If the player is holding nothing, then pick up all the power cells (if any exist), up to the max-stack limit. else if (playerHandItem.IsAir && temporaryItem.stack > 0) { - chargerStackDiff = (short)-temporaryItem.stack; + cellStackDiff = (short)-temporaryItem.stack; + if (cellStackDiff < -temporaryItem.maxStack) + cellStackDiff = (short)-temporaryItem.maxStack; + playerHandItem.SetDefaults(temporaryItem.type); - playerHandItem.stack = temporaryItem.stack; + playerHandItem.stack = -cellStackDiff; temporaryItem.TurnToAir(); AwaitingDecryptionTextClose = false; } } - if (chargerStackDiff != 0) + if (cellStackDiff != 0) { if (shouldPlaySound) Main.PlaySound(SoundID.Grab); AwaitingDecryptionTextClose = false; - codebreakerTileEntity.InputtedCellCount += chargerStackDiff; + codebreakerTileEntity.InputtedCellCount += cellStackDiff; codebreakerTileEntity.SyncContainedStuff(); } } @@ -206,7 +194,7 @@ namespace CalamityMod.UI public static void HandleSchematicSlotInteractions(TECodebreaker codebreakerTileEntity, Vector2 schematicIconCenter, Vector2 area) { - Rectangle clickArea = Utils.CenteredRectangle(schematicIconCenter, area * 0.5f); + Rectangle clickArea = Utils.CenteredRectangle(schematicIconCenter, area); // If the mouse is not in the specific area don't do anything else. if (!MouseScreenArea.Intersects(clickArea)) @@ -216,8 +204,7 @@ namespace CalamityMod.UI if (Main.mouseLeft && Main.mouseLeftRelease) { - Main.playerInventory = true; - if (playerHandItem.IsAir && codebreakerTileEntity.HeldSchematicID != 0) + if (playerHandItem.IsAir && CalamityLists.EncryptedSchematicIDRelationship.ContainsKey(codebreakerTileEntity.HeldSchematicID) && codebreakerTileEntity.DecryptionCountdown <= 0) { playerHandItem.SetDefaults(CalamityLists.EncryptedSchematicIDRelationship[codebreakerTileEntity.HeldSchematicID]); codebreakerTileEntity.HeldSchematicID = 0; @@ -254,7 +241,7 @@ namespace CalamityMod.UI public static void DrawCostVerificationButton(TECodebreaker codebreakerTileEntity, Vector2 drawPosition, int totalCellsCost) { Texture2D confirmationTexture = Main.cameraTexture[5]; - Rectangle clickArea = Utils.CenteredRectangle(drawPosition, confirmationTexture.Size() * VerificationButtonScale * 0.5f); + Rectangle clickArea = Utils.CenteredRectangle(drawPosition, confirmationTexture.Size() * VerificationButtonScale); if (MouseScreenArea.Intersects(clickArea)) { VerificationButtonScale = MathHelper.Clamp(VerificationButtonScale + 0.035f, 1f, 1.35f); @@ -262,7 +249,7 @@ namespace CalamityMod.UI { Main.PlaySound(SoundID.Zombie, Main.LocalPlayer.Center, 67); AwaitingDecryptionTextClose = true; - codebreakerTileEntity.InputtedCellCount -= totalCellsCost; + codebreakerTileEntity.InitialCellCountBeforeDecrypting = codebreakerTileEntity.InputtedCellCount; codebreakerTileEntity.DecryptionCountdown = codebreakerTileEntity.DecryptionTotalTime; codebreakerTileEntity.SyncContainedStuff(); codebreakerTileEntity.SyncDecryptCountdown(); @@ -273,7 +260,82 @@ namespace CalamityMod.UI Main.spriteBatch.Draw(confirmationTexture, drawPosition, null, Color.White, 0f, confirmationTexture.Size() * 0.5f, VerificationButtonScale, SpriteEffects.None, 0f); } - + + public static void HandleDecryptionStuff(TECodebreaker codebreakerTileEntity, Texture2D backgroundTexture, Vector2 backgroundTopLeft, Vector2 barCenter) + { + Texture2D textPanelTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/DraedonDecrypterScreen"); + Vector2 textPanelCenter = backgroundTopLeft + Vector2.UnitX * backgroundTexture.Width + textPanelTexture.Size() * new Vector2(-0.5f, 0.5f); + Main.spriteBatch.Draw(textPanelTexture, textPanelCenter, null, Color.White, 0f, textPanelTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); + + // Generate gibberish and use slowly insert the real text. + // When decryption is done the gibberish will go away and only the underlying text will remain. + int textPadding = 6; + string trueMessage = codebreakerTileEntity.UnderlyingSchematicText; + StringBuilder text = new StringBuilder(codebreakerTileEntity.DecryptionCountdown == 0 ? trueMessage : CalamityUtils.GenerateRandomAlphanumericString(500)); + + // Don't mess with whitespace characters. Doing so can cause the word-wrap to "jump" around. + for (int i = 0; i < trueMessage.Length; i++) + { + if (char.IsWhiteSpace(trueMessage[i])) + text[i] = trueMessage[i]; + } + + // Insert the necessary amount of true text. + for (int i = 0; i < (int)(trueMessage.Length * codebreakerTileEntity.DecryptionCompletion); i++) + text[i] = trueMessage[i]; + + Vector2 currentTextDrawPosition = backgroundTopLeft + Vector2.UnitX * backgroundTexture.Width - Vector2.UnitX * (textPanelTexture.Width - textPadding); + currentTextDrawPosition.Y += 6f; + foreach (string line in Utils.WordwrapString(text.ToString(), Main.fontMouseText, (int)(textPanelTexture.Width * 1.5 - textPadding * 2), 10, out _)) + { + if (string.IsNullOrEmpty(line)) + continue; + + ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, Main.fontMouseText, line, currentTextDrawPosition, Color.Cyan, 0f, Vector2.Zero, new Vector2(0.6f, 0.6f)); + currentTextDrawPosition.Y += 16; + } + + // Draw a small bar at the bottom to indicate how much work is left. + Texture2D edgeTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ChargeMeterBorder"); + Texture2D barTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ChargeMeter"); + Main.spriteBatch.Draw(edgeTexture, barCenter, null, Color.White, 0f, edgeTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0); + + Rectangle barRectangle = new Rectangle(0, 0, (int)(barTexture.Width * codebreakerTileEntity.DecryptionCompletion), barTexture.Width); + Main.spriteBatch.Draw(barTexture, barCenter, barRectangle, Color.White, 0f, edgeTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0); + + // Display a completion percentage below the bar. + + string percentString = (codebreakerTileEntity.DecryptionCompletion * 100f).ToString("n2"); + string completionText = $"{percentString}%"; + Vector2 textDrawPosition = barCenter + new Vector2(-Main.fontMouseText.MeasureString(completionText).X * 0.5f, 10f); + Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontMouseText, completionText, textDrawPosition.X, textDrawPosition.Y, Color.Red * (Main.mouseTextColor / 255f), Color.Black, Vector2.Zero, 1f); + } + + public static void HandleDraedonSummonButton(TECodebreaker codebreakerTileEntity, Vector2 drawPosition) + { + Texture2D contactButton = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ContactButton"); + Rectangle clickArea = Utils.CenteredRectangle(drawPosition, contactButton.Size() * VerificationButtonScale); + if (MouseScreenArea.Intersects(clickArea)) + { + ContactButtonScale = MathHelper.Clamp(ContactButtonScale + 0.035f, 1f, 1.35f); + if (Main.mouseLeft && Main.mouseLeftRelease) + { + Main.PlaySound(SoundID.Zombie, Main.LocalPlayer.Center, 67); + CalamityWorld.DraedonSummonCountdown = CalamityWorld.DraedonSummonCountdownMax; + CalamityWorld.DraedonSummonPosition = codebreakerTileEntity.Center + new Vector2(-8f, -100f); + CalamityNetcode.SyncWorld(); + } + } + else + ContactButtonScale = MathHelper.Clamp(ContactButtonScale - 0.05f, 1f, 1.35f); + + Main.spriteBatch.Draw(contactButton, drawPosition, null, Color.White, 0f, contactButton.Size() * 0.5f, ContactButtonScale, SpriteEffects.None, 0f); + + string contactText = "Contact"; + drawPosition.X -= Main.fontMouseText.MeasureString(contactText).X * 0.5f; + Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontMouseText, contactText, drawPosition.X, drawPosition.Y + 20f, Color.Red * (Main.mouseTextColor / 255f), Color.Black, Vector2.Zero, 1f); + } + public static void DisplayNotStrongEnoughErrorText(Vector2 drawPosition) { string text = "Encryption unsolveable: Upgrades required."; diff --git a/Utilities/StringUtils.cs b/Utilities/StringUtils.cs index 7bb54f1c34..1c08f38964 100644 --- a/Utilities/StringUtils.cs +++ b/Utilities/StringUtils.cs @@ -5,7 +5,7 @@ namespace CalamityMod { public static partial class CalamityUtils { - internal static readonly string AlphanumericCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 "; + internal static readonly string AlphanumericCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; public static string GenerateRandomAlphanumericString(int length) => new string(Enumerable.Repeat(AlphanumericCharacters, length).Select(s => s[Main.rand.Next(s.Length)]).ToArray()); } } diff --git a/World/CalamityWorld.cs b/World/CalamityWorld.cs index 95aae9f245..aef2261677 100644 --- a/World/CalamityWorld.cs +++ b/World/CalamityWorld.cs @@ -52,6 +52,7 @@ namespace CalamityMod.World public static int ArmoredDiggerSpawnCooldown = 0; public static int MoneyStolenByBandit = 0; public static int Reforges; + public static bool IsWorldAfterDraedonUpdate = false; public static Dictionary ScreenShakeSpots = new Dictionary(); //Boss Rush @@ -155,6 +156,11 @@ namespace CalamityMod.World public static bool witchDoctorName = false; public static bool wizardName = false; + // Draedon Summoning stuff. + public static int DraedonSummonCountdown = 0; + public static Vector2 DraedonSummonPosition = Vector2.Zero; + public const int DraedonSummonCountdownMax = 450; + #region Downed Bools public static bool downedDesertScourge = false; public static bool downedCrabulon = false; @@ -459,6 +465,7 @@ namespace CalamityMod.World downed.Add("encounteredOldDuke"); if (HasGeneratedLuminitePlanetoids) downed.Add("HasGeneratedLuminitePlanetoids"); + downed.AddWithCondition("IsWorldAfterDraedonUpdate", IsWorldAfterDraedonUpdate); RecipeUnlockHandler.Save(downed); @@ -566,6 +573,7 @@ namespace CalamityMod.World forcedDownpourWithTear = downed.Contains("forcedTear"); encounteredOldDuke = downed.Contains("encounteredOldDuke"); HasGeneratedLuminitePlanetoids = downed.Contains("HasGeneratedLuminitePlanetoids"); + IsWorldAfterDraedonUpdate = downed.Contains("IsWorldAfterDraedonUpdate"); RecipeUnlockHandler.Load(downed); @@ -826,6 +834,8 @@ namespace CalamityMod.World writer.Write(acidRainPoints); writer.Write(Reforges); writer.Write(MoneyStolenByBandit); + writer.Write(DraedonSummonCountdown); + writer.WriteVector2(DraedonSummonPosition); } #endregion @@ -944,6 +954,8 @@ namespace CalamityMod.World acidRainPoints = reader.ReadInt32(); Reforges = reader.ReadInt32(); MoneyStolenByBandit = reader.ReadInt32(); + DraedonSummonCountdown = reader.ReadInt32(); + DraedonSummonPosition = reader.ReadVector2(); } #endregion @@ -981,6 +993,10 @@ namespace CalamityMod.World { numAbyssIslands = 0; roxShrinePlaced = false; + + // This will only be applied at world-gen time to new worlds. + // Only worlds will never receive this marker naturally. + IsWorldAfterDraedonUpdate = true; } #endregion @@ -1164,6 +1180,12 @@ namespace CalamityMod.World #region PostUpdate public override void PostUpdate() { + if (DraedonSummonCountdown > 0) + { + DraedonSummonCountdown--; + HandleDraedonSummoning(); + } + // Sunken Sea Location...duh SunkenSeaLocation = new Rectangle(WorldGen.UndergroundDesertLocation.Left, WorldGen.UndergroundDesertLocation.Bottom, WorldGen.UndergroundDesertLocation.Width, WorldGen.UndergroundDesertLocation.Height / 2); @@ -2017,6 +2039,25 @@ namespace CalamityMod.World } } } + + public static void HandleDraedonSummoning() + { + // Fire a giant laser into the sky. + if (Main.netMode != NetmodeID.MultiplayerClient && DraedonSummonCountdown == DraedonSummonCountdownMax - 45) + Projectile.NewProjectile(DraedonSummonPosition + Vector2.UnitY * 80f, Vector2.Zero, ModContent.ProjectileType(), 70, 0f); + + if (DraedonSummonCountdown < 150) + { + float fadeToWhite = Utils.InverseLerp(150f, 90f, DraedonSummonCountdown, true) * Utils.InverseLerp(30f, 50f, DraedonSummonCountdown, true); + MoonlordDeathDrama.RequestLight(fadeToWhite, Main.LocalPlayer.Center); + } + + if (DraedonSummonCountdown == 0) + { + Main.NewText("John Wulfrum has awoken!", new Color(175, 75, 255)); + NPC.NewNPC((int)DraedonSummonPosition.X, (int)DraedonSummonPosition.Y, ModContent.NPCType()); + } + } #endregion #region Check Placement Proximity From 690ddd5a9a345921e0a5df84942ed8d82b2e27d1 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 2 Jun 2021 17:48:22 -0500 Subject: [PATCH 07/86] Schematic obtainment methods --- CustomRecipes/RecipeUnlockHandler.cs | 45 +++++++++++++++++++ CustomRecipes/SchematicRecipe.cs | 33 ++++++++++++++ Items/DraedonMisc/EncryptedSchematicHell.cs | 23 ++++++++++ Items/DraedonMisc/EncryptedSchematicIce.cs | 24 ++++++++++ Items/DraedonMisc/EncryptedSchematicJungle.cs | 23 ++++++++++ .../EncryptedSchematicPlanetoid.cs | 23 ++++++++++ .../EncryptedSchematicSunkenSea.cs | 16 ++++++- 7 files changed, 186 insertions(+), 1 deletion(-) create mode 100644 CustomRecipes/SchematicRecipe.cs diff --git a/CustomRecipes/RecipeUnlockHandler.cs b/CustomRecipes/RecipeUnlockHandler.cs index b768573f22..7950a1f1fe 100644 --- a/CustomRecipes/RecipeUnlockHandler.cs +++ b/CustomRecipes/RecipeUnlockHandler.cs @@ -12,6 +12,12 @@ namespace CalamityMod.CustomRecipes public static bool HasUnlockedT4ArsenalRecipes = false; public static bool HasUnlockedT5ArsenalRecipes = false; + public static bool HasFoundSunkenSeaSchematic = false; + public static bool HasFoundPlanetoidSchematic = false; + public static bool HasFoundJungleSchematic = false; + public static bool HasFoundHellSchematic = false; + public static bool HasFoundIceSchematic = false; + public static void Save(List boolTagContainer) { boolTagContainer.AddWithCondition("HasUnlockedT1ArsenalRecipes", HasUnlockedT1ArsenalRecipes); @@ -19,6 +25,24 @@ namespace CalamityMod.CustomRecipes boolTagContainer.AddWithCondition("HasUnlockedT3ArsenalRecipes", HasUnlockedT3ArsenalRecipes); boolTagContainer.AddWithCondition("HasUnlockedT4ArsenalRecipes", HasUnlockedT4ArsenalRecipes); boolTagContainer.AddWithCondition("HasUnlockedT5ArsenalRecipes", HasUnlockedT5ArsenalRecipes); + + boolTagContainer.AddWithCondition("HasFoundSunkenSeaSchematic", HasFoundSunkenSeaSchematic); + boolTagContainer.AddWithCondition("HasFoundPlanetoidSchematic", HasFoundPlanetoidSchematic); + boolTagContainer.AddWithCondition("HasFoundJungleSchematic", HasFoundJungleSchematic); + boolTagContainer.AddWithCondition("HasFoundHellSchematic", HasFoundHellSchematic); + boolTagContainer.AddWithCondition("HasFoundIceSchematic", HasFoundIceSchematic); + + HasUnlockedT1ArsenalRecipes = false; + HasUnlockedT2ArsenalRecipes = false; + HasUnlockedT3ArsenalRecipes = false; + HasUnlockedT4ArsenalRecipes = false; + HasUnlockedT5ArsenalRecipes = false; + + HasFoundSunkenSeaSchematic = false; + HasFoundPlanetoidSchematic = false; + HasFoundJungleSchematic = false; + HasFoundHellSchematic = false; + HasFoundIceSchematic = false; } public static void Load(IList boolTagContainer) @@ -28,6 +52,12 @@ namespace CalamityMod.CustomRecipes HasUnlockedT3ArsenalRecipes = boolTagContainer.Contains("HasUnlockedT3ArsenalRecipes"); HasUnlockedT4ArsenalRecipes = boolTagContainer.Contains("HasUnlockedT4ArsenalRecipes"); HasUnlockedT5ArsenalRecipes = boolTagContainer.Contains("HasUnlockedT5ArsenalRecipes"); + + HasFoundSunkenSeaSchematic = boolTagContainer.Contains("HasFoundSunkenSeaSchematic"); + HasFoundPlanetoidSchematic = boolTagContainer.Contains("HasFoundPlanetoidSchematic"); + HasFoundJungleSchematic = boolTagContainer.Contains("HasFoundJungleSchematic"); + HasFoundHellSchematic = boolTagContainer.Contains("HasFoundHellSchematic"); + HasFoundIceSchematic = boolTagContainer.Contains("HasFoundIceSchematic"); } public static void SendData(BinaryWriter writer) @@ -38,8 +68,16 @@ namespace CalamityMod.CustomRecipes flags[2] = HasUnlockedT3ArsenalRecipes; flags[3] = HasUnlockedT4ArsenalRecipes; flags[4] = HasUnlockedT5ArsenalRecipes; + flags[5] = HasFoundSunkenSeaSchematic; + flags[6] = HasFoundPlanetoidSchematic; + flags[7] = HasFoundJungleSchematic; + + BitsByte flags2 = new BitsByte(); + flags2[0] = HasFoundHellSchematic; + flags2[1] = HasFoundIceSchematic; writer.Write(flags); + writer.Write(flags2); } public static void ReceiveData(BinaryReader reader) @@ -50,6 +88,13 @@ namespace CalamityMod.CustomRecipes HasUnlockedT3ArsenalRecipes = flags[2]; HasUnlockedT4ArsenalRecipes = flags[3]; HasUnlockedT5ArsenalRecipes = flags[4]; + HasFoundSunkenSeaSchematic = flags[5]; + HasFoundPlanetoidSchematic = flags[6]; + HasFoundJungleSchematic = flags[7]; + + BitsByte flags2 = reader.ReadByte(); + HasFoundHellSchematic = flags2[0]; + HasFoundIceSchematic = flags2[1]; } } } \ No newline at end of file diff --git a/CustomRecipes/SchematicRecipe.cs b/CustomRecipes/SchematicRecipe.cs new file mode 100644 index 0000000000..f097834200 --- /dev/null +++ b/CustomRecipes/SchematicRecipe.cs @@ -0,0 +1,33 @@ +using CalamityMod.World; +using Terraria.ModLoader; + +namespace CalamityMod.CustomRecipes +{ + public class SchematicRecipe : ModRecipe + { + public string SchematicName; + public SchematicRecipe(Mod mod, string schematicName) : base(mod) => SchematicName = schematicName; + + public override bool RecipeAvailable() + { + // Allow old worlds to craft the new schematics; They don't exist in old worlds + if (!CalamityWorld.IsWorldAfterDraedonUpdate) + return true; + + switch (SchematicName) + { + case "Sunken Sea": + return RecipeUnlockHandler.HasFoundSunkenSeaSchematic; + case "Planetoid": + return RecipeUnlockHandler.HasFoundPlanetoidSchematic; + case "Jungle": + return RecipeUnlockHandler.HasFoundJungleSchematic; + case "Hell": + return RecipeUnlockHandler.HasFoundHellSchematic; + case "Ice": + return RecipeUnlockHandler.HasFoundIceSchematic; + } + return false; + } + } +} \ No newline at end of file diff --git a/Items/DraedonMisc/EncryptedSchematicHell.cs b/Items/DraedonMisc/EncryptedSchematicHell.cs index 0113e3f8f5..cac05ab946 100644 --- a/Items/DraedonMisc/EncryptedSchematicHell.cs +++ b/Items/DraedonMisc/EncryptedSchematicHell.cs @@ -1,3 +1,6 @@ +using CalamityMod.CustomRecipes; +using CalamityMod.Items.Materials; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -19,5 +22,25 @@ namespace CalamityMod.Items.DraedonMisc item.Calamity().customRarity = CalamityRarity.DraedonRust; item.maxStack = 1; } + + public override void UpdateInventory(Player player) + { + if (Main.myPlayer == player.whoAmI && !RecipeUnlockHandler.HasFoundHellSchematic) + { + RecipeUnlockHandler.HasFoundHellSchematic = true; + CalamityNetcode.SyncWorld(); + } + } + + public override void AddRecipes() + { + SchematicRecipe recipe = new SchematicRecipe(mod, "Hell"); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ItemID.Glass, 50); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this, 1); + recipe.AddRecipe(); + } } } diff --git a/Items/DraedonMisc/EncryptedSchematicIce.cs b/Items/DraedonMisc/EncryptedSchematicIce.cs index c1797e3e2d..b84d3b2f93 100644 --- a/Items/DraedonMisc/EncryptedSchematicIce.cs +++ b/Items/DraedonMisc/EncryptedSchematicIce.cs @@ -1,3 +1,7 @@ +using CalamityMod.CustomRecipes; +using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.DraedonStructures; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -19,5 +23,25 @@ namespace CalamityMod.Items.DraedonMisc item.Calamity().customRarity = CalamityRarity.DraedonRust; item.maxStack = 1; } + + public override void UpdateInventory(Player player) + { + if (Main.myPlayer == player.whoAmI && !RecipeUnlockHandler.HasFoundIceSchematic) + { + RecipeUnlockHandler.HasFoundIceSchematic = true; + CalamityNetcode.SyncWorld(); + } + } + + public override void AddRecipes() + { + SchematicRecipe recipe = new SchematicRecipe(mod, "Ice"); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ItemID.Glass, 50); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this, 1); + recipe.AddRecipe(); + } } } diff --git a/Items/DraedonMisc/EncryptedSchematicJungle.cs b/Items/DraedonMisc/EncryptedSchematicJungle.cs index 0cfadc7dc9..febfbe0ca6 100644 --- a/Items/DraedonMisc/EncryptedSchematicJungle.cs +++ b/Items/DraedonMisc/EncryptedSchematicJungle.cs @@ -1,3 +1,6 @@ +using CalamityMod.CustomRecipes; +using CalamityMod.Items.Materials; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -19,5 +22,25 @@ namespace CalamityMod.Items.DraedonMisc item.Calamity().customRarity = CalamityRarity.DraedonRust; item.maxStack = 1; } + + public override void UpdateInventory(Player player) + { + if (Main.myPlayer == player.whoAmI && !RecipeUnlockHandler.HasFoundJungleSchematic) + { + RecipeUnlockHandler.HasFoundJungleSchematic = true; + CalamityNetcode.SyncWorld(); + } + } + + public override void AddRecipes() + { + SchematicRecipe recipe = new SchematicRecipe(mod, "Jungle"); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ItemID.Glass, 50); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this, 1); + recipe.AddRecipe(); + } } } diff --git a/Items/DraedonMisc/EncryptedSchematicPlanetoid.cs b/Items/DraedonMisc/EncryptedSchematicPlanetoid.cs index f675c39f21..27bf6b08f6 100644 --- a/Items/DraedonMisc/EncryptedSchematicPlanetoid.cs +++ b/Items/DraedonMisc/EncryptedSchematicPlanetoid.cs @@ -1,3 +1,6 @@ +using CalamityMod.CustomRecipes; +using CalamityMod.Items.Materials; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -19,5 +22,25 @@ namespace CalamityMod.Items.DraedonMisc item.Calamity().customRarity = CalamityRarity.DraedonRust; item.maxStack = 1; } + + public override void UpdateInventory(Player player) + { + if (Main.myPlayer == player.whoAmI && !RecipeUnlockHandler.HasFoundPlanetoidSchematic) + { + RecipeUnlockHandler.HasFoundPlanetoidSchematic = true; + CalamityNetcode.SyncWorld(); + } + } + + public override void AddRecipes() + { + SchematicRecipe recipe = new SchematicRecipe(mod, "Planetoid"); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ItemID.Glass, 50); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this, 1); + recipe.AddRecipe(); + } } } diff --git a/Items/DraedonMisc/EncryptedSchematicSunkenSea.cs b/Items/DraedonMisc/EncryptedSchematicSunkenSea.cs index d30493d505..67e2381062 100644 --- a/Items/DraedonMisc/EncryptedSchematicSunkenSea.cs +++ b/Items/DraedonMisc/EncryptedSchematicSunkenSea.cs @@ -1,4 +1,5 @@ using CalamityMod.CustomRecipes; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -28,11 +29,24 @@ namespace CalamityMod.Items.DraedonMisc { // Since no decrypting is necessary for this item simply placing it in your inventory is sufficient enough to "learn" // from it. - if (Main.myPlayer == player.whoAmI && !RecipeUnlockHandler.HasUnlockedT1ArsenalRecipes) + if (Main.myPlayer == player.whoAmI && (!RecipeUnlockHandler.HasUnlockedT1ArsenalRecipes || !RecipeUnlockHandler.HasFoundSunkenSeaSchematic)) { + RecipeUnlockHandler.HasFoundSunkenSeaSchematic = true; RecipeUnlockHandler.HasUnlockedT1ArsenalRecipes = true; CalamityNetcode.SyncWorld(); } } + + // Recipe exists for posierity. + public override void AddRecipes() + { + SchematicRecipe recipe = new SchematicRecipe(mod, "Sunken Sea"); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ItemID.Glass, 50); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this, 1); + recipe.AddRecipe(); + } } } From 5cafe6d2b872ecfb1f63376c47a091ebdff2acab Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 2 Jun 2021 18:10:58 -0500 Subject: [PATCH 08/86] Mouse recipe checks --- CalPlayer/CalamityPlayerMiscEffects.cs | 53 ++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 414e06fcb0..33b00f21d5 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -5,10 +5,12 @@ using CalamityMod.Buffs.Potions; using CalamityMod.Buffs.StatBuffs; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Buffs.Summon; +using CalamityMod.CustomRecipes; using CalamityMod.Dusts; using CalamityMod.Events; using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor; +using CalamityMod.Items.DraedonMisc; using CalamityMod.Items.Fishing.AstralCatches; using CalamityMod.Items.Fishing.BrimstoneCragCatches; using CalamityMod.Items.Fishing.FishingRods; @@ -111,6 +113,9 @@ namespace CalamityMod.CalPlayer // Potions (Quick Buff && Potion Sickness) HandlePotions(player, modPlayer); + // Check if schematics are present on the mouse, for the sake of registering their recipes. + CheckIfMouseItemIsSchematic(player); + // Regularly sync player stats during multiplayer if (player.whoAmI == Main.myPlayer && Main.netMode == NetmodeID.MultiplayerClient) { @@ -4108,6 +4113,54 @@ namespace CalamityMod.CalPlayer } #endregion + #region Mouse Item Checks + public static void CheckIfMouseItemIsSchematic(Player player) + { + if (Main.myPlayer != player.whoAmI) + return; + + bool shouldSync = false; + + // ActiveItem doesn't need to be checked as the other possibility involves + // the item in question already being in the inventory. + if (Main.mouseItem != null && !Main.mouseItem.IsAir) + { + if (Main.mouseItem.type == ModContent.ItemType() && !RecipeUnlockHandler.HasFoundSunkenSeaSchematic) + { + RecipeUnlockHandler.HasFoundSunkenSeaSchematic = true; + shouldSync = true; + } + + if (Main.mouseItem.type == ModContent.ItemType() && !RecipeUnlockHandler.HasFoundPlanetoidSchematic) + { + RecipeUnlockHandler.HasFoundPlanetoidSchematic = true; + shouldSync = true; + } + + if (Main.mouseItem.type == ModContent.ItemType() && !RecipeUnlockHandler.HasFoundJungleSchematic) + { + RecipeUnlockHandler.HasFoundJungleSchematic = true; + shouldSync = true; + } + + if (Main.mouseItem.type == ModContent.ItemType() && !RecipeUnlockHandler.HasFoundHellSchematic) + { + RecipeUnlockHandler.HasFoundHellSchematic = true; + shouldSync = true; + } + + if (Main.mouseItem.type == ModContent.ItemType() && !RecipeUnlockHandler.HasFoundIceSchematic) + { + RecipeUnlockHandler.HasFoundIceSchematic = true; + shouldSync = true; + } + } + + if (shouldSync) + CalamityNetcode.SyncWorld(); + } + #endregion + #region Potion Handling private static void HandlePotions(Player player, CalamityPlayer modPlayer) { From 72c3244793cbe8a609a3098b909de9e3ce339386 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Thu, 3 Jun 2021 14:32:11 -0500 Subject: [PATCH 09/86] The codebreaker drops its cells now --- TileEntities/TECodebreaker.cs | 10 ++++++++++ Tiles/DraedonSummoner/CodebreakerTile.cs | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/TileEntities/TECodebreaker.cs b/TileEntities/TECodebreaker.cs index 0df9a9e309..049818945d 100644 --- a/TileEntities/TECodebreaker.cs +++ b/TileEntities/TECodebreaker.cs @@ -2,6 +2,7 @@ using CalamityMod.CustomRecipes; using CalamityMod.Items.DraedonMisc; using CalamityMod.Tiles.DraedonSummoner; using Microsoft.Xna.Framework; +using System; using System.IO; using Terraria; using Terraria.DataStructures; @@ -155,6 +156,15 @@ namespace CalamityMod.TileEntities if (CalamityLists.EncryptedSchematicIDRelationship.ContainsKey(HeldSchematicID)) Item.NewItem(x * 16, y * 16, 32, 32, CalamityLists.EncryptedSchematicIDRelationship[HeldSchematicID]); + + while (InputtedCellCount > 0) + { + int totalCellsToDrop = InputtedCellCount; + if (totalCellsToDrop > 999) + totalCellsToDrop = 999; + InputtedCellCount -= totalCellsToDrop; + Item.NewItem(x * 16, y * 16, 32, 32, ModContent.ItemType(), totalCellsToDrop); + } } public void SyncConstituents() diff --git a/Tiles/DraedonSummoner/CodebreakerTile.cs b/Tiles/DraedonSummoner/CodebreakerTile.cs index 3249d5c21b..c3e3eaf5af 100644 --- a/Tiles/DraedonSummoner/CodebreakerTile.cs +++ b/Tiles/DraedonSummoner/CodebreakerTile.cs @@ -107,7 +107,7 @@ namespace CalamityMod.Tiles.DraedonSummoner // Otherwise, open the decryption interface when it exists. This can be either opening the GUI from nothing, or just opening a separate codebreaker. else if (codebreakerTileEntity != null) { - // Play a sound depending on whether the player had another charger open previously. + // Play a sound depending on whether the player had another codebreaker open previously. Main.PlaySound(DraedonDecryptUI.ViewedTileEntityID == -1 ? SoundID.MenuOpen : SoundID.MenuTick); DraedonDecryptUI.ViewedTileEntityID = codebreakerTileEntity.ID; Main.playerInventory = true; From 07980fe62578af5a8e61651e543196680d8b10da Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Thu, 3 Jun 2021 21:46:55 -0500 Subject: [PATCH 10/86] Comment corrections --- TileEntities/TECodebreaker.cs | 6 +++--- UI/DraedonDecryptUI.cs | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/TileEntities/TECodebreaker.cs b/TileEntities/TECodebreaker.cs index 049818945d..4e11c21918 100644 --- a/TileEntities/TECodebreaker.cs +++ b/TileEntities/TECodebreaker.cs @@ -111,18 +111,18 @@ namespace CalamityMod.TileEntities public Vector2 Center => Position.ToWorldCoordinates(8f * CodebreakerTile.Width, 8f * CodebreakerTile.Height); public const int MaxCellCapacity = 9999; - // This guarantees that this tile entity will not persist if not placed directly on the top left corner of a Charging Station tile. + // This guarantees that this tile entity will not persist if not placed directly on the top left corner of a Codebreaker tile. public override bool ValidTile(int i, int j) { Tile tile = CalamityUtils.ParanoidTileRetrieval(i, j); return tile.active() && tile.type == ModContent.TileType() && tile.frameX == 0 && tile.frameY == 0; } - // This code is called as a hook when the player places the Charging Station tile so that the tile entity may be placed. + // This code is called as a hook when the player places the Codebreaker tile so that the tile entity may be placed. public override int Hook_AfterPlacement(int i, int j, int type, int style, int direction) { // If in multiplayer, tell the server to place the tile entity and DO NOT place it yourself. That would mismatch IDs. - // Also tell the server that you placed the 3x2 tiles that make up the Charging Station. + // Also tell the server that you placed the 5x8 tiles that make up the Codebreaker. if (Main.netMode == NetmodeID.MultiplayerClient) { NetMessage.SendTileRange(Main.myPlayer, i, j, CodebreakerTile.Width, CodebreakerTile.Height); diff --git a/UI/DraedonDecryptUI.cs b/UI/DraedonDecryptUI.cs index 8c5222e5b8..54c5ee4ec1 100644 --- a/UI/DraedonDecryptUI.cs +++ b/UI/DraedonDecryptUI.cs @@ -26,7 +26,7 @@ namespace CalamityMod.UI public static void Draw(SpriteBatch spriteBatch) { // If not viewing the specific tile entity's interface anymore, or if the ID is for some reason invalid - // don't do anything except resetting/update necessary information. + // don't do anything except resetting/updating necessary information. if (!TileEntity.ByID.ContainsKey(ViewedTileEntityID) || !(TileEntity.ByID[ViewedTileEntityID] is TECodebreaker codebreakerTileEntity)) { VerificationButtonScale = 1f; @@ -304,7 +304,6 @@ namespace CalamityMod.UI Main.spriteBatch.Draw(barTexture, barCenter, barRectangle, Color.White, 0f, edgeTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0); // Display a completion percentage below the bar. - string percentString = (codebreakerTileEntity.DecryptionCompletion * 100f).ToString("n2"); string completionText = $"{percentString}%"; Vector2 textDrawPosition = barCenter + new Vector2(-Main.fontMouseText.MeasureString(completionText).X * 0.5f, 10f); From 343b299f8ed24dce49646d00b0514df76bb9c2cb Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 5 Jun 2021 18:36:29 -0500 Subject: [PATCH 11/86] Better UI buttons --- ExtraTextures/UI/ContactButton.png | Bin 312 -> 0 bytes ExtraTextures/UI/ContactIcon.png | Bin 0 -> 512 bytes ExtraTextures/UI/DecryptIcon.png | Bin 0 -> 422 bytes UI/DraedonDecryptUI.cs | 32 +++++++++++++++++++++-------- 4 files changed, 24 insertions(+), 8 deletions(-) delete mode 100644 ExtraTextures/UI/ContactButton.png create mode 100644 ExtraTextures/UI/ContactIcon.png create mode 100644 ExtraTextures/UI/DecryptIcon.png diff --git a/ExtraTextures/UI/ContactButton.png b/ExtraTextures/UI/ContactButton.png deleted file mode 100644 index cd2dee8e7ecde2a156da0bbd477b8748d4845efa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 312 zcmeAS@N?(olHy`uVBq!ia0vp^5anMpx{|g7sn6}@1qmBxtJAsT)tn+<$pOdN~l6W zbylhAH^&5XzqCIw%=;#r_NE)Hy8Yt7>%SMZmS$|d;C_6Lgv%1v6${cO4$9ai-Iye{ zfVYq9TtoDW1G|m>dhlm#Y--55cQZnlL7QX6v%?JUI~cG2iDx=swz`#X)nNfQ=`Clo z7B;_1V|q6!jVF_Fo#FpA-5)eF8Ldu;9_Z62TSaONkLUJtzhq4C z-7e)E)gZ+b?i$asdJg9Si5J}oQ@=25SQg#;(D6X&Uk1gj@-`E$HGx2nF?hQAxvXPx#1ZP1_K>z@;j|==^1poj532;bRa{vGizW@LZzX3P}QzQTY0hLKaK~zXfV;FIO z5lRyT|NnpZ526n+vP{1i8UX2B;iWr!7x0nT{(S1JneEeyfCfKJOp6X!! z`h)wyv}5y2Fx^y}0;bWywRe*tj5`pY>xh6U3@~_7H7rgq^sfQ)wGVCv(=ZTx2-U~S zKRyT3sz-Ujw22oFn6_p34W_TWsR7fvqEk@p8ZaM|Y_VpZHyDF_3iB-p6ne3PG03Md z--5u?JFmbP9Soj0hJm!r^TBaF(XLVd@O;oAYj%c4KRJ6E+4PigV)FCz@cd(I0SG3LOz9oq2pt8kon;bI0UXw z+6v|mdLL8GVl_iPFeVlZT_1z;HG1AA1`Lpo85jT*EOn*PL!z4i0000Px#1ZP1_K>z@;j|==^1poj532;bRa{vGizW@LZzX3P}QzQTY0Xs=VK~zXf&6P20 z!ax{?FLf&xH^Eu@4_q^J4gCXd-HHxEe?YtV0}2j8!NEZ&IE!lsaVxlsoeQ06DP7~` zr7z?@{D=zX?iup>-CdGT`yZvw;FswDvF1h&6v!fa<%%9T{n@h(a zH*?gs9fg0R&i7{T8f!)tX@CsRh%>WbM!CJnBEvD#(9B9RI`~DIAuUhA|97-!j~wi& zM80l6ksQbN+$ja+8y#yvwDHgLFXTf~hgmpAwjJ57HIR1gk%aw(_xm@xpN;XO633{u zwU-7(ruI3Wj0nwMZtqYR8EB`G6!50P+;G_;v(lw@Sg4mh*Ed8cmQ Q)c^nh07*qoM6N<$g8rzq3;+NC literal 0 HcmV?d00001 diff --git a/UI/DraedonDecryptUI.cs b/UI/DraedonDecryptUI.cs index 54c5ee4ec1..e34d733a87 100644 --- a/UI/DraedonDecryptUI.cs +++ b/UI/DraedonDecryptUI.cs @@ -87,10 +87,10 @@ namespace CalamityMod.UI DisplayCostText(costDisplayLocation, cost); if (codebreakerTileEntity.InputtedCellCount >= cost) - DrawCostVerificationButton(codebreakerTileEntity, costVerificationLocation, cost); + DrawCostVerificationButton(codebreakerTileEntity, costVerificationLocation); } - Vector2 summonButtonCenter = backgroundTopLeft + new Vector2(140f, backgroundTexture.Height - 55f); + Vector2 summonButtonCenter = backgroundTopLeft + new Vector2(140f, backgroundTexture.Height - 48f); if (codebreakerTileEntity.ReadyToSummonDreadon) HandleDraedonSummonButton(codebreakerTileEntity, summonButtonCenter); @@ -238,9 +238,9 @@ namespace CalamityMod.UI Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontItemStack, totalCellsCost.ToString(), offsetDrawPosition.X - 11f, offsetDrawPosition.Y, Color.White, Color.Black, new Vector2(0.3f), 0.75f); } - public static void DrawCostVerificationButton(TECodebreaker codebreakerTileEntity, Vector2 drawPosition, int totalCellsCost) + public static void DrawCostVerificationButton(TECodebreaker codebreakerTileEntity, Vector2 drawPosition) { - Texture2D confirmationTexture = Main.cameraTexture[5]; + Texture2D confirmationTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/DecryptIcon"); Rectangle clickArea = Utils.CenteredRectangle(drawPosition, confirmationTexture.Size() * VerificationButtonScale); if (MouseScreenArea.Intersects(clickArea)) { @@ -295,12 +295,15 @@ namespace CalamityMod.UI currentTextDrawPosition.Y += 16; } + if (codebreakerTileEntity.DecryptionCountdown <= 0) + return; + // Draw a small bar at the bottom to indicate how much work is left. Texture2D edgeTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ChargeMeterBorder"); Texture2D barTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ChargeMeter"); Main.spriteBatch.Draw(edgeTexture, barCenter, null, Color.White, 0f, edgeTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0); - Rectangle barRectangle = new Rectangle(0, 0, (int)(barTexture.Width * codebreakerTileEntity.DecryptionCompletion), barTexture.Width); + Rectangle barRectangle = new Rectangle(0, 0, (int)(barTexture.Width * codebreakerTileEntity.DecryptionCompletion * 0.9f), barTexture.Width); Main.spriteBatch.Draw(barTexture, barCenter, barRectangle, Color.White, 0f, edgeTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0); // Display a completion percentage below the bar. @@ -311,8 +314,8 @@ namespace CalamityMod.UI } public static void HandleDraedonSummonButton(TECodebreaker codebreakerTileEntity, Vector2 drawPosition) - { - Texture2D contactButton = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ContactButton"); + { + Texture2D contactButton = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ContactIcon"); Rectangle clickArea = Utils.CenteredRectangle(drawPosition, contactButton.Size() * VerificationButtonScale); if (MouseScreenArea.Intersects(clickArea)) { @@ -330,9 +333,22 @@ namespace CalamityMod.UI Main.spriteBatch.Draw(contactButton, drawPosition, null, Color.White, 0f, contactButton.Size() * 0.5f, ContactButtonScale, SpriteEffects.None, 0f); + Color[] exoPalette = new Color[] + { + new Color(250, 255, 112), + new Color(211, 235, 108), + new Color(166, 240, 105), + new Color(105, 240, 220), + new Color(64, 130, 145), + new Color(145, 96, 145), + new Color(242, 112, 73), + new Color(199, 62, 62), + }; + string contactText = "Contact"; + Color contactTextColor = CalamityUtils.MulticolorLerp((float)Math.Cos(Main.GlobalTime * 0.7f) * 0.5f + 0.5f, exoPalette); drawPosition.X -= Main.fontMouseText.MeasureString(contactText).X * 0.5f; - Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontMouseText, contactText, drawPosition.X, drawPosition.Y + 20f, Color.Red * (Main.mouseTextColor / 255f), Color.Black, Vector2.Zero, 1f); + Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontMouseText, contactText, drawPosition.X, drawPosition.Y + 20f, contactTextColor, Color.Black, Vector2.Zero, 1f); } public static void DisplayNotStrongEnoughErrorText(Vector2 drawPosition) From 77d94541d7aea7bcf7f9ab6ac9470078b00a0d22 Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 11 Jun 2021 17:56:11 -0500 Subject: [PATCH 12/86] Schematic resprites and knowledge tooltips --- CustomRecipes/ArsenalTierGatedRecipe.cs | 18 ++++++++++++++++++ Items/CalamityGlobalItemTooltip.cs | 18 ++++++++++++++++-- Items/DraedonMisc/AdvancedDisplay.cs | 3 +++ Items/DraedonMisc/AuricQuantumCoolingCell.cs | 1 + Items/DraedonMisc/DecryptionComputer.cs | 3 +++ Items/DraedonMisc/EncryptedSchematicHell.png | Bin 611 -> 693 bytes Items/DraedonMisc/EncryptedSchematicIce.png | Bin 611 -> 649 bytes .../DraedonMisc/EncryptedSchematicJungle.png | Bin 611 -> 591 bytes .../EncryptedSchematicSunkenSea.png | Bin 611 -> 644 bytes Items/DraedonMisc/LongRangedSensorArray.cs | 3 +++ Items/DraedonMisc/VoltageRegulationSystem.cs | 3 +++ .../DraedonsArsenal/FrequencyManipulator.cs | 3 +++ .../DraedonsArsenal/GalvanizingGlaive.cs | 3 +++ Items/Weapons/DraedonsArsenal/GatlingLaser.cs | 3 +++ Items/Weapons/DraedonsArsenal/GaussDagger.cs | 3 +++ Items/Weapons/DraedonsArsenal/GaussPistol.cs | 3 +++ Items/Weapons/DraedonsArsenal/GaussRifle.cs | 3 +++ .../DraedonsArsenal/HydraulicVoltCrasher.cs | 3 +++ Items/Weapons/DraedonsArsenal/LaserRifle.cs | 3 +++ .../DraedonsArsenal/MatterModulator.cs | 3 +++ .../Weapons/DraedonsArsenal/MountedScanner.cs | 3 +++ Items/Weapons/DraedonsArsenal/Phaseslayer.cs | 3 +++ Items/Weapons/DraedonsArsenal/PlasmaCaster.cs | 3 +++ .../Weapons/DraedonsArsenal/PlasmaGrenade.cs | 3 +++ Items/Weapons/DraedonsArsenal/PoleWarper.cs | 3 +++ Items/Weapons/DraedonsArsenal/PulseDragon.cs | 3 +++ Items/Weapons/DraedonsArsenal/PulsePistol.cs | 3 +++ Items/Weapons/DraedonsArsenal/PulseRifle.cs | 3 +++ .../DraedonsArsenal/PulseTurretRemote.cs | 3 +++ Items/Weapons/DraedonsArsenal/SnakeEyes.cs | 3 +++ .../StarSwallowerContainmentUnit.cs | 3 +++ Items/Weapons/DraedonsArsenal/SystemBane.cs | 3 +++ Items/Weapons/DraedonsArsenal/Taser.cs | 3 +++ Items/Weapons/DraedonsArsenal/TeslaCannon.cs | 3 +++ Items/Weapons/DraedonsArsenal/TrackingDisk.cs | 3 +++ Items/Weapons/DraedonsArsenal/WavePounder.cs | 3 +++ Localization/CalamityLocalization.cs | 2 +- 37 files changed, 123 insertions(+), 3 deletions(-) diff --git a/CustomRecipes/ArsenalTierGatedRecipe.cs b/CustomRecipes/ArsenalTierGatedRecipe.cs index af51c51a2d..daae8f3b9a 100644 --- a/CustomRecipes/ArsenalTierGatedRecipe.cs +++ b/CustomRecipes/ArsenalTierGatedRecipe.cs @@ -13,6 +13,24 @@ namespace CalamityMod.CustomRecipes AllowedInOldWorlds = allowedInOldWorlds; } + public static bool HasTierBeenLearned(int tier) + { + switch (tier) + { + case 1: + return RecipeUnlockHandler.HasUnlockedT1ArsenalRecipes; + case 2: + return RecipeUnlockHandler.HasUnlockedT2ArsenalRecipes; + case 3: + return RecipeUnlockHandler.HasUnlockedT3ArsenalRecipes; + case 4: + return RecipeUnlockHandler.HasUnlockedT4ArsenalRecipes; + case 5: + return RecipeUnlockHandler.HasUnlockedT5ArsenalRecipes; + } + return false; + } + public override bool RecipeAvailable() { if (AllowedInOldWorlds && !CalamityWorld.IsWorldAfterDraedonUpdate) diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index bf5da7bdde..5906658c6a 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -1,4 +1,5 @@ using CalamityMod.CalPlayer; +using CalamityMod.CustomRecipes; using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor; using CalamityMod.Items.Placeables.Furniture.Fountains; @@ -978,6 +979,19 @@ namespace CalamityMod.Items tooltips.Add(line); } } - #endregion - } + #endregion + + #region Schematic Knowledge Tooltip Utility + public static void InsertKnowledgeTooltip(List tooltips, int tier, bool allowOldWorlds = false) + { + TooltipLine line = new TooltipLine(CalamityMod.Instance, "SchematicKnowledge1", "You don't have sufficient knowledge to create this yet"); + TooltipLine line2 = new TooltipLine(CalamityMod.Instance, "SchematicKnowledge2", "A specific schematic must be deciphered first"); + line.overrideColor = line2.overrideColor = Color.Cyan; + + bool allowedDueToOldWorld = allowOldWorlds && CalamityWorld.IsWorldAfterDraedonUpdate; + tooltips.AddWithCondition(line, !ArsenalTierGatedRecipe.HasTierBeenLearned(tier) && !allowedDueToOldWorld); + tooltips.AddWithCondition(line2, !ArsenalTierGatedRecipe.HasTierBeenLearned(tier) && !allowedDueToOldWorld); + } + #endregion + } } diff --git a/Items/DraedonMisc/AdvancedDisplay.cs b/Items/DraedonMisc/AdvancedDisplay.cs index 29e777e8a8..936b0b4d2f 100644 --- a/Items/DraedonMisc/AdvancedDisplay.cs +++ b/Items/DraedonMisc/AdvancedDisplay.cs @@ -6,6 +6,7 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; using CalamityMod.TileEntities; using CalamityMod.CustomRecipes; +using System.Collections.Generic; namespace CalamityMod.Items.DraedonMisc { @@ -30,6 +31,8 @@ namespace CalamityMod.Items.DraedonMisc public override bool UseItem(Player player) => true; + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 3); + public override bool ConsumeItem(Player player) { Point placeTileCoords = Main.MouseWorld.ToTileCoordinates(); diff --git a/Items/DraedonMisc/AuricQuantumCoolingCell.cs b/Items/DraedonMisc/AuricQuantumCoolingCell.cs index db332c62e6..2655518409 100644 --- a/Items/DraedonMisc/AuricQuantumCoolingCell.cs +++ b/Items/DraedonMisc/AuricQuantumCoolingCell.cs @@ -38,6 +38,7 @@ namespace CalamityMod.Items.DraedonMisc public override void ModifyTooltips(List tooltips) { tooltips.FirstOrDefault(x => x.Name == "Tooltip2" && x.mod == "Terraria").overrideColor = Color.DarkRed; + CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 5, true); } public override void Update(ref float gravity, ref float maxFallSpeed) diff --git a/Items/DraedonMisc/DecryptionComputer.cs b/Items/DraedonMisc/DecryptionComputer.cs index d4e7c94efe..f440354862 100644 --- a/Items/DraedonMisc/DecryptionComputer.cs +++ b/Items/DraedonMisc/DecryptionComputer.cs @@ -6,6 +6,7 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; using CalamityMod.TileEntities; using CalamityMod.CustomRecipes; +using System.Collections.Generic; namespace CalamityMod.Items.DraedonMisc { @@ -32,6 +33,8 @@ namespace CalamityMod.Items.DraedonMisc public override bool UseItem(Player player) => true; + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 1); + public override bool ConsumeItem(Player player) { Point placeTileCoords = Main.MouseWorld.ToTileCoordinates(); diff --git a/Items/DraedonMisc/EncryptedSchematicHell.png b/Items/DraedonMisc/EncryptedSchematicHell.png index 6cd561cb05192d8654317ef3a0d325e7d9512761..ee834c680c661853b1911c68effb5352bf1c1971 100644 GIT binary patch delta 682 zcmV;b0#*Iv1hoZ_7k?lK1^@s6WLWAw00001b5ch_0Itp)=>Px#1ZP1_K>z@;j|==^ z1poj532;bRa{vGi!vFvd!vV){sAK>D0!m3lK~z{r-IqN`TTvK>?=`6ocBzxs%|#I@ zIGD8oTdmzX=%64%htN{m>9)GL+8-$GW(J`Og-~aIq6l#lLVpm7Epg~nnhv56s)Obx z_P*!5O1^q~gMak+z{zt?Lb&0*-#y=nU8z*8tDv{Ny`~E-=kvCnR#B(@-*aV&+O~}g zO~>O{OE&iQ;IG9ZEHNk1h~r*Jq+a2zp8cD9ZEf(d9MkyZIU_-BJxDx~n#k$iOTt2}|@-p#b;m&t2Dr%}un{TI9YN*(odQ z1iiTtI4n`ZWT$dDn4QVkM5EfrFxg69Gi;}S!AzpHCyoM9hv6y5m7K2l% z6f9YvU(qv#IZr*$qcTy}XgSdfv-S?h@53bMskb^`Dr;nCB0NnI*63i5s?yJ^i?I2L z%KcQHH-B$TF2M(5eXykdRT^fk%S8G8`1CVa!eou>^?^UsPoQczE{3Gx?hJV!Z07*qoM6N<$f&y*#e7k?TE1^@s6!MV=%00001b5ch_0Itp)=>Px%9Z5t%R9J=8m$6G6 zQ4q#|8!QflBZ8ndl1{QB*c@6VBACQl2&ZU~6oRC%yQ@>0A`(InZBir<5%LG<1yL)( zMiA8NVnFmN!-;T(a2E6C$j;rmw+RH^*L*YYz1dy9{r0`tfPb{;Eof9vUHd04-=$jq z;Gb^x9}!Fp45TVJuJ!`uf@`7;&Bs%VilbO4i>;zvke@qy+kvFKr3W zPYAD-gp1FFb$?eeZ@?c#?ZDy94FJQPo$0RR6lf@@u>0j^#RVmkoAu*gTrT9VqDe}I ztE=hmU_4oWXy%B=koxpuY8kp+K;Q%dkb>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*cviZFS(!@7*%H~`hl&1-WMcKMTYAE!C z&%@V6^(QOlCVr|;CPo4a^3H1|premP(lBGJa$(nn0;*o@!@nr5Z9eoGPlpAMv(HRcoz{<%9 zJm1#`7sH=mvXec4^&Kp!wUgBe4GySIa<{$;o1YkAaym?oiM^J3->%F}On(!%ZQFam ehj;oWZdp%7pWSPx%9Z5t%R9J=8m$6G6Q4q#|8!QflBZ8ndl1{QB*c@6VBACQl2&ZU~6oRC%yQ@>0 zA`(InZBir<5%LG<1yL)(MiA8NVnFmN!-;T(a2E6C$j;rmw+RH^*L*YYz1dy9{r0`t zfVAi>XjD&K`zJ2nrCR>rpKkUa5ljpWq$)VB_5g5R9~DIx-b5Gd?wNuk;czIL$3fRA zw&wtk6z%BGWB~Y8tF`61Fk1oOysRE`ipD7!m&d`r0SA8+RV8Qo`r0ZOah?v#Wf?F^ z*560J=HSJo1p1XPZ3)j$2(Oidi_e60S21tEA4ToJ;mr*I!=0V!uH+PGD5$XeF!`WS$}Beoh5_cvl6VeR@xgy1KgSYd2H<7g|BvY0LbU_ z0IaWklZmcCSUnZDU!E)pPkj~sKHEBfTol%Q)Vq^O1O3{MtJQl8a=DxY3)29s>%?>E z0UFAv*Oq?>tMckuTc=9Kz#Byy9!=_^O0PdkpeKkT$(sthpI*7vLY1`pr}L)58$}x) z4YOGQJ{%kXu;{#ak?jWH<<>F)8|pEutnDM4P>81L;p9#~0G|}K-n2?4;^`A%?V_w# z;}k2JaqXJ)dfRS1BhTlJqQTVQAOO|d+en9B(ta}uZ_lE6#?{%bs9mU{E1!gGr+#^~ x=`XZ$ech6q@Mu){=l true; + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 2); + public override bool ConsumeItem(Player player) { Point placeTileCoords = Main.MouseWorld.ToTileCoordinates(); diff --git a/Items/DraedonMisc/VoltageRegulationSystem.cs b/Items/DraedonMisc/VoltageRegulationSystem.cs index cb3b13ed3d..0b048f36c6 100644 --- a/Items/DraedonMisc/VoltageRegulationSystem.cs +++ b/Items/DraedonMisc/VoltageRegulationSystem.cs @@ -6,6 +6,7 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; using CalamityMod.TileEntities; using CalamityMod.CustomRecipes; +using System.Collections.Generic; namespace CalamityMod.Items.DraedonMisc { @@ -31,6 +32,8 @@ namespace CalamityMod.Items.DraedonMisc public override bool UseItem(Player player) => true; + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 4); + public override bool ConsumeItem(Player player) { Point placeTileCoords = Main.MouseWorld.ToTileCoordinates(); diff --git a/Items/Weapons/DraedonsArsenal/FrequencyManipulator.cs b/Items/Weapons/DraedonsArsenal/FrequencyManipulator.cs index cbf8d340f8..703bc5730c 100644 --- a/Items/Weapons/DraedonsArsenal/FrequencyManipulator.cs +++ b/Items/Weapons/DraedonsArsenal/FrequencyManipulator.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -51,6 +52,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 2); + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); diff --git a/Items/Weapons/DraedonsArsenal/GalvanizingGlaive.cs b/Items/Weapons/DraedonsArsenal/GalvanizingGlaive.cs index cb6a599700..816c0561d0 100644 --- a/Items/Weapons/DraedonsArsenal/GalvanizingGlaive.cs +++ b/Items/Weapons/DraedonsArsenal/GalvanizingGlaive.cs @@ -2,6 +2,7 @@ using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -51,6 +52,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 3); + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { float swingOffset = Main.rand.NextFloat(0.5f, 1f) * item.shootSpeed * 1.6f * player.direction; diff --git a/Items/Weapons/DraedonsArsenal/GatlingLaser.cs b/Items/Weapons/DraedonsArsenal/GatlingLaser.cs index f712a46951..3e5ed17b95 100644 --- a/Items/Weapons/DraedonsArsenal/GatlingLaser.cs +++ b/Items/Weapons/DraedonsArsenal/GatlingLaser.cs @@ -2,6 +2,7 @@ using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -54,6 +55,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 3); + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); diff --git a/Items/Weapons/DraedonsArsenal/GaussDagger.cs b/Items/Weapons/DraedonsArsenal/GaussDagger.cs index 357f9c1903..8fde7250a1 100644 --- a/Items/Weapons/DraedonsArsenal/GaussDagger.cs +++ b/Items/Weapons/DraedonsArsenal/GaussDagger.cs @@ -2,6 +2,7 @@ using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -44,6 +45,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal modItem.ChargePerUse = 0.05f; } + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 1); + public override void OnHitNPC(Player player, NPC target, int damage, float knockBack, bool crit) { target.Calamity().GaussFluxTimer += 50; diff --git a/Items/Weapons/DraedonsArsenal/GaussPistol.cs b/Items/Weapons/DraedonsArsenal/GaussPistol.cs index 9abb103cc1..3a0479552d 100644 --- a/Items/Weapons/DraedonsArsenal/GaussPistol.cs +++ b/Items/Weapons/DraedonsArsenal/GaussPistol.cs @@ -1,6 +1,7 @@ using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; +using System.Collections.Generic; using Terraria.ID; using Terraria.ModLoader; @@ -44,6 +45,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal modItem.ChargePerUse = 0.05f; } + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 2); + public override void AddRecipes() { ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 2); diff --git a/Items/Weapons/DraedonsArsenal/GaussRifle.cs b/Items/Weapons/DraedonsArsenal/GaussRifle.cs index 03c924d9e0..0645432e36 100644 --- a/Items/Weapons/DraedonsArsenal/GaussRifle.cs +++ b/Items/Weapons/DraedonsArsenal/GaussRifle.cs @@ -2,6 +2,7 @@ using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -51,6 +52,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal return false; } + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 3); + public override void AddRecipes() { ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 3); diff --git a/Items/Weapons/DraedonsArsenal/HydraulicVoltCrasher.cs b/Items/Weapons/DraedonsArsenal/HydraulicVoltCrasher.cs index fe90632bb0..a0733635b6 100644 --- a/Items/Weapons/DraedonsArsenal/HydraulicVoltCrasher.cs +++ b/Items/Weapons/DraedonsArsenal/HydraulicVoltCrasher.cs @@ -1,6 +1,7 @@ using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -51,6 +52,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0 && item.Calamity().Charge > 0; + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 2); + public override void AddRecipes() { ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 2); diff --git a/Items/Weapons/DraedonsArsenal/LaserRifle.cs b/Items/Weapons/DraedonsArsenal/LaserRifle.cs index b94e59f66d..929cda4cdb 100644 --- a/Items/Weapons/DraedonsArsenal/LaserRifle.cs +++ b/Items/Weapons/DraedonsArsenal/LaserRifle.cs @@ -2,6 +2,7 @@ using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -63,6 +64,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal return false; } + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 4); + public override Vector2? HoldoutOffset() { return new Vector2(-20, 0); diff --git a/Items/Weapons/DraedonsArsenal/MatterModulator.cs b/Items/Weapons/DraedonsArsenal/MatterModulator.cs index a12dcd2ca8..3356fa79e6 100644 --- a/Items/Weapons/DraedonsArsenal/MatterModulator.cs +++ b/Items/Weapons/DraedonsArsenal/MatterModulator.cs @@ -2,6 +2,7 @@ using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -56,6 +57,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal return false; } + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 2); + public override void AddRecipes() { ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 2); diff --git a/Items/Weapons/DraedonsArsenal/MountedScanner.cs b/Items/Weapons/DraedonsArsenal/MountedScanner.cs index 1e44b5a491..51db8b0507 100644 --- a/Items/Weapons/DraedonsArsenal/MountedScanner.cs +++ b/Items/Weapons/DraedonsArsenal/MountedScanner.cs @@ -2,6 +2,7 @@ using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -85,6 +86,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal return false; } + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 2); + public override void AddRecipes() { ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 2); diff --git a/Items/Weapons/DraedonsArsenal/Phaseslayer.cs b/Items/Weapons/DraedonsArsenal/Phaseslayer.cs index 4e2f86d9ad..ef284ea1a8 100644 --- a/Items/Weapons/DraedonsArsenal/Phaseslayer.cs +++ b/Items/Weapons/DraedonsArsenal/Phaseslayer.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -70,6 +71,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal return false; } + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 5); + public override void AddRecipes() { ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 5); diff --git a/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs b/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs index 34156ec0f1..a9033eac84 100644 --- a/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs +++ b/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs @@ -2,6 +2,7 @@ using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -96,6 +97,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal return new Vector2(-10, 0); } + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 4); + public override void AddRecipes() { ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 4); diff --git a/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs b/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs index 219a9b0513..46db30f449 100644 --- a/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs +++ b/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs @@ -4,6 +4,7 @@ using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.DraedonsArsenal; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -58,6 +59,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal return false; } + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 5); + public override void AddRecipes() { ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 5); diff --git a/Items/Weapons/DraedonsArsenal/PoleWarper.cs b/Items/Weapons/DraedonsArsenal/PoleWarper.cs index 42b394c572..6e92b2eb85 100644 --- a/Items/Weapons/DraedonsArsenal/PoleWarper.cs +++ b/Items/Weapons/DraedonsArsenal/PoleWarper.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -81,6 +82,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal return false; } + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 52); + public override void AddRecipes() { ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 5); diff --git a/Items/Weapons/DraedonsArsenal/PulseDragon.cs b/Items/Weapons/DraedonsArsenal/PulseDragon.cs index 789738bc64..81eee4591f 100644 --- a/Items/Weapons/DraedonsArsenal/PulseDragon.cs +++ b/Items/Weapons/DraedonsArsenal/PulseDragon.cs @@ -2,6 +2,7 @@ using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -59,6 +60,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal return false; } + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 4); + public override void AddRecipes() { ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 4); diff --git a/Items/Weapons/DraedonsArsenal/PulsePistol.cs b/Items/Weapons/DraedonsArsenal/PulsePistol.cs index 7d44106546..1fec36a440 100644 --- a/Items/Weapons/DraedonsArsenal/PulsePistol.cs +++ b/Items/Weapons/DraedonsArsenal/PulsePistol.cs @@ -2,6 +2,7 @@ using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -53,6 +54,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override Vector2? HoldoutOffset() => new Vector2(10f, 0f); + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 1); + public override void AddRecipes() { ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 1); diff --git a/Items/Weapons/DraedonsArsenal/PulseRifle.cs b/Items/Weapons/DraedonsArsenal/PulseRifle.cs index 8ea03df9cb..07d6eec929 100644 --- a/Items/Weapons/DraedonsArsenal/PulseRifle.cs +++ b/Items/Weapons/DraedonsArsenal/PulseRifle.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -68,6 +69,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override Vector2? HoldoutOffset() => new Vector2(-10, 0); + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 4); + public override void AddRecipes() { ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 4); diff --git a/Items/Weapons/DraedonsArsenal/PulseTurretRemote.cs b/Items/Weapons/DraedonsArsenal/PulseTurretRemote.cs index 2cdee979be..d83697b76a 100644 --- a/Items/Weapons/DraedonsArsenal/PulseTurretRemote.cs +++ b/Items/Weapons/DraedonsArsenal/PulseTurretRemote.cs @@ -2,6 +2,7 @@ using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -58,6 +59,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal return false; } + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 3); + public override void AddRecipes() { ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 3); diff --git a/Items/Weapons/DraedonsArsenal/SnakeEyes.cs b/Items/Weapons/DraedonsArsenal/SnakeEyes.cs index c7c273a56b..b29efef263 100644 --- a/Items/Weapons/DraedonsArsenal/SnakeEyes.cs +++ b/Items/Weapons/DraedonsArsenal/SnakeEyes.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Weapons.Summon; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -54,6 +55,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal return false; } + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 4); + public override void AddRecipes() { ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 4); diff --git a/Items/Weapons/DraedonsArsenal/StarSwallowerContainmentUnit.cs b/Items/Weapons/DraedonsArsenal/StarSwallowerContainmentUnit.cs index 240c6542e2..33eb8cdbef 100644 --- a/Items/Weapons/DraedonsArsenal/StarSwallowerContainmentUnit.cs +++ b/Items/Weapons/DraedonsArsenal/StarSwallowerContainmentUnit.cs @@ -2,6 +2,7 @@ using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -56,6 +57,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal return false; } + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 1); + public override void AddRecipes() { ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 1); diff --git a/Items/Weapons/DraedonsArsenal/SystemBane.cs b/Items/Weapons/DraedonsArsenal/SystemBane.cs index 7006e28b91..64991564af 100644 --- a/Items/Weapons/DraedonsArsenal/SystemBane.cs +++ b/Items/Weapons/DraedonsArsenal/SystemBane.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -59,6 +60,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal return false; } + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 3); + public override void AddRecipes() { ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 3); diff --git a/Items/Weapons/DraedonsArsenal/Taser.cs b/Items/Weapons/DraedonsArsenal/Taser.cs index d7115a06ec..cec40c61eb 100644 --- a/Items/Weapons/DraedonsArsenal/Taser.cs +++ b/Items/Weapons/DraedonsArsenal/Taser.cs @@ -1,6 +1,7 @@ using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -46,6 +47,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 1); + public override void AddRecipes() { ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 1); diff --git a/Items/Weapons/DraedonsArsenal/TeslaCannon.cs b/Items/Weapons/DraedonsArsenal/TeslaCannon.cs index 2fdef1907f..4b0ab94dee 100644 --- a/Items/Weapons/DraedonsArsenal/TeslaCannon.cs +++ b/Items/Weapons/DraedonsArsenal/TeslaCannon.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.DraedonsArsenal; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -69,6 +70,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override Vector2? HoldoutOffset() => new Vector2(-20, 0); + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 5); + public override void AddRecipes() { ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 5); diff --git a/Items/Weapons/DraedonsArsenal/TrackingDisk.cs b/Items/Weapons/DraedonsArsenal/TrackingDisk.cs index 7452b6d22d..d61410933e 100644 --- a/Items/Weapons/DraedonsArsenal/TrackingDisk.cs +++ b/Items/Weapons/DraedonsArsenal/TrackingDisk.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -59,6 +60,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal return false; } + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 1); + public override void AddRecipes() { ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 1); diff --git a/Items/Weapons/DraedonsArsenal/WavePounder.cs b/Items/Weapons/DraedonsArsenal/WavePounder.cs index 44b34d9d0d..dd5cb060aa 100644 --- a/Items/Weapons/DraedonsArsenal/WavePounder.cs +++ b/Items/Weapons/DraedonsArsenal/WavePounder.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -57,6 +58,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal return false; } + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 4); + public override void AddRecipes() { ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 4); diff --git a/Localization/CalamityLocalization.cs b/Localization/CalamityLocalization.cs index 07aca5bfa0..508fe26cb9 100644 --- a/Localization/CalamityLocalization.cs +++ b/Localization/CalamityLocalization.cs @@ -181,7 +181,7 @@ namespace CalamityMod.Localization new [] { "AprilFools2", "A boomer awaits..." }, //possible alternative to GhostBossText4 new [] { "AcidRainStart", "A toxic downpour falls over the wasteland seas!" }, - new [] { "AcidRainEnd", "The sulphuric skies begin to clear..." } + new [] { "AcidRainEnd", "The sulphuric skies begin to clear..." }, }; } From 7ddd0a5c2bc520a3412bb13462d85e5295c00b0b Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 11 Jun 2021 19:54:35 -0500 Subject: [PATCH 13/86] Lab Finding items --- Items/CalamityGlobalItem.cs | 2 +- Items/LabFinders/CyanSeekingMechanism.cs | 44 ++++++++++ Items/LabFinders/CyanSeekingMechanism.png | Bin 0 -> 426 bytes Items/LabFinders/GreenSeekingMechanism.cs | 44 ++++++++++ Items/LabFinders/GreenSeekingMechanism.png | Bin 0 -> 433 bytes Items/LabFinders/MysteriousMechanism.cs | 36 ++++++++ Items/LabFinders/MysteriousMechanism.png | Bin 0 -> 347 bytes Items/LabFinders/PurpleSeekingMechanism.cs | 44 ++++++++++ Items/LabFinders/PurpleSeekingMechanism.png | Bin 0 -> 423 bytes Items/LabFinders/RedSeekingMechanism.cs | 44 ++++++++++ Items/LabFinders/RedSeekingMechanism.png | Bin 0 -> 433 bytes Items/LabFinders/YellowSeekingMechanism.cs | 44 ++++++++++ Items/LabFinders/YellowSeekingMechanism.png | Bin 0 -> 425 bytes Projectiles/Typeless/CyanLabSeeker.cs | 53 ++++++++++++ Projectiles/Typeless/GreenLabSeeker.cs | 54 ++++++++++++ Projectiles/Typeless/PurpleLabSeeker.cs | 61 +++++++++++++ Projectiles/Typeless/RedLabSeeker.cs | 91 ++++++++++++++++++++ Projectiles/Typeless/YellowLabSeeker.cs | 53 ++++++++++++ World/CalamityWorld.cs | 39 +++++---- World/DraedonStructures.cs | 4 + World/Planets/MainPlanet.cs | 1 + 21 files changed, 598 insertions(+), 16 deletions(-) create mode 100644 Items/LabFinders/CyanSeekingMechanism.cs create mode 100644 Items/LabFinders/CyanSeekingMechanism.png create mode 100644 Items/LabFinders/GreenSeekingMechanism.cs create mode 100644 Items/LabFinders/GreenSeekingMechanism.png create mode 100644 Items/LabFinders/MysteriousMechanism.cs create mode 100644 Items/LabFinders/MysteriousMechanism.png create mode 100644 Items/LabFinders/PurpleSeekingMechanism.cs create mode 100644 Items/LabFinders/PurpleSeekingMechanism.png create mode 100644 Items/LabFinders/RedSeekingMechanism.cs create mode 100644 Items/LabFinders/RedSeekingMechanism.png create mode 100644 Items/LabFinders/YellowSeekingMechanism.cs create mode 100644 Items/LabFinders/YellowSeekingMechanism.png create mode 100644 Projectiles/Typeless/CyanLabSeeker.cs create mode 100644 Projectiles/Typeless/GreenLabSeeker.cs create mode 100644 Projectiles/Typeless/PurpleLabSeeker.cs create mode 100644 Projectiles/Typeless/RedLabSeeker.cs create mode 100644 Projectiles/Typeless/YellowLabSeeker.cs diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index f927f33194..3c92764d68 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -728,7 +728,7 @@ namespace CalamityMod.Items // If you have enough charge, decrement charge on the spot because this hook runs exactly once every time you use an item. // Mana has to be checked separately or you'll fail to use the weapon on a mana check later and still have consumed charge. - if (player.CheckMana(item)) + if (player.CheckMana(item) && item.modItem.CanUseItem(player)) Charge -= chargeNeeded; } } diff --git a/Items/LabFinders/CyanSeekingMechanism.cs b/Items/LabFinders/CyanSeekingMechanism.cs new file mode 100644 index 0000000000..76ac4b77c6 --- /dev/null +++ b/Items/LabFinders/CyanSeekingMechanism.cs @@ -0,0 +1,44 @@ +using CalamityMod.Projectiles.Typeless; +using CalamityMod.World; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.LabFinders +{ + public class CyanSeekingMechanism : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cyan Seeking Mechanism"); + Tooltip.SetDefault("Moves swiftly towards a lab deep below the desert"); + } + + public override void SetDefaults() + { + item.width = 24; + item.height = 26; + item.noUseGraphic = true; + item.useStyle = ItemUseStyleID.SwingThrow; + item.useTime = item.useAnimation = 36; + item.shoot = ModContent.ProjectileType(); + item.Calamity().MaxCharge = 100; + item.Calamity().ChargePerUse = 15; + item.Calamity().UsesCharge = true; + item.Calamity().customRarity = CalamityRarity.DraedonRust; + } + + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0 && CalamityWorld.SunkenSeaLabCenter != Vector2.Zero; + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ItemID.WaterBucket); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/LabFinders/CyanSeekingMechanism.png b/Items/LabFinders/CyanSeekingMechanism.png new file mode 100644 index 0000000000000000000000000000000000000000..edd68f889ecef2ba157c42e924be9ee4f9a21ce6 GIT binary patch literal 426 zcmeAS@N?(olHy`uVBq!ia0vp^QXtI11|(N{`J4k%jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBufiR<}hF1engT1GVV~B@$@}K|z?U^+l9`Z9s9A*|{bKAf$ zv4PX;vJ8)X_lZ8`O5acec{aX#`+CjKvE^TA43g$>7ky&TV6ZXa!K03e69u!EJYBZD zIWsrb*MOJ#w3<)jrU1sOIT!D{8_d74az(>WgMt_5WDROxei1a7D?F27S>mI6>)s_q zd3rMX96qo_(wOapy93WR&t=oKJCb%(y|$atwo`&F%?GIR_T|q9zc`0=G+%UfxPMd9 z=kOyTvGy->b*T>gO9WOXLqQ=-BhdoMd2rp~`Y*`HPi;Yzd!scztaAF39tsYxm3B zWzCrq46~ZAsv8(o)UYt`@G5n(YivCDTv=kqH&^yGirvq-0__?Zt$ubiGBR)+uktUm SXYU1uFN3G6pUXO@geCxUMX0_2 literal 0 HcmV?d00001 diff --git a/Items/LabFinders/GreenSeekingMechanism.cs b/Items/LabFinders/GreenSeekingMechanism.cs new file mode 100644 index 0000000000..da3188e614 --- /dev/null +++ b/Items/LabFinders/GreenSeekingMechanism.cs @@ -0,0 +1,44 @@ +using CalamityMod.Projectiles.Typeless; +using CalamityMod.World; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.LabFinders +{ + public class GreenSeekingMechanism : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Green Seeking Mechanism"); + Tooltip.SetDefault("Moves swiftly towards a lab within the jungle"); + } + + public override void SetDefaults() + { + item.width = 24; + item.height = 26; + item.noUseGraphic = true; + item.useStyle = ItemUseStyleID.SwingThrow; + item.useTime = item.useAnimation = 36; + item.shoot = ModContent.ProjectileType(); + item.Calamity().MaxCharge = 100; + item.Calamity().ChargePerUse = 15; + item.Calamity().UsesCharge = true; + item.Calamity().customRarity = CalamityRarity.DraedonRust; + } + + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0 && CalamityWorld.JungleLabCenter != Vector2.Zero; + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ItemID.Vine, 3); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/LabFinders/GreenSeekingMechanism.png b/Items/LabFinders/GreenSeekingMechanism.png new file mode 100644 index 0000000000000000000000000000000000000000..0b1ff1cb190e4ff52a0f77d5f4125bb0f252ca7a GIT binary patch literal 433 zcmV;i0Z#sjP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!2kdb!2!6DYwZ940Y*tgK~zXfWBmXB zKLbg?Q30Z1{{u!aO(bA~(liId&mywp$o>f{mA474fb z0H$H$-mdOoT1iO(OvAvvdk?_$mR&o*KBJqDSYSTM^l}9YT)lN4Ov79Z1IJFD0n-O% zeuHU7sPyOicfs^UD6Q}845oekJ;AiSsw&ug`o$3tqr^>+g9(_1f!z<^Ls_U`>+YRk z8dqxEym332hWU8lQ=PV&BAAAi05D)>j_PAr+@bpb24MMV;7SGXBjfq}u}BN#xBGZ-M`6BrnLK7xT$T9A^&>>9XKAsW!h bM+^)A{kVt&g~*pK00000NkvXXu0mjfh?}v9 literal 0 HcmV?d00001 diff --git a/Items/LabFinders/MysteriousMechanism.cs b/Items/LabFinders/MysteriousMechanism.cs new file mode 100644 index 0000000000..51dd30ac8d --- /dev/null +++ b/Items/LabFinders/MysteriousMechanism.cs @@ -0,0 +1,36 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Typeless; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.LabFinders +{ + public class MysteriousMechanism : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Mysterious Mechanism"); + Tooltip.SetDefault("Used as a base for specialized homing technology"); + } + + public override void SetDefaults() + { + item.width = 24; + item.height = 26; + item.Calamity().customRarity = CalamityRarity.DraedonRust; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 4); + recipe.AddIngredient(ModContent.ItemType(), 4); + recipe.AddIngredient(ItemID.IronBar, 10); + recipe.anyIronBar = true; + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/LabFinders/MysteriousMechanism.png b/Items/LabFinders/MysteriousMechanism.png new file mode 100644 index 0000000000000000000000000000000000000000..7f12c1775f2a9a14339664c56eee2de4e7e4c3d4 GIT binary patch literal 347 zcmV-h0i^zkP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0PsmfK~zXfWBmXB zKLd#XrhySk69t%{G|d6g7TK$+{s&GTmWzp|w z0I#Allm!7>cI^QBlzu(}Vz5tOF24EfEtrM@^i*bLZUSXt2ggpH0n=A6UkB3{_wEJL z^!E|Dz)nR4%EAu@Up|7l{Lq~{U>Y3&%^6}P1I$O-YKma`>aF`=8s@{H<0BZrRdNvW t2@DKAA0Yvl2BLfd19bDzaI=Vk0RY23Upd*lnM(iw002ovPDHLkV1iMHi~j%s literal 0 HcmV?d00001 diff --git a/Items/LabFinders/PurpleSeekingMechanism.cs b/Items/LabFinders/PurpleSeekingMechanism.cs new file mode 100644 index 0000000000..28e08b4a5b --- /dev/null +++ b/Items/LabFinders/PurpleSeekingMechanism.cs @@ -0,0 +1,44 @@ +using CalamityMod.Projectiles.Typeless; +using CalamityMod.World; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.LabFinders +{ + public class PurpleSeekingMechanism : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Purple Seeking Mechanism"); + Tooltip.SetDefault("Moves swiftly towards a lab within the sky"); + } + + public override void SetDefaults() + { + item.width = 24; + item.height = 26; + item.noUseGraphic = true; + item.useStyle = ItemUseStyleID.SwingThrow; + item.useTime = item.useAnimation = 36; + item.shoot = ModContent.ProjectileType(); + item.Calamity().MaxCharge = 100; + item.Calamity().ChargePerUse = 15; + item.Calamity().UsesCharge = true; + item.Calamity().customRarity = CalamityRarity.DraedonRust; + } + + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0 && CalamityWorld.PlanetoidLabCenter != Vector2.Zero; + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ItemID.Cloud, 20); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/LabFinders/PurpleSeekingMechanism.png b/Items/LabFinders/PurpleSeekingMechanism.png new file mode 100644 index 0000000000000000000000000000000000000000..aaf94eb5f17385709d1bedf279ec1f65111bd411 GIT binary patch literal 423 zcmeAS@N?(olHy`uVBq!ia0vp^QXtI11|(N{`J4k%jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc4K|)Gjv*f2$$$R;w`bOTFhz_xqWPvNo7)D4 zi4B}ymt}bDyHE5jzI1<8f*p^{o?7YrIlOW52M?TCDSS|By6+68XZ&&UhDJt7Uz75x ztY%!hc9rF_0mElOD~Ioje`{Gjch2qNn!(T9{_YOr<>`L%jF&AZawbTry?gtLZ`sr- zA_q)(d}bLYH`K5kNtmBfwX;d1ZT0qd&6zX06BCY2;Y_$ykYzW+Y(HP2K^4afYwPCB zh?ql8@7@kspZb0E;y(N}t1gEHvt0fa zcP~MTZOxg$+L|{{Bn^7sF-tT&UEZiInZU5OrQxTDt?3~KAGz?E<{#{u7-I^}Yj5Wn z@G?6TZ}`Q+#@64Tz!1LD?}WO6!H*gi=6p$!15z!Lasp3(); + item.Calamity().MaxCharge = 100; + item.Calamity().ChargePerUse = 15; + item.Calamity().UsesCharge = true; + item.Calamity().customRarity = CalamityRarity.DraedonRust; + } + + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0 && CalamityWorld.HellLabCenter != Vector2.Zero; + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ItemID.HellstoneBar, 4); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/LabFinders/RedSeekingMechanism.png b/Items/LabFinders/RedSeekingMechanism.png new file mode 100644 index 0000000000000000000000000000000000000000..0b1ff1cb190e4ff52a0f77d5f4125bb0f252ca7a GIT binary patch literal 433 zcmV;i0Z#sjP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!2kdb!2!6DYwZ940Y*tgK~zXfWBmXB zKLbg?Q30Z1{{u!aO(bA~(liId&mywp$o>f{mA474fb z0H$H$-mdOoT1iO(OvAvvdk?_$mR&o*KBJqDSYSTM^l}9YT)lN4Ov79Z1IJFD0n-O% zeuHU7sPyOicfs^UD6Q}845oekJ;AiSsw&ug`o$3tqr^>+g9(_1f!z<^Ls_U`>+YRk z8dqxEym332hWU8lQ=PV&BAAAi05D)>j_PAr+@bpb24MMV;7SGXBjfq}u}BN#xBGZ-M`6BrnLK7xT$T9A^&>>9XKAsW!h bM+^)A{kVt&g~*pK00000NkvXXu0mjfh?}v9 literal 0 HcmV?d00001 diff --git a/Items/LabFinders/YellowSeekingMechanism.cs b/Items/LabFinders/YellowSeekingMechanism.cs new file mode 100644 index 0000000000..a54448c777 --- /dev/null +++ b/Items/LabFinders/YellowSeekingMechanism.cs @@ -0,0 +1,44 @@ +using CalamityMod.Projectiles.Typeless; +using CalamityMod.World; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.LabFinders +{ + public class YellowSeekingMechanism : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Yellow Seeking Mechanism"); + Tooltip.SetDefault("Moves swiftly towards a lab within the frozen caverns"); + } + + public override void SetDefaults() + { + item.width = 24; + item.height = 26; + item.noUseGraphic = true; + item.useStyle = ItemUseStyleID.SwingThrow; + item.useTime = item.useAnimation = 36; + item.shoot = ModContent.ProjectileType(); + item.Calamity().MaxCharge = 100; + item.Calamity().ChargePerUse = 15; + item.Calamity().UsesCharge = true; + item.Calamity().customRarity = CalamityRarity.DraedonRust; + } + + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0 && CalamityWorld.IceLabCenter != Vector2.Zero; + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ItemID.IceBlock, 50); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/LabFinders/YellowSeekingMechanism.png b/Items/LabFinders/YellowSeekingMechanism.png new file mode 100644 index 0000000000000000000000000000000000000000..d0d0dfe69c41780b5acdbf11d193d064c78ccbb7 GIT binary patch literal 425 zcmeAS@N?(olHy`uVBq!ia0vp^QXtI11|(N{`J4k%jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBufiR<}hF1engPo^~V~B@$@}K|z?U^+n=r%J&G#eadcH6)( zv4PX;vJ8)X_lds63ZY>J@@#zf_Vt>dW6QtL7$nW%F8aiv!C+&;gGU_`CkkdSdAe+Q zb7pR=uK_RfX*Hk5O#zHmb1vR@H<*88<%))%1_dw9$r{wY{32*DS9m7FvcyOC*1b!J z^7Lf%IecJ=q%qqGcL$ztp3A0dcO>nodTlqOZKniVnh#K=^QPYiw{SdmHt3aO`gQJH zf|S_w4HirG_b2Fa7a1^KHrVj{VYLRgXwKce!ak3^dS{#Gv0tA5{yytv=J~I-TopOE zW#4r38EuT(#Ub+Y)|G5Ni+?k)CH%~M;Ke54ps$!<=jz{Uz%coEXczyU{se~bJHGd~ zN&6gTxFEB}uCejpV`Yg0p{s;Haq{rk$scSuB=6z*sev_Sl>qOHC(3MW3}L2~xzPvz RhXR9_!PC{xWt~$(698uup@ske literal 0 HcmV?d00001 diff --git a/Projectiles/Typeless/CyanLabSeeker.cs b/Projectiles/Typeless/CyanLabSeeker.cs new file mode 100644 index 0000000000..3084ac683c --- /dev/null +++ b/Projectiles/Typeless/CyanLabSeeker.cs @@ -0,0 +1,53 @@ +using CalamityMod.World; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class CyanLabSeeker : ModProjectile + { + public ref float Time => ref projectile.ai[0]; + public override string Texture => "CalamityMod/Items/LabFinders/CyanSeekingMechanism"; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Seeking Mechanism"); + ProjectileID.Sets.TrailingMode[projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 20; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 24; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.timeLeft = 300; + } + + public override void AI() => RedLabSeeker.Behavior(projectile, CalamityWorld.SunkenSeaLabCenter, Color.Cyan, ref Time); + + public override void Kill(int timeLeft) + { + for (int i = 0; i < 8; i++) + { + Dust dust = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Circular(16f, 16f), 267); + dust.color = Color.Cyan; + dust.scale = Main.rand.NextFloat(0.95f, 1.25f); + dust.velocity = Main.rand.NextVector2Circular(2.5f, 2.5f); + dust.velocity.Y -= 1.5f; + dust.fadeIn = 1.2f; + dust.noGravity = true; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityUtils.DrawAfterimagesCentered(projectile, 1, lightColor, 3); + return false; + } + } +} diff --git a/Projectiles/Typeless/GreenLabSeeker.cs b/Projectiles/Typeless/GreenLabSeeker.cs new file mode 100644 index 0000000000..9909d3452f --- /dev/null +++ b/Projectiles/Typeless/GreenLabSeeker.cs @@ -0,0 +1,54 @@ +using CalamityMod.World; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class GreenLabSeeker : ModProjectile + { + public ref float Time => ref projectile.ai[0]; + public override string Texture => "CalamityMod/Items/LabFinders/GreenSeekingMechanism"; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Seeking Mechanism"); + ProjectileID.Sets.TrailingMode[projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 20; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 24; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.timeLeft = 300; + } + + + public override void AI() => RedLabSeeker.Behavior(projectile, CalamityWorld.JungleLabCenter, Color.Green, ref Time); + + public override void Kill(int timeLeft) + { + for (int i = 0; i < 8; i++) + { + Dust dust = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Circular(16f, 16f), 267); + dust.color = Color.Green; + dust.scale = Main.rand.NextFloat(0.95f, 1.25f); + dust.velocity = Main.rand.NextVector2Circular(2.5f, 2.5f); + dust.velocity.Y -= 1.5f; + dust.fadeIn = 1.2f; + dust.noGravity = true; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityUtils.DrawAfterimagesCentered(projectile, 1, lightColor, 3); + return false; + } + } +} diff --git a/Projectiles/Typeless/PurpleLabSeeker.cs b/Projectiles/Typeless/PurpleLabSeeker.cs new file mode 100644 index 0000000000..6f0b1b0a43 --- /dev/null +++ b/Projectiles/Typeless/PurpleLabSeeker.cs @@ -0,0 +1,61 @@ +using CalamityMod.World; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class PurpleLabSeeker : ModProjectile + { + public ref float Time => ref projectile.ai[0]; + public override string Texture => "CalamityMod/Items/LabFinders/PurpleSeekingMechanism"; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Seeking Mechanism"); + ProjectileID.Sets.TrailingMode[projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 20; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 24; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.timeLeft = 300; + } + + public override void AI() => RedLabSeeker.Behavior(projectile, CalamityWorld.PlanetoidLabCenter, Color.Magenta, ref Time); + + public override void Kill(int timeLeft) + { + for (int i = 0; i < 8; i++) + { + Dust dust = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Circular(16f, 16f), 267); + dust.color = Color.Magenta; + dust.scale = Main.rand.NextFloat(0.95f, 1.25f); + dust.velocity = Main.rand.NextVector2Circular(2.5f, 2.5f); + dust.velocity.Y -= 1.5f; + dust.fadeIn = 1.2f; + dust.noGravity = true; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture = Main.projectileTexture[projectile.type]; + if (Time > 80f) + { + for (int i = 0; i < 24; i += 2) + { + Vector2 drawPosition = projectile.Center - projectile.velocity.SafeNormalize(Vector2.Zero) * i * Utils.InverseLerp(80f, 125f, Time, true) * 25f - Main.screenPosition; + spriteBatch.Draw(texture, drawPosition, null, projectile.GetAlpha(lightColor) * (1f - i / 24f), projectile.rotation, texture.Size() * 0.5f, projectile.scale, SpriteEffects.None, 0f); + } + } + return true; + } + } +} diff --git a/Projectiles/Typeless/RedLabSeeker.cs b/Projectiles/Typeless/RedLabSeeker.cs new file mode 100644 index 0000000000..2c8d331efd --- /dev/null +++ b/Projectiles/Typeless/RedLabSeeker.cs @@ -0,0 +1,91 @@ +using CalamityMod.World; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class RedLabSeeker : ModProjectile + { + public ref float Time => ref projectile.ai[0]; + public override string Texture => "CalamityMod/Items/LabFinders/RedSeekingMechanism"; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Seeking Mechanism"); + ProjectileID.Sets.TrailingMode[projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 20; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 24; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.timeLeft = 300; + } + + public static void Behavior(Projectile projectile, Vector2 destination, Color dustColor, ref float time) + { + if (time < 45f) + projectile.velocity = Vector2.UnitY * Utils.InverseLerp(0f, 25f, time, true) * Utils.InverseLerp(30f, 25f, time, true) * -4.5f; + else if (time < 80f) + projectile.rotation = (projectile.AngleTo(destination) + MathHelper.PiOver2) * Utils.InverseLerp(45f, 70f, time, true); + else + { + if (projectile.WithinRange(destination, 420f)) + { + projectile.velocity = Vector2.Lerp(projectile.velocity, Vector2.UnitY * (float)Math.Sin((time - 80f) / 24f) * 2.5f, 0.15f); + projectile.rotation *= 0.95f; + projectile.Center = Vector2.Lerp(projectile.Center, destination, 0.1f); + } + // Release lingering dust. + else + { + Dust dust = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Circular(8f, 8f), 267); + dust.velocity = Main.rand.NextVector2Circular(2f, 2f); + dust.noGravity = true; + dust.color = dustColor; + dust.scale = 1.6f; + dust.fadeIn = 1.45f; + } + } + + if (time > 80f && time < 120f) + projectile.velocity = (projectile.rotation - MathHelper.PiOver2).ToRotationVector2() * Utils.InverseLerp(80f, 105f, time, true) * 25f; + + // Reset afterimages before the charge. + if (time < 80f) + projectile.oldPos = new Vector2[projectile.oldPos.Length]; + + Lighting.AddLight(projectile.Center, Vector3.One * 0.8f); + time++; + } + + public override void AI() => Behavior(projectile, CalamityWorld.HellLabCenter, Color.Red, ref Time); + + public override void Kill(int timeLeft) + { + for (int i = 0; i < 8; i++) + { + Dust dust = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Circular(16f, 16f), 267); + dust.color = Color.Red; + dust.scale = Main.rand.NextFloat(0.95f, 1.25f); + dust.velocity = Main.rand.NextVector2Circular(2.5f, 2.5f); + dust.velocity.Y -= 1.5f; + dust.fadeIn = 1.2f; + dust.noGravity = true; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityUtils.DrawAfterimagesCentered(projectile, 1, lightColor, 3); + return false; + } + } +} diff --git a/Projectiles/Typeless/YellowLabSeeker.cs b/Projectiles/Typeless/YellowLabSeeker.cs new file mode 100644 index 0000000000..82bf8fa0d6 --- /dev/null +++ b/Projectiles/Typeless/YellowLabSeeker.cs @@ -0,0 +1,53 @@ +using CalamityMod.World; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class YellowLabSeeker : ModProjectile + { + public ref float Time => ref projectile.ai[0]; + public override string Texture => "CalamityMod/Items/LabFinders/YellowSeekingMechanism"; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Seeking Mechanism"); + ProjectileID.Sets.TrailingMode[projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 20; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 24; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.timeLeft = 300; + } + + public override void AI() => RedLabSeeker.Behavior(projectile, CalamityWorld.IceLabCenter, Color.Yellow, ref Time); + + public override void Kill(int timeLeft) + { + for (int i = 0; i < 8; i++) + { + Dust dust = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Circular(16f, 16f), 267); + dust.color = Color.Yellow; + dust.scale = Main.rand.NextFloat(0.95f, 1.25f); + dust.velocity = Main.rand.NextVector2Circular(2.5f, 2.5f); + dust.velocity.Y -= 1.5f; + dust.fadeIn = 1.2f; + dust.noGravity = true; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityUtils.DrawAfterimagesCentered(projectile, 1, lightColor, 3); + return false; + } + } +} diff --git a/World/CalamityWorld.cs b/World/CalamityWorld.cs index da4c3eb0ec..b3a64eecde 100644 --- a/World/CalamityWorld.cs +++ b/World/CalamityWorld.cs @@ -161,6 +161,13 @@ namespace CalamityMod.World public static Vector2 DraedonSummonPosition = Vector2.Zero; public const int DraedonSummonCountdownMax = 450; + // Draedon Lab Locations. + public static Vector2 SunkenSeaLabCenter; + public static Vector2 PlanetoidLabCenter; + public static Vector2 JungleLabCenter; + public static Vector2 HellLabCenter; + public static Vector2 IceLabCenter; + #region Downed Bools public static bool downedDesertScourge = false; public static bool downedCrabulon = false; @@ -471,21 +478,17 @@ namespace CalamityMod.World return new TagCompound { - { - "downed", downed - }, - { - "abyssChasmBottom", abyssChasmBottom - }, - { - "acidRainPoints", acidRainPoints - }, - { - "Reforges", Reforges - }, - { - "MoneyStolenByBandit", MoneyStolenByBandit - } + ["downed"] = downed, + ["abyssChasmBottom"] = abyssChasmBottom, + ["acidRainPoints"] = acidRainPoints, + ["Reforges"] = Reforges, + ["MoneyStolenByBandit"] = MoneyStolenByBandit, + + ["SunkenSeaLabCenter"] = SunkenSeaLabCenter, + ["PlanetoidLabCenter"] = PlanetoidLabCenter, + ["JungleLabCenter"] = JungleLabCenter, + ["HellLabCenter"] = HellLabCenter, + ["IceLabCenter"] = IceLabCenter, }; } #endregion @@ -581,6 +584,12 @@ namespace CalamityMod.World acidRainPoints = tag.GetInt("acidRainPoints"); Reforges = tag.GetInt("Reforges"); MoneyStolenByBandit = tag.GetInt("MoneyStolenByBandit"); + + SunkenSeaLabCenter = tag.Get("SunkenSeaLabCenter"); + PlanetoidLabCenter = tag.Get("PlanetoidLabCenter"); + JungleLabCenter = tag.Get("JungleLabCenter"); + HellLabCenter = tag.Get("HellLabCenter"); + IceLabCenter = tag.Get("IceLabCenter"); } #endregion diff --git a/World/DraedonStructures.cs b/World/DraedonStructures.cs index 00ecb4d969..2f166f916f 100644 --- a/World/DraedonStructures.cs +++ b/World/DraedonStructures.cs @@ -273,6 +273,7 @@ namespace CalamityMod.World { bool hasPlacedMurasama = false; PlaceSchematic(mapKey, new Point(placementPoint.X, placementPoint.Y), SchematicAnchor.TopLeft, ref hasPlacedMurasama, new Action(FillHellLaboratoryChest)); + CalamityWorld.HellLabCenter = placementPoint.ToWorldCoordinates() + new Vector2(TileMaps[mapKey].GetLength(0), TileMaps[mapKey].GetLength(1)) * 8f; break; } } @@ -345,6 +346,7 @@ namespace CalamityMod.World bool hasPlacedLogAndSchematic = false; PlaceSchematic(mapKey, new Point(placementPoint.X, placementPoint.Y), SchematicAnchor.TopLeft, ref hasPlacedLogAndSchematic, new Action(FillSunkenSeaLaboratoryChest)); + CalamityWorld.SunkenSeaLabCenter = placementPoint.ToWorldCoordinates() + new Vector2(TileMaps[mapKey].GetLength(0), TileMaps[mapKey].GetLength(1)) * 8f; } #endregion @@ -424,6 +426,7 @@ namespace CalamityMod.World { bool hasPlacedLogAndSchematic = false; PlaceSchematic(mapKey, new Point(placementPoint.X, placementPoint.Y), SchematicAnchor.TopLeft, ref hasPlacedLogAndSchematic, new Action(FillIceLaboratoryChest)); + CalamityWorld.IceLabCenter = placementPoint.ToWorldCoordinates() + new Vector2(TileMaps[mapKey].GetLength(0), TileMaps[mapKey].GetLength(1)) * 8f; break; } } @@ -503,6 +506,7 @@ namespace CalamityMod.World { bool hasPlacedLogAndSchematic = false; PlaceSchematic(mapKey, new Point(placementPoint.X, placementPoint.Y), SchematicAnchor.TopLeft, ref hasPlacedLogAndSchematic, new Action(FillPlagueLaboratoryChest)); + CalamityWorld.JungleLabCenter = placementPoint.ToWorldCoordinates() + new Vector2(TileMaps[mapKey].GetLength(0), TileMaps[mapKey].GetLength(1)) * 8f; break; } } diff --git a/World/Planets/MainPlanet.cs b/World/Planets/MainPlanet.cs index f2ec4f0f5e..2b82e2d855 100644 --- a/World/Planets/MainPlanet.cs +++ b/World/Planets/MainPlanet.cs @@ -109,6 +109,7 @@ namespace CalamityMod.World.Planets // TODO -- This should probably use PlacementAnchor.Center and just provide the center of the planetoid... bool hasPlacedLogAndSchematic = false; SchematicManager.PlaceSchematic("Planetoid Laboratory", new Point(origin.X - 33, origin.Y - 17), SchematicAnchor.TopLeft, ref hasPlacedLogAndSchematic, new Action(DraedonStructures.FillPlanetoidLaboratoryChest)); + CalamityWorld.PlanetoidLabCenter = origin.ToWorldCoordinates(); //PLACE BREAKABLE GRASS AND TREES WorldUtils.Gen(origin, new ModShapes.OuterOutline(mainShape, true, true), Actions.Chain(new GenAction[] From 1830594ce9f8f9c8cc3c205f4e7ea6056bafdb0f Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 11 Jun 2021 19:55:20 -0500 Subject: [PATCH 14/86] Afterimage fix --- Projectiles/Typeless/CyanLabSeeker.cs | 12 ++++++++++-- Projectiles/Typeless/GreenLabSeeker.cs | 12 ++++++++++-- Projectiles/Typeless/RedLabSeeker.cs | 12 ++++++++++-- Projectiles/Typeless/YellowLabSeeker.cs | 12 ++++++++++-- 4 files changed, 40 insertions(+), 8 deletions(-) diff --git a/Projectiles/Typeless/CyanLabSeeker.cs b/Projectiles/Typeless/CyanLabSeeker.cs index 3084ac683c..bd33008fc6 100644 --- a/Projectiles/Typeless/CyanLabSeeker.cs +++ b/Projectiles/Typeless/CyanLabSeeker.cs @@ -46,8 +46,16 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(projectile, 1, lightColor, 3); - return false; + Texture2D texture = Main.projectileTexture[projectile.type]; + if (Time > 80f) + { + for (int i = 0; i < 24; i += 2) + { + Vector2 drawPosition = projectile.Center - projectile.velocity.SafeNormalize(Vector2.Zero) * i * Utils.InverseLerp(80f, 125f, Time, true) * 25f - Main.screenPosition; + spriteBatch.Draw(texture, drawPosition, null, projectile.GetAlpha(lightColor) * (1f - i / 24f), projectile.rotation, texture.Size() * 0.5f, projectile.scale, SpriteEffects.None, 0f); + } + } + return true; } } } diff --git a/Projectiles/Typeless/GreenLabSeeker.cs b/Projectiles/Typeless/GreenLabSeeker.cs index 9909d3452f..b64810bfd2 100644 --- a/Projectiles/Typeless/GreenLabSeeker.cs +++ b/Projectiles/Typeless/GreenLabSeeker.cs @@ -47,8 +47,16 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(projectile, 1, lightColor, 3); - return false; + Texture2D texture = Main.projectileTexture[projectile.type]; + if (Time > 80f) + { + for (int i = 0; i < 24; i += 2) + { + Vector2 drawPosition = projectile.Center - projectile.velocity.SafeNormalize(Vector2.Zero) * i * Utils.InverseLerp(80f, 125f, Time, true) * 25f - Main.screenPosition; + spriteBatch.Draw(texture, drawPosition, null, projectile.GetAlpha(lightColor) * (1f - i / 24f), projectile.rotation, texture.Size() * 0.5f, projectile.scale, SpriteEffects.None, 0f); + } + } + return true; } } } diff --git a/Projectiles/Typeless/RedLabSeeker.cs b/Projectiles/Typeless/RedLabSeeker.cs index 2c8d331efd..da6c4d8711 100644 --- a/Projectiles/Typeless/RedLabSeeker.cs +++ b/Projectiles/Typeless/RedLabSeeker.cs @@ -84,8 +84,16 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(projectile, 1, lightColor, 3); - return false; + Texture2D texture = Main.projectileTexture[projectile.type]; + if (Time > 80f) + { + for (int i = 0; i < 24; i += 2) + { + Vector2 drawPosition = projectile.Center - projectile.velocity.SafeNormalize(Vector2.Zero) * i * Utils.InverseLerp(80f, 125f, Time, true) * 25f - Main.screenPosition; + spriteBatch.Draw(texture, drawPosition, null, projectile.GetAlpha(lightColor) * (1f - i / 24f), projectile.rotation, texture.Size() * 0.5f, projectile.scale, SpriteEffects.None, 0f); + } + } + return true; } } } diff --git a/Projectiles/Typeless/YellowLabSeeker.cs b/Projectiles/Typeless/YellowLabSeeker.cs index 82bf8fa0d6..231521a5c6 100644 --- a/Projectiles/Typeless/YellowLabSeeker.cs +++ b/Projectiles/Typeless/YellowLabSeeker.cs @@ -46,8 +46,16 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(projectile, 1, lightColor, 3); - return false; + Texture2D texture = Main.projectileTexture[projectile.type]; + if (Time > 80f) + { + for (int i = 0; i < 24; i += 2) + { + Vector2 drawPosition = projectile.Center - projectile.velocity.SafeNormalize(Vector2.Zero) * i * Utils.InverseLerp(80f, 125f, Time, true) * 25f - Main.screenPosition; + spriteBatch.Draw(texture, drawPosition, null, projectile.GetAlpha(lightColor) * (1f - i / 24f), projectile.rotation, texture.Size() * 0.5f, projectile.scale, SpriteEffects.None, 0f); + } + } + return true; } } } From 93aa36d69991e48bfb293cdcf9d254c9db6cece1 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 12 Jun 2021 04:51:06 -0500 Subject: [PATCH 15/86] The Codebreaker emits light --- Tiles/DraedonSummoner/CodebreakerTile.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Tiles/DraedonSummoner/CodebreakerTile.cs b/Tiles/DraedonSummoner/CodebreakerTile.cs index c3e3eaf5af..fd8110a6d7 100644 --- a/Tiles/DraedonSummoner/CodebreakerTile.cs +++ b/Tiles/DraedonSummoner/CodebreakerTile.cs @@ -63,7 +63,14 @@ namespace CalamityMod.Tiles.DraedonSummoner return true; } - public override bool CreateDust(int i, int j, ref int type) + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + r = 0.18f; + g = 0.8f; + b = 0.9f; + } + + public override bool CreateDust(int i, int j, ref int type) { Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 182); return false; From 1e1ae0229cfd1b6ba99c0e017a74ca303506289b Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 18 Jun 2021 13:36:41 -0500 Subject: [PATCH 16/86] Very rough base for Draedon summoning --- Localization/CalamityLocalization.cs | 6 +- NPCs/ExoMechs/Draedon.cs | 109 +++++++++++++++++++++++++ NPCs/ExoMechs/Draedon.png | Bin 0 -> 2820 bytes Projectiles/Boss/DraedonSummonLaser.cs | 10 ++- World/CalamityWorld.cs | 6 +- 5 files changed, 124 insertions(+), 7 deletions(-) create mode 100644 NPCs/ExoMechs/Draedon.cs create mode 100644 NPCs/ExoMechs/Draedon.png diff --git a/Localization/CalamityLocalization.cs b/Localization/CalamityLocalization.cs index 508fe26cb9..34ef94e6e9 100644 --- a/Localization/CalamityLocalization.cs +++ b/Localization/CalamityLocalization.cs @@ -117,7 +117,11 @@ namespace CalamityMod.Localization new [] { "CryogenBossText", "Cryogen is derping out!" }, - new [] { "HardmodeOreTier1Text", "Your world has been blessed with Cobalt and Palladium!" }, + new [] { "DraedonIntroductionText1", "Something seems... very off." }, + new [] { "DraedonIntroductionText2", "Well, whatever." }, + new [] { "DraedonIntroductionText3", "Here's your exo mechs lol" }, + + new [] { "HardmodeOreTier1Text", "Your world has been blessed with Cobalt and Palladium!" }, new [] { "HardmodeOreTier2Text", "Your world has been blessed with Mythril and Orichalcum!" }, new [] { "HardmodeOreTier3Text", "Your world has been blessed with Adamantite and Titanium!" }, new [] { "HardmodeOreTier4Text", "The hallow has been blessed with consecrated stone!" }, diff --git a/NPCs/ExoMechs/Draedon.cs b/NPCs/ExoMechs/Draedon.cs new file mode 100644 index 0000000000..eb581a0c7a --- /dev/null +++ b/NPCs/ExoMechs/Draedon.cs @@ -0,0 +1,109 @@ +using CalamityMod.NPCs.ExoMechs.Thanatos; +using Microsoft.Xna.Framework; +using System.IO; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.NPCs.ExoMechs +{ + public class Draedon : ModNPC + { + public Player PlayerToFollow => Main.player[npc.target]; + public ref float TalkTimer => ref npc.ai[0]; + public static readonly Color TextColor = new Color(155, 255, 255); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Draedon"); + Main.npcFrameCount[npc.type] = 12; + } + + public override void SetDefaults() + { + npc.damage = 0; + npc.width = npc.height = 34; + npc.defense = 9999; + npc.lifeMax = 50; + npc.friendly = true; + npc.dontTakeDamage = true; + npc.aiStyle = aiType = -1; + npc.knockBackResist = 0f; + } + + public override void AI() + { + if (Main.netMode != NetmodeID.MultiplayerClient && TalkTimer == 90f) + { + CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.DraedonIntroductionText1", TextColor); + npc.TargetClosest(false); + npc.netUpdate = true; + } + + if (Main.netMode != NetmodeID.MultiplayerClient && TalkTimer == 250f) + { + CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.DraedonIntroductionText2", TextColor); + npc.netUpdate = true; + } + + if (Main.netMode != NetmodeID.MultiplayerClient && TalkTimer == 330f) + { + CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.DraedonIntroductionText3", TextColor); + npc.netUpdate = true; + } + + npc.velocity = Vector2.UnitY * Utils.InverseLerp(0f, 50f, TalkTimer, true) * Utils.InverseLerp(65f, 50f, TalkTimer, true) * -4.5f; + + // Make the screen rumble and summon the exo mechs. + if (TalkTimer < 435f) + { + Main.LocalPlayer.Calamity().GeneralScreenShakePower = Utils.InverseLerp(4200f, 1400f, Main.LocalPlayer.Distance(PlayerToFollow.Center), true) * 18f; + Main.LocalPlayer.Calamity().GeneralScreenShakePower *= Utils.InverseLerp(335f, 425f, TalkTimer, true); + } + + if (TalkTimer == 430f) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + SummonExoMechs(); + + if (Main.netMode != NetmodeID.Server) + { + var sound = Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/FlareSound"), PlayerToFollow.Center); + sound.Volume = MathHelper.Clamp(sound.Volume * 1.55f, 0f, 1f); + } + } + + TalkTimer++; + } + + public void SummonExoMechs() + { + // Spawn Thanatos underground. + Vector2 thanatosSpawnPosition = PlayerToFollow.Center + Vector2.UnitY * 2100f; + NPC thanatos = CalamityUtils.SpawnBossBetter(thanatosSpawnPosition, ModContent.NPCType()); + if (thanatos != null) + thanatos.velocity = thanatos.SafeDirectionTo(PlayerToFollow.Center) * 40f; + + // Spawn Ares in the sky, directly above the player. + Vector2 aresSpawnPosition = PlayerToFollow.Center - Vector2.UnitY * 1400f; + // CalamityUtils.SpawnBossBetter(thanatosSpawnPosition, ModContent.NPCType()); + + // And summon Apollo and Artemis above the player to their sides. + Vector2 apolloSpawnPosition = PlayerToFollow.Center + new Vector2(-1100f, -1600f); + // CalamityUtils.SpawnBossBetter(thanatosSpawnPosition, ModContent.NPCType()); + Vector2 artemisSpawnPosition = PlayerToFollow.Center + new Vector2(1100f, -1600f); + // CalamityUtils.SpawnBossBetter(thanatosSpawnPosition, ModContent.NPCType()); + } + + public override void FindFrame(int frameHeight) + { + npc.frameCounter++; + if (npc.frameCounter > 5) + { + npc.frameCounter = 0f; + npc.frame.Y += frameHeight; + if (npc.frame.Y >= frameHeight * 6) + npc.frame.Y = 0; + } + } + } +} diff --git a/NPCs/ExoMechs/Draedon.png b/NPCs/ExoMechs/Draedon.png new file mode 100644 index 0000000000000000000000000000000000000000..b73d19e5a40223fb8d77d9db6b73f68361f71bb5 GIT binary patch literal 2820 zcmeHJiC0rs8hof;0)jvgVg{{M5iJs|h^!66Jm_i9%)cdT0AauH<1nLAh7Z?z<^Zz}7pmkL zDR*3R-mkBpzn3jBlDjOR<(t`@7@_aQV{S;w?A6u&pYtVQ3qQo{_kpvUe(ZCN+j3sW zuxK_$GDl-kp~KBXXvSrB#hfW7J6o}BMWQE`eU4PIvAEdNwL`F36o>F0%m?+1JX8ED zAk>v<2H-G-jA8O?R=phzF28InF4cPIz3xOvzjtMsPLnOEtgZ2M4i$zP6^)8Y=Ua`% z&s5wRiA95OSlJs*sPQ%yL z1!NSo%bmN@?s8Xa@d}y!#&-c0&{5E+Hl#z8-FK+9<&j9PZ(t@zc@@fET6R)8)Iwsn zLktO`GY02v`3$OhZpYl5ZShZOF;dIhwV|5Usm?XCWx~P(BCH$F7a=ji&~+g?1Hfr2 z#r$oe0CVXmd#U|p9!-`d5Md2zBYvGn zWKWUqRGWI!i|EokV>*GOJ4cM>g>B5HCg;PMkzO2K;Q`=JT^8)G6X>+$uEWHAHZ-M) zFK0iwrLV*z9NO=%t}e>9HNVL*$%9Ni(@D;PeT1d!f#FC_?uAoVBq3d^)*ratfM&H4 z$*@s;^Ku2PW?FSU>Qb7q6gnZAj{0i+g=x4qE6TciE#mtU2Q2tstS>DhY~x*R6=&>` zRc&`66$ZlaBmpXqJE?kBsCG~Gi}d7GxEZ$o+E`fsN9oSJu?A<$A^raZqOO>_iH{(` z9y5-Y^d@GSuVr_Pj51jbHPg^_s`CdYDk{$Kt@WPYzFAw9YZBAA3S&C6T$gJ))Kp+% z%U77N%O7s-MFTS+{Z&yJdSL)Ew-WSR0lD@%f8h2xJRvAqhGwxAz=;wmtvUdO5h(JMi=(+=;%*Oy;DpmgLCo7lbwAp90% z{@e+Ohtu624$hDr4MRg8QI&@ET^AmYoDMNGMtQji0FLOYE`QD>=T>_;Zhy%0tXC(@ z#ANEUe{C>KyXEq{1U5PS98md*Rf=;s#YkSrmOG9xt6s@gw-%qwkzv#}XIbSY*h_MJw7Z6<|E95 zx?kosAimK!peL59|2!~>yI?+4I?-WUH)dy*x1DWYNRgJ#NC*h(MsSw{HVGo|%rTEu@P-h-%46)KC4ITv#3 zKh*8!Rg-BmM3ttG?{%b)eCOy%gg?!E^LGs%$8|n*9Yox0*^`E_3=%7Lt(_MEe|bM~ zo`EirP>^^QE$PBe_t6q~6_JYb0PW~z)%U`z7d?ojvZldyGD|=?Wgo{@ zS-&7#a4Wp}Ef>Y_Hb}XXnknyjeyVc_=tDO;0+J#6^VYeH&rga~iRD_>{c)gD-faxm zCnhzH?W?|XV}mr3PC;Y_#py$p_>q6JgW7f5=R$g4aerkNT7NL1%|;w_3rJ% M$1A|I%_A!B-+^*KmjD0& literal 0 HcmV?d00001 diff --git a/Projectiles/Boss/DraedonSummonLaser.cs b/Projectiles/Boss/DraedonSummonLaser.cs index 83788f4e79..94c75abafd 100644 --- a/Projectiles/Boss/DraedonSummonLaser.cs +++ b/Projectiles/Boss/DraedonSummonLaser.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Projectiles.Boss new Color(242, 112, 73), new Color(199, 62, 62), }; + public const float LaserLength = 3800f; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; @@ -90,14 +91,19 @@ namespace CalamityMod.Projectiles.Boss Vector2[] basePoints = new Vector2[8]; for (int i = 0; i < basePoints.Length; i++) - basePoints[i] = projectile.Center - Vector2.UnitY * i / basePoints.Length * 3800f; + basePoints[i] = projectile.Center - Vector2.UnitY * i / basePoints.Length * LaserLength; Vector2 overallOffset = projectile.Size * 0.5f - Main.screenPosition; RayDrawer.Draw(basePoints, overallOffset, 92); return false; } - public override void DrawBehind(int index, List drawCacheProjsBehindNPCsAndTiles, List drawCacheProjsBehindNPCs, List drawCacheProjsBehindProjectiles, List drawCacheProjsOverWiresUI) + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), projectile.Center, projectile.Center - Vector2.UnitY * LaserLength); + } + + public override void DrawBehind(int index, List drawCacheProjsBehindNPCsAndTiles, List drawCacheProjsBehindNPCs, List drawCacheProjsBehindProjectiles, List drawCacheProjsOverWiresUI) { drawCacheProjsBehindNPCsAndTiles.Add(index); } diff --git a/World/CalamityWorld.cs b/World/CalamityWorld.cs index 4667a2f21b..6cf26ea50e 100644 --- a/World/CalamityWorld.cs +++ b/World/CalamityWorld.cs @@ -12,6 +12,7 @@ using CalamityMod.NPCs.Crabulon; using CalamityMod.NPCs.Cryogen; using CalamityMod.NPCs.DesertScourge; using CalamityMod.NPCs.DevourerofGods; +using CalamityMod.NPCs.ExoMechs; using CalamityMod.NPCs.HiveMind; using CalamityMod.NPCs.NormalNPCs; using CalamityMod.NPCs.OldDuke; @@ -2075,10 +2076,7 @@ namespace CalamityMod.World } if (DraedonSummonCountdown == 0) - { - Main.NewText("John Wulfrum has awoken!", new Color(175, 75, 255)); - NPC.NewNPC((int)DraedonSummonPosition.X, (int)DraedonSummonPosition.Y, ModContent.NPCType()); - } + NPC.NewNPC((int)DraedonSummonPosition.X, (int)DraedonSummonPosition.Y, ModContent.NPCType()); } #endregion From 382f8378e547cf80d91fbf4cb93450f377057a7b Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 23 Jun 2021 05:40:34 +0200 Subject: [PATCH 17/86] Auric Cell placement bug fix --- Items/DraedonMisc/AuricQuantumCoolingCell.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/DraedonMisc/AuricQuantumCoolingCell.cs b/Items/DraedonMisc/AuricQuantumCoolingCell.cs index 2655518409..7e8a57c0bf 100644 --- a/Items/DraedonMisc/AuricQuantumCoolingCell.cs +++ b/Items/DraedonMisc/AuricQuantumCoolingCell.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Items.DraedonMisc if (Main.myPlayer == player.whoAmI && player.WithinRange(Main.MouseWorld, checkDistance) && tile.active() && tile.type == ModContent.TileType()) { TECodebreaker codebreakerTileEntity = CalamityUtils.FindTileEntity(placeTileCoords.X, placeTileCoords.Y, CodebreakerTile.Width, CodebreakerTile.Height, CodebreakerTile.SheetSquare); - if (codebreakerTileEntity is null || codebreakerTileEntity.ContainsCoolingCell) + if (codebreakerTileEntity is null || codebreakerTileEntity.ContainsCoolingCell || codebreakerTileEntity.DecryptionCountdown > 0) return false; codebreakerTileEntity.ContainsCoolingCell = true; From a3a1b6df01244440ff99fcc4042db404bb881733 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 23 Jun 2021 10:27:24 +0200 Subject: [PATCH 18/86] Light UI code refactoring --- UI/DraedonDecryptUI.cs | 70 ++++++++++++++++++++++++++++++++---------- 1 file changed, 53 insertions(+), 17 deletions(-) diff --git a/UI/DraedonDecryptUI.cs b/UI/DraedonDecryptUI.cs index e34d733a87..582f716394 100644 --- a/UI/DraedonDecryptUI.cs +++ b/UI/DraedonDecryptUI.cs @@ -71,12 +71,9 @@ namespace CalamityMod.UI Vector2 schematicSlotDrawCenter = cellDrawCenter + Vector2.UnitY * 70f; - // Display some error text if the codebreaker isn't strong enough to decrypt the text. + // Display some error text if the codebreaker isn't strong enough to decrypt the schematic. if (codebreakerTileEntity.HeldSchematicID != 0 && !codebreakerTileEntity.CanDecryptHeldSchematic) - { - Vector2 errorDisplayLocation = schematicSlotDrawCenter + Vector2.UnitY * 10f; - DisplayNotStrongEnoughErrorText(errorDisplayLocation); - } + DisplayNotStrongEnoughErrorText(schematicSlotDrawCenter); // Handle decryption costs. else if (codebreakerTileEntity.HeldSchematicID != 0 && codebreakerTileEntity.DecryptionCountdown == 0) @@ -162,6 +159,7 @@ namespace CalamityMod.UI playerHandItem.TurnToAir(); AwaitingDecryptionTextClose = false; } + // If the player is holding nothing, then pick up all the power cells (if any exist), up to the max-stack limit. else if (playerHandItem.IsAir && temporaryItem.stack > 0) { @@ -202,8 +200,11 @@ namespace CalamityMod.UI ref Item playerHandItem = ref Main.mouseItem; + // Handle mouse click interactions. if (Main.mouseLeft && Main.mouseLeftRelease) { + // If the player's hand item is empty and the codebreaker has a schematic, grab it. + // This doesn't work if the Codebreaker is busy decrypting the schematic in question. if (playerHandItem.IsAir && CalamityLists.EncryptedSchematicIDRelationship.ContainsKey(codebreakerTileEntity.HeldSchematicID) && codebreakerTileEntity.DecryptionCountdown <= 0) { playerHandItem.SetDefaults(CalamityLists.EncryptedSchematicIDRelationship[codebreakerTileEntity.HeldSchematicID]); @@ -214,6 +215,8 @@ namespace CalamityMod.UI AwaitingDecryptionTextClose = false; } + + // Otherwise, if the player has an encrypted schematic and the Codebreaker doesn't, insert it into the machine. else if (CalamityLists.EncryptedSchematicIDRelationship.ContainsValue(playerHandItem.type)) { codebreakerTileEntity.HeldSchematicID = CalamityLists.EncryptedSchematicIDRelationship.First(i => i.Value == Main.mouseItem.type).Key; @@ -228,13 +231,17 @@ namespace CalamityMod.UI public static void DisplayCostText(Vector2 drawPosition, int totalCellsCost) { + // Display the cost text. string text = "Cost: "; drawPosition.X -= 30f; Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontMouseText, text, drawPosition.X, drawPosition.Y + 20f, Color.White * (Main.mouseTextColor / 255f), Color.Black, Vector2.Zero, 1f); + // And draw the cells to the right of the text. Texture2D cellTexture = ModContent.GetTexture("CalamityMod/Items/DraedonMisc/PowerCell"); Vector2 offsetDrawPosition = new Vector2(drawPosition.X + ChatManager.GetStringSize(Main.fontMouseText, text, Vector2.One, -1f).X + 15f, drawPosition.Y + 30f); Main.spriteBatch.Draw(cellTexture, offsetDrawPosition, null, Color.White, 0f, cellTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); + + // Display the cell quantity numerically below the drawn cells. Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontItemStack, totalCellsCost.ToString(), offsetDrawPosition.X - 11f, offsetDrawPosition.Y, Color.White, Color.Black, new Vector2(0.3f), 0.75f); } @@ -242,9 +249,15 @@ namespace CalamityMod.UI { Texture2D confirmationTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/DecryptIcon"); Rectangle clickArea = Utils.CenteredRectangle(drawPosition, confirmationTexture.Size() * VerificationButtonScale); + // Click if the mouse is hovering over the contact button area. if (MouseScreenArea.Intersects(clickArea)) { + // If so, cause the button to inflate a little bit. VerificationButtonScale = MathHelper.Clamp(VerificationButtonScale + 0.035f, 1f, 1.35f); + + // If a click is done, begin the decryption process. + // This will "lock" various things and make the Codebreaker unbreakable, to prevent complications with lost items. + // Also play a cool sound. if (Main.mouseLeft && Main.mouseLeftRelease) { Main.PlaySound(SoundID.Zombie, Main.LocalPlayer.Center, 67); @@ -255,9 +268,12 @@ namespace CalamityMod.UI codebreakerTileEntity.SyncDecryptCountdown(); } } + + // Otherwise, if not hovering, cause the button to deflate back to its normal size. else VerificationButtonScale = MathHelper.Clamp(VerificationButtonScale - 0.05f, 1f, 1.35f); + // Draw the confirmation icon. Main.spriteBatch.Draw(confirmationTexture, drawPosition, null, Color.White, 0f, confirmationTexture.Size() * 0.5f, VerificationButtonScale, SpriteEffects.None, 0f); } @@ -273,7 +289,8 @@ namespace CalamityMod.UI string trueMessage = codebreakerTileEntity.UnderlyingSchematicText; StringBuilder text = new StringBuilder(codebreakerTileEntity.DecryptionCountdown == 0 ? trueMessage : CalamityUtils.GenerateRandomAlphanumericString(500)); - // Don't mess with whitespace characters. Doing so can cause the word-wrap to "jump" around. + // Messing with whitespace characters so can cause the word-wrap to "jump" around. + // As a result, changes to whitespace characters in the true text do not stay. for (int i = 0; i < trueMessage.Length; i++) { if (char.IsWhiteSpace(trueMessage[i])) @@ -284,10 +301,13 @@ namespace CalamityMod.UI for (int i = 0; i < (int)(trueMessage.Length * codebreakerTileEntity.DecryptionCompletion); i++) text[i] = trueMessage[i]; - Vector2 currentTextDrawPosition = backgroundTopLeft + Vector2.UnitX * backgroundTexture.Width - Vector2.UnitX * (textPanelTexture.Width - textPadding); - currentTextDrawPosition.Y += 6f; + // Define the initial text draw position. + Vector2 currentTextDrawPosition = backgroundTopLeft + new Vector2(backgroundTexture.Width - textPanelTexture.Width + textPadding, 6f); + + // Draw the lines of text. A maximum of 10 may be drawn and the vertical offset per line is 16 pixels. foreach (string line in Utils.WordwrapString(text.ToString(), Main.fontMouseText, (int)(textPanelTexture.Width * 1.5 - textPadding * 2), 10, out _)) { + // If a line is null or empty for some reason, don't attempt to draw it or move to the next line position. if (string.IsNullOrEmpty(line)) continue; @@ -295,20 +315,23 @@ namespace CalamityMod.UI currentTextDrawPosition.Y += 16; } + // Handle special drawing when decryption is ongoing. + // If it isn't, return; the below logic is unnecessary. if (codebreakerTileEntity.DecryptionCountdown <= 0) return; // Draw a small bar at the bottom to indicate how much work is left. - Texture2D edgeTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ChargeMeterBorder"); + Texture2D borderTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ChargeMeterBorder"); Texture2D barTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ChargeMeter"); - Main.spriteBatch.Draw(edgeTexture, barCenter, null, Color.White, 0f, edgeTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(borderTexture, barCenter, null, Color.White, 0f, borderTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0); + // Only 90% is displayed on completion. 100% causes the bar to appear as though it's already complete at around 85%. + // This happens since the final section of the bar is obscured by the border. Rectangle barRectangle = new Rectangle(0, 0, (int)(barTexture.Width * codebreakerTileEntity.DecryptionCompletion * 0.9f), barTexture.Width); - Main.spriteBatch.Draw(barTexture, barCenter, barRectangle, Color.White, 0f, edgeTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(barTexture, barCenter, barRectangle, Color.White, 0f, barTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0); - // Display a completion percentage below the bar. - string percentString = (codebreakerTileEntity.DecryptionCompletion * 100f).ToString("n2"); - string completionText = $"{percentString}%"; + // Display a completion percentage below the bar as a more precise indicator. + string completionText = $"{codebreakerTileEntity.DecryptionCompletion * 100f:n2}%"; Vector2 textDrawPosition = barCenter + new Vector2(-Main.fontMouseText.MeasureString(completionText).X * 0.5f, 10f); Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontMouseText, completionText, textDrawPosition.X, textDrawPosition.Y, Color.Red * (Main.mouseTextColor / 255f), Color.Black, Vector2.Zero, 1f); } @@ -317,9 +340,15 @@ namespace CalamityMod.UI { Texture2D contactButton = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ContactIcon"); Rectangle clickArea = Utils.CenteredRectangle(drawPosition, contactButton.Size() * VerificationButtonScale); + + // Click if the mouse is hovering over the contact button area. if (MouseScreenArea.Intersects(clickArea)) { + // If so, cause the button to inflate a little bit. ContactButtonScale = MathHelper.Clamp(ContactButtonScale + 0.035f, 1f, 1.35f); + + // If a click is done, prepare the summoning process by defining the countdown and current summon position. + // Also play a cool sound. if (Main.mouseLeft && Main.mouseLeftRelease) { Main.PlaySound(SoundID.Zombie, Main.LocalPlayer.Center, 67); @@ -328,11 +357,16 @@ namespace CalamityMod.UI CalamityNetcode.SyncWorld(); } } + + // Otherwise, if not hovering, cause the button to deflate back to its normal size. else ContactButtonScale = MathHelper.Clamp(ContactButtonScale - 0.05f, 1f, 1.35f); + // Draw the contact button. Main.spriteBatch.Draw(contactButton, drawPosition, null, Color.White, 0f, contactButton.Size() * 0.5f, ContactButtonScale, SpriteEffects.None, 0f); + // And display a text indicator that describes the function of the button. + // The color of the text cycles through the exo mech crystal palette. Color[] exoPalette = new Color[] { new Color(250, 255, 112), @@ -347,15 +381,17 @@ namespace CalamityMod.UI string contactText = "Contact"; Color contactTextColor = CalamityUtils.MulticolorLerp((float)Math.Cos(Main.GlobalTime * 0.7f) * 0.5f + 0.5f, exoPalette); + + // Center the draw position. drawPosition.X -= Main.fontMouseText.MeasureString(contactText).X * 0.5f; - Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontMouseText, contactText, drawPosition.X, drawPosition.Y + 20f, contactTextColor, Color.Black, Vector2.Zero, 1f); + drawPosition.Y += 20f; + Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontMouseText, contactText, drawPosition.X, drawPosition.Y, contactTextColor, Color.Black, Vector2.Zero, 1f); } public static void DisplayNotStrongEnoughErrorText(Vector2 drawPosition) { string text = "Encryption unsolveable: Upgrades required."; - drawPosition.X -= 30f; - Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontMouseText, text, drawPosition.X, drawPosition.Y + 20f, Color.IndianRed * (Main.mouseTextColor / 255f), Color.Black, Vector2.Zero, 1f); + Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontMouseText, text, drawPosition.X, drawPosition.Y, Color.IndianRed * (Main.mouseTextColor / 255f), Color.Black, Vector2.Zero, 1f); } } } From 3078acabf7f4ccba70ae15e8d01354b2633a3bc7 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Thu, 24 Jun 2021 06:11:30 +0200 Subject: [PATCH 19/86] Cancel button --- ExtraTextures/UI/DecryptCancelIcon.png | Bin 0 -> 375 bytes UI/DraedonDecryptUI.cs | 43 +++++++++++++++++++++++-- 2 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 ExtraTextures/UI/DecryptCancelIcon.png diff --git a/ExtraTextures/UI/DecryptCancelIcon.png b/ExtraTextures/UI/DecryptCancelIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..e718452a8bfc5d07cd02686b6dcba508fdc384d3 GIT binary patch literal 375 zcmV--0f_#IP)Px$F-b&0R7i>CmN5>3KoCVg#u%+Ah_TR4PhrC;;E;Ll3E zX(HJ;!)6y`U82YEQe5YnwImX4%a7I`?thvZ(}QrxR+N`j*i$jT7kYsBrF zssiAVxGSthx>vQDNtS5&Mt(9Anfd@TurCU}5&{e zb-Hkgt@Er2>48Rhz*4xxltswar`= cost) DrawCostVerificationButton(codebreakerTileEntity, costVerificationLocation); } + else if (codebreakerTileEntity.DecryptionCountdown > 0) + DisplayDecryptCancelButton(codebreakerTileEntity, costVerificationLocation - Vector2.UnitY * 30f); Vector2 summonButtonCenter = backgroundTopLeft + new Vector2(140f, backgroundTexture.Height - 48f); if (codebreakerTileEntity.ReadyToSummonDreadon) @@ -277,6 +283,37 @@ namespace CalamityMod.UI Main.spriteBatch.Draw(confirmationTexture, drawPosition, null, Color.White, 0f, confirmationTexture.Size() * 0.5f, VerificationButtonScale, SpriteEffects.None, 0f); } + public static void DisplayDecryptCancelButton(TECodebreaker codebreakerTileEntity, Vector2 drawPosition) + { + Texture2D cancelTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/DecryptCancelIcon"); + Rectangle clickArea = Utils.CenteredRectangle(drawPosition, cancelTexture.Size() * CancelButtonScale * 1.2f); + // Click if the mouse is hovering over the contact button area. + if (MouseScreenArea.Intersects(clickArea)) + { + // If so, cause the button to inflate a little bit. + CancelButtonScale = MathHelper.Clamp(CancelButtonScale + 0.035f, 0.75f, 1.2f); + + // If a click is done, cancel the decryption process. + // This will cause already consumed cells to be lost. + if (Main.mouseLeft && Main.mouseLeftRelease) + { + Main.PlaySound(SoundID.Item94, Main.LocalPlayer.Center); + AwaitingDecryptionTextClose = false; + codebreakerTileEntity.InitialCellCountBeforeDecrypting = 0; + codebreakerTileEntity.DecryptionCountdown = 0; + codebreakerTileEntity.SyncContainedStuff(); + codebreakerTileEntity.SyncDecryptCountdown(); + } + } + + // Otherwise, if not hovering, cause the button to deflate back to its normal size. + else + CancelButtonScale = MathHelper.Clamp(VerificationButtonScale - 0.05f, 0.75f, 1.2f); + + // Draw the cancel icon. + Main.spriteBatch.Draw(cancelTexture, drawPosition, null, Color.White, 0f, cancelTexture.Size() * 0.5f, CancelButtonScale, SpriteEffects.None, 0f); + } + public static void HandleDecryptionStuff(TECodebreaker codebreakerTileEntity, Texture2D backgroundTexture, Vector2 backgroundTopLeft, Vector2 barCenter) { Texture2D textPanelTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/DraedonDecrypterScreen"); From b09bdca1c416969d0e86a3c95128b44a87109387 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 17:58:33 -0500 Subject: [PATCH 20/86] Decryption bar resprite --- ExtraTextures/UI/CodebreakerDecyptionBar.png | Bin 0 -> 620 bytes .../UI/CodebreakerDecyptionBarCharge.png | Bin 0 -> 221 bytes UI/DraedonDecryptUI.cs | 9 +++------ 3 files changed, 3 insertions(+), 6 deletions(-) create mode 100644 ExtraTextures/UI/CodebreakerDecyptionBar.png create mode 100644 ExtraTextures/UI/CodebreakerDecyptionBarCharge.png diff --git a/ExtraTextures/UI/CodebreakerDecyptionBar.png b/ExtraTextures/UI/CodebreakerDecyptionBar.png new file mode 100644 index 0000000000000000000000000000000000000000..63a3f1d1d246858a6875185aab9fe6487cac9023 GIT binary patch literal 620 zcmV-y0+aoTP)Px%CP_p=R9J=OmpyM2K@f(YMRouwvd-rOh!fihiA3QjAVGyCLyIV&qo<(Z_s~$# zP|@K6QP3oj+<`=*1c?F!juR8djz47aVGu`g9`Ia(Y)9ybv`=%|xxL$&d2e>-OnP<> zfU)Qp0I|3WK&|@8qmP-nc?0md(NcE65H4!{bK?;M@TRQ&O(k3du-onc(EZ*8;6xZ6 z9w#F7GA0@L+5G`P{^l(;arIfj>$h(di*hTdcqrVyI19j|m6smC-D_9W{ikamR9u3U z3IlLq=`sLkQ!{Ep>ij$at}~(Ri@DrL3(0$eY`uSXsC}WcJ=A-}uWw6v08Xy20)M`M zVj}~<+x1s~%?b;BwW-FNo3GXN*zx#q^JF@s#?~oprh6HvR(3pqscFB4r8Y#-JNNGY z5C4Yd$-@T#WV4q5*l*SVsBD)3I5U+rV4=d1YGp?mHokrVAV1(iscqSbZPWhFwSE5F}3P6gJUl)C0JF!|##z zN+0!v-p^3Ixfil)qmghX0q_E?y`00#&kKNs3LogSf}Ke&?kika^T!kEG;pxz4x8OA z|9q{LN&sYYSC##5Sf}vs8WyBeSx7o+V&TPdcwQX=*@Fbxi-Ntsl?nq8i}{K=v2g%O z<+4&f5qAtgz0nNS!9n!(5z60WDq{dTtrh_7w(qxf3jYEsBBV-sW^x4p0000QauV}H3?3y_nDFzLJCw-%t9&V?43s|nTs505)aUcD7J<25k`ivo66Qbl zr0{}tGS8l(p$wwe&pg*~?921u@C401m0D%JHur-X60FYB3=DT?E0jyWl{Ex9k-^i| K&t;ucLK6VtEJU~f literal 0 HcmV?d00001 diff --git a/UI/DraedonDecryptUI.cs b/UI/DraedonDecryptUI.cs index 3dedca4944..5e5e56b82c 100644 --- a/UI/DraedonDecryptUI.cs +++ b/UI/DraedonDecryptUI.cs @@ -358,13 +358,10 @@ namespace CalamityMod.UI return; // Draw a small bar at the bottom to indicate how much work is left. - Texture2D borderTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ChargeMeterBorder"); - Texture2D barTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ChargeMeter"); + Texture2D borderTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/CodebreakerDecyptionBar"); + Texture2D barTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/CodebreakerDecyptionBarCharge"); Main.spriteBatch.Draw(borderTexture, barCenter, null, Color.White, 0f, borderTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0); - - // Only 90% is displayed on completion. 100% causes the bar to appear as though it's already complete at around 85%. - // This happens since the final section of the bar is obscured by the border. - Rectangle barRectangle = new Rectangle(0, 0, (int)(barTexture.Width * codebreakerTileEntity.DecryptionCompletion * 0.9f), barTexture.Width); + Rectangle barRectangle = new Rectangle(0, 0, (int)(barTexture.Width * codebreakerTileEntity.DecryptionCompletion), barTexture.Width); Main.spriteBatch.Draw(barTexture, barCenter, barRectangle, Color.White, 0f, barTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0); // Display a completion percentage below the bar as a more precise indicator. From 8e2320092335dcf430e74563a746018215f4fa1b Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 17:58:48 -0500 Subject: [PATCH 21/86] Decryption cancel confirmation --- TileEntities/TECodebreaker.cs | 2 +- UI/DraedonDecryptUI.cs | 62 ++++++++++++++++++++++++++++------- 2 files changed, 51 insertions(+), 13 deletions(-) diff --git a/TileEntities/TECodebreaker.cs b/TileEntities/TECodebreaker.cs index 4e11c21918..8f5e9baf58 100644 --- a/TileEntities/TECodebreaker.cs +++ b/TileEntities/TECodebreaker.cs @@ -56,7 +56,7 @@ namespace CalamityMod.TileEntities } public float DecryptionCompletion => 1f - DecryptionCountdown / (float)DecryptionTotalTime; - public bool ReadyToSummonDreadon => ContainsCoolingCell; + public bool ReadyToSummonDreadon => ContainsCoolingCell && DecryptionCountdown <= 0; public bool ContainsDecryptionComputer; public bool ContainsSensorArray; diff --git a/UI/DraedonDecryptUI.cs b/UI/DraedonDecryptUI.cs index 5e5e56b82c..5a5c01d3e7 100644 --- a/UI/DraedonDecryptUI.cs +++ b/UI/DraedonDecryptUI.cs @@ -17,6 +17,7 @@ namespace CalamityMod.UI public static class DraedonDecryptUI { public static int ViewedTileEntityID = -1; + public static bool AwaitingCloseConfirmation = false; public static bool AwaitingDecryptionTextClose = false; public static float VerificationButtonScale = 1f; public static float CancelButtonScale = 0.75f; @@ -34,6 +35,7 @@ namespace CalamityMod.UI CancelButtonScale = 0.75f; ContactButtonScale = 1f; ViewedTileEntityID = -1; + AwaitingCloseConfirmation = false; return; } @@ -44,6 +46,7 @@ namespace CalamityMod.UI CancelButtonScale = 0.75f; ContactButtonScale = 1f; ViewedTileEntityID = -1; + AwaitingCloseConfirmation = false; return; } @@ -54,6 +57,7 @@ namespace CalamityMod.UI CancelButtonScale = 0.75f; ContactButtonScale = 1f; ViewedTileEntityID = -1; + AwaitingCloseConfirmation = false; return; } @@ -70,12 +74,14 @@ namespace CalamityMod.UI // Draw the cell payment slot icon. Texture2D emptyCellIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/PowerCellSlot_Empty"); Texture2D occupiedCellIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/PowerCellSlot_Filled"); + Texture2D textPanelTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/DraedonDecrypterScreen"); Texture2D cellTexture = codebreakerTileEntity.InputtedCellCount > 0 ? occupiedCellIconTexture : emptyCellIconTexture; Vector2 cellDrawCenter = backgroundTopLeft + Vector2.One * 60f; Vector2 schematicSlotDrawCenter = cellDrawCenter + Vector2.UnitY * 70f; Vector2 costDisplayLocation = schematicSlotDrawCenter + Vector2.UnitY * 20f; Vector2 costVerificationLocation = costDisplayLocation + Vector2.UnitY * 60f; + Vector2 textPanelCenter = backgroundTopLeft + Vector2.UnitX * backgroundTexture.Width + textPanelTexture.Size() * new Vector2(-0.5f, 0.5f); // Display some error text if the codebreaker isn't strong enough to decrypt the schematic. if (codebreakerTileEntity.HeldSchematicID != 0 && !codebreakerTileEntity.CanDecryptHeldSchematic) @@ -91,7 +97,12 @@ namespace CalamityMod.UI DrawCostVerificationButton(codebreakerTileEntity, costVerificationLocation); } else if (codebreakerTileEntity.DecryptionCountdown > 0) - DisplayDecryptCancelButton(codebreakerTileEntity, costVerificationLocation - Vector2.UnitY * 30f); + { + if (!AwaitingCloseConfirmation) + DisplayDecryptCancelButton(codebreakerTileEntity, costVerificationLocation - Vector2.UnitY * 30f); + else + DisplayDecryptCancelButton(codebreakerTileEntity, textPanelCenter + Vector2.UnitY * 110f); + } Vector2 summonButtonCenter = backgroundTopLeft + new Vector2(140f, backgroundTexture.Height - 48f); if (codebreakerTileEntity.ReadyToSummonDreadon) @@ -99,6 +110,8 @@ namespace CalamityMod.UI if (codebreakerTileEntity.DecryptionCountdown > 0 || AwaitingDecryptionTextClose) HandleDecryptionStuff(codebreakerTileEntity, backgroundTexture, backgroundTopLeft, schematicSlotDrawCenter + Vector2.UnitY * 80f); + if (codebreakerTileEntity.DecryptionCountdown > 0 && AwaitingCloseConfirmation) + DrawDecryptCancelConfirmationText(textPanelCenter); // Draw the schematic icon. Texture2D emptySchematicIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/EncryptedSchematicSlot_Empty"); @@ -255,7 +268,8 @@ namespace CalamityMod.UI { Texture2D confirmationTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/DecryptIcon"); Rectangle clickArea = Utils.CenteredRectangle(drawPosition, confirmationTexture.Size() * VerificationButtonScale); - // Click if the mouse is hovering over the contact button area. + + // Click if the mouse is hovering over the cost button area. if (MouseScreenArea.Intersects(clickArea)) { // If so, cause the button to inflate a little bit. @@ -285,35 +299,59 @@ namespace CalamityMod.UI public static void DisplayDecryptCancelButton(TECodebreaker codebreakerTileEntity, Vector2 drawPosition) { + bool clickingMouse = Main.mouseLeft && Main.mouseLeftRelease; Texture2D cancelTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/DecryptCancelIcon"); Rectangle clickArea = Utils.CenteredRectangle(drawPosition, cancelTexture.Size() * CancelButtonScale * 1.2f); - // Click if the mouse is hovering over the contact button area. + + // Click if the mouse is hovering over the decrypt button area. if (MouseScreenArea.Intersects(clickArea)) { // If so, cause the button to inflate a little bit. - CancelButtonScale = MathHelper.Clamp(CancelButtonScale + 0.035f, 0.75f, 1.2f); + CancelButtonScale = MathHelper.Clamp(CancelButtonScale + 0.035f, 0.9f, 1.2f); // If a click is done, cancel the decryption process. // This will cause already consumed cells to be lost. - if (Main.mouseLeft && Main.mouseLeftRelease) + if (clickingMouse) { - Main.PlaySound(SoundID.Item94, Main.LocalPlayer.Center); - AwaitingDecryptionTextClose = false; - codebreakerTileEntity.InitialCellCountBeforeDecrypting = 0; - codebreakerTileEntity.DecryptionCountdown = 0; - codebreakerTileEntity.SyncContainedStuff(); - codebreakerTileEntity.SyncDecryptCountdown(); + if (AwaitingCloseConfirmation) + { + Main.PlaySound(SoundID.Item94, Main.LocalPlayer.Center); + + AwaitingDecryptionTextClose = false; + codebreakerTileEntity.InitialCellCountBeforeDecrypting = 0; + codebreakerTileEntity.DecryptionCountdown = 0; + codebreakerTileEntity.SyncContainedStuff(); + codebreakerTileEntity.SyncDecryptCountdown(); + AwaitingCloseConfirmation = false; + } + else + AwaitingCloseConfirmation = true; } } // Otherwise, if not hovering, cause the button to deflate back to its normal size. else - CancelButtonScale = MathHelper.Clamp(VerificationButtonScale - 0.05f, 0.75f, 1.2f); + { + CancelButtonScale = MathHelper.Clamp(CancelButtonScale - 0.05f, 0.9f, 1.2f); + if (clickingMouse) + AwaitingCloseConfirmation = false; + } // Draw the cancel icon. Main.spriteBatch.Draw(cancelTexture, drawPosition, null, Color.White, 0f, cancelTexture.Size() * 0.5f, CancelButtonScale, SpriteEffects.None, 0f); } + public static void DrawDecryptCancelConfirmationText(Vector2 drawPosition) + { + Texture2D textPanelTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/DraedonDecrypterScreen"); + Vector2 scale = new Vector2(1f, 0.3f); + Main.spriteBatch.Draw(textPanelTexture, drawPosition, null, Color.White, 0f, textPanelTexture.Size() * 0.5f, scale, SpriteEffects.None, 0); + + string confirmationText = "Are you sure?"; + Vector2 confirmationTextPosition = drawPosition - Main.fontMouseText.MeasureString(confirmationText) * 0.5f + Vector2.UnitY * 4f; + ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, Main.fontMouseText, confirmationText, confirmationTextPosition, Color.Red, 0f, Vector2.Zero, Vector2.One); + } + public static void HandleDecryptionStuff(TECodebreaker codebreakerTileEntity, Texture2D backgroundTexture, Vector2 backgroundTopLeft, Vector2 barCenter) { Texture2D textPanelTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/DraedonDecrypterScreen"); From 039b3442daeffb45ecdec5274c2107e1479f7d6f Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 18:05:25 -0500 Subject: [PATCH 22/86] Cyan percentage text --- UI/DraedonDecryptUI.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UI/DraedonDecryptUI.cs b/UI/DraedonDecryptUI.cs index 5a5c01d3e7..aef8146185 100644 --- a/UI/DraedonDecryptUI.cs +++ b/UI/DraedonDecryptUI.cs @@ -405,7 +405,7 @@ namespace CalamityMod.UI // Display a completion percentage below the bar as a more precise indicator. string completionText = $"{codebreakerTileEntity.DecryptionCompletion * 100f:n2}%"; Vector2 textDrawPosition = barCenter + new Vector2(-Main.fontMouseText.MeasureString(completionText).X * 0.5f, 10f); - Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontMouseText, completionText, textDrawPosition.X, textDrawPosition.Y, Color.Red * (Main.mouseTextColor / 255f), Color.Black, Vector2.Zero, 1f); + Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontMouseText, completionText, textDrawPosition.X, textDrawPosition.Y, Color.Cyan * 1.2f, Color.Black, Vector2.Zero, 1f); } public static void HandleDraedonSummonButton(TECodebreaker codebreakerTileEntity, Vector2 drawPosition) From 525cfb396885bc412432489aec1c7f3d4dc2c1b1 Mon Sep 17 00:00:00 2001 From: Dominic Date: Tue, 29 Jun 2021 07:34:59 -0500 Subject: [PATCH 23/86] Fix --- CalamityMod.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/CalamityMod.cs b/CalamityMod.cs index c5b74d0c99..c16991fd81 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -915,6 +915,7 @@ namespace CalamityMod layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Codebreaker Decryption GUI", () => { DraedonDecryptUI.Draw(Main.spriteBatch); + return true; }, InterfaceScaleType.None)); // Popup GUIs. From 9a611f1078b1d2e5b73d153e640e73a27b8fa1a3 Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 16 Jul 2021 14:40:27 -0500 Subject: [PATCH 24/86] Exo Mech selection --- Effects/CalamityShaders.cs | 3 + Effects/GlitchShader.fx | 28 ++++++ Effects/GlitchShader.xnb | Bin 0 -> 2264 bytes ExtraTextures/UI/ContactIcon.png | Bin 512 -> 0 bytes ExtraTextures/UI/ContactIcon_Ares.png | Bin 0 -> 347 bytes ExtraTextures/UI/ContactIcon_THanos.png | Bin 0 -> 348 bytes ExtraTextures/UI/ContactIcon_Twins.png | Bin 0 -> 347 bytes ExtraTextures/UI/HeadIcon_Ares.png | Bin 0 -> 236 bytes ExtraTextures/UI/HeadIcon_THanos.png | Bin 0 -> 297 bytes ExtraTextures/UI/HeadIcon_Twins.png | Bin 0 -> 272 bytes ExtraTextures/UI/unknown.png | Bin 0 -> 954 bytes NPCs/ExoMechs/Draedon.cs | 45 ++++++--- UI/DraedonDecryptUI.cs | 124 ++++++++++++++++++------ World/CalamityWorld.cs | 8 ++ 14 files changed, 164 insertions(+), 44 deletions(-) create mode 100644 Effects/GlitchShader.fx create mode 100644 Effects/GlitchShader.xnb delete mode 100644 ExtraTextures/UI/ContactIcon.png create mode 100644 ExtraTextures/UI/ContactIcon_Ares.png create mode 100644 ExtraTextures/UI/ContactIcon_THanos.png create mode 100644 ExtraTextures/UI/ContactIcon_Twins.png create mode 100644 ExtraTextures/UI/HeadIcon_Ares.png create mode 100644 ExtraTextures/UI/HeadIcon_THanos.png create mode 100644 ExtraTextures/UI/HeadIcon_Twins.png create mode 100644 ExtraTextures/UI/unknown.png diff --git a/Effects/CalamityShaders.cs b/Effects/CalamityShaders.cs index 6fc43d77dc..fb6b046ca2 100644 --- a/Effects/CalamityShaders.cs +++ b/Effects/CalamityShaders.cs @@ -12,6 +12,7 @@ namespace CalamityMod.Effects public static Effect LightShader; public static Effect SCalMouseShader; public static Effect TentacleShader; + public static Effect GlitchShader; public static Effect LightDistortionShader; public static Effect PhaseslayerRipShader; public static Effect FadedUVMapStreakShader; @@ -29,6 +30,7 @@ namespace CalamityMod.Effects AstralFogShader = CalamityMod.Instance.GetEffect("Effects/CustomShader"); LightShader = CalamityMod.Instance.GetEffect("Effects/LightBurstShader"); TentacleShader = CalamityMod.Instance.GetEffect("Effects/TentacleShader"); + GlitchShader = CalamityMod.Instance.GetEffect("Effects/GlitchShader"); SCalMouseShader = CalamityMod.Instance.GetEffect("Effects/SCalMouseShader"); LightDistortionShader = CalamityMod.Instance.GetEffect("Effects/DistortionShader"); PhaseslayerRipShader = CalamityMod.Instance.GetEffect("Effects/PhaseslayerRipShader"); @@ -47,6 +49,7 @@ namespace CalamityMod.Effects GameShaders.Misc["CalamityMod:FireMouse"] = new MiscShaderData(new Ref(SCalMouseShader), "DyePass"); GameShaders.Misc["CalamityMod:SubsumingTentacle"] = new MiscShaderData(new Ref(TentacleShader), "BurstPass"); + GameShaders.Misc["CalamityMod:Glitch"] = new MiscShaderData(new Ref(GlitchShader), "GlitchPass"); GameShaders.Misc["CalamityMod:LightDistortion"] = new MiscShaderData(new Ref(LightDistortionShader), "DistortionPass"); GameShaders.Misc["CalamityMod:PhaseslayerRipEffect"] = new MiscShaderData(new Ref(PhaseslayerRipShader), "TrailPass"); GameShaders.Misc["CalamityMod:TrailStreak"] = new MiscShaderData(new Ref(FadedUVMapStreakShader), "TrailPass"); diff --git a/Effects/GlitchShader.fx b/Effects/GlitchShader.fx new file mode 100644 index 0000000000..50f4626255 --- /dev/null +++ b/Effects/GlitchShader.fx @@ -0,0 +1,28 @@ +sampler uImage0 : register(s0); +sampler uImage1 : register(s1); +float3 uColor; +float3 uSecondaryColor; +float uOpacity; +float uSaturation; +float uRotation; +float uTime; +float4 uSourceRect; +float2 uWorldPosition; +float uDirection; +float3 uLightSource; +float2 uImageSize0; +float2 uImageSize1; + +float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0 +{ + float horizontalOffset = pow((sin(2.7182818 * 6.283 * coords.y + 16 * uTime) + sin(1.570796 * 16 * coords.y)) * 0.5, 3) * uOpacity * 0.46; + float2 samplePosition = float2(saturate(coords.x + horizontalOffset), coords.y); + return tex2D(uImage0, samplePosition); +} +technique Technique1 +{ + pass GlitchPass + { + PixelShader = compile ps_2_0 PixelShaderFunction(); + } +} \ No newline at end of file diff --git a/Effects/GlitchShader.xnb b/Effects/GlitchShader.xnb new file mode 100644 index 0000000000000000000000000000000000000000..98b8d134a7adc17d2f245019abdbe385d5b2ff53 GIT binary patch literal 2264 zcmbVMO=ufe5T2E-R;iV$KbIa1SxO6OF+x)9BGb5WEXRqd+N%0V1u2B}dL1p1weD({ z*rm{gQgETrmiE|#3Oxi1iVpodnBqe&JvB!|a`YjP9CBh@o!2m`EAd4t+|fnd#=%*(kuQ-+cw{^w(8Ce zt20-eE|_b@6)V4L&E#fg-XIn&hwT2Ic(nUm1jR!;6%PMN2>lsM;~0|y#!rNizr1c- zw{j#o^RZVbhnzf(!K7h$3P;)$6Fm*!mz=iaQcn7BDFkU#OvJhSHOq85tA@KJf|^^-pJsl|K!*(vZIAiqj^T4p{Ho&#_Tl>NWB5-o zzizKv^z(|W@h64LXP`hJAtEowcTKB``xEzhUm^2RDv&b3{)dj+UadG?J1QrxCp|iM zUY%oP+yuug+Aj9s^7mwpiwa-bI9AGOD1O<#-tuZul5Cf}PnFoCIYxCw_p4@qf;%Q- z1}BcmN4ayY+&fjcmP>8hGg}p-+a+RLx6D?@{@AzjM9%_q-5kf;@%$2ol(SIINr1VG z(Nb^#{Rai_Lf=>LL+B~lSm=|`iwZ77Zz*^a`u7U{1^OKYKZKrA`Z5W&Bb}GrSM={jIp2nDPqB~86hfqapARSzhQlyVrTT@1Nx-k!2^)tphUnXPEMkcB zOhmn7$43~<;~cn`n;7!@GEQmO`6ncPZ~Of|ucZ1$lz7_cUMpP7QT#pC&sJa4FPCd& zz1HGStzL50H|#c)*=*s>?CeY-TPRLX(=cpOrFyZZC7Mga@Rhixt5}(BoJ&-bMtT!^ z4nyW&gnk)AywCriqqq4a`K6IxZCUmN+r|BnI{Q@rFnobZ<>h*c2`7@={Bg8ln4zU+ zxg_?e^hVbs>Vb@5pM3Xt=J5!Uf$+`wfGC-uOz)2$w=aDD@5^t)eg1Ly**x3FV85IB zYyNI#dGE{@57-y+$6?n_-}%*;`0e-p&g*Y|xxGEh{3PuCot<6K{v-;{^IB)bkp#FS zgOUCXr4S$4Qvq`BAt(Gba2f-mFn~|75jYLhw$pntieVlFhcOi39{0w;c@^tulow7-Rbqw){8Hk?n X8jZn1w0;KqK|rYk(XW)id~W{%B3e2x literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/ContactIcon.png b/ExtraTextures/UI/ContactIcon.png deleted file mode 100644 index 0158df92ca311d3f4f07e0a369c18cea00050975..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 512 zcmV+b0{{JqP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGizW@LZzX3P}QzQTY0hLKaK~zXfV;FIO z5lRyT|NnpZ526n+vP{1i8UX2B;iWr!7x0nT{(S1JneEeyfCfKJOp6X!! z`h)wyv}5y2Fx^y}0;bWywRe*tj5`pY>xh6U3@~_7H7rgq^sfQ)wGVCv(=ZTx2-U~S zKRyT3sz-Ujw22oFn6_p34W_TWsR7fvqEk@p8ZaM|Y_VpZHyDF_3iB-p6ne3PG03Md z--5u?JFmbP9Soj0hJm!r^TBaF(XLVd@O;oAYj%c4KRJ6E+4PigV)FCz@cd(I0SG3LOz9oq2pt8kon;bI0UXw z+6v|mdLL8GVl_iPFeVlZT_1z;HG1AA1`Lpo85jT*EOn*PL!z4i0000(cpkU2Tj-r}=>OMkC71dZJ1%aS)VKBJvJaWR z{uf++ozr`$ZeqejpuVj0wyHo%uq4PY_&*w8P+dDS2`I@~;1OBOz`%D1gc(IOyc&Rl zQ#@T9LoEE4UOdRxqQK*NG3j)G=*0j3Z@rYxdgSH(EboZiB8ipuV(E)ge)fu|F3`_E zS{XURb<^|9g_Te5%{(de^N$wmW{uTxd)8UzOAE#cBwwu!7hNgZ!&?|;+jos^bF2Gw zqvLBIPVZq}#?oVGmSAyc+Gm;163NY3TMJAC<=Z41-&q{jSo(j)&FR;49$&7>v@Loc YU(2LXc+V%h1L!^mPgg&ebxsLQ0C5tN!vFvP literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/ContactIcon_THanos.png b/ExtraTextures/UI/ContactIcon_THanos.png new file mode 100644 index 0000000000000000000000000000000000000000..fc8a6fddb43cca115a20b333958b04cb5e590a0a GIT binary patch literal 348 zcmeAS@N?(olHy`uVBq!ia0vp^av;pX3?zBp#Z3TGjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCik#1AIbU|NsAR=>OLyTr88to(AcyGkt#TS)0WA*W2Fi<}j9!eiXy?*^X)T zwNpMbP0l+XkK;{}-X literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/ContactIcon_Twins.png b/ExtraTextures/UI/ContactIcon_Twins.png new file mode 100644 index 0000000000000000000000000000000000000000..9e654fccf0c6f1a6377b7732209bb013556c0208 GIT binary patch literal 347 zcmeAS@N?(olHy`uVBq!ia0vp^av;pX3?zBp#Z3TGjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCik#1AIbU|NsB6>_g_6GiQ1a)tOJs`c&Zg>wm$gZJKGD=l}nIJoCeyzO640 z{r`ITb&f;R#JS$}z$3Dlfr0NJ2s7@OnEe(g zIK|V&F~q`u>ZRL!EebrYfmx>m_I&%l|C-#&lQw6k{8cKMslj=)Zrbyp6WzX3QWJFc zpZdJXp! zdheFb=iu*s%rlZVe?GF%?Z9iP&oYl$uO2=;RiHC*)|(NuWIHl2yYbux{txr)z4*}Q$iB}K*FIG literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/HeadIcon_Ares.png b/ExtraTextures/UI/HeadIcon_Ares.png new file mode 100644 index 0000000000000000000000000000000000000000..04e2526e687c45d9600629d6474ed847880ea0d0 GIT binary patch literal 236 zcmeAS@N?(olHy`uVBq!ia0vp^Vn8gz!3-pWKJL#4QjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`c>;VwT#wt?eJb#5)-neQESt$+3Q|`REalo5qxx_BUgg~56j}8|L2$9(GAP(Vn1kUGF!9pf*apYuj9=- z`Jn`2X^{pwG{Wlff(E9*Kg zxw!G{R<1et!fF37h~`o|x$Q(R9j{j-v+rwNAYP3lGhV;%L1d&}mn+ zuWik&mSev+t$!F5;}FDn`kc(Gs=pbprC59wa_{>$Cmm>154gUX@ul7R2h#gL**_LP l^=Yx$t>%R3rn3%3`SbX&HTG97;RU*m!PC{xWt~$(69D@Oa9;ob literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/HeadIcon_Twins.png b/ExtraTextures/UI/HeadIcon_Twins.png new file mode 100644 index 0000000000000000000000000000000000000000..bd061e097c68903772f2f570615af7bc7be9af86 GIT binary patch literal 272 zcmeAS@N?(olHy`uVBq!ia0vp^azHG@!3-oF)&9>0QjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1``2&1HT>BO~UVfeP|NjS*>wA2a80kKLd^No zIfvaPuDeeR_5Qa(w@3M7^@20IEu0=iUv4d*qvTV2*x$EMQ~jwbr(^XhiB6y+7(8A5 KT-G@yGywn@%VKZ< literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/unknown.png b/ExtraTextures/UI/unknown.png new file mode 100644 index 0000000000000000000000000000000000000000..4782990b0d66df7288c9a6c099885963361af136 GIT binary patch literal 954 zcmeAS@N?(olHy`uVBq!ia0vp^X+Z47!3-qp@-NB)DaPU;cPEB*=VV?2IV|apzK#qG z8~eHcB(ehe;Q>A&uK)jkIQ0MPr)`?cK4hLbbH;A!ONXY3eTyAG6?h)Evs>t$(R--Q zd}7v)<6+xMF8%sn(6{yF<<~ijTPCG#p8x;<@wW$7WPZ3aF=3)->aN-&|6LLtnzhV< zW~Y9Wd=8{!OM?7@|KkA+k!{bjfC@PaJR*x382Ao@Fyrz36)6l1Oou&P977`9-%e-r z-)tbz7G1C<_9ojV#Yg}Czu%%?zMW}Nb^vHw_a z>h+Sr-z;Di$A=W=rKcGD)1F*#IP_3$LctDB6`6G>7FSl@e7owD!JZoC%IvwfjY0JL z*SC!J$edWXGp^iPbcI%pR;k5@PrTV1-^rMDT|2I2bj#%P&6-3XO7Rz8IA36Djrh&Px_v7jNI| zUu!R4DUH0Oc4Fnmu-D!UQZehc2IWed9^10^`w~aNEpIA%X05v{RWD<5FFJbK^WwlK z*S-kvnD}~{<73-A-Q1Q%5!-r9b{zX%ydc+gQd~3l@>@QUWwPoL$rhpwuio|w_tdOp zRQY^ZYcJcPea97>+=D|uKH`yCZsD?lbU*BUf(V1DRZFzh{Qnb?* z9{-s!QWw78&vpo`S}>5merNAb zb~fhO&7jnC*g*Fm=StJVN2(dPdbS*T84q;QAr1WtT+5l?anIS&EF-n&)~3g?np^T# zE^KeuaP7fD_xVOeN)y7Ix6jVo+n~$)qO01Z;_QNOzAj5akF^VXZFsJjEq$@tD*yI* zDUoCQwV2WZr^Gc+S~S@r>za_lqC%CE7K>uP82712xyMWlYd$>5D=4yS!JJ8q8Fow( zbDd4DPhe5za`rOr*`c(R&DB#;C)}m^laU)QBkMNCE@ia>*Qnk*HM0aa31+yZu1qyt zB;)WfA}Vc;&$@%p=GxDA`eJ5wN2QBpL)k)|Q;)MXi8xfGu*^4l)EmTAk<=~7x+ zvvx2AWlw9pK8Yi Main.player[npc.target]; public ref float TalkTimer => ref npc.ai[0]; + public ExoMech MechToSummon + { + get => (ExoMech)(int)npc.ai[1]; + set => npc.ai[1] = (int)value; + } public static readonly Color TextColor = new Color(155, 255, 255); public override void SetStaticDefaults() { @@ -63,7 +73,7 @@ namespace CalamityMod.NPCs.ExoMechs if (TalkTimer == 430f) { if (Main.netMode != NetmodeID.MultiplayerClient) - SummonExoMechs(); + SummonExoMech(); if (Main.netMode != NetmodeID.Server) { @@ -75,23 +85,34 @@ namespace CalamityMod.NPCs.ExoMechs TalkTimer++; } - public void SummonExoMechs() + public void SummonExoMech() { - // Spawn Thanatos underground. + // Summon Thanatos underground. Vector2 thanatosSpawnPosition = PlayerToFollow.Center + Vector2.UnitY * 2100f; - NPC thanatos = CalamityUtils.SpawnBossBetter(thanatosSpawnPosition, ModContent.NPCType()); - if (thanatos != null) - thanatos.velocity = thanatos.SafeDirectionTo(PlayerToFollow.Center) * 40f; - // Spawn Ares in the sky, directly above the player. + // Summon Ares in the sky, directly above the player. Vector2 aresSpawnPosition = PlayerToFollow.Center - Vector2.UnitY * 1400f; // CalamityUtils.SpawnBossBetter(thanatosSpawnPosition, ModContent.NPCType()); - // And summon Apollo and Artemis above the player to their sides. - Vector2 apolloSpawnPosition = PlayerToFollow.Center + new Vector2(-1100f, -1600f); - // CalamityUtils.SpawnBossBetter(thanatosSpawnPosition, ModContent.NPCType()); + // Summon Apollo and Artemis above the player to their sides. Vector2 artemisSpawnPosition = PlayerToFollow.Center + new Vector2(1100f, -1600f); - // CalamityUtils.SpawnBossBetter(thanatosSpawnPosition, ModContent.NPCType()); + Vector2 apolloSpawnPosition = PlayerToFollow.Center + new Vector2(-1100f, -1600f); + + switch (MechToSummon) + { + case ExoMech.Destroyer: + NPC thanatos = CalamityUtils.SpawnBossBetter(thanatosSpawnPosition, ModContent.NPCType()); + if (thanatos != null) + thanatos.velocity = thanatos.SafeDirectionTo(PlayerToFollow.Center) * 40f; + break; + case ExoMech.Prime: + //CalamityUtils.SpawnBossBetter(aresSpawnPosition, ModContent.NPCType()); + break; + case ExoMech.Twins: + //CalamityUtils.SpawnBossBetter(artemisSpawnPosition, ModContent.NPCType()); + //CalamityUtils.SpawnBossBetter(apolloSpawnPosition, ModContent.NPCType()); + break; + } } public override void FindFrame(int frameHeight) diff --git a/UI/DraedonDecryptUI.cs b/UI/DraedonDecryptUI.cs index aef8146185..1178490da7 100644 --- a/UI/DraedonDecryptUI.cs +++ b/UI/DraedonDecryptUI.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.DraedonMisc; +using CalamityMod.NPCs.ExoMechs; using CalamityMod.TileEntities; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -8,6 +9,7 @@ using System.Linq; using System.Text; using Terraria; using Terraria.DataStructures; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; using Terraria.UI.Chat; @@ -22,45 +24,27 @@ namespace CalamityMod.UI public static float VerificationButtonScale = 1f; public static float CancelButtonScale = 0.75f; public static float ContactButtonScale = 1f; + public static Draedon.ExoMech? MechToSummon = null; + public static float MechIconScale = 1f; public static readonly Vector2 BackgroundCenter = new Vector2(500f, Main.screenHeight * 0.5f); public static Rectangle MouseScreenArea => Utils.CenteredRectangle(Main.MouseScreen, Vector2.One * 2f); public static void Draw(SpriteBatch spriteBatch) { - // If not viewing the specific tile entity's interface anymore, or if the ID is for some reason invalid - // don't do anything except resetting/updating necessary information. - if (!TileEntity.ByID.ContainsKey(ViewedTileEntityID) || !(TileEntity.ByID[ViewedTileEntityID] is TECodebreaker codebreakerTileEntity)) + // If not viewing the specific tile entity's interface anymore, if the ID is for some reason invalid, or if the player is not equipped to continue viewing the UI + // don't do anything other than resetting necessary data. + if (!TileEntity.ByID.ContainsKey(ViewedTileEntityID) || !(TileEntity.ByID[ViewedTileEntityID] is TECodebreaker codebreakerTileEntity) || !Main.LocalPlayer.WithinRange(codebreakerTileEntity.Center, 270f) || !Main.playerInventory) { VerificationButtonScale = 1f; CancelButtonScale = 0.75f; ContactButtonScale = 1f; ViewedTileEntityID = -1; AwaitingCloseConfirmation = false; + MechToSummon = null; + MechIconScale = 1f; return; } - // If too far away from the tile entity, stop drawing. - if (!Main.LocalPlayer.WithinRange(codebreakerTileEntity.Center, 270f)) - { - VerificationButtonScale = 1f; - CancelButtonScale = 0.75f; - ContactButtonScale = 1f; - ViewedTileEntityID = -1; - AwaitingCloseConfirmation = false; - return; - } - - // Close the UI if the inventory is no longer open. - if (!Main.playerInventory) - { - VerificationButtonScale = 1f; - CancelButtonScale = 0.75f; - ContactButtonScale = 1f; - ViewedTileEntityID = -1; - AwaitingCloseConfirmation = false; - return; - } - // Draw the background. Texture2D backgroundTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/DraedonDecrypterBackground"); spriteBatch.Draw(backgroundTexture, BackgroundCenter, null, Color.White, 0f, backgroundTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); @@ -105,7 +89,7 @@ namespace CalamityMod.UI } Vector2 summonButtonCenter = backgroundTopLeft + new Vector2(140f, backgroundTexture.Height - 48f); - if (codebreakerTileEntity.ReadyToSummonDreadon) + if (codebreakerTileEntity.ReadyToSummonDreadon && CalamityWorld.AbleToSummonDraedon) HandleDraedonSummonButton(codebreakerTileEntity, summonButtonCenter); if (codebreakerTileEntity.DecryptionCountdown > 0 || AwaitingDecryptionTextClose) @@ -410,7 +394,57 @@ namespace CalamityMod.UI public static void HandleDraedonSummonButton(TECodebreaker codebreakerTileEntity, Vector2 drawPosition) { - Texture2D contactButton = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ContactIcon"); + Draedon.ExoMech mechToSummon; + + float flattenedTime = Main.GlobalTime * 0.6f; + float iconTransitionGlitchIntensity = CalamityUtils.Convert01To010(flattenedTime % 1f) * 2.7f; + if (iconTransitionGlitchIntensity > 1f) + iconTransitionGlitchIntensity = 1f; + iconTransitionGlitchIntensity = 1f - iconTransitionGlitchIntensity; + + // Have the mech choices cycle depending on time if one has not yet been selected. + switch ((int)(flattenedTime % 3f)) + { + default: + case 0: + mechToSummon = Draedon.ExoMech.Destroyer; + break; + case 1: + mechToSummon = Draedon.ExoMech.Prime; + break; + case 2: + mechToSummon = Draedon.ExoMech.Twins; + break; + } + + if (MechToSummon.HasValue) + { + iconTransitionGlitchIntensity = 0f; + mechToSummon = MechToSummon.Value; + MechIconScale = MathHelper.Clamp(MechIconScale + 0.035f, 1f, 1.265f); + } + else + MechIconScale = MathHelper.Clamp(MechIconScale - 0.05f, 1f, 1.265f); + + Texture2D mechIconTexture; + Texture2D contactButton; + switch (mechToSummon) + { + default: + case Draedon.ExoMech.Destroyer: + mechIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/HeadIcon_THanos"); + contactButton = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ContactIcon_THanos"); + break; + case Draedon.ExoMech.Prime: + mechIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/HeadIcon_Ares"); + contactButton = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ContactIcon_Ares"); + break; + case Draedon.ExoMech.Twins: + mechIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/HeadIcon_Twins"); + contactButton = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ContactIcon_Twins"); + break; + } + Rectangle clickArea = Utils.CenteredRectangle(drawPosition, contactButton.Size() * VerificationButtonScale); // Click if the mouse is hovering over the contact button area. @@ -419,21 +453,47 @@ namespace CalamityMod.UI // If so, cause the button to inflate a little bit. ContactButtonScale = MathHelper.Clamp(ContactButtonScale + 0.035f, 1f, 1.35f); - // If a click is done, prepare the summoning process by defining the countdown and current summon position. + // If a click is done, do a check. + // If a mech has been selected, prepare the summoning process by defining the countdown and current summon position. Otherwise, select the current mech. // Also play a cool sound. if (Main.mouseLeft && Main.mouseLeftRelease) { - Main.PlaySound(SoundID.Zombie, Main.LocalPlayer.Center, 67); - CalamityWorld.DraedonSummonCountdown = CalamityWorld.DraedonSummonCountdownMax; - CalamityWorld.DraedonSummonPosition = codebreakerTileEntity.Center + new Vector2(-8f, -100f); - CalamityNetcode.SyncWorld(); + if (MechToSummon.HasValue) + { + Main.PlaySound(SoundID.Zombie, Main.LocalPlayer.Center, 67); + CalamityWorld.DraedonMechToSummon = MechToSummon.Value; + CalamityWorld.DraedonSummonCountdown = CalamityWorld.DraedonSummonCountdownMax; + CalamityWorld.DraedonSummonPosition = codebreakerTileEntity.Center + new Vector2(-8f, -100f); + MechToSummon = null; + + CalamityNetcode.SyncWorld(); + } + else + MechToSummon = mechToSummon; } } // Otherwise, if not hovering, cause the button to deflate back to its normal size. else + { ContactButtonScale = MathHelper.Clamp(ContactButtonScale - 0.05f, 1f, 1.35f); + // If a click is done outside of the click area, reset the selected mech again. + if (Main.mouseLeft && Main.mouseLeftRelease) + MechToSummon = null; + } + + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.UIScaleMatrix); + GameShaders.Misc["CalamityMod:Glitch"].UseOpacity(iconTransitionGlitchIntensity); + GameShaders.Misc["CalamityMod:Glitch"].Apply(); + + // Draw the boss icon. + Main.spriteBatch.Draw(mechIconTexture, drawPosition - Vector2.UnitX * 36f, null, Color.White, 0f, mechIconTexture.Size() * 0.5f, MechIconScale, SpriteEffects.None, 0f); + + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.GameViewMatrix.EffectMatrix); + // Draw the contact button. Main.spriteBatch.Draw(contactButton, drawPosition, null, Color.White, 0f, contactButton.Size() * 0.5f, ContactButtonScale, SpriteEffects.None, 0f); diff --git a/World/CalamityWorld.cs b/World/CalamityWorld.cs index 6cf26ea50e..0aa759ce12 100644 --- a/World/CalamityWorld.cs +++ b/World/CalamityWorld.cs @@ -13,6 +13,7 @@ using CalamityMod.NPCs.Cryogen; using CalamityMod.NPCs.DesertScourge; using CalamityMod.NPCs.DevourerofGods; using CalamityMod.NPCs.ExoMechs; +using CalamityMod.NPCs.ExoMechs.Thanatos; using CalamityMod.NPCs.HiveMind; using CalamityMod.NPCs.NormalNPCs; using CalamityMod.NPCs.OldDuke; @@ -159,7 +160,12 @@ namespace CalamityMod.World // Draedon Summoning stuff. public static int DraedonSummonCountdown = 0; + public static Draedon.ExoMech DraedonMechToSummon; public static Vector2 DraedonSummonPosition = Vector2.Zero; + public static bool AbleToSummonDraedon + { + get => DraedonSummonCountdown <= 0 && !NPC.AnyNPCs(ModContent.NPCType()) && !NPC.AnyNPCs(ModContent.NPCType()); + } public const int DraedonSummonCountdownMax = 450; // Draedon Lab Locations. @@ -851,6 +857,7 @@ namespace CalamityMod.World writer.Write(Reforges); writer.Write(MoneyStolenByBandit); writer.Write(DraedonSummonCountdown); + writer.Write((int)DraedonMechToSummon); writer.WriteVector2(DraedonSummonPosition); } #endregion @@ -971,6 +978,7 @@ namespace CalamityMod.World Reforges = reader.ReadInt32(); MoneyStolenByBandit = reader.ReadInt32(); DraedonSummonCountdown = reader.ReadInt32(); + DraedonMechToSummon = (Draedon.ExoMech)reader.ReadInt32(); DraedonSummonPosition = reader.ReadVector2(); } #endregion From 04fc3206c88ebdd138665b990572976a832c8e51 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 17 Jul 2021 05:18:00 -0500 Subject: [PATCH 25/86] Slight shader math simplification --- Effects/GlitchShader.fx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Effects/GlitchShader.fx b/Effects/GlitchShader.fx index 50f4626255..3aa1ca8ee0 100644 --- a/Effects/GlitchShader.fx +++ b/Effects/GlitchShader.fx @@ -15,7 +15,7 @@ float2 uImageSize1; float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0 { - float horizontalOffset = pow((sin(2.7182818 * 6.283 * coords.y + 16 * uTime) + sin(1.570796 * 16 * coords.y)) * 0.5, 3) * uOpacity * 0.46; + float horizontalOffset = pow((sin(coords.y * 17.07947 + uTime * 16) + sin(coords.y * 25.13274)) * 0.5, 3) * uOpacity * 0.46; float2 samplePosition = float2(saturate(coords.x + horizontalOffset), coords.y); return tex2D(uImage0, samplePosition); } From 0f1fe18ecfe8c85795b9ff998c1376ca8a0afb52 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 17 Jul 2021 06:20:53 -0500 Subject: [PATCH 26/86] Exo Palette array splitup --- Items/CalamityGlobalItem.cs | 12 ------------ Projectiles/Boss/DraedonSummonLaser.cs | 17 +++-------------- Projectiles/Melee/PrismRay.cs | 4 ++-- Projectiles/Ranged/PrismExplosionLarge.cs | 2 +- Projectiles/Rogue/TheAtomSplitterDuplicate.cs | 3 +-- Projectiles/Rogue/TheAtomSplitterProjectile.cs | 7 ++----- UI/DraedonDecryptUI.cs | 14 +------------- Utilities/DrawingUtils.cs | 12 ++++++++++++ 8 files changed, 22 insertions(+), 49 deletions(-) diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 91b9a96e3c..f10fd7fda5 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -80,18 +80,6 @@ namespace CalamityMod.Items public bool devItem = false; public bool challengeDrop = false; - public static readonly Color[] ExoPalette = new Color[] - { - new Color(250, 255, 112), - new Color(211, 235, 108), - new Color(166, 240, 105), - new Color(105, 240, 220), - new Color(64, 130, 145), - new Color(145, 96, 145), - new Color(242, 112, 73), - new Color(199, 62, 62), - }; - // See RogueWeapon.cs for rogue modifier shit #region Modifiers public CalamityGlobalItem() diff --git a/Projectiles/Boss/DraedonSummonLaser.cs b/Projectiles/Boss/DraedonSummonLaser.cs index 94c75abafd..8c13fbe34c 100644 --- a/Projectiles/Boss/DraedonSummonLaser.cs +++ b/Projectiles/Boss/DraedonSummonLaser.cs @@ -10,17 +10,6 @@ namespace CalamityMod.Projectiles.Boss { public class DraedonSummonLaser : ModProjectile { - internal static readonly Color[] ExoPalette = new Color[] - { - new Color(250, 255, 112), - new Color(211, 235, 108), - new Color(166, 240, 105), - new Color(105, 240, 220), - new Color(64, 130, 145), - new Color(145, 96, 145), - new Color(242, 112, 73), - new Color(199, 62, 62), - }; public const float LaserLength = 3800f; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; @@ -49,7 +38,7 @@ namespace CalamityMod.Projectiles.Boss for (int i = 0; i < 36; i++) { Dust exoDust = Dust.NewDustPerfect(projectile.BottomRight, 267); - exoDust.color = CalamityUtils.MulticolorLerp(i / 36f, ExoPalette); + exoDust.color = CalamityUtils.MulticolorLerp(i / 36f, CalamityUtils.ExoPalette); exoDust.velocity = (MathHelper.TwoPi * i / 36f).ToRotationVector2() * new Vector2(3f, 1.45f) - Vector2.UnitY * 2f; exoDust.scale = 2.8f; exoDust.fadeIn = Main.rand.NextFloat(0.8f, 1.85f); @@ -59,7 +48,7 @@ namespace CalamityMod.Projectiles.Boss for (int i = 0; i < 10; i++) { Dust exoDust = Dust.NewDustPerfect(projectile.BottomRight, 267); - exoDust.color = CalamityUtils.MulticolorLerp(Main.rand.NextFloat(), ExoPalette); + exoDust.color = CalamityUtils.MulticolorLerp(Main.rand.NextFloat(), CalamityUtils.ExoPalette); exoDust.velocity = Main.rand.NextVector2Circular(2f, 2f); exoDust.scale = 4f; exoDust.fadeIn = 2f; @@ -79,7 +68,7 @@ namespace CalamityMod.Projectiles.Boss private Color PrimitiveColorFunction(float completionRatio) { - return CalamityUtils.MulticolorLerp((Main.GlobalTime * 0.67f - completionRatio * 3f) % 1f, ExoPalette) * 1.2f; + return CalamityUtils.MulticolorLerp((Main.GlobalTime * 0.67f - completionRatio * 3f) % 1f, CalamityUtils.ExoPalette) * 1.2f; } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Melee/PrismRay.cs b/Projectiles/Melee/PrismRay.cs index 7d3b81c3bd..7633d8682d 100644 --- a/Projectiles/Melee/PrismRay.cs +++ b/Projectiles/Melee/PrismRay.cs @@ -1,15 +1,15 @@ -using CalamityMod.Items; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Melee { public class PrismRay : ModProjectile { public Vector2 StartingPosition; - public Color RayColor => CalamityUtils.MulticolorLerp(RayHue, CalamityGlobalItem.ExoPalette); + public Color RayColor => CalamityUtils.MulticolorLerp(RayHue, CalamityUtils.ExoPalette); public Color HueDownscaledRayColor => RayColor * 0.66f; public ref float RayHue => ref projectile.ai[0]; public ref float Time => ref projectile.localAI[1]; diff --git a/Projectiles/Ranged/PrismExplosionLarge.cs b/Projectiles/Ranged/PrismExplosionLarge.cs index 6ed873f793..01671345d3 100644 --- a/Projectiles/Ranged/PrismExplosionLarge.cs +++ b/Projectiles/Ranged/PrismExplosionLarge.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Ranged for (int i = 0; i < 36; i++) { Vector2 lightDrawPosition = drawPosition + (MathHelper.TwoPi * i / 36f + Main.GlobalTime * 5f).ToRotationVector2() * projectile.scale * 20f; - Color lightBurstColor = CalamityUtils.MulticolorLerp(projectile.timeLeft / 144f, Items.CalamityGlobalItem.ExoPalette); + Color lightBurstColor = CalamityUtils.MulticolorLerp(projectile.timeLeft / 144f, CalamityUtils.ExoPalette); lightBurstColor = Color.Lerp(lightBurstColor, Color.White, 0.4f) * projectile.Opacity * 0.04f; lightBurstColor.A = 0; spriteBatch.Draw(lightTexture, lightDrawPosition, null, lightBurstColor, 0f, lightTexture.Size() * 0.5f, projectile.scale * 2.5f, SpriteEffects.None, 0f); diff --git a/Projectiles/Rogue/TheAtomSplitterDuplicate.cs b/Projectiles/Rogue/TheAtomSplitterDuplicate.cs index 0dfc874940..66582f3876 100644 --- a/Projectiles/Rogue/TheAtomSplitterDuplicate.cs +++ b/Projectiles/Rogue/TheAtomSplitterDuplicate.cs @@ -1,4 +1,3 @@ -using CalamityMod.Items; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -52,7 +51,7 @@ namespace CalamityMod.Projectiles.Rogue if (Time <= 1f) return false; - Color drawColor = CalamityUtils.MulticolorLerp((Time / 35f + projectile.identity / 4f) % 1f, CalamityGlobalItem.ExoPalette); + Color drawColor = CalamityUtils.MulticolorLerp((Time / 35f + projectile.identity / 4f) % 1f, CalamityUtils.ExoPalette); drawColor.A = 0; CalamityUtils.DrawAfterimagesCentered(projectile, ProjectileID.Sets.TrailingMode[projectile.type], drawColor); return false; diff --git a/Projectiles/Rogue/TheAtomSplitterProjectile.cs b/Projectiles/Rogue/TheAtomSplitterProjectile.cs index cb23b8ba13..4e05bf6e54 100644 --- a/Projectiles/Rogue/TheAtomSplitterProjectile.cs +++ b/Projectiles/Rogue/TheAtomSplitterProjectile.cs @@ -1,10 +1,7 @@ -using CalamityMod.Items; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using System; using System.IO; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue @@ -81,7 +78,7 @@ namespace CalamityMod.Projectiles.Rogue float dustVelocityArcOffset = 1.5f + (float)Math.Sin(MathHelper.TwoPi * projectile.timeLeft / 35f) * 0.25f; float colorInterpolant = (float)Math.Cos(MathHelper.TwoPi * projectile.timeLeft / 75f) * 0.5f + 0.5f; - Color dustColor = CalamityUtils.MulticolorLerp(colorInterpolant, CalamityGlobalItem.ExoPalette); + Color dustColor = CalamityUtils.MulticolorLerp(colorInterpolant, CalamityUtils.ExoPalette); Vector2 currentDirection = projectile.velocity.SafeNormalize(-Vector2.UnitY); Vector2 tipPosition = projectile.Center + currentDirection * (projectile.height * 0.67f - 3f); tipPosition += Main.rand.NextVector2CircularEdge(0.35f, 0.35f); @@ -132,7 +129,7 @@ namespace CalamityMod.Projectiles.Rogue for (float i = 0f; i < dustCount; i++) { - Color dustColor = CalamityUtils.MulticolorLerp(Main.rand.NextFloat(), CalamityGlobalItem.ExoPalette); + Color dustColor = CalamityUtils.MulticolorLerp(Main.rand.NextFloat(), CalamityUtils.ExoPalette); Dust explosionDust = Dust.NewDustDirect(spawnPosition, 0, 0, 267, 0f, 0f, 0, dustColor, 1f); explosionDust.position = spawnPosition; explosionDust.velocity = baseDustVelocity.RotatedBy(MathHelper.TwoPi * i / dustCount) * outwardFireSpeedFactor * Main.rand.NextFloat(0.8f, 1.2f); diff --git a/UI/DraedonDecryptUI.cs b/UI/DraedonDecryptUI.cs index 1178490da7..2c1ae1cae3 100644 --- a/UI/DraedonDecryptUI.cs +++ b/UI/DraedonDecryptUI.cs @@ -499,20 +499,8 @@ namespace CalamityMod.UI // And display a text indicator that describes the function of the button. // The color of the text cycles through the exo mech crystal palette. - Color[] exoPalette = new Color[] - { - new Color(250, 255, 112), - new Color(211, 235, 108), - new Color(166, 240, 105), - new Color(105, 240, 220), - new Color(64, 130, 145), - new Color(145, 96, 145), - new Color(242, 112, 73), - new Color(199, 62, 62), - }; - string contactText = "Contact"; - Color contactTextColor = CalamityUtils.MulticolorLerp((float)Math.Cos(Main.GlobalTime * 0.7f) * 0.5f + 0.5f, exoPalette); + Color contactTextColor = CalamityUtils.MulticolorLerp((float)Math.Cos(Main.GlobalTime * 0.7f) * 0.5f + 0.5f, CalamityUtils.ExoPalette); // Center the draw position. drawPosition.X -= Main.fontMouseText.MeasureString(contactText).X * 0.5f; diff --git a/Utilities/DrawingUtils.cs b/Utilities/DrawingUtils.cs index a3eefd6d7e..d0973a53f1 100644 --- a/Utilities/DrawingUtils.cs +++ b/Utilities/DrawingUtils.cs @@ -13,6 +13,18 @@ namespace CalamityMod { public static partial class CalamityUtils { + public static readonly Color[] ExoPalette = new Color[] + { + new Color(250, 255, 112), + new Color(211, 235, 108), + new Color(166, 240, 105), + new Color(105, 240, 220), + new Color(64, 130, 145), + new Color(145, 96, 145), + new Color(242, 112, 73), + new Color(199, 62, 62), + }; + #region Projectile Afterimages /// /// Draws a projectile as a series of afterimages. The first of these afterimages is centered on the center of the projectile's hitbox.
From 6ad5c8d66fca0e5d280862911bca438870c69573 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 31 Jul 2021 12:50:59 -0500 Subject: [PATCH 27/86] Animation time shortening --- NPCs/ExoMechs/Draedon.cs | 10 +++++----- World/CalamityWorld.cs | 2 +- World/WorldUpdateMiscEffects.cs | 27 +++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/NPCs/ExoMechs/Draedon.cs b/NPCs/ExoMechs/Draedon.cs index 0f44f09b0b..db3f9cca0b 100644 --- a/NPCs/ExoMechs/Draedon.cs +++ b/NPCs/ExoMechs/Draedon.cs @@ -49,13 +49,13 @@ namespace CalamityMod.NPCs.ExoMechs npc.netUpdate = true; } - if (Main.netMode != NetmodeID.MultiplayerClient && TalkTimer == 250f) + if (Main.netMode != NetmodeID.MultiplayerClient && TalkTimer == 190f) { CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.DraedonIntroductionText2", TextColor); npc.netUpdate = true; } - if (Main.netMode != NetmodeID.MultiplayerClient && TalkTimer == 330f) + if (Main.netMode != NetmodeID.MultiplayerClient && TalkTimer == 270f) { CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.DraedonIntroductionText3", TextColor); npc.netUpdate = true; @@ -64,13 +64,13 @@ namespace CalamityMod.NPCs.ExoMechs npc.velocity = Vector2.UnitY * Utils.InverseLerp(0f, 50f, TalkTimer, true) * Utils.InverseLerp(65f, 50f, TalkTimer, true) * -4.5f; // Make the screen rumble and summon the exo mechs. - if (TalkTimer < 435f) + if (TalkTimer < 375f) { Main.LocalPlayer.Calamity().GeneralScreenShakePower = Utils.InverseLerp(4200f, 1400f, Main.LocalPlayer.Distance(PlayerToFollow.Center), true) * 18f; - Main.LocalPlayer.Calamity().GeneralScreenShakePower *= Utils.InverseLerp(335f, 425f, TalkTimer, true); + Main.LocalPlayer.Calamity().GeneralScreenShakePower *= Utils.InverseLerp(275f, 375f, TalkTimer, true); } - if (TalkTimer == 430f) + if (TalkTimer == 370f) { if (Main.netMode != NetmodeID.MultiplayerClient) SummonExoMech(); diff --git a/World/CalamityWorld.cs b/World/CalamityWorld.cs index c172d3e141..b9654da196 100644 --- a/World/CalamityWorld.cs +++ b/World/CalamityWorld.cs @@ -167,7 +167,7 @@ namespace CalamityMod.World { get => DraedonSummonCountdown <= 0 && !NPC.AnyNPCs(ModContent.NPCType()) && !NPC.AnyNPCs(ModContent.NPCType()); } - public const int DraedonSummonCountdownMax = 450; + public const int DraedonSummonCountdownMax = 260; // Draedon Lab Locations. public static Vector2 SunkenSeaLabCenter; diff --git a/World/WorldUpdateMiscEffects.cs b/World/WorldUpdateMiscEffects.cs index e1713d1aee..6cc019c8db 100644 --- a/World/WorldUpdateMiscEffects.cs +++ b/World/WorldUpdateMiscEffects.cs @@ -11,12 +11,14 @@ using CalamityMod.NPCs.Crabulon; using CalamityMod.NPCs.Cryogen; using CalamityMod.NPCs.DesertScourge; using CalamityMod.NPCs.DevourerofGods; +using CalamityMod.NPCs.ExoMechs; using CalamityMod.NPCs.HiveMind; using CalamityMod.NPCs.NormalNPCs; using CalamityMod.NPCs.Perforator; using CalamityMod.NPCs.ProfanedGuardians; using CalamityMod.NPCs.Signus; using CalamityMod.NPCs.StormWeaver; +using CalamityMod.Projectiles.Boss; using CalamityMod.Tiles; using CalamityMod.Tiles.Abyss; using CalamityMod.Tiles.SunkenSea; @@ -36,6 +38,12 @@ namespace CalamityMod.World { public static void PerformWorldUpdates() { + if (DraedonSummonCountdown > 0) + { + DraedonSummonCountdown--; + HandleDraedonSummoning(); + } + // Sunken Sea Location...duh SunkenSeaLocation = new Rectangle(WorldGen.UndergroundDesertLocation.Left, WorldGen.UndergroundDesertLocation.Bottom, WorldGen.UndergroundDesertLocation.Width, WorldGen.UndergroundDesertLocation.Height / 2); @@ -101,6 +109,25 @@ namespace CalamityMod.World } } + #region Handle Draedon Summoning + + public static void HandleDraedonSummoning() + { + // Fire a giant laser into the sky. + if (Main.netMode != NetmodeID.MultiplayerClient && DraedonSummonCountdown == DraedonSummonCountdownMax - 45) + Projectile.NewProjectile(DraedonSummonPosition + Vector2.UnitY * 80f, Vector2.Zero, ModContent.ProjectileType(), 70, 0f); + + if (DraedonSummonCountdown < 150) + { + float fadeToWhite = Utils.InverseLerp(150f, 90f, DraedonSummonCountdown, true) * Utils.InverseLerp(30f, 50f, DraedonSummonCountdown, true); + MoonlordDeathDrama.RequestLight(fadeToWhite, Main.LocalPlayer.Center); + } + + if (DraedonSummonCountdown == 0) + NPC.NewNPC((int)DraedonSummonPosition.X, (int)DraedonSummonPosition.Y, ModContent.NPCType()); + } + #endregion Handle Draedon Summoning + #region Handle Tile Growing public static void HandleTileGrowth() From da9d127125b8bef08af376d8131f758bfe9d60bd Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 31 Jul 2021 14:59:56 -0500 Subject: [PATCH 28/86] Repair Unit critter for labs --- ILEditing/ILChanges.cs | 11 + NPCs/CalamityGlobalNPC.cs | 58 +++- NPCs/DraedonLabThings/RepairUnitCritter.cs | 284 ++++++++++++++++++ NPCs/DraedonLabThings/RepairUnitCritter.png | Bin 0 -> 4218 bytes .../RepairUnitCritterGlowmask.png | Bin 0 -> 1021 bytes Utilities/CollisionUtils.cs | 29 ++ World/WorldUpdateMiscEffects.cs | 10 + 7 files changed, 390 insertions(+), 2 deletions(-) create mode 100644 NPCs/DraedonLabThings/RepairUnitCritter.cs create mode 100644 NPCs/DraedonLabThings/RepairUnitCritter.png create mode 100644 NPCs/DraedonLabThings/RepairUnitCritterGlowmask.png diff --git a/ILEditing/ILChanges.cs b/ILEditing/ILChanges.cs index b8c4f9aa46..06896d8916 100644 --- a/ILEditing/ILChanges.cs +++ b/ILEditing/ILChanges.cs @@ -131,6 +131,7 @@ namespace CalamityMod.ILEditing On.Terraria.Main.DrawCursor += UseCoolFireCursorEffect; IL.Terraria.Main.DrawInterface_40_InteractItemIcon += MakeMouseHoverItemsSupportAnimations; On.Terraria.Item.AffixName += IncorporateEnchantmentInAffix; + On.Terraria.NPC.ApplyTileCollision += AllowTriggeredFallthrough; } /// @@ -166,6 +167,7 @@ namespace CalamityMod.ILEditing On.Terraria.Main.DrawCursor -= UseCoolFireCursorEffect; IL.Terraria.Main.DrawInterface_40_InteractItemIcon -= MakeMouseHoverItemsSupportAnimations; On.Terraria.Item.AffixName -= IncorporateEnchantmentInAffix; + On.Terraria.NPC.ApplyTileCollision -= AllowTriggeredFallthrough; } #region IL Editing Routines @@ -599,6 +601,15 @@ namespace CalamityMod.ILEditing #endregion #region IL Editing Injected/Hooked Functions + + // Why this isn't a mechanism provided by TML itself or vanilla itself is beyond me. + private static void AllowTriggeredFallthrough(On.Terraria.NPC.orig_ApplyTileCollision orig, NPC self, bool fall, Vector2 cPosition, int cWidth, int cHeight) + { + if (self.active && self.Calamity().ShouldFallThroughPlatforms) + fall = true; + orig(self, fall, cPosition, cWidth, cHeight); + } + private static void BossRushLifeBytes(On.Terraria.Main.orig_InitLifeBytes orig) { orig(); diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 34d75aec1c..5bee45da8a 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -63,6 +63,10 @@ using Terraria.Graphics.Effects; using Terraria.ID; using Terraria.ModLoader; using static Terraria.ModLoader.ModContent; +using CalamityMod.Walls.DraedonStructures; +using System.Reflection; +using Terraria.Utilities; +using CalamityMod.NPCs.DraedonLabThings; namespace CalamityMod.NPCs { @@ -73,6 +77,8 @@ namespace CalamityMod.NPCs public int KillTime { get; set; } = 0; + public bool ShouldFallThroughPlatforms; + /// /// If this is set to true, the NPC's DR cannot be reduced via any means. This applies regardless of whether customDR is true or false. /// @@ -1017,6 +1023,8 @@ namespace CalamityMod.NPCs #region Set Defaults public override void SetDefaults(NPC npc) { + ShouldFallThroughPlatforms = false; + for (int i = 0; i < maxPlayerImmunities; i++) dashImmunityTime[i] = 0; @@ -4211,9 +4219,55 @@ namespace CalamityMod.NPCs safeRangeX = (int)(1920 / 16 * 0.32); //0.52 } } - #endregion + #endregion + + #region Edit Spawn Pool + + internal static readonly FieldInfo MaxSpawnsField = typeof(NPC).GetField("maxSpawns", BindingFlags.NonPublic | BindingFlags.Static); + public static void AttemptToSpawnLabCritters(Player player) + { + if (Main.netMode == NetmodeID.MultiplayerClient) + return; + + int spawnRate = 400; + int maxSpawnCount = (int)MaxSpawnsField.GetValue(null); + NPCLoader.EditSpawnRate(player, ref spawnRate, ref maxSpawnCount); + for (int i = 0; i < 18; i++) + { + int checkPositionX = (int)(player.Center.X / 16 + Main.rand.Next(30, 54) * Main.rand.NextBool(2).ToDirectionInt()); + int checkPositionY = (int)(player.Center.Y / 16 + Main.rand.Next(24, 45) * Main.rand.NextBool(2).ToDirectionInt()); + Vector2 checkPosition = new Vector2(checkPositionX, checkPositionY); + + Tile aboveSpawnTile = CalamityUtils.ParanoidTileRetrieval(checkPositionX, checkPositionY - 1); + bool nearLab = CalamityUtils.ManhattanDistance(checkPosition, CalamityWorld.SunkenSeaLabCenter / 16f) < 180f; + nearLab |= CalamityUtils.ManhattanDistance(checkPosition, CalamityWorld.PlanetoidLabCenter / 16f) < 180f; + nearLab |= CalamityUtils.ManhattanDistance(checkPosition, CalamityWorld.JungleLabCenter / 16f) < 180f; + nearLab |= CalamityUtils.ManhattanDistance(checkPosition, CalamityWorld.HellLabCenter / 16f) < 180f; + nearLab |= CalamityUtils.ManhattanDistance(checkPosition, CalamityWorld.IceLabCenter / 16f) < 180f; + + bool isLabWall = aboveSpawnTile.wall == WallType() || aboveSpawnTile.wall == WallType() || aboveSpawnTile.wall == WallType(); + isLabWall |= aboveSpawnTile.wall == WallType() || aboveSpawnTile.wall == WallType() || aboveSpawnTile.wall == WallType(); + if (!isLabWall || !nearLab || Collision.SolidCollision((checkPosition - new Vector2(2f, 2f)).ToWorldCoordinates(), 4, 4) || player.activeNPCs >= maxSpawnCount || !Main.rand.NextBool(spawnRate)) + continue; + + WeightedRandom pool = new WeightedRandom(); + pool.Add(NPCID.None, 0f); + pool.Add(NPCType(), 0.5f); + + int typeToSpawn = pool.Get(); + if (typeToSpawn != NPCID.None) + { + int spawnedNPC = NPCLoader.SpawnNPC(typeToSpawn, checkPositionX, checkPositionY - 1); + if (Main.netMode == NetmodeID.Server && spawnedNPC < Main.maxNPCs) + { + Main.npc[spawnedNPC].position.Y -= 8f; + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, spawnedNPC); + return; + } + } + } + } - #region Edit Spawn Pool public override void EditSpawnPool(IDictionary pool, NPCSpawnInfo spawnInfo) { bool calamityBiomeZone = spawnInfo.player.Calamity().ZoneAbyss || diff --git a/NPCs/DraedonLabThings/RepairUnitCritter.cs b/NPCs/DraedonLabThings/RepairUnitCritter.cs new file mode 100644 index 0000000000..678a9cff58 --- /dev/null +++ b/NPCs/DraedonLabThings/RepairUnitCritter.cs @@ -0,0 +1,284 @@ +using CalamityMod.Walls.DraedonStructures; +using CalamityMod.World; +using Microsoft.Xna.Framework; +using System; +using System.IO; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.NPCs.DraedonLabThings +{ + public class RepairUnitCritter : ModNPC + { + public enum BehaviorState + { + WalkAround, + WalkOnWalls, + SitAndRecharge + } + + public Vector2 PreviousStuckPosition = Vector2.Zero; + + public BehaviorState CurrentState + { + get => (BehaviorState)(int)npc.ai[0]; + set => npc.ai[0] = (int)value; + } + + public ref float StuckCount => ref npc.ai[1]; + + public bool Initialized + { + get => npc.ai[2] == 1f; + set => npc.ai[2] = value.ToInt(); + } + public bool WantsToClimbOnSomeWall + { + get => npc.ai[3] == 1f; + set => npc.ai[3] = value.ToInt(); + } + + public ref float CurrentFrame => ref npc.localAI[0]; + public ref float Time => ref npc.localAI[1]; + public ref float ClimbTime => ref npc.localAI[2]; + + public const float Gravity = 0.4f; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Repair Unit"); + Main.npcFrameCount[npc.type] = 17; + } + + public override void SetDefaults() + { + npc.aiStyle = -1; + aiType = -1; + npc.damage = 0; + npc.width = 20; + npc.height = 22; + npc.lifeMax = 80; + npc.knockBackResist = 0f; + npc.noGravity = true; + npc.noTileCollide = false; + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath44; + } + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(Time); + writer.Write(ClimbTime); + writer.WriteVector2(PreviousStuckPosition); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + Time = reader.ReadSingle(); + ClimbTime = reader.ReadSingle(); + PreviousStuckPosition = reader.ReadVector2(); + } + + public override void AI() + { + if (!Initialized) + { + npc.velocity = Vector2.UnitX * Main.rand.NextBool(2).ToDirectionInt() * 1.5f; + Initialized = true; + } + + npc.Calamity().ShouldFallThroughPlatforms = false; + switch (CurrentState) + { + case BehaviorState.WalkAround: + WalkAroundOnGround(); + ClimbTime = 0f; + break; + case BehaviorState.WalkOnWalls: + WalkOnWalls(); + ClimbTime++; + break; + } + Time++; + } + + public void WalkAroundOnGround() + { + // Fall onto the ground if mid-air. + npc.frameCounter += npc.velocity.Length() + 0.4f; + + Tile tileBelow = CalamityUtils.ParanoidTileRetrieval((int)(npc.Bottom.X / 16), (int)(npc.Bottom.Y / 16) + 1); + bool onSolidGround = WorldGen.SolidTile(tileBelow) || (tileBelow.active() && Main.tileSolidTop[tileBelow.type]); + float directionSign = Math.Sign(npc.velocity.X); + if (directionSign == 0f) + directionSign = npc.spriteDirection; + if (Math.Abs(npc.velocity.X) > 0.5f && onSolidGround) + npc.velocity.X = MathHelper.Lerp(npc.velocity.X, directionSign * 5f, 0.05f); + + // Enforce gravity. + npc.velocity.Y = MathHelper.Clamp(npc.velocity.Y + Gravity, -15f, 15f); + + // Handle directioning. + if (Math.Abs(npc.velocity.X) > 0.4f) + npc.spriteDirection = (npc.velocity.X > 0f).ToDirectionInt(); + + // Attempt to jump over gaps if they aren't too big. + Vector2 checkPosition = npc.Bottom + new Vector2(Math.Sign(npc.velocity.X) * 24f, 12f); + float? distanceToAheadBelowTile = CalamityUtils.DistanceToTileCollisionHit(checkPosition, Vector2.UnitX * directionSign); + if (onSolidGround && distanceToAheadBelowTile.HasValue && distanceToAheadBelowTile.Value >= 2 && distanceToAheadBelowTile.Value < 9) + { + Vector2 jumpDestination = npc.Center + Vector2.UnitX * npc.spriteDirection * (distanceToAheadBelowTile.Value * 16f + 8f); + npc.velocity = CalamityUtils.GetProjectilePhysicsFiringVelocity(npc.Center, jumpDestination, Gravity, 6f); + } + + // Attempt to jump over vertical obstacles. + bool obstacleInWay = !Collision.CanHit(npc.Center - Vector2.UnitX * directionSign * 8f, 2, 2, npc.Center + Vector2.UnitX * directionSign * 80f, 8, 8); + if (onSolidGround && obstacleInWay) + { + Vector2 jumpDestination = npc.Center + Vector2.UnitX * npc.spriteDirection * 132f; + float? distanceToObstacle = CalamityUtils.DistanceToTileCollisionHit(npc.Center, Vector2.UnitX * directionSign); + float obstacleHeight = 0f; + for (int i = 0; i < 15; i++) + { + if (WorldGen.SolidTile((int)(npc.Center.X / 16 + (distanceToObstacle ?? 0) * npc.spriteDirection), (int)(npc.Center.Y / 16) - i)) + obstacleHeight++; + } + npc.velocity = CalamityUtils.GetProjectilePhysicsFiringVelocity(npc.Center, jumpDestination, Gravity, 6f + StuckCount * 0.7f + obstacleHeight * 0.4f); + + if (MathHelper.Distance(npc.position.X, npc.oldPosition.X) < 0.2f) + { + StuckCount++; + if (StuckCount > 1f && !WantsToClimbOnSomeWall) + WantsToClimbOnSomeWall = true; + if (StuckCount > 2f) + { + npc.velocity.X *= -0.56f; + StuckCount = 0f; + } + PreviousStuckPosition = npc.Center; + } + npc.netUpdate = true; + } + + bool closeObstacleInWay = !Collision.CanHit(npc.Center, 2, 2, npc.Center + Vector2.UnitX * directionSign * 34f, 8, 8); + if (onSolidGround && closeObstacleInWay) + { + npc.velocity.X *= -0.7f; + npc.netUpdate = true; + } + + // Reset the stuck counter if the NPC has become sufficiently far away from the previous stuck postion, indicating that + // it is in fact, no longer stuck. + if (!npc.WithinRange(PreviousStuckPosition, 180f) && StuckCount > 0f) + { + StuckCount = 0f; + npc.netUpdate = true; + } + + // Handle walking frames. + if (npc.frameCounter >= 11f && Math.Abs(npc.velocity.Y) < 1f) + { + CurrentFrame = (CurrentFrame + 1f) % 8f; + npc.frameCounter = 0; + } + + if (Time % 300f == 299f && !WantsToClimbOnSomeWall) + { + WantsToClimbOnSomeWall = true; + npc.netUpdate = true; + } + + // If there are walls to clime on and this NPC wants to climb on some, do so. + if (WantsToClimbOnSomeWall && CalamityUtils.ParanoidTileRetrieval((int)npc.Center.X / 16, (int)npc.Center.Y / 16).wall > 0) + { + CurrentState = BehaviorState.WalkOnWalls; + StuckCount = 0f; + WantsToClimbOnSomeWall = false; + npc.position.Y -= 10f; + npc.netUpdate = true; + } + } + + public void WalkOnWalls() + { + StuckCount = 0f; + WantsToClimbOnSomeWall = false; + npc.Calamity().ShouldFallThroughPlatforms = true; + + // Generate unusual movement patterns based on sines. + // When two periodic functions are summed, the resulting function is periodic if the + // ratio of the b/a is rational, given periodic functions f and g: + // f(a * x) + g(b * x). However, if the ratio is irrational, then the result has no period. + // This is desirable for somewhat random wavy fluctuations. + // In this case, pi/1 (or simply pi) is used, which is indeed an irrational number. + float offsetAngle = (float)(Math.Sin(Time / 360f) + Math.Sin(MathHelper.Pi * Time / 360f)) * 0.003f; + + Vector2 currentDirection = npc.velocity.SafeNormalize((npc.rotation - MathHelper.PiOver2).ToRotationVector2()); + + // Turn much more quickly if there's no wall ahead. + Vector2 aheadCheckPosition = npc.Center + currentDirection * 120f; + Tile aheadTile = CalamityUtils.ParanoidTileRetrieval((int)(aheadCheckPosition.X / 16), (int)(aheadCheckPosition.Y / 16)); + bool aboutToCollideWithSomething = CalamityUtils.DistanceToTileCollisionHit(npc.Center - currentDirection * 5f, currentDirection) < 6f; + bool almostReadyToWalkAgain = ClimbTime > 445f; + + if (((aheadTile.wall == WallID.None || WorldGen.SolidTile(aheadTile)) && !almostReadyToWalkAgain) || aboutToCollideWithSomething) + { + float distanceToCollisionLeft = CalamityUtils.DistanceToTileCollisionHit(npc.Center - currentDirection.RotatedBy(MathHelper.PiOver2) * 5f, currentDirection.RotatedBy(MathHelper.PiOver2)) ?? 10000f; + float distanceToCollisionRight = CalamityUtils.DistanceToTileCollisionHit(npc.Center - currentDirection.RotatedBy(-MathHelper.PiOver2) * 5f, currentDirection.RotatedBy(-MathHelper.PiOver2)) ?? 10000f; + float steerRotation = distanceToCollisionLeft > distanceToCollisionRight ? MathHelper.PiOver2 : -MathHelper.PiOver2; + Vector2 idealVelocity = npc.velocity.RotatedBy(steerRotation); + npc.velocity = npc.velocity.MoveTowards(idealVelocity, 0.95f); + } + else + npc.velocity = npc.velocity.RotatedBy(offsetAngle); + npc.velocity = npc.velocity.SafeNormalize(Vector2.Zero) * 1.56f; + + // Rebound on collision. + if (npc.collideX) + { + npc.velocity.X *= -0.8f; + npc.Center += npc.velocity * 2f; + } + if (npc.collideY) + { + npc.velocity.Y *= -0.8f; + npc.Center += npc.velocity * 2f; + } + + if (npc.velocity.Length() > 1.4f) + npc.rotation = npc.rotation.AngleLerp(npc.velocity.ToRotation() + MathHelper.PiOver2, 0.2f); + + if (Collision.SolidCollision(npc.position + Vector2.One * 24f, npc.width - 12, npc.height - 12)) + { + npc.velocity *= -1f; + npc.position.Y -= 5f; + } + + // Handle climbing frames. + npc.frameCounter++; + if (npc.frameCounter >= 4f) + { + if (CurrentFrame < 9) + CurrentFrame = 9f; + CurrentFrame++; + if (CurrentFrame >= Main.npcFrameCount[npc.type]) + CurrentFrame = 9f; + npc.frameCounter = 0; + } + + if (CalamityUtils.ParanoidTileRetrieval((int)(npc.Center.X / 16), (int)(npc.Center.Y / 16)).wall == WallID.None || ClimbTime > 620f) + { + CurrentState = BehaviorState.WalkAround; + npc.velocity = new Vector2(Main.rand.NextBool(2).ToDirectionInt() * 1.2f, 3f); + npc.rotation = 0f; + npc.netUpdate = true; + } + } + + public override void FindFrame(int frameHeight) + { + npc.frame.Y = (int)(CurrentFrame * frameHeight); + } + } +} diff --git a/NPCs/DraedonLabThings/RepairUnitCritter.png b/NPCs/DraedonLabThings/RepairUnitCritter.png new file mode 100644 index 0000000000000000000000000000000000000000..a7ff5c8d1cf535354d34dc52a285b934630f5c93 GIT binary patch literal 4218 zcmZ`-c{tSHzyC;^`eihdvc^miq9oZ$F_=*q%Z#BcWywxs>;~0WF%x6UzD9iw!)Pi( zW273&GWI29h>$%r#*FPw_qoq~?mzdhvpwfL=e*DB^?JX~Ay`_N9XcR&004kP2sq4I zP^tsKE~EW>1+_*oj-j9s!daUc0aTXE3;>8}Az)WgVR;Mr9sV*c5|5DAWKxUWx{JxM z17onWyP6Ivd||2X5lL1n!F(3~>9u)k`P7yFK;toAzdVq9kn+e)IK{Q+DF<`VaTdxW%l(BO-#Mo1WxaD-J2w$47sg$5>{-q<)qNsj zcTo0(1S5o_0*v*~4Jzqc+;(;CjqEqZ6xlKRwJlz}t*HTk05%rM*Rkl{;7XV;;b)-o|?8TAcmXTV<0$si8O2rDLMCZOZ zu-?0LIfUI9J+T)UW4`ua%@yL;kkg?m{3q|^!y4CnWALK4mz~1@OiHrq(5374GJ^&2 zNlAl3d8*JK52L1p4pz`&Sh_6yRVpv9QTtWbShOY5oT!_6rGYU9Sc0i zt*zB*ws19raMbVE8Kba*EG6KcN9bFj`=uKjz|o0t8u8)^f*0p(2;8Ioj2vY90ArJs z%>1n-4u`WBASERsfiZ3)uX1(Ud1w0~@ZMK@LcE)25Ut_mh*%PTW5@glQj}Tcv|`3y zun0);`?J12w84$s*vDErGnv;38D70&T`^u#xV{xBKfc`nDoKjD7by<%57?WeYP>OLRs(Y4@jiCGD2XS$Nk$Jw3f3c9r@q z%2dm(@Qmlb?vP;jiy%$-eXpr7J@FifLVAF%C<_al62l;u#ex*Gb~1>q|B*NcQa(BZ z7n?GYi^^ULpAveMY<>-6QDZ+NL_5^x`C+ii*U1YQTln#fwMuqgW{^H9DYn9YimwWK zT4hCeM&2??xzf^y02w*iY)H2WMjGUf&gX)XNOXA@Qta)k*smEk{TR3)>g26ork^h- zn9hsW+A$+1|BZseAUJ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j z?c>$E{MKjd_tI8;G{57O2G0)rnV=KjD^+)u>&wehN-4KrzLZj=ZgE;ai79Qx2S1&r zpOf#Rt85rt@w2o4|IWI~p_qIAqT&DmK()!PJB;3YrriN~J}1yv>$!L@ZCA1IXzr1S zHuxTiA3wgAQX~>_t}ZXj)pN@HI}!q_^0l4?t7`?y3R znnVHsYB&onn)42$RcAo&-@PlPl=9E#&o92NPb2_;0a83!?AOBVYJcTRj!|(Z1DH( z?KCUe)9F-v-|s3C2>_sl>kn7u`omT0W%#ZFhibB2e*a9vySr~=-*PW$yUO5-FPE!Q z%Fm}pZey-8mDW%HO<{9fE@k + /// The point to check from. + /// The direction in which tiles are checked. Will always be a unit vector. + public static float? DistanceToTileCollisionHit(Vector2 startingPoint, Vector2 checkDirection, int giveUpLimit = 500) + { + // Ensure that the check direction is normalized. + checkDirection = checkDirection.SafeNormalize(Vector2.Zero); + + for (int i = 1; i < giveUpLimit; i++) + { + Point checkPosition = startingPoint.ToTileCoordinates(); + checkPosition.X += (int)(checkDirection.X * i); + checkPosition.Y += (int)(checkDirection.Y * i); + + // Don't bother checking any further if the check has left the world. + if (!WorldGen.InWorld(checkPosition.X, checkPosition.Y, 2)) + return null; + + // If a solid tile is hit, return the distance. + // Since Terraria's tile coordinate system is discrete and does not care for more advanced concepts, + // the amount of tiles searched such far is a sufficient answer. + Tile tile = ParanoidTileRetrieval(checkPosition.X, checkPosition.Y); + if (WorldGen.SolidTile(tile) || (checkDirection.Y > 0f && tile.active() && Main.tileSolidTop[tile.type])) + return i; + } + return null; + } } } diff --git a/World/WorldUpdateMiscEffects.cs b/World/WorldUpdateMiscEffects.cs index 6cc019c8db..e2ac416645 100644 --- a/World/WorldUpdateMiscEffects.cs +++ b/World/WorldUpdateMiscEffects.cs @@ -97,6 +97,16 @@ namespace CalamityMod.World if (!downedDesertScourge && Main.netMode != NetmodeID.MultiplayerClient && !Main.hardMode) CalamityUtils.StopSandstorm(); + // Attempt to summon lab critters manually since they refuse to exist when using vanilla's spawn methods. + // This needs to check all players since the method only runs server-side. + for (int i = 0; i < Main.maxPlayers; i++) + { + if (!Main.player[i].active || Main.player[i].dead) + continue; + + CalamityGlobalNPC.AttemptToSpawnLabCritters(Main.player[i]); + } + // Make the cultist countdown happen much more quickly. if (Main.netMode != NetmodeID.MultiplayerClient) { From b1be78586fb97ee5f5ef08982dfb650653b6cff6 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 31 Jul 2021 18:33:08 -0500 Subject: [PATCH 29/86] Hit effects and loot for repair units --- Gores/DraedonLabCritters/RepairUnit1.png | Bin 0 -> 186 bytes Gores/DraedonLabCritters/RepairUnit2.png | Bin 0 -> 178 bytes Gores/DraedonLabCritters/RepairUnit3.png | Bin 0 -> 227 bytes NPCs/DraedonLabThings/RepairUnitCritter.cs | 33 +++++++++++++++++++-- 4 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 Gores/DraedonLabCritters/RepairUnit1.png create mode 100644 Gores/DraedonLabCritters/RepairUnit2.png create mode 100644 Gores/DraedonLabCritters/RepairUnit3.png diff --git a/Gores/DraedonLabCritters/RepairUnit1.png b/Gores/DraedonLabCritters/RepairUnit1.png new file mode 100644 index 0000000000000000000000000000000000000000..c7fa6eae856aec1fc11e82ef264bce2b0780192d GIT binary patch literal 186 zcmeAS@N?(olHy`uVBq!ia0vp^96-#&!3-ob9C+3PDaPU;cPEB*=VV?2IV|apzK#qG z8~eHcB(j232Ka=yva+(OD60lJI{^g}V&@cr)RhGJ1^@s5pTR+E;L?!K~Z35*gqYF-%3P|ILyYdZekuF;TZLSEBa7Iull3?KI$VC9%`-~a=I{&xPn U_P-W8fkrZTy85}Sb4q9e0L%$CVE_OC literal 0 HcmV?d00001 diff --git a/Gores/DraedonLabCritters/RepairUnit3.png b/Gores/DraedonLabCritters/RepairUnit3.png new file mode 100644 index 0000000000000000000000000000000000000000..971883e554874e9bbd3c06777a608c26b55469dc GIT binary patch literal 227 zcmeAS@N?(olHy`uVBq!ia0vp^0zk~i!3-n?Kj!QJQjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`MFV_7Tv=IJgPfg;JZ&1Hd`%5ayaNM)GL!k3gn$%#NswRge=uN>@@94e z3UL;AL>2=rIS9gxJ0@no1q!-&x;TbNgqNOmo)m zk8D=K&>h7MJ=P`%)};MvsaEb;EZUS+d)sY8_?rC}USz3Fs$r;G$Edl|$w&og9)qW= KpUXO@geCw(1V&{5 literal 0 HcmV?d00001 diff --git a/NPCs/DraedonLabThings/RepairUnitCritter.cs b/NPCs/DraedonLabThings/RepairUnitCritter.cs index 678a9cff58..c01975ffba 100644 --- a/NPCs/DraedonLabThings/RepairUnitCritter.cs +++ b/NPCs/DraedonLabThings/RepairUnitCritter.cs @@ -1,6 +1,8 @@ +using CalamityMod.Items.DraedonMisc; using CalamityMod.Walls.DraedonStructures; using CalamityMod.World; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using System; using System.IO; using Terraria; @@ -129,7 +131,7 @@ namespace CalamityMod.NPCs.DraedonLabThings if (onSolidGround && distanceToAheadBelowTile.HasValue && distanceToAheadBelowTile.Value >= 2 && distanceToAheadBelowTile.Value < 9) { Vector2 jumpDestination = npc.Center + Vector2.UnitX * npc.spriteDirection * (distanceToAheadBelowTile.Value * 16f + 8f); - npc.velocity = CalamityUtils.GetProjectilePhysicsFiringVelocity(npc.Center, jumpDestination, Gravity, 6f); + npc.velocity = CalamityUtils.GetProjectilePhysicsFiringVelocity(npc.Center, jumpDestination, Gravity, 8.5f); } // Attempt to jump over vertical obstacles. @@ -144,7 +146,7 @@ namespace CalamityMod.NPCs.DraedonLabThings if (WorldGen.SolidTile((int)(npc.Center.X / 16 + (distanceToObstacle ?? 0) * npc.spriteDirection), (int)(npc.Center.Y / 16) - i)) obstacleHeight++; } - npc.velocity = CalamityUtils.GetProjectilePhysicsFiringVelocity(npc.Center, jumpDestination, Gravity, 6f + StuckCount * 0.7f + obstacleHeight * 0.4f); + npc.velocity = CalamityUtils.GetProjectilePhysicsFiringVelocity(npc.Center, jumpDestination, Gravity, 9f + StuckCount * 0.7f + obstacleHeight * 0.4f); if (MathHelper.Distance(npc.position.X, npc.oldPosition.X) < 0.2f) { @@ -276,9 +278,36 @@ namespace CalamityMod.NPCs.DraedonLabThings } } + public override void HitEffect(int hitDirection, double damage) + { + for (int i = 0; i < 6; i++) + Dust.NewDustDirect(npc.position, npc.width, npc.height, 226); + if (npc.life <= 0) + { + for (int i = 1; i <= 3; i++) + Gore.NewGorePerfect(npc.Center, npc.velocity.RotatedByRandom(0.3f) * Main.rand.NextFloat(0.7f, 1f), mod.GetGoreSlot($"Gores/DraedonLabCritters/RepairUnit{i}")); + } + } + + public override void NPCLoot() + { + DropHelper.DropItemChance(npc, ModContent.ItemType(), 2, 2, 4); + } + public override void FindFrame(int frameHeight) { npc.frame.Y = (int)(CurrentFrame * frameHeight); } + + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) + { + Texture2D critterTexture = Main.npcTexture[npc.type]; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/NPCs/DraedonLabThings/RepairUnitCritterGlowmask"); + Vector2 drawPosition = npc.Center - Main.screenPosition + Vector2.UnitY * npc.gfxOffY; + SpriteEffects direction = npc.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + spriteBatch.Draw(critterTexture, drawPosition, npc.frame, npc.GetAlpha(drawColor), npc.rotation, npc.frame.Size() * 0.5f, npc.scale, direction, 0f); + spriteBatch.Draw(glowmask, drawPosition, npc.frame, npc.GetAlpha(Color.White), npc.rotation, npc.frame.Size() * 0.5f, npc.scale, direction, 0f); + return false; + } } } From a7a6ba2b2d843bb76d946de18c2f28cad199ae1d Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Sun, 8 Aug 2021 23:01:37 -0500 Subject: [PATCH 30/86] Glitch shader comments --- Effects/GlitchShader.fx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Effects/GlitchShader.fx b/Effects/GlitchShader.fx index 3aa1ca8ee0..f03db8e66c 100644 --- a/Effects/GlitchShader.fx +++ b/Effects/GlitchShader.fx @@ -15,7 +15,18 @@ float2 uImageSize1; float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0 { - float horizontalOffset = pow((sin(coords.y * 17.07947 + uTime * 16) + sin(coords.y * 25.13274)) * 0.5, 3) * uOpacity * 0.46; + // 17.07947 is 2pi * e, while 25.13274 is 8pi. + // When two sinusoids are added in this way and the periods of each sinusoid are irrational, + // the resulting sinusoid from the addition has no period, meaning that it has pseudo-random + // bumps and valleys. This is ideal for a glitch effect. The * 0.5 at the end is make the range + // of the result be -1 to 1 like a typical sine. + float offsetBase = (sin(coords.y * 17.07947 + uTime * 16) + sin(coords.y * 25.13274)) * 0.5; + + // Here, a power is used to make the valleys and hills sharper, and bias everything else + // towards 0, making horizontal stretches more noticable and powerful when they happen. + // Higher values of uOpacity will result in more powerful offsets, with a uOpacity of 0 + // doing nothing at all. + float horizontalOffset = pow(offsetBase, 3) * uOpacity * 0.46; float2 samplePosition = float2(saturate(coords.x + horizontalOffset), coords.y); return tex2D(uImage0, samplePosition); } From 38bffec24a2f76f01d7ec5ed346f8a34ef0b7e45 Mon Sep 17 00:00:00 2001 From: Dominic Date: Mon, 9 Aug 2021 16:03:23 -0500 Subject: [PATCH 31/86] The Draedon Summoner works for Ares --- NPCs/ExoMechs/Draedon.cs | 3 ++- World/CalamityWorld.cs | 4 +++- World/WorldUpdateMiscEffects.cs | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/NPCs/ExoMechs/Draedon.cs b/NPCs/ExoMechs/Draedon.cs index db3f9cca0b..8ea1c50e24 100644 --- a/NPCs/ExoMechs/Draedon.cs +++ b/NPCs/ExoMechs/Draedon.cs @@ -1,3 +1,4 @@ +using CalamityMod.NPCs.ExoMechs.Ares; using CalamityMod.NPCs.ExoMechs.Thanatos; using Microsoft.Xna.Framework; using Terraria; @@ -106,7 +107,7 @@ namespace CalamityMod.NPCs.ExoMechs thanatos.velocity = thanatos.SafeDirectionTo(PlayerToFollow.Center) * 40f; break; case ExoMech.Prime: - //CalamityUtils.SpawnBossBetter(aresSpawnPosition, ModContent.NPCType()); + CalamityUtils.SpawnBossBetter(aresSpawnPosition, ModContent.NPCType()); break; case ExoMech.Twins: //CalamityUtils.SpawnBossBetter(artemisSpawnPosition, ModContent.NPCType()); diff --git a/World/CalamityWorld.cs b/World/CalamityWorld.cs index d50cc7fd0d..79516b1860 100644 --- a/World/CalamityWorld.cs +++ b/World/CalamityWorld.cs @@ -13,6 +13,7 @@ using CalamityMod.NPCs.Cryogen; using CalamityMod.NPCs.DesertScourge; using CalamityMod.NPCs.DevourerofGods; using CalamityMod.NPCs.ExoMechs; +using CalamityMod.NPCs.ExoMechs.Ares; using CalamityMod.NPCs.ExoMechs.Thanatos; using CalamityMod.NPCs.HiveMind; using CalamityMod.NPCs.NormalNPCs; @@ -165,7 +166,8 @@ namespace CalamityMod.World public static Vector2 DraedonSummonPosition = Vector2.Zero; public static bool AbleToSummonDraedon { - get => DraedonSummonCountdown <= 0 && !NPC.AnyNPCs(ModContent.NPCType()) && !NPC.AnyNPCs(ModContent.NPCType()); + get => DraedonSummonCountdown <= 0 && !NPC.AnyNPCs(ModContent.NPCType()) && + !NPC.AnyNPCs(ModContent.NPCType()) && !NPC.AnyNPCs(ModContent.NPCType()); } public const int DraedonSummonCountdownMax = 260; diff --git a/World/WorldUpdateMiscEffects.cs b/World/WorldUpdateMiscEffects.cs index 62124a142c..980af7851d 100644 --- a/World/WorldUpdateMiscEffects.cs +++ b/World/WorldUpdateMiscEffects.cs @@ -134,7 +134,7 @@ namespace CalamityMod.World } if (DraedonSummonCountdown == 0) - NPC.NewNPC((int)DraedonSummonPosition.X, (int)DraedonSummonPosition.Y, ModContent.NPCType()); + NPC.NewNPC((int)DraedonSummonPosition.X, (int)DraedonSummonPosition.Y, ModContent.NPCType(), 0, 0f, (int)DraedonMechToSummon); } #endregion Handle Draedon Summoning From e7a21f671b6d31efc209ff54492af6fb111efac0 Mon Sep 17 00:00:00 2001 From: Dominic Date: Mon, 16 Aug 2021 07:54:04 -0500 Subject: [PATCH 32/86] Merge fix --- ILEditing/ILChanges.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ILEditing/ILChanges.cs b/ILEditing/ILChanges.cs index 4da556c7f3..0dd3d1b2b7 100644 --- a/ILEditing/ILChanges.cs +++ b/ILEditing/ILChanges.cs @@ -108,6 +108,7 @@ namespace CalamityMod.ILEditing aLabDoorClosed = ModContent.TileType(); // Mechanics / features + On.Terraria.NPC.ApplyTileCollision += AllowTriggeredFallthrough; IL.Terraria.Main.UpdateTime += PermitNighttimeTownNPCSpawning; On.Terraria.Main.UpdateTime_SpawnTownNPCs += AlterTownNPCSpawnRate; IL.Terraria.Player.Hurt += RemoveRNGFromBlackBelt; @@ -155,6 +156,7 @@ namespace CalamityMod.ILEditing labDoorOpen = labDoorClosed = aLabDoorOpen = aLabDoorClosed = -1; // Mechanics / features + On.Terraria.NPC.ApplyTileCollision -= AllowTriggeredFallthrough; IL.Terraria.Main.UpdateTime -= PermitNighttimeTownNPCSpawning; On.Terraria.Main.UpdateTime_SpawnTownNPCs -= AlterTownNPCSpawnRate; IL.Terraria.Player.Hurt -= RemoveRNGFromBlackBelt; @@ -197,6 +199,15 @@ namespace CalamityMod.ILEditing #region IL Editing Routines and Injections #region Mechanics / features + + // Why this isn't a mechanism provided by TML itself or vanilla itself is beyond me. + private static void AllowTriggeredFallthrough(On.Terraria.NPC.orig_ApplyTileCollision orig, NPC self, bool fall, Vector2 cPosition, int cWidth, int cHeight) + { + if (self.active && self.Calamity().ShouldFallThroughPlatforms) + fall = true; + orig(self, fall, cPosition, cWidth, cHeight); + } + private static void PermitNighttimeTownNPCSpawning(ILContext il) { // Don't do town NPC spawning at the end (which lies after a !Main.dayTime return). From 23c66fc5b108c94f2370bc115c4c2e0e833f96f0 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 11 Sep 2021 23:45:29 -0500 Subject: [PATCH 33/86] Coping with merge problems --- CalPlayer/CalamityPlayerMiscEffects.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index ec1cda4e34..7817f364c5 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -1,3 +1,11 @@ +using CalamityMod.Buffs.Alcohol; +using CalamityMod.Buffs.Cooldowns; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.Potions; +using CalamityMod.Buffs.StatBuffs; +using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.Summon; +using CalamityMod.CustomRecipes; using CalamityMod.DataStructures; using CalamityMod.Dusts; using CalamityMod.Events; From 4c73c6f6abbdfe01083463f52e70848a07db4d1d Mon Sep 17 00:00:00 2001 From: Dominic Date: Sun, 12 Sep 2021 00:47:51 -0500 Subject: [PATCH 34/86] Artemis/Apollo are summonable by the Codebreaker --- NPCs/ExoMechs/Draedon.cs | 28 +++++++++++++++------------- UI/DraedonDecryptUI.cs | 2 +- World/CalamityWorld.cs | 23 +++++++++++++++++++++-- 3 files changed, 37 insertions(+), 16 deletions(-) diff --git a/NPCs/ExoMechs/Draedon.cs b/NPCs/ExoMechs/Draedon.cs index 8ea1c50e24..a63c458a2a 100644 --- a/NPCs/ExoMechs/Draedon.cs +++ b/NPCs/ExoMechs/Draedon.cs @@ -5,6 +5,9 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; +using ApolloBoss = CalamityMod.NPCs.ExoMechs.Apollo.Apollo; +using ArtemisBoss = CalamityMod.NPCs.ExoMechs.Artemis.Artemis; + namespace CalamityMod.NPCs.ExoMechs { public class Draedon : ModNPC @@ -36,6 +39,7 @@ namespace CalamityMod.NPCs.ExoMechs npc.defense = 9999; npc.lifeMax = 50; npc.friendly = true; + npc.noGravity = true; npc.dontTakeDamage = true; npc.aiStyle = aiType = -1; npc.knockBackResist = 0f; @@ -88,30 +92,28 @@ namespace CalamityMod.NPCs.ExoMechs public void SummonExoMech() { - // Summon Thanatos underground. - Vector2 thanatosSpawnPosition = PlayerToFollow.Center + Vector2.UnitY * 2100f; - - // Summon Ares in the sky, directly above the player. - Vector2 aresSpawnPosition = PlayerToFollow.Center - Vector2.UnitY * 1400f; - // CalamityUtils.SpawnBossBetter(thanatosSpawnPosition, ModContent.NPCType()); - - // Summon Apollo and Artemis above the player to their sides. - Vector2 artemisSpawnPosition = PlayerToFollow.Center + new Vector2(1100f, -1600f); - Vector2 apolloSpawnPosition = PlayerToFollow.Center + new Vector2(-1100f, -1600f); - switch (MechToSummon) { + // Summon Thanatos underground. case ExoMech.Destroyer: + Vector2 thanatosSpawnPosition = PlayerToFollow.Center + Vector2.UnitY * 2100f; NPC thanatos = CalamityUtils.SpawnBossBetter(thanatosSpawnPosition, ModContent.NPCType()); if (thanatos != null) thanatos.velocity = thanatos.SafeDirectionTo(PlayerToFollow.Center) * 40f; break; + + // Summon Ares in the sky, directly above the player. case ExoMech.Prime: + Vector2 aresSpawnPosition = PlayerToFollow.Center - Vector2.UnitY * 1400f; CalamityUtils.SpawnBossBetter(aresSpawnPosition, ModContent.NPCType()); break; + + // Summon Apollo and Artemis above the player to their sides. case ExoMech.Twins: - //CalamityUtils.SpawnBossBetter(artemisSpawnPosition, ModContent.NPCType()); - //CalamityUtils.SpawnBossBetter(apolloSpawnPosition, ModContent.NPCType()); + Vector2 artemisSpawnPosition = PlayerToFollow.Center + new Vector2(-1100f, -1600f); + Vector2 apolloSpawnPosition = PlayerToFollow.Center + new Vector2(1100f, -1600f); + CalamityUtils.SpawnBossBetter(artemisSpawnPosition, ModContent.NPCType()); + CalamityUtils.SpawnBossBetter(apolloSpawnPosition, ModContent.NPCType()); break; } } diff --git a/UI/DraedonDecryptUI.cs b/UI/DraedonDecryptUI.cs index 2c1ae1cae3..7e18f092d2 100644 --- a/UI/DraedonDecryptUI.cs +++ b/UI/DraedonDecryptUI.cs @@ -88,7 +88,7 @@ namespace CalamityMod.UI DisplayDecryptCancelButton(codebreakerTileEntity, textPanelCenter + Vector2.UnitY * 110f); } - Vector2 summonButtonCenter = backgroundTopLeft + new Vector2(140f, backgroundTexture.Height - 48f); + Vector2 summonButtonCenter = backgroundTopLeft + new Vector2(140f, backgroundTexture.Height - 44f); if (codebreakerTileEntity.ReadyToSummonDreadon && CalamityWorld.AbleToSummonDraedon) HandleDraedonSummonButton(codebreakerTileEntity, summonButtonCenter); diff --git a/World/CalamityWorld.cs b/World/CalamityWorld.cs index b6722e7d55..49252e0ef3 100644 --- a/World/CalamityWorld.cs +++ b/World/CalamityWorld.cs @@ -13,7 +13,9 @@ using CalamityMod.NPCs.Cryogen; using CalamityMod.NPCs.DesertScourge; using CalamityMod.NPCs.DevourerofGods; using CalamityMod.NPCs.ExoMechs; +using CalamityMod.NPCs.ExoMechs.Apollo; using CalamityMod.NPCs.ExoMechs.Ares; +using CalamityMod.NPCs.ExoMechs.Artemis; using CalamityMod.NPCs.ExoMechs.Thanatos; using CalamityMod.NPCs.HiveMind; using CalamityMod.NPCs.NormalNPCs; @@ -166,8 +168,25 @@ namespace CalamityMod.World public static Vector2 DraedonSummonPosition = Vector2.Zero; public static bool AbleToSummonDraedon { - get => DraedonSummonCountdown <= 0 && !NPC.AnyNPCs(ModContent.NPCType()) && - !NPC.AnyNPCs(ModContent.NPCType()) && !NPC.AnyNPCs(ModContent.NPCType()); + get + { + if (DraedonSummonCountdown > 0) + return false; + + if (NPC.AnyNPCs(ModContent.NPCType())) + return false; + + if (NPC.AnyNPCs(ModContent.NPCType())) + return false; + + if (NPC.AnyNPCs(ModContent.NPCType())) + return false; + + if (NPC.AnyNPCs(ModContent.NPCType()) || NPC.AnyNPCs(ModContent.NPCType())) + return false; + + return true; + } } public const int DraedonSummonCountdownMax = 260; From dad579bcc66577c40c18dcfc27465c0b4e7a1774 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sun, 12 Sep 2021 16:29:36 -0500 Subject: [PATCH 35/86] Renamed DraedonDecryptUI to CodebreakerUI --- CalamityMod.cs | 2 +- Tiles/DraedonSummoner/CodebreakerTile.cs | 8 ++++---- UI/{DraedonDecryptUI.cs => CodebreakerUI.cs} | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) rename UI/{DraedonDecryptUI.cs => CodebreakerUI.cs} (99%) diff --git a/CalamityMod.cs b/CalamityMod.cs index e5401b7946..5e75e01d07 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -958,7 +958,7 @@ namespace CalamityMod // Codebreaker UI. layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Codebreaker Decryption GUI", () => { - DraedonDecryptUI.Draw(Main.spriteBatch); + CodebreakerUI.Draw(Main.spriteBatch); return true; }, InterfaceScaleType.None)); diff --git a/Tiles/DraedonSummoner/CodebreakerTile.cs b/Tiles/DraedonSummoner/CodebreakerTile.cs index fd8110a6d7..c5a758c893 100644 --- a/Tiles/DraedonSummoner/CodebreakerTile.cs +++ b/Tiles/DraedonSummoner/CodebreakerTile.cs @@ -105,9 +105,9 @@ namespace CalamityMod.Tiles.DraedonSummoner player.CancelSignsAndChests(); // If this is the tile the player is currently looking at, the associated tile entity doesn't really exist, or it's simply not upgraded enough, close the GUI. - if (codebreakerTileEntity is null || codebreakerTileEntity.ID == DraedonDecryptUI.ViewedTileEntityID || !codebreakerTileEntity.ContainsDecryptionComputer) + if (codebreakerTileEntity is null || codebreakerTileEntity.ID == CodebreakerUI.ViewedTileEntityID || !codebreakerTileEntity.ContainsDecryptionComputer) { - DraedonDecryptUI.ViewedTileEntityID = -1; + CodebreakerUI.ViewedTileEntityID = -1; Main.PlaySound(SoundID.MenuClose); } @@ -115,8 +115,8 @@ namespace CalamityMod.Tiles.DraedonSummoner else if (codebreakerTileEntity != null) { // Play a sound depending on whether the player had another codebreaker open previously. - Main.PlaySound(DraedonDecryptUI.ViewedTileEntityID == -1 ? SoundID.MenuOpen : SoundID.MenuTick); - DraedonDecryptUI.ViewedTileEntityID = codebreakerTileEntity.ID; + Main.PlaySound(CodebreakerUI.ViewedTileEntityID == -1 ? SoundID.MenuOpen : SoundID.MenuTick); + CodebreakerUI.ViewedTileEntityID = codebreakerTileEntity.ID; Main.playerInventory = true; Main.recBigList = false; } diff --git a/UI/DraedonDecryptUI.cs b/UI/CodebreakerUI.cs similarity index 99% rename from UI/DraedonDecryptUI.cs rename to UI/CodebreakerUI.cs index 7e18f092d2..468ba4e06c 100644 --- a/UI/DraedonDecryptUI.cs +++ b/UI/CodebreakerUI.cs @@ -16,7 +16,7 @@ using Terraria.UI.Chat; namespace CalamityMod.UI { - public static class DraedonDecryptUI + public static class CodebreakerUI { public static int ViewedTileEntityID = -1; public static bool AwaitingCloseConfirmation = false; From 6f32b226107a3c40cd0507e38c0b9d1ab26afbed Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 15 Sep 2021 15:23:49 -0500 Subject: [PATCH 36/86] Draedon is no longer a wulfrum enemy --- Effects/GlitchShader.fx | 2 +- Effects/GlitchShader.xnb | Bin 2264 -> 2380 bytes Localization/CalamityLocalization.cs | 6 +-- NPCs/ExoMechs/Draedon.cs | 58 ++++++++++++++++++++------- NPCs/ExoMechs/Draedon.png | Bin 2820 -> 1616 bytes 5 files changed, 47 insertions(+), 19 deletions(-) diff --git a/Effects/GlitchShader.fx b/Effects/GlitchShader.fx index f03db8e66c..e582b0a2a6 100644 --- a/Effects/GlitchShader.fx +++ b/Effects/GlitchShader.fx @@ -28,7 +28,7 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO // doing nothing at all. float horizontalOffset = pow(offsetBase, 3) * uOpacity * 0.46; float2 samplePosition = float2(saturate(coords.x + horizontalOffset), coords.y); - return tex2D(uImage0, samplePosition); + return tex2D(uImage0, samplePosition) * float4(uSecondaryColor, uSaturation); } technique Technique1 { diff --git a/Effects/GlitchShader.xnb b/Effects/GlitchShader.xnb index 98b8d134a7adc17d2f245019abdbe385d5b2ff53..a1e29ac56e86dd899b4f04845ec725b14e5e1a42 100644 GIT binary patch delta 526 zcmYk3yGsK>5XNWjkvmb5Gl&KSMX?b?K?{TUh(SRRA!xwDCa8sA5(o)mAvsVXu}auZ z1kXnrwFroh!p1&@rG=eA{{|b^Z=({2{oU@&x8DxC_u^Dq?UluuZIc%oiuN&I6iY`; zVwyMg_jf6-`A{PgW7;`O@u~&&{DBl5`U%UM2Yr;Ys|FEiQhv!f3NMFdx{$sBRa276 z5k0T?YyllGX_UsSVjpOzFy;dAKpAMYYQ6SYt0^y01$ZDc9~WUW)Sp?3r8B8mdNY}z z%+khMGO->@?SzwC$rSeMKZsrPBcQtfg*xdkSVY(_3O<*cgk$*w2DNxkXSvYcXYVBT zOi7uYju4rqn6TOdKB(OMd>d=LyT7^|7|-W&L8V$EZjG=ZPAz{MI(fK12D>=HH7M#C z!m&FCO(-U^eyDhfn(CvfXMwsSS~f`jI0FA2c$d0E%-Y@Pw_y)CxXrKIsp+OD*?q%s c>P!|YRR#L0+{RkE_^lpX8rdx_Lzj~18_qg#YXATM delta 416 zcmYjMu}T9$5S`h(OBO_8Y&1ks6bpr5L<@tUNfc~E2pF)iQ4sVCwDZ8`v9n`75mH!Kq_DJ2q3hddal^h@=Dm5dvoGC^q+VSv?s(kLRei$Q>cuf?ls+$d&R_FXA?<&_Od!19JyP7k_rB6#JV}8s8&94-SeJCq{$ersqJ^4z!C z%Uj-&YP=`qLgmia`}K~8$E(Y+nS&t6S=E#0_~a;F3^5ajeWLO$k@2xXgd<;3IaJcG z(;4g>I;ckA!0vF6?@}}LfanxO=FgFeI#kplM|yyj)b)50Q~uq__C!ZodbkT)DAEZq IP2c|X7ckLY(*OVf diff --git a/Localization/CalamityLocalization.cs b/Localization/CalamityLocalization.cs index 34ef94e6e9..1746a48edc 100644 --- a/Localization/CalamityLocalization.cs +++ b/Localization/CalamityLocalization.cs @@ -117,9 +117,9 @@ namespace CalamityMod.Localization new [] { "CryogenBossText", "Cryogen is derping out!" }, - new [] { "DraedonIntroductionText1", "Something seems... very off." }, - new [] { "DraedonIntroductionText2", "Well, whatever." }, - new [] { "DraedonIntroductionText3", "Here's your exo mechs lol" }, + new [] { "DraedonIntroductionText1", "OK this is somewhat better." }, + new [] { "DraedonIntroductionText2", "My chair's flame defies physics, but that's OK." }, + new [] { "DraedonIntroductionText3", "Well anyway here's your exo mechs lmao" }, new [] { "HardmodeOreTier1Text", "Your world has been blessed with Cobalt and Palladium!" }, new [] { "HardmodeOreTier2Text", "Your world has been blessed with Mythril and Orichalcum!" }, diff --git a/NPCs/ExoMechs/Draedon.cs b/NPCs/ExoMechs/Draedon.cs index a63c458a2a..5bf1fae57e 100644 --- a/NPCs/ExoMechs/Draedon.cs +++ b/NPCs/ExoMechs/Draedon.cs @@ -1,7 +1,10 @@ using CalamityMod.NPCs.ExoMechs.Ares; using CalamityMod.NPCs.ExoMechs.Thanatos; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; using Terraria; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -26,10 +29,11 @@ namespace CalamityMod.NPCs.ExoMechs set => npc.ai[1] = (int)value; } public static readonly Color TextColor = new Color(155, 255, 255); + public const int TeleportFadeinTime = 45; public override void SetStaticDefaults() { DisplayName.SetDefault("Draedon"); - Main.npcFrameCount[npc.type] = 12; + Main.npcFrameCount[npc.type] = 1; } public override void SetDefaults() @@ -47,6 +51,8 @@ namespace CalamityMod.NPCs.ExoMechs public override void AI() { + npc.Opacity = Utils.InverseLerp(0f, 8f, TalkTimer, true); + npc.spriteDirection = (PlayerToFollow.Center.X < npc.Center.X).ToDirectionInt(); if (Main.netMode != NetmodeID.MultiplayerClient && TalkTimer == 90f) { CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.DraedonIntroductionText1", TextColor); @@ -66,8 +72,6 @@ namespace CalamityMod.NPCs.ExoMechs npc.netUpdate = true; } - npc.velocity = Vector2.UnitY * Utils.InverseLerp(0f, 50f, TalkTimer, true) * Utils.InverseLerp(65f, 50f, TalkTimer, true) * -4.5f; - // Make the screen rumble and summon the exo mechs. if (TalkTimer < 375f) { @@ -118,16 +122,40 @@ namespace CalamityMod.NPCs.ExoMechs } } - public override void FindFrame(int frameHeight) - { - npc.frameCounter++; - if (npc.frameCounter > 5) - { - npc.frameCounter = 0f; - npc.frame.Y += frameHeight; - if (npc.frame.Y >= frameHeight * 6) - npc.frame.Y = 0; - } - } - } + // Draedon should not manually despawn. + public override bool CheckActive() => false; + + public override Color? GetAlpha(Color drawColor) + { + float teleportFade = Utils.InverseLerp(0f, TeleportFadeinTime, TalkTimer, true); + Color color = Color.Lerp(drawColor, Color.Cyan, 1f - (float)Math.Pow(teleportFade, 3D)); + color.A = (byte)(int)(teleportFade * 255f); + + return color * npc.Opacity; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) + { + if (TalkTimer > TeleportFadeinTime) + return true; + + spriteBatch.EnterShaderRegion(); + + Texture2D texture = Main.npcTexture[npc.type]; + Vector2 drawPosition = npc.Center - Main.screenPosition - Vector2.UnitY * 38f; + Vector2 origin = npc.frame.Size() * 0.5f; + Color color = npc.GetAlpha(drawColor); + SpriteEffects direction = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + GameShaders.Misc["CalamityMod:Glitch"].UseOpacity(1f - TalkTimer / TeleportFadeinTime); + GameShaders.Misc["CalamityMod:Glitch"].UseSecondaryColor(color); + GameShaders.Misc["CalamityMod:Glitch"].UseSaturation(color.A / 255f); + GameShaders.Misc["CalamityMod:Glitch"].Apply(); + + spriteBatch.Draw(texture, drawPosition, npc.frame, Color.White * npc.Opacity, npc.rotation, origin, npc.scale, direction, 0f); + + spriteBatch.ExitShaderRegion(); + + return false; + } + } } diff --git a/NPCs/ExoMechs/Draedon.png b/NPCs/ExoMechs/Draedon.png index b73d19e5a40223fb8d77d9db6b73f68361f71bb5..27de3c44ae16c473c1c56be86b3b8510f08422e5 100644 GIT binary patch delta 1566 zcmV+(2I2XH7SIeKiBL{Q4GJ0x0000DNk~Le0001M0001a2m=5B011CDu8|=he*k+> zOjJbx003i1IygN(R9 z^OfDscxDPA$=;LsyxD|Mw>=%7u8;HS`Z%91zpp1Q{wH#~sJUO&xzVVqSU@DEVB@ z&1Q9d?wQXoE~sYfsfTGY36g-)WZiW79$PLK`ORkY`T6;UXYMf<9_1A^zk1}-^IlsH zmntYhOpp?68t0M;kC~drY_|7d^0?^rlps)7+o(@}Z?j}BQkzWh$ffz~7^in}?#^b+ zOzL)_%4}^KOR({T)jm@!N|D|u)m7JLXIEFrrHVjRWrT_DmydHB8(TS&Q0fS$cVVMD zu$ha>veD(TVNr%vMR$<1bIWC^E@mim zEf#ct`n89CHXliLp>J$f=17j&^0>BJxnxrvb;5W&opNWBdcVtZX{OZ*TP!v}E*B{> z_hM5W#*$>;#!*mRd)#=I9@g>caEiHH*qp<4e$JBq=DONzcE!XJPT7)&jwjK>Ddu%K zM~=MH@#FFJb<=RYCq=pF4_%n9+2HQcQg>6IYZt zAkZ|2XR5p|U=**+O`2<+lLK@eVb*0^>!Cl|mSxWUa$SN%lpEtMJ*tr&sa{@k6n!|F zVOu#a*+52KIS=RwT_b@Md0%+`78he>B0;{va#pKfs0q0Gwy=7KGF)+oh?&eny?#Z1 zv#r;>{_~65TmIeNmgu6lvBZy_T~iks>iRCilMD4qepeV2?%^2Y+}+*30hW&;Punu; z-jha!s-gBS8hJXGOv)mSQzAojJtSwaEmqar4s4IRp3ucOxnv^`%~|^$q7e!9XMHSM zhzmGFNkvI$JWI@3z_Ouz6RhL-%5yz`1ipO1=G@n>*iv_JzthbzDm+S_btGSo%ehBS zay>jSIuvwrk)L%(2s3<&suq*xrgR=dZr9`E(~~Njjq!E;?HjWdqf>n?f!UNGeZ>3K zRV?bs>mos}dH9lxZ-LmU(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(@D;PeT1d!f#FC_?uAoVBq3d^)*ratfM&H4 z$*@s;^Ku2PW?FSU>Qb7q6gnZAj{0i+g=x4qE6TciE#mtU2Q2tstS>DhY~x*R6=&>` zRc&`66$ZlaBmpXqJE?kBsCG~Gi}d7GxEZ$o+E`fsN9oSJu?A<$A^raZqOO>_iH{(` z9y5-Y^d@GSuVr_Pj51jbHPg^_s`CdYDk{$Kt@WPYzFAw9YZBAA3S&C6T$gJ))Kp+% z%U77N%O7s-MFTS+{Z&yJdSL)Ew-WSR0lD@%f8h2xJRvAqhGwxAz=;wmtvUdO5h(JMi=(+=;%*Oy;DpmgLCo7lbwAp90% z{@e+Ohtu624$hDr4MRg8QI&@ET^AmYoDMNGMtQji0FLOYE`QD>=T>_;Zhy%0tXC(@ z#ANEUe{C>KyXEq{1U5PS98md*Rf=;s#YkSrmOG9xt6s@gw-%qwkzv#}XIbSY*h_MJw7Z6<|E95 zx?kosAimK!peL59|2!~>yI?+4I?-WUH)dy*x1DWYNRgJ#NC*h(MsSw{HVGo|%rTEu@P-h-%46)KC4ITv#3 zKh*8!Rg-BmM3ttG?{%b)eCOy%gg?!E^LGs%$8|n*9Yox0*^`E_3=%7Lt(_MEe|bM~ zo`EirP>^^QE$PBe_t6q~6_JYb0PW~z)%U`z7d?ojvZldyGD|=?Wgo{@ zS-&7#a4Wp}Ef>Y_Hb}XXnknyjeyVc_=tDO;0+J#6^VYeH&rga~iRD_>{c)gD-faxm zCnhzH?W?|XV}mr3PC;Y_#py$p_>q6JgW7f5=R$g4aerkNT7NL1%|;w_3rJ% M$1A|I%_A!B-+^*KmjD0& From 78d289ab0dc0f668a7cfdae45b4fcb1f55ee12c0 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 15 Sep 2021 19:15:36 -0500 Subject: [PATCH 37/86] Thanatos map head fix --- NPCs/ExoMechs/Thanatos/ThanatosNormalHead.png | Bin 436 -> 448 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/NPCs/ExoMechs/Thanatos/ThanatosNormalHead.png b/NPCs/ExoMechs/Thanatos/ThanatosNormalHead.png index 9cd03281e6ff39db163c822a1a434cb2aa7f2a1d..a5503e05e065f3a47830b4a7810b51cef7d02e62 100644 GIT binary patch delta 302 zcmV+}0nz@n1Hc227YaBC0{{R3-5a>Oks*kG!2kdb!2!6DYwZ940QE^kK~y+T?UI46 zgCGn=OQ~Shy^a6>*>Sl#mlq>^z)s?*oTjumDLYd6AJuqY@3lw>r~Zof1h-;!^45_%Xb`5>1u9pAUsSS(=2I~5Mo4ApSH-2<{;Cgnv!aN z2wbOWH(f1~^E{)ZHW1Bo&h3DXrgT@$IW%%sb!S3Pn=Q+_nx*8vZ7Dq-?kSnA>$21V zJGvCK(oPX~Y%<1f>%61e`1J#98#S(omoldD8KM6w&nNWp=jv-nTqv3$h?y{=36fqf z3NoSzMmu0zU{oXFVBe^W>nncxlApdA7YZZ@0{{R3sSkQvks*kG!TNSkfjzMG}wejF)19_}fb?fbUX0SCGi zw9-xycWg4oZtHxY+xYbZ90xV7h?g>_@fo3?mDdaU{Bw;pBrX)q5X4NF(F95FHwBr| o1f!j>EikK*aMCv_x4M)M!DJn&=3NC1uK)l507*qoM6N<$f(ZtKhyVZp From 6b22f137c210fdebb041cf1ba57afeb769398fed Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Thu, 16 Sep 2021 00:13:16 -0400 Subject: [PATCH 38/86] Added Cosmilite to Fearmonger armor. --- Items/Armor/FearmongerGreathelm.cs | 3 ++- Items/Armor/FearmongerGreaves.cs | 3 ++- Items/Armor/FearmongerPlateMail.cs | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Items/Armor/FearmongerGreathelm.cs b/Items/Armor/FearmongerGreathelm.cs index d3e59b6a39..235af6c80a 100644 --- a/Items/Armor/FearmongerGreathelm.cs +++ b/Items/Armor/FearmongerGreathelm.cs @@ -103,8 +103,9 @@ This extra damage reduction ignores the soft cap"; { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.SpookyHelmet); - recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.AddIngredient(ModContent.ItemType(), 8); recipe.AddIngredient(ItemID.SoulofFright, 8); + recipe.AddIngredient(ModContent.ItemType(), 2); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Armor/FearmongerGreaves.cs b/Items/Armor/FearmongerGreaves.cs index dc6331225d..5d0c56f957 100644 --- a/Items/Armor/FearmongerGreaves.cs +++ b/Items/Armor/FearmongerGreaves.cs @@ -39,8 +39,9 @@ namespace CalamityMod.Items.Armor { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.SpookyLeggings); - recipe.AddIngredient(ModContent.ItemType(), 2); + \recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ItemID.SoulofFright, 10); + recipe.AddIngredient(ModContent.ItemType(), 2); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Armor/FearmongerPlateMail.cs b/Items/Armor/FearmongerPlateMail.cs index 57352bef91..3cb9a6fb12 100644 --- a/Items/Armor/FearmongerPlateMail.cs +++ b/Items/Armor/FearmongerPlateMail.cs @@ -37,8 +37,9 @@ namespace CalamityMod.Items.Armor { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.SpookyBreastplate); - recipe.AddIngredient(ModContent.ItemType(), 3); + recipe.AddIngredient(ModContent.ItemType(), 12); recipe.AddIngredient(ItemID.SoulofFright, 12); + recipe.AddIngredient(ModContent.ItemType(), 3); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); From d7dbfcb48898b31eb05bfeaeb0c2c811182f6682 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Thu, 16 Sep 2021 00:15:47 -0400 Subject: [PATCH 39/86] removed unnecessary 1 --- Items/Mounts/Minecarts/DoGCart.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Mounts/Minecarts/DoGCart.cs b/Items/Mounts/Minecarts/DoGCart.cs index 14a57c6553..d715135e6a 100644 --- a/Items/Mounts/Minecarts/DoGCart.cs +++ b/Items/Mounts/Minecarts/DoGCart.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Mounts.Minecarts { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddIngredient(ModContent.ItemType(), 1); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.Wire, 60); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); From fa93986194e6a6475b65579769649a377764d457 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Thu, 16 Sep 2021 00:16:00 -0400 Subject: [PATCH 40/86] alpha ray is now a "pure cosmilite" upgrade --- Items/Weapons/Magic/AlphaRay.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Items/Weapons/Magic/AlphaRay.cs b/Items/Weapons/Magic/AlphaRay.cs index 228546ecf9..e197165583 100644 --- a/Items/Weapons/Magic/AlphaRay.cs +++ b/Items/Weapons/Magic/AlphaRay.cs @@ -80,8 +80,7 @@ namespace CalamityMod.Items.Weapons.Magic recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 2); recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddIngredient(ModContent.ItemType(), 8); - recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); From d4f8a8115b27551de5c27d11addc30ae45478517 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 15 Sep 2021 23:21:27 -0500 Subject: [PATCH 41/86] Significant progress with Draedon entity --- CalPlayer/CalamityPlayer.cs | 6 + CalamityMod.cs | 8 + Effects/GlitchShader.fx | 7 +- Effects/GlitchShader.xnb | Bin 2380 -> 2640 bytes ...n_Twins.png => HeadIcon_ArtemisApollo.png} | Bin ExtraTextures/UI/unknown.png | Bin 954 -> 0 bytes Localization/CalamityLocalization.cs | 9 +- NPCs/CalamityGlobalNPC.cs | 3 + NPCs/ExoMechs/Draedon.cs | 189 ++++++++++++++++-- NPCs/ExoMechs/Draedon.png | Bin 1616 -> 13830 bytes UI/CodebreakerUI.cs | 95 +-------- UI/ExoMechSelectionUI.cs | 116 +++++++++++ World/WorldUpdateMiscEffects.cs | 7 + 13 files changed, 329 insertions(+), 111 deletions(-) rename ExtraTextures/UI/{HeadIcon_Twins.png => HeadIcon_ArtemisApollo.png} (100%) delete mode 100644 ExtraTextures/UI/unknown.png create mode 100644 UI/ExoMechSelectionUI.cs diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 6cafdd9e11..7b3faf4768 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -1089,6 +1089,10 @@ namespace CalamityMod.CalPlayer public FireParticleSet ProvidenceBurnEffectDrawer = new FireParticleSet(-1, int.MaxValue, Color.Yellow, Color.Red * 1.2f, 10f, 0.65f); #endregion Draw Effects + #region Draedon Summoning + public bool AbleToSelectExoMech = false; + #endregion Draedon Summoning + #endregion #region SavingAndLoading @@ -2122,6 +2126,8 @@ namespace CalamityMod.CalPlayer lastProjectileHit = null; + AbleToSelectExoMech = false; + CalamityPlayerMiscEffects.EnchantHeldItemEffects(player, player.Calamity(), player.ActiveItem()); } #endregion diff --git a/CalamityMod.cs b/CalamityMod.cs index 5e75e01d07..becfa0ed7c 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -968,6 +968,14 @@ namespace CalamityMod PopupGUIManager.UpdateAndDraw(Main.spriteBatch); return true; }, InterfaceScaleType.None)); + + // Exo Mech selection. + layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Exo Mech Selection", () => + { + if (Main.LocalPlayer.Calamity().AbleToSelectExoMech) + ExoMechSelectionUI.Draw(Main.spriteBatch); + return true; + }, InterfaceScaleType.None)); } // Invasion UIs. diff --git a/Effects/GlitchShader.fx b/Effects/GlitchShader.fx index e582b0a2a6..89eb599ac5 100644 --- a/Effects/GlitchShader.fx +++ b/Effects/GlitchShader.fx @@ -12,21 +12,24 @@ float uDirection; float3 uLightSource; float2 uImageSize0; float2 uImageSize1; +float2 frameCount; float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0 { + float frameY = coords.y * frameCount.y; + // 17.07947 is 2pi * e, while 25.13274 is 8pi. // When two sinusoids are added in this way and the periods of each sinusoid are irrational, // the resulting sinusoid from the addition has no period, meaning that it has pseudo-random // bumps and valleys. This is ideal for a glitch effect. The * 0.5 at the end is make the range // of the result be -1 to 1 like a typical sine. - float offsetBase = (sin(coords.y * 17.07947 + uTime * 16) + sin(coords.y * 25.13274)) * 0.5; + float offsetBase = (sin(frameY * 17.07947 + uTime * 16) + sin(coords.y * 25.13274)) * 0.5; // Here, a power is used to make the valleys and hills sharper, and bias everything else // towards 0, making horizontal stretches more noticable and powerful when they happen. // Higher values of uOpacity will result in more powerful offsets, with a uOpacity of 0 // doing nothing at all. - float horizontalOffset = pow(offsetBase, 3) * uOpacity * 0.46; + float horizontalOffset = pow(offsetBase, 3) * uOpacity / frameCount.x * 0.46; float2 samplePosition = float2(saturate(coords.x + horizontalOffset), coords.y); return tex2D(uImage0, samplePosition) * float4(uSecondaryColor, uSaturation); } diff --git a/Effects/GlitchShader.xnb b/Effects/GlitchShader.xnb index a1e29ac56e86dd899b4f04845ec725b14e5e1a42..51b8d818e2e56890cf36b98f71a6243d3ea9813e 100644 GIT binary patch delta 871 zcmZ`$OKVd>82x5$?wuPGO{miJ5lI!R;Dc7sMN!l=wICFUZ31y+i=?E8^+Ag+gkBIK zMK|fJgo449m@K;RK|#cVOU3+vE?i`%U)Xk9l4uj$Mw~|hJT2T2 zYhNY$iP|6fV<52LbL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-Q1Q%5!-r9b{zX%ydc+gQd~3l@>@QUWwPoL$rhpwuio|w_tdOp zRQY^ZYcJcPea97>+=D|uKH`yCZsD?lbU*BUf(V1DRZFzh{Qnb?* z9{-s!QWw78&vpo`S}>5merNAb zb~fhO&7jnC*g*Fm=StJVN2(dPdbS*T84q;QAr1WtT+5l?anIS&EF-n&)~3g?np^T# zE^KeuaP7fD_xVOeN)y7Ix6jVo+n~$)qO01Z;_QNOzAj5akF^VXZFsJjEq$@tD*yI* zDUoCQwV2WZr^Gc+S~S@r>za_lqC%CE7K>uP82712xyMWlYd$>5D=4yS!JJ8q8Fow( zbDd4DPhe5za`rOr*`c(R&DB#;C)}m^laU)QBkMNCE@ia>*Qnk*HM0aa31+yZu1qyt zB;)WfA}Vc;&$@%p=GxDA`eJ5wN2QBpL)k)|Q;)MXi8xfGu*^4l)EmTAk<=~7x+ zvvx2AWlw9pK8Yi()); ResetSavedIndex(ref SCalWorm, NPCType()); + ResetSavedIndex(ref draedon, NPCType()); ResetSavedIndex(ref draedonExoMechWorm, NPCType()); ResetSavedIndex(ref draedonExoMechTwinRed, NPCType()); ResetSavedIndex(ref draedonExoMechTwinGreen, NPCType()); diff --git a/NPCs/ExoMechs/Draedon.cs b/NPCs/ExoMechs/Draedon.cs index 5bf1fae57e..ad9fa558c6 100644 --- a/NPCs/ExoMechs/Draedon.cs +++ b/NPCs/ExoMechs/Draedon.cs @@ -1,5 +1,6 @@ using CalamityMod.NPCs.ExoMechs.Ares; using CalamityMod.NPCs.ExoMechs.Thanatos; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -17,23 +18,51 @@ namespace CalamityMod.NPCs.ExoMechs { public enum ExoMech { + None, Destroyer, Prime, Twins } + + public Vector2 HoverDestinationOffset + { + get => new Vector2(npc.ai[1], npc.ai[2]); + set + { + npc.ai[1] = value.X; + npc.ai[2] = value.Y; + } + } public Player PlayerToFollow => Main.player[npc.target]; public ref float TalkTimer => ref npc.ai[0]; - public ExoMech MechToSummon - { - get => (ExoMech)(int)npc.ai[1]; - set => npc.ai[1] = (int)value; - } + public ref float GeneralTimer => ref npc.ai[3]; + public bool ExoMechIsPresent + { + get + { + if (NPC.AnyNPCs(ModContent.NPCType())) + return true; + + if (NPC.AnyNPCs(ModContent.NPCType())) + return true; + + if (NPC.AnyNPCs(ModContent.NPCType()) || NPC.AnyNPCs(ModContent.NPCType())) + return true; + + return false; + } + } public static readonly Color TextColor = new Color(155, 255, 255); + public static readonly Color TextColorEdgy = new Color(213, 4, 11); public const int TeleportFadeinTime = 45; + public const int TalkDelay = 80; + public const int DelayPerDialogLine = 130; + public const int ExoMechChooseDelay = TalkDelay + DelayPerDialogLine * 4 + 10; + public const int ExoMechShakeTime = 100; public override void SetStaticDefaults() { DisplayName.SetDefault("Draedon"); - Main.npcFrameCount[npc.type] = 1; + Main.npcFrameCount[npc.type] = 12; } public override void SetDefaults() @@ -42,8 +71,8 @@ namespace CalamityMod.NPCs.ExoMechs npc.width = npc.height = 34; npc.defense = 9999; npc.lifeMax = 50; - npc.friendly = true; npc.noGravity = true; + npc.noTileCollide = true; npc.dontTakeDamage = true; npc.aiStyle = aiType = -1; npc.knockBackResist = 0f; @@ -51,35 +80,90 @@ namespace CalamityMod.NPCs.ExoMechs public override void AI() { + // Set the whoAmI variable. + CalamityGlobalNPC.draedon = npc.whoAmI; + + // Prevent stupid natural despawns. + npc.timeLeft = 3600; + + // Decide an initial target on the first frame. + if (TalkTimer == 0f) + npc.TargetClosest(false); + + // Pick someone else to pay attention to if the old target is gone. + if (PlayerToFollow.dead || !PlayerToFollow.active) + { + npc.TargetClosest(false); + + // Fuck off if no living target exists. + if (PlayerToFollow.dead || !PlayerToFollow.active) + { + npc.life = 0; + npc.checkDead(); + npc.active = false; + return; + } + } + + // Stay within the world. + npc.position.Y = MathHelper.Clamp(npc.position.Y, 150f, Main.maxTilesY * 16f - 150f); + npc.Opacity = Utils.InverseLerp(0f, 8f, TalkTimer, true); npc.spriteDirection = (PlayerToFollow.Center.X < npc.Center.X).ToDirectionInt(); - if (Main.netMode != NetmodeID.MultiplayerClient && TalkTimer == 90f) + if (Main.netMode != NetmodeID.MultiplayerClient && TalkTimer == TalkDelay) { CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.DraedonIntroductionText1", TextColor); - npc.TargetClosest(false); npc.netUpdate = true; } - if (Main.netMode != NetmodeID.MultiplayerClient && TalkTimer == 190f) + if (Main.netMode != NetmodeID.MultiplayerClient && TalkTimer == TalkDelay + DelayPerDialogLine) { CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.DraedonIntroductionText2", TextColor); npc.netUpdate = true; } - if (Main.netMode != NetmodeID.MultiplayerClient && TalkTimer == 270f) + if (Main.netMode != NetmodeID.MultiplayerClient && TalkTimer == TalkDelay + DelayPerDialogLine * 2f) { CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.DraedonIntroductionText3", TextColor); npc.netUpdate = true; } - // Make the screen rumble and summon the exo mechs. - if (TalkTimer < 375f) + if (Main.netMode != NetmodeID.MultiplayerClient && TalkTimer == TalkDelay + DelayPerDialogLine * 3f) { - Main.LocalPlayer.Calamity().GeneralScreenShakePower = Utils.InverseLerp(4200f, 1400f, Main.LocalPlayer.Distance(PlayerToFollow.Center), true) * 18f; - Main.LocalPlayer.Calamity().GeneralScreenShakePower *= Utils.InverseLerp(275f, 375f, TalkTimer, true); + CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.DraedonIntroductionText4", TextColor); + npc.netUpdate = true; } - if (TalkTimer == 370f) + // Inform the player who summoned draedon they may choose the first mech and cause a selection UI to appear over their head. + if (Main.netMode != NetmodeID.MultiplayerClient && TalkTimer == TalkDelay + DelayPerDialogLine * 4f) + { + CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.DraedonIntroductionText5", TextColorEdgy); + npc.netUpdate = true; + } + + // Wait for the player to select an exo mech. + if (TalkTimer >= ExoMechChooseDelay && TalkTimer < ExoMechChooseDelay + 8f && CalamityWorld.DraedonMechToSummon == ExoMech.None) + { + PlayerToFollow.Calamity().AbleToSelectExoMech = true; + TalkTimer = ExoMechChooseDelay; + } + + // Fly around once the exo mechs have been spawned. + if (ExoMechIsPresent) + { + FlyAroundInGamerChair(); + GeneralTimer++; + } + + // Make the screen rumble and summon the exo mechs. + if (TalkTimer > ExoMechChooseDelay + 8f && TalkTimer < ExoMechChooseDelay + ExoMechShakeTime) + { + Main.LocalPlayer.Calamity().GeneralScreenShakePower = Utils.InverseLerp(4200f, 1400f, Main.LocalPlayer.Distance(PlayerToFollow.Center), true) * 18f; + Main.LocalPlayer.Calamity().GeneralScreenShakePower *= Utils.InverseLerp(ExoMechChooseDelay + 5f, ExoMechChooseDelay + ExoMechShakeTime, TalkTimer, true); + } + + // Summon the selected exo mech. + if (TalkTimer == ExoMechChooseDelay + 10f) { if (Main.netMode != NetmodeID.MultiplayerClient) SummonExoMech(); @@ -94,9 +178,57 @@ namespace CalamityMod.NPCs.ExoMechs TalkTimer++; } + // TODO - Make this work in conjunction with exo mech transitions. This requires that the exo mech AIs be finished. + public void FlyAroundInGamerChair() + { + // Define a hover destination offset if one hasn't been decided yet. + if (Main.netMode != NetmodeID.MultiplayerClient && HoverDestinationOffset == Vector2.Zero) + { + HoverDestinationOffset = -Vector2.UnitY * 700f; + npc.netUpdate = true; + } + + // Switch hover destinations from time to time. + if (Main.netMode != NetmodeID.MultiplayerClient && GeneralTimer % 480f == 479f) + { + Vector2 offsetDirection; + Vector2 directionToTarget = npc.SafeDirectionTo(PlayerToFollow.Center); + + // Reroll the offset direction if its direction noticably contrasts the current direction from the target. + // This is done to prevent Draedon from selecting a position to zoom to that would make him have to move + // close to the player. + do + offsetDirection = Main.rand.NextVector2Unit(); + while (Vector2.Dot(directionToTarget, offsetDirection) > 0.2f); + + HoverDestinationOffset = offsetDirection * Main.rand.NextFloat(750f, 1100f); + npc.netUpdate = true; + } + + Vector2 hoverDestination = PlayerToFollow.Center + HoverDestinationOffset; + + // Decide sprite direction based on movement if not close enough to the desination. + // Not deciding this here results in Draedon using the default of looking at the target he's following. + if (npc.WithinRange(hoverDestination, 300f)) + { + npc.velocity *= 0.96f; + + float moveSpeed = MathHelper.Lerp(2f, 8f, Utils.InverseLerp(45f, 275f, npc.Distance(hoverDestination), true)); + npc.Center = npc.Center.MoveTowards(hoverDestination, moveSpeed); + } + else + { + npc.spriteDirection = (npc.velocity.X < 0f).ToDirectionInt(); + + Vector2 idealVelocity = npc.SafeDirectionTo(hoverDestination) * 32f; + npc.SimpleFlyMovement(idealVelocity, 0.8f); + npc.velocity = Vector2.Lerp(npc.velocity, idealVelocity, 0.045f); + } + } + public void SummonExoMech() { - switch (MechToSummon) + switch (CalamityWorld.DraedonMechToSummon) { // Summon Thanatos underground. case ExoMech.Destroyer: @@ -134,11 +266,25 @@ namespace CalamityMod.NPCs.ExoMechs return color * npc.Opacity; } + public override void FindFrame(int frameHeight) + { + npc.frame.Width = 106; + + npc.frameCounter++; + if (npc.frameCounter >= 6f) + { + npc.frame.Y = npc.frame.Y + frameHeight; + if (npc.frame.Y >= Main.npcFrameCount[npc.type] * frameHeight) + { + npc.frame.X = (npc.frame.X + 106) % 212; + npc.frame.Y = 0; + } + npc.frameCounter = 0; + } + } + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) { - if (TalkTimer > TeleportFadeinTime) - return true; - spriteBatch.EnterShaderRegion(); Texture2D texture = Main.npcTexture[npc.type]; @@ -146,9 +292,10 @@ namespace CalamityMod.NPCs.ExoMechs Vector2 origin = npc.frame.Size() * 0.5f; Color color = npc.GetAlpha(drawColor); SpriteEffects direction = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - GameShaders.Misc["CalamityMod:Glitch"].UseOpacity(1f - TalkTimer / TeleportFadeinTime); + GameShaders.Misc["CalamityMod:Glitch"].UseOpacity(MathHelper.Clamp(1f - TalkTimer / TeleportFadeinTime, 0f, 1f) * 0.38f); GameShaders.Misc["CalamityMod:Glitch"].UseSecondaryColor(color); GameShaders.Misc["CalamityMod:Glitch"].UseSaturation(color.A / 255f); + GameShaders.Misc["CalamityMod:Glitch"].Shader.Parameters["frameCount"].SetValue(new Vector2(2f, Main.npcFrameCount[npc.type])); GameShaders.Misc["CalamityMod:Glitch"].Apply(); spriteBatch.Draw(texture, drawPosition, npc.frame, Color.White * npc.Opacity, npc.rotation, origin, npc.scale, direction, 0f); diff --git a/NPCs/ExoMechs/Draedon.png b/NPCs/ExoMechs/Draedon.png index 27de3c44ae16c473c1c56be86b3b8510f08422e5..0db4c0553ce5461f721ace153c60d80658e206e9 100644 GIT binary patch literal 13830 zcmd^m2UL^kx-PwULsbMqC;@_W5S1QCLJ^Xn^rk4i2`Y~C9zc4xP(x7=kPd=06&a)# zK|~Q0L@X4Qe!o~|JA0hH&$(yabDL|qVqzNq|G&@sG-8a6^q3j=7|6)Tn9(R5EVvyZ zBct}BqXhq=tPSx4H{|EAdRk-^j}I(@J5*;i4K>NgsuCEt?Ww{2aAN~J65O6bsj3`P z!`pZq6coz$x0F{=7v*3J{_UKLh1I#JG_|xvHS>zY(&wB%JT1&gl2*|@gpj^%shM;k z__)52xq0KMoIPXnv*#|yW*1f*GdgLXaQ)c0gBzR&%S6Aow->7?fBy^l{*I^j;|Qb7W*J z?WDit4N0!cWMm4%XdO-bMVsYoj5#msl4|FTnx`_}!Crc+ZS{IoKYoXbkp~}xu)V6a zZ`M$d-U-RoziJSxJaSWB!dMW=b=>xX_9Fsph?%l5>=^776#JMWFHW{sHu zZXQhxYkI)mj+Lb!`Zr~y*7k?asVRXyIwmWfyREHllH_qKgYkPK;sRWzIW=c-3>p|6 zwvvW->+8NQns(5Ib;XX^sV0%`68*_~`1wlp?GG;#5QIt#z0ZzOkMKH4G&2FTy5eJz z#>&2|LxG0ZjO=)-3*mY9ZUqFy!#_@nOL-(yMGu9(%Q^c-tuP?xlK)1h!0z_zrPRb{ z&jPni1XOd2bvr(C(#NGfj}O17>?;7?guH;VUOa%mdToc_SSN&?=>UI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53|WWq2|1?0)W|D^1r{hAS>a^c02rH{eb#-T)i~AMZG0 z4ZZDgI@hiV*ZsZj-Q;>7=94YAYu|+HV}u%^QlC@0{uFs#Lka#r 1f) - iconTransitionGlitchIntensity = 1f; - iconTransitionGlitchIntensity = 1f - iconTransitionGlitchIntensity; - - // Have the mech choices cycle depending on time if one has not yet been selected. - switch ((int)(flattenedTime % 3f)) - { - default: - case 0: - mechToSummon = Draedon.ExoMech.Destroyer; - break; - case 1: - mechToSummon = Draedon.ExoMech.Prime; - break; - case 2: - mechToSummon = Draedon.ExoMech.Twins; - break; - } - - if (MechToSummon.HasValue) - { - iconTransitionGlitchIntensity = 0f; - mechToSummon = MechToSummon.Value; - MechIconScale = MathHelper.Clamp(MechIconScale + 0.035f, 1f, 1.265f); - } - else - MechIconScale = MathHelper.Clamp(MechIconScale - 0.05f, 1f, 1.265f); - - Texture2D mechIconTexture; - Texture2D contactButton; - switch (mechToSummon) - { - default: - case Draedon.ExoMech.Destroyer: - mechIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/HeadIcon_THanos"); - contactButton = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ContactIcon_THanos"); - break; - case Draedon.ExoMech.Prime: - mechIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/HeadIcon_Ares"); - contactButton = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ContactIcon_Ares"); - break; - case Draedon.ExoMech.Twins: - mechIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/HeadIcon_Twins"); - contactButton = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ContactIcon_Twins"); - break; - } + Texture2D contactButton = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ContactIcon_THanos"); Rectangle clickArea = Utils.CenteredRectangle(drawPosition, contactButton.Size() * VerificationButtonScale); - // Click if the mouse is hovering over the contact button area. + // Check if the mouse is hovering over the contact button area. if (MouseScreenArea.Intersects(clickArea)) { // If so, cause the button to inflate a little bit. ContactButtonScale = MathHelper.Clamp(ContactButtonScale + 0.035f, 1f, 1.35f); // If a click is done, do a check. - // If a mech has been selected, prepare the summoning process by defining the countdown and current summon position. Otherwise, select the current mech. + // Prepare the summoning process by defining the countdown and current summon position. The mech will be summoned by the Draedon NPC. // Also play a cool sound. if (Main.mouseLeft && Main.mouseLeftRelease) { - if (MechToSummon.HasValue) - { - Main.PlaySound(SoundID.Zombie, Main.LocalPlayer.Center, 67); - CalamityWorld.DraedonMechToSummon = MechToSummon.Value; - CalamityWorld.DraedonSummonCountdown = CalamityWorld.DraedonSummonCountdownMax; - CalamityWorld.DraedonSummonPosition = codebreakerTileEntity.Center + new Vector2(-8f, -100f); - MechToSummon = null; + Main.PlaySound(SoundID.Zombie, Main.LocalPlayer.Center, 67); + CalamityWorld.DraedonSummonCountdown = CalamityWorld.DraedonSummonCountdownMax; + CalamityWorld.DraedonSummonPosition = codebreakerTileEntity.Center + new Vector2(-8f, -100f); - CalamityNetcode.SyncWorld(); - } - else - MechToSummon = mechToSummon; + CalamityNetcode.SyncWorld(); } } // Otherwise, if not hovering, cause the button to deflate back to its normal size. else - { ContactButtonScale = MathHelper.Clamp(ContactButtonScale - 0.05f, 1f, 1.35f); - // If a click is done outside of the click area, reset the selected mech again. - if (Main.mouseLeft && Main.mouseLeftRelease) - MechToSummon = null; - } - - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.UIScaleMatrix); - GameShaders.Misc["CalamityMod:Glitch"].UseOpacity(iconTransitionGlitchIntensity); - GameShaders.Misc["CalamityMod:Glitch"].Apply(); - - // Draw the boss icon. - Main.spriteBatch.Draw(mechIconTexture, drawPosition - Vector2.UnitX * 36f, null, Color.White, 0f, mechIconTexture.Size() * 0.5f, MechIconScale, SpriteEffects.None, 0f); - - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.GameViewMatrix.EffectMatrix); - // Draw the contact button. Main.spriteBatch.Draw(contactButton, drawPosition, null, Color.White, 0f, contactButton.Size() * 0.5f, ContactButtonScale, SpriteEffects.None, 0f); diff --git a/UI/ExoMechSelectionUI.cs b/UI/ExoMechSelectionUI.cs new file mode 100644 index 0000000000..0a37d95086 --- /dev/null +++ b/UI/ExoMechSelectionUI.cs @@ -0,0 +1,116 @@ +using CalamityMod.Items.DraedonMisc; +using CalamityMod.NPCs.ExoMechs; +using CalamityMod.TileEntities; +using CalamityMod.World; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.Linq; +using System.Text; +using Terraria; +using Terraria.DataStructures; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.UI.Chat; + +namespace CalamityMod.UI +{ + public static class ExoMechSelectionUI + { + public static float DestroyerIconScale = 1f; + public static float PrimeIconScale = 1f; + public static float TwinsIconScale = 1f; + public static readonly Color HoverTextColor = Draedon.TextColor; + public static Rectangle MouseScreenArea => Utils.CenteredRectangle(Main.MouseScreen, Vector2.One * 2f); + public static void Draw(SpriteBatch spriteBatch) + { + Vector2 drawAreaVerticalOffset = Vector2.UnitY * 105f; + Vector2 baseDrawPosition = Main.LocalPlayer.Top + drawAreaVerticalOffset - Main.screenPosition; + Vector2 destroyerIconDrawOffset = new Vector2(-78f, -124f); + Vector2 primeIconDrawOffset = new Vector2(0f, -140f); + Vector2 twinsIconDrawOffset = new Vector2(78f, -124f); + + HandleInteractionWithButton(baseDrawPosition + destroyerIconDrawOffset, Draedon.ExoMech.Destroyer); + HandleInteractionWithButton(baseDrawPosition + primeIconDrawOffset, Draedon.ExoMech.Prime); + HandleInteractionWithButton(baseDrawPosition + twinsIconDrawOffset, Draedon.ExoMech.Twins); + } + + public static bool HandleInteractionWithButton(Vector2 drawPosition, Draedon.ExoMech exoMech) + { + float iconScale; + string description; + Texture2D iconMechTexture; + + switch (exoMech) + { + case Draedon.ExoMech.Destroyer: + iconScale = DestroyerIconScale; + iconMechTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/HeadIcon_THanos"); + description = "Thanatos, a serpentine terror with impervious armor and innumerable laser turrets."; + break; + case Draedon.ExoMech.Prime: + iconScale = PrimeIconScale; + iconMechTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/HeadIcon_Ares"); + description = "Ares, a heavyweight, diabolical monstrosity with four Exo superweapons."; + break; + default: + case Draedon.ExoMech.Twins: + iconScale = TwinsIconScale; + iconMechTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/HeadIcon_ArtemisApollo"); + description = "Artemis and Apollo, a pair of extremely agile destroyers with pulse cannons."; + break; + } + + // Check for mouse collision/clicks. + Rectangle clickArea = Utils.CenteredRectangle(drawPosition, iconMechTexture.Size() * iconScale); + + // Check if the mouse is hovering over the contact button area. + bool hoveringOverIcon = MouseScreenArea.Intersects(clickArea); + if (hoveringOverIcon) + { + // If so, cause the button to inflate a little bit. + iconScale = MathHelper.Clamp(iconScale + 0.035f, 1f, 1.35f); + + // Make the selection known if a click is done. + if (Main.mouseLeft && Main.mouseLeftRelease) + { + CalamityWorld.DraedonMechToSummon = exoMech; + CalamityNetcode.SyncWorld(); + } + Main.blockMouse = Main.LocalPlayer.mouseInterface = true; + } + + // Otherwise, if not hovering, cause the button to deflate back to its normal size. + else + iconScale = MathHelper.Clamp(iconScale - 0.05f, 1f, 1.2f); + + // Draw the icon with the new scale. + Main.spriteBatch.Draw(iconMechTexture, drawPosition, null, Color.White, 0f, iconMechTexture.Size() * 0.5f, iconScale, SpriteEffects.None, 0f); + + // Draw the descrption if hovering over the icon. + if (hoveringOverIcon) + { + drawPosition.X -= Main.fontMouseText.MeasureString(description).X * 0.5f; + drawPosition.Y += 36f; + Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontMouseText, description, drawPosition.X, drawPosition.Y, HoverTextColor, Color.Black, Vector2.Zero, 1f); + } + + // And update to reflect the new scale. + switch (exoMech) + { + case Draedon.ExoMech.Destroyer: + DestroyerIconScale = iconScale; + break; + case Draedon.ExoMech.Prime: + PrimeIconScale = iconScale; + break; + default: + case Draedon.ExoMech.Twins: + TwinsIconScale = iconScale; + break; + } + return false; + } + } +} diff --git a/World/WorldUpdateMiscEffects.cs b/World/WorldUpdateMiscEffects.cs index 7c2a687416..d98453256c 100644 --- a/World/WorldUpdateMiscEffects.cs +++ b/World/WorldUpdateMiscEffects.cs @@ -38,6 +38,13 @@ namespace CalamityMod.World { public static void PerformWorldUpdates() { + // Reset the exo mech to summon if Draedon is absent. + if (Main.netMode != NetmodeID.MultiplayerClient && DraedonMechToSummon != Draedon.ExoMech.None && CalamityGlobalNPC.draedon == -1) + { + DraedonMechToSummon = Draedon.ExoMech.None; + CalamityNetcode.SyncWorld(); + } + if (DraedonSummonCountdown > 0) { DraedonSummonCountdown--; From 593d5c734e447ab6d209195e347fb53a7af7de71 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 15 Sep 2021 23:35:49 -0500 Subject: [PATCH 42/86] Removed the Draedon screen whitefade --- World/WorldUpdateMiscEffects.cs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/World/WorldUpdateMiscEffects.cs b/World/WorldUpdateMiscEffects.cs index d98453256c..0cd51ebf93 100644 --- a/World/WorldUpdateMiscEffects.cs +++ b/World/WorldUpdateMiscEffects.cs @@ -134,12 +134,6 @@ namespace CalamityMod.World if (Main.netMode != NetmodeID.MultiplayerClient && DraedonSummonCountdown == DraedonSummonCountdownMax - 45) Projectile.NewProjectile(DraedonSummonPosition + Vector2.UnitY * 80f, Vector2.Zero, ModContent.ProjectileType(), 70, 0f); - if (DraedonSummonCountdown < 150) - { - float fadeToWhite = Utils.InverseLerp(150f, 90f, DraedonSummonCountdown, true) * Utils.InverseLerp(30f, 50f, DraedonSummonCountdown, true); - MoonlordDeathDrama.RequestLight(fadeToWhite, Main.LocalPlayer.Center); - } - if (DraedonSummonCountdown == 0) NPC.NewNPC((int)DraedonSummonPosition.X, (int)DraedonSummonPosition.Y, ModContent.NPCType(), 0, 0f, (int)DraedonMechToSummon); } From d712fbcd3d76e3cc7581d45d8963e1e18a89ea90 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 15 Sep 2021 23:37:57 -0500 Subject: [PATCH 43/86] Dreadon -> Draedon --- TileEntities/TECodebreaker.cs | 2 +- UI/CodebreakerUI.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/TileEntities/TECodebreaker.cs b/TileEntities/TECodebreaker.cs index 8f5e9baf58..235a850b07 100644 --- a/TileEntities/TECodebreaker.cs +++ b/TileEntities/TECodebreaker.cs @@ -56,7 +56,7 @@ namespace CalamityMod.TileEntities } public float DecryptionCompletion => 1f - DecryptionCountdown / (float)DecryptionTotalTime; - public bool ReadyToSummonDreadon => ContainsCoolingCell && DecryptionCountdown <= 0; + public bool ReadyToSummonDraedon => ContainsCoolingCell && DecryptionCountdown <= 0; public bool ContainsDecryptionComputer; public bool ContainsSensorArray; diff --git a/UI/CodebreakerUI.cs b/UI/CodebreakerUI.cs index 913cc2b09c..74af94253f 100644 --- a/UI/CodebreakerUI.cs +++ b/UI/CodebreakerUI.cs @@ -87,7 +87,7 @@ namespace CalamityMod.UI } Vector2 summonButtonCenter = backgroundTopLeft + new Vector2(62f, backgroundTexture.Height - 44f); - if (codebreakerTileEntity.ReadyToSummonDreadon && CalamityWorld.AbleToSummonDraedon) + if (codebreakerTileEntity.ReadyToSummonDraedon && CalamityWorld.AbleToSummonDraedon) HandleDraedonSummonButton(codebreakerTileEntity, summonButtonCenter); if (codebreakerTileEntity.DecryptionCountdown > 0 || AwaitingDecryptionTextClose) From 7bc8c725ef9d4a4b48b718a943e3ddcb752036b9 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Thu, 16 Sep 2021 00:38:31 -0400 Subject: [PATCH 44/86] Silva armor is made at the Cosmic Anvil. --- Items/Accessories/Wings/SilvaWings.cs | 17 +++++++++-------- Items/Armor/SilvaArmor.cs | 7 ++++--- Items/Armor/SilvaHelmet.cs | 13 +++++++------ Items/Armor/SilvaMaskedCap.cs | 9 +++++---- 4 files changed, 25 insertions(+), 21 deletions(-) diff --git a/Items/Accessories/Wings/SilvaWings.cs b/Items/Accessories/Wings/SilvaWings.cs index 368f287a46..a1dfdd014b 100644 --- a/Items/Accessories/Wings/SilvaWings.cs +++ b/Items/Accessories/Wings/SilvaWings.cs @@ -1,11 +1,12 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.Graphics.Shaders; -using Terraria.ModLoader; using CalamityMod.Items.Armor; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; namespace CalamityMod.Items.Accessories.Wings { @@ -20,14 +21,14 @@ namespace CalamityMod.Items.Accessories.Wings "Acceleration multiplier: 2.8\n" + "Excellent vertical speed\n" + "Flight time: 270\n" + - "The Silva revive heals you to half health while wearing the Silva armor"); + "The Silva revive heals you to half health while wearing the Silva armor"); } public override void SetDefaults() { item.width = 22; item.height = 20; - item.rare = ItemRarityID.Purple; + item.rare = ItemRarityID.Purple; item.value = CalamityGlobalItem.Rarity14BuyPrice; item.Calamity().customRarity = CalamityRarity.DarkBlue; item.accessory = true; @@ -83,7 +84,7 @@ namespace CalamityMod.Items.Accessories.Wings recipe.AddRecipeGroup("AnyGoldBar", 3); recipe.AddIngredient(ModContent.ItemType(), 3); recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddTile(TileID.LunarCraftingStation); + recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/Armor/SilvaArmor.cs b/Items/Armor/SilvaArmor.cs index 46369f5acc..2a604bd7a3 100644 --- a/Items/Armor/SilvaArmor.cs +++ b/Items/Armor/SilvaArmor.cs @@ -2,6 +2,7 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -16,7 +17,7 @@ namespace CalamityMod.Items.Armor DisplayName.SetDefault("Silva Armor"); Tooltip.SetDefault("+80 max life\n" + "12% increased damage and 8% increased critical strike chance\n" + - "Grants immunity to the irradiated debuff"); + "Grants immunity to the irradiated debuff"); } public override void SetDefaults() @@ -25,7 +26,7 @@ namespace CalamityMod.Items.Armor item.height = 24; item.value = Item.buyPrice(0, 72, 0, 0); item.defense = 44; - item.rare = ItemRarityID.Purple; + item.rare = ItemRarityID.Purple; item.Calamity().customRarity = CalamityRarity.DarkBlue; } @@ -45,7 +46,7 @@ namespace CalamityMod.Items.Armor recipe.AddIngredient(ModContent.ItemType(), 12); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ModContent.ItemType()); - recipe.AddTile(TileID.LunarCraftingStation); + recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/Armor/SilvaHelmet.cs b/Items/Armor/SilvaHelmet.cs index 9f318c27bc..18b2b1d80d 100644 --- a/Items/Armor/SilvaHelmet.cs +++ b/Items/Armor/SilvaHelmet.cs @@ -3,6 +3,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Projectiles.Summon; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -23,9 +24,9 @@ namespace CalamityMod.Items.Armor item.height = 24; item.value = Item.buyPrice(0, 90, 0, 0); item.defense = 13; //110 - item.rare = ItemRarityID.Purple; - item.Calamity().customRarity = CalamityRarity.DarkBlue; - } + item.rare = ItemRarityID.Purple; + item.Calamity().customRarity = CalamityRarity.DarkBlue; + } public override bool IsArmorSet(Item head, Item body, Item legs) { @@ -60,8 +61,8 @@ namespace CalamityMod.Items.Armor } } player.minionDamage += 0.75f; - player.maxMinions += 5; - } + player.maxMinions += 5; + } public override void AddRecipes() { @@ -70,7 +71,7 @@ namespace CalamityMod.Items.Armor recipe.AddRecipeGroup("AnyGoldBar", 5); recipe.AddIngredient(ModContent.ItemType(), 6); recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddTile(TileID.LunarCraftingStation); + recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/Armor/SilvaMaskedCap.cs b/Items/Armor/SilvaMaskedCap.cs index 536bc0e960..4dd57e40d3 100644 --- a/Items/Armor/SilvaMaskedCap.cs +++ b/Items/Armor/SilvaMaskedCap.cs @@ -1,6 +1,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -23,9 +24,9 @@ namespace CalamityMod.Items.Armor item.height = 22; item.value = Item.buyPrice(0, 90, 0, 0); item.defense = 21; //110 - item.rare = ItemRarityID.Purple; - item.Calamity().customRarity = CalamityRarity.DarkBlue; - } + item.rare = ItemRarityID.Purple; + item.Calamity().customRarity = CalamityRarity.DarkBlue; + } public override bool IsArmorSet(Item head, Item body, Item legs) { @@ -64,7 +65,7 @@ namespace CalamityMod.Items.Armor recipe.AddRecipeGroup("AnyGoldBar", 5); recipe.AddIngredient(ModContent.ItemType(), 6); recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddTile(TileID.LunarCraftingStation); + recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); } From c6225fa532ebc8501f626a57693ea90f4f456b9b Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Thu, 16 Sep 2021 00:38:45 -0400 Subject: [PATCH 45/86] Dark Sun Ring is cheaper. Made at Cosmic Anvil. --- Items/Accessories/DarkSunRing.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Items/Accessories/DarkSunRing.cs b/Items/Accessories/DarkSunRing.cs index 104901d01b..8ce3c5b2fa 100644 --- a/Items/Accessories/DarkSunRing.cs +++ b/Items/Accessories/DarkSunRing.cs @@ -1,24 +1,25 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; -using Terraria.ID; using Terraria.DataStructures; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - public class DarkSunRing : ModItem + public class DarkSunRing : ModItem { public override void SetStaticDefaults() { DisplayName.SetDefault("Dark Sun Ring"); Tooltip.SetDefault("Contains the power of the dark sun\n" + - "12% increase to damage and melee speed\n" + + "12% increase to damage and melee speed\n" + "+1 life regen, 15% increased pick speed and +2 max minions\n" + "Increased minion knockback\n" + "During the day the player has +3 life regen\n" + "During the night the player has +15 defense\n" + - "Both of these bonuses are granted during an eclipse"); + "Both of these bonuses are granted during an eclipse"); Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 7)); } @@ -27,7 +28,7 @@ namespace CalamityMod.Items.Accessories item.width = 54; item.height = 58; item.value = CalamityGlobalItem.Rarity14BuyPrice; - item.rare = ItemRarityID.Purple; + item.rare = ItemRarityID.Purple; item.defense = 10; item.lifeRegen = 1; item.accessory = true; @@ -44,8 +45,8 @@ namespace CalamityMod.Items.Accessories { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddIngredient(ModContent.ItemType(), 50); - recipe.AddTile(TileID.LunarCraftingStation); + recipe.AddIngredient(ModContent.ItemType(), 20); + recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); } From ac36b1ba6ca6c13a993012a098096e79b0f5d208 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Thu, 16 Sep 2021 00:39:13 -0400 Subject: [PATCH 46/86] Eclipse Mirror cost matches Dark Sun Ring. Made at Cosmic Anvil. --- Items/Accessories/DimensionalSoulArtifact.cs | 24 ++++++++++---------- Items/Accessories/EclipseMirror.cs | 5 ++-- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Items/Accessories/DimensionalSoulArtifact.cs b/Items/Accessories/DimensionalSoulArtifact.cs index 9da87af51c..7133641ac3 100644 --- a/Items/Accessories/DimensionalSoulArtifact.cs +++ b/Items/Accessories/DimensionalSoulArtifact.cs @@ -14,19 +14,19 @@ namespace CalamityMod.Items.Accessories { DisplayName.SetDefault("Dimensional Soul Artifact"); Tooltip.SetDefault("Power\n" + - "Boosts all damage by 25%, but at what cost?\n" + + "Boosts all damage by 25%, but at what cost?\n" + "Increases all damage taken by 15%"); } public override void SetDefaults() { - item.width = 28; - item.height = 28; - item.accessory = true; - item.rare = ItemRarityID.Red; - item.Calamity().customRarity = CalamityRarity.DarkBlue; - item.value = CalamityGlobalItem.Rarity14BuyPrice; - } + item.width = 28; + item.height = 28; + item.accessory = true; + item.rare = ItemRarityID.Red; + item.Calamity().customRarity = CalamityRarity.DarkBlue; + item.value = CalamityGlobalItem.Rarity14BuyPrice; + } public override void UpdateAccessory(Player player, bool hideVisual) { @@ -37,10 +37,10 @@ namespace CalamityMod.Items.Accessories public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 25); - recipe.AddIngredient(ModContent.ItemType(), 25); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddTile(TileID.DemonAltar); + recipe.AddIngredient(ModContent.ItemType(), 25); + recipe.AddIngredient(ModContent.ItemType(), 25); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddTile(TileID.DemonAltar); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/Accessories/EclipseMirror.cs b/Items/Accessories/EclipseMirror.cs index 046765cd02..0e7385d48a 100644 --- a/Items/Accessories/EclipseMirror.cs +++ b/Items/Accessories/EclipseMirror.cs @@ -1,5 +1,6 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -52,8 +53,8 @@ namespace CalamityMod.Items.Accessories ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddTile(TileID.LunarCraftingStation); + recipe.AddIngredient(ModContent.ItemType(), 20); + recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); } From a6fbeacac600d7d553b8b181a3d8dd0f25af8f51 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Thu, 16 Sep 2021 00:39:36 -0400 Subject: [PATCH 47/86] Gaze of Crysthamyr isn't stupidly expensive. Made at Cosmic Anvil. --- Items/Mounts/GazeOfCrysthamyr.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Items/Mounts/GazeOfCrysthamyr.cs b/Items/Mounts/GazeOfCrysthamyr.cs index a6ce67377b..032c9cc707 100644 --- a/Items/Mounts/GazeOfCrysthamyr.cs +++ b/Items/Mounts/GazeOfCrysthamyr.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Ores; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ID; using Terraria.ModLoader; @@ -35,9 +36,9 @@ namespace CalamityMod.Items.Mounts ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.DD2PetDragon); recipe.AddIngredient(ItemID.SoulofNight, 100); - recipe.AddIngredient(ModContent.ItemType(), 50); + recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ModContent.ItemType(), 25); - recipe.AddTile(TileID.LunarCraftingStation); + recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); } From e6545ea1d9f6b7d2d2280deabadc168656e4d063 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Thu, 16 Sep 2021 00:39:54 -0400 Subject: [PATCH 48/86] Silva blocks are made at Cosmic Anvil (like Cosmilite blocks). --- Items/Placeables/FurnitureSilva/SilvaCrystal.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Placeables/FurnitureSilva/SilvaCrystal.cs b/Items/Placeables/FurnitureSilva/SilvaCrystal.cs index 0ba123cb02..492271d146 100644 --- a/Items/Placeables/FurnitureSilva/SilvaCrystal.cs +++ b/Items/Placeables/FurnitureSilva/SilvaCrystal.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ModContent.ItemType()); recipe.SetResult(this, 400); - recipe.AddTile(TileID.LunarCraftingStation); + recipe.AddTile(ModContent.TileType()); recipe.AddRecipe(); recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 4); From 59964dd791f3733ed954101c3329a9767234dcba Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Thu, 16 Sep 2021 00:42:52 -0400 Subject: [PATCH 49/86] 1 - No pre-Yharon weapons except Arsenal ones use ASE. 2 - Exactly nine pre-Yharon weapons use each of NF, EE and DSF. 3 - Weapon upgrades which didn't require Cosmilite now take 8 bars. 4 - Costs in NF, EE and DSF standardized, except Ice Barrage, which takes double EE. --- Items/Weapons/Magic/EventHorizon.cs | 3 +- Items/Weapons/Magic/FaceMelter.cs | 2 +- Items/Weapons/Magic/IceBarrage.cs | 3 +- Items/Weapons/Magic/LightGodsBrilliance.cs | 3 +- Items/Weapons/Magic/PrimordialAncient.cs | 2 +- Items/Weapons/Magic/RecitationoftheBeast.cs | 2 +- Items/Weapons/Melee/DevilsDevastation.cs | 2 +- Items/Weapons/Melee/EmpyreanKnives.cs | 2 +- Items/Weapons/Melee/FourSeasonsGalaxia.cs | 2 +- Items/Weapons/Melee/GreatswordofBlah.cs | 2 +- Items/Weapons/Melee/Nadir.cs | 2 +- Items/Weapons/Melee/PrismaticBreaker.cs | 2 +- Items/Weapons/Ranged/Alluvion.cs | 2 +- Items/Weapons/Ranged/Karasawa.cs | 2 +- Items/Weapons/Ranged/Onyxia.cs | 3 +- Items/Weapons/Ranged/Phangasm.cs | 2 +- Items/Weapons/Ranged/RubicoPrime.cs | 1 - Items/Weapons/Ranged/SDFMG.cs | 2 +- Items/Weapons/Ranged/StarfleetMK2.cs | 2 +- Items/Weapons/Ranged/ThePack.cs | 2 +- Items/Weapons/Ranged/Ultima.cs | 2 +- Items/Weapons/Rogue/Hypothermia.cs | 3 +- Items/Weapons/Rogue/Penumbra.cs | 3 +- Items/Weapons/Summon/CorvidHarbringerStaff.cs | 3 +- Items/Weapons/Summon/EndoHydraStaff.cs | 3 +- Items/Weapons/Summon/SarosPossession.cs | 48 ++++++++++--------- 26 files changed, 52 insertions(+), 53 deletions(-) diff --git a/Items/Weapons/Magic/EventHorizon.cs b/Items/Weapons/Magic/EventHorizon.cs index 115962a0e6..c523d60ef4 100644 --- a/Items/Weapons/Magic/EventHorizon.cs +++ b/Items/Weapons/Magic/EventHorizon.cs @@ -57,7 +57,8 @@ namespace CalamityMod.Items.Weapons.Magic recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType(), 15); + recipe.AddIngredient(ModContent.ItemType(), 8); + recipe.AddIngredient(ModContent.ItemType(), 8); recipe.AddTile(TileID.Bookcases); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Magic/FaceMelter.cs b/Items/Weapons/Magic/FaceMelter.cs index 37cf56678c..3201f0e701 100644 --- a/Items/Weapons/Magic/FaceMelter.cs +++ b/Items/Weapons/Magic/FaceMelter.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Weapons.Magic recipe.AddIngredient(ItemID.MagicalHarp); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 8); - recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Magic/IceBarrage.cs b/Items/Weapons/Magic/IceBarrage.cs index 7978b1cd4c..12ef782e39 100644 --- a/Items/Weapons/Magic/IceBarrage.cs +++ b/Items/Weapons/Magic/IceBarrage.cs @@ -71,7 +71,8 @@ namespace CalamityMod.Items.Weapons.Magic recipe.AddIngredient(ItemID.BlizzardStaff); recipe.AddIngredient(ItemID.IceRod); recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType(), 23); + recipe.AddIngredient(ModContent.ItemType(), 8); + recipe.AddIngredient(ModContent.ItemType(), 40); recipe.AddIngredient(ModContent.ItemType(), 18); recipe.AddTile(TileID.IceMachine); recipe.SetResult(this); diff --git a/Items/Weapons/Magic/LightGodsBrilliance.cs b/Items/Weapons/Magic/LightGodsBrilliance.cs index a0166c273c..94e3482229 100644 --- a/Items/Weapons/Magic/LightGodsBrilliance.cs +++ b/Items/Weapons/Magic/LightGodsBrilliance.cs @@ -54,9 +54,10 @@ namespace CalamityMod.Items.Weapons.Magic recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.HolyWater, 10); - recipe.AddIngredient(ModContent.ItemType(), 2); recipe.AddIngredient(ItemID.SoulofLight, 30); recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ModContent.ItemType(), 8); + recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddTile(TileID.Bookcases); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Magic/PrimordialAncient.cs b/Items/Weapons/Magic/PrimordialAncient.cs index 878952e3d1..83e8c1b6b1 100644 --- a/Items/Weapons/Magic/PrimordialAncient.cs +++ b/Items/Weapons/Magic/PrimordialAncient.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Weapons.Magic recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.AncientBattleArmorMaterial, 5); recipe.AddIngredient(ModContent.ItemType(), 8); - recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddTile(TileID.Bookcases); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Magic/RecitationoftheBeast.cs b/Items/Weapons/Magic/RecitationoftheBeast.cs index 55aa46d0ed..032cfc6cd8 100644 --- a/Items/Weapons/Magic/RecitationoftheBeast.cs +++ b/Items/Weapons/Magic/RecitationoftheBeast.cs @@ -64,7 +64,7 @@ namespace CalamityMod.Items.Weapons.Magic recipe.AddIngredient(ItemID.DemonScythe); recipe.AddIngredient(ModContent.ItemType(), 12); recipe.AddIngredient(ModContent.ItemType(), 8); - recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddTile(TileID.Bookcases); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Melee/DevilsDevastation.cs b/Items/Weapons/Melee/DevilsDevastation.cs index 5e92f8e618..363286dcf8 100644 --- a/Items/Weapons/Melee/DevilsDevastation.cs +++ b/Items/Weapons/Melee/DevilsDevastation.cs @@ -108,7 +108,7 @@ namespace CalamityMod.Items.Weapons.Melee recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 8); - recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Melee/EmpyreanKnives.cs b/Items/Weapons/Melee/EmpyreanKnives.cs index ded1b73987..5c173f9264 100644 --- a/Items/Weapons/Melee/EmpyreanKnives.cs +++ b/Items/Weapons/Melee/EmpyreanKnives.cs @@ -104,7 +104,7 @@ namespace CalamityMod.Items.Weapons.Melee recipe.AddIngredient(ItemID.VampireKnives); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 8); - recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.AddIngredient(ModContent.ItemType(), 8); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Melee/FourSeasonsGalaxia.cs b/Items/Weapons/Melee/FourSeasonsGalaxia.cs index d4d0501ed6..9e81378b6e 100644 --- a/Items/Weapons/Melee/FourSeasonsGalaxia.cs +++ b/Items/Weapons/Melee/FourSeasonsGalaxia.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Items.Weapons.Melee ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 8); - recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.AddIngredient(ModContent.ItemType(), 8); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Melee/GreatswordofBlah.cs b/Items/Weapons/Melee/GreatswordofBlah.cs index f8a3db23c5..5473633d52 100644 --- a/Items/Weapons/Melee/GreatswordofBlah.cs +++ b/Items/Weapons/Melee/GreatswordofBlah.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Weapons.Melee ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 8); - recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Melee/Nadir.cs b/Items/Weapons/Melee/Nadir.cs index c4d43b73df..b639822bf1 100644 --- a/Items/Weapons/Melee/Nadir.cs +++ b/Items/Weapons/Melee/Nadir.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Weapons.Melee recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ModContent.ItemType(), 8); - recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.AddIngredient(ModContent.ItemType(), 8); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Melee/PrismaticBreaker.cs b/Items/Weapons/Melee/PrismaticBreaker.cs index 561ad7e3c1..47693bf1e0 100644 --- a/Items/Weapons/Melee/PrismaticBreaker.cs +++ b/Items/Weapons/Melee/PrismaticBreaker.cs @@ -162,7 +162,7 @@ namespace CalamityMod.Items.Weapons.Melee recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 3); recipe.AddIngredient(ModContent.ItemType(), 8); - recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Ranged/Alluvion.cs b/Items/Weapons/Ranged/Alluvion.cs index 656ac5558d..8153a926f4 100644 --- a/Items/Weapons/Ranged/Alluvion.cs +++ b/Items/Weapons/Ranged/Alluvion.cs @@ -99,7 +99,7 @@ namespace CalamityMod.Items.Weapons.Ranged recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ModContent.ItemType(), 8); - recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Ranged/Karasawa.cs b/Items/Weapons/Ranged/Karasawa.cs index d30e012404..8f3a505b54 100644 --- a/Items/Weapons/Ranged/Karasawa.cs +++ b/Items/Weapons/Ranged/Karasawa.cs @@ -81,7 +81,7 @@ namespace CalamityMod.Items.Weapons.Ranged r.AddIngredient(ModContent.ItemType(), 15); r.AddIngredient(ModContent.ItemType(), 5); r.AddIngredient(ModContent.ItemType(), 8); - r.AddIngredient(ModContent.ItemType(), 2); + r.AddIngredient(ModContent.ItemType(), 20); r.AddTile(ModContent.TileType()); r.SetResult(this); r.AddRecipe(); diff --git a/Items/Weapons/Ranged/Onyxia.cs b/Items/Weapons/Ranged/Onyxia.cs index a92cf34848..184b09b546 100644 --- a/Items/Weapons/Ranged/Onyxia.cs +++ b/Items/Weapons/Ranged/Onyxia.cs @@ -80,8 +80,7 @@ namespace CalamityMod.Items.Weapons.Ranged ModRecipe r = new ModRecipe(mod); r.AddIngredient(ModContent.ItemType()); r.AddIngredient(ModContent.ItemType(), 8); - r.AddIngredient(ModContent.ItemType(), 6); - r.AddIngredient(ModContent.ItemType(), 2); + r.AddIngredient(ModContent.ItemType(), 8); r.AddTile(ModContent.TileType()); r.SetResult(this); r.AddRecipe(); diff --git a/Items/Weapons/Ranged/Phangasm.cs b/Items/Weapons/Ranged/Phangasm.cs index e461a0074d..1137124739 100644 --- a/Items/Weapons/Ranged/Phangasm.cs +++ b/Items/Weapons/Ranged/Phangasm.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Weapons.Ranged recipe.AddIngredient(ItemID.Phantasm); recipe.AddIngredient(ModContent.ItemType(), 8); recipe.AddIngredient(ModContent.ItemType(), 20); - recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Ranged/RubicoPrime.cs b/Items/Weapons/Ranged/RubicoPrime.cs index 6c0f5a3076..c1f0a1a8de 100644 --- a/Items/Weapons/Ranged/RubicoPrime.cs +++ b/Items/Weapons/Ranged/RubicoPrime.cs @@ -53,7 +53,6 @@ namespace CalamityMod.Items.Weapons.Ranged recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 8); recipe.AddIngredient(ModContent.ItemType(), 20); - recipe.AddIngredient(ModContent.ItemType(), 2); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Ranged/SDFMG.cs b/Items/Weapons/Ranged/SDFMG.cs index 879bf534e4..9408f12bd1 100644 --- a/Items/Weapons/Ranged/SDFMG.cs +++ b/Items/Weapons/Ranged/SDFMG.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Items.Weapons.Ranged recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ModContent.ItemType(), 8); - recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Ranged/StarfleetMK2.cs b/Items/Weapons/Ranged/StarfleetMK2.cs index af650a63bd..4a994de9b3 100644 --- a/Items/Weapons/Ranged/StarfleetMK2.cs +++ b/Items/Weapons/Ranged/StarfleetMK2.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Weapons.Ranged recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 15); recipe.AddIngredient(ModContent.ItemType(), 8); - recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.AddIngredient(ModContent.ItemType(), 8); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Ranged/ThePack.cs b/Items/Weapons/Ranged/ThePack.cs index b8e87b7f35..d74a78ba1b 100644 --- a/Items/Weapons/Ranged/ThePack.cs +++ b/Items/Weapons/Ranged/ThePack.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Items.Weapons.Ranged recipe.AddIngredient(ItemID.MarbleBlock, 50); recipe.AddIngredient(ModContent.ItemType(), 4); recipe.AddIngredient(ModContent.ItemType(), 8); - recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Ranged/Ultima.cs b/Items/Weapons/Ranged/Ultima.cs index 641531080f..8091eaa700 100644 --- a/Items/Weapons/Ranged/Ultima.cs +++ b/Items/Weapons/Ranged/Ultima.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Weapons.Ranged recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 15); recipe.AddIngredient(ModContent.ItemType(), 8); - recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.AddIngredient(ModContent.ItemType(), 8); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Rogue/Hypothermia.cs b/Items/Weapons/Rogue/Hypothermia.cs index 9936753070..daa44fd7eb 100644 --- a/Items/Weapons/Rogue/Hypothermia.cs +++ b/Items/Weapons/Rogue/Hypothermia.cs @@ -84,9 +84,8 @@ namespace CalamityMod.Items.Weapons.Rogue ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.IceBlock, 100); recipe.AddIngredient(ModContent.ItemType(), 6); - recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddIngredient(ModContent.ItemType(), 8); - recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Rogue/Penumbra.cs b/Items/Weapons/Rogue/Penumbra.cs index f041c1318d..6a70ba8894 100644 --- a/Items/Weapons/Rogue/Penumbra.cs +++ b/Items/Weapons/Rogue/Penumbra.cs @@ -72,10 +72,9 @@ namespace CalamityMod.Items.Weapons.Rogue public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddIngredient(ModContent.ItemType(), 6); recipe.AddIngredient(ModContent.ItemType(), 8); - recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Summon/CorvidHarbringerStaff.cs b/Items/Weapons/Summon/CorvidHarbringerStaff.cs index 5c777bc0a4..f4e6f1aa3e 100644 --- a/Items/Weapons/Summon/CorvidHarbringerStaff.cs +++ b/Items/Weapons/Summon/CorvidHarbringerStaff.cs @@ -51,9 +51,8 @@ namespace CalamityMod.Items.Weapons.Summon { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.RavenStaff); - recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddIngredient(ModContent.ItemType(), 8); - recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Summon/EndoHydraStaff.cs b/Items/Weapons/Summon/EndoHydraStaff.cs index 79b53ed827..c5123dc0ff 100644 --- a/Items/Weapons/Summon/EndoHydraStaff.cs +++ b/Items/Weapons/Summon/EndoHydraStaff.cs @@ -78,9 +78,8 @@ namespace CalamityMod.Items.Weapons.Summon { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.StaffoftheFrostHydra); - recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddIngredient(ModContent.ItemType(), 8); - recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Summon/SarosPossession.cs b/Items/Weapons/Summon/SarosPossession.cs index 5debf265f3..ad07758adb 100644 --- a/Items/Weapons/Summon/SarosPossession.cs +++ b/Items/Weapons/Summon/SarosPossession.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; +using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -9,14 +10,14 @@ namespace CalamityMod.Items.Weapons.Summon { public class SarosPossession : ModItem { - int radianceSlots; + int radianceSlots; public override void SetStaticDefaults() { DisplayName.SetDefault("Saros Possession"); Tooltip.SetDefault("Gain absolute control over light itself\n" + - "Summons a radiant aura\n" + + "Summons a radiant aura\n" + "Consumes all of the remaining minion slots on use\n" + - "Must be used from the hotbar\n" + + "Must be used from the hotbar\n" + "Increased power based on the number of minion slots used"); } @@ -36,33 +37,33 @@ namespace CalamityMod.Items.Weapons.Summon item.shoot = ModContent.ProjectileType(); item.shootSpeed = 10f; - item.value = CalamityGlobalItem.Rarity14BuyPrice; - item.rare = ItemRarityID.Purple; - item.Calamity().customRarity = CalamityRarity.DarkBlue; - } + item.value = CalamityGlobalItem.Rarity14BuyPrice; + item.rare = ItemRarityID.Purple; + item.Calamity().customRarity = CalamityRarity.DarkBlue; + } - public override void HoldItem(Player player) + public override void HoldItem(Player player) { - double minionCount = 0; - for (int j = 0; j < Main.projectile.Length; j++) - { + double minionCount = 0; + for (int j = 0; j < Main.projectile.Length; j++) + { Projectile proj = Main.projectile[j]; - if (proj.active && proj.owner == player.whoAmI && proj.minion && proj.type != item.shoot) - { - minionCount += proj.minionSlots; - } - } + if (proj.active && proj.owner == player.whoAmI && proj.minion && proj.type != item.shoot) + { + minionCount += proj.minionSlots; + } + } radianceSlots = (int)(player.maxMinions - minionCount); - } + } public override bool CanUseItem(Player player) - { - return radianceSlots >= 1; - } + { + return radianceSlots >= 1; + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - CalamityUtils.KillShootProjectiles(true, type, player); + CalamityUtils.KillShootProjectiles(true, type, player); Projectile.NewProjectile(position, Vector2.Zero, type, damage, knockBack, player.whoAmI, radianceSlots); return false; } @@ -71,8 +72,9 @@ namespace CalamityMod.Items.Weapons.Summon { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType(), 25); - recipe.AddTile(TileID.LunarCraftingStation); + recipe.AddIngredient(ModContent.ItemType(), 8); + recipe.AddIngredient(ModContent.ItemType(), 8); + recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); } From a6c1778a5445bf9e8abd654af2c16774ef4e1e7c Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Thu, 16 Sep 2021 00:44:52 -0400 Subject: [PATCH 50/86] fix typo --- Items/Armor/FearmongerGreaves.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Armor/FearmongerGreaves.cs b/Items/Armor/FearmongerGreaves.cs index 5d0c56f957..c131b591bf 100644 --- a/Items/Armor/FearmongerGreaves.cs +++ b/Items/Armor/FearmongerGreaves.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Armor { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.SpookyLeggings); - \recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ItemID.SoulofFright, 10); recipe.AddIngredient(ModContent.ItemType(), 2); recipe.AddTile(ModContent.TileType()); From cddd0d4698968f2e9aa61c4bfa988948534616c2 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Thu, 16 Sep 2021 00:46:11 -0400 Subject: [PATCH 51/86] forgot to standardize eclipse's fall --- Items/Weapons/Rogue/EclipsesFall.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Items/Weapons/Rogue/EclipsesFall.cs b/Items/Weapons/Rogue/EclipsesFall.cs index 39f4604d36..660bf75dc4 100644 --- a/Items/Weapons/Rogue/EclipsesFall.cs +++ b/Items/Weapons/Rogue/EclipsesFall.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Rogue; +using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -52,9 +53,10 @@ namespace CalamityMod.Items.Weapons.Rogue { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType(), 15); - recipe.AddIngredient(ModContent.ItemType(), 6); - recipe.AddTile(TileID.LunarCraftingStation); + recipe.AddIngredient(ModContent.ItemType(), 12); + recipe.AddIngredient(ModContent.ItemType(), 8); + recipe.AddIngredient(ModContent.ItemType(), 8); + recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); } From f7c2ef0c6090f35ed4fbf331c695997be079a00f Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 15 Sep 2021 23:54:36 -0500 Subject: [PATCH 52/86] Individual schematic icons for Codebreaker --- .../UI/EncryptedSchematicSlotEmpty.png | Bin 0 -> 458 bytes .../UI/EncryptedSchematicSlotFullHell.png | Bin 0 -> 709 bytes .../UI/EncryptedSchematicSlotFullIce.png | Bin 0 -> 701 bytes .../UI/EncryptedSchematicSlotFullJungle.png | Bin 0 -> 699 bytes .../UI/EncryptedSchematicSlotFullPlanetoid.png | Bin 0 -> 684 bytes .../UI/EncryptedSchematicSlot_Empty.png | Bin 704 -> 0 bytes .../UI/EncryptedSchematicSlot_Full.png | Bin 1077 -> 0 bytes UI/CodebreakerUI.cs | 17 +++++++++++++++-- 8 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 ExtraTextures/UI/EncryptedSchematicSlotEmpty.png create mode 100644 ExtraTextures/UI/EncryptedSchematicSlotFullHell.png create mode 100644 ExtraTextures/UI/EncryptedSchematicSlotFullIce.png create mode 100644 ExtraTextures/UI/EncryptedSchematicSlotFullJungle.png create mode 100644 ExtraTextures/UI/EncryptedSchematicSlotFullPlanetoid.png delete mode 100644 ExtraTextures/UI/EncryptedSchematicSlot_Empty.png delete mode 100644 ExtraTextures/UI/EncryptedSchematicSlot_Full.png diff --git a/ExtraTextures/UI/EncryptedSchematicSlotEmpty.png b/ExtraTextures/UI/EncryptedSchematicSlotEmpty.png new file mode 100644 index 0000000000000000000000000000000000000000..75f2f538b54240387e46bc2f8ebbd42cd8414bdc GIT binary patch literal 458 zcmeAS@N?(olHy`uVBq!ia0vp^HXzKw3=&b&bO2I}#X;^)4C~IxyaaMs(j9#r85lP9 zbN@+X1@g55d_r7-w2HE7Q+aV>c$oa}{|pDOdAYi=va*V*>X{mvh(+WFIXe}3f($nQ zvO63|@s$Mm1^-6|46X<6oB+yj7I;J!0~H(uVa6R3v)=+8!0+ke7~?0x^{T&OwfeIpY`)Cn@aGmwdOwyus+)fO z{*rJzD@{-DFSU#lRopJ=8!z6iWnBGKAm|aB=Bz*By#k*!O|R-M{}N~A%yL}Y`?!+u z&nE&KDkjPc^UU12{-);R?peW%DHgj^WM?|f>9;xS9yhJ{p7QfIJ94JyXhxi?+bQCG z@Y{*LrkyD9^^-UuGNe zeb3vK@^j@&uBN^?CC!}f_}!;;l9QQhuAEVw;q};P?zgv}Dz2vsvG%L3-?MD5(Tmjg iZ>!zBqK+!He_(ztnP>P>{0S)B89ZJ6T-G@yGywo)bh`Ec literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/EncryptedSchematicSlotFullHell.png b/ExtraTextures/UI/EncryptedSchematicSlotFullHell.png new file mode 100644 index 0000000000000000000000000000000000000000..f22ba881559c5aaa1942cf5888e279e97e684558 GIT binary patch literal 709 zcmeAS@N?(olHy`uVBq!ia0vp^HXzKw3=&b&bO2I}#X;^)4C~IxyaaMs(j9#r85lP9 zbN@+X1@c1zd_r7-w2HE7Q+aV>c$oa}{|pDOdAYi=va*V*>X{mvh(+YPsHx4fx6d;% zVU{f6YP`?pwD4+L+OMJr=6C=8|Nr09)5F@aGdw&z$k{2>$)m^<|I**fDwYo5O_`8_sMxFM3>g`|lGG zKOdYZp5|4XyFf(QDP_+Z)3W%fTl=QEeu{~na@^hSNV~?7=Q~3eKeegXTN}vbx8}@T z+f6}*n>eiee}0*e#NzIF?bcVzpkuwag8bDd=DSCJ5}ELD$)wfRF^d;#tY8+Lqqp|Y zV~gljUC|CtiW(!Py`LocYO~zTlvOWNJNApcDy`jnZL9Td4e_IIw@oxVq?F>}!tzMP z`MC2Zy`ME^Y+Z&*$3jH=7F;X6+%aXT$AsHvy?3^GE#&Ilt;L->Cum8gg5$egySFS( zS>k(BLQR&9r};SJ;gmV2bGvU@?0l~-d2ogCvsWCQ(#(=p^5?Hja+=4+D;f^Q*_>)>zVX(#ZS48 z{JSlIGsHGWZjC;6gw5iM;p_)Nc5|kG{{8#uhu8Z(ZGPxPZtCfq+9+KXZl~_D@ynZu buKyUc-?c7vK9HgUjB*A~S3j3^P6c$oa}{|pDOdAYi=va*V*>X{mvxTvX#MdZ)3x4)W} zmS05ba4#v@ZLI|x4cO~q^&Sl!1N)-9W~Qnpg&wzx`7uHO`u_0z{1GA=(!Y^bq2-Ys(a^FCgOW10rNnFl|eh%mVMe9OhiSmx!tr?w<` z8hJ&W(wM9-EPT4{OuTbY*&-XB{-W!iQ@IzE$)1)lh?VQu*>i&>dx7#RDM^c+PaYed zdhPL+Mb5nP=?eRH`Hht+*^B?g8$9@XI$^ud|DwtNX7#jJ8%$2wcQu90t1s`6W=?l| z?AGXG$Ji>gXZjjUIZ|oy^8NJ3tN*A8e%PFH&StJw^M*GIYyEr*wckvf`ipgKPiL#8 TzibIGsu?_8{an^LB{Ts5C?P;r literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/EncryptedSchematicSlotFullJungle.png b/ExtraTextures/UI/EncryptedSchematicSlotFullJungle.png new file mode 100644 index 0000000000000000000000000000000000000000..e1c3851c0a2c286bfb0551c35f9de83eb89e1361 GIT binary patch literal 699 zcmeAS@N?(olHy`uVBq!ia0vp^HXzKw3=&b&bO2I}#X;^)4C~IxyaaMs(j9#r85lP9 zbN@+X1@c1zd_r7-w2HE7Q+aV>c$oa}{|pDOdAYi=va*V*>X{mvh(+WxOO|jo-e+@K z$l9@!`Q5+&|NpnY%nfpOD)O}H>FEg%51(gme>E-5MNKW#$s^Ci1ZbeQR>5^3B~udQ z7YtO73owXpdIVC(S>O>_%)r2R0E8K{u61$(9e%>o#WBRgd+&7q>Lvw&_VZg0o=}|~ zW&HQw{o?PB`3_IB_0D+znS7GQ`=G5eO-q$0z)x)P9 z6T5lKW+sQa{-?V5`z;yv!l};>S*D-b5g4FYZ@|86UEu;3StiMgPt#ian2dJ0PWvG8 zrD4WCi_}!54&TSMmlquSD48)U{q(GtJ>NYfF55=;WhxiGUtD9c;BQT&T-O9s{}#`H zf9-#cwkXbXn8dd7&bHJi+j@(32_{+F>1l7*^4_;ZS6aE`GpC29IG=KSJ};)+`H6;-XB36VxY9YzXPbN4Yz9Bt-&l*@FI z_4Jh8dQ;mUE=g!=v^4gX2ENBM(Z0 z!}h(H^h!wfQh1K!&7B(mMRhFdC3B|zR5yR!f3jjHyRr8)ci;03B_*Prhqif?T}_je zmVU7K*qWxLCNa}4e=D<`_G`Y&!TXa`PrrzfY&k9W>h}?il~Z+%F7gMf)|I+(Eh_*< OG=rzBpUXO@geCx+TrrOT literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/EncryptedSchematicSlotFullPlanetoid.png b/ExtraTextures/UI/EncryptedSchematicSlotFullPlanetoid.png new file mode 100644 index 0000000000000000000000000000000000000000..2630435014e1180b2cd9b058947fcc639ec11d59 GIT binary patch literal 684 zcmeAS@N?(olHy`uVBq!ia0vp^HXzKw3=&b&bO2I}#X;^)4C~IxyaaMs(j9#r85lP9 zbN@+X1@c1zd_r7-w2HE7Q+aV>c$oa}{|pDOdAYi=va*V*>X{mvh(+WxNR%-&K4frO z?5eIl-@)Npdiwthx(uDW7~cQSH#PnL|9_CPQ$$2WZ*Omrr%jl%C(yvS!q7Y*B~udQ z7YtN@3owXpdUPGAj>?wFYU7U=Muo-U3d9^PB0HWLPL;&J`ZAYeIl z?UdboMkPFx8;%PsdpzT`>UqV-Erv@b?PfR~ob;H%>c9e4zdL)I_q;3JynfF!(cS%T z=A2mHB+SR(e75MvN!c%@Mse>hhMcsy8pN-$Rqv4I9kIo`vo`lgOFzgyrPCC=)MCC~ zZvOPA#(&j4ALO5$k{PAlTygX9FUv`fN|U;MzOZjPUstQ3%ij!)Sq4v6KbLh*2~7a0 CvNquW literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/EncryptedSchematicSlot_Empty.png b/ExtraTextures/UI/EncryptedSchematicSlot_Empty.png deleted file mode 100644 index 3cde1bf37a6e8559fb641327083931f8f6ff1261..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 704 zcmV;x0zdtUP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!TwsVm5VVd z%7cj1*vKGmaBjo*(6T@YlruBG1bx2@L4V8L-UYO@wHnH=v#TnhiH=K-gY8WXxWRdd zyg-Zm`B2X6!Xh+3U`0Mzyo4=BM~8=?oLJ-9IXs5C-a%)A=b;-k-Qn|ae-3^&#M<^2G}R6z3OU@{(FrBQ zIOt5!%srleI>P56$3a3@CspH?Q$?E_noMz^=U=>4)M)%()l$Xd+!U0L|KRu#DlZ4! zhL?ksgXzktzvAVftx8PiGS$7`;5n!}-UM}_#Gi-8k>{W)5}D3@fBK~*F&9jYC?hRAU+{FZ~J3(=!3G!9>Z@^Ubc^M*#KB9&>VYKQ9` zboOK>`rAx#m|ow9CVIM*s@(uuRZmxEP(J?2m0hUkpf2Zw<2@}@dLyTZa0-L9b}v29^NvF+j=#k$Y-~d1 zILJ?DI20j@%zrsZEA8ulzMl|tx}p mD5ed#70-DVL0000Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!TxrbQHqNc!^9BESxocJx&LuG`FPHU#>|@^-1(n3Z$|H%|2^m4`(|t&k4MwV z&B@~+NX9>p*;E)7!quNRI*MX!Ia_n-lRAC;2t6VBIx$7MB`bqea_7NgQun7Z($zBg zc7!x@cLAw9j^CC?8fw3+M_xzt=b*Py4jy(^=%USjpCbi>L+@3zGU3iW33AbhqV2m> z#H6MqlRkC5Ahn)@z}5YVbgdl<6*%m493TajanN^xdhW^mi$vsgSjRySsZJX8+d5U$ zUR1!%j9kTy@1O22i2SawS?mR1a-J=4<@JH6d9jrJu04jNU>`f^s4bDouNl4&-+iME`Ra8*^& z>VsvZQ*#TX)~%u$$%&*-dU{FSZa3*|hlA7zI9F3sL)zYQk5t>F{|hf>PL4FP9&2NL zSj#Gp3mRBs^B}W9sSk`{2`cCC!pi4?-EQZg?gU9YJ$gBm#tJ8pOV>MD;WXw!fcL>U z6EFh%=+R0!c&TcSE?V#OFH%%dgV$ZRP+g4q%phz<(~(`9a-Ub`Iz9_f+ly zR8i3JvWwJu4o)m3kjg50QRUW+J|5jT{+5_R3hr0ba{wpBTGSBfFy=?25g{D3Y!&r6 zD911y#7d?xk*gDs&Vhd%l>0&Hl*~ONu#3PQf-9M<3OSEkF9+dZR>Bf#bLTr!qaD3( z$8H831RK@+{C5a}uzw$G%S~1_0%BDZRTM}EgJpL7gNgz~?%a(~4$A&FJ$pkMb1+l~ z*BX33c%i(M6j;W=*ab#9zF!;KY&Ht8A_(=niS+_Gh+kV^4eGrvy}nqeiprIMygMaH z&E2V@^}%R9m1|I7y_JmIPf6q|{eL-#k!E!72w3;ND8MIR^n9k9tFIaIm%PC;8Bawq v;C@=iK?&v&%#RYBUoXu1VRSyq9n`cxKQO`C_MxKn00000NkvXXu0mjfOC9f{ diff --git a/UI/CodebreakerUI.cs b/UI/CodebreakerUI.cs index 74af94253f..700caa2e2b 100644 --- a/UI/CodebreakerUI.cs +++ b/UI/CodebreakerUI.cs @@ -96,8 +96,21 @@ namespace CalamityMod.UI DrawDecryptCancelConfirmationText(textPanelCenter); // Draw the schematic icon. - Texture2D emptySchematicIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/EncryptedSchematicSlot_Empty"); - Texture2D occupiedSchematicIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/EncryptedSchematicSlot_Full"); + Texture2D emptySchematicIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/EncryptedSchematicSlotEmpty"); + Texture2D occupiedSchematicIconTexture = emptySchematicIconTexture; + int schematicType = 0; + + if (codebreakerTileEntity.HeldSchematicID > 0) + schematicType = CalamityLists.EncryptedSchematicIDRelationship[codebreakerTileEntity.HeldSchematicID]; + + if (schematicType == ModContent.ItemType()) + occupiedSchematicIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/EncryptedSchematicSlotFullPlanetoid"); + if (schematicType == ModContent.ItemType()) + occupiedSchematicIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/EncryptedSchematicSlotFullJungle"); + if (schematicType == ModContent.ItemType()) + occupiedSchematicIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/EncryptedSchematicSlotFullHell"); + if (schematicType == ModContent.ItemType()) + occupiedSchematicIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/EncryptedSchematicSlotFullIce"); Texture2D schematicTexture = codebreakerTileEntity.HeldSchematicID != 0 ? occupiedSchematicIconTexture : emptySchematicIconTexture; spriteBatch.Draw(schematicTexture, schematicSlotDrawCenter, null, Color.White, 0f, schematicTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); From 6406df424435520b51531c7a5fa2e1866dabc9f2 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Thu, 16 Sep 2021 00:01:07 -0500 Subject: [PATCH 53/86] Draedon summon laser fixes --- Projectiles/Boss/DraedonSummonLaser.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Projectiles/Boss/DraedonSummonLaser.cs b/Projectiles/Boss/DraedonSummonLaser.cs index 8c13fbe34c..5cd53e6515 100644 --- a/Projectiles/Boss/DraedonSummonLaser.cs +++ b/Projectiles/Boss/DraedonSummonLaser.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Boss public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; public PrimitiveTrail RayDrawer = null; - private const int Lifetime = CalamityWorld.DraedonSummonCountdownMax - 150; + private const int Lifetime = CalamityWorld.DraedonSummonCountdownMax - 60; public override void SetStaticDefaults() => DisplayName.SetDefault("Giant Fuck-off Deathray of Doom"); @@ -35,6 +35,7 @@ namespace CalamityMod.Projectiles.Boss { if (projectile.localAI[0] == 0f) { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/TeslaCannonFire"), projectile.Center); for (int i = 0; i < 36; i++) { Dust exoDust = Dust.NewDustPerfect(projectile.BottomRight, 267); From 5134422860552afe9490181b6eb960ca6938067d Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Thu, 16 Sep 2021 11:27:45 -0500 Subject: [PATCH 54/86] Moved the ExoMech enumeration --- Enums/ExoMech.cs | 10 ++++++++++ NPCs/ExoMechs/Draedon.cs | 8 -------- UI/ExoMechSelectionUI.cs | 22 +++++++++++----------- World/CalamityWorld.cs | 4 ++-- World/WorldUpdateMiscEffects.cs | 4 ++-- 5 files changed, 25 insertions(+), 23 deletions(-) create mode 100644 Enums/ExoMech.cs diff --git a/Enums/ExoMech.cs b/Enums/ExoMech.cs new file mode 100644 index 0000000000..bc83c71dda --- /dev/null +++ b/Enums/ExoMech.cs @@ -0,0 +1,10 @@ +namespace CalamityMod +{ + public enum ExoMech + { + None, + Destroyer, + Prime, + Twins + } +} diff --git a/NPCs/ExoMechs/Draedon.cs b/NPCs/ExoMechs/Draedon.cs index ad9fa558c6..c44df34746 100644 --- a/NPCs/ExoMechs/Draedon.cs +++ b/NPCs/ExoMechs/Draedon.cs @@ -16,14 +16,6 @@ namespace CalamityMod.NPCs.ExoMechs { public class Draedon : ModNPC { - public enum ExoMech - { - None, - Destroyer, - Prime, - Twins - } - public Vector2 HoverDestinationOffset { get => new Vector2(npc.ai[1], npc.ai[2]); diff --git a/UI/ExoMechSelectionUI.cs b/UI/ExoMechSelectionUI.cs index 0a37d95086..13963df5a5 100644 --- a/UI/ExoMechSelectionUI.cs +++ b/UI/ExoMechSelectionUI.cs @@ -31,12 +31,12 @@ namespace CalamityMod.UI Vector2 primeIconDrawOffset = new Vector2(0f, -140f); Vector2 twinsIconDrawOffset = new Vector2(78f, -124f); - HandleInteractionWithButton(baseDrawPosition + destroyerIconDrawOffset, Draedon.ExoMech.Destroyer); - HandleInteractionWithButton(baseDrawPosition + primeIconDrawOffset, Draedon.ExoMech.Prime); - HandleInteractionWithButton(baseDrawPosition + twinsIconDrawOffset, Draedon.ExoMech.Twins); + HandleInteractionWithButton(baseDrawPosition + destroyerIconDrawOffset, ExoMech.Destroyer); + HandleInteractionWithButton(baseDrawPosition + primeIconDrawOffset, ExoMech.Prime); + HandleInteractionWithButton(baseDrawPosition + twinsIconDrawOffset, ExoMech.Twins); } - public static bool HandleInteractionWithButton(Vector2 drawPosition, Draedon.ExoMech exoMech) + public static bool HandleInteractionWithButton(Vector2 drawPosition, ExoMech exoMech) { float iconScale; string description; @@ -44,18 +44,18 @@ namespace CalamityMod.UI switch (exoMech) { - case Draedon.ExoMech.Destroyer: + case ExoMech.Destroyer: iconScale = DestroyerIconScale; iconMechTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/HeadIcon_THanos"); description = "Thanatos, a serpentine terror with impervious armor and innumerable laser turrets."; break; - case Draedon.ExoMech.Prime: + case ExoMech.Prime: iconScale = PrimeIconScale; iconMechTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/HeadIcon_Ares"); description = "Ares, a heavyweight, diabolical monstrosity with four Exo superweapons."; break; default: - case Draedon.ExoMech.Twins: + case ExoMech.Twins: iconScale = TwinsIconScale; iconMechTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/HeadIcon_ArtemisApollo"); description = "Artemis and Apollo, a pair of extremely agile destroyers with pulse cannons."; @@ -63,7 +63,7 @@ namespace CalamityMod.UI } // Check for mouse collision/clicks. - Rectangle clickArea = Utils.CenteredRectangle(drawPosition, iconMechTexture.Size() * iconScale); + Rectangle clickArea = Utils.CenteredRectangle(drawPosition, iconMechTexture.Size() * iconScale * 0.9f); // Check if the mouse is hovering over the contact button area. bool hoveringOverIcon = MouseScreenArea.Intersects(clickArea); @@ -99,14 +99,14 @@ namespace CalamityMod.UI // And update to reflect the new scale. switch (exoMech) { - case Draedon.ExoMech.Destroyer: + case ExoMech.Destroyer: DestroyerIconScale = iconScale; break; - case Draedon.ExoMech.Prime: + case ExoMech.Prime: PrimeIconScale = iconScale; break; default: - case Draedon.ExoMech.Twins: + case ExoMech.Twins: TwinsIconScale = iconScale; break; } diff --git a/World/CalamityWorld.cs b/World/CalamityWorld.cs index 49252e0ef3..3ee1d71aa5 100644 --- a/World/CalamityWorld.cs +++ b/World/CalamityWorld.cs @@ -164,7 +164,7 @@ namespace CalamityMod.World // Draedon Summoning stuff. public static int DraedonSummonCountdown = 0; - public static Draedon.ExoMech DraedonMechToSummon; + public static ExoMech DraedonMechToSummon; public static Vector2 DraedonSummonPosition = Vector2.Zero; public static bool AbleToSummonDraedon { @@ -1012,7 +1012,7 @@ namespace CalamityMod.World Reforges = reader.ReadInt32(); MoneyStolenByBandit = reader.ReadInt32(); DraedonSummonCountdown = reader.ReadInt32(); - DraedonMechToSummon = (Draedon.ExoMech)reader.ReadInt32(); + DraedonMechToSummon = (ExoMech)reader.ReadInt32(); DraedonSummonPosition = reader.ReadVector2(); } #endregion diff --git a/World/WorldUpdateMiscEffects.cs b/World/WorldUpdateMiscEffects.cs index 0cd51ebf93..e20d4186d8 100644 --- a/World/WorldUpdateMiscEffects.cs +++ b/World/WorldUpdateMiscEffects.cs @@ -39,9 +39,9 @@ namespace CalamityMod.World public static void PerformWorldUpdates() { // Reset the exo mech to summon if Draedon is absent. - if (Main.netMode != NetmodeID.MultiplayerClient && DraedonMechToSummon != Draedon.ExoMech.None && CalamityGlobalNPC.draedon == -1) + if (Main.netMode != NetmodeID.MultiplayerClient && DraedonMechToSummon != ExoMech.None && CalamityGlobalNPC.draedon == -1) { - DraedonMechToSummon = Draedon.ExoMech.None; + DraedonMechToSummon = ExoMech.None; CalamityNetcode.SyncWorld(); } From cbcb852d6e874a8b795b98279c0cfe0f9b6a1210 Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 16 Sep 2021 19:59:41 -0500 Subject: [PATCH 55/86] Comment typo fix --- World/CalamityWorld.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/World/CalamityWorld.cs b/World/CalamityWorld.cs index 3ee1d71aa5..862d2bdf8b 100644 --- a/World/CalamityWorld.cs +++ b/World/CalamityWorld.cs @@ -1053,7 +1053,7 @@ namespace CalamityMod.World roxShrinePlaced = false; // This will only be applied at world-gen time to new worlds. - // Only worlds will never receive this marker naturally. + // Old worlds will never receive this marker naturally. IsWorldAfterDraedonUpdate = true; } #endregion From 41e8f7c53be463c5a815610ad0e0bd92f767b71c Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 16 Sep 2021 20:03:31 -0500 Subject: [PATCH 56/86] Green Seeking Mechanism is actually green now --- Items/LabFinders/GreenSeekingMechanism.png | Bin 433 -> 302 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/Items/LabFinders/GreenSeekingMechanism.png b/Items/LabFinders/GreenSeekingMechanism.png index 0b1ff1cb190e4ff52a0f77d5f4125bb0f252ca7a..1f1377a9b99933e4f1f2e0f9597880f30c2c75a7 100644 GIT binary patch delta 257 zcmdnUypCytBnLAC1H-&2d;UyRRH#=B@Ck99`dQmfMaA3IJ=4o|#*_&_>D=`6OQ(-a zNQwCGAP?j&dagSiNO6}0`33)n0|qaD#!oW0LnEH- wb9Jk$b+5|Ftc>|3wEWcHUEfkahVHay{P9bOx4@`S7U&iRPgg&ebxsLQ0BG4~CIA2c delta 389 zcmV;00eb$f0GTmWofDY=reWgVuI^x3Nl5`r!@#|J55V-6T|2-&qnnRdU_Qz8as>-qy>%Zj_PAr+@bpb24MMV;7SGXBjfq}u}BN#xBGZ-M`6BrnLK7xT$T9A^& j>>9XKAsW!hM+^)A{kVt&g~*pK00000NkvXXu0mjf0lupb From dd80b38d2d9c447ebe924493f492ac03078a6f53 Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 16 Sep 2021 20:36:02 -0500 Subject: [PATCH 57/86] Glitch -> TeleportDisplacement --- Effects/CalamityShaders.cs | 7 ++++--- ...litchShader.fx => TeleportDisplacementShader.fx} | 0 ...tchShader.xnb => TeleportDisplacementShader.xnb} | Bin NPCs/ExoMechs/Draedon.cs | 10 +++++----- 4 files changed, 9 insertions(+), 8 deletions(-) rename Effects/{GlitchShader.fx => TeleportDisplacementShader.fx} (100%) rename Effects/{GlitchShader.xnb => TeleportDisplacementShader.xnb} (100%) diff --git a/Effects/CalamityShaders.cs b/Effects/CalamityShaders.cs index fb6b046ca2..2c1fd861e0 100644 --- a/Effects/CalamityShaders.cs +++ b/Effects/CalamityShaders.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Effects public static Effect LightShader; public static Effect SCalMouseShader; public static Effect TentacleShader; - public static Effect GlitchShader; + public static Effect TeleportDisplacementShader; public static Effect LightDistortionShader; public static Effect PhaseslayerRipShader; public static Effect FadedUVMapStreakShader; @@ -27,10 +27,11 @@ namespace CalamityMod.Effects { if (Main.dedServ) return; + AstralFogShader = CalamityMod.Instance.GetEffect("Effects/CustomShader"); LightShader = CalamityMod.Instance.GetEffect("Effects/LightBurstShader"); TentacleShader = CalamityMod.Instance.GetEffect("Effects/TentacleShader"); - GlitchShader = CalamityMod.Instance.GetEffect("Effects/GlitchShader"); + TeleportDisplacementShader = CalamityMod.Instance.GetEffect("Effects/TeleportDisplacementShader"); SCalMouseShader = CalamityMod.Instance.GetEffect("Effects/SCalMouseShader"); LightDistortionShader = CalamityMod.Instance.GetEffect("Effects/DistortionShader"); PhaseslayerRipShader = CalamityMod.Instance.GetEffect("Effects/PhaseslayerRipShader"); @@ -49,7 +50,7 @@ namespace CalamityMod.Effects GameShaders.Misc["CalamityMod:FireMouse"] = new MiscShaderData(new Ref(SCalMouseShader), "DyePass"); GameShaders.Misc["CalamityMod:SubsumingTentacle"] = new MiscShaderData(new Ref(TentacleShader), "BurstPass"); - GameShaders.Misc["CalamityMod:Glitch"] = new MiscShaderData(new Ref(GlitchShader), "GlitchPass"); + GameShaders.Misc["CalamityMod:TeleportDisplacement"] = new MiscShaderData(new Ref(TeleportDisplacementShader), "GlitchPass"); GameShaders.Misc["CalamityMod:LightDistortion"] = new MiscShaderData(new Ref(LightDistortionShader), "DistortionPass"); GameShaders.Misc["CalamityMod:PhaseslayerRipEffect"] = new MiscShaderData(new Ref(PhaseslayerRipShader), "TrailPass"); GameShaders.Misc["CalamityMod:TrailStreak"] = new MiscShaderData(new Ref(FadedUVMapStreakShader), "TrailPass"); diff --git a/Effects/GlitchShader.fx b/Effects/TeleportDisplacementShader.fx similarity index 100% rename from Effects/GlitchShader.fx rename to Effects/TeleportDisplacementShader.fx diff --git a/Effects/GlitchShader.xnb b/Effects/TeleportDisplacementShader.xnb similarity index 100% rename from Effects/GlitchShader.xnb rename to Effects/TeleportDisplacementShader.xnb diff --git a/NPCs/ExoMechs/Draedon.cs b/NPCs/ExoMechs/Draedon.cs index c44df34746..4dae958568 100644 --- a/NPCs/ExoMechs/Draedon.cs +++ b/NPCs/ExoMechs/Draedon.cs @@ -284,11 +284,11 @@ namespace CalamityMod.NPCs.ExoMechs Vector2 origin = npc.frame.Size() * 0.5f; Color color = npc.GetAlpha(drawColor); SpriteEffects direction = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - GameShaders.Misc["CalamityMod:Glitch"].UseOpacity(MathHelper.Clamp(1f - TalkTimer / TeleportFadeinTime, 0f, 1f) * 0.38f); - GameShaders.Misc["CalamityMod:Glitch"].UseSecondaryColor(color); - GameShaders.Misc["CalamityMod:Glitch"].UseSaturation(color.A / 255f); - GameShaders.Misc["CalamityMod:Glitch"].Shader.Parameters["frameCount"].SetValue(new Vector2(2f, Main.npcFrameCount[npc.type])); - GameShaders.Misc["CalamityMod:Glitch"].Apply(); + GameShaders.Misc["CalamityMod:TeleportDisplacement"].UseOpacity(MathHelper.Clamp(1f - TalkTimer / TeleportFadeinTime, 0f, 1f) * 0.38f); + GameShaders.Misc["CalamityMod:TeleportDisplacement"].UseSecondaryColor(color); + GameShaders.Misc["CalamityMod:TeleportDisplacement"].UseSaturation(color.A / 255f); + GameShaders.Misc["CalamityMod:TeleportDisplacement"].Shader.Parameters["frameCount"].SetValue(new Vector2(2f, Main.npcFrameCount[npc.type])); + GameShaders.Misc["CalamityMod:TeleportDisplacement"].Apply(); spriteBatch.Draw(texture, drawPosition, npc.frame, Color.White * npc.Opacity, npc.rotation, origin, npc.scale, direction, 0f); From 6842541e855d5ecedf2b43ae9029467d7377abdd Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Thu, 16 Sep 2021 22:35:08 -0400 Subject: [PATCH 58/86] spiced up cooling cell recipe --- Items/DraedonMisc/AuricQuantumCoolingCell.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Items/DraedonMisc/AuricQuantumCoolingCell.cs b/Items/DraedonMisc/AuricQuantumCoolingCell.cs index 7e8a57c0bf..f8b7905310 100644 --- a/Items/DraedonMisc/AuricQuantumCoolingCell.cs +++ b/Items/DraedonMisc/AuricQuantumCoolingCell.cs @@ -73,8 +73,11 @@ namespace CalamityMod.Items.DraedonMisc { // Old worlds can craft the cell immediately for the sake of being able to easily fight Draedon in endgame worlds. ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 5, true); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddTile(ModContent.TileType()); + recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.AddIngredient(ItemID.Wire, 40); + recipe.AddIngredient(ModContent.ItemType(), 80); + recipe.AddIngredient(ModContent.ItemType(), 12); + recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); } From 5762de480f953e9f76329f7c34a68346aa9b8097 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Thu, 16 Sep 2021 22:35:25 -0400 Subject: [PATCH 59/86] spiced up decryption computer recipe --- Items/DraedonMisc/DecryptionComputer.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Items/DraedonMisc/DecryptionComputer.cs b/Items/DraedonMisc/DecryptionComputer.cs index f440354862..0787f02636 100644 --- a/Items/DraedonMisc/DecryptionComputer.cs +++ b/Items/DraedonMisc/DecryptionComputer.cs @@ -60,7 +60,9 @@ namespace CalamityMod.Items.DraedonMisc ArsenalTierGatedRecipe recipe = new ArsenalTierGatedRecipe(mod, 1); recipe.AddIngredient(ModContent.ItemType(), 18); recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddIngredient(ItemID.Glass, 5); + recipe.AddIngredient(ItemID.Wire, 300); // Anything prior to Tier 2 (Post-Mechs) is fair game. + recipe.AddRecipeGroup("AnyCopperBar", 10); + recipe.AddIngredient(ItemID.Glass, 15); recipe.AddTile(TileID.Anvils); recipe.SetResult(this, 1); recipe.AddRecipe(); From 78d2fc43eeaca389ca1964f265ee51c8f2493a4a Mon Sep 17 00:00:00 2001 From: Cameron Ewell Date: Thu, 16 Sep 2021 22:35:39 -0400 Subject: [PATCH 60/86] Improve planetoid schematic Codebreaker tooltip --- Items/DraedonMisc/EncryptedSchematicPlanetoid.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/DraedonMisc/EncryptedSchematicPlanetoid.cs b/Items/DraedonMisc/EncryptedSchematicPlanetoid.cs index 27bf6b08f6..17f131482d 100644 --- a/Items/DraedonMisc/EncryptedSchematicPlanetoid.cs +++ b/Items/DraedonMisc/EncryptedSchematicPlanetoid.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.DraedonMisc public override void SetStaticDefaults() { DisplayName.SetDefault("Encrypted Schematic"); - Tooltip.SetDefault("Requires a Codebreaker with a computer to decrypt"); + Tooltip.SetDefault("Requires a Codebreaker with a basic decryption computer to decrypt"); } public override void SetDefaults() From 0aad2db31419c262ba6759fc7646d078badcc041 Mon Sep 17 00:00:00 2001 From: Cameron Ewell Date: Thu, 16 Sep 2021 22:35:59 -0400 Subject: [PATCH 61/86] Improve SS schematic unlock tooltip --- Items/DraedonMisc/EncryptedSchematicSunkenSea.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Items/DraedonMisc/EncryptedSchematicSunkenSea.cs b/Items/DraedonMisc/EncryptedSchematicSunkenSea.cs index 67e2381062..f5e161e900 100644 --- a/Items/DraedonMisc/EncryptedSchematicSunkenSea.cs +++ b/Items/DraedonMisc/EncryptedSchematicSunkenSea.cs @@ -11,9 +11,9 @@ namespace CalamityMod.Items.DraedonMisc public override void SetStaticDefaults() { DisplayName.SetDefault("Schematic"); - Tooltip.SetDefault("You can barely make out its text. It states:\n" + - "Something idk\n" + - "Having this item in your inventory permanently unlocks special equipment"); + Tooltip.SetDefault("You can barely make out its text...\n" + + "Finely detailed diagrams of numerous devices and weaponry dance across the holographic screen\n" + + "Picking up this item or holding it in your inventory permanently unlocks new recipes"); } public override void SetDefaults() From f5a03494460eb17ad73e4297f2a4b86e68d8075e Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 16 Sep 2021 22:23:18 -0500 Subject: [PATCH 62/86] Draedon death stuff + gores --- Gores/Draedon/Chair1.png | Bin 0 -> 293 bytes Gores/Draedon/Chair2.png | Bin 0 -> 388 bytes Gores/Draedon/Chair3.png | Bin 0 -> 457 bytes Gores/Draedon/Chair4.png | Bin 0 -> 441 bytes Gores/Draedon/Draedon1.png | Bin 0 -> 306 bytes Gores/Draedon/Draedon2.png | Bin 0 -> 416 bytes Gores/Draedon/Draedon3.png | Bin 0 -> 357 bytes Gores/Draedon/Draedon4.png | Bin 0 -> 541 bytes NPCs/CalamityGlobalNPC.cs | 2 + NPCs/ExoMechs/Draedon.cs | 209 +++++++++++++++++++++++------- NPCs/ExoMechs/Draedon.png | Bin 13830 -> 44837 bytes NPCs/ExoMechs/DraedonGlowmask.png | Bin 0 -> 13221 bytes UI/BossHealthBarManager.cs | 2 +- 13 files changed, 164 insertions(+), 49 deletions(-) create mode 100644 Gores/Draedon/Chair1.png create mode 100644 Gores/Draedon/Chair2.png create mode 100644 Gores/Draedon/Chair3.png create mode 100644 Gores/Draedon/Chair4.png create mode 100644 Gores/Draedon/Draedon1.png create mode 100644 Gores/Draedon/Draedon2.png create mode 100644 Gores/Draedon/Draedon3.png create mode 100644 Gores/Draedon/Draedon4.png create mode 100644 NPCs/ExoMechs/DraedonGlowmask.png diff --git a/Gores/Draedon/Chair1.png b/Gores/Draedon/Chair1.png new file mode 100644 index 0000000000000000000000000000000000000000..e514084ae26910170327d2634f3e20f8b4839efe GIT binary patch literal 293 zcmeAS@N?(olHy`uVBq!ia0vp^Qb4T2!3-o9Jh`O^q!^2X+?^QKos)S9iw5|FxB_W81;voKJYx&{;`XVQdc{DI^Ov<211a{BAiv=MV89^d&Flsg z;wRVbBHm#|D^5cNS$zMDc`dsE0{nY>IOuKQYPD0f)=b0Ku_TC8XXjH8}wc+%Q;BBnI bS8uWQRB~(931qDSx`@Hk)z4*}Q$iB}ayMwE literal 0 HcmV?d00001 diff --git a/Gores/Draedon/Chair2.png b/Gores/Draedon/Chair2.png new file mode 100644 index 0000000000000000000000000000000000000000..99377710bca445be65fd329f926657c0df388a9f GIT binary patch literal 388 zcmeAS@N?(olHy`uVBq!ia0vp^T0ktv!3-pGztvmNn{1`bpw1tToq&ufK1QSU9J%gmU_j;7WM&==^Y&%K|Gw@?yAK#-G{ObW-VDK zr=SQ_w&QM&G?3yi3Gxg6j{+F3+?lZuD8*Ue5n0T@z;^(I8MCf+asma9db&7((%@j}1k7 zz9MdcE|a?dWGQLRoEoIPT5>1HtK5}FModdIOp-IwrrdYV>?!8bg=d#Wzp$Pz?Tbbqn literal 0 HcmV?d00001 diff --git a/Gores/Draedon/Chair3.png b/Gores/Draedon/Chair3.png new file mode 100644 index 0000000000000000000000000000000000000000..3d1a32e2bc441741316309916a34170e92bcd1e8 GIT binary patch literal 457 zcmeAS@N?(olHy`uVBq!ia0vp^CP1vi!3-p2m9zDM6k~CayA#8@b22Z19F}xPUq=Rp zjs4tz5?O(KtpJ}8S0Eh_nOB9~m&X9=LM?D8pIc5m^jWZ~%lEv#xb=0v*8T>EamT;k|asL7`>^ z9v4TiR;B;{cb`pL=(W{0;oic&wEJhIRg1ey1fB`cc%R<@J`yvw`%I7)}S@2|FT>z1TA_PW2F20VcV7K zeO|GLdd}vkh%jrkf2jMdt8l}s_M&F)?G-mXI-EEapGy?7K3Z{Sq6I^Y*{RxaDCaPg(ckMlykZ*I#j3_HYK-on2%>`$$Zs@(-yj{Vbp(^QYS-TK15 i`BLQNlk#dyqV7isxoBFP{#*qNE(T9mKbLh*2~7Z(gtMIh literal 0 HcmV?d00001 diff --git a/Gores/Draedon/Chair4.png b/Gores/Draedon/Chair4.png new file mode 100644 index 0000000000000000000000000000000000000000..767c9e1f02786b4bc6afb6a01f581095dedd20bb GIT binary patch literal 441 zcmeAS@N?(olHy`uVBq!ia0vp^W{QnfocJhsen_7#RVT z9gOF&08)Gslu#Q1G9pi(`m~_tq(=g_;!v zScDY<1ONXo-+cJZDd%Fwx6VsuWM*@(+_Ub+{{{@a08fUL>wYkBngY$%EJlyX7 zxb3^+$9d}y=5>nuNL_aNp|X$3<;XHC_JbnQ`{J8VC~~-OmEvDC?U+f!Mz5J0e74Mx zxUAqi`I-2JsgjqMWzG}S_wK29yoC+(wBo?8k%m!~PMcwXgZywSFKxk-mj+a$f*`}Nn{URjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCil21AIbUfwYCKT~<_#nvg(4b@8Ig=wuJ8C9@|2#e>s5<^w6tk|4j}|4_gX z>|Y@S5-jkDEM{QfI}E~%$MaXD00p}}T^vI!{O3+M$j7Y6!5SFw^S{1c@b$Off;^rl z@HodYeB|a__ue;jTUl+smeAMzDNEijEb`pARqjHOmZMf^wYl`cIo9(&7Ol)W$d%!6 zc+N}_MWL6HQhZuJwOHb^u%TY zDV~xbzu^A}z#w%0+&Q2)XMsm#F#`kNArNL1)$nQn3cmGpaSXBWUppz9@2~<7i{XSx z2mZc~)<3Nss%^RAv+x_9sH8`y*wT&NEt*Fw!rusqc%<+;$IjoHw#v4Jd*UW|g#4P_<>}RVs#4F_b&6o_6qmloA=fO{>r7-@DKc@2(*p*L znCah@0+MQ!zB*`4o>Te5tg!irLmlfj1vPD+?u&X4RUdCi^l_X2BXh%1y{oRF40_*# z7HrXV>lFOFJeN77NbazS*9C^_9m#up7&e^z>Yur^-b!C`u5BmtPWc4?sP>CDCsy5< uEBi9~#=IlinMV`cf8C#X?eq+ZB|-OOwA6Hee$4=dDubu1pUXO@geCwzS)nxm literal 0 HcmV?d00001 diff --git a/Gores/Draedon/Draedon3.png b/Gores/Draedon/Draedon3.png new file mode 100644 index 0000000000000000000000000000000000000000..ca30e2e8b9fe0b1e8094ec1c0bf38a83e3fd5f54 GIT binary patch literal 357 zcmeAS@N?(olHy`uVBq!ia0vp^GC-`)!3-pi+eR$~QjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`6$5-iT;&uLflLcqJH6CYH6eklsF?N9jt$ktiz=g+%$^98n!o*?I*{Tn z3Gxg64+jih{*0f1!kh&jk;M!Qe1|}oQB=dL0Vuf5)5S5w!hi0igM2LtJg$M=SC#(% zKX_P_Lx<-=WnrV-C6Ut;)g(VyxV+kw#_#I%Vc{M|`%`)!Y@`o8ZWF!K(UDcL_*P}# z&y$VoW(lm)ofx*@x0&`0uJr=@)=6ZtztMfGm?F0L*_K1uEup&Yx>LR>=oZc>np4~I zSbD~#4{~N^)pDWo%Z|8zSp0^`diudi0ltU!PgVuZdi~0^&P{SVzofZzMD>R4hi}^z nMV|V&*TT&CTOo_l!6|jSLX{2c&aaLD`hdaH)z4*}Q$iB}M^T7z literal 0 HcmV?d00001 diff --git a/Gores/Draedon/Draedon4.png b/Gores/Draedon/Draedon4.png new file mode 100644 index 0000000000000000000000000000000000000000..7343b8d0ec77c8746911064e32c1f2c2a0243da1 GIT binary patch literal 541 zcmeAS@N?(olHy`uVBq!ia0vp^8bEBr!3-po(>X2yDaPU;cPEB*=VV?2IV|apzK#qG z8~eHcB(eheS^+*Gu0Yzt)-Kt@YEfmhnvg(4b#X^WM^;qK`e?@`vnTfS^vEeF>ZPUv zmF+Zm7XzgDN`m}?|04qi*8_J>0A)A}JR*yM3J!rVqo{^g1JD6Uo-U3d9^Ol*+@92| zAmHL?pwj*C|9idmwgq|HPAUFXXs+ELyJyE=mGCR4y4NgVc)llo+W8f{C3+&d-QWK& z7Q3)hVxx0J`1|CTX%e%mC$O?CmVACqDd5@J`qy?R-X4E(=P~1~u9}PY3#2^+B$$@& z&92yZMnTQ^&`PO`DU79DF3Jz(7w0$SuF)>}GOu^}(zMWw503NdzGoZOD@6rvh)QhK(q54u7gOJHRVzvH_$eue_noQM4OKHPNKWv~ zcbTvz-+?KUmdKI;Vst0DVv6?f?J) literal 0 HcmV?d00001 diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index e681fae2c4..44be8f7587 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -146,6 +146,7 @@ namespace CalamityMod.NPCs // Stuff used by the Boss Health UI public bool SplittingWorm = false; + public bool CanHaveBossHealthBar = false; // Timer for how long an NPC is immune to certain debuffs public const int slowingDebuffResistanceMin = 1800; @@ -749,6 +750,7 @@ namespace CalamityMod.NPCs // Reset the enraged state every frame. The expectation is that bosses will continuously set it back to true if necessary. CurrentlyEnraged = false; + CanHaveBossHealthBar = false; } #endregion diff --git a/NPCs/ExoMechs/Draedon.cs b/NPCs/ExoMechs/Draedon.cs index 4dae958568..c0aebc5cef 100644 --- a/NPCs/ExoMechs/Draedon.cs +++ b/NPCs/ExoMechs/Draedon.cs @@ -4,6 +4,7 @@ using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; +using System.IO; using Terraria; using Terraria.Graphics.Shaders; using Terraria.ID; @@ -16,22 +17,24 @@ namespace CalamityMod.NPCs.ExoMechs { public class Draedon : ModNPC { + public float DefeatTimer; + public bool ShouldStartStandingUp; public Vector2 HoverDestinationOffset - { + { get => new Vector2(npc.ai[1], npc.ai[2]); - set - { + set + { npc.ai[1] = value.X; npc.ai[2] = value.Y; - } - } + } + } public Player PlayerToFollow => Main.player[npc.target]; public ref float TalkTimer => ref npc.ai[0]; public ref float GeneralTimer => ref npc.ai[3]; public bool ExoMechIsPresent - { - get - { + { + get + { if (NPC.AnyNPCs(ModContent.NPCType())) return true; @@ -43,26 +46,27 @@ namespace CalamityMod.NPCs.ExoMechs return false; } - } + } public static readonly Color TextColor = new Color(155, 255, 255); public static readonly Color TextColorEdgy = new Color(213, 4, 11); public const int TeleportFadeinTime = 45; - public const int TalkDelay = 80; + public const int TalkDelay = 150; public const int DelayPerDialogLine = 130; public const int ExoMechChooseDelay = TalkDelay + DelayPerDialogLine * 4 + 10; public const int ExoMechShakeTime = 100; + public const int DelayBeforeDefeatStandup = 30; public override void SetStaticDefaults() { DisplayName.SetDefault("Draedon"); - Main.npcFrameCount[npc.type] = 12; + Main.npcFrameCount[npc.type] = 15; } public override void SetDefaults() { npc.damage = 0; npc.width = npc.height = 34; - npc.defense = 9999; - npc.lifeMax = 50; + npc.defense = 100; + npc.lifeMax = 16000; npc.noGravity = true; npc.noTileCollide = true; npc.dontTakeDamage = true; @@ -70,6 +74,18 @@ namespace CalamityMod.NPCs.ExoMechs npc.knockBackResist = 0f; } + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(DefeatTimer); + writer.Write(ShouldStartStandingUp); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + DefeatTimer = reader.ReadSingle(); + ShouldStartStandingUp = reader.ReadBoolean(); + } + public override void AI() { // Set the whoAmI variable. @@ -89,7 +105,7 @@ namespace CalamityMod.NPCs.ExoMechs // Fuck off if no living target exists. if (PlayerToFollow.dead || !PlayerToFollow.active) - { + { npc.life = 0; npc.checkDead(); npc.active = false; @@ -98,10 +114,15 @@ namespace CalamityMod.NPCs.ExoMechs } // Stay within the world. - npc.position.Y = MathHelper.Clamp(npc.position.Y, 150f, Main.maxTilesY * 16f - 150f); + npc.position.Y = MathHelper.Clamp(npc.position.Y, 150f, Main.maxTilesY * 16f - 150f); npc.Opacity = Utils.InverseLerp(0f, 8f, TalkTimer, true); npc.spriteDirection = (PlayerToFollow.Center.X < npc.Center.X).ToDirectionInt(); + + // Play the stand up animation after teleportation. + if (TalkTimer == TeleportFadeinTime + 5f) + ShouldStartStandingUp = true; + if (Main.netMode != NetmodeID.MultiplayerClient && TalkTimer == TalkDelay) { CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.DraedonIntroductionText1", TextColor); @@ -135,13 +156,13 @@ namespace CalamityMod.NPCs.ExoMechs // Wait for the player to select an exo mech. if (TalkTimer >= ExoMechChooseDelay && TalkTimer < ExoMechChooseDelay + 8f && CalamityWorld.DraedonMechToSummon == ExoMech.None) - { + { PlayerToFollow.Calamity().AbleToSelectExoMech = true; TalkTimer = ExoMechChooseDelay; - } + } // Fly around once the exo mechs have been spawned. - if (ExoMechIsPresent) + if (ExoMechIsPresent || DefeatTimer > 0f) { FlyAroundInGamerChair(); GeneralTimer++; @@ -163,22 +184,30 @@ namespace CalamityMod.NPCs.ExoMechs if (Main.netMode != NetmodeID.Server) { var sound = Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/FlareSound"), PlayerToFollow.Center); - sound.Volume = MathHelper.Clamp(sound.Volume * 1.55f, 0f, 1f); + + if (sound != null) + sound.Volume = MathHelper.Clamp(sound.Volume * 1.55f, 0f, 1f); } } + if (TalkTimer > ExoMechChooseDelay + 10f && !ExoMechIsPresent) + { + HandleDefeatStuff(); + DefeatTimer++; + } + TalkTimer++; } // TODO - Make this work in conjunction with exo mech transitions. This requires that the exo mech AIs be finished. public void FlyAroundInGamerChair() - { + { // Define a hover destination offset if one hasn't been decided yet. if (Main.netMode != NetmodeID.MultiplayerClient && HoverDestinationOffset == Vector2.Zero) - { + { HoverDestinationOffset = -Vector2.UnitY * 700f; npc.netUpdate = true; - } + } // Switch hover destinations from time to time. if (Main.netMode != NetmodeID.MultiplayerClient && GeneralTimer % 480f == 479f) @@ -197,6 +226,10 @@ namespace CalamityMod.NPCs.ExoMechs npc.netUpdate = true; } + // Always hover to the side of the target when defeated. + if (DefeatTimer > 5f) + HoverDestinationOffset = Vector2.UnitX * (PlayerToFollow.Center.X < npc.Center.X).ToDirectionInt() * 325f; + Vector2 hoverDestination = PlayerToFollow.Center + HoverDestinationOffset; // Decide sprite direction based on movement if not close enough to the desination. @@ -210,10 +243,12 @@ namespace CalamityMod.NPCs.ExoMechs } else { - npc.spriteDirection = (npc.velocity.X < 0f).ToDirectionInt(); + if (DefeatTimer < DelayBeforeDefeatStandup) + npc.spriteDirection = (npc.velocity.X < 0f).ToDirectionInt(); - Vector2 idealVelocity = npc.SafeDirectionTo(hoverDestination) * 32f; - npc.SimpleFlyMovement(idealVelocity, 0.8f); + float flySpeed = DefeatTimer > 5f ? 14f : 32f; + Vector2 idealVelocity = npc.SafeDirectionTo(hoverDestination) * flySpeed; + npc.SimpleFlyMovement(idealVelocity, flySpeed / 400f); npc.velocity = Vector2.Lerp(npc.velocity, idealVelocity, 0.045f); } } @@ -246,55 +281,133 @@ namespace CalamityMod.NPCs.ExoMechs } } + public void HandleDefeatStuff() + { + // Become vulnerable after being defeated after a certain point. + npc.dontTakeDamage = DefeatTimer < 250f; + npc.Calamity().CanHaveBossHealthBar = !npc.dontTakeDamage; + + // Stand up in awe after a small amount of time has passed. + if (DefeatTimer > DelayBeforeDefeatStandup) + ShouldStartStandingUp = true; + + // TODO - This needs to be changed. + if (DefeatTimer == DelayBeforeDefeatStandup + 10f) + Main.NewText("Wait, what? How?", TextColor); + + if (DefeatTimer == DelayBeforeDefeatStandup + 80f) + Main.NewText("No", TextColor); + } + // Draedon should not manually despawn. public override bool CheckActive() => false; - public override Color? GetAlpha(Color drawColor) - { + public override Color? GetAlpha(Color drawColor) + { float teleportFade = Utils.InverseLerp(0f, TeleportFadeinTime, TalkTimer, true); Color color = Color.Lerp(drawColor, Color.Cyan, 1f - (float)Math.Pow(teleportFade, 3D)); color.A = (byte)(int)(teleportFade * 255f); return color * npc.Opacity; - } + } - public override void FindFrame(int frameHeight) + public override void FindFrame(int frameHeight) { - npc.frame.Width = 106; + npc.frame.Width = 102; + int xFrame = npc.frame.X / npc.frame.Width; + int yFrame = npc.frame.Y / npc.frame.Height; + int frame = xFrame * Main.npcFrameCount[npc.type] + yFrame; + + // Prepare to stand up if called for and not already doing so. + if (ShouldStartStandingUp && frame < 23) + frame = 23; + + int frameChangeDelay = 7; + bool shouldNotSitDown = DefeatTimer > DelayBeforeDefeatStandup; npc.frameCounter++; - if (npc.frameCounter >= 6f) - { - npc.frame.Y = npc.frame.Y + frameHeight; - if (npc.frame.Y >= Main.npcFrameCount[npc.type] * frameHeight) - { - npc.frame.X = (npc.frame.X + 106) % 212; - npc.frame.Y = 0; - } - npc.frameCounter = 0; - } - } + if (npc.frameCounter >= frameChangeDelay) + { + frame++; - public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) - { + if (!ShouldStartStandingUp && frame >= 23) + frame = 0; + + // Do the sit animation infinitely if Draedon should not sit down again. + if (shouldNotSitDown && frame >= 47) + frame = 36; + + if (frame >= 59) + { + frame = 0; + ShouldStartStandingUp = false; + } + + npc.frameCounter = 0; + } + + npc.frame.X = frame / Main.npcFrameCount[npc.type] * npc.frame.Width; + npc.frame.Y = frame % Main.npcFrameCount[npc.type] * npc.frame.Height; + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = 16000; + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life > 0) + return; + + for (int i = 1; i <= 4; i++) + { + Vector2 goreSpawnOffset = Main.rand.NextVector2Circular(12f, 12f); + Vector2 draedonPieceVelocity = Main.rand.NextVector2CircularEdge(7f, 7f) - Vector2.UnitY * 8f; + Vector2 chairPieceVelocity = Vector2.UnitY.RotatedByRandom(0.13f) * Main.rand.NextFloat(4.45f, 5.4f); + Gore.NewGoreDirect(npc.Center + goreSpawnOffset, draedonPieceVelocity, mod.GetGoreSlot($"Gores/Draedon/Draedon{i}")); + + goreSpawnOffset = Main.rand.NextVector2Circular(18f, 18f); + Gore.NewGoreDirect(npc.Center + goreSpawnOffset, chairPieceVelocity, mod.GetGoreSlot($"Gores/Draedon/Chair{i}")); + } + } + + // Always instantly kill Draedon when he's vulnerable + public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) + { + damage *= 56D; + if (damage < npc.lifeMax) + damage = npc.lifeMax + Main.rand.NextFloat(50f, 750f); + crit = true; + return true; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) + { spriteBatch.EnterShaderRegion(); Texture2D texture = Main.npcTexture[npc.type]; + Texture2D glowmask = Main.npcTexture[npc.type]; + Rectangle frame = npc.frame; + Vector2 drawPosition = npc.Center - Main.screenPosition - Vector2.UnitY * 38f; - Vector2 origin = npc.frame.Size() * 0.5f; + Vector2 origin = frame.Size() * 0.5f; Color color = npc.GetAlpha(drawColor); - SpriteEffects direction = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + SpriteEffects direction = npc.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; GameShaders.Misc["CalamityMod:TeleportDisplacement"].UseOpacity(MathHelper.Clamp(1f - TalkTimer / TeleportFadeinTime, 0f, 1f) * 0.38f); GameShaders.Misc["CalamityMod:TeleportDisplacement"].UseSecondaryColor(color); GameShaders.Misc["CalamityMod:TeleportDisplacement"].UseSaturation(color.A / 255f); GameShaders.Misc["CalamityMod:TeleportDisplacement"].Shader.Parameters["frameCount"].SetValue(new Vector2(2f, Main.npcFrameCount[npc.type])); GameShaders.Misc["CalamityMod:TeleportDisplacement"].Apply(); - spriteBatch.Draw(texture, drawPosition, npc.frame, Color.White * npc.Opacity, npc.rotation, origin, npc.scale, direction, 0f); + spriteBatch.Draw(texture, drawPosition, frame, drawColor * npc.Opacity, npc.rotation, origin, npc.scale, direction, 0f); spriteBatch.ExitShaderRegion(); + if (TalkTimer >= TeleportFadeinTime) + spriteBatch.Draw(glowmask, drawPosition, frame, Color.White * npc.Opacity, npc.rotation, origin, npc.scale, direction, 0f); + return false; - } - } + } + } } diff --git a/NPCs/ExoMechs/Draedon.png b/NPCs/ExoMechs/Draedon.png index 0db4c0553ce5461f721ace153c60d80658e206e9..c0ec806a42987a152fec93a8bc065d02ace13bc2 100644 GIT binary patch literal 44837 zcmeFZ2UL@5zP?SDs+1t1C`C$w5C|PadJQchfbL-p=gVbIzP|zBA`r<65i)1 zDd|<&X-Y}LZk&s-v1u|hGKFEWn5=I|o6~_|ahU~`CnsE85^tR}J>?ArfBW{$oSA{o z=2V=%h{e&P5i&AuXQZzmx7zeG-2UcgYZ7|H`G!QL5pW;+jMVgj3&|jJQ#5eYfA}9o z;ajG!z<~^Y1~!2d6bD=PKPVe-oLQ%!xbwzPN7EwIaXp*m;uLvYx8|xg6*&eoJl)`9 zujpHI@$BBWw-@VbU%3hACUOh5CiRCO<-IguqjLJ9J56`>=Z|PFRJY{g5)5RL$eoIh zVePb)sAL?#;^|c#9UPnz3*9iH>GYFC%2I=(&iQ86=_L|fTb9?FAMW6g>H``OBaaU(eGIYlxc}hZs_84F%(wOFvacQz zow)K(Z@07$Kh>&`@e|~{(?_hfpIZNL;zGu>s13s_9DTv1hdGFbZxi)>sJ z>-75dLk$h*&ds%Fp!)aRzsy6$8D5#RRu_3H3)LG`PM(WGE3Inp^t~&LpUWH_)%Wyy zk%~7QCGJ%+)~eKT(F4nI(nOh*!Ko+c_UKx)y(c~jg{MxHjLl~Z9)bf9KSZ~ zuC8whB^|__u|O*pZuwPt8z+;kt&?`;?ui$7zFgMg3?NY5oqaYN<)Cnpks;ZBcCQ9h zfzmn7zBtcrvntU(>#G>G!uIs7zl9uqy^>o~0(D50&Oue{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8Di{XjEuJ7Id#9*-@dHEKFxnv_o^MLNLxRb!=H6+W~Pk zOfZNPfDy(nC?L7Hq9MkmQm@(*CFt-B1uDNm;9AKBQ>O#a;B4QzLdd1dW7JFhxmP6z zJQ=Ou_BERdDow${f&&Zz!k=(*l0dFFO4!u38wx$WUoeH%>N26%?yb4HwZ<%^2y%y7 zLB68CHFj2b_rjP!j33u|4L=mfAq~XazXU60nkchCQY>m5eoH46RE7NIL_Q+L#Lu|^ z(a787n_B1IE%)ph0+&3Q3iX#y<4Ss^z*SjCd5!=xWD-`uN>s(+AIbU|{!OFmt4CS` z=S+A<^6@V`r^=lxXZfk{8lN&DQZDQ-t7xUO_j$(FW_QPv)HSFSBXtd+EanaLqr%^( z7>Irm!T%}IKMmcyr!i=~1PHwzI8Ys=7`hYE$w?2nb^&;0-qgVRQpVlGa1GwTlG@DS zC)p9CobdQ1R15vsA2DGloOhyKju{i>Wy0R=<65Udj*p%jgcRY04Wb@jUaxJoT@HQ{ zI`7I+2?HbygBI3GqS0C$xOLNy2mmGP+fn(ZP2jJ$;saps2zOa0#U3$D|Gy#J!)CuC+<-k-{EBaHJc;;aPtp}K_`d8QAbKyLo1UJeUsw2bcfB;aHPDyl z?}|f}cXmEL$oxAG4~(;C{C{Ac#dDBCrgpGM7Ftl^{XW@2{u?XvmtT>JM1@gZKkaSK z*nR5ixGyK1$$reYiX~|~TT9y-g#M#SmYqa>ks{wFCVSRmRk3uw#J%>rlD+v6~6B!z5q*I|~7y3T{toTkS diff --git a/NPCs/ExoMechs/DraedonGlowmask.png b/NPCs/ExoMechs/DraedonGlowmask.png new file mode 100644 index 0000000000000000000000000000000000000000..ea7762e563211a512a4ad0953944239a35d80f1c GIT binary patch literal 13221 zcmeHO2{@E{-+rXXPGpIQvNqYbNEDJiOPH*Ku?r0F3U4x=9%Vq|L*&D|L(%hX{k_=A0USyh)VUW zk}mk(20_F(_L6{~W@?8nf^S49U6s>NUI*JG1Ra7@l}_njNtzj~b!3Cz=bdxObw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j?NqZE*#@lahF`@F< z!<4jdqC)t&5LBZGL)wrAZeEaQ^U53(x`$J}G3J)PUs5~_F7v1j%yD6hA^Dp;Gn}-O zHQ$qjbc-S&bwug_vaZW4zstH>t>bYHuCzCkldaY_QWUo&=mzp0@rV)cc!b9qAOed8U+ zhLnikg)t6!O*g9kNX0G;Kd!=BBSmT+eI?#2S)qiE5_7#N(tfftAYRN zuujmVHPhLF;9i~0;!(Q`$gJc~SnE@S)CH9x3$o6HyH(&fk-E&9C(O$?Dtt2p8J-1; z97nOHRuERlF$*tmX+4q)=(I?EI!6d9JutUF8RAxhf_`i9z%$XH#UESvHCx{7v%YxT zWM%M6A;A6E%Hp*@F(aMr0J5ub9yEBb8_3m-;rsQ~_=$^iRlnx{)K5I>^t+l~-6^P! z{^?ZO@ngP?&zNss>ZvZ${0E|T<3CqNjTx!{ zzvoA~R=pHsPQ~8;WvU(l?_p@5(ajH*KVnR8L$;hKL{hM^G-HduZw8#rQQG&v4?!t? z#_?<(`Dt&mqHn>mRFsiyn~IHmpkcVf1Wn7_R%qx{7kcA{)4$@^7hU`lTkt|U<|Fe5 zl0%0n{nqC_E>hZ7A83d(ry6Um9o~aqA04e^P+>AZhyEqAn`yFT0Ga!VMB*WY@l)$@rg{C||?U7~V% ztH~HEwjHN3HQnSCYk$2`n$EXz@=u#bZI$wAS%L=yQuBOw}jr@C5`&&d0z?ZGk@Vhl=~fGLiFNHXgd&Ogso{n=R7*jw=bZXi`f-gO%7g literal 0 HcmV?d00001 diff --git a/UI/BossHealthBarManager.cs b/UI/BossHealthBarManager.cs index 565eabcaaf..516551a6cd 100644 --- a/UI/BossHealthBarManager.cs +++ b/UI/BossHealthBarManager.cs @@ -348,7 +348,7 @@ namespace CalamityMod.UI continue; bool isEoWSegment = Main.npc[i].type == NPCID.EaterofWorldsBody || Main.npc[i].type == NPCID.EaterofWorldsTail; - if ((Main.npc[i].IsABoss() && !isEoWSegment) || MinibossHPBarList.Contains(Main.npc[i].type)) + if ((Main.npc[i].IsABoss() && !isEoWSegment) || MinibossHPBarList.Contains(Main.npc[i].type) || Main.npc[i].Calamity().CanHaveBossHealthBar) AttemptToAddBar(i); } From 2268911c2857921cd27659c812db057af1d24700 Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 16 Sep 2021 22:38:38 -0500 Subject: [PATCH 63/86] Removal of unnecessary icon sprites --- ...ng => EncryptedSchematicSlotBackground.png} | Bin .../UI/EncryptedSchematicSlotFullHell.png | Bin 709 -> 0 bytes .../UI/EncryptedSchematicSlotFullIce.png | Bin 701 -> 0 bytes .../UI/EncryptedSchematicSlotFullJungle.png | Bin 699 -> 0 bytes .../UI/EncryptedSchematicSlotFullPlanetoid.png | Bin 684 -> 0 bytes UI/CodebreakerUI.cs | 17 +++++++++-------- 6 files changed, 9 insertions(+), 8 deletions(-) rename ExtraTextures/UI/{EncryptedSchematicSlotEmpty.png => EncryptedSchematicSlotBackground.png} (100%) delete mode 100644 ExtraTextures/UI/EncryptedSchematicSlotFullHell.png delete mode 100644 ExtraTextures/UI/EncryptedSchematicSlotFullIce.png delete mode 100644 ExtraTextures/UI/EncryptedSchematicSlotFullJungle.png delete mode 100644 ExtraTextures/UI/EncryptedSchematicSlotFullPlanetoid.png diff --git a/ExtraTextures/UI/EncryptedSchematicSlotEmpty.png b/ExtraTextures/UI/EncryptedSchematicSlotBackground.png similarity index 100% rename from ExtraTextures/UI/EncryptedSchematicSlotEmpty.png rename to ExtraTextures/UI/EncryptedSchematicSlotBackground.png diff --git a/ExtraTextures/UI/EncryptedSchematicSlotFullHell.png b/ExtraTextures/UI/EncryptedSchematicSlotFullHell.png deleted file mode 100644 index f22ba881559c5aaa1942cf5888e279e97e684558..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 709 zcmeAS@N?(olHy`uVBq!ia0vp^HXzKw3=&b&bO2I}#X;^)4C~IxyaaMs(j9#r85lP9 zbN@+X1@c1zd_r7-w2HE7Q+aV>c$oa}{|pDOdAYi=va*V*>X{mvh(+YPsHx4fx6d;% zVU{f6YP`?pwD4+L+OMJr=6C=8|Nr09)5F@aGdw&z$k{2>$)m^<|I**fDwYo5O_`8_sMxFM3>g`|lGG zKOdYZp5|4XyFf(QDP_+Z)3W%fTl=QEeu{~na@^hSNV~?7=Q~3eKeegXTN}vbx8}@T z+f6}*n>eiee}0*e#NzIF?bcVzpkuwag8bDd=DSCJ5}ELD$)wfRF^d;#tY8+Lqqp|Y zV~gljUC|CtiW(!Py`LocYO~zTlvOWNJNApcDy`jnZL9Td4e_IIw@oxVq?F>}!tzMP z`MC2Zy`ME^Y+Z&*$3jH=7F;X6+%aXT$AsHvy?3^GE#&Ilt;L->Cum8gg5$egySFS( zS>k(BLQR&9r};SJ;gmV2bGvU@?0l~-d2ogCvsWCQ(#(=p^5?Hja+=4+D;f^Q*_>)>zVX(#ZS48 z{JSlIGsHGWZjC;6gw5iM;p_)Nc5|kG{{8#uhu8Z(ZGPxPZtCfq+9+KXZl~_D@ynZu buKyUc-?c7vK9HgUjB*A~S3j3^P6c$oa}{|pDOdAYi=va*V*>X{mvxTvX#MdZ)3x4)W} zmS05ba4#v@ZLI|x4cO~q^&Sl!1N)-9W~Qnpg&wzx`7uHO`u_0z{1GA=(!Y^bq2-Ys(a^FCgOW10rNnFl|eh%mVMe9OhiSmx!tr?w<` z8hJ&W(wM9-EPT4{OuTbY*&-XB{-W!iQ@IzE$)1)lh?VQu*>i&>dx7#RDM^c+PaYed zdhPL+Mb5nP=?eRH`Hht+*^B?g8$9@XI$^ud|DwtNX7#jJ8%$2wcQu90t1s`6W=?l| z?AGXG$Ji>gXZjjUIZ|oy^8NJ3tN*A8e%PFH&StJw^M*GIYyEr*wckvf`ipgKPiL#8 TzibIGsu?_8{an^LB{Ts5C?P;r diff --git a/ExtraTextures/UI/EncryptedSchematicSlotFullJungle.png b/ExtraTextures/UI/EncryptedSchematicSlotFullJungle.png deleted file mode 100644 index e1c3851c0a2c286bfb0551c35f9de83eb89e1361..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 699 zcmeAS@N?(olHy`uVBq!ia0vp^HXzKw3=&b&bO2I}#X;^)4C~IxyaaMs(j9#r85lP9 zbN@+X1@c1zd_r7-w2HE7Q+aV>c$oa}{|pDOdAYi=va*V*>X{mvh(+WxOO|jo-e+@K z$l9@!`Q5+&|NpnY%nfpOD)O}H>FEg%51(gme>E-5MNKW#$s^Ci1ZbeQR>5^3B~udQ z7YtO73owXpdIVC(S>O>_%)r2R0E8K{u61$(9e%>o#WBRgd+&7q>Lvw&_VZg0o=}|~ zW&HQw{o?PB`3_IB_0D+znS7GQ`=G5eO-q$0z)x)P9 z6T5lKW+sQa{-?V5`z;yv!l};>S*D-b5g4FYZ@|86UEu;3StiMgPt#ian2dJ0PWvG8 zrD4WCi_}!54&TSMmlquSD48)U{q(GtJ>NYfF55=;WhxiGUtD9c;BQT&T-O9s{}#`H zf9-#cwkXbXn8dd7&bHJi+j@(32_{+F>1l7*^4_;ZS6aE`GpC29IG=KSJ};)+`H6;-XB36VxY9YzXPbN4Yz9Bt-&l*@FI z_4Jh8dQ;mUE=g!=v^4gX2ENBM(Z0 z!}h(H^h!wfQh1K!&7B(mMRhFdC3B|zR5yR!f3jjHyRr8)ci;03B_*Prhqif?T}_je zmVU7K*qWxLCNa}4e=D<`_G`Y&!TXa`PrrzfY&k9W>h}?il~Z+%F7gMf)|I+(Eh_*< OG=rzBpUXO@geCx+TrrOT diff --git a/ExtraTextures/UI/EncryptedSchematicSlotFullPlanetoid.png b/ExtraTextures/UI/EncryptedSchematicSlotFullPlanetoid.png deleted file mode 100644 index 2630435014e1180b2cd9b058947fcc639ec11d59..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 684 zcmeAS@N?(olHy`uVBq!ia0vp^HXzKw3=&b&bO2I}#X;^)4C~IxyaaMs(j9#r85lP9 zbN@+X1@c1zd_r7-w2HE7Q+aV>c$oa}{|pDOdAYi=va*V*>X{mvh(+WxNR%-&K4frO z?5eIl-@)Npdiwthx(uDW7~cQSH#PnL|9_CPQ$$2WZ*Omrr%jl%C(yvS!q7Y*B~udQ z7YtN@3owXpdUPGAj>?wFYU7U=Muo-U3d9^PB0HWLPL;&J`ZAYeIl z?UdboMkPFx8;%PsdpzT`>UqV-Erv@b?PfR~ob;H%>c9e4zdL)I_q;3JynfF!(cS%T z=A2mHB+SR(e75MvN!c%@Mse>hhMcsy8pN-$Rqv4I9kIo`vo`lgOFzgyrPCC=)MCC~ zZvOPA#(&j4ALO5$k{PAlTygX9FUv`fN|U;MzOZjPUstQ3%ij!)Sq4v6KbLh*2~7a0 CvNquW diff --git a/UI/CodebreakerUI.cs b/UI/CodebreakerUI.cs index 700caa2e2b..c8ae97f840 100644 --- a/UI/CodebreakerUI.cs +++ b/UI/CodebreakerUI.cs @@ -96,24 +96,25 @@ namespace CalamityMod.UI DrawDecryptCancelConfirmationText(textPanelCenter); // Draw the schematic icon. - Texture2D emptySchematicIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/EncryptedSchematicSlotEmpty"); - Texture2D occupiedSchematicIconTexture = emptySchematicIconTexture; + Texture2D schematicIconBG = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/EncryptedSchematicSlotBackground"); + Texture2D schematicIconTexture = schematicIconBG; int schematicType = 0; if (codebreakerTileEntity.HeldSchematicID > 0) schematicType = CalamityLists.EncryptedSchematicIDRelationship[codebreakerTileEntity.HeldSchematicID]; if (schematicType == ModContent.ItemType()) - occupiedSchematicIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/EncryptedSchematicSlotFullPlanetoid"); + schematicIconTexture = ModContent.GetTexture("CalamityMod/Items/DraedonMisc/EncryptedSchematicPlanetoid"); if (schematicType == ModContent.ItemType()) - occupiedSchematicIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/EncryptedSchematicSlotFullJungle"); + schematicIconTexture = ModContent.GetTexture("CalamityMod/Items/DraedonMisc/EncryptedSchematicJungle"); if (schematicType == ModContent.ItemType()) - occupiedSchematicIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/EncryptedSchematicSlotFullHell"); + schematicIconTexture = ModContent.GetTexture("CalamityMod/Items/DraedonMisc/EncryptedSchematicHell"); if (schematicType == ModContent.ItemType()) - occupiedSchematicIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/EncryptedSchematicSlotFullIce"); + schematicIconTexture = ModContent.GetTexture("CalamityMod/Items/DraedonMisc/EncryptedSchematicIce"); - Texture2D schematicTexture = codebreakerTileEntity.HeldSchematicID != 0 ? occupiedSchematicIconTexture : emptySchematicIconTexture; - spriteBatch.Draw(schematicTexture, schematicSlotDrawCenter, null, Color.White, 0f, schematicTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); + spriteBatch.Draw(schematicIconBG, schematicSlotDrawCenter, null, Color.White, 0f, schematicIconBG.Size() * 0.5f, 1f, SpriteEffects.None, 0f); + if (codebreakerTileEntity.HeldSchematicID != 0) + spriteBatch.Draw(schematicIconTexture, schematicSlotDrawCenter, null, Color.White, 0f, schematicIconTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); HandleSchematicSlotInteractions(codebreakerTileEntity, schematicSlotDrawCenter, cellTexture.Size()); // Create a temporary item for drawing purposes. From f1dc7f4635bc9212c568dddf5f280f222b58a5ca Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 16 Sep 2021 22:45:44 -0500 Subject: [PATCH 64/86] Codebreaker textures are cached --- Tiles/DraedonSummoner/CodebreakerTile.cs | 44 +++++++++++++++--------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/Tiles/DraedonSummoner/CodebreakerTile.cs b/Tiles/DraedonSummoner/CodebreakerTile.cs index c5a758c893..634b37946b 100644 --- a/Tiles/DraedonSummoner/CodebreakerTile.cs +++ b/Tiles/DraedonSummoner/CodebreakerTile.cs @@ -19,9 +19,27 @@ namespace CalamityMod.Tiles.DraedonSummoner public const int OriginOffsetX = 2; public const int OriginOffsetY = 7; public const int SheetSquare = 18; + public static Texture2D TileTexture; + public static Texture2D ComputerTexture; + public static Texture2D SensorTexture; + public static Texture2D DisplayTexture; + public static Texture2D VoltageRegulatorTexture; + public static Texture2D VoltageRegulatorTexture2; + public static Texture2D CoolingCellTexture; public override void SetDefaults() { + if (!Main.dedServ) + { + TileTexture = ModContent.GetTexture("CalamityMod/Tiles/DraedonSummoner/CodebreakerTile"); + ComputerTexture = ModContent.GetTexture("CalamityMod/Tiles/DraedonSummoner/CodebreakerDecryptionComputer"); + SensorTexture = ModContent.GetTexture("CalamityMod/Tiles/DraedonSummoner/CodebreakerLongRangedSensorArray"); + DisplayTexture = ModContent.GetTexture("CalamityMod/Tiles/DraedonSummoner/CodebreakerAdvancedDisplay"); + VoltageRegulatorTexture = ModContent.GetTexture("CalamityMod/Tiles/DraedonSummoner/CodebreakerVoltageRegulationSystem"); + VoltageRegulatorTexture2 = ModContent.GetTexture("CalamityMod/Tiles/DraedonSummoner/CodebreakerVoltageRegulationSystem2"); + CoolingCellTexture = ModContent.GetTexture("CalamityMod/Tiles/DraedonSummoner/CodebreakerAuricQuantumCoolingCell"); + } + Main.tileLighted[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileNoAttach[Type] = true; @@ -53,7 +71,7 @@ namespace CalamityMod.Tiles.DraedonSummoner // Prevent the tile from being destroyed while it's busy decrypting. // If it's destroyed the tile entity would be too and the resources used on decryption would be lost for nothing. - public override bool CanKillTile(int i, int j, ref bool blockDamaged) + public override bool CanKillTile(int i, int j, ref bool blockDamaged) { TECodebreaker codebreakerTileEntity = CalamityUtils.FindTileEntity(i, j, Width, Height, SheetSquare); if (codebreakerTileEntity is null) @@ -61,7 +79,7 @@ namespace CalamityMod.Tiles.DraedonSummoner if (codebreakerTileEntity.DecryptionCountdown > 0) return false; return true; - } + } public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { @@ -137,39 +155,33 @@ namespace CalamityMod.Tiles.DraedonSummoner // Grab the tile entity because it stores the information regarding what is actually attached. TECodebreaker codebreakerTileEntity = CalamityUtils.FindTileEntity(i, j, Width, Height, SheetSquare); - Texture2D tex = ModContent.GetTexture("CalamityMod/Tiles/DraedonSummoner/CodebreakerTile"); - Texture2D computerTexture = ModContent.GetTexture("CalamityMod/Tiles/DraedonSummoner/CodebreakerDecryptionComputer"); - Texture2D sensorTexture = ModContent.GetTexture("CalamityMod/Tiles/DraedonSummoner/CodebreakerLongRangedSensorArray"); - Texture2D displayTexture = ModContent.GetTexture("CalamityMod/Tiles/DraedonSummoner/CodebreakerAdvancedDisplay"); - Texture2D voltageRegulatorTexture = ModContent.GetTexture("CalamityMod/Tiles/DraedonSummoner/CodebreakerVoltageRegulationSystem"); - Texture2D voltageRegulatorTexture2 = ModContent.GetTexture("CalamityMod/Tiles/DraedonSummoner/CodebreakerVoltageRegulationSystem2"); - Texture2D coolingCellTexture = ModContent.GetTexture("CalamityMod/Tiles/DraedonSummoner/CodebreakerAuricQuantumCoolingCell"); Vector2 offset = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); if (t.halfBrick()) offset.Y += 8f; + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + offset; Color drawColor = Lighting.GetColor(i, j); Rectangle frame = new Rectangle(frameXPos, frameYPos, 16, 16); if ((!t.halfBrick() && t.slope() == 0) || t.halfBrick()) { - spriteBatch.Draw(tex, drawPosition, frame, drawColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + spriteBatch.Draw(TileTexture, drawPosition, frame, drawColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); // Place secondary parts. if (codebreakerTileEntity != null) { if (codebreakerTileEntity.ContainsDecryptionComputer) - spriteBatch.Draw(computerTexture, drawPosition, frame, drawColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + spriteBatch.Draw(ComputerTexture, drawPosition, frame, drawColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); if (codebreakerTileEntity.ContainsVoltageRegulationSystem) - spriteBatch.Draw(voltageRegulatorTexture2, drawPosition, frame, drawColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + spriteBatch.Draw(VoltageRegulatorTexture2, drawPosition, frame, drawColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); if (codebreakerTileEntity.ContainsSensorArray) - spriteBatch.Draw(sensorTexture, drawPosition, frame, drawColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + spriteBatch.Draw(SensorTexture, drawPosition, frame, drawColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); if (codebreakerTileEntity.ContainsCoolingCell) - spriteBatch.Draw(coolingCellTexture, drawPosition, frame, drawColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + spriteBatch.Draw(CoolingCellTexture, drawPosition, frame, drawColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); if (codebreakerTileEntity.ContainsVoltageRegulationSystem) - spriteBatch.Draw(voltageRegulatorTexture, drawPosition, frame, drawColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + spriteBatch.Draw(VoltageRegulatorTexture, drawPosition, frame, drawColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); if (codebreakerTileEntity.ContainsAdvancedDisplay) - spriteBatch.Draw(displayTexture, drawPosition, frame, drawColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + spriteBatch.Draw(DisplayTexture, drawPosition, frame, drawColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); } } return false; From f9d315cb591bde6fe8e2e0167e0cc6b15f3721a7 Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 16 Sep 2021 22:48:28 -0500 Subject: [PATCH 65/86] Warning if a codebreaker has no computer --- Tiles/DraedonSummoner/CodebreakerTile.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Tiles/DraedonSummoner/CodebreakerTile.cs b/Tiles/DraedonSummoner/CodebreakerTile.cs index 634b37946b..fb383ea9fd 100644 --- a/Tiles/DraedonSummoner/CodebreakerTile.cs +++ b/Tiles/DraedonSummoner/CodebreakerTile.cs @@ -125,6 +125,10 @@ namespace CalamityMod.Tiles.DraedonSummoner // If this is the tile the player is currently looking at, the associated tile entity doesn't really exist, or it's simply not upgraded enough, close the GUI. if (codebreakerTileEntity is null || codebreakerTileEntity.ID == CodebreakerUI.ViewedTileEntityID || !codebreakerTileEntity.ContainsDecryptionComputer) { + // Create a warning if someone attempts to click on a codebreaker without a computer with which to open the UI. + if (!codebreakerTileEntity.ContainsDecryptionComputer) + CombatText.NewText(player.Hitbox, Color.Cyan, "No decryption computer installed"); + CodebreakerUI.ViewedTileEntityID = -1; Main.PlaySound(SoundID.MenuClose); } From 71fb02aa9ccf8e50b401834210ed0ad7fc2964c5 Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 16 Sep 2021 22:51:20 -0500 Subject: [PATCH 66/86] ReadBoolean -> BitsByte for efficiency --- TileEntities/TECodebreaker.cs | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/TileEntities/TECodebreaker.cs b/TileEntities/TECodebreaker.cs index 235a850b07..94bc3632f8 100644 --- a/TileEntities/TECodebreaker.cs +++ b/TileEntities/TECodebreaker.cs @@ -174,13 +174,16 @@ namespace CalamityMod.TileEntities return; ModPacket packet = mod.GetPacket(); + BitsByte containmentFlagWrapper = new BitsByte(); + containmentFlagWrapper[0] = ContainsDecryptionComputer; + containmentFlagWrapper[1] = ContainsSensorArray; + containmentFlagWrapper[2] = ContainsAdvancedDisplay; + containmentFlagWrapper[3] = ContainsVoltageRegulationSystem; + containmentFlagWrapper[4] = ContainsCoolingCell; + packet.Write((byte)CalamityModMessageType.UpdateCodebreakerConstituents); packet.Write(ID); - packet.Write(ContainsDecryptionComputer); - packet.Write(ContainsSensorArray); - packet.Write(ContainsAdvancedDisplay); - packet.Write(ContainsVoltageRegulationSystem); - packet.Write(ContainsCoolingCell); + packet.Write(containmentFlagWrapper); } public static void ReadConstituentsUpdateSync(Mod mod, BinaryReader reader) @@ -190,11 +193,12 @@ namespace CalamityMod.TileEntities // Continue reading to the end even if a tile entity with the given ID does not exist. // Not doing this will cause errors/bugs. - bool containsDecryptionComputer = reader.ReadBoolean(); - bool containsSensorArray = reader.ReadBoolean(); - bool containsAdvancedDisplay = reader.ReadBoolean(); - bool containsVoltageRegulationSystem = reader.ReadBoolean(); - bool containsCoolingCell = reader.ReadBoolean(); + BitsByte containmentFlagWrapper = reader.ReadByte(); + bool containsDecryptionComputer = containmentFlagWrapper[0]; + bool containsSensorArray = containmentFlagWrapper[1]; + bool containsAdvancedDisplay = containmentFlagWrapper[2]; + bool containsVoltageRegulationSystem = containmentFlagWrapper[3]; + bool containsCoolingCell = containmentFlagWrapper[4]; // After doing reading, check again to see if the tile entity is actually there. // If it isn't don't bother doing anything else. From ad39b0dd7cf1df06df27119013aca82c3f54dc21 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 8 Sep 2021 19:07:24 -0500 Subject: [PATCH 67/86] Base for Cal NPC dialog --- NPCs/TownNPCs/WITCH.cs | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/NPCs/TownNPCs/WITCH.cs b/NPCs/TownNPCs/WITCH.cs index 219026ada2..136727a7b4 100644 --- a/NPCs/TownNPCs/WITCH.cs +++ b/NPCs/TownNPCs/WITCH.cs @@ -7,7 +7,7 @@ using CalamityMod.World; using Terraria; using Terraria.ID; using Terraria.ModLoader; - +using Terraria.Utilities; using static Terraria.ModLoader.ModContent; using SCalBoss = CalamityMod.NPCs.SupremeCalamitas.SupremeCalamitas; @@ -53,7 +53,32 @@ namespace CalamityMod.NPCs.TownNPCs public override string TownNPCName() => "Calamitas"; - public override string GetChat() => "Mrrp is cringe."; + // For Mrrp when he works on this. + // These comments can be removed once he's done modifying this and understands how it works. + + // The way this works is by having an RNG based on weights. + // With certain conditions (such as if a blood moon is happening) you can add possibilities + // to the RNG via textSelector.Add("text", weight); + // Text can always appear assuming the weight is greater than 0 and there's no if condition deciding whether it can. + // The higher the weight is, the more likely it is to be selected from all the choices. + // To give an example of this, assume you have two possibilities: + // "a" with a weight of 1, and "b" with a weight of 5. The chance of "a" being displayed would be + // 1/6, while "b" wold have a 5/6 chance of being displayed. + // If only one possibility exists it will be the only thing that is displayed, regardless of weight. + public override string GetChat() + { + WeightedRandom textSelector = new WeightedRandom(Main.rand); + textSelector.Add("Test", 0.95); + + // Select a possibility from the RNG and choose it as the thing that should be said. + string thingToSay = textSelector.Get(); + + // Have a flat chance (1/4444) to simply ignore the above selection and say something humorous instead. + if (Main.rand.NextBool(4444)) + thingToSay = "Mrrp is cringe."; + + return thingToSay; + } public override void SetChatButtons(ref string button, ref string button2) => button = "Enchant"; From 9cf23b9553f094d3c48d5245c96e2f3a1db3b73d Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Mon, 13 Sep 2021 14:41:27 -0500 Subject: [PATCH 68/86] Calamitas NPC dialog --- NPCs/TownNPCs/WITCH.cs | 51 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 47 insertions(+), 4 deletions(-) diff --git a/NPCs/TownNPCs/WITCH.cs b/NPCs/TownNPCs/WITCH.cs index 136727a7b4..65a939b94d 100644 --- a/NPCs/TownNPCs/WITCH.cs +++ b/NPCs/TownNPCs/WITCH.cs @@ -5,6 +5,7 @@ using CalamityMod.Projectiles.Magic; using CalamityMod.UI.CalamitasEnchants; using CalamityMod.World; using Terraria; +using Terraria.GameContent.Events; using Terraria.ID; using Terraria.ModLoader; using Terraria.Utilities; @@ -53,9 +54,6 @@ namespace CalamityMod.NPCs.TownNPCs public override string TownNPCName() => "Calamitas"; - // For Mrrp when he works on this. - // These comments can be removed once he's done modifying this and understands how it works. - // The way this works is by having an RNG based on weights. // With certain conditions (such as if a blood moon is happening) you can add possibilities // to the RNG via textSelector.Add("text", weight); @@ -68,7 +66,52 @@ namespace CalamityMod.NPCs.TownNPCs public override string GetChat() { WeightedRandom textSelector = new WeightedRandom(Main.rand); - textSelector.Add("Test", 0.95); + + if (npc.homeless) + { + textSelector.Add("I'm considering moving back to that old cave of mine."); + textSelector.Add("I certainly can't return to the Tyrant's old dwellings now, have you got any places to stay?"); + } + else + { + textSelector.Add("I can't pay rent, but if you've got any dead relative you want me to try and... what? You don't?"); + textSelector.Add("One of these days, I was thinking of starting a garden with the flowers from the old capitol of hell." + + "I love the smell of brimstone in the morning."); + textSelector.Add("I think I've settled comfortably, thank you very much."); + textSelector.Add("Many seasons have gone by since I first met with the Tyrant, and only now did I break free." + + "I wish I'd been stronger..."); + textSelector.Add("If you've got any curses you want dispelled... well I'm not your person."); + + if (!Main.dayTime) + { + if (Main.bloodMoon) + { + textSelector.Add("Such an unnatural shade of red. Nothing like my brimstone flames.", 5.15); + textSelector.Add("I can't work with nights like these. The stars seem to have shrunk away in fear.", 5.15); + } + else + { + textSelector.Add("These undead are horrific, I can't stand to look at them. How could anyone be satisfied" + + "with such amateur work?", 2.8); + textSelector.Add("I don't think it's a stretch to say that astrology is utter nonsense... but it was a hobby" + + "of mine once.", 2.8); + } + } + + if (BirthdayParty.PartyIsUp) + textSelector.Add("If another person asks me if I can dance or not, I will light their hat on fire.", 5.5); + + if (NPC.AnyNPCs(NPCType())) + { + textSelector.Add("I cannot understand the Sea King. He does not seem to want me dead. That amount of compassion" + + "I just can't understand.", 1.45); + } + if (NPC.AnyNPCs(NPCType())) + { + textSelector.Add("That frosty old man.. even if you ignore our brands of magic and our old alliances, I doubt I'd ever" + + "get along with him.", 1.45); + } + } // Select a possibility from the RNG and choose it as the thing that should be said. string thingToSay = textSelector.Get(); From 9e96623a284a413ac2d9cf2059e24c039ee6fd01 Mon Sep 17 00:00:00 2001 From: Cameron Ewell Date: Fri, 17 Sep 2021 00:22:29 -0400 Subject: [PATCH 69/86] Fix SCal ellipsis having only two periods --- NPCs/TownNPCs/WITCH.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NPCs/TownNPCs/WITCH.cs b/NPCs/TownNPCs/WITCH.cs index 65a939b94d..7c00caf758 100644 --- a/NPCs/TownNPCs/WITCH.cs +++ b/NPCs/TownNPCs/WITCH.cs @@ -108,7 +108,7 @@ namespace CalamityMod.NPCs.TownNPCs } if (NPC.AnyNPCs(NPCType())) { - textSelector.Add("That frosty old man.. even if you ignore our brands of magic and our old alliances, I doubt I'd ever" + + textSelector.Add("That frosty old man... even if you ignore our brands of magic and our old alliances, I doubt I'd ever" + "get along with him.", 1.45); } } From 57f71615dd4edc09118ec35cc90981864f06f114 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 15 Sep 2021 16:30:07 -0500 Subject: [PATCH 70/86] Nerfed Rem's Revenge damage to 375 --- Items/Weapons/Melee/RemsRevenge.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Melee/RemsRevenge.cs b/Items/Weapons/Melee/RemsRevenge.cs index 2aff20909c..15266bf64e 100644 --- a/Items/Weapons/Melee/RemsRevenge.cs +++ b/Items/Weapons/Melee/RemsRevenge.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.damage = 415; + item.damage = 375; item.melee = true; item.width = 44; item.height = 34; From 6859264c7971681d48a522e821f9c1101febe5f4 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 15 Sep 2021 16:48:53 -0500 Subject: [PATCH 71/86] Buffed Greatsword of Blah damage to 138 --- Items/Weapons/Melee/GreatswordofBlah.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Melee/GreatswordofBlah.cs b/Items/Weapons/Melee/GreatswordofBlah.cs index 5473633d52..8225336918 100644 --- a/Items/Weapons/Melee/GreatswordofBlah.cs +++ b/Items/Weapons/Melee/GreatswordofBlah.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = item.height = 102; - item.damage = 125; + item.damage = 138; item.melee = true; item.useAnimation = 18; item.useStyle = ItemUseStyleID.SwingThrow; From b99008b8d1420dc3177f9dbce5549a51041b2709 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 15 Sep 2021 16:49:09 -0500 Subject: [PATCH 72/86] Increase Phaseslayer iframes --- Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs b/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs index 165fcecad2..cca960c8ab 100644 --- a/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs +++ b/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.penetrate = -1; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 7; + projectile.localNPCHitCooldown = 13; } // Vanilla Terraria doesn't sync projectile rotation, but it does sync velocity. From 6ecd1492d50ea0e532109e515d7139600c3d848a Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 15 Sep 2021 17:02:10 -0500 Subject: [PATCH 73/86] Buffed Galaxia damage to 99 --- Items/Weapons/Melee/FourSeasonsGalaxia.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Melee/FourSeasonsGalaxia.cs b/Items/Weapons/Melee/FourSeasonsGalaxia.cs index 9e81378b6e..30ce17dd99 100644 --- a/Items/Weapons/Melee/FourSeasonsGalaxia.cs +++ b/Items/Weapons/Melee/FourSeasonsGalaxia.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 70; - item.damage = 66; + item.damage = 99; item.melee = true; item.useAnimation = 18; item.useTime = 18; From 62d8ed730ddf830dabbc6f4723e2e496ba920fd0 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 15 Sep 2021 17:02:20 -0500 Subject: [PATCH 74/86] Made Cosmic Shiv movement better --- Projectiles/Melee/CosmicShivBall.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Projectiles/Melee/CosmicShivBall.cs b/Projectiles/Melee/CosmicShivBall.cs index 5c69f79a4d..f785f1d5de 100644 --- a/Projectiles/Melee/CosmicShivBall.cs +++ b/Projectiles/Melee/CosmicShivBall.cs @@ -10,10 +10,11 @@ namespace CalamityMod.Projectiles.Melee { public class CosmicShivBall : ModProjectile { + // TODO - Please for the love of god refactor this at some point. It is ancient public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; public NPC target = null; - public const float maxDistanceToTarget = 300f; + public const float maxDistanceToTarget = 540f; public bool initialized = false; public float startingVelocityY = 0f; public float randomAngleDelta = 0f; @@ -61,15 +62,15 @@ namespace CalamityMod.Projectiles.Melee } if (target != null) { - const float turnSpeed = 20f; - const float speedMult = 48f; - Vector2 distNorm = (target.Center - projectile.Center).SafeNormalize(Vector2.UnitX); - projectile.velocity = (projectile.velocity * (turnSpeed - 1f) + distNorm * speedMult) / turnSpeed; + float inertia = 35f; + float homingSpeed = 33.5f; + Vector2 idealVElocity = projectile.SafeDirectionTo(target.Center, Vector2.UnitX) * homingSpeed; + projectile.velocity = (projectile.velocity * (inertia - 1f) + idealVElocity) / inertia; } else { projectile.ai[0]++; - projectile.velocity.Y = startingVelocityY + (float)(16.0 * Math.Cos((double)projectile.ai[0] / 12.0 + (double)randomAngleDelta)); + projectile.velocity.Y = startingVelocityY + (float)(Math.Cos(projectile.ai[0] / 12D + randomAngleDelta) * 7D); } } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) From 996c17a9c2185a730bd4dc19cbbfd48f5f87cbc8 Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 16 Sep 2021 22:54:24 -0500 Subject: [PATCH 75/86] Variable name fix --- Projectiles/Melee/CosmicShivBall.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Projectiles/Melee/CosmicShivBall.cs b/Projectiles/Melee/CosmicShivBall.cs index f785f1d5de..3263436039 100644 --- a/Projectiles/Melee/CosmicShivBall.cs +++ b/Projectiles/Melee/CosmicShivBall.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.Melee { public class CosmicShivBall : ModProjectile { - // TODO - Please for the love of god refactor this at some point. It is ancient + // TODO - Please for the love of god refactor this at some point. It is ancient. public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; public NPC target = null; @@ -64,8 +64,8 @@ namespace CalamityMod.Projectiles.Melee { float inertia = 35f; float homingSpeed = 33.5f; - Vector2 idealVElocity = projectile.SafeDirectionTo(target.Center, Vector2.UnitX) * homingSpeed; - projectile.velocity = (projectile.velocity * (inertia - 1f) + idealVElocity) / inertia; + Vector2 idealVelocity = projectile.SafeDirectionTo(target.Center, Vector2.UnitX) * homingSpeed; + projectile.velocity = (projectile.velocity * (inertia - 1f) + idealVelocity) / inertia; } else { From d98704c39a3d86421b70edefcb0e05504840f3b4 Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 17 Sep 2021 01:38:00 -0500 Subject: [PATCH 76/86] Fixed overlap with the decryption/contact icons --- UI/CodebreakerUI.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/UI/CodebreakerUI.cs b/UI/CodebreakerUI.cs index c8ae97f840..a6c826269a 100644 --- a/UI/CodebreakerUI.cs +++ b/UI/CodebreakerUI.cs @@ -51,6 +51,7 @@ namespace CalamityMod.UI if (MouseScreenArea.Intersects(backgroundArea)) Main.blockMouse = Main.LocalPlayer.mouseInterface = true; + bool canSummonDraedon = codebreakerTileEntity.ReadyToSummonDraedon && CalamityWorld.AbleToSummonDraedon; Vector2 backgroundTopLeft = BackgroundCenter - backgroundTexture.Size() * 0.5f; // Draw the cell payment slot icon. @@ -64,6 +65,7 @@ namespace CalamityMod.UI Vector2 costDisplayLocation = schematicSlotDrawCenter + Vector2.UnitY * 20f; Vector2 costVerificationLocation = costDisplayLocation + Vector2.UnitY * 60f; Vector2 textPanelCenter = backgroundTopLeft + Vector2.UnitX * backgroundTexture.Width + textPanelTexture.Size() * new Vector2(-0.5f, 0.5f); + Vector2 summonButtonCenter = backgroundTopLeft + new Vector2(58f, backgroundTexture.Height - 48f); // Display some error text if the codebreaker isn't strong enough to decrypt the schematic. if (codebreakerTileEntity.HeldSchematicID != 0 && !codebreakerTileEntity.CanDecryptHeldSchematic) @@ -76,7 +78,14 @@ namespace CalamityMod.UI DisplayCostText(costDisplayLocation, cost); if (codebreakerTileEntity.InputtedCellCount >= cost) + { + if (canSummonDraedon) + { + costVerificationLocation.X -= 15f; + summonButtonCenter.X += 15f; + } DrawCostVerificationButton(codebreakerTileEntity, costVerificationLocation); + } } else if (codebreakerTileEntity.DecryptionCountdown > 0) { @@ -86,8 +95,7 @@ namespace CalamityMod.UI DisplayDecryptCancelButton(codebreakerTileEntity, textPanelCenter + Vector2.UnitY * 110f); } - Vector2 summonButtonCenter = backgroundTopLeft + new Vector2(62f, backgroundTexture.Height - 44f); - if (codebreakerTileEntity.ReadyToSummonDraedon && CalamityWorld.AbleToSummonDraedon) + if (canSummonDraedon) HandleDraedonSummonButton(codebreakerTileEntity, summonButtonCenter); if (codebreakerTileEntity.DecryptionCountdown > 0 || AwaitingDecryptionTextClose) From dc0685c03d8e16da5ce1dd07dff96870d781c1ab Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 17 Sep 2021 04:23:03 -0500 Subject: [PATCH 77/86] Draedon's glowmask works correctly --- NPCs/ExoMechs/Draedon.cs | 4 ++-- NPCs/ExoMechs/DraedonGlowmask.png | Bin 13221 -> 10303 bytes 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NPCs/ExoMechs/Draedon.cs b/NPCs/ExoMechs/Draedon.cs index c0aebc5cef..89c62c9f1b 100644 --- a/NPCs/ExoMechs/Draedon.cs +++ b/NPCs/ExoMechs/Draedon.cs @@ -387,7 +387,7 @@ namespace CalamityMod.NPCs.ExoMechs spriteBatch.EnterShaderRegion(); Texture2D texture = Main.npcTexture[npc.type]; - Texture2D glowmask = Main.npcTexture[npc.type]; + Texture2D glowmask = ModContent.GetTexture("CalamityMod/NPCs/ExoMechs/DraedonGlowmask"); Rectangle frame = npc.frame; Vector2 drawPosition = npc.Center - Main.screenPosition - Vector2.UnitY * 38f; @@ -404,7 +404,7 @@ namespace CalamityMod.NPCs.ExoMechs spriteBatch.ExitShaderRegion(); - if (TalkTimer >= TeleportFadeinTime) + if (TalkTimer > TeleportFadeinTime) spriteBatch.Draw(glowmask, drawPosition, frame, Color.White * npc.Opacity, npc.rotation, origin, npc.scale, direction, 0f); return false; diff --git a/NPCs/ExoMechs/DraedonGlowmask.png b/NPCs/ExoMechs/DraedonGlowmask.png index ea7762e563211a512a4ad0953944239a35d80f1c..5993dfe9cd1d9e52208dd1c70d5d0d3261814ef4 100644 GIT binary patch literal 10303 zcmeHNdpuNm|JQxOHiq0~nv^i)gh<4?G;Tw=Br0^!lyXUmh-@|E7DbUGspOV&NvM?A zJ>ycEP(-Npi)Mr*BZZjxeb3Zx?bfsVJip)TdH&dEyiQM}qvJe#OVR+Do>ulOZYechC9+r3$%Dkoc7Q$2r=J&Bn<7?Sg_h_gK-&y zTo7tVlGIbV~xak+9QDKVADO@;r%aV9i6j>6VKaV-Z%h1ej z8&@*--$7!fJHQuAWgPL0&_j*V4w{-1rVT^tbgLZn`)DXv5m(w+U9*cX(f;GGI=w$d zc-AuPJp^y`4{jzYu-%=a`!{L{b*)R_Tgd^-?DE>P?XrxlTDq^sE<&fwB2MO3!<~?u zw4R2d)~#7?*UEA#)vq?r8XYyDAo4lri$w;;-cIvwEyxN-YW32LSbOSogK?vFB~WTt zu61c!mTw`%46PfMhJRL-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x3$o6HyH(&fk-E&9C(O$?Dtt2p8J-1; z97nOHRuERlF$*tmX+4q)=(I?EI!6d9JutUF8RAxhf_`i9z%$XH#UESvHCx{7v%YxT zWM%M6A;A6E%Hp*@F(aMr0J5ub9yEBb8_3m-;rsQ~_=$^iRlnx{)K5I>^t+l~-6^P! z{^?ZO@ngP?&zNss>ZvZ${0E|T<3CqNjTx!{ zzvoA~R=pHsPQ~8;WvU(l?_p@5(ajH*KVnR8L$;hKL{hM^G-HduZw8#rQQG&v4?!t? z#_?<(`Dt&mqHn>mRFsiyn~IHmpkcVf1Wn7_R%qx{7kcA{)4$@^7hU`lTkt|U<|Fe5 zl0%0n{nqC_E>hZ7A83d(ry6Um9o~aqA04e^P+>AZhyEqAn`yFT0Ga!VMB*WY@l)$@rg{C||?U7~V% ztH~HEwjHN3HQnSCYk$2`n$EXz@=u#bZI$wAS%L=yQuBOw}jr@C5`&&d0z?ZGk@Vhl=~fGLiFNHXgd&Ogso{n=R7*jw=bZXi`f-gO%7g From 5825486dcfb8bb9a30efc8cf3ea23019e02bd29e Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Fri, 17 Sep 2021 08:04:14 -0500 Subject: [PATCH 78/86] 1 - Various exo mech changes. --- ILEditing/ILChanges.cs | 3 + NPCs/ExoMechs/Apollo/Apollo.cs | 468 +++++++++++++------ NPCs/ExoMechs/Ares/AresBody.cs | 23 +- NPCs/ExoMechs/Ares/AresGaussNuke.cs | 10 +- NPCs/ExoMechs/Ares/AresLaserCannon.cs | 15 +- NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs | 10 +- NPCs/ExoMechs/Ares/AresTeslaCannon.cs | 10 +- NPCs/ExoMechs/Artemis/Artemis.cs | 53 +-- NPCs/ExoMechs/Thanatos/ThanatosBody1.cs | 8 +- NPCs/ExoMechs/Thanatos/ThanatosBody2.cs | 8 +- NPCs/ExoMechs/Thanatos/ThanatosHead.cs | 23 +- NPCs/ExoMechs/Thanatos/ThanatosTail.cs | 8 +- Projectiles/Boss/AresDeathBeamStart.cs | 4 +- Projectiles/Boss/AresDeathBeamTelegraph.cs | 2 +- Projectiles/Boss/AresPlasmaFireball.cs | 14 +- Projectiles/Boss/AresTeslaOrb.cs | 3 + Projectiles/Boss/ArtemisDeathrayTelegraph.cs | 2 +- Projectiles/Boss/ArtemisLaserBeamStart.cs | 4 +- Projectiles/Boss/ExoDestroyerBeamStart.cs | 4 +- Utilities/NPCStats.cs | 2 +- 20 files changed, 433 insertions(+), 241 deletions(-) diff --git a/ILEditing/ILChanges.cs b/ILEditing/ILChanges.cs index bfa33c76c5..c0da6ef1db 100644 --- a/ILEditing/ILChanges.cs +++ b/ILEditing/ILChanges.cs @@ -125,6 +125,9 @@ namespace CalamityMod.ILEditing IL.Terraria.Player.ItemCheck += ApplyManaBurnIfNeeded; IL.Terraria.Player.AddBuff += AllowBuffTimeStackingForManaBurn; + // Ravager platform fall fix + + // Damage and health balance IL.Terraria.Main.DamageVar += AdjustDamageVariance; IL.Terraria.NPC.scaleStats += RemoveExpertHardmodeScaling; diff --git a/NPCs/ExoMechs/Apollo/Apollo.cs b/NPCs/ExoMechs/Apollo/Apollo.cs index 3afaf4f50b..64db2186fa 100644 --- a/NPCs/ExoMechs/Apollo/Apollo.cs +++ b/NPCs/ExoMechs/Apollo/Apollo.cs @@ -131,10 +131,12 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo music = /*CalamityMod.Instance.GetMusicFromMusicMod("AdultEidolonWyrm") ??*/ MusicID.Boss3; bossBag = ModContent.ItemType(); } - + public override void BossHeadSlot(ref int index) { - if (npc.life / (float)npc.lifeMax < 0.6f) + if (SecondaryAIState == (float)SecondaryPhase.PassiveAndImmune) + index = -1; + else if (npc.life / (float)npc.lifeMax < 0.6f) index = phase2IconIndex; else index = phase1IconIndex; @@ -333,33 +335,31 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo // Distance where Apollo stops moving float movementDistanceGateValue = 100f; + float chargeLocationDistanceGateValue = 20f; // Velocity and acceleration values - float baseVelocityMult = malice ? 1.3f : death ? 1.2f : revenge ? 1.15f : expertMode ? 1.1f : 1f; - float baseVelocity = 14f * baseVelocityMult; - float baseAcceleration = 1f; - if (berserk) - { - baseVelocity *= 1.5f; - baseAcceleration *= 1.5f; - } + float baseVelocityMult = (berserk ? 0.5f : 0f) + (malice ? 1.3f : death ? 1.2f : revenge ? 1.15f : expertMode ? 1.1f : 1f); + float baseVelocity = 18f * baseVelocityMult; // Charge variables float chargeVelocity = malice ? 90f : death ? 80f : revenge ? 75f : expertMode ? 70f : 60f; - float chargeDistance = 1500f; - float chargeDuration = chargeDistance / chargeVelocity; bool lineUpAttack = calamityGlobalNPC.newAI[3] >= attackPhaseGateValue + 2f; bool doBigAttack = calamityGlobalNPC.newAI[3] >= attackPhaseGateValue + 2f + timeToLineUpAttack; // Rocket phase variables float rocketPhaseDuration = lastMechAlive ? 60f : 90f; + // Default vector to fly to + float chargeComboXOffset = -500f; + float chargeComboYOffset = npc.ai[2] == 0f ? 400f : -400f; + Vector2 destination = SecondaryAIState == (float)SecondaryPhase.PassiveAndImmune ? new Vector2(player.Center.X + 1200f, player.Center.Y) : AIState == (float)Phase.LineUpChargeCombo ? new Vector2(player.Center.X + 750f, player.Center.Y + chargeComboYOffset) : new Vector2(player.Center.X + 750f, player.Center.Y); + // Rotation Vector2 predictionVector = player.velocity * predictionAmt; Vector2 aimedVector = player.Center + predictionVector - npc.Center; float rateOfRotation = 0.1f; Vector2 rotateTowards = player.Center - npc.Center; - bool stopRotatingAndSlowDown = AIState == (float)Phase.LineUpChargeCombo && calamityGlobalNPC.newAI[2] >= timeToLineUpAttack; + bool stopRotatingAndSlowDown = AIState == (float)Phase.LineUpChargeCombo && (Vector2.Distance(npc.Center, destination) <= chargeLocationDistanceGateValue || calamityGlobalNPC.newAI[2] > 0f); if (!stopRotatingAndSlowDown) { if (AIState == (int)Phase.ChargeCombo) @@ -401,11 +401,14 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo npc.localAI[2] = 0f; calamityGlobalNPC.newAI[2] = 0f; calamityGlobalNPC.newAI[3] = 0f; + for (int i = 0; i < maxCharges; i++) + chargeLocations[i] = default; + npc.dontTakeDamage = true; - npc.velocity.Y -= 2f; + npc.velocity.Y -= 1f; if ((double)npc.position.Y < Main.topWorld + 16f) - npc.velocity.Y -= 2f; + npc.velocity.Y -= 1f; if ((double)npc.position.Y < Main.topWorld + 16f) { @@ -433,10 +436,6 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo npc.netUpdate = true; } - // Default vector to fly to - float chargeComboYOffeset = npc.ai[2] == 0f ? 400f : -400f; - Vector2 destination = SecondaryAIState == (float)SecondaryPhase.PassiveAndImmune ? new Vector2(player.Center.X + 1200f, player.Center.Y) : AIState == (float)Phase.LineUpChargeCombo ? new Vector2(player.Center.X + 750f, player.Center.Y + chargeComboYOffeset) : new Vector2(player.Center.X + 750f, player.Center.Y); - // Add a bit of randomness to the destination, but only in specific phases where it's necessary if (AIState == (float)Phase.Normal || AIState == (float)Phase.RocketBarrage || AIState == (float)Phase.PhaseTransition) { @@ -480,6 +479,14 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo // Reset everything npc.ai[3] = 1f; SecondaryAIState = (float)SecondaryPhase.PassiveAndImmune; + npc.localAI[0] = 0f; + npc.localAI[1] = 0f; + npc.localAI[2] = 0f; + calamityGlobalNPC.newAI[2] = 0f; + calamityGlobalNPC.newAI[3] = 0f; + for (int i = 0; i < maxCharges; i++) + chargeLocations[i] = default; + npc.TargetClosest(); if (Main.netMode != NetmodeID.MultiplayerClient) @@ -499,6 +506,14 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo { // Tells Apollo to return to the battle in passive state and reset everything SecondaryAIState = (float)SecondaryPhase.Passive; + npc.localAI[0] = 0f; + npc.localAI[1] = 0f; + npc.localAI[2] = 0f; + calamityGlobalNPC.newAI[2] = 0f; + calamityGlobalNPC.newAI[3] = 0f; + for (int i = 0; i < maxCharges; i++) + chargeLocations[i] = default; + npc.TargetClosest(); } @@ -508,6 +523,14 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo { // Reset everything SecondaryAIState = (float)SecondaryPhase.PassiveAndImmune; + npc.localAI[0] = 0f; + npc.localAI[1] = 0f; + npc.localAI[2] = 0f; + calamityGlobalNPC.newAI[2] = 0f; + calamityGlobalNPC.newAI[3] = 0f; + for (int i = 0; i < maxCharges; i++) + chargeLocations[i] = default; + npc.TargetClosest(); } } @@ -517,11 +540,22 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo // Fire projectiles less often case (int)SecondaryPhase.Passive: + // Fire plasma while passive + AIState = (float)Phase.Normal; + // Enter passive and invincible phase if one of the other exo mechs is berserk if (otherMechIsBerserk) { // Reset everything SecondaryAIState = (float)SecondaryPhase.PassiveAndImmune; + npc.localAI[0] = 0f; + npc.localAI[1] = 0f; + npc.localAI[2] = 0f; + calamityGlobalNPC.newAI[2] = 0f; + calamityGlobalNPC.newAI[3] = 0f; + for (int i = 0; i < maxCharges; i++) + chargeLocations[i] = default; + npc.TargetClosest(); } @@ -529,6 +563,14 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo if (berserk) { // Reset everything + npc.localAI[0] = 0f; + npc.localAI[1] = 0f; + npc.localAI[2] = 0f; + calamityGlobalNPC.newAI[2] = 0f; + calamityGlobalNPC.newAI[3] = 0f; + for (int i = 0; i < maxCharges; i++) + chargeLocations[i] = default; + npc.TargetClosest(); // Never be passive if berserk @@ -540,18 +582,37 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo // Fly above target and become immune case (int)SecondaryPhase.PassiveAndImmune: + // Do nothing while immune + AIState = (float)Phase.Normal; + // Enter the fight again if any of the other exo mechs is below 70% and the other mechs aren't berserk if ((exoWormLifeRatio < 0.7f || exoPrimeLifeRatio < 0.7f) && !otherMechIsBerserk) { // Tells Artemis and Apollo to return to the battle in passive state and reset everything // Return to normal phases if one or more mechs have been downed SecondaryAIState = totalOtherExoMechLifeRatio > 5f ? (float)SecondaryPhase.Nothing : (float)SecondaryPhase.Passive; + npc.localAI[0] = 0f; + npc.localAI[1] = 0f; + npc.localAI[2] = 0f; + calamityGlobalNPC.newAI[2] = 0f; + calamityGlobalNPC.newAI[3] = 0f; + for (int i = 0; i < maxCharges; i++) + chargeLocations[i] = default; + npc.TargetClosest(); } if (berserk) { // Reset everything + npc.localAI[0] = 0f; + npc.localAI[1] = 0f; + npc.localAI[2] = 0f; + calamityGlobalNPC.newAI[2] = 0f; + calamityGlobalNPC.newAI[3] = 0f; + for (int i = 0; i < maxCharges; i++) + chargeLocations[i] = default; + npc.TargetClosest(); // Never be passive if berserk @@ -561,14 +622,118 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo break; } - // Needs edits // Attacking phases - /*switch ((int)AIState) + switch ((int)AIState) { - // Fly above the target + // Fly to the right of the target case (int)Phase.Normal: - if (!targetDead) + // Inverse lerp returns the percentage of progress between A and B + float lerpValue2 = Utils.InverseLerp(movementDistanceGateValue, 2400f, distanceFromDestination.Length(), true); + + // Min velocity + float minVelocity2 = distanceFromDestination.Length(); + float minVelocityCap2 = baseVelocity; + if (minVelocity2 > minVelocityCap2) + minVelocity2 = minVelocityCap2; + + // Max velocity + Vector2 maxVelocity2 = distanceFromDestination / 24f; + float maxVelocityCap2 = minVelocityCap2 * 3f; + if (maxVelocity2.Length() > maxVelocityCap2) + maxVelocity2 = distanceFromDestination.SafeNormalize(Vector2.Zero) * maxVelocityCap2; + + npc.velocity = Vector2.Lerp(distanceFromDestination.SafeNormalize(Vector2.Zero) * minVelocity2, maxVelocity2, lerpValue2); + + // Default animation for 60 frames and then go to telegraph animation + // newAI[3] tells Apollo what animation state it's currently in + bool attacking = calamityGlobalNPC.newAI[3] >= 2f; + bool firingPlasma = attacking && calamityGlobalNPC.newAI[3] + 2f < attackPhaseGateValue; + + // Only increase attack timer if not in immune phase + if (SecondaryAIState != (float)SecondaryPhase.PassiveAndImmune) + calamityGlobalNPC.newAI[2] += 1f; + + if (calamityGlobalNPC.newAI[2] >= defaultAnimationDuration || attacking) + { + if (firingPlasma) + { + // Fire plasma + int numPlasmaOrbs = lastMechAlive ? 15 : 12; + float divisor = attackPhaseGateValue / numPlasmaOrbs; + float plasmaTimer = calamityGlobalNPC.newAI[3] - 2f; + if (plasmaTimer % divisor == 0f) + { + pickNewLocation = true; + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/PlasmaCasterFire"), npc.Center); + Vector2 plasmaVelocity = Vector2.Normalize(aimedVector); + Vector2 offset = plasmaVelocity * 70f; + Projectile.NewProjectile(npc.Center + offset, plasmaVelocity, type, damage, 0f, Main.myPlayer, -1f); + } + } + } + else + calamityGlobalNPC.newAI[2] = 0f; + + // Enter rocket phase after a certain time has passed + // Enter charge phase if in phase 2 and the localAI[2] variable is set to do so + calamityGlobalNPC.newAI[3] += 1f; + if (lineUpAttack) + { + // Return to normal plasma phase if in passive state + if (SecondaryAIState == (float)SecondaryPhase.Passive) + { + pickNewLocation = true; + calamityGlobalNPC.newAI[2] = 0f; + calamityGlobalNPC.newAI[3] = 0f; + for (int i = 0; i < maxCharges; i++) + chargeLocations[i] = default; + + npc.TargetClosest(); + } + else if (doBigAttack) + { + pickNewLocation = npc.localAI[2] == 0f; + calamityGlobalNPC.newAI[2] = 0f; + calamityGlobalNPC.newAI[3] = 0f; + + if (phase2) + AIState = npc.localAI[2] == 1f ? (float)Phase.LineUpChargeCombo : (float)Phase.RocketBarrage; + else + AIState = (float)Phase.RocketBarrage; + } + } + } + + break; + + // Charge + case (int)Phase.RocketBarrage: + + // Reset phase and variables + calamityGlobalNPC.newAI[2] += 1f; + if (calamityGlobalNPC.newAI[2] >= rocketPhaseDuration) + { + // Go back to normal phase + pickNewLocation = true; + AIState = (float)Phase.Normal; + npc.localAI[2] = berserk ? 1f : 0f; + calamityGlobalNPC.newAI[2] = 0f; + npc.TargetClosest(); + } + + break; + + // Get in position for the charge combo, don't do anything else until in position + // Fill up the charge location array with the positions Apollo will charge from + // Create telegraph beams between the charge location array positions + case (int)Phase.LineUpChargeCombo: + + if (!stopRotatingAndSlowDown) { // Inverse lerp returns the percentage of progress between A and B float lerpValue = Utils.InverseLerp(movementDistanceGateValue, 2400f, distanceFromDestination.Length(), true); @@ -587,107 +752,113 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo npc.velocity = Vector2.Lerp(distanceFromDestination.SafeNormalize(Vector2.Zero) * minVelocity, maxVelocity, lerpValue); } - - if (berserk) + else { + // Save the charge locations + for (int i = 0; i < maxCharges; i++) + { + if (chargeLocations[i] == default) + { + switch (i) + { + case 0: + chargeLocations[i] = npc.Center; + break; + case 1: + chargeLocations[i] = chargeLocations[0] + new Vector2(chargeComboXOffset, -chargeComboYOffset * 2f); + break; + case 2: + chargeLocations[i] = chargeLocations[1] + new Vector2(chargeComboXOffset, chargeComboYOffset * 2f); + break; + case 3: + chargeLocations[i] = chargeLocations[2] + new Vector2(chargeComboXOffset, -chargeComboYOffset * 2f); + break; + default: + break; + } + } + } + + // Don't move + npc.velocity = Vector2.Zero; + + // Go to charge phase and reset calamityGlobalNPC.newAI[2] += 1f; - if (calamityGlobalNPC.newAI[2] > deathrayPhaseGateValue) + if (calamityGlobalNPC.newAI[2] >= timeToLineUpAttack) { + AIState = (float)Phase.ChargeCombo; calamityGlobalNPC.newAI[2] = 0f; - AIState = (float)Phase.Deathrays; } } break; - // Move close to target, reduce velocity when close enough, create telegraph beams, fire deathrays - case (int)Phase.Deathrays: + // Charge to several locations almost instantly (Apollo doesn't teleport here, he's just moving very fast :D) + case (int)Phase.ChargeCombo: - if (!targetDead) + // Charge combo attack here + // Increase newAI[2] whenever a charge occurs + + // Reset phase and variables + calamityGlobalNPC.newAI[2] += 1f; + if (calamityGlobalNPC.newAI[2] >= maxCharges) { - if (distanceFromTarget > deathrayDistanceGateValue && calamityGlobalNPC.newAI[3] == 0f) - { - Vector2 desiredVelocity2 = Vector2.Normalize(distanceFromDestination) * baseVelocity; - npc.SimpleFlyMovement(desiredVelocity2, baseAcceleration); - } - else - { - calamityGlobalNPC.newAI[3] = 1f; - npc.velocity *= decelerationVelocityMult; + pickNewLocation = true; + AIState = (float)Phase.Normal; + npc.localAI[2] = 0f; + calamityGlobalNPC.newAI[2] = 0f; + for (int i = 0; i < maxCharges; i++) + chargeLocations[i] = default; - int totalProjectiles = malice ? 12 : expertMode ? 10 : 8; - float radians = MathHelper.TwoPi / totalProjectiles; - Vector2 laserSpawnPoint = new Vector2(npc.Center.X, npc.Center.Y); - bool normalLaserRotation = npc.localAI[0] % 2f == 0f; - float velocity = 6f; - double angleA = radians * 0.5; - double angleB = MathHelper.ToRadians(90f) - angleA; - float velocityX2 = (float)(velocity * Math.Sin(angleA) / Math.Sin(angleB)); - Vector2 spinningPoint = normalLaserRotation ? new Vector2(0f, -velocity) : new Vector2(-velocityX2, -velocity); - spinningPoint.Normalize(); - - calamityGlobalNPC.newAI[2] += 1f; - if (calamityGlobalNPC.newAI[2] < deathrayTelegraphDuration) - { - // Fire deathray telegraph beams - if (calamityGlobalNPC.newAI[2] == 1f) - { - // Set frames to deathray charge up frames, which begin on frame 12 - // Reset the frame counter - npc.frameCounter = 0D; - - // X = 1 sets to frame 8 - frameX = 1; - - // Y = 4 sets to frame 12 - frameY = 4; - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon"), npc.Center); - int type = ModContent.ProjectileType(); - Vector2 spawnPoint = npc.Center + new Vector2(-1f, 23f); - for (int k = 0; k < totalProjectiles; k++) - { - Vector2 laserVelocity = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(spawnPoint + Vector2.Normalize(laserVelocity) * 17f, laserVelocity, type, 0, 0f, Main.myPlayer, 0f, npc.whoAmI); - } - } - } - } - else - { - // Fire deathrays - if (calamityGlobalNPC.newAI[2] == deathrayTelegraphDuration) - { - if (Main.netMode != NetmodeID.MultiplayerClient) - { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/TeslaCannonFire"), npc.Center); - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - Vector2 spawnPoint = npc.Center + new Vector2(-1f, 23f); - for (int k = 0; k < totalProjectiles; k++) - { - Vector2 laserVelocity = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(spawnPoint + Vector2.Normalize(laserVelocity) * 35f, laserVelocity, type, damage, 0f, Main.myPlayer, 0f, npc.whoAmI); - } - } - } - } - - if (calamityGlobalNPC.newAI[2] >= deathrayTelegraphDuration + deathrayDuration) - { - AIState = (float)Phase.Normal; - calamityGlobalNPC.newAI[2] = 0f; - calamityGlobalNPC.newAI[3] = 0f; - npc.localAI[0] += 1f; - npc.TargetClosest(); - } - } + npc.TargetClosest(); } break; - }*/ + + // Phase transition animation, that's all this exists for + case (int)Phase.PhaseTransition: + + // Inverse lerp returns the percentage of progress between A and B + float lerpValue4 = Utils.InverseLerp(movementDistanceGateValue, 2400f, distanceFromDestination.Length(), true); + + // Min velocity + float minVelocity4 = distanceFromDestination.Length(); + float minVelocityCap4 = baseVelocity; + if (minVelocity4 > minVelocityCap4) + minVelocity4 = minVelocityCap4; + + // Max velocity + Vector2 maxVelocity4 = distanceFromDestination / 24f; + float maxVelocityCap4 = minVelocityCap4 * 3f; + if (maxVelocity4.Length() > maxVelocityCap4) + maxVelocity4 = distanceFromDestination.SafeNormalize(Vector2.Zero) * maxVelocityCap4; + + npc.velocity = Vector2.Lerp(distanceFromDestination.SafeNormalize(Vector2.Zero) * minVelocity4, maxVelocity4, lerpValue4); + + // Shoot lens gore at the target at the proper time + if (calamityGlobalNPC.newAI[2] == lensPopTime) + { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LargeWeaponFire"), npc.Center); + Vector2 goreVelocity = Vector2.Normalize(aimedVector); + Vector2 offset = goreVelocity * 70f; + Gore.NewGore(npc.Center + offset, goreVelocity * 24f, mod.GetGoreSlot("Gores/Apollo/ApolloTransitionGore"), 1f); + } + + // Reset phase and variables + calamityGlobalNPC.newAI[2] += 1f; + if (calamityGlobalNPC.newAI[2] >= phaseTransitionDuration) + { + pickNewLocation = true; + AIState = (float)Phase.Normal; + npc.localAI[0] = 0f; + npc.localAI[1] = 0f; + calamityGlobalNPC.newAI[2] = 0f; + calamityGlobalNPC.newAI[3] = 0f; + npc.TargetClosest(); + } + + break; + } } public override bool CanHitPlayer(Player target, ref int cooldownSlot) @@ -709,7 +880,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo if (dist4 < minDist) minDist = dist4; - return minDist <= 100f && npc.Opacity == 1f; + return minDist <= 100f && npc.Opacity == 1f && AIState == (float)Phase.ChargeCombo; } public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) => !CalamityUtils.AntiButcher(npc, ref damage, 0.5f); @@ -720,14 +891,14 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo return null; } - // Needs edits - /*public override void FindFrame(int frameHeight) + public override void FindFrame(int frameHeight) { - // Use telegraph frames when using deathrays + // Use telegraph frames before each attack + bool phase2 = npc.life / (float)npc.lifeMax < 0.6f; npc.frameCounter += 1D; - if (AIState == (float)Phase.Normal || npc.Calamity().newAI[3] == 0f) + if (AIState == (float)Phase.PhaseTransition) { - if (npc.frameCounter >= 10D) + if (npc.frameCounter >= 6D) { // Reset frame counter npc.frameCounter = 0D; @@ -735,41 +906,68 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo // Increment the Y frame frameY++; - // Reset the Y frame if greater than 8 + // Reset the Y frame if greater than 9 if (frameY == maxFramesY) { frameX++; frameY = 0; } - - // Reset the frames to frame 0 - if ((frameX * maxFramesY) + frameY > normalFrameLimit) - frameX = frameY = 0; } } else { - if (npc.frameCounter >= 10D) + if (AIState == (float)Phase.Normal) { - // Reset frame counter - npc.frameCounter = 0D; + int frameLimit = phase2 ? (npc.Calamity().newAI[3] == 0f ? normalFrameLimit_Phase2 : npc.Calamity().newAI[3] == 1f ? chargeUpFrameLimit_Phase2 : attackFrameLimit_Phase2) : + (npc.Calamity().newAI[3] == 0f ? normalFrameLimit_Phase1 : npc.Calamity().newAI[3] == 1f ? chargeUpFrameLimit_Phase1 : attackFrameLimit_Phase1); - // Increment the Y frame - frameY++; - - // Reset the Y frame if greater than 8 - if (frameY == maxFramesY) + if (npc.frameCounter >= 6D) { - frameX++; - frameY = 0; - } + // Reset frame counter + npc.frameCounter = 0D; - // Reset the frames to frame 36, the start of the deathray firing animation loop - if ((frameX * maxFramesY) + frameY > finalStageDeathrayChargeFrameLimit) - frameX = frameY = 4; + // Increment the Y frame + frameY++; + + // Reset the Y frame if greater than 9 + if (frameY == maxFramesY) + { + frameX++; + frameY = 0; + } + + // Reset the frames + int currentFrame = (frameX * maxFramesY) + frameY; + if (currentFrame > frameLimit) + frameX = frameY = phase2 ? (npc.Calamity().newAI[3] == 0f ? 6 : npc.Calamity().newAI[3] == 1f ? 7 : 8) : (npc.Calamity().newAI[3] == 0f ? 0 : npc.Calamity().newAI[3] == 1f ? 1 : 2); + } + } + else if (AIState == (float)Phase.RocketBarrage || AIState == (float)Phase.LineUpChargeCombo || AIState == (float)Phase.ChargeCombo) + { + int frameLimit = phase2 ? attackFrameLimit_Phase2 : attackFrameLimit_Phase1; + if (npc.frameCounter >= 6D) + { + // Reset frame counter + npc.frameCounter = 0D; + + // Increment the Y frame + frameY++; + + // Reset the Y frame if greater than 9 + if (frameY == maxFramesY) + { + frameX++; + frameY = 0; + } + + // Reset the frames + int currentFrame = (frameX * maxFramesY) + frameY; + if (currentFrame > frameLimit) + frameX = frameY = phase2 ? 8 : 2; + } } } - }*/ + } public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) { diff --git a/NPCs/ExoMechs/Ares/AresBody.cs b/NPCs/ExoMechs/Ares/AresBody.cs index a472205002..e464187143 100644 --- a/NPCs/ExoMechs/Ares/AresBody.cs +++ b/NPCs/ExoMechs/Ares/AresBody.cs @@ -105,7 +105,13 @@ namespace CalamityMod.NPCs.ExoMechs.Ares bossBag = ModContent.ItemType(); } - public override void SendExtraAI(BinaryWriter writer) + public override void BossHeadSlot(ref int index) + { + if (SecondaryAIState == (float)SecondaryPhase.PassiveAndImmune) + index = -1; + } + + public override void SendExtraAI(BinaryWriter writer) { writer.Write(frameX); writer.Write(frameY); @@ -323,9 +329,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares calamityGlobalNPC.newAI[3] = 0f; npc.dontTakeDamage = true; - npc.velocity.Y -= 2f; + npc.velocity.Y -= 1f; if ((double)npc.position.Y < Main.topWorld + 16f) - npc.velocity.Y -= 2f; + npc.velocity.Y -= 1f; if ((double)npc.position.Y < Main.topWorld + 16f) { @@ -348,15 +354,10 @@ namespace CalamityMod.NPCs.ExoMechs.Ares Vector2 destination = SecondaryAIState == (float)SecondaryPhase.PassiveAndImmune ? new Vector2(player.Center.X, player.Center.Y - 800f) : AIState != (float)Phase.Deathrays ? new Vector2(player.Center.X, player.Center.Y - 425f) : player.Center; // Velocity and acceleration values - float baseVelocityMult = malice ? 1.3f : death ? 1.2f : revenge ? 1.15f : expertMode ? 1.1f : 1f; - float baseVelocity = 14f * baseVelocityMult; - float baseAcceleration = 1f; + float baseVelocityMult = (berserk ? 0.5f : 0f) + (malice ? 1.3f : death ? 1.2f : revenge ? 1.15f : expertMode ? 1.1f : 1f); + float baseVelocity = 18f * baseVelocityMult; + float baseAcceleration = berserk ? 1.5f : 1f; float decelerationVelocityMult = 0.85f; - if (berserk) - { - baseVelocity *= 1.5f; - baseAcceleration *= 1.5f; - } Vector2 distanceFromDestination = destination - npc.Center; Vector2 desiredVelocity = Vector2.Normalize(distanceFromDestination) * baseVelocity; diff --git a/NPCs/ExoMechs/Ares/AresGaussNuke.cs b/NPCs/ExoMechs/Ares/AresGaussNuke.cs index b9c34def79..47315a41d7 100644 --- a/NPCs/ExoMechs/Ares/AresGaussNuke.cs +++ b/NPCs/ExoMechs/Ares/AresGaussNuke.cs @@ -222,9 +222,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares calamityGlobalNPC.newAI[2] = 0f; npc.dontTakeDamage = true; - npc.velocity.Y -= 2f; + npc.velocity.Y -= 1f; if ((double)npc.position.Y < Main.topWorld + 16f) - npc.velocity.Y -= 2f; + npc.velocity.Y -= 1f; if ((double)npc.position.Y < Main.topWorld + 16f) { @@ -247,10 +247,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares Vector2 destination = calamityGlobalNPC_Body.newAI[0] == (float)AresBody.Phase.Deathrays ? new Vector2(Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.X + 540f, Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.Y + 540f) : new Vector2(Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.X + 560f, Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.Y); // Velocity and acceleration values - float baseVelocityMult = malice ? 1.3f : death ? 1.2f : revenge ? 1.15f : expertMode ? 1.1f : 1f; - float baseVelocity = 16f * baseVelocityMult; - if (berserk) - baseVelocity *= 1.5f; + float baseVelocityMult = (berserk ? 0.5f : 0f) + (malice ? 1.3f : death ? 1.2f : revenge ? 1.15f : expertMode ? 1.1f : 1f); + float baseVelocity = 22f * baseVelocityMult; Vector2 distanceFromDestination = destination - npc.Center; diff --git a/NPCs/ExoMechs/Ares/AresLaserCannon.cs b/NPCs/ExoMechs/Ares/AresLaserCannon.cs index 89aff1c04a..b1282330a8 100644 --- a/NPCs/ExoMechs/Ares/AresLaserCannon.cs +++ b/NPCs/ExoMechs/Ares/AresLaserCannon.cs @@ -213,9 +213,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares calamityGlobalNPC.newAI[2] = 0f; npc.dontTakeDamage = true; - npc.velocity.Y -= 2f; + npc.velocity.Y -= 1f; if ((double)npc.position.Y < Main.topWorld + 16f) - npc.velocity.Y -= 2f; + npc.velocity.Y -= 1f; if ((double)npc.position.Y < Main.topWorld + 16f) { @@ -238,14 +238,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares Vector2 destination = calamityGlobalNPC_Body.newAI[0] == (float)AresBody.Phase.Deathrays ? new Vector2(Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.X - 540f, Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.Y - 540f) : new Vector2(Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.X - 560f, Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.Y); // Velocity and acceleration values - float baseVelocityMult = malice ? 1.3f : death ? 1.2f : revenge ? 1.15f : expertMode ? 1.1f : 1f; - float baseVelocity = 16f * baseVelocityMult; - float baseAcceleration = 1f; - if (berserk) - { - baseVelocity *= 1.5f; - baseAcceleration *= 1.5f; - } + float baseVelocityMult = (berserk ? 0.5f : 0f) + (malice ? 1.3f : death ? 1.2f : revenge ? 1.15f : expertMode ? 1.1f : 1f); + float baseVelocity = 22f * baseVelocityMult; + float baseAcceleration = berserk ? 1.5f : 1f; Vector2 distanceFromDestination = destination - npc.Center; Vector2 desiredVelocity = Vector2.Normalize(distanceFromDestination) * baseVelocity; diff --git a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs index 5eb5958a3b..d4be78fa6a 100644 --- a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs +++ b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs @@ -220,9 +220,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares calamityGlobalNPC.newAI[2] = 0f; npc.dontTakeDamage = true; - npc.velocity.Y -= 2f; + npc.velocity.Y -= 1f; if ((double)npc.position.Y < Main.topWorld + 16f) - npc.velocity.Y -= 2f; + npc.velocity.Y -= 1f; if ((double)npc.position.Y < Main.topWorld + 16f) { @@ -245,10 +245,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares Vector2 destination = calamityGlobalNPC_Body.newAI[0] == (float)AresBody.Phase.Deathrays ? new Vector2(Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.X + 540f, Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.Y - 540f) : new Vector2(Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.X + 375f, Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.Y + 160f); // Velocity and acceleration values - float baseVelocityMult = malice ? 1.3f : death ? 1.2f : revenge ? 1.15f : expertMode ? 1.1f : 1f; - float baseVelocity = 16f * baseVelocityMult; - if (berserk) - baseVelocity *= 1.5f; + float baseVelocityMult = (berserk ? 0.5f : 0f) + (malice ? 1.3f : death ? 1.2f : revenge ? 1.15f : expertMode ? 1.1f : 1f); + float baseVelocity = 22f * baseVelocityMult; Vector2 distanceFromDestination = destination - npc.Center; diff --git a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs index 0212975f6b..623442070a 100644 --- a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs +++ b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs @@ -220,9 +220,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares calamityGlobalNPC.newAI[2] = 0f; npc.dontTakeDamage = true; - npc.velocity.Y -= 2f; + npc.velocity.Y -= 1f; if ((double)npc.position.Y < Main.topWorld + 16f) - npc.velocity.Y -= 2f; + npc.velocity.Y -= 1f; if ((double)npc.position.Y < Main.topWorld + 16f) { @@ -245,10 +245,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares Vector2 destination = calamityGlobalNPC_Body.newAI[0] == (float)AresBody.Phase.Deathrays ? new Vector2(Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.X - 540f, Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.Y + 540f) : new Vector2(Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.X - 375f, Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center.Y + 160f); // Velocity and acceleration values - float baseVelocityMult = malice ? 1.3f : death ? 1.2f : revenge ? 1.15f : expertMode ? 1.1f : 1f; - float baseVelocity = 16f * baseVelocityMult; - if (berserk) - baseVelocity *= 1.5f; + float baseVelocityMult = (berserk ? 0.5f : 0f) + (malice ? 1.3f : death ? 1.2f : revenge ? 1.15f : expertMode ? 1.1f : 1f); + float baseVelocity = 22f * baseVelocityMult; Vector2 distanceFromDestination = destination - npc.Center; diff --git a/NPCs/ExoMechs/Artemis/Artemis.cs b/NPCs/ExoMechs/Artemis/Artemis.cs index 45e68697b1..e25a1d1faa 100644 --- a/NPCs/ExoMechs/Artemis/Artemis.cs +++ b/NPCs/ExoMechs/Artemis/Artemis.cs @@ -142,7 +142,9 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis public override void BossHeadSlot(ref int index) { - if (npc.life / (float)npc.lifeMax < 0.6f) + if (SecondaryAIState == (float)SecondaryPhase.PassiveAndImmune) + index = -1; + else if (npc.life / (float)npc.lifeMax < 0.6f) index = phase2IconIndex; else index = phase1IconIndex; @@ -350,19 +352,13 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis float movementDistanceGateValue = 100f; // Velocity and acceleration values - float baseVelocityMult = malice ? 1.3f : death ? 1.2f : revenge ? 1.15f : expertMode ? 1.1f : 1f; - float baseVelocity = 14f * baseVelocityMult; - float baseAcceleration = 1f; + float baseVelocityMult = (berserk ? 0.5f : 0f) + (malice ? 1.3f : death ? 1.2f : revenge ? 1.15f : expertMode ? 1.1f : 1f); + float baseVelocity = 18f * baseVelocityMult; float decelerationVelocityMult = 0.85f; - if (berserk) - { - baseVelocity *= 1.5f; - baseAcceleration *= 1.5f; - } // Charge variables float chargeVelocity = malice ? 60f : death ? 50f : revenge ? 45f : expertMode ? 40f : 30f; - float chargeDistance = 1800f; + float chargeDistance = 2000f; float chargeDuration = chargeDistance / chargeVelocity; bool lineUpAttack = calamityGlobalNPC.newAI[3] >= attackPhaseGateValue + 2f; bool doBigAttack = calamityGlobalNPC.newAI[3] >= attackPhaseGateValue + 2f + timeToLineUpAttack; @@ -421,9 +417,9 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis rotationDirection = 0; npc.dontTakeDamage = true; - npc.velocity.Y -= 2f; + npc.velocity.Y -= 1f; if ((double)npc.position.Y < Main.topWorld + 16f) - npc.velocity.Y -= 2f; + npc.velocity.Y -= 1f; if ((double)npc.position.Y < Main.topWorld + 16f) { @@ -465,8 +461,8 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis Vector2 distanceFromDestination = destination - npc.Center; Vector2 desiredVelocity = Vector2.Normalize(distanceFromDestination) * baseVelocity; - // Velocity during deathray spin phase - float spinVelocity = baseVelocity * 0.25f; + // Duration of deathray spin to do a full circle + float spinTime = 120f - baseVelocity * 2.5f; // Set to transition to phase 2 if it hasn't happened yet if (phase2 && npc.localAI[3] == 0f) @@ -507,7 +503,6 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis calamityGlobalNPC.newAI[2] = 0f; calamityGlobalNPC.newAI[3] = 0f; rotationDirection = 0; - npc.TargetClosest(); } } else @@ -525,7 +520,6 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis calamityGlobalNPC.newAI[2] = 0f; calamityGlobalNPC.newAI[3] = 0f; rotationDirection = 0; - npc.TargetClosest(); } // Go passive and immune if one of the other mechs is berserk @@ -540,7 +534,6 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis calamityGlobalNPC.newAI[2] = 0f; calamityGlobalNPC.newAI[3] = 0f; rotationDirection = 0; - npc.TargetClosest(); } } @@ -563,7 +556,6 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis calamityGlobalNPC.newAI[2] = 0f; calamityGlobalNPC.newAI[3] = 0f; rotationDirection = 0; - npc.TargetClosest(); } // If Artemis and Apollo are the first mechs to go berserk @@ -576,7 +568,6 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis calamityGlobalNPC.newAI[2] = 0f; calamityGlobalNPC.newAI[3] = 0f; rotationDirection = 0; - npc.TargetClosest(); // Never be passive if berserk SecondaryAIState = (float)SecondaryPhase.Nothing; @@ -602,7 +593,6 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis calamityGlobalNPC.newAI[2] = 0f; calamityGlobalNPC.newAI[3] = 0f; rotationDirection = 0; - npc.TargetClosest(); } if (berserk) @@ -614,7 +604,6 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis calamityGlobalNPC.newAI[2] = 0f; calamityGlobalNPC.newAI[3] = 0f; rotationDirection = 0; - npc.TargetClosest(); // Never be passive if berserk SecondaryAIState = (float)SecondaryPhase.Nothing; @@ -706,7 +695,6 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis calamityGlobalNPC.newAI[2] = 0f; calamityGlobalNPC.newAI[3] = 0f; chargeVelocityNormalized = default; - npc.TargetClosest(); } else { @@ -725,16 +713,15 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis if (doBigAttack) { + calamityGlobalNPC.newAI[3] = 0f; if (phase2) { AIState = npc.localAI[2] == 1f ? (float)Phase.Deathray : (float)Phase.LaserShotgun; - calamityGlobalNPC.newAI[3] = 0f; } else { // Charge until a certain distance is reached and then return to normal phase AIState = (float)Phase.Charge; - calamityGlobalNPC.newAI[3] = 0f; npc.velocity = chargeVelocityNormalized * chargeVelocity; chargeVelocityNormalized = default; } @@ -761,7 +748,6 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis pickNewLocation = true; AIState = (float)Phase.Normal; calamityGlobalNPC.newAI[2] = 0f; - npc.TargetClosest(); } } @@ -799,16 +785,20 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis int type = ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type); Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon"), npc.Center); + Vector2 laserVelocity = Vector2.Normalize(aimedVector) * 10f; - int spread = 3 + (int)(calamityGlobalNPC.newAI[2] / divisor2) * 3; + int spread = 15 + (int)(calamityGlobalNPC.newAI[2] / divisor2) * 15; float rotation = MathHelper.ToRadians(spread); float distanceFromTarget = Vector2.Distance(npc.Center, player.Center + predictionVector); + for (int i = 0; i < numLasersPerSpread + 1; i++) { - Vector2 perturbedSpeed = laserVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numLasersPerSpread - 1))); + Vector2 perturbedSpeed = laserVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numLasersPerSpread - 1))); Vector2 normalizedPerturbedSpeed = Vector2.Normalize(perturbedSpeed); + Vector2 offset = normalizedPerturbedSpeed * 70f; Vector2 newCenter = npc.Center + offset; + Projectile.NewProjectile(newCenter, newCenter + normalizedPerturbedSpeed * distanceFromTarget, type, damage, 0f, Main.myPlayer, 0f, npc.whoAmI); } } @@ -822,7 +812,6 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis AIState = (float)Phase.Normal; npc.localAI[2] = berserk ? 1f : 0f; calamityGlobalNPC.newAI[2] = 0f; - npc.TargetClosest(); } break; @@ -865,7 +854,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis rotationDirection = player.direction; // Set spin velocity - npc.velocity.X = MathHelper.Pi * spinRadius / spinVelocity; + npc.velocity.X = MathHelper.Pi * spinRadius / spinTime; npc.velocity *= -rotationDirection; npc.netUpdate = true; @@ -880,7 +869,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis } } else - npc.velocity = npc.velocity.RotatedBy(MathHelper.Pi / spinVelocity * -rotationDirection); + npc.velocity = npc.velocity.RotatedBy(MathHelper.Pi / spinTime * -rotationDirection); } } else @@ -912,7 +901,6 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis AIState = (float)Phase.Normal; npc.localAI[2] = 0f; calamityGlobalNPC.newAI[2] = 0f; - npc.TargetClosest(); } break; @@ -956,7 +944,6 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis npc.localAI[1] = 0f; calamityGlobalNPC.newAI[2] = 0f; calamityGlobalNPC.newAI[3] = 0f; - npc.TargetClosest(); } break; @@ -982,7 +969,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis if (dist4 < minDist) minDist = dist4; - return minDist <= 100f && npc.Opacity == 1f; + return minDist <= 100f && npc.Opacity == 1f && AIState == (float)Phase.Charge; } public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) => !CalamityUtils.AntiButcher(npc, ref damage, 0.5f); diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs index 2fdca2c136..5a96195aef 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs @@ -71,7 +71,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public override void BossHeadSlot(ref int index) { - if (vulnerable) + if (Main.npc[(int)npc.ai[2]].Calamity().newAI[1] == (float)ThanatosHead.SecondaryPhase.PassiveAndImmune) + index = -1; + else if (vulnerable) index = vulnerableIconIndex; else index = normalIconIndex; @@ -210,7 +212,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (npc.Calamity().newAI[0] == 0f) npc.ai[3] += 1f; - double numSegmentsAbleToFire = malice ? 30D : death ? 20D : revenge ? 17.5 : expertMode ? 15D : 10D; + double numSegmentsAbleToFire = malice ? 35D : death ? 30D : revenge ? 28D : expertMode ? 25D : 20D; if (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge && !berserk) { float divisor = 120f; @@ -278,7 +280,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos else { // This is only used in deathray phase to prevent laser spam - float segmentDivisor = (float)Math.Round(numSegments / (berserk ? 5D : numSegmentsAbleToFire)); + float segmentDivisor = (float)Math.Round(numSegments / (berserk ? numSegmentsAbleToFire * 2f : numSegmentsAbleToFire)); float divisor = npc.localAI[2] * 3f; // Ranges from 3 to 300 if ((npc.ai[3] == divisor && npc.localAI[2] % segmentDivisor == 0f) || npc.Calamity().newAI[0] > 0f) { diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs index 43f5d6c34d..e0fd2c5c98 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs @@ -71,7 +71,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public override void BossHeadSlot(ref int index) { - if (vulnerable) + if (Main.npc[(int)npc.ai[2]].Calamity().newAI[1] == (float)ThanatosHead.SecondaryPhase.PassiveAndImmune) + index = -1; + else if (vulnerable) index = vulnerableIconIndex; else index = normalIconIndex; @@ -210,7 +212,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (npc.Calamity().newAI[0] == 0f) npc.ai[3] += 1f; - double numSegmentsAbleToFire = malice ? 30D : death ? 20D : revenge ? 17.5 : expertMode ? 15D : 10D; + double numSegmentsAbleToFire = malice ? 35D : death ? 30D : revenge ? 28D : expertMode ? 25D : 20D; if (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge && !berserk) { float divisor = 120f; @@ -278,7 +280,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos else { // This is only used in deathray phase to prevent laser spam - float segmentDivisor = (float)Math.Round(numSegments / (berserk ? 5D : numSegmentsAbleToFire)); + float segmentDivisor = (float)Math.Round(numSegments / (berserk ? numSegmentsAbleToFire * 2f : numSegmentsAbleToFire)); float divisor = npc.localAI[2] * 3f; // Ranges from 3 to 300 if ((npc.ai[3] == divisor && npc.localAI[2] % segmentDivisor == 0f) || npc.Calamity().newAI[0] > 0f) { diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index cdc64402f6..cb47c82bf8 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -78,7 +78,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos private const float defaultLifeRatio = 5f; // Base distance from the target for most attacks - private const float baseDistance = 800f; + private const float baseDistance = 400f; // Base distance from target location in order to continue turning private const float baseTurnDistance = 160f; @@ -139,7 +139,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public override void BossHeadSlot(ref int index) { - if (vulnerable) + if (SecondaryAIState == (float)SecondaryPhase.PassiveAndImmune) + index = -1; + else if (vulnerable) index = vulnerableIconIndex; else index = normalIconIndex; @@ -372,9 +374,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos chargeVelocityScalar = 0f; npc.dontTakeDamage = true; - npc.velocity.Y -= 2f; + npc.velocity.Y -= 1f; if ((double)npc.position.Y < Main.topWorld + 16f) - npc.velocity.Y -= 2f; + npc.velocity.Y -= 1f; if ((double)npc.position.Y < Main.topWorld + 16f) { @@ -406,19 +408,14 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos float chargeLocationDistance = turnDistance * 0.2f; // Laser Barrage variables - float laserBarrageLocationBaseDistance = SecondaryAIState == (int)SecondaryPhase.PassiveAndImmune ? baseDistance * 1.5f : baseDistance; + float laserBarrageLocationBaseDistance = SecondaryAIState == (int)SecondaryPhase.PassiveAndImmune ? baseDistance * 2f : baseDistance; Vector2 laserBarrageLocation = new Vector2(0f, laserBarrageLocationBaseDistance); float laserBarrageLocationDistance = turnDistance * 3f; // Velocity and turn speed values - float baseVelocityMult = malice ? 1.3f : death ? 1.2f : revenge ? 1.15f : expertMode ? 1.1f : 1f; - float baseVelocity = 7f * baseVelocityMult; - float turnDegrees = baseVelocity * 0.11f; - if (berserk) - { - baseVelocity *= 1.5f; - turnDegrees *= 1.5f; - } + float baseVelocityMult = (berserk ? 0.5f : 0f) + (malice ? 1.3f : death ? 1.2f : revenge ? 1.15f : expertMode ? 1.1f : 1f); + float baseVelocity = 9f * baseVelocityMult; + float turnDegrees = baseVelocity * 0.11f * (berserk ? 1.5f : 1f); // Increase top velocity if target is dead if (targetDead) diff --git a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs index eb650d31b0..eedf364347 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs @@ -70,7 +70,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public override void BossHeadSlot(ref int index) { - if (vulnerable) + if (Main.npc[(int)npc.ai[2]].Calamity().newAI[1] == (float)ThanatosHead.SecondaryPhase.PassiveAndImmune) + index = -1; + else if (vulnerable) index = vulnerableIconIndex; else index = normalIconIndex; @@ -209,7 +211,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (npc.Calamity().newAI[0] == 0f) npc.ai[3] += 1f; - double numSegmentsAbleToFire = malice ? 30D : death ? 20D : revenge ? 17.5 : expertMode ? 15D : 10D; + double numSegmentsAbleToFire = malice ? 35D : death ? 30D : revenge ? 28D : expertMode ? 25D : 20D; if (calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge && !berserk) { float divisor = 120f; @@ -277,7 +279,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos else { // This is only used in deathray phase to prevent laser spam - float segmentDivisor = (float)Math.Round(numSegments / (berserk ? 5D : numSegmentsAbleToFire)); + float segmentDivisor = (float)Math.Round(numSegments / (berserk ? numSegmentsAbleToFire * 2f : numSegmentsAbleToFire)); float divisor = npc.localAI[2] * 3f; // Ranges from 3 to 300 if ((npc.ai[3] == divisor && npc.localAI[2] % segmentDivisor == 0f) || npc.Calamity().newAI[0] > 0f) { diff --git a/Projectiles/Boss/AresDeathBeamStart.cs b/Projectiles/Boss/AresDeathBeamStart.cs index 06d2972a3d..384861305e 100644 --- a/Projectiles/Boss/AresDeathBeamStart.cs +++ b/Projectiles/Boss/AresDeathBeamStart.cs @@ -97,7 +97,7 @@ namespace CalamityMod.Projectiles.Boss samplingPoint = vector78.Value; float[] array3 = new float[(int)num805]; - Collision.LaserScan(samplingPoint, projectile.velocity, num806 * projectile.scale, 2400f, array3); + Collision.LaserScan(samplingPoint, projectile.velocity, num806 * projectile.scale, 4800f, array3); float num807 = 0f; for (int num808 = 0; num808 < array3.Length; num808++) { @@ -108,7 +108,7 @@ namespace CalamityMod.Projectiles.Boss // Fire laser through walls at max length if target cannot be seen if (!Collision.CanHitLine(Main.npc[(int)projectile.ai[1]].Center, 1, 1, Main.player[Main.npc[(int)projectile.ai[1]].target].Center, 1, 1)) { - num807 = 2400f; + num807 = 4800f; } float amount = 0.5f; diff --git a/Projectiles/Boss/AresDeathBeamTelegraph.cs b/Projectiles/Boss/AresDeathBeamTelegraph.cs index 014f80a945..169f679782 100644 --- a/Projectiles/Boss/AresDeathBeamTelegraph.cs +++ b/Projectiles/Boss/AresDeathBeamTelegraph.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Boss public Vector2 OldVelocity; public const float TelegraphTotalTime = 240f; public const float TelegraphFadeTime = 15f; - public const float TelegraphWidth = 4200f; + public const float TelegraphWidth = 4800f; public override void SetStaticDefaults() { diff --git a/Projectiles/Boss/AresPlasmaFireball.cs b/Projectiles/Boss/AresPlasmaFireball.cs index ea79f1db14..12fb3a8163 100644 --- a/Projectiles/Boss/AresPlasmaFireball.cs +++ b/Projectiles/Boss/AresPlasmaFireball.cs @@ -48,9 +48,12 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { - Vector2 targetLocation = new Vector2(projectile.ai[0], projectile.ai[1]); - if (Vector2.Distance(targetLocation, projectile.Center) < 80f) - projectile.tileCollide = true; + if (projectile.ai[0] != -1f) + { + Vector2 targetLocation = new Vector2(projectile.ai[0], projectile.ai[1]); + if (Vector2.Distance(targetLocation, projectile.Center) < 80f) + projectile.tileCollide = true; + } int fadeInTime = 3; projectile.Opacity = MathHelper.Clamp(1f - ((projectile.timeLeft - (timeLeft - fadeInTime)) / (float)fadeInTime), 0f, 1f); @@ -157,6 +160,11 @@ namespace CalamityMod.Projectiles.Boss { // Plasma bolts int totalProjectiles = CalamityWorld.malice ? 12 : 8; + + // Reduce the total amount of projectiles by half if Apollo is shooting them + if (projectile.ai[0] == -1f) + totalProjectiles /= 2; + float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); float velocity = projectile.velocity.Length(); diff --git a/Projectiles/Boss/AresTeslaOrb.cs b/Projectiles/Boss/AresTeslaOrb.cs index 8103fff1b5..0278354c98 100644 --- a/Projectiles/Boss/AresTeslaOrb.cs +++ b/Projectiles/Boss/AresTeslaOrb.cs @@ -50,6 +50,9 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { + if (projectile.velocity.Length() < 24f) + projectile.velocity *= 1.01f; + int fadeOutTime = 15; int fadeInTime = 3; if (projectile.timeLeft < fadeOutTime) diff --git a/Projectiles/Boss/ArtemisDeathrayTelegraph.cs b/Projectiles/Boss/ArtemisDeathrayTelegraph.cs index 4e7586d93a..84786d9d37 100644 --- a/Projectiles/Boss/ArtemisDeathrayTelegraph.cs +++ b/Projectiles/Boss/ArtemisDeathrayTelegraph.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Boss public Vector2 OldVelocity; public const float TelegraphTotalTime = 60f; public const float TelegraphFadeTime = 15f; - public const float TelegraphWidth = 4200f; + public const float TelegraphWidth = 4800f; public override void SetStaticDefaults() { diff --git a/Projectiles/Boss/ArtemisLaserBeamStart.cs b/Projectiles/Boss/ArtemisLaserBeamStart.cs index db7bfe3aad..5c0a5627e7 100644 --- a/Projectiles/Boss/ArtemisLaserBeamStart.cs +++ b/Projectiles/Boss/ArtemisLaserBeamStart.cs @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Boss float arraySize = 3f; Vector2 samplingPoint = projectile.Center; float[] samples = new float[(int)arraySize]; - Collision.LaserScan(samplingPoint, projectile.velocity, projectile.width * projectile.scale, 2400f, samples); + Collision.LaserScan(samplingPoint, projectile.velocity, projectile.width * projectile.scale, 4800f, samples); float laserLength = 0f; for (int i = 0; i < samples.Length; i++) { @@ -115,7 +115,7 @@ namespace CalamityMod.Projectiles.Boss // Fire laser through walls at max length if target cannot be seen if (!Collision.CanHitLine(ThingToAttachTo.Center, 1, 1, Main.player[ThingToAttachTo.target].Center, 1, 1)) - laserLength = 2400f; + laserLength = 4800f; float amount = 0.5f; LengthOfLaser = MathHelper.Lerp(LengthOfLaser, laserLength, amount); diff --git a/Projectiles/Boss/ExoDestroyerBeamStart.cs b/Projectiles/Boss/ExoDestroyerBeamStart.cs index eed1a3bc8f..d6b5d73769 100644 --- a/Projectiles/Boss/ExoDestroyerBeamStart.cs +++ b/Projectiles/Boss/ExoDestroyerBeamStart.cs @@ -103,7 +103,7 @@ namespace CalamityMod.Projectiles.Boss float arraySize = 3f; Vector2 samplingPoint = projectile.Center; float[] samples = new float[(int)arraySize]; - Collision.LaserScan(samplingPoint, projectile.velocity, projectile.width * projectile.scale, 2400f, samples); + Collision.LaserScan(samplingPoint, projectile.velocity, projectile.width * projectile.scale, 3600f, samples); float laserLength = 0f; for (int i = 0; i < samples.Length; i++) { @@ -113,7 +113,7 @@ namespace CalamityMod.Projectiles.Boss // Fire laser through walls at max length if target cannot be seen if (!Collision.CanHitLine(ThingToAttachTo.Center, 1, 1, Main.player[ThingToAttachTo.target].Center, 1, 1)) - laserLength = 2400f; + laserLength = 3600f; float amount = 0.5f; LengthOfLaser = MathHelper.Lerp(LengthOfLaser, laserLength, amount); diff --git a/Utilities/NPCStats.cs b/Utilities/NPCStats.cs index c438832c01..b1710ab45f 100644 --- a/Utilities/NPCStats.cs +++ b/Utilities/NPCStats.cs @@ -808,7 +808,7 @@ namespace CalamityMod { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 450, 676, 712, 732, 1068 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 350, 528, 556, 572, 834 } }, - // { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 400, 600, 632, 648, 948 } }, + { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 400, 600, 632, 648, 948 } }, // { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 450, 676, 712, 732, 1068 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 500, 752, 788, 808, 1182 } }, From 75bcc0beea94e59489a1997eefabe392b3a185c8 Mon Sep 17 00:00:00 2001 From: Merkalto Date: Fri, 17 Sep 2021 11:29:29 -0500 Subject: [PATCH 79/86] silva requires ASE again, changed to push summoners and mages to pick something other than the eclipse to start out with from time to time --- Items/Armor/SilvaArmor.cs | 2 +- Items/Armor/SilvaHelmet.cs | 2 +- Items/Armor/SilvaLeggings.cs | 2 +- Items/Armor/SilvaMaskedCap.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Items/Armor/SilvaArmor.cs b/Items/Armor/SilvaArmor.cs index 2a604bd7a3..44b3d13bcb 100644 --- a/Items/Armor/SilvaArmor.cs +++ b/Items/Armor/SilvaArmor.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Armor recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddRecipeGroup("AnyGoldBar", 10); recipe.AddIngredient(ModContent.ItemType(), 12); - recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ModContent.ItemType(), 3); recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); diff --git a/Items/Armor/SilvaHelmet.cs b/Items/Armor/SilvaHelmet.cs index 18b2b1d80d..797ea91628 100644 --- a/Items/Armor/SilvaHelmet.cs +++ b/Items/Armor/SilvaHelmet.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Items.Armor recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddRecipeGroup("AnyGoldBar", 5); recipe.AddIngredient(ModContent.ItemType(), 6); - recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ModContent.ItemType(), 2); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Armor/SilvaLeggings.cs b/Items/Armor/SilvaLeggings.cs index 3c1d235802..635538e6d3 100644 --- a/Items/Armor/SilvaLeggings.cs +++ b/Items/Armor/SilvaLeggings.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Armor recipe.AddIngredient(ModContent.ItemType(), 7); recipe.AddRecipeGroup("AnyGoldBar", 7); recipe.AddIngredient(ModContent.ItemType(), 9); - recipe.AddIngredient(ModContent.ItemType(), 7); + recipe.AddIngredient(ModContent.ItemType(), 2); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Armor/SilvaMaskedCap.cs b/Items/Armor/SilvaMaskedCap.cs index 4dd57e40d3..cf23909ece 100644 --- a/Items/Armor/SilvaMaskedCap.cs +++ b/Items/Armor/SilvaMaskedCap.cs @@ -64,7 +64,7 @@ namespace CalamityMod.Items.Armor recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddRecipeGroup("AnyGoldBar", 5); recipe.AddIngredient(ModContent.ItemType(), 6); - recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ModContent.ItemType(), 2); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); From 512fba3cebaaaa02bc8d4bad771c7310fced2790 Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 17 Sep 2021 12:06:34 -0500 Subject: [PATCH 80/86] Fixed lab seeker afterimages --- Projectiles/Typeless/CyanLabSeeker.cs | 2 +- Projectiles/Typeless/GreenLabSeeker.cs | 2 +- Projectiles/Typeless/PurpleLabSeeker.cs | 2 +- Projectiles/Typeless/RedLabSeeker.cs | 8 +++++++- Projectiles/Typeless/YellowLabSeeker.cs | 2 +- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Projectiles/Typeless/CyanLabSeeker.cs b/Projectiles/Typeless/CyanLabSeeker.cs index bd33008fc6..41d77694d6 100644 --- a/Projectiles/Typeless/CyanLabSeeker.cs +++ b/Projectiles/Typeless/CyanLabSeeker.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D texture = Main.projectileTexture[projectile.type]; - if (Time > 80f) + if (Time > 80f && projectile.ai[1] == 0f) { for (int i = 0; i < 24; i += 2) { diff --git a/Projectiles/Typeless/GreenLabSeeker.cs b/Projectiles/Typeless/GreenLabSeeker.cs index b64810bfd2..e4cecb13aa 100644 --- a/Projectiles/Typeless/GreenLabSeeker.cs +++ b/Projectiles/Typeless/GreenLabSeeker.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D texture = Main.projectileTexture[projectile.type]; - if (Time > 80f) + if (Time > 80f && projectile.ai[1] == 0f) { for (int i = 0; i < 24; i += 2) { diff --git a/Projectiles/Typeless/PurpleLabSeeker.cs b/Projectiles/Typeless/PurpleLabSeeker.cs index 6f0b1b0a43..2d906043c7 100644 --- a/Projectiles/Typeless/PurpleLabSeeker.cs +++ b/Projectiles/Typeless/PurpleLabSeeker.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D texture = Main.projectileTexture[projectile.type]; - if (Time > 80f) + if (Time > 80f && projectile.ai[1] == 0f) { for (int i = 0; i < 24; i += 2) { diff --git a/Projectiles/Typeless/RedLabSeeker.cs b/Projectiles/Typeless/RedLabSeeker.cs index da6c4d8711..f7fceae72b 100644 --- a/Projectiles/Typeless/RedLabSeeker.cs +++ b/Projectiles/Typeless/RedLabSeeker.cs @@ -31,6 +31,8 @@ namespace CalamityMod.Projectiles.Typeless public static void Behavior(Projectile projectile, Vector2 destination, Color dustColor, ref float time) { + projectile.ai[1] = 0f; + if (time < 45f) projectile.velocity = Vector2.UnitY * Utils.InverseLerp(0f, 25f, time, true) * Utils.InverseLerp(30f, 25f, time, true) * -4.5f; else if (time < 80f) @@ -39,7 +41,11 @@ namespace CalamityMod.Projectiles.Typeless { if (projectile.WithinRange(destination, 420f)) { + projectile.ai[1] = 1f; projectile.velocity = Vector2.Lerp(projectile.velocity, Vector2.UnitY * (float)Math.Sin((time - 80f) / 24f) * 2.5f, 0.15f); + + if (!projectile.WithinRange(destination, 30f)) + projectile.Center = projectile.Center.MoveTowards(destination, 10f); projectile.rotation *= 0.95f; projectile.Center = Vector2.Lerp(projectile.Center, destination, 0.1f); } @@ -85,7 +91,7 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D texture = Main.projectileTexture[projectile.type]; - if (Time > 80f) + if (Time > 80f && projectile.ai[1] == 0f) { for (int i = 0; i < 24; i += 2) { diff --git a/Projectiles/Typeless/YellowLabSeeker.cs b/Projectiles/Typeless/YellowLabSeeker.cs index 231521a5c6..c73af6ad85 100644 --- a/Projectiles/Typeless/YellowLabSeeker.cs +++ b/Projectiles/Typeless/YellowLabSeeker.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D texture = Main.projectileTexture[projectile.type]; - if (Time > 80f) + if (Time > 80f && projectile.ai[1] == 0f) { for (int i = 0; i < 24; i += 2) { From d3a99e7b908897f06d942ce60afa0e9547c3621c Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 17 Sep 2021 12:08:49 -0500 Subject: [PATCH 81/86] Tainted arm fix when teleporting --- Projectiles/Melee/TaintedBladeSlasher.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Projectiles/Melee/TaintedBladeSlasher.cs b/Projectiles/Melee/TaintedBladeSlasher.cs index 30b8eace4f..52ada7ce59 100644 --- a/Projectiles/Melee/TaintedBladeSlasher.cs +++ b/Projectiles/Melee/TaintedBladeSlasher.cs @@ -189,7 +189,8 @@ namespace CalamityMod.Projectiles.Melee projectile.Center += (destination - projectile.Center).SafeNormalize(Vector2.Zero) * MathHelper.Min(projectile.Distance(destination), 12f + Owner.velocity.Length()); // Ensure that the position is never too far from the destination. - CalamityUtils.DistanceClamp(ref projectile.position, ref destination, 50f); + if (!projectile.WithinRange(destination, 300f)) + projectile.Center = destination; Time++; } From 3dc9532e0a3d2a258cb0533ce4d2dc0b18f61268 Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 17 Sep 2021 12:57:07 -0500 Subject: [PATCH 82/86] The Codebreaker allows for dynamic scaling --- UI/CodebreakerUI.cs | 67 +++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/UI/CodebreakerUI.cs b/UI/CodebreakerUI.cs index a6c826269a..7c713ddeb9 100644 --- a/UI/CodebreakerUI.cs +++ b/UI/CodebreakerUI.cs @@ -25,7 +25,8 @@ namespace CalamityMod.UI public static float CancelButtonScale = 0.75f; public static float ContactButtonScale = 1f; public static float MechIconScale = 1f; - public static readonly Vector2 BackgroundCenter = new Vector2(500f, Main.screenHeight * 0.5f); + public static Vector2 BackgroundCenter => new Vector2(500f, Main.screenHeight * 0.5f + 115f); + public static float GeneralScale => MathHelper.Lerp(1f, 0.7f, Utils.InverseLerp(1325f, 750f, Main.screenWidth, true)) * Main.UIScale; public static Rectangle MouseScreenArea => Utils.CenteredRectangle(Main.MouseScreen, Vector2.One * 2f); public static void Draw(SpriteBatch spriteBatch) @@ -45,27 +46,27 @@ namespace CalamityMod.UI // Draw the background. Texture2D backgroundTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/DraedonDecrypterBackground"); - spriteBatch.Draw(backgroundTexture, BackgroundCenter, null, Color.White, 0f, backgroundTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); + spriteBatch.Draw(backgroundTexture, BackgroundCenter, null, Color.White, 0f, backgroundTexture.Size() * 0.5f, GeneralScale, SpriteEffects.None, 0f); Rectangle backgroundArea = Utils.CenteredRectangle(BackgroundCenter, backgroundTexture.Size()); if (MouseScreenArea.Intersects(backgroundArea)) Main.blockMouse = Main.LocalPlayer.mouseInterface = true; bool canSummonDraedon = codebreakerTileEntity.ReadyToSummonDraedon && CalamityWorld.AbleToSummonDraedon; - Vector2 backgroundTopLeft = BackgroundCenter - backgroundTexture.Size() * 0.5f; + Vector2 backgroundTopLeft = BackgroundCenter - backgroundTexture.Size() * GeneralScale * 0.5f; // Draw the cell payment slot icon. Texture2D emptyCellIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/PowerCellSlot_Empty"); Texture2D occupiedCellIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/PowerCellSlot_Filled"); Texture2D textPanelTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/DraedonDecrypterScreen"); Texture2D cellTexture = codebreakerTileEntity.InputtedCellCount > 0 ? occupiedCellIconTexture : emptyCellIconTexture; - Vector2 cellDrawCenter = backgroundTopLeft + Vector2.One * 60f; + Vector2 cellDrawCenter = backgroundTopLeft + Vector2.One * GeneralScale * 60f; - Vector2 schematicSlotDrawCenter = cellDrawCenter + Vector2.UnitY * 70f; - Vector2 costDisplayLocation = schematicSlotDrawCenter + Vector2.UnitY * 20f; - Vector2 costVerificationLocation = costDisplayLocation + Vector2.UnitY * 60f; - Vector2 textPanelCenter = backgroundTopLeft + Vector2.UnitX * backgroundTexture.Width + textPanelTexture.Size() * new Vector2(-0.5f, 0.5f); - Vector2 summonButtonCenter = backgroundTopLeft + new Vector2(58f, backgroundTexture.Height - 48f); + Vector2 schematicSlotDrawCenter = cellDrawCenter + Vector2.UnitY * GeneralScale * 70f; + Vector2 costDisplayLocation = schematicSlotDrawCenter + Vector2.UnitY * GeneralScale * 20f; + Vector2 costVerificationLocation = costDisplayLocation + Vector2.UnitY * GeneralScale * 60f; + Vector2 textPanelCenter = backgroundTopLeft + Vector2.UnitX * backgroundTexture.Width + textPanelTexture.Size() * GeneralScale * new Vector2(-0.5f, 0.5f); + Vector2 summonButtonCenter = backgroundTopLeft + new Vector2(58f, backgroundTexture.Height - 48f) * GeneralScale; // Display some error text if the codebreaker isn't strong enough to decrypt the schematic. if (codebreakerTileEntity.HeldSchematicID != 0 && !codebreakerTileEntity.CanDecryptHeldSchematic) @@ -120,9 +121,9 @@ namespace CalamityMod.UI if (schematicType == ModContent.ItemType()) schematicIconTexture = ModContent.GetTexture("CalamityMod/Items/DraedonMisc/EncryptedSchematicIce"); - spriteBatch.Draw(schematicIconBG, schematicSlotDrawCenter, null, Color.White, 0f, schematicIconBG.Size() * 0.5f, 1f, SpriteEffects.None, 0f); + spriteBatch.Draw(schematicIconBG, schematicSlotDrawCenter, null, Color.White, 0f, schematicIconBG.Size() * 0.5f, GeneralScale, SpriteEffects.None, 0f); if (codebreakerTileEntity.HeldSchematicID != 0) - spriteBatch.Draw(schematicIconTexture, schematicSlotDrawCenter, null, Color.White, 0f, schematicIconTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); + spriteBatch.Draw(schematicIconTexture, schematicSlotDrawCenter, null, Color.White, 0f, schematicIconTexture.Size() * 0.5f, GeneralScale, SpriteEffects.None, 0f); HandleSchematicSlotInteractions(codebreakerTileEntity, schematicSlotDrawCenter, cellTexture.Size()); // Create a temporary item for drawing purposes. @@ -131,7 +132,7 @@ namespace CalamityMod.UI temporaryPowerCell.SetDefaults(ModContent.ItemType()); temporaryPowerCell.stack = codebreakerTileEntity.InputtedCellCount; - CalamityUtils.DrawPowercellSlot(spriteBatch, temporaryPowerCell, cellDrawCenter, 1f); + CalamityUtils.DrawPowercellSlot(spriteBatch, temporaryPowerCell, cellDrawCenter, GeneralScale); HandleCellSlotInteractions(codebreakerTileEntity, temporaryPowerCell, cellDrawCenter, cellTexture.Size()); } @@ -256,16 +257,16 @@ namespace CalamityMod.UI { // Display the cost text. string text = "Cost: "; - drawPosition.X -= 30f; - Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontMouseText, text, drawPosition.X, drawPosition.Y + 20f, Color.White * (Main.mouseTextColor / 255f), Color.Black, Vector2.Zero, 1f); + drawPosition.X -= GeneralScale * 30f; + Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontMouseText, text, drawPosition.X, drawPosition.Y + GeneralScale * 20f, Color.White * (Main.mouseTextColor / 255f), Color.Black, Vector2.Zero, GeneralScale); // And draw the cells to the right of the text. Texture2D cellTexture = ModContent.GetTexture("CalamityMod/Items/DraedonMisc/PowerCell"); - Vector2 offsetDrawPosition = new Vector2(drawPosition.X + ChatManager.GetStringSize(Main.fontMouseText, text, Vector2.One, -1f).X + 15f, drawPosition.Y + 30f); - Main.spriteBatch.Draw(cellTexture, offsetDrawPosition, null, Color.White, 0f, cellTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); + Vector2 offsetDrawPosition = new Vector2(drawPosition.X + ChatManager.GetStringSize(Main.fontMouseText, text, Vector2.One, -1f).X + GeneralScale * 15f, drawPosition.Y + GeneralScale * 30f); + Main.spriteBatch.Draw(cellTexture, offsetDrawPosition, null, Color.White, 0f, cellTexture.Size() * 0.5f, GeneralScale, SpriteEffects.None, 0f); // Display the cell quantity numerically below the drawn cells. - Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontItemStack, totalCellsCost.ToString(), offsetDrawPosition.X - 11f, offsetDrawPosition.Y, Color.White, Color.Black, new Vector2(0.3f), 0.75f); + Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontItemStack, totalCellsCost.ToString(), offsetDrawPosition.X - 11f, offsetDrawPosition.Y, Color.White, Color.Black, new Vector2(0.3f), GeneralScale * 0.75f); } public static void DrawCostVerificationButton(TECodebreaker codebreakerTileEntity, Vector2 drawPosition) @@ -298,7 +299,7 @@ namespace CalamityMod.UI VerificationButtonScale = MathHelper.Clamp(VerificationButtonScale - 0.05f, 1f, 1.35f); // Draw the confirmation icon. - Main.spriteBatch.Draw(confirmationTexture, drawPosition, null, Color.White, 0f, confirmationTexture.Size() * 0.5f, VerificationButtonScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(confirmationTexture, drawPosition, null, Color.White, 0f, confirmationTexture.Size() * 0.5f, VerificationButtonScale * GeneralScale, SpriteEffects.None, 0f); } public static void DisplayDecryptCancelButton(TECodebreaker codebreakerTileEntity, Vector2 drawPosition) @@ -342,25 +343,25 @@ namespace CalamityMod.UI } // Draw the cancel icon. - Main.spriteBatch.Draw(cancelTexture, drawPosition, null, Color.White, 0f, cancelTexture.Size() * 0.5f, CancelButtonScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(cancelTexture, drawPosition, null, Color.White, 0f, cancelTexture.Size() * 0.5f, CancelButtonScale * GeneralScale, SpriteEffects.None, 0f); } public static void DrawDecryptCancelConfirmationText(Vector2 drawPosition) { Texture2D textPanelTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/DraedonDecrypterScreen"); - Vector2 scale = new Vector2(1f, 0.3f); + Vector2 scale = new Vector2(1f, 0.3f) * GeneralScale; Main.spriteBatch.Draw(textPanelTexture, drawPosition, null, Color.White, 0f, textPanelTexture.Size() * 0.5f, scale, SpriteEffects.None, 0); string confirmationText = "Are you sure?"; - Vector2 confirmationTextPosition = drawPosition - Main.fontMouseText.MeasureString(confirmationText) * 0.5f + Vector2.UnitY * 4f; - ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, Main.fontMouseText, confirmationText, confirmationTextPosition, Color.Red, 0f, Vector2.Zero, Vector2.One); + Vector2 confirmationTextPosition = drawPosition - Main.fontMouseText.MeasureString(confirmationText) * GeneralScale * 0.5f + Vector2.UnitY * GeneralScale * 4f; + ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, Main.fontMouseText, confirmationText, confirmationTextPosition, Color.Red, 0f, Vector2.Zero, Vector2.One * GeneralScale); } public static void HandleDecryptionStuff(TECodebreaker codebreakerTileEntity, Texture2D backgroundTexture, Vector2 backgroundTopLeft, Vector2 barCenter) { Texture2D textPanelTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/DraedonDecrypterScreen"); Vector2 textPanelCenter = backgroundTopLeft + Vector2.UnitX * backgroundTexture.Width + textPanelTexture.Size() * new Vector2(-0.5f, 0.5f); - Main.spriteBatch.Draw(textPanelTexture, textPanelCenter, null, Color.White, 0f, textPanelTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(textPanelTexture, textPanelCenter, null, Color.White, 0f, textPanelTexture.Size() * 0.5f, GeneralScale, SpriteEffects.None, 0f); // Generate gibberish and use slowly insert the real text. // When decryption is done the gibberish will go away and only the underlying text will remain. @@ -390,7 +391,7 @@ namespace CalamityMod.UI if (string.IsNullOrEmpty(line)) continue; - ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, Main.fontMouseText, line, currentTextDrawPosition, Color.Cyan, 0f, Vector2.Zero, new Vector2(0.6f, 0.6f)); + ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, Main.fontMouseText, line, currentTextDrawPosition, Color.Cyan, 0f, Vector2.Zero, new Vector2(0.6f) * GeneralScale); currentTextDrawPosition.Y += 16; } @@ -402,14 +403,14 @@ namespace CalamityMod.UI // Draw a small bar at the bottom to indicate how much work is left. Texture2D borderTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/CodebreakerDecyptionBar"); Texture2D barTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/CodebreakerDecyptionBarCharge"); - Main.spriteBatch.Draw(borderTexture, barCenter, null, Color.White, 0f, borderTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(borderTexture, barCenter, null, Color.White, 0f, borderTexture.Size() * 0.5f, GeneralScale, SpriteEffects.None, 0); Rectangle barRectangle = new Rectangle(0, 0, (int)(barTexture.Width * codebreakerTileEntity.DecryptionCompletion), barTexture.Width); - Main.spriteBatch.Draw(barTexture, barCenter, barRectangle, Color.White, 0f, barTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(barTexture, barCenter, barRectangle, Color.White, 0f, barTexture.Size() * 0.5f, GeneralScale, SpriteEffects.None, 0); // Display a completion percentage below the bar as a more precise indicator. string completionText = $"{codebreakerTileEntity.DecryptionCompletion * 100f:n2}%"; - Vector2 textDrawPosition = barCenter + new Vector2(-Main.fontMouseText.MeasureString(completionText).X * 0.5f, 10f); - Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontMouseText, completionText, textDrawPosition.X, textDrawPosition.Y, Color.Cyan * 1.2f, Color.Black, Vector2.Zero, 1f); + Vector2 textDrawPosition = barCenter + new Vector2(-Main.fontMouseText.MeasureString(completionText).X * 0.5f, 10f) * GeneralScale; + Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontMouseText, completionText, textDrawPosition.X, textDrawPosition.Y, Color.Cyan * 1.2f, Color.Black, Vector2.Zero, GeneralScale); } public static void HandleDraedonSummonButton(TECodebreaker codebreakerTileEntity, Vector2 drawPosition) @@ -442,7 +443,7 @@ namespace CalamityMod.UI ContactButtonScale = MathHelper.Clamp(ContactButtonScale - 0.05f, 1f, 1.35f); // Draw the contact button. - Main.spriteBatch.Draw(contactButton, drawPosition, null, Color.White, 0f, contactButton.Size() * 0.5f, ContactButtonScale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(contactButton, drawPosition, null, Color.White, 0f, contactButton.Size() * 0.5f, ContactButtonScale * GeneralScale, SpriteEffects.None, 0f); // And display a text indicator that describes the function of the button. // The color of the text cycles through the exo mech crystal palette. @@ -450,15 +451,15 @@ namespace CalamityMod.UI Color contactTextColor = CalamityUtils.MulticolorLerp((float)Math.Cos(Main.GlobalTime * 0.7f) * 0.5f + 0.5f, CalamityUtils.ExoPalette); // Center the draw position. - drawPosition.X -= Main.fontMouseText.MeasureString(contactText).X * 0.5f; - drawPosition.Y += 20f; - Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontMouseText, contactText, drawPosition.X, drawPosition.Y, contactTextColor, Color.Black, Vector2.Zero, 1f); + drawPosition.X -= Main.fontMouseText.MeasureString(contactText).X * GeneralScale * 0.5f; + drawPosition.Y += GeneralScale * 20f; + Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontMouseText, contactText, drawPosition.X, drawPosition.Y, contactTextColor, Color.Black, Vector2.Zero, GeneralScale); } public static void DisplayNotStrongEnoughErrorText(Vector2 drawPosition) { string text = "Encryption unsolveable: Upgrades required."; - Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontMouseText, text, drawPosition.X, drawPosition.Y, Color.IndianRed * (Main.mouseTextColor / 255f), Color.Black, Vector2.Zero, 1f); + Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontMouseText, text, drawPosition.X, drawPosition.Y, Color.IndianRed * (Main.mouseTextColor / 255f), Color.Black, Vector2.Zero, GeneralScale); } } } From 8310a03e7c16257dd4866da4f2da77cd86959249 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Fri, 17 Sep 2021 13:46:15 -0500 Subject: [PATCH 83/86] 1 - Fixed exo mech name drawing issue. 2 - Fixed exo mechs spawning each other immediately. 3 - Ares tesla orbs no longer arc during deathray spin phase. --- CalPlayer/CalamityPlayerMiscEffects.cs | 51 -------------------- NPCs/ExoMechs/Apollo/Apollo.cs | 5 +- NPCs/ExoMechs/Ares/AresBody.cs | 5 +- NPCs/ExoMechs/Ares/AresGaussNuke.cs | 2 + NPCs/ExoMechs/Ares/AresLaserCannon.cs | 2 + NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs | 2 + NPCs/ExoMechs/Ares/AresTeslaCannon.cs | 4 +- NPCs/ExoMechs/Artemis/Artemis.cs | 5 +- NPCs/ExoMechs/Thanatos/ThanatosHead.cs | 3 +- Projectiles/Boss/AresTeslaOrb.cs | 7 ++- Projectiles/Boss/DarkEnergyBall.cs | 7 +++ Projectiles/Boss/DarkEnergyBall2.cs | 7 +++ Projectiles/Boss/DoGBeamPortal.cs | 7 +++ 13 files changed, 50 insertions(+), 57 deletions(-) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 7817f364c5..066b57bb34 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -161,57 +161,6 @@ namespace CalamityMod.CalPlayer { if (CalamityWorld.revenge || CalamityWorld.malice) { - // This effect is way too annoying during the fight so I disabled it - Fab - // Signus headcrab effect - /*if (CalamityGlobalNPC.signus != -1) - { - if (Main.npc[CalamityGlobalNPC.signus].active) - { - if (Vector2.Distance(player.Center, Main.npc[CalamityGlobalNPC.signus].Center) <= 5200f) - { - float signusLifeRatio = 1f - (Main.npc[CalamityGlobalNPC.signus].life / Main.npc[CalamityGlobalNPC.signus].lifeMax); - - // Reduce the power of Signus darkness based on your light level. - float multiplier = 1f; - switch (modPlayer.GetTotalLightStrength()) - { - case 0: - break; - case 1: - case 2: - multiplier = 0.75f; - break; - case 3: - case 4: - multiplier = 0.5f; - break; - case 5: - case 6: - multiplier = 0.25f; - break; - default: - multiplier = 0f; - break; - } - - // Increased darkness in Death Mode - if (CalamityWorld.death) - multiplier += (1f - multiplier) * 0.1f; - - // Total darkness - float signusDarkness = signusLifeRatio * multiplier; - - // Headcrab effect - if (!modPlayer.ZoneAbyss && !player.headcovered) - { - float screenObstructionAmt = MathHelper.Clamp(signusDarkness, 0f, 0.63f); - float targetValue = MathHelper.Clamp(screenObstructionAmt * 0.33f, 0.1f, 0.2f); - ScreenObstruction.screenObstruction = MathHelper.Lerp(ScreenObstruction.screenObstruction, screenObstructionAmt, targetValue); - } - } - } - }*/ - // Adjusts the life steal cap in rev/death float lifeStealCap = CalamityWorld.malice ? 30f : CalamityWorld.death ? 50f : 60f; /*if (Main.masterMode) diff --git a/NPCs/ExoMechs/Apollo/Apollo.cs b/NPCs/ExoMechs/Apollo/Apollo.cs index 64db2186fa..dfee0098da 100644 --- a/NPCs/ExoMechs/Apollo/Apollo.cs +++ b/NPCs/ExoMechs/Apollo/Apollo.cs @@ -182,6 +182,8 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo CalamityGlobalNPC.draedonExoMechTwinGreen = npc.whoAmI; + npc.frame = new Rectangle(npc.width * frameX, npc.height * frameY, npc.width, npc.height); + // Difficulty modes bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; bool death = CalamityWorld.death || malice; @@ -265,6 +267,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo // Phases bool phase2 = lifeRatio < 0.6f; + bool spawnOtherExoMechs = lifeRatio < 0.7f && npc.ai[3] == 0f; bool berserk = lifeRatio < 0.4f || (otherExoMechsAlive == 0 && lifeRatio < 0.7f); bool lastMechAlive = berserk && otherExoMechsAlive == 0; @@ -474,7 +477,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo // Spawn the other mechs if Artemis and Apollo are first if (otherExoMechsAlive == 0) { - if (npc.ai[3] == 0f) + if (spawnOtherExoMechs) { // Reset everything npc.ai[3] = 1f; diff --git a/NPCs/ExoMechs/Ares/AresBody.cs b/NPCs/ExoMechs/Ares/AresBody.cs index e464187143..546832aabd 100644 --- a/NPCs/ExoMechs/Ares/AresBody.cs +++ b/NPCs/ExoMechs/Ares/AresBody.cs @@ -139,6 +139,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares CalamityGlobalNPC.draedonExoMechPrime = npc.whoAmI; + npc.frame = new Rectangle(npc.width * frameX, npc.height * frameY, npc.width, npc.height); + // Difficulty modes bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; bool death = CalamityWorld.death || malice; @@ -248,6 +250,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares npc.ai[3] = 1f; // Phases + bool spawnOtherExoMechs = lifeRatio < 0.7f && npc.ai[3] == 0f; bool berserk = lifeRatio < 0.4f || (otherExoMechsAlive == 0 && lifeRatio < 0.7f); bool lastMechAlive = berserk && otherExoMechsAlive == 0; @@ -379,7 +382,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares // Spawn the other mechs if Ares is first if (otherExoMechsAlive == 0) { - if (npc.ai[3] == 0f) + if (spawnOtherExoMechs) { // Reset everything npc.ai[3] = 1f; diff --git a/NPCs/ExoMechs/Ares/AresGaussNuke.cs b/NPCs/ExoMechs/Ares/AresGaussNuke.cs index 47315a41d7..676ca04b77 100644 --- a/NPCs/ExoMechs/Ares/AresGaussNuke.cs +++ b/NPCs/ExoMechs/Ares/AresGaussNuke.cs @@ -103,6 +103,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); + npc.frame = new Rectangle(npc.width * frameX, npc.height * frameY, npc.width, npc.height); + if (CalamityGlobalNPC.draedonExoMechPrime < 0 || !Main.npc[CalamityGlobalNPC.draedonExoMechPrime].active) { npc.life = 0; diff --git a/NPCs/ExoMechs/Ares/AresLaserCannon.cs b/NPCs/ExoMechs/Ares/AresLaserCannon.cs index b1282330a8..c2c1942a35 100644 --- a/NPCs/ExoMechs/Ares/AresLaserCannon.cs +++ b/NPCs/ExoMechs/Ares/AresLaserCannon.cs @@ -101,6 +101,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); + npc.frame = new Rectangle(npc.width * frameX, npc.height * frameY, npc.width, npc.height); + if (CalamityGlobalNPC.draedonExoMechPrime < 0 || !Main.npc[CalamityGlobalNPC.draedonExoMechPrime].active) { npc.life = 0; diff --git a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs index d4be78fa6a..b2501f1689 100644 --- a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs +++ b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs @@ -101,6 +101,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); + npc.frame = new Rectangle(npc.width * frameX, npc.height * frameY, npc.width, npc.height); + if (CalamityGlobalNPC.draedonExoMechPrime < 0 || !Main.npc[CalamityGlobalNPC.draedonExoMechPrime].active) { npc.life = 0; diff --git a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs index 623442070a..bda09634a1 100644 --- a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs +++ b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs @@ -101,6 +101,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); + npc.frame = new Rectangle(npc.width * frameX, npc.height * frameY, npc.width, npc.height); + if (CalamityGlobalNPC.draedonExoMechPrime < 0 || !Main.npc[CalamityGlobalNPC.draedonExoMechPrime].active) { npc.life = 0; @@ -470,7 +472,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares return false; } - + public override bool PreNPCLoot() => false; public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/ExoMechs/Artemis/Artemis.cs b/NPCs/ExoMechs/Artemis/Artemis.cs index e25a1d1faa..1601f01f8d 100644 --- a/NPCs/ExoMechs/Artemis/Artemis.cs +++ b/NPCs/ExoMechs/Artemis/Artemis.cs @@ -190,6 +190,8 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis CalamityGlobalNPC.draedonExoMechTwinRed = npc.whoAmI; + npc.frame = new Rectangle(npc.width * frameX, npc.height * frameY, npc.width, npc.height); + // Difficulty modes bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; bool death = CalamityWorld.death || malice; @@ -276,6 +278,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis // Phases bool phase2 = lifeRatio < 0.6f; + bool spawnOtherExoMechs = lifeRatio < 0.7f && npc.ai[3] == 0f; bool berserk = lifeRatio < 0.4f || (otherExoMechsAlive == 0 && lifeRatio < 0.7f); bool lastMechAlive = berserk && otherExoMechsAlive == 0; @@ -492,7 +495,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis // Note: Only Apollo spawns the mechs because the twins HP values are linked if (otherExoMechsAlive == 0) { - if (npc.ai[3] == 0f) + if (spawnOtherExoMechs) { // Reset everything npc.ai[3] = 1f; diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index cb47c82bf8..52d489cd99 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -250,6 +250,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos npc.ai[3] = 1f; // Phases + bool spawnOtherExoMechs = lifeRatio < 0.7f && npc.ai[3] == 0f; bool berserk = lifeRatio < 0.4f || (otherExoMechsAlive == 0 && lifeRatio < 0.7f); bool lastMechAlive = berserk && otherExoMechsAlive == 0; @@ -451,7 +452,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos // Spawn the other mechs if Thanatos is first if (otherExoMechsAlive == 0) { - if (npc.ai[3] == 0f) + if (spawnOtherExoMechs) { // Reset everything npc.ai[3] = 1f; diff --git a/Projectiles/Boss/AresTeslaOrb.cs b/Projectiles/Boss/AresTeslaOrb.cs index 0278354c98..e989a46b0e 100644 --- a/Projectiles/Boss/AresTeslaOrb.cs +++ b/Projectiles/Boss/AresTeslaOrb.cs @@ -1,3 +1,5 @@ +using CalamityMod.NPCs; +using CalamityMod.NPCs.ExoMechs.Ares; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -140,9 +142,12 @@ namespace CalamityMod.Projectiles.Boss public Projectile GetOrbToAttachTo() { + if (CalamityGlobalNPC.draedonExoMechPrime < 0 || !Main.npc[CalamityGlobalNPC.draedonExoMechPrime].active) + return null; + for (int i = 0; i < Main.maxProjectiles; i++) { - if (Main.projectile[i].type != projectile.type || Main.projectile[i].ai[0] != Identity + 1f || !Main.projectile[i].active) + if (Main.projectile[i].type != projectile.type || Main.projectile[i].ai[0] != Identity + 1f || !Main.projectile[i].active || Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Calamity().newAI[0] == (float)AresBody.Phase.Deathrays) continue; return Main.projectile[i]; diff --git a/Projectiles/Boss/DarkEnergyBall.cs b/Projectiles/Boss/DarkEnergyBall.cs index 7b03090f98..a270cbb957 100644 --- a/Projectiles/Boss/DarkEnergyBall.cs +++ b/Projectiles/Boss/DarkEnergyBall.cs @@ -33,6 +33,13 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { + if (CalamityGlobalNPC.voidBoss < 0 || !Main.npc[CalamityGlobalNPC.voidBoss].active) + { + projectile.active = false; + projectile.netUpdate = true; + return; + } + if (Vector2.Distance(projectile.Center, Main.npc[CalamityGlobalNPC.voidBoss].Center) < 80f) projectile.Kill(); diff --git a/Projectiles/Boss/DarkEnergyBall2.cs b/Projectiles/Boss/DarkEnergyBall2.cs index 506d0c91af..5ff7987d43 100644 --- a/Projectiles/Boss/DarkEnergyBall2.cs +++ b/Projectiles/Boss/DarkEnergyBall2.cs @@ -35,6 +35,13 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { + if (CalamityGlobalNPC.voidBoss < 0 || !Main.npc[CalamityGlobalNPC.voidBoss].active) + { + projectile.active = false; + projectile.netUpdate = true; + return; + } + if (Vector2.Distance(projectile.Center, Main.npc[CalamityGlobalNPC.voidBoss].Center) < 80f) projectile.Kill(); diff --git a/Projectiles/Boss/DoGBeamPortal.cs b/Projectiles/Boss/DoGBeamPortal.cs index b77e467f51..58a5eeed39 100644 --- a/Projectiles/Boss/DoGBeamPortal.cs +++ b/Projectiles/Boss/DoGBeamPortal.cs @@ -45,6 +45,13 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { + if (CalamityGlobalNPC.voidBoss < 0 || !Main.npc[CalamityGlobalNPC.voidBoss].active) + { + projectile.active = false; + projectile.netUpdate = true; + return; + } + Player player = Main.player[projectile.owner]; if (start) From 8e887c0c2113bca38eee15e2f1c5e9dbcd8b6645 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Sun, 19 Sep 2021 18:25:38 -0500 Subject: [PATCH 84/86] 1 - Crabulon, Astrum Aureus and Ravager can now walk on platforms. 2 - True melee damage tooltip only displays on true melee weapons. 3 - True melee code adjustments to make it better. --- CalamityLists.cs | 69 ----------------- ILEditing/ILChanges.cs | 14 +++- Items/CalamityGlobalItem.cs | 57 +++++++++++++- Items/CalamityGlobalItemTooltip.cs | 4 +- Items/Tools/MarniteObliterator.cs | 3 +- .../DraedonsArsenal/HydraulicVoltCrasher.cs | 1 + Items/Weapons/Melee/AstralPike.cs | 3 +- Items/Weapons/Melee/Brimlance.cs | 3 +- Items/Weapons/Melee/DevilsSunrise.cs | 3 +- Items/Weapons/Melee/DiseasedPike.cs | 3 +- Items/Weapons/Melee/DragonRage.cs | 3 +- Items/Weapons/Melee/ExsanguinationLance.cs | 3 +- Items/Weapons/Melee/FulgurationHalberd.cs | 3 +- Items/Weapons/Melee/GildedProboscis.cs | 3 +- Items/Weapons/Melee/MarniteSpear.cs | 3 +- Items/Weapons/Melee/Murasama.cs | 1 + Items/Weapons/Melee/Omniblade.cs | 3 +- Items/Weapons/Melee/PhosphorescentGauntlet.cs | 1 + Items/Weapons/Melee/SausageMaker.cs | 3 +- Items/Weapons/Melee/YateveoBloom.cs | 3 +- NPCs/CalamityAI.cs | 77 +++++++++++-------- NPCs/CalamityGlobalAI.cs | 10 +-- NPCs/Crabulon/CrabulonIdle.cs | 68 ++++++++-------- NPCs/Ravager/RavagerBody.cs | 63 ++++++++------- NPCs/SupremeCalamitas/SupremeCalamitas.cs | 12 +-- NPCs/SupremeCalamitas/SupremeCataclysm.cs | 2 +- NPCs/SupremeCalamitas/SupremeCatastrophe.cs | 2 +- Projectiles/Boss/ArtemisLaserBeamStart.cs | 2 +- Projectiles/CalamityGlobalProjectile.cs | 48 +++++++++++- .../HydraulicVoltCrasherProjectile.cs | 1 + Projectiles/Melee/DevilsSunriseProj.cs | 2 +- Projectiles/Melee/DragonRageStaff.cs | 1 + Projectiles/Melee/MarniteObliteratorProj.cs | 2 +- Projectiles/Melee/MurasamaSlash.cs | 2 +- .../Melee/Spears/AmidiasTridentProj.cs | 1 - Projectiles/Melee/Spears/AstralPikeProj.cs | 2 +- Projectiles/Melee/Spears/BansheeHookProj.cs | 1 - Projectiles/Melee/Spears/BrimlanceProj.cs | 2 +- Projectiles/Melee/Spears/DiseasedPikeSpear.cs | 2 +- Projectiles/Melee/Spears/EarthenPikeSpear.cs | 1 - .../Spears/ExsanguinationLanceProjectile.cs | 2 +- .../Melee/Spears/FulgurationHalberdProj.cs | 2 +- .../Melee/Spears/GildedProboscisProj.cs | 2 +- .../Melee/Spears/GoldplumeSpearProjectile.cs | 1 - .../Spears/HellionFlowerSpearProjectile.cs | 1 - .../Melee/Spears/InsidiousImpalerProj.cs | 1 - .../Melee/Spears/MarniteSpearProjectile.cs | 2 +- Projectiles/Melee/Spears/NadirSpear.cs | 1 - Projectiles/Melee/Spears/SausageMakerSpear.cs | 2 +- .../Melee/Spears/SpatialLanceProjectile.cs | 1 - .../Melee/Spears/StarnightLanceProjectile.cs | 1 - Projectiles/Melee/Spears/StreamGougeProj.cs | 1 - .../Melee/Spears/TenebreusTidesProjectile.cs | 1 - .../Melee/Spears/TerraLanceProjectile.cs | 1 - .../Melee/Spears/UrchinSpearProjectile.cs | 1 - Projectiles/Melee/Spears/YateveoBloomSpear.cs | 2 +- Projectiles/Melee/TaintedBladeSlasher.cs | 1 + Projectiles/Typeless/YanmeisKnifeSlash.cs | 3 - 58 files changed, 285 insertions(+), 228 deletions(-) diff --git a/CalamityLists.cs b/CalamityLists.cs index a959c6f8df..28188e69eb 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -77,7 +77,6 @@ namespace CalamityMod public class CalamityLists { public static IList donatorList; - public static List trueMeleeProjectileList; // DO NOT, EVER, DELETE THIS LIST, OR I WILL COME FOR YOU :D public static List rangedProjectileExceptionList; public static List projectileDestroyExceptionList; public static List projectileMinionList; @@ -515,73 +514,6 @@ namespace CalamityMod "James" }; - trueMeleeProjectileList = new List() - { - // Vanilla shit - ProjectileID.Spear, - ProjectileID.Trident, - ProjectileID.TheRottedFork, - ProjectileID.Swordfish, - ProjectileID.Arkhalis, - ProjectileID.DarkLance, - ProjectileID.CobaltNaginata, - ProjectileID.PalladiumPike, - ProjectileID.MythrilHalberd, - ProjectileID.OrichalcumHalberd, - ProjectileID.AdamantiteGlaive, - ProjectileID.TitaniumTrident, - ProjectileID.MushroomSpear, - ProjectileID.Gungnir, - ProjectileID.ObsidianSwordfish, - ProjectileID.MonkStaffT1, - ProjectileID.MonkStaffT2, - - // Tools - ProjectileID.CobaltDrill, - ProjectileID.MythrilDrill, - ProjectileID.AdamantiteDrill, - ProjectileID.PalladiumDrill, - ProjectileID.OrichalcumDrill, - ProjectileID.TitaniumDrill, - ProjectileID.ChlorophyteDrill, - ProjectileID.CobaltChainsaw, - ProjectileID.MythrilChainsaw, - ProjectileID.AdamantiteChainsaw, - ProjectileID.PalladiumChainsaw, - ProjectileID.OrichalcumChainsaw, - ProjectileID.TitaniumChainsaw, - ProjectileID.ChlorophyteChainsaw, - ProjectileID.VortexDrill, - ProjectileID.VortexChainsaw, - ProjectileID.NebulaDrill, - ProjectileID.NebulaChainsaw, - ProjectileID.SolarFlareDrill, - ProjectileID.SolarFlareChainsaw, - ProjectileID.StardustDrill, - ProjectileID.StardustChainsaw, - ProjectileID.Hamdrax, - ProjectileID.ChlorophyteJackhammer, - ProjectileID.SawtoothShark, - ProjectileID.ButchersChainsaw, - - // Calamity shit - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType() - }; - rangedProjectileExceptionList = new List() { ProjectileID.Phantasm, @@ -2956,7 +2888,6 @@ namespace CalamityMod public static void UnloadLists() { donatorList = null; - trueMeleeProjectileList = null; rangedProjectileExceptionList = null; projectileDestroyExceptionList = null; projectileMinionList = null; diff --git a/ILEditing/ILChanges.cs b/ILEditing/ILChanges.cs index 693201e942..60c3f9ba6d 100644 --- a/ILEditing/ILChanges.cs +++ b/ILEditing/ILChanges.cs @@ -2,6 +2,9 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.CalPlayer; using CalamityMod.Events; using CalamityMod.NPCs; +using CalamityMod.NPCs.AstrumAureus; +using CalamityMod.NPCs.Crabulon; +using CalamityMod.NPCs.Ravager; using CalamityMod.Projectiles; using CalamityMod.Tiles.DraedonStructures; using CalamityMod.World; @@ -127,7 +130,7 @@ namespace CalamityMod.ILEditing IL.Terraria.Player.AddBuff += AllowBuffTimeStackingForManaBurn; // Ravager platform fall fix - + On.Terraria.NPC.Collision_DecideFallThroughPlatforms += EnableCalamityBossPlatformCollision; // Damage and health balance IL.Terraria.Main.DamageVar += AdjustDamageVariance; @@ -337,6 +340,15 @@ namespace CalamityMod.ILEditing return orig(i, j, forced); } + private static bool EnableCalamityBossPlatformCollision(On.Terraria.NPC.orig_Collision_DecideFallThroughPlatforms orig, NPC self) + { + if ((self.type == ModContent.NPCType() || self.type == ModContent.NPCType() || self.type == ModContent.NPCType()) && + self.target >= 0 && Main.player[self.target].position.Y > self.position.Y + self.height) + return true; + + return orig(self); + } + private static void DisableTeleporters(On.Terraria.Wiring.orig_Teleport orig) { if (CalamityPlayer.areThereAnyDamnBosses) diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 49382c01e9..020e63fb74 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -80,6 +80,7 @@ namespace CalamityMod.Items public bool devItem = false; public bool challengeDrop = false; public bool canFirePointBlankShots = false; + public bool trueMelee = false; // See RogueWeapon.cs for rogue modifier shit #region Modifiers @@ -204,6 +205,42 @@ namespace CalamityMod.Items canFirePointBlankShots = true; break; + // Set projectile true melee items to be true melee, this is so bosses know when the player is using a true melee projectile weapon + case ItemID.Spear: + case ItemID.Trident: + case ItemID.PalladiumPike: + case ItemID.ObsidianSwordfish: + case ItemID.CobaltDrill: + case ItemID.MythrilDrill: + case ItemID.AdamantiteDrill: + case ItemID.PalladiumDrill: + case ItemID.OrichalcumDrill: + case ItemID.TitaniumDrill: + case ItemID.ChlorophyteDrill: + case ItemID.CobaltChainsaw: + case ItemID.MythrilChainsaw: + case ItemID.AdamantiteChainsaw: + case ItemID.PalladiumChainsaw: + case ItemID.OrichalcumChainsaw: + case ItemID.TitaniumChainsaw: + case ItemID.ChlorophyteChainsaw: + case ItemID.VortexDrill: + case ItemID.VortexChainsaw: + case ItemID.NebulaDrill: + case ItemID.NebulaChainsaw: + case ItemID.SolarFlareDrill: + case ItemID.SolarFlareChainsaw: + case ItemID.StardustDrill: + case ItemID.StardustChainsaw: + case ItemID.Drax: + case ItemID.ChlorophyteJackhammer: + case ItemID.SawtoothShark: + case ItemID.Arkhalis: + case ItemID.ButchersChainsaw: + case ItemID.MonkStaffT2: + trueMelee = true; + break; + case ItemID.Dynamite: case ItemID.StickyDynamite: case ItemID.BouncyDynamite: @@ -313,6 +350,7 @@ namespace CalamityMod.Items break; case ItemID.AdamantiteGlaive: + trueMelee = true; item.damage = 65; item.shootSpeed *= 1.25f; break; @@ -322,25 +360,30 @@ namespace CalamityMod.Items break; case ItemID.CobaltNaginata: + trueMelee = true; item.damage = 90; break; case ItemID.Gungnir: + trueMelee = true; item.damage = 92; item.shootSpeed *= 1.25f; break; case ItemID.MythrilHalberd: + trueMelee = true; item.damage = 95; item.shootSpeed *= 1.25f; break; case ItemID.OrichalcumHalberd: + trueMelee = true; item.damage = 98; item.shootSpeed *= 1.25f; break; case ItemID.TitaniumTrident: + trueMelee = true; item.damage = 72; item.shootSpeed *= 1.25f; break; @@ -350,18 +393,22 @@ namespace CalamityMod.Items break; case ItemID.TheRottedFork: + trueMelee = true; item.damage = 20; break; case ItemID.Swordfish: + trueMelee = true; item.damage = 38; break; case ItemID.DarkLance: + trueMelee = true; item.damage = 68; break; case ItemID.MushroomSpear: + trueMelee = true; item.damage = 100; break; @@ -407,6 +454,7 @@ namespace CalamityMod.Items break; case ItemID.MonkStaffT1: + trueMelee = true; item.damage = 110; break; @@ -819,7 +867,7 @@ namespace CalamityMod.Items #region SavingAndLoading public override bool NeedsSaving(Item item) { - return rogue || canFirePointBlankShots || timesUsed != 0 || customRarity != 0 || Charge != 0 || reforgeTier != 0 || AppliedEnchantment.HasValue || DischargeEnchantExhaustion != 0; + return rogue || canFirePointBlankShots || trueMelee || timesUsed != 0 || customRarity != 0 || Charge != 0 || reforgeTier != 0 || AppliedEnchantment.HasValue || DischargeEnchantExhaustion != 0; } public override TagCompound Save(Item item) @@ -833,7 +881,8 @@ namespace CalamityMod.Items ["reforgeTier"] = reforgeTier, ["enchantmentID"] = AppliedEnchantment.HasValue ? AppliedEnchantment.Value.ID : 0, ["DischargeEnchantExhaustion"] = DischargeEnchantExhaustion, - ["canFirePointBlankShots"] = canFirePointBlankShots + ["canFirePointBlankShots"] = canFirePointBlankShots, + ["trueMelee"] = trueMelee }; } @@ -841,6 +890,7 @@ namespace CalamityMod.Items { rogue = tag.GetBool("rogue"); canFirePointBlankShots = tag.GetBool("canFirePointBlankShots"); + trueMelee = tag.GetBool("trueMelee"); timesUsed = tag.GetInt("timesUsed"); customRarity = (CalamityRarity)tag.GetInt("rarity"); @@ -874,6 +924,7 @@ namespace CalamityMod.Items BitsByte flags = reader.ReadByte(); rogue = flags[0]; canFirePointBlankShots = flags[1]; + trueMelee = flags[2]; } else { @@ -886,6 +937,7 @@ namespace CalamityMod.Items BitsByte flags = new BitsByte(); flags[0] = rogue; flags[1] = canFirePointBlankShots; + flags[2] = trueMelee; writer.Write(flags); writer.Write((int)customRarity); @@ -901,6 +953,7 @@ namespace CalamityMod.Items BitsByte flags = reader.ReadByte(); rogue = flags[0]; canFirePointBlankShots = flags[1]; + trueMelee = flags[2]; customRarity = (CalamityRarity)reader.ReadInt32(); timesUsed = reader.ReadInt32(); diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index 9a9e187d7f..c71b0ab10a 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -33,8 +33,8 @@ namespace CalamityMod.Items if (nameLine != null) ApplyRarityColor(item, nameLine); - // If the item is melee, add a true melee damage number adjacent to the standard damage number. - if (item.melee && item.damage > 0 && Main.LocalPlayer.Calamity().trueMeleeDamage > 0D) + // If the item is true melee, add a true melee damage number adjacent to the standard damage number. + if (item.melee && (item.shoot == ProjectileID.None || trueMelee) && item.damage > 0 && Main.LocalPlayer.Calamity().trueMeleeDamage > 0D) TrueMeleeDamageTooltip(item, tooltips); // Modify all vanilla tooltips before appending mod mechanics (if any). diff --git a/Items/Tools/MarniteObliterator.cs b/Items/Tools/MarniteObliterator.cs index 15f438f125..7c47be1e83 100644 --- a/Items/Tools/MarniteObliterator.cs +++ b/Items/Tools/MarniteObliterator.cs @@ -33,7 +33,8 @@ namespace CalamityMod.Items.Tools item.autoReuse = true; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 40f; - } + item.Calamity().trueMelee = true; + } public override void AddRecipes() { diff --git a/Items/Weapons/DraedonsArsenal/HydraulicVoltCrasher.cs b/Items/Weapons/DraedonsArsenal/HydraulicVoltCrasher.cs index a0733635b6..96311baab1 100644 --- a/Items/Weapons/DraedonsArsenal/HydraulicVoltCrasher.cs +++ b/Items/Weapons/DraedonsArsenal/HydraulicVoltCrasher.cs @@ -45,6 +45,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.melee = true; item.channel = true; + modItem.trueMelee = true; modItem.UsesCharge = true; modItem.MaxCharge = 85f; modItem.ChargePerUse = 0f; // This weapon is a holdout. Charge is consumed by the holdout projectile. diff --git a/Items/Weapons/Melee/AstralPike.cs b/Items/Weapons/Melee/AstralPike.cs index 70de4755f0..f2220b17a8 100644 --- a/Items/Weapons/Melee/AstralPike.cs +++ b/Items/Weapons/Melee/AstralPike.cs @@ -33,7 +33,8 @@ namespace CalamityMod.Items.Weapons.Melee item.rare = ItemRarityID.Cyan; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 13f; - } + item.Calamity().trueMelee = true; + } // Terraria seems to really dislike high crit values in SetDefaults public override void GetWeaponCrit(Player player, ref int crit) => crit += 25; diff --git a/Items/Weapons/Melee/Brimlance.cs b/Items/Weapons/Melee/Brimlance.cs index 81c28ce962..6f145669ee 100644 --- a/Items/Weapons/Melee/Brimlance.cs +++ b/Items/Weapons/Melee/Brimlance.cs @@ -32,7 +32,8 @@ namespace CalamityMod.Items.Weapons.Melee item.rare = ItemRarityID.Pink; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 12f; - } + item.Calamity().trueMelee = true; + } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; } diff --git a/Items/Weapons/Melee/DevilsSunrise.cs b/Items/Weapons/Melee/DevilsSunrise.cs index 9ddc1e4168..85facd6e4d 100644 --- a/Items/Weapons/Melee/DevilsSunrise.cs +++ b/Items/Weapons/Melee/DevilsSunrise.cs @@ -36,7 +36,8 @@ namespace CalamityMod.Items.Weapons.Melee item.Calamity().customRarity = CalamityRarity.Turquoise; item.Calamity().donorItem = true; - item.shoot = ModContent.ProjectileType(); + item.Calamity().trueMelee = true; + item.shoot = ModContent.ProjectileType(); item.shootSpeed = 24f; } diff --git a/Items/Weapons/Melee/DiseasedPike.cs b/Items/Weapons/Melee/DiseasedPike.cs index 096fd9403f..a7988c2481 100644 --- a/Items/Weapons/Melee/DiseasedPike.cs +++ b/Items/Weapons/Melee/DiseasedPike.cs @@ -32,7 +32,8 @@ namespace CalamityMod.Items.Weapons.Melee item.rare = ItemRarityID.Yellow; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 10f; - } + item.Calamity().trueMelee = true; + } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; } diff --git a/Items/Weapons/Melee/DragonRage.cs b/Items/Weapons/Melee/DragonRage.cs index 87d83b467d..3e2e7036c9 100644 --- a/Items/Weapons/Melee/DragonRage.cs +++ b/Items/Weapons/Melee/DragonRage.cs @@ -35,6 +35,7 @@ namespace CalamityMod.Items.Weapons.Melee item.value = CalamityGlobalItem.Rarity15BuyPrice; item.rare = ItemRarityID.Purple; item.Calamity().customRarity = CalamityRarity.Violet; - } + item.Calamity().trueMelee = true; + } } } diff --git a/Items/Weapons/Melee/ExsanguinationLance.cs b/Items/Weapons/Melee/ExsanguinationLance.cs index e142c93180..82160962de 100644 --- a/Items/Weapons/Melee/ExsanguinationLance.cs +++ b/Items/Weapons/Melee/ExsanguinationLance.cs @@ -33,7 +33,8 @@ namespace CalamityMod.Items.Weapons.Melee item.rare = ItemRarityID.Yellow; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 10f; - } + item.Calamity().trueMelee = true; + } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; diff --git a/Items/Weapons/Melee/FulgurationHalberd.cs b/Items/Weapons/Melee/FulgurationHalberd.cs index 8a9059267d..9b4dd908ec 100644 --- a/Items/Weapons/Melee/FulgurationHalberd.cs +++ b/Items/Weapons/Melee/FulgurationHalberd.cs @@ -33,7 +33,8 @@ namespace CalamityMod.Items.Weapons.Melee item.value = Item.buyPrice(0, 36, 0, 0); item.rare = ItemRarityID.Pink; item.shootSpeed = 8f; - } + item.Calamity().trueMelee = true; + } public override bool AltFunctionUse(Player player) { diff --git a/Items/Weapons/Melee/GildedProboscis.cs b/Items/Weapons/Melee/GildedProboscis.cs index e3892577bc..45e411a0e3 100644 --- a/Items/Weapons/Melee/GildedProboscis.cs +++ b/Items/Weapons/Melee/GildedProboscis.cs @@ -32,7 +32,8 @@ namespace CalamityMod.Items.Weapons.Melee item.rare = ItemRarityID.Purple; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 13f; - } + item.Calamity().trueMelee = true; + } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; } diff --git a/Items/Weapons/Melee/MarniteSpear.cs b/Items/Weapons/Melee/MarniteSpear.cs index 0084cb1ec6..214bba9f81 100644 --- a/Items/Weapons/Melee/MarniteSpear.cs +++ b/Items/Weapons/Melee/MarniteSpear.cs @@ -31,7 +31,8 @@ namespace CalamityMod.Items.Weapons.Melee item.rare = ItemRarityID.Green; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 5f; - } + item.Calamity().trueMelee = true; + } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; diff --git a/Items/Weapons/Melee/Murasama.cs b/Items/Weapons/Melee/Murasama.cs index 49d498e579..24abe58de2 100644 --- a/Items/Weapons/Melee/Murasama.cs +++ b/Items/Weapons/Melee/Murasama.cs @@ -42,6 +42,7 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 24f; item.Calamity().customRarity = CalamityRarity.Violet; Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 14)); + item.Calamity().trueMelee = true; } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Melee/Omniblade.cs b/Items/Weapons/Melee/Omniblade.cs index 566097b9bd..39fae23d88 100644 --- a/Items/Weapons/Melee/Omniblade.cs +++ b/Items/Weapons/Melee/Omniblade.cs @@ -34,7 +34,8 @@ namespace CalamityMod.Items.Weapons.Melee item.shoot = ModContent.ProjectileType(); item.shootSpeed = 24f; item.rare = ItemRarityID.Yellow; - } + item.Calamity().trueMelee = true; + } // Terraria seems to really dislike high crit values in SetDefaults public override void GetWeaponCrit(Player player, ref int crit) => crit += 45; diff --git a/Items/Weapons/Melee/PhosphorescentGauntlet.cs b/Items/Weapons/Melee/PhosphorescentGauntlet.cs index 8c977ce9b8..6c67ff0990 100644 --- a/Items/Weapons/Melee/PhosphorescentGauntlet.cs +++ b/Items/Weapons/Melee/PhosphorescentGauntlet.cs @@ -34,6 +34,7 @@ namespace CalamityMod.Items.Weapons.Melee item.shoot = ModContent.ProjectileType(); item.shootSpeed = 1f; item.Calamity().customRarity = CalamityRarity.PureGreen; + item.Calamity().trueMelee = true; } // Terraria seems to really dislike high crit values in SetDefaults. diff --git a/Items/Weapons/Melee/SausageMaker.cs b/Items/Weapons/Melee/SausageMaker.cs index bcd63e15e9..47f2b94d96 100644 --- a/Items/Weapons/Melee/SausageMaker.cs +++ b/Items/Weapons/Melee/SausageMaker.cs @@ -33,7 +33,8 @@ namespace CalamityMod.Items.Weapons.Melee item.rare = ItemRarityID.Orange; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 6f; - } + item.Calamity().trueMelee = true; + } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; diff --git a/Items/Weapons/Melee/YateveoBloom.cs b/Items/Weapons/Melee/YateveoBloom.cs index a50307d9a7..c58001d435 100644 --- a/Items/Weapons/Melee/YateveoBloom.cs +++ b/Items/Weapons/Melee/YateveoBloom.cs @@ -45,7 +45,8 @@ namespace CalamityMod.Items.Weapons.Melee item.shoot = ModContent.ProjectileType(); item.shootSpeed = ShootSpeed; - } + item.Calamity().trueMelee = true; + } public override bool AltFunctionUse(Player player) { diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index 95348faf79..20642a3efd 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -1637,7 +1637,7 @@ namespace CalamityMod.NPCs // Reduce acceleration if target is holding a true melee weapon Item targetSelectedItem = player.inventory[player.selectedItem]; - if (targetSelectedItem.melee && (targetSelectedItem.shoot == ProjectileID.None || CalamityLists.trueMeleeProjectileList.Contains(targetSelectedItem.shoot))) + if (targetSelectedItem.melee && (targetSelectedItem.shoot == ProjectileID.None || targetSelectedItem.Calamity().trueMelee)) { num824 *= 0.5f; } @@ -1753,7 +1753,7 @@ namespace CalamityMod.NPCs // Reduce acceleration if target is holding a true melee weapon Item targetSelectedItem = player.inventory[player.selectedItem]; - if (targetSelectedItem.melee && (targetSelectedItem.shoot == ProjectileID.None || CalamityLists.trueMeleeProjectileList.Contains(targetSelectedItem.shoot))) + if (targetSelectedItem.melee && (targetSelectedItem.shoot == ProjectileID.None || targetSelectedItem.Calamity().trueMelee)) { num833 *= 0.5f; } @@ -2773,7 +2773,7 @@ namespace CalamityMod.NPCs // Increase defense npc.defense = npc.defDefense; - // Stop colliding with tiles + // Stop colliding with tiles npc.noTileCollide = true; // Set AI to next phase (Walk) and reset other AI @@ -2782,8 +2782,8 @@ namespace CalamityMod.NPCs npc.ai[1] = 0f; npc.netUpdate = true; } - - CustomGravity(); + else + CustomGravity(); } // Walk @@ -2815,41 +2815,50 @@ namespace CalamityMod.NPCs npc.velocity.X = (npc.velocity.X * 20f - num823) / 21f; } - // Walk through tiles if colliding with tiles and player is out of reach - int num854 = 80; - int num855 = 20; - Vector2 position2 = new Vector2(npc.Center.X - (num854 / 2), npc.position.Y + npc.height - num855); - - bool flag52 = false; - if (npc.position.X < player.position.X && npc.position.X + npc.width > player.position.X + player.width && npc.position.Y + npc.height < player.position.Y + player.height - 16f) - flag52 = true; - - if (flag52) + if (Collision.CanHit(npc.position, npc.width, npc.height, player.Center, 1, 1) && !Collision.SolidCollision(npc.position, npc.width, npc.height) && player.position.Y <= npc.position.Y + npc.height) { - npc.velocity.Y += 0.5f; - } - else if (Collision.SolidCollision(position2, num854, num855)) - { - if (npc.velocity.Y > 0f) - npc.velocity.Y = 0f; - - if (npc.velocity.Y > -0.2) - npc.velocity.Y -= 0.025f; - else - npc.velocity.Y -= 0.2f; - - if (npc.velocity.Y < -4f) - npc.velocity.Y = -4f; + CustomGravity(); + npc.noTileCollide = false; } else { - if (npc.velocity.Y < 0f) - npc.velocity.Y = 0f; + npc.noTileCollide = true; + // Walk through tiles if colliding with tiles and player is out of reach + int num854 = 80; + int num855 = 20; + Vector2 position2 = new Vector2(npc.Center.X - (num854 / 2), npc.position.Y + npc.height - num855); - if (npc.velocity.Y < 0.1) - npc.velocity.Y += 0.025f; - else + bool flag52 = false; + if (npc.position.X < player.position.X && npc.position.X + npc.width > player.position.X + player.width && npc.position.Y + npc.height < player.position.Y + player.height - 16f) + flag52 = true; + + if (flag52) + { npc.velocity.Y += 0.5f; + } + else if (Collision.SolidCollision(position2, num854, num855)) + { + if (npc.velocity.Y > 0f) + npc.velocity.Y = 0f; + + if (npc.velocity.Y > -0.2) + npc.velocity.Y -= 0.025f; + else + npc.velocity.Y -= 0.2f; + + if (npc.velocity.Y < -4f) + npc.velocity.Y = -4f; + } + else + { + if (npc.velocity.Y < 0f) + npc.velocity.Y = 0f; + + if (npc.velocity.Y < 0.1) + npc.velocity.Y += 0.025f; + else + npc.velocity.Y += 0.5f; + } } // Walk for a maximum of 6 seconds diff --git a/NPCs/CalamityGlobalAI.cs b/NPCs/CalamityGlobalAI.cs index 2fdfc7d835..cbb87976d1 100644 --- a/NPCs/CalamityGlobalAI.cs +++ b/NPCs/CalamityGlobalAI.cs @@ -5401,7 +5401,7 @@ namespace CalamityMod.NPCs num422 = 0.175f; } // Reduce acceleration if target is holding a true melee weapon - if (targetSelectedItem.melee && (targetSelectedItem.shoot == ProjectileID.None || CalamityLists.trueMeleeProjectileList.Contains(targetSelectedItem.shoot))) + if (targetSelectedItem.melee && (targetSelectedItem.shoot == ProjectileID.None || targetSelectedItem.Calamity().trueMelee)) { num421 *= 0.75f; num422 *= 0.5f; @@ -5512,7 +5512,7 @@ namespace CalamityMod.NPCs num431 = 0.25f; } // Reduce acceleration if target is holding a true melee weapon - if (targetSelectedItem.melee && (targetSelectedItem.shoot == ProjectileID.None || CalamityLists.trueMeleeProjectileList.Contains(targetSelectedItem.shoot))) + if (targetSelectedItem.melee && (targetSelectedItem.shoot == ProjectileID.None || targetSelectedItem.Calamity().trueMelee)) { num430 *= 0.75f; num431 *= 0.5f; @@ -5974,7 +5974,7 @@ namespace CalamityMod.NPCs // Reduce acceleration if target is holding a true melee weapon Item targetSelectedItem = Main.player[npc.target].inventory[Main.player[npc.target].selectedItem]; - if (targetSelectedItem.melee && (targetSelectedItem.shoot == ProjectileID.None || CalamityLists.trueMeleeProjectileList.Contains(targetSelectedItem.shoot))) + if (targetSelectedItem.melee && (targetSelectedItem.shoot == ProjectileID.None || targetSelectedItem.Calamity().trueMelee)) { num399 *= 0.75f; num400 *= 0.5f; @@ -6084,7 +6084,7 @@ namespace CalamityMod.NPCs // Reduce acceleration if target is holding a true melee weapon Item targetSelectedItem = Main.player[npc.target].inventory[Main.player[npc.target].selectedItem]; - if (targetSelectedItem.melee && (targetSelectedItem.shoot == ProjectileID.None || CalamityLists.trueMeleeProjectileList.Contains(targetSelectedItem.shoot))) + if (targetSelectedItem.melee && (targetSelectedItem.shoot == ProjectileID.None || targetSelectedItem.Calamity().trueMelee)) { num409 *= 0.75f; num410 *= 0.5f; @@ -7409,7 +7409,7 @@ namespace CalamityMod.NPCs // Reduce acceleration if target is holding a true melee weapon Item targetSelectedItem = Main.player[npc.target].inventory[Main.player[npc.target].selectedItem]; - if (targetSelectedItem.melee && (targetSelectedItem.shoot == ProjectileID.None || CalamityLists.trueMeleeProjectileList.Contains(targetSelectedItem.shoot))) + if (targetSelectedItem.melee && (targetSelectedItem.shoot == ProjectileID.None || targetSelectedItem.Calamity().trueMelee)) { acceleration *= 0.5f; } diff --git a/NPCs/Crabulon/CrabulonIdle.cs b/NPCs/Crabulon/CrabulonIdle.cs index f3847667e7..3af7137de0 100644 --- a/NPCs/Crabulon/CrabulonIdle.cs +++ b/NPCs/Crabulon/CrabulonIdle.cs @@ -280,41 +280,49 @@ namespace CalamityMod.NPCs.Crabulon npc.velocity.X = (npc.velocity.X * 20f - num823) / 21f; } - int num854 = 80; - int num855 = 20; - Vector2 position2 = new Vector2(npc.Center.X - (num854 / 2), npc.position.Y + npc.height - num855); + if (Collision.CanHit(npc.position, npc.width, npc.height, player.Center, 1, 1) && !Collision.SolidCollision(npc.position, npc.width, npc.height) && player.position.Y <= npc.position.Y + npc.height) + { + npc.noGravity = false; + npc.noTileCollide = false; + } + else + { + npc.noGravity = true; + npc.noTileCollide = true; - bool fallDownOnTopOfTarget = npc.position.X < player.position.X && npc.position.X + npc.width > player.position.X + player.width && npc.position.Y + npc.height < player.position.Y + player.height - 16f; - if (fallDownOnTopOfTarget) - { - npc.velocity.Y += 0.5f; - } - else if (Collision.SolidCollision(position2, num854, num855)) - { - if (npc.velocity.Y > 0f) - npc.velocity.Y = 0f; + int num854 = 80; + int num855 = 20; + Vector2 position2 = new Vector2(npc.Center.X - (num854 / 2), npc.position.Y + npc.height - num855); - if (npc.velocity.Y > -0.2f) - npc.velocity.Y -= 0.025f; - else - npc.velocity.Y -= 0.2f; + bool fallDownOnTopOfTarget = npc.position.X < player.position.X && npc.position.X + npc.width > player.position.X + player.width && npc.position.Y + npc.height < player.position.Y + player.height - 16f; + if (fallDownOnTopOfTarget) + { + npc.velocity.Y += 0.5f; + } + else if (Collision.SolidCollision(position2, num854, num855)) + { + if (npc.velocity.Y > 0f) + npc.velocity.Y = 0f; - if (npc.velocity.Y < -4f) - npc.velocity.Y = -4f; - } - else - { - if (npc.velocity.Y < 0f) - npc.velocity.Y = 0f; + if (npc.velocity.Y > -0.2f) + npc.velocity.Y -= 0.025f; + else + npc.velocity.Y -= 0.2f; - if (npc.velocity.Y < 0.1f) - npc.velocity.Y += 0.025f; - else - npc.velocity.Y += 0.5f; - } + if (npc.velocity.Y < -4f) + npc.velocity.Y = -4f; + } + else + { + if (npc.velocity.Y < 0f) + npc.velocity.Y = 0f; - if (npc.ai[1] % 25f == 24f) - npc.netUpdate = true; + if (npc.velocity.Y < 0.1f) + npc.velocity.Y += 0.025f; + else + npc.velocity.Y += 0.5f; + } + } npc.ai[1] += 1f; if (npc.ai[1] >= (360f - (death ? 120f * (1f - lifeRatio) : 0f))) diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index 778a105e52..3663b12bae 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -170,6 +170,8 @@ namespace CalamityMod.NPCs.Ravager bool immunePhase = headActive || rightClawActive || leftClawActive || rightLegActive || leftLegActive; bool finalPhase = !leftClawActive && !rightClawActive && !headActive && !leftLegActive && !rightLegActive && expertMode; + bool phase2 = npc.ai[0] == 2f; + bool reduceFallSpeed = npc.velocity.Y > 0f && npc.Bottom.Y > player.Top.Y; if (immunePhase) { @@ -306,10 +308,16 @@ namespace CalamityMod.NPCs.Ravager } } - if (npc.ai[0] == 0f) - { - npc.noTileCollide = false; + if (npc.noTileCollide && !player.dead) + { + if (npc.velocity.Y > 0f && npc.Bottom.Y > player.Top.Y) + npc.noTileCollide = false; + else if (Collision.CanHit(npc.position, npc.width, npc.height, player.Center, 1, 1) && !Collision.SolidCollision(npc.position, npc.width, npc.height)) + npc.noTileCollide = false; + } + if (npc.ai[0] == 0f) + { if (npc.velocity.Y == 0f) { npc.velocity.X *= 0.8f; @@ -335,10 +343,14 @@ namespace CalamityMod.NPCs.Ravager float jumpGateValue = 180f; if (npc.ai[1] >= jumpGateValue) - npc.ai[1] = -20f; - else if (npc.ai[1] == -1f) - { - npc.TargetClosest(); + { + npc.ai[1] = -20f; + } + else if (npc.ai[1] == -1f) + { + npc.noTileCollide = true; + + npc.TargetClosest(); bool shouldFall = player.position.Y >= npc.Bottom.Y; float velocityXBoost = death ? 6f * (1f - lifeRatio) : 4f * (1f - lifeRatio); @@ -353,7 +365,7 @@ namespace CalamityMod.NPCs.Ravager if (distanceBelowTarget > 0f) calamityGlobalNPC.newAI[1] += 1f + distanceBelowTarget * multiplier; - float speedMultLimit = malice ? 4f : 3f; + float speedMultLimit = malice ? 3f : 2f; if (calamityGlobalNPC.newAI[1] > speedMultLimit) calamityGlobalNPC.newAI[1] = speedMultLimit; @@ -363,7 +375,6 @@ namespace CalamityMod.NPCs.Ravager if (expertMode && !finalPhase) { - npc.noTileCollide = true; if (shouldFall) velocityY = 1f; @@ -382,19 +393,16 @@ namespace CalamityMod.NPCs.Ravager } if (finalPhase) - { - npc.noTileCollide = true; calamityGlobalNPC.newAI[2] = player.direction; - } float playerLocation = npc.Center.X - player.Center.X; npc.direction = playerLocation < 0 ? 1 : -1; npc.velocity.X = velocityX * npc.direction; - npc.velocity.Y = velocityY; + npc.velocity.Y = velocityY; - npc.ai[0] = finalPhase ? 2f : 1f; - npc.ai[1] = 0f; + npc.ai[0] = finalPhase ? 2f : 1f; + npc.ai[1] = 0f; } } @@ -460,21 +468,12 @@ namespace CalamityMod.NPCs.Ravager } else { - // Fall through - if (!player.dead && expertMode) - { - if ((player.position.Y > npc.Bottom.Y && npc.velocity.Y > 0f) || (player.position.Y < npc.Bottom.Y && npc.velocity.Y < 0f)) - npc.noTileCollide = true; - else if ((npc.velocity.Y > 0f && npc.Bottom.Y > Main.player[npc.target].Top.Y) || (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].Center, 1, 1) && !Collision.SolidCollision(npc.position, npc.width, npc.height))) - npc.noTileCollide = false; - } - Vector2 targetVector = player.position; float aimY = targetVector.Y - 640f; float distanceFromTargetPos = Math.Abs(npc.Top.Y - aimY); bool inRange = npc.Top.Y <= aimY + 160f && npc.Top.Y >= aimY - 16f; - if (npc.ai[0] == 2f && npc.ai[1] == 0f) + if (phase2 && npc.ai[1] == 0f) { calamityGlobalNPC.newAI[3] += 1f; @@ -492,7 +491,7 @@ namespace CalamityMod.NPCs.Ravager } float maxOffset = death ? 320f * (1f - lifeRatio) : 240f * (1f - lifeRatio); - float offset = npc.ai[0] == 2f ? maxOffset * calamityGlobalNPC.newAI[2] : 0f; + float offset = phase2 ? maxOffset * calamityGlobalNPC.newAI[2] : 0f; // Set offset to 0 if the target stops moving if (Math.Abs(player.velocity.X) < 0.5f) @@ -504,7 +503,7 @@ namespace CalamityMod.NPCs.Ravager { npc.damage = npc.defDamage; - if (npc.ai[0] == 2f) + if (phase2) { float stopBeforeFallTime = malice ? 25f : 30f; if (expertMode) @@ -565,7 +564,7 @@ namespace CalamityMod.NPCs.Ravager if (!leftLegActive) velocityX += 1f; - if (npc.ai[0] == 2f) + if (phase2) { npc.damage = 0; velocityXChange *= velocityMult; @@ -589,8 +588,8 @@ namespace CalamityMod.NPCs.Ravager void CustomGravity() { - float gravity = npc.ai[0] == 2f ? 0f : 0.45f; - float maxFallSpeed = npc.ai[0] == 2f ? 24f : 15f; + float gravity = phase2 ? 0f : 0.45f; + float maxFallSpeed = reduceFallSpeed ? 12f : phase2 ? 24f : 15f; if (malice) { gravity *= 1.25f; @@ -608,14 +607,14 @@ namespace CalamityMod.NPCs.Ravager player = Main.player[npc.target]; if (npc.target <= 0 || npc.target == 255 || player.dead || !player.active) { - npc.TargetClosest(true); + npc.TargetClosest(); player = Main.player[npc.target]; } int distanceFromTarget = 5600; if (Vector2.Distance(npc.Center, player.Center) > distanceFromTarget) { - npc.TargetClosest(true); + npc.TargetClosest(); player = Main.player[npc.target]; if (Vector2.Distance(npc.Center, player.Center) > distanceFromTarget) diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index e41177f379..0682c18212 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -1367,7 +1367,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas // Reduce acceleration if target is holding a true melee weapon Item targetSelectedItem = player.inventory[player.selectedItem]; - if (targetSelectedItem.melee && (targetSelectedItem.shoot == ProjectileID.None || CalamityLists.trueMeleeProjectileList.Contains(targetSelectedItem.shoot))) + if (targetSelectedItem.melee && (targetSelectedItem.shoot == ProjectileID.None || targetSelectedItem.Calamity().trueMelee)) { num824 *= 0.5f; } @@ -1619,7 +1619,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas // Reduce acceleration if target is holding a true melee weapon Item targetSelectedItem = player.inventory[player.selectedItem]; - if (targetSelectedItem.melee && (targetSelectedItem.shoot == ProjectileID.None || CalamityLists.trueMeleeProjectileList.Contains(targetSelectedItem.shoot))) + if (targetSelectedItem.melee && (targetSelectedItem.shoot == ProjectileID.None || targetSelectedItem.Calamity().trueMelee)) { num413 *= 0.5f; } @@ -1735,7 +1735,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas // Reduce acceleration if target is holding a true melee weapon Item targetSelectedItem = player.HeldItem; - if (targetSelectedItem.melee && (targetSelectedItem.shoot == ProjectileID.None || CalamityLists.trueMeleeProjectileList.Contains(targetSelectedItem.shoot))) + if (targetSelectedItem.melee && (targetSelectedItem.shoot == ProjectileID.None || targetSelectedItem.Calamity().trueMelee)) { num833 *= 0.5f; } @@ -2021,7 +2021,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas // Reduce acceleration if target is holding a true melee weapon Item targetSelectedItem = player.inventory[player.selectedItem]; - if (targetSelectedItem.melee && (targetSelectedItem.shoot == ProjectileID.None || CalamityLists.trueMeleeProjectileList.Contains(targetSelectedItem.shoot))) + if (targetSelectedItem.melee && (targetSelectedItem.shoot == ProjectileID.None || targetSelectedItem.Calamity().trueMelee)) { num824 *= 0.5f; } @@ -2266,7 +2266,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas // Reduce acceleration if target is holding a true melee weapon Item targetSelectedItem = player.inventory[player.selectedItem]; - if (targetSelectedItem.melee && (targetSelectedItem.shoot == ProjectileID.None || CalamityLists.trueMeleeProjectileList.Contains(targetSelectedItem.shoot))) + if (targetSelectedItem.melee && (targetSelectedItem.shoot == ProjectileID.None || targetSelectedItem.Calamity().trueMelee)) { num413 *= 0.5f; } @@ -2383,7 +2383,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas // Reduce acceleration if target is holding a true melee weapon Item targetSelectedItem = player.inventory[player.selectedItem]; - if (targetSelectedItem.melee && (targetSelectedItem.shoot == ProjectileID.None || CalamityLists.trueMeleeProjectileList.Contains(targetSelectedItem.shoot))) + if (targetSelectedItem.melee && (targetSelectedItem.shoot == ProjectileID.None || targetSelectedItem.Calamity().trueMelee)) { num833 *= 0.5f; } diff --git a/NPCs/SupremeCalamitas/SupremeCataclysm.cs b/NPCs/SupremeCalamitas/SupremeCataclysm.cs index af55c1e4bf..d0e44b7c2f 100644 --- a/NPCs/SupremeCalamitas/SupremeCataclysm.cs +++ b/NPCs/SupremeCalamitas/SupremeCataclysm.cs @@ -97,7 +97,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas // Reduce acceleration if target is holding a true melee weapon Item targetSelectedItem = Main.player[npc.target].inventory[Main.player[npc.target].selectedItem]; - if (targetSelectedItem.melee && (targetSelectedItem.shoot == ProjectileID.None || CalamityLists.trueMeleeProjectileList.Contains(targetSelectedItem.shoot))) + if (targetSelectedItem.melee && (targetSelectedItem.shoot == ProjectileID.None || targetSelectedItem.Calamity().trueMelee)) { num677 *= 0.5f; } diff --git a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs index 3f626975e3..c7e8334fa4 100644 --- a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs +++ b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs @@ -97,7 +97,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas // Reduce acceleration if target is holding a true melee weapon Item targetSelectedItem = Main.player[npc.target].inventory[Main.player[npc.target].selectedItem]; - if (targetSelectedItem.melee && (targetSelectedItem.shoot == ProjectileID.None || CalamityLists.trueMeleeProjectileList.Contains(targetSelectedItem.shoot))) + if (targetSelectedItem.melee && (targetSelectedItem.shoot == ProjectileID.None || targetSelectedItem.Calamity().trueMelee)) { num677 *= 0.5f; } diff --git a/Projectiles/Boss/ArtemisLaserBeamStart.cs b/Projectiles/Boss/ArtemisLaserBeamStart.cs index 5c0a5627e7..0e1a085baf 100644 --- a/Projectiles/Boss/ArtemisLaserBeamStart.cs +++ b/Projectiles/Boss/ArtemisLaserBeamStart.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Boss // The direction of the host NPC. Vector2 hostNPCDirection = Vector2.Normalize(ThingToAttachTo.velocity); - // Offset to move the beam forward so that it starts inside the NPC's mouth. + // Offset to move the beam forward so that it starts in Artemis' focus jewel thing. float beamStartForwardsOffset = -70f; // Set the starting location of the beam to the center of the NPC. diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index a6b5708cd6..4babe3c05d 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -128,11 +128,50 @@ namespace CalamityMod.Projectiles #region SetDefaults public override void SetDefaults(Projectile projectile) { - if (CalamityLists.trueMeleeProjectileList.Contains(projectile.type)) - trueMelee = true; - switch (projectile.type) { + case ProjectileID.Spear: + case ProjectileID.Trident: + case ProjectileID.TheRottedFork: + case ProjectileID.Swordfish: + case ProjectileID.DarkLance: + case ProjectileID.CobaltNaginata: + case ProjectileID.PalladiumPike: + case ProjectileID.MythrilHalberd: + case ProjectileID.OrichalcumHalberd: + case ProjectileID.AdamantiteGlaive: + case ProjectileID.TitaniumTrident: + case ProjectileID.MushroomSpear: + case ProjectileID.Gungnir: + case ProjectileID.ObsidianSwordfish: + case ProjectileID.CobaltDrill: + case ProjectileID.MythrilDrill: + case ProjectileID.AdamantiteDrill: + case ProjectileID.PalladiumDrill: + case ProjectileID.OrichalcumDrill: + case ProjectileID.TitaniumDrill: + case ProjectileID.ChlorophyteDrill: + case ProjectileID.CobaltChainsaw: + case ProjectileID.MythrilChainsaw: + case ProjectileID.AdamantiteChainsaw: + case ProjectileID.PalladiumChainsaw: + case ProjectileID.OrichalcumChainsaw: + case ProjectileID.TitaniumChainsaw: + case ProjectileID.ChlorophyteChainsaw: + case ProjectileID.VortexDrill: + case ProjectileID.VortexChainsaw: + case ProjectileID.NebulaDrill: + case ProjectileID.NebulaChainsaw: + case ProjectileID.SolarFlareDrill: + case ProjectileID.SolarFlareChainsaw: + case ProjectileID.StardustDrill: + case ProjectileID.StardustChainsaw: + case ProjectileID.Hamdrax: + case ProjectileID.ChlorophyteJackhammer: + case ProjectileID.SawtoothShark: + trueMelee = true; + break; + case ProjectileID.Bullet: case ProjectileID.MeteorShot: case ProjectileID.BulletHighVelocity: @@ -203,10 +242,12 @@ namespace CalamityMod.Projectiles case ProjectileID.Arkhalis: case ProjectileID.ButchersChainsaw: + trueMelee = true; projectile.scale = 1.5f; break; case ProjectileID.MonkStaffT1: + trueMelee = true; projectile.scale = 3f; break; @@ -227,6 +268,7 @@ namespace CalamityMod.Projectiles break; case ProjectileID.MonkStaffT2: + trueMelee = true; projectile.idStaticNPCHitCooldown = 18; break; diff --git a/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs b/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs index 02b81cda59..16b2386702 100644 --- a/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs +++ b/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs @@ -29,6 +29,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.ownerHitCheck = true; projectile.melee = true; projectile.scale = 1.75f; + projectile.Calamity().trueMelee = true; } public override void AI() diff --git a/Projectiles/Melee/DevilsSunriseProj.cs b/Projectiles/Melee/DevilsSunriseProj.cs index 6f943b40c1..36b7919c34 100644 --- a/Projectiles/Melee/DevilsSunriseProj.cs +++ b/Projectiles/Melee/DevilsSunriseProj.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Melee projectile.ownerHitCheck = true; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 5; - //projectile.Calamity().trueMelee = true; + projectile.Calamity().trueMelee = true; } public override void AI() diff --git a/Projectiles/Melee/DragonRageStaff.cs b/Projectiles/Melee/DragonRageStaff.cs index 57c21c93f0..8fa94959c9 100644 --- a/Projectiles/Melee/DragonRageStaff.cs +++ b/Projectiles/Melee/DragonRageStaff.cs @@ -31,6 +31,7 @@ namespace CalamityMod.Projectiles.Melee projectile.hide = true; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 5; + projectile.Calamity().trueMelee = true; } public override void AI() diff --git a/Projectiles/Melee/MarniteObliteratorProj.cs b/Projectiles/Melee/MarniteObliteratorProj.cs index ae875ee8fc..f685f7f62a 100644 --- a/Projectiles/Melee/MarniteObliteratorProj.cs +++ b/Projectiles/Melee/MarniteObliteratorProj.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.Melee projectile.hide = true; projectile.ownerHitCheck = true; projectile.melee = true; - //projectile.Calamity().trueMelee = true; + projectile.Calamity().trueMelee = true; } } } diff --git a/Projectiles/Melee/MurasamaSlash.cs b/Projectiles/Melee/MurasamaSlash.cs index 80058e9f6c..ef161d7879 100644 --- a/Projectiles/Melee/MurasamaSlash.cs +++ b/Projectiles/Melee/MurasamaSlash.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Melee projectile.usesIDStaticNPCImmunity = true; projectile.idStaticNPCHitCooldown = 21; projectile.frameCounter = 0; - //projectile.Calamity().trueMelee = true; + projectile.Calamity().trueMelee = true; } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Melee/Spears/AmidiasTridentProj.cs b/Projectiles/Melee/Spears/AmidiasTridentProj.cs index e6ed3edefe..3beca2fd09 100644 --- a/Projectiles/Melee/Spears/AmidiasTridentProj.cs +++ b/Projectiles/Melee/Spears/AmidiasTridentProj.cs @@ -25,7 +25,6 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.penetrate = -1; projectile.ownerHitCheck = true; projectile.hide = true; - //projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 3f; diff --git a/Projectiles/Melee/Spears/AstralPikeProj.cs b/Projectiles/Melee/Spears/AstralPikeProj.cs index 4a9f04712d..94ca091c53 100644 --- a/Projectiles/Melee/Spears/AstralPikeProj.cs +++ b/Projectiles/Melee/Spears/AstralPikeProj.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ignoreWater = true; projectile.penetrate = -1; projectile.ownerHitCheck = true; - //projectile.Calamity().trueMelee = true; + projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 3f; diff --git a/Projectiles/Melee/Spears/BansheeHookProj.cs b/Projectiles/Melee/Spears/BansheeHookProj.cs index 90d4974778..3b95119831 100644 --- a/Projectiles/Melee/Spears/BansheeHookProj.cs +++ b/Projectiles/Melee/Spears/BansheeHookProj.cs @@ -30,7 +30,6 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 5; projectile.alpha = 255; - //projectile.Calamity().trueMelee = true; } public override SpearType SpearAiType => SpearType.GhastlyGlaiveSpear; diff --git a/Projectiles/Melee/Spears/BrimlanceProj.cs b/Projectiles/Melee/Spears/BrimlanceProj.cs index 4d75f0be6e..e256a4389d 100644 --- a/Projectiles/Melee/Spears/BrimlanceProj.cs +++ b/Projectiles/Melee/Spears/BrimlanceProj.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.penetrate = -1; projectile.ownerHitCheck = true; projectile.hide = true; - //projectile.Calamity().trueMelee = true; + projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 3f; diff --git a/Projectiles/Melee/Spears/DiseasedPikeSpear.cs b/Projectiles/Melee/Spears/DiseasedPikeSpear.cs index c320e0737f..5dad1b6d03 100644 --- a/Projectiles/Melee/Spears/DiseasedPikeSpear.cs +++ b/Projectiles/Melee/Spears/DiseasedPikeSpear.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ignoreWater = true; projectile.penetrate = -1; projectile.ownerHitCheck = true; - //projectile.Calamity().trueMelee = true; + projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 3f; diff --git a/Projectiles/Melee/Spears/EarthenPikeSpear.cs b/Projectiles/Melee/Spears/EarthenPikeSpear.cs index 6f70ba1bbd..7bb7360f06 100644 --- a/Projectiles/Melee/Spears/EarthenPikeSpear.cs +++ b/Projectiles/Melee/Spears/EarthenPikeSpear.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ignoreWater = true; projectile.penetrate = -1; projectile.ownerHitCheck = true; - //projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 3f; diff --git a/Projectiles/Melee/Spears/ExsanguinationLanceProjectile.cs b/Projectiles/Melee/Spears/ExsanguinationLanceProjectile.cs index ad14606432..52303501c0 100644 --- a/Projectiles/Melee/Spears/ExsanguinationLanceProjectile.cs +++ b/Projectiles/Melee/Spears/ExsanguinationLanceProjectile.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ignoreWater = true; projectile.penetrate = -1; projectile.ownerHitCheck = true; - //projectile.Calamity().trueMelee = true; + projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 3f; public override float ReelbackSpeed => 2.4f; diff --git a/Projectiles/Melee/Spears/FulgurationHalberdProj.cs b/Projectiles/Melee/Spears/FulgurationHalberdProj.cs index 91551c48ee..67a26ee483 100644 --- a/Projectiles/Melee/Spears/FulgurationHalberdProj.cs +++ b/Projectiles/Melee/Spears/FulgurationHalberdProj.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ignoreWater = true; projectile.penetrate = -1; projectile.ownerHitCheck = true; - //projectile.Calamity().trueMelee = true; + projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 3f; diff --git a/Projectiles/Melee/Spears/GildedProboscisProj.cs b/Projectiles/Melee/Spears/GildedProboscisProj.cs index 4526ffab88..a32f26c39c 100644 --- a/Projectiles/Melee/Spears/GildedProboscisProj.cs +++ b/Projectiles/Melee/Spears/GildedProboscisProj.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ownerHitCheck = true; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 4; - //projectile.Calamity().trueMelee = true; + projectile.Calamity().trueMelee = true; } // These numbers sure are common, huh? yeah, they are diff --git a/Projectiles/Melee/Spears/GoldplumeSpearProjectile.cs b/Projectiles/Melee/Spears/GoldplumeSpearProjectile.cs index 49bd3f8949..784facd3d5 100644 --- a/Projectiles/Melee/Spears/GoldplumeSpearProjectile.cs +++ b/Projectiles/Melee/Spears/GoldplumeSpearProjectile.cs @@ -23,7 +23,6 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ignoreWater = true; projectile.penetrate = -1; projectile.ownerHitCheck = true; - //projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 3f; diff --git a/Projectiles/Melee/Spears/HellionFlowerSpearProjectile.cs b/Projectiles/Melee/Spears/HellionFlowerSpearProjectile.cs index 2405eb9ebe..b7080ec2c9 100644 --- a/Projectiles/Melee/Spears/HellionFlowerSpearProjectile.cs +++ b/Projectiles/Melee/Spears/HellionFlowerSpearProjectile.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ignoreWater = true; projectile.penetrate = -1; projectile.ownerHitCheck = true; - //projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 3f; diff --git a/Projectiles/Melee/Spears/InsidiousImpalerProj.cs b/Projectiles/Melee/Spears/InsidiousImpalerProj.cs index ebca48c63d..dfec53513a 100644 --- a/Projectiles/Melee/Spears/InsidiousImpalerProj.cs +++ b/Projectiles/Melee/Spears/InsidiousImpalerProj.cs @@ -28,7 +28,6 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ownerHitCheck = true; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 5; - //projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 3f; diff --git a/Projectiles/Melee/Spears/MarniteSpearProjectile.cs b/Projectiles/Melee/Spears/MarniteSpearProjectile.cs index 6cbde975c3..4f8192da22 100644 --- a/Projectiles/Melee/Spears/MarniteSpearProjectile.cs +++ b/Projectiles/Melee/Spears/MarniteSpearProjectile.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ignoreWater = true; projectile.penetrate = -1; projectile.ownerHitCheck = true; - //projectile.Calamity().trueMelee = true; + projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 3f; diff --git a/Projectiles/Melee/Spears/NadirSpear.cs b/Projectiles/Melee/Spears/NadirSpear.cs index 61e4138a06..2c3ba98ec3 100644 --- a/Projectiles/Melee/Spears/NadirSpear.cs +++ b/Projectiles/Melee/Spears/NadirSpear.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.penetrate = -1; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 4; - //projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 5.5f; diff --git a/Projectiles/Melee/Spears/SausageMakerSpear.cs b/Projectiles/Melee/Spears/SausageMakerSpear.cs index c375b431af..d2f7c8499f 100644 --- a/Projectiles/Melee/Spears/SausageMakerSpear.cs +++ b/Projectiles/Melee/Spears/SausageMakerSpear.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ignoreWater = true; projectile.penetrate = -1; projectile.ownerHitCheck = true; - //projectile.Calamity().trueMelee = true; + projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 3f; diff --git a/Projectiles/Melee/Spears/SpatialLanceProjectile.cs b/Projectiles/Melee/Spears/SpatialLanceProjectile.cs index bd0454caaa..37cae1e3fa 100644 --- a/Projectiles/Melee/Spears/SpatialLanceProjectile.cs +++ b/Projectiles/Melee/Spears/SpatialLanceProjectile.cs @@ -30,7 +30,6 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ownerHitCheck = true; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 7; - //projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 3f; diff --git a/Projectiles/Melee/Spears/StarnightLanceProjectile.cs b/Projectiles/Melee/Spears/StarnightLanceProjectile.cs index 2ffb51c4fb..083414ef43 100644 --- a/Projectiles/Melee/Spears/StarnightLanceProjectile.cs +++ b/Projectiles/Melee/Spears/StarnightLanceProjectile.cs @@ -25,7 +25,6 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ignoreWater = true; projectile.penetrate = -1; projectile.ownerHitCheck = true; - //projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 3f; diff --git a/Projectiles/Melee/Spears/StreamGougeProj.cs b/Projectiles/Melee/Spears/StreamGougeProj.cs index 9096c3e3ee..c4a0b6fd58 100644 --- a/Projectiles/Melee/Spears/StreamGougeProj.cs +++ b/Projectiles/Melee/Spears/StreamGougeProj.cs @@ -30,7 +30,6 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.hide = true; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 5; - //projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 3f; diff --git a/Projectiles/Melee/Spears/TenebreusTidesProjectile.cs b/Projectiles/Melee/Spears/TenebreusTidesProjectile.cs index 755b3b173d..1713ccaee7 100644 --- a/Projectiles/Melee/Spears/TenebreusTidesProjectile.cs +++ b/Projectiles/Melee/Spears/TenebreusTidesProjectile.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ignoreWater = true; projectile.penetrate = -1; projectile.ownerHitCheck = true; - //projectile.Calamity().trueMelee = true; projectile.usesIDStaticNPCImmunity = true; projectile.idStaticNPCHitCooldown = 15; } diff --git a/Projectiles/Melee/Spears/TerraLanceProjectile.cs b/Projectiles/Melee/Spears/TerraLanceProjectile.cs index 1353d9b72c..7172dcf6ab 100644 --- a/Projectiles/Melee/Spears/TerraLanceProjectile.cs +++ b/Projectiles/Melee/Spears/TerraLanceProjectile.cs @@ -24,7 +24,6 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ignoreWater = true; projectile.penetrate = -1; projectile.ownerHitCheck = true; - //projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 3f; diff --git a/Projectiles/Melee/Spears/UrchinSpearProjectile.cs b/Projectiles/Melee/Spears/UrchinSpearProjectile.cs index 0157170e2b..9401b5637c 100644 --- a/Projectiles/Melee/Spears/UrchinSpearProjectile.cs +++ b/Projectiles/Melee/Spears/UrchinSpearProjectile.cs @@ -25,7 +25,6 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ignoreWater = true; projectile.penetrate = -1; projectile.ownerHitCheck = true; - //projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 3f; diff --git a/Projectiles/Melee/Spears/YateveoBloomSpear.cs b/Projectiles/Melee/Spears/YateveoBloomSpear.cs index 5220848d6b..9da2f9ca74 100644 --- a/Projectiles/Melee/Spears/YateveoBloomSpear.cs +++ b/Projectiles/Melee/Spears/YateveoBloomSpear.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ignoreWater = true; projectile.penetrate = -1; projectile.ownerHitCheck = true; - //projectile.Calamity().trueMelee = true; + projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 3f; diff --git a/Projectiles/Melee/TaintedBladeSlasher.cs b/Projectiles/Melee/TaintedBladeSlasher.cs index 52ada7ce59..e09d257afe 100644 --- a/Projectiles/Melee/TaintedBladeSlasher.cs +++ b/Projectiles/Melee/TaintedBladeSlasher.cs @@ -118,6 +118,7 @@ namespace CalamityMod.Projectiles.Melee projectile.timeLeft = 90000; projectile.usesLocalNPCImmunity = true; projectile.noEnchantments = true; + projectile.Calamity().trueMelee = true; } public override void SendExtraAI(BinaryWriter writer) => writer.Write(VerticalOffset); diff --git a/Projectiles/Typeless/YanmeisKnifeSlash.cs b/Projectiles/Typeless/YanmeisKnifeSlash.cs index 346fbfc9d2..0ea7c02233 100644 --- a/Projectiles/Typeless/YanmeisKnifeSlash.cs +++ b/Projectiles/Typeless/YanmeisKnifeSlash.cs @@ -51,9 +51,6 @@ namespace CalamityMod.Projectiles.Typeless projectile.ownerHitCheck = true; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 20; - - // Not considered true melee to prevent Titan Scale from triggering. - // projectile.Calamity().trueMelee = true; } public override void AI() From 2db13042b150484ba30a87a7d7f0a192d45411e2 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Mon, 20 Sep 2021 10:26:51 -0500 Subject: [PATCH 85/86] 1 - Ravager collides with platforms properly. --- NPCs/CalamityAI.cs | 5 +++-- NPCs/CalamityGlobalAI.cs | 35 +++++++++++++++++------------------ NPCs/Ravager/RavagerBody.cs | 6 ++++-- 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index 20642a3efd..e2a57dea9c 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -2616,6 +2616,7 @@ namespace CalamityMod.NPCs // Phases bool phase2 = lifeRatio < 0.75f; bool phase3 = lifeRatio < 0.5f; + bool reduceFallSpeed = npc.velocity.Y > 0f && npc.Bottom.Y > player.Top.Y && npc.ai[0] == 4f; bool despawnDistance = Vector2.Distance(player.Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance350Tiles; @@ -3213,9 +3214,9 @@ namespace CalamityMod.NPCs void CustomGravity() { float gravity = 0.36f + 0.12f * enrageScale; - float maxFallSpeed = 12f + 4f * enrageScale; + float maxFallSpeed = reduceFallSpeed ? 12f : 12f + 4f * enrageScale; - if (calamityGlobalNPC.newAI[0] > 1f) + if (calamityGlobalNPC.newAI[0] > 1f && !reduceFallSpeed) maxFallSpeed *= calamityGlobalNPC.newAI[0]; npc.velocity.Y += gravity; diff --git a/NPCs/CalamityGlobalAI.cs b/NPCs/CalamityGlobalAI.cs index cbb87976d1..ef2984b464 100644 --- a/NPCs/CalamityGlobalAI.cs +++ b/NPCs/CalamityGlobalAI.cs @@ -9896,8 +9896,10 @@ namespace CalamityMod.NPCs npc.Calamity().CurrentlyEnraged = (!BossRushEvent.BossRushActive && (enrage || turboEnrage)) || enraged; - // Alpha - if (npc.alpha > 0) + bool reduceFallSpeed = npc.velocity.Y > 0f && npc.Bottom.Y > Main.player[npc.target].Top.Y; + + // Alpha + if (npc.alpha > 0) { npc.alpha -= 10; if (npc.alpha < 0) @@ -9959,11 +9961,17 @@ namespace CalamityMod.NPCs } } - // Jump - if (npc.ai[0] == 0f) - { - npc.noTileCollide = false; + if (npc.noTileCollide && !Main.player[npc.target].dead) + { + if (npc.velocity.Y > 0f && npc.Bottom.Y > Main.player[npc.target].Top.Y) + npc.noTileCollide = false; + else if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].Center, 1, 1) && !Collision.SolidCollision(npc.position, npc.width, npc.height)) + npc.noTileCollide = false; + } + // Jump + if (npc.ai[0] == 0f) + { if (npc.velocity.Y == 0f) { // Laser fire when head is dead @@ -10145,15 +10153,6 @@ namespace CalamityMod.NPCs } else { - // Fall through - if (!Main.player[npc.target].dead) - { - if ((Main.player[npc.target].position.Y > npc.Bottom.Y && npc.velocity.Y > 0f) || (Main.player[npc.target].position.Y < npc.Bottom.Y && npc.velocity.Y < 0f)) - npc.noTileCollide = true; - else if ((npc.velocity.Y > 0f && npc.Bottom.Y > Main.player[npc.target].Top.Y) || (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].Center, 1, 1) && !Collision.SolidCollision(npc.position, npc.width, npc.height))) - npc.noTileCollide = false; - } - // Velocity when falling if (npc.position.X < Main.player[npc.target].position.X && npc.position.X + npc.width > Main.player[npc.target].position.X + Main.player[npc.target].width) { @@ -10195,9 +10194,9 @@ namespace CalamityMod.NPCs void CustomGravity() { float gravity = turboEnrage ? 0.9f : enrage ? 0.6f : (!flag41 && !flag42) ? 0.45f : 0.3f; - float maxFallSpeed = turboEnrage ? 30f : enrage ? 20f : (!flag41 && !flag42) ? 15f : 10f; + float maxFallSpeed = reduceFallSpeed ? 12f : turboEnrage ? 30f : enrage ? 20f : (!flag41 && !flag42) ? 15f : 10f; - if (calamityGlobalNPC.newAI[0] > 1f) + if (calamityGlobalNPC.newAI[0] > 1f && !reduceFallSpeed) maxFallSpeed *= calamityGlobalNPC.newAI[0]; npc.velocity.Y += gravity; @@ -10524,7 +10523,7 @@ namespace CalamityMod.NPCs if (enraged) turboEnrage = true; - if (turboEnrage) + if (turboEnrage && NPC.golemBoss >= 0) { npc.Calamity().DR = 0.9999f; npc.Calamity().unbreakableDR = true; diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index 3663b12bae..1e22acec8b 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -475,6 +475,8 @@ namespace CalamityMod.NPCs.Ravager if (phase2 && npc.ai[1] == 0f) { + npc.noTileCollide = true; + calamityGlobalNPC.newAI[3] += 1f; if (inRange) @@ -590,13 +592,13 @@ namespace CalamityMod.NPCs.Ravager { float gravity = phase2 ? 0f : 0.45f; float maxFallSpeed = reduceFallSpeed ? 12f : phase2 ? 24f : 15f; - if (malice) + if (malice && !reduceFallSpeed) { gravity *= 1.25f; maxFallSpeed *= 1.25f; } - if (calamityGlobalNPC.newAI[1] > 1f) + if (calamityGlobalNPC.newAI[1] > 1f && !reduceFallSpeed) maxFallSpeed *= calamityGlobalNPC.newAI[1]; npc.velocity.Y += gravity; From 343920a08d81341c48e98de2ad5271102f904320 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Mon, 20 Sep 2021 12:43:35 -0500 Subject: [PATCH 86/86] 1 - Slime God slimes fall faster now. --- NPCs/SlimeGod/SlimeGod.cs | 4 ++-- NPCs/SlimeGod/SlimeGodRun.cs | 4 ++-- NPCs/SlimeGod/SlimeGodRunSplit.cs | 4 ++-- NPCs/SlimeGod/SlimeGodSplit.cs | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/NPCs/SlimeGod/SlimeGod.cs b/NPCs/SlimeGod/SlimeGod.cs index 357538eb2a..b134405e8b 100644 --- a/NPCs/SlimeGod/SlimeGod.cs +++ b/NPCs/SlimeGod/SlimeGod.cs @@ -399,9 +399,9 @@ namespace CalamityMod.NPCs.SlimeGod else if (npc.ai[2] == 0f) { npc.noTileCollide = true; - npc.noGravity = true; } - npc.velocity.Y += 0.25f; + npc.noGravity = true; + npc.velocity.Y += 0.5f; float velocityLimit = malice ? 20f : death ? 15f : revenge ? 14f : expertMode ? 13f : 12f; if (npc.velocity.Y > velocityLimit) { diff --git a/NPCs/SlimeGod/SlimeGodRun.cs b/NPCs/SlimeGod/SlimeGodRun.cs index cc18939b24..46062cbf5f 100644 --- a/NPCs/SlimeGod/SlimeGodRun.cs +++ b/NPCs/SlimeGod/SlimeGodRun.cs @@ -409,9 +409,9 @@ namespace CalamityMod.NPCs.SlimeGod else if (npc.ai[2] == 0f) { npc.noTileCollide = true; - npc.noGravity = true; } - npc.velocity.Y += 0.3f; + npc.noGravity = true; + npc.velocity.Y += 0.5f; float velocityLimit = malice ? 20f : death ? 15f : revenge ? 14f : expertMode ? 13f : 12f; if (npc.velocity.Y > velocityLimit) { diff --git a/NPCs/SlimeGod/SlimeGodRunSplit.cs b/NPCs/SlimeGod/SlimeGodRunSplit.cs index 6030f25e74..23ca6bc4b7 100644 --- a/NPCs/SlimeGod/SlimeGodRunSplit.cs +++ b/NPCs/SlimeGod/SlimeGodRunSplit.cs @@ -383,9 +383,9 @@ namespace CalamityMod.NPCs.SlimeGod else if (npc.ai[2] == 0f) { npc.noTileCollide = true; - npc.noGravity = true; } - npc.velocity.Y += 0.3f; + npc.noGravity = true; + npc.velocity.Y += 0.5f; float velocityLimit = malice ? 22f : death ? 16f : revenge ? 15f : expertMode ? 14f : 13f; if (npc.velocity.Y > velocityLimit) { diff --git a/NPCs/SlimeGod/SlimeGodSplit.cs b/NPCs/SlimeGod/SlimeGodSplit.cs index c5d14625fe..3c4c228f54 100644 --- a/NPCs/SlimeGod/SlimeGodSplit.cs +++ b/NPCs/SlimeGod/SlimeGodSplit.cs @@ -380,9 +380,9 @@ namespace CalamityMod.NPCs.SlimeGod else if (npc.ai[2] == 0f) { npc.noTileCollide = true; - npc.noGravity = true; } - npc.velocity.Y += 0.25f; + npc.noGravity = true; + npc.velocity.Y += 0.5f; float velocityLimit = malice ? 20f : death ? 15f : revenge ? 14f : expertMode ? 13f : 12f; if (npc.velocity.Y > velocityLimit) {