aliens

Author Topic: Improve ammo recovery for HWPs during debriefing  (Read 291 times)

Offline zRrr

  • Sergeant
  • **
  • Posts: 22
    • View Profile
Improve ammo recovery for HWPs during debriefing
« on: March 01, 2024, 10:14:03 pm »
Currently debriefing screen handles recovery of HWP ammo in separate branch of code. That branch does not work with multiple ammo slots, or other fixed weapons, that may be built-in in hwp armor, so any clips loaded are lost, even if they were not used.

This is an issue for Piratez. Piratez use hwps for special characters, because they can be used as research prerequisite, event triggers, etc. Recent updates introduced two characters (Lady Gudrun The Sorceress and Red Mage Ascendant) that shoot bunch of spells, using several ammo slots and action to slot mapping. Ammo for them is expensive and losing it just because it was loaded is a bit sad.

Reproduction: make HWP with several ammo slots and access to inventory. Go to battle, load all extra ammo, abort. Observe loss of clips in base inventory. I've attached mod with multiple hwps that take HC-AP, AC-AP and pistol clips for built-in second weapon.

I've tried to fix it, by moving recovery code into DebriefingState::recoverItems, and I think it works, as in 'game does not crash and I get expected number of clips back after mission'. Patch also enables merge of used hwp clips, which is difference from OXC, but does not affect unmodded games.

https://github.com/zrrr111/oxce-hwp-ammo-recovery/commit/0530b1ed822725741992f46383c2a4f062e249c3

edit 2024/04/21: moved some comments into github comments, added more testcases for multistage missions.
« Last Edit: April 21, 2024, 08:51:57 pm by zRrr »