aliens

Author Topic: [DONE][Suggestion] Option to override item used for self destruct  (Read 980 times)

Offline Nord

  • Commander
  • *****
  • Posts: 1746
  • The Gate is open.
    • View Profile
Looks like "specab" does not work, if unit's armor have not only "corpseBattle" but "corpseGeo" too, and geoscape corpse item have no "power".
I can add power to geo corpse, but it will make different units explode with the same strength, and this is not good.

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: specab and corpseGeo
« Reply #1 on: October 13, 2023, 06:59:37 pm »
OXC use globe corpse, because of this OXCE behave same, I would like to change it but this could break some mods.

Code: [Select]
if (_attack.attacker)
{
itemRule = _attack.attacker->getArmor()->getCorpseGeoscape(); //TODO: not getCorpseBattlescape ones?
_power = itemRule->getPowerBonus(_attack);
_damageType = itemRule->getDamageType();
_radius = itemRule->getExplosionRadius(_attack);
if (!RNG::percent(itemRule->getSpecialChance()))
{
_power = 0;
}
}

Probably without consensus of all major modders it can't be changed.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9093
    • View Profile
Re: [DONE][Suggestion] Option to override item used for self destruct
« Reply #2 on: December 09, 2023, 10:22:29 am »
Done: https://github.com/MeridianOXC/OpenXcom/commit/d13c4bebe6a825a78bbee52e0b5445a2192070d0

There is a new attribute `selfDestructItem` on the armor, which is used instead of `corpseGeo`.
(corpseGeo still works if selfDestructItem is not specified)
« Last Edit: December 09, 2023, 10:24:16 am by Meridian »