]> git.pond.sub.org Git - empserver/commitdiff
fire: Print "Kaboom" even when the target is out of range
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 8 Feb 2015 11:29:22 +0000 (12:29 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Mon, 2 Mar 2015 07:20:51 +0000 (08:20 +0100)
To make shell use more obvious.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/commands/mfir.c
tests/fire/journal.log

index 2cd3a810d9adc5a41fecac07e28bd61e1af69b81..527dba16b15ccdb9349bfe62229f423568ffb2d5 100644 (file)
@@ -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:
index 0386fc481161e0b167566a94c99b82f83b059829..3de19ac5ac68bc22e172d74314514638109fce2c 100644 (file)
     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
     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
     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
     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
     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
     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
     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
     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
     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
     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