upgrades working; fix a small bug in which a base spell could be re-offered after picking an upgrade

This commit is contained in:
Ian Woods 2026-07-25 23:46:45 -07:00
parent 2de6d85b2f
commit a26d0acbfb
8 changed files with 88 additions and 3 deletions

View file

@ -15,7 +15,9 @@ namespace TD.Gameplay.Draft
/// <see cref="PlayerSpellLoadout"/> and <see cref="BuilderSpellPool"/> already key off of.
/// <see cref="IsValidFor"/> also checks slot capacity — once
/// <see cref="PlayerSpellLoadout.MaxSpellSlots"/> is reached, no further spell options are
/// offered.
/// offered. Gates on <see cref="PlayerSpellLoadout.PlayerHasEverGranted"/> rather than
/// current possession, so a base spell already upgraded past (see
/// <see cref="BuilderSpellUpgradeDraftOption"/>) is never re-offered.
/// </remarks>
[CreateAssetMenu(fileName = "BuilderSpellOption", menuName = "TD/Draft/Builder Spell Option")]
public class BuilderSpellDraftOption : DraftOption
@ -29,7 +31,7 @@ namespace TD.Gameplay.Draft
var loadout = PlayerSpellLoadout.GetForClient(clientId);
if (loadout == null) return false;
if (loadout.SlotCount >= PlayerSpellLoadout.MaxSpellSlots) return false;
return !loadout.PlayerHasSpell(Kind);
return !loadout.PlayerHasEverGranted(Kind);
}
public override bool ServerApply(ulong clientId)