I don't remember who asked for this, but here goes, it's just a global variable:
stunningImprovesMorale: true # default false
Basically when someone stuns an enemy, they get a similar morale bonus as for killing them.
Only once though, to prevent abuse of repeatedly reviving and stunning an enemy.
The winning team also gets (a smaller) morale bonus.
The losing team does not get any morale penalty.
Works for both xcom and aliens.
If someone wants to know exact numbers, here's the code, it's short and should be relatively easy to read:
// morale change when an enemy is stunned (only for the first time!)
if (getMod()->getStunningImprovesMorale() && murderer && !victim->getStatistics()->wasUnconcious)
{
if ((victim->getOriginalFaction() == FACTION_PLAYER && murderer->getFaction() == FACTION_HOSTILE) ||
(victim->getOriginalFaction() == FACTION_HOSTILE && murderer->getFaction() == FACTION_PLAYER))
{
// the murderer gets a morale bonus if he is of a different faction (excluding neutrals)
murderer->moraleChange(20);
for (auto winner : *_save->getUnits())
{
if (!winner->isOut() && winner->getArmor()->getSize() == 1 && winner->getOriginalFaction() == murderer->getOriginalFaction())
{
// the winning squad gets a morale increase (the losing squad is NOT affected)
winner->moraleChange(10);
}
}
}
}