eweapon#
Inherits: sprite
Weapons active on the screen from enemies. See Screen->LoadEWeapon() and Screen->CreateEWeapon().
Variables#
Functions#
Variable descriptions#
The weapon type of the weapon. Some types have hardcoded behaviors.
The weapon type of the weapon. Some types have hardcoded behaviors. Same as ID.
The weapon type of the weapon. Some types have hardcoded behaviors. Same as ID.
For lweapons, the level of the weapon.
Returns the max number of weapons currently allowed.
The angle of the weapon, in radians for Angle or degrees for DegAngle.
Has no real effect if the weapon is not Angular
.
The movement speed of the weapon, in 100thβs/pixel per frame.
The number of frames in the weaponβs animation.
The current frame number that the animation is on.
The amount of damage the weapon deals.
The amount of damage the weapon deals.
If the weapon is angular (instead of directional)
If true, the weaponβs sprite will draw behind the Hero and enemies.
The speed of the animation, in frames per frame.
The secondary CSet used for flashing.
The deadstate of the weapon, denoted by the WeaponDeadState (WDS_
) constants.
If the weapon is flashing or not. When flashing, it changes between its CSet and FlashCSet.
The starting tile of the weaponβs animation.
The starting cset of the weapon.
const int TotalDYOffset π Source
the weaponβs total visual Y-offset.
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.
The weapon script running on this weapon.
The 8 InitD[] arguments for the weapon script.
A bitwise flagset of unblockable flags, using the UNBLOCK_
constants.
If > 0, ticks down each frame. When ticking down to 0, kills the weapon.
The angle of the weapon, in radians for Angle or degrees for DegAngle.
Has no real effect if the weapon is not Angular
.
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.
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.
If true, the weaponβs βRotationβ will be automatically set based on its Angle.
A set of weapon flags.
Valid indices: WeaponFlagIndex (WFLAG_
).
If > -1
, this item will be spawned when the weapon dies.
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.
If > -1
, display this Sprite Data sprite when the weapon dies.
If > 0
, this SFX will be played when the weapon dies.
NOTE: Not implemented - currently only lweapon can be lifted.
The time it takes to lift this weapon via engine lifting.
The height to lift this weapon to via engine lifting.
Various sprites used by the weapon.
int[] BurnLightRadius π Source
The burning light radii associated with sprites of the weapon.
Valid indices: WeaponSpriteIndex (WPN_SPRITE_
).
Warning
Deprecated!
Warning
Deprecated!
Function descriptions#
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!
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.
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.
Grants βOwnershipβ of the parameter object to the weapon.
void Own(directory b) π Source
Grants βOwnershipβ of the parameter object to the weapon.
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.