From fb2ef221a8b9b48d02a2e4bb9d96dd88ccc76161 Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Sun, 18 May 2025 01:02:03 -0700 Subject: [PATCH] added Whispering Pearls --- .../WhisperingPearls/WhisperingPearl.cs | 17 ++ .../WhisperingPearls/WhisperingPearl.png | Bin 0 -> 221 bytes .../WhisperingPearls/WhisperingPearlBlack.cs | 17 ++ .../WhisperingPearls/WhisperingPearlBlack.png | Bin 0 -> 221 bytes .../WhisperingPearlDarkBlue.cs | 17 ++ .../WhisperingPearlDarkBlue.png | Bin 0 -> 221 bytes .../WhisperingPearlDarkGreen.cs | 17 ++ .../WhisperingPearlDarkGreen.png | Bin 0 -> 221 bytes .../WhisperingPearlLightBlue.cs | 17 ++ .../WhisperingPearlLightBlue.png | Bin 0 -> 221 bytes .../WhisperingPearlLightGreen.cs | 17 ++ .../WhisperingPearlLightGreen.png | Bin 0 -> 221 bytes .../WhisperingPearls/WhisperingPearlOrange.cs | 17 ++ .../WhisperingPearlOrange.png | Bin 0 -> 221 bytes .../WhisperingPearls/WhisperingPearlPurple.cs | 17 ++ .../WhisperingPearlPurple.png | Bin 0 -> 221 bytes .../WhisperingPearls/WhisperingPearlRed.cs | 17 ++ .../WhisperingPearls/WhisperingPearlRed.png | Bin 0 -> 221 bytes .../WhisperingPearls/WhisperingPearlYellow.cs | 17 ++ .../WhisperingPearlYellow.png | Bin 0 -> 221 bytes .../Mods.CalamityMod.Items.Placeables.hjson | 50 +++++ .../en-US/Mods.CalamityMod.Tiles.hjson | 2 + Localization/en-US/Mods.CalamityMod.UI.hjson | 121 +++++++++++ Systems/UIManagementSystem.cs | 6 + Tiles/SunkenSea/WhisperingPearl.cs | 99 +++++++++ Tiles/SunkenSea/WhisperingPearl.png | Bin 0 -> 718 bytes Tiles/SunkenSea/WhisperingPearl_Highlight.png | Bin 0 -> 261 bytes UI/WhisperingPearlUI.cs | 189 ++++++++++++++++++ 28 files changed, 637 insertions(+) create mode 100644 Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearl.cs create mode 100644 Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearl.png create mode 100644 Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlBlack.cs create mode 100644 Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlBlack.png create mode 100644 Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlDarkBlue.cs create mode 100644 Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlDarkBlue.png create mode 100644 Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlDarkGreen.cs create mode 100644 Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlDarkGreen.png create mode 100644 Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlLightBlue.cs create mode 100644 Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlLightBlue.png create mode 100644 Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlLightGreen.cs create mode 100644 Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlLightGreen.png create mode 100644 Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlOrange.cs create mode 100644 Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlOrange.png create mode 100644 Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlPurple.cs create mode 100644 Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlPurple.png create mode 100644 Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlRed.cs create mode 100644 Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlRed.png create mode 100644 Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlYellow.cs create mode 100644 Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlYellow.png create mode 100644 Tiles/SunkenSea/WhisperingPearl.cs create mode 100644 Tiles/SunkenSea/WhisperingPearl.png create mode 100644 Tiles/SunkenSea/WhisperingPearl_Highlight.png create mode 100644 UI/WhisperingPearlUI.cs diff --git a/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearl.cs b/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearl.cs new file mode 100644 index 0000000000..4ab1f0cd24 --- /dev/null +++ b/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearl.cs @@ -0,0 +1,17 @@ +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.SunkenSea.WhisperingPearls +{ + public class WhisperingPearl : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.rare = ItemRarityID.Blue; + Item.placeStyle = 0; + } + } +} diff --git a/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearl.png b/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearl.png new file mode 100644 index 0000000000000000000000000000000000000000..ff5ff494413d16ce500bc4598476561839c864d1 GIT binary patch literal 221 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|^0G|-ohVGS%=I{Ob@%!FQmo41mK*Et4EkKH`B*-uLKL{{v-oIo&P=vF< zBeIx*f$uN~Gak=hkpdKS@^o&w4zu`O!H?nmE@RFrW1`kl35 z(ImeUk&8X+4XO{GQ2K8EgeC8S|G_!CN|-NAwcE~gli~9UCRwTcJ=#Fi7(8A5T-G@y GGywpzD@sZL literal 0 HcmV?d00001 diff --git a/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlBlack.cs b/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlBlack.cs new file mode 100644 index 0000000000..a8d8bb6e08 --- /dev/null +++ b/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlBlack.cs @@ -0,0 +1,17 @@ +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.SunkenSea.WhisperingPearls +{ + public class WhisperingPearlBlack : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.rare = ItemRarityID.Blue; + Item.placeStyle = 9; + } + } +} diff --git a/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlBlack.png b/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlBlack.png new file mode 100644 index 0000000000000000000000000000000000000000..a43d3168e5435dff3f4a0dd620e57b33053d0d93 GIT binary patch literal 221 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|^0G|+7Sy@>nB_(5HV>LB3K0ZF6aGdwi$v}#&B*-uLKL{{v-oIo&P=vF< zBeIx*f$uN~Gak=hkpdKS@^o&w4zu`O!H?nmE@RFrW1`kl35 z(ImeUk&8X+4XO{GQ2K8EgeC8S|G_!CN|-NAwcE~gli~9UCRwTcJ=#Fi7(8A5T-G@y GGywq3mP2>| literal 0 HcmV?d00001 diff --git a/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlDarkBlue.cs b/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlDarkBlue.cs new file mode 100644 index 0000000000..d4b7fba3c3 --- /dev/null +++ b/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlDarkBlue.cs @@ -0,0 +1,17 @@ +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.SunkenSea.WhisperingPearls +{ + public class WhisperingPearlDarkBlue : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.rare = ItemRarityID.Blue; + Item.placeStyle = 6; + } + } +} diff --git a/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlDarkBlue.png b/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlDarkBlue.png new file mode 100644 index 0000000000000000000000000000000000000000..91069572d9483410744f9b6b725065ff95e5dc18 GIT binary patch literal 221 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|^0G|+71_mz%hA;+(Mh1o?1_o82uweIHbs)u7666>B9|RaS?_aVXD8gCb z5n0T@z;_sg8IR|$NC65udAc};Xav`u_vT|z;BY>u_2pl<*cP>8_oHt{DoQwh{m$C3 zXp-NF$i<%Z2Gs{oD1A47!jgBv|KOZmCCrzm+HGgL$?$mvldM$!9&Mm$44$rjF6*2U FngDQ(Ld^gG literal 0 HcmV?d00001 diff --git a/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlDarkGreen.cs b/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlDarkGreen.cs new file mode 100644 index 0000000000..dcc21e9d11 --- /dev/null +++ b/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlDarkGreen.cs @@ -0,0 +1,17 @@ +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.SunkenSea.WhisperingPearls +{ + public class WhisperingPearlDarkGreen : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.rare = ItemRarityID.Blue; + Item.placeStyle = 8; + } + } +} diff --git a/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlDarkGreen.png b/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlDarkGreen.png new file mode 100644 index 0000000000000000000000000000000000000000..b2db9441ccb9d3d4ee52c012b2d2843fbaf1e73a GIT binary patch literal 221 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|^0G|+7h7eVTWNn5i4h#i`3|c}!VG|CGSwM=dB*-uLKL{{v-oIo&P=vF< zBeIx*f$uN~Gak=hkpdKS@^o&w4zu`O!H?nmE@RFrW1`kl35 z(ImeUk&8X+4XO{GQ2K8EgeC8S|G_!CN|-NAwcE~gli~9UCRwTcJ=#Fi7(8A5T-G@y GGywp&M?*UR literal 0 HcmV?d00001 diff --git a/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlLightBlue.cs b/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlLightBlue.cs new file mode 100644 index 0000000000..c8b2afa3c9 --- /dev/null +++ b/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlLightBlue.cs @@ -0,0 +1,17 @@ +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.SunkenSea.WhisperingPearls +{ + public class WhisperingPearlLightBlue : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.rare = ItemRarityID.Blue; + Item.placeStyle = 5; + } + } +} diff --git a/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlLightBlue.png b/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlLightBlue.png new file mode 100644 index 0000000000000000000000000000000000000000..3adeb8f80865b4ef0abf60c55965df90c98f34eb GIT binary patch literal 221 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|^0G|+7QNM19=*21>pJg(3a;dulg)jYF>HwtJN`m}?|APR-=KV|d14TFs zJR*x382Ao@Fyrz36)8YLCr=m05RKs4^WJ<63LMS{wZ8ld7u%wC?0)pkNJR<9uisf4 z7ESUy5xLm2-k|#638nAmPgwFU_#d3JtAzQ|RJ-j=HyJ*!V3L)}-=hsQjlt8^&t;uc GLK6TGLPv`L literal 0 HcmV?d00001 diff --git a/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlLightGreen.cs b/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlLightGreen.cs new file mode 100644 index 0000000000..e171db4133 --- /dev/null +++ b/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlLightGreen.cs @@ -0,0 +1,17 @@ +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.SunkenSea.WhisperingPearls +{ + public class WhisperingPearlLightGreen : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.rare = ItemRarityID.Blue; + Item.placeStyle = 4; + } + } +} diff --git a/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlLightGreen.png b/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlLightGreen.png new file mode 100644 index 0000000000000000000000000000000000000000..9a81959456182561f6ba4af7a17b03c27aa56f74 GIT binary patch literal 221 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|^0G|+7hVEd7#YqgGCo$~IXK>X73fGnVXaiDgB|(0{|3QFZ^Zq6Kfg+p* z9+AZi419+{nDKc2iWH!rlc$Sgh(>Vjd2c=j1rFzfT3`N!i)~Rmc0c-Nq@sl5*YB(i zizfMkgwl8OCoFjv{149ARl "Items.Placeables"; + + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.rare = ItemRarityID.Blue; + Item.placeStyle = 2; + } + } +} diff --git a/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlOrange.png b/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlOrange.png new file mode 100644 index 0000000000000000000000000000000000000000..6f95f02fb3f47187dccbac0781c9555295f55052 GIT binary patch literal 221 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|^0G|-o?qKP~NeZ7Q8SKnganCN`m}?|APR-=KV|d14TFs zJR*x382Ao@Fyrz36)8YLCr=m05RKs4^WJ<63LMS{wZ8ld7u%wC?0)pkNJR<9uisf4 z7ESUy5xLm2-k|#638nAmPgwFU_#d3JtAzQ|RJ-j=HyJ*!V3L)}-=hsQjlt8^&t;uc GLK6V+B1b*| literal 0 HcmV?d00001 diff --git a/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlPurple.cs b/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlPurple.cs new file mode 100644 index 0000000000..327b8eb2c2 --- /dev/null +++ b/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlPurple.cs @@ -0,0 +1,17 @@ +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.SunkenSea.WhisperingPearls +{ + public class WhisperingPearlPurple : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.rare = ItemRarityID.Blue; + Item.placeStyle = 7; + } + } +} diff --git a/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlPurple.png b/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlPurple.png new file mode 100644 index 0000000000000000000000000000000000000000..7b6a250a7422e4a553b2c9496f3028233bc85f1f GIT binary patch literal 221 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|^0G|-oZri5C9y2~?Ki(O*)>X~{C|r^xz8*-il?3?({|5nv&HI<^2a0eO zctjR6Fz_7)VaDV6D^h@hPM$7~AsWH8=e_wD6gZp@YJK?^F1AJO*!}36k%|(IU%#_9 zESltZB66{3y+QTC6H4FBpRnXz@IN?bR|)f_sdn3$ZZdpc!6Yk{zegKr8iS{+pUXO@ GgeCy5G)Rd6 literal 0 HcmV?d00001 diff --git a/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlRed.cs b/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlRed.cs new file mode 100644 index 0000000000..3a5d3f958a --- /dev/null +++ b/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlRed.cs @@ -0,0 +1,17 @@ +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.SunkenSea.WhisperingPearls +{ + public class WhisperingPearlRed : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.rare = ItemRarityID.Blue; + Item.placeStyle = 1; + } + } +} diff --git a/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlRed.png b/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlRed.png new file mode 100644 index 0000000000000000000000000000000000000000..59db227945d8740f057d4300f88ed524b3cb25e6 GIT binary patch literal 221 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|^0G|-oZU*ti4AP$&GVjd2c=j1rFzfT3`N!i)~Rmc0c-Nq@sl5*YB(i zizfMkgwl8OCoFjv{149ARl "Items.Placeables"; + + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.rare = ItemRarityID.Blue; + Item.placeStyle = 3; + } + } +} diff --git a/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlYellow.png b/Items/Placeables/SunkenSea/WhisperingPearls/WhisperingPearlYellow.png new file mode 100644 index 0000000000000000000000000000000000000000..35a652f78cc2fce49c5cdfbeb968ea0a36473ea9 GIT binary patch literal 221 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|^0G|-o?hb~<3m87XW7xTs!PNyQ%CN)5#T!Vml?3?({|5nv&HI<^2a0eO zctjR6Fz_7)VaDV6D^h@hPM$7~AsWH8=e_wD6gZp@YJK?^F1AJO*!}36k%|(IU%#_9 zESltZB66{3y+QTC6H4FBpRnXz@IN?bR|)f_sdn3$ZZdpc!6Yk{zegKr8iS{+pUXO@ GgeCy^_eVYe literal 0 HcmV?d00001 diff --git a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson index afef9d3c6a..05dc28d410 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson @@ -3207,6 +3207,56 @@ VoidWorkBench: { Tooltip: "" } +WhisperingPearl: { + DisplayName: Whispering Pearl + Tooltip: Contains knowledge +} + +WhisperingPearlBlack: { + DisplayName: Black Whispering Pearl + Tooltip: "{$Items.Placeables.WhisperingPearl.Tooltip}" +} + +WhisperingPearlDarkBlue: { + DisplayName: Dark Blue Whispering Pearl + Tooltip: "{$Items.Placeables.WhisperingPearl.Tooltip}" +} + +WhisperingPearlDarkGreen: { + DisplayName: Dark Green Whispering Pearl + Tooltip: "{$Items.Placeables.WhisperingPearl.Tooltip}" +} + +WhisperingPearlLightBlue: { + DisplayName: Light Blue Whispering Pearl + Tooltip: "{$Items.Placeables.WhisperingPearl.Tooltip}" +} + +WhisperingPearlLightGreen: { + DisplayName: Light Green Whispering Pearl + Tooltip: "{$Items.Placeables.WhisperingPearl.Tooltip}" +} + +WhisperingPearlOrange: { + DisplayName: Orange Whispering Pearl + Tooltip: "{$Items.Placeables.WhisperingPearl.Tooltip}" +} + +WhisperingPearlPurple: { + DisplayName: Purple Whispering Pearl + Tooltip: "{$Items.Placeables.WhisperingPearl.Tooltip}" +} + +WhisperingPearlRed: { + DisplayName: Red Whispering Pearl + Tooltip: "{$Items.Placeables.WhisperingPearl.Tooltip}" +} + +WhisperingPearlYellow: { + DisplayName: Yellow Whispering Pearl + Tooltip: "{$Items.Placeables.WhisperingPearl.Tooltip}" +} + WulfrumBathtub: { DisplayName: Wulfrum Bathtub Tooltip: "" diff --git a/Localization/en-US/Mods.CalamityMod.Tiles.hjson b/Localization/en-US/Mods.CalamityMod.Tiles.hjson index 32316202fc..958be955cd 100644 --- a/Localization/en-US/Mods.CalamityMod.Tiles.hjson +++ b/Localization/en-US/Mods.CalamityMod.Tiles.hjson @@ -32,6 +32,8 @@ SpineTree.MapEntry: Giant Spine InactivePowerCellFactory.MapEntry: Inactive Power Cell Factory OnyxExcavatorTile.MapEntry: Onyx Excavator CodebreakerTile.MapEntry: The Codebreaker +// Sunken Sea +WhisperingPearl: "{$Items.Placeables.SunkenSea.WhisperingPearl.DisplayName}" // Ores AerialiteOre.MapEntry: Aerialite AerialiteOreDisenchanted.MapEntry: Disenchanted Aerialite diff --git a/Localization/en-US/Mods.CalamityMod.UI.hjson b/Localization/en-US/Mods.CalamityMod.UI.hjson index 0691f76312..32e48661fe 100644 --- a/Localization/en-US/Mods.CalamityMod.UI.hjson +++ b/Localization/en-US/Mods.CalamityMod.UI.hjson @@ -588,6 +588,127 @@ Lecherous: { Description: Spawns a resilient brimstone monster that stays between you and your mouse that interferes with your homing weapons. It releases a bunch of hearts on death. } +// Moving text to a new line inserts a paragraph break. Two blank newlines separate pages. +WhisperingPearl: { + Basic: + ''' + Something about clams + Like yknow those shellfish? + + + By the way I ate curry today + + + MMM.... + ''' + Red: + ''' + Something about red clams + Like yknow those shellfish? + + + By the way I ate curry today + + + MMM.... + ''' + Orange: + ''' + Something about orange clams + + Like yknow those shellfish? + + + By the way I ate curry today + + + MMM.... + ''' + Yellow: + ''' + Something about yellow clams Something about yellow clams Something about yellow clams Something about yellow clams Something about yellow clams Something about yellow clams Something about yellow clams + Like yknow those shellfish? Something about yellow clams Something about yellow clams Something about yellow clams Something about yellow clams Something about yellow clams + + + By the way I ate curry today + + + MMM.... + ''' + LightGreen: + ''' + Something about light green clams + + Like yknow those shellfish? + + + By the way I ate curry today + + + MMM.... + ''' + LightBlue: + ''' + Something about light blue clams + + Like yknow those shellfish? + + + By the way I ate curry today + + + MMM.... + ''' + DarkBlue: + ''' + Something about dark blue clams + + Like yknow those shellfish? + + + By the way I ate curry today + + + MMM.... + ''' + Purple: + ''' + Something about purple clams + + Like yknow those shellfish? + + + By the way I ate curry today + + + MMM.... + ''' + DarkGreen: + ''' + Something about dark green clams + + Like yknow those shellfish? + + + By the way I ate curry today + + + MMM.... + ''' + Black: + ''' + Something about black clams + + Like yknow those shellfish? + + + By the way I ate curry today + + + MMM.... + ''' +} + Disenchant: Disenchant // Worldgen Tasks BetterUnderworld: Creating a smoother Underworld diff --git a/Systems/UIManagementSystem.cs b/Systems/UIManagementSystem.cs index fa9408ef58..b1267fe728 100644 --- a/Systems/UIManagementSystem.cs +++ b/Systems/UIManagementSystem.cs @@ -34,6 +34,12 @@ namespace CalamityMod.Systems int mouseIndex = layers.FindIndex(layer => layer.Name == "Vanilla: Mouse Text"); if (mouseIndex != -1) { + layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Whispering Pearl", () => + { + WhisperingPearlUI.Draw(Main.spriteBatch); + return true; + }, InterfaceScaleType.Game)); + layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Draedon Hologram", () => { LabHologramProjectorUI.Draw(Main.spriteBatch); diff --git a/Tiles/SunkenSea/WhisperingPearl.cs b/Tiles/SunkenSea/WhisperingPearl.cs new file mode 100644 index 0000000000..e1478d1175 --- /dev/null +++ b/Tiles/SunkenSea/WhisperingPearl.cs @@ -0,0 +1,99 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.SunkenSea.WhisperingPearls; +using CalamityMod.TileEntities; +using CalamityMod.UI; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Input; +using Terraria; +using Terraria.Audio; +using Terraria.Enums; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.SunkenSea +{ + public class WhisperingPearl : ModTile + { + public override void SetStaticDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileLighted[Type] = true; + Main.tileNoFail[Type] = true; + Main.tileWaterDeath[Type] = false; + + TileID.Sets.HasOutlines[Type] = true; + TileID.Sets.DisableSmartCursor[Type] = true; + + TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.WaterDeath = false; + TileObjectData.newTile.WaterPlacement = LiquidPlacement.Allowed; + TileObjectData.newTile.LavaDeath = false; + TileObjectData.newTile.LavaPlacement = LiquidPlacement.NotAllowed; + TileObjectData.addTile(Type); + + AddMapEntry(Color.LightCyan, CalamityUtils.GetText("Tiles.WhisperingPearl")); + + DustType = DustID.BlueCrystalShard; + HitSound = SoundID.Item27; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + r = 0f; + g = 0.3f; + b = 0.3f; + } + + public override bool RightClick(int i, int j) + { + int frameNum = Main.tile[i, j].TileFrameX / 18; + string key = frameNum switch + { + 1 => "Red", + 2 => "Orange", + 3 => "Yellow", + 4 => "LightGreen", + 5 => "LightBlue", + 6 => "DarkBlue", + 7 => "Purple", + 8 => "DarkGreen", + 9 => "Black", + _ => "Basic" + }; + if (!WhisperingPearlUI.IsActive) + { + WhisperingPearlUI.StartDialogue(new Vector2(i, j) * 16, key); + } + else + { + WhisperingPearlUI.ProgressDialogue(new Vector2(i, j) * 16, key); + } + return true; + } + public override bool HasSmartInteract(int i, int j, Terraria.GameContent.ObjectInteractions.SmartInteractScanSettings settings) => true; + + public override void MouseOver(int i, int j) + { + int frameNum = Main.tile[i, j].TileFrameX / 18; + int pearl = frameNum switch + { + 1 => ModContent.ItemType(), + 2 => ModContent.ItemType(), + 3 => ModContent.ItemType(), + 4 => ModContent.ItemType(), + 5 => ModContent.ItemType(), + 6 => ModContent.ItemType(), + 7 => ModContent.ItemType(), + 8 => ModContent.ItemType(), + 9 => ModContent.ItemType(), + _ => ModContent.ItemType(), + }; + Main.LocalPlayer.cursorItemIconID = pearl; + Main.LocalPlayer.noThrow = 2; + Main.LocalPlayer.cursorItemIconEnabled = true; + } + } +} diff --git a/Tiles/SunkenSea/WhisperingPearl.png b/Tiles/SunkenSea/WhisperingPearl.png new file mode 100644 index 0000000000000000000000000000000000000000..db431067e248c1c5aa66e2ad2ba0ce2ba167bd67 GIT binary patch literal 718 zcmeAS@N?(olHy`uVBq!ia0vp^TYy-AgBeJ6%v<^cNHG=%xjQkeJ16rJ$YDu$^mSxl z*x1kgCy^D%pBdm2;@Z%?vYSD?J6O8AgMpztSk$kZfx)ZWwuvD`RaRDZ(fqxO8Kf5{ zDJ)*Vz_2(;B6=|cL)c=E84StVN=iy!KYstrpz(Q8 zv9a;qO_z5v$nDHm*}0X0VQ0Qf#!d!?q@96l843*5)YL58<6IfIT{Zb!T^JZ#HM!JX z85mSutIk)A_q8-yG z#7^TE+O+yrpi^0_z2}L%S?QcNbAKz|ok#m|*8dn1lqJe?}D zH|prc*Izd*u2#O0^GC8Tarf7Bi^jX>=06nqR$bp_Y$5YU^4!CUFX=lPE}xwLQ0QEG zeVg`!N`vPyZx(CyI{v6Pq`J*u!q~OUzxAMDgKi=iK z3YRV7tiIUNoN*}7bP0l+XkK DUeQR~ literal 0 HcmV?d00001 diff --git a/Tiles/SunkenSea/WhisperingPearl_Highlight.png b/Tiles/SunkenSea/WhisperingPearl_Highlight.png new file mode 100644 index 0000000000000000000000000000000000000000..d725bbf09d609d3abca26de21d2ac25e0899918e GIT binary patch literal 261 zcmeAS@N?(olHy`uVBq!ia0vp^TYy-AgBeJ6%v<^cNHG=%xjQkeJ16rJ$YDu$^mSxl z*x1kgCy^D%XAAHNasB`QKad%E=yDy9Vk!yp3;xgWbi08UkjGiz5n0T@z;_sg8IR|$ zNC65~dAc};cz9o(;KGrp>pt7J43R-)4A`uSb&S#BPTfQo3iBw+kI9 z6n_14$C90$8})b2{Cc|Er`}+#kfX(nuucUTpVck`e9J{$J)$4B5-!0(1p~r>mdKI;Vst0L9B) AK>z>% literal 0 HcmV?d00001 diff --git a/UI/WhisperingPearlUI.cs b/UI/WhisperingPearlUI.cs new file mode 100644 index 0000000000..3b9a0cbf33 --- /dev/null +++ b/UI/WhisperingPearlUI.cs @@ -0,0 +1,189 @@ +using System.Collections.Generic; +using System.Security.Cryptography.X509Certificates; +using CalamityMod.CalPlayer; +using CalamityMod.Items.Weapons.Typeless; +using CalamityMod.TileEntities; +using CalamityMod.Tiles.SunkenSea; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.UI +{ + public class WhisperingPearlUI + { + /// + /// Controls how many characters can currently be displayed + /// + public static float textTimer = -1; + /// + /// The maximum amount of characters to display for this page + /// + public static int maxTextTime = -1; + /// + /// Which page are we reading? + /// + public static int currentPage = -1; + /// + /// The localization key for the dialogue + /// + public static string key = ""; + /// + /// The bottom position of the text + /// + public static Vector2 position = Vector2.Zero; + /// + /// How many page there are + /// + public static int pageCount = 0; + + public static void Draw(SpriteBatch sb) + { + if (IsActive) + { + bool noPearl = false; + Point pearlTilePos = new Point((int)position.X / 16, (int)position.Y / 16); + Tile target = CalamityUtils.ParanoidTileRetrieval(pearlTilePos.X, pearlTilePos.Y); + // If there is no pearl, stop the dialogue + if (!target.HasTile || target.TileType != ModContent.TileType()) + { + noPearl = true; + } + // If the player is too far from the pearl, cancel the dialogue + else if (!Main.LocalPlayer.IsInTileInteractionRange(pearlTilePos.X, pearlTilePos.Y, TileReachCheckSettings.Simple)) + { + noPearl = true; + } + + if (noPearl) + { + FinishDialogue(); + return; + } + + string text = CalamityUtils.GetTextValue("UI.WhisperingPearl." + key); + + // Separate the text into pages + string[] separated = text.Split("\n\n"); + pageCount = separated.Length; + // If the current page is more than the total amount of pages, stop the dialogue + if (currentPage > separated.Length - 1) + { + FinishDialogue(); + return; + } + + // Cut the page even further down into individual lines + string[] wrapped = Utils.WordwrapString(separated[currentPage], FontAssets.MouseText.Value, 600, 100000, out int lineAmt); + string combined = ""; + + // Combine them back together with newlines separating them + for (int i = 0; i < wrapped.Length; i++) + { + if (wrapped[i] != null) + { + combined += '\n' + wrapped[i]; + } + } + + // Remove the newlines from every line except the last which doesn't have one + maxTextTime = combined.Length; + Vector2 size = FontAssets.MouseText.Value.MeasureString(combined); + // Shave off text based on the timer + combined = combined.Remove((int)textTimer, (combined.Length - (int)textTimer)); + + // How much further the BOTTOM of the text should be drawn above the pearl + float yOffset = 40; + + Utils.DrawBorderString(sb, combined, position - Main.screenPosition - Vector2.UnitY * (size.Y + yOffset), Color.White, anchorx: 0.5f, anchory: 0, maxCharactersDisplayed: 100000); + + // Increment the text timer + // 0.33 means that it takes 3ish frames for 1 letter to appear + if (textTimer < maxTextTime) + { + textTimer += 0.33f; + } + } + // If dialogue can't be active, finish it + else + { + FinishDialogue(); + } + } + + /// + /// Checks if the dialogue is active + /// + public static bool IsActive => textTimer >= 0 && currentPage >= 0 && key != "" && position != Vector2.Zero; + + /// + /// Manually progresses dialogue + /// + public static void ProgressDialogue(Vector2 drawPos, string pearlKey) + { + bool samePearl = pearlKey == key && drawPos == position; + if (IsActive && samePearl) + { + // If the timer hasn't finished, set it to max + if (textTimer < maxTextTime) + { + textTimer = maxTextTime; + } + // If the tmier has finished, progress to the next page or finish if we're out of pages + else + { + if (currentPage + 1 > pageCount) + { + FinishDialogue(); + } + else + { + currentPage++; + } + textTimer = 0; + } + } + else if (!samePearl) + { + StartDialogue(drawPos, pearlKey); + } + else + { + FinishDialogue(); + } + } + + /// + /// Starts up pearl dialogue + /// + /// The position of the bottom of the text + /// The name of the pearl's localization key + public static void StartDialogue(Vector2 drawPos, string pearlkey) + { + position = drawPos; + currentPage = 0; + textTimer = 0; + key = pearlkey; + pageCount = 0; + } + + /// + /// Resets all of the dialogue's variables + /// + public static void FinishDialogue() + { + position = Vector2.Zero; + currentPage = -1; + textTimer = -1; + key = ""; + pageCount = 0; + } + } +}