Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 4 additions & 30 deletions ModSmith/src/Extensions/Sts2NativeExtensions.cs
Original file line number Diff line number Diff line change
@@ -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.
/// <hidden />
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.
5 changes: 3 additions & 2 deletions ModTemplate/src/StarterContent/cards/CoinFlip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
Expand Down