Hi guy's i want to increase the radius of which a fort can fire, now i believe this is the code i need but i can't make heads or tails of it. Can you explain what it is and how to best edit this code to increase the range of the forts range.
Code:
float Cannon_GetFireHeight()
{
aref aCharacter = GetEventData();
aref aEnemy = GetEventData();
ref rBallType = GetGoodByType(sti(aCharacter.Ship.Cannons.Charge.Type));
ref rEnemyShip = GetRealShip(sti(aEnemy.Ship.Type));
string sBallName = rBallType.Name;
float Y,DY;
Y = stf(rEnemyShip.Height.(sBallName).Y);
DY = stf(rEnemyShip.Height.(sBallName).DY);
// charge/ship depend
// boal new goals -->
//return (Y + (frnd()-0.5) * DY * 2);
// ââåäåì ëîãèêó è ó÷åò îò ðàññòîÿÃÂèÿ. òàêæå ó÷åò ÷òî, áîìáû òÿæåëåå ÿäåð
float dist = Ship_GetDistance2D(aCharacter, aEnemy);
// Y- âûñîòû ïðèöåëà, çàäàÃÂàäëÿ áîðòàîò òèïàêîðàáëÿ ïðîòèâÃÂèêà1-3 äëÿ ÿäåð 10-20 äëÿ êÃÂèïïåðåé 2-4 êàðòå÷ DY - äèñïåðñèÿ
// ÃÂóäåì èñõîäèòü èç ïîäîáèÿ òðåóãîëüÃÂèêîâ è òîãî, ÷òî âûñîòàïîäîáðàÃÂàÀêåëëîé ÃÂàñåðåäèÃÂó ðàäèóðàâûñòðåëÃÂ
ref rCannon = GetCannonByType(sti(aCharacter.Ship.Cannons.Type));
if (sBallName == "Bombs" || sBallName == "Grapes")
{
Y = Y + 0.6;
}
if (sti(aEnemy.Ship.Type) == SHIP_FORT)
{
Y = 40;
DY = 16;
}
float RY = abs(Y * (dist / ( stf(rCannon.FireRange) / 2)) + (frnd()-0.5) * DY / 4));
if (RY < 0.8)
{
RY = 0.8;
}
if (RY > 55)
{
RY = 55;
}
return RY;
// boal <--
}