Hello there, NMA.
Some of my findings might be relevant to already mentioned issues (there is much more, but it'll take time to write it all down. I'll try to do this when I find some spare time). All of the code is from PC version:
1. Weapon Knockback, and it's behaviour with various weapons
Code:
CPU Disasm
Address Hex dump Command Comments
00424AD0 |. 837C24 04 06 CMP DWORD PTR SS:[LOCAL.15],6
00424AD5 |. 74 1A JE SHORT 00424AF1
00424AD7 |. 837E 08 00 CMP DWORD PTR DS:[ESI+8],0
00424ADB |. 74 14 JE SHORT 00424AF1
00424ADD |. 8B56 04 MOV EDX,DWORD PTR DS:[ESI+4]
00424AE0 |. 8B46 08 MOV EAX,DWORD PTR DS:[ESI+8]
00424AE3 |. E8 98370500 CALL _item_w_subtype ; [FALLOUT2._item_w_subtype
00424AE8 |. 83F8 02 CMP EAX,2
00424AEB |. 0F85 B1000000 JNE compute_damage_end ; bail out if non-explode and real weapon type != 2
00424AF1 |> 8B4424 14 MOV EAX,DWORD PTR SS:[LOCAL.11]
00424AF5 |. 8B40 64 MOV EAX,DWORD PTR DS:[EAX+64]
00424AF8 |. C1E8 18 SHR EAX,18
00424AFB |. 83F8 01 CMP EAX,1 ; already knocked down?
00424AFE |. 0F85 9E000000 JNE compute_damage_end
00424B04 |. 8B4424 14 MOV EAX,DWORD PTR SS:[LOCAL.11]
00424B08 |. BA 00400000 MOV EDX,4000
00424B0D |. 8B40 64 MOV EAX,DWORD PTR DS:[EAX+64]
00424B10 |. E8 979B0000 CALL _critter_flag_check ; [fallout2.flag_read
00424B15 |. 85C0 TEST EAX,EAX ; knockdown flag test
00424B17 |. 0F85 85000000 JNE compute_damage_end
Then the knockbacking section follows.
compute_damage_end is actually 00424BA2. LOCAL.15 (stack variable +4) holds the damage type, 6 is explode. Item subtype 2 means melee weapon. As one can see, entire knockback section is skipped when real weapon is not of melee type and not explode type, OR one of the checks: critter is already knocked; critter is unknockable is passed.
What knockback section does is updating [offset_attack_struct+34] to the certain value (damage/10; weapon knockback perk makes it damage/5; stonewall makes check if (rnd(0,100) \lt 50) and sets 0 in case of success; also, stonewall divides the total value by 2, no matter the throw result). This value is then used by action_knockback to determine the number of hexes travelled by the target.
2. Weapon Enhanced Knockout (yep, there's no such thing like Enhanced Knockback)
This works pretty much as Kanhef described and with any weapon type.
3. Weapon perks, concerning ToHit
If I'm not mistaken somehow, this works like this:
http://fonlinedocs.netii.net/tohit2.c
I was testing this reversed formula in FO2, and it worked fine.
4. Special unarmed attacks
+critical chance is actually "partial slayer". +50% chance means that non-critical hit have 50% chance to be upgraded. Also, The code (starting at 42394A) is bugged: only two of the attacks are checked, the rest of the upgrading code (for other attacks) is there, but is skipped. However, this can be easily fixed by changing jump addresses.
Code:
CPU Disasm
Address Hex dump Command Comments
0042394A |> \8B56 04 MOV EDX,DWORD PTR DS:[ESI+4] ; = attack type
0042394D |. 83FA 10 CMP EDX,10 ; next: special unarmed attacks, upgrade to critical, BUGGED!
00423950 |. 74 09 JE SHORT 0042395B
00423952 |. 83FA 09 CMP EDX,9
00423955 |. 0F85 B2000000 JNE special_no_upgrade
Then the upgrade code follows, ending just before special_no_upgrade (423A04).
[edit] Ah yeah, forgot to add something already written down:
http://fonlinedocs.netii.net/fo2calg.pdf - critical failures behaviour. The tables themselves:
Code:
fallout2.exe at file offset 0x1065A0
row: weapon type (critfail list), column: critfail severity
0x00000000 0x00800000 0x00800000 0x02000800 0x00002000
0x00000000 0x00800000 0x00400000 0x00001000 0x00000100
0x00000000 0x00000200 0x00400000 0x00001000 0x00200000
0x00800000 0x00800200 0x00C00000 0x00001000 0x00900000
0x00000400 0x00400000 0x00400800 0x00001000 0x00100000
0x00800000 0x00000400 0x00200000 0x00001000 0x02900000
0x00000000 0x00800000 0x00001000 0x00200000 0x00940000
0x00000100 hit self
0x00000200 lost rest of ammo
0x00000400 fired dud shot
0x00000800 hurt self
0x00001000 hit randomly
0x00002000 crippled random limb
0x00040000 on fire
0x00100000 weapon exploded
0x00200000 weapon destroyed
0x00400000 weapon dropped
0x00800000 lost next turn
0x02000000 knocked down