From: Markus Armbruster Date: Sun, 8 Feb 2015 11:29:22 +0000 (+0100) Subject: fire: Print "Kaboom" even when the target is out of range X-Git-Tag: v4.3.33~47 X-Git-Url: http://git.pond.sub.org/?p=empserver;a=commitdiff_plain;h=ac15e5b96111314d2c712f06a44d945ff0c4593e fire: Print "Kaboom" even when the target is out of range To make shell use more obvious. Signed-off-by: Markus Armbruster --- diff --git a/src/lib/commands/mfir.c b/src/lib/commands/mfir.c index 2cd3a810d..527dba16b 100644 --- a/src/lib/commands/mfir.c +++ b/src/lib/commands/mfir.c @@ -338,17 +338,6 @@ multifire(void) pr("range is %d.00 (%.2f)\n", range2, range); } - /* - * If the player fires guns at a submarine, take care not to - * disclose it's a submarine: pretend the target is out of range. - */ - if (target == targ_ship && (mchr[vship.shp_type].m_flags & M_SUB)) - range2 = -1; - if (trange > range2) { - pr("Target out of range.\n"); - continue; - } - nfiring++; switch (target) { case targ_sub: @@ -361,6 +350,17 @@ multifire(void) break; } + /* + * If the player fires guns at a submarine, take care not to + * disclose it's a submarine: pretend the target is out of range. + */ + if (target == targ_ship && (mchr[vship.shp_type].m_flags & M_SUB)) + range2 = -1; + if (trange > range2) { + pr("Target out of range.\n"); + continue; + } + switch (target) { case targ_bogus: case targ_land: diff --git a/tests/fire/journal.log b/tests/fire/journal.log index 0386fc481..3de19ac5a 100644 --- a/tests/fire/journal.log +++ b/tests/fire/journal.log @@ -115,36 +115,42 @@ Play#1 command fire Play#1 output Play#1 1 Sector 4,0 ready to fire Play#1 output Play#1 1 range is 5.00 (4.50) + Play#1 output Play#1 1 \007Kaboom!!! Play#1 output Play#1 1 Target out of range. Play#1 output Play#1 6 0 624 Play#1 input fire se 4,0 0 Play#1 command fire Play#1 output Play#1 1 Sector 4,0 ready to fire Play#1 output Play#1 1 range is 5.00 (4.50) + Play#1 output Play#1 1 \007Kaboom!!! Play#1 output Play#1 1 Target out of range. Play#1 output Play#1 6 0 623 Play#1 input fire se 4,0 13 Play#1 command fire Play#1 output Play#1 1 Sector 4,0 ready to fire Play#1 output Play#1 1 range is 4.00 (4.50) + Play#1 output Play#1 1 \007Kaboom!!! Play#1 output Play#1 1 Target out of range. Play#1 output Play#1 6 0 622 Play#1 input fire se 4,0 12 Play#1 command fire Play#1 output Play#1 1 Sector 4,0 ready to fire Play#1 output Play#1 1 range is 4.00 (4.50) + Play#1 output Play#1 1 \007Kaboom!!! Play#1 output Play#1 1 Target out of range. Play#1 output Play#1 6 0 621 Play#1 input fire se 4,0 14,0 Play#1 command fire Play#1 output Play#1 1 Sector 4,0 ready to fire Play#1 output Play#1 1 range is 4.00 (4.50) + Play#1 output Play#1 1 \007Kaboom!!! Play#1 output Play#1 1 Target out of range. Play#1 output Play#1 6 0 620 Play#1 input fire se 4,0 14,0 Play#1 command fire Play#1 output Play#1 1 Sector 4,0 ready to fire Play#1 output Play#1 1 range is 4.00 (4.50) + Play#1 output Play#1 1 \007Kaboom!!! Play#1 output Play#1 1 Target out of range. Play#1 output Play#1 6 0 619 Play#1 input fire se 4,0 14,0 @@ -158,12 +164,14 @@ Play#1 command fire Play#1 output Play#1 1 Sector 4,0 ready to fire Play#1 output Play#1 1 range is 4.00 (4.50) + Play#1 output Play#1 1 \007Kaboom!!! Play#1 output Play#1 1 Target out of range. Play#1 output Play#1 6 0 617 Play#1 input fire se 4,0 14,0 Play#1 command fire Play#1 output Play#1 1 Sector 4,0 ready to fire Play#1 output Play#1 1 range is 4.00 (4.50) + Play#1 output Play#1 1 \007Kaboom!!! Play#1 output Play#1 1 Target out of range. Play#1 output Play#1 6 0 616 Play#1 input fire se 4,0 14,0 @@ -566,24 +574,28 @@ Play#1 command fire Play#1 output Play#1 1 bb battleship (#3) ready to fire Play#1 output Play#1 1 range is 4.00 (3.71) + Play#1 output Play#1 1 \007Kaboom!!! Play#1 output Play#1 1 Target out of range. Play#1 output Play#1 6 0 579 Play#1 input fire sh 3 0 Play#1 command fire Play#1 output Play#1 1 bb battleship (#3) ready to fire Play#1 output Play#1 1 range is 4.00 (3.71) + Play#1 output Play#1 1 \007Kaboom!!! Play#1 output Play#1 1 Target out of range. Play#1 output Play#1 6 0 578 Play#1 input fire sh 3 13 Play#1 command fire Play#1 output Play#1 1 bb battleship (#3) ready to fire Play#1 output Play#1 1 range is 4.00 (3.71) + Play#1 output Play#1 1 \007Kaboom!!! Play#1 output Play#1 1 Target out of range. Play#1 output Play#1 6 0 577 Play#1 input fire sh 3 12 Play#1 command fire Play#1 output Play#1 1 bb battleship (#3) ready to fire Play#1 output Play#1 1 range is 4.00 (3.71) + Play#1 output Play#1 1 \007Kaboom!!! Play#1 output Play#1 1 Target out of range. Play#1 output Play#1 6 0 576 Play#1 input fire sh 3 6,0 @@ -773,6 +785,7 @@ Play#1 command fire Play#1 output Play#1 1 dd destroyer (#5) ready to fire Play#1 output Play#1 1 range is 1.00 (1.50) + Play#1 output Play#1 1 \007Kaboom!!! Play#1 output Play#1 1 Target out of range. Play#1 output Play#1 6 0 543 Play#1 input fire sh 5 24 @@ -786,6 +799,7 @@ Play#1 command fire Play#1 output Play#1 1 dd destroyer (#5) ready to fire Play#1 output Play#1 1 range is 1.00 (1.50) + Play#1 output Play#1 1 \007Kaboom!!! Play#1 output Play#1 1 Target out of range. Play#1 output Play#1 6 0 541 Play#1 input fire sh 5 24 @@ -799,6 +813,7 @@ Play#1 command fire Play#1 output Play#1 1 dd destroyer (#5) ready to fire Play#1 output Play#1 1 range is 1.00 (1.50) + Play#1 output Play#1 1 \007Kaboom!!! Play#1 output Play#1 1 Target out of range. Play#1 output Play#1 6 0 539 Play#1 input fire sh 5 24 @@ -1095,24 +1110,28 @@ Play#1 command fire Play#1 output Play#1 1 hat hvy artillery #3 ready to fire Play#1 output Play#1 1 range is 4.00 (3.50) + Play#1 output Play#1 1 \007Kaboom!!! Play#1 output Play#1 1 Target out of range. Play#1 output Play#1 6 0 516 Play#1 input fire la 3 0 Play#1 command fire Play#1 output Play#1 1 hat hvy artillery #3 ready to fire Play#1 output Play#1 1 range is 4.00 (3.50) + Play#1 output Play#1 1 \007Kaboom!!! Play#1 output Play#1 1 Target out of range. Play#1 output Play#1 6 0 515 Play#1 input fire la 3 13 Play#1 command fire Play#1 output Play#1 1 hat hvy artillery #3 ready to fire Play#1 output Play#1 1 range is 3.00 (3.50) + Play#1 output Play#1 1 \007Kaboom!!! Play#1 output Play#1 1 Target out of range. Play#1 output Play#1 6 0 514 Play#1 input fire la 3 12 Play#1 command fire Play#1 output Play#1 1 hat hvy artillery #3 ready to fire Play#1 output Play#1 1 range is 3.00 (3.50) + Play#1 output Play#1 1 \007Kaboom!!! Play#1 output Play#1 1 Target out of range. Play#1 output Play#1 6 0 513 Play#1 input fire la 3 6,0 @@ -1194,6 +1213,7 @@ Play#1 command fire Play#1 output Play#1 1 hat hvy artillery #5 ready to fire Play#1 output Play#1 1 range is 3.00 (3.50) + Play#1 output Play#1 1 \007Kaboom!!! Play#1 output Play#1 1 Target out of range. Play#1 output Play#1 6 0 499 Play#1 input fire la 5 0,2 @@ -1207,6 +1227,7 @@ Play#1 command fire Play#1 output Play#1 1 hat hvy artillery #5 ready to fire Play#1 output Play#1 1 range is 3.00 (3.50) + Play#1 output Play#1 1 \007Kaboom!!! Play#1 output Play#1 1 Target out of range. Play#1 output Play#1 6 0 497 Play#1 input fire la 5 0,2 @@ -1220,12 +1241,14 @@ Play#1 command fire Play#1 output Play#1 1 hat hvy artillery #5 ready to fire Play#1 output Play#1 1 range is 3.00 (3.50) + Play#1 output Play#1 1 \007Kaboom!!! Play#1 output Play#1 1 Target out of range. Play#1 output Play#1 6 0 495 Play#1 input fire la 5 0,2 Play#1 command fire Play#1 output Play#1 1 hat hvy artillery #5 ready to fire Play#1 output Play#1 1 range is 3.00 (3.50) + Play#1 output Play#1 1 \007Kaboom!!! Play#1 output Play#1 1 Target out of range. Play#1 output Play#1 6 0 494 Play#1 input lcarg * ?shell>0