Comments translated from French to English.
parent
2400ca1de0
commit
0ecf349cf9
|
@ -46,11 +46,11 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define TOWER_SCOPE 200.0f // port<EFBFBD>e du rayon
|
#define TOWER_SCOPE 200.0f // range of beam
|
||||||
#define ENERGY_FIRE 0.125f // <EFBFBD>nergie consomm<6D>e par tir
|
#define ENERGY_FIRE 0.125f // energy consumed by fire
|
||||||
|
|
||||||
|
|
||||||
// Constructeur de l'objet.
|
// Object's constructor.
|
||||||
|
|
||||||
CAutoTower::CAutoTower(CInstanceManager* iMan, CObject* object)
|
CAutoTower::CAutoTower(CInstanceManager* iMan, CObject* object)
|
||||||
: CAuto(iMan, object)
|
: CAuto(iMan, object)
|
||||||
|
@ -65,12 +65,12 @@ CAutoTower::CAutoTower(CInstanceManager* iMan, CObject* object)
|
||||||
}
|
}
|
||||||
|
|
||||||
Init();
|
Init();
|
||||||
m_phase = ATP_WAIT; // en pause jusqu'au premier Init()
|
m_phase = ATP_WAIT; // paused until the first Init ()
|
||||||
m_time = 0.0f;
|
m_time = 0.0f;
|
||||||
m_lastUpdateTime = 0.0f;
|
m_lastUpdateTime = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Destructeur de l'objet.
|
// Object's destructor.
|
||||||
|
|
||||||
CAutoTower::~CAutoTower()
|
CAutoTower::~CAutoTower()
|
||||||
{
|
{
|
||||||
|
@ -78,7 +78,7 @@ CAutoTower::~CAutoTower()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// D<EFBFBD>truit l'objet.
|
// Destroys the object.
|
||||||
|
|
||||||
void CAutoTower::DeleteObject(BOOL bAll)
|
void CAutoTower::DeleteObject(BOOL bAll)
|
||||||
{
|
{
|
||||||
|
@ -87,7 +87,7 @@ void CAutoTower::DeleteObject(BOOL bAll)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Initialise l'objet.
|
// Initialize the object.
|
||||||
|
|
||||||
void CAutoTower::Init()
|
void CAutoTower::Init()
|
||||||
{
|
{
|
||||||
|
@ -102,7 +102,7 @@ void CAutoTower::Init()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Gestion d'un <20>v<EFBFBD>nement.
|
// Management of an event.
|
||||||
|
|
||||||
BOOL CAutoTower::EventProcess(const Event &event)
|
BOOL CAutoTower::EventProcess(const Event &event)
|
||||||
{
|
{
|
||||||
|
@ -118,7 +118,7 @@ BOOL CAutoTower::EventProcess(const Event &event)
|
||||||
|
|
||||||
m_timeVirus -= event.rTime;
|
m_timeVirus -= event.rTime;
|
||||||
|
|
||||||
if ( m_object->RetVirusMode() ) // contamin<EFBFBD> par un virus ?
|
if ( m_object->RetVirusMode() ) // contaminated by a virus?
|
||||||
{
|
{
|
||||||
if ( m_timeVirus <= 0.0f )
|
if ( m_timeVirus <= 0.0f )
|
||||||
{
|
{
|
||||||
|
@ -141,7 +141,7 @@ BOOL CAutoTower::EventProcess(const Event &event)
|
||||||
|
|
||||||
if ( m_phase == ATP_ZERO )
|
if ( m_phase == ATP_ZERO )
|
||||||
{
|
{
|
||||||
FireStopUpdate(m_progress, TRUE); // clignotte
|
FireStopUpdate(m_progress, TRUE); // blinks
|
||||||
if ( m_progress < 1.0f )
|
if ( m_progress < 1.0f )
|
||||||
{
|
{
|
||||||
energy = 0.0f;
|
energy = 0.0f;
|
||||||
|
@ -167,7 +167,7 @@ BOOL CAutoTower::EventProcess(const Event &event)
|
||||||
|
|
||||||
if ( m_phase == ATP_SEARCH )
|
if ( m_phase == ATP_SEARCH )
|
||||||
{
|
{
|
||||||
FireStopUpdate(m_progress, FALSE); // <EFBFBD>teint
|
FireStopUpdate(m_progress, FALSE); // extinguished
|
||||||
if ( m_progress < 1.0f )
|
if ( m_progress < 1.0f )
|
||||||
{
|
{
|
||||||
quick = 1.0f;
|
quick = 1.0f;
|
||||||
|
@ -275,7 +275,7 @@ BOOL CAutoTower::EventProcess(const Event &event)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Cherche l'objet cible le plus proche.
|
// Seeks the nearest target object.
|
||||||
|
|
||||||
CObject* CAutoTower::SearchTarget(D3DVECTOR &impact)
|
CObject* CAutoTower::SearchTarget(D3DVECTOR &impact)
|
||||||
{
|
{
|
||||||
|
@ -302,7 +302,7 @@ CObject* CAutoTower::SearchTarget(D3DVECTOR &impact)
|
||||||
oType != OBJECT_BEE &&
|
oType != OBJECT_BEE &&
|
||||||
oType != OBJECT_WORM ) continue;
|
oType != OBJECT_WORM ) continue;
|
||||||
|
|
||||||
if ( !pObj->RetActif() ) continue; // inactif ?
|
if ( !pObj->RetActif() ) continue; // inactive?
|
||||||
|
|
||||||
//? if ( g_researchDone & RESEARCH_QUICK )
|
//? if ( g_researchDone & RESEARCH_QUICK )
|
||||||
if ( FALSE )
|
if ( FALSE )
|
||||||
|
@ -311,13 +311,13 @@ CObject* CAutoTower::SearchTarget(D3DVECTOR &impact)
|
||||||
if ( physics != 0 )
|
if ( physics != 0 )
|
||||||
{
|
{
|
||||||
speed = Abs(physics->RetLinMotionX(MO_REASPEED));
|
speed = Abs(physics->RetLinMotionX(MO_REASPEED));
|
||||||
if ( speed > 20.0f ) continue; // avance trop vite ?
|
if ( speed > 20.0f ) continue; // moving too fast?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !pObj->GetCrashSphere(0, oPos, radius) ) continue;
|
if ( !pObj->GetCrashSphere(0, oPos, radius) ) continue;
|
||||||
distance = Length(oPos, iPos);
|
distance = Length(oPos, iPos);
|
||||||
if ( distance > TOWER_SCOPE ) continue; // trop loin
|
if ( distance > TOWER_SCOPE ) continue; // too far
|
||||||
if ( distance < min )
|
if ( distance < min )
|
||||||
{
|
{
|
||||||
min = distance;
|
min = distance;
|
||||||
|
@ -331,7 +331,7 @@ CObject* CAutoTower::SearchTarget(D3DVECTOR &impact)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Retourne une erreur li<6C>e <20> l'<27>tat de l'automate.
|
// Returns an error due the state of the automation.
|
||||||
|
|
||||||
Error CAutoTower::RetError()
|
Error CAutoTower::RetError()
|
||||||
{
|
{
|
||||||
|
@ -345,20 +345,20 @@ Error CAutoTower::RetError()
|
||||||
power = m_object->RetPower();
|
power = m_object->RetPower();
|
||||||
if ( power == 0 )
|
if ( power == 0 )
|
||||||
{
|
{
|
||||||
return ERR_TOWER_POWER; // pas de pile
|
return ERR_TOWER_POWER; // no battery
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( power->RetEnergy() < ENERGY_FIRE )
|
if ( power->RetEnergy() < ENERGY_FIRE )
|
||||||
{
|
{
|
||||||
return ERR_TOWER_ENERGY; // plus assez d'<27>nergie
|
return ERR_TOWER_ENERGY; // not enough energy
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Met <20> jour les feux de stop.
|
// Updates the stop lights.
|
||||||
|
|
||||||
void CAutoTower::FireStopUpdate(float progress, BOOL bLightOn)
|
void CAutoTower::FireStopUpdate(float progress, BOOL bLightOn)
|
||||||
{
|
{
|
||||||
|
@ -375,7 +375,7 @@ void CAutoTower::FireStopUpdate(float progress, BOOL bLightOn)
|
||||||
0.0f, -4.5f,
|
0.0f, -4.5f,
|
||||||
};
|
};
|
||||||
|
|
||||||
if ( !bLightOn ) // <EFBFBD>teint ?
|
if ( !bLightOn ) // extinguished?
|
||||||
{
|
{
|
||||||
for ( i=0 ; i<4 ; i++ )
|
for ( i=0 ; i<4 ; i++ )
|
||||||
{
|
{
|
||||||
|
@ -421,7 +421,7 @@ void CAutoTower::FireStopUpdate(float progress, BOOL bLightOn)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Cr<EFBFBD>e toute l'interface lorsque l'objet est s<>lectionn<6E>.
|
// Creates all the interface when the object is selected.
|
||||||
|
|
||||||
BOOL CAutoTower::CreateInterface(BOOL bSelect)
|
BOOL CAutoTower::CreateInterface(BOOL bSelect)
|
||||||
{
|
{
|
||||||
|
@ -462,8 +462,8 @@ BOOL CAutoTower::CreateInterface(BOOL bSelect)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Met <20> jour l'<27>tat de tous les boutons de l'interface,
|
// Updates the state of all buttons on the interface,
|
||||||
// suite au temps qui s'<27>coule ...
|
// following the time that elapses ...
|
||||||
|
|
||||||
void CAutoTower::UpdateInterface(float rTime)
|
void CAutoTower::UpdateInterface(float rTime)
|
||||||
{
|
{
|
||||||
|
@ -496,7 +496,7 @@ void CAutoTower::UpdateInterface(float rTime)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Sauve tous les param<61>tres de l'automate.
|
// Saves all parameters of the controller.
|
||||||
|
|
||||||
BOOL CAutoTower::Write(char *line)
|
BOOL CAutoTower::Write(char *line)
|
||||||
{
|
{
|
||||||
|
@ -536,7 +536,7 @@ BOOL CAutoTower::Write(char *line)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Restitue tous les param<61>tres de l'automate.
|
// Restores all parameters of the controller.
|
||||||
|
|
||||||
BOOL CAutoTower::Read(char *line)
|
BOOL CAutoTower::Read(char *line)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue