]> git.pond.sub.org Git - empserver/commitdiff
edit: Implement editing of missile fortification
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 27 Aug 2017 12:47:31 +0000 (14:47 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 5 Jan 2021 06:23:45 +0000 (07:23 +0100)
The edit command doesn't support editing plane fortification.  Has
always been that way.  Implement it as key 'F'.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/commands/edit.c
tests/actofgod/final.xdump
tests/actofgod/geninput.pl
tests/actofgod/journal.log

index 781246480265e6892c67d6919ee1e75f1baed1f7..c345f168f845fdd3ae1b7bc727dc519b0a0da4a0 100644 (file)
@@ -1133,6 +1133,13 @@ edit_plane(struct plnstr *plane, char *key, char *p)
                           "from %d to %d", plane->pln_tech, arg);
        pln_set_tech(plane, arg);
        break;
+    case 'F':
+       arg = LIMIT_TO(arg, 0, pcp->pl_flags & P_M ? 127 : 0);
+       divine_unit_change((struct empobj *)plane, "Fortification",
+                          arg != plane->pln_harden, arg - plane->pln_harden,
+                          "from %d to %d", plane->pln_harden, arg);
+       plane->pln_harden = arg;
+       break;
     case 'r':
        arg = LIMIT_TO(arg, 0, pl_range(pcp, plane->pln_tech));
        divine_unit_change((struct empobj *)plane, "Range",
index 7bde7edde2ecbf7ff9cc20387ce9e9f7526fae56..0470238e03318c69b809defee1dbbf9be5e53e8d 100644 (file)
@@ -189,6 +189,10 @@ uid owner xloc yloc type effic mobil off tech opx opy mission radius wing range
 6 1 0 0 9 10 0 0 90 0 0 none 0 "" 0 0 -1 -1 () 0 0.00000
 7 1 0 0 9 10 0 0 90 0 0 none 0 "" 17 0 -1 -1 () 0 0.00000
 8 1 0 0 0 10 0 0 90 0 0 none 0 "" 9 0 -1 -1 () 0 0.00000
+12 1 0 0 28 10 0 0 145 0 0 none 0 "" 0 0 -1 -1 () 0 0.00000
+13 1 0 0 28 10 0 0 145 0 0 none 0 "" 0 0 -1 -1 () 0 0.00000
+14 1 0 0 28 10 0 0 145 0 0 none 0 "" 0 127 -1 -1 () 0 0.00000
+15 1 0 0 28 10 0 0 145 0 0 none 0 "" 0 127 -1 -1 () 0 0.00000
 49 0 0 0 0 0 0 0 0 0 0 none 0 "" 0 0 -1 -1 () 0 0.00000
 /config
 config land
@@ -216,20 +220,22 @@ uid owner xloc yloc type effic mobil off tech opx opy mission radius stockpile p
 config news
 actor action victim times duration time
 0 44 1 47 0 0
-0 43 2 7 0 0
-0 44 3 28 0 0
-0 43 1 105 0 0
+0 43 2 6 0 0
+0 44 3 27 0 0
+0 43 1 109 0 0
 0 42 1 20 0 0
 1 45 0 3 0 0
-0 43 3 53 0 0
+0 43 3 47 0 0
 0 44 2 14 0 0
 0 42 2 20 0 0
 2 45 0 2 0 0
 0 42 3 6 0 0
-0 44 1 5 0 0
+0 44 1 6 0 0
+0 43 2 5 0 0
+0 44 3 1 0 0
+0 43 1 7 0 0
 0 43 4 2 0 0
-0 43 2 4 0 0
-0 43 1 3 0 0
+0 43 3 6 0 0
 0 33 0 2 0 0
 /config
 config trade
index 4232cabf6599e0e6ddbe6cc632a752d1ea63f12f..520e33b8b8d440b1d2e0d29c0815204bc873bd1b 100755 (executable)
@@ -261,13 +261,18 @@ edit_int('ship', 2, (
 edit('plane', 6, 'T', 'mb', 'O', 1, 'T', 'mb', 'T', 'hb', 'T', 'mb');
 edit('plane', 7, 'O', 1, 'r', 255, 'T', 'hb', 'T', 'mb');
 edit('plane', 8, 'O', 1, 'T', 'hb', 'r', 255, 'T', 'f1');
+edit('plane', 12, 'T', 'ssm', 'O', 1, 'U', 13, 'U', 14, 'U', 15);
 
-# plane: effic mobil range tech
+# plane: effic mobil range tech harden
 edit_int('plane', 2, (
     ['e', 0, 100],
     ['m', -127, 127],
     ['r', 0, 9],
     ['t', 50, 32767],
+    ['F', 0, 0],
+));
+edit_int('plane', 12, (
+    ['F', 0, 127],
 ));
 
 # land: type
index 665793a4dfd902b4f52bc20679bb6cf1ea748067..c131547a6c4b1b8e7516097359614cf6c80ba448 100644 (file)
     Play#0 output Play#0 1 Range of hb   B-26B Marauder #8 changed from 0 to 15
     Play#0 output Play#0 1 Type of hb   B-26B Marauder #8 changed to f1   Sopwith Camel
     Play#0 output Play#0 6 0 640
+    Play#0 input edit p 12 T ssm O 1 U 13 U 14 U 15
+    Play#0 command edit
+    Play#0 output Play#0 1 Type of f1   Sopwith Camel #12 changed to ssm  V2
+    Play#0 output Play#0 1 Owner of ssm  V2 #12 changed from POGO (#0) to 1 (#1)
+    Play#0 output Play#0 1 Efficiency of ssm  V2 #12 changed from 0 to 10
+    Play#0 output Play#0 1 ssm  V2 #12 duplicated to (#13)
+    Play#0 output Play#0 1 ssm  V2 #13 duplicated to (#14)
+    Play#0 output Play#0 1 ssm  V2 #14 duplicated to (#15)
+    Play#0 output Play#0 6 0 640
     Play#0 input edit p 2 e 1
     Play#0 command edit
     Play#0 output Play#0 1 Efficiency of f1   Sopwith Camel #2 unchanged
     Play#0 command edit
     Play#0 output Play#0 1 Tech level of f1   Sopwith Camel #5 changed from 100 to 32767
     Play#0 output Play#0 6 0 640
+    Play#0 input edit p 2 F 0
+    Play#0 command edit
+    Play#0 output Play#0 1 Fortification of f1   Sopwith Camel #2 unchanged
+    Play#0 output Play#0 6 0 640
+    Play#0 input edit p 3 F -1
+    Play#0 command edit
+    Play#0 output Play#0 1 Fortification of f1   Sopwith Camel #3 unchanged
+    Play#0 output Play#0 6 0 640
+    Play#0 input edit p 4 F 0
+    Play#0 command edit
+    Play#0 output Play#0 1 Fortification of f1   Sopwith Camel #4 unchanged
+    Play#0 output Play#0 6 0 640
+    Play#0 input edit p 5 F 1
+    Play#0 command edit
+    Play#0 output Play#0 1 Fortification of f1   Sopwith Camel #5 unchanged
+    Play#0 output Play#0 6 0 640
+    Play#0 input edit p 12 F 1
+    Play#0 command edit
+    Play#0 output Play#0 1 Fortification of ssm  V2 #12 changed from 0 to 1
+    Play#0 output Play#0 6 0 640
+    Play#0 input edit p 12 F 0
+    Play#0 command edit
+    Play#0 output Play#0 1 Fortification of ssm  V2 #12 changed from 1 to 0
+    Play#0 output Play#0 6 0 640
+    Play#0 input edit p 13 F -1
+    Play#0 command edit
+    Play#0 output Play#0 1 Fortification of ssm  V2 #13 unchanged
+    Play#0 output Play#0 6 0 640
+    Play#0 input edit p 14 F 126
+    Play#0 command edit
+    Play#0 output Play#0 1 Fortification of ssm  V2 #14 changed from 0 to 126
+    Play#0 output Play#0 6 0 640
+    Play#0 input edit p 14 F 127
+    Play#0 command edit
+    Play#0 output Play#0 1 Fortification of ssm  V2 #14 changed from 126 to 127
+    Play#0 output Play#0 6 0 640
+    Play#0 input edit p 15 F 128
+    Play#0 command edit
+    Play#0 output Play#0 1 Fortification of ssm  V2 #15 changed from 0 to 127
+    Play#0 output Play#0 6 0 640
     Play#0 input edit u 6 T art O 1 T art T hat g 12 T art
     Play#0 command edit
     Play#0 output Play#0 1 Type of cav  cavalry #6 changed to art  artillery
     Play#0 output Play#0 1 Type of f1   Sopwith Camel #8 changed to hb   B-26B Marauder by an act of POGO
     Play#0 output Play#0 1 Range of hb   B-26B Marauder #8 changed from 0 to 15 by an act of POGO
     Play#0 output Play#0 1 Type of hb   B-26B Marauder #8 changed to f1   Sopwith Camel by an act of POGO
+    Play#0 output Play#0 1 ssm  V2 #12 given to you by an act of POGO!
+    Play#0 output Play#0 1 ssm  V2 #13 given to you by an act of POGO!
+    Play#0 output Play#0 1 ssm  V2 #14 given to you by an act of POGO!
+    Play#0 output Play#0 1 ssm  V2 #15 given to you by an act of POGO!
+    Play#0 output Play#0 1 Fortification of ssm  V2 #12 changed from 0 to 1 by an act of POGO
+    Play#0 output Play#0 1 Fortification of ssm  V2 #12 changed from 1 to 0 by an act of POGO
+    Play#0 output Play#0 1 Fortification of ssm  V2 #14 changed from 0 to 126 by an act of POGO
+    Play#0 output Play#0 1 Fortification of ssm  V2 #14 changed from 126 to 127 by an act of POGO
+    Play#0 output Play#0 1 Fortification of ssm  V2 #15 changed from 0 to 127 by an act of POGO
     Play#0 output Play#0 1 art  artillery #6 given to you by an act of POGO!
     Play#0 output Play#0 1 Type of art  artillery #6 changed to hat  hvy artillery by an act of POGO
     Play#0 output Play#0 1 POGO gave you 12 guns in hat  hvy artillery #6