As you may have guessed. I am trying to modify the dismasting values. By this, i mean reducing the probability of a dismast and/or removing the probability of a dismasting completely. I believe that i am trying to change the dismasting values globally, not just for the player ship. i dont mind that.
Below i have posted a piece of code from the 'Age of Pirates 2\Program\SEA_AI\AIShip.c'. I have highlighted the lines that interest me. my question is posted after that.
float Ship_MastDamage()
{
int iDamageType = GetEventData();
int iMastNum = GetEventData();
float x = GetEventData();
float y = GetEventData();
float z = GetEventData();
float fDamage = GetEventData();
aref rCharacter = GetEventData();
rCharacter.seatime.lasthit = GetSeaTime(); // JA: added for surrender code
switch (iDamageType)
{
case SHIP_MAST_TOUCH_ISLAND:
fDamage = fDamage + 0.25;
break;
case SHIP_MAST_TOUCH_SHIP:
//aref rCollideCharacter = GetEventData();
fDamage = fDamage + 0.2;
break;
case SHIP_MAST_TOUCH_BALL:
int iBallType = sti(AIBalls.CurrentBallType); //ñïîðíî, òê ýòî íå ÿäðà, òîãî êòî ñòðåëÿë, à ñêîðåå ÿäðà ÃÃ
switch (iBallType)
{
case GOOD_BALLS:
fDamage = fDamage + 0.1;
break;
case GOOD_GRAPES:
fDamage = fDamage + 0.05;
break;
case GOOD_KNIPPELS:
fDamage = fDamage + 0.25;
break;
case GOOD_BOMBS:
fDamage = fDamage + 0.15;
break;
}
break;
}
//float fAccuracy = stf(rCharacter.TmpSkill.Accuracy);
//fDamage = fDamage * (1.0 + (0.3 * fAccuracy));
fDamage = Clampf(fDamage);
// if mast fall - play sound
if (fDamage >= 1.0)
{
Play3DSound("mast_fall", x, y, z);
rCharacter.ship.sp = CalculateShipSP(rCharacter); // ðåôðåøèì ïàðóñà îò ìîäåëè
rCharacter.Tmp.SpeedRecall = 0; // ÷òîá ïåðåñ÷èòàëñÿ ìàíåâð
}
return fDamage;
//procMastFall
MY QUESTIONS:- If i was to change...
THIS:-
case GOOD_BALLS:
fDamage = fDamage + 0.1
TO THIS:-
case GOOD_BALLS:
fDamage = 0
Would it mean that if a normal cannon ball hits the mast(s) there is ZERO damage therefore the mast does not fall?
Thank you for your time and patience
Below i have posted a piece of code from the 'Age of Pirates 2\Program\SEA_AI\AIShip.c'. I have highlighted the lines that interest me. my question is posted after that.
float Ship_MastDamage()
{
int iDamageType = GetEventData();
int iMastNum = GetEventData();
float x = GetEventData();
float y = GetEventData();
float z = GetEventData();
float fDamage = GetEventData();
aref rCharacter = GetEventData();
rCharacter.seatime.lasthit = GetSeaTime(); // JA: added for surrender code
switch (iDamageType)
{
case SHIP_MAST_TOUCH_ISLAND:
fDamage = fDamage + 0.25;
break;
case SHIP_MAST_TOUCH_SHIP:
//aref rCollideCharacter = GetEventData();
fDamage = fDamage + 0.2;
break;
case SHIP_MAST_TOUCH_BALL:
int iBallType = sti(AIBalls.CurrentBallType); //ñïîðíî, òê ýòî íå ÿäðà, òîãî êòî ñòðåëÿë, à ñêîðåå ÿäðà ÃÃ
switch (iBallType)
{
case GOOD_BALLS:
fDamage = fDamage + 0.1;
break;
case GOOD_GRAPES:
fDamage = fDamage + 0.05;
break;
case GOOD_KNIPPELS:
fDamage = fDamage + 0.25;
break;
case GOOD_BOMBS:
fDamage = fDamage + 0.15;
break;
}
break;
}
//float fAccuracy = stf(rCharacter.TmpSkill.Accuracy);
//fDamage = fDamage * (1.0 + (0.3 * fAccuracy));
fDamage = Clampf(fDamage);
// if mast fall - play sound
if (fDamage >= 1.0)
{
Play3DSound("mast_fall", x, y, z);
rCharacter.ship.sp = CalculateShipSP(rCharacter); // ðåôðåøèì ïàðóñà îò ìîäåëè
rCharacter.Tmp.SpeedRecall = 0; // ÷òîá ïåðåñ÷èòàëñÿ ìàíåâð
}
return fDamage;
//procMastFall
MY QUESTIONS:- If i was to change...
THIS:-
case GOOD_BALLS:
fDamage = fDamage + 0.1
TO THIS:-
case GOOD_BALLS:
fDamage = 0
Would it mean that if a normal cannon ball hits the mast(s) there is ZERO damage therefore the mast does not fall?
Thank you for your time and patience