53@interface StationEntity (OOPrivate)
55- (void) pullInShipIfPermitted:(
ShipEntity *)ship;
56- (void) addShipToStationCount:(
ShipEntity *)ship;
58- (void) addShipToLaunchQueue:(
ShipEntity *)ship withPriority:(BOOL)priority;
59- (unsigned) countOfShipsInLaunchQueueWithPrimaryRole:(NSString *)role;
61- (NSDictionary *) holdPositionInstructionForShip:(
ShipEntity *)ship;
67@interface StationEntity (mwDebug)
89 return [[UNIVERSE currentSystemData] oo_intForKey:KEY_TECHLEVEL];
118 double buoy_distance = 10000.0;
120 HPVector result = HPvector_add([
self position], vectorToHPVector(vector_multiply_scalar(v_f, buoy_distance)));
175 foreach (good, [market goods])
197 return [UNIVERSE commodityMarket];
207- (void) setLocalMarket:(NSArray *) some_market
207- (void) setLocalMarket:(NSArray *) some_market {
…}
237- (void) setLocalShipyard:(NSArray *) some_market
240 [localShipyard release];
237- (void) setLocalShipyard:(NSArray *) some_market {
…}
253 if (definition ==
nil)
255 [localInterfaces removeObjectForKey:key];
259 [localInterfaces setObject:definition forKey:key];
267 localMarket = [[[UNIVERSE commodities] generateMarketForStation:
self] retain];
272- (void) setPlanet:(OOPlanetEntity *)planet_entity
272- (void) setPlanet:(OOPlanetEntity *)planet_entity {
…}
283 return [UNIVERSE entityForUniversalID:planet];
307 return [[
self subEntities] objectEnumeratorFilteredWithSelector:@selector(isDock)];
314 NSEnumerator *subEnum =
nil;
334 NSEnumerator *subEnum =
nil;
340 if ([sub allowsLaunching] && [sub countOfShipsInLaunchQueue] == 0)
349 if ([sub allowsLaunching])
369 NSEnumerator *subEnum =
nil;
377 NSEnumerator *holdEnum =
nil;
407 while ((ship = [onHoldEnum nextObject]))
418 NSEnumerator *subEnum =
nil;
435 NSEnumerator *subEnum =
nil;
439 if ([sub shipIsInDockingQueue:ship])
451 [
acc oo_setHPVector:coords forKey:@"destination"];
452 [
acc oo_setFloat:speed forKey:@"speed"];
453 [
acc oo_setFloat:range forKey:@"range"];
455 [
acc oo_setBool:match_rotation forKey:@"match_rotation"];
456 [
acc oo_setInteger:docking_stage forKey:@"docking_stage"];
459 [
acc setObject:ai_message forKey:@"ai_message"];
463 [
acc setObject:comms_message forKey:@"comms_message"];
472- (NSDictionary *) dockingInstructionsForShip:(
ShipEntity *) ship
474 if (ship ==
nil)
return nil;
499 NSEnumerator *subEnum =
nil;
501 NSString *docking =
nil;
503 NSUInteger queue = 100;
505 BOOL alldockstoosmall = YES;
508 if ([sub shipIsInDockingQueue:ship])
512 alldockstoosmall = NO;
515 if (player_is_ahead) {
522 if ([docking isEqualToString:
@"DOCK_CLOSED"])
525 jsval rval = JSVAL_VOID;
528 JSBool tempreject = NO;
531 if (OK) OK = JS_ValueToBoolean(context, rval, &tempreject);
532 if (!OK) tempreject = NO;
535 docking =
@"TRY_AGAIN_LATER";
539 docking =
@"TOO_BIG_TO_DOCK";
545 if ([docking isEqualToString:
@"DOCKING_POSSIBLE"] && [sub countOfShipsInDockingQueue] < queue) {
549 alldockstoosmall = NO;
551 else if (![docking isEqualToString:
@"TOO_BIG_TO_DOCK"])
553 alldockstoosmall = NO;
558 alldockstoosmall = NO;
561 if (chosenDock ==
nil)
563 if (player_is_ahead || ([docking isEqualToString:
@"TOO_BIG_TO_DOCK"] && !alldockstoosmall) || docking ==
nil)
568 docking =
@"TRY_AGAIN_LATER";
576 if (fabs(
flightRoll) > 0.01 && [chosenDock isOffCentre])
472- (NSDictionary *) dockingInstructionsForShip:(
ShipEntity *) ship {
…}
591- (NSDictionary *)holdPositionInstructionForShip:(
ShipEntity *)ship
593 if (![_shipsOnHold containsObject:ship])
591- (NSDictionary *)holdPositionInstructionForShip:(
ShipEntity *)ship {
…}
610 NSEnumerator *subEnum =
nil;
628- (id)initWithKey:(NSString *)key definition:(NSDictionary *)dict
628- (id)initWithKey:(NSString *)key definition:(NSDictionary *)dict {
…}
662- (BOOL) setUpShipFromDictionary:(NSDictionary *) dict
670 port_radius = [
dict oo_nonNegativeDoubleForKey:@"port_radius" defaultValue:500.0];
674 NSString *portDimensionsStr = [
dict oo_stringForKey:@"port_dimensions"];
675 if (portDimensionsStr !=
nil)
681 if ([tokens
count] == 3)
684 [[tokens objectAtIndex:1] floatValue],
685 [[tokens objectAtIndex:2] floatValue]);
690 if (![super setUpShipFromDictionary:dict])
return NO;
695 max_police = [
dict oo_unsignedIntForKey:@"max_police" defaultValue:STATION_MAX_POLICE];
698 hasNPCTraffic = [
dict oo_fuzzyBooleanForKey:@"has_npc_traffic" defaultValue:(maxFlightSpeed == 0)];
703 marketCapacity = [
dict oo_unsignedIntForKey:@"market_capacity" defaultValue:MAIN_SYSTEM_MARKET_LIMIT];
721 double unitime = [UNIVERSE getTime];
662- (BOOL) setUpShipFromDictionary:(NSDictionary *) dict {
…}
765 NSEnumerator *subEnum =
nil;
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]);
786 OOLog(
@"ship.setup.docks",
@"No docks set up for %@, making virtual dock",
self);
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"];
801 if (![
self setUpOneStandardSubentity:virtualDockDict asTurret:NO])
813 if (![ship
isShip])
return NO;
816 NSEnumerator *subEnum =
nil;
820 if ([sub shipIsInDockingCorridor:ship])
842 NSEnumerator *subEnum =
nil;
860 NSEnumerator *subEnum =
nil;
873 BOOL isRockHermit = (
scanClass == CLASS_ROCK);
874 BOOL isMainStation = (
self == [UNIVERSE station]);
876 double unitime = [UNIVERSE getTime];
888 if (isDockingStation && [player
status] == STATUS_IN_FLIGHT)
932 DESC(@"station-docking-clearance-granted-in-@-until-@"),
940 DESC(@"station-docking-clearance-granted-until-@"),
1001 NSEnumerator *subEnum =
nil;
1014 NSEnumerator *subEnum =
nil;
1032 NSEnumerator *subEnum =
nil;
1036 if ([sub allowsDocking] && [sub countOfShipsInLaunchQueue] == 0 && [sub countOfShipsInDockingQueue] == 0)
1038 if ([[sub canAcceptShipForDocking:
PLAYER] isEqualToString:
@"DOCKING_POSSIBLE"])
1050 NSEnumerator *subEnum =
nil;
1055 if ([sub allowsDocking] && ([[sub canAcceptShipForDocking:
PLAYER] isEqualToString:
@"DOCKING_POSSIBLE"] || [[sub canAcceptShipForDocking:
PLAYER] isEqualToString:
@"TRY_AGAIN_LATER"]))
1067 NSEnumerator *subEnum =
nil;
1071 if ([sub allowsLaunching])
1082 NSEnumerator *subEnum =
nil;
1086 if ([sub allowsDocking] && [sub countOfShipsInLaunchQueue] == 0 && [sub countOfShipsInDockingQueue] == 0)
1095- (void) addShipToLaunchQueue:(
ShipEntity *)ship withPriority:(BOOL)priority
1097 NSEnumerator *subEnum =
nil;
1099 unsigned threshold = 0;
1104 while (threshold < 16)
1106 for (subEnum = [
self dockSubEntityEnumerator]; (sub = [
subEnum nextObject]); )
1108 if (sub != player_reserved_dock)
1110 if ([sub countOfShipsInDockingQueue] == 0)
1112 if ([sub allowsLaunching] && [sub countOfShipsInLaunchQueue] <= threshold)
1114 if ([sub allowsLaunchingOf:ship])
1131 while (threshold < 16)
1133 for (subEnum = [
self dockSubEntityEnumerator]; (sub = [
subEnum nextObject]); )
1140 if ([sub allowsLaunching] && [sub countOfShipsInDockingQueue] <= threshold)
1142 if ([sub allowsLaunchingOf:ship])
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]);
1095- (void) addShipToLaunchQueue:(
ShipEntity *)ship withPriority:(BOOL)priority {
…}
1158- (unsigned) countOfShipsInLaunchQueueWithPrimaryRole:(NSString *)role
1160 unsigned result = 0;
1161 NSEnumerator *subEnum =
nil;
1163 for (subEnum = [
self dockSubEntityEnumerator]; (sub = [
subEnum nextObject]); )
1158- (unsigned) countOfShipsInLaunchQueueWithPrimaryRole:(NSString *)role {
…}
1178 if (![ship
isShip])
return NO;
1180 NSEnumerator *subEnum =
nil;
1184 if ([sub allowsLaunchingOf:ship])
1190 if (logNoFit)
OOLog(
@"station.launchShip.failed",
@"Cancelled launch for a %@ with role %@, as it is too large for the docking port of the %@.",
1198 if (ship ==
nil)
return;
1209 NSEnumerator *subEnum =
nil;
1220 if (isDockingStation && [player
status] == STATUS_IN_FLIGHT &&
1229 DESC(@"station-docking-clearance-holding-d-ships-approaching"),
1235 DESC(@"station-docking-clearance-holding-d-ships-departing"),
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"])
1254 if (0 < defenders_launched) defenders_launched--;
1256 else if ([ship hasPrimaryRole:
@"scavenger"] || [ship hasPrimaryRole:
@"miner"])
1258 if (0 < scavengers_launched) scavengers_launched--;
1275- (void)setHasNPCTraffic:(BOOL)flag
1275- (void)setHasNPCTraffic:(BOOL)flag {
…}
1299- (void) takeEnergyDamage:(
double)amount from:(
Entity *)ent becauseOf:(
Entity *)other weaponIdentifier:(NSString *)weaponIdentifier
1312 if (
self == [
UNIVERSE station] && !isFriend)
1318 if ([
self hasNewAI] || isEnergyMine)
1320 unsigned b=isEnergyMine ? 96 : 64;
1339 if (!isFriend && (
self != [
UNIVERSE station] || amount <
energy) )
1299- (void) takeEnergyDamage:(
double)amount from:(
Entity *)ent becauseOf:(
Entity *)other weaponIdentifier:(NSString *)weaponIdentifier {
…}
1346- (void) adjustVelocity:(Vector) xVel
1346- (void) adjustVelocity:(Vector) xVel {
…}
1351- (void)takeScrapeDamage:(
double)amount from:(
Entity *)ent
1351- (void)takeScrapeDamage:(
double)amount from:(
Entity *)ent {
…}
1358- (void) takeHeatDamage:(
double)amount
1358- (void) takeHeatDamage:(
double)amount {
…}
1371- (void) setAllegiance:(NSString *)newAllegiance
1373 [allegiance release];
1371- (void) setAllegiance:(NSString *)newAllegiance {
…}
1393 if (signallingScript)
1395 ShipScriptEventNoCx(
self,
"alertConditionChanged", INT_TO_JSVAL(level), INT_TO_JSVAL(oldLevel));
1420 OOLog(
@"station.launchShip.impossible",
@"Cancelled launch for a ship with role %@, as the %@ has no launch docks.",
1425 BOOL trader = [
role isEqualToString:@"trader"];
1426 BOOL sunskimmer = ([
role isEqualToString:@"sunskim-trader"]);
1429 if((trader && (
randf() < 0.1)) || sunskimmer)
1431 ship = [UNIVERSE newShipWithRole:@"sunskim-trader"];
1438 ship = [UNIVERSE newShipWithRole:role];
1441 if (![
self fitsInDock:ship])
1464 [UNIVERSE makeSunSkimmer:ship andSetAI:YES];
1520 OOLog(
@"station.launchShip.impossible",
@"Cancelled launch for a police ship, as the %@ has no launch docks.",
1527 NSMutableArray *result =
nil;
1529 if (techlevel == NSNotFound) techlevel = 6;
1536 if (![
UNIVERSE entityForUniversalID:police_target])
1544 if ((
Ranrot() & 3) + 9 < techlevel)
1546 police_ship = [UNIVERSE newShipWithRole:@"interceptor"];
1550 police_ship = [UNIVERSE newShipWithRole:@"police"];
1553 if (police_ship && [
self fitsInDock:police_ship])
1555 if (![police_ship
crew])
1563 if ([police_ship
scanClass] == CLASS_NOT_SET)
1571 [
result addObject:police_ship];
1585 OOLog(
@"station.launchShip.impossible",
@"Cancelled launch for a defense ship, as the %@ has no launch docks.",
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";
1600 if (techlevel == NSNotFound) techlevel = 6;
1601 if ((
Ranrot() & 7) + 6 <= techlevel)
1602 default_defense_ship_role =
@"interceptor";
1604 default_defense_ship_role =
@"police";
1607 default_defense_ship_role =
@"hermit-ship";
1612 if (![
UNIVERSE entityForUniversalID:defense_target])
1618 defense_ship_key = [shipinfoDictionary oo_stringForKey:@"defense_ship"];
1619 if (defense_ship_key !=
nil)
1621 defense_ship = [UNIVERSE newShipWithName:defense_ship_key];
1625 defense_ship_role = [shipinfoDictionary oo_stringForKey:@"defense_ship_role" defaultValue:default_defense_ship_role];
1626 defense_ship = [UNIVERSE newShipWithRole:defense_ship_role];
1629 if (!defense_ship && default_defense_ship_role != defense_ship_role)
1630 defense_ship = [UNIVERSE newShipWithRole:default_defense_ship_role];
1632 if (!defense_ship || ![
self fitsInDock:defense_ship])
1638 if ([defense_ship
isPolice] || [defense_ship hasPrimaryRole:
@"hermit-ship"])
1647 if (![defense_ship
crew])
1672 else if ([defense_ship
scanClass] == CLASS_NOT_SET)
1686 return defense_ship;
1695 OOLog(
@"station.launchShip.impossible",
@"Cancelled launch for a scavenger ship, as the %@ has no launch docks.",
1707 scavenger_ship = [UNIVERSE newShipWithRole:@"scavenger"];
1709 if (![
self fitsInDock:scavenger_ship])
1717 if (![scavenger_ship
crew])
1731 return scavenger_ship;
1740 OOLog(
@"station.launchShip.impossible",
@"Cancelled launch for a miner ship, as the %@ has no launch docks.",
1755 miner_ship = [UNIVERSE newShipWithRole:@"miner"];
1757 if (![
self fitsInDock:miner_ship])
1765 if (![miner_ship
crew])
1789 OOLog(
@"station.launchShip.impossible",
@"Cancelled launch for a pirate ship, as the %@ has no launch docks.",
1799 if (![
UNIVERSE entityForUniversalID:defense_target])
1806 pirate_ship = [UNIVERSE newShipWithRole:@"pirate"];
1809 if (![
self fitsInDock:pirate_ship])
1817 if (![pirate_ship
crew])
1848 OOLog(
@"station.launchShip.impossible",
@"Cancelled launch for a shuttle ship, as the %@ has no launch docks.",
1854 shuttle_ship = [UNIVERSE newShipWithRole:@"shuttle"];
1856 if (![
self fitsInDock:shuttle_ship])
1864 if (![shuttle_ship
crew])
1877 return shuttle_ship;
1886 OOLog(
@"station.launchShip.impossible",
@"Cancelled launch for an escort ship, as the %@ has no launch docks.",
1892 escort_ship = [UNIVERSE newShipWithRole:@"escort"];
1894 if (escort_ship && [
self fitsInDock:escort_ship])
1896 if (![escort_ship
crew])
1917 OOLog(
@"station.launchShip.impossible",
@"Cancelled launch for a patrol ship, as the %@ has no launch docks.",
1927 if (techlevel == NSNotFound)
1930 if ((
Ranrot() & 7) + 6 <= techlevel)
1931 patrol_ship = [UNIVERSE newShipWithRole:@"interceptor"];
1933 patrol_ship = [UNIVERSE newShipWithRole:@"police"];
1935 if (![
self fitsInDock:patrol_ship])
1943 if (![patrol_ship
crew])
1950 if ([patrol_ship
scanClass] == CLASS_NOT_SET)
1969- (void) launchShipWithRole:(NSString*) role
1973 OOLog(
@"station.launchShip.impossible",
@"Cancelled launch for a ship with role %@, as the %@ has no launch docks.",
1977 ShipEntity *ship = [UNIVERSE newShipWithRole: role];
1978 if (ship && [
self fitsInDock:ship])
1969- (void) launchShipWithRole:(NSString*) role {
…}
1996 if (
self == [
UNIVERSE station])
return;
2000 if ((player)&&([player
status] == STATUS_DOCKED || [player
status] == STATUS_DOCKING)&&([player dockedStation] ==
self))
2004 [UNIVERSE setViewDirection:VIEW_FORWARD];
2005 [[UNIVERSE gameController] setMouseInteractionModeForFlight];
2024 if (
self == [
UNIVERSE station])
return;
2029- (void) becomeLargeExplosion:(
double) factor
2031 if (
self == [
UNIVERSE station])
return;
2029- (void) becomeLargeExplosion:(
double) factor {
…}
2044- (NSString *) acceptDockingClearanceRequestFrom:(
ShipEntity *)other
2046 NSString *result =
nil;
2047 double timeNow = [UNIVERSE getTime];
2053 [UNIVERSE clearPreviousMessage];
2077 result =
@"DOCKING_CLEARANCE_NOT_REQUIRED";
2082 if( result ==
nil && [other
isPlayer] &&
self == [player getTargetDockStation])
2084 switch( [player getDockingClearanceStatus] )
2091 DESC(@"station-docking-clearance-extended-until-@"),
2095 result =
@"DOCKING_CLEARANCE_EXTENDED";
2104 result =
@"DOCKING_CLEARANCE_CANCELLED";
2109 [
self doScriptEvent:OOJSID("stationDockingQueuesAreEmpty")];
2120 if (result ==
nil && [other
isPlayer] &&
self != [player getTargetDockStation])
2134 result =
@"DOCKING_CLEARANCE_DENIED_SHIP_FUGITIVE";
2142 result =
@"DOCKING_CLEARANCE_DENIED_SHIP_HOSTILE";
2153 result =
@"DOCKING_CLEARANCE_DENIED_NO_DOCKS";
2163 DESC(@"station-docking-clearance-acknowledged-d-ships-approaching"),
2166 result =
@"DOCKING_CLEARANCE_DENIED_TRAFFIC_INBOUND";
2172 DESC(@"station-docking-clearance-acknowledged-d-ships-departing"),
2175 result =
@"DOCKING_CLEARANCE_DENIED_TRAFFIC_OUTBOUND";
2185 result =
@"DOCKING_CLEARANCE_DENIED_NO_DOCKS";
2187 NSEnumerator *subEnum =
nil;
2189 BOOL openLater = NO;
2193 if ([docking isEqualToString:
@"DOCK_CLOSED"])
2196 jsval rval = JSVAL_VOID;
2199 JSBool tempreject = NO;
2202 if (OK) OK = JS_ValueToBoolean(context, rval, &tempreject);
2203 if (!OK) tempreject = NO;
2210 if (openLater)
break;
2238 DESC(@"station-docking-clearance-granted-in-@-until-@"),
2246 DESC(@"station-docking-clearance-granted-until-@"),
2251 result =
@"DOCKING_CLEARANCE_GRANTED";
2044- (NSString *) acceptDockingClearanceRequestFrom:(
ShipEntity *)other {
…}
2261 NSEnumerator *subEnum =
nil;
2275 NSEnumerator *subEnum =
nil;
2292- (void) setRequiresDockingClearance:(BOOL)newValue
2292- (void) setRequiresDockingClearance:(BOOL)newValue {
…}
2304- (void) setAllowsFastDocking:(BOOL)newValue
2304- (void) setAllowsFastDocking:(BOOL)newValue {
…}
2316- (void) setAllowsAutoDocking:(BOOL)newValue
2316- (void) setAllowsAutoDocking:(BOOL)newValue {
…}
2332 return [[shipinfoDictionary objectForKey:@"roles"] rangeOfString:@"rotating-station"].location != NSNotFound;
2343 return [shipinfoDictionary oo_stringForKey:@"market"];
2351 id determinant = [shipinfoDictionary objectForKey:@"has_shipyard"];
2354 determinant = [shipinfoDictionary objectForKey:@"hasShipyard"];
2359 if ([determinant isKindOfClass:[NSArray
class]])
2361 return [PLAYER scriptTestConditions:OOSanitizeLegacyScriptConditions(determinant, nil)];
2387 [
self setLocalShipyard:[UNIVERSE shipsForSaleForSystem:[UNIVERSE currentSystemID] withTL:stationTechLevel atTime:[PLAYER clockTime]]];
2393 for (i = 0; i < [
shipyard count]; i++)
2395 NSString *shipID = [[
shipyard oo_dictionaryAtIndex:i] oo_stringForKey:SHIPYARD_KEY_ID];
2396 if ([[
PLAYER shipyardRecord] objectForKey:shipID])
2398 [
shipyard removeObjectAtIndex:i--];
2410- (void) setSuppressArrivalReports:(BOOL)newValue
2410- (void) setSuppressArrivalReports:(BOOL)newValue {
…}
2422- (void) setHasBreakPattern:(BOOL)newValue
2422- (void) setHasBreakPattern:(BOOL)newValue {
…}
2436 NSMutableArray *flags =
nil;
2437 NSString *flagsString =
nil;
2438 NSString *alertString =
@"*** ERROR: UNKNOWN ALERT LEVEL ***";
2445 alertString =
@"green";
2449 alertString =
@"yellow";
2453 alertString =
@"red";
2457 OOLog(
@"dumpState.stationEntity",
@"Alert level: %@", alertString);
2469 #define ADD_FLAG_IF_SET(x) if (x) { [flags addObject:@#x]; }
2473 flagsString = [
flags count] ? [
flags componentsJoinedByString:@", "] : (NSString *)
@"none";
2474 OOLog(
@"dumpState.stationEntity",
@"Flags: %@", flagsString);
2487 while ((ship = [onHoldEnum nextObject]))
#define ADD_FLAG_IF_SET(x)
void OOStandardsDeprecated(NSString *message)
BOOL OOEnforceStandards(void)
#define OOJS_PROFILE_EXIT
#define OOJS_PROFILE_ENTER
OOINLINE jsval OOJSValueFromNativeObject(JSContext *context, id object)
OOINLINE JSContext * OOJSAcquireContext(void)
OOINLINE void OOJSRelinquishContext(JSContext *context)
#define OOLog(class, format,...)
Vector vector_forward_from_quaternion(Quaternion quat)
NSString * OOCommodityType
uint64_t OOCreditsQuantity
@ DOCKING_CLEARANCE_STATUS_TIMING_OUT
@ DOCKING_CLEARANCE_STATUS_NOT_REQUIRED
@ DOCKING_CLEARANCE_STATUS_GRANTED
@ DOCKING_CLEARANCE_STATUS_NONE
@ DOCKING_CLEARANCE_STATUS_REQUESTED
#define ShipScriptEventNoCx(ship, event,...)
NSDictionary * OOMakeDockingInstructions(StationEntity *station, HPVector coords, float speed, float range, NSString *ai_message, NSString *comms_message, BOOL match_rotation, int docking_stage)
@ STATION_ALERT_LEVEL_RED
@ STATION_ALERT_LEVEL_YELLOW
@ STATION_ALERT_LEVEL_GREEN
#define DOCKING_CLEARANCE_WINDOW
NSString * dbgDumpIdLocks()
NSArray * dbgGetIdLocks()
NSArray * dbgGetShipsOnApproach()
void message:(NSString *ms)
void reactToMessage:context:(NSString *message,[context] NSString *debugContext)
void launchShip:(ShipEntity *ship)
NSUInteger countOfShipsInLaunchQueueWithPrimaryRole:(NSString *role)
Vector portUpVectorForShipsBoundingBox:(BoundingBox bb)
NSDictionary * dockingInstructionsForShip:(ShipEntity *ship)
NSUInteger countOfShipsInLaunchQueue()
NSUInteger countOfShipsInDockingQueue()
NSUInteger pruneAndCountShipsOnApproach()
NSString * canAcceptShipForDocking:(ShipEntity *ship)
void autoDockShipsOnApproach()
void abortDockingForShip:(ShipEntity *ship)
void noteDockingForShip:(ShipEntity *ship)
void clearDockingCorridor()
void addShipToLaunchQueue:withPriority:(ShipEntity *ship,[withPriority] BOOL priority)
void setScanClass:(OOScanClass sClass)
NSUInteger exportLegalityForGood:(OOCommodityType good)
NSDictionary * dictionaryForScripting()
NSUInteger importLegalityForGood:(OOCommodityType good)
BOOL setQuantity:forGood:(OOCargoQuantity quantity,[forGood] OOCommodityType good)
OOCargoQuantity quantityForGood:(OOCommodityType good)
BOOL setPrice:forGood:(OOCreditsQuantity price,[forGood] OOCommodityType good)
void loadStationAmounts:(NSArray *amounts)
BOOL callMethod:inContext:withArguments:count:result:(jsid methodID,[inContext] JSContext *context,[withArguments] jsval *argv,[count] intN argc,[result] jsval *outResult)
void setLeader:(ShipEntity *leader)
NSEnumerator * objectEnumerator()
void makeObjectsPerformSelector:withObject:(SEL selector,[withObject] id argument)
void removeObject:(id< OOWeakReferenceSupport > object)
OODockingClearanceStatus getDockingClearanceStatus()
StationEntity * getTargetDockStation()
void setDockingClearanceStatus:(OODockingClearanceStatus newValue)
void leaveDock:(StationEntity *station)
BOOL isExplicitlyUnpiloted()
void setBounty:withReason:(OOCreditsQuantity amount,[withReason] OOLegalStatusReason reason)
void addTarget:(Entity *targetEntity)
void setPrimaryAggressor:(Entity *targetEntity)
void setFuel:(OOFuelQuantity amount)
void takeEnergyDamage:from:becauseOf:weaponIdentifier:(double amount, [from] Entity *ent, [becauseOf] Entity *other, [weaponIdentifier] NSString *weaponIdentifier)
id initWithKey:definition:(NSString *key,[definition] NSDictionary *dict)
void setCargoFlag:(OOCargoFlag flag)
NSDictionary * shipinfoDictionary
BOOL collideWithShip:(ShipEntity *other)
OOShipGroup * escortGroup()
void takeScrapeDamage:from:(double amount,[from] Entity *ent)
void setSingleCrewWithRole:(NSString *crewRole)
void setGroup:(OOShipGroup *group)
void doScriptEvent:(jsid message)
OOShipGroup * stationGroup()
void setPrimaryRole:(NSString *role)
NSString * descriptionComponents()
void setHeatInsulation:(GLfloat value)
OOAegisStatus aegis_status
void respondToAttackFrom:becauseOf:(Entity *from,[becauseOf] Entity *other)
void becomeLargeExplosion:(double factor)
NSEnumerator * shipSubEntityEnumerator()
void adjustVelocity:(Vector xVel)
void setPendingEscortCount:(uint8_t count)
void sendExpandedMessage:toShip:(NSString *message_text,[toShip] ShipEntity *other_ship)
void update:(OOTimeDelta delta_t)
uint8_t pendingEscortCount()
void takeHeatDamage:(double amount)
void markAsOffender:withReason:(int offence_value,[withReason] OOLegalStatusReason reason)
void doScriptEvent:withArgument:(jsid message,[withArgument] id argument)
void switchAITo:(NSString *aiString)
void setFoundTarget:(Entity *targetEntity)
void sendAIMessage:(NSString *message)
NSMutableArray * subEntities
void setOwner:(Entity *who_owns_entity)
void enterDock:(StationEntity *station)
void addShipToLaunchQueue:withPriority:(ShipEntity *ship, [withPriority] BOOL priority)
void acceptPatrolReportFrom:(ShipEntity *patrol_ship)
ShipEntity * launchMiner()
ShipEntity * launchScavenger()
OOCommodityMarket * localMarket
double patrol_launch_interval
ShipEntity * launchIndependentShip:(NSString *role)
NSString * marketOverrideName()
double last_trader_launch_time
OOCommodityMarket * initialiseLocalMarket()
ShipEntity * launchDefenseShip()
void autoDockShipsOnApproach()
ShipEntity * launchPirateShip()
void setAlertLevel:signallingScript:(OOStationAlertLevel level,[signallingScript] BOOL signallingScript)
unsigned currentlyInDockingQueues()
BOOL suppressArrivalReports()
Vector virtualPortDimensions()
NSMutableDictionary * localInterfaces
DockEntity * player_reserved_dock
ShipEntity * launchShuttle()
NSMutableArray * localShipyard
unsigned allowsAutoDocking
void generateShipyard:(OOTechLevelID stationTechLevel)
BOOL dockingCorridorIsEmpty()
ShipEntity * launchPatrol()
NSDictionary * OOMakeDockingInstructions(StationEntity *station, HPVector coords, float speed, float range, NSString *ai_message, NSString *comms_message, BOOL match_rotation, int docking_stage)
unsigned defenders_launched
NSString * descriptionComponents()
void increaseAlertLevel()
unsigned countOfDockedDefenders()
unsigned countOfDockedPolice()
unsigned no_docking_while_launching
OOCargoQuantity marketCapacity
NSDictionary * localMarketForScripting()
OOTechLevelID equivalentTechLevel
OOStationAlertLevel alertLevel
void autoDockShipsOnHold()
unsigned countOfDockedContractors()
void sanityCheckShipsOnApproach()
double last_shuttle_launch_time
unsigned interstellarUndockingAllowed
unsigned currentlyInLaunchingQueues()
unsigned scavengers_launched
void decreaseAlertLevel()
void addShipToStationCount:(ShipEntity *ship)
unsigned countOfShipsInLaunchQueueWithPrimaryRole:(NSString *role)
unsigned suppress_arrival_reports
HPVector beaconPosition()
unsigned allowsFastDocking
double shuttle_launch_interval
BOOL fitsInDock:andLogNoFit:(ShipEntity *ship,[andLogNoFit] BOOL logNoFit)
ShipEntity * launchEscort()
unsigned max_defense_ships
NSArray * marketDefinition
float equipmentPriceFactor
void pullInShipIfPermitted:(ShipEntity *ship)
void setLocalShipyard:(NSArray *market)
double last_patrol_report_time
NSString * marketScriptName
DockEntity * playerReservedDock()
DockEntity * selectDockForDocking()
NSEnumerator * dockSubEntityEnumerator()
unsigned requiresDockingClearance
double trader_launch_interval
NSDictionary * holdPositionInstructionForShip:(ShipEntity *ship)
void clearDockingCorridor()
void setAllegiance:(NSString *newAllegiance)