From d6d39061ab608520ec9aa0f80f0ae9bd4199c9c4 Mon Sep 17 00:00:00 2001 From: EJCrispy Date: Fri, 11 Apr 2025 13:57:16 -0700 Subject: [PATCH 1/2] Changed tiki armor full set bonus to give knockback immunity and an extra summon slot. Also changed the localization to reflect this. --- AdventurePlayer.cs | 17 ++++++++++++++++- Localization/en-US.hjson | 2 ++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/AdventurePlayer.cs b/AdventurePlayer.cs index dce6e18e..cb706f0a 100644 --- a/AdventurePlayer.cs +++ b/AdventurePlayer.cs @@ -76,7 +76,6 @@ public void Apply(AdventurePlayer adventurePlayer) adventurePlayer.Deaths = Deaths; } } - public sealed class ItemPickup(int[] items) : IPacket { public int[] Items { get; } = items; @@ -624,6 +623,7 @@ public override void OnHurt(Player.HurtInfo info) PvPImmuneTime = adventureConfig.Combat.StandardInvincibilityFrames; } + public override bool OnPickup(Item item) { // FIXME: This could work for non-modded items, but I'm not so sure the item type ordinals are determinant. @@ -682,4 +682,19 @@ public override string ToString() { return $"{Player.whoAmI}/{Player.name}/{DiscordUser?.Id}"; } + // Handles the set bonus effects + public class TikiArmorModPlayer : ModPlayer + { + public override void PostUpdateEquips() + { + // Check if wearing full Tiki Armor + if (Player.armor[0].type == ItemID.TikiMask && + Player.armor[1].type == ItemID.TikiShirt && + Player.armor[2].type == ItemID.TikiPants) + { + Player.maxMinions += 1; + Player.noKnockback = true; + } + } + } } \ No newline at end of file diff --git a/Localization/en-US.hjson b/Localization/en-US.hjson index fd24d07e..9e95b167 100644 --- a/Localization/en-US.hjson +++ b/Localization/en-US.hjson @@ -362,3 +362,5 @@ Mods: { Bounty.CollectedAllMechanicalBossSouls: "[c/32FF82:Cries of tortured souls emanate from the Bounty Shop...]" } } + +ArmorSetBonus.Tiki: Set bonus: Knockback immunity, increases whip range by 20% , +2 minion slots. Does not apply if name contains "ss" From 8b2b568331f6c90a68ae844b7ce1a11c8e8f89a4 Mon Sep 17 00:00:00 2001 From: EJCrispy Date: Fri, 11 Apr 2025 14:41:20 -0700 Subject: [PATCH 2/2] also capped zoom at 100% --- AdventurePlayer.cs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/AdventurePlayer.cs b/AdventurePlayer.cs index cb706f0a..50675b01 100644 --- a/AdventurePlayer.cs +++ b/AdventurePlayer.cs @@ -697,4 +697,31 @@ public override void PostUpdateEquips() } } } + public class ForceZoom : ModPlayer + { + // Configuration + private const float BaseMinimumZoom = 1.0f; // Normal minimum zoom (100%) + // Runtime variables + private float currentMinimumZoom; + private float playerZoomTarget; + + public override void PostUpdate() + { + // 1. Determine current minimum based on equipment + currentMinimumZoom = Player.armor[0].type == ItemID.Goggles + ? BaseMinimumZoom + : BaseMinimumZoom; + + // 2. Get the player's current zoom target from the game + playerZoomTarget = Main.GameZoomTarget; + + // 3. Enforce minimum zoom but allow zooming in beyond + if (playerZoomTarget < currentMinimumZoom) + { + Main.GameZoomTarget = currentMinimumZoom; + Main.GameViewMatrix.Zoom = new Vector2(currentMinimumZoom); + } + + } + } } \ No newline at end of file