Oolite
Loading...
Searching...
No Matches
ShipEntity.h
Go to the documentation of this file.
1/*
2
3 ShipEntity.h
4
5 Entity subclass representing a ship, or various other flying things like cargo
6 pods and stations (a subclass).
7
8 Oolite
9 Copyright (C) 2004-2013 Giles C Williams and contributors
10
11 This program is free software; you can redistribute it and/or
12 modify it under the terms of the GNU General Public License
13 as published by the Free Software Foundation; either version 2
14 of the License, or (at your option) any later version.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
24 MA 02110-1301, USA.
25
26 */
27
28#pragma once
29
31#import "OOJSPropID.h"
32#import "OOPlanetEntity.h"
33
37
38#define MAX_TARGETS 24
39#define RAIDER_MAX_CARGO 5
40#define MERCHANTMAN_MAX_CARGO 125
41
42#define PIRATES_PREFER_PLAYER YES
43
44#define TURRET_MINIMUM_COS 0.20f
45
46#define SHIP_THRUST_FACTOR 5.0f
47#define AFTERBURNER_BURNRATE 0.25f
48
49#define CLOAKING_DEVICE_ENERGY_RATE 12.8f
50#define CLOAKING_DEVICE_MIN_ENERGY 128
51#define CLOAKING_DEVICE_START_ENERGY 0.75f
52
53#define MILITARY_JAMMER_ENERGY_RATE 3
54#define MILITARY_JAMMER_MIN_ENERGY 128
55
56#define COMBAT_IN_RANGE_FACTOR 0.035f
57#define COMBAT_BROADSIDE_IN_RANGE_FACTOR 0.020f
58#define COMBAT_OUT_RANGE_FACTOR 0.500f
59#define COMBAT_BROADSIDE_RANGE_FACTOR 0.900f
60#define COMBAT_WEAPON_RANGE_FACTOR 1.200f
61#define COMBAT_JINK_OFFSET 500.0f
62
63#define SHIP_COOLING_FACTOR 0.1f
64// heat taken from energy damage depends on mass
65// but limit maximum rate since masses vary so much
66// Cobra III ~=215000
67#define SHIP_ENERGY_DAMAGE_TO_HEAT_FACTOR (mass > 400000 ? 200000 / mass : 0.5)
68#define SHIP_INSULATION_FACTOR 0.00175f
69#define SHIP_MAX_CABIN_TEMP 256.0f
70#define SHIP_MIN_CABIN_TEMP 60.0f
71#define EJECTA_TEMP_FACTOR 0.85f
72#define DEFAULT_HYPERSPACE_SPIN_TIME 15.0f
73
74#define SUN_TEMPERATURE 1250.0f
75
76#define MAX_ESCORTS 16
77#define ESCORT_SPACING_FACTOR 3.0
78
79#define SHIPENTITY_MAX_MISSILES 32
80
81#define TURRET_TYPICAL_ENERGY 25.0f
82#define TURRET_SHOT_SPEED 2000.0f
83#define TURRET_SHOT_DURATION 3.0
84#define TURRET_SHOT_RANGE (TURRET_SHOT_SPEED * TURRET_SHOT_DURATION)
85#define TURRET_SHOT_FREQUENCY (TURRET_SHOT_DURATION * TURRET_SHOT_DURATION * TURRET_SHOT_DURATION / 100.0)
86
87#define NPC_PLASMA_SPEED 1500.0f
88#define MAIN_PLASMA_DURATION 5.0
89#define NPC_PLASMA_RANGE (MAIN_PLASMA_DURATION * NPC_PLASMA_SPEED)
90
91#define PLAYER_PLASMA_SPEED 1000.0f
92#define PLAYER_PLASMA_RANGE (MAIN_PLASMA_DURATION * PLAYER_PLASMA_SPEED)
93
94#define TRACTOR_FORCE 2500.0f
95
96#define AIMS_AGGRESSOR_SWITCHED_TARGET @"AGGRESSOR_SWITCHED_TARGET"
97
98// number of vessels considered when scanning around
99#define MAX_SCAN_NUMBER 32
100
101#define BASELINE_SHIELD_LEVEL 128.0f // Max shield level with no boosters.
102#define INITIAL_SHOT_TIME 100.0
103
104#define MIN_FUEL 0 // minimum fuel required for afterburner use
105#ifdef OO_DUMP_PLANETINFO
106// debugging planetinfo needs rapid jumping
107#define MAX_JUMP_RANGE 150.0
108#else
109#define MAX_JUMP_RANGE 7.0 // the 7 ly limit
110#endif
111
112#define ENTITY_PERSONALITY_MAX 0x7FFFU
113#define ENTITY_PERSONALITY_INVALID 0xFFFFU
114
115#define WEAPON_COOLING_FACTOR 6.0f
116#define NPC_MAX_WEAPON_TEMP 256.0f
117#define WEAPON_COOLING_CUTOUT 0.85f
118
119#define COMBAT_AI_WEAPON_TEMP_READY 0.25f * NPC_MAX_WEAPON_TEMP
120#define COMBAT_AI_WEAPON_TEMP_USABLE WEAPON_COOLING_CUTOUT* NPC_MAX_WEAPON_TEMP
121// factor determining how close to target AI has to be to be confident in aim
122// higher factor makes confident at longer ranges
123#define COMBAT_AI_CONFIDENCE_FACTOR 1250000.0f
124#define COMBAT_AI_ISNT_AWFUL 0.0f
125// removes BEHAVIOUR_ATTACK_FLY_TO_TARGET_SIX/TWELVE (unless thargoid)
126#define COMBAT_AI_IS_SMART 5.0f
127// adds BEHAVIOUR_(FLEE_)EVASIVE_ACTION
128#define COMBAT_AI_FLEES_BETTER 6.0f
129// adds BEHAVIOUR_ATTACK_BREAK_OFF_TARGET
130#define COMBAT_AI_DOGFIGHTER 6.5f
131// adds BEHAVIOUR_ATTACK_SLOW_DOGFIGHT
132#define COMBAT_AI_TRACKS_CLOSER 7.5f
133#define COMBAT_AI_USES_SNIPING 8.5f
134// adds BEHAVIOUR_ATTACK_SNIPER
135#define COMBAT_AI_FLEES_BETTER_2 9.0f
136// AI reacts to changes in target path in about 1.5 seconds.
137#define COMBAT_AI_STANDARD_REACTION_TIME 1.5f
138
139#define MAX_LANDING_SPEED 50.0
140#define MAX_LANDING_SPEED2 (MAX_LANDING_SPEED * MAX_LANDING_SPEED)
141
142#define MAX_COS 0.995 // cos(5 degrees) is close enough in most cases for navigation
143#define MAX_COS2 (MAX_COS * MAX_COS)
144
145#define ENTRY(label, value) label = value,
146
147typedef enum OOBehaviour {
148#include "OOBehaviour.tbl"
150
151#undef ENTRY
152
153/*typedef enum
154{
155 WEAPON_NONE = 0U,
156 WEAPON_PLASMA_CANNON = 1,
157 WEAPON_PULSE_LASER = 2,
158 WEAPON_BEAM_LASER = 3,
159 WEAPON_MINING_LASER = 4,
160 WEAPON_MILITARY_LASER = 5,
161 WEAPON_THARGOID_LASER = 10,
162 WEAPON_UNDEFINED
163 } OOWeaponType; */
165
166typedef enum {
167 // Alert conditions are used by player and station entities.
168 // NOTE: numerical values are available to scripts and shaders.
174
175typedef enum {
176#define DIFF_STRING_ENTRY(label, string) label,
177#include "OOShipDamageType.tbl"
178#undef DIFF_STRING_ENTRY
179
180 kOOShipDamageTypeDefault = kOODamageTypeEnergy
182
184@public
185 // derived variables
186 OOTimeDelta shot_time; // time elapsed since last shot was fired
187
188 // navigation
189 Vector v_forward, v_up, v_right; // unit vectors derived from the direction faced
190
191 // variables which are controlled by AI
192 HPVector _destination; // for flying to/from a set point
193
194 GLfloat desired_range; // range to which to journey/scan
195 GLfloat desired_speed; // speed at which to travel
196 // next three used to set desired attitude, flightRoll etc. gradually catch up to target
197 GLfloat stick_roll; // stick roll
198 GLfloat stick_pitch; // stick pitch
199 GLfloat stick_yaw; // stick yaw
200 OOBehaviour behaviour; // ship's behavioural state
201
202 BoundingBox totalBoundingBox; // records ship configuration
203
204@protected
205 // set-up
206 NSDictionary* shipinfoDictionary;
207
209
210 // scripting
214
215 // docking instructions
216 NSDictionary* dockingInstructions;
217
225
226 // per ship-type variables
227 //
228 GLfloat maxFlightSpeed; // top speed (160.0 for player) (200.0 for fast raider)
229 GLfloat max_flight_roll; // maximum roll rate (2.0 for player) (3.0 for fast raider)
230 GLfloat max_flight_pitch; // maximum pitch rate (1.0 for player) (1.5 for fast raider) also radians/sec for (* turrets *)
232 GLfloat cruiseSpeed; // 80% of top speed
233
234 GLfloat max_thrust; // acceleration
235 GLfloat thrust; // acceleration
236 float hyperspaceMotorSpinTime; // duration of hyperspace countdown
237
238 unsigned military_jammer_active : 1, // military_jammer
239
241
242 pitching_over : 1, // set to YES if executing a sharp loop
243 rolling_over : 1, // set to YES if executing a sharp roll
244 reportAIMessages : 1, // normally NO, suppressing AI message reporting
245
246 being_mined : 1, // normally NO, set to Yes when fired on by mining laser
247
249
250 isHulk : 1, // This is used to distinguish abandoned ships from cargo
252 isNearPlanetSurface : 1, // check for landing on planet
253 isFrangible : 1, // frangible => subEntities can be damaged individually
254 cloaking_device_active : 1, // cloaking_device
255 cloakPassive : 1, // cloak deactivates when main weapons or missiles are fired
256 cloakAutomatic : 1, // cloak activates itself automatic during attack
257 canFragment : 1, // Can it break into wreckage?
258 isWreckage : 1, // Is it wreckage?
259 _showDamage : 1, // Show damage?
260 suppressExplosion : 1, // Avoid exploding on death (script hook)
261 suppressAegisMessages : 1, // No script/AI messages sent by -checkForAegis,
262 isMissile : 1, // Whether this was launched by fireMissile (used to track submunitions).
263 _explicitlyUnpiloted : 1, // Is meant to not have crew
264 hasScoopMessage : 1, // suppress scoop messages when false.
265
266 // scripting
272
274
275 GLfloat sunGlareFilter; // Range 0.0 - 1.0, where 0 means no sun glare filter, 1 means glare fully filtered
276
277 OOFuelQuantity fuel; // witch-space fuel
279
282
283 OOCargoQuantity likely_cargo; // likely amount of cargo (for pirates, this is what is spilled as loot)
284 OOCargoQuantity max_cargo; // capacity of cargo hold
285 OOCargoQuantity extra_cargo; // capacity of cargo hold extension (if any)
286 OOCargoQuantity equipment_weight; // amount of equipment using cargo space (excluding passenger_berth & extra_cargo_bay)
287 OOCargoType cargo_type; // if this is scooped, this is indicates contents
288 OOCargoFlag cargo_flag; // indicates contents for merchantmen
289 OOCreditsQuantity bounty; // bounty (if any)
290
291 GLfloat energy_recharge_rate; // recharge rate for energy banks
292
293 OOWeaponFacingSet weapon_facings; // weapon mounts available (bitmask)
294 OOWeaponType forward_weapon_type; // type of forward weapon (allows lasers, plasma cannon, others)
295 OOWeaponType aft_weapon_type; // type of aft weapon (allows lasers, plasma cannon, others)
296 OOWeaponType port_weapon_type; // type of port weapon
297 OOWeaponType starboard_weapon_type; // type of starboard weapon
298 GLfloat weapon_damage; // energy damage dealt by weapon
299 GLfloat weapon_damage_override; // custom energy damage dealt by front laser, if applicable
300 GLfloat weaponRange; // range of the weapon (in meters)
301 OOWeaponFacing currentWeaponFacing; // not necessarily the same as view for the player
302
303 GLfloat weapon_energy_use, weapon_temp, weapon_shot_temperature; // active weapon temp, delta-temp
305
306 GLfloat scannerRange; // typically 25600
307
308 unsigned missiles; // number of on-board missiles
309 unsigned max_missiles; // number of missile pylons
310 NSString* _missileRole;
311 OOTimeDelta missile_load_time; // minimum time interval between missile launches
312 OOTimeAbsolute missile_launch_time; // time of last missile launch
313
314 AI* shipAI; // ship's AI system
315
316 NSString* name; // descriptive name
317 NSString* shipUniqueName; // uniqish name e.g. "Terror of Lave"
318 NSString* shipClassName; // e.g. "Cobra III"
319 NSString* displayName; // name shown on screen
320 NSString* scan_description; // scan class name
321 OORoleSet* roleSet; // Roles a ship can take, eg. trader, hunter, police, pirate, scavenger &c.
322 NSString* primaryRole; // "Main" role of the ship.
323
324 NSArray* explosionType; // explosion.plist entries
325
326 // AI stuff
327 Vector jink; // x and y set factors for offsetting a pursuing ship's position
328 HPVector coordinates; // for flying to/from a set point
329 Vector reference; // a direction vector of magnitude 1 (* turrets *)
330
331 NSUInteger _subIdx; // serialisation index - used only if this ship is a subentity
332 NSUInteger _maxShipSubIdx; // serialisation index - the number of ship subentities inside the shipdata
333 double launch_time; // time at which launched
334 double launch_delay; // delay for thinking after launch
336
337 GLfloat frustration, // degree of dissatisfaction with the current behavioural state, factor used to test this
339
340 int patrol_counter; // keeps track of where the ship is along a patrol route
341
342 NSMutableDictionary* previousCondition; // restored after collision avoidance
343
344 // derived variables
345 float weapon_recharge_rate; // time between shots
346 int shot_counter; // number of shots fired
347 OOTimeAbsolute cargo_dump_time; // time cargo was last dumped
348 OOTimeAbsolute last_shot_time; // time shot was last fired
349
350 NSMutableArray* cargo; // cargo containers go in here
351
352 OOCommodityType commodity_type; // type of commodity in a container
353 OOCargoQuantity commodity_amount; // 1 if unit is TONNES (0), possibly more if precious metals KILOGRAMS (1)
354 // or gem stones GRAMS (2)
355
356 // navigation
357 GLfloat flightSpeed; // current speed
358 GLfloat flightRoll; // current roll rate
359 GLfloat flightPitch; // current pitch rate
360 GLfloat flightYaw; // current yaw rate
361
362 GLfloat accuracy;
366
367 OOAegisStatus aegis_status; // set to YES when within the station's protective zone
370
371 double messageTime; // counts down the seconds a radio message is active for
372
373 double next_spark_time; // time of next spark when throwing sparks
374
375 Vector collision_vector; // direction of colliding thing.
376
377 GLfloat _scaleFactor; // scale factor for size variation
378
379 BOOL _multiplyWeapons; // multiply instead of splitting weapons
380 // position of gun ports
381 NSArray *forwardWeaponOffset,
385
386 // crew (typically one OOCharacter - the pilot)
387 NSArray* crew;
388
389 // close contact / collision tracking
390 NSMutableDictionary* closeContactsInfo;
391
393
394 // scooping...
396
397 // from player entity moved here now we're doing more complex heat stuff
399
400 // for advanced scanning etc.
401 ShipEntity* scanned_ships[MAX_SCAN_NUMBER + 1];
402 GLfloat distance2_scanned_ships[MAX_SCAN_NUMBER + 1];
404
405 // advanced navigation
409
410 // Collision detection
411 Octree* octree;
412
413#ifdef OO_DEBUG_MONITOR_ENABLED
414 // DEBUGGING
415 OOBehaviour debugLastBehaviour;
416#endif
417
418 uint16_t entity_personality; // Per-entity random number. Exposed to shaders and scripts.
419 NSDictionary* scriptInfo; // script_info dictionary from shipdata.plist, exposed to scripts.
420
421 NSMutableArray* subEntities;
422 OOEquipmentType* missile_list[SHIPENTITY_MAX_MISSILES];
423
424 // various types of target
425 OOWeakReference* _primaryTarget; // for combat or rendezvous
426 OOWeakReference* _primaryAggressor; // recorded after attack
429 OOWeakReference* _lastEscortTarget; // last target an escort was deployed after
430 OOWeakReference* _thankedShip; // last ship thanked
431 OOWeakReference* _rememberedShip; // ship being remembered
432 OOWeakReference* _proximityAlert; // a ShipEntity within 2x collision_radius
433
434 // Stuff for the target tracking curve. The ship records the position of the target every reactionTime/2 seconds, then fits a curve to the
435 // last three recorded positions. Instead of tracking the primary target's actual position it uses the curve to calculate the target's position.
436 // This introduces a small amount of lag to the target tracking making the NPC more human.
437 float reactionTime;
441
442@private
443 OOWeakReference* _subEntityTakingDamage; // frangible => subEntities can be damaged individually
444
445 NSString* _shipKey;
446
447 NSMutableArray* _equipment;
449
450 OOWeakReference* _lastAegisLock; // remember last aegis planet/sun
451
456 // Cache of ship-relative positions, managed by -coordinatesForEscortPosition:.
459
460 OOWeakSet* _defenseTargets; // defense targets
461
462 // ships in this set can't be collided with
464
466
467 OOWeakReference* _shipHitByLaser; // entity hit by the last laser shot
468
469 // beacons
470 NSString* _beaconCode;
471 NSString* _beaconLabel;
474 id<OOHUDBeaconIcon> _beaconDrawable;
475
477
478 // Demo ship state
479 BOOL isDemoShip;
483}
484
485// ship brains
486- (void)setStateMachine:(NSString*)ai_desc;
487- (void)setAI:(AI*)ai;
488- (AI*)getAI;
489- (BOOL)hasAutoAI;
490- (BOOL)hasNewAI;
491- (void)setShipScript:(NSString*)script_name;
492- (void)removeScript;
493- (OOScript*)shipScript;
494- (OOScript*)shipAIScript;
495- (OOTimeAbsolute)shipAIScriptWakeTime;
496- (void)setAIScriptWakeTime:(OOTimeAbsolute)t;
497- (double)frustration;
498- (void)setLaunchDelay:(double)delay;
499
500- (void)interpretAIMessage:(NSString*)message;
501
502- (GLfloat)accuracy;
503- (void)setAccuracy:(GLfloat)new_accuracy;
504
505- (OOMesh*)mesh;
506- (void)setMesh:(OOMesh*)mesh;
507
509
513
514- (NSArray*)subEntities;
515- (NSUInteger)subEntityCount;
516- (BOOL)hasSubEntity:(Entity<OOSubEntity>*)sub;
517
518- (NSEnumerator*)subEntityEnumerator;
519- (NSEnumerator*)shipSubEntityEnumerator;
520- (NSEnumerator*)flasherEnumerator;
521- (NSEnumerator*)exhaustEnumerator;
522
524- (void)setSubEntityTakingDamage:(ShipEntity*)sub;
525
526- (void)clearSubEntities; // Releases and clears subentity array, after making sure subentities don't think ship is owner.
527
529- (void)setSubEntityRotationalVelocity:(Quaternion)rv;
530
531// subentities management
532- (NSString*)serializeShipSubEntities;
533- (void)deserializeShipSubEntitiesFrom:(NSString*)string;
534- (NSUInteger)maxShipSubEntities;
535- (void)setSubIdx:(NSUInteger)value;
536- (NSUInteger)subIdx;
537
539- (float)volume;
540
541// octree collision hunting
542- (GLfloat)doesHitLine:(HPVector)v0 v1:(HPVector)v1;
543- (GLfloat)doesHitLine:(HPVector)v0 v1:(HPVector)v1 hitEntity:(ShipEntity**)hitEntity;
544- (GLfloat)doesHitLine:(HPVector)v0 v1:(HPVector)v1 withPosition:(HPVector)o i:(Vector)i j:(Vector)j k:(Vector)k; // for subentities
545
546- (BoundingBox)findBoundingBoxRelativeToPosition:(HPVector)opv i:(Vector)i j:(Vector)j k:(Vector)k;
547
549
550// beacons // definitions now in <OOBeaconEntity> protocol
551
552- (void)setIsBoulder:(BOOL)flag;
553- (BOOL)isBoulder;
554- (BOOL)isMinable;
555
556- (BOOL)countsAsKill;
557
558- (void)setUpEscorts;
560
561- (id)initWithKey:(NSString*)key definition:(NSDictionary*)dict;
562- (BOOL)setUpFromDictionary:(NSDictionary*)shipDict;
563- (BOOL)setUpShipFromDictionary:(NSDictionary*)shipDict;
564- (BOOL)setUpSubEntities;
565- (BOOL)setUpOneStandardSubentity:(NSDictionary*)subentDict asTurret:(BOOL)asTurret;
566- (GLfloat)frustumRadius;
567
568- (NSString*)shipDataKey;
569- (NSString*)shipDataKeyAutoRole;
570- (void)setShipDataKey:(NSString*)key;
571
572- (NSDictionary*)shipInfoDictionary;
573
574- (NSArray*)getWeaponOffsetFrom:(NSDictionary*)dict withKey:(NSString*)key inMode:(NSString*)mode;
575- (NSArray*)aftWeaponOffset;
579- (BOOL)hasAutoWeapons;
580
583
584- (void)respondToAttackFrom:(Entity*)from becauseOf:(Entity*)other;
585
586// Equipment
588- (BOOL)hasEquipmentItem:(id)equipmentKeys includeWeapons:(BOOL)includeWeapons whileLoading:(BOOL)loading; // This can take a string or an set or array of strings. If a collection, returns YES if ship has _any_ of the specified equipment. If includeWeapons is NO, missiles and primary weapons are not checked.
589- (BOOL)hasEquipmentItem:(id)equipmentKeys; // Short for hasEquipmentItem:foo includeWeapons:NO whileLoading:NO
590- (NSUInteger)countEquipmentItem:(NSString*)eqkey;
591- (NSString*)equipmentItemProviding:(NSString*)equipmentType;
592- (BOOL)hasEquipmentItemProviding:(NSString*)equipmentType;
593- (BOOL)hasAllEquipment:(id)equipmentKeys includeWeapons:(BOOL)includeWeapons whileLoading:(BOOL)loading; // Like hasEquipmentItem:includeWeapons:, but requires _all_ elements in collection.
594- (BOOL)hasAllEquipment:(id)equipmentKeys; // Short for hasAllEquipment:foo includeWeapons:NO
595- (BOOL)setWeaponMount:(OOWeaponFacing)facing toWeapon:(NSString*)eqKey;
596- (BOOL)canAddEquipment:(NSString*)equipmentKey inContext:(NSString*)context; // Test ability to add equipment, taking equipment-specific constriants into account.
597- (BOOL)equipmentValidToAdd:(NSString*)equipmentKey inContext:(NSString*)context; // Actual test if equipment satisfies validation criteria.
598- (BOOL)equipmentValidToAdd:(NSString*)equipmentKey whileLoading:(BOOL)loading inContext:(NSString*)context;
599- (BOOL)addEquipmentItem:(NSString*)equipmentKey inContext:(NSString*)context;
600- (BOOL)addEquipmentItem:(NSString*)equipmentKey withValidation:(BOOL)validateAddition inContext:(NSString*)context;
601- (BOOL)hasHyperspaceMotor;
602- (float)hyperspaceSpinTime;
603- (void)setHyperspaceSpinTime:(float)new;
604
605- (NSEnumerator*)equipmentEnumerator;
606- (NSUInteger)equipmentCount;
607- (void)removeEquipmentItem:(NSString*)equipmentKey;
608- (void)removeAllEquipment;
611
612// Internal, subject to change. Use the methods above instead.
613- (BOOL)hasOneEquipmentItem:(NSString*)itemKey includeWeapons:(BOOL)includeMissiles whileLoading:(BOOL)loading;
614- (BOOL)hasOneEquipmentItem:(NSString*)itemKey includeMissiles:(BOOL)includeMissiles whileLoading:(BOOL)loading;
615- (BOOL)hasPrimaryWeapon:(OOWeaponType)weaponType;
616- (BOOL)removeExternalStore:(OOEquipmentType*)eqType;
617
618// Passengers and parcels - not supported for NPCs, but interface is here for genericity.
619- (NSUInteger)parcelCount;
620- (NSUInteger)passengerCount;
621- (NSUInteger)passengerCapacity;
622
623- (NSUInteger)missileCount;
624- (NSUInteger)missileCapacity;
625
626- (NSUInteger)extraCargo;
627
628// Tests for the various special-cased equipment items
629// (Nowadays, more convenience methods)
630- (BOOL)hasScoop;
631- (BOOL)hasFuelScoop;
632- (BOOL)hasCargoScoop;
633- (BOOL)hasECM;
634- (BOOL)hasCloakingDevice;
636- (BOOL)hasMilitaryJammer;
637- (BOOL)hasExpandedCargoBay;
638- (BOOL)hasShieldBooster;
640- (BOOL)hasHeatShield;
641- (BOOL)hasFuelInjection;
642- (BOOL)hasCascadeMine;
643- (BOOL)hasEscapePod;
644- (BOOL)hasDockingComputer;
646
647// Shield information derived from equipment. NPCs can't have shields, but that should change at some point.
648- (float)shieldBoostFactor;
649- (float)maxForwardShieldLevel;
650- (float)maxAftShieldLevel;
651- (float)shieldRechargeRate;
652
653- (double)maxHyperspaceDistance;
654- (float)afterburnerFactor;
655- (float)afterburnerRate;
656- (void)setAfterburnerFactor:(GLfloat)new;
657- (void)setAfterburnerRate:(GLfloat)new;
658- (float)maxThrust;
659- (float)thrust;
660
661- (void)setMaxThrust:(GLfloat)new;
662- (void)setMaxFlightPitch:(GLfloat)new;
663- (void)setMaxFlightSpeed:(GLfloat)new;
664- (void)setMaxFlightRoll:(GLfloat)new;
665- (void)setMaxFlightYaw:(GLfloat)new;
666- (void)setEnergyRechargeRate:(GLfloat)new;
667
668- (void)processBehaviour:(OOTimeDelta)delta_t;
669// Behaviours
670- (void)behaviour_stop_still:(double)delta_t;
671- (void)behaviour_idle:(double)delta_t;
672- (void)behaviour_tumble:(double)delta_t;
673- (void)behaviour_tractored:(double)delta_t;
674- (void)behaviour_track_target:(double)delta_t;
675- (void)behaviour_intercept_target:(double)delta_t;
676- (void)behaviour_attack_target:(double)delta_t;
677- (void)behaviour_attack_slow_dogfight:(double)delta_t;
678- (void)behaviour_evasive_action:(double)delta_t;
679- (void)behaviour_attack_break_off_target:(double)delta_t;
680- (void)behaviour_fly_to_target_six:(double)delta_t;
681- (void)behaviour_attack_mining_target:(double)delta_t;
682- (void)behaviour_attack_fly_to_target:(double)delta_t;
683- (void)behaviour_attack_fly_from_target:(double)delta_t;
684- (void)behaviour_running_defense:(double)delta_t;
685- (void)behaviour_flee_target:(double)delta_t;
686- (void)behaviour_attack_broadside:(double)delta_t;
687- (void)behaviour_attack_broadside_left:(double)delta_t;
688- (void)behaviour_attack_broadside_right:(double)delta_t;
689- (void)behaviour_close_to_broadside_range:(double)delta_t;
690- (void)behaviour_close_with_target:(double)delta_t;
691- (void)behaviour_attack_broadside_target:(double)delta_t leftside:(BOOL)leftside;
692- (void)behaviour_attack_sniper:(double)delta_t;
693- (void)behaviour_fly_range_from_destination:(double)delta_t;
694- (void)behaviour_face_destination:(double)delta_t;
695- (void)behaviour_land_on_planet:(double)delta_t;
696- (void)behaviour_formation_form_up:(double)delta_t;
697- (void)behaviour_fly_to_destination:(double)delta_t;
698- (void)behaviour_fly_from_destination:(double)delta_t;
699- (void)behaviour_avoid_collision:(double)delta_t;
700- (void)behaviour_track_as_turret:(double)delta_t;
701- (void)behaviour_fly_thru_navpoints:(double)delta_t;
702- (void)behaviour_scripted_ai:(double)delta_t;
703
705- (void)setReactionTime:(float)newReactionTime;
707- (void)startTrackingCurve;
708- (void)updateTrackingCurve;
710
711- (GLfloat*)scannerDisplayColorForShip:(ShipEntity*)otherShip isHostile:(BOOL)isHostile flash:(BOOL)flash scannerDisplayColor1:(OOColor*)scannerDisplayColor1 scannerDisplayColor2:(OOColor*)scannerDisplayColor2 scannerDisplayColorH1:(OOColor*)scannerDisplayColorH1 scannerDisplayColorH2:(OOColor*)scannerDisplayColorH2;
712- (void)setScannerDisplayColor1:(OOColor*)color1;
713- (void)setScannerDisplayColor2:(OOColor*)color2;
716- (void)setScannerDisplayColorHostile1:(OOColor*)color1;
717- (void)setScannerDisplayColorHostile2:(OOColor*)color2;
720
721- (BOOL)isCloaked;
722- (void)setCloaked:(BOOL)cloak;
723- (BOOL)hasAutoCloak;
724- (void)setAutoCloak:(BOOL)automatic;
725
726- (void)applyThrust:(double)delta_t;
727- (void)applyAttitudeChanges:(double)delta_t;
728
729- (void)avoidCollision;
731
732- (double)messageTime;
733- (void)setMessageTime:(double)value;
734
736- (void)setGroup:(OOShipGroup*)group;
737
739- (void)setEscortGroup:(OOShipGroup*)group; // Only for use in unconventional set-up situations.
740
741- (OOShipGroup*)stationGroup; // should probably be defined in stationEntity.m
742
743- (BOOL)hasEscorts;
744- (NSEnumerator*)escortEnumerator;
745- (NSArray*)escortArray;
746
747- (uint8_t)escortCount;
748
749// Pending escort count: number of escorts to set up "later".
750- (uint8_t)pendingEscortCount;
751- (void)setPendingEscortCount:(uint8_t)count;
752
753// allow adjustment of escort numbers from shipdata.plist levels
754- (uint8_t)maxEscortCount;
755- (void)setMaxEscortCount:(uint8_t)newCount;
756
757- (NSUInteger)turretCount;
758
759- (NSString*)name;
760- (NSString*)shipUniqueName;
761- (NSString*)shipClassName;
762- (NSString*)displayName;
763- (NSString*)scanDescription;
764- (NSString*)scanDescriptionForScripting;
765- (void)setName:(NSString*)inName;
766- (void)setShipUniqueName:(NSString*)inName;
767- (void)setShipClassName:(NSString*)inName;
768- (void)setDisplayName:(NSString*)inName;
769- (void)setScanDescription:(NSString*)inName;
770- (NSString*)identFromShip:(ShipEntity*)otherShip; // name displayed to other ships
771
772- (BOOL)hasRole:(NSString*)role;
774
775- (void)addRole:(NSString*)role;
776- (void)addRole:(NSString*)role withProbability:(float)probability;
777- (void)removeRole:(NSString*)role;
778
779- (NSString*)primaryRole;
780- (void)setPrimaryRole:(NSString*)role;
781- (BOOL)hasPrimaryRole:(NSString*)role;
782
783- (BOOL)isPolice; // Scan class is CLASS_POLICE
784- (BOOL)isThargoid; // Scan class is CLASS_THARGOID
785- (BOOL)isTrader; // Primary role is "trader" || isPlayer
786- (BOOL)isPirate; // Primary role is "pirate"
787- (BOOL)isMissile; // Primary role has suffix "MISSILE"
788- (BOOL)isMine; // Primary role has suffix "MINE"
789- (BOOL)isWeapon; // isMissile || isWeapon
790- (BOOL)isEscort; // Primary role is "escort" or "wingman"
791- (BOOL)isShuttle; // Primary role is "shuttle"
792- (BOOL)isTurret; // Behaviour is BEHAVIOUR_TRACK_AS_TURRET
793- (BOOL)isPirateVictim; // Primary role is listed in pirate-victim-roles.plist
794- (BOOL)isExplicitlyUnpiloted; // Has unpiloted = yes in its shipdata.plist entry
795- (BOOL)isUnpiloted; // Explicitly unpiloted, hulk, rock, cargo, debris etc; an open-ended criterion that may grow.
796
797- (OOAlertCondition)alertCondition; // quick calc for shaders
798- (OOAlertCondition)realAlertCondition; // full calculation for scripting
799- (BOOL)hasHostileTarget;
800- (BOOL)isHostileTo:(Entity*)entity;
801
802// defense target handling
803- (NSUInteger)defenseTargetCount;
804- (NSArray*)allDefenseTargets;
805- (NSEnumerator*)defenseTargetEnumerator;
807- (BOOL)addDefenseTarget:(Entity*)target;
808- (BOOL)isDefenseTarget:(Entity*)target;
809- (void)removeDefenseTarget:(Entity*)target;
811
812// collision exceptions
813- (NSArray*)collisionExceptions;
814- (void)addCollisionException:(ShipEntity*)ship;
815- (void)removeCollisionException:(ShipEntity*)ship;
816- (BOOL)collisionExceptedFor:(ShipEntity*)ship;
817
818- (GLfloat)weaponRange;
819- (void)setWeaponRange:(GLfloat)value;
820- (void)setWeaponDataFromType:(OOWeaponType)weapon_type;
821- (float)energyRechargeRate; // final rate after energy units
822- (float)weaponRechargeRate;
823- (void)setWeaponRechargeRate:(float)value;
824- (void)setWeaponEnergy:(float)value;
826
827- (GLfloat)scannerRange;
828- (void)setScannerRange:(GLfloat)value;
829
831- (void)setReference:(Vector)v;
832
834- (void)setReportAIMessages:(BOOL)yn;
835
837- (OOPlanetEntity*)findNearestPlanet;
838- (Entity<OOStellarBody>*)findNearestStellarBody; // NOTE: includes sun.
839- (OOPlanetEntity*)findNearestPlanetExcludingMoons;
841- (void)forceAegisCheck;
842- (BOOL)withinStationAegis;
843- (void)setLastAegisLock:(Entity<OOStellarBody>*)lastAegisLock;
844
847- (void)setHomeSystem:(OOSystemID)s;
848- (void)setDestinationSystem:(OOSystemID)s;
849
850- (NSArray*)crew;
851- (NSArray*)crewForScripting;
852- (void)setCrew:(NSArray*)crewArray;
857- (void)setSingleCrewWithRole:(NSString*)crewRole;
858
859// Fuel and capacity in tenths of light-years.
861- (void)setFuel:(OOFuelQuantity)amount;
863
864- (GLfloat)fuelChargeRate;
865
866- (void)setRoll:(double)amount;
867- (void)setRawRoll:(double)amount; // does not multiply by PI/2
868- (void)setPitch:(double)amount;
869- (void)setYaw:(double)amount;
870- (void)setThrust:(double)amount;
871- (void)applySticks:(double)delta_t;
872
873- (void)setThrustForDemo:(float)factor;
874
875/*
876 Sets the bounty on this ship to amount.
877 Does not check to see if the ship is allowed to have a bounty, for example if it is police.
878 */
879- (void)setBounty:(OOCreditsQuantity)amount;
880- (void)setBounty:(OOCreditsQuantity)amount withReason:(OOLegalStatusReason)reason;
881- (void)setBounty:(OOCreditsQuantity)amount withReasonAsString:(NSString*)reason;
883
885
886- (BOOL)isTemplateCargoPod;
887- (void)setUpCargoType:(NSString*)cargoString;
888- (void)setCommodity:(OOCommodityType)co_type andAmount:(OOCargoQuantity)co_amount;
889- (void)setCommodityForPod:(OOCommodityType)co_type andAmount:(OOCargoQuantity)co_amount;
892
894- (void)setMaxAvailableCargoSpace:(OOCargoQuantity)new;
898- (NSArray*)cargoListForScripting;
899- (NSMutableArray*)cargo;
900- (void)setCargo:(NSArray*)some_cargo;
901- (BOOL)addCargo:(NSArray*)some_cargo;
902- (BOOL)removeCargo:(OOCommodityType)commodity amount:(OOCargoQuantity)amount;
903- (BOOL)showScoopMessage;
904
905- (NSArray*)passengerListForScripting;
906- (NSArray*)parcelListForScripting;
907- (NSArray*)contractListForScripting;
908- (NSArray*)equipmentListForScripting;
909- (OOWeaponType)weaponTypeIDForFacing:(OOWeaponFacing)facing strict:(BOOL)strict;
910- (OOEquipmentType*)weaponTypeForFacing:(OOWeaponFacing)facing strict:(BOOL)strict;
911- (NSArray*)missilesList;
912
914- (void)setCargoFlag:(OOCargoFlag)flag;
915
916- (void)setSpeed:(double)amount;
917- (double)desiredSpeed;
918- (void)setDesiredSpeed:(double)amount;
919- (double)desiredRange;
920- (void)setDesiredRange:(double)amount;
921
922- (double)cruiseSpeed;
923
925- (void)setTotalVelocity:(Vector)vel; // Set velocity to vel - thrustVector, effectively setting the instanteneous velocity to vel.
926
927- (void)increase_flight_speed:(double)delta;
928- (void)decrease_flight_speed:(double)delta;
929- (void)increase_flight_roll:(double)delta;
930- (void)decrease_flight_roll:(double)delta;
931- (void)increase_flight_pitch:(double)delta;
932- (void)decrease_flight_pitch:(double)delta;
933- (void)increase_flight_yaw:(double)delta;
934- (void)decrease_flight_yaw:(double)delta;
935
936- (GLfloat)flightRoll;
937- (GLfloat)flightPitch;
938- (GLfloat)flightYaw;
939- (GLfloat)flightSpeed;
940- (GLfloat)maxFlightPitch;
941- (GLfloat)maxFlightSpeed;
942- (GLfloat)maxFlightRoll;
943- (GLfloat)maxFlightYaw;
944- (GLfloat)speedFactor;
945
946- (GLfloat)temperature;
947- (void)setTemperature:(GLfloat)value;
948- (GLfloat)heatInsulation;
949- (void)setHeatInsulation:(GLfloat)value;
950
952- (float)randomEjectaTemperatureWithMaxFactor:(float)factor;
953
954// the percentage of damage taken (100 is destroyed, 0 is fine)
955- (int)damage;
956
957- (void)dealEnergyDamage:(GLfloat)baseDamage atRange:(GLfloat)range withBias:(GLfloat)velocityBias;
959- (void)dealMomentumWithinDesiredRange:(double)amount;
960
961// Dispatch shipTakingDamage() event.
962- (void)noteTakingDamage:(double)amount from:(Entity*)entity type:(OOShipDamageType)type;
963// Dispatch shipDied() and possibly shipKilledOther() events. This is only for use by getDestroyedBy:damageType:, but needs to be visible to PlayerEntity's version.
964- (void)noteKilledBy:(Entity*)whom damageType:(OOShipDamageType)type;
965
966- (void)getDestroyedBy:(Entity*)whom damageType:(OOShipDamageType)type;
967- (void)becomeExplosion;
968- (void)becomeLargeExplosion:(double)factor;
969- (void)becomeEnergyBlast;
971- (void)setIsWreckage:(BOOL)isw;
972- (BOOL)showDamage;
973
974- (Vector)positionOffsetForAlignment:(NSString*)align;
976
977- (void)collectBountyFor:(ShipEntity*)other;
978
980
982
983- (GLfloat)weaponRecoveryTime;
984- (GLfloat)laserHeatLevel;
985- (GLfloat)laserHeatLevelAft;
986- (GLfloat)laserHeatLevelForward;
987- (GLfloat)laserHeatLevelPort;
988- (GLfloat)laserHeatLevelStarboard;
989- (GLfloat)hullHeatLevel;
990- (GLfloat)entityPersonality;
991- (GLint)entityPersonalityInt;
992- (void)setEntityPersonalityInt:(uint16_t)value;
993
994- (void)setSuppressExplosion:(BOOL)suppress;
995
996- (void)resetExhaustPlumes;
997
998- (void)removeExhaust:(OOExhaustPlumeEntity*)exhaust;
999- (void)removeFlasher:(OOFlasherEntity*)flasher;
1000
1001/*-----------------------------------------
1002
1003 AI piloting methods
1004
1005 -----------------------------------------*/
1006
1007- (void)checkScanner;
1011
1018- (void)setFoundTarget:(Entity*)targetEntity;
1019- (void)setPrimaryAggressor:(Entity*)targetEntity;
1020- (void)setLastEscortTarget:(Entity*)targetEntity;
1021- (void)setThankedShip:(Entity*)targetEntity;
1022- (void)setRememberedShip:(Entity*)targetEntity;
1023- (void)setProximityAlert:(ShipEntity*)targetEntity;
1024- (void)setTargetStation:(Entity*)targetEntity;
1025- (BOOL)isValidTarget:(Entity*)target;
1026- (void)addTarget:(Entity*)targetEntity;
1027- (void)removeTarget:(Entity*)targetEntity;
1029- (id)primaryTarget;
1032
1033- (BOOL)isFriendlyTo:(ShipEntity*)otherShip;
1034
1036
1037- (void)noteLostTarget;
1039- (void)noteTargetDestroyed:(ShipEntity*)target;
1040
1042- (void)setBehaviour:(OOBehaviour)cond;
1043
1044- (void)trackOntoTarget:(double)delta_t withDForward:(GLfloat)dp;
1045
1046- (double)ballTrackLeadingTarget:(double)delta_t atTarget:(Entity*)target;
1047
1048- (GLfloat)rollToMatchUp:(Vector)up_vec rotating:(GLfloat)match_roll;
1049
1050- (GLfloat)rangeToDestination;
1051- (double)trackDestination:(double)delta_t retreat:(BOOL)retreat;
1052
1053- (void)setCoordinate:(HPVector)coord;
1056- (HPVector)distance_six:(GLfloat)dist;
1057- (HPVector)distance_twelve:(GLfloat)dist withOffset:(GLfloat)offset;
1058
1059- (void)setEvasiveJink:(GLfloat)z;
1060- (void)evasiveAction:(double)delta_t;
1061- (double)trackPrimaryTarget:(double)delta_t retreat:(BOOL)retreat;
1062- (double)trackSideTarget:(double)delta_t leftside:(BOOL)leftside;
1063- (double)missileTrackPrimaryTarget:(double)delta_t;
1064
1065// return 0.0 if there is no primary target
1066- (double)rangeToPrimaryTarget;
1068- (double)rangeToSecondaryTarget:(Entity*)target;
1069- (BOOL)hasProximityAlertIgnoringTarget:(BOOL)ignore_target;
1070- (GLfloat)currentAimTolerance;
1071/* This method returns a value between 0.0f and 1.0f, depending on how directly our view point
1072 faces the sun and is used for generating the "staring at the sun" glare effect. 0.0f means that
1073 we are not facing the sun, 1.0f means that we are looking directly at it. The cosine of the
1074 threshold angle between view point and sun, below which we consider the ship as looking
1075 at the sun, is passed as parameter to the method.
1076*/
1077- (GLfloat)lookingAtSunWithThresholdAngleCos:(GLfloat)thresholdAngleCos;
1078
1079- (BOOL)onTarget:(OOWeaponFacing)direction withWeapon:(OOWeaponType)weapon;
1080
1082- (void)resetShotTime;
1083
1084- (BOOL)fireMainWeapon:(double)range;
1085- (BOOL)fireAftWeapon:(double)range;
1086- (BOOL)firePortWeapon:(double)range;
1087- (BOOL)fireStarboardWeapon:(double)range;
1088- (BOOL)fireTurretCannon:(double)range;
1089- (void)setLaserColor:(OOColor*)color;
1090- (void)setExhaustEmissiveColor:(OOColor*)color;
1093- (BOOL)fireSubentityLaserShot:(double)range;
1094- (BOOL)fireDirectLaserShot:(double)range;
1096- (BOOL)fireDirectLaserShotAt:(Entity*)my_target;
1097- (NSArray*)laserPortOffset:(OOWeaponFacing)direction;
1098- (BOOL)fireLaserShotInDirection:(OOWeaponFacing)direction weaponIdentifier:(NSString*)weaponIdentifier;
1099- (void)adjustMissedShots:(int)delta;
1100- (int)missedShots;
1101- (void)considerFiringMissile:(double)delta_t;
1104- (ShipEntity*)fireMissileWithIdentifier:(NSString*)identifier andTarget:(Entity*)target;
1105- (BOOL)isMissileFlagSet;
1106- (void)setIsMissileFlag:(BOOL)newValue;
1108- (void)setMissileLoadTime:(OOTimeDelta)newMissileLoadTime;
1109- (void)noticeECM;
1110- (BOOL)fireECM;
1111- (BOOL)cascadeIfAppropriateWithDamageAmount:(double)amount cascadeOwner:(Entity*)owner;
1114- (BOOL)launchCascadeMine;
1117- (ShipEntity*)dumpCargoItem:(OOCommodityType)preferred;
1118- (OOCargoType)dumpItem:(ShipEntity*)jetto;
1119
1120- (void)manageCollisions;
1121- (BOOL)collideWithShip:(ShipEntity*)other;
1122- (void)adjustVelocity:(Vector)xVel;
1123- (void)addImpactMoment:(Vector)moment fraction:(GLfloat)howmuch;
1124- (BOOL)canScoop:(ShipEntity*)other;
1125- (void)getTractoredBy:(ShipEntity*)other;
1126- (void)scoopIn:(ShipEntity*)other;
1127- (void)scoopUp:(ShipEntity*)other;
1128- (void)scoopUpProcess:(ShipEntity*)other processEvents:(BOOL)proc_events processMessages:(BOOL)proc_messages;
1129
1130- (BOOL)abandonShip;
1131
1132- (void)takeScrapeDamage:(double)amount from:(Entity*)ent;
1133- (void)takeHeatDamage:(double)amount;
1134
1135- (void)enterDock:(StationEntity*)station;
1136- (void)leaveDock:(StationEntity*)station;
1137
1138- (void)enterWormhole:(WormholeEntity*)w_hole;
1139- (void)enterWormhole:(WormholeEntity*)w_hole replacing:(BOOL)replacing;
1140- (void)enterWitchspace;
1141- (void)leaveWitchspace;
1143
1144/*
1145 Mark this ship as an offender, this is different to setBounty as some ships such as police
1146 are not markable. The final bounty may not be equal to existing bounty plus offence_value.
1147 */
1148- (void)markAsOffender:(int)offence_value;
1149- (void)markAsOffender:(int)offence_value withReason:(OOLegalStatusReason)reason;
1150
1151- (void)switchLightsOn;
1152- (void)switchLightsOff;
1153- (BOOL)lightsActive;
1154
1155- (void)setDestination:(HPVector)dest;
1156- (void)setEscortDestination:(HPVector)dest;
1157
1158- (BOOL)canAcceptEscort:(ShipEntity*)potentialEscort;
1159- (BOOL)acceptAsEscort:(ShipEntity*)other_ship;
1160- (void)deployEscorts;
1161- (void)dockEscorts;
1162
1166
1167- (void)landOnPlanet:(OOPlanetEntity*)planet;
1168
1169- (void)abortDocking;
1170- (NSDictionary*)dockingInstructions;
1171
1173
1174- (void)broadcastHitByLaserFrom:(ShipEntity*)aggressor_ship;
1175
1176// Sun glare filter - 0 for no filter, 1 for full filter
1178- (void)setSunGlareFilter:(GLfloat)newValue;
1179
1180// Unpiloted ships cannot broadcast messages, unless the unpilotedOverride is set to YES.
1181- (void)sendExpandedMessage:(NSString*)message_text toShip:(ShipEntity*)other_ship;
1182- (void)sendMessage:(NSString*)message_text toShip:(ShipEntity*)other_ship withUnpilotedOverride:(BOOL)unpilotedOverride;
1183- (void)broadcastAIMessage:(NSString*)ai_message;
1184- (void)broadcastMessage:(NSString*)message_text withUnpilotedOverride:(BOOL)unpilotedOverride;
1185- (void)setCommsMessageColor;
1186- (void)receiveCommsMessage:(NSString*)message_text from:(ShipEntity*)other;
1187- (void)commsMessage:(NSString*)valueString withUnpilotedOverride:(BOOL)unpilotedOverride;
1188
1189- (BOOL)markedForFines;
1190- (BOOL)markForFines;
1191
1192- (BOOL)isMining;
1193
1194- (void)spawn:(NSString*)roles_number;
1195
1197
1199- (void)setTrackCloseContacts:(BOOL)value;
1200
1201/*
1202 * Changes a ship to a hulk, for example when the pilot ejects.
1203 * Aso unsets hulkiness for example when a new pilot gets in.
1204 */
1205- (void)setHulk:(BOOL)isNowHulk;
1206- (BOOL)isHulk;
1207#if OO_SALVAGE_SUPPORT
1208- (void)claimAsSalvage;
1209- (void)sendCoordinatesToPilot;
1210- (void)pilotArrived;
1211#endif
1212
1214- (NSDictionary*)scriptInfo;
1215- (void)overrideScriptInfo:(NSDictionary*)override; // Add items from override (if not nil) to scriptInfo, replacing in case of duplicates. Used for subentities.
1216
1217- (BOOL)scriptedMisjump;
1218- (void)setScriptedMisjump:(BOOL)newValue;
1219- (GLfloat)scriptedMisjumpRange;
1220- (void)setScriptedMisjumpRange:(GLfloat)newValue;
1221
1223
1224// Demo ship
1225- (void)setDemoShip:(OOScalar)demoRate;
1227- (void)setDemoStartTime:(OOTimeAbsolute)time;
1228
1229/* *** Script events.
1230 For NPC ships, these call doEvent: on the ship script.
1231 For the player, they do that and also call doWorldScriptEvent:.
1232*/
1233- (void)doScriptEvent:(OOJSPropID)message;
1234- (void)doScriptEvent:(OOJSPropID)message withArgument:(id)argument;
1235- (void)doScriptEvent:(OOJSPropID)message withArgument:(id)argument1 andArgument:(id)argument2;
1236- (void)doScriptEvent:(OOJSPropID)message withArguments:(NSArray*)arguments;
1237// argv is borrowed: with QuickJS, the caller remains responsible for freeing the values.
1238#if OOJS_QUICKJS
1239- (void)doScriptEvent:(OOJSPropID)message withArguments:(JSValue*)argv count:(int)argc;
1240- (void)doScriptEvent:(OOJSPropID)message inContext:(JSContext*)context withArguments:(JSValue*)argv count:(int)argc;
1241#else
1242- (void)doScriptEvent:(OOJSPropID)message withArguments:(jsval*)argv count:(int)argc;
1243- (void)doScriptEvent:(OOJSPropID)message inContext:(JSContext*)context withArguments:(jsval*)argv count:(int)argc;
1244#endif
1245
1246/* Convenience to send an event with raw JS values, for example:
1247 ShipScriptEvent(context, ship, "doSomething", OOJSValueFromDouble(context, 42));
1248 The argument values are owned by the macro, which frees them (with
1249 OOJSFreeValue()) after the event has been sent, so they must be fresh
1250 values that are not used again afterwards.
1251*/
1252#define ShipScriptEvent(context, ship, event, ...) \
1253 do { \
1254 OOJSVal argv[] = { __VA_ARGS__ }; \
1255 int argc = sizeof argv / sizeof *argv; \
1256 [ship doScriptEvent:OOJSID(event) inContext:context withArguments:argv count:argc]; \
1257 for (int oojsArgIndex = 0; oojsArgIndex < argc; oojsArgIndex++) { \
1258 OOJSFreeValue(context, argv[oojsArgIndex]); \
1259 } \
1260 } while (0)
1261
1262#define ShipScriptEventNoCx(ship, event, ...) \
1263 do { \
1264 JSContext* oojsEventContext = OOJSAcquireContext(); \
1265 ShipScriptEvent(oojsEventContext, ship, event, ##__VA_ARGS__); \
1266 OOJSRelinquishContext(oojsEventContext); \
1267 } while (0)
1268
1269- (void)reactToAIMessage:(NSString*)message context:(NSString*)debugContext; // Immediate message
1270- (void)sendAIMessage:(NSString*)message; // Queued message
1271- (void)doScriptEvent:(OOJSPropID)scriptEvent andReactToAIMessage:(NSString*)aiMessage;
1272- (void)doScriptEvent:(OOJSPropID)scriptEvent withArgument:(id)argument andReactToAIMessage:(NSString*)aiMessage;
1273
1274@end
1275
1276#ifdef OO_DEBUG_MONITOR_ENABLED
1277@interface ShipEntity (Debug)
1278
1279- (OOShipGroup*)rawEscortGroup;
1280
1281@end
1282#endif
1283
1284@interface Entity (SubEntityRelationship)
1285
1286/* For the common case of testing whether foo is a ship, bar is a ship, bar
1287 is a subentity of foo and this relationship is represented sanely.
1288*/
1289- (BOOL)isShipWithSubEntityShip:(Entity*)other;
1290
1291@end
1292
1293NSDictionary* OODefaultShipShaderMacros(void);
1294
1295GLfloat getWeaponRangeFromType(OOWeaponType weapon_type);
1296
1297// Defined in OOConstToString.m
1298NSString* OOStringFromBehaviour(OOBehaviour behaviour) CONST_FUNC;
1299
1300// Weapon strings prefixed with EQ_, used in shipyard.plist.
1302OOWeaponType OOWeaponTypeFromEquipmentIdentifierSloppy(NSString* string) PURE_FUNC; // Uses suffix match for backwards compatibility.
1305
1308
1309BOOL isWeaponNone(OOWeaponType weapon);
1310
1311NSString* OODisplayStringFromAlertCondition(OOAlertCondition alertCondition);
1312
#define PURE_FUNC
#define CONST_FUNC
jsid OOJSPropID
Definition OOJSPropID.h:31
GLfloat OOScalar
Definition OOMaths.h:49
uint16_t OOFuelQuantity
Definition OOTypes.h:158
uint8_t OOWeaponFacingSet
Definition OOTypes.h:204
NSString * OOCommodityType
Definition OOTypes.h:97
OOAegisStatus
Definition OOTypes.h:53
OOLegalStatusReason
Definition OOTypes.h:139
uint64_t OOCreditsQuantity
Definition OOTypes.h:160
uint16_t OOUniversalID
Definition OOTypes.h:165
int16_t OOSystemID
Definition OOTypes.h:183
OOCargoType
Definition OOTypes.h:60
uint32_t OOCargoQuantity
Definition OOTypes.h:155
double OOTimeDelta
Definition OOTypes.h:193
OOCargoFlag
Definition OOTypes.h:99
double OOTimeAbsolute
Definition OOTypes.h:192
OOWeaponFacing
Definition OOTypes.h:195
OOEquipmentType * OOWeaponType
Definition ShipEntity.h:164
BOOL isWeaponNone(OOWeaponType weapon)
OOAlertCondition
Definition ShipEntity.h:166
@ ALERT_CONDITION_GREEN
Definition ShipEntity.h:170
@ ALERT_CONDITION_RED
Definition ShipEntity.h:172
@ ALERT_CONDITION_YELLOW
Definition ShipEntity.h:171
@ ALERT_CONDITION_DOCKED
Definition ShipEntity.h:169
OOWeaponType OOWeaponTypeFromEquipmentIdentifierStrict(NSString *string) PURE_FUNC
OOWeaponType OOWeaponTypeFromEquipmentIdentifierLegacy(NSString *string)
NSDictionary * OODefaultShipShaderMacros(void)
GLfloat getWeaponRangeFromType(OOWeaponType weapon_type)
NSString * OOStringFromShipDamageType(OOShipDamageType type) CONST_FUNC
OOBehaviour
Definition ShipEntity.h:147
NSString * OOStringFromWeaponType(OOWeaponType weapon) CONST_FUNC
NSString * OOEquipmentIdentifierFromWeaponType(OOWeaponType weapon) CONST_FUNC
NSString * OODisplayStringFromAlertCondition(OOAlertCondition alertCondition)
NSString * OOStringFromBehaviour(OOBehaviour behaviour) CONST_FUNC
OOWeaponType OOWeaponTypeFromEquipmentIdentifierSloppy(NSString *string) PURE_FUNC
OOShipDamageType
Definition ShipEntity.h:175
@ kOOShipDamageTypeDefault
Definition ShipEntity.h:180
OOWeaponType OOWeaponTypeFromString(NSString *string) PURE_FUNC
Definition AI.h:35
void landOnPlanet()
OOWeaponFacingSet weapon_facings
Definition ShipEntity.h:293
BOOL isExplicitlyUnpiloted()
BOOL suppressFlightNotifications()
OOTimeAbsolute last_shot_time
Definition ShipEntity.h:348
GLfloat laserHeatLevelAft()
OOCargoQuantity commodity_amount
Definition ShipEntity.h:353
Vector positionOffsetForShipInRotationToAlignment(ShipEntity *ship, Quaternion q, NSString *align)
void setCommsMessageColor()
BOOL hasScoop()
unsigned suppressExplosion
Definition ShipEntity.h:260
Entity * rememberedShip()
NSUInteger passengerCount()
GLfloat weapon_damage
Definition ShipEntity.h:298
OOWeakReference * _targetStation
Definition ShipEntity.h:427
Vector forwardVector()
void enterWitchspace()
unsigned trackCloseContacts
double launch_delay
Definition ShipEntity.h:334
double next_spark_time
Definition ShipEntity.h:373
NSUInteger turretCount()
BOOL canStillTrackPrimaryTarget()
OOColor * laser_color
Definition ShipEntity.h:218
Vector tractor_position
Definition ShipEntity.h:395
unsigned noRocks
Definition ShipEntity.h:270
OOCargoFlag cargo_flag
Definition ShipEntity.h:288
OOCommodityType commodity_type
Definition ShipEntity.h:352
BOOL hasMilitaryJammer()
HPVector absoluteTractorPosition()
NSMutableArray * cargo
void noteLostTarget()
void resumePostProximityAlert()
unsigned isMissile
BOOL isPirate()
OOEquipmentType * selectMissile()
unsigned _lightsActive
Definition ShipEntity.h:271
GLfloat currentAimTolerance()
void transitionToAegisNone()
OOTimeAbsolute aiScriptWakeTime
Definition ShipEntity.h:213
BOOL markForFines()
OOWeakReference * _shipHitByLaser
Definition ShipEntity.h:467
float maxThrust()
Vector v_forward
Definition ShipEntity.h:189
float shieldBoostFactor()
unsigned haveStartedJSAI
Definition ShipEntity.h:269
void setUpEscorts()
int _missed_shots
Definition ShipEntity.h:365
NSArray * allDefenseTargets()
float weaponRechargeRate()
Vector upVector()
id primaryTargetWithoutValidityCheck()
GLfloat pitch_tolerance
Definition ShipEntity.h:363
NSUInteger defenseTargetCount()
ShipEntity ** scannedShips()
GLfloat stick_pitch
Definition ShipEntity.h:198
NSDictionary * shipInfoDictionary()
BOOL markedForFines()
void setTargetToSystemStation()
float hyperspaceSpinTime()
unsigned rolling_over
Definition ShipEntity.h:243
NSUInteger passengerCapacity()
NSDictionary * scriptInfo
OOColor * scanner_display_color_hostile2
Definition ShipEntity.h:224
BOOL hasAutoWeapons()
GLfloat scriptedMisjumpRange()
OOTimeAbsolute cargo_dump_time
Definition ShipEntity.h:347
void calculateTrackingCurve()
BOOL hasEscorts()
BOOL _escortPositionsValid
Definition ShipEntity.h:458
NSArray * contractListForScripting()
GLfloat frustration
OOWeakReference * _thankedShip
Definition ShipEntity.h:430
OOSystemID destination_system
Definition ShipEntity.h:369
OOWeakReference * _rememberedShip
Definition ShipEntity.h:431
unsigned reportAIMessages
OOWeaponFacing currentWeaponFacing
void manageCollisions()
unsigned isNearPlanetSurface
Definition ShipEntity.h:252
GLfloat rangeToDestination()
unsigned hasScoopMessage
Definition ShipEntity.h:264
OOTimeAbsolute trackingCurveTimes[4]
Definition ShipEntity.h:439
NSDictionary * dockingInstructions
GLfloat weapon_damage_override
Definition ShipEntity.h:299
NSUInteger equipmentCount()
GLfloat maxFlightRoll()
GLfloat weaponRange
void broadcastEnergyBlastImminent()
int numberOfScannedShips()
void forceAegisCheck()
BOOL isWeapon()
GLfloat weapon_energy_use
Definition ShipEntity.h:303
uint8_t _maxEscortCount
Definition ShipEntity.h:454
BOOL witchspaceLeavingEffects()
GLfloat afterburner_speed_factor
Definition ShipEntity.h:281
GLfloat aft_weapon_temp
Definition ShipEntity.h:304
ShipEntity * scanned_ships[MAX_SCAN_NUMBER+1]
Definition ShipEntity.h:401
unsigned isFrangible
OOAlertCondition alertCondition()
GLfloat _scriptedMisjumpRange
Definition ShipEntity.h:273
GLfloat max_flight_pitch
Definition ShipEntity.h:230
Vector jink
Definition ShipEntity.h:327
NSDictionary * shipinfoDictionary
Definition ShipEntity.h:206
ShipEntity * subEntityTakingDamage()
unsigned _showDamage
Definition ShipEntity.h:259
void broadcastThargoidDestroyed()
BOOL hasFuelScoop()
unsigned isWreckage
Definition ShipEntity.h:258
BOOL hasFuelInjection()
OOShipGroup * escortGroup()
BOOL hasMilitaryShieldEnhancer()
void switchLightsOn()
NSEnumerator * escortEnumerator()
unsigned suppressAegisMessages
Definition ShipEntity.h:261
NSString * shipDataKey()
NSMutableArray * _equipment
Definition ShipEntity.h:447
int checkShipsInVicinityForWitchJumpExit()
NSUInteger subIdx()
Definition ShipEntity.m:729
NSUInteger missileCount()
OORoleSet * roleSet
NSString * primaryRole
GLfloat laserHeatLevelStarboard()
GLfloat port_weapon_temp
Definition ShipEntity.h:304
NSString * _missileRole
Definition ShipEntity.h:310
OOColor * scanner_display_color2
Definition ShipEntity.h:222
OOShipGroup * group()
OOCargoQuantity availableCargoSpace()
unsigned cloakAutomatic
Definition ShipEntity.h:256
unsigned missiles
Definition ShipEntity.h:308
float reactionTime
OOWeakReference * _subEntityTakingDamage
Definition ShipEntity.h:443
OOWeakReference * _primaryAggressor
Definition ShipEntity.h:426
OOCargoFlag cargoFlag()
BOOL abandonShip()
unsigned number_of_navpoints
Definition ShipEntity.h:408
OOColor * scannerDisplayColor2()
unsigned being_fined
Definition ShipEntity.h:248
double desiredRange()
NSString * name
uint8_t maxEscortCount()
unsigned max_missiles
Definition ShipEntity.h:309
float maxForwardShieldLevel()
HPVector _destination
Definition ShipEntity.h:192
BOOL isTrader()
GLfloat stick_yaw
Definition ShipEntity.h:199
NSArray * portWeaponOffset
Quaternion subentityRotationalVelocity
Definition ShipEntity.h:208
float hyperspaceMotorSpinTime
Definition ShipEntity.h:236
BOOL isTurret()
BOOL fireDirectLaserDefensiveShot()
GLint entityPersonalityInt()
OOShipGroup * stationGroup()
NSString * shipClassName
GLfloat flightPitch
BOOL isPolice()
Entity * primaryAggressor()
OOTimeDelta missile_load_time
Definition ShipEntity.h:311
OOShipGroup * _group
Definition ShipEntity.h:452
GLfloat flightSpeed
void validateDefenseTargets()
OOCargoType cargoType()
NSArray * equipmentListForScripting()
OOWeakSet * _collisionExceptions
Definition ShipEntity.h:463
void deployEscorts()
OOWeaponType aft_weapon_type
Definition ShipEntity.h:295
void deactivateCloakingDevice()
BOOL countsAsKill()
BoundingBox totalBoundingBox
Vector v_up
Definition ShipEntity.h:189
Entity * entityForShaderProperties()
OOUniversalID planetForLanding
Definition ShipEntity.h:335
OOCreditsQuantity removeMissiles()
OOWeakReference * _lastAegisLock
Definition ShipEntity.h:450
NSString * scanDescription()
BOOL isPirateVictim()
OOWeakReference * _lastEscortTarget
Definition ShipEntity.h:429
NSEnumerator * defenseTargetEnumerator()
NSMutableDictionary * previousCondition
Definition ShipEntity.h:342
void updateTrackingCurve()
GLfloat _scaleFactor
Definition ShipEntity.h:377
OOWeakReference * _primaryTarget
Definition ShipEntity.h:425
NSArray * starboardWeaponOffset
void setTargetToNearestFriendlyStation()
Entity * thankedShip()
GLfloat desired_range
Definition ShipEntity.h:194
BOOL activateCloakingDevice()
NSEnumerator * equipmentEnumerator()
HPVector coordinates
GLfloat temperature()
void abortDocking()
OOTimeDelta shotTime()
void resetExhaustPlumes()
OOFuelQuantity fuel
OOFuelQuantity fuelCapacity()
float shieldRechargeRate()
OOEquipmentType * missile_list[SHIPENTITY_MAX_MISSILES]
Definition ShipEntity.h:422
BOOL hasHeatShield()
NSArray * escortArray()
OOCreditsQuantity bounty
id< OOHUDBeaconIcon > _beaconDrawable
Definition ShipEntity.h:474
NSArray * parcelListForScripting()
HPVector calculateTargetPosition()
OOAegisStatus aegis_status
Definition ShipEntity.h:367
void checkScannerIgnoringUnpowered()
BOOL hasMilitaryScannerFilter()
NSArray * cargoListForScripting()
NSEnumerator * flasherEnumerator()
Entity * proximityAlert()
NSMutableDictionary * closeContactsInfo
Definition ShipEntity.h:390
NSString * scan_description
Definition ShipEntity.h:320
StationEntity * targetStation()
GLfloat sunGlareFilter
BOOL hasEscapePod()
void leaveWitchspace()
GLfloat distance2_scanned_ships[MAX_SCAN_NUMBER+1]
Definition ShipEntity.h:402
uint16_t entity_personality
Definition ShipEntity.h:418
NSString * serializeShipSubEntities()
Definition ShipEntity.m:753
OOWeakReference * _proximityAlert
Definition ShipEntity.h:432
OOAlertCondition realAlertCondition()
OOTimeAbsolute missile_launch_time
Definition ShipEntity.h:312
GLfloat accuracy
GLfloat forward_weapon_temp
Definition ShipEntity.h:304
void removeAllEquipment()
double desiredSpeed()
ShipEntity * fireMissile()
NSString * shipUniqueName
unsigned being_mined
Definition ShipEntity.h:246
OOCargoQuantity likely_cargo
Definition ShipEntity.h:283
OOTimeDelta missileLoadTime()
NSString * scanDescriptionForScripting()
NSUInteger missileCapacity()
OOColor * exhaust_emissive_color
Definition ShipEntity.h:220
void dealEnergyDamageWithinDesiredRange()
Vector reference
double approachAspectToPrimaryTarget()
OOSystemID home_system
Definition ShipEntity.h:368
Vector _escortPositions[MAX_ESCORTS]
Definition ShipEntity.h:457
GLfloat thrust
OOPlanetEntity * findNearestPlanet()
OOCommodityType dumpCargo()
GLfloat starboard_weapon_temp
Definition ShipEntity.h:304
BOOL hasCascadeMine()
OOTimeDelta shot_time
Definition ShipEntity.h:186
OOColor * scannerDisplayColorHostile2()
HPVector navpoints[32]
Definition ShipEntity.h:406
float energyRechargeRate()
NSArray * missilesList()
OOCargoType cargo_type
Definition ShipEntity.h:287
GLfloat stick_roll
Definition ShipEntity.h:197
BOOL isUnpiloted()
BOOL isTemplateCargoPod()
Definition ShipEntity.m:932
ShipEntity * launchEscapeCapsule()
NSEnumerator * shipSubEntityEnumerator()
void switchLightsOff()
unsigned pitching_over
Definition ShipEntity.h:242
BOOL hasDockingComputer()
void dockEscorts()
GLfloat speedFactor()
Vector missileLaunchPosition()
NSEnumerator * exhaustEnumerator()
NSUInteger _subIdx
Definition ShipEntity.h:331
BOOL isMissileFlagSet()
NSArray * aftWeaponOffset
BOOL isShuttle()
NSArray * forwardWeaponOffset
Entity< OOStellarBody > * findNearestStellarBody()
float maxAftShieldLevel()
OOColor * scanner_display_color1
Definition ShipEntity.h:221
int legalStatus()
float afterburnerRate()
NSArray * passengerListForScripting()
NSArray * collisionExceptions()
OOWeaponFacingSet weaponFacings()
HPVector destination()
NSEnumerator * subEntityEnumerator()
GLfloat weapon_temp
Definition ShipEntity.h:303
BOOL hasShieldBooster()
float randomEjectaTemperature()
OOBehaviour behaviour
unsigned cloakPassive
float _heatInsulation
Definition ShipEntity.h:448
OOWeaponType starboard_weapon_type
Definition ShipEntity.h:297
OOJSScript * script
NSUInteger parcelCount()
unsigned scripted_misjump
Definition ShipEntity.h:267
OOColor * scannerDisplayColorHostile1()
float ship_temperature
Definition ShipEntity.h:398
void removeAllDefenseTargets()
BOOL hasGalacticHyperdrive()
BOOL launchCascadeMine()
GLfloat heatInsulation()
OOColor * exhaustEmissiveColor()
GLfloat aim_tolerance
Definition ShipEntity.h:364
uint8_t escortCount()
OOTimeAbsolute demoStartTime
Definition ShipEntity.h:481
void updateEscortFormation()
BOOL hasHostileTarget()
unsigned military_jammer_active
Definition ShipEntity.h:238
BOOL hasCargoScoop()
void clearSubEntities()
OOCargoQuantity commodityAmount()
GLfloat weapon_shot_temperature
Definition ShipEntity.h:303
void noteLostTargetAndGoIdle()
GLfloat max_flight_yaw
Definition ShipEntity.h:231
BOOL isMinable()
GLfloat energy_recharge_rate
Definition ShipEntity.h:291
NSUInteger extraCargo()
OOCargoQuantity maxAvailableCargoSpace()
OOColor * default_laser_color
Definition ShipEntity.h:219
double launch_time
Definition ShipEntity.h:333
float weapon_recharge_rate
Definition ShipEntity.h:345
uint8_t pendingEscortCount()
GLfloat laserHeatLevel()
BOOL setUpSubEntities()
Definition ShipEntity.m:790
GLfloat max_thrust
Definition ShipEntity.h:234
OOSystemID destinationSystem()
ShipEntity * shipHitByLaser()
Quaternion subEntityRotationalVelocity()
OOShipGroup * _escortGroup
Definition ShipEntity.h:453
GLfloat max_flight_roll
Definition ShipEntity.h:229
void checkScanner()
HPVector trackingCurveCoeffs[3]
Definition ShipEntity.h:440
GLfloat laserHeatLevelPort()
int patrol_counter
Definition ShipEntity.h:340
float afterburnerFactor()
BOOL _multiplyWeapons
Definition ShipEntity.h:379
int shot_counter
Definition ShipEntity.h:346
void resetShotTime()
GLfloat afterburner_rate
Definition ShipEntity.h:280
GLfloat desired_speed
Definition ShipEntity.h:195
double messageTime
NSString * _beaconCode
Definition ShipEntity.h:470
BOOL hasAutoCloak()
float volume()
NSArray * crewForScripting()
OOWeaponType port_weapon_type
Definition ShipEntity.h:296
BOOL lightsActive()
double maxHyperspaceDistance()
OOCargoQuantity max_cargo
Definition ShipEntity.h:284
OOColor * laserColor()
NSUInteger maxShipSubEntities()
Definition ShipEntity.m:734
Vector thrustVector()
Octree * octree
NSUInteger subEntityCount()
BOOL isBoulder()
GLfloat maxFlightYaw()
NSString * shipDataKeyAutoRole()
BOOL hasHyperspaceMotor()
uint8_t _pendingEscortCount
Definition ShipEntity.h:455
unsigned canFragment
Definition ShipEntity.h:257
OOAegisStatus checkForAegis()
GLfloat laserHeatLevelForward()
unsigned isHulk
OOJSScript * aiScript
Definition ShipEntity.h:212
void setTargetToNearestStation()
OOMesh * mesh()
Quaternion demoStartOrientation
Definition ShipEntity.h:482
double rangeToPrimaryTarget()
GLfloat fuelChargeRate()
Triangle absoluteIJKForSubentity()
BOOL scriptedMisjump()
OOCargoQuantity cargoQuantityOnBoard()
unsigned next_navpoint_index
Definition ShipEntity.h:407
BOOL withinStationAegis()
OOWeakReference * _nextBeacon
Definition ShipEntity.h:473
NSString * _beaconLabel
Definition ShipEntity.h:471
GLfloat entityPersonality()
OOPlanetEntity * findNearestPlanetExcludingMoons()
OOWeakSet * _defenseTargets
Definition ShipEntity.h:460
void becomeExplosion()
GLfloat fuel_accumulator
Definition ShipEntity.h:278
unsigned n_scanned_ships
Definition ShipEntity.h:403
OOColor * scanner_display_color_hostile1
Definition ShipEntity.h:223
unsigned docking_match_rotation
Definition ShipEntity.h:240
OOWeaponType forward_weapon_type
Definition ShipEntity.h:294
Vector collision_vector
Definition ShipEntity.h:375
NSArray * crew
unsigned cloaking_device_active
Definition ShipEntity.h:254
GLfloat flightRoll
OOCargoQuantity extra_cargo
Definition ShipEntity.h:285
void startTrackingCurve()
OOScalar demoRate
Definition ShipEntity.h:480
NSMutableArray * subEntities
OOCargoQuantity equipment_weight
Definition ShipEntity.h:286
BOOL showScoopMessage()
Vector rightVector()
unsigned _explicitlyUnpiloted
Definition ShipEntity.h:263
HPVector trackingCurvePositions[4]
Definition ShipEntity.h:438
GLfloat scannerRange
GLfloat weaponRecoveryTime()
OOWeakReference * _prevBeacon
Definition ShipEntity.h:472
GLfloat maxFlightSpeed
BOOL isCloaked()
OOCommodityType commodityType()
NSArray * explosionType
Definition ShipEntity.h:324
GLfloat _profileRadius
Definition ShipEntity.h:465
BoundingBox findSubentityBoundingBox()
BOOL isThargoid()
BOOL hasExpandedCargoBay()
NSString * displayName
GLfloat success_factor
Definition ShipEntity.h:338
OOWeakReference * _foundTarget
Definition ShipEntity.h:428
void becomeEnergyBlast()
BOOL hasCloakingDevice()
NSString * lastRadioMessage
Definition ShipEntity.h:392
Entity * lastEscortTarget()
GLfloat maxFlightPitch()
Entity * foundTarget()
OOColor * scannerDisplayColor1()
NSUInteger _maxShipSubIdx
Definition ShipEntity.h:332
GLfloat hullHeatLevel()
NSString * _shipKey
Definition ShipEntity.h:445
double _nextAegisCheck
Definition ShipEntity.h:476
GLfloat flightYaw
GLfloat frustumRadius()
Definition ShipEntity.m:822
unsigned haveExecutedSpawnAction
Definition ShipEntity.h:268
void avoidCollision()
BOOL isEscort()
Vector v_right
Definition ShipEntity.h:189
GLfloat cruiseSpeed
BOOL showDamage()
OOSystemID homeSystem()
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque