EmilyMisc.zh#
Variables#
const bool |
|
const int |
|
const int |
|
const int |
|
const bool |
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 = |
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 |
|
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) |
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 |
|
bool |
|
bool |
|
bool |
CanScrollInDir(int dir) |
int |
InFrontCenteredX(int dir, int dist) |
int |
InFrontCenteredY(int dir, int dist) |
void |
|
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) |
create(int w, int h) |
|
void |
doMapScreenshot(int map, int frameDelay = |
void |
doAllMapScreenshots(int frameDelay = |
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
Function descriptions#
Returns 1 if the dir is rightward, -1 if leftward, 0 if neither
Returns 1 if the dir is downward, -1 if upward, 0 if neither
Removes the horizontal component of a direction
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β