In connection with my random events project, I had another look at monsters:
Borg Cube IDs (all jnz)
40E099 cmp word [eax+52h], 73h // 0xD49D
42B333 cmp word [eax+52h], 73h // 0x2A737 (AI empire reactions to Borg presence)
4359E3 cmp word [eax+52h], 73h // 0x34DE7
We can use instead: cmp word [eax+28h], 24h // (works with any shiplist)
At 0xD49C, 0x2A736 and 0x34DE6 change: 52 73 to: 28 24.
Explanation:
Ds: 5B2344 [GShipList]
Offset 0x0028 to 0x0029 = race-ID (even for monster unique, but not in shiplist.sst order !)
Offset 0x0052 to 0x0053 = shiplist.sst-ID
On this occasion, I also had another look at extending the shiplist phase II.
Word instead of single-byte registers - not very complicated (excepting possible issues with ship-ID "FF") - but all in all ~200 code sequences would have to be rewritten:
sub_46F940 (read_shiptech_sst) -> 15 calls
sub_46F9C0 (read_shiplist_sst) -> 155 calls
So even with a very optimistic assumption of 5 minutes per code location...
Thereby the following deliberations become more or less moot.
Monster switches:
0x
4E878 -> Monster system attack (borg, crystal & tarellian)
44F472 mov ax, [eax+28h]
44F476 sub eax, 24h
0x
4F357 -> monster race-IDs (+cube count) via ship-IDs
44FF51 mov ax, [edx+28h]
44FF55 sub eax, 24h
NOTE jump tables for switch statement (order of addresses) have to be addapted at 44F3F0 & 44FED0 each:
(old order via shiplist.sst-ID)
0 - Borg Cube (73)
1 - Calamarain (74)
2 - Chodak (75)
3 - Crystal Entity (76)
4 - Combat Drone (77)
5 - Edo Guardian (78 )
6 - Gomtuu (79)
7 - Husnock (7A)
8 - Orbital Battery (7B)
9 - Tarellian (7C)
(new order via monster race-ID)
0 - Borg Cube 24
1 - Crystal Entity 25
2 - Chodak 26
3 - Calamarain 27
4 - Gomtuu 28
5 - Tarellian 29
6 - Edo Guardian 2A
7 - Combat Drone 2B
8 - Husnock 2C
9 - (redundant)
0x
49DA5 (loc_44A99F) -> monster torpedoes
0x
49FC5 (loc_44ABBF) -> monster phaser
Source of ship-ID is shiplist.sst for both: -> mov ax, [ecx+66h] -> sub eax, 0x73
This should work instead: mov ax, [ecx+118h]
(or mov ax, bx) -> sub eax, 0x24
and set controlling race in shiplist.sst for monsters accordingly i.e. 0x24 +0-9.
So monsters would be just like all the other ships - see also:
Weapon labels of ships/ Beams & Torpedoes
Here it's faster to keep the old order (e.g. 25=Calamarain, not Crystal Entity).
Remaining monster-IDs in trek.exe (still need to be adapted for each resizing of shiplist)
0x
4E698 (loc_44F295) -> Cube ID (block cube check)
Sub_44FAA4 (add_new_Monster) - ship-IDs (&name) via monster race-IDs
0x4EEDB - Borg Cube ID (73)
0x4F0DB - Calamarain ID (74)
0x4F05A - Chodak ID (75)
0x4F01B - Crystal Entity ID (76)
0x4F1F7 - Combat Drone ID (77)
0x4F1B2 - Edo Guardian ID (78 )
0x4F121 - Gomtuu ID (79)
0x4F232 - Husnock ID (7A)
0x4F173 - Tarellian ID (7C)
Number of ships:
0x
6EC0A (sub_46F7D0) -> redundant
replace at 0x6EC08 -> 83 F8 7D 7D 5E with 90 90 90 90 90
0x
6EC68 (loc_46F85D) -> also redundant (at least in my tests, due to shiprace check)
replace at 0x6EC66 -> 83 FA 7D 7C with 90 90 90 EB
0x
6EF89 (loc_46FB6A) -> redundant
replace at 0x6EF87 -> 66 3D 7D 00 74 with 90 90 90 90 EB
0x
6F02F (loc_46FC0A) -> redundant
replace at 0x6F02D -> 66 3D 7D 00 74 with 90 90 90 90 EB
EDIT:
47983C cmp edi, 7Dh -> number of ships (unused) - See
combat.bin.
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.