Jazz2::Actors::Weapons::CustomShot class

Shot of a custom weapon of the level.

Flies, bounces, homes in, pierces and goes off as the level describes its weapon (see WeaponShotOptions). A shot of ShotLook::Beam doesn't fly, it reaches from the muzzle as far as it would fly in its time. The parameters it's activated with are the upgrades, the WeaponType of the weapon and flags: PlaysSound, IsBubble.

Base classes

class ShotBase
Base class of a shot from a player's weapon.

Public static variables

static std::uint8_t PlaysSound constexpr
Flag of the parameters, the shot plays the sound of firing.
static std::uint8_t IsBubble constexpr
Flag of the parameters, the shot is an air bubble in place of a shot under water (see WeaponOptions::ReplacedByBubbles).

Constructors, destructors, conversion operators

CustomShot()
Creates a new instance.

Public functions

void OnFire(const std::shared_ptr<ActorBase>& owner, Vector2f gunspotPos, Vector2f speed, float angle, bool isFacingLeft)
Called when the shot is fired.
auto OnHandleCollision(ActorBase* other) -> bool override
Called when the object collides with another object.
auto GetWeaponType() -> WeaponType override
Returns the weapon of the game it's made from, GetSourceWeapon() is the weapon of the level that fired it.
auto GetSourceWeapon() -> WeaponType override
Returns the weapon of the level that fired the shot, the same as GetWeaponType() unless the level made its own.
auto ThawsFrozen() const -> bool override
Returns true if the shot thaws what's frozen.

Protected functions

auto OnActivatedAsync(const 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.
void OnUpdateHitbox() override
Called when the hitbox needs to be updated.
void OnEmitLights(SmallVectorImpl<LightEmitter>& lights) override
Called when emitting lights.
auto OnPerish(ActorBase* collider) -> bool override
Called when the object has no health left and should perish.
void OnHitWall(float timeMult) override
Called when the object hits a wall.
void OnRicochet() override
Called on shot ricochet.