eweapon#

Inherits: sprite

Weapons active on the screen from enemies. See Screen->LoadEWeapon() and Screen->CreateEWeapon().

Variables#

int

ID

int

Type

int

Family

int

Level

int

Max

int

Angle

int

Step

int

NumFrames

int

Frame

int

Power

int

Damage

bool

Angular

bool

Behind

int

ASpeed

int

FlashCSet

int

DeadState

bool

Flash

int

OriginalTile

int

OriginalCSet

const int

TotalDYOffset

npc

Parent

bool

CollDetection

int

Script

untyped[]

InitD

int

Unblockable

int

Timeout

int

DegAngle

int

Vx

int

Vy

bool

AutoRotate

bool[]

Flags

int

DeathItem

int

DeathDropset

int

DeathItemPFlags

int

DeathSprite

int

DeathSFX

int

LiftLevel

int

LiftTime

int

LiftHeight

int[]

Sprites

int[]

BurnLightRadius

const int

UID deprecated

int

ParentUID deprecated

Functions#

int

Max() deprecated

void

Max(int value) deprecated

bool

isValid()

void

UseSprite(int spriteid)

void

Explode(int mode)

void

Remove()

bool

Switch(int effect)

void

MakeAngular()

void

MakeDirectional()

void

Own(bitmap b)

void

Own(paldata b)

void

Own(file b)

void

Own(directory b)

void

Own(stack b)

void

Own(randgen b)

void

OwnArray(untyped array)

void

OwnObject(untyped object)

Variable descriptions#

int ID πŸ”— Source

The weapon type of the weapon. Some types have hardcoded behaviors.


int Type πŸ”— Source

The weapon type of the weapon. Some types have hardcoded behaviors. Same as ID.


int Family πŸ”— Source

The weapon type of the weapon. Some types have hardcoded behaviors. Same as ID.


int Level πŸ”— Source

For lweapons, the level of the weapon.


int Max πŸ”— Source

Returns the max number of weapons currently allowed.


int Angle πŸ”— Source

The angle of the weapon, in radians for Angle or degrees for DegAngle. Has no real effect if the weapon is not Angular.


int Step πŸ”— Source

The movement speed of the weapon, in 100th’s/pixel per frame.


int NumFrames πŸ”— Source

The number of frames in the weapon’s animation.


int Frame πŸ”— Source

The current frame number that the animation is on.


int Power πŸ”— Source

The amount of damage the weapon deals.


int Damage πŸ”— Source

The amount of damage the weapon deals.


bool Angular πŸ”— Source

If the weapon is angular (instead of directional)


bool Behind πŸ”— Source

If true, the weapon’s sprite will draw behind the Hero and enemies.


int ASpeed πŸ”— Source

The speed of the animation, in frames per frame.


int FlashCSet πŸ”— Source

The secondary CSet used for flashing.


int DeadState πŸ”— Source

The deadstate of the weapon, denoted by the WeaponDeadState (WDS_) constants.


bool Flash πŸ”— Source

If the weapon is flashing or not. When flashing, it changes between its CSet and FlashCSet.


int OriginalTile πŸ”— Source

The starting tile of the weapon’s animation.


int OriginalCSet πŸ”— Source

The starting cset of the weapon.


const int TotalDYOffset πŸ”— Source

the weapon’s total visual Y-offset.


npc Parent πŸ”— Source

The ID of the item, or pointer of the npc (respectively for lweapon, and for eweapon) that created this weapon.

Weapons created by script have a default Parent of -1 (lweapon) and <npc>-0.0001 (eweapon).

For lweapons, this value determines what item editor index to read item flags from.

Setting it to an item of a class that does not normally generate the given weapon

type may have unexpected effects.


bool CollDetection πŸ”— Source

If the weapon’s collision is enabled. Set to false to disable collision entirely.


int Script πŸ”— Source

The weapon script running on this weapon.


untyped[] InitD πŸ”— Source

The 8 InitD[] arguments for the weapon script.


int Unblockable πŸ”— Source

A bitwise flagset of unblockable flags, using the UNBLOCK_ constants.


int Timeout πŸ”— Source

If > 0, ticks down each frame. When ticking down to 0, kills the weapon.


int DegAngle πŸ”— Source

The angle of the weapon, in radians for Angle or degrees for DegAngle. Has no real effect if the weapon is not Angular.


int Vx πŸ”— Source

The velocity on the X or Y axis. Setting these will make the weapon Angular if it isn’t already, and will adjust the weapon’s Angle and Step speed.


int Vy πŸ”— Source

The velocity on the X or Y axis. Setting these will make the weapon Angular if it isn’t already, and will adjust the weapon’s Angle and Step speed.


bool AutoRotate πŸ”— Source

If true, the weapon’s β€˜Rotation’ will be automatically set based on its Angle.


bool[] Flags πŸ”— Source

A set of weapon flags.

Valid indices: WeaponFlagIndex (WFLAG_).


int DeathItem πŸ”— Source

If > -1, this item will be spawned when the weapon dies.


int DeathDropset πŸ”— Source

If > -1, this item dropset will be rolled for a drop when the weapon dies.


int DeathItemPFlags πŸ”— Source

The itemsprite::Pickup to use for the item dropped via DeathItem or DeathDropset.


int DeathSprite πŸ”— Source

If > -1, display this Sprite Data sprite when the weapon dies.


int DeathSFX πŸ”— Source

If > 0, this SFX will be played when the weapon dies.


int LiftLevel πŸ”— Source

NOTE: Not implemented - currently only lweapon can be lifted.


int LiftTime πŸ”— Source

The time it takes to lift this weapon via engine lifting.


int LiftHeight πŸ”— Source

The height to lift this weapon to via engine lifting.


int[] Sprites πŸ”— Source

Various sprites used by the weapon.


int[] BurnLightRadius πŸ”— Source

The burning light radii associated with sprites of the weapon.

Valid indices: WeaponSpriteIndex (WPN_SPRITE_).


const int UID πŸ”— Source

Warning

Deprecated!


int ParentUID πŸ”— Source

Warning

Deprecated!


Function descriptions#

int Max() πŸ”— Source

Returns the max number of weapons currently allowed.

Warning

Deprecated! Use Max instead!


void Max(int value) πŸ”— Source

Sets the max number of weapons allowed to a new value. Range 1-1024.

Warning

Deprecated! Use Max instead!


bool isValid() πŸ”— Source

Returns true if this pointer points to a valid weapon. If this returns false, using any other value of this pointer will error.


void UseSprite(int spriteid) πŸ”— Source

Loads the graphical information from the spritedata indicated by spriteid to the weapon.


void Explode(int mode) πŸ”— Source

Creates an explosion particle effect in mode 0, 1, or 2 of the sprite.


void Remove() πŸ”— Source

Instantly deletes the weapon.


bool Switch(int effect) πŸ”— Source

Switch the Hero with this sprite.

Valid values for effect: SwitchEffect (SW_EFF_).


void MakeAngular() πŸ”— Source

If the weapon is not Angular, makes it Angular, and sets its Angle based on its Dir.


void MakeDirectional() πŸ”— Source

If the weapon is Angular, makes it not Angular, and set its Dir based on its Angle


void Own(bitmap b) πŸ”— Source

Grants β€˜Ownership’ of the parameter object to the weapon.


void Own(paldata b) πŸ”— Source

Grants β€˜Ownership’ of the parameter object to the weapon.


void Own(file b) πŸ”— Source

Grants β€˜Ownership’ of the parameter object to the weapon.


void Own(directory b) πŸ”— Source

Grants β€˜Ownership’ of the parameter object to the weapon.


void Own(stack b) πŸ”— Source

Grants β€˜Ownership’ of the parameter object to the weapon.


void Own(randgen b) πŸ”— Source

Grants β€˜Ownership’ of the parameter object to the weapon.


void OwnArray(untyped array) πŸ”— Source

Grants β€˜Ownership’ of the parameter object to the weapon.


void OwnObject(untyped object) πŸ”— Source

Grants β€˜Ownership’ of the parameter object to the weapon.