Allow chosen Reinforcements reserve costs
Verify and publish checkpoint container / container (push) Successful in 11m11s
Verify and publish checkpoint container / container (push) Successful in 11m11s
This commit is contained in:
1 parent
9dd386ff7a
commit
1cf90f1328
16 files changed
+419
-44
No files matched your search
@@ -515,6 +515,12 @@ export function GameTable({
|
||||
selectedDefenseId === 'ecaz-reinforcements';
|
||||
const harassSelected = (selectedWeaponId === 'ecaz-harass-withdraw' && !planetologistWeapon) ||
|
||||
selectedDefenseId === 'ecaz-harass-withdraw';
|
||||
const [reinforcementsEliteDraft, setReinforcementsEliteDraft] = useState<{ key: string; elite: number } | null>(null);
|
||||
const reinforcementsEliteKey = `${g.code}:${me.id}:${g.battle?.event ?? ''}`;
|
||||
const reinforcementsEliteOptions = g.battle?.reinforcements?.eliteOptions ?? [];
|
||||
const chosenReinforcementsElite = reinforcementsEliteDraft?.key === reinforcementsEliteKey &&
|
||||
reinforcementsEliteOptions.includes(reinforcementsEliteDraft.elite)
|
||||
? reinforcementsEliteDraft.elite : reinforcementsEliteOptions[0];
|
||||
const [reinforcementsSourceDraft, setReinforcementsSourceDraft] = useState<{
|
||||
key: string; index: number;
|
||||
} | null>(null);
|
||||
@@ -597,6 +603,8 @@ export function GameTable({
|
||||
enabled: plan.planetologistSpecial === true,
|
||||
});
|
||||
setKwisatz(!!plan.kwisatz);
|
||||
setReinforcementsEliteDraft(plan.reinforcementsElite === undefined ? null
|
||||
: { key: reinforcementsEliteKey, elite: plan.reinforcementsElite });
|
||||
if (plan.reinforcementsSources) {
|
||||
const chosen = JSON.stringify(plan.reinforcementsSources);
|
||||
const index = reinforcementsSourceChoices?.findIndex(choice => JSON.stringify(choice) === chosen);
|
||||
@@ -5779,12 +5787,23 @@ export function GameTable({
|
||||
Reinforcements may occupy either card slot but is neither a weapon nor a defense.
|
||||
It adds 2 to battle strength without changing the physical dial or spice support.
|
||||
The cost is three reserve forces sent to the Tanks on any revealed outcome.
|
||||
Available for that quote: {g.battle.reinforcements.normal} normal,{' '}
|
||||
Default fee: {g.battle.reinforcements.normal} normal,{' '}
|
||||
{g.battle.reinforcements.elite} elite.
|
||||
The card is discarded even after a traitor call or explosion.
|
||||
{g.battle.reinforcements.blocked && ` ${g.battle.reinforcements.blocked}`}
|
||||
</p>
|
||||
)}
|
||||
{reinforcementsSelected && !g.homeworlds && reinforcementsEliteOptions.length > 0 && (
|
||||
<label className="block space-y-1">
|
||||
<span>Reinforcements reserve fee</span>
|
||||
<select value={chosenReinforcementsElite} disabled={busy}
|
||||
onChange={event => setReinforcementsEliteDraft({ key: reinforcementsEliteKey, elite: Number(event.target.value) })}>
|
||||
{reinforcementsEliteOptions.map(elite => <option key={elite} value={elite}>
|
||||
{3 - elite} normal + {elite} special
|
||||
</option>)}
|
||||
</select>
|
||||
</label>
|
||||
)}
|
||||
{reinforcementsSelected && reinforcementsSourceChoices && (
|
||||
<ReinforcementsSources game={g} choices={reinforcementsSourceChoices}
|
||||
selected={reinforcementsSourceIndex} busy={busy}
|
||||
@@ -5903,7 +5922,10 @@ export function GameTable({
|
||||
weapon,
|
||||
defense,
|
||||
...(reinforcementsSelected && selectedReserveSource
|
||||
? { reinforcementsSources: selectedReserveSource } : {}),
|
||||
? { reinforcementsSources: selectedReserveSource,
|
||||
reinforcementsElite: Object.values(selectedReserveSource).reduce((sum, forces) => sum + forces.elite, 0) }
|
||||
: reinforcementsSelected && chosenReinforcementsElite !== undefined
|
||||
? { reinforcementsElite: chosenReinforcementsElite } : {}),
|
||||
}),
|
||||
!!occupyControl?.blocked || !!stonePlanReason || !!harassControl.blocked || !!smugglerPlanReason || !!reinforcementsPlanReason || !battlePairValid,
|
||||
)}
|
||||
@@ -5922,6 +5944,9 @@ export function GameTable({
|
||||
{g.battle.plans[me.id]?.planetologistSpecial && (
|
||||
<p className="fine">Planetologist alternate Special: +2 if the leader survives; no normal card effect.</p>
|
||||
)}
|
||||
{g.battle.plans[me.id]?.reinforcementsElite !== undefined && !g.battle.plans[me.id]?.reinforcementsSources && (
|
||||
<p className="fine">Sealed reserve fee: {3 - g.battle.plans[me.id].reinforcementsElite!} normal + {g.battle.plans[me.id].reinforcementsElite} special.</p>
|
||||
)}
|
||||
{g.battle.plans[me.id]?.reinforcementsSources && (
|
||||
<p className="fine">Sealed reserve fee: {reinforcementsSourceLabel(g, g.battle.plans[me.id].reinforcementsSources!)}</p>
|
||||
)}
|
||||
|
||||
@@ -19,7 +19,7 @@ export function ReinforcementsSources({ game, choices, selected, onChange, busy
|
||||
if (!choices.length) return null;
|
||||
return <fieldset disabled={busy} className="space-y-3 rounded-lg border border-[#a88b60]/50 p-3">
|
||||
<legend>Reinforcements reserve sources</legend>
|
||||
<p className="fine">Three original native reserves go to the Tanks, normal first. These are not the invading army or future Harass returns.</p>
|
||||
<p className="fine">Choose the three original native reserves sent to the Tanks. These are not the invading army or future Harass returns.</p>
|
||||
{choices.length > 1 ? <label className="block space-y-1">
|
||||
<span>Native reserve fee allocation</span>
|
||||
<select value={selected} onChange={event => onChange(Number(event.target.value))}>
|
||||
|
||||
Reference in new issue
Block a user