f49cda7cdc
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>
17 lines
542 B
C#
17 lines
542 B
C#
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;
|
|
}
|
|
}
|