new builder option per draft - first one is gold per kill

This commit is contained in:
Ian Woods 2026-07-07 22:55:35 -07:00
parent 4a37d3747c
commit 157b77ebfa
21 changed files with 456 additions and 7 deletions

View file

@ -0,0 +1,34 @@
// Assets/_Project/Scripts/Gameplay/BuilderEffects/BuilderEffectDefinition.cs
using UnityEngine;
using TD.Core;
namespace TD.Gameplay.BuilderEffects
{
/// <summary>
/// Base class for one builder effect — a passive perk that applies to every tower a
/// player's Builder constructs (e.g. "kills yield bonus gold"). Granted via the draft
/// (<see cref="TD.Gameplay.Draft.BuilderEffectDraftOption"/>) and tracked per-player by
/// <see cref="BuilderUpgradeManager"/>.
/// </summary>
/// <remarks>
/// <para><b>One asset per kind.</b> <see cref="Kind"/> is fixed per subclass (each concrete
/// type overrides it to its own <see cref="BuilderEffectKind"/>), so there's no way to
/// mis-tag an asset in the inspector. <see cref="BuilderEffectPool"/> uses it to build a
/// fixed-size, enum-indexed lookup table — no scanning to resolve a kind to its data.</para>
///
/// <para><b>No shared "Apply" contract.</b> Concrete subclasses (e.g.
/// <see cref="GoldPerKillEffectDefinition"/>) carry whatever payload they need. Effects with
/// different application shapes — a simple value read at an existing game-event hook vs.
/// behavior that needs its own component on the tower — are still just subclasses; consumers
/// query the concrete type they care about directly (see
/// <see cref="BuilderUpgradeManager.GetTotalGoldPerKillBonus"/>).</para>
/// </remarks>
public abstract class BuilderEffectDefinition : ScriptableObject
{
/// <summary>Which builder effect this asset's data belongs to.</summary>
public abstract BuilderEffectKind Kind { get; }
[Tooltip("Name shown wherever a player's active builder effects are listed.")]
public string DisplayName;
}
}