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>
19 lines
538 B
C#
19 lines
538 B
C#
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;
|
|
}
|
|
}
|