Functions

bool isValid int X int Y int Jump int DrawStyle int ID int OriginalTile int Tile int CSet int FlashCSet int NumFrames int Frame int ASpeed int Delay bool Flash int Flip int Pickup int Extend int TileWidth int TileHeight int HitWidth int HitHeight int HitZHeight int HitXOffset int HitYOffset int DrawXOffset int DrawYOffset int DrawZOffset float Misc[]
Back to Top
Pages: Global | FFC | Link | Screen | Item | Weapon | Itemdata | Game | NPC | std | string

Item Functions and Variables Documentation

Functions and Properties

Return Type Function Information
boolisValid()
Returns whether this item pointer is still valid. An item pointer
becomes invalid when Link picks up the item, the item fades away
or Link leaves the screen. Accessing any variables using an
invalid item pointer prints an error message to allegro.log and
does nothing.
intX
The item's X position on the screen, in pixels. Float values passed to this will be cast to int.
intY
The item's Y position on the screen, in pixels. Float values passed to this will be cast to int.
intJump
The item's upward velocity, in pixels. If negative, the item will fall.
The downward acceleration of Gravity (in Init Data) modifies this value every frame.
intDrawStyle
An integer representing how the item is to be drawn. Use one of the
DS_ constants in std.zh to set or compare this value.
intID
This item's ID number. Use the I_ constants to compare this value. The effect of writing to this field is currently undefined.
intOriginalTile
The starting tile of the item's animation.
intTile
The current tile associated with this item.
intCSet
This item's CSet.
intFlashCSet
The CSet used during this item's flash frames, if this item flashes.
intNumFrames
The number of frames in this item's animation.
intFrame
The tile that is this item's current animation frame.
intASpeed
The speed at which this item animates, in screen frames.
intDelay
The amount of time the animation is suspended after the last frame
before the animation restarts, in item frames. That is, the total
number of screen frames of extra wait is Delay*ASpeed.
boolFlash
Whether or not the item flashes. A flashing item alternates between
its CSet and its FlashCSet.
intFlip
Whether and how the item's tiles should be flipped.
0: No flip
1: Horizontal flip
2: Vertical flip
3: Both (180 degree rotation)
intPickup
The pickup flags of the item, which determine what happens when Link
picks up the item. Its value consists of flags OR'd (|) together; use
the IP_ constants in std.zh to set or compare these values.
A special note about IP_ENEMYCARRIED: if the Quest Rule "Hide Enemy-
Carried Items" is set, then an item carried by an enemy will have its
X and Y values set to -128 while the enemy is carrying it. If this
flag is removed from such an item, then it will be moved to the enemy's
on-screen location.
If you are not comfortable with performing binary operations, use the ItemPickup functions from std.zh.
intExtend
Whether to extend the sprite of the item.
intTileWidth
The number of tile columns composing the sprite.
Writing to this is ignored unless Extend is set to values >=3.
intTileHeight
The number of tile rows composing the sprite.
Writing to this is ignored unless Extend is set to values >=3.
intHitWidth
The width of the sprite's hitbox, or collision rectangle.
intHitHeight
The height of the sprite's hitbox, or collision rectangle.
intHitZHeight
The Z-axis height of the sprite's hitbox, or collision rectangle.
The greater it is, the higher Link must jump or fly over the sprite to avoid picking up the item.
intHitXOffset
The X offset of the sprite's hitbox, or collision rectangle.
Setting it to positive or negative values will move the sprite's hitbox left or right.
intHitYOffset
The Y offset of the sprite's hitbox, or collision rectangle.
Setting it to positive or negative values will move the sprite's hitbox up or down.
intDrawXOffset
The X offset of the sprite.
Setting it to positive or negative values will move the sprite's tiles left or right relative to its position.
intDrawYOffset
The Y offset of the sprite.
Setting it to positive or negative values will move the sprite's tiles up or down relative to its position.
intDrawZOffset
The Z offset of the sprite.
floatMisc[]
An array of 16 miscellaneous variables for you to use as you please.
Note that lweapons and eweapons possess exactly the same attributes
although their designation affects how they are treated by the engine.
The values here correspond to both the lweapon and eweapon type.