File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
src/client/graphics/layers Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -171,6 +171,9 @@ export class AlertFrame extends LitElement implements Layer {
171171 currentTick - this . lastAlertTick < ALERT_COOLDOWN_TICKS ;
172172
173173 // Find new attacks that we haven't seen yet
174+ const playerTroops = myPlayer . troops ( ) ;
175+ const minAttackTroopsThreshold = playerTroops / 5 ; // 1/5 of current troops
176+
174177 for ( const attack of incomingAttacks ) {
175178 // Only alert for non-retreating attacks
176179 if ( ! attack . retreating && ! this . seenAttackIds . has ( attack . id ) ) {
@@ -180,10 +183,14 @@ export class AlertFrame extends LitElement implements Layer {
180183 ourAttackTick !== undefined &&
181184 currentTick - ourAttackTick < RETALIATION_WINDOW_TICKS ;
182185
186+ // Check if attack is too small (less than 1/5 of our troops)
187+ const isSmallAttack = attack . troops < minAttackTroopsThreshold ;
188+
183189 // Don't alert if:
184190 // 1. We're in cooldown from a recent alert
185- // 2. This is a retaliation (we attacked them within 10 seconds)
186- if ( ! inCooldown && ! isRetaliation ) {
191+ // 2. This is a retaliation (we attacked them within 15 seconds)
192+ // 3. The attack is too small (less than 1/5 of our troops)
193+ if ( ! inCooldown && ! isRetaliation && ! isSmallAttack ) {
187194 this . seenAttackIds . add ( attack . id ) ;
188195 this . activateAlert ( ) ;
189196 } else {
You can’t perform that action at this time.
0 commit comments