Well, have a look at the code:Kaks wrote:Hmm, I don't know why I didn't notice 'hasEquipmentItem item' before.
Code: Select all
- (BOOL) hasScoop
{
return [self hasEquipmentItem:@"EQ_FUEL_SCOOPS"];
}
- (BOOL) hasECM
{
return [self hasEquipmentItem:@"EQ_ECM"];
}
- (BOOL) hasCloakingDevice
{
return [self hasEquipmentItem:@"EQ_CLOAKING_DEVICE"];
}
- (BOOL) hasMilitaryScannerFilter
{
#if USEMASC
return [self hasEquipmentItem:@"EQ_MILITARY_SCANNER_FILTER"];
#else
return NO;
#endif
}
- (BOOL) hasMilitaryJammer
{
#if USEMASC
return [self hasEquipmentItem:@"EQ_MILITARY_JAMMER"];
#else
return NO;
#endif
}
- (BOOL) hasExpandedCargoBay
{
return [self hasEquipmentItem:@"EQ_CARGO_BAY"];
}
- (BOOL) hasShieldBooster
{
return [self hasEquipmentItem:@"EQ_SHIELD_BOOSTER"];
}
- (BOOL) hasMilitaryShieldEnhancer
{
return [self hasEquipmentItem:@"EQ_NAVAL_SHIELD_BOOSTER"];
}
- (BOOL) hasHeatShield
{
return [self hasEquipmentItem:@"EQ_HEAT_SHIELD"];
}
- (BOOL) hasFuelInjection
{
return [self hasEquipmentItem:@"EQ_FUEL_INJECTION"];
}
- (BOOL) hasEnergyBomb
{
return [self hasEquipmentItem:@"EQ_ENERGY_BOMB"];
}
- (BOOL) hasEscapePod
{
return [self hasEquipmentItem:@"EQ_ESCAPE_POD"];
}
- (BOOL) hasDockingComputer
{
return [self hasEquipmentItem:@"EQ_DOCK_COMP"];
}
- (BOOL) hasGalacticHyperdrive
{
return [self hasEquipmentItem:@"EQ_GAL_DRIVE"];
}
- (float) shieldBoostFactor
{
float boostFactor = 1.0f;
if ([self hasShieldBooster]) boostFactor += 1.0f;
if ([self hasMilitaryShieldEnhancer]) boostFactor += 1.0f;
return boostFactor;
}
- (float) maxForwardShieldLevel
{
return BASELINE_SHIELD_LEVEL * [self shieldBoostFactor];
}
- (float) maxAftShieldLevel
{
return BASELINE_SHIELD_LEVEL * [self shieldBoostFactor];
}
- (float) shieldRechargeRate
{
return [self hasMilitaryShieldEnhancer] ? 3.0f : 2.0f;
}
Furthermore, while my code addition only calls this in the default for determination of scanner color, Oolite itself does something very similar at the beginning:
Code: Select all
- (BOOL) isJammingScanning
{
return ([self hasMilitaryJammer] && military_jammer_active);
}
Screet