#include "hostAPI_Player.txt"

#include "hostAPI_Sound.txt"

#include "hostAPI_Bullet.txt"

#include "hostAPI_Boss.txt"

host htRunAVGScript(script);
host htRunSTGScript(script);
host htRunAVGScriptInSTG(script);

host htAddScore(score);
host htAddFloatingText(text, font, fontSize, r, g, b, a, x, y, dx, dy, frame, fadeinFrame, fadeoutFrame);

#define DIFFICULTY_NORMAL 0;
#define DIFFICULTY_HARD	1;

host htAddDifficultyIdent(ident);

host htStoreScore();

host htGetHit();

#define ITEM_POWER 1;
#define ITEM_BOMB 2;
#define ITEM_LIFE 3;
#define ITEM_HITX2 4;
#define ITEM_CRIX2 5;

host htInsertItem(type, x, y);
host htClearAllItems();

#define SCREEN_SHAKE_HOROZONTAL 2;
#define SCREEN_SHAKE_VERTICAL 1;

host htShakeScreen(type, time, amplitude);

host htIni_GetInt(sec, ident, default);
host htIni_GetFloat(sec, ident, default);
host htIni_GetString(sec, ident, default);
host htIni_SetInt(sec, ident, val);
host htIni_SetFloat(sec, ident, val);
host htIni_SetString(sec, ident, val);

host htStageEnd();
host htGetDifficulty();
host htReturnToMain();

host htStartTimer(interval, repeatTimes, funcName);
host htPlayEndTheme();

host htStoreVariable(variable, name);
host htGetVariableAsInt(name);
host htGetVariableAsFloat(name);
host htGetVariableAsString(name);

#define BACKGROUND_TYPE_STILL 1;
#define BACKGROUND_TYPE_SCROLL 0;
#define BACKGROUND_TYPE_TURN 2;

host htSet2DBackground(path, speed, type);
host htEnable2DFog1(flag, speed);
host htSetFogSpeed(speed);
host htSetBackgroundSpeed(speed);
host htSetBackgroundAlpha(a);

host htEnableSeaSimulation();
host htStopSeaSimulation();

host htSetSCBackground(path, w, h, count);
host htSetSCBackgroundAlpha(a);
host htStopSCBackground();

host htAddBackgroundCover(path, speed, x, y, fadeinTime, type);
host htClearBackgroundCover();

host htAddSprite(id, name);
host htCreateSprite(id, iWidth, iHeight);
host htDeleteSprite(id);
host htDeleteSpriteEx(id, afterFrame);

host htSetSpriteColor(id, r, g, b, a);
host htSetSpriteColorEx(id, r, g, b, a, i);

host htRenderSprite(id);
host htRenderSpriteWithPos(id);

host htSetSpritePos(id, x, y);
host htSetSpriteHotSpot(id, x, y);
host htSetSpriteZ(id, z);
host htSetSpriteRotation(id, rot);
host htSetSpriteScale(id, x, y);

host htSpriteFadeIn(id, frame);
host htSpriteFadeOut(id, frame);
host htSpriteFadeInEx(id, frame, dest);
host htSpriteFadeOutEx(id, frame, dest);
host htSpriteScale(id, frame, dest);
host htSpriteScaleEx(id, frame, destH, destV);
host htMoveSpriteTo(id, frame, destX, destY);

#define BLENDMODE_COLORADD 	1;
#define BLENDMODE_COLORMUL 	0;
#define BLENDMODE_ALPHABLEND 	2;
#define BLENDMODE_ALPHAADD 	0;
#define BLENDMODE_ZWRITE 	4;
#define BLENDMODE_NOZWRITE 	0;

#define DISTORT_NODE 		0;
#define DISTORT_TOPLEFT 	1;
#define DISTORT_CENTER 		2;


host htEnableSpriteDistort(id, flag);
host htSetSpriteBlendMode(id, mode);
host htSetDistortDisplacement(id, col, row, dx, dy, ref);
host htSetDistortColor(id, col, row, r, g, b, a);
host htGetDistortCols(id);
host htGetDistortRows(id);

host htLog(mssg);
host htExit();

host htMessagebox(mssg, title);

#define XKEY_ENTER 1;
#define XKEY_UP 2;
#define XKEY_DOWN 3;
#define XKEY_LEFT 4;
#define XKEY_RIGHT 5;
#define XKEY_SHOOT 6;
#define XKEY_BOMB 7;
#define XKEY_SLOW 8;
#define XKEY_ESC 9;
#define XKEY_1 10;
#define XKEY_2 11;
#define XKEY_3 12;
#define XKEY_4 13;
#define XKEY_5 14;
#define XKEY_6 15;
#define XKEY_7 16;
#define XKEY_8 17;
#define XKEY_9 18;
#define XKEY_0 19;
#define XKEY_TAB 20;
#define XKEY_SPACE 21;
#define XKEY_CTRL 22;
#define XKEY_P 23;


host htTestkey(keyid);

host htLoadScript(path);
host htSetCurrActiveScript(id);

//these functions are under test
//no need to call them
host htRemoveScript(id);
host htRemoveCurrActiveScript();

//font related
host htCreateFont(fontName, fontSize);
host htCreateFontWithColor(fontName, fontSize, r, g, b, a);
host htCreateFontWithColorEx(fontName, fontSize, r, g, b, a, isBold, isItalic, isAntialias);
host htSetFontColor(fontID, r, g, b, a);
host htSetFontKerning(fontID, kerning);
host htRenderStr(fontID, str);

host htCreateTextBox(x, y, w, h, fontName, fontSize);
host htDeleteTextBox(id);
host htMoveTextBoxTo(id, x, y);
host htSetTextBoxColor(id, r, g, b, a);
host htSetTextBoxPos(id, x, y);
host htSetTextBoxFrame(id, path, dx, dy);
host htSetTextBoxGradient(id, sr, sg, sb, sa, dr, dg, db, da);
host htSetTextBoxInfo(id, isScroll, isFade);
host htSetTextBoxText(id, text);
host htAddTextBoxText(id, text);
host htSetTextBoxSize(id, x, y, w, h);
host htSetTextBoxFadeUpdateDuration(id, dur);
host htSetTextBoxScrollUpdateDuration(id, dur);
