These code errors are quite easy to correct: (jle -> jl)Gowron wrote:3. Orbital Batteries:
...there's some odd effect: You can take on a LV8 orbital battery with a 640 HP (shields + hull) Cardassian Cruiser II, and it will survive with 0 HPs... This doesn't make much sense
Ships survive with 0 HPs (fix):
at 0x67AA6 and at 0x67B5B change 8E to -> 8C (asm-4686A5 & 46875A)
Note the value at 0x67AA6 i.e. asm-4686A5 should NOT be changed when using the defensive bonus for Strike Cruisers against OBs!
OBs survive with 0 PTs (fix):
at 0x67CB3 change 7E to -> 7C (asm-4688B3)
OB firepower : (defense output * tech level)
Code: Select all
46853A mov edx, 5 // tech-ID (weapon)
Code: Select all
468552 mov edx, 2 // tech-ID (construction)
Code: Select all
46856D 0FAFC8 IMUL ECX,EAX
468570 0FAFC2 IMUL EAX,EDX
468573 9090 NOP
468575 898C248C020000 MOV [ESP+28C],ECX
Option: no SH protection for active OBs (i.e. SH power not wasted for OBs )
Code: Select all
at 0x67C8B change -> 7D to EB
and at 0x67CA9
change:
29 DD C7 00 00 00 00 00
to:
90 90 90 90 90 90 90 90
46888B jge short_4688A2 // jge = jmp
4688A9 sub ebp, ebx // removed
4688AB mov dword ptr [eax], 0 // removed
Gowron wrote:Although Strike Cruisers are labelled as orbital killers, regular Cruisers will do better.
Establishing a defensive bonus for Strike Cruisers against OBs
The below modification reduces the firepower of the OBs against Strike Cruisers, but only for one OB per Strike Cruiser. So this specialised counter ability is limited if there are more active batteries than attacking ships (i.e. when approaching to the planet in order to bomb, whilst there are remaining OB shots). For more info see: Attacking a System
Code: Select all
trek.exe at 0x67A54
replace:
8B 84 04 3E 02 00 00 C1 F8 10 E8 2D 20 FE FF 89 C1 89 C3 31 C0 89 E2 8A 41 52 E8 4D 73 00 00 8B 94 24 90 02 00 00 85 D2 0F 84 80 01 00 00 8B 84 24 8C 02 00 00 8D 72 FF 8B 79 38 89 B4 24 90 02 00 00 39 F8 0F 8E F8 01 00 00 8B 71 3C 29 F8 39 F0 0F 8E 50 01 00 00 8B B4 24 80 02 00 00 8B 51 28 8B 41 4E C1 FA 10 C1 F8 10
with:
66 8B 84 04 40 02 00 00 E8 2F 20 FE FF 8B C8 8B D8 8B D4 8A 41 52 E8 51 73 00 00 8B B4 24 90 02 00 00 85 F6 0F 84 84 01 00 00 8B 84 24 8C 02 00 00 4E 80 7C 24 68 03 75 03 C1 E8 01 8B 79 38 89 B4 24 90 02 00 00 3B C7 0F 8E F4 01 00 00 8B 71 3C 2B C7 3B C6 0F 8C 4C 01 00 00 8B B4 24 80 02 00 00 66 8B 51 2A 66 8B 41 50
468654 668B840440020000 MOV AX,WORD PTR[ESP+EAX+240]
46865C E82F20FEFF CALL 44A690 (read_GShipList)
468661 8BC8 MOV ECX,EAX
468663 8BD8 MOV EBX,EAX
468665 8BD4 MOV EDX,ESP
468667 8A4152 MOV AL,BYTE PTR[ECX+52]
46866A E851730000 CALL 46F9C0 (read_shiplist.sst)
46866F 8BB42490020000 MOV ESI,DWORD PTR[ESP+290]
468676 85F6 TEST ESI,ESI (remaining OB-shots)
468678 0F8484010000 JE 468802 (ship-weapons free)
46867E 8B84248C020000 MOV EAX,DWORD PTR[ESP+28C]
468685 4E DEC ESI
468686 807C246803 CMP BYTE PTR[ESP+68],3
46868B 7503 JNZ SHORT 468690
46868D C1E801 SHR EAX,1 (OB firepower/2^1)
468690 8B7938 MOV EDI,DWORD PTR[ECX+38]
468693 89B42490020000 MOV DWORD PTR[ESP+290],ESI
46869A 3BC7 CMP EAX,EDI
46869C 0F8EF4010000 JLE 468896 (shields_only)
4686A2 8B713C MOV ESI,DWORD PTR[ECX+3C]
4686A5 2BC7 SUB EAX,EDI
4686A7 3BC6 CMP EAX,ESI
4686A9 0F8C4C010000 JL 4687FB (hull_damage)
4686AF 8BB42480020000 MOV ESI,DWORD PTR[ESP+280]
4686B6 668B512A MOV DX,WORD PTR[ECX+2A]
4686BA 668B4150 MOV AX,WORD PTR[ECX+50]
Note wrt the Ships survive with 0 HPs (fix): Change only 0x67B5B (8E-> 8C) the first fix is part of the Strike Cruiser patch!
Adjusting ship weapons damage against OBs (unmodded first SH):
(ships that survive the OB initial attack)
The addresses [ESP+] represent shiplist.sst +84, +88 & +8C (i.e. torpedo number, multiplier & damage)+120h
Code: Select all
468812 8BAC24AC010000 MOV EBP, [ESP+1AC]
468819 0FAFAC24A8010000 IMUL EBP, [ESP+1A8]
468821 0FAFAC24A4010000 IMUL EBP, [ESP+1A4]
and (relevance unclear) +240h / +360h :
46896B 8B8424CC020000 MOV EAX, [ESP+2CC]
468972 0FAF8424C8020000 IMUL EAX, [ESP+2C8]
46897A 0FAF8424C4020000 IMUL EAX, [ESP+2C4]
468997 8B9424EC030000 MOV EDX, [ESP+3EC]
46899E 0FAF9424E8030000 IMUL EDX, [ESP+3E8]
4689A6 0FAF9424E4030000 IMUL EDX, [ESP+3E4]
Adjusting ship weapons bombing damage (SH, population & buildings):
(ships that survive ALL OB shots)
Code: Select all
467472 8B8424AC010000 MOV EAX, [ESP+1AC]
467479 0FAF8424A8010000 IMUL EAX, [ESP+1A8]
467481 0FAF8424A4010000 IMUL EAX, [ESP+1A4]
For example we could use unused parts of the plasma stats in shiplist.sst for the creation of ship-specific (& ship to ship combat independent) bombing resp. OB attacking abilities. This should be safe as long as we keep +0xB4 (plasma attNum) = 0. shiplist.sst at +0xBC (plasma attMul) I suggest we leave for a future use as pulse weapon graphic indicator.
Example: (change code for torpedo multiplier to ex-plasma attLev)
+0xB8 (ex-plasma attLev) -> position exactly 3 lines below the torpedo multiplier (+0x88)
The new value is at shiplist.sst +0xB8 (ex-plasma attLev) so we increase all values by 0x30:
468819 imul ebp, [esp+1A8h] -> +1D8h
-> at 0x67C1D change A8 -> to D8
468972 imul eax, [esp+2C8h] -> +2F8h
-> at 0x67D76 change C8 -> to F8
46899E imul edx, [esp+3E8h] -> +418h
-> at 0x67DA2 change E8 03 -> to 18 04
same for bombing damage: (other value/address optional)
467479 imul eax, [esp+1A8h] -> +1D8h
-> at 0x6687D change A8 -> to D8
From the counter-system point of view, perfect solution would be to use each a custom data-field in shiplist for OB-combat & an other for bombing (i.e. adapting each address of the first statement and removing the other two statements). But that's a considerable expenditure and one needs a mod manual, because there is no in-game display for these ship abilities.
The 'bombard system' morale event gets randomly prevented (not the worst, since it curbs exploiting). Removing the jmp statement at 46844F skips the random engine, but this will apply the morale effect even if all ships were destroyed by OBs (i.e. bombing task prevented): at 0x6784F change 75 22 to -> 90 90
Registers:
[esp+270h] = number of OBs
[esp+284h] = destroyed OBs
[esp+28Ch] = OB firepower
[esp+290h] = remaining OB-shots
[esp+294h] = OB HitPoints (reloaded from [esp+26Ch] for next OB)
Possible future projects:
-> prevent wastage of OB overflow damage (possible options):
- techlevel * OB shots (instead of * OB firepower) problem: target selection
- shots * firepower to [esp+28Ch] & check if lower 1 (instead of [esp+290h], 0)
- if ships destroyed store overflow damage & add to next OB shot
-> prevent the line-up of specific ship types as cheap 'OB blocker' (colony, scout, destroyer?)
-> building hitpoints:
Code: Select all
466EF9 mov edx, 2 // construction tech