Jazz2::Scripting::Legacy::ScriptSceneryObject class

Destructible scenery as an object of the game, for a level script that drives it.

Scenery is a part of its tile, which breaks by itself (see Tiles::TileMap::SetTileEventFlags()), the scripts of JJ2+ drive it as an object of BEHAVIOR::DESTRUCTSCENERY though - e.g. to give it a light. The object is made only where a script gave the template of the event what only an object can have (see ScriptObjectHost::NeedsHost()), so a level that doesn't pays nothing for it. It neither collides nor is drawn, its own behavior only tells the script what the tile does, as measured in JJ2+ - it sleeps (STATE::SLEEP) until the tile breaks (STATE::DONE), collapsing scenery is in STATE::EXTRA for the one update it collapses in.

Base classes

class Jazz2::Actors::ActorBase
Base class of an object.

Constructors, destructors, conversion operators

ScriptSceneryObject()

Public functions

auto IsCollapsing() const -> bool
Returns true for the update the tile collapses in, until the next one.
auto IsBroken() const -> bool
Returns true once the tile is broken.

Protected functions

auto OnActivatedAsync(const Actors::ActorActivationDetails& details) -> Task<bool> override
Called when the object is created and activated.
void OnUpdate(float timeMult) override
Called every frame to update the object state.
auto OnDraw(RenderQueue& renderQueue) -> bool override
Called when the object needs to be drawn.