Updates to spells, HUD, Gold, and Camera Controls. New sound effects!

This commit is contained in:
Matt F 2026-07-18 18:12:56 -07:00
parent 689fe7be88
commit a33d951abd
27 changed files with 578 additions and 68 deletions

View file

@ -37,5 +37,14 @@ namespace TD.Gameplay.Draft
var loadout = PlayerSpellLoadout.GetForClient(clientId);
return loadout != null && loadout.ServerGrantSpell(Kind);
}
/// <summary>Inherits the granted spell's icon (resolved from the pool by
/// <see cref="Kind"/>) unless this option assigns an override.</summary>
public override Sprite ResolveIcon()
{
if (Icon != null) return Icon;
var def = BuilderSpellPool.Instance != null ? BuilderSpellPool.Instance.Get(Kind) : null;
return def != null ? def.Icon : null;
}
}
}

View file

@ -34,9 +34,19 @@ namespace TD.Gameplay.Draft
[TextArea(2, 4)]
public string Description;
[Tooltip("Icon shown on the draft card. Optional for placeholder content.")]
[Tooltip("OPTIONAL override for the draft card icon. Leave empty to inherit the icon of " +
"the item this option grants (its tower / spell); assign one only when you want " +
"to override that inherited icon.")]
public Sprite Icon;
/// <summary>
/// The icon actually shown on the draft card. Returns the explicit <see cref="Icon"/>
/// override when one is assigned; otherwise subclasses fall back to the icon of the item
/// they grant (tower, spell). The base class has no referenced item, so it just returns
/// <see cref="Icon"/> (which may be null).
/// </summary>
public virtual Sprite ResolveIcon() => Icon;
[Header("Generation")]
[Tooltip("Relative draw weight. Higher = offered more often. Rarer rewards use " +
"lower weights. Must be > 0.")]

View file

@ -48,5 +48,9 @@ namespace TD.Gameplay.Draft
return deck.ServerGrantTower(typeId);
}
/// <summary>Inherits the granted tower's icon unless this option assigns an override.</summary>
public override Sprite ResolveIcon()
=> Icon != null ? Icon : (Tower != null ? Tower.Icon : null);
}
}