EmilyMisc.zh#

Variables#

const bool

MAPDATA_USECURSCREEN

const int

SCRNSHOT_DMAP

const int

SYS_WHITE

const int

SYS_BLACK

const bool

MAPSCREENSHOT_HIDES_SUBSCR

Functions#

int

dirX(int dir)

int

dirY(int dir)

int

remX(int dir)

int

remY(int dir)

int

addX(int dir, int add)

int

addY(int dir, int add)

int

SpinDir8(int dir, int count = 1)

int

HorzFlip(int dir)

int

VertFlip(int dir)

bool

CanWalkM(lweapon weap, mapdata map, int dir, int step, bool useHit)

bool

CanWalkM(eweapon weap, mapdata map, int dir, int step, bool useHit)

bool

CanWalkM(npc n, mapdata map, int dir, int step, bool useHit)

bool

CanWalkM(ffc f, mapdata map, int dir, int step, bool useEffect)

bool

CanWalkM(mapdata map, int dir, int step)

bool

CanWalkM(int x, int y, int xx, int yy, mapdata map, int dir, int step)

bool

CanWalkS(int x, int y, int xx, int yy, int dir, int step)

bool

CanWalkMFull(lweapon weap, mapdata map, int dir, int step, bool useHit)

bool

CanWalkMFull(eweapon weap, mapdata map, int dir, int step, bool useHit)

bool

CanWalkMFull(npc n, mapdata map, int dir, int step, bool useHit)

bool

CanWalkMFull(ffc f, mapdata map, int dir, int step, bool useEffect)

bool

CanWalkMFull(mapdata map, int dir, int step)

bool

CanWalkMFull(int x, int y, int xx, int yy, mapdata map, int dir, int step)

bool

CanWalkSFull(int x, int y, int xx, int yy, int dir, int step)

mapdata

CurMapdata()

mapdata

loadLayer(mapdata m, int layer)

int

InvVectorX(int deltax, int angle)

int

InvVectorY(int deltay, int angle)

bool

TriangleRectCollision(int tx1, int ty1, int tx2, int ty2, int tx3, int ty3, int rx1, int ry1, int rx2, int ry2)

bool

HeroTriangleCollision(int tx1, int ty1, int tx2, int ty2, int tx3, int ty3)

bool

HeroTriangleCollision(int tx1, int ty1, int tx2, int ty2, int tx3, int ty3, bool bigHitbox)

bool

lineRectIntersect(int x1, int y1, int x2, int y2, int left, int right, int top, int bottom)

bool

pointTriangleCollision(int x1, int y1, int x2, int y2, int x3, int y3, int px, int py)

void

ffcSolid(ffc anFFC)

bool

HeroIsScrolling()

bool

HeroIsScrollingOrWarping()

bool

CanScrollInDir(int dir)

int

InFrontCenteredX(int dir, int dist)

int

InFrontCenteredY(int dir, int dist)

void

haltFFC(ffc f)

void

MooshDrawTile(int layer, int cx, int cy, int tile, int blockw, int blockh, int cset, int xscale, int yscale, int rx, int ry, int rangle, int flip, bool transparency, int opacity)

void

ColorScreen(int layer, int color, bool subscrArea)

void

DrawStrings(int layer, int x, int y, int font, int color, int background_color, int format, char32[] ptr, int opacity, int verticalSpacing, int MaxWidth)

void

DrawStrings(int layer, int x, int y, int font, int color, int background_color, int format, char32[] ptr, int opacity, int shadow_type, int shadow_color, int verticalSpacing, int MaxWidth)

void

DrawStringsBitmap(bitmap b, int layer, int x, int y, int font, int color, int background_color, int format, char32[] ptr, int opacity, int verticalSpacing, int MaxWidth)

void

DrawStringsBitmap(bitmap b, int layer, int x, int y, int font, int color, int background_color, int format, char32[] ptr, int opacity, int shadow_type, int shadow_color, int verticalSpacing, int MaxWidth)

int

DrawStringsCount(int font, char32[] ptr, int MaxWidth)

int

DrawStringsWid(int font, char32[] ptr, int MaxWidth)

void

getFontName(char32[] buf, int font)

void

colorscr_txt(int color, int txtcolor, int font, char32[] buf, bool hidesubscr)

bitmap

create(int w, int h)

void

doMapScreenshot(int map, int frameDelay = 10)

void

doAllMapScreenshots(int frameDelay = 10)

untyped

large_memmove(untyped[] dest, int dpos, untyped[] src, int spos, int n)

int

item_tile(int id)

int

item_cset(int id)

Variable descriptions#

const bool MAPDATA_USECURSCREEN = true πŸ”— Source

If true, then calling CanWalkM with the current screen’s mapdata will use Screen-> instead of the provided mapdata->


const int SCRNSHOT_DMAP = 511 πŸ”— Source

end start Fancy screenshot thing


const int SYS_WHITE = 245 πŸ”— Source


const int SYS_BLACK = 224 πŸ”— Source


const bool MAPSCREENSHOT_HIDES_SUBSCR = true πŸ”— Source


Function descriptions#

int dirX(int dir) πŸ”— Source

Returns 1 if the dir is rightward, -1 if leftward, 0 if neither


int dirY(int dir) πŸ”— Source

Returns 1 if the dir is downward, -1 if upward, 0 if neither


int remX(int dir) πŸ”— Source

Removes the horizontal component of a direction


int remY(int dir) πŸ”— Source

Removes the vertical component of a direction


int addX(int dir, int add) πŸ”— Source

Adds the horizontal component of a direction


int addY(int dir, int add) πŸ”— Source

Adds the vertical component of a direction


int SpinDir8(int dir, int count = 1) πŸ”— Source

Spin a dir clockwise 45Β°, count number of times If count is negative, will spin counterclockwise instead


int HorzFlip(int dir) πŸ”— Source

Flip a dir horizontally


int VertFlip(int dir) πŸ”— Source

Flip a dir horizontally


bool CanWalkM(lweapon weap, mapdata map, int dir, int step, bool useHit) πŸ”— Source

This function (and set of overloads) acts as CanWalk, but uses an arbitrary mapdata pointer for solidity, rather than the current screen. Related: CurMapdata()

lweapon


bool CanWalkM(eweapon weap, mapdata map, int dir, int step, bool useHit) πŸ”— Source

eweapon


bool CanWalkM(npc n, mapdata map, int dir, int step, bool useHit) πŸ”— Source

npc


bool CanWalkM(ffc f, mapdata map, int dir, int step, bool useEffect) πŸ”— Source

ffc


bool CanWalkM(mapdata map, int dir, int step) πŸ”— Source

Link


bool CanWalkM(int x, int y, int xx, int yy, mapdata map, int dir, int step) πŸ”— Source

Main


bool CanWalkS(int x, int y, int xx, int yy, int dir, int step) πŸ”— Source

invalid direction Current Screen


bool CanWalkMFull(lweapon weap, mapdata map, int dir, int step, bool useHit) πŸ”— Source

invalid direction end Standard start Full (Checks the FULL hitbox, not just where you are moving into) lweapon


bool CanWalkMFull(eweapon weap, mapdata map, int dir, int step, bool useHit) πŸ”— Source

eweapon


bool CanWalkMFull(npc n, mapdata map, int dir, int step, bool useHit) πŸ”— Source

npc


bool CanWalkMFull(ffc f, mapdata map, int dir, int step, bool useEffect) πŸ”— Source

ffc


bool CanWalkMFull(mapdata map, int dir, int step) πŸ”— Source

Link


bool CanWalkMFull(int x, int y, int xx, int yy, mapdata map, int dir, int step) πŸ”— Source

Main


bool CanWalkSFull(int x, int y, int xx, int yy, int dir, int step) πŸ”— Source

invalid direction Current Screen


mapdata CurMapdata() πŸ”— Source

Returns a mapdata pointer to the current screen (Perm version).


mapdata loadLayer(mapdata m, int layer) πŸ”— Source

Returns a mapdata pointer to the specified layer of the given pointer. Will be perm version unless Game->LoadTempScreen(0) is provided, in which case it will return the temp layer.


int InvVectorX(int deltax, int angle) πŸ”— Source

Returns the length of the line which has an angle of angle, and results in a change in x of deltax


int InvVectorY(int deltay, int angle) πŸ”— Source

Returns the length of the line which has an angle of angle, and results in a change in y of deltay


bool TriangleRectCollision(int tx1, int ty1, int tx2, int ty2, int tx3, int ty3, int rx1, int ry1, int rx2, int ry2) πŸ”— Source

Checks if the given rectangle and triangle collide


bool HeroTriangleCollision(int tx1, int ty1, int tx2, int ty2, int tx3, int ty3) πŸ”— Source

Checks if the given triangle collides with Hero, using Hero->BigHitbox’s setting


bool HeroTriangleCollision(int tx1, int ty1, int tx2, int ty2, int tx3, int ty3, bool bigHitbox) πŸ”— Source

Checks if the given triangle collides with Hero, with an option for bigHitbox


bool lineRectIntersect(int x1, int y1, int x2, int y2, int left, int right, int top, int bottom) πŸ”— Source

Returns true if the line specified by points (x1,y1), (x2,y2) intersects with the rectangle defined by (left,right,top,bottom) Based on: https://seblee.me/2009/05/super-fast-trianglerectangle-intersection-test/


bool pointTriangleCollision(int x1, int y1, int x2, int y2, int x3, int y3, int px, int py) πŸ”— Source

Returns true if a point (px,py) is within the triangle defined by (x1,y1), (x2,y2), (x3,y3)


void ffcSolid(ffc anFFC) πŸ”— Source

My attempt at a solid FFC function. Call ffcSolid(ffc) each frame to make the ffc solid. This is not fully tested.


bool HeroIsScrolling() πŸ”— Source

Returns true if Hero is scrolling, or about to begin scrolling. Any scripted draws intended to not draw during scrolling should run only if this returns false. Due to variance with Hero’s movement (1 or 2 pixels), this may sometimes return true extraneously.


bool HeroIsScrollingOrWarping() πŸ”— Source

Returns true if Hero is scrolling, or about to begin scrolling. Any scripted draws intended to not draw during scrolling should run only if this returns false. Due to variance with Hero’s movement (1 or 2 pixels), this may sometimes return true extraneously.


bool CanScrollInDir(int dir) πŸ”— Source

Returns true if scrolling in a particular direction from this screen is valid. This checks for the edge of the map, respecting sidewarps.


int InFrontCenteredX(int dir, int dist) πŸ”— Source

Returns the X-offset to add to a sprite’s coordinate to be directly in front of it, by β€˜dist’ pixels of them


int InFrontCenteredY(int dir, int dist) πŸ”— Source

Returns the Y-offset to add to a sprite’s coordinate to be directly in front of it, by β€˜dist’ pixels of them


void haltFFC(ffc f) πŸ”— Source

Zeroes all movement factors of an FFC


void MooshDrawTile(int layer, int cx, int cy, int tile, int blockw, int blockh, int cset, int xscale, int yscale, int rx, int ry, int rangle, int flip, bool transparency, int opacity) πŸ”— Source

end start Drawing Functions As the name of the function implies, this was stolen from Moosh.


void ColorScreen(int layer, int color, bool subscrArea) πŸ”— Source

Colors the entire screen. bool subscrArea determines if the passive subscreen should be included.


void DrawStrings(int layer, int x, int y, int font, int color, int background_color, int format, char32[] ptr, int opacity, int verticalSpacing, int MaxWidth) πŸ”— Source

This will work as DrawString, but, it can draw over multiple vertical lines. Text over the Max Width, as well as newline characters (’n’), will break to the next line. New params: β€˜verticalSpacing’ is the extra space to include between lines. β€˜MaxWidth’ is the width at which text will be forced onto the next line.


void DrawStrings(int layer, int x, int y, int font, int color, int background_color, int format, char32[] ptr, int opacity, int shadow_type, int shadow_color, int verticalSpacing, int MaxWidth) πŸ”— Source

end


void DrawStringsBitmap(bitmap b, int layer, int x, int y, int font, int color, int background_color, int format, char32[] ptr, int opacity, int verticalSpacing, int MaxWidth) πŸ”— Source

This will work as DrawString, but, it can draw over multiple vertical lines. Text over the Max Width, as well as newline characters (’n’), will break to the next line. New params: β€˜b’ is the bitmap to render to. β€˜verticalSpacing’ is the extra space to include between lines. β€˜MaxWidth’ is the width at which text will be forced onto the next line.


void DrawStringsBitmap(bitmap b, int layer, int x, int y, int font, int color, int background_color, int format, char32[] ptr, int opacity, int shadow_type, int shadow_color, int verticalSpacing, int MaxWidth) πŸ”— Source

end


int DrawStringsCount(int font, char32[] ptr, int MaxWidth) πŸ”— Source

Same as DrawStrings, but, does not draw anything. Returns the number of lines that DrawStrings would use.


int DrawStringsWid(int font, char32[] ptr, int MaxWidth) πŸ”— Source

Same as DrawStrings, but, does not draw anything. Returns the width that DrawStrings would hit, at max.


void getFontName(char32[] buf, int font) πŸ”— Source

end end Drawing Functions


void colorscr_txt(int color, int txtcolor, int font, char32[] buf, bool hidesubscr) πŸ”— Source

end


bitmap create(int w, int h) πŸ”— Source

end


void doMapScreenshot(int map, int frameDelay = 10) πŸ”— Source


void doAllMapScreenshots(int frameDelay = 10) πŸ”— Source

end


untyped large_memmove(untyped[] dest, int dpos, untyped[] src, int spos, int n) πŸ”— Source

As memmove(), but with a larger buffer


int item_tile(int id) πŸ”— Source

end Gets an item’s tile, animated based on β€˜Game->Time’


int item_cset(int id) πŸ”— Source

Gets an item’s cset, animated based on β€˜Game->Time’