OpenXcom Forum

Modding => Work In Progress => Topic started by: clownagent on January 03, 2017, 11:52:02 am

Title: Power source explosion strength
Post by: clownagent on January 03, 2017, 11:52:02 am
Is there any possibilty to change the strength of the initial power source explosion?

Changing the mcd value 55 (HE-strength) of the power source seems to have no effect.
Title: Re: Power source explosion strength
Post by: Hobbes on January 03, 2017, 02:58:54 pm
Is there any possibilty to change the strength of the initial power source explosion?

Changing the mcd value 55 (HE-strength) of the power source seems to have no effect.

It is hardcoded - the explosion due from a UFO crash is calculated when the map is generated. Changing the MCD value has no effect. The actual code is:

Code: [Select]
void BattlescapeGenerator::explodePowerSources()
{
for (int i = 0; i < _save->getMapSizeXYZ(); ++i)
{
if (_save->getTiles()[i]->getMapData(O_OBJECT)
&& _save->getTiles()[i]->getMapData(O_OBJECT)->getSpecialType() == UFO_POWER_SOURCE && RNG::percent(75))
{
Position pos;
pos.x = _save->getTiles()[i]->getPosition().x*16;
pos.y = _save->getTiles()[i]->getPosition().y*16;
pos.z = (_save->getTiles()[i]->getPosition().z*24) +12;
_save->getTileEngine()->explode(pos, 180+RNG::generate(0,70), DT_HE, 10);
}
}

The explosion damage can vary between 180-250, with a radius of 10 tiles, if I'm reading it right.
Title: Re: Power source explosion strength
Post by: ohartenstein23 on January 03, 2017, 03:03:56 pm
Power sources specifically are hardcoded to 170-250 HE damage. The MCD value only is checked for tile objects other than power sources.
Title: Re: Power source explosion strength
Post by: clownagent on January 03, 2017, 03:24:38 pm
It is hardcoded - the explosion due from a UFO crash is calculated when the map is generated. Changing the MCD value has no effect.
The explosion damage can vary between 180-250, with a radius of 10 tiles, if I'm reading it right.

Ok.
Would be nice if it were externalized to the ruleset.

Then, une could also give other objects of the craft the possibilty to be destroyed, for example:
UFO navigation: 25% chance for 50 HE
Alien Alloys (UFO walls): 1% chance for 100 HE
etc
to simulate hits from  craft weapons.
Title: Re: Power source explosion strength
Post by: Nord on January 03, 2017, 06:54:10 pm
Then, une could also give other objects of the craft the possibilty to be destroyed, for example:
UFO navigation: 25% chance for 50 HE
Alien Alloys (UFO walls): 1% chance for 100 HE
etc
to simulate hits from  craft weapons.
Quite interesting idea, but can lead to holes in floors, creating impassable obstacles.
Title: Re: Power source explosion strength
Post by: clownagent on January 03, 2017, 09:01:20 pm
Quite interesting idea, but can lead to holes in floors, creating impassable obstacles.

Might happen, if you shoot something with a plasma gun  ;)