Thanks Pip, Found the Airstrike.BSF.
It looks like it adds up all of the AAValues, eg. each 88 counts 35%, each Wirbelwind counts 50%, capped at 90%.
But I can't see where it compares the sum of the AAValues to the AAVulnerability... Sorry, I'm probably being blind...?
Is the shot down test just a simple product of AAVulnerability multiplied by total AAValue? So a Hurricane (AAVulnerability of 50%) vs. 2x 88s and 1x Wirbelwind (total AAValue of 120%, capped at 90%) has a 50% x 90% = 45% chance of being shot down?
Code: Select all
// if there is nothing on the targeted tile, we look for another target.
i = FindAirTarget(x, y, 5, side) ;
// kinda ugly, we have to send in the result in a single value.
if( i != 0 )
{
x = i >> 12 ;
y = i & 4095 ;
}
i = AAFire(x, y, side, 20, GetBonusValue("AAVulnerable", GetCurrentSide(), name)) ;
effectX = x;
effectY = y;
AddVizCamCenter(x,y) ;
AddVizDelay(30) ; // 1 second delay so we can see what is going on
AddVizFunctionCall("HideEffectMarker", markerID) ;
effectX*=100;
effectX += 50 ;
effectY*=100 ;
effectY+=50 ;
// to force a shooting down
//i = 1000 ;
if( i > Rand(0,100))
{
Log("Shooting down...") ;
// shoot it down!
StartWorkString() ;
PrintWorkStringLiteral(mesh);
PrintWorkStringLiteral("_die") ;
// play the _die version of the airstrike
Log(GetWorkString()) ;
AddVizFunctionCall("PlaySFX", effectX, effectY, 90) ;
AddVizSpotAnim(effectX, effectY, GetWorkString(), 0, -1) ;
AddVizDelay(5) ;
// this is very ugly indeed. But otherwise we would need to have some way to store and release strings
AddVizFunctionCall("StartWorkString", 11) ;
AddVizFunctionCall("PrintWorkStringLiteral","BHead0Image:",11) ;
AddVizFunctionCall("PrintWorkStringLiteral",name,11) ;
AddVizFunctionCall("StartWorkString",12) ;
AddVizFunctionCall("PrintWorkStringLiteral","IDS_BPOPDIE_", 12) ;
AddVizFunctionCall("PrintWorkStringLiteral",name, 12) ;
AddVizFunctionCall("ShowUIScreen", "BattleHead0", "Anim1", GetWorkString(12), GetWorkString(11)) ;
}
else
{
// attack success!
if( GetBonusValue("IncomingSFX", GetCurrentSide(), name) != 0 )
{
AddVizFunctionCall("PlaySFX", effectX, effectY, GetBonusValue("IncomingSFX", GetCurrentSide(), name)) ;
}
AddVizSpotAnim(effectX, effectY, mesh, 0, 1000) ;
// attack tiles
bx = x-GetBonusValue("BombFrontX", GetCurrentSide(), name) ;
bmaxx = bx + GetBonusValue("BombLengthX", GetCurrentSide(), name) ;
minX = x-GetBonusValue("FrontX", GetCurrentSide(), name) ;
maxX = minX + GetBonusValue("LengthX", GetCurrentSide(), name) ;
for (i=maxX; i>minX; i--)
{
tiley = y + Rand(-GetBonusValue("SpreadY", GetCurrentSide(), name), GetBonusValue("SpreadY", GetCurrentSide(), name)) ;