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

#include <OOECMBlastEntity.h>

+ Inheritance diagram for OOECMBlastEntity:
+ Collaboration diagram for OOECMBlastEntity:

Instance Methods

(id) - initFromShip:
 
(void) - update: [implementation]
 
(void) - drawImmediate:translucent: [implementation]
 
(BOOL) - isECMBlast [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
 
(BOOL) - validForAddToUniverse
 
(void) - addToLinkedLists
 
(void) - removeFromLinkedLists
 
(void) - updateLinkedLists
 
(void) - wasAddedToUniverse
 
(void) - wasRemovedFromUniverse
 
(void) - warnAboutHostiles
 
(CollisionRegion *) - collisionRegion
 
(void) - setCollisionRegion:
 
(void) - setUniversalID:
 
(OOUniversalID- universalID
 
(BOOL) - throwingSparks
 
(void) - setThrowSparks:
 
(void) - throwSparks
 
(void) - setOwner:
 
(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) - orientationChanged
 
(void) - setVelocity:
 
(Vector) - velocity
 
(double) - speed
 
(GLfloat) - distanceTravelled
 
(void) - setDistanceTravelled:
 
(void) - setStatus:
 
(OOEntityStatus- status
 
(void) - setScanClass:
 
(OOScanClass- scanClass
 
(void) - setEnergy:
 
(GLfloat) - energy
 
(void) - setMaxEnergy:
 
(GLfloat) - maxEnergy
 
(void) - applyRoll:andClimb:
 
(void) - applyRoll:climb:andYaw:
 
(void) - moveForward:
 
(OOMatrix) - rotationMatrix
 
(OOMatrix) - drawRotationMatrix
 
(OOMatrix) - transformationMatrix
 
(OOMatrix) - drawTransformationMatrix
 
(BOOL) - canCollide
 
(GLfloat) - collisionRadius
 
(GLfloat) - frustumRadius
 
(void) - setCollisionRadius:
 
(NSMutableArray *) - collisionArray
 
(void) - applyVelocity:
 
(BOOL) - checkCloseCollisionWith:
 
(void) - takeEnergyDamage:from:becauseOf:weaponIdentifier:
 
(void) - dumpState
 
(void) - dumpSelfState
 
(double) - findCollisionRadius
 
(BOOL) - isVisible
 
(BOOL) - isInSpace
 
(BOOL) - isImmuneToBreakPatternHide
 
(GLfloat) - universalTime
 
(GLfloat) - spawnTime
 
(GLfloat) - timeElapsedSinceSpawn
 
(void) - setAtmosphereFogging:
 
(OOColor *) - fogUniform
 
(NSString *) - descriptionForObjDumpBasic
 
(NSString *) - descriptionForObjDump
 
(NSSet *) - allTextures
 
(id) - init [implementation]
 
(void) - dealloc [implementation]
 
(NSString *) - descriptionComponents [implementation]
 
(BOOL) - checkLinkedLists [implementation]
 
(id< OOWeakReferenceSupport >) - superShaderBindingTarget [implementation]
 
(Vector) - relativePosition [implementation]
 
(void) - subEntityReallyDied: [implementation]
 
(BOOL) - isBreakPattern
 
(void) - inspect [implementation]
 
(NSArray *) - debugInspectorModules [implementation]
 
(NSString *) - inspScanClassLine
 
(NSString *) - inspStatusLine
 
(NSString *) - inspRetainCountLine
 
(NSString *) - inspPositionLine
 
(NSString *) - inspVelocityLine
 
(NSString *) - inspOrientationLine
 
(NSString *) - inspEnergyLine
 
(NSString *) - inspOwnerLine
 
(NSString *) - inspTargetLine
 
(NSString *) - inspDescription [implementation]
 
(NSString *) - inspBasicIdentityLine [implementation]
 
(BOOL) - isExhaust
 
(BOOL) - isFlasher
 
(BOOL) - isVisibleToScripts
 
(NSString *) - oo_jsClassName
 
(void) - getJSClass:andPrototype:
 
(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]
 
(BOOL) - isShipWithSubEntityShip:
 
(void) - drawSubEntityImmediate:translucent: [implementation]
 
- Instance Methods inherited from OOWeakRefObject
(id) - weakSelf
 
(id) - weakRetain [implementation]
 
(void) - weakRefDied: [implementation]
 
- Instance Methods inherited from <OOWeakReferenceSupport>
(id) - OO_RETURNS_RETAINED
 

Private Attributes

OOTimeDelta _nextBlast
 
uint_fast8_t _blastsRemaining
 
OOWeakReference_ship
 

Additional Inherited Members

- 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 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 33 of file OOECMBlastEntity.h.

Method Documentation

◆ drawImmediate:translucent:

- (void) drawImmediate: (bool) immediate
translucent: (bool) translucent 
implementation

Reimplemented from Entity.

Definition at line 1 of file OOECMBlastEntity.m.

111 :(bool)immediate translucent:(bool)translucent
112{
113#if ECM_DEBUG_DRAW && OO_DEBUG
115#endif
116 // Else do nothing, we're invisible!
117}
void OODebugDrawPoint(Vector position, OOColor *color)
const Vector kZeroVector
Definition OOVector.m:28

◆ initFromShip:

- (id) initFromShip: (ShipEntity *) ship

Definition at line 1 of file OOECMBlastEntity.m.

48 :(ShipEntity *)ship
49{
50 if (ship == nil)
51 {
52 DESTROY(self);
53 }
54 else if ((self = [super init]))
55 {
58 _ship = [ship weakRetain];
59
60 [self setPosition:[ship position]];
61
62 [self setStatus:STATUS_EFFECT];
63 [self setScanClass:CLASS_NO_DRAW];
64 }
65
66 return self;
67}
#define DESTROY(x)
Definition OOCocoa.h:77
#define ECM_PULSE_INTERVAL
#define ECM_PULSE_COUNT
return nil
HPVector position
Definition Entity.h:112
id init()
Definition Entity.m:68
uint_fast8_t _blastsRemaining
OOWeakReference * _ship
OOTimeDelta _nextBlast

◆ isECMBlast

- (BOOL) isECMBlast
implementation

Reimplemented from Entity.

Definition at line 1 of file OOECMBlastEntity.m.

121{
122 return YES;
123}

◆ update:

- (void) update: (OOTimeDelta) delta_t
implementation

Reimplemented from Entity.

Definition at line 1 of file OOECMBlastEntity.m.

70 :(OOTimeDelta)delta_t
71{
72 _nextBlast -= delta_t;
73 ShipEntity *ship = [_ship weakRefUnderlyingObject];
74 BOOL validShip = (ship != nil) && ([ship status] != STATUS_DEAD);
75
76 if (_nextBlast <= 0.0 && validShip)
77 {
78 // Do ECM stuff.
79 double radius = OOClamp_0_1_d((double)(ECM_PULSE_COUNT - _blastsRemaining + 1) * 1.0 / (double)ECM_PULSE_COUNT);
80 radius *= SCANNER_MAX_RANGE;
82
83 NSArray *targets = [UNIVERSE findEntitiesMatchingPredicate:IsShipPredicate
84 parameter:NULL
85 inRange:radius
86 ofEntity:self];
87 NSUInteger i, count = [targets count];
88 if (count > 0)
89 {
90 JSContext *context = OOJSAcquireContext();
91 jsval ecmPulsesRemaining = INT_TO_JSVAL(_blastsRemaining);
92 jsval whomVal = OOJSValueFromNativeObject(context, ship);
93
94 for (i = 0; i < count; i++)
95 {
96 ShipEntity *target = [targets objectAtIndex:i];
97 ShipScriptEvent(context, target, "shipHitByECM", ecmPulsesRemaining, whomVal);
98 [target reactToAIMessage:@"ECM" context:nil];
99 [target noticeECM];
100 }
101
102 OOJSRelinquishContext(context);
103 }
105 }
106
107 if (_blastsRemaining == 0 || !validShip) [UNIVERSE removeEntity:self];
108}
#define SCANNER_MAX_RANGE
Definition Entity.h:51
OOINLINE jsval OOJSValueFromNativeObject(JSContext *context, id object)
OOINLINE JSContext * OOJSAcquireContext(void)
OOINLINE void OOJSRelinquishContext(JSContext *context)
unsigned count
double OOTimeDelta
Definition OOTypes.h:224
#define ShipScriptEvent(context, ship, event,...)
OOEntityStatus status()
Definition Entity.m:793
void reactToAIMessage:context:(NSString *message,[context] NSString *debugContext)

Member Data Documentation

◆ _blastsRemaining

- (uint_fast8_t) _blastsRemaining
private

Definition at line 37 of file OOECMBlastEntity.h.

◆ _nextBlast

- (OOTimeDelta) _nextBlast
private

Definition at line 36 of file OOECMBlastEntity.h.

◆ _ship

- (OOWeakReference*) _ship
private

Definition at line 38 of file OOECMBlastEntity.h.


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