I've been poking through a couple of areas of the combat engine I haven't decoded yet (e.g. the secondary weapon effects - knockdown, poison, stun, etc.). I've found a couple of oddities (likely bugs), and wanted to get some input on ideas for the best way to fix them.
First - can anyone confirm if they have seen a "critical miss" in vanilla FOT 1.27 (ideally with a save just before that miss could occur)? The reason I ask is that I found the routine that appears to calculate the critical miss chance (low luck and Jinxed trait increase the chances), but the subroutine that appears to have been intended to apply the critical miss effect has been nulled out, with the result that a "critical miss" always misses all targets (even for burst and area attacks). I've also found the tables that appear to determine the critical miss effect by weapon type (unarmed, melee, and ranged), but IDA tells me no code refers to them. I'll add a scripting hook for FTSE to allow mods to use and customize the behavior, but should I make an attempt at trying to recreate the original behavior? (Wondering if this was removed for balance reasons.)
Second - I've surprisingly found code in the secondary weapon effect routine that refers to the Bonsai perk, but unsurprisingly it's broken. The way the code is currently written is as follows:
1. When a character receives either radiation or poison damage, check if they have the Bonsai perk, and have already received 50 radiation / 20 poison damage. If so, continue; if not, skip below and apply the damage as normal.
2. Roll a number from 0-99, and check if it is less than the current radiation/poison damage being applied (for poison only, multiply the damage taken by 2.5 first). If so, continue; if not, skip below and apply the damage as normal.
3. Remove 50 radiation / 20 poison from the character that was hit.
4. Create a fruit item, but override the normal 4? points of healing from the fruit with either 10-20 radiation or 5-10 poison damage. (Presumably, the intent is that a Bonsai character can extract radiation or poison into fruit to expel it.) Unfortunately, the fruit item isn't added to any inventory or placed on the ground anywhere, so the player never sees the effect (and, an entity entry for the current level is permanently leaked).
5. A change of color is applied to the character's "base" color entry. This is quite odd - maybe this was supposed to be applied to the fruit object instead?
6. Finally, apply the original radiation/poison damage.
So, a question to everyone - what, if anything, should I do to fix this? The closest to original intent would probably be to add the fruit to the inventory, and get rid of the color swap. But is the perk really worth it? Or should I modify it to work more like the original docs described (random fruit appearing at times)? Or, zero out the effect entirely and free up a perk slot for future use?
First - can anyone confirm if they have seen a "critical miss" in vanilla FOT 1.27 (ideally with a save just before that miss could occur)? The reason I ask is that I found the routine that appears to calculate the critical miss chance (low luck and Jinxed trait increase the chances), but the subroutine that appears to have been intended to apply the critical miss effect has been nulled out, with the result that a "critical miss" always misses all targets (even for burst and area attacks). I've also found the tables that appear to determine the critical miss effect by weapon type (unarmed, melee, and ranged), but IDA tells me no code refers to them. I'll add a scripting hook for FTSE to allow mods to use and customize the behavior, but should I make an attempt at trying to recreate the original behavior? (Wondering if this was removed for balance reasons.)
Second - I've surprisingly found code in the secondary weapon effect routine that refers to the Bonsai perk, but unsurprisingly it's broken. The way the code is currently written is as follows:
1. When a character receives either radiation or poison damage, check if they have the Bonsai perk, and have already received 50 radiation / 20 poison damage. If so, continue; if not, skip below and apply the damage as normal.
2. Roll a number from 0-99, and check if it is less than the current radiation/poison damage being applied (for poison only, multiply the damage taken by 2.5 first). If so, continue; if not, skip below and apply the damage as normal.
3. Remove 50 radiation / 20 poison from the character that was hit.
4. Create a fruit item, but override the normal 4? points of healing from the fruit with either 10-20 radiation or 5-10 poison damage. (Presumably, the intent is that a Bonsai character can extract radiation or poison into fruit to expel it.) Unfortunately, the fruit item isn't added to any inventory or placed on the ground anywhere, so the player never sees the effect (and, an entity entry for the current level is permanently leaked).
5. A change of color is applied to the character's "base" color entry. This is quite odd - maybe this was supposed to be applied to the fruit object instead?
6. Finally, apply the original radiation/poison damage.
So, a question to everyone - what, if anything, should I do to fix this? The closest to original intent would probably be to add the fruit to the inventory, and get rid of the color swap. But is the perk really worth it? Or should I modify it to work more like the original docs described (random fruit appearing at times)? Or, zero out the effect entirely and free up a perk slot for future use?