[Add] Yacht scoring system with Balatro-like modifier pipeline

Implements the core game loop for Yacht dice: 5-dice rolling with
lock/unlock, 3 rolls per turn, 13 standard scoring categories, and
an extensible ScriptableObject-based modifier system that applies
additive then multiplicative bonuses (chips+mult pattern).

Includes two test modifiers: BonusForOnes (+10 per 1) and
MultiplierForSixes (x6 per 6).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-27 03:01:19 +07:00
parent b33017a320
commit f49cda7cdc
10 changed files with 517 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
using UnityEngine;
[CreateAssetMenu(fileName = "BonusForOnes", menuName = "YachtDice/Modifiers/Bonus For Ones")]
public sealed class BonusForOnes : ScoreModifier
{
[SerializeField] private int bonusPerOne = 10;
public override ModifierPhase Phase => ModifierPhase.Additive;
public override void Apply(ref ScoreResult result)
{
int count = 0;
for (int i = 0; i < result.DiceValues.Length; i++)
if (result.DiceValues[i] == 1) count++;
result.FlatBonus += bonusPerOne * count;
}
}
@@ -0,0 +1,16 @@
using UnityEngine;
[CreateAssetMenu(fileName = "MultiplierForSixes", menuName = "YachtDice/Modifiers/Multiplier For Sixes")]
public sealed class MultiplierForSixes : ScoreModifier
{
[SerializeField] private float multiplierPerSix = 6f;
public override ModifierPhase Phase => ModifierPhase.Multiplicative;
public override void Apply(ref ScoreResult result)
{
for (int i = 0; i < result.DiceValues.Length; i++)
if (result.DiceValues[i] == 6)
result.Multiplier *= multiplierPerSix;
}
}
+19
View File
@@ -0,0 +1,19 @@
using UnityEngine;
public abstract class ScoreModifier : ScriptableObject
{
public enum ModifierPhase
{
Additive,
Multiplicative
}
[SerializeField] private string displayName;
[SerializeField] [TextArea] private string description;
public string DisplayName => displayName;
public string Description => description;
public abstract ModifierPhase Phase { get; }
public abstract void Apply(ref ScoreResult result);
}