jjOBJ class
#include <Jazz2/Scripting/Legacy/Objects.h>
An object of the level.
Enemies, pickups, bullets, platforms, light sources and similar things placed in or spawned into the level. Every object has a slot in jjObjects, and new objects start as a copy of their template in jjObjectPresets. Besides position, speed and animation, an object carries a jjOBJ::
Public static functions
-
static auto jjAddObject(std::
uint8_t eventID, float xPixel, float yPixel, std:: uint16_t creatorID, std:: uint32_t creatorType, std:: uint32_t behavior) -> std:: int32_t - Creates a new object.
-
static auto jjAddObjectEx(std::
uint8_t eventID, float xPixel, float yPixel, std:: uint16_t creatorID, std:: uint32_t creatorType, jjVOIDFUNCOBJ behavior) -> std:: int32_t - Creates a new object driven by a behavior function.
-
static void jjDeleteObject(std::
int32_t objectID) - Removes an object from the level.
-
static void jjKillObject(std::
int32_t objectID) - Kills an object.
-
static auto PackCreator(std::
uint32_t type, std:: uint16_t id) -> std:: int32_t - Packs a creator type and a 16-bit creator ID as creator keeps them.
-
static void AddPixelExplosion(LevelScriptLoader* owner,
float xPixel,
float yPixel,
std::
uint32_t frame, std:: int32_t direction) - Bursts a frame of the animation table into debris where it would be drawn, see particlePixelExplosion().
Constructors, destructors, conversion operators
Public functions
- void AddRef()
- Increments the reference count.
- void Release()
- Decrements the reference count.
- auto get_isActive() const -> bool
- Whether the object currently exists.
-
auto objectHit(jjOBJ* target,
std::
uint32_t playerHandling) -> jjOBJ* - Makes this object hit another one as an object of
playerHandling. -
void blast(std::
int32_t maxDistance, bool blastObjects) partially supported - Hurts and pushes away players near the object, like an explosion.
-
void behave1(std::
uint32_t behavior, bool draw) partially supported - Runs a built-in behavior for the object once.
- void behave2(jjBEHAVIOR behavior, bool draw)
- Runs the given behavior for the object once.
- void behave3(jjVOIDFUNCOBJ behavior, bool draw)
- Runs the given behavior function for the object once.
- void RunWalkingEnemy(LevelScriptLoader* owner, bool draw)
- Runs
BEHAVIOR::WALKINGENEMYonce, as measured in JJ2+, optionally drawing the object. -
auto determineCurFrame(bool change) -> std::
uint32_t - Computes the frame for the current animation and frame index.
-
auto get_creatorID() const -> std::
uint16_t - Returns the ID of the object or player that created this object.
-
auto set_creatorID(std::
uint16_t value) const -> std:: uint16_t - Sets the ID of the object or player that created this object.
-
auto get_creatorType() const -> std::
uint32_t - Returns what kind of thing created this object.
-
auto set_creatorType(std::
uint32_t value) const -> std:: uint32_t - Sets what kind of thing created this object.
-
auto determineCurAnim(std::
uint8_t setID, std:: uint8_t animation, bool change) -> int16_t - Computes the animation index for an animation of a set.
-
auto determineCurAnimOfSet(std::
int32_t setID, std:: uint8_t animation, bool change) -> int16_t - Computes the animation index for an animation of a set.
-
auto get_bulletHandling() -> std::
uint32_t - Returns how the object reacts when a bullet touches it.
-
auto set_bulletHandling(std::
uint32_t value) -> std:: uint32_t - Sets how the object reacts when a bullet touches it.
- auto get_ricochet() -> bool partially supported
- Returns whether bullets bounce off the object.
- auto set_ricochet(bool value) -> bool
- Sets whether bullets bounce off the object.
- auto get_freezable() -> bool
- Returns whether ice bullets freeze the object.
- auto set_freezable(bool value) -> bool
- Sets whether ice bullets freeze the object.
- auto get_blastable() -> bool
- Returns whether explosions affect the object.
- auto set_blastable(bool value) -> bool
- Sets whether explosions affect the object.
-
auto get_playerHandling() -> std::
uint32_t - Returns how the object reacts when a player touches it.
-
auto set_playerHandling(std::
uint32_t value) -> std:: uint32_t - Sets how the object reacts when a player touches it.
- auto get_isTarget() -> bool partially supported
- Returns whether homing attacks go after the object.
- auto set_isTarget(bool value) -> bool
- Sets whether homing attacks go after the object.
- auto get_triggersTNT() -> bool partially supported
- Returns whether the object sets off nearby TNT.
- auto set_triggersTNT(bool value) -> bool
- Sets whether the object sets off nearby TNT.
- auto get_deactivates() -> bool
- Returns whether the object is unloaded when far away from players.
- auto set_deactivates(bool value) -> bool
- Sets whether the object is unloaded when far away from players.
- auto get_scriptedCollisions() -> bool
- Returns whether the script decides what happens when the object is hit.
- auto set_scriptedCollisions(bool value) -> bool
- Sets whether the script decides what happens when the object is hit.
-
auto get_var(std::
uint8_t x) -> std:: int32_t - Returns a general-purpose value of the object.
-
auto set_var(std::
uint8_t x, std:: int32_t value) -> std:: int32_t - Sets a general-purpose value of the object.
-
auto draw() -> std::
int32_t partially supported - Draws the object.
-
auto beSolid(bool shouldCheckForStompingLocalPlayers) -> std::
int32_t - Makes the object solid for players.
-
void bePlatform(float xOld,
float yOld,
std::
int32_t width, std:: int32_t height) - Lets players stand on top of the object.
- void clearPlatform()
- Releases players standing on the object.
- void putOnGround(bool precise)
- Moves the object down onto the ground below it.
- auto ricochet() -> bool
- Makes a bullet bounce off.
-
auto unfreeze(std::
int32_t style) -> std:: int32_t partially supported - Unfreezes the object.
- void deleteObject()
- Removes the object from the level permanently.
- void deactivate()
- Unloads the object, usually in response to STATE::DEACTIVATE.
- void pathMovement() partially supported
- Moves the object along a path of waypoints.
-
auto fireBullet(std::
uint8_t eventID) -> std:: int32_t - Fires a bullet from the object.
-
void particlePixelExplosion(std::
int32_t style) partially supported - Bursts the current frame of the object into pixel particles.
-
void grantPickup(jjPLAYER* player,
std::
int32_t frequency) partially supported - Possibly drops a random pickup, as destroyed enemies and crates do.
-
auto findNearestPlayer(std::
int32_t maxDistance) const -> std:: int32_t - Finds the nearest player.
-
auto findNearestPlayerEx(std::
int32_t maxDistance, std:: int32_t& foundDistance) const -> std:: int32_t - Finds the nearest player and its distance.
- auto doesCollide(const jjOBJ* object, bool always) const -> bool
- Checks whether the sprites of this object and another object overlap.
- auto doesCollidePlayer(const jjPLAYER* object, bool always) const -> bool partially supported
- Checks whether the sprite of this object overlaps a player.
Public variables
- jjBEHAVIOR behavior partially supported
- Behavior that runs for the object once per tick.
- float xOrg
- Horizontal position the object was created at, in pixels.
- float yOrg
- Vertical position the object was created at, in pixels.
- float xPos
- Current horizontal position in pixels.
- float yPos
- Current vertical position in pixels.
- float xSpeed
- Horizontal speed in pixels per tick, negative to the left.
- float ySpeed
- Vertical speed in pixels per tick, negative upward.
- float xAcc
- Horizontal acceleration in pixels per tick squared.
- float yAcc
- Vertical acceleration in pixels per tick squared.
-
std::
int32_t counter - General-purpose counter, mostly used by behaviors to time upcoming events.
-
std::
uint32_t curFrame - Frame currently shown for the object.
-
std::
int32_t age - General-purpose value, the game doesn't change it by itself.
-
std::
int32_t creator - Creator ID and creator type combined into one number.
- int16_t curAnim
- Animation the object takes its frames from.
-
std::
uint16_t killAnim - Animation used while the object is being destroyed, in the same form as jjOBJ::
curAnim. -
std::
uint8_t freeze - Remaining time the object stays frozen, in ticks.
-
std::
uint8_t lightType - Kind of light the object emits.
-
std::
int8_t frameID - Index of the current frame within jjOBJ::
curAnim. -
std::
int8_t noHit partially supported - Legacy hit flags.
-
std::
int8_t energy - Remaining health of the object.
-
std::
int8_t light partially supported - Size of the light emitted by the object, see jjOBJ::
lightType. -
std::
uint8_t objType partially supported - Legacy object category.
-
std::
int8_t state - Current state of the object.
-
std::
uint16_t points partially supported - Score the object is worth when a player destroys it.
-
std::
uint8_t eventID - Event the object was created from.
-
std::
int8_t direction - Direction the object faces.
-
std::
uint8_t justHit - Ticks left of the white flash shown after a hit.
-
std::
int8_t oldState - State the object was in before it got frozen.
-
std::
int32_t animSpeed - Animation speed, or damage of a bullet.
-
std::
int32_t special - General-purpose value with a meaning specific to each object.
-
std::
uint8_t doesHurt - General-purpose value, the game doesn't use it by itself.
-
std::
uint8_t counterEnd - Smaller general-purpose counter.
-
std::
int16_t objectID - Index of the object in jjObjects.
Function documentation
static std:: int32_t Jazz2:: Scripting:: Legacy:: jjOBJ:: jjAddObject(std:: uint8_t eventID,
float xPixel,
float yPixel,
std:: uint16_t creatorID,
std:: uint32_t creatorType,
std:: uint32_t behavior)
Creates a new object.
| Parameters | |
|---|---|
| eventID | Event of the object, usually an OBJECT::Object constant |
| xPixel | Horizontal position in pixels |
| yPixel | Vertical position in pixels |
| creatorID | Object or player that created the object, see jjOBJ::creatorID |
| creatorType | Kind of the creator, see jjOBJ::creatorType |
| behavior | Behavior to use instead of the template's, BEHAVIOR::DEFAULT keeps the template's |
| Returns | Object ID of the new object (an index of jjObjects), or 0 on failure |
The object is built from the template in jjObjectPresets for eventID and placed at the given position, which also becomes its jjOBJ::behavior here is not the same as assigning jjOBJ::
static std:: int32_t Jazz2:: Scripting:: Legacy:: jjOBJ:: jjAddObjectEx(std:: uint8_t eventID,
float xPixel,
float yPixel,
std:: uint16_t creatorID,
std:: uint32_t creatorType,
jjVOIDFUNCOBJ behavior)
Creates a new object driven by a behavior function.
| Parameters | |
|---|---|
| eventID | Event of the object, usually an OBJECT::Object constant |
| xPixel | Horizontal position in pixels |
| yPixel | Vertical position in pixels |
| creatorID | Object or player that created the object, see jjOBJ::creatorID |
| creatorType | Kind of the creator, see jjOBJ::creatorType |
| behavior | Behavior function of the new object |
| Returns | Object ID of the new object (an index of jjObjects), or 0 on failure |
Works like the other overload, but the new object gets the given function as its jjOBJ::
static void Jazz2:: Scripting:: Legacy:: jjOBJ:: jjDeleteObject(std:: int32_t objectID)
Removes an object from the level.
The same as calling jjOBJ::delete() on jjObjects[objectID].
static void Jazz2:: Scripting:: Legacy:: jjOBJ:: jjKillObject(std:: int32_t objectID)
Kills an object.
Unlike jjDeleteObject(), the object dies the regular way first, so whatever it does on death still happens.
bool Jazz2:: Scripting:: Legacy:: jjOBJ:: get_isActive() const
Whether the object currently exists.
False for a free slot of jjObjects or an object that has been deleted, which is the same as its jjOBJ::
jjOBJ* Jazz2:: Scripting:: Legacy:: jjOBJ:: objectHit(jjOBJ* target,
std:: uint32_t playerHandling)
Makes this object hit another one as an object of playerHandling.
| Parameters | |
|---|---|
| target | Object being hit |
| playerHandling | How this object hits, as one of this handling |
| Returns | The target object |
Wherever they are. A target with scriptedCollisions is told of it (by the animSpeed of this object) when playerHandling is a bullet or HANDLING::SPECIAL; two objects of the game collide as the game has them; otherwise a bullet hurts the target by its animSpeed unless its bulletHandling says otherwise. The target's jjOBJ::
void Jazz2:: Scripting:: Legacy:: jjOBJ:: blast(std:: int32_t maxDistance,
bool blastObjects)
Hurts and pushes away players near the object, like an explosion.
| Parameters | |
|---|---|
| maxDistance | Squared radius in pixels |
| blastObjects | Whether enemies are hurt too |
Every vulnerable player whose squared distance from the object in pixels is less than maxDistance loses one point of health and is knocked away from the object. With blastObjects the enemies there that are isBlastable are hurt too, by 1 to 9 the nearer they are, as by TNT of the game.
void Jazz2:: Scripting:: Legacy:: jjOBJ:: behave1(std:: uint32_t behavior,
bool draw)
Runs a built-in behavior for the object once.
| Parameters | |
|---|---|
| behavior | Behavior to run |
| draw | Whether the object should be drawn |
Doesn't change jjOBJ::
void Jazz2:: Scripting:: Legacy:: jjOBJ:: behave2(jjBEHAVIOR behavior,
bool draw)
Runs the given behavior for the object once.
| Parameters | |
|---|---|
| behavior | Behavior to run |
| draw | Whether the object should be drawn |
Accepts any form a jjBEHAVIOR can hold and doesn't change jjOBJ::
void Jazz2:: Scripting:: Legacy:: jjOBJ:: behave3(jjVOIDFUNCOBJ behavior,
bool draw)
Runs the given behavior function for the object once.
| Parameters | |
|---|---|
| behavior | Function to run |
| draw | Whether the object should be drawn |
std:: uint32_t Jazz2:: Scripting:: Legacy:: jjOBJ:: determineCurFrame(bool change)
Computes the frame for the current animation and frame index.
| Parameters | |
|---|---|
| change | Whether to also store the result in jjOBJ:: |
| Returns | The computed frame, an index of jjAnimFrames |
The result is the first frame of jjOBJ::
std:: uint16_t Jazz2:: Scripting:: Legacy:: jjOBJ:: get_creatorID() const
Returns the ID of the object or player that created this object.
An index of jjObjects or jjPlayers, depending on jjOBJ::creatorType, or 0 if no creator is known.
std:: uint32_t Jazz2:: Scripting:: Legacy:: jjOBJ:: get_creatorType() const
Returns what kind of thing created this object.
CREATOR::OBJECT for an object made by another object, CREATOR::PLAYER for one made by a player, or CREATOR::LEVEL for one placed in the level.
int16_t Jazz2:: Scripting:: Legacy:: jjOBJ:: determineCurAnim(std:: uint8_t setID,
std:: uint8_t animation,
bool change)
Computes the animation index for an animation of a set.
| Parameters | |
|---|---|
| setID | Animation set, an ANIM::Set constant is recommended |
| animation | Zero-based index of the animation within the set |
| change | Whether to also store the result in jjOBJ:: |
| Returns | The computed animation, an index of jjAnimations |
The result is the first animation of the set plus animation, or 0 if the set isn't available.
int16_t Jazz2:: Scripting:: Legacy:: jjOBJ:: determineCurAnimOfSet(std:: int32_t setID,
std:: uint8_t animation,
bool change)
Computes the animation index for an animation of a set.
| Parameters | |
|---|---|
| setID | Animation set |
| animation | Zero-based index of the animation within the set |
| change | Whether to also store the result in jjOBJ:: |
| Returns | The computed animation, an index of jjAnimations |
The result is the first animation of the set plus animation, or 0 if the set isn't available. The set can also be a custom one.
std:: uint32_t Jazz2:: Scripting:: Legacy:: jjOBJ:: get_bulletHandling()
Returns how the object reacts when a bullet touches it.
- HANDLING::HURTBYBULLET — the object loses energy and the bullet is usually destroyed
- HANDLING::IGNOREBULLET — neither the object nor the bullet is affected
- HANDLING::DESTROYBULLET — the bullet is destroyed, the object is unaffected
- HANDLING::DETECTBULLET — the object is unaffected, the bullet is usually destroyed
Bullets of the game hit an object that exists only for the script by its frame if it has a handling set, is an enemy (HANDLING::ENEMY) or has scriptedCollisions, and go through it otherwise.
bool Jazz2:: Scripting:: Legacy:: jjOBJ:: get_ricochet()
Returns whether bullets bounce off the object.
bool Jazz2:: Scripting:: Legacy:: jjOBJ:: get_freezable()
Returns whether ice bullets freeze the object.
When false, ice bullets hit the object like any other bullet.
bool Jazz2:: Scripting:: Legacy:: jjOBJ:: get_blastable()
Returns whether explosions affect the object.
An object that isn't is left alone by blast().
std:: uint32_t Jazz2:: Scripting:: Legacy:: jjOBJ:: get_playerHandling()
Returns how the object reacts when a player touches it.
For example, HANDLING::ENEMY hurts the player, HANDLING::PICKUP is collected and HANDLING::SPECIAL runs code specific to the object. Bullets use HANDLING::PLAYERBULLET or HANDLING::ENEMYBULLET.
bool Jazz2:: Scripting:: Legacy:: jjOBJ:: get_isTarget()
Returns whether homing attacks go after the object.
bool Jazz2:: Scripting:: Legacy:: jjOBJ:: get_triggersTNT()
Returns whether the object sets off nearby TNT.
bool Jazz2:: Scripting:: Legacy:: jjOBJ:: get_deactivates()
Returns whether the object is unloaded when far away from players.
When true, the object enters STATE::DEACTIVATE once it gets too far from players. An object placed in the level then comes back, reset, when a player gets near again.
bool Jazz2:: Scripting:: Legacy:: jjOBJ:: get_scriptedCollisions()
Returns whether the script decides what happens when the object is hit.
When true and jjOBJ::playerHandling is HANDLING::PICKUP or HANDLING::SPECIAL, collisions with players and bullets call onObjectHit() of the object's behavior class, or the global onObjectHit() function, instead of the game's own handling. Bullets of the game hit an object that exists only for the script by its frame.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjOBJ:: get_var(std:: uint8_t x)
Returns a general-purpose value of the object.
Each object has a small array of integers that behaviors use for anything they need. Indices 0 to 15 are available, reading other ones gives 0 and writing them has no effect.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjOBJ:: draw()
Draws the object.
| Returns | Always 0 |
|---|
Uses the position, direction and jjOBJ::
std:: int32_t Jazz2:: Scripting:: Legacy:: jjOBJ:: beSolid(bool shouldCheckForStompingLocalPlayers)
Makes the object solid for players.
| Parameters | |
|---|---|
| shouldCheckForStompingLocalPlayers | A player buttstomping onto it is one more hit (force 1) for a behavior with scriptedCollisions |
| Returns | -1 or 1 while a player pushes it left or right, 0 otherwise |
Solid by its current frame for this tick, where it is. A player standing on it is lifted when it moves up.
void Jazz2:: Scripting:: Legacy:: jjOBJ:: bePlatform(float xOld,
float yOld,
std:: int32_t width,
std:: int32_t height)
Lets players stand on top of the object.
| Parameters | |
|---|---|
| xOld | Horizontal position of the object in the previous tick |
| yOld | Vertical position of the object in the previous tick |
| width | Width of the platform in pixels, 0 to derive it from the current frame |
| height | Height of the platform in pixels, its top is half of it above the object; 0 as the platforms of the game, whose top is 4 pixels above it (the same as a height of 8) |
Call it every tick while the object should carry players, they go along with it by how far it moved.
void Jazz2:: Scripting:: Legacy:: jjOBJ:: clearPlatform()
Releases players standing on the object.
Call it before removing an object that used jjOBJ::
void Jazz2:: Scripting:: Legacy:: jjOBJ:: putOnGround(bool precise)
Moves the object down onto the ground below it.
| Parameters | |
|---|---|
| precise | Whether to place the object exactly |
Without precise, the result can be a few pixels off, which is fine for most objects. Also resets jjOBJ::
bool Jazz2:: Scripting:: Legacy:: jjOBJ:: ricochet()
Makes a bullet bounce off.
| Returns | True if the object is a bullet and bounced, false otherwise |
|---|
A bullet a script made turns around, a bullet of the game bounces off as from a wall.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjOBJ:: unfreeze(std:: int32_t style)
Unfreezes the object.
| Parameters | |
|---|---|
| style | Currently ignored |
| Returns | Value jjOBJ:: |
Sets jjOBJ::
void Jazz2:: Scripting:: Legacy:: jjOBJ:: deleteObject()
Removes the object from the level permanently.
The object stops being active immediately.
void Jazz2:: Scripting:: Legacy:: jjOBJ:: deactivate()
Unloads the object, usually in response to STATE::DEACTIVATE.
An object placed in the level is restored to the event map, so it comes back when a player gets near again. Any other object is removed permanently.
void Jazz2:: Scripting:: Legacy:: jjOBJ:: pathMovement()
Moves the object along a path of waypoints.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjOBJ:: fireBullet(std:: uint8_t eventID)
Fires a bullet from the object.
| Parameters | |
|---|---|
| eventID | Event of the bullet, usually an OBJECT::Object constant |
| Returns | Object ID of the bullet, or 0 on failure |
Creates an object of the given event at the gun spot of the current frame, facing the same way as this object and with this object as its creator.
void Jazz2:: Scripting:: Legacy:: jjOBJ:: particlePixelExplosion(std:: int32_t style)
Bursts the current frame of the object into pixel particles.
| Parameters | |
|---|---|
| style | Currently ignored, every style looks the same |
Same as jjAddParticlePixelExplosion() with the position, frame and direction of the object.
void Jazz2:: Scripting:: Legacy:: jjOBJ:: grantPickup(jjPLAYER* player,
std:: int32_t frequency)
Possibly drops a random pickup, as destroyed enemies and crates do.
One time in frequency, a carrot, a fast fire or a red gem falls out of the object.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjOBJ:: findNearestPlayer(std:: int32_t maxDistance) const
Finds the nearest player.
| Parameters | |
|---|---|
| maxDistance | Squared search radius in pixels |
| Returns | Index of the nearest player within the radius, or a negative number if there is none |
std:: int32_t Jazz2:: Scripting:: Legacy:: jjOBJ:: findNearestPlayerEx(std:: int32_t maxDistance,
std:: int32_t& foundDistance) const
Finds the nearest player and its distance.
| Parameters | |
|---|---|
| maxDistance | Squared search radius in pixels |
| foundDistance | Receives the squared distance of the found player in pixels |
| Returns | Index of the nearest player within the radius, or a negative number if there is none |
bool Jazz2:: Scripting:: Legacy:: jjOBJ:: doesCollide(const jjOBJ* object,
bool always) const
Checks whether the sprites of this object and another object overlap.
| Parameters | |
|---|---|
| object | Object to test against |
| always | Whether a single shared pixel is enough, otherwise a few are needed (bullets always need just one) |
Compares the pixels of the current frames at the objects' positions and directions. Handling settings, scaling and rotation aren't taken into account.
bool Jazz2:: Scripting:: Legacy:: jjOBJ:: doesCollidePlayer(const jjPLAYER* object,
bool always) const
Checks whether the sprite of this object overlaps a player.
| Parameters | |
|---|---|
| object | Player to test against |
| always | Currently ignored |
Compares the pixels of the current frame of the object with the hitbox of the player.
Variable documentation
jjBEHAVIOR Jazz2:: Scripting:: Legacy:: jjOBJ:: behavior
Behavior that runs for the object once per tick.
Either a BEHAVIOR::Behavior constant, a jjVOIDFUNCOBJ function or a jjBEHAVIORINTERFACE instance. Assigning to the behavior of a template in jjObjectPresets (typically in onLevelLoad()) changes every object of that event created afterward.
std:: uint32_t Jazz2:: Scripting:: Legacy:: jjOBJ:: curFrame
Frame currently shown for the object.
An index of jjAnimFrames that combines jjOBJ::
std:: int32_t Jazz2:: Scripting:: Legacy:: jjOBJ:: creator
Creator ID and creator type combined into one number.
Use jjOBJ::creatorID and jjOBJ::creatorType instead.
int16_t Jazz2:: Scripting:: Legacy:: jjOBJ:: curAnim
Animation the object takes its frames from.
An index of jjAnimations. Use jjOBJ::
std:: uint8_t Jazz2:: Scripting:: Legacy:: jjOBJ:: freeze
Remaining time the object stays frozen, in ticks.
0 when the object isn't frozen. Built-in behaviors count it down, custom behaviors have to do so themselves.
std:: uint8_t Jazz2:: Scripting:: Legacy:: jjOBJ:: lightType
Kind of light the object emits.
One of the LIGHT::Type constants, its size is given by jjOBJ::
std:: int8_t Jazz2:: Scripting:: Legacy:: jjOBJ:: noHit
Legacy hit flags.
Use jjOBJ::bulletHandling, jjOBJ::causesRicochet, jjOBJ::isFreezable and jjOBJ::isBlastable instead.
std:: int8_t Jazz2:: Scripting:: Legacy:: jjOBJ:: energy
Remaining health of the object.
For enemies, the number of hits the object can still take.
std:: int8_t Jazz2:: Scripting:: Legacy:: jjOBJ:: light
Size of the light emitted by the object, see jjOBJ::
std:: uint8_t Jazz2:: Scripting:: Legacy:: jjOBJ:: objType
Legacy object category.
Use jjOBJ::playerHandling, jjOBJ::isTarget, jjOBJ::triggersTNT, jjOBJ::deactivates and jjOBJ::scriptedCollisions instead.
std:: int8_t Jazz2:: Scripting:: Legacy:: jjOBJ:: state
Current state of the object.
One of the STATE::State constants, for example STATE::START for a new object or STATE::KILL for one that has been destroyed.
std:: uint16_t Jazz2:: Scripting:: Legacy:: jjOBJ:: points
Score the object is worth when a player destroys it.
std:: uint8_t Jazz2:: Scripting:: Legacy:: jjOBJ:: eventID
Event the object was created from.
Usually compared with OBJECT::Object constants. It is the only reliable way to tell what kind of object this is, so changing it may make the object behave unexpectedly.
std:: int8_t Jazz2:: Scripting:: Legacy:: jjOBJ:: direction
Direction the object faces.
Zero or positive for right, negative for left.
std:: uint8_t Jazz2:: Scripting:: Legacy:: jjOBJ:: justHit
Ticks left of the white flash shown after a hit.
While non-zero, the object is drawn in a single color. The game counts it down by itself.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjOBJ:: animSpeed
Animation speed, or damage of a bullet.
For bullets, how much damage they deal.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjOBJ:: special
General-purpose value with a meaning specific to each object.
For bullets, the animation used when they are fired upward.
std:: uint8_t Jazz2:: Scripting:: Legacy:: jjOBJ:: counterEnd
Smaller general-purpose counter.
For bullets, how long they fly before they explode.