lweapon#
Inherits: sprite
Weapons active on the screen from the hero.
Load with Screen->LWeapons[], Screen->LoadLWeapon(), or Screen->CreateLWeapon().
Variables#
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
bool |
|
bool |
|
int |
|
int |
|
int |
|
bool |
|
int |
|
int |
|
const int |
|
bool |
CollDetection deprecated |
int |
|
int |
|
int |
|
int |
|
untyped[] |
|
int |
|
int |
|
int |
|
int |
|
bool |
|
int |
|
int |
|
int |
|
int |
|
bool |
|
bool[] |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int[] |
|
int[] |
|
int[] |
|
const int |
UID deprecated |
int |
ID deprecated |
int |
Family deprecated |
Functions#
Enumerations#
Player weapon types. Used with Screen->CreateLWeapon().
LWeaponType LW_SWORD = 1
This cannot be created.
LWeaponType LW_WAND = 12
This cannot be created.
LWeaponType LW_CANDLE = 12
This cannot be created.
LWeaponType LW_HAMMER = 19
This cannot be created.
LWeaponType LW_HOOKSHOT = 20
This cannot be created.
LWeaponType LW_CANEOFBYRNA = 27
This cannot be created.
LWeaponType LW_BUGNET = 52
This cannot be created.
LWeaponType LW_ARROW = 8
LWeaponType LW_BEAM = 2
Sword beam.
LWeaponType LW_BRANG = 3
LWeaponType LW_BOMB = 6
LWeaponType LW_BOMBBLAST = 4
Bomb explosion.
LWeaponType LW_SBOMB = 7
LWeaponType LW_SBOMBBLAST = 5
Super Bomb explosion.
LWeaponType LW_FIRE = 9
LWeaponType LW_WHISTLE = 10
Whistle music - kills Digdogger.
LWeaponType LW_BAIT = 11
LWeaponType LW_MAGIC = 13
Wand magic.
LWeaponType LW_WIND = 15
Whistle whirlwind.
LWeaponType LW_REFMAGIC = 16
Reflected wand magic.
LWeaponType LW_REFFIREBALL = 17
Reflected fireball.
LWeaponType LW_REFROCK = 18
Reflected rock.
LWeaponType LW_REFBEAM = 28
Reflected sword beam.
LWeaponType LW_SPARKLE = 23
LWeaponType LW_FIRESPARKLE = 24
Damages enemies.
LWeaponType LW_SCRIPT1 = 31
Dummy weapon, for use with scripts.
LWeaponType LW_SCRIPT2 = 32
LWeaponType LW_SCRIPT3 = 33
LWeaponType LW_SCRIPT4 = 34
LWeaponType LW_SCRIPT5 = 35
LWeaponType LW_SCRIPT6 = 36
LWeaponType LW_SCRIPT7 = 37
LWeaponType LW_SCRIPT8 = 38
LWeaponType LW_SCRIPT9 = 39
LWeaponType LW_SCRIPT10 = 40
LWeaponType LW_ICE = 41
Unimplemented.
LWeaponType LW_THROWN = 44
LWeaponType LW_REFARROW = 53
LWeaponType LW_REFFIRE = 54
LWeaponType LW_REFFIRE2 = 55
Variable descriptions#
value LWeaponType (LW_)
The weapon type. Some types have hardcoded behaviors.
For lweapons, the level of the weapon.
The special info for the lweapon.
Used by wind lweapons, instead of Level, to determine their effects.
deprecated_getter SPRITEMAXLWPN
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.
alias Damage
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.
value WeaponDeadState (WDS_)
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.
Deprecated: use sprite::NoCollisionTimer instead!
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.
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<globals_enum_member_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 Defensen 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.
value UnblockableBitflags (UNBLOCK_)
Unblockable bitflags.
If > 0, ticks down each frame. When ticking down to 0, kills the weapon.
When the weapon lands from the air, it bounces based on this multiplier of itβs downward velocity, and BounceAdd. Must be >= 0.
Added in version 3.0.
When the weapon lands from the air, it bounces based on BounceMult, adding this value in px/frame after the multiplier. Using a negative value will dampen the bounce, and is recommended to prevent the weapon from bouncing many tiny rapid bounces as itβs velocity gets small.
bool DisableTriggers π Source
Added in version 3.0.
Set to true, this prevents the weapon from triggering any Combo Triggers. Also affects some melee weapon checks (ex. slash/pound combos).
This being false means that scripts are not CAUSING it to ignore triggers- it does not account for other things that may disable the weapon from activating triggers (ex. the Hammer being above the playerβs head).
Added in version 3.0.
If < 0, the weapon behaves as normal. If == 0, the weapon pierces infinitely. If > 0, each time the weapon hits an enemy or the player, counts down by 1. When counting down from β1β to β0β, the weapon dies. Some weapons have special behavior; ex. bomb blasts do not die, but will have their collision disabled so they cannot hit further targets- and the PierceCount set on a lit bomb will apply to the bombβs blast.
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.
index WeaponFlag (WFLAG_)
A set of weapon flags.
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
index WeaponSpriteIndex (WPN_SPRITE_)
The burning light radii associated with sprites of the weapon.
int[] BurnLightOffset π Source
index WeaponSpriteIndex (WPN_SPRITE_)
Added in version 3.0.
The burning light offsets associated with sprites of the weapon.
Deprecated:
This is now just the internal engine ID, which is the same as doing
<int>some_sprite.
value LWeaponType (LW_)
Deprecated: Exactly the same as Type, use that instead.
value LWeaponType (LW_)
Deprecated: Exactly the same as Type, use that instead.
Function descriptions#
void Max(int value) π Source
Sets the max number of weapons allowed to a new value. Range 1-1024.
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 sprite_id) π Source
Loads the graphical information from the spritedata indicated by
sprite_id.
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_) (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.
Added in version 3.0.