Add tower Sell action with refund + coin VFX/SFX

Owner-validated sell RPC refunds SellRefundPercent of invested gold (Wall refunds 100% while un-upgraded), despawns the tower, and broadcasts a coin-burst VFX + rustle SFX. Refunds do not count as per-wave income. Investment/upgrade tracking added as the seam for the future upgrade system.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Matt F 2026-07-14 20:05:06 -07:00
parent 2429efbf6a
commit 9be31b1645
7 changed files with 361 additions and 12 deletions

View file

@ -47,6 +47,22 @@ namespace TD.Towers
"successful server-side placement validation.")]
public int GoldCost;
// -------------------------------------------------------------------
// Selling
// -------------------------------------------------------------------
[Header("Selling")]
[Tooltip("Portion of the gold INVESTED in this tower (placement cost plus any gold " +
"later spent upgrading it) that is refunded when it is sold, as a 01 factor. " +
"Default 0.75 = 75%.")]
[Range(0f, 1f)]
public float SellRefundPercent = 0.75f;
[Tooltip("When true, this tower refunds 100% of its invested gold while it has never " +
"been upgraded (upgradeCount == 0); once upgraded it falls back to " +
"SellRefundPercent. Set on the Wall so a fresh wall can be re-mazed for free.")]
public bool FullRefundIfUnupgraded = false;
// -------------------------------------------------------------------
// Construction
// -------------------------------------------------------------------