lweapon#
Inherits: sprite
Weapons active on the screen from the hero. See Screen->LoadLWeapon() and Screen->CreateLWeapon().
Variables#
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
bool |
|
bool |
|
int |
|
int |
|
int |
|
bool |
|
int |
|
int |
|
const int |
|
bool |
|
int |
|
int |
|
int |
|
int |
|
int |
|
untyped[] |
|
int |
|
int |
|
int |
|
int |
|
int |
|
bool |
|
bool[] |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int[] |
|
int[] |
|
const int |
UID deprecated |
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.
The special info for the lweapon.
Used by wind lweapons, instead of Level, to determine their effects.
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.
bool CollDetection ๐ Source
If the weaponโs collision is enabled. Set to false to disable collision entirely.
The ID of the item 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.
For lweapons, the level of the weapon.
The weapon script running on this weapon.
The UseWeapon property for this weapon.
If set to a value greater than 0, all collisions with npcs will use this as if it was the weaponโs ID for calculating the defense value for it.
e.g., if a LW_MAGIC weapon is set to a Weapon of LW_BRANG, when it collides with an npc, the npc will use Defense:ref:LW_BRANG<libs_std_var_lw_brang> to resolve its effects.
Some weapons will also trigger map flags, and screen combos as if the natural weapon was the value set as ->Weapon.,
e.g. If you set a LW_BRANG weapon to a ->Weapon of LW_SWORD, it will cut bushes.
The default defense value for this weapon.
If set greater than 0, then when this weapon collides with an npc, if that npc has its Defense``n`` value set to NONE for this weaponโs type, it will resolve using this Defense value (e.g. Stun).
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.
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!
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
.
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_
).
bool MakeAngular() ๐ Source
If the weapon is not Angular, makes it Angular, and sets its Angle based on its Dir.
bool MakeDirectional() ๐ Source
If the weapon is Angular, makes it not Angular, and sets 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.