Exemplo n.º 1
0
void Afterburner::Activate(uint32 targetID)
{
	m_ActiveModuleProc->ActivateCycle();

	m_Ship->SetAttribute(AttrCharge, 134.999996046585);
	m_Ship->SetAttribute(AttrMaxVelocity, 387);
	m_Ship->SetAttribute(AttrSpeedBoostFactorCalc, 1.29126213592233);
	m_Ship->SetAttribute(AttrSpeedBoostFactorCalc2, 0.29126213592233);
	m_Ship->SetAttribute(AttrMass, 1648000);

	m_Item->SetActive(true, 1253, 10000, true);

	DoDestiny_SetBallMass mass;
	mass.entityID = m_Ship->itemID();
	mass.mass = 1648000;

	DoDestiny_SetMaxSpeed speed;
	speed.entityID = m_Ship->itemID();
	speed.speedValue = 387.378640776699;

	std::vector<PyTuple *> updates;
	updates.push_back(mass.Encode());
	updates.push_back(speed.Encode());

	m_Ship->GetOperator()->GetDestiny()->SendDestinyUpdate(updates, true);
}
Exemplo n.º 2
0
void Afterburner::Deactivate() 
{
	m_ActiveModuleProc->DeactivateCycle();

	m_Ship->SetAttribute(AttrMaxVelocity, 300);
	m_Ship->SetAttribute(AttrSpeedBoostFactorCalc, 1.41811846689895);
	m_Ship->SetAttribute(AttrSpeedBoostFactorCalc2, 0.418118466898955);
	m_Ship->SetAttribute(AttrMass, 1148000);

	DoDestiny_SetMaxSpeed speed;
	speed.entityID = m_Ship->itemID();
	speed.speedValue = 300;

	DoDestiny_SetBallMass mass;
	mass.entityID = m_Ship->itemID();
	mass.mass = 1148000;

	std::vector<PyTuple *> updates;
	updates.push_back(speed.Encode());
	updates.push_back(mass.Encode());

	m_Ship->GetOperator()->GetDestiny()->SendDestinyUpdate(updates, true);
}
Exemplo n.º 3
0
void Afterburner::StopCycle(bool abort)
{
	//m_Item->SetActive(false, 1253, 0.0, false);

	// Tell Destiny Manager about our new speed so it properly tracks ship movement:
	m_Ship->GetOperator()->GetDestiny()->SetMaxVelocity(m_Ship->GetDefaultAttribute(AttrMaxVelocity).get_float());
	m_Ship->GetOperator()->GetDestiny()->SetSpeedFraction(1.0);

	DoDestiny_SetMaxSpeed speed;
	speed.entityID = m_Ship->itemID();
	speed.speedValue = m_Ship->GetDefaultAttribute(AttrMaxVelocity).get_float();

	DoDestiny_SetBallMass mass;
	mass.entityID = m_Ship->itemID();
	mass.mass = m_Ship->GetAttribute(AttrMass).get_float();

	std::vector<PyTuple *> updates;
	updates.push_back(speed.Encode());
	updates.push_back(mass.Encode());

	m_ActiveModuleProc->DeactivateCycle();

	m_Ship->GetOperator()->GetDestiny()->SendDestinyUpdate(updates, false);

	Notify_OnGodmaShipEffect shipEff;
	shipEff.itemID = m_Item->itemID();
	shipEff.effectID = 1254;
	shipEff.when = Win32TimeNow();
	shipEff.start = 0;
	shipEff.active = 0;

	PyList* env = new PyList;
	env->AddItem(new PyInt(shipEff.itemID));
	env->AddItem(new PyInt(m_Ship->ownerID()));
	env->AddItem(new PyInt(m_Ship->itemID()));
	env->AddItem(new PyNone);
	env->AddItem(new PyNone);
	env->AddItem(new PyNone);
	env->AddItem(new PyInt(shipEff.effectID));

	shipEff.environment = env;
	shipEff.startTime = shipEff.when;
	shipEff.duration = 1.0;		//m_ActiveModuleProc->GetRemainingCycleTimeMS();		// At least, I'm assuming this is the remaining time left in the cycle
	shipEff.repeat = new PyInt(0);
	shipEff.randomSeed = new PyNone;
	shipEff.error = new PyNone;

	PyList* events = new PyList;
	events->AddItem(shipEff.Encode());

	Notify_OnMultiEvent multi;
	multi.events = events;

	PyTuple* tmp = multi.Encode();

	m_Ship->GetOperator()->SendDogmaNotification("OnMultiEvent", "clientID", &tmp);

	m_ActiveModuleProc->DeactivateCycle();

	// Create Special Effect:
	m_Ship->GetOperator()->GetDestiny()->SendSpecialEffect
		(
		m_Ship,
		m_Item->itemID(),
		m_Item->typeID(),
		0,
		0,
		"effects.SpeedBoost",
		0,
		0,
		0,
		1.0,
		0
		);
}
Exemplo n.º 4
0
void Afterburner::_ShowCycle()
{
	//m_Item->SetActive(true, 1253, m_Item->GetAttribute(AttrDuration).get_float(), true);

	double implantBonuses = 1.0;	// TODO: gather and accumulate all implant bonuses for MWDs/Afterburners
	double accelerationControlSkillLevel = 0.0;	// TODO: Figure out how to get access to skills list of character running this ship and get this value
	double boostSpeed = m_Ship->GetAttribute(AttrMaxVelocity).get_float() * (1.0 + (m_Item->GetAttribute(AttrSpeedFactor).get_float() / 100.0 * (1 + accelerationControlSkillLevel * 0.05) * (implantBonuses) * (m_Item->GetAttribute(AttrSpeedBoostFactor).get_float() / (m_Ship->GetAttribute(AttrMass).get_float()))));

	// Tell Destiny Manager about our new speed so it properly tracks ship movement:
	m_Ship->GetOperator()->GetDestiny()->SetMaxVelocity(boostSpeed);
	m_Ship->GetOperator()->GetDestiny()->SetSpeedFraction(1.0);

	DoDestiny_SetBallMass mass;
	mass.entityID = m_Ship->itemID();
	mass.mass = m_Ship->GetAttribute(AttrMass).get_float();

	DoDestiny_SetMaxSpeed speed;
	speed.entityID = m_Ship->itemID();
	speed.speedValue = boostSpeed;

	std::vector<PyTuple *> updates;
	updates.push_back(mass.Encode());
	updates.push_back(speed.Encode());

	//m_Ship->GetOperator()->GetDestiny()->SendDestinyUpdate(updates, false);

	// Create Destiny Updates:
	Notify_OnGodmaShipEffect shipEff;
	shipEff.itemID = m_Item->itemID();
	shipEff.effectID = 1254;		// From EVEEffectID::
	shipEff.when = Win32TimeNow();
	shipEff.start = 1;
	shipEff.active = 1;

	PyList* env = new PyList;
	env->AddItem(new PyInt(shipEff.itemID));
	env->AddItem(new PyInt(m_Ship->ownerID()));
	env->AddItem(new PyInt(m_Ship->itemID()));
	env->AddItem(new PyNone);
	env->AddItem(new PyNone);
	env->AddItem(new PyNone);
	env->AddItem(new PyInt(shipEff.effectID));

	shipEff.environment = env;
	shipEff.startTime = shipEff.when;
	shipEff.duration = m_Item->GetAttribute(AttrDuration).get_float();
	shipEff.repeat = new PyInt(1000);
	shipEff.randomSeed = new PyNone;
	shipEff.error = new PyNone;

	PyTuple* tmp = new PyTuple(3);
	//tmp->SetItem(1, dmgMsg.Encode());
	tmp->SetItem(2, shipEff.Encode());

	std::vector<PyTuple*> events;
	//events.push_back(dmgMsg.Encode());
	events.push_back(shipEff.Encode());

	//std::vector<PyTuple*> updates;
	//updates.push_back(dmgChange.Encode());

	m_Ship->GetOperator()->GetDestiny()->SendDestinyUpdate(updates, events, false);

	// Create Special Effect:
	m_Ship->GetOperator()->GetDestiny()->SendSpecialEffect
		(
		m_Ship,
		m_Item->itemID(),
		m_Item->typeID(),
		0,
		0,
		"effects.SpeedBoost",
		0,
		1,
		1,
		m_Item->GetAttribute(AttrDuration).get_float(),
		1000
		);
}