コード例 #1
0
ファイル: Afterburner.cpp プロジェクト: Almamu/evemu_server
void Afterburner::DoCycle()
{
	if (m_ActiveModuleProc->ShouldProcessActiveCycle())
	{
		_ShowCycle();
	}
}
コード例 #2
0
double Webifier::DoCycle()
{
        if ((!m_Ship->GetPilot()->GetShipSE()->SysBubble())
            || (!m_Ship->GetPilot()->GetShipSE()->SysBubble()->GetEntity(m_targetID)) )
        {
            Deactivate();
            return 0;
        }
        _ShowCycle();

        //check for range here..
        //  maxRange, overloadRangeBonus

        return _GetDuration();
}
コード例 #3
0
void ArmorRepairer::DoCycle()
{
	if( m_ActiveModuleProc->ShouldProcessActiveCycle() )
	{
		_ShowCycle();

		// Apply repair amount:
		EvilNumber newDamageAmount;
		if( m_Item->GetAttribute(AttrArmorDamageAmount) <= m_Ship->GetAttribute(AttrArmorDamage) )
			newDamageAmount = m_Ship->GetAttribute(AttrArmorDamage) - m_Item->GetAttribute(AttrArmorDamageAmount);
		else
			newDamageAmount = 0.0;

        m_Ship->SetAttribute(AttrArmorDamage, newDamageAmount);
	}
}
コード例 #4
0
void ProjectileTurret::Activate(SystemEntity * targetEntity)
{
	if( this->m_chargeRef != NULL )
	{
		m_targetEntity = targetEntity;
		m_targetID = targetEntity->Item()->itemID();

		// Activate active processing component timer:
		m_ActiveModuleProc->ActivateCycle();
		m_ModuleState = MOD_ACTIVATED;
		_ShowCycle();
	}
	else
	{
		sLog.Error( "ProjectileTurret::Activate()", "ERROR: Cannot find charge that is supposed to be loaded into this module!" );
		throw PyException( MakeCustomError( "ERROR!  Cannot find charge that is supposed to be loaded into this module!" ) );
	}
}
コード例 #5
0
double ShieldTransporter::DoCycle()
{
        if (!m_Ship->GetPilot()->GetShipSE()->SysBubble())
        {
            Deactivate();
            return 0;
        }
        _ShowCycle();

        // Apply boost amount:
        EvilNumber shieldCharge = m_targetEntity->GetSelf()->GetAttribute(AttrShieldCharge);
        shieldCharge += m_Item->GetAttribute(AttrShieldBonus);
        if (shieldCharge > m_targetEntity->GetSelf()->GetAttribute(AttrShieldCapacity)) {
            shieldCharge = m_targetEntity->GetSelf()->GetAttribute(AttrShieldCapacity);
        }
        m_targetEntity->GetSelf()->SetAttribute(AttrShieldCharge, shieldCharge);

        return _GetDuration();
}
コード例 #6
0
void MissileLauncher::DoCycle()
{
	if( m_ActiveModuleProc->ShouldProcessActiveCycle() )
	{
		// Check to see if our target is still in this bubble or has left or been destroyed:
		if( m_Ship->GetOperator()->GetSystemEntity()->Bubble() == NULL )
		{
			// Target has left our bubble or been destroyed, deactivate this module:
			Deactivate();
			return;
		}
		else
		{
			if( !(m_Ship->GetOperator()->GetSystemEntity()->Bubble()->GetEntity(m_targetID)) )
			{
				// Target has left our bubble or been destroyed, deactivate this module:
				Deactivate();
				return;
			}
		}

		if( m_chargeRef->quantity() == 0 )
		{
			Deactivate();
			return;
		}

		_ShowCycle();

		// Create Damage action:
		//Damage( SystemEntity *_source,
        //    InventoryItemRef _weapon,
        //    double _kinetic,
        //    double _thermal,
        //    double _em,
        //    double _explosive,
        //    EVEEffectID _effect );
		double kinetic_damage = 0.0;
		double thermal_damage = 0.0;
		double em_damage = 0.0;
		double explosive_damage = 0.0;

		// This still somehow needs skill, ship, module, and implant bonuses to be applied:
		// This still somehow needs to have optimal range and falloff attributes applied as a damage modification factor:
		if( m_chargeRef->HasAttribute(AttrKineticDamage) )
			kinetic_damage = (m_Item->GetAttribute(AttrDamageMultiplier) * m_chargeRef->GetAttribute(AttrKineticDamage)).get_float();
		if( m_chargeRef->HasAttribute(AttrThermalDamage) )
			thermal_damage = (m_Item->GetAttribute(AttrDamageMultiplier) * m_chargeRef->GetAttribute(AttrThermalDamage)).get_float();
		if( m_chargeRef->HasAttribute(AttrEmDamage) )
			em_damage = (m_Item->GetAttribute(AttrDamageMultiplier) * m_chargeRef->GetAttribute(AttrEmDamage)).get_float();
		if( m_chargeRef->HasAttribute(AttrExplosiveDamage) )
			explosive_damage = (m_Item->GetAttribute(AttrDamageMultiplier) * m_chargeRef->GetAttribute(AttrExplosiveDamage)).get_float();

		Damage damageDealt
		(
			m_Ship->GetOperator()->GetSystemEntity(),
			m_Item,
			kinetic_damage,			// kinetic damage
			thermal_damage,			// thermal damage
			em_damage,				// em damage
			explosive_damage,		// explosive damage
			effectMissileLaunching	// from EVEEffectID::
		);
		
		m_targetEntity->ApplyDamage( damageDealt );

		// Reduce ammo charge by 1 unit:
		m_chargeRef->SetQuantity(m_chargeRef->quantity() - 1);
	}
}
コード例 #7
0
ファイル: SuperWeapon.cpp プロジェクト: Almamu/evemu_server
void SuperWeapon::DoCycle()
{
	if( m_ActiveModuleProc->ShouldProcessActiveCycle() )
	{
		_ShowCycle();

		// Do massive, crazy damage to targets within a sphere of damage, screw CCP and their 'this can only target capital ships' junk ;)
		// NOTE: due to the small bit of time to "build up" the weapon firing action, we need a timer to delay application of damage to the target(s)
		// Avatar:  5 seconds to build after activation,  5 seconds duration, instant reach to target
		// Erebus:  6 seconds to build after activation,  6 seconds duration, instant reach to target
		// Leviathan:  range to target 124km,  6 seconds to launch after activation, 9 seconds flight time
		// Ragnarok:  range to target 125km,  6 seconds to build after activation, 4 seconds duration, instant reach to target
		//
		// TODO:
		// 0. Somehow disable warping and jump drive until deactivated
		// 1. Set 'm_buildUpTimer' to the "build up time"
		// 2. Set 'm_effectDurationTimer' to the "duration/flight time" of the super weapon effect
		// 3. Move Damage action to SuperWeapon::Process() function and check for timer expirations before applying damage
		// 4. Consider applying damage in increments, such as 5 stages of the 2 million hp (400,000 hp per stage, once per second)
		// 5. Loop through all entities in the bubble, filtering on dynamic entities that are ships, drones, structures, cans
		//    and calculate distance from target to calculate area-of-effect damage using some 1/x formula, where damage sustained
		//    drops off the further away from the primary target.

		// Create Damage action:
		//Damage( SystemEntity *_source,
		//    InventoryItemRef _weapon,
		//    double _kinetic,
		//    double _thermal,
		//    double _em,
		//    double _explosive,
		//    EVEEffectID _effect );
		double kinetic_damage = 0.0;
		double thermal_damage = 0.0;
		double em_damage = 0.0;
		double explosive_damage = 0.0;

		// This still somehow needs skill, ship, module, and implant bonuses to be applied:
		// This still somehow needs to have optimal range and falloff attributes applied as a damage modification factor:
		if (m_Item->HasAttribute(AttrKineticDamage))
			kinetic_damage = (m_Item->GetAttribute(AttrKineticDamage)).get_float();
		if (m_Item->HasAttribute(AttrThermalDamage))
			thermal_damage = (m_Item->GetAttribute(AttrThermalDamage)).get_float();
		if (m_Item->HasAttribute(AttrEmDamage))
			em_damage = (m_Item->GetAttribute(AttrEmDamage)).get_float();
		if (m_Item->HasAttribute(AttrExplosiveDamage))
			explosive_damage = (m_Item->GetAttribute(AttrExplosiveDamage)).get_float();

		Damage damageDealt
			(
			m_Ship->GetOperator()->GetSystemEntity(),
			m_Item,
			kinetic_damage,			// kinetic damage
			thermal_damage,			// thermal damage
			em_damage,				// em damage
			explosive_damage,		// explosive damage
			(EVEEffectID)(m_effectID)	// from EVEEffectID::
			);

		m_targetEntity->ApplyDamage(damageDealt);

		// Reduce consumable in cargo:
		// TODO
	}
}