// General Open Zelda Functions #if defined _general_included #endinput #endif #define _general_included //#define _dbt_workaround // Define 8 Directions enum _Directions{ north, east, south, west, northeast, southeast, southwest, northwest, } native PutSprite(ident[], valx, valy, vald, layer = 0, r = 255, g = 255, b = 255, a = 255, rot = 0, scale = 100); native DrawImage(code[], x, y, r = 255, g = 255, b = 255, a = 255, rot = 0, scale = 100); native GetWidth(ident[]); native GetHeight(ident[]); native QKey(); native AKey(); native SKey(); native WKey(); native EnterKey(); native UpKey(); native DownKey(); native LeftKey(); native RightKey(); native SetQKey(val); native SetAKey(val); native SetSKey(val); native SetWKey(val); native SetEnterKey(val); native SetUpKey(val); native SetDownKey(val); native SetLeftKey(val); native SetRightKey(val); native SetWorldX(val); native SetWorldY(val); native GetWorldX(); native GetWorldY(); native GetGroupMinX(); native GetGroupMinY(); native GetGroupMaxX(); native GetGroupMaxY(); native UpdateWorldCo(x, y); native NearPoint(x1, y1, x2, y2, dist); native SetPauseLevel(val); native GetPauseLevel(); native FirstRun(); native InitialPlayerX(); native InitialPlayerY(); native CheckForHoleXY(x,y); native FadeTo(red, green, blue, speed); native Wipe(direction, speed); native CalculateAngle(x1,y1,x2,y2); // Saving loading functions native SetRestartTable(index, x, y, desc[] ); native SetRestartPoint(x, y); native ClearRestartTable(); // Text Drawing Functions native SetTextSize( size ); native DrawText(string[], x, y, red = 255, green = 255, blue = 255, alpha = 255); // Functions for drawing shapes native DrawRectangle(x1, y1, x2, y2, red, green, blue, alpha = 255, angle = 0); native DrawLine(x1, y1, x2, y2, width, red, green, blue, aplha = 255); // Enables or Disables user input native EnableControls( enable ); // Copies a numeric value in val to the string native ToString(val, string[]); // Sets and Gets the screen something falls to when it falls down a hole native SetLowerLevel(x, y); native GetLowerLevelX(); native GetLowerLevelY(); // TextBox Functions native InitTextBox(string[], wid, priority); native SetTextBoxColor(red, green, blue, alpha); native FinishedReading(); native GetLastAnswer(); // Time Functions for Day/Night native GetMinuteCount(); native GetHourCount(); native GetDayCount(); native SetMinuteCount(val); native SetHourCount(val); native SetDayCount(val); native SetDayLength(val); // Global\Local Functions native SetGlobal(index, val); native GetGlobal(index); native SetLocal(index, val); native GetLocal(index); // Sound functions native PlaySound(code[], volume = 200); native SetMusicVolume(volume); native PlayMusic(code[], fade); native SetMusicFadeSpeed(speed = 110); // Starts a gameover screen native GameOver(); // Used for changing the alpha value of a background sprite native SetSpriteAlpha( spriteCode[], newAlpha); // Debugging functions native ToFile(value); native TextFile(string[]); stock WorldToScreenX(x) { return (x - GetWorldX()) * 2 } stock WorldToScreenY(y) { return (y - GetWorldY()) * 2 } stock GetEnterKey() { if(EnterKey()) { SetEnterKey(false); return true; } return false; } stock GetAKey() { if(AKey()) { SetAKey(false); return true; } return false; } stock GetSKey() { if(SKey()) { SetSKey(false); return true; } return false; } stock GetQKey() { if(QKey()) { SetQKey(false); return true; } return false; } stock GetWKey() { if(WKey()) { SetWKey(false); return true; } return false; } #if defined _dbt_workaround #include native nDrawBitmapText(string[], x, y, style = 1, red = 255, green = 255, blue = 255, alpha = 255, scale = 200) = DrawBitmapText; stock DrawBitmapText(string[], x, y, style = 1, r = 255, g = 255, b = 255, a = 255, scale = 200, uppercase = true, zdepth = -1, layer = 0) { new length = strlen(string); new thisx = x; new thisy = y; new spacing = 8; new prefix[7] = "_charX"; new spacer_image[9] = "_charX32"; new temp[4]; new thischar; new gfx[11]; if ( 0 <= style <= 9 ) style += 48; else if ( 10 <= style <= 36 ) style += 55; else if ( 37 <= style <= 62 ) style += 87; else style = 49; prefix[5] = style; spacer_image[5] = style; spacing = GetWidth(spacer_image); for(new n = 0; n