Пример #1
0
//----------------------------------------------------------------------------
// TODO: add in enhancement data here
void NounShip::updateCharacter()
{
	PROFILE_FUNCTION();

	float m = mass();
	m *=  calculateModifier( MT_MASS );
	if ( m < 1.0f )
		m = 1.0f;

	m_Sensor = baseSensor();
	m_View = baseView();
	m_MaxDamage = baseDamage();
	m_MaxEnergy = baseEnergy();
	m_MaxVelocity = baseVelocity();
	m_MaxCargo = baseCargo();
	m_MaxThrust = baseThrust();

	for(int i=0;i<m_Gadgets.size();i++)
	{
		NounGadget * pGadget = m_Gadgets[i];

		m				+= pGadget->addMass();
		m_Sensor		+= pGadget->addSensor();
		m_MaxVelocity	+= pGadget->addMaxVelocity() * velocityModifier();
		m_MaxDamage		+= pGadget->addMaxDamage();
		m_MaxEnergy		+= pGadget->addMaxEnergy();
		m_MaxCargo		+= pGadget->addCargo();
		m_MaxThrust		+= pGadget->addThrust();
	}

	//calculate the acceleration by taking the thrust and dividing by the mass of the ship
	m_MaxAcceleration = m_MaxThrust / m;
	
	//calculate the turn rate (yaw) by taking the baseYaw(), dividing by the mass of the ship and adding a fraction of m_MaxAcceleration
	m_MaxYaw = (baseYaw() / m) + (m_MaxAcceleration / 10);

	//apply enhancements to ships, including gadget effects
	m_MaxVelocity *=  calculateModifier( MT_DRIVE_VELOCITY );
	m_MaxThrust	*= calculateModifier( MT_DRIVE_THRUST );
	m_MaxYaw *= calculateModifier( MT_TURNRATE );
	m_MaxEnergy *= calculateModifier( MT_SHIPENERGY );
}
Пример #2
0
int Creature::getDamage()
{
	return baseDamage();
}