Throw tomatoes after rounds too, and let bots actually throw

Tomatoes fly on the round-over screen as well as the results. Bots'
throws count while their attack is held, as their controls land after
the match reads presses each tick.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shweetandClaude Opus 5.5 committed 2026-11-08 18:20:46 -05:00
1 parent 9a41474069
commit e88fed1f4c
2 files changed
+9 -4

No files matched your search

+6 -2
View File
@@ -174,6 +174,7 @@ void Match::update(Sim& sim)
deathmatch_update(sim);
break;
case MATCH_ROUND_OVER:
tomatoes_update(sim);
if (timer > 0)
break;
if (winner >= 0 && wins[winner] >= rules.wins_get())
@@ -415,14 +416,17 @@ void Match::edit_take(Sim& sim, Fighter& fighter)
}
}
// On the results, everyone but the winner can splat tomatoes where they click, for show, a few a second at most.
// After a round and on the results, everyone but the winner can splat tomatoes where they click, for show, a few a
// second at most.
void Match::tomatoes_update(Sim& sim)
{
for (int i = 0; i < sim.fighterCount; i++)
{
Fighter& fighter = sim.fighters[i];
tomatoCooldowns[i] -= TICK;
if (i == winner || isGone[i] || tomatoCooldowns[i] > 0 || !fighter.is_pressed(CONTROL_ATTACK))
// Bots' controls land after this each tick, so theirs count while held (see Bot::update).
bool isThrown = fighter.isBot ? fighter.is_down(CONTROL_ATTACK) : fighter.is_pressed(CONTROL_ATTACK);
if (i == winner || isGone[i] || tomatoCooldowns[i] > 0 || !isThrown)
continue;
tomatoCooldowns[i] = TOMATO_COOLDOWN;
sim.cues->tomato_splat(fighter.controls.cursor, i);