当前位置: 首页>>代码示例>>C++>>正文


C++ EvilNumber::get_float方法代码示例

本文整理汇总了C++中EvilNumber::get_float方法的典型用法代码示例。如果您正苦于以下问题:C++ EvilNumber::get_float方法的具体用法?C++ EvilNumber::get_float怎么用?C++ EvilNumber::get_float使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EvilNumber的用法示例。


在下文中一共展示了EvilNumber::get_float方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ME_EffectOnWaste

EvilNumber ME_EffectOnWaste( EvilNumber MaterialAmount, EvilNumber BaseWasteFactor, EvilNumber MaterialEfficiency )
{
    EvilNumber ME_Factor(0.0);

    if( MaterialEfficiency >= 0 )
        ME_Factor = (1.0 / (MaterialEfficiency.get_float() + 1.0));
    else
        ME_Factor = (1.0 - MaterialEfficiency.get_float());

    return (floor(0.5 + (MaterialAmount.get_float() * (BaseWasteFactor.get_float() / 100.0) * ME_Factor.get_float())));
}
开发者ID:Camwarp,项目名称:evemu_server,代码行数:11,代码来源:EVEUtils.cpp

示例2: EffectiveStanding

EvilNumber EffectiveStanding( EvilNumber YourStanding, EvilNumber ConnectionsSkillLevel, EvilNumber DiplomacySkillLevel )
{
    EvilNumber SkillLevel(0.0);

    if( YourStanding < 0.0 )
        SkillLevel = DiplomacySkillLevel;
    else
        SkillLevel = ConnectionsSkillLevel;

    return (YourStanding.get_float() + ((10.0 - YourStanding.get_float()) * (0.04 * (SkillLevel.get_float()))));
}
开发者ID:Camwarp,项目名称:evemu_server,代码行数:11,代码来源:EVEUtils.cpp

示例3: ProcessActiveCycle

void ActiveModuleProcessingComponent::ProcessActiveCycle()
{
	//TO-DO: Check to see if capacitor is drained at activation or after the cycle

    //check for stop signal
    if(m_Stop)
        return;

    //else consume capacitor
	EvilNumber capCapacity = m_Ship->GetAttribute(AttrCharge);
	EvilNumber capNeed = m_Mod->GetAttribute(AttrCapacitorNeed);
	capCapacity -= capNeed;

	m_Ship->SetAttribute(AttrCharge, capCapacity.get_float());

    //then check if we are targeting another ship or not and apply attribute changes
	//maybe we can have a check for modules that repeat the same attributes so we
	//send the changes just once at activation and at deactivation

	//--pseudocode--
	//if(target != self)
	//	m_ShipAttrComp->ModifyTargetShipAttribute();
	//else
	//	m_ShipAttrComp->ModifyShipAttribute();
}
开发者ID:B3N4K,项目名称:evemu_server,代码行数:25,代码来源:ActiveModuleProcessingComponent.cpp

示例4: _modifyModuleAttributes

/* rewrote attrib calculations and implemented true stacking penality, with checks for exceptions.  -allan 13April16  */
void ModifyModuleAttributesComponent::_modifyModuleAttributes(GenericModule* targetMod, uint32 targetAttrID, uint32 sourceAttrID, EVECalculationType type)
{
    uint8 stackSize = 1;
    EvilNumber modVal = m_Mod->GetAttribute(sourceAttrID), startVal = targetMod->GetAttribute(targetAttrID);
    /* check for attribs that are NOT penalized here, and bypass stacking method. */
    /* note:  DCU, rigs and subsystems do not use this method */
    if ((targetAttrID != AttrWarpFactor) or (sourceAttrID != AttrCargoCapacityMultiplier)) {
        std::map<uint16, uint8>::iterator itr = m_attribMap.find(targetAttrID);
        if (itr != m_attribMap.end()) {
            /** @todo   verify these module states  */
            if (m_Mod->GetModuleState() == MOD_ONLINE)
                stackSize = ++itr->second;
            else if ((m_Mod->GetModuleState() == MOD_OFFLINE)
                or (m_Mod->GetModuleState() == MOD_DEACTIVATING))
                /** @todo  implement the difference between MOD_OFFLINE and MOD_DEACTIVATING */
                {
                    if (itr->second == 1)
                        m_attribMap.erase(itr);
                    else
                        stackSize = --itr->second;
                }
        } else
            m_attribMap.emplace(targetAttrID, 1);
    }

    double effectiveness = 1;
    if (m_Mod->GetModuleState() == MOD_ONLINE) {
        effectiveness = exp(-pow(((stackSize - 1)/2.67),2));  //stacking calculation fixed  -allan  20Dec15
        m_Mod->SetEffectiveness(targetAttrID, effectiveness);
    } else if ((m_Mod->GetModuleState() == MOD_OFFLINE) or (m_Mod->GetModuleState() == MOD_DEACTIVATING)) {
        effectiveness = m_Mod->GetEffectiveness(targetAttrID);
    }
    if (effectiveness <= 0) {   /* this should never happen */
        codelog(SHIP__MODULE_ERROR, "MMAC::_modifyModuleAttributes() -  effectiveness <= 0");
        targetMod->GetShipRef()->GetPilot()->SendErrorMsg("Internal Server Error.  Ref: ServerError 25620");
    }
    modVal *= effectiveness;
    EvilNumber newVal = CalculateNewAttributeValue(startVal, modVal, type);
    _log(SHIP__MODULE_TRACE, "MMAC::_modifyModuleAttributes() -  origVal:%f, Mod:%f, newVal:%f, stackSize:%u, effective:%f, type:%i", \
    startVal.get_float(), modVal.get_float(), newVal.get_float(), stackSize, effectiveness, (int)type);

    SetAttribute(targetMod, targetAttrID, newVal);
}
开发者ID:Vortex24,项目名称:evemu-Mainserver,代码行数:44,代码来源:ModifyModuleAttributesComponent.cpp

示例5: TimeToLock

uint32 TargetManager::TimeToLock(ShipRef ship, SystemEntity *target) const {

    EvilNumber scanRes = ship->GetAttribute(AttrScanResolution);
    EvilNumber sigRad(500);

	if( target->Item().get() != NULL )
		if( target->Item()->HasAttribute(AttrSignatureRadius) )
			sigRad = target->Item()->GetAttribute(AttrSignatureRadius);

    EvilNumber time = ( EvilNumber(40000) / ( scanRes ) ) /( EvilNumber::pow( e_log( sigRad + e_sqrt( sigRad * sigRad + 1) ), 2) );

	return static_cast<uint32>(time.get_float() * 1000); // Timer uses ms instead of seconds
}
开发者ID:Camwarp,项目名称:evemu_server,代码行数:13,代码来源:TargetManager.cpp

示例6: ProductionTime

EvilNumber ProductionTime( EvilNumber BaseProductionTime, EvilNumber ProductivityModifier, EvilNumber ProductionEfficiency, EvilNumber ProductionTimeModifier )
{
    EvilNumber PE_Factor(0.0);

    if( ProductionEfficiency >= 0.0 )
        PE_Factor = (ProductionEfficiency.get_float() / (1.0 + ProductionEfficiency.get_float()));
    else
        PE_Factor = (ProductionEfficiency.get_float() - 1.0);

    return (BaseProductionTime.get_float()
        * (1.0 - (ProductivityModifier.get_float() / BaseProductionTime.get_float())
        * (PE_Factor.get_float()))
        * ProductionTimeModifier.get_float());
}
开发者ID:Camwarp,项目名称:evemu_server,代码行数:14,代码来源:EVEUtils.cpp

示例7: BlueprintInventionChance

EvilNumber BlueprintInventionChance( EvilNumber BaseChance, EvilNumber EncryptionSkillLevel, EvilNumber DataCore1SkillLevel, EvilNumber DataCore2SkillLevel, EvilNumber MetaLevel, EvilNumber DecryptorModifier )
{
    return (BaseChance.get_float() * (1+0.01*EncryptionSkillLevel.get_float())
        * (1+(DataCore1SkillLevel.get_float()+DataCore2SkillLevel.get_float())
        * (0.1 / (5 - MetaLevel.get_float())) * DecryptorModifier.get_float()));
}
开发者ID:Camwarp,项目名称:evemu_server,代码行数:6,代码来源:EVEUtils.cpp

示例8: ModifyNonStackingModuleAttributes

// set attributes that are not stackable here...calibration, PG, CPU, etc.
void ModifyModuleAttributesComponent::ModifyNonStackingModuleAttributes(GenericModule* targetMod, uint32 targetAttrID, uint32 sourceAttrID, EVECalculationType type) {
    EvilNumber newVal = CalculateNewAttributeValue(targetMod->GetAttribute(targetAttrID), m_Mod->GetAttribute(sourceAttrID), type);
    if (!targetMod->getItem()->SetAttribute(targetAttrID, newVal))
        sLog.Error("MMAC::ModifyNonStackingModuleAttributes()","Failed to set attribute %u to %f on module %u", targetAttrID, newVal.get_float(), targetMod->itemID());
}
开发者ID:Vortex24,项目名称:evemu-Mainserver,代码行数:6,代码来源:ModifyModuleAttributesComponent.cpp

示例9: TradeBrokerFee

EvilNumber TradeBrokerFee( EvilNumber BrokerRelationsSkillLevel, EvilNumber FactionStanding, EvilNumber CorporationStanding )
{
    return (100.0 * ((0.01 - 0.0005 * BrokerRelationsSkillLevel.get_float())
        / (pow( 2, (0.14 * FactionStanding.get_float() + 0.06 * CorporationStanding.get_float()) ))));
}
开发者ID:Camwarp,项目名称:evemu_server,代码行数:5,代码来源:EVEUtils.cpp

示例10: TargetingLockTime

EvilNumber TargetingLockTime( EvilNumber YourEffectiveScanResolution, EvilNumber TargetEffectiveSignatureRadius )
{
    return (40000.0 / (YourEffectiveScanResolution.get_float() * pow(asinh(TargetEffectiveSignatureRadius.get_float()),2)));
}
开发者ID:Camwarp,项目名称:evemu_server,代码行数:4,代码来源:EVEUtils.cpp

示例11: SkillPointsAtLevel

EvilNumber SkillPointsAtLevel( EvilNumber SkillLevel, EvilNumber SkillRank )
{
    return (pow( 2, (2.5 * SkillLevel.get_float()) - 2.5 ) * 250.0 * SkillRank);
}
开发者ID:Camwarp,项目名称:evemu_server,代码行数:4,代码来源:EVEUtils.cpp

示例12: MissionStandingIncrease

EvilNumber MissionStandingIncrease( EvilNumber BaseMissionIncrease, EvilNumber YourSocialSkillLevel )
{
    return (BaseMissionIncrease * (1 + 0.05 * YourSocialSkillLevel.get_float()));
}
开发者ID:Camwarp,项目名称:evemu_server,代码行数:4,代码来源:EVEUtils.cpp

示例13: RequiredAgentStanding

EvilNumber RequiredAgentStanding( EvilNumber AgentLevel, EvilNumber AgentQuality )
{
    return (((AgentLevel.get_float() - 1) * 2) + (AgentQuality.get_float()/20.0));
}
开发者ID:Camwarp,项目名称:evemu_server,代码行数:4,代码来源:EVEUtils.cpp

示例14: ME_LevelToEliminateWaste

EvilNumber ME_LevelToEliminateWaste( EvilNumber MaterialAmount, EvilNumber BaseWasteFactor )
{
    return (floor(0.02 * BaseWasteFactor.get_float() * MaterialAmount.get_float()));
}
开发者ID:Camwarp,项目名称:evemu_server,代码行数:4,代码来源:EVEUtils.cpp

示例15: AgentEffectiveQuality

EvilNumber AgentEffectiveQuality( EvilNumber AgentQuality, EvilNumber NegotiationSkillLevel, EvilNumber AgentPersonalStanding )
{
    return (AgentQuality.get_float() + (5.0 * NegotiationSkillLevel.get_float()) + AgentPersonalStanding.get_float());
}
开发者ID:Camwarp,项目名称:evemu_server,代码行数:4,代码来源:EVEUtils.cpp


注:本文中的EvilNumber::get_float方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。