OpenXcom Forum
OpenXcom Forks => OXCE Support => OpenXcom Extended (OXCE) => OXCE Support Y-scripts => Topic started by: Ethereal on October 27, 2024, 12:32:51 pm
-
I recently encountered something strange - a soldier had full health at the end of a battle, but 10 fatal wounds. He received 0 days of treatment. I don't think this is right. Each fatal wound should increase the duration of treatment by 10 days or so.
In general, it would be good to have a global option that would regulate the number of days of treatment for each fatal wound remaining after the battle.
-
This is already doable via scripts.
-
Days of recovery are modifiable by `returnFromMissionUnit` by `recovery_time` parameter, you can set any logic you want there.
-
Thanks for the answers, but I’m still not a good scripter. But I'll try.
-
One thing you look for is `getFatalwoundsTotal` function that get all fatal wounds from every body part.
Usage look like `unit.getFatalwoundsTotal total;` where `total` is local variable you define and after this line it will have total of wounds.
-
Here's a script that adds 10 days extra recovery for each fatal wound:
extended:
scripts:
returnFromMissionUnit:
- new: YSCRIPT_EXTRA_RECOVERY_AFTER_MISSION
offset: 10
code: |
var int total;
unit.getFatalwoundsTotal total;
mul total 10;
add recovery_time total;
return;
-
Here's a script that adds 10 days extra recovery for each fatal wound:
Thank you. It works.