std_functions.zh#
Functions#
bool |
|
bool |
|
bool |
|
bool |
|
void |
AimEWeapon(eweapon e, int aimtype) |
void |
AimLWeapon(lweapon l, npc n, int aimtype) |
void |
AimLWeapon(lweapon l, int aimtype) |
int |
Angle(int x1, int y1, int x2, int y2) |
int |
AngleDir4(int angle) |
int |
AngleDir8(int angle) |
int |
AtFrontX(int dir) |
int |
AtFrontY(int dir) |
bool |
|
bool |
|
bool |
|
bool |
|
bool |
CanWalk(int x, int y, int dir, int step, bool full_tile) |
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
CenterX(itemsprite it) |
int |
|
int |
|
int |
|
int |
|
int |
CenterY(itemsprite it) |
bool |
CircleCollision(int c1x, int c1y, int radius1, int c2x, int c2y, int radius2) |
int |
Clamp(int x, int low, int high) |
void |
ClearTileBlock(int reffirst, int reflast) |
void |
ClearTileRow(int ref, int length) |
bool |
|
bool |
|
bool |
|
bool |
|
bool |
|
bool |
|
bool |
Collision(itemsprite a, lweapon b) |
bool |
Collision(itemsprite a, eweapon b) |
bool |
Collision(itemsprite a, npc b) |
bool |
Collision(itemsprite a, itemsprite b) |
bool |
|
bool |
|
bool |
|
bool |
Collision(ffc f, itemsprite b) |
bool |
|
bool |
|
bool |
|
bool |
|
bool |
|
bool |
Collision(lweapon a, itemsprite b) |
bool |
Collision(eweapon a, itemsprite b) |
bool |
Collision(npc a, itemsprite b) |
bool |
|
bool |
|
bool |
|
bool |
Collision(itemsprite a, ffc b) |
bool |
|
bool |
|
bool |
|
bool |
|
bool |
|
bool |
|
int |
ComboAt(int x, int y) |
bool |
ComboFI(int x, int y, int flag) |
bool |
ComboFI(int loc, int flag) |
int |
ComboX(int rpos) |
int |
ComboY(int rpos) |
int |
RegionRelativeScreenX(int scr) |
int |
RegionRelativeScreenY(int scr) |
int |
RegionWorldOffsetX(int scr) |
int |
RegionWorldOffsetY(int scr) |
bool |
RegionIncludesScreen(int scr) |
int |
RegionGetFFCId(int scr, int index) |
T |
Cond(bool cond, T a, T b) deprecated |
bool |
ConsumeKey(int level = |
void |
CopyTileBlock(int sourcefirst, int sourcelast, int destfirst) |
void |
CopyTileRow(int source, int dest, int length) |
void |
CounterAdd(int counter, int amount) |
void |
CounterReduce(int counter, int amount) |
CreateEWeaponAt(int id, int x, int y) |
|
CreateItemAt(int id, int x, int y) |
|
CreateLWeaponAt(int id, int x, int y) |
|
CreateNPCAt(int id, int x, int y) |
|
CreateTimeoutItem(int id, int x, int y) |
|
int |
CrossProduct(int x1, int y1, int x2, int y2) |
void |
DCounterAdd(int counter, int amount) |
void |
DCounterReduce(int counter, int amount) |
int |
DefeatedLevelBoss(int level) |
int |
DirNormal(int dir) |
int |
DirAbnormal(int dir) |
int |
Dir4Angle(int dir) |
int |
DirAngle(int dir) |
int |
Dir4Rad(int dir) |
int |
DirRad(int dir) |
int |
DistanceSquared(int x, int y) |
bool |
|
int |
Div(int x, int y) |
int |
|
int |
DMapMapGraphicsIndex(int dmapID) |
int |
|
int |
DMapToMap(int screen, int dmap) |
int |
DotProduct(int x1, int y1, int x2, int y2) |
void |
DrawString(int layer, int x, int y, int font, int color, int background_color, int format, int opacity, char32[] ptr, int start) |
void |
DrawString(int layer, int x, int y, int font, int color, int background_color, int format, int opacity, char32[] ptr, int start, int end) |
void |
DrawTileSimple(int x, int y, int tile, int color) |
void |
DrawToLayer(ffc f, int layer, int opacity) |
void |
DrawToLayer(npc n, int layer, int opacity) |
void |
DrawToLayer(lweapon l, int layer, int opacity) |
void |
DrawToLayer(eweapon e, int layer, int opacity) |
void |
DrawToLayer(itemsprite i, int layer, int opacity) |
bool |
|
bool |
|
int |
|
int |
FirstComboFlagOf(int t, int layer) |
int |
FirstComboTypeOf(int t, int layer) |
int |
FirstComboOf(int t, int layer) |
int |
|
int |
|
int |
|
int |
|
bool |
GetDMapFlag(int dmap, int flag) |
int |
GetFirstItemOf(int itemclass) |
int |
GetHighestLevelItem(int itemclass) |
int |
|
int |
GetHighestLevelItemOwned(int itemclass) |
GetInfoString(int shop_id, int str_id) |
|
void |
GetInfoString(char32[] buffer, int shop_id, int str_id) |
int |
GetInfoStringID(int shop_id, int str_id) |
bool |
GetItemPickup(itemsprite i, int pickup) |
int |
GetLayerComboC(int layer, int pos) |
int |
GetLayerComboD(int layer, int pos) |
int |
GetLayerComboF(int layer, int pos) |
int |
GetLayerComboI(int layer, int pos) |
int |
GetLayerComboS(int layer, int pos) |
int |
GetLayerComboT(int layer, int pos) |
bool |
GetLevelItem(int level, int itm) |
bool |
GetLevelItem(int itm) |
int |
GetMapScreenEFlag(mapdata md, int category, int flag) |
int |
GetMapScreenEFlag(int mapid, int scr, int category, int flag) |
bool |
GetMapscreenFlag(mapdata m, mapscreenflags flagid) |
bool |
GetMapscreenFlag(int mapid, int scr, mapscreenflags flagid) |
void |
GetMessage(int ID, char32[] ptr) |
bool |
GetNPCMiscFlag(npc e, int flag) |
void |
GetNPCName(int npc_id, char32[] buffer) |
bool |
GetScreenDBit(int dmap, int screen, int d, int bit) |
bool |
GetScreenDBit(int screen, int d, int bit) |
bool |
GetScreenDBit(int d, int bit) |
int |
GridX(int x) |
int |
GridY(int y) |
int |
HasBossKey(int level = |
int |
HasCompass(int level = |
bool |
|
int |
HasMap(int level = |
bool |
HasKey(int level = |
int |
HasTriforce(int level) |
int |
|
int |
|
int |
|
int |
HitboxBottom(npc a) |
int |
HitboxBottom(ffc a) |
int |
|
int |
|
int |
|
int |
HitboxLeft(npc a) |
int |
HitboxLeft(ffc a) |
int |
|
int |
|
int |
|
int |
HitboxRight(npc a) |
int |
HitboxRight(ffc a) |
int |
|
int |
|
int |
|
int |
|
int |
|
bool |
IsBackgroundLayer(int layer) |
bool |
IsBackgroundLayer(int layer, mapdata m) |
int |
InFrontX(int dir, int dist) |
int |
InFrontY(int dir, int dist) |
bool |
|
bool |
|
bool |
|
bool |
|
bool |
|
bool |
IsEven(int x) |
bool |
|
bool |
IsOdd(int x) |
bool |
IsPit(int position) |
bool |
|
bool |
IsWater(int position) |
int |
LargeDistance(int x1, int y1, int x2, int y2, int divisor) |
int |
LastComboFlagOf(int t, int layer) |
int |
LastComboTypeOf(int t, int layer) |
int |
LastComboOf(int t, int layer) |
bool |
|
bool |
|
bool |
|
bool |
|
int |
Lerp(int p1, int p2, int t) |
bool |
|
bool |
|
bool |
|
bool |
LinkCollision(npc b) |
bool |
LinkCollision(ffc f) |
LoadEWeaponOf(int type) |
|
LoadLWeaponOf(int type) |
|
LoadNPCOf(int type) |
|
LoadNPCOfType(int type) |
|
int |
LogToBase(int x, int base) |
int |
longrand(int max) |
int |
MapToDMap(int screen, int dmap) |
void |
|
void |
|
void |
MCounterAdd(int counter, int amount) |
void |
MCounterReduce(int counter, int amount) |
int |
Midpoint(int p1, int p2) |
NextToLink(int id, int distx, int disty) |
|
NextToLink(int id, int dist) |
|
void |
NoAction() |
int |
|
int |
NumEWeaponsOf(int type) |
int |
NumItemsOf(int type) |
int |
NumKeys(int level = |
int |
NumLWeaponsOf(int type) |
int |
NumNPCsOf(int type) |
int |
NumTriforcePieces(int maxlevel = |
int |
OppositeDir(int dir) |
int |
RadianAngle(int x1, int y1, int x2, int y2) |
int |
RadianAngleDir4(int angle) |
int |
RadianAngleDir8(int angle) |
int |
Rand(int min, int max) |
int |
Randf(int n) |
int |
Randf(int n1, int n2) |
bool |
RectCollision(int box1_x1, int box1_y1, int box1_x2, int box1_y2, int box2_x1, int box2_y1, int box2_x2, int box2_y2) |
void |
|
void |
|
void |
Remove(itemsprite i) |
void |
|
bool |
|
bool |
|
bool |
|
bool |
|
int |
Round(int x) |
int |
RotateScalePointX(int x, int y, int centerX, int centerY, int degrees, int scaleX, int scaleY) |
int |
RotateScalePointY(int x, int y, int centerX, int centerY, int degrees, int scaleX, int scaleY) |
int |
RotatePointX(int x, int y, int centerX, int centerY, int degrees) |
int |
RotatePointY(int x, int y, int centerX, int centerY, int degrees) |
int |
ScalePointX(int x, int centerX, int scale) |
int |
ScalePointY(int y, int centerY, int scale) |
LoadMD(int map, int scr) |
|
LoadMapDataDM(int dmap, int scr) |
|
void |
ScreenCopy(int destmap, int destscr, int srcmap, int srcscr) |
int |
ScreenEFlag(int category, int flag) |
int |
ScreenEFlag(int m, int scr, int category, int flag) |
int |
ScreenEFlag(mapdata md, int category, int flag) |
int |
ScreenFlag(int category, int flag) |
int |
ScreenFlag(int m, int scr, int category, int flag) |
int |
ScreenFlag(mapdata m, int category, int flag) |
int |
|
void |
SetDMapFlag(int dmap, int flag, bool state) |
void |
SetEquipment(int a, int b) |
void |
SetItemPickup(itemsprite i, int pickup, bool state) |
void |
SetLayerComboC(int layer, int pos, int val) |
void |
SetLayerComboD(int layer, int pos, int val) |
void |
SetLayerComboF(int layer, int pos, int val) |
void |
SetLayerComboI(int layer, int pos, int val) |
void |
SetLayerComboS(int layer, int pos, int val) |
void |
SetLayerComboT(int layer, int pos, int val) |
void |
SetLevelItem(int level, int itm, bool state) |
void |
SetLevelItem(int itm, bool state) |
void |
SetMapscreenFlag(mapdata m, mapscreenflags flagid, bool state) |
void |
SetMapscreenFlag(int mapid, int scr, mapscreenflags flagid, bool state) |
void |
SetScreenDBit(int dmap, int screen, int d, int bit, bool state) |
void |
SetScreenDBit(int screen, int d, int bit, bool state) |
void |
SetScreenDBit(int d, int bit, bool state) |
void |
SetVisibleOnDungeonMap(bool state) |
void |
SetVisibleOnDungeonMap(int scr, bool state) |
void |
SetVisibleOnDungeonMap(dmapdata dm, bool state) |
void |
SetVisibleOnDungeonMap(dmapdata dm, int scr, bool state) |
void |
SetVisibleOnDungeonMap(dmapdata dm, int x, int y, bool state) |
void |
SetVisibleOnDungeonMap(bool no_offset, bool state) |
void |
SetVisibleOnDungeonMap(int scr, bool no_offset, bool state) |
void |
SetVisibleOnDungeonMap(dmapdata dm, bool no_offset, bool state) |
void |
SetVisibleOnDungeonMap(dmapdata dm, int scr, bool no_offset, bool state) |
int |
Sign(int n) |
int |
SmoothStep(int p1, int p2, int t) |
int |
SpinDir(int dir) |
int |
SpinDir8(int dir) |
bool |
SquareCollision(int c1x, int c1y, int side1, int c2x, int c2y, int side2) |
bool |
SquareCollision2(int c1x, int c1y, int radius1, int c2x, int c2y, int radius2) |
void |
SwapTileBlock(int first, int last, int second) |
void |
SwapTileRow(int first, int second, int length) |
int |
TurnTowards(int X, int Y, int targetX, int targetY, int radian_angle, int t = |
bool |
UsingItem(int id) |
int |
vbound(int x, int high, int low) |
int |
VBound(int x, int high, int low) |
int |
VectorX(int len, int angle) |
int |
VectorY(int len, int angle) |
bool |
VisibleOnDungeonMap(int x, int y) |
bool |
|
bool |
VisibleOnDungeonMap(int scr) |
bool |
|
bool |
VisibleOnDungeonMap(dmapdata dm, int scr) |
bool |
VisibleOnDungeonMap(dmapdata dm, int x, int y) |
bool |
VisibleOnDungeonMap(bool no_offset) |
bool |
VisibleOnDungeonMap(int scr, bool no_offset) |
bool |
VisibleOnDungeonMap(dmapdata dm, bool no_offset) |
bool |
VisibleOnDungeonMap(dmapdata dm, int scr, bool no_offset) |
void |
SetVisibleOnDungeonMap(int x, int y, bool state) |
void |
|
void |
WaitNoAction(int frames) |
int |
WeaponTypeToID(int wpnt) |
void |
getScrTimeName(char32[] buf, int scrtime) |
untyped |
wrap(untyped x, int mod) |
FireEWeaponAngle(int type, int x, int y, int radians, int step, int dmg, int sprite = |
|
FireEWeaponDegAngle(int type, int x, int y, int degrees, int step, int dmg, int sprite = |
|
FireEWeaponDir(int type, int x, int y, int dir, int step, int dmg, int sprite = |
|
FireEWeaponAtHero(int type, int x, int y, bool angular, int step, int dmg, int sprite = |
|
FireLWeaponAngle(int type, int x, int y, int radians, int step, int dmg, int sprite = |
|
FireLWeaponDegAngle(int type, int x, int y, int degrees, int step, int dmg, int sprite = |
|
FireLWeaponDir(int type, int x, int y, int dir, int step, int dmg, int sprite = |
|
bool |
GetLevelSwitchState(int level, int switchNum) |
void |
SetLevelSwitchState(int level, int switchNum, bool state) |
int |
AdjacentCombo(int cmb, int dir) |
bool |
ChooseB() |
void |
ClearFFC(int ffc_id) |
int |
Distance(int x1, int y1, int x2, int y2) |
int |
Choose(int a, int b) |
int |
Choose(int a, int b, int c) |
int |
Choose(int a, int b, int c, int d) |
int |
Choose(int a, int b, int c, int d, int e) |
int |
Choose(int a, int b, int c, int d, int e, int f) |
bool |
blink(int[] clkptr, int frames) |
Function descriptions#
Returns if Link is above an npc.
Returns if Link is above, below, left of, or right of an ffc.
bool Above(eweapon n) π Source
Returns if Link is above, below, left of, or right of an eweapon.
bool Above(lweapon n) π Source
Returns if Link is above, below, left of, or right of an lweapon.
void AimEWeapon(eweapon e, int aimtype) π Source
Various methods for shooting at Link and at random
void AimLWeapon(lweapon l, npc n, int aimtype) π Source
Aiming at enemies and at random
void AimLWeapon(lweapon l, int aimtype) π Source
int Angle(int x1, int y1, int x2, int y2) π Source
Returns the direction of the vector from point 1 to point 2, in degrees from -180 to 180. (0 = right)
int AngleDir4(int angle) π Source
Converts a counterclockwise degree angle (from -180 to 180) into one of the four standard directions (DIR_UP, DIR_DOWN, DIR_LEFT, DIR_RIGHT) used by ZC.
int AngleDir8(int angle) π Source
Converts a counterclockwise degree angle (from -180 to 180) into one of the eight standard directions (DIR_UP etc.) used by ZC.
int AtFrontX(int dir) π Source
Returns the correct offset to be at the front of a sprite facing in the direction βdirβ
int AtFrontY(int dir) π Source
Returns if Link is below an npc.
Returns if Link is above, below, left of, or right of an ffc.
bool Below(eweapon n) π Source
Returns if Link is above, below, left of, or right of an eweapon.
bool Below(lweapon n) π Source
Returns if Link is above, below, left of, or right of an lweapon.
bool CanWalk(int x, int y, int dir, int step, bool full_tile) π Source
This should allow any scripted object to easily mimic Link styled LOZ solidity collision checking, be it Link, FFCs, or enemies. Note - You should use full_tile=true if you donβt want the upper eight pixels to overlap solid combos as per LOZ1 behavior.
Get the X and Y coordinates at the center of a sprite
int CenterX(ffc anFFC) π Source
int CenterX(npc anNPC) π Source
int CenterX(eweapon anEWeapon) π Source
int CenterX(lweapon anLWeapon) π Source
int CenterX(itemsprite it) π Source
int CenterY(ffc anFFC) π Source
int CenterY(npc anNPC) π Source
int CenterY(eweapon anEWeapon) π Source
int CenterY(lweapon anLWeapon) π Source
int CenterY(itemsprite it) π Source
bool CircleCollision(int c1x, int c1y, int radius1, int c2x, int c2y, int radius2) π Source
Returns true if the two circles c1 and c2 overlap.
int Clamp(int x, int low, int high) π Source
Clamps x to the range of low, high.
void ClearTileBlock(int reffirst, int reflast) π Source
Clears a block of tiles defined by diagonal corners βreffirstβ and βreflastβ
void ClearTileRow(int ref, int length) π Source
Clears a row of tiles of length βlengthβ starting from tile βrefβ
bool Collision(lweapon a, eweapon b) π Source
Returns true if there is a collision between the hitboxes of an lweapon and an eweapon.
bool Collision(lweapon a, lweapon b) π Source
A collision between an lweapon and an lweapon.
bool Collision(eweapon a, eweapon b) π Source
A collision between an eweapon and an eweapon.
bool Collision(lweapon a, npc b) π Source
A collision between an lweapon and an npc.
bool Collision(eweapon a, npc b) π Source
A collision between an eweapon and an npc.
bool Collision(npc a, npc b) π Source
A collision between an npc and an npc.
bool Collision(itemsprite a, lweapon b) π Source
A collision between an item and an lweapon.
bool Collision(itemsprite a, eweapon b) π Source
A collision between an item and an eweapon.
bool Collision(itemsprite a, npc b) π Source
A collision between an item and an npc.
bool Collision(itemsprite a, itemsprite b) π Source
A collision between an item and an item.
bool Collision(ffc f, lweapon b) π Source
A collision between an ffc and an lweapon. Uses TileWidth and TileHeight for the FFCβs bounding box. Ignores the Z axis.
bool Collision(ffc f, eweapon b) π Source
A collision between an ffc and an eweapon. Uses TileWidth and TileHeight for the FFCβs bounding box. Ignores the Z axis.
bool Collision(ffc f, npc b) π Source
A collision between an ffc and an npc. Uses TileWidth and TileHeight for the FFCβs bounding box. Ignores the Z axis.
bool Collision(ffc f, itemsprite b) π Source
A collision between an ffc and an item. Uses TileWidth and TileHeight for the FFCβs bounding box. Ignores the Z axis.
bool Collision(ffc f, ffc f2) π Source
A collision between an ffc and an ffc. Uses TileWidth and TileHeight for the FFCsβ bounding boxes.
bool Collision(ffc f, int radius1, ffc f2, int radius2) π Source
A circular collision between an ffc and an ffc. Uses TileWidth and TileHeight to find the center of the FFCs.
bool Collision(eweapon a, lweapon b) π Source
So that you donβt have to remember the ordering of the args
bool Collision(npc a, lweapon b) π Source
bool Collision(npc a, eweapon b) π Source
bool Collision(lweapon a, itemsprite b) π Source
bool Collision(eweapon a, itemsprite b) π Source
bool Collision(npc a, itemsprite b) π Source
bool Collision(lweapon a, ffc b) π Source
bool Collision(eweapon a, ffc b) π Source
bool Collision(npc a, ffc b) π Source
bool Collision(itemsprite a, ffc b) π Source
bool Collision(eweapon b) π Source
Returns true if there is a collision between Linkβs hitbox and the eweaponβs. This only checks hitboxes.
bool Collision(lweapon b) π Source
Returns true if there is a collision between Linkβs hitbox and the lweaponβs. This only checks hitboxes.
bool Collision(itemsprite b) π Source
Returns true if there is a collision between Linkβs hitbox and the itemβs. This only checks hitboxes.
bool Collision(npc b) π Source
Returns true if there is a collision between Linkβs hitbox and the npcβs. This only checks hitboxes. Uses TileWidth and TileHeight to find the center of the FFCs.
bool Collision(ffc f) π Source
Returns true if there is a collision between Linkβs hitbox and the FFCβs. This only checks hitboxes.
bool Collision(combodata f) π Source
Only legal from combodata scripts as this->Collision
int ComboAt(int x, int y) π Source
Finds the location of a combo, given its (x,y) coordinates on the screen
bool ComboFI(int x, int y, int flag) π Source
Returns true if the combo at β(x, y)β has either an inherent or place flag of type βflagβ
bool ComboFI(int loc, int flag) π Source
Returns true if the combo at βlocβ has either an inherent or place flag of type βflagβ
int ComboX(int rpos) π Source
Note: all of the Region->ID
checks in these various functions are minor performance improvements. The functions
likely work even without that.
Return the coordinates of a combo on the screen
int ComboY(int rpos) π Source
int RegionRelativeScreenX(int scr) π Source
Given a screen index, returns the screen offset in the X direction in the current region.
Example: If the region origin is screen 5, RegionRelativeScreenX(8) == 3
int RegionRelativeScreenY(int scr) π Source
Given a screen index, returns the screen offset in the Y direction in the current region.
int RegionWorldOffsetX(int scr) π Source
Given a screen index, returns the world offset in the x direction for the current region.
int RegionWorldOffsetY(int scr) π Source
Given a screen index, returns the world offset in the y direction for the current region.
bool RegionIncludesScreen(int scr) π Source
Returns true if the given screen index is inside the current region. When not in a region, only returns true if scr is equal to Game->CurScreen.
int RegionGetFFCId(int scr, int index) π Source
Returns the FFC ID of the screen scr
, which must be within the current Region.
index
is the screen-specific index of the FFC (what you would see in the editor on that screen).
T Cond(bool cond, T a, T b) π Source
Returns a if cond is true, else b. Overloaded.
Warning
Deprecated! Consider using a ternary expression instead: cond ? a : b
bool ConsumeKey(int level = -1
) π Source
void CopyTileBlock(int sourcefirst, int sourcelast, int destfirst) π Source
Copies a block of tiles defined by diagonal corners βsourcefirstβ and βsourcelastβ onto the block starting with top left tile βdestfirstβ
void CopyTileRow(int source, int dest, int length) π Source
Copies a row of tiles of length βlengthβ from βsourceβ onto βdestβ
void CounterAdd(int counter, int amount) π Source
Add to a counter without rollover.
void CounterReduce(int counter, int amount) π Source
Reduce a counter without rollvoer.
eweapon CreateEWeaponAt(int id, int x, int y) π Source
Create an EWeapon and set its X and Y position in one command
itemsprite CreateItemAt(int id, int x, int y) π Source
Create an Item and set its X and Y position in one command
lweapon CreateLWeaponAt(int id, int x, int y) π Source
Create an LWeapon and set its X and Y position in one command
npc CreateNPCAt(int id, int x, int y) π Source
Create an NPC and set its X and Y position in one command
itemsprite CreateTimeoutItem(int id, int x, int y) π Source
Creates a timeout item (like a rupee or heart)
int CrossProduct(int x1, int y1, int x2, int y2) π Source
Returns the cross product of two vectors.
void DCounterAdd(int counter, int amount) π Source
D Add to a drain counter without rollover.
void DCounterReduce(int counter, int amount) π Source
Reduce a drain counter without rollvoer.
int DefeatedLevelBoss(int level) π Source
Returns if Link has defeated the dungeon boss for a given level.
int DirNormal(int dir) π Source
Normalizes a dir between 8 and 15
int DirAbnormal(int dir) π Source
The reverse
int Dir4Angle(int dir) π Source
Returns angle of the given direction.
int DirAngle(int dir) π Source
Returns angle of the given direction.
int Dir4Rad(int dir) π Source
Same as Dir4Angle, but return value is measured in radians.
int DirRad(int dir) π Source
Same as DirAngle, but return value is measured in radians.
int DistanceSquared(int x, int y) π Source
Returns the squared distance of a vector.
bool DistXY(ffc a, int dist) π Source
returns true if Link is within βdistβ distance of an ffc on both its X and its Y axis.
int Div(int x, int y) π Source
Returns the Quotient only of x divided by y
int DMapMapGraphicsIndex(dmapdata dm) π Source
Returns the correct index for getting minimap, or dungeon map tiles and csets to use with dmapdata->MiniMapTile[] and similar instructions. Accepts a dmapdata pointer.
int DMapMapGraphicsIndex(int dmapID) π Source
Returns the correct index for getting minimap, or dungeon map tiles and csets to use with dmapdata->MiniMapTile[] and similar instructions. Accepts a dmap ID as an integer.
int DMapMapGraphicsIndex() π Source
Returns the correct index for getting minimap, or dungeon map tiles and csets to use with dmapdata->MiniMapTile[] and similar instructions. Checks the current DMap.
int DMapToMap(int screen, int dmap) π Source
Convert between map and DMap screens
int DotProduct(int x1, int y1, int x2, int y2) π Source
Returns the dot product of two vectors.
void DrawString(int layer, int x, int y, int font, int color, int background_color, int format, int opacity, char32[] ptr, int start) π Source
Overload to Screen->DrawString which includes a position to begin drawing from in the string Does not check for overflow
void DrawString(int layer, int x, int y, int font, int color, int background_color, int format, int opacity, char32[] ptr, int start, int end) π Source
Overload to Screen->DrawString which includes a start and end position to draw the string Does not check for overflow
void DrawTileSimple(int x, int y, int tile, int color) π Source
A very simple layer 0 tile drawing routine.
void DrawToLayer(ffc f, int layer, int opacity) π Source
Draws an ffc to a given layer. If the ffc is larger than 1x1 its graphics must all be comboed
void DrawToLayer(npc n, int layer, int opacity) π Source
Draws an npc to a given layer
void DrawToLayer(lweapon l, int layer, int opacity) π Source
Draws an lweapon to a given layer
void DrawToLayer(eweapon e, int layer, int opacity) π Source
Draws an eweapon to a given layer
void DrawToLayer(itemsprite i, int layer, int opacity) π Source
Draws an item to a given layer
lweapon Duplicate(lweapon a) π Source
Creates and returns an exact copy of the passed LWeapon. Assumes that the passed pointer is valid.
eweapon Duplicate(eweapon a) π Source
Creates and returns an exact copy of the passed EWeapon. Assumes that the passed pointer is valid.
bool EnemiesAlive() π Source
E Returns if there are enemy NPCs alive on the current screen.
bool Facing(ffc f) π Source
F Returns if Link is facing an ffc.
Returns the number of an FFC, and -1 for a non-valid FFC (which should never happen)
int FirstComboFlagOf(int t, int layer) π Source
Returns the position of the first instance of the given combo flag, or -1. Checks inherent flags too!
int FirstComboTypeOf(int t, int layer) π Source
Returns the position of the first instance of the given combo, or -1.
int FirstComboOf(int t, int layer) π Source
Returns the position of the first instance of the given combo, or -1.
catchalltypes GetCatchallType(mapdata m) π Source
G Returns the catchall type used by a mapscreen passed as pointer βmβ.
int GetEquipmentA() π Source
Returns the item ID of the item equipped to the A button
int GetEquipmentB() π Source
return (Hero->Equipment&0xFF); Returns the item ID of the item equipped to the B button
int GetEquipmentX() π Source
return ((Hero->Equipment&0xFF00)>>8); Returns the item ID of the item equipped to the X button
int GetEquipmentY() π Source
return ((Hero->Equipment&0xFF00)>>8); Returns the item ID of the item equipped to the Y button
bool GetDMapFlag(int dmap, int flag) π Source
return ((Hero->Equipment&0xFF00)>>8); Returns true if DMap bitwise flags βflagβ is set on dmap βdmapβ
int GetFirstItemOf(int itemclass) π Source
int GetHighestLevelItem(int itemclass) π Source
int GetHighestLevelItem(itemsprite i) π Source
int GetHighestLevelItemOwned(int itemclass) π Source
Faster than the old function; this now works exactly how the engine handles it. -Em
messagedata GetInfoString(int shop_id, int str_id) π Source
Gets the ZString (message) ID used by a Pay for Info Shop. Argument 1 is the info shop ID, argument 2 is the shopβs string (0 to 2). Returns the string typed as messagedata, e.g. messagedata md = GetInfoString(shop, 0);
void GetInfoString(char32[] buffer, int shop_id, int str_id) π Source
Copies the ZString (message) ID used by a Pay for Info Shop to a client (ZScript) string. Argument 1 is a ZScript string pointer, Arguent 2 is the info shop ID, Argument 3 is the shopβs string (0 to 2).
int GetInfoStringID(int shop_id, int str_id) π Source
Gets the ZString (message) ID used by a Pay for Info Shop. Argument 1 is the info shop ID, argument 2 is the shopβs string (0 to 2). Returns an integer of the string ID.
itemdata GetItemData(itemsprite i) π Source
bool GetItemPickup(itemsprite i, int pickup) π Source
Returns true if an itemβs Pickup state is set Use the IP_ constants for the βpickupβ argument of this function
int GetLayerComboC(int layer, int pos) π Source
A shorthand way to get a combo on the current layer. Layer 0 is the screen itself.
int GetLayerComboD(int layer, int pos) π Source
A shorthand way to get a combo on the current layer. Layer 0 is the screen itself.
int GetLayerComboF(int layer, int pos) π Source
A shorthand way to get a combo on the current layer. Layer 0 is the screen itself.
int GetLayerComboI(int layer, int pos) π Source
A shorthand way to get a combo on the current layer. Layer 0 is the screen itself.
int GetLayerComboS(int layer, int pos) π Source
A shorthand way to get a combo on the current layer. Layer 0 is the screen itself.
int GetLayerComboT(int layer, int pos) π Source
A shorthand way to get a combo on the current layer. Layer 0 is the screen itself.
bool GetLevelItem(int level, int itm) π Source
Returns true if Link has the level item βitmβ from level βlevelβ Overloaded to use the current level if no βlevelβ arg is entered Use the LI_ constants for the βitmβ argument
bool GetLevelItem(int itm) π Source
int GetMapScreenEFlag(mapdata md, int category, int flag) π Source
Gets mapdata EFlags, similar to ScreenEFlag() Uses a mapdata pointer.
int GetMapScreenEFlag(int mapid, int scr, int category, int flag) π Source
Gets mapdata EFlags, similar to ScreenEFlag() Uses map an screen integer values.
bool GetMapscreenFlag(mapdata m, mapscreenflags flagid) π Source
Helper function to get mapdata->Flags[] values See the enum mapscreenflags for legal flags. Accepts a mapdata pointer.
bool GetMapscreenFlag(int mapid, int scr, mapscreenflags flagid) π Source
Helper function to get mapdata->Flags[] values See the enum mapscreenflags for legal flags. Accepts a map ID and a screen ID.
void GetMessage(int ID, char32[] ptr) π Source
Puts a ZQE Message String into a client array string βptrβ
bool GetNPCMiscFlag(npc e, int flag) π Source
Returns true if an npcβs Misc. flag is set.
void GetNPCName(int npc_id, char32[] buffer) π Source
Get an NPCβs name from an ID
bool GetScreenDBit(int dmap, int screen, int d, int bit) π Source
npc n = Screen->CreateNPC(ID); n->GetName(ptr); Remove(n); Returns the state of bit βbitβ of Screen->D[] register βdβ
bool GetScreenDBit(int screen, int d, int bit) π Source
bool GetScreenDBit(int d, int bit) π Source
Snaps βxβ to the combo grid Equivalent to calling ComboX(ComboAt(x,foo));
Snaps βyβ to the combo grid Equivalent to calling ComboY(ComboAt(foo,y));
int HasBossKey(int level = -1
) π Source
H Returns if Link has the map for a given level.
int HasCompass(int level = -1
) π Source
Returns if Link has the compass for a given level.
bool HasHeavyBoots() π Source
int HasMap(int level = -1
) π Source
bool HasKey(int level = -1
) π Source
int HasTriforce(int level) π Source
int HitboxBottom(eweapon a) π Source
Returns the Y coordinate of the bottom edge of the hitbox.
int HitboxBottom(lweapon a) π Source
int HitboxBottom(itemsprite a) π Source
int HitboxBottom(npc a) π Source
int HitboxBottom(ffc a) π Source
Uses TileWidth and TileHeight for the FFCβs bounding box.
int HitboxLeft(eweapon a) π Source
Returns the X coordinate of the left edge of the hitbox.
int HitboxLeft(lweapon a) π Source
int HitboxLeft(itemsprite a) π Source
int HitboxLeft(npc a) π Source
int HitboxLeft(ffc a) π Source
int HitboxRight(eweapon a) π Source
Returns the X coordinate of the right edge of the hitbox.
int HitboxRight(lweapon a) π Source
int HitboxRight(itemsprite a) π Source
int HitboxRight(npc a) π Source
int HitboxRight(ffc a) π Source
int HitboxTop(eweapon a) π Source
Returns the Y coordinate of the top edge of the hitbox.
int HitboxTop(lweapon a) π Source
int HitboxTop(itemsprite a) π Source
int HitboxTop(npc a) π Source
int HitboxTop(ffc a) π Source
bool IsBackgroundLayer(int layer) π Source
I Returns if a layer is set as a background layer for the current screen.
bool IsBackgroundLayer(int layer, mapdata m) π Source
Returns if a layer is set as a background layer for a mapdata pointer.
int InFrontX(int dir, int dist) π Source
Returns the correct offset to be βdistβ pixels away from the front of a sprite facing in the direction βdirβ
int InFrontY(int dir, int dist) π Source
if(dir == DIR_LEFT) x = -16+dist; else if(dir == DIR_RIGHT) x = 16-dist; return x;
bool InputLeftClick() π Source
if(dir == DIR_UP) y = -16+dist; else if(dir == DIR_DOWN) y = 16-dist; return y; Functions for those who are not comfortable with binary Returns true if the left mouse button is pressed
bool InputMiddleClick() π Source
Returns true if the central mouse button (if equipped) is pressed
bool InputRightClick() π Source
Returns true if the right mouse button is pressed
Returns true if the present screen is a dungen type.
bool IsDungeonFlag() π Source
Returns true if Link is on a Dungeon (flagged) screen
bool IsEven(int x) π Source
Returns true if the integer is even.
bool IsInteriorFlag() π Source
Returns true if Link is on an Interior (flagged) screen
Returns true if the integer is odd.
bool IsPit(int position) π Source
Returns true if the combo at the given position is a pit.
Returns true if Link is on a sideview screen
bool IsWater(int position) π Source
Returns true if the combo at the given position is water.
int LargeDistance(int x1, int y1, int x2, int y2, int divisor) π Source
J K L Function to get a distance that would otherwise be too large and overflow Distance(). Get the distance between two points, divided up by divisor. This avoids causing problems with the Distance function doing calculations that go over the max constant
int LastComboFlagOf(int t, int layer) π Source
Returns the position of the last instance of the given combo flag, or -1. Checks inherent flags too!
int LastComboTypeOf(int t, int layer) π Source
Returns the position of the last instance of the given combo, or -1.
int LastComboOf(int t, int layer) π Source
Returns the position of the last instance of the given combo, or -1.
bool LeftOf(npc n) π Source
Returns if Link is left of an npc.
bool LeftOf(ffc n) π Source
Returns if Link is above, below, left of, or right of an ffc.
bool LeftOf(eweapon n) π Source
Returns if Link is above, below, left of, or right of an eweapon.
bool LeftOf(lweapon n) π Source
Returns if Link is above, below, left of, or right of an lweapon.
int Lerp(int p1, int p2, int t) π Source
Interpolates between p1 and p2 given βtβ clamped within range 0,1.
bool LinkCollision(eweapon b) π Source
Returns true if there is a collision between Linkβs hitbox and the eweaponβs. This only checks hitboxes.
bool LinkCollision(lweapon b) π Source
Returns true if there is a collision between Linkβs hitbox and the lweaponβs. This only checks hitboxes.
bool LinkCollision(itemsprite b) π Source
Returns true if there is a collision between Linkβs hitbox and the itemβs. This only checks hitboxes.
bool LinkCollision(npc b) π Source
Returns true if there is a collision between Linkβs hitbox and the npcβs. This only checks hitboxes. Uses TileWidth and TileHeight to find the center of the FFCs.
bool LinkCollision(ffc f) π Source
Returns true if there is a collision between Linkβs hitbox and the FFCβs. This only checks hitboxes.
eweapon LoadEWeaponOf(int type) π Source
Returns the first EWeapon of the given type. Use the EW_ constants. If none exist, it returns an uninitialised pointer.
lweapon LoadLWeaponOf(int type) π Source
Returns the first LWeapon of the given type. Use the LW_ constants. If none exist, it returns an uninitialised pointer.
npc LoadNPCOf(int type) π Source
Returns the first NPC of the given ID. Use the NPC_ constants. If none exist, it returns an uninitialised pointer.
npc LoadNPCOfType(int type) π Source
Returns the first NPC of the given type. Use the NPCT_ constants. If none exist, it returns an uninitialised pointer.
int LogToBase(int x, int base) π Source
Returns the logarithm of x to the given base
int longrand(int max) π Source
Returns a random integer between 0 abd 199,999
int MapToDMap(int screen, int dmap) π Source
void MakeBlockable(eweapon e) π Source
void MakeUnblockable(eweapon e) π Source
void MCounterAdd(int counter, int amount) π Source
Add to a counter max without rollover.
void MCounterReduce(int counter, int amount) π Source
Reduce a counter max without rollvoer.
int Midpoint(int p1, int p2) π Source
Finds the center of p1 and p2.
lweapon NextToLink(int id, int distx, int disty) π Source
N Creates an lweapon at βdistx,distyβ away from where Link is facing
lweapon NextToLink(int id, int dist) π Source
Creates an lweapon βdistβ pixels away from the front of Link
eweapon NextToNPC(npc n, int id, int distx, int disty) π Source
eweapon NextToNPC(npc n, int id, int dist) π Source
Kills all of Linkβs inputs
int NumberEnemies() π Source
Link->InputUp = false; Link->PressUp = false; Link->InputDown = false; Link->PressDown = false; Link->InputLeft = false; Link->PressLeft = false; Link->InputRight = false; Link->PressRight = false; Link->InputR = false; Link->PressR = false; Link->InputL = false; Link->PressL = false; Link->InputA = false; Link->PressA = false; Link->InputB = false; Link->PressB = false; Link->InputEx1 = false; Link->PressEx1 = false; Link->InputEx2 = false; Link->PressEx2 = false; Link->InputEx3 = false; Link->PressEx3 = false; Link->InputEx4 = false; Link->PressEx4 = false;
Returns the number of enemy NPCs on the current screen.
int NumEWeaponsOf(int type) π Source
int NumItemsOf(int type) π Source
Use the I_ constants. Warning: these iterate over every onscreen item. Iterating over every onscreen lweapon multiple times per frame may cause slowdown in Zelda Classic.
int NumKeys(int level = -1
) π Source
Returns the number of keys that the Hero has for the level βlevelβ
int NumLWeaponsOf(int type) π Source
Use the LW_ constants. Warning: these iterate over every onscreen lweapon. Iterating over every onscreen lweapon multiple times per frame may cause slowdown in Zelda Classic.
int NumNPCsOf(int type) π Source
Valid values for type
: NpcType (NPCT_
).
int NumTriforcePieces(int maxlevel = 8
) π Source
Returns the number of Triforce Pieces Link currently has. Specify the highest level in your game with arg βmaxlevelβ.
int OppositeDir(int dir) π Source
OnSidePlatform() is now in std_sideview.zh Returns the opposite direction to angle βdirβ
int RadianAngle(int x1, int y1, int x2, int y2) π Source
P Q R The above, but in radians.
int RadianAngleDir4(int angle) π Source
The above, but for radian angles.
int RadianAngleDir8(int angle) π Source
The above, but for radian angles.
int Rand(int min, int max) π Source
Returns a random integer in the bounds of min and max
Returns a random floating point number up to n
int Randf(int n1, int n2) π Source
Returns a random floating point number between min and max
bool RectCollision(int box1_x1, int box1_y1, int box1_x2, int box1_y2, int box2_x1, int box2_y1, int box2_x2, int box2_y2) π Source
Generalized and optimized rectangle collision checking function. Returns true if the bounding box of box1 and box2 overlap.
void Remove(lweapon l) π Source
Removes LWeapon βlβ from the screen
void Remove(eweapon e) π Source
Removes EWeapon βeβ from the screen
void Remove(itemsprite i) π Source
Removes Item βiβ from the screen
void Remove(npc n) π Source
Removes NPC βnβ from the screen
bool RightOf(npc n) π Source
Returns if Link is right of an npc.
bool RightOf(ffc n) π Source
Returns if Link is above, below, left of, or right of an ffc.
bool RightOf(eweapon n) π Source
Returns if Link is above, below, left of, or right of an eweapon.
bool RightOf(lweapon n) π Source
Returns if Link is above, below, left of, or right of an lweapon.
Rounds x to the nearest integer
int RotateScalePointX(int x, int y, int centerX, int centerY, int degrees, int scaleX, int scaleY) π Source
rotates and scales X about a center point by an amount of degrees
int RotateScalePointY(int x, int y, int centerX, int centerY, int degrees, int scaleX, int scaleY) π Source
rotates and scales Y about a center point by an amount of degrees
int RotatePointX(int x, int y, int centerX, int centerY, int degrees) π Source
rotates X about a center point by an amount of degrees
int RotatePointY(int x, int y, int centerX, int centerY, int degrees) π Source
rotates Y about a center point by an amount of degrees
int ScalePointX(int x, int centerX, int scale) π Source
S scales X to centerX by a given scale
int ScalePointY(int y, int centerY, int scale) π Source
scales Y to centerY by a given scale
mapdata LoadMD(int map, int scr) π Source
mapdata LoadMapDataDM(int dmap, int scr) π Source
void ScreenCopy(int destmap, int destscr, int srcmap, int srcscr) π Source
Copies the combos and csets from one screen to another. Only copies layer 0!
int ScreenEFlag(int category, int flag) π Source
Returns 1 if Screen Enemy Flag βflagβ is set from category βcategoryβ, 0 if itβs not and -1 if an invalid flag is passed Flags are numbered starting from 0
int ScreenEFlag(int m, int scr, int category, int flag) π Source
Returns 1 if Screen Enemy Flag βflagβ is set from category βcategoryβ, 0 if itβs not and -1 if an invalid flag is passed Flags are numbered starting from 0
int ScreenEFlag(mapdata md, int category, int flag) π Source
Returns 1 if Screen Enemy Flag βflagβ is set from category βcategoryβ, 0 if itβs not and -1 if an invalid flag is passed Flags are numbered starting from 0
int ScreenFlag(int category, int flag) π Source
Returns 1 if Screen Flag βflagβ is set from category βcategoryβ, 0 if itβs not and -1 if an invalid flag is passed Flags are numbered starting from 0
int ScreenFlag(int m, int scr, int category, int flag) π Source
Returns 1 if Screen Flag βflagβ is set from category βcategoryβ, 0 if itβs not and -1 if an invalid flag is passed Flags are numbered starting from 0
int ScreenFlag(mapdata m, int category, int flag) π Source
Returns 1 if Screen Flag βflagβ is set from category βcategoryβ, 0 if itβs not and -1 if an invalid flag is passed Flags are numbered starting from 0
Returns the item ID for the current screen, if there is one.
void SetDMapFlag(int dmap, int flag, bool state) π Source
Sets certain DMap bitwise flags to βstateβ
void SetEquipment(int a, int b) π Source
Writes items to both the A and the b item slots.
void SetItemPickup(itemsprite i, int pickup, bool state) π Source
Sets an itemβs Pickup state to βstateβ
void SetLayerComboC(int layer, int pos, int val) π Source
A shorthand way to set a cset on the current layer. Layer 0 is the screen itself.
void SetLayerComboD(int layer, int pos, int val) π Source
A shorthand way to set a combo on the current layer. Layer 0 is the screen itself.
void SetLayerComboF(int layer, int pos, int val) π Source
A shorthand way to set a combo on the current layer. Layer 0 is the screen itself.
void SetLayerComboI(int layer, int pos, int val) π Source
A shorthand way to set a combo on the current layer. Layer 0 is the screen itself.
void SetLayerComboS(int layer, int pos, int val) π Source
A shorthand way to set a combo on the current layer. Layer 0 is the screen itself.
void SetLayerComboT(int layer, int pos, int val) π Source
A shorthand way to set a combo on the current layer. Layer 0 is the screen itself.
void SetLevelItem(int level, int itm, bool state) π Source
Gives or removes a level item from Linkβs inventory
void SetLevelItem(int itm, bool state) π Source
void SetMapscreenFlag(mapdata m, mapscreenflags flagid, bool state) π Source
Helper function to set mapdata->Flags[] bits. See the enum mapscreenflags for legal flags. Accepts a mapdata pointer.
void SetMapscreenFlag(int mapid, int scr, mapscreenflags flagid, bool state) π Source
Helper function to set mapdata->Flags[] bits. See the enum mapscreenflags for legal flags. Accepts a map ID, and a screen ID.
void SetScreenDBit(int dmap, int screen, int d, int bit, bool state) π Source
Sets bit βbitβ of Screen->D[] register βdβ to βstateβ
void SetScreenDBit(int screen, int d, int bit, bool state) π Source
void SetScreenDBit(int d, int bit, bool state) π Source
void SetVisibleOnDungeonMap(bool state) π Source
Sets if a screen is visible on the passive subscreen minimap. Works on the current screen, on the current DMap. Respects DMap Offsets.
void SetVisibleOnDungeonMap(int scr, bool state) π Source
Sets if a screen is visible on the passive subscreen minimap. Works on a specified screen, on the current DMap. Respects DMap Offsets.
void SetVisibleOnDungeonMap(dmapdata dm, bool state) π Source
Sets if a screen is visible on the passive subscreen minimap. Works on the current screen, on a specified DMap, passed as a dmapdata pointer. Respects DMap Offsets.
void SetVisibleOnDungeonMap(dmapdata dm, int scr, bool state) π Source
Sets if a screen is visible on the passive subscreen minimap. Works on a specified screen, on a specified DMap, passed as a dmapdata pointer. Respects DMap Offsets.
void SetVisibleOnDungeonMap(dmapdata dm, int x, int y, bool state) π Source
Sets if a screen is visible on the passive subscreen minimap. Accepts the screen X and Y on a grid of 8x8, on a specified DMap, passed as a dmapdata pointer. Offsets are immaterial, as this is direct Grid[] access with x,y of the 8x8 grid.
void SetVisibleOnDungeonMap(bool no_offset, bool state) π Source
Sets if a screen is visible on the passive subscreen minimap. Works on the current screen, on the current DMap. If bool no_offset is set true, the screen position ignores DMap offsets.
void SetVisibleOnDungeonMap(int scr, bool no_offset, bool state) π Source
Sets if a screen is visible on the passive subscreen minimap. Works on a specified screen, on the current DMap. If bool no_offset is set true, the screen position ignores DMap offsets.
void SetVisibleOnDungeonMap(dmapdata dm, bool no_offset, bool state) π Source
Sets if a screen is visible on the passive subscreen minimap. Works on the current screen, on a specified DMap, passed as a dmapdata pointer. If bool no_offset is set true, the screen position ignores DMap offsets.
void SetVisibleOnDungeonMap(dmapdata dm, int scr, bool no_offset, bool state) π Source
Sets if a screen is visible on the passive subscreen minimap. Works on a specified screen, on a specified DMap, passed as a dmapdata pointer. If bool no_offset is set true, the screen position ignores DMap offsets.
Returns the sign of n
int SmoothStep(int p1, int p2, int t) π Source
Performs a βSmoothβ Interpolation given βtβ clamped within range 0,1.
int SpinDir(int dir) π Source
Converts directions to go round in a circle rather than U, D, L, R
int SpinDir8(int dir) π Source
bool SquareCollision(int c1x, int c1y, int side1, int c2x, int c2y, int side2) π Source
Check for collisions of two squares given upper-left coordinates and a side length for each.
bool SquareCollision2(int c1x, int c1y, int radius1, int c2x, int c2y, int radius2) π Source
Check for collisions of two squares given center coordinates and a halved side length for each.
void SwapTileBlock(int first, int last, int second) π Source
Swaps a block of tiles defined by diagonal corners βfirstβ and βlastβ with the block starting with top left tile βsecondβ
void SwapTileRow(int first, int second, int length) π Source
Swaps a row of tiles of length βlengthβ between positions βfirstβ and βsecondβ
int TurnTowards(int X, int Y, int targetX, int targetY, int radian_angle, int t = 1.0
) π Source
T Returns an angle pointing (t)percentage more accurate to the target than the specified radian_angle.
bool UsingItem(int id) π Source
U Returns true if Hero is using item βidβ
int vbound(int x, int high, int low) π Source
V
int VBound(int x, int high, int low) π Source
same as Clamp, but with reversed values.
int VectorX(int len, int angle) π Source
Returns the X component of a vector with a degree angle. A length of 3 and angle of 0 returns 3. A length of 3 and angle of 45 returns approx. 1.57. A length of 3 and angle of 90 returns 0.
int VectorY(int len, int angle) π Source
Returns the Y component of a vector with a degree angle. A length of 3 and angle of 0 returns 0. A length of 3 and angle of 45 returns approx. 1.57. A length of 3 and angle of 90 returns 3.
bool VisibleOnDungeonMap(int x, int y) π Source
Returns if a screen is visible on the passive subscreen minimap. Accepts the X and Y positions of a screen, where X and Y are 0 to 8.
bool VisibleOnDungeonMap() π Source
Returns if a screen is visible on the passive subscreen minimap. Uses the current screen.
bool VisibleOnDungeonMap(int scr) π Source
Returns if a screen is visible on the passive subscreen minimap. Accepts a specific screen ID for the current dmap.
bool VisibleOnDungeonMap(dmapdata dm) π Source
Returns if a screen is visible on the passive subscreen minimap. Uses the current screen on a dmapdata pointer.
bool VisibleOnDungeonMap(dmapdata dm, int scr) π Source
Returns if a screen is visible on the passive subscreen minimap. Accepts a specific screen ID on a specified dmapdata pointer.
bool VisibleOnDungeonMap(dmapdata dm, int x, int y) π Source
Returns if a screen is visible on the passive subscreen minimap. Accepts the X and Y positions of a screen, where X and Y are 0 to 8, using a specified dmapdata pointer.
bool VisibleOnDungeonMap(bool no_offset) π Source
Returns if a screen is visible on the passive subscreen minimap. Accepts the X and Y positions of a screen, where X and Y are 0 to 8. If bool no_offset is set true, the screen position ignores DMap offsets.
bool VisibleOnDungeonMap(int scr, bool no_offset) π Source
Returns if a screen is visible on the passive subscreen minimap. Uses the current screen. If bool no_offset is set true, the screen position ignores DMap offsets.
bool VisibleOnDungeonMap(dmapdata dm, bool no_offset) π Source
Returns if a screen is visible on the passive subscreen minimap. Accepts a specific screen ID for the current dmap. If bool no_offset is set true, the screen position ignores DMap offsets.
bool VisibleOnDungeonMap(dmapdata dm, int scr, bool no_offset) π Source
Returns if a screen is visible on the passive subscreen minimap. Uses the current screen on a dmapdata pointer. If bool no_offset is set true, the screen position ignores DMap offsets.
void SetVisibleOnDungeonMap(int x, int y, bool state) π Source
Sets if a screen is visible on the passive subscreen minimap. Accepts the screen X and Y on a grid of 8x8, on the current DMap. Offsets are immaterial, as this is direct Grid[] access with x,y of the 8x8 grid.
void WaitNoAction() π Source
NoAction, then Waitframe or (equivalent of) Waitframes
void WaitNoAction(int frames) π Source
int WeaponTypeToID(int wpnt) π Source
Turns a WPN_ constant to an EW_ constant
void getScrTimeName(char32[] buf, int scrtime) π Source
untyped wrap(untyped x, int mod) π Source
(SCR_TIMING_[^,]+), ttcase $1:rntttstrcpy(buf, β$1β);rntttbreak;rn Wrap a value between 0 and a bound
eweapon FireEWeaponAngle(int type, int x, int y, int radians, int step, int dmg, int sprite = -1
, int sfx = 0
, int scriptid = 0
, untyped[] args = NULL
) π Source
eweapon FireEWeaponDegAngle(int type, int x, int y, int degrees, int step, int dmg, int sprite = -1
, int sfx = 0
, int scriptid = 0
, untyped[] args = NULL
) π Source
eweapon FireEWeaponDir(int type, int x, int y, int dir, int step, int dmg, int sprite = -1
, int sfx = 0
, int scriptid = 0
, untyped[] args = NULL
) π Source
eweapon FireEWeaponAtHero(int type, int x, int y, bool angular, int step, int dmg, int sprite = -1
, int sfx = 0
, int scriptid = 0
, untyped[] args = NULL
) π Source
lweapon FireLWeaponAngle(int type, int x, int y, int radians, int step, int dmg, int sprite = -1
, int sfx = 0
, int scriptid = 0
, untyped[] args = NULL
) π Source
lweapon FireLWeaponDegAngle(int type, int x, int y, int degrees, int step, int dmg, int sprite = -1
, int sfx = 0
, int scriptid = 0
, untyped[] args = NULL
) π Source
lweapon FireLWeaponDir(int type, int x, int y, int dir, int step, int dmg, int sprite = -1
, int sfx = 0
, int scriptid = 0
, untyped[] args = NULL
) π Source
bool GetLevelSwitchState(int level, int switchNum) π Source
Gets a switch state for a given level
void SetLevelSwitchState(int level, int switchNum, bool state) π Source
Sets or unsets a switch state for a given level
int AdjacentCombo(int cmb, int dir) π Source
Returns the Nth combo index of a combo based on a central point, and a direction.
For example, combo 22 + COMBO_UPRIGHT returns 7
,
as combo 7 is to the upper-right of combo 22.
Returns -1 on error.
Fairly select between true or false.
void ClearFFC(int ffc_id) π Source
Terminate an FFC, and set all its properties to 0.
int Distance(int x1, int y1, int x2, int y2) π Source
Returns the distance between two sets of coordinates using Pythagorasβ Theorem
int Choose(int a, int b) π Source
Chooses one of the options randomly and fairly.
int Choose(int a, int b, int c) π Source
int Choose(int a, int b, int c, int d) π Source
int Choose(int a, int b, int c, int d, int e) π Source
int Choose(int a, int b, int c, int d, int e, int f) π Source
bool blink(int[] clkptr, int frames) π Source
//clkptr is an array, sized at least [1], frames is the duration on/off, so, 10 would be on for ten frames, then off for ten frames