Allow Advanced Emperor gifts during Guild rate responses
Verify and publish checkpoint container / container (push) Successful in 11m3s
Verify and publish checkpoint container / container (push) Successful in 11m3s
This commit is contained in:
1 parent
b3843bf18e
commit
5e7f7b45e4
14 files changed
+475
-6
No files matched your search
@@ -14,7 +14,8 @@ export function EmperorTimingGift({ game, act, busy }: {
|
||||
const [raw, setRaw] = useState('1');
|
||||
const phaseOpening = game.emperorPhaseOpeningGift;
|
||||
const extortion = game.emperorExtortionGift;
|
||||
const offer = phaseOpening ?? extortion ?? game.emperorGuildTimingGift;
|
||||
const guildRate = game.emperorGuildRateGift;
|
||||
const offer = phaseOpening ?? extortion ?? guildRate ?? game.emperorGuildTimingGift;
|
||||
if (!offer) return null;
|
||||
const amount = /^[1-9]\d*$/.test(raw) ? Number(raw) : NaN;
|
||||
const canShare = !busy && Number.isSafeInteger(amount) && amount >= 1 && amount <= offer.maximum;
|
||||
@@ -26,7 +27,9 @@ export function EmperorTimingGift({ game, act, busy }: {
|
||||
? 'Phase opening resumes after the Karama response to your gift.'
|
||||
: extortion
|
||||
? 'The Moritani Extortion decision resumes after the Karama response to your gift.'
|
||||
: 'The Guild timing decision resumes after the Karama response to your gift.'}</p>
|
||||
: guildRate
|
||||
? 'The original Guild rate response resumes after the Karama response to your gift.'
|
||||
: 'The Guild timing decision resumes after the Karama response to your gift.'}</p>
|
||||
<label htmlFor={`${id}-amount`}>Spice to share</label>
|
||||
<input id={`${id}-amount`} type="number" inputMode="numeric" min={1} max={offer.maximum}
|
||||
step={1} value={raw} disabled={busy} onChange={event => setRaw(event.target.value)} />
|
||||
|
||||
Reference in new issue
Block a user