std_functions.zh#

Functions#

bool

Above(npc n)

bool

Above(ffc n)

bool

Above(eweapon n)

bool

Above(lweapon n)

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

Below(npc n)

bool

Below(ffc n)

bool

Below(eweapon n)

bool

Below(lweapon n)

bool

CanWalk(int x, int y, int dir, int step, bool full_tile)

int

CenterLinkX()

int

CenterLinkY()

int

CenterX(ffc anFFC)

int

CenterX(npc anNPC)

int

CenterX(eweapon anEWeapon)

int

CenterX(lweapon anLWeapon)

int

CenterX(itemsprite it)

int

CenterY(ffc anFFC)

int

CenterY(npc anNPC)

int

CenterY(eweapon anEWeapon)

int

CenterY(lweapon anLWeapon)

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

Collision(lweapon a, eweapon b)

bool

Collision(lweapon a, lweapon b)

bool

Collision(eweapon a, eweapon b)

bool

Collision(lweapon a, npc b)

bool

Collision(eweapon a, npc b)

bool

Collision(npc a, npc b)

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

Collision(ffc f, lweapon b)

bool

Collision(ffc f, eweapon b)

bool

Collision(ffc f, npc b)

bool

Collision(ffc f, itemsprite b)

bool

Collision(ffc f, ffc f2)

bool

Collision(ffc f, int radius1, ffc f2, int radius2)

bool

Collision(eweapon a, lweapon b)

bool

Collision(npc a, lweapon b)

bool

Collision(npc a, eweapon b)

bool

Collision(lweapon a, itemsprite b)

bool

Collision(eweapon a, itemsprite b)

bool

Collision(npc a, itemsprite b)

bool

Collision(lweapon a, ffc b)

bool

Collision(eweapon a, ffc b)

bool

Collision(npc a, ffc b)

bool

Collision(itemsprite a, ffc b)

bool

Collision(eweapon b)

bool

Collision(lweapon b)

bool

Collision(itemsprite b)

bool

Collision(npc b)

bool

Collision(ffc f)

bool

Collision(combodata f)

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 = -1)

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)

eweapon

CreateEWeaponAt(int id, int x, int y)

itemsprite

CreateItemAt(int id, int x, int y)

lweapon

CreateLWeaponAt(int id, int x, int y)

npc

CreateNPCAt(int id, int x, int y)

itemsprite

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

DistXY(ffc a, int dist)

int

Div(int x, int y)

int

DMapMapGraphicsIndex(dmapdata dm)

int

DMapMapGraphicsIndex(int dmapID)

int

DMapMapGraphicsIndex()

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)

lweapon

Duplicate(lweapon a)

eweapon

Duplicate(eweapon a)

bool

EnemiesAlive()

bool

Facing(ffc f)

int

FFCNum(ffc f)

int

FirstComboFlagOf(int t, int layer)

int

FirstComboTypeOf(int t, int layer)

int

FirstComboOf(int t, int layer)

catchalltypes

GetCatchallType(mapdata m)

int

GetEquipmentA()

int

GetEquipmentB()

int

GetEquipmentX()

int

GetEquipmentY()

bool

GetDMapFlag(int dmap, int flag)

int

GetFirstItemOf(int itemclass)

int

GetHighestLevelItem(int itemclass)

int

GetHighestLevelItem(itemsprite i)

int

GetHighestLevelItemOwned(int itemclass)

messagedata

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)

itemdata

GetItemData(itemsprite i)

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 = -1)

int

HasCompass(int level = -1)

bool

HasHeavyBoots()

int

HasMap(int level = -1)

bool

HasKey(int level = -1)

int

HasTriforce(int level)

int

HitboxBottom(eweapon a)

int

HitboxBottom(lweapon a)

int

HitboxBottom(itemsprite a)

int

HitboxBottom(npc a)

int

HitboxBottom(ffc a)

int

HitboxLeft(eweapon a)

int

HitboxLeft(lweapon a)

int

HitboxLeft(itemsprite a)

int

HitboxLeft(npc a)

int

HitboxLeft(ffc a)

int

HitboxRight(eweapon a)

int

HitboxRight(lweapon a)

int

HitboxRight(itemsprite a)

int

HitboxRight(npc a)

int

HitboxRight(ffc a)

int

HitboxTop(eweapon a)

int

HitboxTop(lweapon a)

int

HitboxTop(itemsprite a)

int

HitboxTop(npc a)

int

HitboxTop(ffc a)

bool

IsBackgroundLayer(int layer)

bool

IsBackgroundLayer(int layer, mapdata m)

int

InFrontX(int dir, int dist)

int

InFrontY(int dir, int dist)

bool

InputLeftClick()

bool

InputMiddleClick()

bool

InputRightClick()

bool

IsDungeon()

bool

IsDungeonFlag()

bool

IsEven(int x)

bool

IsInteriorFlag()

bool

IsOdd(int x)

bool

IsPit(int position)

bool

IsSideview()

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

LeftOf(npc n)

bool

LeftOf(ffc n)

bool

LeftOf(eweapon n)

bool

LeftOf(lweapon n)

int

Lerp(int p1, int p2, int t)

bool

LinkCollision(eweapon b)

bool

LinkCollision(lweapon b)

bool

LinkCollision(itemsprite b)

bool

LinkCollision(npc b)

bool

LinkCollision(ffc f)

eweapon

LoadEWeaponOf(int type)

lweapon

LoadLWeaponOf(int type)

npc

LoadNPCOf(int type)

npc

LoadNPCOfType(int type)

int

LogToBase(int x, int base)

int

longrand(int max)

int

MapToDMap(int screen, int dmap)

void

MakeBlockable(eweapon e)

void

MakeUnblockable(eweapon e)

void

MCounterAdd(int counter, int amount)

void

MCounterReduce(int counter, int amount)

int

Midpoint(int p1, int p2)

lweapon

NextToLink(int id, int distx, int disty)

lweapon

NextToLink(int id, int dist)

eweapon

NextToNPC(npc n, int id, int distx, int disty)

eweapon

NextToNPC(npc n, int id, int dist)

void

NoAction()

int

NumberEnemies()

int

NumEWeaponsOf(int type)

int

NumItemsOf(int type)

int

NumKeys(int level = -1)

int

NumLWeaponsOf(int type)

int

NumNPCsOf(int type)

int

NumTriforcePieces(int maxlevel = 8)

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

Remove(lweapon l)

void

Remove(eweapon e)

void

Remove(itemsprite i)

void

Remove(npc n)

bool

RightOf(npc n)

bool

RightOf(ffc n)

bool

RightOf(eweapon n)

bool

RightOf(lweapon n)

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)

mapdata

LoadMD(int map, int scr)

mapdata

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

ScreenItem()

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 = 1.0)

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

VisibleOnDungeonMap()

bool

VisibleOnDungeonMap(int scr)

bool

VisibleOnDungeonMap(dmapdata dm)

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

WaitNoAction()

void

WaitNoAction(int frames)

int

WeaponTypeToID(int wpnt)

void

getScrTimeName(char32[] buf, int scrtime)

untyped

wrap(untyped x, int mod)

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)

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)

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)

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)

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)

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)

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)

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#

bool Above(npc n) πŸ”— Source

Returns if Link is above an npc.


bool Above(ffc n) πŸ”— Source

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


bool Below(npc n) πŸ”— Source

Returns if Link is below an npc.


bool Below(ffc n) πŸ”— Source

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.


int CenterLinkX() πŸ”— Source

Get the X and Y coordinates at the center of a sprite


int CenterLinkY() πŸ”— Source


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.


int FFCNum(ffc f) πŸ”— Source

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


int GridX(int x) πŸ”— Source

Snaps β€˜x’ to the combo grid Equivalent to calling ComboX(ComboAt(x,foo));


int GridY(int y) πŸ”— Source

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


bool IsDungeon() πŸ”— Source

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


bool IsOdd(int x) πŸ”— Source

Returns true if the integer is odd.


bool IsPit(int position) πŸ”— Source

Returns true if the combo at the given position is a pit.


bool IsSideview() πŸ”— Source

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.


N Creates an lweapon at β€˜distx,disty’ away from where Link is facing


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


void NoAction() πŸ”— 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


int Randf(int n) πŸ”— Source

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.


int Round(int x) πŸ”— Source

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


int ScreenItem() πŸ”— Source

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.


int Sign(int n) πŸ”— Source

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.


bool ChooseB() πŸ”— Source

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


//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