Correct Emperor special Sardaukar revival limits
This commit is contained in:
1 parent
b750a3d3eb
commit
ac4302a8ed
14 files changed
+269
-33
No files matched your search
@@ -5,11 +5,13 @@ export function EliteCount({
|
||||
value,
|
||||
onChange,
|
||||
max,
|
||||
min = 0,
|
||||
label = 'Elite forces included',
|
||||
}: {
|
||||
value: number;
|
||||
onChange: (value: number) => void;
|
||||
max: number;
|
||||
min?: number;
|
||||
label?: string;
|
||||
}) {
|
||||
const id = useId();
|
||||
@@ -19,7 +21,7 @@ export function EliteCount({
|
||||
<Input
|
||||
id={id}
|
||||
type="number"
|
||||
min={0}
|
||||
min={min}
|
||||
max={max}
|
||||
value={value}
|
||||
onChange={(e) => onChange(Number(e.target.value))}
|
||||
|
||||
@@ -6327,7 +6327,9 @@ export function GameTable({
|
||||
<>
|
||||
<p className="muted">
|
||||
Once per game: revive up to three forces or one
|
||||
leader for free.
|
||||
leader for free. These returns do not use your
|
||||
ordinary revival allowances, including the normal
|
||||
one-Sardaukar limit.
|
||||
</p>
|
||||
<label htmlFor={`special-revive-${c.id}`}>
|
||||
Forces to revive
|
||||
@@ -6346,12 +6348,8 @@ export function GameTable({
|
||||
<EliteCount
|
||||
label="Sardaukar to revive"
|
||||
value={eliteAmount}
|
||||
max={Math.min(
|
||||
1,
|
||||
amount,
|
||||
me.elites.tanks,
|
||||
1 - me.elites.revived,
|
||||
)}
|
||||
min={Math.max(0, amount - (me.tanks - me.elites.tanks))}
|
||||
max={Math.min(amount, me.elites.tanks)}
|
||||
onChange={setEliteAmount}
|
||||
/>
|
||||
)}
|
||||
@@ -6365,7 +6363,9 @@ export function GameTable({
|
||||
amount,
|
||||
elite: eliteAmount,
|
||||
},
|
||||
!me.tanks,
|
||||
!Number.isSafeInteger(amount) || amount < 1 || amount > Math.min(3, me.tanks) ||
|
||||
!Number.isSafeInteger(eliteAmount) || eliteAmount < Math.max(0, amount - (me.tanks - (me.elites?.tanks ?? 0))) ||
|
||||
eliteAmount > Math.min(amount, me.elites?.tanks ?? 0),
|
||||
)}
|
||||
{me.leaders
|
||||
.filter(
|
||||
|
||||
Reference in new issue
Block a user