OpenXcom Forum

Modding => OXCE Support => OpenXcom Extended => OXCE Support Y-scripts => Topic started by: Buscher on January 14, 2023, 08:20:34 pm

Title: [Solved] Difference between some scripting hooks in group bonuses
Post by: Buscher on January 14, 2023, 08:20:34 pm
We were looking at the scripting hooks such as energyRecoveryBonusStats and energySoldierRecoveryBonusStats. I didn't really get smart looking at them in the source code. BonusSoldierStatsRecoveryParser and BonusStatsRecoveryParser inherit from BonusStatsBaseParser but I don't really see a difference the two.

What is the difference between these hooks?
Thanks.
Title: Re: Difference between some scripting hooks in group bonuses
Post by: Yankes on January 15, 2023, 11:13:57 am
If two hooks inhere from same base class then its mean they have same functionality but are used in different place.

In this case we have difference to what given hooks is linked,
in case of `energyRecoveryBonusStats` is to Armor and in case `energySoldierRecoveryBonusStats` to solder bonus stats.

Both are called at same moment but primary hook is `energyRecoveryBonusStats` and `energySoldierRecoveryBonusStats` only used to prepare initial value of additional bonus stat based on each bonus solder have.
Title: Re: Difference between some scripting hooks in group bonuses
Post by: Buscher on January 20, 2023, 09:47:24 pm
That clears it up. Thank you very much Yankes!