Deal items on ready, /pvp, and calmer rival windows
- Readying in a countdown deals any empty slots at random right away, and the countdown reads "Starting..." once everyone is ready. - /pvp toggles PvP in the sandbox, offline or in a lobby. - Rival windows sit at half opacity (half again when knocked out, and when hovered), show no item tooltips, and drop to small icons past two full-size rows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6f112ab231
commit
5d6ebf2bba
5 files changed
+77
-68
No files matched your search
+27
-13
@@ -140,14 +140,17 @@ void Match::update(Sim& sim)
|
||||
break;
|
||||
case MATCH_COUNTDOWN:
|
||||
{
|
||||
// Ready sticks once pressed, and bots always are. Once everyone is, the wait drops to its last second.
|
||||
// Fighters choosing items pick them through their controls.
|
||||
// Ready sticks once pressed, and bots always are. Readying deals any slots still empty at random. Once
|
||||
// everyone is, the wait drops to its last second. Fighters choosing items pick them through their controls.
|
||||
bool isEveryone = true;
|
||||
for (int i = 0; i < sim.fighterCount; i++)
|
||||
{
|
||||
Fighter& fighter = sim.fighters[i];
|
||||
edit_take(sim, fighter);
|
||||
bool wasReady = isReady[i];
|
||||
isReady[i] |= fighter.isBot || fighter.is_down(CONTROL_READY);
|
||||
if (isReady[i] && !wasReady)
|
||||
loadout_deal(sim, i);
|
||||
isEveryone &= isReady[i];
|
||||
}
|
||||
if (isEveryone)
|
||||
@@ -421,20 +424,31 @@ void Match::mirror_copy(Sim& sim, bool isTrinket)
|
||||
}
|
||||
}
|
||||
|
||||
// The countdown is over: slots still empty after choosing are dealt at random (once, and shared, when mirrored), and
|
||||
// the menu closes.
|
||||
// Deals a fighter's empty slots at random. A mirrored kind is dealt only to the first fighter, and copied to everyone.
|
||||
void Match::loadout_deal(Sim& sim, int index)
|
||||
{
|
||||
Fighter& fighter = sim.fighters[index];
|
||||
for (int kind = 0; kind < 2; kind++)
|
||||
{
|
||||
bool isTrinket = kind == 1;
|
||||
ItemRules& items = isTrinket ? rules.trinkets : rules.weapons;
|
||||
if (items.isMirror && index > 0)
|
||||
continue;
|
||||
if (isTrinket)
|
||||
picks_deal(sim.rng, fighter.trinketLoadout, fighter.trinketSlots, TRINKET_COUNT, items.isDuplicates);
|
||||
else
|
||||
picks_deal(sim.rng, fighter.weaponLoadout, fighter.weaponSlots, WEAPON_COUNT, items.isDuplicates);
|
||||
if (items.isMirror)
|
||||
mirror_copy(sim, isTrinket);
|
||||
}
|
||||
}
|
||||
|
||||
// The countdown is over: slots still empty after choosing (by anyone who never readied) are dealt at random, and the
|
||||
// menu closes.
|
||||
void Match::fight_start(Sim& sim)
|
||||
{
|
||||
for (int i = 0; i < sim.fighterCount; i++)
|
||||
{
|
||||
Fighter& fighter = sim.fighters[i];
|
||||
picks_deal(sim.rng, fighter.weaponLoadout, fighter.weaponSlots, WEAPON_COUNT, rules.weapons.isDuplicates);
|
||||
picks_deal(sim.rng, fighter.trinketLoadout, fighter.trinketSlots, TRINKET_COUNT, rules.trinkets.isDuplicates);
|
||||
if (i == 0 && rules.weapons.isMirror)
|
||||
mirror_copy(sim, false);
|
||||
if (i == 0 && rules.trinkets.isMirror)
|
||||
mirror_copy(sim, true);
|
||||
}
|
||||
loadout_deal(sim, i);
|
||||
if (isWeaponPick || isTrinketPick)
|
||||
sim.cues->choice_close();
|
||||
isWeaponPick = false;
|
||||
|
||||
Reference in new issue
Block a user