eweapon#
Inherits: sprite
Weapons active on the screen from enemies.
Load with Screen->EWeapons[], Screen->LoadEWeapon(), or Screen->CreateEWeapon().
Variables#
Functions#
Enumerations#
EWeapon types. Used with Screen->CreateEWeapon() and Screen->LoadEWeapon().
EWeaponType EW_ARROW = 130
EWeaponType EW_BRANG = 131
EWeaponType EW_BEAM = 132
Sword beam.
EWeaponType EW_ROCK = 133
EWeaponType EW_MAGIC = 134
EWeaponType EW_FIREBALL = 129
EWeaponType EW_FIREBALL2 = 145
Arcing boss fireball.
EWeaponType EW_BOMB = 137
Projectile bomb.
EWeaponType EW_BOMBBLAST = 135
Bomb explosion.
EWeaponType EW_SBOMB = 138
Projectile super bomb.
EWeaponType EW_SBOMBBLAST = 136
Super bomb explosion.
EWeaponType EW_FIRETRAIL = 139
EWeaponType EW_FIRE = 140
EWeaponType EW_WIND = 141
Wind wizzrobe magic.
EWeaponType EW_FIRE2 = 142
EWeaponType EW_SCRIPT1 = 31
Dummy weapon, for use with scripts.
EWeaponType EW_SCRIPT2 = 32
EWeaponType EW_SCRIPT3 = 33
EWeaponType EW_SCRIPT4 = 34
EWeaponType EW_SCRIPT5 = 35
EWeaponType EW_SCRIPT6 = 36
EWeaponType EW_SCRIPT7 = 37
EWeaponType EW_SCRIPT8 = 38
EWeaponType EW_SCRIPT9 = 39
EWeaponType EW_SCRIPT10 = 40
Variable descriptions#
value EWeaponType (EW_)
The weapon type. Some types have hardcoded behaviors.
For lweapons, the level of the weapon.
deprecated_getter Max
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.
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.
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_)
The weaponβs 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.
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
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.
Deprecated.
value EWeaponType (EW_)
Deprecated: Exactly the same as Type, use that instead.
value EWeaponType (EW_)
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 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_) (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
Added in version 3.0.