EmilyMisc.zh#
Variables#
const bool |
|
const int |
|
const int |
|
const int |
|
const bool |
Functions#
int |
Emily::dirX(int dir) |
int |
Emily::dirY(int dir) |
int |
Emily::remX(int dir) |
int |
Emily::remY(int dir) |
int |
Emily::addX(int dir, int add) |
int |
Emily::addY(int dir, int add) |
int |
Emily::SpinDir8(int dir, int count = |
int |
Emily::HorzFlip(int dir) |
int |
Emily::VertFlip(int dir) |
bool |
Emily::CanWalkM(lweapon weap, mapdata map, int dir, int step, bool useHit) |
bool |
Emily::CanWalkM(eweapon weap, mapdata map, int dir, int step, bool useHit) |
bool |
Emily::CanWalkM(npc n, mapdata map, int dir, int step, bool useHit) |
bool |
Emily::CanWalkM(ffc f, mapdata map, int dir, int step, bool useEffect) |
bool |
Emily::CanWalkM(mapdata map, int dir, int step) |
bool |
Emily::CanWalkM(int x, int y, int xx, int yy, mapdata map, int dir, int step) |
bool |
Emily::CanWalkS(int x, int y, int xx, int yy, int dir, int step) |
bool |
Emily::CanWalkMFull(lweapon weap, mapdata map, int dir, int step, bool useHit) |
bool |
Emily::CanWalkMFull(eweapon weap, mapdata map, int dir, int step, bool useHit) |
bool |
Emily::CanWalkMFull(npc n, mapdata map, int dir, int step, bool useHit) |
bool |
Emily::CanWalkMFull(ffc f, mapdata map, int dir, int step, bool useEffect) |
bool |
Emily::CanWalkMFull(mapdata map, int dir, int step) |
bool |
Emily::CanWalkMFull(int x, int y, int xx, int yy, mapdata map, int dir, int step) |
bool |
Emily::CanWalkSFull(int x, int y, int xx, int yy, int dir, int step) |
Emily::loadLayer(mapdata m, int layer) |
|
int |
Emily::InvVectorX(int deltax, int angle) |
int |
Emily::InvVectorY(int deltay, int angle) |
bool |
Emily::TriangleRectCollision(int tx1, int ty1, int tx2, int ty2, int tx3, int ty3, int rx1, int ry1, int rx2, int ry2) |
bool |
Emily::HeroTriangleCollision(int tx1, int ty1, int tx2, int ty2, int tx3, int ty3) |
bool |
Emily::HeroTriangleCollision(int tx1, int ty1, int tx2, int ty2, int tx3, int ty3, bool bigHitbox) |
bool |
Emily::lineRectIntersect(int x1, int y1, int x2, int y2, int left, int right, int top, int bottom) |
bool |
Emily::pointTriangleCollision(int x1, int y1, int x2, int y2, int x3, int y3, int px, int py) |
void |
Emily::ffcSolid(ffc anFFC) |
bool |
|
bool |
|
bool |
Emily::CanScrollInDir(int dir) |
int |
Emily::InFrontCenteredX(int dir, int dist) |
int |
Emily::InFrontCenteredY(int dir, int dist) |
void |
|
void |
Emily::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 |
Emily::ColorScreen(int layer, int color, bool subscrArea) |
void |
Emily::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 |
Emily::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 |
Emily::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 |
Emily::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 |
Emily::DrawStringsCount(int font, char32[] ptr, int MaxWidth) |
int |
Emily::DrawStringsWid(int font, char32[] ptr, int MaxWidth) |
void |
Emily::getFontName(char32[] buf, int font) |
void |
Emily::colorscr_txt(int color, int txtcolor, int font, char32[] buf, bool hidesubscr) |
Emily::create(int w, int h) |
|
void |
Emily::doMapScreenshot(int map, int frameDelay = |
void |
Emily::doAllMapScreenshots(int frameDelay = |
untyped |
Emily::large_memmove(untyped[] dest, int dpos, untyped[] src, int spos, int n) |
int |
Emily::item_tile(int id) |
int |
Emily::item_cset(int id) |
Variable descriptions#
const bool Emily::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 Emily::SCRNSHOT_DMAP = 511 π Source
end start Fancy screenshot thing
const int Emily::SYS_WHITE = 245 π Source
const int Emily::SYS_BLACK = 224 π Source
const bool Emily::MAPSCREENSHOT_HIDES_SUBSCR = true π Source
Function descriptions#
int Emily::dirX(int dir) π Source
Returns 1 if the dir is rightward, -1 if leftward, 0 if neither
int Emily::dirY(int dir) π Source
Returns 1 if the dir is downward, -1 if upward, 0 if neither
int Emily::remX(int dir) π Source
Removes the horizontal component of a direction
int Emily::remY(int dir) π Source
Removes the vertical component of a direction
int Emily::addX(int dir, int add) π Source
Adds the horizontal component of a direction
int Emily::addY(int dir, int add) π Source
Adds the vertical component of a direction
int Emily::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 Emily::HorzFlip(int dir) π Source
Flip a dir horizontally
int Emily::VertFlip(int dir) π Source
Flip a dir horizontally
bool Emily::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 Emily::CanWalkM(eweapon weap, mapdata map, int dir, int step, bool useHit) π Source
eweapon
bool Emily::CanWalkM(npc n, mapdata map, int dir, int step, bool useHit) π Source
npc
bool Emily::CanWalkM(ffc f, mapdata map, int dir, int step, bool useEffect) π Source
ffc
bool Emily::CanWalkM(mapdata map, int dir, int step) π Source
Link
bool Emily::CanWalkM(int x, int y, int xx, int yy, mapdata map, int dir, int step) π Source
Main
bool Emily::CanWalkS(int x, int y, int xx, int yy, int dir, int step) π Source
invalid direction Current Screen
bool Emily::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 Emily::CanWalkMFull(eweapon weap, mapdata map, int dir, int step, bool useHit) π Source
eweapon
bool Emily::CanWalkMFull(npc n, mapdata map, int dir, int step, bool useHit) π Source
npc
bool Emily::CanWalkMFull(ffc f, mapdata map, int dir, int step, bool useEffect) π Source
ffc
bool Emily::CanWalkMFull(mapdata map, int dir, int step) π Source
Link
bool Emily::CanWalkMFull(int x, int y, int xx, int yy, mapdata map, int dir, int step) π Source
Main
bool Emily::CanWalkSFull(int x, int y, int xx, int yy, int dir, int step) π Source
invalid direction Current Screen
mapdata Emily::CurMapdata() π Source
Returns a mapdata pointer to the current screen (Perm version).
mapdata Emily::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 Emily::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 Emily::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 Emily::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 Emily::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 Emily::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 Emily::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 Emily::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 Emily::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 Emily::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 Emily::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 Emily::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 Emily::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 Emily::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 Emily::haltFFC(ffc f) π Source
Zeroes all movement factors of an FFC
void Emily::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 Emily::ColorScreen(int layer, int color, bool subscrArea) π Source
Colors the entire screen. bool subscrArea determines if the passive subscreen should be included.
void Emily::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 Emily::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 Emily::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 Emily::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 Emily::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 Emily::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 Emily::getFontName(char32[] buf, int font) π Source
end end Drawing Functions
void Emily::colorscr_txt(int color, int txtcolor, int font, char32[] buf, bool hidesubscr) π Source
end
bitmap Emily::create(int w, int h) π Source
end
void Emily::doMapScreenshot(int map, int frameDelay = 10) π Source
void Emily::doAllMapScreenshots(int frameDelay = 10) π Source
end
untyped Emily::large_memmove(untyped[] dest, int dpos, untyped[] src, int spos, int n) π Source
As memmove(), but with a larger buffer
int Emily::item_tile(int id) π Source
end Gets an itemβs tile, animated based on βGame->Timeβ
int Emily::item_cset(int id) π Source
Gets an itemβs cset, animated based on βGame->Timeβ