Skip to content
EvilEngine.Api.Weapons

IProjectile interface

public interface IProjectile

A projectile in flight, as its behaviour and the weapon that launched it see it. It never hits its owner. A number or vector it’s given that isn’t finite, or is past a float’s range, throws ArgumentOutOfRangeException naming it, and so does an orientation of all zeros.

Assembly
EvilEngine.Api
Commit
4ff877b1

Members

Model property

ContentId Model { get; set; }

The model it draws as, which can change, like a missile’s motor lighting.

Position property

MapVector Position { get; set; }

Where it is.

Velocity property

MapVector Velocity { get; set; }

How fast it’s moving, in meters a second. Setting it steers a traced projectile or sets a physics body’s speed.

Orientation property

Orientation Orientation { get; set; }

How it’s turned.

Age property

double Age { get; }

Seconds since it was launched.

Time property

double Time { get; }

The session’s clock in seconds.

Interval property

double Interval { get; }

The tick’s length in seconds.

Alive property

bool Alive { get; }

Whether it’s still in the world.

Stuck property

bool Stuck { get; }

Whether it has stuck in something.

Body property

IPhysicsBody? Body { get; }

Its physics body when it’s physical, or null.

Glow property

ProjectileGlow? Glow { get; set; }

Its glowing sprite, which it can change, like a grenade blinking faster.

Trail property

ProjectileTrail? Trail { get; set; }

Its trail, which it can start or stop.

Trace method

WeaponTrace Trace(MapVector from, MapVector to)

A line through the world, its props and its people, leaving out its owner.

Sound method

void Sound(ContentId sound)

Plays a sound record where it is.

Strike method

void Strike(double damage, MapVector impulse, DamageKind kind = DamageKind.Generic)

Hurts the person it just touched by the damage, of the kind given, or pushes the prop it just touched by the impulse in kg·m/s.

Explode method

void Explode(WeaponBlast blast)

Removes it and sets off a blast where it is, lifted a unit off the surface it hit.

Stick method

void Stick(double seconds)

Stops it where it is for so many seconds, at most 60, then removes it.

Remove method

void Remove()

Takes it out of the world.