Author Topic: Power source explosion strength  (Read 4075 times)

Offline clownagent

  • Colonel
  • ****
  • Posts: 380
    • View Profile
Power source explosion strength
« 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.
« Last Edit: January 03, 2017, 11:57:32 am by clownagent »

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: Power source explosion strength
« Reply #1 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.
« Last Edit: January 03, 2017, 03:03:24 pm by Hobbes »

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1933
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: Power source explosion strength
« Reply #2 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.

Offline clownagent

  • Colonel
  • ****
  • Posts: 380
    • View Profile
Re: Power source explosion strength
« Reply #3 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.

Offline Nord

  • Commander
  • *****
  • Posts: 1746
  • The Gate is open.
    • View Profile
Re: Power source explosion strength
« Reply #4 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.

Offline clownagent

  • Colonel
  • ****
  • Posts: 380
    • View Profile
Re: Power source explosion strength
« Reply #5 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  ;)