JoKe wrote
You're right, the explosion strength is very much random. It can be anything from the door booby trap level to something akin to the Legifer blast strength. Judging purely by the graphic size and apparent damage here, a code dive would be needed for real values.
This seems to be the code relevant to Turox's explosion effect. I'm not sure how the explosion power translates to damage, but for anyone who does know how this stuff works, compare
Turox's:
10 + RAND() % 100
to
Legifer's:
(300 + Max(GetRelation(), 0)) >> 3
and
Wand of Fireballs/Holy Banana:
75 + RAND() % 25 - RAND() % 25
If I understand this correctly* then Turox's explosion power is
(10 + (0-99)), for a range of 10-109, while Legifer's is
((300 + (0-1000))/ 8 ), with a range of 37-162, and Fireball's
(75 + (0-24) -- (0-24)), range 51-99, so Legifer's blast still has the potential to be the most powerful of the non-gunpowder based explosions. It seems Turox can outperform a Wand of Fireballs, though the latter also has the highest minimum power, making it more reliable. Legifer's explosion power is directly related to your relation with him, which is nice, as it's reliably powerful should you be in good standing and it's not as volatile as a wand. I'm not sure how gunpowder based explosives work since they're power is based on volume; I might look into that later.
UPDATE: Did more digging:
void level::Explosion(character* Terrorist, const festring& DeathMsg, v2 Pos, int Strength, truth HurtNeutrals)
{
static int StrengthLimit[6] = { 500, 250, 100, 50, 25, 10 };
uint c;
int Size = 6;
for(c = 0; c < 6; ++c)
if(Strength >= StrengthLimit[c])
{
Size = c;
break;
}
Exp->RadiusSquare = (8 - Size) * (8 - Size);
There seem to be six different sizes of explosion each with different radii based on the Strength cutoffs listed above. Wand of Fireballs will always have a Size value of 3, so the radius of its explosion is 5 squares. Turox can have an explosion radius ranging from 3-6 squares, and Legifer's ranging from 4-6.
As a side note, I find the formula for the Fireball's power kind of odd, as it would have been easier to simply use
(50 + Rand() % 50), which would result in a range of 50-99, which is still within the same size restriction. Is that one point of Strength that important, or is there something I'm missing here?
FURTHER UPDATE: Figured out gunpowder and other explosive materials:
long material::GetTotalExplosivePower() const { return long(double(Volume) * GetExplosivePower() / 1000000); }
Turns out you just multiply the Volume and ExplosivePower (both set in the script files) and divide by a million.
For example, Veteran Kamikaze Dwarves have backpacks with a gunpowder volume of 30000. Gunpowder's explosive power is 15000.
(30000*15000)/1000000 = 450, giving their explosions a radius of seven squares. Big Mines have a gunpowder volume of 12500, so their explosion Strength is 187, and regular mines are 75. So a Veteran Kamikaze Dwarf is as powerful as six mines.
*I probably don't; any corrections from someone who does know what they're talking about are more than welcome.
EDIT: Cleaned up and edited out some mistakes since I initially misread the formula for Legifer's explosion.