Oolite 1.91.0.7644-241112-7f5034b
Loading...
Searching...
No Matches
StationEntity Class Reference

#include <StationEntity.h>

+ Inheritance diagram for StationEntity:
+ Collaboration diagram for StationEntity:

Instance Methods

(OOCargoQuantity- marketCapacity
 
(NSArray *) - marketDefinition
 
(NSString *) - marketScriptName
 
(BOOL) - marketMonitored
 
(BOOL) - marketBroadcast
 
(OOCreditsQuantity- legalStatusOfManifest:export:
 
(OOCommodityMarket *) - localMarket
 
(void) - setLocalMarket:
 
(NSDictionary *) - localMarketForScripting
 
(void) - setPrice:forCommodity:
 
(void) - setQuantity:forCommodity:
 
(NSMutableArray *) - localShipyard
 
(void) - setLocalShipyard:
 
(void) - generateShipyard
 
(void) - generateShipyard:
 
(NSMutableDictionary *) - localInterfaces
 
(void) - setInterfaceDefinition:forKey:
 
(OOCommodityMarket *) - initialiseLocalMarket
 
(OOTechLevelID- equivalentTechLevel
 
(void) - setEquivalentTechLevel:
 
(NSEnumerator *) - dockSubEntityEnumerator
 
(Vector) - virtualPortDimensions
 
(DockEntity *) - playerReservedDock
 
(HPVector) - beaconPosition
 
(float) - equipmentPriceFactor
 
(void) - setPlanet:
 
(OOPlanetEntity *) - planet
 
(void) - setAllegiance:
 
(NSString *) - allegiance
 
(unsigned) - countOfDockedContractors
 
(unsigned) - countOfDockedPolice
 
(unsigned) - countOfDockedDefenders
 
(void) - sanityCheckShipsOnApproach
 
(void) - autoDockShipsOnApproach
 
(Vector) - portUpVectorForShip:
 
(NSDictionary *) - dockingInstructionsForShip:
 
(BOOL) - shipIsInDockingCorridor:
 
(BOOL) - dockingCorridorIsEmpty
 
(void) - clearDockingCorridor
 
(void) - clear
 
(void) - abortAllDockings
 
(void) - abortDockingForShip:
 
(BOOL) - hasMultipleDocks
 
(BOOL) - hasClearDock
 
(BOOL) - hasLaunchDock
 
(DockEntity *) - selectDockForDocking
 
(unsigned) - currentlyInLaunchingQueues
 
(unsigned) - currentlyInDockingQueues
 
(void) - launchShip:
 
(ShipEntity *) - launchIndependentShip:
 
(void) - noteDockedShip:
 
(BOOL) - interstellarUndockingAllowed
 
(BOOL) - hasNPCTraffic
 
(void) - setHasNPCTraffic:
 
(OOStationAlertLevel- alertLevel
 
(void) - setAlertLevel:signallingScript:
 
(void) - increaseAlertLevel
 
(void) - decreaseAlertLevel
 
(NSArray *) - launchPolice
 
(ShipEntity *) - launchDefenseShip
 
(ShipEntity *) - launchScavenger
 
(ShipEntity *) - launchMiner
 
(ShipEntity *) - launchPirateShip
 
(ShipEntity *) - launchShuttle
 
(ShipEntity *) - launchEscort
 
(ShipEntity *) - launchPatrol
 
(void) - launchShipWithRole:
 
(void) - acceptPatrolReportFrom:
 
(NSString *) - acceptDockingClearanceRequestFrom:
 
(BOOL) - requiresDockingClearance
 
(void) - setRequiresDockingClearance:
 
(BOOL) - allowsFastDocking
 
(void) - setAllowsFastDocking:
 
(BOOL) - allowsAutoDocking
 
(void) - setAllowsAutoDocking:
 
(BOOL) - allowsSaving
 
(NSString *) - marketOverrideName
 
(BOOL) - isRotatingStation
 
(BOOL) - hasShipyard
 
(BOOL) - suppressArrivalReports
 
(void) - setSuppressArrivalReports:
 
(BOOL) - hasBreakPattern
 
(void) - setHasBreakPattern:
 
(BOOL) - fitsInDock:
 
(BOOL) - fitsInDock:andLogNoFit:
 
(BOOL) - isUnpiloted [implementation]
 
(void) - autoDockShipsOnHold [implementation]
 
(NSDictionary *) - OOMakeDockingInstructions [implementation]
 
(NSDictionary *) - holdPositionInstructionForShip: [implementation]
 
(id) - initWithKey:definition: [implementation]
 
(void) - dealloc [implementation]
 
(BOOL) - setUpShipFromDictionary: [implementation]
 
(BOOL) - setUpSubEntities [implementation]
 
(void) - pullInShipIfPermitted: [implementation]
 
(void) - update: [implementation]
 
(BOOL) - hasEligibleDock [implementation]
 
(void) - addShipToLaunchQueue:withPriority: [implementation]
 
(unsigned) - countOfShipsInLaunchQueueWithPrimaryRole: [implementation]
 
(void) - addShipToStationCount: [implementation]
 
(BOOL) - collideWithShip: [implementation]
 
(BOOL) - hasHostileTarget [implementation]
 
(void) - takeEnergyDamage:from:becauseOf:weaponIdentifier: [implementation]
 
(void) - adjustVelocity: [implementation]
 
(void) - takeScrapeDamage:from: [implementation]
 
(void) - takeHeatDamage: [implementation]
 
(void) - becomeExplosion [implementation]
 
(void) - becomeEnergyBlast [implementation]
 
(void) - becomeLargeExplosion: [implementation]
 
(NSString *) - descriptionComponents [implementation]
 
(void) - dumpSelfState [implementation]
 
(NSArray *) - dbgGetShipsOnApproach [implementation]
 
(NSArray *) - dbgGetIdLocks [implementation]
 
(NSString *) - dbgDumpIdLocks [implementation]
 
(void) - acceptDistressMessageFrom: [implementation]
 
(void) - getJSClass:andPrototype: [implementation]
 
(NSString *) - oo_jsClassName [implementation]
 
- Instance Methods inherited from ShipEntity
(void) - setStateMachine:
 
(void) - setAI:
 
(AI *) - getAI
 
(BOOL) - hasAutoAI
 
(BOOL) - hasNewAI
 
(void) - setShipScript:
 
(void) - removeScript
 
(OOScript *) - shipScript
 
(OOScript *) - shipAIScript
 
(OOTimeAbsolute- shipAIScriptWakeTime
 
(void) - setAIScriptWakeTime:
 
(double) - frustration
 
(void) - setLaunchDelay:
 
(void) - interpretAIMessage:
 
(GLfloat) - accuracy
 
(void) - setAccuracy:
 
(OOMesh *) - mesh
 
(void) - setMesh:
 
(BoundingBox) - totalBoundingBox
 
(Vector) - forwardVector
 
(Vector) - upVector
 
(Vector) - rightVector
 
(NSArray *) - subEntities
 
(NSUInteger) - subEntityCount
 
(BOOL) - hasSubEntity:
 
(NSEnumerator *) - subEntityEnumerator
 
(NSEnumerator *) - shipSubEntityEnumerator
 
(NSEnumerator *) - flasherEnumerator
 
(NSEnumerator *) - exhaustEnumerator
 
(ShipEntity *) - subEntityTakingDamage
 
(void) - setSubEntityTakingDamage:
 
(void) - clearSubEntities
 
(Quaternion) - subEntityRotationalVelocity
 
(void) - setSubEntityRotationalVelocity:
 
(NSString *) - serializeShipSubEntities
 
(void) - deserializeShipSubEntitiesFrom:
 
(NSUInteger) - maxShipSubEntities
 
(void) - setSubIdx:
 
(NSUInteger) - subIdx
 
(Octree *) - octree
 
(float) - volume
 
(GLfloat) - doesHitLine:v0:
 
(GLfloat) - doesHitLine:v0:v1:
 
(GLfloat) - doesHitLine:v0:withPosition:andIJK:i:j:
 
(BoundingBox) - findBoundingBoxRelativeToPosition:InVectors:i:j:
 
(HPVector) - absoluteTractorPosition
 
(void) - setIsBoulder:
 
(BOOL) - isBoulder
 
(BOOL) - isMinable
 
(BOOL) - countsAsKill
 
(void) - setUpEscorts
 
(void) - updateEscortFormation
 
(BOOL) - setUpFromDictionary:
 
(BOOL) - setUpOneStandardSubentity:asTurret:
 
(GLfloat) - frustumRadius
 
(NSString *) - shipDataKey
 
(NSString *) - shipDataKeyAutoRole
 
(void) - setShipDataKey:
 
(NSDictionary *) - shipInfoDictionary
 
(NSArray *) - getWeaponOffsetFrom:withKey:inMode:
 
(NSArray *) - aftWeaponOffset
 
(NSArray *) - forwardWeaponOffset
 
(NSArray *) - portWeaponOffset
 
(NSArray *) - starboardWeaponOffset
 
(BOOL) - hasAutoWeapons
 
(BOOL) - isFrangible
 
(BOOL) - suppressFlightNotifications
 
(void) - respondToAttackFrom:becauseOf:
 
(OOWeaponFacingSet- weaponFacings
 
(BOOL) - hasEquipmentItem:includeWeapons:whileLoading:
 
(BOOL) - hasEquipmentItem:
 
(NSUInteger) - countEquipmentItem:
 
(NSString *) - equipmentItemProviding:
 
(BOOL) - hasEquipmentItemProviding:
 
(BOOL) - hasAllEquipment:includeWeapons:whileLoading:
 
(BOOL) - hasAllEquipment:
 
(BOOL) - setWeaponMount:toWeapon:
 
(BOOL) - canAddEquipment:inContext:
 
(BOOL) - equipmentValidToAdd:inContext:
 
(BOOL) - equipmentValidToAdd:whileLoading:inContext:
 
(BOOL) - addEquipmentItem:inContext:
 
(BOOL) - addEquipmentItem:withValidation:inContext:
 
(BOOL) - hasHyperspaceMotor
 
(float) - hyperspaceSpinTime
 
(void) - setHyperspaceSpinTime:
 
(NSEnumerator *) - equipmentEnumerator
 
(NSUInteger) - equipmentCount
 
(void) - removeEquipmentItem:
 
(void) - removeAllEquipment
 
(OOEquipmentType *) - selectMissile
 
(OOCreditsQuantity- removeMissiles
 
(BOOL) - hasOneEquipmentItem:includeWeapons:whileLoading:
 
(BOOL) - hasOneEquipmentItem:includeMissiles:whileLoading:
 
(BOOL) - hasPrimaryWeapon:
 
(BOOL) - removeExternalStore:
 
(NSUInteger) - parcelCount
 
(NSUInteger) - passengerCount
 
(NSUInteger) - passengerCapacity
 
(NSUInteger) - missileCount
 
(NSUInteger) - missileCapacity
 
(NSUInteger) - extraCargo
 
(BOOL) - hasScoop
 
(BOOL) - hasFuelScoop
 
(BOOL) - hasCargoScoop
 
(BOOL) - hasECM
 
(BOOL) - hasCloakingDevice
 
(BOOL) - hasMilitaryScannerFilter
 
(BOOL) - hasMilitaryJammer
 
(BOOL) - hasExpandedCargoBay
 
(BOOL) - hasShieldBooster
 
(BOOL) - hasMilitaryShieldEnhancer
 
(BOOL) - hasHeatShield
 
(BOOL) - hasFuelInjection
 
(BOOL) - hasCascadeMine
 
(BOOL) - hasEscapePod
 
(BOOL) - hasDockingComputer
 
(BOOL) - hasGalacticHyperdrive
 
(float) - shieldBoostFactor
 
(float) - maxForwardShieldLevel
 
(float) - maxAftShieldLevel
 
(float) - shieldRechargeRate
 
(double) - maxHyperspaceDistance
 
(float) - afterburnerFactor
 
(float) - afterburnerRate
 
(void) - setAfterburnerFactor:
 
(void) - setAfterburnerRate:
 
(float) - maxThrust
 
(float) - thrust
 
(void) - setMaxThrust:
 
(void) - setMaxFlightPitch:
 
(void) - setMaxFlightSpeed:
 
(void) - setMaxFlightRoll:
 
(void) - setMaxFlightYaw:
 
(void) - setEnergyRechargeRate:
 
(void) - processBehaviour:
 
(void) - behaviour_stop_still:
 
(void) - behaviour_idle:
 
(void) - behaviour_tumble:
 
(void) - behaviour_tractored:
 
(void) - behaviour_track_target:
 
(void) - behaviour_intercept_target:
 
(void) - behaviour_attack_target:
 
(void) - behaviour_attack_slow_dogfight:
 
(void) - behaviour_evasive_action:
 
(void) - behaviour_attack_break_off_target:
 
(void) - behaviour_fly_to_target_six:
 
(void) - behaviour_attack_mining_target:
 
(void) - behaviour_attack_fly_to_target:
 
(void) - behaviour_attack_fly_from_target:
 
(void) - behaviour_running_defense:
 
(void) - behaviour_flee_target:
 
(void) - behaviour_attack_broadside:
 
(void) - behaviour_attack_broadside_left:
 
(void) - behaviour_attack_broadside_right:
 
(void) - behaviour_close_to_broadside_range:
 
(void) - behaviour_close_with_target:
 
(void) - behaviour_attack_broadside_target:leftside:
 
(void) - behaviour_attack_sniper:
 
(void) - behaviour_fly_range_from_destination:
 
(void) - behaviour_face_destination:
 
(void) - behaviour_land_on_planet:
 
(void) - behaviour_formation_form_up:
 
(void) - behaviour_fly_to_destination:
 
(void) - behaviour_fly_from_destination:
 
(void) - behaviour_avoid_collision:
 
(void) - behaviour_track_as_turret:
 
(void) - behaviour_fly_thru_navpoints:
 
(void) - behaviour_scripted_ai:
 
(float) - reactionTime
 
(void) - setReactionTime:
 
(HPVector) - calculateTargetPosition
 
(void) - startTrackingCurve
 
(void) - updateTrackingCurve
 
(void) - calculateTrackingCurve
 
(GLfloat *) - scannerDisplayColorForShip:otherShip:isHostile:flash:scannerDisplayColor1:scannerDisplayColor2:scannerDisplayColorH1:
 
(void) - setScannerDisplayColor1:
 
(void) - setScannerDisplayColor2:
 
(OOColor *) - scannerDisplayColor1
 
(OOColor *) - scannerDisplayColor2
 
(void) - setScannerDisplayColorHostile1:
 
(void) - setScannerDisplayColorHostile2:
 
(OOColor *) - scannerDisplayColorHostile1
 
(OOColor *) - scannerDisplayColorHostile2
 
(BOOL) - isCloaked
 
(void) - setCloaked:
 
(BOOL) - hasAutoCloak
 
(void) - setAutoCloak:
 
(void) - applyThrust:
 
(void) - applyAttitudeChanges:
 
(void) - avoidCollision
 
(void) - resumePostProximityAlert
 
(double) - messageTime
 
(void) - setMessageTime:
 
(OOShipGroup *) - group
 
(void) - setGroup:
 
(OOShipGroup *) - escortGroup
 
(void) - setEscortGroup:
 
(OOShipGroup *) - stationGroup
 
(BOOL) - hasEscorts
 
(NSEnumerator *) - escortEnumerator
 
(NSArray *) - escortArray
 
(uint8_t) - escortCount
 
(uint8_t) - pendingEscortCount
 
(void) - setPendingEscortCount:
 
(uint8_t) - maxEscortCount
 
(void) - setMaxEscortCount:
 
(NSUInteger) - turretCount
 
(NSString *) - name
 
(NSString *) - shipUniqueName
 
(NSString *) - shipClassName
 
(NSString *) - displayName
 
(NSString *) - scanDescription
 
(NSString *) - scanDescriptionForScripting
 
(void) - setName:
 
(void) - setShipUniqueName:
 
(void) - setShipClassName:
 
(void) - setDisplayName:
 
(void) - setScanDescription:
 
(NSString *) - identFromShip:
 
(BOOL) - hasRole:
 
(OORoleSet *) - roleSet
 
(void) - addRole:
 
(void) - addRole:withProbability:
 
(void) - removeRole:
 
(NSString *) - primaryRole
 
(void) - setPrimaryRole:
 
(BOOL) - hasPrimaryRole:
 
(BOOL) - isPolice
 
(BOOL) - isThargoid
 
(BOOL) - isTrader
 
(BOOL) - isPirate
 
(BOOL) - isMissile
 
(BOOL) - isMine
 
(BOOL) - isWeapon
 
(BOOL) - isEscort
 
(BOOL) - isShuttle
 
(BOOL) - isTurret
 
(BOOL) - isPirateVictim
 
(BOOL) - isExplicitlyUnpiloted
 
(OOAlertCondition- alertCondition
 
(OOAlertCondition- realAlertCondition
 
(BOOL) - isHostileTo:
 
(NSUInteger) - defenseTargetCount
 
(NSArray *) - allDefenseTargets
 
(NSEnumerator *) - defenseTargetEnumerator
 
(void) - validateDefenseTargets
 
(BOOL) - addDefenseTarget:
 
(BOOL) - isDefenseTarget:
 
(void) - removeDefenseTarget:
 
(void) - removeAllDefenseTargets
 
(NSArray *) - collisionExceptions
 
(void) - addCollisionException:
 
(void) - removeCollisionException:
 
(BOOL) - collisionExceptedFor:
 
(GLfloat) - weaponRange
 
(void) - setWeaponRange:
 
(void) - setWeaponDataFromType:
 
(float) - energyRechargeRate
 
(float) - weaponRechargeRate
 
(void) - setWeaponRechargeRate:
 
(void) - setWeaponEnergy:
 
(OOWeaponFacing- currentWeaponFacing
 
(GLfloat) - scannerRange
 
(void) - setScannerRange:
 
(Vector) - reference
 
(void) - setReference:
 
(BOOL) - reportAIMessages
 
(void) - setReportAIMessages:
 
(void) - transitionToAegisNone
 
(OOPlanetEntity *) - findNearestPlanet
 
(Entity< OOStellarBody > *) - findNearestStellarBody
 
(OOPlanetEntity *) - findNearestPlanetExcludingMoons
 
(OOAegisStatus- checkForAegis
 
(void) - forceAegisCheck
 
(BOOL) - withinStationAegis
 
(void) - setLastAegisLock:
 
(OOSystemID- homeSystem
 
(OOSystemID- destinationSystem
 
(void) - setHomeSystem:
 
(void) - setDestinationSystem:
 
(NSArray *) - crew
 
(NSArray *) - crewForScripting
 
(void) - setCrew:
 
(void) - setSingleCrewWithRole:
 
(OOFuelQuantity- fuel
 
(void) - setFuel:
 
(OOFuelQuantity- fuelCapacity
 
(GLfloat) - fuelChargeRate
 
(void) - setRoll:
 
(void) - setRawRoll:
 
(void) - setPitch:
 
(void) - setYaw:
 
(void) - setThrust:
 
(void) - applySticks:
 
(void) - setThrustForDemo:
 
(void) - setBounty:
 
(void) - setBounty:withReason:
 
(void) - setBounty:withReasonAsString:
 
(OOCreditsQuantity- bounty
 
(int- legalStatus
 
(BOOL) - isTemplateCargoPod
 
(void) - setUpCargoType:
 
(void) - setCommodity:andAmount:
 
(void) - setCommodityForPod:andAmount:
 
(OOCommodityType- commodityType
 
(OOCargoQuantity- commodityAmount
 
(OOCargoQuantity- maxAvailableCargoSpace
 
(void) - setMaxAvailableCargoSpace:
 
(OOCargoQuantity- availableCargoSpace
 
(OOCargoQuantity- cargoQuantityOnBoard
 
(OOCargoType- cargoType
 
(NSArray *) - cargoListForScripting
 
(NSMutableArray *) - cargo
 
(void) - setCargo:
 
(BOOL) - addCargo:
 
(BOOL) - removeCargo:amount:
 
(BOOL) - showScoopMessage
 
(NSArray *) - passengerListForScripting
 
(NSArray *) - parcelListForScripting
 
(NSArray *) - contractListForScripting
 
(NSArray *) - equipmentListForScripting
 
(OOWeaponType- weaponTypeIDForFacing:strict:
 
(OOEquipmentType *) - weaponTypeForFacing:strict:
 
(NSArray *) - missilesList
 
(OOCargoFlag- cargoFlag
 
(void) - setCargoFlag:
 
(void) - setSpeed:
 
(double) - desiredSpeed
 
(void) - setDesiredSpeed:
 
(double) - desiredRange
 
(void) - setDesiredRange:
 
(double) - cruiseSpeed
 
(Vector) - thrustVector
 
(void) - setTotalVelocity:
 
(void) - increase_flight_speed:
 
(void) - decrease_flight_speed:
 
(void) - increase_flight_roll:
 
(void) - decrease_flight_roll:
 
(void) - increase_flight_pitch:
 
(void) - decrease_flight_pitch:
 
(void) - increase_flight_yaw:
 
(void) - decrease_flight_yaw:
 
(GLfloat) - flightRoll
 
(GLfloat) - flightPitch
 
(GLfloat) - flightYaw
 
(GLfloat) - flightSpeed
 
(GLfloat) - maxFlightPitch
 
(GLfloat) - maxFlightSpeed
 
(GLfloat) - maxFlightRoll
 
(GLfloat) - maxFlightYaw
 
(GLfloat) - speedFactor
 
(GLfloat) - temperature
 
(void) - setTemperature:
 
(GLfloat) - heatInsulation
 
(void) - setHeatInsulation:
 
(float) - randomEjectaTemperature
 
(float) - randomEjectaTemperatureWithMaxFactor:
 
(int- damage
 
(void) - dealEnergyDamage:atRange:withBias:
 
(void) - dealEnergyDamageWithinDesiredRange
 
(void) - dealMomentumWithinDesiredRange:
 
(void) - noteTakingDamage:from:type:
 
(void) - noteKilledBy:damageType:
 
(void) - getDestroyedBy:damageType:
 
(void) - broadcastEnergyBlastImminent
 
(void) - setIsWreckage:
 
(BOOL) - showDamage
 
(Vector) - positionOffsetForAlignment:
 
(Vector) - positionOffsetForShipInRotationToAlignment
 
(void) - collectBountyFor:
 
(BoundingBox) - findSubentityBoundingBox
 
(Triangle) - absoluteIJKForSubentity
 
(GLfloat) - weaponRecoveryTime
 
(GLfloat) - laserHeatLevel
 
(GLfloat) - laserHeatLevelAft
 
(GLfloat) - laserHeatLevelForward
 
(GLfloat) - laserHeatLevelPort
 
(GLfloat) - laserHeatLevelStarboard
 
(GLfloat) - hullHeatLevel
 
(GLfloat) - entityPersonality
 
(GLint) - entityPersonalityInt
 
(void) - setEntityPersonalityInt:
 
(void) - setSuppressExplosion:
 
(void) - resetExhaustPlumes
 
(void) - removeExhaust:
 
(void) - removeFlasher:
 
(void) - checkScanner
 
(void) - checkScannerIgnoringUnpowered
 
(ShipEntity **) - scannedShips
 
(int- numberOfScannedShips
 
(Entity *) - foundTarget
 
(Entity *) - primaryAggressor
 
(Entity *) - lastEscortTarget
 
(Entity *) - thankedShip
 
(Entity *) - rememberedShip
 
(Entity *) - proximityAlert
 
(void) - setFoundTarget:
 
(void) - setPrimaryAggressor:
 
(void) - setLastEscortTarget:
 
(void) - setThankedShip:
 
(void) - setRememberedShip:
 
(void) - setProximityAlert:
 
(void) - setTargetStation:
 
(BOOL) - isValidTarget:
 
(void) - addTarget:
 
(void) - removeTarget:
 
(BOOL) - canStillTrackPrimaryTarget
 
(id) - primaryTarget
 
(id) - primaryTargetWithoutValidityCheck
 
(StationEntity *) - targetStation
 
(BOOL) - isFriendlyTo:
 
(ShipEntity *) - shipHitByLaser
 
(void) - noteLostTarget
 
(void) - noteLostTargetAndGoIdle
 
(void) - noteTargetDestroyed:
 
(OOBehaviour- behaviour
 
(void) - setBehaviour:
 
(void) - trackOntoTarget:withDForward:
 
(double) - ballTrackLeadingTarget:atTarget:
 
(GLfloat) - rollToMatchUp:rotating:
 
(GLfloat) - rangeToDestination
 
(double) - trackDestination:delta_t:
 
(void) - setCoordinate:
 
(HPVector) - coordinates
 
(HPVector) - destination
 
(HPVector) - distance_six:
 
(HPVector) - distance_twelve:withOffset:
 
(void) - setEvasiveJink:
 
(void) - evasiveAction:
 
(double) - trackPrimaryTarget:delta_t:
 
(double) - trackSideTarget:delta_t:
 
(double) - missileTrackPrimaryTarget:
 
(double) - rangeToPrimaryTarget
 
(double) - approachAspectToPrimaryTarget
 
(double) - rangeToSecondaryTarget:
 
(BOOL) - hasProximityAlertIgnoringTarget:
 
(GLfloat) - currentAimTolerance
 
(GLfloat) - lookingAtSunWithThresholdAngleCos:
 
(BOOL) - onTarget:withWeapon:
 
(OOTimeDelta- shotTime
 
(void) - resetShotTime
 
(BOOL) - fireMainWeapon:
 
(BOOL) - fireAftWeapon:
 
(BOOL) - firePortWeapon:
 
(BOOL) - fireStarboardWeapon:
 
(BOOL) - fireTurretCannon:
 
(void) - setLaserColor:
 
(void) - setExhaustEmissiveColor:
 
(OOColor *) - laserColor
 
(OOColor *) - exhaustEmissiveColor
 
(BOOL) - fireSubentityLaserShot:
 
(BOOL) - fireDirectLaserShot:
 
(BOOL) - fireDirectLaserDefensiveShot
 
(BOOL) - fireDirectLaserShotAt:
 
(NSArray *) - laserPortOffset:
 
(BOOL) - fireLaserShotInDirection:weaponIdentifier:
 
(void) - adjustMissedShots:
 
(int- missedShots
 
(void) - considerFiringMissile:
 
(Vector) - missileLaunchPosition
 
(ShipEntity *) - fireMissile
 
(ShipEntity *) - fireMissileWithIdentifier:andTarget:
 
(BOOL) - isMissileFlagSet
 
(void) - setIsMissileFlag:
 
(OOTimeDelta- missileLoadTime
 
(void) - setMissileLoadTime:
 
(void) - noticeECM
 
(BOOL) - fireECM
 
(BOOL) - cascadeIfAppropriateWithDamageAmount:cascadeOwner:
 
(BOOL) - activateCloakingDevice
 
(void) - deactivateCloakingDevice
 
(BOOL) - launchCascadeMine
 
(ShipEntity *) - launchEscapeCapsule
 
(OOCommodityType- dumpCargo
 
(ShipEntity *) - dumpCargoItem:
 
(OOCargoType- dumpItem:
 
(void) - manageCollisions
 
(void) - addImpactMoment:fraction:
 
(BOOL) - canScoop:
 
(void) - getTractoredBy:
 
(void) - scoopIn:
 
(void) - scoopUp:
 
(void) - scoopUpProcess:processEvents:processMessages:
 
(BOOL) - abandonShip
 
(void) - enterDock:
 
(void) - leaveDock:
 
(void) - enterWormhole:
 
(void) - enterWormhole:replacing:
 
(void) - enterWitchspace
 
(void) - leaveWitchspace
 
(BOOL) - witchspaceLeavingEffects
 
(void) - markAsOffender:
 
(void) - markAsOffender:withReason:
 
(void) - switchLightsOn
 
(void) - switchLightsOff
 
(BOOL) - lightsActive
 
(void) - setDestination:
 
(void) - setEscortDestination:
 
(BOOL) - canAcceptEscort:
 
(BOOL) - acceptAsEscort:
 
(void) - deployEscorts
 
(void) - dockEscorts
 
(void) - setTargetToNearestFriendlyStation
 
(void) - setTargetToNearestStation
 
(void) - setTargetToSystemStation
 
(void) - landOnPlanet:
 
(void) - abortDocking
 
(NSDictionary *) - dockingInstructions
 
(void) - broadcastThargoidDestroyed
 
(void) - broadcastHitByLaserFrom:
 
(GLfloat) - sunGlareFilter
 
(void) - setSunGlareFilter:
 
(void) - sendExpandedMessage:toShip:
 
(void) - sendMessage:toShip:withUnpilotedOverride:
 
(void) - broadcastAIMessage:
 
(void) - broadcastMessage:withUnpilotedOverride:
 
(void) - setCommsMessageColor
 
(void) - receiveCommsMessage:from:
 
(void) - commsMessage:withUnpilotedOverride:
 
(BOOL) - markedForFines
 
(BOOL) - markForFines
 
(BOOL) - isMining
 
(void) - spawn:
 
(int- checkShipsInVicinityForWitchJumpExit
 
(BOOL) - trackCloseContacts
 
(void) - setTrackCloseContacts:
 
(void) - setHulk:
 
(BOOL) - isHulk
 
(OOJSScript *) - script
 
(NSDictionary *) - scriptInfo
 
(void) - overrideScriptInfo:
 
(BOOL) - scriptedMisjump
 
(void) - setScriptedMisjump:
 
(GLfloat) - scriptedMisjumpRange
 
(void) - setScriptedMisjumpRange:
 
(Entity *) - entityForShaderProperties
 
(void) - setDemoShip:
 
(BOOL) - isDemoShip
 
(void) - setDemoStartTime:
 
(void) - doScriptEvent:
 
(void) - doScriptEvent:withArgument:
 
(void) - doScriptEvent:withArgument:andArgument:
 
(void) - doScriptEvent:withArguments:
 
(void) - doScriptEvent:withArguments:count:
 
(void) - doScriptEvent:inContext:withArguments:count:
 
(void) - reactToAIMessage:context:
 
(void) - sendAIMessage:
 
(void) - doScriptEvent:andReactToAIMessage:
 
(void) - doScriptEvent:withArgument:andReactToAIMessage:
 
(id) - init [implementation]
 
(id) - initBypassForPlayer [implementation]
 
(NSString *) - repeatString:times: [implementation]
 
(BOOL) - setUpOneSubentity: [implementation]
 
(BOOL) - setUpOneFlasher: [implementation]
 
(NSString *) - shortDescriptionComponents [implementation]
 
(BoundingBox) - findBoundingBoxRelativeToPosition:InVectors:_i:_j: [implementation]
 
(void) - wasAddedToUniverse [implementation]
 
(void) - wasRemovedFromUniverse [implementation]
 
(NSString *) - beaconCode [implementation]
 
(void) - setBeaconCode: [implementation]
 
(NSString *) - beaconLabel [implementation]
 
(void) - setBeaconLabel: [implementation]
 
(BOOL) - isVisible [implementation]
 
(BOOL) - isBeacon [implementation]
 
(id< OOHUDBeaconIcon >) - beaconDrawable [implementation]
 
(Entity< OOBeaconEntity > *) - prevBeacon [implementation]
 
(Entity< OOBeaconEntity > *) - nextBeacon [implementation]
 
(void) - setPrevBeacon: [implementation]
 
(void) - setNextBeacon: [implementation]
 
(void) - setUpMixedEscorts [implementation]
 
(void) - setUpOneEscort:inGroup:withRole:atPosition:andCount: [implementation]
 
(OOScanClass- scanClass [implementation]
 
(BOOL) - canCollide [implementation]
 
(ShipEntity *) - doOctreesCollide [implementation]
 
(BOOL) - checkCloseCollisionWith: [implementation]
 
(void) - addSubentityToCollisionRadius: [implementation]
 
(ShipEntity *) - launchPodWithCrew: [implementation]
 
(BOOL) - validForAddToUniverse [implementation]
 
(void) - noteFrustration: [implementation]
 
(OOEquipmentType *) - generateMissileEquipmentTypeFrom: [implementation]
 
(OOEquipmentType *) - verifiedMissileTypeFromRole: [implementation]
 
(void) - drawImmediate:translucent: [implementation]
 
(void) - drawDebugStuff [implementation]
 
(void) - drawSubEntityImmediate:translucent: [implementation]
 
(BOOL) - isJammingScanning [implementation]
 
(void) - addSubEntity: [implementation]
 
(void) - setOwner: [implementation]
 
(void) - orientationChanged [implementation]
 
(void) - applyRoll:andClimb: [implementation]
 
(void) - applyRoll:climb:andYaw: [implementation]
 
(OOShipGroup *) - rawEscortGroup [implementation]
 
(NSComparisonResult) - ComparePlanetsBySurfaceDistance [implementation]
 
(Entity< OOStellarBody > *) - lastAegisLock [implementation]
 
(void) - setStatus: [implementation]
 
(void) - rescaleBy: [implementation]
 
(void) - rescaleBy:writeToCache: [implementation]
 
(void) - releaseCargoPodsDebris [implementation]
 
(void) - subEntityDied: [implementation]
 
(void) - subEntityReallyDied: [implementation]
 
(NSComparisonResult) - compareBeaconCodeWith: [implementation]
 
(uint32_t) - randomSeedForShaders [implementation]
 
(void) - setShipHitByLaser: [implementation]
 
(BOOL) - fireWeapon:direction:range: [implementation]
 
(void) - throwSparks [implementation]
 
(Vector) - velocity [implementation]
 
(void) - suppressTargetLost [implementation]
 
(void) - refreshEscortPositions [implementation]
 
(HPVector) - coordinatesForEscortPosition: [implementation]
 
(void) - setTargetToNearestStationIncludingHostiles: [implementation]
 
(BoundingBox) - findBoundingBoxRelativeTo:InVectors:_i:_j: [implementation]
 
(OOTimeAbsolute- getDemoStartTime [implementation]
 
(void) - doNothing [implementation]
 
(NSString *) - descriptionForObjDump [implementation]
 
(void) - setAITo:
 
(void) - setAIScript:
 
(void) - switchAITo:
 
(void) - scanForHostiles
 
(BOOL) - performHyperSpaceToSpecificSystem:
 
(void) - scanForNearestIncomingMissile
 
(void) - enterTargetWormhole
 
(void) - enterPlayerWormhole
 
(void) - wormholeEscorts
 
(void) - wormholeEntireGroup
 
(BOOL) - suggestEscortTo:
 
(void) - groupAttackTarget
 
(void) - performAttack
 
(void) - performCollect
 
(void) - performEscort
 
(void) - performFaceDestination
 
(void) - performFlee
 
(void) - performFlyToRangeFromDestination
 
(void) - performHold
 
(void) - performIdle
 
(void) - performIntercept
 
(void) - performLandOnPlanet
 
(void) - performMining
 
(void) - performScriptedAI
 
(void) - performScriptedAttackAI
 
(void) - performStop
 
(void) - performTumble
 
(void) - broadcastDistressMessage
 
(void) - broadcastDistressMessageWithDumping:
 
(void) - requestDockingCoordinates
 
(void) - recallDockingInstructions
 
(void) - performBuoyTumble [implementation]
 
(NSDictionary *) - savedShipDictionaryWithContext:
 
(void) - simplifyShipdata:andGetDeletes: [implementation]
 
(void) - checkFoundTarget [implementation]
 
(BOOL) - performHyperSpaceExitReplace: [implementation]
 
(BOOL) - performHyperSpaceExitReplace:toSystem: [implementation]
 
(void) - scanForNearestShipWithPredicate:parameter: [implementation]
 
(void) - scanForNearestShipWithNegatedPredicate:parameter: [implementation]
 
(BOOL) - inspHasSecondaryIdentityLine [implementation]
 
(NSString *) - inspSecondaryIdentityLine [implementation]
 
(NSString *) - inspDescription [implementation]
 
(NSString *) - inspTargetLine [implementation]
 
(BOOL) - inspCanBecomeTarget [implementation]
 
(void) - inspBecomeTarget [implementation]
 
(NSArray *) - subEntitiesForScript
 
(void) - setTargetForScript:
 
(BOOL) - isVisibleToScripts [implementation]
 
(NSArray *) - debugInspectorModules [implementation]
 
(void) - setStateTo: [implementation]
 
(void) - pauseAI: [implementation]
 
(void) - randomPauseAI: [implementation]
 
(void) - dropMessages: [implementation]
 
(void) - debugDumpPendingMessages [implementation]
 
(void) - setDestinationToCurrentLocation [implementation]
 
(void) - setDesiredRangeTo: [implementation]
 
(void) - setDesiredRangeForWaypoint [implementation]
 
(void) - setSpeedTo: [implementation]
 
(void) - setSpeedFactorTo: [implementation]
 
(void) - setSpeedToCruiseSpeed [implementation]
 
(void) - setThrustFactorTo: [implementation]
 
(void) - setTargetToPrimaryAggressor [implementation]
 
(void) - scanForNearestMerchantman [implementation]
 
(void) - scanForRandomMerchantman [implementation]
 
(void) - scanForLoot [implementation]
 
(void) - scanForRandomLoot [implementation]
 
(void) - setTargetToFoundTarget [implementation]
 
(void) - checkForFullHold [implementation]
 
(void) - getWitchspaceEntryCoordinates [implementation]
 
(void) - setDestinationFromCoordinates [implementation]
 
(void) - setCoordinatesFromPosition [implementation]
 
(void) - fightOrFleeMissile [implementation]
 
(void) - setCourseToPlanet [implementation]
 
(void) - setTakeOffFromPlanet [implementation]
 
(void) - landOnPlanet [implementation]
 
(void) - checkTargetLegalStatus [implementation]
 
(void) - checkOwnLegalStatus [implementation]
 
(void) - exitAIWithMessage: [implementation]
 
(void) - setDestinationToTarget [implementation]
 
(void) - setDestinationWithinTarget [implementation]
 
(void) - checkCourseToDestination [implementation]
 
(void) - checkAegis [implementation]
 
(void) - checkEnergy [implementation]
 
(void) - checkHeatInsulation [implementation]
 
(void) - scanForOffenders [implementation]
 
(void) - setCourseToWitchpoint [implementation]
 
(void) - setDestinationToWitchpoint [implementation]
 
(void) - setDestinationToStationBeacon [implementation]
 
(void) - performHyperSpaceExit [implementation]
 
(void) - performHyperSpaceExitWithoutReplacing [implementation]
 
(void) - wormholeGroup [implementation]
 
(void) - commsMessage: [implementation]
 
(void) - commsMessageByUnpiloted: [implementation]
 
(void) - ejectCargo [implementation]
 
(void) - scanForThargoid [implementation]
 
(void) - scanForNonThargoid [implementation]
 
(void) - thargonCheckMother [implementation]
 
(void) - becomeUncontrolledThargon [implementation]
 
(void) - checkDistanceTravelled [implementation]
 
(void) - fightOrFleeHostiles [implementation]
 
(void) - suggestEscort [implementation]
 
(void) - escortCheckMother [implementation]
 
(void) - checkGroupOddsVersusTarget [implementation]
 
(void) - scanForFormationLeader [implementation]
 
(void) - messageMother: [implementation]
 
(void) - setPlanetPatrolCoordinates [implementation]
 
(void) - setSunSkimStartCoordinates [implementation]
 
(void) - setSunSkimEndCoordinates [implementation]
 
(void) - setSunSkimExitCoordinates [implementation]
 
(void) - patrolReportIn [implementation]
 
(void) - checkForMotherStation [implementation]
 
(void) - sendTargetCommsMessage: [implementation]
 
(void) - markTargetForFines [implementation]
 
(void) - markTargetForOffence: [implementation]
 
(void) - storeTarget [implementation]
 
(void) - recallStoredTarget [implementation]
 
(void) - scanForRocks [implementation]
 
(void) - setDestinationToDockingAbort [implementation]
 
(void) - requestNewTarget [implementation]
 
(void) - rollD: [implementation]
 
(void) - scanForNearestShipWithPrimaryRole: [implementation]
 
(void) - scanForNearestShipHavingRole: [implementation]
 
(void) - scanForNearestShipWithAnyPrimaryRole: [implementation]
 
(void) - scanForNearestShipHavingAnyRole: [implementation]
 
(void) - scanForNearestShipWithScanClass: [implementation]
 
(void) - scanForNearestShipWithoutPrimaryRole: [implementation]
 
(void) - scanForNearestShipNotHavingRole: [implementation]
 
(void) - scanForNearestShipWithoutAnyPrimaryRole: [implementation]
 
(void) - scanForNearestShipNotHavingAnyRole: [implementation]
 
(void) - scanForNearestShipWithoutScanClass: [implementation]
 
(void) - setCoordinates: [implementation]
 
(void) - checkForNormalSpace [implementation]
 
(void) - setTargetToRandomStation [implementation]
 
(void) - setTargetToLastStation [implementation]
 
(void) - addFuel: [implementation]
 
(void) - scriptActionOnTarget: [implementation]
 
(void) - sendScriptMessage: [implementation]
 
(void) - ai_throwSparks [implementation]
 
(void) - explodeSelf [implementation]
 
(void) - ai_debugMessage: [implementation]
 
(void) - targetFirstBeaconWithCode: [implementation]
 
(void) - targetNextBeaconWithCode: [implementation]
 
(void) - setRacepointsFromTarget [implementation]
 
(void) - performFlyRacepoints [implementation]
 
(void) - addPrimaryAggressorAsDefenseTarget [implementation]
 
(void) - addFoundTargetAsDefenseTarget [implementation]
 
(void) - findNewDefenseTarget [implementation]
 
(void) - setDestinationToJinkPosition [implementation]
 
(void) - disengageAutopilot [implementation]
 
(void) - messageSelf: [implementation]
 
(void) - scanForNearestShipMatchingPredicate: [implementation]
 
(void) - safeScriptActionOnTarget: [implementation]
 
(ShipEntity *) - ejectShipOfType:
 
(ShipEntity *) - ejectShipOfRole:
 
(NSArray *) - spawnShipsWithRole:count:
 
(BOOL) - isShipWithSubEntityShip: [implementation]
 
- Instance Methods inherited from OOEntityWithDrawable
(OODrawable *) - drawable
 
(void) - setDrawable:
 
(double) - findCollisionRadius [implementation]
 
(NSSet *) - allTextures [implementation]
 
- Instance Methods inherited from Entity
(NSUInteger) - sessionID
 
(BOOL) - isShip
 
(BOOL) - isDock
 
(BOOL) - isStation
 
(BOOL) - isSubEntity
 
(BOOL) - isPlayer
 
(BOOL) - isPlanet
 
(BOOL) - isSun
 
(BOOL) - isSunlit
 
(BOOL) - isStellarObject
 
(BOOL) - isSky
 
(BOOL) - isWormhole
 
(BOOL) - isEffect
 
(BOOL) - isVisualEffect
 
(BOOL) - isWaypoint
 
(void) - addToLinkedLists
 
(void) - removeFromLinkedLists
 
(void) - updateLinkedLists
 
(void) - warnAboutHostiles
 
(CollisionRegion *) - collisionRegion
 
(void) - setCollisionRegion:
 
(void) - setUniversalID:
 
(OOUniversalID- universalID
 
(BOOL) - throwingSparks
 
(void) - setThrowSparks:
 
(id) - owner
 
(ShipEntity *) - parentEntity
 
(ShipEntity *) - rootShipEntity
 
(void) - setPosition:
 
(void) - setPositionX:y:z:
 
(HPVector) - position
 
(Vector) - cameraRelativePosition
 
(GLfloat) - cameraRangeFront
 
(GLfloat) - cameraRangeBack
 
(void) - updateCameraRelativePosition
 
(Vector) - vectorTo:
 
(HPVector) - absolutePositionForSubentity
 
(HPVector) - absolutePositionForSubentityOffset:
 
(double) - zeroDistance
 
(double) - camZeroDistance
 
(NSComparisonResult) - compareZeroDistance:
 
(BoundingBox) - boundingBox
 
(GLfloat) - mass
 
(Quaternion) - orientation
 
(void) - setOrientation:
 
(Quaternion) - normalOrientation
 
(void) - setNormalOrientation:
 
(void) - setVelocity:
 
(double) - speed
 
(GLfloat) - distanceTravelled
 
(void) - setDistanceTravelled:
 
(OOEntityStatus- status
 
(void) - setScanClass:
 
(void) - setEnergy:
 
(GLfloat) - energy
 
(void) - setMaxEnergy:
 
(GLfloat) - maxEnergy
 
(void) - moveForward:
 
(OOMatrix) - rotationMatrix
 
(OOMatrix) - drawRotationMatrix
 
(OOMatrix) - transformationMatrix
 
(OOMatrix) - drawTransformationMatrix
 
(GLfloat) - collisionRadius
 
(void) - setCollisionRadius:
 
(NSMutableArray *) - collisionArray
 
(void) - applyVelocity:
 
(void) - dumpState
 
(BOOL) - isInSpace
 
(BOOL) - isImmuneToBreakPatternHide
 
(GLfloat) - universalTime
 
(GLfloat) - spawnTime
 
(GLfloat) - timeElapsedSinceSpawn
 
(void) - setAtmosphereFogging:
 
(OOColor *) - fogUniform
 
(NSString *) - descriptionForObjDumpBasic
 
(BOOL) - checkLinkedLists [implementation]
 
(id< OOWeakReferenceSupport >) - superShaderBindingTarget [implementation]
 
(Vector) - relativePosition [implementation]
 
(BOOL) - isBreakPattern
 
(void) - inspect [implementation]
 
(BOOL) - isECMBlast
 
(NSString *) - inspScanClassLine
 
(NSString *) - inspStatusLine
 
(NSString *) - inspRetainCountLine
 
(NSString *) - inspPositionLine
 
(NSString *) - inspVelocityLine
 
(NSString *) - inspOrientationLine
 
(NSString *) - inspEnergyLine
 
(NSString *) - inspOwnerLine
 
(NSString *) - inspBasicIdentityLine [implementation]
 
(BOOL) - isExhaust
 
(BOOL) - isFlasher
 
(void) - deleteJSSelf
 
(jsval) - oo_jsValueInContext: [implementation]
 
(BOOL) - isCascadeWeapon
 
(BOOL) - isPlayerLikeShip
 
(GLfloat) - clock [implementation]
 
(unsigned) - pseudoFixedD100 [implementation]
 
(unsigned) - pseudoFixedD256 [implementation]
 
(unsigned) - systemGovernment [implementation]
 
(unsigned) - systemEconomy [implementation]
 
(unsigned) - systemTechLevel [implementation]
 
(unsigned) - systemPopulation [implementation]
 
(unsigned) - systemProductivity [implementation]
 
- Instance Methods inherited from OOWeakRefObject
(id) - weakSelf
 
(id) - weakRetain [implementation]
 
(void) - weakRefDied: [implementation]
 
- Instance Methods inherited from <OOWeakReferenceSupport>
(id) - OO_RETURNS_RETAINED
 
- Instance Methods inherited from <OOSubEntity>
- Instance Methods inherited from <OOBeaconEntity>

Private Attributes

OOWeakSet_shipsOnHold
 
DockEntityplayer_reserved_dock
 
double last_launch_time
 
double approach_spacing
 
OOStationAlertLevel alertLevel
 
unsigned max_police
 
unsigned max_defense_ships
 
unsigned defenders_launched
 
unsigned max_scavengers
 
unsigned scavengers_launched
 
OOTechLevelID equivalentTechLevel
 
float equipmentPriceFactor
 
Vector port_dimensions
 
double port_radius
 
unsigned no_docking_while_launching: 1
 
unsigned hasNPCTraffic: 1
 
BOOL hasPatrolShips
 
OOUniversalID planet
 
NSString * allegiance
 
OOCommodityMarketlocalMarket
 
OOCargoQuantity marketCapacity
 
NSArray * marketDefinition
 
NSString * marketScriptName
 
NSMutableArray * localShipyard
 
NSMutableDictionary * localInterfaces
 
unsigned docked_shuttles
 
double last_shuttle_launch_time
 
double shuttle_launch_interval
 
unsigned docked_traders
 
double last_trader_launch_time
 
double trader_launch_interval
 
double last_patrol_report_time
 
double patrol_launch_interval
 
unsigned suppress_arrival_reports: 1
 
unsigned requiresDockingClearance: 1
 
unsigned interstellarUndockingAllowed: 1
 
unsigned allowsFastDocking: 1
 
unsigned allowsSaving: 1
 
unsigned allowsAutoDocking: 1
 
unsigned hasBreakPattern: 1
 
unsigned marketMonitored: 1
 
unsigned marketBroadcast: 1
 

Additional Inherited Members

- Class Methods inherited from ShipEntity
(static BOOL) + IsBehaviourHostile [implementation]
 
(static float) + SurfaceDistanceSqaredV [implementation]
 
(static float) + SurfaceDistanceSqared [implementation]
 
(static BOOL) + AuthorityPredicate [implementation]
 
(id) + shipRestoredFromDictionary:useFallback:context:
 
- Public Attributes inherited from ShipEntity
OOTimeDelta shot_time
 
Vector v_forward
 
Vector v_up
 
Vector v_right
 
HPVector _destination
 
GLfloat desired_range
 
GLfloat desired_speed
 
GLfloat stick_roll
 
GLfloat stick_pitch
 
GLfloat stick_yaw
 
OOBehaviour behaviour
 
BoundingBox totalBoundingBox
 
- Public Attributes inherited from Entity
OOUniversalID universalID
 
unsigned isShip: 1
 
unsigned isStation: 1
 
unsigned isPlayer: 1
 
unsigned isWormhole: 1
 
unsigned isSubEntity: 1
 
unsigned hasMoved: 1
 
unsigned hasRotated: 1
 
unsigned hasCollided: 1
 
unsigned isSunlit: 1
 
unsigned collisionTestFilter: 2
 
unsigned throw_sparks: 1
 
unsigned isImmuneToBreakPatternHide: 1
 
unsigned isExplicitlyNotMainStation: 1
 
unsigned isVisualEffect: 1
 
OOScanClass scanClass
 
GLfloat zero_distance
 
GLfloat cam_zero_distance
 
GLfloat no_draw_distance
 
GLfloat collision_radius
 
HPVector position
 
Vector cameraRelativePosition
 
Quaternion orientation
 
OOColoratmosphereFogging
 
int zero_index
 
Entityx_previous
 
Entityx_next
 
Entityy_previous
 
Entityy_next
 
Entityz_previous
 
Entityz_next
 
Entitycollision_chain
 
OOUniversalID shadingEntityID
 
Entitycollider
 
CollisionRegioncollisionRegion
 
- Protected Attributes inherited from ShipEntity
NSDictionary * shipinfoDictionary
 
Quaternion subentityRotationalVelocity
 
OOJSScriptscript
 
OOJSScriptaiScript
 
OOTimeAbsolute aiScriptWakeTime
 
NSDictionary * dockingInstructions
 
OOColorlaser_color
 
OOColordefault_laser_color
 
OOColorexhaust_emissive_color
 
OOColorscanner_display_color1
 
OOColorscanner_display_color2
 
OOColorscanner_display_color_hostile1
 
OOColorscanner_display_color_hostile2
 
GLfloat maxFlightSpeed
 
GLfloat max_flight_roll
 
GLfloat max_flight_pitch
 
GLfloat max_flight_yaw
 
GLfloat cruiseSpeed
 
GLfloat max_thrust
 
GLfloat thrust
 
float hyperspaceMotorSpinTime
 
unsigned military_jammer_active: 1
 
unsigned docking_match_rotation: 1
 
unsigned pitching_over: 1
 
unsigned rolling_over: 1
 
unsigned reportAIMessages: 1
 
unsigned being_mined: 1
 
unsigned being_fined: 1
 
unsigned isHulk: 1
 
unsigned trackCloseContacts: 1
 
unsigned isNearPlanetSurface: 1
 
unsigned isFrangible: 1
 
unsigned cloaking_device_active: 1
 
unsigned cloakPassive: 1
 
unsigned cloakAutomatic: 1
 
unsigned canFragment: 1
 
unsigned isWreckage: 1
 
unsigned _showDamage: 1
 
unsigned suppressExplosion: 1
 
unsigned suppressAegisMessages: 1
 
unsigned isMissile: 1
 
unsigned _explicitlyUnpiloted: 1
 
unsigned hasScoopMessage: 1
 
unsigned scripted_misjump: 1
 
unsigned haveExecutedSpawnAction: 1
 
unsigned haveStartedJSAI: 1
 
unsigned noRocks: 1
 
unsigned _lightsActive: 1
 
GLfloat _scriptedMisjumpRange
 
GLfloat sunGlareFilter
 
OOFuelQuantity fuel
 
GLfloat fuel_accumulator
 
GLfloat afterburner_rate
 
GLfloat afterburner_speed_factor
 
OOCargoQuantity likely_cargo
 
OOCargoQuantity max_cargo
 
OOCargoQuantity extra_cargo
 
OOCargoQuantity equipment_weight
 
OOCargoType cargo_type
 
OOCargoFlag cargo_flag
 
OOCreditsQuantity bounty
 
GLfloat energy_recharge_rate
 
OOWeaponFacingSet weapon_facings
 
OOWeaponType forward_weapon_type
 
OOWeaponType aft_weapon_type
 
OOWeaponType port_weapon_type
 
OOWeaponType starboard_weapon_type
 
GLfloat weapon_damage
 
GLfloat weapon_damage_override
 
GLfloat weaponRange
 
OOWeaponFacing currentWeaponFacing
 
GLfloat weapon_energy_use
 
GLfloat weapon_temp
 
GLfloat weapon_shot_temperature
 
GLfloat forward_weapon_temp
 
GLfloat aft_weapon_temp
 
GLfloat port_weapon_temp
 
GLfloat starboard_weapon_temp
 
GLfloat scannerRange
 
unsigned missiles
 
unsigned max_missiles
 
NSString * _missileRole
 
OOTimeDelta missile_load_time
 
OOTimeAbsolute missile_launch_time
 
AIshipAI
 
NSString * name
 
NSString * shipUniqueName
 
NSString * shipClassName
 
NSString * displayName
 
NSString * scan_description
 
OORoleSetroleSet
 
NSString * primaryRole
 
NSArray * explosionType
 
Vector jink
 
HPVector coordinates
 
Vector reference
 
NSUInteger _subIdx
 
NSUInteger _maxShipSubIdx
 
double launch_time
 
double launch_delay
 
OOUniversalID planetForLanding
 
GLfloat frustration
 
GLfloat success_factor
 
int patrol_counter
 
NSMutableDictionary * previousCondition
 
float weapon_recharge_rate
 
int shot_counter
 
OOTimeAbsolute cargo_dump_time
 
OOTimeAbsolute last_shot_time
 
NSMutableArray * cargo
 
OOCommodityType commodity_type
 
OOCargoQuantity commodity_amount
 
GLfloat flightSpeed
 
GLfloat flightRoll
 
GLfloat flightPitch
 
GLfloat flightYaw
 
GLfloat accuracy
 
GLfloat pitch_tolerance
 
GLfloat aim_tolerance
 
int _missed_shots
 
OOAegisStatus aegis_status
 
OOSystemID home_system
 
OOSystemID destination_system
 
double messageTime
 
double next_spark_time
 
Vector collision_vector
 
GLfloat _scaleFactor
 
BOOL _multiplyWeapons
 
NSArray * forwardWeaponOffset
 
NSArray * aftWeaponOffset
 
NSArray * portWeaponOffset
 
NSArray * starboardWeaponOffset
 
NSArray * crew
 
NSMutableDictionary * closeContactsInfo
 
NSString * lastRadioMessage
 
Vector tractor_position
 
float ship_temperature
 
ShipEntityscanned_ships [MAX_SCAN_NUMBER+1]
 
GLfloat distance2_scanned_ships [MAX_SCAN_NUMBER+1]
 
unsigned n_scanned_ships
 
HPVector navpoints [32]
 
unsigned next_navpoint_index
 
unsigned number_of_navpoints
 
Octreeoctree
 
OOBehaviour debugLastBehaviour
 
uint16_t entity_personality
 
NSDictionary * scriptInfo
 
NSMutableArray * subEntities
 
OOEquipmentTypemissile_list [SHIPENTITY_MAX_MISSILES]
 
OOWeakReference_primaryTarget
 
OOWeakReference_primaryAggressor
 
OOWeakReference_targetStation
 
OOWeakReference_foundTarget
 
OOWeakReference_lastEscortTarget
 
OOWeakReference_thankedShip
 
OOWeakReference_rememberedShip
 
OOWeakReference_proximityAlert
 
float reactionTime
 
HPVector trackingCurvePositions [4]
 
OOTimeAbsolute trackingCurveTimes [4]
 
HPVector trackingCurveCoeffs [3]
 
- Protected Attributes inherited from Entity
HPVector lastPosition
 
Quaternion lastOrientation
 
GLfloat distanceTravelled
 
OOMatrix rotMatrix
 
Vector velocity
 
GLfloat energy
 
GLfloat maxEnergy
 
BoundingBox boundingBox
 
GLfloat mass
 
NSMutableArray * collidingEntities
 
OOTimeAbsolute spawnTime
 
struct JSObject * _jsSelf
 
- Protected Attributes inherited from OOWeakRefObject
OOWeakReferenceweakSelf
 

Detailed Description

Definition at line 52 of file StationEntity.h.

Method Documentation

◆ abortAllDockings

- (void) abortAllDockings

Definition at line 1 of file StationEntity.m.

368{
369 NSEnumerator *subEnum = nil;
370 DockEntity *sub = nil;
371 for (subEnum = [self dockSubEntityEnumerator]; (sub = [subEnum nextObject]); )
372 {
373 [sub abortAllDockings];
374 }
375
376 [_shipsOnHold makeObjectsPerformSelector:@selector(sendAIMessage:) withObject:@"DOCKING_ABORTED"];
377 NSEnumerator *holdEnum = nil;
378 ShipEntity *hold = nil;
379 for (holdEnum = [_shipsOnHold objectEnumerator]; (hold = [holdEnum nextObject]); )
380 {
381 [hold doScriptEvent:OOJSID("stationWithdrewDockingClearance")];
382 }
383
384 PlayerEntity *player = PLAYER;
385
386 if ([player getTargetDockStation] == self && [player getDockingClearanceStatus] >= DOCKING_CLEARANCE_STATUS_REQUESTED)
387 {
388 // then docking clearance is requested but hasn't been cancelled
389 // yet by a DockEntity
390 [self sendExpandedMessage:@"[station-docking-clearance-abort-cancelled]" toShip:player];
391 [player setDockingClearanceStatus:DOCKING_CLEARANCE_STATUS_NONE];
392 [player doScriptEvent:OOJSID("stationWithdrewDockingClearance")];
393 }
394
395 [_shipsOnHold removeAllObjects];
396
397 [shipAI message:@"DOCKING_COMPLETE"];
398 [self doScriptEvent:OOJSID("stationDockingQueuesAreEmpty")];
399
400}
return nil
@ DOCKING_CLEARANCE_STATUS_REQUESTED
Definition OOTypes.h:170
#define PLAYER
void abortAllDockings()
Definition DockEntity.m:96
void setDockingClearanceStatus:(OODockingClearanceStatus newValue)
void doScriptEvent:(jsid message)
OOWeakSet * _shipsOnHold
NSEnumerator * dockSubEntityEnumerator()

Referenced by StationAbortAllDockings(), and StationLaunchShipWithRole().

+ Here is the caller graph for this function:

◆ abortDockingForShip:

- (void) abortDockingForShip: (ShipEntity *) ship

Definition at line 448 of file StationEntity.m.

603 :(ShipEntity *) ship
604{
605 [ship sendAIMessage:@"DOCKING_ABORTED"];
606 [ship doScriptEvent:OOJSID("stationWithdrewDockingClearance")];
607
608 [_shipsOnHold removeObject:ship];
609
610 NSEnumerator *subEnum = nil;
611 DockEntity *sub = nil;
612 for (subEnum = [self dockSubEntityEnumerator]; (sub = [subEnum nextObject]); )
613 {
614 [sub abortDockingForShip:ship];
615 }
616
617 if ([ship isPlayer])
618 {
620 }
621
622 [self sanityCheckShipsOnApproach];
623}
void abortDockingForShip:(ShipEntity *ship)
Definition DockEntity.m:589
unsigned isPlayer
Definition Entity.h:93
void sendAIMessage:(NSString *message)
DockEntity * player_reserved_dock

References OOWeakRefObject::weakRetain.

Referenced by StationAbortDockingForShip().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ acceptDistressMessageFrom:

- (void) acceptDistressMessageFrom: (ShipEntity *) other
implementation

Reimplemented from ShipEntity.

Provided by category StationEntity(OOAIPrivate).

Definition at line 1 of file ShipEntityAI.m.

2908 :(ShipEntity *)other
2909{
2910 if (self != [UNIVERSE station]) return;
2911
2912 OOWeakReference *old_target = _primaryTarget;
2913 _primaryTarget = [[[other primaryTarget] weakRetain] autorelease];
2914 [(ShipEntity *)[other primaryTarget] markAsOffender:8 withReason:kOOLegalStatusReasonDistressCall]; // mark their card
2915 [self launchDefenseShip];
2916 _primaryTarget = old_target;
2917
2918}
#define UNIVERSE
Definition Universe.h:833

◆ acceptDockingClearanceRequestFrom:

- (NSString *) acceptDockingClearanceRequestFrom: (ShipEntity *) other

Definition at line 448 of file StationEntity.m.

2044 :(ShipEntity *)other
2045{
2046 NSString *result = nil;
2047 double timeNow = [UNIVERSE getTime];
2048 PlayerEntity *player = PLAYER;
2049
2050 [self doScriptEvent:OOJSID("stationReceivedDockingRequest") withArgument:other];
2051
2052
2053 [UNIVERSE clearPreviousMessage];
2054
2055 [self sanityCheckShipsOnApproach];
2056
2057 // Docking clearance not required - clear it just in case it's been
2058 // set for another nearby station.
2059 if (![self requiresDockingClearance])
2060 {
2061 // TODO: We're potentially cancelling docking at another station, so
2062 // ensure we clear the timer to allow NPC traffic. If we
2063 // don't, normal traffic will resume once the timer runs out.
2064 // No clearance is needed, but don't send friendly messages to hostile ships!
2065 if (!(([other isPlayer] && [other hasHostileTarget]) || (self == [UNIVERSE station] && [other bounty] > 50)))
2066 {
2067 [self sendExpandedMessage:@"[station-docking-clearance-not-required]" toShip:other];
2068 }
2069 if ([other isPlayer])
2070 {
2071 [player setDockingClearanceStatus:DOCKING_CLEARANCE_STATUS_NOT_REQUIRED];
2072 }
2073 [shipAI reactToMessage:@"DOCKING_REQUESTED" context:nil]; // react to the request
2074 [self doScriptEvent:OOJSID("stationAcceptedDockingRequest") withArgument:other];
2075
2077 result = @"DOCKING_CLEARANCE_NOT_REQUIRED";
2078 }
2079
2080 // Docking clearance already granted for this station - check for
2081 // time-out or cancellation (but only for the Player).
2082 if( result == nil && [other isPlayer] && self == [player getTargetDockStation])
2083 {
2084 switch( [player getDockingClearanceStatus] )
2085 {
2088 {
2090 [self sendExpandedMessage:[NSString stringWithFormat:
2091 DESC(@"station-docking-clearance-extended-until-@"),
2092 ClockToString([player clockTime] + DOCKING_CLEARANCE_WINDOW, NO)]
2093 toShip:other];
2094 [player setDockingClearanceStatus:DOCKING_CLEARANCE_STATUS_GRANTED];
2095 result = @"DOCKING_CLEARANCE_EXTENDED";
2096 break;
2097 }
2098 // else, continue with canceling.
2101 last_launch_time = timeNow;
2102 [self sendExpandedMessage:@"[station-docking-clearance-cancelled]" toShip:other];
2103 [player setDockingClearanceStatus:DOCKING_CLEARANCE_STATUS_NONE];
2104 result = @"DOCKING_CLEARANCE_CANCELLED";
2106 if ([self currentlyInDockingQueues] == 0)
2107 {
2108 [shipAI message:@"DOCKING_COMPLETE"];
2109 [self doScriptEvent:OOJSID("stationDockingQueuesAreEmpty")];
2110 }
2111 break;
2114 break;
2115 }
2116 }
2117
2118 // First we must set the status to REQUESTED to avoid problems when
2119 // switching docking targets - even if we later set it back to NONE.
2120 if (result == nil && [other isPlayer] && self != [player getTargetDockStation])
2121 {
2122 player_reserved_dock = nil; // and clear any previously reserved dock
2123 [player setDockingClearanceStatus:DOCKING_CLEARANCE_STATUS_REQUESTED];
2124 }
2125
2126 // Deny docking for fugitives at the main station
2127 // TODO: Should this be another key in shipdata.plist and/or should this
2128 // apply to all stations?
2129 if (result == nil && self == [UNIVERSE station] && [other bounty] > 50) // do not grant docking clearance to fugitives
2130 {
2131 [self sendExpandedMessage:@"[station-docking-clearance-H-clearance-refused]" toShip:other];
2132 if ([other isPlayer])
2133 [player setDockingClearanceStatus:DOCKING_CLEARANCE_STATUS_NONE];
2134 result = @"DOCKING_CLEARANCE_DENIED_SHIP_FUGITIVE";
2135 }
2136
2137 if (result == nil && [other hasHostileTarget]) // do not grant docking clearance to hostile ships.
2138 {
2139 [self sendExpandedMessage:@"[station-docking-clearance-denied]" toShip:other];
2140 if ([other isPlayer])
2141 [player setDockingClearanceStatus:DOCKING_CLEARANCE_STATUS_NONE];
2142 result = @"DOCKING_CLEARANCE_DENIED_SHIP_HOSTILE";
2143 }
2144
2145 if (![self hasEligibleDock]) // make sure at least one dock could plausibly accept the player
2146 {
2147 if ([other isPlayer])
2148 {
2149 [player setDockingClearanceStatus:DOCKING_CLEARANCE_STATUS_NONE];
2150 }
2151 [self sendExpandedMessage:@"[station-docking-clearance-denied-no-docks]" toShip:other];
2152
2153 result = @"DOCKING_CLEARANCE_DENIED_NO_DOCKS";
2154 }
2155 else if (![self hasClearDock]) // skip check if at least one dock clear
2156 {
2157 // Put ship in queue if we've got incoming or outgoing traffic or
2158 // if the player is waiting for manual clearance and we are not
2159 // the player
2160 if (result == nil && (([self currentlyInDockingQueues] && last_launch_time < timeNow) || (![other isPlayer] && [player getDockingClearanceStatus] == DOCKING_CLEARANCE_STATUS_REQUESTED)))
2161 {
2162 [self sendExpandedMessage:[NSString stringWithFormat:
2163 DESC(@"station-docking-clearance-acknowledged-d-ships-approaching"),
2164 [self currentlyInDockingQueues]+1] toShip:other];
2165 // No need to set status to REQUESTED as we've already done that earlier.
2166 result = @"DOCKING_CLEARANCE_DENIED_TRAFFIC_INBOUND";
2167 }
2168
2169 if (result == nil && [self currentlyInLaunchingQueues])
2170 {
2171 [self sendExpandedMessage:[NSString stringWithFormat:
2172 DESC(@"station-docking-clearance-acknowledged-d-ships-departing"),
2173 [self currentlyInLaunchingQueues]+1] toShip:other];
2174 // No need to set status to REQUESTED as we've already done that earlier.
2175 result = @"DOCKING_CLEARANCE_DENIED_TRAFFIC_OUTBOUND";
2176 }
2177 if (result == nil)
2178 {
2179 // if this happens, the station has no docks which allow
2180 // docking, so deny clearance
2181 if ([other isPlayer])
2182 {
2183 [player setDockingClearanceStatus:DOCKING_CLEARANCE_STATUS_NONE];
2184 }
2185 result = @"DOCKING_CLEARANCE_DENIED_NO_DOCKS";
2186 // but can check to see if we'll open some for later.
2187 NSEnumerator *subEnum = nil;
2188 DockEntity* sub = nil;
2189 BOOL openLater = NO;
2190 for (subEnum = [self dockSubEntityEnumerator]; (sub = [subEnum nextObject]); )
2191 {
2192 NSString *docking = [sub canAcceptShipForDocking:other];
2193 if ([docking isEqualToString:@"DOCK_CLOSED"])
2194 {
2195 JSContext *context = OOJSAcquireContext();
2196 jsval rval = JSVAL_VOID;
2197 jsval args[] = { OOJSValueFromNativeObject(context, sub),
2198 OOJSValueFromNativeObject(context, other) };
2199 JSBool tempreject = NO;
2200
2201 BOOL OK = [[self script] callMethod:OOJSID("willOpenDockingPortFor") inContext:context withArguments:args count:2 result:&rval];
2202 if (OK) OK = JS_ValueToBoolean(context, rval, &tempreject);
2203 if (!OK) tempreject = NO; // default to permreject
2204 if (tempreject)
2205 {
2206 openLater = YES;
2207 }
2208 OOJSRelinquishContext(context);
2209 }
2210 if (openLater) break;
2211 }
2212
2213 if (openLater)
2214 {
2215 [self sendExpandedMessage:@"[station-docking-clearance-denied-no-docks-yet]" toShip:other];
2216 }
2217 else
2218 {
2219 [self sendExpandedMessage:@"[station-docking-clearance-denied-no-docks]" toShip:other];
2220 }
2221
2222 }
2223 }
2224
2225 // Ship has passed all checks - grant docking!
2226 if (result == nil)
2227 {
2229 if ([other isPlayer])
2230 {
2231 [player setDockingClearanceStatus:DOCKING_CLEARANCE_STATUS_GRANTED];
2232 player_reserved_dock = [self selectDockForDocking];
2233 }
2234
2235 if ([self hasMultipleDocks] && [other isPlayer])
2236 {
2237 [self sendExpandedMessage:[NSString stringWithFormat:
2238 DESC(@"station-docking-clearance-granted-in-@-until-@"),
2239 [player_reserved_dock displayName],
2240 ClockToString([player clockTime] + DOCKING_CLEARANCE_WINDOW, NO)]
2241 toShip:other];
2242 }
2243 else
2244 {
2245 [self sendExpandedMessage:[NSString stringWithFormat:
2246 DESC(@"station-docking-clearance-granted-until-@"),
2247 ClockToString([player clockTime] + DOCKING_CLEARANCE_WINDOW, NO)]
2248 toShip:other];
2249 }
2250
2251 result = @"DOCKING_CLEARANCE_GRANTED";
2252 [shipAI reactToMessage:@"DOCKING_REQUESTED" context:nil]; // react to the request
2253 [self doScriptEvent:OOJSID("stationAcceptedDockingRequest") withArgument:other];
2254 }
2255 return result;
2256}
OOINLINE jsval OOJSValueFromNativeObject(JSContext *context, id object)
OOINLINE JSContext * OOJSAcquireContext(void)
OOINLINE void OOJSRelinquishContext(JSContext *context)
@ DOCKING_CLEARANCE_STATUS_TIMING_OUT
Definition OOTypes.h:172
@ DOCKING_CLEARANCE_STATUS_NOT_REQUIRED
Definition OOTypes.h:169
@ DOCKING_CLEARANCE_STATUS_GRANTED
Definition OOTypes.h:171
@ DOCKING_CLEARANCE_STATUS_NONE
Definition OOTypes.h:168
#define DOCKING_CLEARANCE_WINDOW
NSString * canAcceptShipForDocking:(ShipEntity *ship)
Definition DockEntity.m:222
OOCreditsQuantity bounty
Definition ShipEntity.h:300
double last_launch_time
unsigned currentlyInDockingQueues()
unsigned no_docking_while_launching
unsigned currentlyInLaunchingQueues()
unsigned requiresDockingClearance

◆ acceptPatrolReportFrom:

- (void) acceptPatrolReportFrom: (ShipEntity *) patrol_ship

Definition at line 448 of file StationEntity.m.

2036 :(ShipEntity*) patrol_ship
2037{
2038 last_patrol_report_time = [UNIVERSE getTime];
2039}
double last_patrol_report_time

Referenced by ShipPatrolReportIn().

+ Here is the caller graph for this function:

◆ addShipToLaunchQueue:withPriority:

- (void) addShipToLaunchQueue: (ShipEntity *) ship
withPriority: (BOOL) priority 
implementation

Provided by category StationEntity(OOPrivate).

Definition at line 448 of file StationEntity.m.

1095 :(ShipEntity *)ship withPriority:(BOOL)priority
1096{
1097 NSEnumerator *subEnum = nil;
1098 DockEntity *sub = nil;
1099 unsigned threshold = 0;
1100
1101 // quickest launch if we assign ships to those bays with no incoming ships
1102 // and spread the ships evenly around those bays
1103 // much easier if the station has at least one launch-only dock
1104 while (threshold < 16)
1105 {
1106 for (subEnum = [self dockSubEntityEnumerator]; (sub = [subEnum nextObject]); )
1107 {
1108 if (sub != player_reserved_dock)
1109 {
1110 if ([sub countOfShipsInDockingQueue] == 0)
1111 {
1112 if ([sub allowsLaunching] && [sub countOfShipsInLaunchQueue] <= threshold)
1113 {
1114 if ([sub allowsLaunchingOf:ship])
1115 {
1116 [sub addShipToLaunchQueue:ship withPriority:priority];
1117 return;
1118 }
1119 }
1120 }
1121 }
1122 }
1123 threshold++;
1124 }
1125 // if we get this far, all docks have at least some incoming traffic.
1126 // usually most efficient (since launching is far faster than docking)
1127 // to assign all ships to the *same* dock with the smallest incoming queue
1128 // rather than to try spreading them out across several queues
1129 // also stops escorts being launched before their mothership
1130 threshold = 0;
1131 while (threshold < 16)
1132 {
1133 for (subEnum = [self dockSubEntityEnumerator]; (sub = [subEnum nextObject]); )
1134 {
1135 /* so this time as long as it allows launching only check
1136 * the docking queue size so long as enumerator order is
1137 * deterministic, this will assign every launch this
1138 * update to the same dock (edge case where new docking
1139 * ship appears in the middle, probably not a problem) */
1140 if ([sub allowsLaunching] && [sub countOfShipsInDockingQueue] <= threshold)
1141 {
1142 if ([sub allowsLaunchingOf:ship])
1143 {
1144 [sub addShipToLaunchQueue:ship withPriority:priority];
1145 return;
1146 }
1147 }
1148
1149 }
1150 threshold++;
1151 }
1152
1153 OOLog(@"station.launchShip.failed", @"Cancelled launch for a %@ with role %@, as the %@ has too many ships in its launch queue(s) or no suitable launch docks.",
1154 [ship displayName], [ship primaryRole], [self displayName]);
1155}
#define OOLog(class, format,...)
Definition OOLogging.h:88
void addShipToLaunchQueue:withPriority:(ShipEntity *ship,[withPriority] BOOL priority)
Definition DockEntity.m:865
NSString * primaryRole
Definition ShipEntity.h:333
NSString * displayName
Definition ShipEntity.h:330

◆ addShipToStationCount:

- (void) addShipToStationCount: (ShipEntity *) ship
implementation

Provided by category StationEntity(OOPrivate).

Definition at line 448 of file StationEntity.m.

1248 :(ShipEntity *) ship
1249{
1250 if ([ship isShuttle]) docked_shuttles++;
1251 else if ([ship isTrader] && ![ship isPlayer]) docked_traders++;
1252 else if (([ship isPolice] && ![ship isEscort]) || [ship hasPrimaryRole:@"defense_ship"])
1253 {
1255 }
1256 else if ([ship hasPrimaryRole:@"scavenger"] || [ship hasPrimaryRole:@"miner"]) // treat miners and scavengers alike!
1257 {
1259 }
1260}
BOOL isTrader()
BOOL isPolice()
BOOL isShuttle()
BOOL isEscort()
unsigned defenders_launched
unsigned scavengers_launched
unsigned docked_traders
unsigned docked_shuttles

◆ adjustVelocity:

- (void) adjustVelocity: (Vector) xVel
implementation

Reimplemented from ShipEntity.

Definition at line 448 of file StationEntity.m.

1346 :(Vector) xVel
1347{
1348 if (self != [UNIVERSE station]) [super adjustVelocity:xVel]; //dont get moved
1349}

◆ alertLevel

- (OOStationAlertLevel) alertLevel

◆ allegiance

- (NSString *) allegiance

◆ allowsAutoDocking

- (BOOL) allowsAutoDocking

◆ allowsFastDocking

- (BOOL) allowsFastDocking

◆ allowsSaving

- (BOOL) allowsSaving

◆ autoDockShipsOnApproach

- (void) autoDockShipsOnApproach

Definition at line 1 of file StationEntity.m.

417{
418 NSEnumerator *subEnum = nil;
419 DockEntity *sub = nil;
420 for (subEnum = [self dockSubEntityEnumerator]; (sub = [subEnum nextObject]); )
421 {
423 }
424
425 [self autoDockShipsOnHold];
426
427 [shipAI message:@"DOCKING_COMPLETE"];
428 [self doScriptEvent:OOJSID("stationDockingQueuesAreEmpty")];
429
430}
void autoDockShipsOnApproach()
Definition DockEntity.m:166

◆ autoDockShipsOnHold

- (void) autoDockShipsOnHold
implementation

Definition at line 1 of file StationEntity.m.

404{
405 NSEnumerator *onHoldEnum = [_shipsOnHold objectEnumerator];
406 ShipEntity *ship = nil;
407 while ((ship = [onHoldEnum nextObject]))
408 {
409 [self pullInShipIfPermitted:ship];
410 }
411
412 [_shipsOnHold removeAllObjects];
413}

◆ beaconPosition

- (HPVector) beaconPosition

Definition at line 1 of file StationEntity.m.

117{
118 double buoy_distance = 10000.0; // distance from station entrance
119 Vector v_f = vector_forward_from_quaternion([self orientation]);
120 HPVector result = HPvector_add([self position], vectorToHPVector(vector_multiply_scalar(v_f, buoy_distance)));
121
122 return result;
123}
Vector vector_forward_from_quaternion(Quaternion quat)
Quaternion orientation
Definition Entity.h:114
HPVector position
Definition Entity.h:112

◆ becomeEnergyBlast

- (void) becomeEnergyBlast
implementation

Reimplemented from ShipEntity.

Definition at line 448 of file StationEntity.m.

2023{
2024 if (self == [UNIVERSE station]) return;
2025 [super becomeEnergyBlast];
2026}

◆ becomeExplosion

- (void) becomeExplosion
implementation

Reimplemented from ShipEntity.

Definition at line 448 of file StationEntity.m.

1995{
1996 if (self == [UNIVERSE station]) return;
1997
1998 // launch docked ships if possible
1999 PlayerEntity* player = PLAYER;
2000 if ((player)&&([player status] == STATUS_DOCKED || [player status] == STATUS_DOCKING)&&([player dockedStation] == self))
2001 {
2002 // undock the player!
2003 [player leaveDock:self];
2004 [UNIVERSE setViewDirection:VIEW_FORWARD];
2005 [[UNIVERSE gameController] setMouseInteractionModeForFlight];
2006 [player warnAboutHostiles]; // sound a klaxon
2007 }
2008
2009 if (scanClass == CLASS_ROCK) // ie we're a rock hermit or similar
2010 {
2011 // set the role so that we break up into rocks!
2012 [self setPrimaryRole:@"asteroid"];
2013 being_mined = YES;
2014 }
2015
2016 // finally bite the bullet
2017 [super becomeExplosion];
2018}
OOEntityStatus status()
Definition Entity.m:793
void warnAboutHostiles()
void leaveDock:(StationEntity *station)
OOScanClass scanClass()
unsigned being_mined
Definition ShipEntity.h:257

◆ becomeLargeExplosion:

- (void) becomeLargeExplosion: (double) factor
implementation

Reimplemented from ShipEntity.

Definition at line 448 of file StationEntity.m.

2029 :(double) factor
2030{
2031 if (self == [UNIVERSE station]) return;
2032 [super becomeLargeExplosion:factor];
2033}

◆ clear

- (void) clear

Definition at line 448 of file StationEntity.m.

1000{
1001 NSEnumerator *subEnum = nil;
1002 DockEntity* sub = nil;
1003 for (subEnum = [self dockSubEntityEnumerator]; (sub = [subEnum nextObject]); )
1004 {
1005 [sub clear];
1006 }
1007
1008 [_shipsOnHold removeAllObjects];
1009}

◆ clearDockingCorridor

- (void) clearDockingCorridor

Definition at line 448 of file StationEntity.m.

856{
857 if (!UNIVERSE)
858 return;
859
860 NSEnumerator *subEnum = nil;
861 DockEntity* sub = nil;
862 for (subEnum = [self dockSubEntityEnumerator]; (sub = [subEnum nextObject]); )
863 {
865 }
866
867 return;
868}
void clearDockingCorridor()

◆ collideWithShip:

- (BOOL) collideWithShip: (ShipEntity *) other
implementation

Reimplemented from ShipEntity.

Definition at line 448 of file StationEntity.m.

1281 :(ShipEntity *)other
1282{
1283 /*
1284 There used to be a [self abortAllDockings] here. Removed as there
1285 doesn't appear to be a good reason for it and it interferes with
1286 docking clearance.
1287 -- Micha 2010-06-10
1288 Reformatted, Ahruman 2012-08-26
1289 */
1290 return [super collideWithShip:other];
1291}

◆ countOfDockedContractors

- (unsigned) countOfDockedContractors

Definition at line 1 of file StationEntity.m.

◆ countOfDockedDefenders

- (unsigned) countOfDockedDefenders

Definition at line 1 of file StationEntity.m.

◆ countOfDockedPolice

- (unsigned) countOfDockedPolice

Definition at line 1 of file StationEntity.m.

294{
296}
unsigned max_police

◆ countOfShipsInLaunchQueueWithPrimaryRole:

- (unsigned) countOfShipsInLaunchQueueWithPrimaryRole: (NSString *) role
implementation

Provided by category StationEntity(OOPrivate).

Definition at line 448 of file StationEntity.m.

1158 :(NSString *)role
1159{
1160 unsigned result = 0;
1161 NSEnumerator *subEnum = nil;
1162 DockEntity* sub = nil;
1163 for (subEnum = [self dockSubEntityEnumerator]; (sub = [subEnum nextObject]); )
1164 {
1165 result += [sub countOfShipsInLaunchQueueWithPrimaryRole:role];
1166 }
1167 return result;
1168}

◆ currentlyInDockingQueues

- (unsigned) currentlyInDockingQueues

Definition at line 448 of file StationEntity.m.

2260{
2261 NSEnumerator *subEnum = nil;
2262 DockEntity* sub = nil;
2263 unsigned soa = 0;
2264 for (subEnum = [self dockSubEntityEnumerator]; (sub = [subEnum nextObject]); )
2265 {
2266 soa += [sub countOfShipsInDockingQueue];
2267 }
2268 soa += [_shipsOnHold count];
2269 return soa;
2270}
unsigned count

◆ currentlyInLaunchingQueues

- (unsigned) currentlyInLaunchingQueues

Definition at line 448 of file StationEntity.m.

2274{
2275 NSEnumerator *subEnum = nil;
2276 DockEntity* sub = nil;
2277 unsigned soa = 0;
2278 for (subEnum = [self dockSubEntityEnumerator]; (sub = [subEnum nextObject]); )
2279 {
2280 soa += [sub countOfShipsInLaunchQueue];
2281 }
2282 return soa;
2283}

◆ dbgDumpIdLocks

- (NSString *) dbgDumpIdLocks
implementation

Provided by category StationEntity(mwDebug).

◆ dbgGetIdLocks

- (NSArray *) dbgGetIdLocks
implementation

Provided by category StationEntity(mwDebug).

◆ dbgGetShipsOnApproach

- (NSArray *) dbgGetShipsOnApproach
implementation

Provided by category StationEntity(mwDebug).

◆ dealloc

- (void) dealloc
implementation

Reimplemented from ShipEntity.

Definition at line 448 of file StationEntity.m.

647{
653// DESTROY(localPassengers);
654// DESTROY(localContracts);
657
658 [super dealloc];
659}
#define DESTROY(x)
Definition OOCocoa.h:77
OOCommodityMarket * localMarket
NSMutableDictionary * localInterfaces
NSMutableArray * localShipyard
NSString * allegiance
NSArray * marketDefinition
NSString * marketScriptName

◆ decreaseAlertLevel

- (void) decreaseAlertLevel

Definition at line 448 of file StationEntity.m.

1510{
1511 [self setAlertLevel:[self alertLevel] - 1 signallingScript:YES];
1512}

Referenced by StationDecreaseAlertLevel().

+ Here is the caller graph for this function:

◆ descriptionComponents

- (NSString *) descriptionComponents
implementation

Reimplemented from ShipEntity.

Definition at line 448 of file StationEntity.m.

2429{
2430 return [NSString stringWithFormat:@"\"%@\" %@", name, [super descriptionComponents]];
2431}

◆ dockingCorridorIsEmpty

- (BOOL) dockingCorridorIsEmpty

Definition at line 448 of file StationEntity.m.

838{
839 if (!UNIVERSE)
840 return NO;
841
842 NSEnumerator *subEnum = nil;
843 DockEntity* sub = nil;
844 for (subEnum = [self dockSubEntityEnumerator]; (sub = [subEnum nextObject]); )
845 {
846 if ([sub dockingCorridorIsEmpty])
847 {
848 return YES; // if any are
849 }
850 }
851 return NO;
852}
BOOL dockingCorridorIsEmpty()

◆ dockingInstructionsForShip:

- (NSDictionary *) dockingInstructionsForShip: (ShipEntity *) ship

Definition at line 448 of file StationEntity.m.

472 :(ShipEntity *) ship
473{
474 if (ship == nil) return nil;
475
476 [self doScriptEvent:OOJSID("stationReceivedDockingRequest") withArgument:ship];
477
478 if ([ship isPlayer])
479 {
480 player_reserved_dock = nil; // clear any dock reservation for manual docking
481 }
482
483 if ([ship isPlayer] && [ship legalStatus] > 50) // note: non-player fugitives dock as normal
484 {
485 // refuse docking to the fugitive player
486 return OOMakeDockingInstructions(self, [ship position], 0, 100, @"DOCKING_REFUSED", @"[station-docking-refused-to-fugitive]", NO, -1);
487 }
488
489 if (magnitude2(velocity) > 1.0 ||
490 fabs(flightPitch) > 0.01 ||
491 fabs(flightYaw) > 0.01)
492 {
493 // no docking while station is moving, pitching or yawing
494 return [self holdPositionInstructionForShip:ship];
495 }
496 PlayerEntity *player = PLAYER;
497 BOOL player_is_ahead = (![ship isPlayer] && [player getDockingClearanceStatus] == DOCKING_CLEARANCE_STATUS_REQUESTED && (self == [player getTargetDockStation]));
498
499 NSEnumerator *subEnum = nil;
500 DockEntity *chosenDock = nil;
501 NSString *docking = nil;
502 DockEntity *sub = nil;
503 NSUInteger queue = 100;
504
505 BOOL alldockstoosmall = YES;
506 for (subEnum = [self dockSubEntityEnumerator]; (sub = [subEnum nextObject]); )
507 {
508 if ([sub shipIsInDockingQueue:ship])
509 {
510 // if already claimed a docking queue, use that one
511 chosenDock = sub;
512 alldockstoosmall = NO;
513 break;
514 }
515 if (player_is_ahead) {
516 // can't allocate a new queue while player is manually docking
517 continue;
518 }
519 if (sub != player_reserved_dock || [ship isPlayer])
520 {
521 docking = [sub canAcceptShipForDocking:ship];
522 if ([docking isEqualToString:@"DOCK_CLOSED"])
523 {
524 JSContext *context = OOJSAcquireContext();
525 jsval rval = JSVAL_VOID;
526 jsval args[] = { OOJSValueFromNativeObject(context, sub),
527 OOJSValueFromNativeObject(context, ship) };
528 JSBool tempreject = NO;
529
530 BOOL OK = [[self script] callMethod:OOJSID("willOpenDockingPortFor") inContext:context withArguments:args count:2 result:&rval];
531 if (OK) OK = JS_ValueToBoolean(context, rval, &tempreject);
532 if (!OK) tempreject = NO; // default to permreject
533 if (tempreject)
534 {
535 docking = @"TRY_AGAIN_LATER";
536 }
537 else
538 {
539 docking = @"TOO_BIG_TO_DOCK";
540 }
541
542 OOJSRelinquishContext(context);
543 }
544
545 if ([docking isEqualToString:@"DOCKING_POSSIBLE"] && [sub countOfShipsInDockingQueue] < queue) {
546 // try to select the dock with the fewest ships already enqueued
547 chosenDock = sub;
548 queue = [sub countOfShipsInDockingQueue];
549 alldockstoosmall = NO;
550 }
551 else if (![docking isEqualToString:@"TOO_BIG_TO_DOCK"])
552 {
553 alldockstoosmall = NO;
554 }
555 }
556 else
557 {
558 alldockstoosmall = NO;
559 }
560 }
561 if (chosenDock == nil)
562 {
563 if (player_is_ahead || ([docking isEqualToString:@"TOO_BIG_TO_DOCK"] && !alldockstoosmall) || docking == nil)
564 {
565 // either player is manually docking and we can't allocate new docks,
566 // or the last dock was too small, and there may be an acceptable one
567 // not tested yet or returning TRY_AGAIN_LATER
568 docking = @"TRY_AGAIN_LATER";
569 }
570 // no docks accept this ship (or the player is blocking them)
571 return OOMakeDockingInstructions(self, [ship position], 200, 100, docking, nil, NO, -1);
572 }
573
574
575 // rolling is okay for some
576 if (fabs(flightRoll) > 0.01 && [chosenDock isOffCentre])
577 {
578 return [self holdPositionInstructionForShip:ship];
579 }
580
581 // we made it through holding!
582 [_shipsOnHold removeObject:ship];
583
584 [shipAI reactToMessage:@"DOCKING_REQUESTED" context:@"requestDockingCoordinates"]; // react to the request
585 [self doScriptEvent:OOJSID("stationAcceptedDockingRequest") withArgument:ship];
586
587 return [chosenDock dockingInstructionsForShip:ship];
588}
NSDictionary * dockingInstructionsForShip:(ShipEntity *ship)
Definition DockEntity.m:282
NSUInteger countOfShipsInDockingQueue()
Definition DockEntity.m:660
OODockingClearanceStatus getDockingClearanceStatus()
StationEntity * getTargetDockStation()
GLfloat flightPitch
Definition ShipEntity.h:370
int legalStatus()
Vector velocity()
GLfloat flightRoll
Definition ShipEntity.h:369
GLfloat flightYaw
Definition ShipEntity.h:371
NSDictionary * OOMakeDockingInstructions(StationEntity *station, HPVector coords, float speed, float range, NSString *ai_message, NSString *comms_message, BOOL match_rotation, int docking_stage)

◆ dockSubEntityEnumerator

- (NSEnumerator *) dockSubEntityEnumerator

Definition at line 1 of file StationEntity.m.

306{
307 return [[self subEntities] objectEnumeratorFilteredWithSelector:@selector(isDock)];
308}

◆ dumpSelfState

- (void) dumpSelfState
implementation

Reimplemented from ShipEntity.

Definition at line 448 of file StationEntity.m.

2435{
2436 NSMutableArray *flags = nil;
2437 NSString *flagsString = nil;
2438 NSString *alertString = @"*** ERROR: UNKNOWN ALERT LEVEL ***";
2439
2440 [super dumpSelfState];
2441
2442 switch (alertLevel)
2443 {
2445 alertString = @"green";
2446 break;
2447
2449 alertString = @"yellow";
2450 break;
2451
2453 alertString = @"red";
2454 break;
2455 }
2456
2457 OOLog(@"dumpState.stationEntity", @"Alert level: %@", alertString);
2458 OOLog(@"dumpState.stationEntity", @"Max police: %u", max_police);
2459 OOLog(@"dumpState.stationEntity", @"Max defense ships: %u", max_defense_ships);
2460 OOLog(@"dumpState.stationEntity", @"Defenders launched: %u", defenders_launched);
2461 OOLog(@"dumpState.stationEntity", @"Max scavengers: %u", max_scavengers);
2462 OOLog(@"dumpState.stationEntity", @"Scavengers launched: %u", scavengers_launched);
2463 OOLog(@"dumpState.stationEntity", @"Docked shuttles: %u", docked_shuttles);
2464 OOLog(@"dumpState.stationEntity", @"Docked traders: %u", docked_traders);
2465 OOLog(@"dumpState.stationEntity", @"Equivalent tech level: %li", equivalentTechLevel);
2466 OOLog(@"dumpState.stationEntity", @"Equipment price factor: %g", equipmentPriceFactor);
2467
2468 flags = [NSMutableArray array];
2469 #define ADD_FLAG_IF_SET(x) if (x) { [flags addObject:@#x]; }
2471 if ([self isRotatingStation]) { [flags addObject:@"rotatingStation"]; }
2472 if (![self dockingCorridorIsEmpty]) { [flags addObject:@"dockingCorridorIsBusy"]; }
2473 flagsString = [flags count] ? [flags componentsJoinedByString:@", "] : (NSString *)@"none";
2474 OOLog(@"dumpState.stationEntity", @"Flags: %@", flagsString);
2475
2476 // approach and hold lists.
2477
2478 // Ships on hold list, only used with moving stations (= carriers)
2479 if([_shipsOnHold count] > 0)
2480 {
2481 OOLog(@"dumpState.stationEntity", @"%li Ships on hold (unsorted):", [_shipsOnHold count]);
2482
2483 OOLogIndent();
2484 NSEnumerator *onHoldEnum = [_shipsOnHold objectEnumerator];
2485 ShipEntity *ship = nil;
2486 unsigned i = 1;
2487 while ((ship = [onHoldEnum nextObject]))
2488 {
2489 OOLog(@"dumpState.stationEntity", @"Nr %i: %@ at distance %g with role: %@", i++, [ship displayName], HPdistance([self position], [ship position]), [ship primaryRole]);
2490 }
2491 OOLogOutdent();
2492 }
2493}
#define ADD_FLAG_IF_SET(x)
void OOLogOutdent(void)
Definition OOLogging.m:376
void OOLogIndent(void)
Definition OOLogging.m:366
@ STATION_ALERT_LEVEL_RED
@ STATION_ALERT_LEVEL_YELLOW
@ STATION_ALERT_LEVEL_GREEN
OOTechLevelID equivalentTechLevel
OOStationAlertLevel alertLevel
float equipmentPriceFactor

◆ equipmentPriceFactor

- (float) equipmentPriceFactor

◆ equivalentTechLevel

- (OOTechLevelID) equivalentTechLevel

◆ fitsInDock:

- (BOOL) fitsInDock: (ShipEntity *) ship

Definition at line 448 of file StationEntity.m.

1170 :(ShipEntity *)ship
1171{
1172 return [self fitsInDock:ship andLogNoFit:YES];
1173}

◆ fitsInDock:andLogNoFit:

- (BOOL) fitsInDock: (ShipEntity *) ship
andLogNoFit: (BOOL) logNoFit 

Definition at line 448 of file StationEntity.m.

1176 :(ShipEntity *)ship andLogNoFit:(BOOL)logNoFit
1177{
1178 if (![ship isShip]) return NO;
1179
1180 NSEnumerator *subEnum = nil;
1181 DockEntity* sub = nil;
1182 for (subEnum = [self dockSubEntityEnumerator]; (sub = [subEnum nextObject]); )
1183 {
1184 if ([sub allowsLaunchingOf:ship])
1185 {
1186 return YES;
1187 }
1188 }
1189
1190 if (logNoFit) OOLog(@"station.launchShip.failed", @"Cancelled launch for a %@ with role %@, as it is too large for the docking port of the %@.",
1191 [ship displayName], [ship primaryRole], self);
1192 return NO;
1193}
unsigned isShip
Definition Entity.h:91

Referenced by StationCanDockShip().

+ Here is the caller graph for this function:

◆ generateShipyard

- (void) generateShipyard

Definition at line 448 of file StationEntity.m.

2376{
2377 [self generateShipyard:[self equivalentTechLevel]];
2378}

Referenced by StationEntity(OOJavaScriptExtensions)::getJSClass:andPrototype:, StationAddShipToShipyard(), and StationGetProperty().

+ Here is the caller graph for this function:

◆ generateShipyard:

- (void) generateShipyard: (OOTechLevelID) stationTechLevel

Definition at line 448 of file StationEntity.m.

2381 :(OOTechLevelID)stationTechLevel
2382{
2383 unsigned i;
2384
2385 if ([self localShipyard] == nil)
2386 {
2387 [self setLocalShipyard:[UNIVERSE shipsForSaleForSystem:[UNIVERSE currentSystemID] withTL:stationTechLevel atTime:[PLAYER clockTime]]];
2388 }
2389
2390 NSMutableArray *shipyard = [self localShipyard];
2391
2392 // remove ships that the player has already bought
2393 for (i = 0; i < [shipyard count]; i++)
2394 {
2395 NSString *shipID = [[shipyard oo_dictionaryAtIndex:i] oo_stringForKey:SHIPYARD_KEY_ID];
2396 if ([[PLAYER shipyardRecord] objectForKey:shipID])
2397 {
2398 [shipyard removeObjectAtIndex:i--];
2399 }
2400 }
2401}
NSUInteger OOTechLevelID
Definition OOTypes.h:204

◆ getJSClass:andPrototype:

- (void) getJSClass: (JSClass **) outClass
andPrototype: (JSObject **) outPrototype 
implementation

Reimplemented from ShipEntity.

Provided by category StationEntity(OOJavaScriptExtensions).

Definition at line 1113 of file OOJSStation.m.

215 :(JSClass **)outClass andPrototype:(JSObject **)outPrototype
216{
217 *outClass = &sStationClass;
218 *outPrototype = sStationPrototype;
219}
static JSClass sStationClass
Definition OOJSStation.m:69
static JSObject * sStationPrototype
Definition OOJSStation.m:40

◆ hasBreakPattern

- (BOOL) hasBreakPattern

◆ hasClearDock

- (BOOL) hasClearDock

Definition at line 448 of file StationEntity.m.

1031{
1032 NSEnumerator *subEnum = nil;
1033 DockEntity* sub = nil;
1034 for (subEnum = [self dockSubEntityEnumerator]; (sub = [subEnum nextObject]); )
1035 {
1036 if ([sub allowsDocking] && [sub countOfShipsInLaunchQueue] == 0 && [sub countOfShipsInDockingQueue] == 0)
1037 {
1038 if ([[sub canAcceptShipForDocking:PLAYER] isEqualToString:@"DOCKING_POSSIBLE"])
1039 {
1040 return YES;
1041 }
1042 }
1043 }
1044 return NO;
1045}

◆ hasEligibleDock

- (BOOL) hasEligibleDock
implementation

Definition at line 448 of file StationEntity.m.

1049{
1050 NSEnumerator *subEnum = nil;
1051 DockEntity* sub = nil;
1052 for (subEnum = [self dockSubEntityEnumerator]; (sub = [subEnum nextObject]); )
1053 {
1054 // TRY_AGAIN_LATER in this context means "ships launching now"
1055 if ([sub allowsDocking] && ([[sub canAcceptShipForDocking:PLAYER] isEqualToString:@"DOCKING_POSSIBLE"] || [[sub canAcceptShipForDocking:PLAYER] isEqualToString:@"TRY_AGAIN_LATER"]))
1056 {
1057 return YES;
1058 }
1059 }
1060 return NO;
1061}

◆ hasHostileTarget

- (BOOL) hasHostileTarget
implementation

Reimplemented from ShipEntity.

Definition at line 448 of file StationEntity.m.

1295{
1296 return [super hasHostileTarget] || ([self primaryTarget] != nil && ((alertLevel == STATION_ALERT_LEVEL_YELLOW) || (alertLevel == STATION_ALERT_LEVEL_RED)));
1297}

◆ hasLaunchDock

- (BOOL) hasLaunchDock

Definition at line 448 of file StationEntity.m.

1066{
1067 NSEnumerator *subEnum = nil;
1068 DockEntity* sub = nil;
1069 for (subEnum = [self dockSubEntityEnumerator]; (sub = [subEnum nextObject]); )
1070 {
1071 if ([sub allowsLaunching])
1072 {
1073 return YES;
1074 }
1075 }
1076 return NO;
1077}

◆ hasMultipleDocks

- (BOOL) hasMultipleDocks

Definition at line 448 of file StationEntity.m.

1013{
1014 NSEnumerator *subEnum = nil;
1015 DockEntity* sub = nil;
1016 unsigned docks = 0;
1017 for (subEnum = [self dockSubEntityEnumerator]; (sub = [subEnum nextObject]); )
1018 {
1019 docks++;
1020 if (docks > 1) {
1021 return YES;
1022 }
1023 }
1024 return NO;
1025}

◆ hasNPCTraffic

- (BOOL) hasNPCTraffic

◆ hasShipyard

- (BOOL) hasShipyard

Definition at line 448 of file StationEntity.m.

2348{
2349 if ([UNIVERSE station] == self)
2350 return YES;
2351 id determinant = [shipinfoDictionary objectForKey:@"has_shipyard"];
2352
2353 if (!determinant)
2354 determinant = [shipinfoDictionary objectForKey:@"hasShipyard"];
2355
2356 // NOTE: non-standard capitalization is documented and entrenched.
2357 if (determinant)
2358 {
2359 if ([determinant isKindOfClass:[NSArray class]])
2360 {
2361 return [PLAYER scriptTestConditions:OOSanitizeLegacyScriptConditions(determinant, nil)];
2362 }
2363 else
2364 {
2365 return OOFuzzyBooleanFromObject(determinant, 0.0f);
2366 }
2367 }
2368 else
2369 {
2370 return NO;
2371 }
2372}
BOOL OOFuzzyBooleanFromObject(id object, float defaultValue)

◆ holdPositionInstructionForShip:

- (NSDictionary *) holdPositionInstructionForShip: (ShipEntity *) ship
implementation

Provided by category StationEntity(OOPrivate).

Definition at line 448 of file StationEntity.m.

591 :(ShipEntity *)ship
592{
593 if (![_shipsOnHold containsObject:ship])
594 {
595 [self sendExpandedMessage:@"[station-acknowledges-hold-position]" toShip:ship];
596 [_shipsOnHold addObject:ship];
597 }
598
599 return OOMakeDockingInstructions(self, [ship position], 0, 100, @"HOLD_POSITION", nil, NO, -1);
600}

◆ increaseAlertLevel

- (void) increaseAlertLevel

Definition at line 448 of file StationEntity.m.

1503{
1504 [self setAlertLevel:[self alertLevel] + 1 signallingScript:YES];
1505}

Referenced by StationIncreaseAlertLevel().

+ Here is the caller graph for this function:

◆ initialiseLocalMarket

- (OOCommodityMarket *) initialiseLocalMarket

Definition at line 1 of file StationEntity.m.

265{
267 localMarket = [[[UNIVERSE commodities] generateMarketForStation:self] retain];
268 return localMarket;
269}

◆ initWithKey:definition:

- (id) initWithKey: (NSString *) key
definition: (NSDictionary *) dict 
implementation

Reimplemented from ShipEntity.

Definition at line 448 of file StationEntity.m.

628 :(NSString *)key definition:(NSDictionary *)dict
629{
631
632 self = [super initWithKey:key definition:dict];
633 if (self != nil)
634 {
635 isStation = YES;
636 _shipsOnHold = [[OOWeakSet alloc] init];
637 hasBreakPattern = YES;
638 localInterfaces = [[NSMutableDictionary alloc] init];
639 }
640 return self;
641
643 }
#define OOJS_PROFILE_EXIT
#define OOJS_PROFILE_ENTER
unsigned isStation
Definition Entity.h:92
unsigned hasBreakPattern

◆ interstellarUndockingAllowed

- (BOOL) interstellarUndockingAllowed

◆ isRotatingStation

- (BOOL) isRotatingStation

Definition at line 448 of file StationEntity.m.

2330{
2331 if ([shipinfoDictionary oo_boolForKey:@"rotating" defaultValue:NO]) return YES;
2332 return [[shipinfoDictionary objectForKey:@"roles"] rangeOfString:@"rotating-station"].location != NSNotFound; // legacy
2333}
NSDictionary * shipinfoDictionary
Definition ShipEntity.h:217

◆ isUnpiloted

- (BOOL) isUnpiloted
implementation

Reimplemented from ShipEntity.

Definition at line 1 of file StationEntity.m.

80{
81 return [self isExplicitlyUnpiloted] || [self isHulk];
82}

◆ launchDefenseShip

- (ShipEntity *) launchDefenseShip

Definition at line 448 of file StationEntity.m.

1582{
1583 if (![self hasLaunchDock])
1584 {
1585 OOLog(@"station.launchShip.impossible", @"Cancelled launch for a defense ship, as the %@ has no launch docks.",
1586 [self displayName]);
1587 return nil;
1588 }
1589
1590 OOUniversalID defense_target = [[self primaryTarget] universalID];
1591 ShipEntity *defense_ship = nil;
1592 NSString *defense_ship_key = nil,
1593 *defense_ship_role = nil,
1594 *default_defense_ship_role = nil;
1595 NSString *defense_ship_ai = @"oolite-defenseShipAI.js";
1596
1597 OOTechLevelID techlevel;
1598
1599 techlevel = [self equivalentTechLevel];
1600 if (techlevel == NSNotFound) techlevel = 6;
1601 if ((Ranrot() & 7) + 6 <= techlevel)
1602 default_defense_ship_role = @"interceptor";
1603 else
1604 default_defense_ship_role = @"police";
1605
1606 if (scanClass == CLASS_ROCK)
1607 default_defense_ship_role = @"hermit-ship";
1608
1609 if (defenders_launched >= max_defense_ships) // shuttles are to rockhermits what police ships are to stations
1610 return nil;
1611
1612 if (![UNIVERSE entityForUniversalID:defense_target])
1613 {
1614 [self noteLostTarget];
1615 return nil;
1616 }
1617
1618 defense_ship_key = [shipinfoDictionary oo_stringForKey:@"defense_ship"];
1619 if (defense_ship_key != nil)
1620 {
1621 defense_ship = [UNIVERSE newShipWithName:defense_ship_key];
1622 }
1623 if (!defense_ship)
1624 {
1625 defense_ship_role = [shipinfoDictionary oo_stringForKey:@"defense_ship_role" defaultValue:default_defense_ship_role];
1626 defense_ship = [UNIVERSE newShipWithRole:defense_ship_role];
1627 }
1628
1629 if (!defense_ship && default_defense_ship_role != defense_ship_role)
1630 defense_ship = [UNIVERSE newShipWithRole:default_defense_ship_role];
1631
1632 if (!defense_ship || ![self fitsInDock:defense_ship])
1633 {
1634 [defense_ship release];
1635 return nil;
1636 }
1637
1638 if ([defense_ship isPolice] || [defense_ship hasPrimaryRole:@"hermit-ship"])
1639 {
1640 [defense_ship switchAITo:defense_ship_ai];
1641 }
1642
1643 [defense_ship setPrimaryRole:@"defense_ship"];
1644
1646
1647 if (![defense_ship crew])
1648 {
1649 if ([defense_ship isPolice])
1650 {
1651 [defense_ship setSingleCrewWithRole:@"police"];
1652 }
1653 else
1654 {
1655 [defense_ship setSingleCrewWithRole:@"hunter"];
1656 }
1657 }
1658
1659 [defense_ship setOwner: self];
1660 if ([self group] == nil)
1661 {
1662 [self setGroup:[self stationGroup]];
1663 }
1664 [defense_ship setGroup:[self stationGroup]]; // who's your Daddy
1665
1666 [defense_ship addTarget:[UNIVERSE entityForUniversalID:defense_target]];
1667
1668 if ((scanClass != CLASS_ROCK)&&(scanClass != CLASS_STATION))
1669 {
1670 [defense_ship setScanClass: scanClass]; // same as self
1671 }
1672 else if ([defense_ship scanClass] == CLASS_NOT_SET)
1673 {
1674 [defense_ship setScanClass: CLASS_NEUTRAL];
1675 }
1676
1677 if ([defense_ship heatInsulation] < [self heatInsulation])
1678 {
1679 [defense_ship setHeatInsulation:[self heatInsulation]];
1680 }
1681
1682 [self addShipToLaunchQueue:defense_ship withPriority:YES];
1683 [defense_ship autorelease];
1684 [self abortAllDockings];
1685
1686 return defense_ship;
1687}
uint16_t OOUniversalID
Definition OOTypes.h:189
OOShipGroup * group()
GLfloat heatInsulation()
NSArray * crew
Definition ShipEntity.h:399
unsigned Ranrot(void)

Referenced by StationLaunchDefenseShip().

+ Here is the caller graph for this function:

◆ launchEscort

- (ShipEntity *) launchEscort

Definition at line 448 of file StationEntity.m.

1883{
1884 if (![self hasLaunchDock])
1885 {
1886 OOLog(@"station.launchShip.impossible", @"Cancelled launch for an escort ship, as the %@ has no launch docks.",
1887 [self displayName]);
1888 return nil;
1889 }
1890 ShipEntity *escort_ship;
1891
1892 escort_ship = [UNIVERSE newShipWithRole:@"escort"]; // retain count = 1
1893
1894 if (escort_ship && [self fitsInDock:escort_ship])
1895 {
1896 if (![escort_ship crew])
1897 {
1898 [escort_ship setSingleCrewWithRole:@"hunter"];
1899 }
1900
1901 [escort_ship setScanClass: CLASS_NEUTRAL];
1902 [escort_ship setCargoFlag: CARGO_FLAG_FULL_PLENTIFUL];
1903 [escort_ship switchAITo:@"oolite-escortAI.js"];
1904 [self addShipToLaunchQueue:escort_ship withPriority:NO];
1905
1906 }
1907 [escort_ship release];
1908 return escort_ship;
1909}

Referenced by StationLaunchEscort().

+ Here is the caller graph for this function:

◆ launchIndependentShip:

- (ShipEntity *) launchIndependentShip: (NSString *) role

Definition at line 448 of file StationEntity.m.

1416 :(NSString*) role
1417{
1418 if (![self hasLaunchDock])
1419 {
1420 OOLog(@"station.launchShip.impossible", @"Cancelled launch for a ship with role %@, as the %@ has no launch docks.",
1421 role, [self displayName]);
1422 return nil;
1423 }
1424
1425 BOOL trader = [role isEqualToString:@"trader"];
1426 BOOL sunskimmer = ([role isEqualToString:@"sunskim-trader"]);
1427 ShipEntity *ship = nil;
1428
1429 if((trader && (randf() < 0.1)) || sunskimmer)
1430 {
1431 ship = [UNIVERSE newShipWithRole:@"sunskim-trader"];
1432 sunskimmer = true;
1433 trader = true;
1434 role = @"trader"; // make sure also sunskimmers get trader role.
1435 }
1436 else
1437 {
1438 ship = [UNIVERSE newShipWithRole:role];
1439 }
1440
1441 if (![self fitsInDock:ship])
1442 {
1443 [ship release];
1444 return nil;
1445 }
1446
1447 if (ship)
1448 {
1449 if (![ship crew])
1450 {
1451 [ship setSingleCrewWithRole:role];
1452 }
1453 [ship setPrimaryRole:role];
1454
1455 if(trader || ship->scanClass == CLASS_NOT_SET) [ship setScanClass: CLASS_NEUTRAL]; // keep defined scanclasses for non-traders.
1456
1457 if (trader)
1458 {
1459 [ship setBounty:0 withReason:kOOLegalStatusReasonSetup];
1460 [ship setCargoFlag:CARGO_FLAG_FULL_PLENTIFUL];
1461 if (sunskimmer)
1462 {
1463 [ship setFuel:(Ranrot()&31)];
1464 [UNIVERSE makeSunSkimmer:ship andSetAI:YES];
1465 }
1466 else
1467 {
1468// JSAI: not needed - oolite-traderAI.js handles exiting if full fuel and plentiful cargo
1469// [ship switchAITo:@"exitingTraderAI.plist"];
1470 if([ship fuel] == 0) [ship setFuel:70];
1471// if ([ship hasRole:@"sunskim-trader"]) [UNIVERSE makeSunSkimmer:ship andSetAI:NO];
1472 }
1473 }
1474
1475 [self addShipToLaunchQueue:ship withPriority:NO];
1476
1477 OOShipGroup *escortGroup = [ship escortGroup];
1478 if ([ship group] == nil) [ship setGroup:escortGroup];
1479 // Eric: Escorts are defined both as _group and as _escortGroup because friendly attacks are only handled within _group.
1480 [escortGroup setLeader:ship];
1481
1482 // add escorts to the trader
1483 unsigned escorts = [ship pendingEscortCount];
1484 if(escorts > 0)
1485 {
1486 [ship setOwner:self]; // makes escorts get added to station launch queue
1487 [ship setUpEscorts];
1488 [ship setOwner:ship];
1489 }
1490
1491 [ship setPendingEscortCount:0];
1492 [ship autorelease];
1493 }
1494 return ship;
1495}
void setLeader:(ShipEntity *leader)
OOShipGroup * escortGroup()
OOFuelQuantity fuel
Definition ShipEntity.h:288
float randf(void)

Referenced by StationLaunchShipWithRole().

+ Here is the caller graph for this function:

◆ launchMiner

- (ShipEntity *) launchMiner

Definition at line 448 of file StationEntity.m.

1737{
1738 if (![self hasLaunchDock])
1739 {
1740 OOLog(@"station.launchShip.impossible", @"Cancelled launch for a miner ship, as the %@ has no launch docks.",
1741 [self displayName]);
1742 return nil;
1743 }
1744
1745 ShipEntity *miner_ship;
1746
1747 int n_miners = [UNIVERSE countShipsWithPrimaryRole:@"miner" inRange:SCANNER_MAX_RANGE ofEntity:self] + [self countOfShipsInLaunchQueueWithPrimaryRole:@"miner"];
1748
1749 if (n_miners >= 1) // just the one
1750 return nil;
1751
1752 // count miners as scavengers...
1753 if (scavengers_launched >= max_scavengers) return nil;
1754
1755 miner_ship = [UNIVERSE newShipWithRole:@"miner"]; // retain count = 1
1756
1757 if (![self fitsInDock:miner_ship])
1758 {
1759 [miner_ship release];
1760 return nil;
1761 }
1762
1763 if (miner_ship)
1764 {
1765 if (![miner_ship crew])
1766 {
1767 [miner_ship setSingleCrewWithRole:@"miner"];
1768 }
1769
1771 [miner_ship setScanClass:CLASS_NEUTRAL];
1772 if ([miner_ship heatInsulation] < [self heatInsulation])
1773 [miner_ship setHeatInsulation:[self heatInsulation]];
1774 [miner_ship setGroup:[self stationGroup]]; // who's your Daddy -- FIXME: should we have a separate group for non-escort auxiliaires?
1775 [miner_ship switchAITo:@"oolite-scavengerAI.js"];
1776 [self addShipToLaunchQueue:miner_ship withPriority:NO];
1777 [miner_ship autorelease];
1778 }
1779 return miner_ship;
1780}
return self

Referenced by StationLaunchMiner().

+ Here is the caller graph for this function:

◆ launchPatrol

- (ShipEntity *) launchPatrol

Reimplemented from ShipEntity.

Definition at line 448 of file StationEntity.m.

1914{
1915 if (![self hasLaunchDock])
1916 {
1917 OOLog(@"station.launchShip.impossible", @"Cancelled launch for a patrol ship, as the %@ has no launch docks.",
1918 [self displayName]);
1919 return nil;
1920 }
1922 {
1923 ShipEntity *patrol_ship = nil;
1924 OOTechLevelID techlevel;
1925
1926 techlevel = [self equivalentTechLevel];
1927 if (techlevel == NSNotFound)
1928 techlevel = 6;
1929
1930 if ((Ranrot() & 7) + 6 <= techlevel)
1931 patrol_ship = [UNIVERSE newShipWithRole:@"interceptor"]; // retain count = 1
1932 else
1933 patrol_ship = [UNIVERSE newShipWithRole:@"police"]; // retain count = 1
1934
1935 if (![self fitsInDock:patrol_ship])
1936 {
1937 [patrol_ship release];
1938 return nil;
1939 }
1940
1941 if (patrol_ship)
1942 {
1943 if (![patrol_ship crew])
1944 {
1945 [patrol_ship setSingleCrewWithRole:@"police"];
1946 }
1947
1949 [patrol_ship switchLightsOff];
1950 if ([patrol_ship scanClass] == CLASS_NOT_SET)
1951 [patrol_ship setScanClass: CLASS_POLICE];
1952 if ([patrol_ship heatInsulation] < [self heatInsulation])
1953 [patrol_ship setHeatInsulation:[self heatInsulation]];
1954 [patrol_ship setPrimaryRole:@"police-station-patrol"];
1955 [patrol_ship setBounty:0 withReason:kOOLegalStatusReasonSetup];
1956 [patrol_ship setGroup:[self stationGroup]]; // who's your Daddy
1957 [patrol_ship switchAITo:@"oolite-policeAI.js"];
1958 [self addShipToLaunchQueue:patrol_ship withPriority:NO];
1959 [self acceptPatrolReportFrom:patrol_ship];
1960 [patrol_ship autorelease];
1961 return patrol_ship;
1962 }
1963 }
1964 return nil;
1965}

Referenced by StationLaunchPatrol().

+ Here is the caller graph for this function:

◆ launchPirateShip

- (ShipEntity *) launchPirateShip

Lazygun** added the following line

Lazygun** added the following method. A complete rip-off of launchDefenseShip.

Definition at line 448 of file StationEntity.m.

1786{
1787 if ([self hasLaunchDock])
1788 {
1789 OOLog(@"station.launchShip.impossible", @"Cancelled launch for a pirate ship, as the %@ has no launch docks.",
1790 [self displayName]);
1791 return nil;
1792 }
1793 //Pirate ships are launched from the same pool as defence ships.
1794 OOUniversalID defense_target = [[self primaryTarget] universalID];
1795 ShipEntity *pirate_ship = nil;
1796
1797 if (defenders_launched >= max_defense_ships) return nil; // shuttles are to rockhermits what police ships are to stations
1798
1799 if (![UNIVERSE entityForUniversalID:defense_target])
1800 {
1801 [self noteLostTarget];
1802 return nil;
1803 }
1804
1805 // Yep! The standard hermit defence ships, even if they're the aggressor.
1806 pirate_ship = [UNIVERSE newShipWithRole:@"pirate"]; // retain count = 1
1807 // Nope, use standard pirates in a generic method.
1808
1809 if (![self fitsInDock:pirate_ship])
1810 {
1811 [pirate_ship release];
1812 return nil;
1813 }
1814
1815 if (pirate_ship)
1816 {
1817 if (![pirate_ship crew])
1818 {
1819 [pirate_ship setSingleCrewWithRole:@"pirate"];
1820 }
1821
1823
1824 // set the owner of the ship to the station so that it can check back for docking later
1825 [pirate_ship setOwner:self];
1826 [pirate_ship setGroup:[self stationGroup]]; // who's your Daddy
1827 [pirate_ship setPrimaryRole:@"defense_ship"];
1828 [pirate_ship addTarget:[UNIVERSE entityForUniversalID:defense_target]];
1829 [pirate_ship setScanClass: CLASS_NEUTRAL];
1830 if ([pirate_ship heatInsulation] < [self heatInsulation])
1831 [pirate_ship setHeatInsulation:[self heatInsulation]];
1832 //**Lazygun** added 30 Nov 04 to put a bounty on those pirates' heads.
1833 [pirate_ship setBounty: 10 + floor(randf() * 20) withReason:kOOLegalStatusReasonSetup]; // modified for variety
1834
1835 [self addShipToLaunchQueue:pirate_ship withPriority:NO];
1836 [pirate_ship autorelease];
1837 [self abortAllDockings];
1838 }
1839 return pirate_ship;
1840}

Referenced by StationLaunchPirateShip().

+ Here is the caller graph for this function:

◆ launchPolice

- (NSArray *) launchPolice

Definition at line 448 of file StationEntity.m.

1517{
1518 if (![self hasLaunchDock])
1519 {
1520 OOLog(@"station.launchShip.impossible", @"Cancelled launch for a police ship, as the %@ has no launch docks.",
1521 [self displayName]);
1522 return [NSArray array];
1523 }
1524
1525 OOUniversalID police_target = [[self primaryTarget] universalID];
1526 unsigned i;
1527 NSMutableArray *result = nil;
1528 OOTechLevelID techlevel = [self equivalentTechLevel];
1529 if (techlevel == NSNotFound) techlevel = 6;
1530
1531 result = [NSMutableArray arrayWithCapacity:4];
1532
1533 for (i = 0; (i < 4)&&(defenders_launched < max_police) ; i++)
1534 {
1535 ShipEntity *police_ship = nil;
1536 if (![UNIVERSE entityForUniversalID:police_target])
1537 {
1538 [self noteLostTarget];
1539 return [NSArray array];
1540 }
1541 /* this is more likely to give interceptors than the
1542 * equivalent populator function: save them for defense
1543 * ships */
1544 if ((Ranrot() & 3) + 9 < techlevel)
1545 {
1546 police_ship = [UNIVERSE newShipWithRole:@"interceptor"]; // retain count = 1
1547 }
1548 else
1549 {
1550 police_ship = [UNIVERSE newShipWithRole:@"police"]; // retain count = 1
1551 }
1552
1553 if (police_ship && [self fitsInDock:police_ship])
1554 {
1555 if (![police_ship crew])
1556 {
1557 [police_ship setSingleCrewWithRole:@"police"];
1558 }
1559
1560 [police_ship setGroup:[self stationGroup]]; // who's your Daddy
1561 [police_ship setPrimaryRole:@"police"];
1562 [police_ship addTarget:[UNIVERSE entityForUniversalID:police_target]];
1563 if ([police_ship scanClass] == CLASS_NOT_SET)
1564 [police_ship setScanClass: CLASS_POLICE];
1565 [police_ship setBounty:0 withReason:kOOLegalStatusReasonSetup];
1566 if ([police_ship heatInsulation] < [self heatInsulation])
1567 [police_ship setHeatInsulation:[self heatInsulation]];
1568 [police_ship switchAITo:@"oolite-defenseShipAI.js"];
1569 [self addShipToLaunchQueue:police_ship withPriority:YES];
1571 [result addObject:police_ship];
1572 }
1573 [police_ship autorelease];
1574 }
1575 [self abortAllDockings];
1576 return result;
1577}

Referenced by StationLaunchPolice().

+ Here is the caller graph for this function:

◆ launchScavenger

- (ShipEntity *) launchScavenger

Definition at line 448 of file StationEntity.m.

1692{
1693 if (![self hasLaunchDock])
1694 {
1695 OOLog(@"station.launchShip.impossible", @"Cancelled launch for a scavenger ship, as the %@ has no launch docks.",
1696 [self displayName]);
1697 return nil;
1698 }
1699
1700 ShipEntity *scavenger_ship;
1701
1702 unsigned scavs = [UNIVERSE countShipsWithPrimaryRole:@"scavenger" inRange:SCANNER_MAX_RANGE ofEntity:self] + [self countOfShipsInLaunchQueueWithPrimaryRole:@"scavenger"];
1703
1704 if (scavs >= max_scavengers) return nil;
1705 if (scavengers_launched >= max_scavengers) return nil;
1706
1707 scavenger_ship = [UNIVERSE newShipWithRole:@"scavenger"]; // retain count = 1
1708
1709 if (![self fitsInDock:scavenger_ship])
1710 {
1711 [scavenger_ship release];
1712 return nil;
1713 }
1714
1715 if (scavenger_ship)
1716 {
1717 if (![scavenger_ship crew])
1718 {
1719 [scavenger_ship setSingleCrewWithRole:@"miner"];
1720 }
1721
1723 [scavenger_ship setScanClass: CLASS_NEUTRAL];
1724 if ([scavenger_ship heatInsulation] < [self heatInsulation])
1725 [scavenger_ship setHeatInsulation:[self heatInsulation]];
1726 [scavenger_ship setGroup:[self stationGroup]]; // who's your Daddy -- FIXME: should we have a separate group for non-escort auxiliaires?
1727 [scavenger_ship switchAITo:@"oolite-scavengerAI.js"];
1728 [self addShipToLaunchQueue:scavenger_ship withPriority:NO];
1729 [scavenger_ship autorelease];
1730 }
1731 return scavenger_ship;
1732}

Referenced by StationLaunchScavenger().

+ Here is the caller graph for this function:

◆ launchShip:

- (void) launchShip: (ShipEntity *) ship

Definition at line 1 of file StationEntity.m.

332 :(ShipEntity *)ship
333{
334 NSEnumerator *subEnum = nil;
335 DockEntity *sub = nil;
336
337 // try to find an unused dock first
338 for (subEnum = [self dockSubEntityEnumerator]; (sub = [subEnum nextObject]); )
339 {
340 if ([sub allowsLaunching] && [sub countOfShipsInLaunchQueue] == 0)
341 {
342 [sub launchShip:ship];
343 return;
344 }
345 }
346 // otherwise any launchable dock will do
347 for (subEnum = [self dockSubEntityEnumerator]; (sub = [subEnum nextObject]); )
348 {
349 if ([sub allowsLaunching])
350 {
351 [sub launchShip:ship];
352 return;
353 }
354 }
355
356 // ship has no launch docks specified; just use the last one
357 if (sub != nil)
358 {
359 [sub launchShip:ship];
360 return;
361 }
362 // guaranteed to always be a dock as virtual dock will suffice
363}
void launchShip:(ShipEntity *ship)
Definition DockEntity.m:888

◆ launchShipWithRole:

- (void) launchShipWithRole: (NSString *) role

Definition at line 448 of file StationEntity.m.

1969 :(NSString*) role
1970{
1971 if (![self hasLaunchDock])
1972 {
1973 OOLog(@"station.launchShip.impossible", @"Cancelled launch for a ship with role %@, as the %@ has no launch docks.",
1974 role, [self displayName]);
1975 return;
1976 }
1977 ShipEntity *ship = [UNIVERSE newShipWithRole: role]; // retain count = 1
1978 if (ship && [self fitsInDock:ship])
1979 {
1980 if (![ship crew])
1981 {
1982 [ship setSingleCrewWithRole:role];
1983 }
1984 if (ship->scanClass == CLASS_NOT_SET) [ship setScanClass: CLASS_NEUTRAL];
1985 [ship setPrimaryRole:role];
1986 [ship setGroup:[self stationGroup]]; // who's your Daddy
1987 [self addShipToLaunchQueue:ship withPriority:NO];
1988 }
1989 [ship release];
1990}

◆ launchShuttle

- (ShipEntity *) launchShuttle

Definition at line 448 of file StationEntity.m.

1845{
1846 if (![self hasLaunchDock])
1847 {
1848 OOLog(@"station.launchShip.impossible", @"Cancelled launch for a shuttle ship, as the %@ has no launch docks.",
1849 [self displayName]);
1850 return nil;
1851 }
1852 ShipEntity *shuttle_ship;
1853
1854 shuttle_ship = [UNIVERSE newShipWithRole:@"shuttle"]; // retain count = 1
1855
1856 if (![self fitsInDock:shuttle_ship])
1857 {
1858 [shuttle_ship release];
1859 return nil;
1860 }
1861
1862 if (shuttle_ship)
1863 {
1864 if (![shuttle_ship crew])
1865 {
1866 [shuttle_ship setSingleCrewWithRole:@"trader"];
1867 }
1868
1870 [shuttle_ship setScanClass: CLASS_NEUTRAL];
1871 [shuttle_ship setCargoFlag:CARGO_FLAG_FULL_SCARCE];
1872 [shuttle_ship switchAITo:@"oolite-shuttleAI.js"];
1873 [self addShipToLaunchQueue:shuttle_ship withPriority:NO];
1874
1875 [shuttle_ship autorelease];
1876 }
1877 return shuttle_ship;
1878}

Referenced by StationLaunchShuttle().

+ Here is the caller graph for this function:

◆ legalStatusOfManifest:export:

- (OOCreditsQuantity) legalStatusOfManifest: (OOCommodityMarket *) manifest
export: (BOOL) export 

Definition at line 1 of file StationEntity.m.

170 :(OOCommodityMarket *)manifest export:(BOOL)export
171{
172 OOCreditsQuantity penalty, status = 0;
173 OOCommodityMarket *market = [self localMarket];
174 OOCommodityType good = nil;
175 foreach (good, [market goods])
176 {
177 if (export)
178 {
179 penalty = [market exportLegalityForGood:good];
180 }
181 else
182 {
183 penalty = [market importLegalityForGood:good];
184 }
185 status += penalty * [manifest quantityForGood:good];
186 }
187 return status;
188}
NSString * OOCommodityType
Definition OOTypes.h:106
uint64_t OOCreditsQuantity
Definition OOTypes.h:182
NSUInteger exportLegalityForGood:(OOCommodityType good)
NSUInteger importLegalityForGood:(OOCommodityType good)

◆ localInterfaces

- (NSMutableDictionary *) localInterfaces

◆ localMarket

- (OOCommodityMarket *) localMarket

◆ localMarketForScripting

- (NSDictionary *) localMarketForScripting

Definition at line 1 of file StationEntity.m.

214{
215 return [[self localMarket] dictionaryForScripting];
216}

Referenced by StationGetProperty().

+ Here is the caller graph for this function:

◆ localShipyard

- (NSMutableArray *) localShipyard

◆ marketBroadcast

- (BOOL) marketBroadcast

◆ marketCapacity

- (OOCargoQuantity) marketCapacity

◆ marketDefinition

- (NSArray *) marketDefinition

◆ marketMonitored

- (BOOL) marketMonitored

◆ marketOverrideName

- (NSString *) marketOverrideName

Definition at line 448 of file StationEntity.m.

2337{
2338 // 2010.06.14 - Micha - we can't default to the primary role as otherwise the logic
2339 // generating the market in [Universe commodityDataForEconomy:] doesn't
2340 // work properly with the various overrides. The primary role will get
2341 // used if either there is no market override, or the market wasn't
2342 // defined.
2343 return [shipinfoDictionary oo_stringForKey:@"market"];
2344}

◆ marketScriptName

- (NSString *) marketScriptName

◆ noteDockedShip:

- (void) noteDockedShip: (ShipEntity *) ship

Definition at line 448 of file StationEntity.m.

1196 :(ShipEntity *) ship
1197{
1198 if (ship == nil) return;
1199
1200 PlayerEntity *player = PLAYER;
1201 // set last launch time to avoid clashes with outgoing ships
1202 if ([player getDockingClearanceStatus] != DOCKING_CLEARANCE_STATUS_GRANTED)
1203 {
1204 // avoid interfering with docking clearance on another bay
1205 last_launch_time = [UNIVERSE getTime];
1206 }
1207 [self addShipToStationCount: ship];
1208
1209 NSEnumerator *subEnum = nil;
1210 DockEntity* sub = nil;
1211 for (subEnum = [self dockSubEntityEnumerator]; (sub = [subEnum nextObject]); )
1212 {
1213 [sub noteDockingForShip:ship];
1214 }
1215 [self sanityCheckShipsOnApproach];
1216
1217 [self doScriptEvent:OOJSID("otherShipDocked") withArgument:ship];
1218
1219 BOOL isDockingStation = (self == [player getTargetDockStation]);
1220 if (isDockingStation && [player status] == STATUS_IN_FLIGHT &&
1221 [player getDockingClearanceStatus] == DOCKING_CLEARANCE_STATUS_REQUESTED)
1222 {
1223 if (![self hasClearDock])
1224 {
1225 // then say why
1226 if ([self currentlyInDockingQueues])
1227 {
1228 [self sendExpandedMessage:[NSString stringWithFormat:
1229 DESC(@"station-docking-clearance-holding-d-ships-approaching"),
1230 [self currentlyInDockingQueues]+1] toShip:player];
1231 }
1232 else if([self currentlyInLaunchingQueues])
1233 {
1234 [self sendExpandedMessage:[NSString stringWithFormat:
1235 DESC(@"station-docking-clearance-holding-d-ships-departing"),
1236 [self currentlyInLaunchingQueues]+1] toShip:player];
1237 }
1238 }
1239 }
1240
1241
1242 if ([ship isPlayer])
1243 {
1245 }
1246}
void noteDockingForShip:(ShipEntity *ship)
Definition DockEntity.m:579

◆ oo_jsClassName

- (NSString *) oo_jsClassName
implementation

Reimplemented from ShipEntity.

Provided by category StationEntity(OOJavaScriptExtensions).

Definition at line 1113 of file OOJSStation.m.

223{
224 return @"Station";
225}

◆ OOMakeDockingInstructions

- (NSDictionary *) OOMakeDockingInstructions (StationEntity *) station
(HPVector) coords
(float) speed
(float) range
(NSString *) ai_message
(NSString *) comms_message
(BOOL) match_rotation
(int) docking_stage 
implementation

Definition at line 448 of file StationEntity.m.

449{
450 NSMutableDictionary *acc = [NSMutableDictionary dictionaryWithCapacity:8];
451 [acc oo_setHPVector:coords forKey:@"destination"];
452 [acc oo_setFloat:speed forKey:@"speed"];
453 [acc oo_setFloat:range forKey:@"range"];
454 [acc setObject:[[station weakRetain] autorelease] forKey:@"station"];
455 [acc oo_setBool:match_rotation forKey:@"match_rotation"];
456 [acc oo_setInteger:docking_stage forKey:@"docking_stage"];
457 if (ai_message)
458 {
459 [acc setObject:ai_message forKey:@"ai_message"];
460 }
461 if (comms_message)
462 {
463 [acc setObject:comms_message forKey:@"comms_message"];
464 }
465 return [NSDictionary dictionaryWithDictionary:acc];
466}

◆ planet

- (OOPlanetEntity *) planet

◆ playerReservedDock

- (DockEntity *) playerReservedDock

Definition at line 1 of file StationEntity.m.

111{
113}

◆ portUpVectorForShip:

- (Vector) portUpVectorForShip: (ShipEntity *) ship

Definition at line 1 of file StationEntity.m.

433 :(ShipEntity*) ship
434{
435 NSEnumerator *subEnum = nil;
436 DockEntity *sub = nil;
437 for (subEnum = [self dockSubEntityEnumerator]; (sub = [subEnum nextObject]); )
438 {
439 if ([sub shipIsInDockingQueue:ship])
440 {
441 return [sub portUpVectorForShipsBoundingBox:[ship totalBoundingBox]];
442 }
443 }
444 return kZeroVector;
445}
const Vector kZeroVector
Definition OOVector.m:28
Vector portUpVectorForShipsBoundingBox:(BoundingBox bb)
Definition DockEntity.m:624

◆ pullInShipIfPermitted:

- (void) pullInShipIfPermitted: (ShipEntity *) ship
implementation

Provided by category StationEntity(OOPrivate).

Definition at line 448 of file StationEntity.m.

831 :(ShipEntity *)ship
832{
833 [ship enterDock:self]; // dock performs permitted checks
834}
void enterDock:(StationEntity *station)

◆ requiresDockingClearance

- (BOOL) requiresDockingClearance

◆ sanityCheckShipsOnApproach

- (void) sanityCheckShipsOnApproach

Definition at line 1 of file StationEntity.m.

312{
313
314 NSEnumerator *subEnum = nil;
315 DockEntity* sub = nil;
316 unsigned soa = 0;
317 for (subEnum = [self dockSubEntityEnumerator]; (sub = [subEnum nextObject]); )
318 {
319 soa += [sub pruneAndCountShipsOnApproach];
320 }
321
322 if (soa == 0)
323 {
324 // if all docks have no ships on approach
325 [shipAI message:@"DOCKING_COMPLETE"];
326 [self doScriptEvent:OOJSID("stationDockingQueuesAreEmpty")];
327 }
328}

◆ selectDockForDocking

- (DockEntity *) selectDockForDocking

Definition at line 448 of file StationEntity.m.

1081{
1082 NSEnumerator *subEnum = nil;
1083 DockEntity* sub = nil;
1084 for (subEnum = [self dockSubEntityEnumerator]; (sub = [subEnum nextObject]); )
1085 {
1086 if ([sub allowsDocking] && [sub countOfShipsInLaunchQueue] == 0 && [sub countOfShipsInDockingQueue] == 0)
1087 {
1088 return sub;
1089 }
1090 }
1091 return nil;
1092}

◆ setAlertLevel:signallingScript:

- (void) setAlertLevel: (OOStationAlertLevel) level
signallingScript: (BOOL) signallingScript 

Definition at line 448 of file StationEntity.m.

1384 :(OOStationAlertLevel)level signallingScript:(BOOL)signallingScript
1385{
1388
1389 if (alertLevel != level)
1390 {
1392 alertLevel = level;
1393 if (signallingScript)
1394 {
1395 ShipScriptEventNoCx(self, "alertConditionChanged", INT_TO_JSVAL(level), INT_TO_JSVAL(oldLevel));
1396 }
1397 switch (level)
1398 {
1400 [shipAI reactToMessage:@"GREEN_ALERT" context:nil];
1401 break;
1402
1404 [shipAI reactToMessage:@"YELLOW_ALERT" context:nil];
1405 break;
1406
1408 [shipAI reactToMessage:@"RED_ALERT" context:nil];
1409 break;
1410 }
1411 }
1412}
#define ShipScriptEventNoCx(ship, event,...)
OOStationAlertLevel

Referenced by StationSetProperty().

+ Here is the caller graph for this function:

◆ setAllegiance:

- (void) setAllegiance: (NSString *) newAllegiance

Definition at line 448 of file StationEntity.m.

1371 :(NSString *)newAllegiance
1372{
1373 [allegiance release];
1374 allegiance = [newAllegiance copy];
1375}

Referenced by StationSetProperty().

+ Here is the caller graph for this function:

◆ setAllowsAutoDocking:

- (void) setAllowsAutoDocking: (BOOL) newValue

Definition at line 448 of file StationEntity.m.

2316 :(BOOL)newValue
2317{
2318 allowsAutoDocking = !!newValue; // Ensure yes or no
2319}
unsigned allowsAutoDocking

Referenced by StationSetProperty().

+ Here is the caller graph for this function:

◆ setAllowsFastDocking:

- (void) setAllowsFastDocking: (BOOL) newValue

Definition at line 448 of file StationEntity.m.

2304 :(BOOL)newValue
2305{
2306 allowsFastDocking = !!newValue; // Ensure yes or no
2307}
unsigned allowsFastDocking

Referenced by StationSetProperty().

+ Here is the caller graph for this function:

◆ setEquivalentTechLevel:

- (void) setEquivalentTechLevel: (OOTechLevelID) value

Definition at line 1 of file StationEntity.m.

98 :(OOTechLevelID) value
99{
100 equivalentTechLevel = value;
101}

◆ setHasBreakPattern:

- (void) setHasBreakPattern: (BOOL) newValue

Definition at line 448 of file StationEntity.m.

2422 :(BOOL)newValue
2423{
2424 hasBreakPattern = !!newValue;
2425}

Referenced by StationSetProperty().

+ Here is the caller graph for this function:

◆ setHasNPCTraffic:

- (void) setHasNPCTraffic: (BOOL) flag

Definition at line 448 of file StationEntity.m.

1275 :(BOOL)flag
1276{
1277 hasNPCTraffic = flag != NO;
1278}
unsigned hasNPCTraffic

Referenced by StationSetProperty().

+ Here is the caller graph for this function:

◆ setInterfaceDefinition:forKey:

- (void) setInterfaceDefinition: (OOJSInterfaceDefinition *) definition
forKey: (NSString *) key 

Definition at line 1 of file StationEntity.m.

251 :(OOJSInterfaceDefinition *)definition forKey:(NSString *)key
252{
253 if (definition == nil)
254 {
255 [localInterfaces removeObjectForKey:key];
256 }
257 else
258 {
259 [localInterfaces setObject:definition forKey:key];
260 }
261}

Referenced by StationSetInterface().

+ Here is the caller graph for this function:

◆ setLocalMarket:

- (void) setLocalMarket: (NSArray *) market

Definition at line 1 of file StationEntity.m.

207 :(NSArray *) some_market
208{
209 [[self localMarket] loadStationAmounts:some_market];
210}

◆ setLocalShipyard:

- (void) setLocalShipyard: (NSArray *) market

Definition at line 1 of file StationEntity.m.

237 :(NSArray *) some_market
238{
239 if (localShipyard)
240 [localShipyard release];
241 localShipyard = [[NSMutableArray alloc] initWithArray:some_market];
242}

◆ setPlanet:

- (void) setPlanet: (OOPlanetEntity *) planet

Definition at line 1 of file StationEntity.m.

272 :(OOPlanetEntity *)planet_entity
273{
274 if (planet_entity)
275 planet = [planet_entity universalID];
276 else
278}
@ NO_TARGET
Definition OOTypes.h:194
OOUniversalID planet

◆ setPrice:forCommodity:

- (void) setPrice: (OOCreditsQuantity) price
forCommodity: (OOCommodityType) commodity 

Definition at line 1 of file StationEntity.m.

219 :(OOCreditsQuantity)price forCommodity:(OOCommodityType)commodity
220{
221 [[self localMarket] setPrice:price forGood:commodity];
222}

Referenced by StationSetMarketPrice().

+ Here is the caller graph for this function:

◆ setQuantity:forCommodity:

- (void) setQuantity: (OOCargoQuantity) quantity
forCommodity: (OOCommodityType) commodity 

Definition at line 1 of file StationEntity.m.

225 :(OOCargoQuantity)quantity forCommodity:(OOCommodityType)commodity
226{
227 [[self localMarket] setQuantity:quantity forGood:commodity];
228}
uint32_t OOCargoQuantity
Definition OOTypes.h:176

Referenced by StationSetMarketQuantity().

+ Here is the caller graph for this function:

◆ setRequiresDockingClearance:

- (void) setRequiresDockingClearance: (BOOL) newValue

Definition at line 448 of file StationEntity.m.

2292 :(BOOL)newValue
2293{
2294 requiresDockingClearance = !!newValue; // Ensure yes or no
2295}

Referenced by StationSetProperty().

+ Here is the caller graph for this function:

◆ setSuppressArrivalReports:

- (void) setSuppressArrivalReports: (BOOL) newValue

Definition at line 448 of file StationEntity.m.

2410 :(BOOL)newValue
2411{
2412 suppress_arrival_reports = !!newValue; // ensure YES or NO
2413}
unsigned suppress_arrival_reports

Referenced by StationSetProperty().

+ Here is the caller graph for this function:

◆ setUpShipFromDictionary:

- (BOOL) setUpShipFromDictionary: (NSDictionary *) dict
implementation

Reimplemented from ShipEntity.

Definition at line 448 of file StationEntity.m.

662 :(NSDictionary *) dict
663{
665
666 isShip = YES;
667 isStation = YES;
669
670 port_radius = [dict oo_nonNegativeDoubleForKey:@"port_radius" defaultValue:500.0];
671
672 // port_dimensions is deprecated
673 port_dimensions = make_vector(69, 69, 250);
674 NSString *portDimensionsStr = [dict oo_stringForKey:@"port_dimensions"];
675 if (portDimensionsStr != nil)
676 {
677 OOStandardsDeprecated(@"The port_dimensions key is deprecated");
678 if (!OOEnforceStandards())
679 {
680 NSArray* tokens = [portDimensionsStr componentsSeparatedByString:@"x"];
681 if ([tokens count] == 3)
682 {
683 port_dimensions = make_vector([[tokens objectAtIndex:0] floatValue],
684 [[tokens objectAtIndex:1] floatValue],
685 [[tokens objectAtIndex:2] floatValue]);
686 }
687 }
688 }
689
690 if (![super setUpShipFromDictionary:dict]) return NO;
691
692 equivalentTechLevel = [dict oo_unsignedIntegerForKey:@"equivalent_tech_level" defaultValue:NSNotFound];
693 max_scavengers = [dict oo_unsignedIntForKey:@"max_scavengers" defaultValue:3];
694 max_defense_ships = [dict oo_unsignedIntForKey:@"max_defense_ships" defaultValue:3];
695 max_police = [dict oo_unsignedIntForKey:@"max_police" defaultValue:STATION_MAX_POLICE];
696 equipmentPriceFactor = [dict oo_nonNegativeFloatForKey:@"equipment_price_factor" defaultValue:1.0];
698 hasNPCTraffic = [dict oo_fuzzyBooleanForKey:@"has_npc_traffic" defaultValue:(maxFlightSpeed == 0)]; // carriers default to NO
699 hasPatrolShips = [dict oo_fuzzyBooleanForKey:@"has_patrol_ships" defaultValue:NO];
700 suppress_arrival_reports = [dict oo_boolForKey:@"suppress_arrival_reports" defaultValue:NO];
701 [self setAllegiance:[dict oo_stringForKey:@"allegiance"]];
702
703 marketCapacity = [dict oo_unsignedIntForKey:@"market_capacity" defaultValue:MAIN_SYSTEM_MARKET_LIMIT];
704 marketDefinition = [[dict oo_arrayForKey:@"market_definition" defaultValue:nil] retain];
705 marketScriptName = [[dict oo_stringForKey:@"market_script" defaultValue:nil] retain];
706 marketMonitored = [dict oo_boolForKey:@"market_monitored" defaultValue:NO];
707 marketBroadcast = [dict oo_boolForKey:@"market_broadcast" defaultValue:YES];
708
709 // Non main stations may have requiresDockingClearance set to yes as a result of the code below,
710 // but this variable should be irrelevant for them, as they do not make use of it anyway.
711 requiresDockingClearance = [dict oo_boolForKey:@"requires_docking_clearance" defaultValue:[UNIVERSE dockingClearanceProtocolActive]];
712
713 allowsFastDocking = [dict oo_boolForKey:@"allows_fast_docking" defaultValue:NO];
714
715 allowsAutoDocking = [dict oo_boolForKey:@"allows_auto_docking" defaultValue:YES];
716
717 allowsSaving = [UNIVERSE deterministicPopulation];
718
719 interstellarUndockingAllowed = [dict oo_boolForKey:@"interstellar_undocking" defaultValue:NO];
720
721 double unitime = [UNIVERSE getTime];
722
723 if ([self hasNPCTraffic]) // removed the 'isRotatingStation' restriction.
724 {
725 docked_shuttles = ranrot_rand() & 3; // 0..3;
726 shuttle_launch_interval = 15.0 * 60.0; // every 15 minutes
728
729 docked_traders = 3 + (ranrot_rand() & 7); // 1..3;
730 trader_launch_interval = 3600.0 / docked_traders; // every few minutes
731 last_trader_launch_time = unitime + 60.0 - trader_launch_interval; // in one minute's time
732 }
733 else
734 {
735 docked_shuttles = 0;
736 docked_traders = 0; // 1..3;
737 }
738
739 patrol_launch_interval = 300.0; // 5 minutes
741
742 if ([self crew] == nil)
743 {
744 [self setSingleCrewWithRole:@"police"];
745 }
746
747 if ([self group] == nil)
748 {
749 [self setGroup:[self stationGroup]];
750 }
751 return YES;
752
754}
void OOStandardsDeprecated(NSString *message)
BOOL OOEnforceStandards(void)
Vector port_dimensions
double patrol_launch_interval
double last_trader_launch_time
unsigned marketMonitored
OOCargoQuantity marketCapacity
unsigned allowsSaving
unsigned marketBroadcast
double last_shuttle_launch_time
unsigned interstellarUndockingAllowed
double shuttle_launch_interval
double trader_launch_interval
#define ranrot_rand()

◆ setUpSubEntities

- (BOOL) setUpSubEntities
implementation

Reimplemented from ShipEntity.

Definition at line 448 of file StationEntity.m.

759{
760 if (![super setUpSubEntities])
761 {
762 return NO;
763 }
764
765 NSEnumerator *subEnum = nil;
766
767#ifndef NDEBUG
768 ShipEntity *subEntity = nil;
769 for (subEnum = [self shipSubEntityEnumerator]; (subEntity = [subEnum nextObject]); )
770 {
771 if ([subEntity isStation])
772 {
773 OOLog(@"setup.ship.badType.subentities",@"Subentity %@ (%@) of station %@ is itself a StationEntity. This is an internal error - please report it. ",subEntity,[subEntity shipDataKey],[self displayName]);
774 }
775 }
776#endif
777
778 // and now check for docks
779 DockEntity *sub = nil;
780 for (subEnum = [self dockSubEntityEnumerator]; (sub = [subEnum nextObject]); )
781 {
782 return YES;
783 }
784
785 OOStandardsDeprecated([NSString stringWithFormat:@"No docks set up for %@",self]);
786 OOLog(@"ship.setup.docks",@"No docks set up for %@, making virtual dock",self);
787
788 // no real docks, make a virtual one
789 NSMutableDictionary *virtualDockDict = [NSMutableDictionary dictionaryWithCapacity:10];
790 [virtualDockDict setObject:@"standard" forKey:@"type"];
791 [virtualDockDict setObject:@"oolite-dock-virtual" forKey:@"subentity_key"];
792 [virtualDockDict oo_setVector:make_vector(0,0,port_radius) forKey:@"position"];
793 [virtualDockDict oo_setQuaternion:kIdentityQuaternion forKey:@"orientation"];
794 [virtualDockDict oo_setBool:YES forKey:@"is_dock"];
795 [virtualDockDict setObject:@"the docking bay" forKey:@"dock_label"];
796 [virtualDockDict oo_setBool:YES forKey:@"allow_docking"];
797 [virtualDockDict oo_setBool:NO forKey:@"disallowed_docking_collides"];
798 [virtualDockDict oo_setBool:YES forKey:@"allow_launching"];
799 [virtualDockDict oo_setBool:YES forKey:@"_is_virtual_dock"];
800
801 if (![self setUpOneStandardSubentity:virtualDockDict asTurret:NO])
802 {
803 return NO;
804 }
805 return YES;
806}
NSString * shipDataKey()
NSEnumerator * shipSubEntityEnumerator()

◆ shipIsInDockingCorridor:

- (BOOL) shipIsInDockingCorridor: (ShipEntity *) ship

Definition at line 448 of file StationEntity.m.

811 :(ShipEntity *)ship
812{
813 if (![ship isShip]) return NO;
814 if ([ship isPlayer] && [ship status] == STATUS_DEAD) return NO;
815
816 NSEnumerator *subEnum = nil;
817 DockEntity* sub = nil;
818 for (subEnum = [self dockSubEntityEnumerator]; (sub = [subEnum nextObject]); )
819 {
820 if ([sub shipIsInDockingCorridor:ship])
821 {
822 return YES;
823 }
824 }
825 return NO;
826}

◆ suppressArrivalReports

- (BOOL) suppressArrivalReports

Definition at line 448 of file StationEntity.m.

2405{
2407}

◆ takeEnergyDamage:from:becauseOf:weaponIdentifier:

- (void) takeEnergyDamage: (double) amount
from: (Entity *) ent
becauseOf: (Entity *) other
weaponIdentifier: (NSString *) weaponIdentifier 
implementation

Reimplemented from ShipEntity.

Definition at line 448 of file StationEntity.m.

1299 :(double)amount from:(Entity *)ent becauseOf:(Entity *)other weaponIdentifier:(NSString *)weaponIdentifier
1300{
1301 // stations must ignore friendly fire, otherwise the defenders' AI gets stuck.
1302 BOOL isFriend = NO;
1303 OOShipGroup *group = [self group];
1304
1305 if ([other isShip] && group != nil)
1306 {
1307 OOShipGroup *otherGroup = [(ShipEntity *)other group];
1308 isFriend = otherGroup == group || [otherGroup leader] == self;
1309 }
1310
1311 // If this is the system's main station...
1312 if (self == [UNIVERSE station] && !isFriend)
1313 {
1314 //...get angry
1315 BOOL isEnergyMine = [ent isCascadeWeapon];
1316
1317 // JSAIs might ignore friendly fire from conventional weapons
1318 if ([self hasNewAI] || isEnergyMine)
1319 {
1320 unsigned b=isEnergyMine ? 96 : 64;
1321 if ([(ShipEntity*)other bounty] >= b) //already a hardened criminal?
1322 {
1323 b *= 1.5; //bigger bounty!
1324 }
1325 [(ShipEntity*)other markAsOffender:b withReason:kOOLegalStatusReasonAttackedMainStation];
1326 [self setPrimaryAggressor:other];
1327 [self setFoundTarget:other];
1328 [self launchPolice];
1329 }
1330
1331 if (isEnergyMine) //don't blow up!
1332 {
1333 [self increaseAlertLevel];
1334 [self respondToAttackFrom:ent becauseOf:other];
1335 return;
1336 }
1337 }
1338 // Stop damage if main station & close to death!
1339 if (!isFriend && (self != [UNIVERSE station] || amount < energy) )
1340 {
1341 // Handle damage like a ship.
1342 [super takeEnergyDamage:amount from:ent becauseOf:other weaponIdentifier:weaponIdentifier];
1343 }
1344}
GLfloat energy
Definition Entity.h:142
ShipEntity * leader()
BOOL hasNewAI()

◆ takeHeatDamage:

- (void) takeHeatDamage: (double) amount
implementation

Reimplemented from ShipEntity.

Definition at line 448 of file StationEntity.m.

1358 :(double)amount
1359{
1360 // Stop damage if main station
1361 if (self != [UNIVERSE station]) [super takeHeatDamage:amount];
1362}

◆ takeScrapeDamage:from:

- (void) takeScrapeDamage: (double) amount
from: (Entity *) ent 
implementation

Reimplemented from ShipEntity.

Definition at line 448 of file StationEntity.m.

1351 :(double)amount from:(Entity *)ent
1352{
1353 // Stop damage if main station
1354 if (self != [UNIVERSE station]) [super takeScrapeDamage:amount from:ent];
1355}

◆ update:

- (void) update: (OOTimeDelta) delta_t
implementation

Reimplemented from ShipEntity.

Definition at line 448 of file StationEntity.m.

871 :(OOTimeDelta) delta_t
872{
873 BOOL isRockHermit = (scanClass == CLASS_ROCK);
874 BOOL isMainStation = (self == [UNIVERSE station]);
875
876 double unitime = [UNIVERSE getTime];
877
878 if (!isMainStation && localMarket == nil)
879 {
880 [self initialiseLocalMarket];
881 }
882
883 [super update:delta_t];
884
885 PlayerEntity *player = PLAYER;
886
887 BOOL isDockingStation = (self == [player getTargetDockStation]);
888 if (isDockingStation && [player status] == STATUS_IN_FLIGHT)
889 {
890 if ([player getDockingClearanceStatus] >= DOCKING_CLEARANCE_STATUS_GRANTED)
891 {
892 if (last_launch_time-30 < unitime && [player getDockingClearanceStatus] != DOCKING_CLEARANCE_STATUS_TIMING_OUT)
893 {
894 [self sendExpandedMessage:@"[station-docking-clearance-about-to-expire]" toShip:player];
895 [player setDockingClearanceStatus:DOCKING_CLEARANCE_STATUS_TIMING_OUT];
896 }
897 else if (last_launch_time < unitime)
898 {
899 [self sendExpandedMessage:@"[station-docking-clearance-expired]" toShip:player];
900 [player setDockingClearanceStatus:DOCKING_CLEARANCE_STATUS_NONE]; // Docking clearance for player has expired.
901 [player doScriptEvent:OOJSID("playerDockingClearanceExpired")];
902 if ([self currentlyInDockingQueues] == 0)
903 {
904 [[self getAI] message:@"DOCKING_COMPLETE"];
905 [self doScriptEvent:OOJSID("stationDockingQueuesAreEmpty")];
906 }
908 }
909 }
910
911 else if ([player getDockingClearanceStatus] == DOCKING_CLEARANCE_STATUS_NOT_REQUIRED)
912 {
913 if (last_launch_time < unitime)
914 {
915 [player setDockingClearanceStatus:DOCKING_CLEARANCE_STATUS_NONE];
916 if ([self currentlyInDockingQueues] == 0)
917 {
918 [[self getAI] message:@"DOCKING_COMPLETE"];
919 [self doScriptEvent:OOJSID("stationDockingQueuesAreEmpty")];
920 }
921 }
922 }
923
924 else if ([player getDockingClearanceStatus] == DOCKING_CLEARANCE_STATUS_REQUESTED &&
925 [self hasClearDock])
926 {
927 DockEntity *dock = [self selectDockForDocking];
929 if ([self hasMultipleDocks])
930 {
931 [self sendExpandedMessage:[NSString stringWithFormat:
932 DESC(@"station-docking-clearance-granted-in-@-until-@"),
933 [dock displayName],
934 ClockToString([player clockTime] + DOCKING_CLEARANCE_WINDOW, NO)]
935 toShip:player];
936 }
937 else
938 {
939 [self sendExpandedMessage:[NSString stringWithFormat:
940 DESC(@"station-docking-clearance-granted-until-@"),
941 ClockToString([player clockTime] + DOCKING_CLEARANCE_WINDOW, NO)]
942 toShip:player];
943 }
945 [player setDockingClearanceStatus:DOCKING_CLEARANCE_STATUS_GRANTED];
946 [player doScriptEvent:OOJSID("playerDockingClearanceGranted")];
947
948 }
949 }
950
951
952 if (approach_spacing > 0.0)
953 {
954 approach_spacing -= delta_t * 10.0; // reduce by 10 m/s
955 if (approach_spacing < 0.0) approach_spacing = 0.0;
956 }
957
958 /* JSAI: JS-based AIs handle their own traffic either alone or
959 * in conjunction with the system repopulator */
960 if (![self hasNewAI])
961 {
962 // begin launch of shuttles, traders, patrols
963 if ((docked_shuttles > 0)&&(!isRockHermit))
964 {
966 {
967 if (([self hasNPCTraffic])&&(aegis_status != AEGIS_NONE))
968 {
969 [self launchShuttle];
970 }
971 last_shuttle_launch_time = unitime;
972 }
973 }
974
975 if ((docked_traders > 0)&&(!isRockHermit))
976 {
978 {
979 if ([self hasNPCTraffic])
980 {
981 [self launchIndependentShip:@"trader"];
983 }
984 last_trader_launch_time = unitime;
985 }
986 }
987
988 // testing patrols
990 {
991 if (!((isMainStation && [self hasNPCTraffic]) || hasPatrolShips) || [self launchPatrol] != nil)
992 last_patrol_report_time = unitime;
993 }
994
995 }
996}
@ AEGIS_NONE
Definition OOTypes.h:61
double OOTimeDelta
Definition OOTypes.h:224
OOAegisStatus aegis_status
Definition ShipEntity.h:378
ShipEntity * launchPatrol()
double approach_spacing

◆ virtualPortDimensions

- (Vector) virtualPortDimensions

Definition at line 1 of file StationEntity.m.

105{
106 return port_dimensions;
107}

Member Data Documentation

◆ _shipsOnHold

- (OOWeakSet*) _shipsOnHold
private

Definition at line 55 of file StationEntity.h.

◆ alertLevel

- (OOStationAlertLevel) alertLevel
private

Definition at line 59 of file StationEntity.h.

◆ allegiance

- (NSString *) allegiance
private

Definition at line 80 of file StationEntity.h.

Referenced by StationGetProperty().

◆ allowsAutoDocking

- (BOOL) allowsAutoDocking
private

Definition at line 108 of file StationEntity.h.

◆ allowsFastDocking

- (BOOL) allowsFastDocking
private

Definition at line 106 of file StationEntity.h.

◆ allowsSaving

- (BOOL) allowsSaving
private

Definition at line 107 of file StationEntity.h.

◆ approach_spacing

- (double) approach_spacing
private

Definition at line 58 of file StationEntity.h.

◆ defenders_launched

- (unsigned) defenders_launched
private

Definition at line 63 of file StationEntity.h.

◆ docked_shuttles

- (unsigned) docked_shuttles
private

Definition at line 92 of file StationEntity.h.

◆ docked_traders

- (unsigned) docked_traders
private

Definition at line 96 of file StationEntity.h.

◆ equipmentPriceFactor

- (float) equipmentPriceFactor
private

Definition at line 69 of file StationEntity.h.

◆ equivalentTechLevel

- (OOTechLevelID) equivalentTechLevel
private

Definition at line 68 of file StationEntity.h.

◆ hasBreakPattern

- (BOOL) hasBreakPattern
private

Definition at line 109 of file StationEntity.h.

◆ hasNPCTraffic

- (BOOL) hasNPCTraffic
private

Definition at line 75 of file StationEntity.h.

◆ hasPatrolShips

- (BOOL) hasPatrolShips
private

Definition at line 76 of file StationEntity.h.

◆ interstellarUndockingAllowed

- (BOOL) interstellarUndockingAllowed
private

Definition at line 105 of file StationEntity.h.

◆ last_launch_time

- (double) last_launch_time
private

Definition at line 57 of file StationEntity.h.

◆ last_patrol_report_time

- (double) last_patrol_report_time
private

Definition at line 100 of file StationEntity.h.

◆ last_shuttle_launch_time

- (double) last_shuttle_launch_time
private

Definition at line 93 of file StationEntity.h.

◆ last_trader_launch_time

- (double) last_trader_launch_time
private

Definition at line 97 of file StationEntity.h.

◆ localInterfaces

- (NSMutableDictionary *) localInterfaces
private

Definition at line 90 of file StationEntity.h.

◆ localMarket

- (OOCommodityMarket *) localMarket
private

Definition at line 82 of file StationEntity.h.

◆ localShipyard

- (NSMutableArray *) localShipyard
private

◆ marketBroadcast

- (BOOL) marketBroadcast
private

Definition at line 111 of file StationEntity.h.

◆ marketCapacity

- (OOCargoQuantity) marketCapacity
private

Definition at line 83 of file StationEntity.h.

◆ marketDefinition

- (NSArray *) marketDefinition
private

Definition at line 84 of file StationEntity.h.

◆ marketMonitored

- (BOOL) marketMonitored
private

Definition at line 110 of file StationEntity.h.

◆ marketScriptName

- (NSString *) marketScriptName
private

Definition at line 85 of file StationEntity.h.

◆ max_defense_ships

- (unsigned) max_defense_ships
private

Definition at line 62 of file StationEntity.h.

◆ max_police

- (unsigned) max_police
private

Definition at line 61 of file StationEntity.h.

◆ max_scavengers

- (unsigned) max_scavengers
private

Definition at line 65 of file StationEntity.h.

◆ no_docking_while_launching

- (unsigned) no_docking_while_launching
private

Definition at line 74 of file StationEntity.h.

◆ patrol_launch_interval

- (double) patrol_launch_interval
private

Definition at line 101 of file StationEntity.h.

◆ planet

- (OOPlanetEntity *) planet
private

Definition at line 78 of file StationEntity.h.

◆ player_reserved_dock

- (DockEntity*) player_reserved_dock
private

Definition at line 56 of file StationEntity.h.

◆ port_dimensions

- (Vector) port_dimensions
private

Definition at line 71 of file StationEntity.h.

◆ port_radius

- (double) port_radius
private

Definition at line 72 of file StationEntity.h.

◆ requiresDockingClearance

- (BOOL) requiresDockingClearance
private

Definition at line 104 of file StationEntity.h.

◆ scavengers_launched

- (unsigned) scavengers_launched
private

Definition at line 66 of file StationEntity.h.

◆ shuttle_launch_interval

- (double) shuttle_launch_interval
private

Definition at line 94 of file StationEntity.h.

◆ suppress_arrival_reports

- (unsigned) suppress_arrival_reports
private

Definition at line 103 of file StationEntity.h.

◆ trader_launch_interval

- (double) trader_launch_interval
private

Definition at line 98 of file StationEntity.h.


The documentation for this class was generated from the following files: