From 6b74607018ca0d562b366310706be0182334fabb Mon Sep 17 00:00:00 2001 From: Nathan Feger Date: Sun, 24 May 2026 09:37:40 -0500 Subject: [PATCH] fix: remove duplicate ValuePropExtensions and update TalkCmd.Play signature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit IsPoweredAttack, IsPoweredCardOrMonsterMoveBlock, and IsCardOrMonsterMove are now part of the native sts2 API. Keeping ModSmith's re-exports in the same namespace causes CS0121 ambiguity errors for any mod that references both assemblies. TalkCmd.Play signature changed from (LocString, Creature, double) to (LocString, Creature, VfxColor, VfxDuration) — updated CoinFlip template to match. Co-Authored-By: Claude Sonnet 4.6 --- .../src/Extensions/Sts2NativeExtensions.cs | 34 +++---------------- .../src/StarterContent/cards/CoinFlip.cs | 5 +-- 2 files changed, 7 insertions(+), 32 deletions(-) diff --git a/ModSmith/src/Extensions/Sts2NativeExtensions.cs b/ModSmith/src/Extensions/Sts2NativeExtensions.cs index fc3e4d0..79a4720 100644 --- a/ModSmith/src/Extensions/Sts2NativeExtensions.cs +++ b/ModSmith/src/Extensions/Sts2NativeExtensions.cs @@ -1,30 +1,4 @@ -namespace MegaCrit.Sts2.Core.ValueProps; - -// Internal extensions provided by Sts2 internally and re-exported by ModSmith -// since they seem pretty harmless. -/// -public static class ValuePropExtensions -{ - public static bool IsPoweredAttack(this ValueProp props) - { - if (props.HasFlag(ValueProp.Move)) - { - return !props.HasFlag(ValueProp.Unpowered); - } - return false; - } - - public static bool IsPoweredCardOrMonsterMoveBlock(this ValueProp props) - { - if (props.HasFlag(ValueProp.Move)) - { - return !props.HasFlag(ValueProp.Unpowered); - } - return false; - } - - public static bool IsCardOrMonsterMove(this ValueProp props) - { - return props.HasFlag(ValueProp.Move); - } -} +// This file previously re-exported ValuePropExtensions (IsPoweredAttack, etc.) from the sts2 +// game assembly as a convenience for mods. These methods are now part of the public sts2 API +// and no longer need to be provided here. The file is kept to avoid breaking any mod that +// references it indirectly, but it intentionally contains no declarations. diff --git a/ModTemplate/src/StarterContent/cards/CoinFlip.cs b/ModTemplate/src/StarterContent/cards/CoinFlip.cs index 3fdd002..43cd3dd 100644 --- a/ModTemplate/src/StarterContent/cards/CoinFlip.cs +++ b/ModTemplate/src/StarterContent/cards/CoinFlip.cs @@ -5,6 +5,7 @@ using MegaCrit.Sts2.Core.Localization; using MegaCrit.Sts2.Core.Localization.DynamicVars; using MegaCrit.Sts2.Core.Nodes.Rooms; +using MegaCrit.Sts2.Core.Nodes.Vfx; using MegaCrit.Sts2.Core.Random; using ModSmith.Models; @@ -27,13 +28,13 @@ protected override async Task OnPlay(PlayerChoiceContext choiceContext, CardPlay var goldValue = DynamicVars.Gold.IntValue; if (heads) { - TalkCmd.Play(new LocString("cards", $"{base.Id.Entry}.headsBanter"), Owner.Creature, 1.5); + TalkCmd.Play(new LocString("cards", $"{base.Id.Entry}.headsBanter"), Owner.Creature, VfxColor.Green, VfxDuration.Standard); NCombatRoom.Instance?.PlaySplashVfx(Owner.Creature, StsColors.green); await PlayerCmd.GainGold(goldValue, Owner); } else { - TalkCmd.Play(new LocString("cards", $"{base.Id.Entry}.tailsBanter"), Owner.Creature, 1.5); + TalkCmd.Play(new LocString("cards", $"{base.Id.Entry}.tailsBanter"), Owner.Creature, VfxColor.Red, VfxDuration.Standard); NCombatRoom.Instance?.PlaySplashVfx(Owner.Creature, StsColors.red); goldValue = base.IsUpgraded ? goldValue / 2 : goldValue; await PlayerCmd.LoseGold(goldValue, Owner);