jjPLAYER class
#include <Jazz2/Scripting/Legacy/Player.h>
A player in the level.
Script view of one player: position and speed, health, lives, score, ammo and powerups, the current character, pressed keys, camera, timer and many state counters, plus actions such as warping, morphing or hurting. Positions are in pixels and durations in ticks, 70 ticks per second. Scripts get players from jjP, jjPlayers or jjLocalPlayers. The level script loader owns one instance per player and wraps the game's own player actor with it.
Constructors, destructors, conversion operators
-
jjPLAYER(LevelScriptLoader* levelScripts,
Actors::
Player* player) - Creates a new instance wrapping the given engine player.
- ~jjPLAYER()
Public functions
- auto operator=(const jjPLAYER& o) -> jjPLAYER&
-
auto get_score() const -> std::
int32_t - Returns the player's score.
-
auto set_score(std::
int32_t value) -> std:: int32_t - Sets the player's score.
-
auto get_scoreDisplayed() const -> std::
int32_t partially supported - Returns the score shown on the HUD.
-
auto set_scoreDisplayed(std::
int32_t value) -> std:: int32_t - Sets the score shown on the HUD.
-
auto setScore(std::
int32_t value) -> std:: int32_t - Sets the player's score.
- auto get_xPos() const -> float
- Returns the horizontal position in pixels.
- auto set_xPos(float value) -> float
- Sets the horizontal position in pixels.
- auto get_yPos() const -> float
- Returns the vertical position in pixels.
- auto set_yPos(float value) -> float
- Sets the vertical position in pixels.
- auto get_xAcc() const -> float
- Returns the horizontal acceleration.
- auto set_xAcc(float value) -> float
- Sets the horizontal acceleration.
- auto get_yAcc() const -> float
- Returns the vertical acceleration.
- auto set_yAcc(float value) -> float
- Sets the vertical acceleration.
- auto get_xOrg() const -> float
- Returns the horizontal respawn position in pixels.
- auto set_xOrg(float value) -> float
- Sets the horizontal respawn position in pixels.
- auto get_yOrg() const -> float
- Returns the vertical respawn position in pixels.
- auto set_yOrg(float value) -> float
- Sets the vertical respawn position in pixels.
- auto get_xSpeed() -> float
- Returns the horizontal speed in pixels per tick.
- auto set_xSpeed(float value) -> float
- Sets the horizontal speed in pixels per tick.
- auto get_ySpeed() -> float
- Returns the vertical speed in pixels per tick.
- auto set_ySpeed(float value) -> float
- Sets the vertical speed in pixels per tick.
-
auto get_frozen() const -> std::
int8_t - Returns how many more ticks the player stays frozen.
-
auto set_frozen(std::
int8_t value) -> std:: int8_t - Sets how many more ticks the player stays frozen.
- void freeze(bool frozen)
- Freezes or unfreezes the player.
-
auto get_currTile() -> std::
int32_t - Returns the tile the player is in, packed into one number.
-
auto startSugarRush(std::
int32_t time) -> bool - Gives the player a sugar rush.
-
auto get_health() const -> std::
int8_t - Returns how many hearts the player has left.
-
auto set_health(std::
int8_t value) -> std:: int8_t - Sets how many hearts the player has left.
-
auto get_fastfire() const -> std::
int32_t - Returns the delay between shots in ticks.
-
auto set_fastfire(std::
int32_t value) -> std:: int32_t - Sets the delay between shots in ticks.
-
auto get_currWeapon() const -> std::
int8_t - Returns the selected weapon.
-
auto set_currWeapon(std::
int8_t value) -> std:: int8_t - Sets the selected weapon.
-
auto get_lives() const -> std::
int32_t - Returns how many lives the player has left.
-
auto set_lives(std::
int32_t value) -> std:: int32_t - Sets how many lives the player has left.
-
auto get_invincibility() const -> std::
int32_t partially supported - Returns the remaining invincibility in ticks.
-
auto set_invincibility(std::
int32_t value) -> std:: int32_t - Sets the remaining invincibility in ticks.
-
auto get_lightType() const -> std::
uint32_t - Returns the type of light the player emits.
-
auto set_lightType(std::
uint32_t value) -> std:: uint32_t - Sets the type of light the player emits.
-
auto get_blink() const -> std::
int32_t - Returns how many more ticks the player blinks.
-
auto set_blink(std::
int32_t value) -> std:: int32_t - Sets how many more ticks the player blinks.
-
auto extendInvincibility(std::
int32_t duration) -> std:: int32_t partially supported - Extends the player's invincibility.
-
auto get_food() const -> std::
int32_t - Returns how much food the player has eaten.
-
auto set_food(std::
int32_t value) -> std:: int32_t - Sets how much food the player has eaten.
-
auto get_coins() const -> std::
int32_t - Returns how many coins the player has.
-
auto set_coins(std::
int32_t value) -> std:: int32_t - Sets how many coins the player has.
-
auto testForCoins(std::
int32_t numberOfCoins) -> bool - Spends coins if the player has enough.
-
auto get_gems(std::
uint32_t type) const -> std:: int32_t - Returns how many gems of the given color the player has.
-
auto set_gems(std::
uint32_t type, std:: int32_t value) -> std:: int32_t - Sets how many gems of the given color the player has.
-
auto testForGems(std::
int32_t numberOfGems, std:: uint32_t type) -> bool - Spends gems of one color if the player has enough.
-
auto get_shieldType() const -> std::
int32_t - Returns the shield the player has.
-
auto set_shieldType(std::
int32_t value) -> std:: int32_t - Sets the shield the player has.
-
auto get_shieldTime() const -> std::
int32_t - Returns how many more ticks the shield lasts.
-
auto set_shieldTime(std::
int32_t value) -> std:: int32_t - Sets how many more ticks the shield lasts.
-
auto get_rolling() const -> std::
int32_t - Returns how many more ticks the player stays rolled up in a ball.
-
auto set_rolling(std::
int32_t value) -> std:: int32_t - Sets how many more ticks the player stays rolled up in a ball.
-
auto get_direction() const -> std::
int8_t - Returns the direction the player faces.
-
auto set_direction(std::
int8_t value) -> std:: int8_t - Sets the direction the player faces.
-
auto get_playerID() const -> std::
int8_t - Returns the index of the player.
-
auto get_localPlayerID() const -> std::
int32_t - Returns the index of the player among local players.
-
auto get_team() const -> std::
int32_t - Returns the team the player belongs to.
- auto get_teamRed() const -> bool
- Returns whether the player isn't on the blue team.
- auto get_running() const -> bool
- Returns whether the player is running.
- auto set_running(bool value) -> bool
- Sets whether the player is running.
-
auto get_doubleJumpCount() const -> std::
int32_t - Returns how many double jumps the player made in the air.
-
auto set_doubleJumpCount(std::
int32_t value) -> std:: int32_t - Sets how many double jumps the player made in the air.
- auto get_alreadyDoubleJumped() const -> bool
- Returns whether the player already used the double jump in the air.
- auto set_alreadyDoubleJumped(bool value) -> bool
- Sets whether the player already used the double jump in the air.
-
auto get_stoned() -> std::
int32_t - Returns how many more ticks the player stays dizzy.
-
auto set_stoned(std::
int32_t value) -> std:: int32_t - Sets how many more ticks the player stays dizzy.
-
auto get_helicopter() const -> std::
int32_t - Returns how many more ticks the helicopter ears last.
-
auto set_helicopter(std::
int32_t value) -> std:: int32_t - Sets how many more ticks the helicopter ears last.
-
auto get_idle() const -> std::
int32_t - Returns how many ticks the player has been idle.
-
auto set_idle(std::
int32_t value) -> std:: int32_t - Sets how many ticks the player has been idle.
-
void suckerTube(std::
int32_t xSpeed, std:: int32_t ySpeed, bool center, bool noclip, bool trigSample) partially supported - Moves the player as if touching a sucker tube event.
-
void poleSpin(float xSpeed,
float ySpeed,
std::
uint32_t delay) partially supported - Swings the player around a pole and launches it.
- void spring(float xSpeed, float ySpeed, bool keepZeroSpeeds, bool sample)
- Bounces the player as if touching a spring.
- auto get_isConnecting() const -> bool
- Returns whether the player is a client still joining the level of an online server.
- auto get_isIdle() const -> bool
- Returns whether the player is an idle server that isn't in the level.
- auto get_isOut() const -> bool
- Returns whether the player is out of a last-rabbit-standing game.
- auto get_isSpectating() const -> bool
- Returns whether the player is spectating by choice, not because the server made it.
- auto get_isInGame() const -> bool
- Returns whether the player actually takes part in the game.
- auto get_name() const -> String
- Returns the player's name, including color codes.
- auto get_nameUnformatted() const -> String
- Returns the player's name without color codes.
- auto setName(const String& name) -> bool
- Changes the player's name.
-
auto get_light() const -> std::
int8_t - Returns the size of the light the player emits.
-
auto set_light(std::
int8_t value) -> std:: int8_t - Sets the intensity of the light the player emits.
-
auto get_fur() const -> std::
uint32_t - Returns the player's fur colors packed into one number.
-
auto set_fur(std::
uint32_t value) -> std:: uint32_t - Sets the player's fur colors packed into one number.
-
void getFur(std::
uint8_t& a, std:: uint8_t& b, std:: uint8_t& c, std:: uint8_t& d) const - Reads the player's four fur colors.
-
void setFur(std::
uint8_t a, std:: uint8_t b, std:: uint8_t c, std:: uint8_t d) - Changes the player's four fur colors.
- auto get_noFire() const -> bool
- Returns whether the player is prevented from firing.
- auto set_noFire(bool value) -> bool
- Sets whether the player is prevented from firing.
- auto get_antiGrav() const -> bool partially supported
- Returns whether the player falls upwards.
- auto set_antiGrav(bool value) -> bool
- Sets whether the player falls upwards.
- auto get_invisibility() const -> bool
- Returns whether the player is invisible, it isn't drawn then.
- auto set_invisibility(bool value) -> bool
- Sets whether the player is invisible.
- auto get_noclipMode() const -> bool
- Returns whether the player passes through walls.
- auto set_noclipMode(bool value) -> bool
- Sets whether the player passes through walls.
-
auto get_lighting() const -> std::
uint8_t - Returns the ambient light level of the player's view.
-
auto set_lighting(std::
uint8_t value) -> std:: uint8_t - Sets the ambient light level of the player's view.
-
auto resetLight() -> std::
uint8_t - Resets the ambient light to the level's default.
- auto get_playerKeyLeftPressed() -> bool
- Returns whether the left key is held.
- auto get_playerKeyRightPressed() -> bool
- Returns whether the right key is held.
- auto get_playerKeyUpPressed() -> bool
- Returns whether the up key is held.
- auto get_playerKeyDownPressed() -> bool
- Returns whether the down key is held.
- auto get_playerKeyFirePressed() -> bool
- Returns whether the fire key is held.
- auto get_playerKeySelectPressed() -> bool
- Returns whether the weapon select key is held.
- auto get_playerKeyJumpPressed() -> bool
- Returns whether the jump key is held.
- auto get_playerKeyRunPressed() -> bool
- Returns whether the run key is held.
- auto set_playerKeyLeftPressed(bool value) -> bool
- Sets whether the left key is pressed.
- auto set_playerKeyRightPressed(bool value) -> bool
- Sets whether the right key is pressed.
- auto set_playerKeyUpPressed(bool value) -> bool
- Sets whether the up key is pressed.
- auto set_playerKeyDownPressed(bool value) -> bool
- Sets whether the down key is pressed.
- auto set_playerKeyFirePressed(bool value) -> bool
- Sets whether the fire key is pressed.
- auto set_playerKeySelectPressed(bool value) -> bool
- Sets whether the weapon-select key is pressed.
- auto set_playerKeyJumpPressed(bool value) -> bool
- Sets whether the jump key is pressed.
- auto set_playerKeyRunPressed(bool value) -> bool
- Sets whether the run key is pressed.
-
auto get_powerup(std::
uint8_t index) -> bool - Returns whether the given weapon is powered up.
-
auto set_powerup(std::
uint8_t index, bool value) -> bool - Sets whether the given weapon is powered up.
-
auto get_ammo(std::
uint8_t index) const -> std:: int32_t - Returns how much ammo the player has of the given weapon.
-
auto set_ammo(std::
uint8_t index, std:: int32_t value) -> std:: int32_t - Sets how much ammo the player has of the given weapon.
-
auto offsetPosition(std::
int32_t xPixels, std:: int32_t yPixels) -> bool - Moves the player by the given offset at once.
-
auto warpToTile(std::
int32_t xTile, std:: int32_t yTile, bool fast) -> bool - Warps the player to the center of the given tile.
-
auto warpToID(std::
uint8_t warpID, bool fast) -> bool - Warps the player to the warp target with the given ID.
-
auto morph(bool rabbitsOnly,
bool morphEffect) -> std::
uint32_t - Changes the player into the next character.
-
auto morphTo(std::
uint32_t charNew, bool morphEffect) -> std:: uint32_t - Changes the player into the given character.
-
auto revertMorph(bool morphEffect) -> std::
uint32_t - Changes the player back into its original character.
-
auto get_charCurr() const -> std::
uint32_t - Returns the player's current character.
-
auto get_charOrig() const -> std::
uint32_t - Returns the character the player started the level as.
-
auto set_charOrig(std::
uint32_t value) -> std:: uint32_t - Sets the character the player started the level as.
- void kill()
- Kills the player at once.
-
auto hurt(std::
int8_t damage, bool forceHurt, jjPLAYER* attacker) -> bool partially supported - Hurts the player.
-
auto get_timerState() const -> std::
uint32_t - Returns the state of the player's timer.
- auto get_timerPersists() const -> bool
- Returns whether the player's timer keeps running when the player dies.
- auto set_timerPersists(bool value) -> bool
- Sets whether the player's timer keeps running when the player dies.
-
auto timerStart(std::
int32_t ticks, bool startPaused) -> std:: uint32_t - Starts the player's timer.
-
auto timerPause() -> std::
uint32_t - Pauses the player's timer.
-
auto timerResume() -> std::
uint32_t - Resumes the player's paused timer.
-
auto timerStop() -> std::
uint32_t - Stops the player's timer.
-
auto get_timerTime() const -> std::
int32_t - Returns how many ticks are left on the player's timer.
-
auto set_timerTime(std::
int32_t value) -> std:: int32_t - Sets how many ticks are left on the player's timer.
- void timerFunction(const String& functionName)
- Sets the function called when the player's timer runs out, by its name.
- void timerFunctionPtr(void* function)
- Sets the function called when the player's timer runs out.
- void timerFunctionFuncPtr(void* function)
- Sets the function called when the player's timer runs out.
- auto activateBoss(bool activate) -> bool
- Activates the bosses of the level.
-
auto limitXScroll(std::
uint16_t left, std:: uint16_t width) -> bool - Limits horizontal scrolling of the camera.
- void cameraFreezeFF(float xPixel, float yPixel, bool centered, bool instant)
- Fixes the camera at the given position.
- void cameraFreezeBF(bool xUnfreeze, float yPixel, bool centered, bool instant)
- Fixes the camera vertically.
- void cameraFreezeFB(float xPixel, bool yUnfreeze, bool centered, bool instant)
- Fixes the camera horizontally.
- void cameraFreezeBB(bool xUnfreeze, bool yUnfreeze, bool centered, bool instant)
- Releases or keeps each axis of the camera.
- void cameraUnfreeze(bool instant)
- Lets the camera follow the player again.
-
void showText(const String& text,
std::
uint32_t size) partially supported - Shows text on the screen.
-
void showTextByID(std::
uint32_t textID, std:: uint32_t offset, std:: uint32_t size) partially supported - Shows one of the level's text strings on the screen.
-
auto get_fly() const -> std::
uint32_t - Returns how the player is flying.
-
auto set_fly(std::
uint32_t value) -> std:: uint32_t - Sets how the player is flying.
-
auto fireBulletDirection(std::
uint8_t gun, bool depleteAmmo, bool requireAmmo, std:: uint32_t direction) -> std:: int32_t partially supported - Makes the player fire in a direction.
-
auto fireBulletAngle(std::
uint8_t gun, bool depleteAmmo, bool requireAmmo, float angle) -> std:: int32_t partially supported - Makes the player fire at an angle.
-
auto get_subscreenX() const -> std::
int32_t - Returns the left edge of the player's part of the screen.
-
auto get_subscreenY() const -> std::
int32_t - Returns the top edge of the player's part of the screen.
- auto get_cameraX() const -> float
- Returns the left edge of the player's view of the level.
- auto get_cameraY() const -> float
- Returns the top edge of the player's view of the level.
-
auto get_deaths() const -> std::
int32_t - Returns how many times the player died in a competitive game.
- auto get_isJailed() const -> bool
- Returns whether the player is in jail in Jailbreak.
- auto get_isZombie() const -> bool
- Returns whether the player is a zombie in Pestilence.
-
auto get_lrsLives() const -> std::
int32_t - Returns the lives left in last-rabbit-standing game modes, -1 in any other.
-
auto get_roasts() const -> std::
int32_t - Returns how many players this player roasted.
-
auto get_laps() const -> std::
int32_t - Returns how many laps the player finished in a race.
-
auto get_lapTimeCurrent() const -> std::
int32_t - Returns how many ticks the current lap has lasted.
-
auto get_lapTimes(std::
uint32_t index) const -> std:: int32_t - Returns the time of one of the last 5 laps in ticks.
-
auto get_lapTimeBest() const -> std::
int32_t - Returns the time of the player's fastest lap in ticks, 0 before the first one.
- auto get_isAdmin() const -> bool
- Returns whether the player is an administrator of the server.
-
auto hasPrivilege(const String& privilege,
std::
uint32_t moduleID) const -> bool - Returns whether the player has the given administrator privilege.
- auto doesCollide(const jjOBJ* object, bool always) const -> bool partially supported
- Returns whether the player touches the given object.
-
auto getObjectHitForce(const jjOBJ* target) const -> std::
int32_t - Returns how hard the player would hit an object.
-
auto objectHit(jjOBJ* target,
std::
int32_t force, std:: uint32_t playerHandling) -> bool partially supported - Makes the player collide with an object as with one of
playerHandling. - auto isEnemy(const jjPLAYER* victim) const -> bool
- Returns whether this player can hurt the given player.
-
auto get_spriteMode() const -> std::
uint32_t partially supported - Returns the sprite mode the player is drawn with.
-
auto set_spriteMode(std::
uint32_t value) -> std:: uint32_t - Sets the sprite mode the player is drawn with.
- void SetDrawnByScript(bool value)
- Hides the player while
onPlayerDraw()of the script draws it in another frame. -
auto get_spriteParam() const -> std::
uint8_t - Returns the parameter of the sprite mode, see get_
spriteMode(). -
auto set_spriteParam(std::
uint8_t value) -> std:: uint8_t - Sets the parameter of the sprite mode.
-
auto get_curAnim() const -> std::
uint16_t - Returns the animation the player shows.
-
auto get_curFrame() const -> std::
uint32_t - Returns the sprite frame the player shows.
-
auto get_frameID() const -> std::
uint8_t - Returns the frame the player shows within its animation.
-
auto FireScriptedWeapon(WeaponType weaponType,
float aimAngle = -1.0f,
Actors::
ActorBase** lastShot = nullptr) -> bool - Fires the bullets of a weapon whose bullets a script controls, see LevelScriptLoader::
FirePlayerWeapon(). -
void ApplyPendingSpeed(std::
int32_t currentTick) - Moves the player by the
ySpeeda behavior of an object set in an earlier tick, as JJ2+ moves the players before the objects. - void ApplyScriptFields()
- Hands what the script changed of the plain properties over to the player, after each call of the script.
- void SetPushingSolidObject()
- Shows the player pushing an object a behavior made solid, see jjOBJ::
beSolid(). -
void UpdateLaps(std::
int32_t currentTick) - Takes the times of the laps the player finished, once per tick, see get_
lapTimes(). - void DrawInSpriteMode()
- Draws the player in a sprite mode it can't draw itself in, once per tick, see spriteMode.
- void ApplyPlayerDraw(const jjPLAYERDRAW& draw, const jjPLAYERDRAW& original)
- Applies what
onPlayerDraw()changed of the effects drawn with the player for the current tick. -
void SetMaxHealth(std::
int32_t value) - auto HidesNativeBossMeter() const -> bool
Public variables
- float jumpStrength
- Vertical speed the player gains by jumping.
-
std::
int32_t warpID - Warp the player is currently going through.
-
std::
int32_t bossNumber - Object ID of the boss whose health the boss meter shows.
-
std::
int32_t boss - Object id of the player's boss.
- bool bossActive
- Whether a boss fight is active.
-
std::
int32_t platform - Object ID of the object the player stands on, or pushes (see jjOBJ::
beSolid()). -
std::
int32_t flag partially supported - Object ID of the flag the player carries.
-
std::
int32_t clientID - ID of the machine the player plays on.
-
std::
int32_t buttstomp partially supported - Buttstomp phase of the player.
-
std::
int32_t helicopterElapsed partially supported - Ticks spent using helicopter ears since the last jump.
-
std::
int32_t specialMove partially supported - Special move the player is performing.
- bool isLocal
- Whether the player plays on this machine.
- bool isActive
- Whether the handle stands for a player in the level.
Function documentation
std:: int32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_scoreDisplayed() const
Returns the score shown on the HUD.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: setScore(std:: int32_t value)
Sets the player's score.
| Returns | The new score |
|---|
Same as assigning score.
float Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_xPos() const
Returns the horizontal position in pixels.
Assigning it moves the player there at once, without colliding with or triggering anything on the way.
float Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_yPos() const
Returns the vertical position in pixels.
Assigning it moves the player there at once, without colliding with or triggering anything on the way.
float Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_xAcc() const
Returns the horizontal acceleration.
An external force applied to the player's horizontal speed, positive to the right.
float Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_yAcc() const
Returns the vertical acceleration.
An external force applied to the player's vertical speed, positive downwards.
float Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_xOrg() const
Returns the horizontal respawn position in pixels.
Where the player comes back after dying, usually the last checkpoint reached.
float Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_yOrg() const
Returns the vertical respawn position in pixels.
Where the player comes back after dying, usually the last checkpoint reached.
float Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_xSpeed()
Returns the horizontal speed in pixels per tick.
Positive values move the player to the right.
float Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_ySpeed()
Returns the vertical speed in pixels per tick.
Positive values move the player down.
std:: int8_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_frozen() const
Returns how many more ticks the player stays frozen.
0 when the player isn't frozen, at most 127. Assigning a positive value freezes the player for that long, 0 or less unfreezes it.
void Jazz2:: Scripting:: Legacy:: jjPLAYER:: freeze(bool frozen)
Freezes or unfreezes the player.
| Parameters | |
|---|---|
| frozen | Pass false to unfreeze the player instead |
Freezing lasts 3 seconds (210 ticks).
std:: int32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_currTile()
Returns the tile the player is in, packed into one number.
Equals int(xPos) / 32 + int(yPos) / 32 * 65536. Mostly useful for telling whether the player moved to another tile since an earlier check.
bool Jazz2:: Scripting:: Legacy:: jjPLAYER:: startSugarRush(std:: int32_t time)
Gives the player a sugar rush.
| Parameters | |
|---|---|
| time | Duration in ticks |
| Returns | False without starting it while a boss fight is active or the game mode doesn't allow it, true otherwise |
std:: int32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_fastfire() const
Returns the delay between shots in ticks.
35 without any fast fire, lowered by about 3 ticks with each fast fire collected, down to 6. An assigned value is rounded to the closest number of fast fires.
std:: int8_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_currWeapon() const
Returns the selected weapon.
A 1-based WEAPON::Weapon number. Assigning a number that isn't a weapon is ignored.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_invincibility() const
Returns the remaining invincibility in ticks.
Assigning a positive value makes the player invincible for that long, 0 or less ends it.
std:: uint32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_lightType() const
Returns the type of light the player emits.
LIGHT::PLAYER by default. With it and light 0 the player has the light of the game, any other type or size gives it that light as an object of the type and size has it, LIGHT::NONE none.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_blink() const
Returns how many more ticks the player blinks.
A blinking player, as after being hurt, can't be hurt again. Assigning a positive value starts blinking, 0 ends it without touching other kinds of invincibility.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: extendInvincibility(std:: int32_t duration)
Extends the player's invincibility.
| Parameters | |
|---|---|
| duration | Ticks to add, a negative value shortens it but never below 0 |
| Returns | The remaining invincibility in ticks |
std:: int32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_food() const
Returns how much food the player has eaten.
Assigning it only changes the counter, use startSugarRush() to start a sugar rush.
bool Jazz2:: Scripting:: Legacy:: jjPLAYER:: testForCoins(std:: int32_t numberOfCoins)
Spends coins if the player has enough.
| Returns | True if the player had at least numberOfCoins coins, which are then taken away, false otherwise with the coins left untouched |
|---|
Works like a coin warp whose outcome the script decides.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_gems(std:: uint32_t type) const
Returns how many gems of the given color the player has.
Indexed by GEM::Color. Other indices read as 0 and ignore writes.
bool Jazz2:: Scripting:: Legacy:: jjPLAYER:: testForGems(std:: int32_t numberOfGems,
std:: uint32_t type)
Spends gems of one color if the player has enough.
| Parameters | |
|---|---|
| numberOfGems | Number of gems to take away |
| type | GEM::Color of the gems |
| Returns | True if the player had enough gems, which are then taken away, false otherwise with the gems left untouched |
std:: int32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_shieldType() const
Returns the shield the player has.
A SHIELD::Shield value. Assigning a value that isn't a known shield is ignored.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_shieldTime() const
Returns how many more ticks the shield lasts.
0 when the player has no shield.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_rolling() const
Returns how many more ticks the player stays rolled up in a ball.
Assigning a positive value rolls the player up and takes away control until the time runs out, 0 ends it at once.
std:: int8_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_direction() const
Returns the direction the player faces.
-1 for left, 1 for right. Assigning a negative value turns the player left, a positive one right and 0 is ignored.
std:: int8_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_playerID() const
Returns the index of the player.
The index among all players of the game, also in online multiplayer.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_localPlayerID() const
Returns the index of the player among local players.
0 to 3 in a splitscreen game, the index of jjLocalPlayers.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_team() const
Returns the team the player belongs to.
A TEAM::Color value, TEAM::BLUE outside of team-based game modes.
bool Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_running() const
Returns whether the player is running.
Follows the run key. Assigning it holds or releases the run key for the current tick, or switches running on or off when the run key toggles.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_doubleJumpCount() const
Returns how many double jumps the player made in the air.
Counted since the player last stood on the ground. Once it reaches jjCHARACTER::
bool Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_alreadyDoubleJumped() const
Returns whether the player already used the double jump in the air.
Older form of doubleJumpCount, which should be used instead.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_stoned()
Returns how many more ticks the player stays dizzy.
Assigning a positive value makes the player dizzy for that long.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_helicopter() const
Returns how many more ticks the helicopter ears last.
0 when the player isn't using them.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_idle() const
Returns how many ticks the player has been idle.
0 when the player isn't idle.
void Jazz2:: Scripting:: Legacy:: jjPLAYER:: suckerTube(std:: int32_t xSpeed,
std:: int32_t ySpeed,
bool center,
bool noclip,
bool trigSample)
Moves the player as if touching a sucker tube event.
| Parameters | |
|---|---|
| xSpeed | Horizontal speed |
| ySpeed | Vertical speed |
| center | Whether to center the player in its tile on the axis it doesn't move along, moving diagonally with it every tick can get the player stuck |
| noclip | Whether the player passes through walls while in the tube |
| trigSample | Currently ignored |
void Jazz2:: Scripting:: Legacy:: jjPLAYER:: poleSpin(float xSpeed,
float ySpeed,
std:: uint32_t delay)
Swings the player around a pole and launches it.
void Jazz2:: Scripting:: Legacy:: jjPLAYER:: spring(float xSpeed,
float ySpeed,
bool keepZeroSpeeds,
bool sample)
Bounces the player as if touching a spring.
| Parameters | |
|---|---|
| xSpeed | Horizontal speed |
| ySpeed | Vertical speed |
| keepZeroSpeeds | If true, an axis with zero speed keeps the player's current speed instead of stopping it |
| sample | Whether to play the spring sound |
Speeds use the scale of springs in the original game, 16 for red, 24 for green and 32 for blue, so an upward red spring is spring(0, -16, ...). Nothing happens if both speeds are 0.
bool Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_isIdle() const
Returns whether the player is an idle server that isn't in the level.
Always false, a server of this game without a player of its own has no such player.
bool Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_isInGame() const
Returns whether the player actually takes part in the game.
Currently the same as isActive.
std:: int8_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_light() const
Returns the size of the light the player emits.
As jjOBJ::
std:: uint32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_fur() const
Returns the player's fur colors packed into one number.
Four palette indices, one per byte, the first fur section in the lowest byte. Assigning it recolors the player at once. furGet() and furSet() work with the four indices separately.
void Jazz2:: Scripting:: Legacy:: jjPLAYER:: getFur(std:: uint8_t& a,
std:: uint8_t& b,
std:: uint8_t& c,
std:: uint8_t& d) const
Reads the player's four fur colors.
Each output receives the palette index of one fur section.
void Jazz2:: Scripting:: Legacy:: jjPLAYER:: setFur(std:: uint8_t a,
std:: uint8_t b,
std:: uint8_t c,
std:: uint8_t d)
Changes the player's four fur colors.
Each argument is the palette index of one fur section. The player is recolored at once.
bool Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_antiGrav() const
Returns whether the player falls upwards.
The player stands on ceilings, jumps down and is drawn upside down. Its speeds stay as the world has them (ySpeed is still positive downwards), turning it on or off keeps how it moves. In online multiplayer, it's synced from the machine that sets it to the server and to the other players.
bool Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_noclipMode() const
Returns whether the player passes through walls.
While true, the player also ignores gravity and keeps its current speed. Turning it on can trap the player if the level isn't built for it.
std:: uint8_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_lighting() const
Returns the ambient light level of the player's view.
100 means full brightness. Assigning it changes the ambient light for this player only.
std:: uint8_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: resetLight()
Resets the ambient light to the level's default.
| Returns | The new ambient light level |
|---|
bool Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_playerKeyLeftPressed()
Returns whether the left key is held.
Assigning it simulates pressing or releasing the key.
bool Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_playerKeyRightPressed()
Returns whether the right key is held.
Assigning it simulates pressing or releasing the key.
bool Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_playerKeyUpPressed()
Returns whether the up key is held.
Assigning it simulates pressing or releasing the key.
bool Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_playerKeyDownPressed()
Returns whether the down key is held.
Assigning it simulates pressing or releasing the key.
bool Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_playerKeyFirePressed()
Returns whether the fire key is held.
Assigning it simulates pressing or releasing the key. Holding it doesn't fire every tick, shots still wait for fastfire.
bool Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_playerKeySelectPressed()
Returns whether the weapon select key is held.
Assigning it simulates pressing or releasing the key.
bool Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_playerKeyJumpPressed()
Returns whether the jump key is held.
Assigning it simulates pressing or releasing the key.
bool Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_playerKeyRunPressed()
Returns whether the run key is held.
Assigning it simulates pressing or releasing the key.
bool Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_powerup(std:: uint8_t index)
Returns whether the given weapon is powered up.
Indexed by a 1-based WEAPON::Weapon number, WEAPON::CURRENT is the selected weapon. Other indices that aren't a weapon read as false and ignore writes.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_ammo(std:: uint8_t index) const
Returns how much ammo the player has of the given weapon.
Indexed by a 1-based WEAPON::Weapon number, in whole rounds, WEAPON::CURRENT is the selected weapon. Other indices that aren't a weapon read as 0 and ignore writes. For a weapon with jjWEAPON::infinite set, assigning a positive value gives the player unlimited ammo of it.
bool Jazz2:: Scripting:: Legacy:: jjPLAYER:: offsetPosition(std:: int32_t xPixels,
std:: int32_t yPixels)
Moves the player by the given offset at once.
| Parameters | |
|---|---|
| xPixels | Pixels to move to the right |
| yPixels | Pixels to move down |
| Returns | Always true |
The move skips the warp effect, which makes it suitable for levels that loop seamlessly.
bool Jazz2:: Scripting:: Legacy:: jjPLAYER:: warpToTile(std:: int32_t xTile,
std:: int32_t yTile,
bool fast)
Warps the player to the center of the given tile.
| Parameters | |
|---|---|
| xTile | Horizontal tile coordinate |
| yTile | Vertical tile coordinate |
| fast | If true, the player moves at once instead of using the warp effect |
| Returns | Always true |
bool Jazz2:: Scripting:: Legacy:: jjPLAYER:: warpToID(std:: uint8_t warpID,
bool fast)
Warps the player to the warp target with the given ID.
| Parameters | |
|---|---|
| warpID | ID of the Warp Target event |
| fast | If true, the player moves at once instead of using the warp effect |
| Returns | False if the level has no warp target with that ID |
std:: uint32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: morph(bool rabbitsOnly,
bool morphEffect)
Changes the player into the next character.
| Parameters | |
|---|---|
| rabbitsOnly | Whether to cycle only through the rabbits |
| morphEffect | Whether to show the morphing effect |
| Returns | The player's character afterwards |
Cycles through Jazz, Spaz, Lori (TSF only), the bird and the frog, skipping characters whose sprites aren't available.
std:: uint32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: morphTo(std:: uint32_t charNew,
bool morphEffect)
Changes the player into the given character.
| Parameters | |
|---|---|
| charNew | The new character |
| morphEffect | Whether to show the morphing effect |
| Returns | The player's character afterwards |
The player stays as it is if the sprites of that character aren't available.
std:: uint32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: revertMorph(bool morphEffect)
Changes the player back into its original character.
| Parameters | |
|---|---|
| morphEffect | Whether to show the morphing effect |
| Returns | The player's character afterwards |
Works like the Revert Morph event, the player becomes charOrig.
std:: uint32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_charCurr() const
Returns the player's current character.
A CHAR::Char value, which is also the index of the animation set the character uses. Change it with morphTo() or revertMorph().
std:: uint32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_charOrig() const
Returns the character the player started the level as.
The character revertMorph() and the Revert Morph event change the player back into. Only CHAR::JAZZ, CHAR::SPAZ and CHAR::LORI are accepted when assigning it, other values are ignored.
bool Jazz2:: Scripting:: Legacy:: jjPLAYER:: hurt(std:: int8_t damage,
bool forceHurt,
jjPLAYER* attacker)
Hurts the player.
| Parameters | |
|---|---|
| damage | Number of hearts to take away |
| forceHurt | If true, any invincibility or blinking ends first, so it doesn't block the hit |
| attacker | Currently ignored |
| Returns | Whether the player lost health |
std:: uint32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_timerState() const
Returns the state of the player's timer.
A TIMER::State value. Change it with timerStart(), timerPause(), timerResume() and timerStop().
bool Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_timerPersists() const
Returns whether the player's timer keeps running when the player dies.
If false, dying stops the timer.
std:: uint32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: timerStart(std:: int32_t ticks,
bool startPaused)
Starts the player's timer.
| Parameters | |
|---|---|
| ticks | Time on the timer in ticks |
| startPaused | Whether the timer starts paused |
| Returns | TIMER::PAUSED if startPaused is true, TIMER::STARTED otherwise |
The HUD shows the time left at the top of the view, unless onDrawPlayerTimer() draws it.
std:: uint32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: timerPause()
Pauses the player's timer.
| Returns | The timer state afterwards |
|---|
Only a running timer is paused, a stopped one stays stopped.
std:: uint32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: timerResume()
Resumes the player's paused timer.
| Returns | The timer state afterwards |
|---|
std:: uint32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: timerStop()
Stops the player's timer.
| Returns | TIMER::STOPPED |
|---|
The timer function isn't called.
void Jazz2:: Scripting:: Legacy:: jjPLAYER:: timerFunction(const String& functionName)
Sets the function called when the player's timer runs out, by its name.
The function is called only when the timer reaches zero by itself. Without one, onPlayerTimerEnd() is called. Passing the function itself instead of its name is preferred.
void Jazz2:: Scripting:: Legacy:: jjPLAYER:: timerFunctionPtr(void* function)
Sets the function called when the player's timer runs out.
The function is called only when the timer reaches zero by itself.
void Jazz2:: Scripting:: Legacy:: jjPLAYER:: timerFunctionFuncPtr(void* function)
Sets the function called when the player's timer runs out.
The function is called only when the timer reaches zero by itself, with the player whose timer ran out.
bool Jazz2:: Scripting:: Legacy:: jjPLAYER:: activateBoss(bool activate)
Activates the bosses of the level.
| Parameters | |
|---|---|
| activate | Whether to activate the bosses or end the boss fight of the player |
| Returns | Always true |
Works like the player touching an Activate Boss event. With activate false only the player's bossActivated is cleared, which hides the boss meter, the bosses go on.
bool Jazz2:: Scripting:: Legacy:: jjPLAYER:: limitXScroll(std:: uint16_t left,
std:: uint16_t width)
Limits horizontal scrolling of the camera.
| Parameters | |
|---|---|
| left | Left edge in tiles |
| width | Width in tiles |
| Returns | Always true |
Works like a Limit X Scroll event.
void Jazz2:: Scripting:: Legacy:: jjPLAYER:: cameraFreezeFF(float xPixel,
float yPixel,
bool centered,
bool instant)
Fixes the camera at the given position.
| Parameters | |
|---|---|
| xPixel | Horizontal position in pixels |
| yPixel | Vertical position in pixels |
| centered | If true, the position is the center of the view, otherwise its top left corner |
| instant | If true, the camera jumps there, otherwise it scrolls there smoothly |
The camera stays there until cameraUnfreeze() is called.
void Jazz2:: Scripting:: Legacy:: jjPLAYER:: cameraFreezeBF(bool xUnfreeze,
float yPixel,
bool centered,
bool instant)
Fixes the camera vertically.
| Parameters | |
|---|---|
| xUnfreeze | If true, the camera follows the player horizontally again, otherwise the horizontal axis stays as it is |
| yPixel | Vertical position in pixels |
| centered | If true, the position is the center of the view, otherwise its top edge |
| instant | If true, the camera jumps there, otherwise it scrolls there smoothly |
void Jazz2:: Scripting:: Legacy:: jjPLAYER:: cameraFreezeFB(float xPixel,
bool yUnfreeze,
bool centered,
bool instant)
Fixes the camera horizontally.
| Parameters | |
|---|---|
| xPixel | Horizontal position in pixels |
| yUnfreeze | If true, the camera follows the player vertically again, otherwise the vertical axis stays as it is |
| centered | If true, the position is the center of the view, otherwise its left edge |
| instant | If true, the camera jumps there, otherwise it scrolls there smoothly |
void Jazz2:: Scripting:: Legacy:: jjPLAYER:: cameraFreezeBB(bool xUnfreeze,
bool yUnfreeze,
bool centered,
bool instant)
Releases or keeps each axis of the camera.
| Parameters | |
|---|---|
| xUnfreeze | If true, the camera follows the player horizontally again |
| yUnfreeze | If true, the camera follows the player vertically again |
| centered | Has no effect with this overload |
| instant | If true, the camera jumps back to the player, otherwise it scrolls there smoothly |
Passing true for both axes is the same as cameraUnfreeze().
void Jazz2:: Scripting:: Legacy:: jjPLAYER:: cameraUnfreeze(bool instant)
Lets the camera follow the player again.
| Parameters | |
|---|---|
| instant | If true, the camera jumps back to the player, otherwise it scrolls there smoothly |
void Jazz2:: Scripting:: Legacy:: jjPLAYER:: showText(const String& text,
std:: uint32_t size)
Shows text on the screen.
| Parameters | |
|---|---|
| text | Text to show |
| size | STRING::Size of the text |
The text appears the way a Text event shows it.
void Jazz2:: Scripting:: Legacy:: jjPLAYER:: showTextByID(std:: uint32_t textID,
std:: uint32_t offset,
std:: uint32_t size)
Shows one of the level's text strings on the screen.
| Parameters | |
|---|---|
| textID | Index of the text string in the level |
| offset | Which part of the string to show, when it is split into parts by | characters |
| size | STRING::Size of the text |
Works like a Text event.
std:: uint32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_fly() const
Returns how the player is flying.
FLIGHT::FLYCARROT while using a copter, FLIGHT::AIRBOARD while on an airboard, FLIGHT::NONE otherwise. Assigning one of these values starts or ends flying accordingly.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: fireBulletDirection(std:: uint8_t gun,
bool depleteAmmo,
bool requireAmmo,
std:: uint32_t direction)
Makes the player fire in a direction.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: fireBulletAngle(std:: uint8_t gun,
bool depleteAmmo,
bool requireAmmo,
float angle)
Makes the player fire at an angle.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_subscreenX() const
Returns the left edge of the player's part of the screen.
In pixels from the left edge of the window, 0 unless the screen is split.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_subscreenY() const
Returns the top edge of the player's part of the screen.
In pixels from the top edge of the window, 0 unless the screen is split.
float Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_cameraX() const
Returns the left edge of the player's view of the level.
In pixels, measured in layer 4.
float Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_cameraY() const
Returns the top edge of the player's view of the level.
In pixels, measured in layer 4.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_lapTimeCurrent() const
Returns how many ticks the current lap has lasted.
Counted from the tick the previous lap was seen finished, the first lap from when the script first looked.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_lapTimes(std:: uint32_t index) const
Returns the time of one of the last 5 laps in ticks.
Index 0 is the most recent lap, 0 for a lap not run yet.
bool Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_isAdmin() const
Returns whether the player is an administrator of the server.
The players of the server's own machine always are.
bool Jazz2:: Scripting:: Legacy:: jjPLAYER:: hasPrivilege(const String& privilege,
std:: uint32_t moduleID) const
Returns whether the player has the given administrator privilege.
The game has no privileges of their own, an administrator (get_
bool Jazz2:: Scripting:: Legacy:: jjPLAYER:: doesCollide(const jjOBJ* object,
bool always) const
Returns whether the player touches the given object.
| Parameters | |
|---|---|
| object | The object to test |
| always | Currently ignored |
The pixels of the frame the object shows are tested against the player's hitbox.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: getObjectHitForce(const jjOBJ* target) const
Returns how hard the player would hit an object.
1 during a buttstomp or a sugar rush, -1 during another special move, -101 when running fast into the frozen target, 0 otherwise.
bool Jazz2:: Scripting:: Legacy:: jjPLAYER:: objectHit(jjOBJ* target,
std:: int32_t force,
std:: uint32_t playerHandling)
Makes the player collide with an object as with one of playerHandling.
| Parameters | |
|---|---|
| target | The object to collide with |
| force | How hard the player hits: 0 for a plain touch, 1 for a buttstomp or sugar rush, -1 for a special move |
| playerHandling | How the object is handled |
| Returns | Whether the object was affected |
Even where they aren't. With scriptedCollisions the object is told of it, HANDLING::HURT, HANDLING::ENEMYBULLET and HANDLING::ENEMY with force 0 hurt the player (the bullet explodes), HANDLING::ENEMY with an attack hurts an object that exists only for the script, HANDLING::PICKUP collects one as the pickup of the game of its event. An object of the game collides as the game has it otherwise.
bool Jazz2:: Scripting:: Legacy:: jjPLAYER:: isEnemy(const jjPLAYER* victim) const
Returns whether this player can hurt the given player.
Always false in single player and cooperation. Otherwise the rules of the game mode apply, for example nobody but the ring holder and the bottom feeder in Roast Tag, or nobody in jail in Jailbreak.
std:: uint32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_spriteMode() const
Returns the sprite mode the player is drawn with.
A SPRITE::Mode value, SPRITE::NORMAL by default. SPRITE::INVISIBLE hides the player.
std:: uint16_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_curAnim() const
Returns the animation the player shows.
An index into jjAnimations, 0 if the animation shown has no counterpart there.
std:: uint32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_curFrame() const
Returns the sprite frame the player shows.
An index into jjAnimFrames, equal to the first frame of curAnim plus frameID.
std:: uint8_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: get_frameID() const
Returns the frame the player shows within its animation.
0 is the first frame of curAnim.
bool Jazz2:: Scripting:: Legacy:: jjPLAYER:: FireScriptedWeapon(WeaponType weaponType,
float aimAngle = -1.0f,
Actors:: ActorBase** lastShot = nullptr)
Fires the bullets of a weapon whose bullets a script controls, see LevelScriptLoader::
With aimAngle (0 up, clockwise) one bullet at that angle, as fireBullet(), lastShot gets the last one.
Variable documentation
float Jazz2:: Scripting:: Legacy:: jjPLAYER:: jumpStrength
Vertical speed the player gains by jumping.
In pixels per tick, -10 by default. A running jump adds to it as it always does.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: warpID
Warp the player is currently going through.
0 unless the player is in the animation of a warp: then the ID of the warp event plus one, or 1 for a warp without an ID (a bonus warp, a script). Fast warps take no time, they read 0.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: bossNumber
Object ID of the boss whose health the boss meter shows.
While bossActivated is true, the meter shows the energy of that object as a share of the energy of its entry in jjObjectPresets. 0 if there's no boss. The game fills it in while one of its own bosses is active, otherwise it keeps what the script assigned.
bool Jazz2:: Scripting:: Legacy:: jjPLAYER:: bossActive
Whether a boss fight is active.
Set by the Activate Boss event or activateBoss(). The game keeps it in line with its own bosses, but a value the script assigns stays until the game's own boss state changes.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: platform
Object ID of the object the player stands on, or pushes (see jjOBJ::
0 when the player isn't standing on an object scripts can see. The game refreshes it, so assigning it has no lasting effect.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: flag
Object ID of the flag the player carries.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: clientID
ID of the machine the player plays on.
0 for the machine of the server and in a game without one. A client of an online server has the number the server gave it when it connected (a client knows its own once its level is loaded), the one that jjSendPacket() takes.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: buttstomp
Buttstomp phase of the player.
The game refreshes it, so assigning it has no lasting effect.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: helicopterElapsed
Ticks spent using helicopter ears since the last jump.
std:: int32_t Jazz2:: Scripting:: Legacy:: jjPLAYER:: specialMove
Special move the player is performing.
0 when there's none. The game refreshes it, so assigning it has no lasting effect.
bool Jazz2:: Scripting:: Legacy:: jjPLAYER:: isLocal
Whether the player plays on this machine.
False for a player of another machine in online multiplayer and for a handle that doesn't stand for a player.
bool Jazz2:: Scripting:: Legacy:: jjPLAYER:: isActive
Whether the handle stands for a player in the level.
When false, most other properties read as 0 and writes to them are ignored.