Frame 1
function Seq_CleanUp() {
if (gameSeq == undefined) {
} else if (gameSeq != null) {
seqGame_Exit(false);
}
if (endingSeq == undefined) {
} else if (endingSeq != null) {
seqEnding_Exit(false);
}
if (bootSeq == undefined) {
} else if (bootSeq != null) {
seqBoot_Exit(false);
}
}
function bootSeq_Create() {
var _local2 = new Object();
_local2.Exec = bootSeq_exec;
_local2.Destroy = bootSeq_destroy;
_local2.m_mode = 0;
_local2.m_step = 0;
_local2.m_frameCounter = 0;
_local2.m_timer = 0;
_local2.m_screen_mc = _root.createEmptyMovieClip("theLoadingScreen", DEPTH_SCENE_PROGRESS_LOAD);
var _local3 = Math.floor((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (_local3 >= 100) {
_local2.m_bg_mc = null;
_local2.m_title_mc = null;
_local2.m_bar_mc = null;
} else {
_local2.m_bg_mc = _root.theLoadingScreen.attachMovie("loading_bg", "loading_bg_mc", 10);
_local2.m_title_mc = _root.theLoadingScreen.attachMovie("loading_nowloading", "loading_nowloading_mc", 20);
_local2.m_title_mc._x = 240;
_local2.m_title_mc._y = 300;
_local2.m_bar_mc = _root.theLoadingScreen.createEmptyMovieClip("loading_bar_mc", 30);
}
return(_local2);
}
function bootSeq_exec() {
var _local7 = _root.getBytesLoaded() / _root.getBytesTotal();
switch (this.m_step) {
case 0 :
if (_local7 >= 1) {
this.m_step++;
}
break;
case 1 :
seqBoot_Exit(true);
return(undefined);
}
if (this.m_bar_mc != null) {
var _local3 = this.m_bar_mc;
var _local6 = Math.floor(_local7 * 512);
var _local5 = 36;
var _local4 = 320;
_local3.clear();
_local3.lineStyle(2, 0, 100);
_local3.moveTo(_local5, _local4);
_local3.lineTo(_local5 + 512, _local4);
_local3.lineTo(_local5 + 512, _local4 + 12);
_local3.lineTo(_local5, _local4 + 12);
_local3.lineTo(_local5, _local4);
_local3.lineStyle(1, 0, 100);
_local3.beginFill(16711680, 80);
_local3.moveTo(_local5, _local4 + 1);
_local3.lineTo(_local5 + _local6, _local4 + 1);
_local3.lineTo(_local5 + _local6, _local4 + 10);
_local3.lineTo(_local5, _local4 + 10);
_local3.lineTo(_local5, _local4);
_local3.endFill();
}
if (this.m_title_mc._y != null) {
var _local9 = this.m_frameCounter * 8;
var _local8 = (_local9 * Math.PI) / 180;
var _local10 = Math.abs(Math.cos(_local8) * 100);
this.m_title_mc._alpha = _local10;
}
this.m_frameCounter++;
}
function bootSeq_destroy() {
if (this.m_bar_mc != null) {
this.m_bar_mc.removeMovieClip();
this.m_bar_mc = null;
}
if (this.m_title_mc != null) {
this.m_title_mc.removeMovieClip();
this.m_title_mc = null;
}
if (this.m_bg_mc != null) {
this.m_bg_mc.removeMovieClip();
this.m_bg_mc = null;
}
if (this.m_screen_mc != null) {
this.m_screen_mc.removeMovieClip();
this.m_screen_mc = null;
}
}
function seqBoot_MainLoop() {
if (_root.bootSeq != null) {
_root.bootSeq.Exec();
}
}
function seqBoot_Exit(isNext) {
delete _root.onEnterFrame;
_root.bootSeq.Destroy();
_root.bootSeq = null;
if (isNext) {
_root.gotoAndPlay("seq_loading");
}
}
stop();
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
fscommand ("showmenu", "false");
_root.attachMovie("WindowLogo", "theWinLogo_mc", DEPTH_SCENE_WINLOGO, {_x:0, _y:0});
if (_root.UPPER_BG_IS_JPN) {
theWinLogo_mc.gotoAndPlay("PAT_JPN");
} else {
theWinLogo_mc.gotoAndPlay("PAT_ENG");
}
Seq_CleanUp();
stopAllSounds();
var loaded_swf_rate = Math.floor((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (loaded_swf_rate >= 100) {
_root.gotoAndPlay("seq_loading");
}
var bootSeq = bootSeq_Create();
_root.onEnterFrame = seqBoot_MainLoop;
Frame 2
stop();
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var progress_rate = Math.floor((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (progress_rate < 100) {
_root.gotoAndPlay("seq_boot");
} else {
_root.gotoAndPlay("seq_title");
}
Frame 3
function dspen_onEnterFrame() {
this._x = _root._xmouse;
this._y = _root._ymouse;
}
function dspen_onMouseDown() {
this.gotoAndPlay("PAT_ON");
}
function dspen_onMouseUp() {
this.gotoAndPlay("PAT_NORMAL");
}
stop();
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
Seq_CleanUp();
_root.createEmptyMovieClip("theUpperScreenMask_mc", DEPTH_SCENE_UPPER_MASK);
theUpperScreenMask_mc._x = SCENE_UPPER_XPOS;
theUpperScreenMask_mc._y = SCENE_UPPER_YPOS;
with (theUpperScreenMask_mc) {
beginFill(255);
moveTo(0, 0);
lineTo(STAGE_SCREEN_WIDTH, 0);
lineTo(STAGE_SCREEN_WIDTH, STAGE_SCREEN_HEIGHT);
lineTo(0, STAGE_SCREEN_HEIGHT);
lineTo(0, 0);
endFill();
}
_root.createEmptyMovieClip("theLowerScreenMask_mc", DEPTH_SCENE_LOWER_MASK);
theLowerScreenMask_mc._x = SCENE_LOWER_XPOS;
theLowerScreenMask_mc._y = SCENE_LOWER_YPOS;
with (theLowerScreenMask_mc) {
beginFill(255);
moveTo(0, 0);
lineTo(STAGE_SCREEN_WIDTH, 0);
lineTo(STAGE_SCREEN_WIDTH, STAGE_SCREEN_HEIGHT);
lineTo(0, STAGE_SCREEN_HEIGHT);
lineTo(0, 0);
endFill();
}
_root.createEmptyMovieClip("theUpperScreen", DEPTH_SCENE_UPPER);
theUpperScreen._x = SCENE_UPPER_XPOS;
theUpperScreen._y = SCENE_UPPER_YPOS;
theUpperScreen.setMask(theUpperScreenMask_mc);
_root.createEmptyMovieClip("theLowerScreen", DEPTH_SCENE_LOWER);
theLowerScreen._x = SCENE_LOWER_XPOS;
theLowerScreen._y = SCENE_LOWER_YPOS;
theLowerScreen.setMask(theLowerScreenMask_mc);
with (_root.theLowerScreen) {
clear();
beginFill(0, 0);
moveTo(0, 0);
lineTo(STAGE_SCREEN_WIDTH, 0);
lineTo(STAGE_SCREEN_WIDTH, STAGE_SCREEN_HEIGHT);
lineTo(0, STAGE_SCREEN_HEIGHT);
lineTo(0, 0);
endFill();
}
_root.theUpperScreen.createEmptyMovieClip("upperFadeBox_mc", DEPTH_UPPER_FADE);
with (_root.theUpperScreen.upperFadeBox_mc) {
clear();
beginFill(16777215, 100);
moveTo(0, 0);
lineTo(STAGE_SCREEN_WIDTH, 0);
lineTo(STAGE_SCREEN_WIDTH, STAGE_SCREEN_HEIGHT);
lineTo(0, STAGE_SCREEN_HEIGHT);
lineTo(0, 0);
endFill();
}
_root.theLowerScreen.createEmptyMovieClip("lowerFadeBox_mc", DEPTH_LOWER_SCENE_FADE);
with (_root.theLowerScreen.lowerFadeBox_mc) {
clear();
beginFill(16777215, 100);
moveTo(0, 0);
lineTo(STAGE_SCREEN_WIDTH, 0);
lineTo(STAGE_SCREEN_WIDTH, STAGE_SCREEN_HEIGHT);
lineTo(0, STAGE_SCREEN_HEIGHT);
lineTo(0, 0);
endFill();
}
_root.attachMovie("DSLiteFrame", "theDSFrame", DEPTH_SCENE_DSFRAME, {_x:DSFRAME_XPOS, _y:DSFRAME_YPOS});
_root.attachMovie("WindowBG", "theWinBG", DEPTH_SCENE_WINBG, {_x:0, _y:0});
_root.attachMovie("DSPenAnimation", "theDSPen_mc", DEPTH_SCENE_DSPEN);
theDSPen_mc._alpha = 80;
theDSPen_mc.onEnterFrame = dspen_onEnterFrame;
theDSPen_mc.onMouseDown = dspen_onMouseDown;
theDSPen_mc.onMouseUp = dspen_onMouseUp;
(Mouse.hide());// not popped
var bg_mc = theUpperScreen.attachMovie("UpBaseAnimation", "UpBG", DEPTH_UPPER_BG);
if (_root.UPPER_BG_IS_JPN) {
bg_mc.gotoAndPlay("PAT_JPN");
} else {
bg_mc.gotoAndPlay("PAT_ENG");
}
_root.gotoAndPlay("seq_game");
Frame 4
function vec3d_Create(x, y, z) {
return({x:x, y:y, z:z});
}
function vec3d_Clone(v) {
return({x:v.x, y:v.y, z:v.z});
}
function vec3d_Add(a, b) {
return({x:a.x + b.x, y:a.y + b.y, z:a.z + b.z});
}
function vec3d_Subtract(a, b) {
return({x:a.x - b.x, y:a.y - b.y, z:a.z - b.z});
}
function vec3d_Scale(a, v) {
return({x:a * v.x, y:a * v.y, z:a * v.z});
}
function vec3d_DotProduct(a, b) {
return(((a.x * b.x) + (a.y * b.y)) + (a.z * b.z));
}
function vec3d_CrossProduct(a, b) {
return({x:(a.y * b.z) - (a.z * b.y), y:(a.z * b.x) - (a.x * b.z), z:(a.x * b.y) - (a.y * b.x)});
}
function vec3d_Mag(v) {
return(Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z)));
}
function vec3d_Normalize(v) {
var _local2 = Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
if (_local2 > 0) {
_local2 = 1 / _local2;
}
return({x:v.x * _local2, y:v.y * _local2, z:v.z * _local2});
}
function vec3d_MultAdd(a, v1, v2) {
return({x:v2.x + (a * v1.x), y:v2.y + (a * v1.y), z:v2.z + (a * v1.z)});
}
function vec3d_Set(v, x, y, z) {
v.x = x;
v.y = y;
v.z = z;
}
function ObjSpdUpSet(lSpd, sSpd, sMaxSpd) {
lSpd = lSpd + sSpd;
if (sMaxSpd == 0) {
return(lSpd);
}
if (sSpd >= 0) {
if (lSpd > sMaxSpd) {
lSpd = sMaxSpd;
}
} else if (lSpd < (-sMaxSpd)) {
lSpd = -sMaxSpd;
}
return(lSpd);
}
function ObjSpdDownSet(lSpd, sSpd) {
if (lSpd > 0) {
lSpd = lSpd - sSpd;
if (lSpd < 0) {
lSpd = 0;
}
} else {
lSpd = lSpd + sSpd;
if (lSpd > 0) {
lSpd = 0;
}
}
return(lSpd);
}
function ObjShiftSet(lPos, sTag, divStep, usMax, usMin) {
var _local1;
if (lPos == sTag) {
return(lPos);
}
if (usMin == 0) {
usMin = 1;
}
_local1 = (sTag - lPos) * divStep;
if (usMax > 0) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin > 0) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ObjDiffSet(lPos, sTag, sSrc, divStep, usMax, usMin) {
if (lPos == sTag) {
return(lPos);
}
if (!usMin) {
usMin = 1;
}
var _local1;
_local1 = (lPos - sSrc) * divStep;
if (sTag > sSrc) {
if (_local1 < 0) {
_local1 = 0;
}
}
if (sTag < sSrc) {
if (_local1 > 0) {
_local1 = 0;
}
}
if (usMax) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ComputeNumBCDCode(val, valMax) {
if (val >= valMax) {
if (valMax == 0) {
val = 0;
} else {
val = valMax - 1;
}
}
var _local1;
var _local6 = 0;
var _local2 = valMax;
var _local4;
if (_local2 >= 100) {
_local2 = Math.floor(_local2 / 10);
_local1 = 0;
for(;;){
if (val >= _local2) {
_local4 = Math.floor(val / _local2);
_local6 = _local6 | (_local4 << _local1);
val = val - (_local4 * _local2);
}
_local1 = _local1 + 4;
if (_local2 <= 10) {
break;
}
_local2 = Math.floor(_local2 / 10);
};
}
_local6 = _local6 | (val << _local1);
var _local5 = _local1 / 4;
if (_local5 > 7) {
_local5 = 7;
} else if (_local5 < 0) {
_local5 = 0;
}
var _local9 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local8 = 0;
var _local7;
_local1 = 0;
while (_local1 < (_local5 + 1)) {
_local7 = (_local6 >> (4 * _local1)) & 15;
_local8 = _local8 | (_local7 << _local9[(7 - _local5) + _local1]);
_local1++;
}
return(_local8);
}
function ComputeTimeBCDCode(frameVal) {
var _local7 = [1080000, 108000, 18000, 1800, 300, 30, 10, 1];
var _local6 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local1;
var _local5 = 0;
var _local3;
var _local4;
_local1 = 0;
while (_local1 < 7) {
_local3 = _local7[_local1];
if (_local1 == 6) {
frameVal = Math.floor(frameVal * 3.4140625);
}
if (frameVal >= _local3) {
_local4 = Math.floor(frameVal / _local3);
_local5 = _local5 | (_local4 << _local6[_local1]);
frameVal = frameVal - (_local4 * _local3);
}
_local1++;
}
_local5 = _local5 | (frameVal << _local6[_local1]);
return(_local5);
}
function testVector3() {
}
function MouseDownCallback() {
this.m_oldState = false;
this.m_state = true;
}
function MouseUpCallback() {
this.m_oldState = true;
this.m_state = false;
}
function MouseInputUpdate(baseClip) {
this.m_oldPos.x = this.m_pos.x;
this.m_oldPos.y = this.m_pos.y;
this.m_pos.x = baseClip._xmouse;
this.m_pos.y = baseClip._ymouse;
this.m_posDelta.x = this.m_pos.x - this.m_oldPos.x;
this.m_posDelta.y = this.m_pos.y - this.m_oldPos.y;
if (this.m_state && (!this.m_oldState)) {
this.m_pressed = true;
this.m_oldState = true;
this.m_downPos.x = this.m_pos.x;
this.m_downPos.y = this.m_pos.y;
} else {
this.m_pressed = false;
}
if ((!this.m_state) && (this.m_oldState)) {
this.m_released = true;
this.m_oldState = false;
this.m_upPos.x = this.m_pos.x;
this.m_upPos.y = this.m_pos.y;
} else {
this.m_released = false;
}
if (this.m_state) {
this.m_upPos.x = this.m_pos.x;
this.m_upPos.y = this.m_pos.y;
}
this.m_key_on_old = this.m_key_on;
var _local2 = 0;
if (Key.isDown(32)) {
_local2 = _local2 | PAD_BUTTON_R;
}
this.m_key_on = _local2;
this.m_key_push = this.m_key_on & (this.m_key_on ^ this.m_key_on_old);
this.m_key_pull = this.m_key_on_old & (this.m_key_on ^ this.m_key_on_old);
}
function MouseInput_Create(baseClip) {
var _local1 = new Object();
_local1.m_pos = new flash.geom.Point(baseClip._xmouse, baseClip._ymouse);
_local1.m_oldPos = new flash.geom.Point(baseClip._xmouse, baseClip._ymouse);
_local1.m_posDelta = new flash.geom.Point(0, 0);
_local1.m_downPos = new flash.geom.Point(0, 0);
_local1.m_upPos = new flash.geom.Point(0, 0);
_local1.m_state = false;
_local1.m_oldState = false;
_local1.m_pressed = false;
_local1.m_released = false;
_local1.update = MouseInputUpdate;
_local1.onMouseDown = MouseDownCallback;
_local1.onMouseUp = MouseUpCallback;
Mouse.addListener(_local1);
_local1.m_key_on_old = 0;
_local1.m_key_on = 0;
_local1.m_key_push = 0;
_local1.m_key_pull = 0;
return(_local1);
}
function MouseInput_Destroy(work) {
Mouse.removeListener(work);
work.m_pos = null;
work.m_oldPos = null;
work.m_posDelta = null;
work.m_downPos = null;
work.m_upPos = null;
work.update = null;
delete work.onMouseDown;
delete work.onMouseUp;
work.onMouseDown = null;
work.onMouseUp = null;
}
function vec3d_Create(x, y, z) {
return({x:x, y:y, z:z});
}
function vec3d_Clone(v) {
return({x:v.x, y:v.y, z:v.z});
}
function vec3d_Add(a, b) {
return({x:a.x + b.x, y:a.y + b.y, z:a.z + b.z});
}
function vec3d_Subtract(a, b) {
return({x:a.x - b.x, y:a.y - b.y, z:a.z - b.z});
}
function vec3d_Scale(a, v) {
return({x:a * v.x, y:a * v.y, z:a * v.z});
}
function vec3d_DotProduct(a, b) {
return(((a.x * b.x) + (a.y * b.y)) + (a.z * b.z));
}
function vec3d_CrossProduct(a, b) {
return({x:(a.y * b.z) - (a.z * b.y), y:(a.z * b.x) - (a.x * b.z), z:(a.x * b.y) - (a.y * b.x)});
}
function vec3d_Mag(v) {
return(Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z)));
}
function vec3d_Normalize(v) {
var _local2 = Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
if (_local2 > 0) {
_local2 = 1 / _local2;
}
return({x:v.x * _local2, y:v.y * _local2, z:v.z * _local2});
}
function vec3d_MultAdd(a, v1, v2) {
return({x:v2.x + (a * v1.x), y:v2.y + (a * v1.y), z:v2.z + (a * v1.z)});
}
function vec3d_Set(v, x, y, z) {
v.x = x;
v.y = y;
v.z = z;
}
function ObjSpdUpSet(lSpd, sSpd, sMaxSpd) {
lSpd = lSpd + sSpd;
if (sMaxSpd == 0) {
return(lSpd);
}
if (sSpd >= 0) {
if (lSpd > sMaxSpd) {
lSpd = sMaxSpd;
}
} else if (lSpd < (-sMaxSpd)) {
lSpd = -sMaxSpd;
}
return(lSpd);
}
function ObjSpdDownSet(lSpd, sSpd) {
if (lSpd > 0) {
lSpd = lSpd - sSpd;
if (lSpd < 0) {
lSpd = 0;
}
} else {
lSpd = lSpd + sSpd;
if (lSpd > 0) {
lSpd = 0;
}
}
return(lSpd);
}
function ObjShiftSet(lPos, sTag, divStep, usMax, usMin) {
var _local1;
if (lPos == sTag) {
return(lPos);
}
if (usMin == 0) {
usMin = 1;
}
_local1 = (sTag - lPos) * divStep;
if (usMax > 0) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin > 0) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ObjDiffSet(lPos, sTag, sSrc, divStep, usMax, usMin) {
if (lPos == sTag) {
return(lPos);
}
if (!usMin) {
usMin = 1;
}
var _local1;
_local1 = (lPos - sSrc) * divStep;
if (sTag > sSrc) {
if (_local1 < 0) {
_local1 = 0;
}
}
if (sTag < sSrc) {
if (_local1 > 0) {
_local1 = 0;
}
}
if (usMax) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ComputeNumBCDCode(val, valMax) {
if (val >= valMax) {
if (valMax == 0) {
val = 0;
} else {
val = valMax - 1;
}
}
var _local1;
var _local6 = 0;
var _local2 = valMax;
var _local4;
if (_local2 >= 100) {
_local2 = Math.floor(_local2 / 10);
_local1 = 0;
for(;;){
if (val >= _local2) {
_local4 = Math.floor(val / _local2);
_local6 = _local6 | (_local4 << _local1);
val = val - (_local4 * _local2);
}
_local1 = _local1 + 4;
if (_local2 <= 10) {
break;
}
_local2 = Math.floor(_local2 / 10);
};
}
_local6 = _local6 | (val << _local1);
var _local5 = _local1 / 4;
if (_local5 > 7) {
_local5 = 7;
} else if (_local5 < 0) {
_local5 = 0;
}
var _local9 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local8 = 0;
var _local7;
_local1 = 0;
while (_local1 < (_local5 + 1)) {
_local7 = (_local6 >> (4 * _local1)) & 15;
_local8 = _local8 | (_local7 << _local9[(7 - _local5) + _local1]);
_local1++;
}
return(_local8);
}
function ComputeTimeBCDCode(frameVal) {
var _local7 = [1080000, 108000, 18000, 1800, 300, 30, 10, 1];
var _local6 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local1;
var _local5 = 0;
var _local3;
var _local4;
_local1 = 0;
while (_local1 < 7) {
_local3 = _local7[_local1];
if (_local1 == 6) {
frameVal = Math.floor(frameVal * 3.4140625);
}
if (frameVal >= _local3) {
_local4 = Math.floor(frameVal / _local3);
_local5 = _local5 | (_local4 << _local6[_local1]);
frameVal = frameVal - (_local4 * _local3);
}
_local1++;
}
_local5 = _local5 | (frameVal << _local6[_local1]);
return(_local5);
}
function testVector3() {
}
function sceneview_setparam(from, at) {
this.from.x = from.x;
this.from.y = from.y;
this.from.z = from.z;
this.at.x = at.x;
this.at.y = at.y;
this.at.z = at.z;
this.dirty = true;
}
function sceneview_setcurrent() {
if (this.dirty) {
var _local2 = vec3d_Subtract(this.from, this.at);
_local2 = vec3d_Normalize(_local2);
var _local3 = vec3d_CrossProduct(this.wup, _local2);
_local3 = vec3d_Normalize(_local3);
var _local4 = vec3d_CrossProduct(_local2, _local3);
_local4 = vec3d_Normalize(_local4);
this.right.x = _local3.x;
this.right.y = _local3.y;
this.right.z = _local3.z;
this.up.x = _local4.x;
this.up.y = _local4.y;
this.up.z = _local4.z;
this.forward.x = _local2.x;
this.forward.y = _local2.y;
this.forward.z = _local2.z;
this.pos.x = this.from.x;
this.pos.y = this.from.y;
this.pos.z = this.from.z;
this.dirty = false;
}
}
function sceneview_localizeposition(worldPos) {
var _local3 = vec3d_Subtract(worldPos, this.pos);
var _local2 = vec3d_Create(0, 0, 0);
_local2.x = vec3d_DotProduct(_local3, this.right);
_local2.y = vec3d_DotProduct(_local3, this.up);
_local2.z = vec3d_DotProduct(_local3, this.forward);
return(_local2);
}
function sceneview_globalizeDirection(localDir) {
var _local5 = vec3d_Scale(localDir.x, this.right);
var _local4 = vec3d_Scale(localDir.y, this.up);
var _local3 = vec3d_Scale(localDir.z, this.forward);
var _local2 = vec3d_Add(_local5, _local4);
_local2 = vec3d_Add(_local2, _local3);
return(_local2);
}
function SceneView_Create() {
var _local1 = new Object();
_local1.from = vec3d_Create(0, 0, 0);
_local1.at = vec3d_Create(0, 0, -1);
_local1.wup = vec3d_Create(0, 1, 0);
_local1.dirty = true;
_local1.SetParam = sceneview_setparam;
_local1.SetCurrent = sceneview_setcurrent;
_local1.LocalizePosition = sceneview_localizeposition;
_local1.GlobalizeDirection = sceneview_globalizeDirection;
_local1.pos = vec3d_Create(0, 0, 0);
_local1.right = vec3d_Create(1, 0, 0);
_local1.up = vec3d_Create(0, 1, 0);
_local1.forward = vec3d_Create(0, 0, 1);
return(_local1);
}
function SceneView_Destroy(viewObj) {
viewObj.from = null;
viewObj.at = null;
viewObj.wup = null;
viewObj.dirty = null;
viewObj.SetParam = null;
viewObj.SetCurrent = null;
viewObj.pos = null;
viewObj.right = null;
viewObj.up = null;
viewObj.forward = null;
}
function vec3d_Create(x, y, z) {
return({x:x, y:y, z:z});
}
function vec3d_Clone(v) {
return({x:v.x, y:v.y, z:v.z});
}
function vec3d_Add(a, b) {
return({x:a.x + b.x, y:a.y + b.y, z:a.z + b.z});
}
function vec3d_Subtract(a, b) {
return({x:a.x - b.x, y:a.y - b.y, z:a.z - b.z});
}
function vec3d_Scale(a, v) {
return({x:a * v.x, y:a * v.y, z:a * v.z});
}
function vec3d_DotProduct(a, b) {
return(((a.x * b.x) + (a.y * b.y)) + (a.z * b.z));
}
function vec3d_CrossProduct(a, b) {
return({x:(a.y * b.z) - (a.z * b.y), y:(a.z * b.x) - (a.x * b.z), z:(a.x * b.y) - (a.y * b.x)});
}
function vec3d_Mag(v) {
return(Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z)));
}
function vec3d_Normalize(v) {
var _local2 = Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
if (_local2 > 0) {
_local2 = 1 / _local2;
}
return({x:v.x * _local2, y:v.y * _local2, z:v.z * _local2});
}
function vec3d_MultAdd(a, v1, v2) {
return({x:v2.x + (a * v1.x), y:v2.y + (a * v1.y), z:v2.z + (a * v1.z)});
}
function vec3d_Set(v, x, y, z) {
v.x = x;
v.y = y;
v.z = z;
}
function ObjSpdUpSet(lSpd, sSpd, sMaxSpd) {
lSpd = lSpd + sSpd;
if (sMaxSpd == 0) {
return(lSpd);
}
if (sSpd >= 0) {
if (lSpd > sMaxSpd) {
lSpd = sMaxSpd;
}
} else if (lSpd < (-sMaxSpd)) {
lSpd = -sMaxSpd;
}
return(lSpd);
}
function ObjSpdDownSet(lSpd, sSpd) {
if (lSpd > 0) {
lSpd = lSpd - sSpd;
if (lSpd < 0) {
lSpd = 0;
}
} else {
lSpd = lSpd + sSpd;
if (lSpd > 0) {
lSpd = 0;
}
}
return(lSpd);
}
function ObjShiftSet(lPos, sTag, divStep, usMax, usMin) {
var _local1;
if (lPos == sTag) {
return(lPos);
}
if (usMin == 0) {
usMin = 1;
}
_local1 = (sTag - lPos) * divStep;
if (usMax > 0) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin > 0) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ObjDiffSet(lPos, sTag, sSrc, divStep, usMax, usMin) {
if (lPos == sTag) {
return(lPos);
}
if (!usMin) {
usMin = 1;
}
var _local1;
_local1 = (lPos - sSrc) * divStep;
if (sTag > sSrc) {
if (_local1 < 0) {
_local1 = 0;
}
}
if (sTag < sSrc) {
if (_local1 > 0) {
_local1 = 0;
}
}
if (usMax) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ComputeNumBCDCode(val, valMax) {
if (val >= valMax) {
if (valMax == 0) {
val = 0;
} else {
val = valMax - 1;
}
}
var _local1;
var _local6 = 0;
var _local2 = valMax;
var _local4;
if (_local2 >= 100) {
_local2 = Math.floor(_local2 / 10);
_local1 = 0;
for(;;){
if (val >= _local2) {
_local4 = Math.floor(val / _local2);
_local6 = _local6 | (_local4 << _local1);
val = val - (_local4 * _local2);
}
_local1 = _local1 + 4;
if (_local2 <= 10) {
break;
}
_local2 = Math.floor(_local2 / 10);
};
}
_local6 = _local6 | (val << _local1);
var _local5 = _local1 / 4;
if (_local5 > 7) {
_local5 = 7;
} else if (_local5 < 0) {
_local5 = 0;
}
var _local9 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local8 = 0;
var _local7;
_local1 = 0;
while (_local1 < (_local5 + 1)) {
_local7 = (_local6 >> (4 * _local1)) & 15;
_local8 = _local8 | (_local7 << _local9[(7 - _local5) + _local1]);
_local1++;
}
return(_local8);
}
function ComputeTimeBCDCode(frameVal) {
var _local7 = [1080000, 108000, 18000, 1800, 300, 30, 10, 1];
var _local6 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local1;
var _local5 = 0;
var _local3;
var _local4;
_local1 = 0;
while (_local1 < 7) {
_local3 = _local7[_local1];
if (_local1 == 6) {
frameVal = Math.floor(frameVal * 3.4140625);
}
if (frameVal >= _local3) {
_local4 = Math.floor(frameVal / _local3);
_local5 = _local5 | (_local4 << _local6[_local1]);
frameVal = frameVal - (_local4 * _local3);
}
_local1++;
}
_local5 = _local5 | (frameVal << _local6[_local1]);
return(_local5);
}
function testVector3() {
}
function vec3d_Create(x, y, z) {
return({x:x, y:y, z:z});
}
function vec3d_Clone(v) {
return({x:v.x, y:v.y, z:v.z});
}
function vec3d_Add(a, b) {
return({x:a.x + b.x, y:a.y + b.y, z:a.z + b.z});
}
function vec3d_Subtract(a, b) {
return({x:a.x - b.x, y:a.y - b.y, z:a.z - b.z});
}
function vec3d_Scale(a, v) {
return({x:a * v.x, y:a * v.y, z:a * v.z});
}
function vec3d_DotProduct(a, b) {
return(((a.x * b.x) + (a.y * b.y)) + (a.z * b.z));
}
function vec3d_CrossProduct(a, b) {
return({x:(a.y * b.z) - (a.z * b.y), y:(a.z * b.x) - (a.x * b.z), z:(a.x * b.y) - (a.y * b.x)});
}
function vec3d_Mag(v) {
return(Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z)));
}
function vec3d_Normalize(v) {
var _local2 = Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
if (_local2 > 0) {
_local2 = 1 / _local2;
}
return({x:v.x * _local2, y:v.y * _local2, z:v.z * _local2});
}
function vec3d_MultAdd(a, v1, v2) {
return({x:v2.x + (a * v1.x), y:v2.y + (a * v1.y), z:v2.z + (a * v1.z)});
}
function vec3d_Set(v, x, y, z) {
v.x = x;
v.y = y;
v.z = z;
}
function ObjSpdUpSet(lSpd, sSpd, sMaxSpd) {
lSpd = lSpd + sSpd;
if (sMaxSpd == 0) {
return(lSpd);
}
if (sSpd >= 0) {
if (lSpd > sMaxSpd) {
lSpd = sMaxSpd;
}
} else if (lSpd < (-sMaxSpd)) {
lSpd = -sMaxSpd;
}
return(lSpd);
}
function ObjSpdDownSet(lSpd, sSpd) {
if (lSpd > 0) {
lSpd = lSpd - sSpd;
if (lSpd < 0) {
lSpd = 0;
}
} else {
lSpd = lSpd + sSpd;
if (lSpd > 0) {
lSpd = 0;
}
}
return(lSpd);
}
function ObjShiftSet(lPos, sTag, divStep, usMax, usMin) {
var _local1;
if (lPos == sTag) {
return(lPos);
}
if (usMin == 0) {
usMin = 1;
}
_local1 = (sTag - lPos) * divStep;
if (usMax > 0) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin > 0) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ObjDiffSet(lPos, sTag, sSrc, divStep, usMax, usMin) {
if (lPos == sTag) {
return(lPos);
}
if (!usMin) {
usMin = 1;
}
var _local1;
_local1 = (lPos - sSrc) * divStep;
if (sTag > sSrc) {
if (_local1 < 0) {
_local1 = 0;
}
}
if (sTag < sSrc) {
if (_local1 > 0) {
_local1 = 0;
}
}
if (usMax) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ComputeNumBCDCode(val, valMax) {
if (val >= valMax) {
if (valMax == 0) {
val = 0;
} else {
val = valMax - 1;
}
}
var _local1;
var _local6 = 0;
var _local2 = valMax;
var _local4;
if (_local2 >= 100) {
_local2 = Math.floor(_local2 / 10);
_local1 = 0;
for(;;){
if (val >= _local2) {
_local4 = Math.floor(val / _local2);
_local6 = _local6 | (_local4 << _local1);
val = val - (_local4 * _local2);
}
_local1 = _local1 + 4;
if (_local2 <= 10) {
break;
}
_local2 = Math.floor(_local2 / 10);
};
}
_local6 = _local6 | (val << _local1);
var _local5 = _local1 / 4;
if (_local5 > 7) {
_local5 = 7;
} else if (_local5 < 0) {
_local5 = 0;
}
var _local9 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local8 = 0;
var _local7;
_local1 = 0;
while (_local1 < (_local5 + 1)) {
_local7 = (_local6 >> (4 * _local1)) & 15;
_local8 = _local8 | (_local7 << _local9[(7 - _local5) + _local1]);
_local1++;
}
return(_local8);
}
function ComputeTimeBCDCode(frameVal) {
var _local7 = [1080000, 108000, 18000, 1800, 300, 30, 10, 1];
var _local6 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local1;
var _local5 = 0;
var _local3;
var _local4;
_local1 = 0;
while (_local1 < 7) {
_local3 = _local7[_local1];
if (_local1 == 6) {
frameVal = Math.floor(frameVal * 3.4140625);
}
if (frameVal >= _local3) {
_local4 = Math.floor(frameVal / _local3);
_local5 = _local5 | (_local4 << _local6[_local1]);
frameVal = frameVal - (_local4 * _local3);
}
_local1++;
}
_local5 = _local5 | (frameVal << _local6[_local1]);
return(_local5);
}
function testVector3() {
}
function sceneview_setparam(from, at) {
this.from.x = from.x;
this.from.y = from.y;
this.from.z = from.z;
this.at.x = at.x;
this.at.y = at.y;
this.at.z = at.z;
this.dirty = true;
}
function sceneview_setcurrent() {
if (this.dirty) {
var _local2 = vec3d_Subtract(this.from, this.at);
_local2 = vec3d_Normalize(_local2);
var _local3 = vec3d_CrossProduct(this.wup, _local2);
_local3 = vec3d_Normalize(_local3);
var _local4 = vec3d_CrossProduct(_local2, _local3);
_local4 = vec3d_Normalize(_local4);
this.right.x = _local3.x;
this.right.y = _local3.y;
this.right.z = _local3.z;
this.up.x = _local4.x;
this.up.y = _local4.y;
this.up.z = _local4.z;
this.forward.x = _local2.x;
this.forward.y = _local2.y;
this.forward.z = _local2.z;
this.pos.x = this.from.x;
this.pos.y = this.from.y;
this.pos.z = this.from.z;
this.dirty = false;
}
}
function sceneview_localizeposition(worldPos) {
var _local3 = vec3d_Subtract(worldPos, this.pos);
var _local2 = vec3d_Create(0, 0, 0);
_local2.x = vec3d_DotProduct(_local3, this.right);
_local2.y = vec3d_DotProduct(_local3, this.up);
_local2.z = vec3d_DotProduct(_local3, this.forward);
return(_local2);
}
function sceneview_globalizeDirection(localDir) {
var _local5 = vec3d_Scale(localDir.x, this.right);
var _local4 = vec3d_Scale(localDir.y, this.up);
var _local3 = vec3d_Scale(localDir.z, this.forward);
var _local2 = vec3d_Add(_local5, _local4);
_local2 = vec3d_Add(_local2, _local3);
return(_local2);
}
function SceneView_Create() {
var _local1 = new Object();
_local1.from = vec3d_Create(0, 0, 0);
_local1.at = vec3d_Create(0, 0, -1);
_local1.wup = vec3d_Create(0, 1, 0);
_local1.dirty = true;
_local1.SetParam = sceneview_setparam;
_local1.SetCurrent = sceneview_setcurrent;
_local1.LocalizePosition = sceneview_localizeposition;
_local1.GlobalizeDirection = sceneview_globalizeDirection;
_local1.pos = vec3d_Create(0, 0, 0);
_local1.right = vec3d_Create(1, 0, 0);
_local1.up = vec3d_Create(0, 1, 0);
_local1.forward = vec3d_Create(0, 0, 1);
return(_local1);
}
function SceneView_Destroy(viewObj) {
viewObj.from = null;
viewObj.at = null;
viewObj.wup = null;
viewObj.dirty = null;
viewObj.SetParam = null;
viewObj.SetCurrent = null;
viewObj.pos = null;
viewObj.right = null;
viewObj.up = null;
viewObj.forward = null;
}
function StageSpriteMan_Init(stage_mc) {
var _local1 = new Object();
_local1.stage_mc = stage_mc;
_local1.geneDepth = 0;
_local1.sortDepth = 0;
_local1.orderContainer = new Array();
return(_local1);
}
function StageSpriteMan_Exit(mgr) {
mgr.orderContainer = null;
delete mgr.orderContainer;
}
function StageSpriteMan_CreateObject(mgr, objType) {
var _local1 = new Object();
_local1.pos = vec3d_Create(0, 0, 0);
_local1.viewPos = vec3d_Create(0, 0, 0);
_local1.screenPos = vec3d_Create(0, 0, 0);
_local1.sortDepth = STAGESPRITE_SORT_INIT_DEPTH;
_local1.objType = objType;
_local1.baseScale = 100;
_local1.width = 1;
return(_local1);
}
function StageSpriteMan_CreateMC(mgr, linkName) {
var _local1 = STAGESPRITE_GENE_DEPTH_START + mgr.geneDepth;
mgr.geneDepth = (mgr.geneDepth + 1) & STAGESPRITE_GENE_DEPTH_MASK;
var _local3 = mgr.stage_mc;
var _local4 = _local3.attachMovie(linkName, linkName + _local1, _local1);
return(_local4);
}
function StageSpriteMan_CreateEmptyMC(mgr, linkName) {
var _local1 = STAGESPRITE_GENE_DEPTH_START + mgr.geneDepth;
mgr.geneDepth = (mgr.geneDepth + 1) & STAGESPRITE_GENE_DEPTH_MASK;
var _local3 = mgr.stage_mc;
var _local4 = _local3.createEmptyMovieClip(("EMPTY_" + linkName) + _local1, _local1);
return(_local4);
}
function StageSpriteMan_ResetOrderArray(mgr) {
mgr.orderContainer = null;
mgr.orderContainer = new Array();
}
function StageSpriteMan_AddOrder(mgr, stageObj, stage_mc) {
var _local1 = new Object();
_local1.stageObj = stageObj;
_local1.stage_mc = stage_mc;
mgr.orderContainer.push(_local1);
}
function StageSpriteMan_TransformOrderItems(mgr, projMtx, stageView) {
var _local3 = (STAGE_SCREEN_HEIGHT / 2) * STAGE_FOVY_COTANGENT;
var _local2;
var _local5;
var _local4;
var _local6 = mgr.orderContainer.length;
var _local1;
i = 0;
while (i < _local6) {
_local1 = mgr.orderContainer[i].stageObj;
_local1.viewPos = stageView.LocalizePosition(_local1.pos);
_local2 = -_local1.viewPos.z;
_local5 = (_local3 * _local1.viewPos.x) / _local2;
_local4 = (_local3 * _local1.viewPos.y) / _local2;
_local1.screenPos.x = _local5 + (STAGE_SCREEN_WIDTH / 2);
_local1.screenPos.y = (-_local4) + (STAGE_SCREEN_HEIGHT / 2);
i++;
}
}
function StageSpriteMan_ZSortOrderItems(mgr) {
if (mgr.orderContainer.length > 0) {
var _local2 = function (a, b) {
var _local1 = a.stageObj.viewPos.z - b.stageObj.viewPos.z;
if (_local1 > 0) {
return(1);
}
if (_local1 < 0) {
return(-1);
}
return(0);
};
mgr.orderContainer.sort(_local2);
}
}
function StageSpriteMan_DrawOrderItems(mgr) {
var _local13 = 5;
var _local15 = 261;
var _local11 = (STAGE_SCREEN_HEIGHT / 2) / Math.tan(STAGE_FOVY_RAD);
var _local12 = STAGESPRITE_SORT_DEPTH_START;
var _local9;
var _local3;
var _local2;
var _local10;
var _local4 = new flash.geom.ColorTransform();
var _local5;
var _local7;
var _local6;
var _local8;
var _local16 = mgr.orderContainer.length;
_local9 = 0;
while (_local9 < _local16) {
_local3 = mgr.orderContainer[_local9].stageObj;
_local2 = mgr.orderContainer[_local9].stage_mc;
_local2.swapDepths(_local12);
_local12++;
switch (_local3.objType) {
case STAGESPRITE_TYPE_PLAYER :
_local2._x = _local3.screenPos.x - (_local2._width * 0.5);
_local2._y = _local3.screenPos.y - (_local2._height * 0.6);
break;
case STAGESPRITE_TYPE_WATER :
_local2._x = _local3.screenPos.x;
_local2._y = _local3.screenPos.y;
_local2._xscale = (_local2._yscale = _local3.baseScale);
break;
case STAGESPRITE_TYPE_BOOST :
_local2._x = _local3.screenPos.x - (_local2._width * 0.5);
_local2._y = _local3.screenPos.y - (_local2._height * 0.5);
_local2._xscale = (_local2._yscale = _local3.baseScale);
break;
case STAGESPRITE_TYPE_GOAL_ISLAND :
if (_local3.viewPos.z <= (-_local13)) {
_local2._x = _local3.screenPos.x;
_local2._y = _root.gameSeq.m_sea.sealine;
_local10 = _local11 / (-_local3.viewPos.z);
_local2._xscale = (_local2._yscale = _local10 * _local3.baseScale);
_local5 = (512 - (-_local3.viewPos.z)) / 288;
if (_local5 < 0) {
_local5 = 0;
} else if (_local5 > 1) {
_local5 = 1;
}
_local7 = _local5;
_local4.redMultiplier = _local7;
_local4.greenMultiplier = _local7;
_local4.blueMultiplier = _local7;
_local6 = Math.floor((1 - _local5) * 255);
_local4.redOffset = _local6;
_local4.greenOffset = _local6;
_local4.blueOffset = _local6;
_local8 = _local2.transform;
_local8.colorTransform = _local4;
_local2.transform = _local8;
_local2._visible = true;
} else {
_local2._visible = false;
}
break;
case STAGESPRITE_TYPE_BOOST_WIND :
break;
default :
if ((_local3.viewPos.z <= (-_local13)) && (_local3.viewPos.z > (-_local15))) {
if (_local3.objType == STAGESPRITE_TYPE_SHARK) {
_local2._x = _local3.screenPos.x - (_local2._width * 0.5);
_local2._y = _local3.screenPos.y - (_local2._height * 0.5);
} else {
_local2._x = _local3.screenPos.x;
_local2._y = _local3.screenPos.y;
}
_local10 = _local11 / (-_local3.viewPos.z);
_local2._xscale = (_local2._yscale = _local10 * _local3.baseScale);
_local5 = (128 - (-_local3.viewPos.z)) / 112;
if (_local5 < 0) {
_local5 = 0;
} else if (_local5 > 1) {
_local5 = 1;
}
_local7 = _local5;
_local4.redMultiplier = _local7;
_local4.greenMultiplier = _local7;
_local4.blueMultiplier = _local7;
_local6 = Math.floor((1 - _local5) * 255);
_local4.redOffset = _local6;
_local4.greenOffset = _local6;
_local4.blueOffset = _local6;
_local8 = _local2.transform;
_local8.colorTransform = _local4;
_local2.transform = _local8;
_local2._visible = true;
} else {
_local2._visible = false;
}
}
_local9++;
}
}
function StageSpriteMan_TransformItem(stageObj, projMtx, stageView) {
var _local7 = STAGE_SCREEN_WIDTH;
var _local8 = STAGE_SCREEN_HEIGHT;
var _local11 = _local7 / 2;
var _local12 = _local8 / 2;
var _local9 = _local7;
var _local10 = _local8;
stageObj.viewPos = stageView.LocalizePosition(stageObj.pos);
var _local3 = (((stageObj.viewPos.x * projMtx[0][3]) + (stageObj.viewPos.y * projMtx[1][3])) + (stageObj.viewPos.z * projMtx[2][3])) + projMtx[3][3];
var _local6 = (((stageObj.viewPos.x * projMtx[0][0]) + (stageObj.viewPos.y * projMtx[1][0])) + (stageObj.viewPos.z * projMtx[2][0])) + projMtx[3][0];
var _local5 = (((stageObj.viewPos.x * projMtx[0][1]) + (stageObj.viewPos.y * projMtx[1][1])) + (stageObj.viewPos.z * projMtx[2][1])) + projMtx[3][1];
var _local4 = (((stageObj.viewPos.x * projMtx[0][2]) + (stageObj.viewPos.y * projMtx[1][2])) + (stageObj.viewPos.z * projMtx[2][2])) + projMtx[3][2];
_local6 = (_local6 + _local3) / (2 * _local3);
_local5 = (_local5 + _local3) / (2 * _local3);
_local4 = (_local4 + _local3) / (2 * _local3);
stageObj.screenPos.x = 0 + (_local9 * _local6);
stageObj.screenPos.y = STAGE_SCREEN_HEIGHT - (_local10 * _local5);
stageObj.screenPos.z = _local4;
}
function StageSpriteMan_TransformItemOther(stageObj, stageView) {
stageObj.viewPos = stageView.LocalizePosition(stageObj.pos);
var _local3 = (STAGE_SCREEN_HEIGHT / 2) * STAGE_FOVY_COTANGENT;
var _local2 = -stageObj.viewPos.z;
var _local5 = (_local3 * stageObj.viewPos.x) / _local2;
var _local4 = (_local3 * stageObj.viewPos.y) / _local2;
stageObj.screenPos.x = _local5 + (STAGE_SCREEN_WIDTH / 2);
stageObj.screenPos.y = (-_local4) + (STAGE_SCREEN_HEIGHT / 2);
}
function vec3d_Create(x, y, z) {
return({x:x, y:y, z:z});
}
function vec3d_Clone(v) {
return({x:v.x, y:v.y, z:v.z});
}
function vec3d_Add(a, b) {
return({x:a.x + b.x, y:a.y + b.y, z:a.z + b.z});
}
function vec3d_Subtract(a, b) {
return({x:a.x - b.x, y:a.y - b.y, z:a.z - b.z});
}
function vec3d_Scale(a, v) {
return({x:a * v.x, y:a * v.y, z:a * v.z});
}
function vec3d_DotProduct(a, b) {
return(((a.x * b.x) + (a.y * b.y)) + (a.z * b.z));
}
function vec3d_CrossProduct(a, b) {
return({x:(a.y * b.z) - (a.z * b.y), y:(a.z * b.x) - (a.x * b.z), z:(a.x * b.y) - (a.y * b.x)});
}
function vec3d_Mag(v) {
return(Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z)));
}
function vec3d_Normalize(v) {
var _local2 = Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
if (_local2 > 0) {
_local2 = 1 / _local2;
}
return({x:v.x * _local2, y:v.y * _local2, z:v.z * _local2});
}
function vec3d_MultAdd(a, v1, v2) {
return({x:v2.x + (a * v1.x), y:v2.y + (a * v1.y), z:v2.z + (a * v1.z)});
}
function vec3d_Set(v, x, y, z) {
v.x = x;
v.y = y;
v.z = z;
}
function ObjSpdUpSet(lSpd, sSpd, sMaxSpd) {
lSpd = lSpd + sSpd;
if (sMaxSpd == 0) {
return(lSpd);
}
if (sSpd >= 0) {
if (lSpd > sMaxSpd) {
lSpd = sMaxSpd;
}
} else if (lSpd < (-sMaxSpd)) {
lSpd = -sMaxSpd;
}
return(lSpd);
}
function ObjSpdDownSet(lSpd, sSpd) {
if (lSpd > 0) {
lSpd = lSpd - sSpd;
if (lSpd < 0) {
lSpd = 0;
}
} else {
lSpd = lSpd + sSpd;
if (lSpd > 0) {
lSpd = 0;
}
}
return(lSpd);
}
function ObjShiftSet(lPos, sTag, divStep, usMax, usMin) {
var _local1;
if (lPos == sTag) {
return(lPos);
}
if (usMin == 0) {
usMin = 1;
}
_local1 = (sTag - lPos) * divStep;
if (usMax > 0) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin > 0) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ObjDiffSet(lPos, sTag, sSrc, divStep, usMax, usMin) {
if (lPos == sTag) {
return(lPos);
}
if (!usMin) {
usMin = 1;
}
var _local1;
_local1 = (lPos - sSrc) * divStep;
if (sTag > sSrc) {
if (_local1 < 0) {
_local1 = 0;
}
}
if (sTag < sSrc) {
if (_local1 > 0) {
_local1 = 0;
}
}
if (usMax) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ComputeNumBCDCode(val, valMax) {
if (val >= valMax) {
if (valMax == 0) {
val = 0;
} else {
val = valMax - 1;
}
}
var _local1;
var _local6 = 0;
var _local2 = valMax;
var _local4;
if (_local2 >= 100) {
_local2 = Math.floor(_local2 / 10);
_local1 = 0;
for(;;){
if (val >= _local2) {
_local4 = Math.floor(val / _local2);
_local6 = _local6 | (_local4 << _local1);
val = val - (_local4 * _local2);
}
_local1 = _local1 + 4;
if (_local2 <= 10) {
break;
}
_local2 = Math.floor(_local2 / 10);
};
}
_local6 = _local6 | (val << _local1);
var _local5 = _local1 / 4;
if (_local5 > 7) {
_local5 = 7;
} else if (_local5 < 0) {
_local5 = 0;
}
var _local9 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local8 = 0;
var _local7;
_local1 = 0;
while (_local1 < (_local5 + 1)) {
_local7 = (_local6 >> (4 * _local1)) & 15;
_local8 = _local8 | (_local7 << _local9[(7 - _local5) + _local1]);
_local1++;
}
return(_local8);
}
function ComputeTimeBCDCode(frameVal) {
var _local7 = [1080000, 108000, 18000, 1800, 300, 30, 10, 1];
var _local6 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local1;
var _local5 = 0;
var _local3;
var _local4;
_local1 = 0;
while (_local1 < 7) {
_local3 = _local7[_local1];
if (_local1 == 6) {
frameVal = Math.floor(frameVal * 3.4140625);
}
if (frameVal >= _local3) {
_local4 = Math.floor(frameVal / _local3);
_local5 = _local5 | (_local4 << _local6[_local1]);
frameVal = frameVal - (_local4 * _local3);
}
_local1++;
}
_local5 = _local5 | (frameVal << _local6[_local1]);
return(_local5);
}
function testVector3() {
}
function ScreenSpriteMan_Init(base_mc) {
var _local1 = new Object();
_local1.base_mc = base_mc;
_local1.fixDepth = 0;
_local1.markerDepth = 0;
_local1.effectDepth = 0;
_local1.soundDepth = 0;
_local1.effectFrontDepth = 0;
return(_local1);
}
function ScreenSpriteMan_Exit(mgr) {
mgr.base_mc = null;
}
function ScreenSpriteMan_CreateFixMC(mgr, linkName, offsetDepth) {
var _local1 = SCREENSPRITE_DEPTH_FIX + offsetDepth;
if (linkName == "EMPTY_MC") {
return(mgr.base_mc.createEmptyMovieClip(("FIX_" + linkName) + _local1, _local1));
}
return(mgr.base_mc.attachMovie(linkName, linkName + _local1, _local1));
}
function ScreenSpriteMan_CreateMarkerMC(mgr, linkName) {
var _local2 = SCREENSPRITE_DEPTH_MARKER + mgr.markerDepth;
mgr.markerDepth = (mgr.markerDepth + 1) & SCREENSPRITE_DEPTH_MASK;
return(mgr.base_mc.attachMovie(linkName, linkName + _local2, _local2));
}
function ScreenSpriteMan_CreateEffectMC(mgr, linkName) {
var _local2 = SCREENSPRITE_DEPTH_EFFECT + mgr.effectDepth;
mgr.effectDepth = (mgr.effectDepth + 1) & SCREENSPRITE_DEPTH_MASK;
return(mgr.base_mc.attachMovie(linkName, linkName + _local2, _local2));
}
function ScreenSpriteMan_CreateSoundMC(mgr, linkName) {
var _local2 = SCREENSPRITE_DEPTH_SOUND + mgr.soundDepth;
mgr.soundDepth = (mgr.soundDepth + 1) & SCREENSPRITE_DEPTH_MASK;
return(mgr.base_mc.createEmptyMovieClip(linkName + _local2, _local2));
}
function ScreenSpriteMan_CreateEffectFrontMC(mgr, linkName) {
var _local2 = SCREENSPRITE_DEPTH_EFFECT_FRONT + mgr.effectFrontDepth;
mgr.effectFrontDepth = (mgr.effectFrontDepth + 1) & SCREENSPRITE_DEPTH_MASK;
return(mgr.base_mc.attachMovie(linkName, linkName + _local2, _local2));
}
function StageSoundMan_Init(stage_mc) {
var _local5 = ["bgm_game", "bgm_discover", "bgm_retire", "bgm_result"];
var _local3 = ["se_accel", "se_max_speed", "se_brake", "se_boost_on", "se_boost", "se_boost_end", "se_no_energy", "se_ski_jump", "se_land_water", "se_trick_slide", "se_trick_suc", "se_trick_fail", "se_splash", "se_damage", "se_collision", "se_retire", "se_explosion", "se_ring", "se_goal", "se_score_indication", "se_drift", "se_idling", "se_go", "se_owa", "se_yahoo", "se_yea", "se_t_decide"];
if (!UPPER_BG_IS_JPN) {
_local3[SOUND_SE_GO] = "se_go_e";
_local3[SOUND_SE_OWA] = "se_owa_e";
_local3[SOUND_SE_YAHOO] = "se_yahoo_e";
_local3[SOUND_SE_YEA] = "se_yea_e";
}
var _local2 = new Object();
_local2.stage_mc = stage_mc;
_local2.bgms = new Array();
_local2.ses = new Array();
_local2.bgm_linknames = _local5;
_local2.se_linknames = _local3;
_local2.sound_mcs = new Array();
_local2.global_sound = null;
stagesoundman_setup_bgm(_local2);
stagesoundman_setup_se(_local2);
var _local4 = _root.screenSpriteMgr.base_mc;
_local2.global_sound = new Sound(_local4);
_local2.PlayBGM = stagesoundman_play_bgm;
_local2.StopBGM = stagesoundman_stop_bgm;
_local2.PlaySE = stagesoundman_play_se;
_local2.StopSE = stagesoundman_stop_se;
_local2.SetVolumeG = stagesoundman_setvolumeg;
return(_local2);
}
function StageSoundMan_Exit(mgr) {
stopAllSounds();
mgr.stage_mc = null;
mgr.bgms = null;
mgr.ses = null;
mgr.bgm_names = null;
var _local1;
_local1 = 0;
while (_local1 < mgr.sound_mcs.length) {
mgr.sound_mcs[_local1].removeMovieClip();
mgr.sound_mcs[_local1] = null;
_local1++;
}
mgr.sound_mcs = null;
mgr.global_sound = null;
}
function stagesoundman_setup_bgm(mgr) {
var _local2;
_local2 = 0;
while (_local2 < mgr.bgm_linknames.length) {
var _local6 = mgr.bgm_linknames[_local2];
var _local4 = ScreenSpriteMan_CreateSoundMC(_root.screenSpriteMgr, "SoundBgm");
var _local3 = new Sound(_local4);
if (_local2 == SOUND_BGM_GAME) {
_local3.onSoundComplete = stagesoundman_onSoundComplete;
}
_local3.attachSound(_local6);
mgr.bgms[_local2] = _local3;
mgr.sound_mcs.push(_local4);
_local2++;
}
}
function stagesoundman_setup_se(mgr) {
var _local2;
_local2 = 0;
while (_local2 < mgr.se_linknames.length) {
var _local6 = mgr.se_linknames[_local2];
var _local4 = ScreenSpriteMan_CreateSoundMC(_root.screenSpriteMgr, "SoundSe");
var _local3 = new Sound(_local4);
switch (_local2) {
case SOUND_SE_DRIFT :
case SOUND_SE_IDLING :
case SOUND_SE_BOOST :
case SOUND_SE_MAX_SPEED :
case SOUND_SE_SCORE_INDICATION :
_local3.onSoundComplete = stagesoundman_onSoundComplete;
}
_local3.attachSound(_local6);
mgr.ses[_local2] = _local3;
mgr.sound_mcs.push(_local4);
_local2++;
}
}
function stagesoundman_onSoundComplete() {
this.start(0, SOUND_DEFAULT_LOOP_COUNT);
}
function stagesoundman_play_bgm(bgm_no) {
if (this.bgms[bgm_no]) {
var _local2 = this.bgms[bgm_no];
if (bgm_no == SOUND_BGM_GAME) {
_local2.start(0, SOUND_DEFAULT_LOOP_COUNT);
} else {
_local2.start();
}
}
}
function stagesoundman_stop_bgm(bgm_no) {
if (this.bgms[bgm_no]) {
var _local4 = this.bgms[bgm_no];
var _local2 = this.bgm_linknames[bgm_no];
_local4.stop(_local2);
}
}
function stagesoundman_play_se(se_no) {
if (this.ses[se_no]) {
var _local2 = this.ses[se_no];
switch (se_no) {
case SOUND_SE_IDLING :
_local2.start(0, SOUND_DEFAULT_LOOP_COUNT);
break;
case SOUND_SE_DRIFT :
case SOUND_SE_BOOST :
case SOUND_SE_MAX_SPEED :
case SOUND_SE_SCORE_INDICATION :
_local2.start(0, SOUND_DEFAULT_LOOP_COUNT);
break;
default :
_local2.start();
}
}
}
function stagesoundman_stop_se(se_no) {
if (this.ses[se_no]) {
var _local4 = this.ses[se_no];
var _local3 = this.se_linknames[se_no];
_local4.stop(_local3);
}
}
function stagesoundman_setvolumeg(vol) {
if (this.global_sound != null) {
this.global_sound.setVolume(vol);
}
}
function ScreenFade_Create() {
var _local1 = new Object();
_local1.taskflag = 0;
_local1.exec = screenfade_exec;
_local1.exit = screenfade_exit;
_local1.step = 0;
_local1.alpha = 100;
_local1.color = 16777215 /* 0xFFFFFF */;
_local1.busy = false;
return(_local1);
}
function screenfade_exec() {
var SCREENFADE_FADE_SPD = 5;
var fUpdateBox = false;
switch (this.step) {
case SCREENFADE_STEP_IDLE :
break;
case SCREENFADE_STEP_FADE_IN :
this.alpha = this.alpha - SCREENFADE_FADE_SPD;
if (this.alpha < 0) {
this.alpha = 0;
this.step = SCREENFADE_STEP_IDLE;
this.busy = false;
}
fUpdateBox = true;
break;
case SCREENFADE_STEP_FADE_OUT :
this.alpha = this.alpha + SCREENFADE_FADE_SPD;
if (this.alpha > 100) {
this.alpha = 100;
this.step = SCREENFADE_STEP_IDLE;
this.busy = false;
}
fUpdateBox = true;
}
if (fUpdateBox) {
var alpha = Math.floor(this.alpha);
if (this.alpha > 0) {
with (_root.theUpperScreen.upperFadeBox_mc) {
_visible = true;
clear();
beginFill(this.color, alpha);
moveTo(0, 0);
lineTo(STAGE_SCREEN_WIDTH, 0);
lineTo(STAGE_SCREEN_WIDTH, STAGE_SCREEN_HEIGHT);
lineTo(0, STAGE_SCREEN_HEIGHT);
lineTo(0, 0);
endFill();
}
with (_root.theLowerScreen.lowerFadeBox_mc) {
_visible = true;
clear();
beginFill(this.color, alpha);
moveTo(0, 0);
lineTo(STAGE_SCREEN_WIDTH, 0);
lineTo(STAGE_SCREEN_WIDTH, STAGE_SCREEN_HEIGHT);
lineTo(0, STAGE_SCREEN_HEIGHT);
lineTo(0, 0);
endFill();
}
} else {
with (_root.theUpperScreen.upperFadeBox_mc) {
_visible = false;
}
with (_root.theLowerScreen.lowerFadeBox_mc) {
_visible = false;
}
}
}
}
function screenfade_exit() {
}
function ScreenFade_WhiteInRequest(myFade) {
myFade.alpha = 100;
myFade.color = 16777215 /* 0xFFFFFF */;
myFade.step = SCREENFADE_STEP_FADE_IN;
myFade.busy = true;
}
function ScreenFade_WhiteOutRequest(myFade) {
myFade.alpha = 0;
myFade.color = 16777215 /* 0xFFFFFF */;
myFade.step = SCREENFADE_STEP_FADE_OUT;
myFade.busy = true;
}
function vec3d_Create(x, y, z) {
return({x:x, y:y, z:z});
}
function vec3d_Clone(v) {
return({x:v.x, y:v.y, z:v.z});
}
function vec3d_Add(a, b) {
return({x:a.x + b.x, y:a.y + b.y, z:a.z + b.z});
}
function vec3d_Subtract(a, b) {
return({x:a.x - b.x, y:a.y - b.y, z:a.z - b.z});
}
function vec3d_Scale(a, v) {
return({x:a * v.x, y:a * v.y, z:a * v.z});
}
function vec3d_DotProduct(a, b) {
return(((a.x * b.x) + (a.y * b.y)) + (a.z * b.z));
}
function vec3d_CrossProduct(a, b) {
return({x:(a.y * b.z) - (a.z * b.y), y:(a.z * b.x) - (a.x * b.z), z:(a.x * b.y) - (a.y * b.x)});
}
function vec3d_Mag(v) {
return(Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z)));
}
function vec3d_Normalize(v) {
var _local2 = Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
if (_local2 > 0) {
_local2 = 1 / _local2;
}
return({x:v.x * _local2, y:v.y * _local2, z:v.z * _local2});
}
function vec3d_MultAdd(a, v1, v2) {
return({x:v2.x + (a * v1.x), y:v2.y + (a * v1.y), z:v2.z + (a * v1.z)});
}
function vec3d_Set(v, x, y, z) {
v.x = x;
v.y = y;
v.z = z;
}
function ObjSpdUpSet(lSpd, sSpd, sMaxSpd) {
lSpd = lSpd + sSpd;
if (sMaxSpd == 0) {
return(lSpd);
}
if (sSpd >= 0) {
if (lSpd > sMaxSpd) {
lSpd = sMaxSpd;
}
} else if (lSpd < (-sMaxSpd)) {
lSpd = -sMaxSpd;
}
return(lSpd);
}
function ObjSpdDownSet(lSpd, sSpd) {
if (lSpd > 0) {
lSpd = lSpd - sSpd;
if (lSpd < 0) {
lSpd = 0;
}
} else {
lSpd = lSpd + sSpd;
if (lSpd > 0) {
lSpd = 0;
}
}
return(lSpd);
}
function ObjShiftSet(lPos, sTag, divStep, usMax, usMin) {
var _local1;
if (lPos == sTag) {
return(lPos);
}
if (usMin == 0) {
usMin = 1;
}
_local1 = (sTag - lPos) * divStep;
if (usMax > 0) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin > 0) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ObjDiffSet(lPos, sTag, sSrc, divStep, usMax, usMin) {
if (lPos == sTag) {
return(lPos);
}
if (!usMin) {
usMin = 1;
}
var _local1;
_local1 = (lPos - sSrc) * divStep;
if (sTag > sSrc) {
if (_local1 < 0) {
_local1 = 0;
}
}
if (sTag < sSrc) {
if (_local1 > 0) {
_local1 = 0;
}
}
if (usMax) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ComputeNumBCDCode(val, valMax) {
if (val >= valMax) {
if (valMax == 0) {
val = 0;
} else {
val = valMax - 1;
}
}
var _local1;
var _local6 = 0;
var _local2 = valMax;
var _local4;
if (_local2 >= 100) {
_local2 = Math.floor(_local2 / 10);
_local1 = 0;
for(;;){
if (val >= _local2) {
_local4 = Math.floor(val / _local2);
_local6 = _local6 | (_local4 << _local1);
val = val - (_local4 * _local2);
}
_local1 = _local1 + 4;
if (_local2 <= 10) {
break;
}
_local2 = Math.floor(_local2 / 10);
};
}
_local6 = _local6 | (val << _local1);
var _local5 = _local1 / 4;
if (_local5 > 7) {
_local5 = 7;
} else if (_local5 < 0) {
_local5 = 0;
}
var _local9 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local8 = 0;
var _local7;
_local1 = 0;
while (_local1 < (_local5 + 1)) {
_local7 = (_local6 >> (4 * _local1)) & 15;
_local8 = _local8 | (_local7 << _local9[(7 - _local5) + _local1]);
_local1++;
}
return(_local8);
}
function ComputeTimeBCDCode(frameVal) {
var _local7 = [1080000, 108000, 18000, 1800, 300, 30, 10, 1];
var _local6 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local1;
var _local5 = 0;
var _local3;
var _local4;
_local1 = 0;
while (_local1 < 7) {
_local3 = _local7[_local1];
if (_local1 == 6) {
frameVal = Math.floor(frameVal * 3.4140625);
}
if (frameVal >= _local3) {
_local4 = Math.floor(frameVal / _local3);
_local5 = _local5 | (_local4 << _local6[_local1]);
frameVal = frameVal - (_local4 * _local3);
}
_local1++;
}
_local5 = _local5 | (frameVal << _local6[_local1]);
return(_local5);
}
function testVector3() {
}
function StageMap_Create() {
var _local1 = new Object();
_local1.taskflag = 0;
_local1.exec = stagemap_exec;
_local1.exit = stagemap_exit;
_local1.pos_line = 0;
_local1.pos_line_prev = 0;
_local1.pos_line_current = 0;
_local1.pos = vec3d_Create(0, 0, 0);
_local1.pos_prev = vec3d_Create(0, 0, 0);
_local1.pos_start = vec3d_Create(0, 0, 0);
_local1.move = vec3d_Create(0, 0, 0);
_local1.pos_block = 0;
_local1.block_total = 0;
_local1.blks = new Array();
return(_local1);
}
function stagemap_exec() {
var _local4 = 0;
var _local3 = this.blks[this.pos_block];
_local4 = seqGame_GetPlayerSpdForMap();
this.pos_line_prev = this.pos_line;
this.pos_line = this.pos_line + _local4;
this.pos_line_current = this.pos_line_current + _local4;
this.pos_prev.x = this.pos.x;
this.pos_prev.y = this.pos.y;
this.pos_prev.z = this.pos.z;
if (this.block_total > this.pos_block) {
if (this.pos_line_current >= STAGEMAP_SEA_LINE_LENGTH) {
this.pos_line_current = this.pos_line_current - STAGEMAP_SEA_LINE_LENGTH;
this.pos_block++;
_local3 = this.blks[this.pos_block];
this.pos.x = _local3.pos_start.x;
this.pos.y = _local3.pos_start.y;
this.pos.z = _local3.pos_start.z;
this.pos_start.x = this.pos.x;
this.pos_start.y = this.pos.y;
this.pos_start.z = this.pos.z;
if (_local3.type >= MAP_BLKTYPE_ISLAND_PREV) {
switch (_local3.type) {
case MAP_BLKTYPE_ISLAND_PREV :
_root.gameSeq.m_gameflags = _root.gameSeq.m_gameflags | SBD_MAIN_LAND_PREV;
break;
case MAP_BLKTYPE_ISLAND :
_root.gameSeq.m_gameflags = _root.gameSeq.m_gameflags | SBD_MAIN_LAND;
}
}
}
}
var _local5 = this.pos_line_current / STAGEMAP_SEA_LINE_LENGTH;
var pos = StageMap_RatoForPos(_local3, _local5);
this.pos.x = pos.x;
this.pos.y = pos.y;
this.pos.z = pos.z;
this.move = vec3d_Subtract(this.pos, this.pos_prev);
}
function stagemap_exit() {
}
function StageMap_RatoForPos(blk, rate) {
var _local6 = (1 - rate) * (1 - rate);
var _local2 = (rate + rate) * (1 - rate);
var _local5 = rate * rate;
if (((_local6 + _local2) + _local5) != 1) {
_local2 = _local2 + (1 - ((_local6 + _local2) + _local5));
}
var _local4 = vec3d_Create(0, 0, 0);
_local4.x = ((_local6 * blk.pos_start.x) + (_local2 * blk.pos_point.x)) + (_local5 * blk.pos_end.x);
_local4.y = 0;
_local4.z = ((_local6 * blk.pos_start.z) + (_local2 * blk.pos_point.z)) + (_local5 * blk.pos_end.z);
return(_local4);
}
function StageMap_Setup(myMap) {
var _local2;
myMap.block_total = STAGEMAP_LINESIZE;
_local2 = 0;
while (_local2 < (myMap.block_total + 1)) {
var _local1 = new Object();
_local1.type = 0;
_local1.level = 0;
_local1.block_no = 0;
_local1.block_no_type = 0;
_local1.pos_start = vec3d_Create(0, 0, 0);
_local1.pos_point = vec3d_Create(0, 0, 0);
_local1.pos_end = vec3d_Create(0, 0, 0);
_local1.line = 0;
myMap.blks[_local2] = _local1;
_local2++;
}
myMap.blks[myMap.block_total - 1].type = MAP_BLKTYPE_ISLAND_PREV;
myMap.blks[myMap.block_total].type = MAP_BLKTYPE_ISLAND;
stagemap_mapblockset(myMap);
}
function stagemap_mapblockset(myMap) {
var _local1;
var _local4;
_local1 = myMap.blks[0];
_local1.pos_start.x = myMap.pos_start.x;
_local1.pos_start.y = myMap.pos_start.y;
_local1.pos_start.z = myMap.pos_start.z;
_local1.line = 0;
var _local2 = vec3d_Create(0, 0, -STAGEMAP_SEA_LINE_LENGTH);
_local1.pos_end.x = _local1.pos_start.x + _local2.x;
_local1.pos_end.y = _local1.pos_start.y + _local2.y;
_local1.pos_end.z = _local1.pos_start.z + _local2.z;
_local2 = vec3d_Scale(0.5, _local2);
_local1.pos_point.x = _local1.pos_start.x + _local2.x;
_local1.pos_point.y = _local1.pos_start.y + _local2.y;
_local1.pos_point.z = _local1.pos_start.z + _local2.z;
var _local3;
_local3 = 1;
while (_local3 < myMap.blks.length) {
_local4 = myMap.blks[_local3 - 1];
_local1 = myMap.blks[_local3];
_local1.line = _local4.line + STAGEMAP_SEA_LINE_LENGTH;
_local1.pos_start.x = _local4.pos_end.x;
_local1.pos_start.y = _local4.pos_end.y;
_local1.pos_start.z = _local4.pos_end.z;
_local2 = vec3d_Create(0, 0, -STAGEMAP_SEA_LINE_LENGTH);
_local1.pos_end.x = _local1.pos_start.x + _local2.x;
_local1.pos_end.y = _local1.pos_start.y + _local2.y;
_local1.pos_end.z = _local1.pos_start.z + _local2.z;
_local2 = vec3d_Scale(0.5, _local2);
_local1.pos_point.x = _local1.pos_start.x + _local2.x;
_local1.pos_point.y = _local1.pos_start.y + _local2.y;
_local1.pos_point.z = _local1.pos_start.z + _local2.z;
_local3++;
}
}
function Player_Create() {
var myShip = new Object();
myShip.taskflag = 0;
myShip.exec = player_exec;
myShip.exit = player_exit;
myShip.mainState = 0;
myShip.move_flag = 0;
myShip.user_flag = 0;
myShip.user_timer = 0;
myShip.score = 0;
myShip.enemy_kill = 0;
myShip.vit = SBD_JETSKI_VIT_DEFAULT;
myShip.tension = 0;
myShip.ring_num = 0;
myShip.state = -1;
myShip.time_invisible = 0;
myShip.combo_hit = 0;
myShip.combo_hit_max = 0;
myShip.trick_type = 0;
myShip.jump_type = 0;
myShip.jump_offset = 0;
myShip.boost_time = 0;
myShip.boost_ignore_time = 0;
myShip.combo_timer = 0;
myShip.combo_ring = 0;
myShip.spdup_timer = 0;
myShip.spdup_slow_timer = 0;
myShip.nomove_timer = 0;
myShip.slow_move_timer = 0;
myShip.boost_combo_time = 0;
myShip.boost_start_time = 0;
myShip.hitstop_timer = 0;
myShip.touch_flag = 0;
myShip.touch_on = new flash.geom.Point(STAGE_SCREEN_WIDTH / 2, STAGE_SCREEN_HEIGHT / 2);
myShip.touch_prev = new flash.geom.Point(STAGE_SCREEN_WIDTH / 2, STAGE_SCREEN_HEIGHT / 2);
myShip.touch_push = new flash.geom.Point(STAGE_SCREEN_WIDTH / 2, STAGE_SCREEN_HEIGHT / 2);
myShip.d_time = 64;
myShip.key_push = 0;
myShip.key_pull = 0;
myShip.key_on = 0;
myShip.pos_touch = new flash.geom.Point(STAGE_SCREEN_WIDTH / 2, STAGE_SCREEN_HEIGHT / 2);
myShip.pos_target = vec3d_Create(0, 0, 0);
myShip.spd = 0;
myShip.velocity = vec3d_Create(0, 0, 0);
myShip.move_flag = myShip.move_flag | OBD_MOVE_FALL;
myShip.spd_fall = 0.0068359375;
myShip.spd_fall_max = 0.5;
myShip.move_flag = myShip.move_flag | OBD_MOVE_UNDER;
myShip.stageObj = StageSpriteMan_CreateObject(_root.stageSpriteMgr, STAGESPRITE_TYPE_PLAYER);
myShip.stage_mc = StageSpriteMan_CreateMC(_root.stageSpriteMgr, "PlayerAnimation");
var mask_mc = _root.createEmptyMovieClip("thePlayerSeaMask_mc", DEPTH_SCENE_PLAYER_SEA_MASK);
mask_mc._x = SCENE_LOWER_XPOS;
mask_mc._y = SCENE_LOWER_YPOS;
with (mask_mc) {
beginFill(4194304, 80);
moveTo(0, 0);
lineTo(STAGE_SCREEN_WIDTH, 0);
lineTo(STAGE_SCREEN_WIDTH, 159);
lineTo(0, 159);
lineTo(0, 0);
endFill();
}
myShip.sea_mask_mc = mask_mc;
myShip.stage_mc.setMask(mask_mc);
player_ShipActionChange(myShip, SBE_JET_FW);
myShip.pos_target = player_computePosTarget(myShip.pos_touch.x, PLAYER_TOUCH_POS_Y, PLAYER_JETSKI_POS);
myShip.stageObj.pos.x = myShip.pos_target.x;
myShip.stageObj.pos.y = 0;
myShip.stageObj.pos.z = myShip.pos_target.z;
_root.gameSeq.MakeEffect3d(0, 0, 0, TRAP_ACTNO_WATER01, 0);
player_JetStartWaitInit(myShip);
return(myShip);
}
function player_exec() {
this.user_flag = this.user_flag & (~SBD_SHIP_FLAG_REJUMP);
player_ShipTimer(this);
if (_root.gameSeq.m_gameflags & SBD_MAIN_GAMEOVER) {
this.user_flag = this.user_flag | SBD_SHIP_NO_TOUCH_MOVE;
}
player_TouchGet(this);
if (_root.gameSeq.m_gameflags & SBD_MAIN_DEMO) {
if ((_root.gameSeq.m_gameflags & SBD_MAIN_GAMEOVER) && (!(this.user_flag & SBD_SHIP_LAND_ARRIVE))) {
player_JetBoostExit(this);
this.spd = ObjSpdDownSet(this.spd, PLAYER_JETSKI_ATK_SPDDO);
}
} else {
player_JetTouchSet(this);
}
if (this.hitstop_timer) {
this.hitstop_timer--;
}
if (!this.hitstop_timer) {
switch (this.mainState) {
case PLAYER_MS_JET_FW :
player_JetFwMain(this);
break;
case PLAYER_MS_JET_JUMP :
player_JetJumpMain(this);
break;
case PLAYER_MS_JET_DAMAGE :
player_JetDamageMain(this);
break;
case PLAYER_MS_JET_DIE :
player_JetDieMain(this);
break;
case PLAYER_MS_JET_GOAL :
player_JetGoalMain(this);
break;
case PLAYER_MS_JET_STARTWAIT :
player_JetStartWaitMain(this);
break;
default :
player_ShipMove(this);
}
}
if (!this.hitstop_timer) {
if (!(this.move_flag & OBD_MOVE_UNDER)) {
if (this.move_flag & OBD_MOVE_FALL) {
this.velocity.y = this.velocity.y - this.spd_fall;
}
if (this.move_flag & OBD_MOVE_FALL) {
if (this.velocity.y < (-this.spd_fall_max)) {
this.velocity.y = -this.spd_fall_max;
}
}
}
this.stageObj.pos.y = this.stageObj.pos.y + this.velocity.y;
}
if (!(this.move_flag & OBD_MOVE_JUMP)) {
this.stageObj.pos.y = 0;
}
player_JetEngineSound(this);
if (this.user_flag & SBD_SHIP_FLAG_TRICK) {
if (this.move_flag & OBD_MOVE_UNDER) {
this.user_flag = this.user_flag & (~SBD_SHIP_FLAG_TRICK);
}
}
if ((this.move_flag & OBD_MOVE_UNDER) && (Math.abs(this.spd) > (PLAYER_JETSKI_SPDBO * 0.05))) {
if ((!(_root.gameSeq.m_frameCounter & 3)) && (!Math.round(Math.random()))) {
player_ShipRandomWater(this);
player_ShipRandomWater(this);
player_ShipRandomWater(this);
player_ShipRandomWater(this);
}
}
StageSpriteMan_AddOrder(_root.stageSpriteMgr, this.stageObj, this.stage_mc);
}
function player_exit() {
this.touch_on = null;
this.touch_prev = null;
this.touch_push = null;
myShip.pos_touch = null;
myShip.pos_target = null;
this.stageObj = null;
this.stage_mc.removeMovieClip();
this.stage_mc = null;
if (this.sea_mask_mc != null) {
this.sea_mask_mc.removeMovieClip();
this.sea_mask_mc = null;
}
}
function player_TouchGet(myShip) {
var _local3 = 0;
if ((((_root.touchPen.m_pos.x >= 0) && (_root.touchPen.m_pos.x <= STAGE_SCREEN_WIDTH)) && (_root.touchPen.m_pos.y >= 0)) && (_root.touchPen.m_pos.y <= STAGE_SCREEN_HEIGHT)) {
_local3 = _local3 | PLAYER_TP_FLAG_RECT_IN;
} else {
_local3 = _local3 & (~PLAYER_TP_FLAG_RECT_IN);
}
if (!(myShip.touch_flag & PLAYER_TP_FLAG_ENABLE)) {
if (_root.touchPen.m_pressed && (_local3 & PLAYER_TP_FLAG_RECT_IN)) {
myShip.touch_flag = myShip.touch_flag | PLAYER_TP_FLAG_ENABLE;
_local3 = _local3 | PLAYER_TP_FLAG_ENABLE;
} else {
if (myShip.touch_flag & PLAYER_TP_FLAG_ON) {
_local3 = _local3 | PLAYER_TP_FLAG_PREV;
}
myShip.touch_flag = _local3;
}
}
if (myShip.touch_flag & PLAYER_TP_FLAG_ENABLE) {
if (myShip.touch_flag & PLAYER_TP_FLAG_ON) {
_local3 = _local3 | PLAYER_TP_FLAG_PREV;
}
if (_root.touchPen.m_state) {
_local3 = _local3 | PLAYER_TP_FLAG_ON;
_local3 = _local3 | PLAYER_TP_FLAG_ENABLE;
}
if (_root.touchPen.m_pressed) {
_local3 = _local3 | PLAYER_TP_FLAG_PUSH;
}
if (_root.touchPen.m_released) {
_local3 = _local3 | PLAYER_TP_FLAG_PULL;
}
myShip.touch_flag = _local3;
if (_root.gameSeq.m_gameflags & SBD_MAIN_DEMO) {
return(undefined);
}
myShip.touch_prev.x = myShip.touch_on.x;
myShip.touch_prev.y = myShip.touch_on.y;
myShip.touch_on.x = _root.touchPen.m_pos.x;
myShip.touch_on.y = _root.touchPen.m_pos.y;
if (myShip.touch_on.x < 0) {
myShip.touch_on.x = 0;
}
if (myShip.touch_on.x > STAGE_SCREEN_WIDTH) {
myShip.touch_on.x = STAGE_SCREEN_WIDTH;
}
if (myShip.touch_on.y < 0) {
myShip.touch_on.y = 0;
}
if (myShip.touch_on.y > STAGE_SCREEN_HEIGHT) {
myShip.touch_on.y = STAGE_SCREEN_HEIGHT;
}
if (!(myShip.touch_flag & PLAYER_TP_FLAG_PREV)) {
myShip.touch_prev.x = myShip.touch_on.x;
myShip.touch_prev.y = myShip.touch_on.y;
}
}
myShip.key_on = _root.touchPen.m_key_on;
myShip.key_push = _root.touchPen.m_key_push;
myShip.key_pull = _root.touchPen.m_key_pull;
}
function player_JetTouchSet(myShip) {
if ((myShip.touch_flag & PLAYER_TP_FLAG_ON) && (!player_ShipDieCheck(myShip))) {
if (myShip.touch_flag & PLAYER_TP_FLAG_PUSH) {
_root.stageSoundMgr.StopSE(SOUND_SE_BRAKE);
}
myShip.pos_touch.x = myShip.touch_on.x;
myShip.pos_touch.y = myShip.touch_on.y;
if (!(myShip.move_flag & OBD_MOVE_FRONT)) {
if ((!(myShip.move_flag & OBD_MOVE_JUMP)) && (!(myShip.user_flag & SBD_SHIP_LAND_ARRIVE))) {
var _local3 = PLAYER_JETSKI_SPDMA;
var _local5 = 0;
if ((myShip.user_flag & SBD_SHIP_FLAG_BOOST) || (myShip.spdup_timer)) {
_local3 = PLAYER_JETSKI_SPDBO;
_local3 = _local3 + _local5;
if (myShip.spd > _local3) {
myShip.spd = ObjSpdDownSet(myShip.spd, PLAYER_JETSKI_SPDDO_OVER);
} else {
myShip.spd = ObjSpdUpSet(myShip.spd, PLAYER_SHIP_SPD_TYOUSEI2, _local3);
}
} else {
var _local4;
_local3 = _local3 + _local5;
if (myShip.spd < (PLAYER_JETSKI_SPDMA * 0.25)) {
_local4 = PLAYER_SHIP_SPDAD_G1;
} else if (myShip.spd < (PLAYER_JETSKI_SPDMA * 0.5)) {
_local4 = PLAYER_SHIP_SPDAD_G2;
} else if (myShip.spd < (PLAYER_JETSKI_SPDMA * 0.75)) {
_local4 = PLAYER_SHIP_SPDAD_G3;
} else if (myShip.spd < (PLAYER_JETSKI_SPDMA * 0.875)) {
_local4 = PLAYER_SHIP_SPDAD_G4;
} else {
_local4 = PLAYER_SHIP_SPDAD_G5;
}
if (myShip.spd > _local3) {
myShip.spd = ObjSpdDownSet(myShip.spd, PLAYER_JETSKI_SPDDO_OVER - _local4);
if (myShip.spd < _local3) {
myShip.spd = _local3;
}
} else {
myShip.spd = ObjSpdUpSet(myShip.spd, _local4, _local3);
}
if (myShip.touch_flag & PLAYER_TP_FLAG_PUSH) {
_root.stageSoundMgr.StopSE(SOUND_SE_ACCEL);
_root.stageSoundMgr.PlaySE(SOUND_SE_ACCEL);
}
}
}
}
} else if (myShip.spd > 0) {
if ((!(myShip.move_flag & OBD_MOVE_JUMP)) && (!(myShip.user_flag & SBD_SHIP_LAND_ARRIVE))) {
if (myShip.touch_flag & PLAYER_TP_FLAG_PULL) {
_root.stageSoundMgr.StopSE(SOUND_SE_BRAKE);
_root.stageSoundMgr.PlaySE(SOUND_SE_BRAKE);
}
if (!(myShip.user_flag & SBD_SHIP_FLAG_BOOST)) {
myShip.spd = ObjSpdDownSet(myShip.spd, PLAYER_JETSKI_SPDDO);
}
}
}
if (myShip.spd <= 0) {
var _local6 = _root.gameSeq.m_map.pos_line_prev;
var _local7 = _root.gameSeq.m_map.pos_line;
if (_local6 > _local7) {
myShip.spd = 0;
_root.stageSoundMgr.PlaySE(SOUND_SE_COLLISION);
}
player_JetBoostExit(pObj);
}
myShip.pos_target = player_computePosTarget(myShip.pos_touch.x, PLAYER_TOUCH_POS_Y, PLAYER_JETSKI_POS);
if (myShip.user_flag & SBD_SHIP_LAND_ARRIVE) {
return(undefined);
}
if (!player_ShipDieCheck(myShip)) {
if (!(myShip.move_flag & OBD_MOVE_JUMP)) {
if (myShip.touch_flag & PLAYER_TP_FLAG_PUSH) {
if (myShip.d_time > PLAYER_SHIP_DOUBLE_TIME) {
myShip.d_time = 0;
}
}
if (myShip.d_time) {
if ((myShip.touch_flag & PLAYER_TP_FLAG_PUSH) && (myShip.d_time < PLAYER_SHIP_DOUBLE_TIME)) {
player_JetBoostInit(myShip);
}
}
if (myShip.key_push & (PAD_BUTTON_R | PAD_BUTTON_L)) {
player_JetBoostInit(myShip);
}
myShip.d_time++;
}
if ((!(myShip.touch_flag & PLAYER_TP_FLAG_ON)) && (!(pShip.key_on & (PAD_BUTTON_R | PAD_BUTTON_L)))) {
player_JetBoostExit(myShip);
}
if (myShip.key_pull & (PAD_BUTTON_R | PAD_BUTTON_L)) {
player_JetBoostExit(myShip);
}
}
}
function player_computePosTarget(sx, sy, length) {
var _local3 = seqGame_ComputeWorldRayFromScreenPos(sx, sy);
var _local2 = vec3d_MultAdd(length + 1, _local3, _root.sceneView.pos);
return(_local2);
}
function player_ShipMove(myShip) {
if (myShip.user_flag & SBD_SHIP_NO_TOUCH_MOVE) {
return(undefined);
}
var _local2;
var _local3;
var _local4;
_local2 = PLAYER_SIDE_MOVE_DIVSTEP;
_local3 = PLAYER_SIDE_MOVE_MAX;
_local4 = PLAYER_SIDE_MOVE_MIN;
if (myShip.nomove_timer) {
_local2 = PLAYER_SIDE_MOVE_NOMOVE_DIVSTEP;
_local3 = PLAYER_SIDE_MOVE_NOMOVE_MAX;
_local4 = PLAYER_SIDE_MOVE_NOMOVE_MIN;
} else if (myShip.slow_move_timer) {
_local2 = PLAYER_SIDE_MOVE_SLOW_DIVSTEP;
_local3 = _local3 - (myShip.slow_move_timer * PLAYER_SIDE_MOVE_SLOW_MAX);
_local4 = PLAYER_SIDE_MOVE_SLOW_MIN;
} else if (myShip.spdup_slow_timer || (myShip.user_flag & SBD_SHIP_FLAG_BOOST)) {
_local2 = PLAYER_SIDE_MOVE_BOOST_DIVSTEP;
_local3 = PLAYER_SIDE_MOVE_BOOST_MAX;
_local4 = PLAYER_SIDE_MOVE_BOOST_MIN;
}
myShip.stageObj.pos.x = ObjShiftSet(myShip.stageObj.pos.x, myShip.pos_target.x, _local2, _local3, _local4);
myShip.stageObj.pos.z = ObjShiftSet(myShip.stageObj.pos.z, myShip.pos_target.z, _local2, _local3, _local4);
}
function player_ShipTimer(myShip) {
if (myShip.combo_ring > SBD_JETSKI_COMBO_COUNT) {
if (myShip.combo_timer) {
myShip.combo_timer--;
} else {
myShip.combo_hit = 0;
}
}
if (myShip.boost_start_time) {
myShip.boost_start_time--;
}
if (myShip.boost_combo_time) {
myShip.boost_combo_time--;
if (!myShip.boost_combo_time) {
if (myShip.user_flag & SBD_SHIP_FLAG_BOOST_COMBO_USE) {
player_ShipTensionSet(myShip, SBD_SHIP_BOOST_USE6);
myShip.user_flag = myShip.user_flag & (~SBD_SHIP_FLAG_BOOST_COMBO_USE);
_root.stageSoundMgr.PlaySE(SOUND_SE_NO_ENERGY);
}
}
}
if (myShip.boost_ignore_time) {
myShip.boost_ignore_time--;
}
if (myShip.spdup_timer) {
myShip.spdup_timer--;
if (!myShip.spdup_timer) {
myShip.user_flag = myShip.user_flag & (~SBD_SHIP_FLAG_SPDUP);
}
}
if (myShip.spdup_slow_timer) {
myShip.spdup_slow_timer--;
}
if (myShip.slow_move_timer) {
myShip.slow_move_timer--;
}
if (myShip.nomove_timer) {
myShip.nomove_timer--;
if (!myShip.nomove_timer) {
myShip.slow_move_timer = SBD_JETSKI_DAMAGE_SLOW_TIME;
}
}
if (myShip.user_flag & SBD_SHIP_FLAG_BOOST) {
if (!(myShip.move_flag & OBD_MOVE_JUMP)) {
player_ShipTensionSet(myShip, SBD_SHIP_BOOST_USE3);
} else {
player_ShipTensionSet(myShip, SBD_SHIP_BOOST_USE4);
}
if (!myShip.tension) {
player_JetBoostExit(myShip);
}
}
if (myShip.time_invisible) {
myShip.time_invisible--;
if (!myShip.time_invisible) {
}
}
}
function player_JetFwInit(myShip) {
if (!(myShip.user_flag & SBD_SHIP_FLAG_GUARD)) {
if (((myShip.touch_flag & PLAYER_TP_FLAG_ON) || (myShip.user_flag & SBD_SHIP_FLAG_BOOST)) || (!myShip.spd)) {
player_ShipActionChange(myShip, SBE_JET_FW);
} else {
player_ShipActionChange(myShip, SBE_JET_BRAKE2);
}
}
myShip.mainState = PLAYER_MS_JET_FW;
}
function player_JetFwMain(myShip) {
switch (myShip.state) {
case SBE_JET_FW :
if (((!((myShip.touch_flag & PLAYER_TP_FLAG_ON) || (myShip.user_flag & SBD_SHIP_FLAG_BOOST))) && (myShip.spd)) || (myShip.move_flag & OBD_MOVE_FRONT)) {
player_ShipActionChange(myShip, SBE_JET_BRAKE1);
}
break;
case SBE_JET_BRAKE1 :
if ((((myShip.touch_flag & PLAYER_TP_FLAG_ON) || (myShip.user_flag & SBD_SHIP_FLAG_BOOST)) || (!myShip.spd)) && (!(myShip.move_flag & OBD_MOVE_FRONT))) {
player_ShipActionChange(myShip, SBE_JET_BRAKE3);
break;
}
if (myShip.stage_mc._currentframe >= SBE_JET_BRAKE1_FRAME_E) {
player_ShipActionChange(myShip, SBE_JET_BRAKE2);
}
break;
case SBE_JET_BRAKE2 :
if ((((myShip.touch_flag & PLAYER_TP_FLAG_ON) || (myShip.user_flag & SBD_SHIP_FLAG_BOOST)) || (!myShip.spd)) && (!(myShip.move_flag & OBD_MOVE_FRONT))) {
player_ShipActionChange(myShip, SBE_JET_BRAKE3);
}
break;
case SBE_JET_BRAKE3 :
if ((!((myShip.touch_flag & PLAYER_TP_FLAG_ON) || (myShip.user_flag & SBD_SHIP_FLAG_BOOST))) && (myShip.spd)) {
player_ShipActionChange(myShip, SBE_JET_BRAKE1);
} else {
if (myShip.stage_mc._currentframe < SBE_JET_BRAKE3_FRAME_E) {
break;
}
player_ShipActionChange(myShip, SBE_JET_FW);
}
}
player_ShipMove(myShip);
player_JetGroundCheck(myShip);
if (myShip.move_flag & OBD_MOVE_FRONT) {
myShip.move_flag = myShip.move_flag & (~OBD_MOVE_FRONT);
}
}
function player_JetJumpInit(myShip) {
myShip.user_flag = myShip.user_flag & (~SBD_SHIP_FLAG_DAMAGE);
player_ShipActionChange(myShip, SBE_JET_JUMP1);
myShip.trick_type = 0;
myShip.user_flag = myShip.user_flag | SBD_SHIP_FLAG_REJUMP;
myShip.move_flag = myShip.move_flag | OBD_MOVE_JUMP;
myShip.move_flag = myShip.move_flag & (~OBD_MOVE_UNDER);
myShip.velocity.y = PLAYER_JET_JUMP_SPD;
myShip.spd = PLAYER_JETSKI_JUMP_SPDBO;
player_ShipRandomWater(myShip);
player_ShipRandomWater(myShip);
player_ShipRandomWater(myShip);
player_ShipRandomWater(myShip);
myShip.user_timer = 0;
_root.stageSoundMgr.StopSE(SOUND_SE_BRAKE);
_root.stageSoundMgr.PlaySE(SOUND_SE_SKI_JUMP);
myShip.mainState = PLAYER_MS_JET_JUMP;
}
function player_JetJumpMain(myShip) {
myShip.user_timer++;
if ((myShip.user_timer & 3) && (myShip.user_timer < 10)) {
player_ShipRandomWater(myShip);
player_ShipRandomWater(myShip);
}
if (myShip.trick_type) {
var _local3 = myShip.trick_type;
if ((_local3 < 1) || (_local3 > 4)) {
_local3 = 2;
}
player_ShipActionChange(myShip, (SBE_JET_TRICK1 - 1) + _local3);
myShip.user_flag = myShip.user_flag | SBD_SHIP_FLAG_TRICK;
var _local4 = ((Math.random() > 0.5) ? (SOUND_SE_YAHOO) : (SOUND_SE_YEA));
_root.stageSoundMgr.PlaySE(_local4);
myShip.trick_type = 0;
}
switch (myShip.state) {
case SBE_JET_JUMP1 :
if (myShip.velocity.y < 0.015625) {
player_ShipActionChange(myShip, SBE_JET_JUMP2);
}
break;
case SBE_JET_JUMP2 :
if (myShip.stage_mc._currentframe >= SBE_JET_JUMP2_FRAME_E) {
player_ShipActionChange(myShip, SBE_JET_JUMP3);
}
break;
case SBE_JET_JUMP3 :
break;
case SBE_JET_TRICK1 :
case SBE_JET_TRICK2 :
case SBE_JET_TRICK3 :
case SBE_JET_TRICK4 :
}
player_ShipMove(myShip);
if (player_JetGroundCheck(myShip)) {
player_JetFwInit(myShip);
}
}
function player_JetDamageInit(myShip) {
player_ShipActionChange(myShip, SBE_JET_DAMAGE);
myShip.combo_hit = 0;
myShip.time_invisible = SBD_SHIP_INVISIBLE_TIME;
myShip.user_flag = myShip.user_flag | SBD_SHIP_FLAG_DAMAGE;
myShip.user_timer = SBD_JETSKI_DAMAGE_TIME;
myShip.spd = myShip.spd * 0.5;
if (myShip.velocity.y > 0) {
myShip.velocity.y = 0;
}
_root.stageSoundMgr.PlaySE(SOUND_SE_OWA);
_root.stageSoundMgr.PlaySE(SOUND_SE_DAMAGE);
myShip.mainState = PLAYER_MS_JET_DAMAGE;
}
function player_JetDamageMain(myShip) {
player_ShipMove(myShip);
player_JetGroundCheck(myShip);
if (!(--myShip.user_timer)) {
myShip.user_flag = myShip.user_flag & (~SBD_SHIP_FLAG_DAMAGE);
player_JetFwInit(myShip);
return(undefined);
}
}
function player_JetDieInit(myShip) {
if (_root.gameSeq.m_gameflags & SBD_MAIN_GAMEOVER) {
return(undefined);
}
player_ShipStateInit(myShip);
player_ShipActionChange(myShip, SBE_JET_DOWN);
myShip.user_flag = myShip.user_flag | SBD_SHIP_FLAG_DAMAGE;
myShip.spd = 0;
if (myShip.velocity.y > 0) {
myShip.velocity.y = 0;
}
myShip.taskflag = myShip.taskflag | GAME_TASKFLAG_NOHIT;
myShip.user_timer = 0;
_root.gameSeq.m_gameflags = _root.gameSeq.m_gameflags | SBD_MAIN_GAMEOVER;
_root.stageSoundMgr.PlaySE(SOUND_SE_OWA);
_root.stageSoundMgr.PlaySE(SOUND_SE_DAMAGE);
_root.stageSoundMgr.PlaySE(SOUND_SE_RETIRE);
myShip.mainState = PLAYER_MS_JET_DIE;
}
function player_JetDieMain(myShip) {
player_JetGroundCheck(myShip);
if (!((++myShip.user_timer) & 1)) {
player_ShipRandomSmoke(myShip);
}
}
function player_JetStartWaitInit(myShip) {
player_ShipActionChange(myShip, SBE_JET_FW);
myShip.spd = 0;
myShip.mainState = PLAYER_MS_JET_STARTWAIT;
}
function player_JetStartWaitMain(myShip) {
myShip.pos_target = player_computePosTarget(myShip.pos_touch.x, PLAYER_TOUCH_POS_Y, PLAYER_JETSKI_POS);
myShip.stageObj.pos.x = myShip.pos_target.x;
myShip.stageObj.pos.y = 0;
myShip.stageObj.pos.z = myShip.pos_target.z;
player_ShipMove(myShip);
if (!(_root.gameSeq.m_gameflags & SBD_MAIN_DEMO)) {
_root.stageSoundMgr.PlaySE(SOUND_SE_GO);
player_JetFwInit(myShip);
}
}
function player_JetGoalInit(myShip) {
if (myShip.mainState == PLAYER_MS_JET_GOAL) {
return(undefined);
}
if (_root.gameSeq.m_gameflags & SBD_MAIN_GAMEOVER) {
return(undefined);
}
player_ShipStateInit(myShip);
myShip.user_flag = myShip.user_flag | SBD_SHIP_LAND_ARRIVE;
myShip.taskflag = myShip.taskflag | GAME_TASKFLAG_NOHIT;
this.user_flag = this.user_flag & (~SBD_SHIP_FLAG_SPDUP);
if (!(this.move_flag & OBD_MOVE_JUMP)) {
if ((myShip.state != SBE_JET_BRAKE2) && (myShip.state != SBE_JET_BRAKE1)) {
player_ShipActionChange(myShip, SBE_JET_BRAKE1);
}
}
_root.stageSoundMgr.PlaySE(SOUND_SE_GOAL);
_root.stageSoundMgr.PlaySE(SOUND_SE_DRIFT);
myShip.mainState = PLAYER_MS_JET_GOAL;
}
function player_JetGoalMain(myShip) {
if (_root.gameSeq.m_map.pos_line_current >= 48) {
myShip.spd = ObjSpdDownSet(myShip.spd, PLAYER_JETSKI_SPDDO);
} else {
myShip.spd = ObjSpdUpSet(myShip.spd, PLAYER_JETSKI_SPDAD, PLAYER_JETSKI_SPDMA);
}
if (myShip.move_flag & OBD_MOVE_JUMP) {
if (player_JetGroundCheck(myShipj)) {
player_ShipActionChange(myShip, SBE_JET_BRAKE2);
}
} else {
switch (myShip.state) {
case SBE_JET_BRAKE1 :
if (myShip.stage_mc._currentframe >= SBE_JET_BRAKE1_FRAME_E) {
player_ShipActionChange(myShip, SBE_JET_BRAKE2);
}
break;
case SBE_JET_BRAKE3 :
if (myShip.stage_mc._currentframe < SBE_JET_BRAKE3_FRAME_E) {
break;
}
player_ShipActionChange(myShip, SBE_JET_FW);
}
}
if (_root.gameSeq.m_gameflags & SBD_MAIN_DEMO) {
return(undefined);
}
}
function player_JetGroundCheck(myShip) {
if (!(myShip.move_flag & OBD_MOVE_JUMP)) {
return(true);
}
if (myShip.velocity.y < 0) {
var _local3 = 0;
if (myShip.stageObj.pos.y < _local3) {
myShip.move_flag = myShip.move_flag & (~OBD_MOVE_JUMP);
myShip.move_flag = myShip.move_flag | OBD_MOVE_UNDER;
myShip.velocity.y = 0;
myShip.stageObj.pos.y = _local3;
_root.stageSoundMgr.PlaySE(SOUND_SE_LAND_WATER);
return(true);
}
}
return(false);
}
function player_JetBoostInit(myShip) {
if (myShip.tension < (-SBD_SHIP_BOOST_USE2)) {
return(undefined);
}
if (myShip.boost_ignore_time) {
return(undefined);
}
if (!(myShip.user_flag & SBD_SHIP_FLAG_BOOST)) {
myShip.boost_ignore_time = SBD_BOOST_IGNORE_TIME;
player_ShipTensionSet(myShip, SBD_SHIP_BOOST_USE5);
_root.stageSoundMgr.StopSE(SOUND_SE_BRAKE);
_root.stageSoundMgr.PlaySE(SOUND_SE_BOOST_ON);
}
if (myShip.boost_combo_time) {
if (!(myShip.user_flag & SBD_SHIP_FLAG_BOOST_COMBO_USE)) {
if (myShip.boost_combo_time < SBD_SHIP_BOOST_COMBO_RETIME) {
myShip.boost_combo_time = SBD_SHIP_BOOST_COMBO_RETIME;
}
}
myShip.user_flag = myShip.user_flag | SBD_SHIP_FLAG_BOOST_COMBO_USE;
}
if (!(myShip.user_flag & SBD_SHIP_FLAG_BOOST)) {
_root.gameSeq.MakeEffect3d(0, 0, 0, TRAP_ACTNO_BOOST_A, 0);
_root.gameSeq.MakeEffect3d(0, 0, 0, TRAP_ACTNO_BOOST_WIND, 0);
}
myShip.boost_start_time = SBD_SHIP_BOOST_CURVE_IGNORE_TIME;
myShip.spd = PLAYER_JETSKI_SPDBO;
myShip.user_flag = myShip.user_flag | SBD_SHIP_FLAG_BOOST;
}
function player_JetBoostExit(myShip) {
if (myShip.user_flag & SBD_SHIP_FLAG_BOOST) {
if (myShip.user_flag & SBD_SHIP_FLAG_SE_BOOST) {
_root.stageSoundMgr.StopSE(SOUND_SE_BOOST);
myShip.user_flag = myShip.user_flag & (~SBD_SHIP_FLAG_SE_BOOST);
}
_root.stageSoundMgr.PlaySE(SOUND_SE_BOOST_END);
myShip.user_flag = myShip.user_flag & (~SBD_SHIP_FLAG_BOOST);
if (myShip.spd > PLAYER_JETSKI_JUMP_SPDBO) {
myShip.spd = PLAYER_JETSKI_JUMP_SPDBO;
}
}
}
function Player_BodyHitCall(myShip, eneTrap) {
switch (eneTrap.actno) {
case TRAP_ACTNO_ROCK :
player_JetStoneWallMoveSet(myShip, eneTrap);
break;
case TRAP_ACTNO_JUMP :
player_JumpGimmickHitCall(myShip, eneTrap);
break;
case TRAP_ACTNO_MINE :
case TRAP_ACTNO_SHARK :
case TRAP_ACTNO_BIRD :
case TRAP_ACTNO_BOB :
player_JetDamageCall(myShip, eneTrap);
break;
case TRAP_ACTNO_RING :
player_RingHitCall(myShip, eneTrap);
break;
}
}
function player_JetStoneWallMoveSet(myShip, eneTrap) {
if (myShip.move_flag & OBD_MOVE_JUMP) {
return(undefined);
}
myShip.move_flag = myShip.move_flag | OBD_MOVE_FRONT;
var _local2 = eneTrap.pos_line.z - _root.gameSeq.m_map.pos_line;
if (_local2 < 0) {
_local2 = -_local2;
}
var _local5 = (eneTrap.body_radius + PLAYER_JETSKI_RADIUS) - 0.0625;
var _local7 = Math.abs(myShip.stageObj.pos.x - eneTrap.stageObj.pos.x);
var _local8 = eneTrap.body_radius + PLAYER_JETSKI_RADIUS;
var _local3 = _local7 / _local8;
_local3 = (_local3 / 65536) * 360;
_local3 = (_local3 * Math.PI) / 180;
_local5 = _local5 * Math.cos(_local3);
_local2 = _local2 - _local5;
if (_local2 > 0) {
_local2 = 0;
}
if (myShip.spd > _local2) {
myShip.spd = _local2;
}
}
function player_JumpGimmickHitCall(myShip, eneTrap) {
if (eneTrap.actno == TRAP_ACTNO_JUMP) {
myShip.jump_type = eneTrap.trick_type;
myShip.jump_offset = Math.floor(eneTrap.stageObj.screenPos.x - (STAGE_SCREEN_WIDTH / 2));
}
player_JetJumpInit(myShip);
eneTrap.taskflag = eneTrap.taskflag | GAME_TASKFLAG_NOHIT;
}
function player_JetDamageCall(myShip, eneTrap) {
if (myShip.time_invisible > 0) {
eneTrap.taskflag = eneTrap.taskflag | (GAME_TASKFLAG_NOHIT + GAME_TASKFLAG_COLLIDE);
return(undefined);
}
myShip.hitstop_timer = SBD_DAMAGE_HITSTOP_TIME;
eneTrap.hitstop_timer = SBD_DAMAGE_HITSTOP_TIME;
eneTrap.taskflag = eneTrap.taskflag | (GAME_TASKFLAG_NOHIT + GAME_TASKFLAG_COLLIDE);
var _local6 = (myShip.stageObj.pos.x + eneTrap.stageObj.pos.x) * 0.5;
var _local5 = (myShip.stageObj.pos.y + eneTrap.stageObj.pos.y) * 0.5;
var _local4 = (myShip.stageObj.pos.z + eneTrap.stageObj.pos.z) * 0.5;
_root.gameSeq.MakeEffect3d(_local6, _local5, _local4, TRAP_ACTNO_HIT, 0);
_local6 = myShip.stageObj.pos.x;
_local5 = myShip.stageObj.pos.y;
_local4 = myShip.stageObj.pos.z;
_root.gameSeq.MakeEffect3d(_local6, _local5, _local4, TRAP_ACTNO_SMOKE_DAMAGE, 0);
player_ShipDamageSet(myShip, eneTrap);
if (player_ShipDieCheck(myShip)) {
player_JetDieInit(myShip);
return(undefined);
}
player_JetDamageInit(myShip);
}
function player_RingHitCall(myShip, eneTrap) {
player_ShipDamageSet(myShip, eneTrap);
Player_ShipRingNumSet(myShip);
player_ShipTensionSet(myShip, SBD_JETSKI_TEN_RING);
Player_ShipComboSet(myShip);
Player_ShipScoreSet(myShip, SBD_RING_SCORE);
}
function Player_AttackHitCall(myShip, eneTrap) {
var _local1 = 0;
switch (eneTrap.actno) {
case TRAP_ACTNO_MINE :
_local1 = SBD_MINE_SCORE;
break;
case TRAP_ACTNO_SHARK :
_local1 = SBD_SHARK_SCORE;
break;
case TRAP_ACTNO_BIRD :
_local1 = SBD_BIRD_SCORE;
break;
case TRAP_ACTNO_BOB :
_local1 = SBD_BOB_SCORE;
}
switch (eneTrap.actno) {
case TRAP_ACTNO_MINE :
case TRAP_ACTNO_SHARK :
case TRAP_ACTNO_BIRD :
case TRAP_ACTNO_BOB :
myShip.hitstop_timer = SBD_ATTACK_HITSTOP_TIME;
eneTrap.hitstop_timer = SBD_ATTACK_HITSTOP_TIME;
Player_ShipScoreSet(myShip, _local1);
Player_EnemyKillNumSet(myShip);
break;
}
}
function player_ShipDamageSet(myShip, eneTrap) {
if (myShip.vit <= 0) {
return(undefined);
}
var _local2 = 0;
switch (eneTrap.actno) {
case TRAP_ACTNO_RING :
_local2 = -SBD_JETSKI_VIT_RING;
break;
default :
_local2 = SBD_DAMAGE_DEFAULT;
}
myShip.vit = myShip.vit - _local2;
if (myShip.vit < 0) {
myShip.vit = 0;
}
if (myShip.vit > SBD_JETSKI_VIT_MAX) {
myShip.vit = SBD_JETSKI_VIT_MAX;
}
}
function player_ShipTensionSet(myShip, tension) {
if (myShip.boost_combo_time) {
if (tension < 0) {
return(undefined);
}
}
var _local3 = myShip.tension;
myShip.tension = myShip.tension + tension;
if (myShip.tension < 0) {
myShip.tension = 0;
}
if (myShip.tension >= SBD_JETSKI_TEN_MAX) {
myShip.tension = SBD_JETSKI_TEN_MAX;
if (myShip.boost_combo_time) {
if (tension > SBD_JETSKI_TEN_RING) {
myShip.boost_combo_time = myShip.boost_combo_time + (tension * 2);
} else if (tension > 0) {
myShip.boost_combo_time = myShip.boost_combo_time + tension;
}
} else if ((!(myShip.user_flag & SBD_SHIP_FLAG_BOOST)) && ((_local3 < myShip.tension) || ((_local3 <= myShip.tension) && (tension >= 10)))) {
myShip.boost_combo_time = SBD_SHIP_BOOST_COMBO_TIME;
}
}
if (myShip.boost_combo_time > SBD_SHIP_BOOST_COMBO_LIMIT_TIME) {
myShip.boost_combo_time = SBD_SHIP_BOOST_COMBO_LIMIT_TIME;
}
}
function player_ShipDieCheck(myShip) {
if (myShip.vit <= 0) {
return(true);
}
return(false);
}
function player_ShipStateInit(myShip) {
myShip.user_flag = myShip.user_flag & (~SBD_SHIP_FLAG_DAMAGE);
myShip.boost_combo_time = 0;
myShip.user_flag = myShip.user_flag & (~SBD_SHIP_FLAG_BOOST_COMBO_USE);
player_JetBoostExit(myShip);
}
function player_ShipActionChange(myShip, actId) {
if (actId >= SBE_JET_MAX) {
return(undefined);
}
if (myShip.state != actId) {
var _local3 = ["run1", "jump1", "jump2", "jump3", "jump4", "run1", "damage", "miss", "brake1", "brake2", "brake3", "trick_tate", "trick_tate", "trick_yoko", "trick_yoko", "miss", "trick_yoko", "trick_yoko"];
var _local2 = _local3[actId];
myShip.stage_mc.gotoAndPlay(_local2);
myShip.state = actId;
}
}
function Player_ShipScoreSet(myShip, addScore) {
var _local2 = 1 + Math.floor(myShip.combo_hit / 50);
myShip.score = myShip.score + (_local2 * addScore);
if (myShip.score > SBD_SHIP_RECORD_SCORE_MAX) {
myShip.score = SBD_SHIP_RECORD_SCORE_MAX;
}
}
function Player_ShipComboSet(myShip) {
myShip.combo_hit++;
if (myShip.combo_hit > myShip.combo_hit_max) {
myShip.combo_hit_max = myShip.combo_hit;
}
myShip.combo_timer = SBD_JETSKI_COMBO_TIMER;
myShip.combo_ring = 0;
}
function Player_ShipRingNumSet(myShip) {
myShip.ring_num++;
if (myShip.ring_num > SBD_SHIP_RECORD_RING_MAX) {
myShip.ring_num = SBD_SHIP_RECORD_RING_MAX;
}
}
function Player_ShipScoreSetForResult(myShip) {
myShip.score = myShip.score + (myShip.ring_num * SBD_SHIP_RECORD_SCORE_RING_MUL);
myShip.score = myShip.score + (myShip.enemy_kill * SBD_SHIP_RECORD_SCORE_ENEMY_MUL);
myShip.score = myShip.score + (myShip.combo_hit_max * SBD_SHIP_RECORD_SCORE_COMBO_MUL);
if (myShip.score > SBD_SHIP_RECORD_SCORE_MAX) {
myShip.score = SBD_SHIP_RECORD_SCORE_MAX;
}
}
function player_ShipRandomWater(myShip) {
var _local4 = 0 + myShip.stageObj.pos.x;
var _local3 = 0.25 + myShip.stageObj.pos.y;
var _local2 = 1.5 + myShip.stageObj.pos.z;
_root.gameSeq.MakeEffect3d(_local4, _local3, _local2, TRAP_ACTNO_WATER02, 0);
}
function player_ShipRandomSmoke(myShip) {
var _local4 = (1024 - Math.floor(Math.random() * 2047)) / 4096;
var _local3 = (-1024 + Math.floor(Math.random() * 2047)) / 4096;
var _local2 = (-4096 + Math.floor(Math.random() * 8191)) / 4096;
_local4 = _local4 + myShip.stageObj.pos.x;
_local3 = _local3 + myShip.stageObj.pos.y;
_local2 = _local2 + myShip.stageObj.pos.z;
_root.gameSeq.MakeEffect3d(_local4, _local3, _local2, TRAP_ACTNO_SMOKE, 0);
}
function player_JetEngineSound(myShip) {
if (myShip.move_flag & OBD_MOVE_JUMP) {
return(undefined);
}
if (!(myShip.user_flag & SBD_SHIP_FLAG_BOOST)) {
if (myShip.user_flag & SBD_SHIP_FLAG_SE_BOOST) {
_root.stageSoundMgr.StopSE(SOUND_SE_BOOST);
myShip.user_flag = myShip.user_flag & (~SBD_SHIP_FLAG_SE_BOOST);
}
if (myShip.spd <= 0) {
if (myShip.user_flag & SBD_SHIP_FLAG_SE_MAX_SPEED) {
_root.stageSoundMgr.StopSE(SOUND_SE_MAX_SPEED);
myShip.user_flag = myShip.user_flag & (~SBD_SHIP_FLAG_SE_MAX_SPEED);
}
if (!(myShip.user_flag & SBD_SHIP_FLAG_SE_IDLING)) {
_root.stageSoundMgr.PlaySE(SOUND_SE_IDLING);
myShip.user_flag = myShip.user_flag | SBD_SHIP_FLAG_SE_IDLING;
}
} else {
if (myShip.user_flag & SBD_SHIP_FLAG_SE_IDLING) {
_root.stageSoundMgr.StopSE(SOUND_SE_IDLING);
myShip.user_flag = myShip.user_flag & (~SBD_SHIP_FLAG_SE_IDLING);
}
if (!(myShip.user_flag & SBD_SHIP_FLAG_SE_MAX_SPEED)) {
_root.stageSoundMgr.PlaySE(SOUND_SE_MAX_SPEED);
myShip.user_flag = myShip.user_flag | SBD_SHIP_FLAG_SE_MAX_SPEED;
}
}
} else {
if (myShip.user_flag & SBD_SHIP_FLAG_SE_IDLING) {
_root.stageSoundMgr.StopSE(SOUND_SE_IDLING);
myShip.user_flag = myShip.user_flag & (~SBD_SHIP_FLAG_SE_IDLING);
}
if (myShip.user_flag & SBD_SHIP_FLAG_SE_MAX_SPEED) {
_root.stageSoundMgr.StopSE(SOUND_SE_MAX_SPEED);
myShip.user_flag = myShip.user_flag & (~SBD_SHIP_FLAG_SE_MAX_SPEED);
}
if (!(myShip.user_flag & SBD_SHIP_FLAG_SE_BOOST)) {
_root.stageSoundMgr.PlaySE(SOUND_SE_BOOST);
myShip.user_flag = myShip.user_flag | SBD_SHIP_FLAG_SE_BOOST;
}
}
}
function Player_EnemyKillNumSet(myShip) {
myShip.enemy_kill++;
if (myShip.enemy_kill > SBD_SHIP_RECORD_ENEMY_KILL_MAX) {
myShip.enemy_kill = SBD_SHIP_RECORD_ENEMY_KILL_MAX;
}
}
function vec3d_Create(x, y, z) {
return({x:x, y:y, z:z});
}
function vec3d_Clone(v) {
return({x:v.x, y:v.y, z:v.z});
}
function vec3d_Add(a, b) {
return({x:a.x + b.x, y:a.y + b.y, z:a.z + b.z});
}
function vec3d_Subtract(a, b) {
return({x:a.x - b.x, y:a.y - b.y, z:a.z - b.z});
}
function vec3d_Scale(a, v) {
return({x:a * v.x, y:a * v.y, z:a * v.z});
}
function vec3d_DotProduct(a, b) {
return(((a.x * b.x) + (a.y * b.y)) + (a.z * b.z));
}
function vec3d_CrossProduct(a, b) {
return({x:(a.y * b.z) - (a.z * b.y), y:(a.z * b.x) - (a.x * b.z), z:(a.x * b.y) - (a.y * b.x)});
}
function vec3d_Mag(v) {
return(Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z)));
}
function vec3d_Normalize(v) {
var _local2 = Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
if (_local2 > 0) {
_local2 = 1 / _local2;
}
return({x:v.x * _local2, y:v.y * _local2, z:v.z * _local2});
}
function vec3d_MultAdd(a, v1, v2) {
return({x:v2.x + (a * v1.x), y:v2.y + (a * v1.y), z:v2.z + (a * v1.z)});
}
function vec3d_Set(v, x, y, z) {
v.x = x;
v.y = y;
v.z = z;
}
function ObjSpdUpSet(lSpd, sSpd, sMaxSpd) {
lSpd = lSpd + sSpd;
if (sMaxSpd == 0) {
return(lSpd);
}
if (sSpd >= 0) {
if (lSpd > sMaxSpd) {
lSpd = sMaxSpd;
}
} else if (lSpd < (-sMaxSpd)) {
lSpd = -sMaxSpd;
}
return(lSpd);
}
function ObjSpdDownSet(lSpd, sSpd) {
if (lSpd > 0) {
lSpd = lSpd - sSpd;
if (lSpd < 0) {
lSpd = 0;
}
} else {
lSpd = lSpd + sSpd;
if (lSpd > 0) {
lSpd = 0;
}
}
return(lSpd);
}
function ObjShiftSet(lPos, sTag, divStep, usMax, usMin) {
var _local1;
if (lPos == sTag) {
return(lPos);
}
if (usMin == 0) {
usMin = 1;
}
_local1 = (sTag - lPos) * divStep;
if (usMax > 0) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin > 0) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ObjDiffSet(lPos, sTag, sSrc, divStep, usMax, usMin) {
if (lPos == sTag) {
return(lPos);
}
if (!usMin) {
usMin = 1;
}
var _local1;
_local1 = (lPos - sSrc) * divStep;
if (sTag > sSrc) {
if (_local1 < 0) {
_local1 = 0;
}
}
if (sTag < sSrc) {
if (_local1 > 0) {
_local1 = 0;
}
}
if (usMax) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ComputeNumBCDCode(val, valMax) {
if (val >= valMax) {
if (valMax == 0) {
val = 0;
} else {
val = valMax - 1;
}
}
var _local1;
var _local6 = 0;
var _local2 = valMax;
var _local4;
if (_local2 >= 100) {
_local2 = Math.floor(_local2 / 10);
_local1 = 0;
for(;;){
if (val >= _local2) {
_local4 = Math.floor(val / _local2);
_local6 = _local6 | (_local4 << _local1);
val = val - (_local4 * _local2);
}
_local1 = _local1 + 4;
if (_local2 <= 10) {
break;
}
_local2 = Math.floor(_local2 / 10);
};
}
_local6 = _local6 | (val << _local1);
var _local5 = _local1 / 4;
if (_local5 > 7) {
_local5 = 7;
} else if (_local5 < 0) {
_local5 = 0;
}
var _local9 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local8 = 0;
var _local7;
_local1 = 0;
while (_local1 < (_local5 + 1)) {
_local7 = (_local6 >> (4 * _local1)) & 15;
_local8 = _local8 | (_local7 << _local9[(7 - _local5) + _local1]);
_local1++;
}
return(_local8);
}
function ComputeTimeBCDCode(frameVal) {
var _local7 = [1080000, 108000, 18000, 1800, 300, 30, 10, 1];
var _local6 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local1;
var _local5 = 0;
var _local3;
var _local4;
_local1 = 0;
while (_local1 < 7) {
_local3 = _local7[_local1];
if (_local1 == 6) {
frameVal = Math.floor(frameVal * 3.4140625);
}
if (frameVal >= _local3) {
_local4 = Math.floor(frameVal / _local3);
_local5 = _local5 | (_local4 << _local6[_local1]);
frameVal = frameVal - (_local4 * _local3);
}
_local1++;
}
_local5 = _local5 | (frameVal << _local6[_local1]);
return(_local5);
}
function testVector3() {
}
function makeMarker(type, time, pos_x, pos_y, flag) {
var _local1 = new Object();
_local1.type = type;
_local1.time = time;
_local1.pos_x = pos_x;
_local1.pos_y = pos_y;
_local1.flag = flag;
return(_local1);
}
function TrickMarker_Create() {
var _local1 = new Object();
_local1.taskflag = 0;
_local1.exec = trickmarker_exec;
_local1.exit = trickmarker_exit;
_local1.now_no = 0;
_local1.now_marker_no = 0;
_local1.flag = 0;
_local1.false_timer = 0;
_local1.trick = 0;
_local1.offset = 0;
_local1.markers = new Array();
_local1.debug_out = 0;
return(_local1);
}
function trickmarker_exec() {
trickmarker_StartEndCheck(this);
trickmarker_Marker(this);
trickmarker_Disp(this);
trickmarker_Cleanup(this);
}
function trickmarker_exit() {
var _local2;
_local2 = 0;
while (_local2 < this.markers.length) {
this.markers[_local2].flag = this.markers[_local2].flag & (~SBD_MARKER_ENABLE);
_local2++;
}
trickmarker_Cleanup(this);
this.markers = null;
}
function trickmarker_StartEndCheck(work) {
var _local5 = _root.gameSeq.m_player;
if (work.flag & SBD_TRICK_DAMAGE_WAIT) {
if ((_local5.move_flag & OBD_MOVE_UNDER) || (_local5.user_flag & SBD_SHIP_FLAG_REJUMP)) {
work.flag = work.flag & (~SBD_TRICK_DAMAGE_WAIT);
} else {
return(undefined);
}
}
if ((((_local5.move_flag & OBD_MOVE_JUMP) && (!(_local5.user_flag & SBD_SHIP_FLAG_DAMAGE))) && (!(work.flag & SBD_TRICK_FALSE))) && (!(_local5.user_flag & SBD_SHIP_FLAG_REJUMP))) {
if (!(work.flag & SBD_TRICK_WHILE)) {
work.flag = work.flag | SBD_TRICK_SET;
work.flag = work.flag | SBD_TRICK_WHILE;
}
if (work.flag & SBD_TRICK_SET) {
trickmarker_markerSet(work);
}
} else if (work.flag & SBD_TRICK_WHILE) {
if ((_local5.user_flag & SBD_SHIP_FLAG_DAMAGE) || (work.flag & SBD_TRICK_FALSE)) {
work.flag = work.flag | SBD_TRICK_DAMAGE_WAIT;
}
work.flag = work.flag & (~(SBD_TRICK_WHILE | SBD_TRICK_FALSE));
work.now_no = work.now_marker_no;
var _local2;
var _local4 = work.markers.length;
_local2 = 0;
while (_local2 < _local4) {
work.markers[_local2].flag = work.markers[_local2].flag & (~SBD_MARKER_ENABLE);
_local2++;
}
}
}
function trickmarker_markerSet(work) {
work.trick = 0;
work.false_timer = 0;
var _local8 = _root.gameSeq.m_player.jump_type;
work.offset = _root.gameSeq.m_player.jump_offset;
var _local10 = false;
var _local6 = 0;
var _local9 = -marker_file[_local8][0].pos_x;
var _local7 = 0;
var _local11 = 0;
var _local4 = 0;
_local4 = 0;
for(;;){
var _local2 = trickmarker_makeMarkerObj();
var _local3 = marker_file[_local8][_local4];
_local2.flag = 0;
_local2.flag = _local2.flag | SBD_MARKER_ENABLE;
_local2.flag = _local2.flag | SBD_MARKER_NODISP;
if (_local3.flag & SBD_MF_WAIT) {
_local7++;
_local2.flag = _local2.flag | SBD_MARKER_ACT_CHANGE_NOWAIT;
_local6 = 0;
}
if (_local4 == 0) {
_local2.flag = _local2.flag | SBD_MARKER_ACT_CHANGE_NOWAIT;
}
if (_local7 != 0) {
_local2.flag = _local2.flag | SBD_MARKER_WAIT1;
}
_local2.no = work.now_marker_no;
_local2.timer = _local3.time;
_local2.timer_bet = _local6;
_local6++;
_local2.pos_x = (_local3.pos_x + _local9) + (STAGE_SCREEN_WIDTH / 2);
_local2.pos_x = _local2.pos_x + work.offset;
_local2.pos_y = _local3.pos_y;
_local2.type = _local3.type;
if ((_local4 != 0) && (!(_local3.flag & (SBD_MF_TRICK_MASK | SBD_MF_WAIT)))) {
_local2.disp_type = SBD_MARKER_TYPE_BETWEEN;
if ((_local2.type > SBD_MARKER_TYPE_1_4) && (_local2.type <= SBD_MARKER_TYPE_3_4)) {
_local2.pos_y = _local2.pos_y + 5;
} else {
_local2.pos_y = _local2.pos_y - 6;
}
} else {
_local2.disp_type = _local3.type & (SBD_MARKER_TYPE_1_4 - 1);
if ((_local2.type == SBD_MARKER_TYPE_1_4) || (_local2.type == SBD_MARKER_TYPE_3_4)) {
_local2.disp_type = SBD_MARKER_TYPE_1_4;
} else if (_local2.type & SBD_MARKER_TYPE_1_4) {
_local2.disp_type = _local2.disp_type ^ (SBD_MARKER_TYPE_1_4 - 1);
_local2.disp_type = _local2.disp_type + 1;
}
}
_local2.trick_mc = trickmarker_makeMarkerMC(_local2);
_local2.trick = _local3.flag & SBD_MF_TRICK_MASK;
work.now_marker_no++;
work.markers.push(_local2);
if (_local3.flag & SBD_MF_END) {
break;
}
_local4++;
};
work.flag = work.flag & (~SBD_TRICK_SET);
}
function trickmarker_Marker(work) {
var _local4 = false;
var _local7;
var _local5 = new Array(4);
_local5[0] = new flash.geom.Point(0, 0);
_local5[1] = new flash.geom.Point(0, 0);
_local5[2] = new flash.geom.Point(0, 0);
_local5[3] = new flash.geom.Point(0, 0);
var _local10 = _root.gameSeq.m_player.touch_flag;
var _local9 = new flash.geom.Point(0, 0);
var _local8 = new flash.geom.Point(0, 0);
_local9.x = _root.gameSeq.m_player.touch_on.x;
_local9.y = _root.gameSeq.m_player.touch_on.y;
_local8.x = _root.gameSeq.m_player.touch_prev.x;
_local8.y = _root.gameSeq.m_player.touch_prev.y;
var _local11 = work.markers.length;
var _local2;
_local7 = 0;
for ( ; _local7 < _local11 ; _local7++) {
_local2 = work.markers[_local7];
if (!(_local2.flag & SBD_MARKER_ENABLE)) {
} else if (_local2.flag & SBD_MARKER_NODISP) {
if (_local2.timer) {
if (_local2.flag & SBD_MARKER_WAIT1) {
if (work.trick > 0) {
_local2.timer--;
}
} else {
_local2.timer--;
}
if (_local2.timer <= 0) {
_local2.flag = _local2.flag | SBD_MARKER_START;
_local2.flag = _local2.flag & (~SBD_MARKER_NODISP);
_local2.trick_mc.gotoAndPlay("PAT_START");
}
}
} else {
if (_local2.flag & SBD_MARKER_START) {
_local4 = false;
if (_local2.trick_mc) {
_local4 = _local2.trick_mc._currentframe >= MARKER_MC_PAT_START_END_FRAME;
} else {
_local4 = true;
}
if ((_local4 && (_local2.flag & SBD_MARKER_ACT_CHANGE_NOWAIT)) || (work.false_timer > 0)) {
if (_local2.timer_bet == 0) {
_local2.flag = _local2.flag & (~SBD_MARKER_START);
_local2.trick_mc.gotoAndPlay("PAT_NOW");
} else {
_local2.timer_bet--;
}
}
}
if (_local2.flag & SBD_MARKER_CLEAR) {
_local4 = false;
if (_local2.trick_mc != null) {
_local4 = _local2.trick_mc._currentframe >= MARKER_MC_PAT_TOUCH_END_FRAME;
} else {
_local4 = true;
}
if (_local4) {
_local2.flag = 0;
continue;
}
} else if (work.now_no != _local2.no) {
} else {
if (work.false_timer > 0) {
if (!(_local10 & PLAYER_TP_FLAG_ON)) {
work.false_timer--;
if (!work.false_timer) {
work.flag = work.flag | SBD_TRICK_FALSE;
_root.gameSeq.MakeEffect2d(_local2.pos_x, _local2.pos_y, TRAP_ACTNO_TRICK_NG, 0);
_root.stageSoundMgr.PlaySE(SOUND_SE_TRICK_FAIL);
continue;
}
} else {
work.false_timer = SBD_TRICK_FALSE_TIME;
}
}
if (!(_local10 & PLAYER_TP_FLAG_ON)) {
} else {
trickmarker_MarkerRectSet(_local2, _local5);
if (trickmarker_SegmentToTriangleCheck(_local9, _local8, _local5[0], _local5[1], _local5[2]) || (trickmarker_SegmentToTriangleCheck(_local9, _local8, _local5[1], _local5[2], _local5[3]))) {
_local2.flag = _local2.flag & (~SBD_MARKER_START);
_local2.flag = _local2.flag | SBD_MARKER_CLEAR;
_local2.trick_mc.gotoAndPlay("PAT_TOUCH");
work.now_no++;
work.false_timer = SBD_TRICK_FALSE_TIME;
if (_local2.trick) {
_root.gameSeq.m_player.trick_type = _local2.trick;
_root.gameSeq.MakeEffect2d(_local2.pos_x, _local2.pos_y, TRAP_ACTNO_TRICK_OK, 0);
work.false_timer = 0;
work.tirck++;
var _local6;
switch (_local2.trick) {
default :
_local6 = SBD_TRICK1_SCORE;
break;
case SBD_MF_T3 :
_local6 = SBD_TRICK2_SCORE;
break;
case SBD_MF_T4 :
_local6 = SBD_TRICK3_SCORE;
}
Player_ShipScoreSet(_root.gameSeq.m_player, _local6);
player_ShipTensionSet(_root.gameSeq.m_player, SBD_SHIP_BOOST_GET);
_root.stageSoundMgr.PlaySE(SOUND_SE_TRICK_SUC);
} else {
_root.stageSoundMgr.PlaySE(SOUND_SE_TRICK_SLIDE);
}
}
}
}
}
}
}
function trickmarker_MarkerRectSet(marker, rect) {
var _local8 = ((marker.type * (360 / SBD_MARKER_TYPE_MAX)) * Math.PI) / 180;
var _local3;
var _local2;
if (marker.disp_type == SBD_MARKER_TYPE_BETWEEN) {
_local3 = SBD_TRICK_BETWEEN_CENTER_OFST_X;
_local2 = SBD_TRICK_BETWEEN_CENTER_OFST_Y;
} else {
_local3 = SBD_TRICK_CENTER_OFST_X;
_local2 = SBD_TRICK_CENTER_OFST_Y;
}
var _local5 = new flash.geom.Point(marker.pos_x, marker.pos_y);
var _local1;
var _local4 = new flash.geom.Matrix();
_local4.rotate(_local8);
_local1 = new flash.geom.Point(-_local3, -_local2);
_local1 = _local4.transformPoint(_local1);
rect[0] = _local5.add(_local1);
_local1 = new flash.geom.Point(_local3, -_local2);
_local1 = _local4.transformPoint(_local1);
rect[1] = _local5.add(_local1);
_local1 = new flash.geom.Point(-_local3, _local2);
_local1 = _local4.transformPoint(_local1);
rect[2] = _local5.add(_local1);
_local1 = new flash.geom.Point(_local3, _local2);
_local1 = _local4.transformPoint(_local1);
rect[3] = _local5.add(_local1);
}
function trickmarker_SegmentToTriangleCheck(pos1, pos2, tr1, tr2, tr3) {
if (trickmarker_PointToTriangleCheck(pos1, tr1, tr2, tr3)) {
return(true);
}
if (trickmarker_SegmentToSegmentCheck(pos1, pos2, tr1, tr2)) {
return(true);
}
if (trickmarker_SegmentToSegmentCheck(pos1, pos2, tr2, tr3)) {
return(true);
}
if (trickmarker_SegmentToSegmentCheck(pos1, pos2, tr3, tr1)) {
return(true);
}
return(false);
}
function trickmarker_PointToTriangleCheck(pos, tr1, tr2, tr3) {
if (((tr1.x - tr3.x) * (tr1.y - tr2.y)) == ((tr1.x - tr2.x) * (tr1.y - tr3.y))) {
return(false);
}
if (trickmarker_LineToSegmentCheck(tr1, tr2, pos, tr3) < 0) {
return(false);
}
if (trickmarker_LineToSegmentCheck(tr1, tr3, pos, tr2) < 0) {
return(false);
}
if (trickmarker_LineToSegmentCheck(tr2, tr3, pos, tr1) < 0) {
return(false);
}
return(true);
}
function trickmarker_LineToSegmentCheck(pos11, pos12, pos21, pos22) {
return((((pos11.x - pos12.x) * (pos21.y - pos11.y)) + ((pos11.y - pos12.y) * (pos11.x - pos21.x))) * (((pos11.x - pos12.x) * (pos22.y - pos11.y)) + ((pos11.y - pos12.y) * (pos11.x - pos22.x))));
}
function trickmarker_SegmentToSegmentCheck(pos11, pos12, pos21, pos22) {
if (pos11.x >= pos12.x) {
if (((pos11.x < pos21.x) && (pos11.x < pos22.x)) || ((pos12.x > pos21.x) && (pos12.x > pos22.x))) {
return(false);
}
} else if (((pos12.x < pos21.x) && (pos12.x < pos22.x)) || ((pos11.x > pos21.x) && (pos11.x > pos22.x))) {
return(false);
}
if (pos11.y >= pos12.y) {
if (((pos11.y < pos21.y) && (pos11.y < pos22.y)) || ((pos12.y > pos21.y) && (pos12.y > pos22.y))) {
return(false);
}
} else if (((pos12.y < pos21.y) && (pos12.y < pos22.y)) || ((pos11.y > pos21.y) && (pos11.y > pos22.y))) {
return(false);
}
if (trickmarker_LineToSegmentCheck(pos11, pos12, pos21, pos22) >= 0) {
return(false);
}
if (trickmarker_LineToSegmentCheck(pos21, pos22, pos11, pos12) >= 0) {
return(false);
}
return(true);
}
function trickmarker_Disp(work) {
var _local2;
var _local3 = work.markers.length;
var _local1;
_local2 = 0;
while (_local2 < _local3) {
_local1 = work.markers[_local2];
if ((_local1.flag & SBD_MARKER_ENABLE) && (!(_local1.flag & SBD_MARKER_NODISP))) {
if (_local1.trick_mc != null) {
_local1.trick_mc._x = _local1.pos_x;
_local1.trick_mc._y = _local1.pos_y;
_local1.trick_mc._visible = true;
}
} else if (_local1.trick_mc != null) {
_local1.trick_mc._visible = false;
}
_local2++;
}
}
function trickmarker_Cleanup(work) {
var _local1 = work.markers.length;
while (_local1-- , _local1 >= 0) {
if (!(work.markers[_local1].flag & SBD_MARKER_ENABLE)) {
if (work.markers[_local1].trick_mc != null) {
work.markers[_local1].trick_mc.removeMovieClip();
work.markers[_local1].trick_mc = null;
}
work.markers.splice(_local1, 1);
}
}
}
function trickmarker_makeMarkerObj() {
var _local1 = new Object();
_local1.pos_x = 0;
_local1.pos_y = 0;
_local1.timer = 0;
_local1.timer_bet = 0;
_local1.type = 0;
_local1.flag = 0;
_local1.trick = 0;
_local1.dummy = 0;
_local1.disp_type = 0;
_local1.no = 0;
_local1.trick_mc = null;
return(_local1);
}
function trickmarker_makeMarkerMC(marker) {
var _local2 = null;
if (marker.disp_type == SBD_MARKER_TYPE_BETWEEN) {
_local2 = ScreenSpriteMan_CreateMarkerMC(_root.screenSpriteMgr, "TrickBetAnimation");
} else {
var _local4 = ["Trick00Animation", "Trick01Animation", "Trick02Animation", "Trick03Animation", "Trick04Animation"];
var _local5;
if (marker.disp_type < _local4.length) {
_local2 = ScreenSpriteMan_CreateMarkerMC(_root.screenSpriteMgr, _local4[marker.disp_type]);
} else {
_local2 = ScreenSpriteMan_CreateMarkerMC(_root.screenSpriteMgr, _local4[0]);
}
_local2._xscale = (_local2._yscale = 100);
if ((marker.type > SBD_MARKER_TYPE_1_4) && (marker.type <= SBD_MARKER_TYPE_3_4)) {
_local2._yscale = -100;
}
if (marker.type >= SBD_MARKER_TYPE_2_4) {
_local2._xscale = -100;
}
}
if (_local2 != null) {
_local2.stop();
_local2._visible = false;
}
return(_local2);
}
function vec3d_Create(x, y, z) {
return({x:x, y:y, z:z});
}
function vec3d_Clone(v) {
return({x:v.x, y:v.y, z:v.z});
}
function vec3d_Add(a, b) {
return({x:a.x + b.x, y:a.y + b.y, z:a.z + b.z});
}
function vec3d_Subtract(a, b) {
return({x:a.x - b.x, y:a.y - b.y, z:a.z - b.z});
}
function vec3d_Scale(a, v) {
return({x:a * v.x, y:a * v.y, z:a * v.z});
}
function vec3d_DotProduct(a, b) {
return(((a.x * b.x) + (a.y * b.y)) + (a.z * b.z));
}
function vec3d_CrossProduct(a, b) {
return({x:(a.y * b.z) - (a.z * b.y), y:(a.z * b.x) - (a.x * b.z), z:(a.x * b.y) - (a.y * b.x)});
}
function vec3d_Mag(v) {
return(Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z)));
}
function vec3d_Normalize(v) {
var _local2 = Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
if (_local2 > 0) {
_local2 = 1 / _local2;
}
return({x:v.x * _local2, y:v.y * _local2, z:v.z * _local2});
}
function vec3d_MultAdd(a, v1, v2) {
return({x:v2.x + (a * v1.x), y:v2.y + (a * v1.y), z:v2.z + (a * v1.z)});
}
function vec3d_Set(v, x, y, z) {
v.x = x;
v.y = y;
v.z = z;
}
function ObjSpdUpSet(lSpd, sSpd, sMaxSpd) {
lSpd = lSpd + sSpd;
if (sMaxSpd == 0) {
return(lSpd);
}
if (sSpd >= 0) {
if (lSpd > sMaxSpd) {
lSpd = sMaxSpd;
}
} else if (lSpd < (-sMaxSpd)) {
lSpd = -sMaxSpd;
}
return(lSpd);
}
function ObjSpdDownSet(lSpd, sSpd) {
if (lSpd > 0) {
lSpd = lSpd - sSpd;
if (lSpd < 0) {
lSpd = 0;
}
} else {
lSpd = lSpd + sSpd;
if (lSpd > 0) {
lSpd = 0;
}
}
return(lSpd);
}
function ObjShiftSet(lPos, sTag, divStep, usMax, usMin) {
var _local1;
if (lPos == sTag) {
return(lPos);
}
if (usMin == 0) {
usMin = 1;
}
_local1 = (sTag - lPos) * divStep;
if (usMax > 0) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin > 0) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ObjDiffSet(lPos, sTag, sSrc, divStep, usMax, usMin) {
if (lPos == sTag) {
return(lPos);
}
if (!usMin) {
usMin = 1;
}
var _local1;
_local1 = (lPos - sSrc) * divStep;
if (sTag > sSrc) {
if (_local1 < 0) {
_local1 = 0;
}
}
if (sTag < sSrc) {
if (_local1 > 0) {
_local1 = 0;
}
}
if (usMax) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ComputeNumBCDCode(val, valMax) {
if (val >= valMax) {
if (valMax == 0) {
val = 0;
} else {
val = valMax - 1;
}
}
var _local1;
var _local6 = 0;
var _local2 = valMax;
var _local4;
if (_local2 >= 100) {
_local2 = Math.floor(_local2 / 10);
_local1 = 0;
for(;;){
if (val >= _local2) {
_local4 = Math.floor(val / _local2);
_local6 = _local6 | (_local4 << _local1);
val = val - (_local4 * _local2);
}
_local1 = _local1 + 4;
if (_local2 <= 10) {
break;
}
_local2 = Math.floor(_local2 / 10);
};
}
_local6 = _local6 | (val << _local1);
var _local5 = _local1 / 4;
if (_local5 > 7) {
_local5 = 7;
} else if (_local5 < 0) {
_local5 = 0;
}
var _local9 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local8 = 0;
var _local7;
_local1 = 0;
while (_local1 < (_local5 + 1)) {
_local7 = (_local6 >> (4 * _local1)) & 15;
_local8 = _local8 | (_local7 << _local9[(7 - _local5) + _local1]);
_local1++;
}
return(_local8);
}
function ComputeTimeBCDCode(frameVal) {
var _local7 = [1080000, 108000, 18000, 1800, 300, 30, 10, 1];
var _local6 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local1;
var _local5 = 0;
var _local3;
var _local4;
_local1 = 0;
while (_local1 < 7) {
_local3 = _local7[_local1];
if (_local1 == 6) {
frameVal = Math.floor(frameVal * 3.4140625);
}
if (frameVal >= _local3) {
_local4 = Math.floor(frameVal / _local3);
_local5 = _local5 | (_local4 << _local6[_local1]);
frameVal = frameVal - (_local4 * _local3);
}
_local1++;
}
_local5 = _local5 | (frameVal << _local6[_local1]);
return(_local5);
}
function testVector3() {
}
function vec3d_Create(x, y, z) {
return({x:x, y:y, z:z});
}
function vec3d_Clone(v) {
return({x:v.x, y:v.y, z:v.z});
}
function vec3d_Add(a, b) {
return({x:a.x + b.x, y:a.y + b.y, z:a.z + b.z});
}
function vec3d_Subtract(a, b) {
return({x:a.x - b.x, y:a.y - b.y, z:a.z - b.z});
}
function vec3d_Scale(a, v) {
return({x:a * v.x, y:a * v.y, z:a * v.z});
}
function vec3d_DotProduct(a, b) {
return(((a.x * b.x) + (a.y * b.y)) + (a.z * b.z));
}
function vec3d_CrossProduct(a, b) {
return({x:(a.y * b.z) - (a.z * b.y), y:(a.z * b.x) - (a.x * b.z), z:(a.x * b.y) - (a.y * b.x)});
}
function vec3d_Mag(v) {
return(Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z)));
}
function vec3d_Normalize(v) {
var _local2 = Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
if (_local2 > 0) {
_local2 = 1 / _local2;
}
return({x:v.x * _local2, y:v.y * _local2, z:v.z * _local2});
}
function vec3d_MultAdd(a, v1, v2) {
return({x:v2.x + (a * v1.x), y:v2.y + (a * v1.y), z:v2.z + (a * v1.z)});
}
function vec3d_Set(v, x, y, z) {
v.x = x;
v.y = y;
v.z = z;
}
function ObjSpdUpSet(lSpd, sSpd, sMaxSpd) {
lSpd = lSpd + sSpd;
if (sMaxSpd == 0) {
return(lSpd);
}
if (sSpd >= 0) {
if (lSpd > sMaxSpd) {
lSpd = sMaxSpd;
}
} else if (lSpd < (-sMaxSpd)) {
lSpd = -sMaxSpd;
}
return(lSpd);
}
function ObjSpdDownSet(lSpd, sSpd) {
if (lSpd > 0) {
lSpd = lSpd - sSpd;
if (lSpd < 0) {
lSpd = 0;
}
} else {
lSpd = lSpd + sSpd;
if (lSpd > 0) {
lSpd = 0;
}
}
return(lSpd);
}
function ObjShiftSet(lPos, sTag, divStep, usMax, usMin) {
var _local1;
if (lPos == sTag) {
return(lPos);
}
if (usMin == 0) {
usMin = 1;
}
_local1 = (sTag - lPos) * divStep;
if (usMax > 0) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin > 0) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ObjDiffSet(lPos, sTag, sSrc, divStep, usMax, usMin) {
if (lPos == sTag) {
return(lPos);
}
if (!usMin) {
usMin = 1;
}
var _local1;
_local1 = (lPos - sSrc) * divStep;
if (sTag > sSrc) {
if (_local1 < 0) {
_local1 = 0;
}
}
if (sTag < sSrc) {
if (_local1 > 0) {
_local1 = 0;
}
}
if (usMax) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ComputeNumBCDCode(val, valMax) {
if (val >= valMax) {
if (valMax == 0) {
val = 0;
} else {
val = valMax - 1;
}
}
var _local1;
var _local6 = 0;
var _local2 = valMax;
var _local4;
if (_local2 >= 100) {
_local2 = Math.floor(_local2 / 10);
_local1 = 0;
for(;;){
if (val >= _local2) {
_local4 = Math.floor(val / _local2);
_local6 = _local6 | (_local4 << _local1);
val = val - (_local4 * _local2);
}
_local1 = _local1 + 4;
if (_local2 <= 10) {
break;
}
_local2 = Math.floor(_local2 / 10);
};
}
_local6 = _local6 | (val << _local1);
var _local5 = _local1 / 4;
if (_local5 > 7) {
_local5 = 7;
} else if (_local5 < 0) {
_local5 = 0;
}
var _local9 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local8 = 0;
var _local7;
_local1 = 0;
while (_local1 < (_local5 + 1)) {
_local7 = (_local6 >> (4 * _local1)) & 15;
_local8 = _local8 | (_local7 << _local9[(7 - _local5) + _local1]);
_local1++;
}
return(_local8);
}
function ComputeTimeBCDCode(frameVal) {
var _local7 = [1080000, 108000, 18000, 1800, 300, 30, 10, 1];
var _local6 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local1;
var _local5 = 0;
var _local3;
var _local4;
_local1 = 0;
while (_local1 < 7) {
_local3 = _local7[_local1];
if (_local1 == 6) {
frameVal = Math.floor(frameVal * 3.4140625);
}
if (frameVal >= _local3) {
_local4 = Math.floor(frameVal / _local3);
_local5 = _local5 | (_local4 << _local6[_local1]);
frameVal = frameVal - (_local4 * _local3);
}
_local1++;
}
_local5 = _local5 | (frameVal << _local6[_local1]);
return(_local5);
}
function testVector3() {
}
function makeTrap(lineZ, x, y, actno, acttype) {
var _local1 = new Object();
_local1.line_x = x;
_local1.line_y = y;
_local1.line_z = lineZ;
_local1.actno = actno;
_local1.acttype = acttype;
return(_local1);
}
function TrapGen_Create() {
var _local1 = new Object();
_local1.taskflag = 0;
_local1.exec = trapgen_exec;
_local1.exit = trapgen_exit;
_local1.genIdx = 0;
_local1.genflags = new Array(TrapSet_Level00_Tbl.length);
trapgen_setup(_local1);
return(_local1);
}
function trapgen_setup(myGen) {
var _local2;
_local2 = 0;
while (_local2 < myGen.genflags.length) {
myGen.genflags[_local2] = false;
_local2++;
}
var _local5 = _root.gameSeq.m_map.pos_line + TRAPGEN_BORDER_NEAR;
var _local6 = _root.gameSeq.m_map.pos_line + TRAPGEN_BORDER_FAR;
var _local3 = TrapSet_Level00_Tbl;
_local2 = 0;
while (_local2 < _local3.length) {
if (_local3[_local2].line_z >= _local5) {
break;
}
_local2++;
}
myGen.genIdx = _local2;
}
function trapgen_exec() {
var _local3;
var _local5 = _root.gameSeq.m_map.pos_line + TRAPGEN_BORDER_NEAR;
var _local7 = _root.gameSeq.m_map.pos_line + TRAPGEN_BORDER_FAR;
var _local4 = TrapSet_Level00_Tbl;
var _local6 = _local4.length;
_local3 = this.genIdx;
if (_local4[_local3].line_z >= _local5) {
while (_local3 > 0) {
if (_local4[_local3].line_z < _local5) {
_local3++;
break;
}
_local3--;
}
} else {
while (_local3 < _local6) {
if (_local4[_local3].line_z >= _local5) {
break;
}
_local3++;
}
}
if (_local3 < 0) {
_local3 = 0;
} else if (_local3 > (_local4.length - 1)) {
_local3 = _local4.length - 1;
}
this.genIdx = _local3;
while (_local3 < _local6) {
if (_local4[_local3].line_z >= _local7) {
break;
}
if (this.genflags[_local3] == false) {
_root.gameSeq.MakeTrap(_local4[_local3].line_z, _local4[_local3].line_x, _local4[_local3].line_y, _local4[_local3].actno, _local4[_local3].acttype);
this.genflags[_local3] = true;
}
_local3++;
}
}
function trapgen_exit() {
}
function vec3d_Create(x, y, z) {
return({x:x, y:y, z:z});
}
function vec3d_Clone(v) {
return({x:v.x, y:v.y, z:v.z});
}
function vec3d_Add(a, b) {
return({x:a.x + b.x, y:a.y + b.y, z:a.z + b.z});
}
function vec3d_Subtract(a, b) {
return({x:a.x - b.x, y:a.y - b.y, z:a.z - b.z});
}
function vec3d_Scale(a, v) {
return({x:a * v.x, y:a * v.y, z:a * v.z});
}
function vec3d_DotProduct(a, b) {
return(((a.x * b.x) + (a.y * b.y)) + (a.z * b.z));
}
function vec3d_CrossProduct(a, b) {
return({x:(a.y * b.z) - (a.z * b.y), y:(a.z * b.x) - (a.x * b.z), z:(a.x * b.y) - (a.y * b.x)});
}
function vec3d_Mag(v) {
return(Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z)));
}
function vec3d_Normalize(v) {
var _local2 = Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
if (_local2 > 0) {
_local2 = 1 / _local2;
}
return({x:v.x * _local2, y:v.y * _local2, z:v.z * _local2});
}
function vec3d_MultAdd(a, v1, v2) {
return({x:v2.x + (a * v1.x), y:v2.y + (a * v1.y), z:v2.z + (a * v1.z)});
}
function vec3d_Set(v, x, y, z) {
v.x = x;
v.y = y;
v.z = z;
}
function ObjSpdUpSet(lSpd, sSpd, sMaxSpd) {
lSpd = lSpd + sSpd;
if (sMaxSpd == 0) {
return(lSpd);
}
if (sSpd >= 0) {
if (lSpd > sMaxSpd) {
lSpd = sMaxSpd;
}
} else if (lSpd < (-sMaxSpd)) {
lSpd = -sMaxSpd;
}
return(lSpd);
}
function ObjSpdDownSet(lSpd, sSpd) {
if (lSpd > 0) {
lSpd = lSpd - sSpd;
if (lSpd < 0) {
lSpd = 0;
}
} else {
lSpd = lSpd + sSpd;
if (lSpd > 0) {
lSpd = 0;
}
}
return(lSpd);
}
function ObjShiftSet(lPos, sTag, divStep, usMax, usMin) {
var _local1;
if (lPos == sTag) {
return(lPos);
}
if (usMin == 0) {
usMin = 1;
}
_local1 = (sTag - lPos) * divStep;
if (usMax > 0) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin > 0) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ObjDiffSet(lPos, sTag, sSrc, divStep, usMax, usMin) {
if (lPos == sTag) {
return(lPos);
}
if (!usMin) {
usMin = 1;
}
var _local1;
_local1 = (lPos - sSrc) * divStep;
if (sTag > sSrc) {
if (_local1 < 0) {
_local1 = 0;
}
}
if (sTag < sSrc) {
if (_local1 > 0) {
_local1 = 0;
}
}
if (usMax) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ComputeNumBCDCode(val, valMax) {
if (val >= valMax) {
if (valMax == 0) {
val = 0;
} else {
val = valMax - 1;
}
}
var _local1;
var _local6 = 0;
var _local2 = valMax;
var _local4;
if (_local2 >= 100) {
_local2 = Math.floor(_local2 / 10);
_local1 = 0;
for(;;){
if (val >= _local2) {
_local4 = Math.floor(val / _local2);
_local6 = _local6 | (_local4 << _local1);
val = val - (_local4 * _local2);
}
_local1 = _local1 + 4;
if (_local2 <= 10) {
break;
}
_local2 = Math.floor(_local2 / 10);
};
}
_local6 = _local6 | (val << _local1);
var _local5 = _local1 / 4;
if (_local5 > 7) {
_local5 = 7;
} else if (_local5 < 0) {
_local5 = 0;
}
var _local9 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local8 = 0;
var _local7;
_local1 = 0;
while (_local1 < (_local5 + 1)) {
_local7 = (_local6 >> (4 * _local1)) & 15;
_local8 = _local8 | (_local7 << _local9[(7 - _local5) + _local1]);
_local1++;
}
return(_local8);
}
function ComputeTimeBCDCode(frameVal) {
var _local7 = [1080000, 108000, 18000, 1800, 300, 30, 10, 1];
var _local6 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local1;
var _local5 = 0;
var _local3;
var _local4;
_local1 = 0;
while (_local1 < 7) {
_local3 = _local7[_local1];
if (_local1 == 6) {
frameVal = Math.floor(frameVal * 3.4140625);
}
if (frameVal >= _local3) {
_local4 = Math.floor(frameVal / _local3);
_local5 = _local5 | (_local4 << _local6[_local1]);
frameVal = frameVal - (_local4 * _local3);
}
_local1++;
}
_local5 = _local5 | (frameVal << _local6[_local1]);
return(_local5);
}
function testVector3() {
}
function SeaBg_Create() {
var _local2 = new Object();
_local2.taskflag = 0;
_local2.exec = seabg_exec;
_local2.exit = seabg_exit;
_local2.sealine = 0;
_local2.move_z = 0;
_local2.params = new Array(STAGE_SCREEN_HEIGHT);
_local2.sky_mc = _root.seaScene.attachMovie("SkyAnimation", "SkyAnimation" + DEPTH_SEABG_SKY, DEPTH_SEABG_SKY);
_local2.sea_mc = _root.seaScene.createEmptyMovieClip("sea_mc" + DEPTH_SEABG_SEA, DEPTH_SEABG_SEA);
_local2.sea_mc._alpha = 37;
_local2.sea_u_mc = _root.seaScene.createEmptyMovieClip("sea_mc" + DEPTH_SEABG_SEA_U, DEPTH_SEABG_SEA_U);
_local2.sea_mc._quality = "LOW";
_local2.sea_u_mc._quality = "LOW";
_local2.gra_mc = _root.seaScene.createEmptyMovieClip("gra_mc" + DEPTH_SEABG_GRA, DEPTH_SEABG_GRA);
_local2.sea_bmp = flash.display.BitmapData.loadBitmap("sea_top_png");
_local2.sea_top_bmp = null;
_local2.sea_under_bmp = flash.display.BitmapData.loadBitmap("sea_under_png");
_local2.top_pos_x = 0;
_local2.top_pos_y = 0;
_local2.under_pos_x = 0;
_local2.under_pos_y = 0;
_local2.timer = 0;
_local2.move_z = 0;
_local2.sealine = seabg_compute_sealine();
_local2.sky_mc._y = _local2.sealine - SKY_BG_HEIGHT;
seabg_compute_ground(_local2);
seabg_draw_ground(_local2);
seabg_draw_gradation(_local2);
return(_local2);
}
function seabg_exec() {
var _local6 = seqGame_GetPlayerSpdForMap();
var _local8 = this.move_z + (-_local6);
var _local4 = _local8 - this.move_z;
var _local3;
var _local2;
_local3 = this.sealine;
while (_local3 < STAGE_SCREEN_HEIGHT) {
_local2 = this.params[_local3];
_local2.dy = _local2.dy + _local4;
_local2.ty = Math.floor(((-_local2.dy) + this.top_pos_y) * 4);
_local2.tx = Math.floor(this.top_pos_x * _local2.zm);
_local2.ty_u = Math.floor(((-_local2.dy) + this.under_pos_y) * 4);
_local2.tx_u = Math.floor(this.under_pos_x * _local2.zm);
_local3++;
}
(seabg_draw_groundOther(this));// not popped
var _local9 = (this.timer * SBD_SEA_WAVE_SPD) & 65535;
var _local7 = (_local9 * (Math.PI*2)) / 65536;
var _local5 = Math.sin(_local7);
this.top_pos_x = this.top_pos_x - (_local5 * 0.1);
this.top_pos_y = this.top_pos_y + (_local5 * 0.05);
this.under_pos_x = -this.top_pos_x;
this.under_pos_y = -this.top_pos_y;
this.timer++;
}
function seabg_exit() {
if (this.sky_mc) {
this.sky_mc.removeMovieClip();
this.sky_mc = null;
}
if (this.sea_mc) {
this.sea_mc.removeMovieClip();
this.sea_mc = null;
}
if (this.sea_u_mc) {
this.sea_u_mc.removeMovieClip();
this.sea_u_mc = null;
}
if (this.gra_mc) {
this.gra_mc.removeMovieClip();
this.gra_mc = null;
}
if (this.sea_bmp) {
this.sea_bmp.dispose();
this.sea_bmp = null;
}
if (this.sea_top_bmp) {
this.sea_top_bmp.dispose();
this.sea_top_bmp = null;
}
if (this.sea_under_bmp) {
this.sea_under_bmp.dispose();
this.sea_under_bmp = null;
}
this.params = null;
}
function seabg_compute_sealine() {
var _local6 = (STAGE_SCREEN_HEIGHT / 2) * STAGE_FOVY_COTANGENT;
var _local3 = 96;
var _local5 = _root.sceneView.up.y;
var _local4 = _root.sceneView.forward.y;
var _local2 = (_local6 / _local3) * (((_local3 * _local4) - _root.sceneView.pos.y) / _local5);
_local2 = (STAGE_SCREEN_HEIGHT / 2) - Math.floor(_local2);
return(_local2);
}
function seabg_compute_ground(mySea) {
var _local18 = STAGE_SCREEN_HEIGHT / 2;
var _local7 = 0;
var _local19 = (STAGE_SCREEN_HEIGHT / 2) * STAGE_FOVY_COTANGENT;
var _local11 = 0;
var _local14 = _root.sceneView.up.x;
var _local13 = _root.sceneView.up.y;
var _local12 = _root.sceneView.up.z;
var _local10 = (_root.sceneView.forward.x * _local19) + ((_local11 - _local18) * _local14);
var _local9 = (_root.sceneView.forward.y * _local19) + ((_local11 - _local18) * _local13);
var _local8 = (_root.sceneView.forward.z * _local19) + ((_local11 - _local18) * _local12);
var _local16 = _root.sceneView.pos.x;
var _local15 = _root.sceneView.pos.z + mySea.move_z;
var _local4;
_local4 = _local11;
while (_local4 < STAGE_SCREEN_HEIGHT) {
var _local2 = new Object();
var _local3 = _root.sceneView.pos.y / _local9;
var _local6 = _local3 * _root.sceneView.right.x;
_local2.pa = _local6;
_local2.dx = (_local16 + (_local7 * _local6)) - (_local3 * _local10);
var _local5 = _local3 * _root.sceneView.right.z;
_local2.pc = _local5;
_local2.dy = (_local15 + (_local7 * _local5)) - (_local3 * _local8);
_local2.tx = Math.floor(_local2.dx * 4);
_local2.ty = Math.floor((-_local2.dy) * 4);
_local2.zm = 1 / (_local3 * 4);
_local2.tx_u = Math.floor(_local2.dx * 4);
_local2.ty_u = Math.floor((-_local2.dy) * 4);
mySea.params[_local4] = _local2;
_local10 = _local10 + _local14;
_local9 = _local9 + _local13;
_local8 = _local8 + _local12;
_local4++;
}
}
function seabg_draw_ground(mySea) {
mySea.sea_mc.clear();
mySea.sea_u_mc.clear();
var _local2;
var _local3 = new flash.geom.Matrix();
var _local5;
var _local1;
var _local6 = mySea.params.length;
_local2 = mySea.sealine;
while (_local2 < _local6) {
_local5 = mySea.params[_local2];
_local3.a = _local5.zm;
_local3.tx = (STAGE_SCREEN_WIDTH / 2) - _local5.tx;
_local3.ty = _local2 - _local5.ty;
_local1 = mySea.sea_mc;
_local1.beginBitmapFill(mySea.sea_bmp, _local3, true, false);
_local1.moveTo(0, _local2);
_local1.lineTo(0, _local2 + 1);
_local1.lineTo(STAGE_SCREEN_WIDTH, _local2 + 1);
_local1.lineTo(STAGE_SCREEN_WIDTH, _local2);
_local1.lineTo(0, _local2);
_local1.endFill();
_local3.tx = (STAGE_SCREEN_WIDTH / 2) - _local5.tx_u;
_local3.ty = _local2 - _local5.ty_u;
_local1 = mySea.sea_u_mc;
_local1.beginBitmapFill(mySea.sea_under_bmp, _local3, true, false);
_local1.moveTo(0, _local2);
_local1.lineTo(0, _local2 + 1);
_local1.lineTo(STAGE_SCREEN_WIDTH, _local2 + 1);
_local1.lineTo(STAGE_SCREEN_WIDTH, _local2);
_local1.lineTo(0, _local2);
_local1.endFill();
_local2++;
}
}
function seabg_draw_groundOther(mySea) {
mySea.sea_mc.clear();
mySea.sea_u_mc.clear();
var _local2;
var _local3 = new flash.geom.Matrix();
var _local5;
var _local1;
var _local6 = mySea.params.length;
_local2 = mySea.sealine;
while (_local2 < _local6) {
_local5 = mySea.params[_local2];
_local3.a = _local5.zm;
_local3.tx = (STAGE_SCREEN_WIDTH / 2) - _local5.tx_u;
_local3.ty = _local2 - _local5.ty_u;
_local1 = mySea.sea_u_mc;
_local1.beginBitmapFill(mySea.sea_under_bmp, _local3, true, false);
_local1.moveTo(0, _local2);
_local1.lineTo(0, _local2 + 1);
_local1.lineTo(STAGE_SCREEN_WIDTH, _local2 + 1);
_local1.lineTo(STAGE_SCREEN_WIDTH, _local2);
_local1.lineTo(0, _local2);
_local1.endFill();
_local3.tx = (STAGE_SCREEN_WIDTH / 2) - _local5.tx;
_local3.ty = _local2 - _local5.ty;
_local1 = mySea.sea_mc;
_local1.beginBitmapFill(mySea.sea_bmp, _local3, true, false);
_local1.moveTo(0, _local2);
_local1.lineTo(0, _local2 + 1);
_local1.lineTo(STAGE_SCREEN_WIDTH, _local2 + 1);
_local1.lineTo(STAGE_SCREEN_WIDTH, _local2);
_local1.lineTo(0, _local2);
_local1.endFill();
_local2++;
}
}
function seabg_update_wave(mySea) {
var _local4 = (mySea.timer * SBD_SEA_WAVE_SPD) & 65535;
var _local3 = (_local4 * (Math.PI*2)) / 65536;
var _local2 = Math.sin(_local3);
mySea.top_pos_x = mySea.top_pos_x - (_local2 * 0.1);
mySea.top_pos_y = mySea.top_pos_y + (_local2 * 0.05);
mySea.under_pos_x = -mySea.top_pos_x;
mySea.under_pos_y = -mySea.top_pos_y;
}
function seabg_draw_gradation(mySea) {
var _local1;
var _local2 = mySea.gra_mc;
_local2.clear();
_local1 = mySea.sealine;
while (_local1 < mySea.params.length) {
var _local4;
var _local5 = Math.floor((-mySea.params[_local1].dy) / 12);
_local4 = _local5 * 14;
_local2.beginFill(16777215, _local4);
_local2.moveTo(0, _local1);
_local2.lineTo(0, _local1 + 1);
_local2.lineTo(STAGE_SCREEN_WIDTH, _local1 + 1);
_local2.lineTo(STAGE_SCREEN_WIDTH, _local1);
_local2.lineTo(0, _local1);
_local2.endFill();
_local1++;
}
}
function vec3d_Create(x, y, z) {
return({x:x, y:y, z:z});
}
function vec3d_Clone(v) {
return({x:v.x, y:v.y, z:v.z});
}
function vec3d_Add(a, b) {
return({x:a.x + b.x, y:a.y + b.y, z:a.z + b.z});
}
function vec3d_Subtract(a, b) {
return({x:a.x - b.x, y:a.y - b.y, z:a.z - b.z});
}
function vec3d_Scale(a, v) {
return({x:a * v.x, y:a * v.y, z:a * v.z});
}
function vec3d_DotProduct(a, b) {
return(((a.x * b.x) + (a.y * b.y)) + (a.z * b.z));
}
function vec3d_CrossProduct(a, b) {
return({x:(a.y * b.z) - (a.z * b.y), y:(a.z * b.x) - (a.x * b.z), z:(a.x * b.y) - (a.y * b.x)});
}
function vec3d_Mag(v) {
return(Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z)));
}
function vec3d_Normalize(v) {
var _local2 = Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
if (_local2 > 0) {
_local2 = 1 / _local2;
}
return({x:v.x * _local2, y:v.y * _local2, z:v.z * _local2});
}
function vec3d_MultAdd(a, v1, v2) {
return({x:v2.x + (a * v1.x), y:v2.y + (a * v1.y), z:v2.z + (a * v1.z)});
}
function vec3d_Set(v, x, y, z) {
v.x = x;
v.y = y;
v.z = z;
}
function ObjSpdUpSet(lSpd, sSpd, sMaxSpd) {
lSpd = lSpd + sSpd;
if (sMaxSpd == 0) {
return(lSpd);
}
if (sSpd >= 0) {
if (lSpd > sMaxSpd) {
lSpd = sMaxSpd;
}
} else if (lSpd < (-sMaxSpd)) {
lSpd = -sMaxSpd;
}
return(lSpd);
}
function ObjSpdDownSet(lSpd, sSpd) {
if (lSpd > 0) {
lSpd = lSpd - sSpd;
if (lSpd < 0) {
lSpd = 0;
}
} else {
lSpd = lSpd + sSpd;
if (lSpd > 0) {
lSpd = 0;
}
}
return(lSpd);
}
function ObjShiftSet(lPos, sTag, divStep, usMax, usMin) {
var _local1;
if (lPos == sTag) {
return(lPos);
}
if (usMin == 0) {
usMin = 1;
}
_local1 = (sTag - lPos) * divStep;
if (usMax > 0) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin > 0) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ObjDiffSet(lPos, sTag, sSrc, divStep, usMax, usMin) {
if (lPos == sTag) {
return(lPos);
}
if (!usMin) {
usMin = 1;
}
var _local1;
_local1 = (lPos - sSrc) * divStep;
if (sTag > sSrc) {
if (_local1 < 0) {
_local1 = 0;
}
}
if (sTag < sSrc) {
if (_local1 > 0) {
_local1 = 0;
}
}
if (usMax) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ComputeNumBCDCode(val, valMax) {
if (val >= valMax) {
if (valMax == 0) {
val = 0;
} else {
val = valMax - 1;
}
}
var _local1;
var _local6 = 0;
var _local2 = valMax;
var _local4;
if (_local2 >= 100) {
_local2 = Math.floor(_local2 / 10);
_local1 = 0;
for(;;){
if (val >= _local2) {
_local4 = Math.floor(val / _local2);
_local6 = _local6 | (_local4 << _local1);
val = val - (_local4 * _local2);
}
_local1 = _local1 + 4;
if (_local2 <= 10) {
break;
}
_local2 = Math.floor(_local2 / 10);
};
}
_local6 = _local6 | (val << _local1);
var _local5 = _local1 / 4;
if (_local5 > 7) {
_local5 = 7;
} else if (_local5 < 0) {
_local5 = 0;
}
var _local9 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local8 = 0;
var _local7;
_local1 = 0;
while (_local1 < (_local5 + 1)) {
_local7 = (_local6 >> (4 * _local1)) & 15;
_local8 = _local8 | (_local7 << _local9[(7 - _local5) + _local1]);
_local1++;
}
return(_local8);
}
function ComputeTimeBCDCode(frameVal) {
var _local7 = [1080000, 108000, 18000, 1800, 300, 30, 10, 1];
var _local6 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local1;
var _local5 = 0;
var _local3;
var _local4;
_local1 = 0;
while (_local1 < 7) {
_local3 = _local7[_local1];
if (_local1 == 6) {
frameVal = Math.floor(frameVal * 3.4140625);
}
if (frameVal >= _local3) {
_local4 = Math.floor(frameVal / _local3);
_local5 = _local5 | (_local4 << _local6[_local1]);
frameVal = frameVal - (_local4 * _local3);
}
_local1++;
}
_local5 = _local5 | (frameVal << _local6[_local1]);
return(_local5);
}
function testVector3() {
}
function FixBg_Create() {
var _local1 = new Object();
_local1.taskflag = 0;
_local1.exec = fixbg_exec;
_local1.exit = fixbg_exit;
_local1.flag = 0;
_local1.timer = 0;
_local1.vit_disp = 0;
_local1.tension_disp = 0;
_local1.vit = 0;
_local1.vit_prev = 0;
_local1.tension = 0;
_local1.vit_max = 0;
_local1.vit_warning = 0;
_local1.vit_danger = 0;
_local1.vit_dmg = 0;
_local1.vit_length = 0;
_local1.ten_length = 0;
_local1.dmg_wait_timer = 0;
_local1.vit_vib_timer = 0;
_local1.combo_code = 0;
_local1.combo_code_prev = 0;
_local1.combo_timer = new Array(FIXBG_COMBOTIMER_IDX_MAX);
_local1.score_code = 0;
_local1.time_code = 0;
_local1.time_mcs = new Array();
_local1.score_mcs = new Array();
_local1.combo_mcs = new Array();
_local1.boost_mcs = new Array();
_local1.vit_mcs = new Array();
_local1.offset_pos = 0;
_local1.vit_max = SBD_JETSKI_VIT_MAX;
_local1.vit_warning = _local1.vit_max / 2;
_local1.vit_danger = _local1.vit_warning / 2;
_local1.combo_code_prev = 4294967295;
_local1.flag = _local1.flag | SBD_FIX_START_FADE;
_local1.offset_pos = SBD_FIX_START_OFST_Y;
return(_local1);
}
function fixbg_exec() {
fixbg_collectInfo(this);
fixbg_updateInfo(this);
fixbg_action(this);
fixbg_drawInfo(this);
this.timer++;
}
function fixbg_exit() {
this.combo_timer = null;
var _local2;
_local2 = 0;
while (_local2 < this.time_mcs.length) {
this.time_mcs[_local2].removeMovieClip();
this.time_mcs[_local2] = null;
_local2++;
}
this.time_mcs = null;
_local2 = 0;
while (_local2 < this.score_mcs.length) {
this.score_mcs[_local2].removeMovieClip();
this.score_mcs[_local2] = null;
_local2++;
}
this.score_mcs = null;
_local2 = 0;
while (_local2 < this.combo_mcs.length) {
this.combo_mcs[_local2].removeMovieClip();
this.combo_mcs[_local2] = null;
_local2++;
}
this.combo_mcs = null;
_local2 = 0;
while (_local2 < this.boost_mcs.length) {
this.boost_mcs[_local2].removeMovieClip();
this.boost_mcs[_local2] = null;
_local2++;
}
this.boost_mcs = null;
_local2 = 0;
while (_local2 < this.vit_mcs.length) {
this.vit_mcs[_local2].removeMovieClip();
this.vit_mcs[_local2] = null;
_local2++;
}
this.vit_mcs = null;
}
function fixbg_collectInfo(myFix) {
myFix.vit_prev = myFix.vit;
myFix.vit = _root.gameSeq.m_player.vit;
myFix.tension = _root.gameSeq.m_player.tension;
if (myFix.vit_prev != myFix.vit) {
if (myFix.vit_prev > myFix.vit) {
myFix.dmg_wait_timer = SBD_FIX_DAMAGE_WAIT;
myFix.vit_vib_timer = SBD_FIX_DAMAGE_VIB;
}
}
if (!(myFix.flag & SBD_FIX_START)) {
myFix.vit_disp = myFix.vit;
myFix.vit_dmg = myFix.vit;
myFix.tension_disp = myFix.tension;
myFix.flag = myFix.flag | SBD_FIX_START;
}
fixbg_collect_time(myFix);
fixbg_collect_combo(myFix);
fixbg_collect_score(myFix);
}
function fixbg_collect_time(myFix) {
var _local3 = _root.gameSeq.m_record_timer;
var _local2 = ComputeTimeBCDCode(_local3);
myFix.time_code = _local2;
}
function fixbg_collect_score(myFix) {
var _local2 = _root.gameSeq.m_player.score;
myFix.score_code = fixbg_numCodeCompute(_local2, 100000000);
}
function fixbg_collect_combo(myFix) {
var _local2 = _root.gameSeq.m_player.combo_hit;
myFix.combo_code = fixbg_numCodeCompute(_local2, 1000);
}
function fixbg_numCodeCompute(val, valMax) {
return(ComputeNumBCDCode(val, valMax));
}
function fixbg_updateInfo(myFix) {
myFix.vit_disp = ObjShiftSet(myFix.vit_disp, myFix.vit, 0.5, 0, 0.5);
if (!myFix.dmg_wait_timer) {
if (myFix.vit_dmg > myFix.vit) {
myFix.vit_dmg = ObjShiftSet(myFix.vit_dmg, myFix.vit, 0.0625, 4, 0.5);
} else {
myFix.vit_dmg = myFix.vit_disp;
}
} else {
myFix.dmg_wait_timer--;
}
if (myFix.vit_vib_timer) {
myFix.vit_vib_timer--;
}
myFix.tension_disp = ObjShiftSet(myFix.tension_disp, myFix.tension, 0.25, 0, 0.5);
}
function fixbg_action(myFix) {
if (myFix.flag & SBD_FIX_REQ_ENTER) {
if (myFix.flag & SBD_FIX_START_FADE) {
if (myFix.timer > SBD_FIX_START_FADE_TIME) {
myFix.offset_pos = ObjShiftSet(myFix.offset_pos, 0, SBD_FIX_START_FADE_DIVSTEP, SBD_FIX_START_FADE_MAX, SBD_FIX_START_FADE_MIN);
}
if (myFix.offset_pos >= 0) {
myFix.offset_pos = 0;
myFix.flag = myFix.flag & (~SBD_FIX_START_FADE);
}
}
}
if (myFix.flag & SBD_FIX_REQ_LEAVE) {
myFix.offset_pos = ObjDiffSet(myFix.offset_pos, SBD_FIX_START_OFST_Y, 0, SBD_FIX_START_FADE_DIVSTEP, SBD_FIX_START_FADE_MAX, SBD_FIX_START_FADE_MIN);
}
var _local3 = false;
var _local4;
if (myFix.vit < myFix.vit_danger) {
myFix.flag = myFix.flag & (~SBD_FIX_WARNING);
if (!(myFix.flag & SBD_FIX_DANGER)) {
myFix.flag = myFix.flag | SBD_FIX_DANGER;
_local3 = true;
_local4 = "PAT_LV3";
}
} else if (myFix.vit < myFix.vit_warning) {
myFix.flag = myFix.flag & (~SBD_FIX_DANGER);
if (!(myFix.flag & SBD_FIX_WARNING)) {
myFix.flag = myFix.flag | SBD_FIX_WARNING;
_local3 = true;
_local4 = "PAT_LV2";
}
} else if (myFix.flag & (SBD_FIX_WARNING | SBD_FIX_DANGER)) {
myFix.flag = myFix.flag & (~SBD_FIX_DANGER);
myFix.flag = myFix.flag & (~SBD_FIX_WARNING);
_local3 = true;
_local4 = "PAT_LV1";
}
if (_local3 && (myFix.vit_mcs.length > 0)) {
myFix.vit_mcs[FIXBG_VITMCS_IDX_GAUGE].gotoAndPlay(_local4);
}
if (_root.gameSeq.m_player.user_flag & SBD_SHIP_FLAG_BOOST) {
if (!(myFix.flag & SBD_FIX_BOOST_ACTION)) {
myFix.flag = myFix.flag | SBD_FIX_BOOST_ACTION;
if (myFix.boost_mcs.length > 0) {
myFix.boost_mcs[FIXBG_BOOSTMCS_IDX_ICON].gotoAndPlay("PAT_BOOST");
}
}
} else if (myFix.flag & SBD_FIX_BOOST_ACTION) {
myFix.flag = myFix.flag & (~SBD_FIX_BOOST_ACTION);
if (myFix.boost_mcs.length > 0) {
myFix.boost_mcs[FIXBG_BOOSTMCS_IDX_ICON].gotoAndPlay("PAT_NORMAL");
}
}
if (_root.gameSeq.m_player.boost_combo_time > 0) {
if (!(myFix.flag & SBD_FIX_BOOST_COMBO_ACTION)) {
myFix.flag = myFix.flag | SBD_FIX_BOOST_COMBO_ACTION;
if (myFix.boost_mcs.length > 0) {
myFix.boost_mcs[FIXBG_BOOSTMCS_IDX_GAUGE].gotoAndPlay("PAT_BOOST");
}
}
myFix.flag = myFix.flag & (~SBD_FIX_BOOST_OK_ACTION);
} else if (myFix.tension >= (-SBD_SHIP_BOOST_USE2)) {
if (!(myFix.flag & SBD_FIX_BOOST_OK_ACTION)) {
myFix.flag = myFix.flag & (~SBD_FIX_BOOST_COMBO_ACTION);
myFix.flag = myFix.flag | SBD_FIX_BOOST_OK_ACTION;
if (myFix.boost_mcs.length > 0) {
var _local5 = myFix.boost_mcs[FIXBG_BOOSTMCS_IDX_GAUGE];
_local5.gotoAndPlay("PAT_NORMAL");
}
}
} else if (myFix.flag & (SBD_FIX_BOOST_COMBO_ACTION | SBD_FIX_BOOST_OK_ACTION)) {
myFix.flag = myFix.flag & (~(SBD_FIX_BOOST_COMBO_ACTION | SBD_FIX_BOOST_OK_ACTION));
if (myFix.boost_mcs.length > 0) {
myFix.boost_mcs[FIXBG_BOOSTMCS_IDX_GAUGE].gotoAndPlay("PAT_STOP");
}
}
}
function fixbg_drawInfo(myFix) {
fixbg_draw_time(myFix);
fixbg_draw_score(myFix);
fixbg_draw_combo(myFix);
fixbg_draw_tension(myFix);
fixbg_draw_vit(myFix);
}
function fixbg_draw_time(myFix) {
var _local10 = 7;
var _local2;
if (myFix.time_mcs.length == 0) {
_local2 = 0;
while (_local2 < _local10) {
var _local4;
_local4 = ScreenSpriteMan_CreateFixMC(_root.screenSpriteMgr, "fixTimeAnimation", FIXBG_DEPTH_BASE_TIMER + _local2);
myFix.time_mcs.push(_local4);
_local2++;
}
}
var _local8 = ((_root.gameSeq.m_gameflags & SBD_MAIN_RESULT) ? false : true);
var _local9 = myFix.time_mcs.length;
_local2 = 0;
while (_local2 < _local9) {
myFix.time_mcs[_local2]._visible = _local8;
_local2++;
}
if (!_local8) {
return(undefined);
}
var _local13 = [0, 4, 8, 12, 16, 20, 24, 28];
var _local11 = [154, 142, 122, 110, 90];
var _local7;
var _local12 = 1 + myFix.offset_pos;
var _local6;
var _local5;
_local2 = 4;
while (_local2 >= 0) {
_local7 = _local11[_local2];
_local6 = (myFix.time_code >> _local13[_local2]) & 15;
_local5 = "PAT_" + _local6.toString();
var _local4 = myFix.time_mcs[_local2];
_local4._x = _local7;
_local4._y = _local12;
_local4.gotoAndPlay(_local5);
_local2--;
}
myFix.time_mcs[5]._x = myFix.time_mcs[4]._x + 12;
myFix.time_mcs[5]._y = myFix.time_mcs[4]._y;
myFix.time_mcs[5].gotoAndPlay("PAT_SQUOT");
myFix.time_mcs[6]._x = myFix.time_mcs[2]._x + 12;
myFix.time_mcs[6]._y = myFix.time_mcs[2]._y;
myFix.time_mcs[6].gotoAndPlay("PAT_WQUOT");
}
function fixbg_draw_score(myFix) {
var _local2;
if (myFix.score_mcs.length == 0) {
_local2 = 0;
while (_local2 < 8) {
var _local3;
_local3 = ScreenSpriteMan_CreateFixMC(_root.screenSpriteMgr, "fixScoreAnimation", FIXBG_DEPTH_BASE_SCORE + _local2);
myFix.score_mcs.push(_local3);
_local2++;
}
}
var _local8 = ((_root.gameSeq.m_gameflags & SBD_MAIN_RESULT) ? false : true);
var _local9 = myFix.score_mcs.length;
_local2 = 0;
while (_local2 < _local9) {
myFix.score_mcs[_local2]._visible = _local8;
_local2++;
}
if (!_local8) {
return(undefined);
}
var _local11 = 243;
var _local10 = 4 + myFix.offset_pos;
var _local5 = false;
var _local6;
var _local7;
_local2 = 7;
while (_local2 >= 0) {
_local6 = (myFix.score_code >> (4 * _local2)) & 15;
var _local3 = myFix.score_mcs[_local2];
if (_local2 == 0) {
_local5 = true;
}
if ((!_local6) && (!_local5)) {
_local3._visible = false;
} else {
_local5 = true;
_local7 = "PAT_" + _local6.toString();
_local3._visible = true;
_local3._x = _local11 - (_local2 * 6);
_local3._y = _local10;
_local3.gotoAndPlay(_local7);
}
_local2--;
}
}
function fixbg_draw_combo(myFix) {
var _local2;
if (myFix.combo_mcs.length == 0) {
var _local12;
_local2 = 0;
while (_local2 < 3) {
_local12 = ScreenSpriteMan_CreateFixMC(_root.screenSpriteMgr, "fixComboFontAnimation", FIXBG_DEPTH_BASE_COMBO + _local2);
myFix.combo_mcs.push(_local12);
_local2++;
}
_local12 = ScreenSpriteMan_CreateFixMC(_root.screenSpriteMgr, "fixComboIconAnimation", FIXBG_DEPTH_BASE_COMBO + _local2);
myFix.combo_mcs.push(_local12);
}
var _local8 = true;
if (_root.gameSeq.m_gameflags & SBD_MAIN_RESULT) {
_local8 = false;
} else {
var _local13 = _root.gameSeq.m_player.combo_timer;
if ((_local13 > SBD_FIX_COMBO_BLINK) || (!(_local13 & 1))) {
_local8 = true;
} else {
_local8 = false;
}
}
if (!myFix.combo_code) {
myFix.combo_code_prev = myFix.combo_code;
_local8 = false;
}
var _local11 = myFix.combo_mcs.length;
_local2 = 0;
while (_local2 < _local11) {
myFix.combo_mcs[_local2]._visible = _local8;
_local2++;
}
if (!_local8) {
return(undefined);
}
if (myFix.combo_code_prev != myFix.combo_code) {
if ((!myFix.combo_code_prev) || (myFix.combo_code_prev == 4294967295)) {
myFix.combo_timer[FIXBG_COMBOTIMER_IDX_COMBO] = 4;
}
_local2 = 0;
while (_local2 < 3) {
var _local5 = 15 << (_local2 * 4);
if ((myFix.combo_code_prev & _local5) != (myFix.combo_code & _local5)) {
myFix.combo_timer[_local2] = 4 + (_local2 * 2);
}
_local2++;
}
}
var _local14 = _root.gameSeq.m_player.combo_hit;
var _local10 = (37 + myFix.offset_pos) - 12;
var _local9 = 12;
if (_local14 > 99) {
_local9 = 36;
} else if (_local14 > 9) {
_local9 = 24;
}
var _local6 = false;
_local2 = 2;
while (_local2 >= 0) {
var _local4 = (myFix.combo_code >> (4 * _local2)) & 15;
var _local7 = "PAT_" + _local4.toString();
var _local12 = myFix.combo_mcs[_local2];
if (_local2 == 0) {
_local6 = true;
}
if ((!_local4) && (!_local6)) {
_local12._visible = false;
} else {
_local6 = true;
_local12._visible = true;
_local12.gotoAndPlay(_local7);
_local12._x = _local9 - (_local2 * 12);
_local12._y = _local10 - myFix.combo_timer[_local2];
if (myFix.combo_timer[_local2]) {
myFix.combo_timer[_local2]--;
}
}
_local2--;
}
var _local12 = myFix.combo_mcs[3];
_local12._x = (_local9 + 8) + 8;
_local12._y = _local10 + (myFix.combo_timer[FIXBG_COMBOTIMER_IDX_COMBO] * 2);
_local12._visible = true;
if (myFix.combo_timer[FIXBG_COMBOTIMER_IDX_COMBO]) {
myFix.combo_timer[FIXBG_COMBOTIMER_IDX_COMBO]--;
}
myFix.combo_code_prev = myFix.combo_code;
}
function fixbg_draw_tension(myFix) {
if (myFix.boost_mcs.length == 0) {
var boost_mc;
boost_mc = ScreenSpriteMan_CreateFixMC(_root.screenSpriteMgr, "fixBoostIconAnimation", FIXBG_DEPTH_BOOST_ICON);
boost_mc._x = SBD_FIX_ENE_POS_X;
boost_mc._y = SBD_FIX_ENE_POS_Y;
myFix.boost_mcs[FIXBG_BOOSTMCS_IDX_ICON] = boost_mc;
boost_mc = ScreenSpriteMan_CreateFixMC(_root.screenSpriteMgr, "fixBoostBaseAnimation", FIXBG_DEPTH_BOOST_BASE);
boost_mc._x = SBD_FIX_T_BAR_POS_X;
boost_mc._y = SBD_FIX_T_BAR_POS_Y;
myFix.boost_mcs[FIXBG_BOOSTMCS_IDX_BASE] = boost_mc;
var mask_mc = _root.createEmptyMovieClip("theBoostMask_mc", DEPTH_SCENE_BOOST_MASK);
mask_mc._x = (SBD_FIX_T_BAR_POS_X + 2) + SCENE_LOWER_XPOS;
mask_mc._y = (SBD_FIX_T_BAR_POS_Y + 1) + SCENE_LOWER_YPOS;
with (mask_mc) {
beginFill(16711935);
moveTo(0, 0);
lineTo(72, 0);
lineTo(72, 4);
lineTo(0, 4);
lineTo(0, 0);
endFill();
}
mask_mc._xscale = 100;
myFix.boost_mcs[FIXBG_BOOSTMCS_IDX_MASK] = mask_mc;
boost_mc = ScreenSpriteMan_CreateFixMC(_root.screenSpriteMgr, "fixBoostgaugeAnimation", FIXBG_DEPTH_BOOST_GAUGE);
boost_mc._x = SBD_FIX_T_BAR_POS_X + 2;
boost_mc._y = SBD_FIX_T_BAR_POS_Y + 1;
boost_mc.gotoAndPlay("PAT_STOP");
boost_mc.setMask(mask_mc);
myFix.boost_mcs[FIXBG_BOOSTMCS_IDX_GAUGE] = boost_mc;
}
if (myFix.boost_mcs.length > 0) {
myFix.boost_mcs[FIXBG_BOOSTMCS_IDX_ICON]._y = SBD_FIX_ENE_POS_Y + myFix.offset_pos;
myFix.boost_mcs[FIXBG_BOOSTMCS_IDX_BASE]._y = SBD_FIX_T_BAR_POS_Y + myFix.offset_pos;
myFix.boost_mcs[FIXBG_BOOSTMCS_IDX_MASK]._y = ((SBD_FIX_T_BAR_POS_Y + 1) + SCENE_LOWER_YPOS) + myFix.offset_pos;
myFix.boost_mcs[FIXBG_BOOSTMCS_IDX_GAUGE]._y = (SBD_FIX_T_BAR_POS_Y + 1) + myFix.offset_pos;
}
var rate = ((myFix.tension_disp / SBD_JETSKI_TEN_MAX) * 100);
if (rate < 0) {
rate = 0;
} else if (rate > 100) {
rate = 100;
}
var mask_mc = myFix.boost_mcs[FIXBG_BOOSTMCS_IDX_MASK];
mask_mc._xscale = rate;
}
function fixbg_draw_vit(myFix) {
var vit_mc;
if (myFix.vit_mcs.length == 0) {
vit_mc = ScreenSpriteMan_CreateFixMC(_root.screenSpriteMgr, "fixLifeBaseAnimation", FIXBG_DEPTH_VIT_BASE);
vit_mc._x = SBD_FIX_WOOD_POS_X;
vit_mc._y = SBD_FIX_WOOD_POS_Y;
myFix.vit_mcs[FIXBG_VITMCS_IDX_BASE] = vit_mc;
var mask_mc = _root.createEmptyMovieClip("theVitMask_mc", DEPTH_SCENE_VIT_MASK);
mask_mc._x = SBD_FIX_V_BAR_POS_X + SCENE_LOWER_XPOS;
mask_mc._y = SBD_FIX_V_BAR_POS_Y + SCENE_LOWER_YPOS;
with (mask_mc) {
beginFill(16711935);
moveTo(0, 0);
lineTo(64, 0);
lineTo(64, 6);
lineTo(0, 6);
lineTo(0, 0);
endFill();
}
mask_mc._xscale = 100;
myFix.vit_mcs[FIXBG_VITMCS_IDX_MASK] = mask_mc;
vit_mc = ScreenSpriteMan_CreateFixMC(_root.screenSpriteMgr, "fixLifegaugeAnimation", FIXBG_DEPTH_VIT_GAUGE);
vit_mc._x = SBD_FIX_V_BAR_POS_X;
vit_mc._y = SBD_FIX_V_BAR_POS_Y;
myFix.vit_mcs[FIXBG_VITMCS_IDX_GAUGE] = vit_mc;
vit_mc.setMask(mask_mc);
}
if (myFix.vit_mcs.length > 0) {
myFix.vit_mcs[FIXBG_VITMCS_IDX_BASE]._y = SBD_FIX_WOOD_POS_Y + myFix.offset_pos;
myFix.vit_mcs[FIXBG_VITMCS_IDX_MASK]._y = (SBD_FIX_V_BAR_POS_Y + SCENE_LOWER_YPOS) + myFix.offset_pos;
myFix.vit_mcs[FIXBG_VITMCS_IDX_GAUGE]._y = SBD_FIX_V_BAR_POS_Y + myFix.offset_pos;
}
var rate = ((myFix.vit_disp / SBD_JETSKI_VIT_MAX) * 100);
if (rate < 0) {
rate = 0;
} else if (rate > 100) {
rate = 100;
}
var mask_mc = myFix.vit_mcs[FIXBG_VITMCS_IDX_MASK];
mask_mc._xscale = rate;
}
function vec3d_Create(x, y, z) {
return({x:x, y:y, z:z});
}
function vec3d_Clone(v) {
return({x:v.x, y:v.y, z:v.z});
}
function vec3d_Add(a, b) {
return({x:a.x + b.x, y:a.y + b.y, z:a.z + b.z});
}
function vec3d_Subtract(a, b) {
return({x:a.x - b.x, y:a.y - b.y, z:a.z - b.z});
}
function vec3d_Scale(a, v) {
return({x:a * v.x, y:a * v.y, z:a * v.z});
}
function vec3d_DotProduct(a, b) {
return(((a.x * b.x) + (a.y * b.y)) + (a.z * b.z));
}
function vec3d_CrossProduct(a, b) {
return({x:(a.y * b.z) - (a.z * b.y), y:(a.z * b.x) - (a.x * b.z), z:(a.x * b.y) - (a.y * b.x)});
}
function vec3d_Mag(v) {
return(Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z)));
}
function vec3d_Normalize(v) {
var _local2 = Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
if (_local2 > 0) {
_local2 = 1 / _local2;
}
return({x:v.x * _local2, y:v.y * _local2, z:v.z * _local2});
}
function vec3d_MultAdd(a, v1, v2) {
return({x:v2.x + (a * v1.x), y:v2.y + (a * v1.y), z:v2.z + (a * v1.z)});
}
function vec3d_Set(v, x, y, z) {
v.x = x;
v.y = y;
v.z = z;
}
function ObjSpdUpSet(lSpd, sSpd, sMaxSpd) {
lSpd = lSpd + sSpd;
if (sMaxSpd == 0) {
return(lSpd);
}
if (sSpd >= 0) {
if (lSpd > sMaxSpd) {
lSpd = sMaxSpd;
}
} else if (lSpd < (-sMaxSpd)) {
lSpd = -sMaxSpd;
}
return(lSpd);
}
function ObjSpdDownSet(lSpd, sSpd) {
if (lSpd > 0) {
lSpd = lSpd - sSpd;
if (lSpd < 0) {
lSpd = 0;
}
} else {
lSpd = lSpd + sSpd;
if (lSpd > 0) {
lSpd = 0;
}
}
return(lSpd);
}
function ObjShiftSet(lPos, sTag, divStep, usMax, usMin) {
var _local1;
if (lPos == sTag) {
return(lPos);
}
if (usMin == 0) {
usMin = 1;
}
_local1 = (sTag - lPos) * divStep;
if (usMax > 0) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin > 0) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ObjDiffSet(lPos, sTag, sSrc, divStep, usMax, usMin) {
if (lPos == sTag) {
return(lPos);
}
if (!usMin) {
usMin = 1;
}
var _local1;
_local1 = (lPos - sSrc) * divStep;
if (sTag > sSrc) {
if (_local1 < 0) {
_local1 = 0;
}
}
if (sTag < sSrc) {
if (_local1 > 0) {
_local1 = 0;
}
}
if (usMax) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ComputeNumBCDCode(val, valMax) {
if (val >= valMax) {
if (valMax == 0) {
val = 0;
} else {
val = valMax - 1;
}
}
var _local1;
var _local6 = 0;
var _local2 = valMax;
var _local4;
if (_local2 >= 100) {
_local2 = Math.floor(_local2 / 10);
_local1 = 0;
for(;;){
if (val >= _local2) {
_local4 = Math.floor(val / _local2);
_local6 = _local6 | (_local4 << _local1);
val = val - (_local4 * _local2);
}
_local1 = _local1 + 4;
if (_local2 <= 10) {
break;
}
_local2 = Math.floor(_local2 / 10);
};
}
_local6 = _local6 | (val << _local1);
var _local5 = _local1 / 4;
if (_local5 > 7) {
_local5 = 7;
} else if (_local5 < 0) {
_local5 = 0;
}
var _local9 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local8 = 0;
var _local7;
_local1 = 0;
while (_local1 < (_local5 + 1)) {
_local7 = (_local6 >> (4 * _local1)) & 15;
_local8 = _local8 | (_local7 << _local9[(7 - _local5) + _local1]);
_local1++;
}
return(_local8);
}
function ComputeTimeBCDCode(frameVal) {
var _local7 = [1080000, 108000, 18000, 1800, 300, 30, 10, 1];
var _local6 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local1;
var _local5 = 0;
var _local3;
var _local4;
_local1 = 0;
while (_local1 < 7) {
_local3 = _local7[_local1];
if (_local1 == 6) {
frameVal = Math.floor(frameVal * 3.4140625);
}
if (frameVal >= _local3) {
_local4 = Math.floor(frameVal / _local3);
_local5 = _local5 | (_local4 << _local6[_local1]);
frameVal = frameVal - (_local4 * _local3);
}
_local1++;
}
_local5 = _local5 | (frameVal << _local6[_local1]);
return(_local5);
}
function testVector3() {
}
function vec3d_Create(x, y, z) {
return({x:x, y:y, z:z});
}
function vec3d_Clone(v) {
return({x:v.x, y:v.y, z:v.z});
}
function vec3d_Add(a, b) {
return({x:a.x + b.x, y:a.y + b.y, z:a.z + b.z});
}
function vec3d_Subtract(a, b) {
return({x:a.x - b.x, y:a.y - b.y, z:a.z - b.z});
}
function vec3d_Scale(a, v) {
return({x:a * v.x, y:a * v.y, z:a * v.z});
}
function vec3d_DotProduct(a, b) {
return(((a.x * b.x) + (a.y * b.y)) + (a.z * b.z));
}
function vec3d_CrossProduct(a, b) {
return({x:(a.y * b.z) - (a.z * b.y), y:(a.z * b.x) - (a.x * b.z), z:(a.x * b.y) - (a.y * b.x)});
}
function vec3d_Mag(v) {
return(Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z)));
}
function vec3d_Normalize(v) {
var _local2 = Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
if (_local2 > 0) {
_local2 = 1 / _local2;
}
return({x:v.x * _local2, y:v.y * _local2, z:v.z * _local2});
}
function vec3d_MultAdd(a, v1, v2) {
return({x:v2.x + (a * v1.x), y:v2.y + (a * v1.y), z:v2.z + (a * v1.z)});
}
function vec3d_Set(v, x, y, z) {
v.x = x;
v.y = y;
v.z = z;
}
function ObjSpdUpSet(lSpd, sSpd, sMaxSpd) {
lSpd = lSpd + sSpd;
if (sMaxSpd == 0) {
return(lSpd);
}
if (sSpd >= 0) {
if (lSpd > sMaxSpd) {
lSpd = sMaxSpd;
}
} else if (lSpd < (-sMaxSpd)) {
lSpd = -sMaxSpd;
}
return(lSpd);
}
function ObjSpdDownSet(lSpd, sSpd) {
if (lSpd > 0) {
lSpd = lSpd - sSpd;
if (lSpd < 0) {
lSpd = 0;
}
} else {
lSpd = lSpd + sSpd;
if (lSpd > 0) {
lSpd = 0;
}
}
return(lSpd);
}
function ObjShiftSet(lPos, sTag, divStep, usMax, usMin) {
var _local1;
if (lPos == sTag) {
return(lPos);
}
if (usMin == 0) {
usMin = 1;
}
_local1 = (sTag - lPos) * divStep;
if (usMax > 0) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin > 0) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ObjDiffSet(lPos, sTag, sSrc, divStep, usMax, usMin) {
if (lPos == sTag) {
return(lPos);
}
if (!usMin) {
usMin = 1;
}
var _local1;
_local1 = (lPos - sSrc) * divStep;
if (sTag > sSrc) {
if (_local1 < 0) {
_local1 = 0;
}
}
if (sTag < sSrc) {
if (_local1 > 0) {
_local1 = 0;
}
}
if (usMax) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ComputeNumBCDCode(val, valMax) {
if (val >= valMax) {
if (valMax == 0) {
val = 0;
} else {
val = valMax - 1;
}
}
var _local1;
var _local6 = 0;
var _local2 = valMax;
var _local4;
if (_local2 >= 100) {
_local2 = Math.floor(_local2 / 10);
_local1 = 0;
for(;;){
if (val >= _local2) {
_local4 = Math.floor(val / _local2);
_local6 = _local6 | (_local4 << _local1);
val = val - (_local4 * _local2);
}
_local1 = _local1 + 4;
if (_local2 <= 10) {
break;
}
_local2 = Math.floor(_local2 / 10);
};
}
_local6 = _local6 | (val << _local1);
var _local5 = _local1 / 4;
if (_local5 > 7) {
_local5 = 7;
} else if (_local5 < 0) {
_local5 = 0;
}
var _local9 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local8 = 0;
var _local7;
_local1 = 0;
while (_local1 < (_local5 + 1)) {
_local7 = (_local6 >> (4 * _local1)) & 15;
_local8 = _local8 | (_local7 << _local9[(7 - _local5) + _local1]);
_local1++;
}
return(_local8);
}
function ComputeTimeBCDCode(frameVal) {
var _local7 = [1080000, 108000, 18000, 1800, 300, 30, 10, 1];
var _local6 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local1;
var _local5 = 0;
var _local3;
var _local4;
_local1 = 0;
while (_local1 < 7) {
_local3 = _local7[_local1];
if (_local1 == 6) {
frameVal = Math.floor(frameVal * 3.4140625);
}
if (frameVal >= _local3) {
_local4 = Math.floor(frameVal / _local3);
_local5 = _local5 | (_local4 << _local6[_local1]);
frameVal = frameVal - (_local4 * _local3);
}
_local1++;
}
_local5 = _local5 | (frameVal << _local6[_local1]);
return(_local5);
}
function testVector3() {
}
function ScreenSpriteMan_Init(base_mc) {
var _local1 = new Object();
_local1.base_mc = base_mc;
_local1.fixDepth = 0;
_local1.markerDepth = 0;
_local1.effectDepth = 0;
_local1.soundDepth = 0;
_local1.effectFrontDepth = 0;
return(_local1);
}
function ScreenSpriteMan_Exit(mgr) {
mgr.base_mc = null;
}
function ScreenSpriteMan_CreateFixMC(mgr, linkName, offsetDepth) {
var _local1 = SCREENSPRITE_DEPTH_FIX + offsetDepth;
if (linkName == "EMPTY_MC") {
return(mgr.base_mc.createEmptyMovieClip(("FIX_" + linkName) + _local1, _local1));
}
return(mgr.base_mc.attachMovie(linkName, linkName + _local1, _local1));
}
function ScreenSpriteMan_CreateMarkerMC(mgr, linkName) {
var _local2 = SCREENSPRITE_DEPTH_MARKER + mgr.markerDepth;
mgr.markerDepth = (mgr.markerDepth + 1) & SCREENSPRITE_DEPTH_MASK;
return(mgr.base_mc.attachMovie(linkName, linkName + _local2, _local2));
}
function ScreenSpriteMan_CreateEffectMC(mgr, linkName) {
var _local2 = SCREENSPRITE_DEPTH_EFFECT + mgr.effectDepth;
mgr.effectDepth = (mgr.effectDepth + 1) & SCREENSPRITE_DEPTH_MASK;
return(mgr.base_mc.attachMovie(linkName, linkName + _local2, _local2));
}
function ScreenSpriteMan_CreateSoundMC(mgr, linkName) {
var _local2 = SCREENSPRITE_DEPTH_SOUND + mgr.soundDepth;
mgr.soundDepth = (mgr.soundDepth + 1) & SCREENSPRITE_DEPTH_MASK;
return(mgr.base_mc.createEmptyMovieClip(linkName + _local2, _local2));
}
function ScreenSpriteMan_CreateEffectFrontMC(mgr, linkName) {
var _local2 = SCREENSPRITE_DEPTH_EFFECT_FRONT + mgr.effectFrontDepth;
mgr.effectFrontDepth = (mgr.effectFrontDepth + 1) & SCREENSPRITE_DEPTH_MASK;
return(mgr.base_mc.attachMovie(linkName, linkName + _local2, _local2));
}
function StartLogo_Create() {
var _local1 = new Object();
_local1.taskflag = 0;
_local1.exec = startlogo_exec;
_local1.exit = startlogo_exit;
_local1.timer = SBD_DM_START_TIME;
_local1.wavelogo = startlogo_wavelogo_create();
if (UPPER_BG_IS_JPN) {
_local1.wavecap = startlogo_wavecap_create();
} else {
_local1.wavecap = null;
}
_local1.readygo = startlogo_readygo_create();
return(_local1);
}
function startlogo_exec() {
if (this.wavelogo != null) {
this.wavelogo.exec();
}
if (this.wavecap != null) {
this.wavecap.exec();
}
if (this.readygo != null) {
this.readygo.exec();
}
if (this.readygo != null) {
if (this.readygo.taskflag & GAME_TASKFLAG_KILL) {
this.timer = 0;
}
}
if ((--this.timer) < 0) {
this.timer = 0;
this.taskflag = this.taskflag | GAME_TASKFLAG_KILL;
}
}
function startlogo_exit() {
if (this.wavelogo != null) {
this.wavelogo.exit();
this.wavelogo = null;
}
if (this.wavecap != null) {
this.wavecap.exit();
this.wavecap = null;
}
if (this.readygo != null) {
this.readygo.exit();
thire.readygo = null;
}
}
function startlogo_wavelogo_create() {
var _local2 = new Object();
_local2.taskflag = 0;
_local2.exec = startlogo_wavelogo_exec;
_local2.exit = startlogo_wavelogo_exit;
_local2.step = 0;
_local2.user_timer = SBD_DM_LOGO_WAIT1;
_local2.pos_x = SBD_DM_LOGO_START_POS_X;
_local2.pos_y = SBD_DM_LOGO_START_POS_Y;
_local2.wave_mc = ScreenSpriteMan_CreateEffectMC(_root.screenSpriteMgr, "startWaveAnimation");
var _local3 = _local2.wave_mc;
_local3._x = _local2.pos_x;
_local3._y = _local2.pos_y;
_local3._visible = false;
return(_local2);
}
function startlogo_wavelogo_exec() {
switch (this.step) {
case 0 :
this.user_timer = SBD_DM_LOGO_WAIT1;
this.pos_x = SBD_DM_LOGO_START_POS_X;
this.pos_y = SBD_DM_LOGO_START_POS_Y;
this.wave_mc._visible = true;
this.step++;
break;
case 1 :
if (this.user_timer) {
this.user_timer--;
} else {
this.pos_x = ObjShiftSet(this.pos_x, SBD_DM_LOGO_MAIN_POS_X, 0.25, 0, 0.25);
}
if (this.pos_x == SBD_DM_LOGO_MAIN_POS_X) {
this.user_timer = SBD_DM_LOGO_WAIT2;
this.step++;
}
break;
case 2 :
if (this.user_timer) {
this.user_timer--;
} else {
this.pos_x = ObjDiffSet(this.pos_x, SBD_DM_LOGO_END_POS_X, SBD_DM_LOGO_MAIN_POS_X, 0.5, 0, 0.25);
}
if (this.pos_x == SBD_DM_LOGO_END_POS_X) {
this.taskflag = this.taskflag | GAME_TASKFLAG_KILL;
this.step++;
}
break;
}
this.wave_mc._x = this.pos_x;
this.wave_mc._y = this.pos_y;
}
function startlogo_wavelogo_exit() {
if (this.wave_mc) {
var wave_mc = this.wave_mc;
wave_mc.removeMovieClip();
this.wave_mc = null;
}
}
function startlogo_wavecap_create() {
var _local2 = new Object();
_local2.taskflag = 0;
_local2.exec = startlogo_wavecap_exec;
_local2.exit = startlogo_wavecap_exit;
_local2.step = 0;
_local2.user_timer = SBD_DM_LOGO_CAPTION_WAIT1;
_local2.alpha = 0;
_local2.cap_mc = ScreenSpriteMan_CreateEffectMC(_root.screenSpriteMgr, "startWaveJpAnimation");
var _local3 = _local2.cap_mc;
_local3._x = SBD_DM_LOGO_CAPTION_MAIN_POS_X;
_local3._y = SBD_DM_LOGO_CAPTION_MAIN_POS_Y;
_local3._alpha = _local2.alpha;
_local3._visible = false;
return(_local2);
}
function startlogo_wavecap_exec() {
switch (this.step) {
case 0 :
this.user_timer = SBD_DM_LOGO_CAPTION_WAIT1;
this.alpha = 0;
this.cap_mc._visible = false;
this.step++;
break;
case 1 :
if (this.user_timer) {
this.user_timer--;
} else {
this.cap_mc._visible = true;
if (this.alpha < 100) {
this.alpha = this.alpha + 10;
if (this.alpha >= 100) {
this.alpha = 100;
this.user_timer = SBD_DM_LOGO_CAPTION_WAIT2;
this.step++;
}
}
}
break;
case 2 :
if (this.user_timer) {
this.user_timer--;
} else if (this.alpha > 0) {
this.alpha = this.alpha - 10;
if (this.alpha <= 0) {
this.alpha = 0;
this.taskflag = this.taskflag | GAME_TASKFLAG_KILL;
this.cap_mc._visible = false;
this.step++;
}
}
break;
}
this.cap_mc._alpha = this.alpha;
}
function startlogo_wavecap_exit() {
if (this.cap_mc) {
var cap_mc = this.cap_mc;
cap_mc.removeMovieClip();
this.cap_mc = null;
}
}
function startlogo_readygo_create() {
var _local2 = new Object();
_local2.taskflag = 0;
_local2.exec = startlogo_readygo_exec;
_local2.exit = startlogo_readygo_exit;
_local2.step = 0;
_local2.user_timer = SBD_DM_READY_WAIT1;
_local2.user_work = SBD_DM_READY_WAIT2;
_local2.pos_x = SBD_DM_READY_MAIN_POS_X;
_local2.pos_y = SBD_DM_READY_MAIN_POS_Y;
_local2.scale_x = 2;
_local2.scale_y = 0;
_local2.alpha = 100;
_local2.sprite_mc = ScreenSpriteMan_CreateEffectMC(_root.screenSpriteMgr, "startReadyGoAnimation");
var _local3 = _local2.sprite_mc;
_local3._x = _local2.pos_x;
_local3._y = _local2.pos_y;
_local3._xscale = myRead.scale_x * 100;
_local3._yscale = myRead.scale_y * 100;
_local3._alpha = _local2.alpha;
_local3._visible = false;
return(_local2);
}
function startlogo_readygo_exec() {
switch (this.step) {
case 0 :
this.user_timer = SBD_DM_READY_WAIT1;
this.user_work = SBD_DM_READY_WAIT2;
this.pos_x = SBD_DM_READY_MAIN_POS_X;
this.pos_y = SBD_DM_READY_MAIN_POS_Y;
this.scale_x = 2;
this.scale_y = 0;
this.alpha = 100;
this.sprite_mc.gotoAndPlay("PAT_READY");
this.sprite_mc._visible = false;
this.step++;
break;
case 1 :
if (this.user_timer) {
this.user_timer--;
} else {
this.sprite_mc._visible = true;
this.scale_y = ObjDiffSet(this.scale_y, 1, 0, 0.5, 0, 0.25);
this.scale_x = ObjShiftSet(this.scale_x, 1, 0.5, 0, 0.5);
}
if (this.scale_y >= 1) {
this.scale_y = 1;
if (this.user_work) {
this.user_work--;
} else {
this.alpha = this.alpha - 12.5;
if (this.alpha < 12.5) {
this.step++;
}
}
}
break;
case 2 :
this.alpha = 100;
this.scale_x = 0.875;
this.scale_y = 0.875;
this.user_timer = SBD_DM_GO_WAIT1;
this.user_work = 0;
this.sprite_mc.gotoAndPlay("PAT_GO");
this.step++;
break;
case 3 :
if (this.user_timer) {
switch (this.user_timer) {
case SBD_DM_GO_WAIT1 :
this.scale_x = (this.scale_y = 1.25);
break;
case SBD_DM_GO_WAIT1 - 1 :
this.scale_x = (this.scale_y = 1.125);
break;
case SBD_DM_GO_WAIT1 - 2 :
this.scale_x = (this.scale_y = 1);
}
this.user_timer--;
} else {
this.alpha = this.alpha - 10;
if (this.alpha <= 0) {
this.alpha = 0;
this.taskflag = this.taskflag | GAME_TASKFLAG_KILL;
this.step++;
}
}
break;
}
var sprite_mc = this.sprite_mc;
sprite_mc._x = this.pos_x;
sprite_mc._y = this.pos_y;
sprite_mc._xscale = this.scale_x * 100;
sprite_mc._yscale = this.scale_y * 100;
sprite_mc._alpha = this.alpha;
}
function startlogo_readygo_exit() {
if (this.sprite_mc) {
var sprite_mc = this.sprite_mc;
sprite_mc.removeMovieClip();
this.sprite_mc = null;
}
}
function vec3d_Create(x, y, z) {
return({x:x, y:y, z:z});
}
function vec3d_Clone(v) {
return({x:v.x, y:v.y, z:v.z});
}
function vec3d_Add(a, b) {
return({x:a.x + b.x, y:a.y + b.y, z:a.z + b.z});
}
function vec3d_Subtract(a, b) {
return({x:a.x - b.x, y:a.y - b.y, z:a.z - b.z});
}
function vec3d_Scale(a, v) {
return({x:a * v.x, y:a * v.y, z:a * v.z});
}
function vec3d_DotProduct(a, b) {
return(((a.x * b.x) + (a.y * b.y)) + (a.z * b.z));
}
function vec3d_CrossProduct(a, b) {
return({x:(a.y * b.z) - (a.z * b.y), y:(a.z * b.x) - (a.x * b.z), z:(a.x * b.y) - (a.y * b.x)});
}
function vec3d_Mag(v) {
return(Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z)));
}
function vec3d_Normalize(v) {
var _local2 = Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
if (_local2 > 0) {
_local2 = 1 / _local2;
}
return({x:v.x * _local2, y:v.y * _local2, z:v.z * _local2});
}
function vec3d_MultAdd(a, v1, v2) {
return({x:v2.x + (a * v1.x), y:v2.y + (a * v1.y), z:v2.z + (a * v1.z)});
}
function vec3d_Set(v, x, y, z) {
v.x = x;
v.y = y;
v.z = z;
}
function ObjSpdUpSet(lSpd, sSpd, sMaxSpd) {
lSpd = lSpd + sSpd;
if (sMaxSpd == 0) {
return(lSpd);
}
if (sSpd >= 0) {
if (lSpd > sMaxSpd) {
lSpd = sMaxSpd;
}
} else if (lSpd < (-sMaxSpd)) {
lSpd = -sMaxSpd;
}
return(lSpd);
}
function ObjSpdDownSet(lSpd, sSpd) {
if (lSpd > 0) {
lSpd = lSpd - sSpd;
if (lSpd < 0) {
lSpd = 0;
}
} else {
lSpd = lSpd + sSpd;
if (lSpd > 0) {
lSpd = 0;
}
}
return(lSpd);
}
function ObjShiftSet(lPos, sTag, divStep, usMax, usMin) {
var _local1;
if (lPos == sTag) {
return(lPos);
}
if (usMin == 0) {
usMin = 1;
}
_local1 = (sTag - lPos) * divStep;
if (usMax > 0) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin > 0) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ObjDiffSet(lPos, sTag, sSrc, divStep, usMax, usMin) {
if (lPos == sTag) {
return(lPos);
}
if (!usMin) {
usMin = 1;
}
var _local1;
_local1 = (lPos - sSrc) * divStep;
if (sTag > sSrc) {
if (_local1 < 0) {
_local1 = 0;
}
}
if (sTag < sSrc) {
if (_local1 > 0) {
_local1 = 0;
}
}
if (usMax) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ComputeNumBCDCode(val, valMax) {
if (val >= valMax) {
if (valMax == 0) {
val = 0;
} else {
val = valMax - 1;
}
}
var _local1;
var _local6 = 0;
var _local2 = valMax;
var _local4;
if (_local2 >= 100) {
_local2 = Math.floor(_local2 / 10);
_local1 = 0;
for(;;){
if (val >= _local2) {
_local4 = Math.floor(val / _local2);
_local6 = _local6 | (_local4 << _local1);
val = val - (_local4 * _local2);
}
_local1 = _local1 + 4;
if (_local2 <= 10) {
break;
}
_local2 = Math.floor(_local2 / 10);
};
}
_local6 = _local6 | (val << _local1);
var _local5 = _local1 / 4;
if (_local5 > 7) {
_local5 = 7;
} else if (_local5 < 0) {
_local5 = 0;
}
var _local9 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local8 = 0;
var _local7;
_local1 = 0;
while (_local1 < (_local5 + 1)) {
_local7 = (_local6 >> (4 * _local1)) & 15;
_local8 = _local8 | (_local7 << _local9[(7 - _local5) + _local1]);
_local1++;
}
return(_local8);
}
function ComputeTimeBCDCode(frameVal) {
var _local7 = [1080000, 108000, 18000, 1800, 300, 30, 10, 1];
var _local6 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local1;
var _local5 = 0;
var _local3;
var _local4;
_local1 = 0;
while (_local1 < 7) {
_local3 = _local7[_local1];
if (_local1 == 6) {
frameVal = Math.floor(frameVal * 3.4140625);
}
if (frameVal >= _local3) {
_local4 = Math.floor(frameVal / _local3);
_local5 = _local5 | (_local4 << _local6[_local1]);
frameVal = frameVal - (_local4 * _local3);
}
_local1++;
}
_local5 = _local5 | (frameVal << _local6[_local1]);
return(_local5);
}
function testVector3() {
}
function vec3d_Create(x, y, z) {
return({x:x, y:y, z:z});
}
function vec3d_Clone(v) {
return({x:v.x, y:v.y, z:v.z});
}
function vec3d_Add(a, b) {
return({x:a.x + b.x, y:a.y + b.y, z:a.z + b.z});
}
function vec3d_Subtract(a, b) {
return({x:a.x - b.x, y:a.y - b.y, z:a.z - b.z});
}
function vec3d_Scale(a, v) {
return({x:a * v.x, y:a * v.y, z:a * v.z});
}
function vec3d_DotProduct(a, b) {
return(((a.x * b.x) + (a.y * b.y)) + (a.z * b.z));
}
function vec3d_CrossProduct(a, b) {
return({x:(a.y * b.z) - (a.z * b.y), y:(a.z * b.x) - (a.x * b.z), z:(a.x * b.y) - (a.y * b.x)});
}
function vec3d_Mag(v) {
return(Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z)));
}
function vec3d_Normalize(v) {
var _local2 = Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
if (_local2 > 0) {
_local2 = 1 / _local2;
}
return({x:v.x * _local2, y:v.y * _local2, z:v.z * _local2});
}
function vec3d_MultAdd(a, v1, v2) {
return({x:v2.x + (a * v1.x), y:v2.y + (a * v1.y), z:v2.z + (a * v1.z)});
}
function vec3d_Set(v, x, y, z) {
v.x = x;
v.y = y;
v.z = z;
}
function ObjSpdUpSet(lSpd, sSpd, sMaxSpd) {
lSpd = lSpd + sSpd;
if (sMaxSpd == 0) {
return(lSpd);
}
if (sSpd >= 0) {
if (lSpd > sMaxSpd) {
lSpd = sMaxSpd;
}
} else if (lSpd < (-sMaxSpd)) {
lSpd = -sMaxSpd;
}
return(lSpd);
}
function ObjSpdDownSet(lSpd, sSpd) {
if (lSpd > 0) {
lSpd = lSpd - sSpd;
if (lSpd < 0) {
lSpd = 0;
}
} else {
lSpd = lSpd + sSpd;
if (lSpd > 0) {
lSpd = 0;
}
}
return(lSpd);
}
function ObjShiftSet(lPos, sTag, divStep, usMax, usMin) {
var _local1;
if (lPos == sTag) {
return(lPos);
}
if (usMin == 0) {
usMin = 1;
}
_local1 = (sTag - lPos) * divStep;
if (usMax > 0) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin > 0) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ObjDiffSet(lPos, sTag, sSrc, divStep, usMax, usMin) {
if (lPos == sTag) {
return(lPos);
}
if (!usMin) {
usMin = 1;
}
var _local1;
_local1 = (lPos - sSrc) * divStep;
if (sTag > sSrc) {
if (_local1 < 0) {
_local1 = 0;
}
}
if (sTag < sSrc) {
if (_local1 > 0) {
_local1 = 0;
}
}
if (usMax) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ComputeNumBCDCode(val, valMax) {
if (val >= valMax) {
if (valMax == 0) {
val = 0;
} else {
val = valMax - 1;
}
}
var _local1;
var _local6 = 0;
var _local2 = valMax;
var _local4;
if (_local2 >= 100) {
_local2 = Math.floor(_local2 / 10);
_local1 = 0;
for(;;){
if (val >= _local2) {
_local4 = Math.floor(val / _local2);
_local6 = _local6 | (_local4 << _local1);
val = val - (_local4 * _local2);
}
_local1 = _local1 + 4;
if (_local2 <= 10) {
break;
}
_local2 = Math.floor(_local2 / 10);
};
}
_local6 = _local6 | (val << _local1);
var _local5 = _local1 / 4;
if (_local5 > 7) {
_local5 = 7;
} else if (_local5 < 0) {
_local5 = 0;
}
var _local9 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local8 = 0;
var _local7;
_local1 = 0;
while (_local1 < (_local5 + 1)) {
_local7 = (_local6 >> (4 * _local1)) & 15;
_local8 = _local8 | (_local7 << _local9[(7 - _local5) + _local1]);
_local1++;
}
return(_local8);
}
function ComputeTimeBCDCode(frameVal) {
var _local7 = [1080000, 108000, 18000, 1800, 300, 30, 10, 1];
var _local6 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local1;
var _local5 = 0;
var _local3;
var _local4;
_local1 = 0;
while (_local1 < 7) {
_local3 = _local7[_local1];
if (_local1 == 6) {
frameVal = Math.floor(frameVal * 3.4140625);
}
if (frameVal >= _local3) {
_local4 = Math.floor(frameVal / _local3);
_local5 = _local5 | (_local4 << _local6[_local1]);
frameVal = frameVal - (_local4 * _local3);
}
_local1++;
}
_local5 = _local5 | (frameVal << _local6[_local1]);
return(_local5);
}
function testVector3() {
}
function ScreenSpriteMan_Init(base_mc) {
var _local1 = new Object();
_local1.base_mc = base_mc;
_local1.fixDepth = 0;
_local1.markerDepth = 0;
_local1.effectDepth = 0;
_local1.soundDepth = 0;
_local1.effectFrontDepth = 0;
return(_local1);
}
function ScreenSpriteMan_Exit(mgr) {
mgr.base_mc = null;
}
function ScreenSpriteMan_CreateFixMC(mgr, linkName, offsetDepth) {
var _local1 = SCREENSPRITE_DEPTH_FIX + offsetDepth;
if (linkName == "EMPTY_MC") {
return(mgr.base_mc.createEmptyMovieClip(("FIX_" + linkName) + _local1, _local1));
}
return(mgr.base_mc.attachMovie(linkName, linkName + _local1, _local1));
}
function ScreenSpriteMan_CreateMarkerMC(mgr, linkName) {
var _local2 = SCREENSPRITE_DEPTH_MARKER + mgr.markerDepth;
mgr.markerDepth = (mgr.markerDepth + 1) & SCREENSPRITE_DEPTH_MASK;
return(mgr.base_mc.attachMovie(linkName, linkName + _local2, _local2));
}
function ScreenSpriteMan_CreateEffectMC(mgr, linkName) {
var _local2 = SCREENSPRITE_DEPTH_EFFECT + mgr.effectDepth;
mgr.effectDepth = (mgr.effectDepth + 1) & SCREENSPRITE_DEPTH_MASK;
return(mgr.base_mc.attachMovie(linkName, linkName + _local2, _local2));
}
function ScreenSpriteMan_CreateSoundMC(mgr, linkName) {
var _local2 = SCREENSPRITE_DEPTH_SOUND + mgr.soundDepth;
mgr.soundDepth = (mgr.soundDepth + 1) & SCREENSPRITE_DEPTH_MASK;
return(mgr.base_mc.createEmptyMovieClip(linkName + _local2, _local2));
}
function ScreenSpriteMan_CreateEffectFrontMC(mgr, linkName) {
var _local2 = SCREENSPRITE_DEPTH_EFFECT_FRONT + mgr.effectFrontDepth;
mgr.effectFrontDepth = (mgr.effectFrontDepth + 1) & SCREENSPRITE_DEPTH_MASK;
return(mgr.base_mc.attachMovie(linkName, linkName + _local2, _local2));
}
function ResultPanel_Create() {
var _local2 = new Object();
_local2.taskflag = 0;
_local2.exec = resultpanel_exec;
_local2.exit = resultpanel_exit;
_local2.step = 0;
_local2.user_timer = 0;
_local2.user_work = 1;
_local2.user_flag = 0;
_local2.tasks = new Array(RSLT_SUBTASK_ID_MAX);
var _local1;
_local1 = 0;
while (_local1 < _local2.tasks.length) {
_local2.tasks[_local1] = null;
_local1++;
}
return(_local2);
}
function resultpanel_exec() {
switch (this.step) {
case RSLT_STEP_WAIT_INIT :
resultpanel_step_enterInit(this);
break;
case RSLT_STEP_WAIT_MAIN :
resultpanel_step_enterMain(this);
break;
case RSLT_STEP_END_INIT :
resultpanel_step_endInit(this);
break;
case RSLT_STEP_END_MAIN :
resultpanel_step_endMain(this);
break;
case RSLT_STEP_NEXT :
}
var _local2;
var _local3 = this.tasks.length;
_local2 = 0;
while (_local2 < _local3) {
if (this.tasks[_local2] != null) {
if (this.tasks[_local2].taskflag & GAME_TASKFLAG_KILL) {
this.tasks[_local2].exit();
this.tasks[_local2] = null;
} else {
this.tasks[_local2].exec();
}
}
_local2++;
}
}
function resultpanel_exit() {
var _local2;
_local2 = 0;
while (_local2 < this.tasks.length) {
if (this.tasks[_local2] != null) {
this.tasks[_local2].exit();
this.tasks[_local2] = null;
}
_local2++;
}
this.tasks = null;
}
function resultpanel_step_enterInit(myRslt) {
myRslt.tasks[RSLT_SUBTASK_ID_FINISH] = resultpanel_finish_create();
myRslt.tasks[RSLT_SUBTASK_ID_TIME] = resultpanel_time_create();
myRslt.tasks[RSLT_SUBTASK_ID_SCORE] = resultpanel_score_create();
myRslt.tasks[RSLT_SUBTASK_ID_RING] = resultpanel_scoredetail_create(SBE_FIX_BOARD_RING);
myRslt.tasks[RSLT_SUBTASK_ID_ENEMY] = resultpanel_scoredetail_create(SBE_FIX_BOARD_ENEMY);
myRslt.tasks[RSLT_SUBTASK_ID_COMBO] = resultpanel_scoredetail_create(SBE_FIX_BOARD_COMBO);
myRslt.user_timer = 0;
myRslt.user_work = 1;
myRslt.step++;
}
function resultpanel_step_enterMain(myRslt) {
myRslt.user_timer++;
if (myRslt.user_timer <= SBD_DM_SKIP_IGNORE_TIME) {
return(undefined);
}
if (!(myRslt.user_flag & SBD_DM_SCORE_END)) {
if (myRslt.user_timer == SBD_DM_COUNT_START_TIME) {
_root.stageSoundMgr.PlaySE(SOUND_SE_SCORE_INDICATION);
myRslt.user_flag = myRslt.user_flag | SBD_DM_SCORE_COUNT_SE;
}
}
if (myRslt.user_timer > SBD_DM_COUNT_START_TIME) {
myRslt.user_timer = SBD_DM_COUNT_START_TIME + 1;
}
if (_root.touchPen.m_pressed) {
if (!myRslt.user_work) {
myRslt.step = RSLT_STEP_END_INIT;
return(undefined);
}
resultpanel_DispEnd(myRslt);
myRslt.user_flag = myRslt.user_flag | SBD_DM_SCORE_DISP_SKIP;
}
if (!myRslt.user_work) {
resultpanel_DispEnd(myRslt);
} else {
myRslt.user_work = 0;
}
}
function resultpanel_step_endInit(myRslt) {
myRslt.user_timer = SBD_DM_SCORE_END_TIME;
myRslt.tasks[RSLT_SUBTASK_ID_TIME].reqflags = myRslt.tasks[RSLT_SUBTASK_ID_TIME].reqflags | RSLT_REQFLAGS_REQ_LEAVE;
myRslt.tasks[RSLT_SUBTASK_ID_SCORE].reqflags = myRslt.tasks[RSLT_SUBTASK_ID_SCORE].reqflags | RSLT_REQFLAGS_REQ_LEAVE;
myRslt.tasks[RSLT_SUBTASK_ID_RING].reqflags = myRslt.tasks[RSLT_SUBTASK_ID_RING].reqflags | RSLT_REQFLAGS_REQ_LEAVE;
myRslt.tasks[RSLT_SUBTASK_ID_ENEMY].reqflags = myRslt.tasks[RSLT_SUBTASK_ID_ENEMY].reqflags | RSLT_REQFLAGS_REQ_LEAVE;
myRslt.tasks[RSLT_SUBTASK_ID_COMBO].reqflags = myRslt.tasks[RSLT_SUBTASK_ID_COMBO].reqflags | RSLT_REQFLAGS_REQ_LEAVE;
myRslt.step = RSLT_STEP_END_MAIN;
}
function resultpanel_step_endMain(myRslt) {
if (myRslt.user_timer > 0) {
myRslt.user_timer--;
}
if ((myRslt.user_timer == 0) || (_root.touchPen.m_pressed)) {
myRslt.taskflag = myRslt.taskflag | GAME_TASKFLAG_KILL;
myRslt.step++;
}
}
function resultpanel_DispEnd(myRslt) {
if (myRslt.user_flag & SBD_DM_SCORE_COUNT_SE) {
_root.stageSoundMgr.StopSE(SOUND_SE_SCORE_INDICATION);
myRslt.user_flag = myRslt.user_flag & (~SBD_DM_SCORE_COUNT_SE);
}
if (!(myRslt.user_flag & SBD_DM_SCORE_END)) {
_root.stageSoundMgr.StopBGM(SOUND_BGM_DISCOVER);
_root.stageSoundMgr.PlayBGM(SOUND_BGM_RESULT);
myRslt.user_timer = SBD_DM_COUNT_START_TIME + 1;
myRslt.user_flag = myRslt.user_flag | SBD_DM_SCORE_END;
}
}
function resultpanel_isChildSkip() {
if (_root.gameSeq.m_result.user_flag & SBD_DM_SCORE_DISP_SKIP) {
return(true);
}
return(false);
}
function resultpanel_ChildCount() {
if (_root.gameSeq.m_result.step == RSLT_STEP_WAIT_MAIN) {
_root.gameSeq.m_result.user_work++;
}
}
function resultpanel_finish_create() {
var _local2 = new Object();
_local2.taskflag = 0;
_local2.exec = resultpanel_finish_exec;
_local2.exit = resultpanel_finish_exit;
_local2.step = 0;
_local2.user_timer = SBD_DM_CLEAR_WAIT1;
_local2.user_work = SBD_DM_CLEAR_WAIT2;
_local2.pos_x = SBD_DM_CLEAR_POS_X;
_local2.pos_y = SBD_DM_CLEAR_POS_Y;
_local2.scale_y = 0;
_local2.scale_x = 2;
_local2.alpha = 100;
_local2.sprite_mc = ScreenSpriteMan_CreateEffectMC(_root.screenSpriteMgr, "resultFinishAnimation");
var _local3 = _local2.sprite_mc;
_local3._x = _local2.pos_x;
_local3._y = _local2.pos_y;
_local3._xscale = _local2.scale_x * 100;
_local3._yscale = _local2.scale_y * 100;
_local3._alpha = _local2.alpha;
_local3._visible = false;
return(_local2);
}
function resultpanel_finish_exec() {
if (this.step == 0) {
if (this.user_timer) {
this.user_timer--;
} else {
this.sprite_mc._visible = true;
this.scale_y = ObjDiffSet(this.scale_y, 1, 0, 0.5, 0, 0.25);
this.scale_x = ObjShiftSet(this.scale_x, 1, 0.5, 0, 0.5);
}
if (this.scale_y >= 1) {
if (this.user_work) {
this.user_work--;
} else {
this.alpha = this.alpha - 12.5;
if (this.alpha < 12.5) {
this.taskflag = this.taskflag | GAME_TASKFLAG_KILL;
this.step++;
}
}
}
if (resultpanel_isChildSkip()) {
this.taskflag = this.taskflag | GAME_TASKFLAG_KILL;
this.step++;
}
var sprite_mc = this.sprite_mc;
sprite_mc._x = this.pos_x;
sprite_mc._y = this.pos_y;
sprite_mc._xscale = this.scale_x * 100;
sprite_mc._yscale = this.scale_y * 100;
sprite_mc._alpha = this.alpha;
}
}
function resultpanel_finish_exit() {
if (this.sprite_mc != null) {
this.sprite_mc.removeMovieClip();
this.sprite_mc = null;
}
}
function resultpanel_scoredetail_create(id) {
var _local3 = new Object();
var _local4;
_local3.taskflag = 0;
_local3.exec = resultpanel_scoredetail_exec;
_local3.exit = resultpanel_scoredetail_exit;
_local3.step = 0;
_local3.reqflags = 0;
_local3.user_work = id;
_local3.user_timer = 0;
_local3.pos_x = 0;
_local3.pos_y = 0;
_local3.sprite_mc = ScreenSpriteMan_CreateEffectMC(_root.screenSpriteMgr, "resultBaseAnimation");
_local3.sprite_mc._visible = false;
_local3.number_mcs = new Array();
_local4 = 0;
while (_local4 < 8) {
var _local2 = ScreenSpriteMan_CreateEffectMC(_root.screenSpriteMgr, "resultFontAnimation");
_local2._visible = false;
_local3.number_mcs.push(_local2);
_local4++;
}
_local3.titletask = resultpanel_scoretitle_create(id);
return(_local3);
}
function resultpanel_scoredetail_exec() {
switch (this.step) {
case 0 :
this.user_timer = SBD_DM_SCORE_DETAIL_WAIT1;
this.user_timer = this.user_timer + (this.user_work * SBD_DM_SCORE_DETAIL_WAIT1_OFST);
this.pos_x = SBD_DM_SCORE_DETAIL_START_POS_X;
this.pos_y = SBD_DM_SCORE_DETAIL_START_POS_Y;
this.pos_y = this.pos_y + (this.user_work * SBD_DM_SCORE_DETAIL_START_POS_Y_OFST);
this.sprite_mc._visible = false;
this.step++;
break;
case 1 :
resultpanel_ChildCount();
if (this.user_timer) {
this.user_timer--;
} else {
this.pos_x = ObjShiftSet(this.pos_x, SBD_DM_SCORE_DETAIL_MAIN_POS_X, SBD_DM_BOARD_SPD_DIVSTEP, SBD_DM_BOARD_SPD_MAX, SBD_DM_BOARD_SPD_MIN);
this.sprite_mc._visible = true;
}
if (resultpanel_isChildSkip()) {
this.pos_x = SBD_DM_SCORE_DETAIL_MAIN_POS_X;
this.sprite_mc._visible = true;
}
if (this.pos_x == SBD_DM_SCORE_DETAIL_MAIN_POS_X) {
this.user_timer = 0;
this.titletask.step = SCORETITLE_STEP_DISP_MAIN;
this.step++;
}
break;
case 2 :
var _local3 = 0;
switch (this.user_work) {
case SBE_FIX_BOARD_RING :
_local3 = _root.gameSeq.m_player.ring_num;
break;
case SBE_FIX_BOARD_ENEMY :
_local3 = _root.gameSeq.m_player.enemy_kill;
break;
case SBE_FIX_BOARD_COMBO :
_local3 = _root.gameSeq.m_player.combo_hit_max;
}
if (this.user_timer != _local3) {
resultpanel_ChildCount();
}
this.user_timer = ObjShiftSet(this.user_timer, _local3, SBD_DM_SCORE_SPD_DIVSTEP, SBD_DM_SCORE_SPD_MAX, SBD_DM_SCORE_SPD_MIN);
if (resultpanel_isChildSkip()) {
this.user_timer = _local3;
}
var _local4 = ComputeNumBCDCode(this.user_timer, SBD_SHIP_RECORD_RING_MAX);
resultpanel_draw_number(this, _local4, this.pos_x + SBD_DM_SCORE_DETAIL_OFST_X, this.pos_y + SBD_DM_SCORE_DETAIL_OFST_Y);
if (this.reqflags & RSLT_REQFLAGS_REQ_LEAVE) {
this.user_timer = SBD_DM_SCORE_DETAIL_WAIT2;
this.user_timer = this.user_timer + (this.user_work * SBD_DM_SCORE_DETAIL_WAIT2_OFST);
this.user_work = _local4;
this.titletask.step = SCORETITLE_STEP_ESC_MAIN;
this.step++;
}
break;
case 3 :
if ((--this.user_timer) < 0) {
this.pos_x = ObjDiffSet(this.pos_x, SBD_DM_SCORE_DETAIL_END_POS_X, SBD_DM_SCORE_DETAIL_MAIN_POS_X, SBD_DM_BOARD_ESC_SPD_DIVSTEP, SBD_DM_BOARD_ESC_SPD_MAX, SBD_DM_BOARD_ESC_SPD_MIN);
}
resultpanel_draw_number(this, this.user_work, this.pos_x + SBD_DM_SCORE_DETAIL_OFST_X, this.pos_y + SBD_DM_SCORE_DETAIL_OFST_Y);
if (this.pos_x == SBD_DM_SCORE_DETAIL_END_POS_X) {
this.taskflag = this.taskflag | GAME_TASKFLAG_KILL;
this.step++;
}
break;
}
this.sprite_mc._x = this.pos_x;
this.sprite_mc._y = this.pos_y;
if (this.titletask != null) {
this.titletask.parent_pos_x = this.pos_x;
this.titletask.parent_pos_y = this.pos_y;
this.titletask.exec();
}
}
function resultpanel_scoredetail_exit() {
if (this.titletask != null) {
this.titletask.exit();
this.titletask = null;
}
if (this.sprite_mc != null) {
this.sprite_mc.removeMovieClip();
this.sprite_mc = null;
}
var _local2;
_local2 = 0;
while (_local2 < this.number_mcs.length) {
if (this.number_mcs[_local2] != null) {
this.number_mcs[_local2].removeMovieClip();
this.number_mcs[_local2] = null;
}
_local2++;
}
}
function resultpanel_scoretitle_create(id) {
var _local2 = new Object();
_local2.taskflag = 0;
_local2.exec = resultpanel_scoretitle_exec;
_local2.exit = resultpanel_scoretitle_exit;
_local2.step = 0;
_local2.reqflags = 0;
_local2.user_work = id;
_local2.user_timer = 0;
_local2.pos_x = 0;
_local2.pos_y = 0;
_local2.scale_y = 0;
_local2.parent_pos_x = 0;
_local2.parent_pos_y = 0;
var _local4 = ["resultRingAnimation", "resultEnemyAnimation", "resultMaxcomboAnimation"];
var _local3 = _local4[id];
_local2.sprite_mc = ScreenSpriteMan_CreateEffectMC(_root.screenSpriteMgr, _local3);
_local2.sprite_mc._visible = false;
return(_local2);
}
function resultpanel_scoretitle_exec() {
switch (this.step) {
case SCORETITLE_STEP_APPEAR_INIT :
this.pos_x = SBD_DM_SCORE_DETAIL_MAIN_POS_X;
this.pos_y = SBD_DM_SCORE_DETAIL_MAIN_POS_Y;
this.pos_y = this.pos_y + (this.user_work * SBD_DM_SCORE_DETAIL_START_POS_Y_OFST);
this.sprite_mc._visible = false;
this.scale_y = 0;
this.step++;
break;
case SCORETITLE_STEP_APPEAR_MAIN :
case SCORETITLE_STEP_DISP_MAIN :
case SCORETITLE_STEP_ESC_MAIN :
var _local2 = false;
if (this.step != SCORETITLE_STEP_APPEAR_MAIN) {
_local2 = true;
this.sprite_mc._visible = true;
}
if (_local2) {
this.scale_y = ObjDiffSet(this.scale_y, 1, 0, 0.5, 0, 0.25);
}
if (this.step == SCORETITLE_STEP_ESC_MAIN) {
this.scale_y = 1;
this.sprite_mc._visible = true;
}
this.pos_x = this.parent_pos_x + SBD_DM_SCORE_DETAIL_TITLE_OFST_X;
this.pos_y = this.parent_pos_y + SBD_DM_SCORE_DETAIL_TITLE_OFST_Y;
}
this.sprite_mc._x = this.pos_x;
this.sprite_mc._y = this.pos_y;
this.sprite_mc._yscale = this.scale_y * 100;
}
function resultpanel_scoretitle_exit() {
if (this.sprite_mc != null) {
this.sprite_mc.removeMovieClip();
this.sprite_mc = null;
}
}
function resultpanel_draw_number(myWork, code, pos_x, pos_y) {
var _local1;
var _local4 = false;
_local1 = 7;
while (_local1 >= 0) {
var _local3 = (code >> (4 * _local1)) & 15;
var _local5 = "PAT_" + _local3.toString();
var _local2 = myWork.number_mcs[_local1];
if (_local1 == 0) {
_local4 = true;
}
if ((!_local3) && (!_local4)) {
_local2._visible = false;
} else {
_local4 = true;
_local2._visible = true;
_local2._x = pos_x - (_local1 * 10);
_local2._y = pos_y;
_local2.gotoAndPlay(_local5);
}
_local1--;
}
}
function resultpanel_draw_time(myWork, code, pos_x, pos_y) {
var _local2;
var _local10 = 10;
var _local11 = 6;
var _local6 = [2, 11, 28, 37, 52];
_local2 = 4;
while (_local2 >= 0) {
var _local4 = (code >> (4 * _local2)) & 15;
var _local3 = "PAT_" + _local4.toString();
var _local1 = myWork.number_mcs[_local2];
_local1._visible = true;
_local1._x = pos_x - _local6[_local2];
_local1._y = pos_y;
_local1.gotoAndPlay(_local3);
_local1._visible = true;
_local2--;
}
myWork.number_mcs[5]._visible = true;
myWork.number_mcs[5]._x = (myWork.number_mcs[4]._x + _local10) + 2;
myWork.number_mcs[5]._y = myWork.number_mcs[4]._y;
myWork.number_mcs[5].gotoAndPlay("PAT_SQUOT");
myWork.number_mcs[6]._visible = true;
myWork.number_mcs[6]._x = (myWork.number_mcs[2]._x + _local10) + 3;
myWork.number_mcs[6]._y = myWork.number_mcs[2]._y;
myWork.number_mcs[6].gotoAndPlay("PAT_WQUOT");
}
function resultpanel_score_create() {
var _local3 = new Object();
_local3.taskflag = 0;
_local3.exec = resultpanel_score_exec;
_local3.exit = resultpanel_score_exit;
_local3.step = 0;
_local3.reqflags = 0;
_local3.user_work = 0;
_local3.user_timer = 0;
_local3.pos_x = 0;
_local3.pos_y = 0;
_local3.sprite_mc = ScreenSpriteMan_CreateEffectMC(_root.screenSpriteMgr, "resultScoreAnimation");
_local3.sprite_mc._visible = false;
_local3.number_mcs = new Array();
i = 0;
while (i < 8) {
var _local2 = ScreenSpriteMan_CreateEffectMC(_root.screenSpriteMgr, "resultFontAnimation");
_local2._visible = false;
_local3.number_mcs.push(_local2);
i++;
}
return(_local3);
}
function resultpanel_score_exec() {
var _local3;
switch (this.step) {
case 0 :
this.user_timer = SBD_DM_SCORE_HEAD_WAIT1;
this.pos_x = SBD_DM_SCORE_HEAD_START_POS_X;
this.pos_y = SBD_DM_SCORE_HEAD_START_POS_Y2;
this.sprite_mc._visible = true;
this.step++;
break;
case 1 :
resultpanel_ChildCount();
if (this.user_timer) {
this.user_timer--;
} else {
this.pos_x = ObjShiftSet(this.pos_x, SBD_DM_SCORE_HEAD_MAIN_POS_X, SBD_DM_BOARD_SPD_DIVSTEP, SBD_DM_BOARD_SPD_MAX, SBD_DM_BOARD_SPD_MIN);
}
if (resultpanel_isChildSkip()) {
this.pos_x = SBD_DM_SCORE_HEAD_MAIN_POS_X;
}
if (this.pos_x == SBD_DM_SCORE_HEAD_MAIN_POS_X) {
this.user_work = 0;
this.step++;
}
break;
case 2 :
var _local5 = _root.gameSeq.m_player.score;
if (this.user_work != _local5) {
resultpanel_ChildCount();
}
this.user_work = ObjShiftSet(this.user_work, _local5, SBD_DM_SCORE_SPD_DIVSTEP, SBD_DM_SCORE_SPD_MAX, SBD_DM_SCORE_SPD_MIN);
if (resultpanel_isChildSkip()) {
this.user_work = _local5;
}
var _local4 = ComputeNumBCDCode(this.user_work, 100000000);
_local3 = 7;
while (_local3) {
if (_local4 & (15 << (_local3 * 4))) {
break;
}
_local3--;
}
resultpanel_draw_number(this, _local4, (this.pos_x + (_local3 * SBD_DM_SCORE_OFST_X)) + SBD_DM_SCORE_OFST_DEF_X, this.pos_y + SBD_DM_SCORE_OFST_Y);
if (this.reqflags & RSLT_REQFLAGS_REQ_LEAVE) {
this.user_work = _local4;
this.user_timer = SBD_DM_LOGO_WAIT2;
this.step++;
}
break;
case 3 :
this.pos_x = ObjDiffSet(this.pos_x, SBD_DM_SCORE_HEAD_END_POS_X, SBD_DM_SCORE_HEAD_MAIN_POS_X, SBD_DM_BOARD_ESC_SPD_DIVSTEP, SBD_DM_BOARD_ESC_SPD_MAX, SBD_DM_BOARD_ESC_SPD_MIN);
_local3 = 7;
while (_local3) {
if (this.user_work & (15 << (_local3 * 4))) {
break;
}
_local3--;
}
if (!_local3) {
_local3--;
}
resultpanel_draw_number(this, this.user_work, (this.pos_x + (_local3 * SBD_DM_SCORE_OFST_X)) + SBD_DM_SCORE_OFST_DEF_X, this.pos_y + SBD_DM_SCORE_OFST_Y);
if (this.pos_x == SBD_DM_SCORE_HEAD_END_POS_X) {
this.taskflag = this.taskflag | GAME_TASKFLAG_KILL;
this.step++;
}
break;
}
this.sprite_mc._x = this.pos_x;
this.sprite_mc._y = this.pos_y;
}
function resultpanel_score_exit() {
if (this.sprite_mc != null) {
this.sprite_mc.removeMovieClip();
this.sprite_mc = null;
}
var _local2;
_local2 = 0;
while (_local2 < this.number_mcs.length) {
if (this.number_mcs[_local2] != null) {
this.number_mcs[_local2].removeMovieClip();
this.number_mcs[_local2] = null;
}
_local2++;
}
}
function resultpanel_time_create() {
var _local3 = new Object();
_local3.taskflag = 0;
_local3.exec = resultpanel_time_exec;
_local3.exit = resultpanel_time_exit;
_local3.step = 0;
_local3.reqflags = 0;
_local3.user_work = 0;
_local3.user_timer = 0;
_local3.pos_x = 0;
_local3.pos_y = 0;
_local3.sprite_mc = ScreenSpriteMan_CreateEffectMC(_root.screenSpriteMgr, "resultCleartimeAnimation");
_local3.sprite_mc._visible = false;
_local3.number_mcs = new Array();
i = 0;
while (i < 8) {
var _local2 = ScreenSpriteMan_CreateEffectMC(_root.screenSpriteMgr, "resultFontAnimation");
_local2._visible = false;
_local3.number_mcs.push(_local2);
i++;
}
return(_local3);
}
function resultpanel_time_exec() {
switch (this.step) {
case 0 :
this.user_timer = SBD_DM_TIME_HEAD_WAIT1;
this.pos_x = SBD_DM_TIME_HEAD_START_POS_X;
this.pos_y = SBD_DM_TIME_HEAD_START_POS_Y;
this.sprite_mc._visible = true;
this.step++;
break;
case 1 :
resultpanel_ChildCount();
if (this.user_timer) {
this.user_timer--;
} else {
this.pos_x = ObjShiftSet(this.pos_x, SBD_DM_TIME_HEAD_MAIN_POS_X, SBD_DM_BOARD_SPD_DIVSTEP, SBD_DM_BOARD_SPD_MAX, SBD_DM_BOARD_SPD_MIN);
}
if (resultpanel_isChildSkip()) {
this.pos_x = SBD_DM_TIME_HEAD_MAIN_POS_X;
}
if (this.pos_x == SBD_DM_TIME_HEAD_MAIN_POS_X) {
this.user_work = 0;
this.step++;
}
break;
case 2 :
var _local3 = _root.gameSeq.m_record_timer;
if (this.user_work != _local3) {
resultpanel_ChildCount();
}
this.user_work = ObjShiftSet(this.user_work, _local3, SBD_DM_SCORE_SPD_DIVSTEP, SBD_DM_SCORE_SPD_MAX, SBD_DM_SCORE_SPD_MIN);
if (resultpanel_isChildSkip()) {
this.user_work = _local3;
}
var _local4 = ComputeTimeBCDCode(this.user_work);
resultpanel_draw_time(this, _local4, this.pos_x + SBD_DM_TIME_HEAD_OFST_X, this.pos_y + SBD_DM_TIME_HEAD_OFST_Y);
if (this.reqflags & RSLT_REQFLAGS_REQ_LEAVE) {
this.user_work = _local4;
this.user_timer = SBD_DM_TIME_HEAD_WAIT2;
this.step++;
}
break;
case 3 :
if ((--this.user_timer) < 0) {
this.user_timer = 0;
this.pos_x = ObjDiffSet(this.pos_x, SBD_DM_TIME_HEAD_END_POS_X, SBD_DM_TIME_HEAD_MAIN_POS_X, SBD_DM_BOARD_ESC_SPD_DIVSTEP, SBD_DM_BOARD_ESC_SPD_MAX, SBD_DM_BOARD_ESC_SPD_MIN);
}
resultpanel_draw_time(this, this.user_work, this.pos_x + SBD_DM_TIME_HEAD_OFST_X, this.pos_y + SBD_DM_TIME_HEAD_OFST_Y);
if (this.pos_x == SBD_DM_TIME_HEAD_END_POS_X) {
this.taskflag = this.taskflag | GAME_TASKFLAG_KILL;
this.step++;
}
break;
}
this.sprite_mc._x = this.pos_x;
this.sprite_mc._y = this.pos_y;
}
function resultpanel_time_exit() {
if (this.sprite_mc != null) {
this.sprite_mc.removeMovieClip();
this.sprite_mc = null;
}
var _local2;
_local2 = 0;
while (_local2 < this.number_mcs.length) {
if (this.number_mcs[_local2] != null) {
this.number_mcs[_local2].removeMovieClip();
this.number_mcs[_local2] = null;
}
_local2++;
}
}
function vec3d_Create(x, y, z) {
return({x:x, y:y, z:z});
}
function vec3d_Clone(v) {
return({x:v.x, y:v.y, z:v.z});
}
function vec3d_Add(a, b) {
return({x:a.x + b.x, y:a.y + b.y, z:a.z + b.z});
}
function vec3d_Subtract(a, b) {
return({x:a.x - b.x, y:a.y - b.y, z:a.z - b.z});
}
function vec3d_Scale(a, v) {
return({x:a * v.x, y:a * v.y, z:a * v.z});
}
function vec3d_DotProduct(a, b) {
return(((a.x * b.x) + (a.y * b.y)) + (a.z * b.z));
}
function vec3d_CrossProduct(a, b) {
return({x:(a.y * b.z) - (a.z * b.y), y:(a.z * b.x) - (a.x * b.z), z:(a.x * b.y) - (a.y * b.x)});
}
function vec3d_Mag(v) {
return(Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z)));
}
function vec3d_Normalize(v) {
var _local2 = Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
if (_local2 > 0) {
_local2 = 1 / _local2;
}
return({x:v.x * _local2, y:v.y * _local2, z:v.z * _local2});
}
function vec3d_MultAdd(a, v1, v2) {
return({x:v2.x + (a * v1.x), y:v2.y + (a * v1.y), z:v2.z + (a * v1.z)});
}
function vec3d_Set(v, x, y, z) {
v.x = x;
v.y = y;
v.z = z;
}
function ObjSpdUpSet(lSpd, sSpd, sMaxSpd) {
lSpd = lSpd + sSpd;
if (sMaxSpd == 0) {
return(lSpd);
}
if (sSpd >= 0) {
if (lSpd > sMaxSpd) {
lSpd = sMaxSpd;
}
} else if (lSpd < (-sMaxSpd)) {
lSpd = -sMaxSpd;
}
return(lSpd);
}
function ObjSpdDownSet(lSpd, sSpd) {
if (lSpd > 0) {
lSpd = lSpd - sSpd;
if (lSpd < 0) {
lSpd = 0;
}
} else {
lSpd = lSpd + sSpd;
if (lSpd > 0) {
lSpd = 0;
}
}
return(lSpd);
}
function ObjShiftSet(lPos, sTag, divStep, usMax, usMin) {
var _local1;
if (lPos == sTag) {
return(lPos);
}
if (usMin == 0) {
usMin = 1;
}
_local1 = (sTag - lPos) * divStep;
if (usMax > 0) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin > 0) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ObjDiffSet(lPos, sTag, sSrc, divStep, usMax, usMin) {
if (lPos == sTag) {
return(lPos);
}
if (!usMin) {
usMin = 1;
}
var _local1;
_local1 = (lPos - sSrc) * divStep;
if (sTag > sSrc) {
if (_local1 < 0) {
_local1 = 0;
}
}
if (sTag < sSrc) {
if (_local1 > 0) {
_local1 = 0;
}
}
if (usMax) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ComputeNumBCDCode(val, valMax) {
if (val >= valMax) {
if (valMax == 0) {
val = 0;
} else {
val = valMax - 1;
}
}
var _local1;
var _local6 = 0;
var _local2 = valMax;
var _local4;
if (_local2 >= 100) {
_local2 = Math.floor(_local2 / 10);
_local1 = 0;
for(;;){
if (val >= _local2) {
_local4 = Math.floor(val / _local2);
_local6 = _local6 | (_local4 << _local1);
val = val - (_local4 * _local2);
}
_local1 = _local1 + 4;
if (_local2 <= 10) {
break;
}
_local2 = Math.floor(_local2 / 10);
};
}
_local6 = _local6 | (val << _local1);
var _local5 = _local1 / 4;
if (_local5 > 7) {
_local5 = 7;
} else if (_local5 < 0) {
_local5 = 0;
}
var _local9 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local8 = 0;
var _local7;
_local1 = 0;
while (_local1 < (_local5 + 1)) {
_local7 = (_local6 >> (4 * _local1)) & 15;
_local8 = _local8 | (_local7 << _local9[(7 - _local5) + _local1]);
_local1++;
}
return(_local8);
}
function ComputeTimeBCDCode(frameVal) {
var _local7 = [1080000, 108000, 18000, 1800, 300, 30, 10, 1];
var _local6 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local1;
var _local5 = 0;
var _local3;
var _local4;
_local1 = 0;
while (_local1 < 7) {
_local3 = _local7[_local1];
if (_local1 == 6) {
frameVal = Math.floor(frameVal * 3.4140625);
}
if (frameVal >= _local3) {
_local4 = Math.floor(frameVal / _local3);
_local5 = _local5 | (_local4 << _local6[_local1]);
frameVal = frameVal - (_local4 * _local3);
}
_local1++;
}
_local5 = _local5 | (frameVal << _local6[_local1]);
return(_local5);
}
function testVector3() {
}
function MapMarker_Create() {
var _local1 = new Object();
_local1.taskflag = 0;
_local1.exec = mapmarker_exec;
_local1.exit = mapmarker_exit;
_local1.step = 0;
_local1.user_flag = 0;
_local1.user_timer = 0;
_local1.mark_pos_x = SBD_VSFIX_START_X;
_local1.mark_pos_y = SBD_VSFIX_START_Y;
_local1.mark_mc = mapmarker_CreateMC("UpSonic", DEPTH_UPPER_POINT);
_local1.mark_mc.gotoAndPlay("PAT_POINT");
_local1.icon_pos_y = SBD_VSFIX_MARKER_S_Y_OFST;
_local1.icon_scale_x;
_local1.icon_scale_y;
_local1.icon_rotang;
_local1.icon_mc = mapmarker_CreateMC("UpSonic", DEPTH_UPPER_SONIC);
_local1.icon_mc.gotoAndPlay("PAT_SONIC");
_local1.goal_mc = mapmarker_CreateMC("UpGoalAnimation", DEPTH_UPPER_GOAL);
_local1.goal_mc._x = SBD_VSFIX_GOAL_X - 12;
_local1.goal_mc._y = SBD_VSFIX_GOAL_Y - 12;
return(_local1);
}
function mapmarker_exec() {
var _local9;
var _local8;
if (_root.gameSeq.m_map) {
_local9 = _root.gameSeq.m_map.pos_line;
_local8 = _root.gameSeq.m_map.block_total * STAGEMAP_SEA_LINE_LENGTH;
} else {
_local9 = 0;
_local8 = STAGEMAP_LINESIZE * STAGEMAP_SEA_LINE_LENGTH;
}
var _local10 = _local9 / _local8;
var _local7 = SBD_VSFIX_START_X + (_local10 * SBD_VSFIX_LENGTH);
if (this.mark_pos_x < _local7) {
this.mark_pos_x = _local7;
}
if (this.mark_pos_x > SBD_VSFIX_GOAL_X) {
this.mark_pos_x = SBD_VSFIX_GOAL_X;
}
var _local3 = _root.gameSeq.m_player.state;
var _local4 = _root.gameSeq.m_player.user_flag;
if (_local3 == SBE_JET_DAMAGE) {
if (!(this.user_flag & SBD_VSFIX_DAMAGE_FLAG)) {
this.user_flag = this.user_flag | SBD_VSFIX_DAMAGE_FLAG;
}
this.icon_rotang = this.icon_rotang + 4096;
} else {
if (this.user_flag & SBD_VSFIX_DAMAGE_FLAG) {
this.icon_rotang = 0;
this.user_flag = this.user_flag & (~SBD_VSFIX_DAMAGE_FLAG);
}
if (!(_local4 & SBD_SHIP_FLAG_BOOST)) {
var _local6 = false;
if (this.icon_rotang & 32768) {
_local6 = true;
this.icon_rotang = -this.icon_rotang;
this.icon_rotang = this.icon_rotang & 65535;
}
if ((_local3 >= SBE_JET_BRAKE1) && (_local3 <= SBE_JET_BRAKE2)) {
if (!(this.user_flag & SBD_VSFIX_BRAKE_FLAG)) {
this.user_flag = this.user_flag | SBD_VSFIX_BRAKE_FLAG;
this.icon_rotang = 0;
}
_local6 = true;
this.icon_rotang = this.icon_rotang & 65535;
this.icon_rotang = ObjShiftSet(this.icon_rotang, 4096, 0.5, 0, 0);
this.icon_rotang = this.icon_rotang & 65535;
} else {
this.icon_rotang = this.icon_rotang & 65535;
this.icon_rotang = ObjShiftSet(this.icon_rotang, 0, 0.5, 0, 0);
this.icon_rotang = this.icon_rotang & 65535;
this.user_flag = this.user_flag & (~SBD_VSFIX_BRAKE_FLAG);
}
if (_local6) {
this.icon_rotang = -this.icon_rotang;
this.icon_rotang = this.icon_rotang & 65535;
}
}
}
if (_local4 & SBD_SHIP_FLAG_BOOST) {
if (!(this.user_flag & SBD_VSFIX_BOOST_FLAG)) {
this.user_flag = this.user_flag | SBD_VSFIX_BOOST_FLAG;
this.icon_rotang = 0;
if (!(this.user_flag & SBD_VSFIX_TRICK_FLAG)) {
this.user_timer = 0;
}
}
this.icon_rotang = this.icon_rotang & 65535;
this.icon_rotang = ObjShiftSet(this.icon_rotang, 4096, 0.5, 0, 0);
this.icon_rotang = this.icon_rotang & 65535;
} else {
this.user_flag = this.user_flag & (~SBD_VSFIX_BOOST_FLAG);
}
if ((_local3 >= SBE_JET_TRICK1) && (_local3 <= SBE_JET_TRICK4)) {
if (!(this.user_flag & SBD_VSFIX_TRICK_FLAG)) {
this.user_flag = this.user_flag | SBD_VSFIX_TRICK_FLAG;
if (!(this.user_flag & SBD_VSFIX_BOOST_FLAG)) {
this.user_timer = 0;
}
}
} else {
this.user_flag = this.user_flag & (~SBD_VSFIX_TRICK_FLAG);
}
if ((_local4 & SBD_SHIP_FLAG_BOOST) || ((_local3 >= SBE_JET_TRICK1) && (_local3 <= SBE_JET_TRICK4))) {
var _local5 = 0;
if (this.user_timer & 8) {
_local5 = (this.user_timer & 7) * 128;
} else {
_local5 = (8 - (this.user_timer & 7)) * 128;
}
this.user_timer++;
this.icon_scale_x = (4096 + _local5) / 4096;
this.icon_scale_y = this.icon_scale_x;
} else {
this.icon_scale_x = (this.icon_scale_y = 1);
}
var _local11 = _root.gameSeq.m_player.stageObj.pos.y;
this.icon_pos_y = SBD_VSFIX_MARKER_S_Y_OFST - (_local11 * 2);
if (this.mark_mc != null) {
this.mark_mc._x = this.mark_pos_x;
this.mark_mc._y = this.mark_pos_y;
}
if (this.icon_mc != null) {
this.icon_mc._x = this.mark_pos_x;
this.icon_mc._y = this.mark_pos_y + this.icon_pos_y;
this.icon_mc._xscale = this.icon_scale_x * 100;
this.icon_mc._yscale = this.icon_scale_y * 100;
this.icon_mc._rotation = 360 * ((this.icon_rotang & 65535) / 65536);
}
}
function mapmarker_exit() {
if (this.mark_mc != null) {
this.mark_mc.removeMovieClip();
this.mark_mc = null;
}
if (this.icon_mc != null) {
this.icon_mc.removeMovieClip();
this.icon_mc = null;
}
if (this.goal_mc != null) {
this.goal_mc.removeMovieClip();
this.goal_mc = null;
}
}
function mapmarker_CreateMC(linkName, offsetDepth) {
var _local2 = offsetDepth;
return(_root.theUpperScreen.attachMovie(linkName, linkName + _local2, _local2));
}
function vec3d_Create(x, y, z) {
return({x:x, y:y, z:z});
}
function vec3d_Clone(v) {
return({x:v.x, y:v.y, z:v.z});
}
function vec3d_Add(a, b) {
return({x:a.x + b.x, y:a.y + b.y, z:a.z + b.z});
}
function vec3d_Subtract(a, b) {
return({x:a.x - b.x, y:a.y - b.y, z:a.z - b.z});
}
function vec3d_Scale(a, v) {
return({x:a * v.x, y:a * v.y, z:a * v.z});
}
function vec3d_DotProduct(a, b) {
return(((a.x * b.x) + (a.y * b.y)) + (a.z * b.z));
}
function vec3d_CrossProduct(a, b) {
return({x:(a.y * b.z) - (a.z * b.y), y:(a.z * b.x) - (a.x * b.z), z:(a.x * b.y) - (a.y * b.x)});
}
function vec3d_Mag(v) {
return(Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z)));
}
function vec3d_Normalize(v) {
var _local2 = Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
if (_local2 > 0) {
_local2 = 1 / _local2;
}
return({x:v.x * _local2, y:v.y * _local2, z:v.z * _local2});
}
function vec3d_MultAdd(a, v1, v2) {
return({x:v2.x + (a * v1.x), y:v2.y + (a * v1.y), z:v2.z + (a * v1.z)});
}
function vec3d_Set(v, x, y, z) {
v.x = x;
v.y = y;
v.z = z;
}
function ObjSpdUpSet(lSpd, sSpd, sMaxSpd) {
lSpd = lSpd + sSpd;
if (sMaxSpd == 0) {
return(lSpd);
}
if (sSpd >= 0) {
if (lSpd > sMaxSpd) {
lSpd = sMaxSpd;
}
} else if (lSpd < (-sMaxSpd)) {
lSpd = -sMaxSpd;
}
return(lSpd);
}
function ObjSpdDownSet(lSpd, sSpd) {
if (lSpd > 0) {
lSpd = lSpd - sSpd;
if (lSpd < 0) {
lSpd = 0;
}
} else {
lSpd = lSpd + sSpd;
if (lSpd > 0) {
lSpd = 0;
}
}
return(lSpd);
}
function ObjShiftSet(lPos, sTag, divStep, usMax, usMin) {
var _local1;
if (lPos == sTag) {
return(lPos);
}
if (usMin == 0) {
usMin = 1;
}
_local1 = (sTag - lPos) * divStep;
if (usMax > 0) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin > 0) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ObjDiffSet(lPos, sTag, sSrc, divStep, usMax, usMin) {
if (lPos == sTag) {
return(lPos);
}
if (!usMin) {
usMin = 1;
}
var _local1;
_local1 = (lPos - sSrc) * divStep;
if (sTag > sSrc) {
if (_local1 < 0) {
_local1 = 0;
}
}
if (sTag < sSrc) {
if (_local1 > 0) {
_local1 = 0;
}
}
if (usMax) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ComputeNumBCDCode(val, valMax) {
if (val >= valMax) {
if (valMax == 0) {
val = 0;
} else {
val = valMax - 1;
}
}
var _local1;
var _local6 = 0;
var _local2 = valMax;
var _local4;
if (_local2 >= 100) {
_local2 = Math.floor(_local2 / 10);
_local1 = 0;
for(;;){
if (val >= _local2) {
_local4 = Math.floor(val / _local2);
_local6 = _local6 | (_local4 << _local1);
val = val - (_local4 * _local2);
}
_local1 = _local1 + 4;
if (_local2 <= 10) {
break;
}
_local2 = Math.floor(_local2 / 10);
};
}
_local6 = _local6 | (val << _local1);
var _local5 = _local1 / 4;
if (_local5 > 7) {
_local5 = 7;
} else if (_local5 < 0) {
_local5 = 0;
}
var _local9 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local8 = 0;
var _local7;
_local1 = 0;
while (_local1 < (_local5 + 1)) {
_local7 = (_local6 >> (4 * _local1)) & 15;
_local8 = _local8 | (_local7 << _local9[(7 - _local5) + _local1]);
_local1++;
}
return(_local8);
}
function ComputeTimeBCDCode(frameVal) {
var _local7 = [1080000, 108000, 18000, 1800, 300, 30, 10, 1];
var _local6 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local1;
var _local5 = 0;
var _local3;
var _local4;
_local1 = 0;
while (_local1 < 7) {
_local3 = _local7[_local1];
if (_local1 == 6) {
frameVal = Math.floor(frameVal * 3.4140625);
}
if (frameVal >= _local3) {
_local4 = Math.floor(frameVal / _local3);
_local5 = _local5 | (_local4 << _local6[_local1]);
frameVal = frameVal - (_local4 * _local3);
}
_local1++;
}
_local5 = _local5 | (frameVal << _local6[_local1]);
return(_local5);
}
function testVector3() {
}
function TipsPanel_Create() {
var _local2 = new Object();
_local2.taskflag = 0;
_local2.exec = tipspanel_exec;
_local2.exit = tipspanel_exit;
_local2.step = 0;
_local2.flag = 0;
_local2.btn_frame_base = TIPS_BTN_FRAME_BASE_ENG;
_local2.btn_offset_y = 0;
_local2.scene_mc = _root.createEmptyMovieClip("theTipsScreen", DEPTH_SCENE_TIPS);
if (_local2.scene_mc != null) {
_local2.board_mc = _local2.scene_mc.createEmptyMovieClip("tips_board_mc" + TIPS_BOARD_DEPTH, TIPS_BOARD_DEPTH);
_local2.panel_mc = _local2.scene_mc.attachMovie("TipsHintAnimation", "tips_hint_mc" + TIPS_PANEL_DEPTH, TIPS_PANEL_DEPTH);
_local2.btn_mc = _local2.scene_mc.attachMovie("TipsBtnAnimation", "tips_btn_mc" + TIPS_BTN_DEPTH, TIPS_BTN_DEPTH);
} else {
_local2.board_mc = null;
_local2.panel_mc = null;
_local2.btn_mc = null;
}
if (UPPER_BG_IS_JPN) {
_local2.btn_frame_base = TIPS_BTN_FRAME_BASE_JPN;
} else {
_local2.btn_frame_base = TIPS_BTN_FRAME_BASE_ENG;
}
if (_local2.panel_mc != null) {
if (UPPER_BG_IS_JPN) {
_local2.panel_mc.gotoAndStop("PAT_JPN");
}
_local2.panel_mc._visible = false;
}
if (_local2.btn_mc != null) {
_local2.btn_mc._x = TIPS_BTN_XPOS;
_local2.btn_mc._y = TIPS_BTN_YPOS;
_local2.btn_mc._visible = false;
}
if (_local2.board_mc != null) {
var _local3 = _local2.board_mc;
var _local5 = Stage.width;
var _local4 = Stage.height;
_local3.clear();
_local3.beginFill(0, 50);
_local3.moveTo(0, 0);
_local3.lineTo(0, _local4);
_local3.lineTo(_local5, _local4);
_local3.lineTo(_local5, 0);
_local3.lineTo(0, 0);
_local3.endFill();
_local2.board_mc._visible = false;
}
tipspanel_tips_onoff(_local2, false);
return(_local2);
}
function tipspanel_exec() {
var _local3 = 0;
var _local8 = 0;
var _local7 = 0;
var _local5 = false;
if (!(_root.gameSeq.m_gameflags & (SBD_MAIN_RESULT | SBD_MAIN_GAMEOVER))) {
_local5 = true;
}
if (_local5) {
if (_root.touchPen.m_pressed) {
_local3 = _local3 | PLAYER_TP_FLAG_PUSH;
}
if (_root.touchPen.m_released) {
_local3 = _local3 | PLAYER_TP_FLAG_PULL;
}
if (_root.touchPen.m_state) {
_local3 = _local3 | PLAYER_TP_FLAG_ON;
}
_local8 = _root.touchPen.m_pos.x + SCENE_LOWER_XPOS;
_local7 = _root.touchPen.m_pos.y + SCENE_LOWER_YPOS;
if (this.btn_mc != null) {
this.btn_mc._visible = true;
}
} else if (this.btn_mc != null) {
this.btn_mc._visible = false;
}
var _local4 = false;
if (_local3 & ((PLAYER_TP_FLAG_ON | PLAYER_TP_FLAG_PUSH) | PLAYER_TP_FLAG_PULL)) {
var _local11 = _local8 - this.btn_mc._x;
var _local9 = _local7 - this.btn_mc._y;
var _local10 = 4;
var _local6 = 98;
var _local12 = 0;
var _local13 = 32;
if ((!(this.flag & TIPS_FLAGS_TIPS_ON)) && (UPPER_BG_IS_JPN)) {
_local10 = _local10 - 22;
_local6 = _local6 - 22;
}
if ((((_local11 >= _local10) && (_local11 <= _local6)) && (_local9 >= _local12)) && (_local9 <= _local13)) {
_local4 = true;
}
}
if (this.flag & TIPS_FLAGS_BTN_DOWN) {
if (_local3 & PLAYER_TP_FLAG_PULL) {
this.flag = this.flag & (~TIPS_FLAGS_BTN_DOWN);
if (_local4) {
if (this.flag & TIPS_FLAGS_TIPS_ON) {
tipspanel_tips_onoff(this, false);
_root.gameSeq.m_gameflags = _root.gameSeq.m_gameflags & (~SBD_MAIN_ENABLE_TIPS);
_root.gameSeq.PauseTasks(false);
_root.stageSoundMgr.SetVolumeG(100);
} else {
tipspanel_tips_onoff(this, true);
_root.gameSeq.m_gameflags = _root.gameSeq.m_gameflags | SBD_MAIN_ENABLE_TIPS;
_root.gameSeq.PauseTasks(true);
_root.stageSoundMgr.SetVolumeG(0);
}
}
}
} else if ((_local3 & PLAYER_TP_FLAG_PUSH) && (_local4)) {
this.flag = this.flag | TIPS_FLAGS_BTN_DOWN;
}
if (this.flag & TIPS_FLAGS_BTN_DOWN) {
if (this.btn_offset_y < TIPS_BTN_OFFSET_Y_MAX) {
this.btn_offset_y = this.btn_offset_y + 2;
} else {
this.btn_offset_y = TIPS_BTN_OFFSET_Y_MAX;
}
} else if (this.btn_offset_y > 0) {
this.btn_offset_y = this.btn_offset_y - 2;
} else {
this.btn_offset_y = 0;
}
if (this.btn_mc != null) {
this.btn_mc._y = TIPS_BTN_YPOS + this.btn_offset_y;
}
}
function tipspanel_exit() {
if (this.board_mc != null) {
this.board_mc.removeMovieClip();
this.board_mc = null;
}
if (this.panel_mc != null) {
this.panel_mc.removeMovieClip();
this.panel_mc = null;
}
if (this.btn_mc != null) {
this.btn_mc.removeMovieClip();
this.btn_mc = null;
}
if (this.scene_mc != null) {
this.scene_mc.removeMovieClip();
this.scene_mc = null;
}
}
function tipspanel_tips_onoff(myWork, onoff) {
if (onoff) {
if (!(myWork.flag & TIPS_FLAGS_TIPS_ON)) {
}
myWork.flag = myWork.flag | TIPS_FLAGS_TIPS_ON;
} else {
if (myWork.flag & TIPS_FLAGS_TIPS_ON) {
}
myWork.flag = myWork.flag & (~TIPS_FLAGS_TIPS_ON);
}
if (myWork.flag & TIPS_FLAGS_TIPS_ON) {
if (myWork.board_mc != null) {
myWork.board_mc._visible = true;
}
if (myWork.panel_mc != null) {
myWork.panel_mc._visible = true;
}
myWork.btn_mc.gotoAndStop(myWork.btn_frame_base + 1);
} else {
if (myWork.board_mc != null) {
myWork.board_mc._visible = false;
}
if (myWork.panel_mc != null) {
myWork.panel_mc._visible = false;
}
myWork.btn_mc.gotoAndStop(myWork.btn_frame_base);
}
}
function vec3d_Create(x, y, z) {
return({x:x, y:y, z:z});
}
function vec3d_Clone(v) {
return({x:v.x, y:v.y, z:v.z});
}
function vec3d_Add(a, b) {
return({x:a.x + b.x, y:a.y + b.y, z:a.z + b.z});
}
function vec3d_Subtract(a, b) {
return({x:a.x - b.x, y:a.y - b.y, z:a.z - b.z});
}
function vec3d_Scale(a, v) {
return({x:a * v.x, y:a * v.y, z:a * v.z});
}
function vec3d_DotProduct(a, b) {
return(((a.x * b.x) + (a.y * b.y)) + (a.z * b.z));
}
function vec3d_CrossProduct(a, b) {
return({x:(a.y * b.z) - (a.z * b.y), y:(a.z * b.x) - (a.x * b.z), z:(a.x * b.y) - (a.y * b.x)});
}
function vec3d_Mag(v) {
return(Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z)));
}
function vec3d_Normalize(v) {
var _local2 = Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
if (_local2 > 0) {
_local2 = 1 / _local2;
}
return({x:v.x * _local2, y:v.y * _local2, z:v.z * _local2});
}
function vec3d_MultAdd(a, v1, v2) {
return({x:v2.x + (a * v1.x), y:v2.y + (a * v1.y), z:v2.z + (a * v1.z)});
}
function vec3d_Set(v, x, y, z) {
v.x = x;
v.y = y;
v.z = z;
}
function ObjSpdUpSet(lSpd, sSpd, sMaxSpd) {
lSpd = lSpd + sSpd;
if (sMaxSpd == 0) {
return(lSpd);
}
if (sSpd >= 0) {
if (lSpd > sMaxSpd) {
lSpd = sMaxSpd;
}
} else if (lSpd < (-sMaxSpd)) {
lSpd = -sMaxSpd;
}
return(lSpd);
}
function ObjSpdDownSet(lSpd, sSpd) {
if (lSpd > 0) {
lSpd = lSpd - sSpd;
if (lSpd < 0) {
lSpd = 0;
}
} else {
lSpd = lSpd + sSpd;
if (lSpd > 0) {
lSpd = 0;
}
}
return(lSpd);
}
function ObjShiftSet(lPos, sTag, divStep, usMax, usMin) {
var _local1;
if (lPos == sTag) {
return(lPos);
}
if (usMin == 0) {
usMin = 1;
}
_local1 = (sTag - lPos) * divStep;
if (usMax > 0) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin > 0) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ObjDiffSet(lPos, sTag, sSrc, divStep, usMax, usMin) {
if (lPos == sTag) {
return(lPos);
}
if (!usMin) {
usMin = 1;
}
var _local1;
_local1 = (lPos - sSrc) * divStep;
if (sTag > sSrc) {
if (_local1 < 0) {
_local1 = 0;
}
}
if (sTag < sSrc) {
if (_local1 > 0) {
_local1 = 0;
}
}
if (usMax) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ComputeNumBCDCode(val, valMax) {
if (val >= valMax) {
if (valMax == 0) {
val = 0;
} else {
val = valMax - 1;
}
}
var _local1;
var _local6 = 0;
var _local2 = valMax;
var _local4;
if (_local2 >= 100) {
_local2 = Math.floor(_local2 / 10);
_local1 = 0;
for(;;){
if (val >= _local2) {
_local4 = Math.floor(val / _local2);
_local6 = _local6 | (_local4 << _local1);
val = val - (_local4 * _local2);
}
_local1 = _local1 + 4;
if (_local2 <= 10) {
break;
}
_local2 = Math.floor(_local2 / 10);
};
}
_local6 = _local6 | (val << _local1);
var _local5 = _local1 / 4;
if (_local5 > 7) {
_local5 = 7;
} else if (_local5 < 0) {
_local5 = 0;
}
var _local9 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local8 = 0;
var _local7;
_local1 = 0;
while (_local1 < (_local5 + 1)) {
_local7 = (_local6 >> (4 * _local1)) & 15;
_local8 = _local8 | (_local7 << _local9[(7 - _local5) + _local1]);
_local1++;
}
return(_local8);
}
function ComputeTimeBCDCode(frameVal) {
var _local7 = [1080000, 108000, 18000, 1800, 300, 30, 10, 1];
var _local6 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local1;
var _local5 = 0;
var _local3;
var _local4;
_local1 = 0;
while (_local1 < 7) {
_local3 = _local7[_local1];
if (_local1 == 6) {
frameVal = Math.floor(frameVal * 3.4140625);
}
if (frameVal >= _local3) {
_local4 = Math.floor(frameVal / _local3);
_local5 = _local5 | (_local4 << _local6[_local1]);
frameVal = frameVal - (_local4 * _local3);
}
_local1++;
}
_local5 = _local5 | (frameVal << _local6[_local1]);
return(_local5);
}
function testVector3() {
}
function TrapBuoy_Create(lineZ, ofs_x, ofs_y, acttype) {
var _local2 = new Object();
_local2.taskflag = 0;
_local2.exec = trap_buoy_exec;
_local2.exit = trap_buoy_exit;
_local2.actno = TRAP_ACTNO_BUOY;
_local2.actflag = 0;
_local2.body_radius = 1.0859375;
_local2.attack_radius = 0;
_local2.hitstop_timer = 0;
_local2.pos_line = vec3d_Create(ofs_x, ofs_y, lineZ);
_local2.pos_stage = vec3d_Create(0, 0, 0);
_local2.stageObj = StageSpriteMan_CreateObject(_root.stageSpriteMgr, 0);
_local2.stageObj.baseScale = TRAP_BUOY_BASE_SCALE;
_local2.stage_mc = StageSpriteMan_CreateMC(_root.stageSpriteMgr, "BuoyGoalAnimation");
_local2.stage_mc.gotoAndPlay("PAT_GREEN");
_local2.stage_mc._visible = false;
trap_buoy_update_pos(_local2);
return(_local2);
}
function trap_buoy_exec() {
trap_buoy_update_pos(this);
if (trap_buoy_checkFrameout(this)) {
this.taskflag = this.taskflag | GAME_TASKFLAG_KILL;
} else {
StageSpriteMan_AddOrder(_root.stageSpriteMgr, this.stageObj, this.stage_mc);
}
}
function trap_buoy_exit() {
this.stageObj = null;
this.stage_mc.removeMovieClip();
this.stage_mc = null;
}
function trap_buoy_update_pos(myTrap) {
myTrap.pos_stage = seqGame_GetStagePos(myTrap.pos_line);
myTrap.stageObj.pos.x = myTrap.pos_stage.x;
myTrap.stageObj.pos.y = myTrap.pos_stage.y;
myTrap.stageObj.pos.z = myTrap.pos_stage.z;
}
function trap_buoy_checkFrameout(myTrap) {
var _local1 = -3;
if (myTrap.stageObj.pos.z > (-_local1)) {
return(true);
}
return(false);
}
function vec3d_Create(x, y, z) {
return({x:x, y:y, z:z});
}
function vec3d_Clone(v) {
return({x:v.x, y:v.y, z:v.z});
}
function vec3d_Add(a, b) {
return({x:a.x + b.x, y:a.y + b.y, z:a.z + b.z});
}
function vec3d_Subtract(a, b) {
return({x:a.x - b.x, y:a.y - b.y, z:a.z - b.z});
}
function vec3d_Scale(a, v) {
return({x:a * v.x, y:a * v.y, z:a * v.z});
}
function vec3d_DotProduct(a, b) {
return(((a.x * b.x) + (a.y * b.y)) + (a.z * b.z));
}
function vec3d_CrossProduct(a, b) {
return({x:(a.y * b.z) - (a.z * b.y), y:(a.z * b.x) - (a.x * b.z), z:(a.x * b.y) - (a.y * b.x)});
}
function vec3d_Mag(v) {
return(Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z)));
}
function vec3d_Normalize(v) {
var _local2 = Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
if (_local2 > 0) {
_local2 = 1 / _local2;
}
return({x:v.x * _local2, y:v.y * _local2, z:v.z * _local2});
}
function vec3d_MultAdd(a, v1, v2) {
return({x:v2.x + (a * v1.x), y:v2.y + (a * v1.y), z:v2.z + (a * v1.z)});
}
function vec3d_Set(v, x, y, z) {
v.x = x;
v.y = y;
v.z = z;
}
function ObjSpdUpSet(lSpd, sSpd, sMaxSpd) {
lSpd = lSpd + sSpd;
if (sMaxSpd == 0) {
return(lSpd);
}
if (sSpd >= 0) {
if (lSpd > sMaxSpd) {
lSpd = sMaxSpd;
}
} else if (lSpd < (-sMaxSpd)) {
lSpd = -sMaxSpd;
}
return(lSpd);
}
function ObjSpdDownSet(lSpd, sSpd) {
if (lSpd > 0) {
lSpd = lSpd - sSpd;
if (lSpd < 0) {
lSpd = 0;
}
} else {
lSpd = lSpd + sSpd;
if (lSpd > 0) {
lSpd = 0;
}
}
return(lSpd);
}
function ObjShiftSet(lPos, sTag, divStep, usMax, usMin) {
var _local1;
if (lPos == sTag) {
return(lPos);
}
if (usMin == 0) {
usMin = 1;
}
_local1 = (sTag - lPos) * divStep;
if (usMax > 0) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin > 0) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ObjDiffSet(lPos, sTag, sSrc, divStep, usMax, usMin) {
if (lPos == sTag) {
return(lPos);
}
if (!usMin) {
usMin = 1;
}
var _local1;
_local1 = (lPos - sSrc) * divStep;
if (sTag > sSrc) {
if (_local1 < 0) {
_local1 = 0;
}
}
if (sTag < sSrc) {
if (_local1 > 0) {
_local1 = 0;
}
}
if (usMax) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ComputeNumBCDCode(val, valMax) {
if (val >= valMax) {
if (valMax == 0) {
val = 0;
} else {
val = valMax - 1;
}
}
var _local1;
var _local6 = 0;
var _local2 = valMax;
var _local4;
if (_local2 >= 100) {
_local2 = Math.floor(_local2 / 10);
_local1 = 0;
for(;;){
if (val >= _local2) {
_local4 = Math.floor(val / _local2);
_local6 = _local6 | (_local4 << _local1);
val = val - (_local4 * _local2);
}
_local1 = _local1 + 4;
if (_local2 <= 10) {
break;
}
_local2 = Math.floor(_local2 / 10);
};
}
_local6 = _local6 | (val << _local1);
var _local5 = _local1 / 4;
if (_local5 > 7) {
_local5 = 7;
} else if (_local5 < 0) {
_local5 = 0;
}
var _local9 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local8 = 0;
var _local7;
_local1 = 0;
while (_local1 < (_local5 + 1)) {
_local7 = (_local6 >> (4 * _local1)) & 15;
_local8 = _local8 | (_local7 << _local9[(7 - _local5) + _local1]);
_local1++;
}
return(_local8);
}
function ComputeTimeBCDCode(frameVal) {
var _local7 = [1080000, 108000, 18000, 1800, 300, 30, 10, 1];
var _local6 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local1;
var _local5 = 0;
var _local3;
var _local4;
_local1 = 0;
while (_local1 < 7) {
_local3 = _local7[_local1];
if (_local1 == 6) {
frameVal = Math.floor(frameVal * 3.4140625);
}
if (frameVal >= _local3) {
_local4 = Math.floor(frameVal / _local3);
_local5 = _local5 | (_local4 << _local6[_local1]);
frameVal = frameVal - (_local4 * _local3);
}
_local1++;
}
_local5 = _local5 | (frameVal << _local6[_local1]);
return(_local5);
}
function testVector3() {
}
function TrapGoalLogo_Create(lineZ, ofs_x, ofs_y) {
var _local2 = new Object();
_local2.taskflag = GAME_TASKFLAG_NOHIT;
_local2.exec = trap_goallogo_exec;
_local2.exit = trap_goallogo_exit;
_local2.actno = TRAP_ACTNO_GOAL_LOGO;
_local2.actflag = 0;
_local2.step = 0;
_local2.body_radius = 1.0859375;
_local2.attack_radius = 0;
_local2.hitstop_timer = 0;
lineZ = lineZ - 1;
_local2.pos_line = vec3d_Create(0, SBD_GOAL_OFST_Y, lineZ);
_local2.pos_stage = vec3d_Create(0, 0, 0);
_local2.stageObj = StageSpriteMan_CreateObject(_root.stageSpriteMgr, 0);
_local2.stageObj.baseScale = TRAP_GOAL_LOGO_BASE_SCALE;
_local2.stage_mc = StageSpriteMan_CreateMC(_root.stageSpriteMgr, "GoalAnimation");
_local2.stage_mc.gotoAndPlay("PAT_STRING");
_local2.stage_mc._visible = false;
_local2.user_work = lineZ;
_local2.user_timer = 0;
_local2.floating_y = 0;
trap_goallogo_update_pos(_local2);
return(_local2);
}
function trap_goallogo_exec() {
trap_goallogo_update_pos(this);
if (trap_goallogo_checkFrameout(this)) {
this.taskflag = this.taskflag | GAME_TASKFLAG_KILL;
} else {
StageSpriteMan_AddOrder(_root.stageSpriteMgr, this.stageObj, this.stage_mc);
}
}
function trap_goallogo_exit() {
this.stageObj = null;
this.stage_mc.removeMovieClip();
this.stage_mc = null;
}
function trap_goallogo_update_pos(myTrap) {
myTrap.pos_stage = seqGame_GetStagePos(myTrap.pos_line);
myTrap.stageObj.pos.x = myTrap.pos_stage.x;
myTrap.stageObj.pos.y = myTrap.pos_stage.y;
myTrap.stageObj.pos.z = myTrap.pos_stage.z;
}
function trap_goallogo_checkFrameout(myTrap) {
var _local1 = -3;
if (myTrap.stageObj.pos.z > (-_local1)) {
return(true);
}
return(false);
}
function TrapGoalRing_Create(lineZ, ofs_x, ofs_y) {
var _local2 = new Object();
_local2.taskflag = GAME_TASKFLAG_NOHIT;
_local2.exec = trap_goalring_exec;
_local2.exit = trap_goalring_exit;
_local2.actno = TRAP_ACTNO_GOAL_RING;
_local2.actflag = 0;
_local2.step = 0;
_local2.body_radius = 0;
_local2.attack_radius = 0;
_local2.hitstop_timer = 0;
_local2.pos_line = vec3d_Create(0, SBD_GOAL_OFST_Y, lineZ);
_local2.pos_stage = vec3d_Create(0, 0, 0);
_local2.stageObj = StageSpriteMan_CreateObject(_root.stageSpriteMgr, 0);
_local2.stageObj.baseScale = TRAP_GOAL_RING_BASE_SCALE;
_local2.stage_mc = StageSpriteMan_CreateMC(_root.stageSpriteMgr, "GoalAnimation");
_local2.stage_mc.gotoAndPlay("PAT_RING");
_local2.stage_mc._visible = false;
_local2.stageObj_2 = StageSpriteMan_CreateObject(_root.stageSpriteMgr, 0);
_local2.stageObj_2.baseScale = TRAP_GOAL_RING_BASE_SCALE;
_local2.stage_mc_2 = StageSpriteMan_CreateMC(_root.stageSpriteMgr, "GoalAnimation");
_local2.stage_mc_2.gotoAndPlay("PAT_RING");
_local2.stage_mc_2._alpha = 65;
_local2.stage_mc_2._visible = false;
_local2.stageObj_3 = StageSpriteMan_CreateObject(_root.stageSpriteMgr, 0);
_local2.stageObj_3.baseScale = TRAP_GOAL_RING_BASE_SCALE;
_local2.stage_mc_3 = StageSpriteMan_CreateMC(_root.stageSpriteMgr, "GoalAnimation");
_local2.stage_mc_3.gotoAndPlay("PAT_RING");
_local2.stage_mc_3._alpha = 30;
_local2.stage_mc_3._visible = false;
_local2.user_work = 0;
_local2.user_timer = 0;
_local2.scale_x = 2;
_local2.zoom_angle = 0;
_local2.floating_y = 0;
trap_goalring_update_pos(_local2);
return(_local2);
}
function trap_goalring_exec() {
var _local4;
var _local5;
_local5 = (this.zoom_angle + 0) & 65535;
_local4 = (_local5 * (Math.PI*2)) / 65536;
this.stageObj.baseScale = TRAP_GOAL_RING_BASE_SCALE + (0.5 * Math.sin(_local4));
_local5 = (this.zoom_angle + 16384) & 65535;
_local4 = (_local5 * (Math.PI*2)) / 65536;
this.stageObj_2.baseScale = TRAP_GOAL_RING_BASE_SCALE + (0.5 * Math.sin(_local4));
_local5 = (this.zoom_angle + 32768) & 65535;
_local4 = (_local5 * (Math.PI*2)) / 65536;
this.stageObj_3.baseScale = TRAP_GOAL_RING_BASE_SCALE + (0.5 * Math.sin(_local4));
this.zoom_angle = this.zoom_angle + 1024;
trap_goalring_update_pos(this);
if (mySeq.m_map.pos_line > this.pos_line.z) {
var _local3 = this.scale_x;
_local3 = ObjShiftSet(_local3, 8, 0.5, 1, 0.0625);
if (!this.user_work) {
this.user_work = 1;
_local3 = 1;
}
this.scale_x = _local3;
if (_local3 >= 8) {
this.taskflag = this.taskflag | GAME_TASKFLAG_KILL;
return(undefined);
}
}
if (trap_goalring_checkFrameout(this)) {
this.taskflag = this.taskflag | GAME_TASKFLAG_KILL;
} else {
StageSpriteMan_AddOrder(_root.stageSpriteMgr, this.stageObj, this.stage_mc);
StageSpriteMan_AddOrder(_root.stageSpriteMgr, this.stageObj_2, this.stage_mc_2);
StageSpriteMan_AddOrder(_root.stageSpriteMgr, this.stageObj_3, this.stage_mc_3);
}
}
function trap_goalring_exit() {
this.stageObj = null;
this.stageObj_2 = null;
this.stageObj_3 = null;
this.stage_mc.removeMovieClip();
this.stage_mc = null;
this.stage_mc_2.removeMovieClip();
this.stage_mc_2 = null;
this.stage_mc_3.removeMovieClip();
this.stage_mc_3 = null;
}
function trap_goalring_update_pos(myTrap) {
myTrap.pos_stage = seqGame_GetStagePos(myTrap.pos_line);
myTrap.stageObj.pos.x = myTrap.pos_stage.x;
myTrap.stageObj.pos.y = myTrap.pos_stage.y;
myTrap.stageObj.pos.z = myTrap.pos_stage.z;
myTrap.stageObj_2.pos.x = myTrap.pos_stage.x;
myTrap.stageObj_2.pos.y = myTrap.pos_stage.y;
myTrap.stageObj_2.pos.z = myTrap.pos_stage.z - 0.5;
myTrap.stageObj_3.pos.x = myTrap.pos_stage.x;
myTrap.stageObj_3.pos.y = myTrap.pos_stage.y;
myTrap.stageObj_3.pos.z = myTrap.pos_stage.z - 1;
}
function trap_goalring_checkFrameout(myTrap) {
var _local1 = -3;
if (myTrap.stageObj.pos.z > (-_local1)) {
return(true);
}
return(false);
}
function vec3d_Create(x, y, z) {
return({x:x, y:y, z:z});
}
function vec3d_Clone(v) {
return({x:v.x, y:v.y, z:v.z});
}
function vec3d_Add(a, b) {
return({x:a.x + b.x, y:a.y + b.y, z:a.z + b.z});
}
function vec3d_Subtract(a, b) {
return({x:a.x - b.x, y:a.y - b.y, z:a.z - b.z});
}
function vec3d_Scale(a, v) {
return({x:a * v.x, y:a * v.y, z:a * v.z});
}
function vec3d_DotProduct(a, b) {
return(((a.x * b.x) + (a.y * b.y)) + (a.z * b.z));
}
function vec3d_CrossProduct(a, b) {
return({x:(a.y * b.z) - (a.z * b.y), y:(a.z * b.x) - (a.x * b.z), z:(a.x * b.y) - (a.y * b.x)});
}
function vec3d_Mag(v) {
return(Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z)));
}
function vec3d_Normalize(v) {
var _local2 = Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
if (_local2 > 0) {
_local2 = 1 / _local2;
}
return({x:v.x * _local2, y:v.y * _local2, z:v.z * _local2});
}
function vec3d_MultAdd(a, v1, v2) {
return({x:v2.x + (a * v1.x), y:v2.y + (a * v1.y), z:v2.z + (a * v1.z)});
}
function vec3d_Set(v, x, y, z) {
v.x = x;
v.y = y;
v.z = z;
}
function ObjSpdUpSet(lSpd, sSpd, sMaxSpd) {
lSpd = lSpd + sSpd;
if (sMaxSpd == 0) {
return(lSpd);
}
if (sSpd >= 0) {
if (lSpd > sMaxSpd) {
lSpd = sMaxSpd;
}
} else if (lSpd < (-sMaxSpd)) {
lSpd = -sMaxSpd;
}
return(lSpd);
}
function ObjSpdDownSet(lSpd, sSpd) {
if (lSpd > 0) {
lSpd = lSpd - sSpd;
if (lSpd < 0) {
lSpd = 0;
}
} else {
lSpd = lSpd + sSpd;
if (lSpd > 0) {
lSpd = 0;
}
}
return(lSpd);
}
function ObjShiftSet(lPos, sTag, divStep, usMax, usMin) {
var _local1;
if (lPos == sTag) {
return(lPos);
}
if (usMin == 0) {
usMin = 1;
}
_local1 = (sTag - lPos) * divStep;
if (usMax > 0) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin > 0) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ObjDiffSet(lPos, sTag, sSrc, divStep, usMax, usMin) {
if (lPos == sTag) {
return(lPos);
}
if (!usMin) {
usMin = 1;
}
var _local1;
_local1 = (lPos - sSrc) * divStep;
if (sTag > sSrc) {
if (_local1 < 0) {
_local1 = 0;
}
}
if (sTag < sSrc) {
if (_local1 > 0) {
_local1 = 0;
}
}
if (usMax) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ComputeNumBCDCode(val, valMax) {
if (val >= valMax) {
if (valMax == 0) {
val = 0;
} else {
val = valMax - 1;
}
}
var _local1;
var _local6 = 0;
var _local2 = valMax;
var _local4;
if (_local2 >= 100) {
_local2 = Math.floor(_local2 / 10);
_local1 = 0;
for(;;){
if (val >= _local2) {
_local4 = Math.floor(val / _local2);
_local6 = _local6 | (_local4 << _local1);
val = val - (_local4 * _local2);
}
_local1 = _local1 + 4;
if (_local2 <= 10) {
break;
}
_local2 = Math.floor(_local2 / 10);
};
}
_local6 = _local6 | (val << _local1);
var _local5 = _local1 / 4;
if (_local5 > 7) {
_local5 = 7;
} else if (_local5 < 0) {
_local5 = 0;
}
var _local9 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local8 = 0;
var _local7;
_local1 = 0;
while (_local1 < (_local5 + 1)) {
_local7 = (_local6 >> (4 * _local1)) & 15;
_local8 = _local8 | (_local7 << _local9[(7 - _local5) + _local1]);
_local1++;
}
return(_local8);
}
function ComputeTimeBCDCode(frameVal) {
var _local7 = [1080000, 108000, 18000, 1800, 300, 30, 10, 1];
var _local6 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local1;
var _local5 = 0;
var _local3;
var _local4;
_local1 = 0;
while (_local1 < 7) {
_local3 = _local7[_local1];
if (_local1 == 6) {
frameVal = Math.floor(frameVal * 3.4140625);
}
if (frameVal >= _local3) {
_local4 = Math.floor(frameVal / _local3);
_local5 = _local5 | (_local4 << _local6[_local1]);
frameVal = frameVal - (_local4 * _local3);
}
_local1++;
}
_local5 = _local5 | (frameVal << _local6[_local1]);
return(_local5);
}
function testVector3() {
}
function TrapRing_Create(lineZ, ofs_x, ofs_y) {
var _local2 = new Object();
_local2.taskflag = 0;
_local2.exec = trap_ring_exec;
_local2.exit = trap_ring_exit;
_local2.actno = TRAP_ACTNO_RING;
_local2.actflag = 0;
_local2.step = 0;
_local2.body_radius = SBD_RING_RADIUS;
_local2.attack_radius = 0;
_local2.hitstop_timer = 0;
ofs_y + SBD_RING_Y_OFFSET;
_local2.pos_line = vec3d_Create(ofs_x, ofs_y, lineZ);
_local2.pos_stage = vec3d_Create(0, 0, 0);
_local2.stageObj = StageSpriteMan_CreateObject(_root.stageSpriteMgr, 0);
_local2.stageObj.baseScale = 2;
_local2.stage_mc = StageSpriteMan_CreateMC(_root.stageSpriteMgr, "RingAnimation");
_local2.stage_mc.stop();
_local2.stage_mc._visible = false;
_local2.flag = 0;
_local2.timer = 0;
trap_ring_update_pos(_local2);
return(_local2);
}
function trap_ring_exec() {
this.pos_stage = seqGame_GetStagePos(this.pos_line);
this.stageObj.pos.x = this.pos_stage.x;
this.stageObj.pos.y = this.pos_stage.y;
this.stageObj.pos.z = this.pos_stage.z;
if (!(this.flag & SBD_RING_CLEAR)) {
var _local3 = _root.gameSeq.ring_mc._currentFrame;
this.stage_mc.gotoAndStop(_local3);
}
if (trap_ring_checkFrameout(this)) {
this.taskflag = this.taskflag | GAME_TASKFLAG_KILL;
if (!(this.flag & SBD_RING_CLEAR)) {
_root.gameSeq.m_player.combo_ring++;
}
} else {
StageSpriteMan_AddOrder(_root.stageSpriteMgr, this.stageObj, this.stage_mc);
}
}
function trap_ring_exit() {
this.stageObj = null;
this.stage_mc.removeMovieClip();
this.stage_mc = null;
}
function trap_ring_update_pos(myTrap) {
myTrap.pos_stage = seqGame_GetStagePos(myTrap.pos_line);
myTrap.stageObj.pos.x = myTrap.pos_stage.x;
myTrap.stageObj.pos.y = myTrap.pos_stage.y;
myTrap.stageObj.pos.z = myTrap.pos_stage.z;
}
function trap_ring_checkFrameout(myTrap) {
if (myTrap.flag & SBD_RING_CLEAR) {
myTrap.timer++;
if (myTrap.timer >= SBD_RING_CLEAR_TIME) {
return(true);
}
}
var _local2 = -3;
if (myTrap.stageObj.pos.z > (-_local2)) {
return(true);
}
return(false);
}
function TrapRing_BodyHitCall(myTrap) {
myTrap.taskflag = GAME_TASKFLAG_NOHIT;
myTrap.flag = myTrap.flag | SBD_RING_CLEAR;
myTrap.timer = 0;
myTrap.stage_mc.gotoAndPlay("PAT_CLEAR");
if (!(_root.gameSeq.m_gameflags & SBD_MAIN_RING_SE)) {
_root.stageSoundMgr.PlaySE(SOUND_SE_RING);
_root.gameSeq.m_gameflags = _root.gameSeq.m_gameflags | SBD_MAIN_RING_SE;
}
}
function vec3d_Create(x, y, z) {
return({x:x, y:y, z:z});
}
function vec3d_Clone(v) {
return({x:v.x, y:v.y, z:v.z});
}
function vec3d_Add(a, b) {
return({x:a.x + b.x, y:a.y + b.y, z:a.z + b.z});
}
function vec3d_Subtract(a, b) {
return({x:a.x - b.x, y:a.y - b.y, z:a.z - b.z});
}
function vec3d_Scale(a, v) {
return({x:a * v.x, y:a * v.y, z:a * v.z});
}
function vec3d_DotProduct(a, b) {
return(((a.x * b.x) + (a.y * b.y)) + (a.z * b.z));
}
function vec3d_CrossProduct(a, b) {
return({x:(a.y * b.z) - (a.z * b.y), y:(a.z * b.x) - (a.x * b.z), z:(a.x * b.y) - (a.y * b.x)});
}
function vec3d_Mag(v) {
return(Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z)));
}
function vec3d_Normalize(v) {
var _local2 = Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
if (_local2 > 0) {
_local2 = 1 / _local2;
}
return({x:v.x * _local2, y:v.y * _local2, z:v.z * _local2});
}
function vec3d_MultAdd(a, v1, v2) {
return({x:v2.x + (a * v1.x), y:v2.y + (a * v1.y), z:v2.z + (a * v1.z)});
}
function vec3d_Set(v, x, y, z) {
v.x = x;
v.y = y;
v.z = z;
}
function ObjSpdUpSet(lSpd, sSpd, sMaxSpd) {
lSpd = lSpd + sSpd;
if (sMaxSpd == 0) {
return(lSpd);
}
if (sSpd >= 0) {
if (lSpd > sMaxSpd) {
lSpd = sMaxSpd;
}
} else if (lSpd < (-sMaxSpd)) {
lSpd = -sMaxSpd;
}
return(lSpd);
}
function ObjSpdDownSet(lSpd, sSpd) {
if (lSpd > 0) {
lSpd = lSpd - sSpd;
if (lSpd < 0) {
lSpd = 0;
}
} else {
lSpd = lSpd + sSpd;
if (lSpd > 0) {
lSpd = 0;
}
}
return(lSpd);
}
function ObjShiftSet(lPos, sTag, divStep, usMax, usMin) {
var _local1;
if (lPos == sTag) {
return(lPos);
}
if (usMin == 0) {
usMin = 1;
}
_local1 = (sTag - lPos) * divStep;
if (usMax > 0) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin > 0) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ObjDiffSet(lPos, sTag, sSrc, divStep, usMax, usMin) {
if (lPos == sTag) {
return(lPos);
}
if (!usMin) {
usMin = 1;
}
var _local1;
_local1 = (lPos - sSrc) * divStep;
if (sTag > sSrc) {
if (_local1 < 0) {
_local1 = 0;
}
}
if (sTag < sSrc) {
if (_local1 > 0) {
_local1 = 0;
}
}
if (usMax) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ComputeNumBCDCode(val, valMax) {
if (val >= valMax) {
if (valMax == 0) {
val = 0;
} else {
val = valMax - 1;
}
}
var _local1;
var _local6 = 0;
var _local2 = valMax;
var _local4;
if (_local2 >= 100) {
_local2 = Math.floor(_local2 / 10);
_local1 = 0;
for(;;){
if (val >= _local2) {
_local4 = Math.floor(val / _local2);
_local6 = _local6 | (_local4 << _local1);
val = val - (_local4 * _local2);
}
_local1 = _local1 + 4;
if (_local2 <= 10) {
break;
}
_local2 = Math.floor(_local2 / 10);
};
}
_local6 = _local6 | (val << _local1);
var _local5 = _local1 / 4;
if (_local5 > 7) {
_local5 = 7;
} else if (_local5 < 0) {
_local5 = 0;
}
var _local9 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local8 = 0;
var _local7;
_local1 = 0;
while (_local1 < (_local5 + 1)) {
_local7 = (_local6 >> (4 * _local1)) & 15;
_local8 = _local8 | (_local7 << _local9[(7 - _local5) + _local1]);
_local1++;
}
return(_local8);
}
function ComputeTimeBCDCode(frameVal) {
var _local7 = [1080000, 108000, 18000, 1800, 300, 30, 10, 1];
var _local6 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local1;
var _local5 = 0;
var _local3;
var _local4;
_local1 = 0;
while (_local1 < 7) {
_local3 = _local7[_local1];
if (_local1 == 6) {
frameVal = Math.floor(frameVal * 3.4140625);
}
if (frameVal >= _local3) {
_local4 = Math.floor(frameVal / _local3);
_local5 = _local5 | (_local4 << _local6[_local1]);
frameVal = frameVal - (_local4 * _local3);
}
_local1++;
}
_local5 = _local5 | (frameVal << _local6[_local1]);
return(_local5);
}
function testVector3() {
}
function TrapRock_Create(lineZ, ofs_x, ofs_y, acttype) {
var _local2 = new Object();
_local2.taskflag = 0;
_local2.exec = trap_rock_exec;
_local2.exit = trap_rock_exit;
_local2.actno = TRAP_ACTNO_ROCK;
_local2.actflag = 0;
_local2.step = 0;
_local2.body_radius = SBD_STONE_JET_RADIUS;
_local2.attack_radius = 0;
_local2.hitstop_timer = 0;
_local2.pos_line = vec3d_Create(ofs_x, ofs_y, lineZ);
_local2.pos_stage = vec3d_Create(0, 0, 0);
_local2.stageObj = StageSpriteMan_CreateObject(_root.stageSpriteMgr, 0);
_local2.stageObj.baseScale = TRAP_ROCK_BASE_SCALE;
_local2.stage_mc = StageSpriteMan_CreateMC(_root.stageSpriteMgr, "IslandAnimation");
if (acttype == 0) {
_local2.stage_mc.gotoAndPlay("PAT_ISLAND_00");
} else {
_local2.stage_mc.gotoAndPlay("PAT_ISLAND_01");
}
_local2.stage_mc._visible = false;
trap_rock_update_pos(_local2);
return(_local2);
}
function trap_rock_exec() {
this.pos_stage = seqGame_GetStagePos(this.pos_line);
this.stageObj.pos.x = this.pos_stage.x;
this.stageObj.pos.y = this.pos_stage.y;
this.stageObj.pos.z = this.pos_stage.z;
if (trap_rock_checkFrameout(this)) {
this.taskflag = this.taskflag | GAME_TASKFLAG_KILL;
} else {
StageSpriteMan_AddOrder(_root.stageSpriteMgr, this.stageObj, this.stage_mc);
}
}
function trap_rock_exit() {
this.stageObj = null;
this.stage_mc.removeMovieClip();
this.stage_mc = null;
}
function trap_rock_update_pos(myTrap) {
myTrap.pos_stage = seqGame_GetStagePos(myTrap.pos_line);
myTrap.stageObj.pos.x = myTrap.pos_stage.x;
myTrap.stageObj.pos.y = myTrap.pos_stage.y;
myTrap.stageObj.pos.z = myTrap.pos_stage.z;
}
function trap_rock_checkFrameout(myTrap) {
var _local1 = -3;
if (myTrap.stageObj.pos.z > (-_local1)) {
return(true);
}
return(false);
}
function vec3d_Create(x, y, z) {
return({x:x, y:y, z:z});
}
function vec3d_Clone(v) {
return({x:v.x, y:v.y, z:v.z});
}
function vec3d_Add(a, b) {
return({x:a.x + b.x, y:a.y + b.y, z:a.z + b.z});
}
function vec3d_Subtract(a, b) {
return({x:a.x - b.x, y:a.y - b.y, z:a.z - b.z});
}
function vec3d_Scale(a, v) {
return({x:a * v.x, y:a * v.y, z:a * v.z});
}
function vec3d_DotProduct(a, b) {
return(((a.x * b.x) + (a.y * b.y)) + (a.z * b.z));
}
function vec3d_CrossProduct(a, b) {
return({x:(a.y * b.z) - (a.z * b.y), y:(a.z * b.x) - (a.x * b.z), z:(a.x * b.y) - (a.y * b.x)});
}
function vec3d_Mag(v) {
return(Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z)));
}
function vec3d_Normalize(v) {
var _local2 = Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
if (_local2 > 0) {
_local2 = 1 / _local2;
}
return({x:v.x * _local2, y:v.y * _local2, z:v.z * _local2});
}
function vec3d_MultAdd(a, v1, v2) {
return({x:v2.x + (a * v1.x), y:v2.y + (a * v1.y), z:v2.z + (a * v1.z)});
}
function vec3d_Set(v, x, y, z) {
v.x = x;
v.y = y;
v.z = z;
}
function ObjSpdUpSet(lSpd, sSpd, sMaxSpd) {
lSpd = lSpd + sSpd;
if (sMaxSpd == 0) {
return(lSpd);
}
if (sSpd >= 0) {
if (lSpd > sMaxSpd) {
lSpd = sMaxSpd;
}
} else if (lSpd < (-sMaxSpd)) {
lSpd = -sMaxSpd;
}
return(lSpd);
}
function ObjSpdDownSet(lSpd, sSpd) {
if (lSpd > 0) {
lSpd = lSpd - sSpd;
if (lSpd < 0) {
lSpd = 0;
}
} else {
lSpd = lSpd + sSpd;
if (lSpd > 0) {
lSpd = 0;
}
}
return(lSpd);
}
function ObjShiftSet(lPos, sTag, divStep, usMax, usMin) {
var _local1;
if (lPos == sTag) {
return(lPos);
}
if (usMin == 0) {
usMin = 1;
}
_local1 = (sTag - lPos) * divStep;
if (usMax > 0) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin > 0) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ObjDiffSet(lPos, sTag, sSrc, divStep, usMax, usMin) {
if (lPos == sTag) {
return(lPos);
}
if (!usMin) {
usMin = 1;
}
var _local1;
_local1 = (lPos - sSrc) * divStep;
if (sTag > sSrc) {
if (_local1 < 0) {
_local1 = 0;
}
}
if (sTag < sSrc) {
if (_local1 > 0) {
_local1 = 0;
}
}
if (usMax) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ComputeNumBCDCode(val, valMax) {
if (val >= valMax) {
if (valMax == 0) {
val = 0;
} else {
val = valMax - 1;
}
}
var _local1;
var _local6 = 0;
var _local2 = valMax;
var _local4;
if (_local2 >= 100) {
_local2 = Math.floor(_local2 / 10);
_local1 = 0;
for(;;){
if (val >= _local2) {
_local4 = Math.floor(val / _local2);
_local6 = _local6 | (_local4 << _local1);
val = val - (_local4 * _local2);
}
_local1 = _local1 + 4;
if (_local2 <= 10) {
break;
}
_local2 = Math.floor(_local2 / 10);
};
}
_local6 = _local6 | (val << _local1);
var _local5 = _local1 / 4;
if (_local5 > 7) {
_local5 = 7;
} else if (_local5 < 0) {
_local5 = 0;
}
var _local9 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local8 = 0;
var _local7;
_local1 = 0;
while (_local1 < (_local5 + 1)) {
_local7 = (_local6 >> (4 * _local1)) & 15;
_local8 = _local8 | (_local7 << _local9[(7 - _local5) + _local1]);
_local1++;
}
return(_local8);
}
function ComputeTimeBCDCode(frameVal) {
var _local7 = [1080000, 108000, 18000, 1800, 300, 30, 10, 1];
var _local6 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local1;
var _local5 = 0;
var _local3;
var _local4;
_local1 = 0;
while (_local1 < 7) {
_local3 = _local7[_local1];
if (_local1 == 6) {
frameVal = Math.floor(frameVal * 3.4140625);
}
if (frameVal >= _local3) {
_local4 = Math.floor(frameVal / _local3);
_local5 = _local5 | (_local4 << _local6[_local1]);
frameVal = frameVal - (_local4 * _local3);
}
_local1++;
}
_local5 = _local5 | (frameVal << _local6[_local1]);
return(_local5);
}
function testVector3() {
}
function TrapMine_Create(lineZ, ofs_x, ofs_y, acttype) {
var _local2 = new Object();
_local2.taskflag = GAME_TASKFLAG_HIT_BRK;
_local2.exec = trap_mine_exec;
_local2.exit = trap_mine_exit;
_local2.actno = TRAP_ACTNO_MINE;
_local2.actflag = 0;
_local2.step = 0;
_local2.body_radius = SBD_MINE_RADIUS;
_local2.attack_radius = 0;
_local2.hitstop_timer = 0;
_local2.pos_line = vec3d_Create(ofs_x, ofs_y, lineZ);
_local2.pos_stage = vec3d_Create(0, 0, 0);
_local2.stageObj = StageSpriteMan_CreateObject(_root.stageSpriteMgr, 0);
_local2.stageObj.baseScale = 3;
_local2.stage_mc = StageSpriteMan_CreateMC(_root.stageSpriteMgr, "MineAnimation");
_local2.stage_mc._visible = false;
_local2.user_timer = 0;
_local2.spd_x = (_local2.spd_y = (_local2.spd_z = 0));
trap_mine_update_pos(_local2);
return(_local2);
}
function trap_mine_exec() {
if (this.hitstop_timer) {
this.hitstop_timer--;
StageSpriteMan_AddOrder(_root.stageSpriteMgr, this.stageObj, this.stage_mc);
return(undefined);
}
if (this.taskflag & GAME_TASKFLAG_COLLIDE) {
_root.gameSeq.MakeEffect3d(this.pos_stage.x, this.pos_stage.y, this.pos_stage.z, TRAP_ACTNO_BOM, 0);
_root.stageSoundMgr.PlaySE(SOUND_SE_EXPLOSION);
this.taskflag = this.taskflag | GAME_TASKFLAG_KILL;
return(undefined);
}
this.pos_stage = seqGame_GetStagePos(this.pos_line);
this.stageObj.pos.x = this.pos_stage.x;
this.stageObj.pos.y = this.pos_stage.y;
this.stageObj.pos.z = this.pos_stage.z;
if (trap_mine_checkFrameout(this)) {
this.taskflag = this.taskflag | GAME_TASKFLAG_KILL;
} else {
StageSpriteMan_AddOrder(_root.stageSpriteMgr, this.stageObj, this.stage_mc);
}
}
function trap_mine_die_exec() {
if (this.hitstop_timer) {
this.hitstop_timer--;
StageSpriteMan_AddOrder(_root.stageSpriteMgr, this.stageObj, this.stage_mc);
return(undefined);
}
this.pos_stage.x = this.pos_stage.x + this.spd_x;
this.pos_stage.y = this.pos_stage.y + this.spd_y;
this.pos_stage.z = this.pos_stage.z + this.spd_z;
this.stageObj.pos.x = this.pos_stage.x;
this.stageObj.pos.y = this.pos_stage.y;
this.stageObj.pos.z = this.pos_stage.z;
if ((++this.user_timer) > SBD_BREAK_TIME) {
this.taskflag = this.taskflag | GAME_TASKFLAG_KILL;
} else {
StageSpriteMan_AddOrder(_root.stageSpriteMgr, this.stageObj, this.stage_mc);
}
}
function trap_mine_exit() {
this.stageObj = null;
this.stage_mc.removeMovieClip();
this.stage_mc = null;
}
function trap_mine_update_pos(myTrap) {
myTrap.pos_stage = seqGame_GetStagePos(myTrap.pos_line);
myTrap.stageObj.pos.x = myTrap.pos_stage.x;
myTrap.stageObj.pos.y = myTrap.pos_stage.y;
myTrap.stageObj.pos.z = myTrap.pos_stage.z;
}
function trap_mine_checkFrameout(myTrap) {
var _local1 = -3;
if (myTrap.stageObj.pos.z > (-_local1)) {
return(true);
}
return(false);
}
function TrapMine_AttackHitCall(myTrap) {
trap_mine_die_init(myTrap);
}
function trap_mine_die_init(myTrap) {
var _local3 = -(_root.gameSeq.m_player.spd + SBD_BREAK_SPD);
var _local5 = (512 - Math.floor(Math.random() * 1023)) & 65535;
var _local4 = (_local5 * (Math.PI*2)) / 65536;
myTrap.spd_x = _local3 * Math.sin(_local4);
myTrap.spd_z = _local3 * Math.cos(_local4);
myTrap.spd_y = (512 + Math.floor(Math.random() * 511)) / 4096;
myTrap.exec = trap_mine_die_exec;
myTrap.taskflag = myTrap.taskflag | GAME_TASKFLAG_NOHIT;
myTrap.user_timer = 0;
_root.stageSoundMgr.PlaySE(SOUND_SE_SPLASH);
}
function vec3d_Create(x, y, z) {
return({x:x, y:y, z:z});
}
function vec3d_Clone(v) {
return({x:v.x, y:v.y, z:v.z});
}
function vec3d_Add(a, b) {
return({x:a.x + b.x, y:a.y + b.y, z:a.z + b.z});
}
function vec3d_Subtract(a, b) {
return({x:a.x - b.x, y:a.y - b.y, z:a.z - b.z});
}
function vec3d_Scale(a, v) {
return({x:a * v.x, y:a * v.y, z:a * v.z});
}
function vec3d_DotProduct(a, b) {
return(((a.x * b.x) + (a.y * b.y)) + (a.z * b.z));
}
function vec3d_CrossProduct(a, b) {
return({x:(a.y * b.z) - (a.z * b.y), y:(a.z * b.x) - (a.x * b.z), z:(a.x * b.y) - (a.y * b.x)});
}
function vec3d_Mag(v) {
return(Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z)));
}
function vec3d_Normalize(v) {
var _local2 = Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
if (_local2 > 0) {
_local2 = 1 / _local2;
}
return({x:v.x * _local2, y:v.y * _local2, z:v.z * _local2});
}
function vec3d_MultAdd(a, v1, v2) {
return({x:v2.x + (a * v1.x), y:v2.y + (a * v1.y), z:v2.z + (a * v1.z)});
}
function vec3d_Set(v, x, y, z) {
v.x = x;
v.y = y;
v.z = z;
}
function ObjSpdUpSet(lSpd, sSpd, sMaxSpd) {
lSpd = lSpd + sSpd;
if (sMaxSpd == 0) {
return(lSpd);
}
if (sSpd >= 0) {
if (lSpd > sMaxSpd) {
lSpd = sMaxSpd;
}
} else if (lSpd < (-sMaxSpd)) {
lSpd = -sMaxSpd;
}
return(lSpd);
}
function ObjSpdDownSet(lSpd, sSpd) {
if (lSpd > 0) {
lSpd = lSpd - sSpd;
if (lSpd < 0) {
lSpd = 0;
}
} else {
lSpd = lSpd + sSpd;
if (lSpd > 0) {
lSpd = 0;
}
}
return(lSpd);
}
function ObjShiftSet(lPos, sTag, divStep, usMax, usMin) {
var _local1;
if (lPos == sTag) {
return(lPos);
}
if (usMin == 0) {
usMin = 1;
}
_local1 = (sTag - lPos) * divStep;
if (usMax > 0) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin > 0) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ObjDiffSet(lPos, sTag, sSrc, divStep, usMax, usMin) {
if (lPos == sTag) {
return(lPos);
}
if (!usMin) {
usMin = 1;
}
var _local1;
_local1 = (lPos - sSrc) * divStep;
if (sTag > sSrc) {
if (_local1 < 0) {
_local1 = 0;
}
}
if (sTag < sSrc) {
if (_local1 > 0) {
_local1 = 0;
}
}
if (usMax) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ComputeNumBCDCode(val, valMax) {
if (val >= valMax) {
if (valMax == 0) {
val = 0;
} else {
val = valMax - 1;
}
}
var _local1;
var _local6 = 0;
var _local2 = valMax;
var _local4;
if (_local2 >= 100) {
_local2 = Math.floor(_local2 / 10);
_local1 = 0;
for(;;){
if (val >= _local2) {
_local4 = Math.floor(val / _local2);
_local6 = _local6 | (_local4 << _local1);
val = val - (_local4 * _local2);
}
_local1 = _local1 + 4;
if (_local2 <= 10) {
break;
}
_local2 = Math.floor(_local2 / 10);
};
}
_local6 = _local6 | (val << _local1);
var _local5 = _local1 / 4;
if (_local5 > 7) {
_local5 = 7;
} else if (_local5 < 0) {
_local5 = 0;
}
var _local9 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local8 = 0;
var _local7;
_local1 = 0;
while (_local1 < (_local5 + 1)) {
_local7 = (_local6 >> (4 * _local1)) & 15;
_local8 = _local8 | (_local7 << _local9[(7 - _local5) + _local1]);
_local1++;
}
return(_local8);
}
function ComputeTimeBCDCode(frameVal) {
var _local7 = [1080000, 108000, 18000, 1800, 300, 30, 10, 1];
var _local6 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local1;
var _local5 = 0;
var _local3;
var _local4;
_local1 = 0;
while (_local1 < 7) {
_local3 = _local7[_local1];
if (_local1 == 6) {
frameVal = Math.floor(frameVal * 3.4140625);
}
if (frameVal >= _local3) {
_local4 = Math.floor(frameVal / _local3);
_local5 = _local5 | (_local4 << _local6[_local1]);
frameVal = frameVal - (_local4 * _local3);
}
_local1++;
}
_local5 = _local5 | (frameVal << _local6[_local1]);
return(_local5);
}
function testVector3() {
}
function TrapJump_Create(lineZ, ofs_x, ofs_y, acttype) {
var _local3 = [0, 2, 0, 0, 2, 2, 1, 7, 3, 9, 3, 9, 0, 0, 0, 2];
var _local2 = new Object();
_local2.taskflag = 0;
_local2.exec = trap_jump_exec;
_local2.exit = trap_jump_exit;
_local2.actno = TRAP_ACTNO_JUMP;
_local2.actflag = 0;
_local2.step = 0;
_local2.body_radius = SBD_JUMP_RADIUS;
_local2.attack_radius = 0;
_local2.hitstop_timer = 0;
_local2.pos_line = vec3d_Create(ofs_x, ofs_y, lineZ);
_local2.pos_stage = vec3d_Create(0, 0, 0);
_local2.stageObj = StageSpriteMan_CreateObject(_root.stageSpriteMgr, 0);
_local2.stageObj.baseScale = TRAP_JUMP_BASE_SCALE;
_local2.stage_mc = StageSpriteMan_CreateMC(_root.stageSpriteMgr, "JumpAnimation");
_local2.stage_mc._visible = false;
_local2.stageObj_sign = StageSpriteMan_CreateObject(_root.stageSpriteMgr, 0);
_local2.stageObj_sign.baseScale = TRAP_JUMP_SIGN_BASE_SCALE;
_local2.stage_sign_mc = StageSpriteMan_CreateMC(_root.stageSpriteMgr, "JumpSignAnimation");
var _local4 = "PAT_0" + _local3[acttype].toString();
_local2.stage_sign_mc.gotoAndPlay(_local4);
_local2.stage_sign_mc._visible = false;
_local2.trick_type = acttype;
_local2.user_timer = 0;
_local2.sign_spd_y = 0;
_local2.sign_ofs_y = 0;
trap_jump_update_pos(_local2);
return(_local2);
}
function trap_jump_exec() {
trap_jump_update_pos(this);
if (trap_jump_checkFrameout(this)) {
this.taskflag = this.taskflag | GAME_TASKFLAG_KILL;
} else {
StageSpriteMan_AddOrder(_root.stageSpriteMgr, this.stageObj, this.stage_mc);
StageSpriteMan_AddOrder(_root.stageSpriteMgr, this.stageObj_sign, this.stage_sign_mc);
}
}
function trap_jump_exit() {
this.stageObj = null;
this.stage_mc.removeMovieClip();
this.stage_mc = null;
this.stage_sign_mc.removeMovieClip();
this.stage_sign_mc = null;
}
function trap_jump_update_pos(myTrap) {
myTrap.pos_stage = seqGame_GetStagePos(myTrap.pos_line);
myTrap.stageObj.pos.x = myTrap.pos_stage.x;
myTrap.stageObj.pos.y = myTrap.pos_stage.y;
myTrap.stageObj.pos.z = myTrap.pos_stage.z;
var _local3 = [128, 256, 128, 32, -128, -256, -128, -32];
var _local2 = 0;
myTrap.sign_spd_y = myTrap.sign_spd_y + _local3[(myTrap.user_timer >> 2) & 7];
_local2 = myTrap.sign_spd_y / 4096;
myTrap.user_timer++;
myTrap.stageObj_sign.pos.x = myTrap.stageObj.pos.x;
myTrap.stageObj_sign.pos.y = (myTrap.stageObj.pos.y + SBD_JET_JUMP_MARK_OFST_Y) + _local2;
myTrap.stageObj_sign.pos.z = myTrap.stageObj.pos.z;
}
function trap_jump_checkFrameout(myTrap) {
var _local1 = -3;
if (myTrap.stageObj.pos.z > (-_local1)) {
return(true);
}
return(false);
}
function vec3d_Create(x, y, z) {
return({x:x, y:y, z:z});
}
function vec3d_Clone(v) {
return({x:v.x, y:v.y, z:v.z});
}
function vec3d_Add(a, b) {
return({x:a.x + b.x, y:a.y + b.y, z:a.z + b.z});
}
function vec3d_Subtract(a, b) {
return({x:a.x - b.x, y:a.y - b.y, z:a.z - b.z});
}
function vec3d_Scale(a, v) {
return({x:a * v.x, y:a * v.y, z:a * v.z});
}
function vec3d_DotProduct(a, b) {
return(((a.x * b.x) + (a.y * b.y)) + (a.z * b.z));
}
function vec3d_CrossProduct(a, b) {
return({x:(a.y * b.z) - (a.z * b.y), y:(a.z * b.x) - (a.x * b.z), z:(a.x * b.y) - (a.y * b.x)});
}
function vec3d_Mag(v) {
return(Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z)));
}
function vec3d_Normalize(v) {
var _local2 = Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
if (_local2 > 0) {
_local2 = 1 / _local2;
}
return({x:v.x * _local2, y:v.y * _local2, z:v.z * _local2});
}
function vec3d_MultAdd(a, v1, v2) {
return({x:v2.x + (a * v1.x), y:v2.y + (a * v1.y), z:v2.z + (a * v1.z)});
}
function vec3d_Set(v, x, y, z) {
v.x = x;
v.y = y;
v.z = z;
}
function ObjSpdUpSet(lSpd, sSpd, sMaxSpd) {
lSpd = lSpd + sSpd;
if (sMaxSpd == 0) {
return(lSpd);
}
if (sSpd >= 0) {
if (lSpd > sMaxSpd) {
lSpd = sMaxSpd;
}
} else if (lSpd < (-sMaxSpd)) {
lSpd = -sMaxSpd;
}
return(lSpd);
}
function ObjSpdDownSet(lSpd, sSpd) {
if (lSpd > 0) {
lSpd = lSpd - sSpd;
if (lSpd < 0) {
lSpd = 0;
}
} else {
lSpd = lSpd + sSpd;
if (lSpd > 0) {
lSpd = 0;
}
}
return(lSpd);
}
function ObjShiftSet(lPos, sTag, divStep, usMax, usMin) {
var _local1;
if (lPos == sTag) {
return(lPos);
}
if (usMin == 0) {
usMin = 1;
}
_local1 = (sTag - lPos) * divStep;
if (usMax > 0) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin > 0) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ObjDiffSet(lPos, sTag, sSrc, divStep, usMax, usMin) {
if (lPos == sTag) {
return(lPos);
}
if (!usMin) {
usMin = 1;
}
var _local1;
_local1 = (lPos - sSrc) * divStep;
if (sTag > sSrc) {
if (_local1 < 0) {
_local1 = 0;
}
}
if (sTag < sSrc) {
if (_local1 > 0) {
_local1 = 0;
}
}
if (usMax) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ComputeNumBCDCode(val, valMax) {
if (val >= valMax) {
if (valMax == 0) {
val = 0;
} else {
val = valMax - 1;
}
}
var _local1;
var _local6 = 0;
var _local2 = valMax;
var _local4;
if (_local2 >= 100) {
_local2 = Math.floor(_local2 / 10);
_local1 = 0;
for(;;){
if (val >= _local2) {
_local4 = Math.floor(val / _local2);
_local6 = _local6 | (_local4 << _local1);
val = val - (_local4 * _local2);
}
_local1 = _local1 + 4;
if (_local2 <= 10) {
break;
}
_local2 = Math.floor(_local2 / 10);
};
}
_local6 = _local6 | (val << _local1);
var _local5 = _local1 / 4;
if (_local5 > 7) {
_local5 = 7;
} else if (_local5 < 0) {
_local5 = 0;
}
var _local9 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local8 = 0;
var _local7;
_local1 = 0;
while (_local1 < (_local5 + 1)) {
_local7 = (_local6 >> (4 * _local1)) & 15;
_local8 = _local8 | (_local7 << _local9[(7 - _local5) + _local1]);
_local1++;
}
return(_local8);
}
function ComputeTimeBCDCode(frameVal) {
var _local7 = [1080000, 108000, 18000, 1800, 300, 30, 10, 1];
var _local6 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local1;
var _local5 = 0;
var _local3;
var _local4;
_local1 = 0;
while (_local1 < 7) {
_local3 = _local7[_local1];
if (_local1 == 6) {
frameVal = Math.floor(frameVal * 3.4140625);
}
if (frameVal >= _local3) {
_local4 = Math.floor(frameVal / _local3);
_local5 = _local5 | (_local4 << _local6[_local1]);
frameVal = frameVal - (_local4 * _local3);
}
_local1++;
}
_local5 = _local5 | (frameVal << _local6[_local1]);
return(_local5);
}
function testVector3() {
}
function TrapShark_Create(lineZ, ofs_x, ofs_y, acttype) {
var _local2 = new Object();
_local2.taskflag = GAME_TASKFLAG_HIT_BRK;
_local2.exec = trap_shark_exec;
_local2.exit = trap_shark_exit;
_local2.actno = TRAP_ACTNO_SHARK;
_local2.actflag = 0;
_local2.step = 0;
_local2.body_radius = SBD_SHARK_RADIUS;
_local2.attack_radius = 0;
_local2.hitstop_timer = 0;
_local2.pos_line = vec3d_Create(ofs_x, ofs_y, lineZ);
_local2.pos_line.y = _local2.pos_line.y + SBD_SHARK_HEIGHT;
_local2.pos_stage = vec3d_Create(0, 0, 0);
_local2.stageObj = StageSpriteMan_CreateObject(_root.stageSpriteMgr, STAGESPRITE_TYPE_SHARK);
_local2.stageObj.baseScale = 0.85;
_local2.stage_mc = StageSpriteMan_CreateMC(_root.stageSpriteMgr, "SharkAnimation");
_local2.stage_mc._visible = false;
_local2.spd_line = -(SBD_SHARK_SPD + (0 * SBD_SHARK_SPD_MUL));
_local2.user_timer = 0;
_local2.spd_x = (_local2.spd_y = (_local2.spd_z = 0));
trap_shark_update_pos(_local2);
return(_local2);
}
function trap_shark_exec() {
if (this.hitstop_timer) {
this.hitstop_timer--;
StageSpriteMan_AddOrder(_root.stageSpriteMgr, this.stageObj, this.stage_mc);
return(undefined);
}
if (this.taskflag & GAME_TASKFLAG_COLLIDE) {
}
this.pos_line.z = this.pos_line.z + this.spd_line;
this.pos_stage = seqGame_GetStagePos(this.pos_line);
var _local4 = [128, 256, 128, 32, -128, -256, -128, -32];
var _local3 = 0;
this.spd_y = this.spd_y + _local4[(this.user_timer >> 2) & 7];
_local3 = this.spd_y / 4096;
this.user_timer++;
this.pos_stage.y = this.pos_stage.y + _local3;
this.stageObj.pos.x = this.pos_stage.x;
this.stageObj.pos.y = this.pos_stage.y;
this.stageObj.pos.z = this.pos_stage.z;
if (trap_shark_checkFrameout(this)) {
this.taskflag = this.taskflag | GAME_TASKFLAG_KILL;
} else {
StageSpriteMan_AddOrder(_root.stageSpriteMgr, this.stageObj, this.stage_mc);
}
}
function trap_shark_die_exec() {
if (this.hitstop_timer) {
this.hitstop_timer--;
StageSpriteMan_AddOrder(_root.stageSpriteMgr, this.stageObj, this.stage_mc);
return(undefined);
}
this.pos_stage.x = this.pos_stage.x + this.spd_x;
this.pos_stage.y = this.pos_stage.y + this.spd_y;
this.pos_stage.z = this.pos_stage.z + this.spd_z;
this.stageObj.pos.x = this.pos_stage.x;
this.stageObj.pos.y = this.pos_stage.y;
this.stageObj.pos.z = this.pos_stage.z;
if ((++this.user_timer) > SBD_BREAK_TIME) {
this.taskflag = this.taskflag | GAME_TASKFLAG_KILL;
} else {
StageSpriteMan_AddOrder(_root.stageSpriteMgr, this.stageObj, this.stage_mc);
}
}
function trap_shark_exit() {
this.stageObj = null;
this.stage_mc.removeMovieClip();
this.stage_mc = null;
}
function trap_shark_update_pos(myTrap) {
myTrap.pos_stage = seqGame_GetStagePos(myTrap.pos_line);
myTrap.stageObj.pos.x = myTrap.pos_stage.x;
myTrap.stageObj.pos.y = myTrap.pos_stage.y;
myTrap.stageObj.pos.z = myTrap.pos_stage.z;
}
function trap_shark_checkFrameout(myTrap) {
var _local1 = -3;
if (myTrap.stageObj.pos.z > (-_local1)) {
return(true);
}
return(false);
}
function TrapShark_AttackHitCall(myTrap) {
trap_shark_die_init(myTrap);
}
function trap_shark_die_init(myTrap) {
var _local3 = -(_root.gameSeq.m_player.spd + SBD_BREAK_SPD);
var _local5 = (512 - Math.floor(Math.random() * 1023)) & 65535;
var _local4 = (_local5 * (Math.PI*2)) / 65536;
myTrap.spd_x = _local3 * Math.sin(_local4);
myTrap.spd_z = _local3 * Math.cos(_local4);
myTrap.spd_y = (512 + Math.floor(Math.random() * 511)) / 4096;
myTrap.exec = trap_shark_die_exec;
myTrap.taskflag = myTrap.taskflag | GAME_TASKFLAG_NOHIT;
myTrap.user_timer = 0;
myTrap.stage_mc.gotoAndPlay("PAT_CRASH");
_root.stageSoundMgr.PlaySE(SOUND_SE_SPLASH);
}
function vec3d_Create(x, y, z) {
return({x:x, y:y, z:z});
}
function vec3d_Clone(v) {
return({x:v.x, y:v.y, z:v.z});
}
function vec3d_Add(a, b) {
return({x:a.x + b.x, y:a.y + b.y, z:a.z + b.z});
}
function vec3d_Subtract(a, b) {
return({x:a.x - b.x, y:a.y - b.y, z:a.z - b.z});
}
function vec3d_Scale(a, v) {
return({x:a * v.x, y:a * v.y, z:a * v.z});
}
function vec3d_DotProduct(a, b) {
return(((a.x * b.x) + (a.y * b.y)) + (a.z * b.z));
}
function vec3d_CrossProduct(a, b) {
return({x:(a.y * b.z) - (a.z * b.y), y:(a.z * b.x) - (a.x * b.z), z:(a.x * b.y) - (a.y * b.x)});
}
function vec3d_Mag(v) {
return(Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z)));
}
function vec3d_Normalize(v) {
var _local2 = Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
if (_local2 > 0) {
_local2 = 1 / _local2;
}
return({x:v.x * _local2, y:v.y * _local2, z:v.z * _local2});
}
function vec3d_MultAdd(a, v1, v2) {
return({x:v2.x + (a * v1.x), y:v2.y + (a * v1.y), z:v2.z + (a * v1.z)});
}
function vec3d_Set(v, x, y, z) {
v.x = x;
v.y = y;
v.z = z;
}
function ObjSpdUpSet(lSpd, sSpd, sMaxSpd) {
lSpd = lSpd + sSpd;
if (sMaxSpd == 0) {
return(lSpd);
}
if (sSpd >= 0) {
if (lSpd > sMaxSpd) {
lSpd = sMaxSpd;
}
} else if (lSpd < (-sMaxSpd)) {
lSpd = -sMaxSpd;
}
return(lSpd);
}
function ObjSpdDownSet(lSpd, sSpd) {
if (lSpd > 0) {
lSpd = lSpd - sSpd;
if (lSpd < 0) {
lSpd = 0;
}
} else {
lSpd = lSpd + sSpd;
if (lSpd > 0) {
lSpd = 0;
}
}
return(lSpd);
}
function ObjShiftSet(lPos, sTag, divStep, usMax, usMin) {
var _local1;
if (lPos == sTag) {
return(lPos);
}
if (usMin == 0) {
usMin = 1;
}
_local1 = (sTag - lPos) * divStep;
if (usMax > 0) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin > 0) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ObjDiffSet(lPos, sTag, sSrc, divStep, usMax, usMin) {
if (lPos == sTag) {
return(lPos);
}
if (!usMin) {
usMin = 1;
}
var _local1;
_local1 = (lPos - sSrc) * divStep;
if (sTag > sSrc) {
if (_local1 < 0) {
_local1 = 0;
}
}
if (sTag < sSrc) {
if (_local1 > 0) {
_local1 = 0;
}
}
if (usMax) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ComputeNumBCDCode(val, valMax) {
if (val >= valMax) {
if (valMax == 0) {
val = 0;
} else {
val = valMax - 1;
}
}
var _local1;
var _local6 = 0;
var _local2 = valMax;
var _local4;
if (_local2 >= 100) {
_local2 = Math.floor(_local2 / 10);
_local1 = 0;
for(;;){
if (val >= _local2) {
_local4 = Math.floor(val / _local2);
_local6 = _local6 | (_local4 << _local1);
val = val - (_local4 * _local2);
}
_local1 = _local1 + 4;
if (_local2 <= 10) {
break;
}
_local2 = Math.floor(_local2 / 10);
};
}
_local6 = _local6 | (val << _local1);
var _local5 = _local1 / 4;
if (_local5 > 7) {
_local5 = 7;
} else if (_local5 < 0) {
_local5 = 0;
}
var _local9 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local8 = 0;
var _local7;
_local1 = 0;
while (_local1 < (_local5 + 1)) {
_local7 = (_local6 >> (4 * _local1)) & 15;
_local8 = _local8 | (_local7 << _local9[(7 - _local5) + _local1]);
_local1++;
}
return(_local8);
}
function ComputeTimeBCDCode(frameVal) {
var _local7 = [1080000, 108000, 18000, 1800, 300, 30, 10, 1];
var _local6 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local1;
var _local5 = 0;
var _local3;
var _local4;
_local1 = 0;
while (_local1 < 7) {
_local3 = _local7[_local1];
if (_local1 == 6) {
frameVal = Math.floor(frameVal * 3.4140625);
}
if (frameVal >= _local3) {
_local4 = Math.floor(frameVal / _local3);
_local5 = _local5 | (_local4 << _local6[_local1]);
frameVal = frameVal - (_local4 * _local3);
}
_local1++;
}
_local5 = _local5 | (frameVal << _local6[_local1]);
return(_local5);
}
function testVector3() {
}
function TrapBird_Create(lineZ, ofs_x, ofs_y, acttype) {
var _local2 = new Object();
_local2.taskflag = GAME_TASKFLAG_HIT_BRK;
_local2.exec = trap_bird_exec;
_local2.exit = trap_bird_exit;
_local2.actno = TRAP_ACTNO_BIRD;
_local2.actflag = 0;
_local2.step = 0;
_local2.body_radius = SBD_BIRD_RADIUS;
_local2.attack_radius = 0;
_local2.hitstop_timer = 0;
_local2.pos_line = vec3d_Create(ofs_x, ofs_y, lineZ);
_local2.pos_line.y = _local2.pos_line.y + SBD_BIRD_HEIGHT;
_local2.pos_stage = vec3d_Create(0, 0, 0);
_local2.stageObj = StageSpriteMan_CreateObject(_root.stageSpriteMgr, STAGESPRITE_TYPE_SHARK);
_local2.stageObj.baseScale = 1.5;
_local2.stage_mc = StageSpriteMan_CreateMC(_root.stageSpriteMgr, "BirdAnimation");
_local2.stage_mc._visible = false;
_local2.spd_line = -(SBD_SHARK_SPD + (0 * SBD_SHARK_SPD_MUL));
_local2.user_timer = 0;
_local2.spd_x = (_local2.spd_y = (_local2.spd_z = 0));
trap_bird_update_pos(_local2);
return(_local2);
}
function trap_bird_exec() {
if (this.hitstop_timer) {
this.hitstop_timer--;
StageSpriteMan_AddOrder(_root.stageSpriteMgr, this.stageObj, this.stage_mc);
return(undefined);
}
if (this.taskflag & GAME_TASKFLAG_COLLIDE) {
}
this.pos_line.z = this.pos_line.z + this.spd_line;
this.pos_stage = seqGame_GetStagePos(this.pos_line);
var _local4 = [128, 256, 128, 32, -128, -256, -128, -32];
var _local3 = 0;
this.spd_y = this.spd_y + _local4[(this.user_timer >> 2) & 7];
_local3 = this.spd_y / 4096;
this.user_timer++;
this.pos_stage.y = this.pos_stage.y + _local3;
this.stageObj.pos.x = this.pos_stage.x;
this.stageObj.pos.y = this.pos_stage.y;
this.stageObj.pos.z = this.pos_stage.z;
if (trap_bird_checkFrameout(this)) {
this.taskflag = this.taskflag | GAME_TASKFLAG_KILL;
} else {
StageSpriteMan_AddOrder(_root.stageSpriteMgr, this.stageObj, this.stage_mc);
}
}
function trap_bird_die_exec() {
if (this.hitstop_timer) {
this.hitstop_timer--;
StageSpriteMan_AddOrder(_root.stageSpriteMgr, this.stageObj, this.stage_mc);
return(undefined);
}
this.pos_stage.x = this.pos_stage.x + this.spd_x;
this.pos_stage.y = this.pos_stage.y + this.spd_y;
this.pos_stage.z = this.pos_stage.z + this.spd_z;
this.stageObj.pos.x = this.pos_stage.x;
this.stageObj.pos.y = this.pos_stage.y;
this.stageObj.pos.z = this.pos_stage.z;
if ((++this.user_timer) > SBD_BREAK_TIME) {
this.taskflag = this.taskflag | GAME_TASKFLAG_KILL;
} else {
StageSpriteMan_AddOrder(_root.stageSpriteMgr, this.stageObj, this.stage_mc);
}
}
function trap_bird_exit() {
this.stageObj = null;
this.stage_mc.removeMovieClip();
this.stage_mc = null;
}
function trap_bird_update_pos(myTrap) {
myTrap.pos_stage = seqGame_GetStagePos(myTrap.pos_line);
myTrap.stageObj.pos.x = myTrap.pos_stage.x;
myTrap.stageObj.pos.y = myTrap.pos_stage.y;
myTrap.stageObj.pos.z = myTrap.pos_stage.z;
}
function trap_bird_checkFrameout(myTrap) {
var _local1 = -3;
if (myTrap.stageObj.pos.z > (-_local1)) {
return(true);
}
return(false);
}
function TrapBird_AttackHitCall(myTrap) {
trap_bird_die_init(myTrap);
}
function trap_bird_die_init(myTrap) {
var _local3 = -(_root.gameSeq.m_player.spd + SBD_BREAK_SPD);
var _local5 = (512 - Math.floor(Math.random() * 1023)) & 65535;
var _local4 = (_local5 * (Math.PI*2)) / 65536;
myTrap.spd_x = _local3 * Math.sin(_local4);
myTrap.spd_z = _local3 * Math.cos(_local4);
myTrap.spd_y = (512 + Math.floor(Math.random() * 511)) / 4096;
myTrap.exec = trap_bird_die_exec;
myTrap.taskflag = myTrap.taskflag | GAME_TASKFLAG_NOHIT;
myTrap.user_timer = 0;
myTrap.stage_mc.gotoAndPlay("PAT_CRASH");
_root.stageSoundMgr.PlaySE(SOUND_SE_SPLASH);
}
function vec3d_Create(x, y, z) {
return({x:x, y:y, z:z});
}
function vec3d_Clone(v) {
return({x:v.x, y:v.y, z:v.z});
}
function vec3d_Add(a, b) {
return({x:a.x + b.x, y:a.y + b.y, z:a.z + b.z});
}
function vec3d_Subtract(a, b) {
return({x:a.x - b.x, y:a.y - b.y, z:a.z - b.z});
}
function vec3d_Scale(a, v) {
return({x:a * v.x, y:a * v.y, z:a * v.z});
}
function vec3d_DotProduct(a, b) {
return(((a.x * b.x) + (a.y * b.y)) + (a.z * b.z));
}
function vec3d_CrossProduct(a, b) {
return({x:(a.y * b.z) - (a.z * b.y), y:(a.z * b.x) - (a.x * b.z), z:(a.x * b.y) - (a.y * b.x)});
}
function vec3d_Mag(v) {
return(Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z)));
}
function vec3d_Normalize(v) {
var _local2 = Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
if (_local2 > 0) {
_local2 = 1 / _local2;
}
return({x:v.x * _local2, y:v.y * _local2, z:v.z * _local2});
}
function vec3d_MultAdd(a, v1, v2) {
return({x:v2.x + (a * v1.x), y:v2.y + (a * v1.y), z:v2.z + (a * v1.z)});
}
function vec3d_Set(v, x, y, z) {
v.x = x;
v.y = y;
v.z = z;
}
function ObjSpdUpSet(lSpd, sSpd, sMaxSpd) {
lSpd = lSpd + sSpd;
if (sMaxSpd == 0) {
return(lSpd);
}
if (sSpd >= 0) {
if (lSpd > sMaxSpd) {
lSpd = sMaxSpd;
}
} else if (lSpd < (-sMaxSpd)) {
lSpd = -sMaxSpd;
}
return(lSpd);
}
function ObjSpdDownSet(lSpd, sSpd) {
if (lSpd > 0) {
lSpd = lSpd - sSpd;
if (lSpd < 0) {
lSpd = 0;
}
} else {
lSpd = lSpd + sSpd;
if (lSpd > 0) {
lSpd = 0;
}
}
return(lSpd);
}
function ObjShiftSet(lPos, sTag, divStep, usMax, usMin) {
var _local1;
if (lPos == sTag) {
return(lPos);
}
if (usMin == 0) {
usMin = 1;
}
_local1 = (sTag - lPos) * divStep;
if (usMax > 0) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin > 0) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ObjDiffSet(lPos, sTag, sSrc, divStep, usMax, usMin) {
if (lPos == sTag) {
return(lPos);
}
if (!usMin) {
usMin = 1;
}
var _local1;
_local1 = (lPos - sSrc) * divStep;
if (sTag > sSrc) {
if (_local1 < 0) {
_local1 = 0;
}
}
if (sTag < sSrc) {
if (_local1 > 0) {
_local1 = 0;
}
}
if (usMax) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ComputeNumBCDCode(val, valMax) {
if (val >= valMax) {
if (valMax == 0) {
val = 0;
} else {
val = valMax - 1;
}
}
var _local1;
var _local6 = 0;
var _local2 = valMax;
var _local4;
if (_local2 >= 100) {
_local2 = Math.floor(_local2 / 10);
_local1 = 0;
for(;;){
if (val >= _local2) {
_local4 = Math.floor(val / _local2);
_local6 = _local6 | (_local4 << _local1);
val = val - (_local4 * _local2);
}
_local1 = _local1 + 4;
if (_local2 <= 10) {
break;
}
_local2 = Math.floor(_local2 / 10);
};
}
_local6 = _local6 | (val << _local1);
var _local5 = _local1 / 4;
if (_local5 > 7) {
_local5 = 7;
} else if (_local5 < 0) {
_local5 = 0;
}
var _local9 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local8 = 0;
var _local7;
_local1 = 0;
while (_local1 < (_local5 + 1)) {
_local7 = (_local6 >> (4 * _local1)) & 15;
_local8 = _local8 | (_local7 << _local9[(7 - _local5) + _local1]);
_local1++;
}
return(_local8);
}
function ComputeTimeBCDCode(frameVal) {
var _local7 = [1080000, 108000, 18000, 1800, 300, 30, 10, 1];
var _local6 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local1;
var _local5 = 0;
var _local3;
var _local4;
_local1 = 0;
while (_local1 < 7) {
_local3 = _local7[_local1];
if (_local1 == 6) {
frameVal = Math.floor(frameVal * 3.4140625);
}
if (frameVal >= _local3) {
_local4 = Math.floor(frameVal / _local3);
_local5 = _local5 | (_local4 << _local6[_local1]);
frameVal = frameVal - (_local4 * _local3);
}
_local1++;
}
_local5 = _local5 | (frameVal << _local6[_local1]);
return(_local5);
}
function testVector3() {
}
function TrapBob_Create(lineZ, ofs_x, ofs_y, acttype) {
var _local2 = new Object();
_local2.taskflag = GAME_TASKFLAG_HIT_BRK;
_local2.exec = trap_bob_exec;
_local2.exit = trap_bob_exit;
_local2.actno = TRAP_ACTNO_BOB;
_local2.actflag = 0;
_local2.step = 0;
_local2.body_radius = SBD_BOB_RADIUS;
_local2.attack_radius = 0;
_local2.hitstop_timer = 0;
_local2.pos_line = vec3d_Create(ofs_x, ofs_y, lineZ);
_local2.pos_line.y = _local2.pos_line.y + SBD_BOB_HEIGHT;
_local2.pos_stage = vec3d_Create(0, 0, 0);
_local2.stageObj = StageSpriteMan_CreateObject(_root.stageSpriteMgr, STAGESPRITE_TYPE_SHARK);
_local2.stageObj.baseScale = 1;
_local2.stage_mc = StageSpriteMan_CreateMC(_root.stageSpriteMgr, "BobAnimation");
_local2.stage_mc._visible = false;
_local2.spd_line = 0;
_local2.user_timer = 0;
_local2.spd_x = (_local2.spd_y = (_local2.spd_z = 0));
trap_bob_update_pos(_local2);
return(_local2);
}
function trap_bob_exec() {
if (this.hitstop_timer) {
this.hitstop_timer--;
StageSpriteMan_AddOrder(_root.stageSpriteMgr, this.stageObj, this.stage_mc);
return(undefined);
}
if (this.taskflag & GAME_TASKFLAG_COLLIDE) {
}
this.pos_stage = seqGame_GetStagePos(this.pos_line);
var _local4 = [128, 256, 128, 32, -128, -256, -128, -32];
var _local3 = 0;
this.spd_y = this.spd_y + _local4[(this.user_timer >> 2) & 7];
_local3 = this.spd_y / 4096;
this.user_timer++;
this.pos_stage.y = this.pos_stage.y + _local3;
this.stageObj.pos.x = this.pos_stage.x;
this.stageObj.pos.y = this.pos_stage.y;
this.stageObj.pos.z = this.pos_stage.z;
if (trap_bob_checkFrameout(this)) {
this.taskflag = this.taskflag | GAME_TASKFLAG_KILL;
} else {
StageSpriteMan_AddOrder(_root.stageSpriteMgr, this.stageObj, this.stage_mc);
}
}
function trap_bob_die_exec() {
if (this.hitstop_timer) {
this.hitstop_timer--;
StageSpriteMan_AddOrder(_root.stageSpriteMgr, this.stageObj, this.stage_mc);
return(undefined);
}
this.pos_stage.x = this.pos_stage.x + this.spd_x;
this.pos_stage.y = this.pos_stage.y + this.spd_y;
this.pos_stage.z = this.pos_stage.z + this.spd_z;
this.stageObj.pos.x = this.pos_stage.x;
this.stageObj.pos.y = this.pos_stage.y;
this.stageObj.pos.z = this.pos_stage.z;
if ((++this.user_timer) > SBD_BREAK_TIME) {
this.taskflag = this.taskflag | GAME_TASKFLAG_KILL;
} else {
StageSpriteMan_AddOrder(_root.stageSpriteMgr, this.stageObj, this.stage_mc);
}
}
function trap_bob_exit() {
this.stageObj = null;
this.stage_mc.removeMovieClip();
this.stage_mc = null;
}
function trap_bob_update_pos(myTrap) {
myTrap.pos_stage = seqGame_GetStagePos(myTrap.pos_line);
myTrap.stageObj.pos.x = myTrap.pos_stage.x;
myTrap.stageObj.pos.y = myTrap.pos_stage.y;
myTrap.stageObj.pos.z = myTrap.pos_stage.z;
}
function trap_bob_checkFrameout(myTrap) {
var _local1 = -3;
if (myTrap.stageObj.pos.z > (-_local1)) {
return(true);
}
return(false);
}
function TrapBob_AttackHitCall(myTrap) {
trap_bob_die_init(myTrap);
}
function trap_bob_die_init(myTrap) {
var _local3 = -(_root.gameSeq.m_player.spd + SBD_BREAK_SPD);
var _local5 = (512 - Math.floor(Math.random() * 1023)) & 65535;
var _local4 = (_local5 * (Math.PI*2)) / 65536;
myTrap.spd_x = _local3 * Math.sin(_local4);
myTrap.spd_z = _local3 * Math.cos(_local4);
myTrap.spd_y = (512 + Math.floor(Math.random() * 511)) / 4096;
myTrap.exec = trap_bob_die_exec;
myTrap.taskflag = myTrap.taskflag | GAME_TASKFLAG_NOHIT;
myTrap.user_timer = 0;
myTrap.stage_mc.gotoAndPlay("PAT_CRASH");
_root.stageSoundMgr.PlaySE(SOUND_SE_SPLASH);
}
function vec3d_Create(x, y, z) {
return({x:x, y:y, z:z});
}
function vec3d_Clone(v) {
return({x:v.x, y:v.y, z:v.z});
}
function vec3d_Add(a, b) {
return({x:a.x + b.x, y:a.y + b.y, z:a.z + b.z});
}
function vec3d_Subtract(a, b) {
return({x:a.x - b.x, y:a.y - b.y, z:a.z - b.z});
}
function vec3d_Scale(a, v) {
return({x:a * v.x, y:a * v.y, z:a * v.z});
}
function vec3d_DotProduct(a, b) {
return(((a.x * b.x) + (a.y * b.y)) + (a.z * b.z));
}
function vec3d_CrossProduct(a, b) {
return({x:(a.y * b.z) - (a.z * b.y), y:(a.z * b.x) - (a.x * b.z), z:(a.x * b.y) - (a.y * b.x)});
}
function vec3d_Mag(v) {
return(Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z)));
}
function vec3d_Normalize(v) {
var _local2 = Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
if (_local2 > 0) {
_local2 = 1 / _local2;
}
return({x:v.x * _local2, y:v.y * _local2, z:v.z * _local2});
}
function vec3d_MultAdd(a, v1, v2) {
return({x:v2.x + (a * v1.x), y:v2.y + (a * v1.y), z:v2.z + (a * v1.z)});
}
function vec3d_Set(v, x, y, z) {
v.x = x;
v.y = y;
v.z = z;
}
function ObjSpdUpSet(lSpd, sSpd, sMaxSpd) {
lSpd = lSpd + sSpd;
if (sMaxSpd == 0) {
return(lSpd);
}
if (sSpd >= 0) {
if (lSpd > sMaxSpd) {
lSpd = sMaxSpd;
}
} else if (lSpd < (-sMaxSpd)) {
lSpd = -sMaxSpd;
}
return(lSpd);
}
function ObjSpdDownSet(lSpd, sSpd) {
if (lSpd > 0) {
lSpd = lSpd - sSpd;
if (lSpd < 0) {
lSpd = 0;
}
} else {
lSpd = lSpd + sSpd;
if (lSpd > 0) {
lSpd = 0;
}
}
return(lSpd);
}
function ObjShiftSet(lPos, sTag, divStep, usMax, usMin) {
var _local1;
if (lPos == sTag) {
return(lPos);
}
if (usMin == 0) {
usMin = 1;
}
_local1 = (sTag - lPos) * divStep;
if (usMax > 0) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin > 0) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ObjDiffSet(lPos, sTag, sSrc, divStep, usMax, usMin) {
if (lPos == sTag) {
return(lPos);
}
if (!usMin) {
usMin = 1;
}
var _local1;
_local1 = (lPos - sSrc) * divStep;
if (sTag > sSrc) {
if (_local1 < 0) {
_local1 = 0;
}
}
if (sTag < sSrc) {
if (_local1 > 0) {
_local1 = 0;
}
}
if (usMax) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ComputeNumBCDCode(val, valMax) {
if (val >= valMax) {
if (valMax == 0) {
val = 0;
} else {
val = valMax - 1;
}
}
var _local1;
var _local6 = 0;
var _local2 = valMax;
var _local4;
if (_local2 >= 100) {
_local2 = Math.floor(_local2 / 10);
_local1 = 0;
for(;;){
if (val >= _local2) {
_local4 = Math.floor(val / _local2);
_local6 = _local6 | (_local4 << _local1);
val = val - (_local4 * _local2);
}
_local1 = _local1 + 4;
if (_local2 <= 10) {
break;
}
_local2 = Math.floor(_local2 / 10);
};
}
_local6 = _local6 | (val << _local1);
var _local5 = _local1 / 4;
if (_local5 > 7) {
_local5 = 7;
} else if (_local5 < 0) {
_local5 = 0;
}
var _local9 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local8 = 0;
var _local7;
_local1 = 0;
while (_local1 < (_local5 + 1)) {
_local7 = (_local6 >> (4 * _local1)) & 15;
_local8 = _local8 | (_local7 << _local9[(7 - _local5) + _local1]);
_local1++;
}
return(_local8);
}
function ComputeTimeBCDCode(frameVal) {
var _local7 = [1080000, 108000, 18000, 1800, 300, 30, 10, 1];
var _local6 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local1;
var _local5 = 0;
var _local3;
var _local4;
_local1 = 0;
while (_local1 < 7) {
_local3 = _local7[_local1];
if (_local1 == 6) {
frameVal = Math.floor(frameVal * 3.4140625);
}
if (frameVal >= _local3) {
_local4 = Math.floor(frameVal / _local3);
_local5 = _local5 | (_local4 << _local6[_local1]);
frameVal = frameVal - (_local4 * _local3);
}
_local1++;
}
_local5 = _local5 | (frameVal << _local6[_local1]);
return(_local5);
}
function testVector3() {
}
function TrapGoalIsland_Create(lineZ, ofs_x, ofs_y) {
var _local2 = new Object();
_local2.taskflag = GAME_TASKFLAG_NOHIT;
_local2.exec = trap_goalisland_exec;
_local2.exit = trap_goalisland_exit;
_local2.actno = TRAP_ACTNO_GOAL_ISLAND;
_local2.actflag = 0;
_local2.step = 0;
_local2.body_radius = 0;
_local2.attack_radius = 0;
_local2.hitstop_timer = 0;
_local2.pos_line = vec3d_Create(0, 0, lineZ + SBD_MAP_LAND_LENGTH);
_local2.pos_stage = vec3d_Create(0, 0, 0);
_local2.stageObj = StageSpriteMan_CreateObject(_root.stageSpriteMgr, STAGESPRITE_TYPE_GOAL_ISLAND);
_local2.stageObj.baseScale = TRAP_GOAL_ISLAND_BASE_SCALE;
_local2.stage_mc = StageSpriteMan_CreateMC(_root.stageSpriteMgr, "GoalIslandAnimation");
_local2.stage_mc._visible = false;
trap_goalisland_update_pos(_local2);
return(_local2);
}
function trap_goalisland_exec() {
this.pos_stage = seqGame_GetStagePos(this.pos_line);
var _local3 = vec3d_Mag(this.pos_stage);
var _local4 = 0;
if (_local3 > SBD_LAND_LENGTH_MAX) {
this.stage_mc._visible = false;
return(undefined);
}
if (_local3 > SBD_LAND_LENGTH) {
} else {
_local4 = -SBD_LAND_LENGTH;
}
this.stageObj.pos.x = this.pos_stage.x;
this.stageObj.pos.y = this.pos_stage.y;
this.stageObj.pos.z = this.pos_stage.z + _local4;
if (trap_goalisland_checkFrameout(this)) {
this.taskflag = this.taskflag | GAME_TASKFLAG_KILL;
} else {
StageSpriteMan_AddOrder(_root.stageSpriteMgr, this.stageObj, this.stage_mc);
}
}
function trap_goalisland_exit() {
this.stageObj = null;
this.stage_mc.removeMovieClip();
this.stage_mc = null;
}
function trap_goalisland_update_pos(myTrap) {
myTrap.pos_stage = seqGame_GetStagePos(myTrap.pos_line);
myTrap.stageObj.pos.x = myTrap.pos_stage.x;
myTrap.stageObj.pos.y = myTrap.pos_stage.y;
myTrap.stageObj.pos.z = myTrap.pos_stage.z;
}
function trap_goalisland_checkFrameout(myTrap) {
var _local1 = -3;
if (myTrap.stageObj.pos.z > (-_local1)) {
return(true);
}
return(false);
}
function vec3d_Create(x, y, z) {
return({x:x, y:y, z:z});
}
function vec3d_Clone(v) {
return({x:v.x, y:v.y, z:v.z});
}
function vec3d_Add(a, b) {
return({x:a.x + b.x, y:a.y + b.y, z:a.z + b.z});
}
function vec3d_Subtract(a, b) {
return({x:a.x - b.x, y:a.y - b.y, z:a.z - b.z});
}
function vec3d_Scale(a, v) {
return({x:a * v.x, y:a * v.y, z:a * v.z});
}
function vec3d_DotProduct(a, b) {
return(((a.x * b.x) + (a.y * b.y)) + (a.z * b.z));
}
function vec3d_CrossProduct(a, b) {
return({x:(a.y * b.z) - (a.z * b.y), y:(a.z * b.x) - (a.x * b.z), z:(a.x * b.y) - (a.y * b.x)});
}
function vec3d_Mag(v) {
return(Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z)));
}
function vec3d_Normalize(v) {
var _local2 = Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
if (_local2 > 0) {
_local2 = 1 / _local2;
}
return({x:v.x * _local2, y:v.y * _local2, z:v.z * _local2});
}
function vec3d_MultAdd(a, v1, v2) {
return({x:v2.x + (a * v1.x), y:v2.y + (a * v1.y), z:v2.z + (a * v1.z)});
}
function vec3d_Set(v, x, y, z) {
v.x = x;
v.y = y;
v.z = z;
}
function ObjSpdUpSet(lSpd, sSpd, sMaxSpd) {
lSpd = lSpd + sSpd;
if (sMaxSpd == 0) {
return(lSpd);
}
if (sSpd >= 0) {
if (lSpd > sMaxSpd) {
lSpd = sMaxSpd;
}
} else if (lSpd < (-sMaxSpd)) {
lSpd = -sMaxSpd;
}
return(lSpd);
}
function ObjSpdDownSet(lSpd, sSpd) {
if (lSpd > 0) {
lSpd = lSpd - sSpd;
if (lSpd < 0) {
lSpd = 0;
}
} else {
lSpd = lSpd + sSpd;
if (lSpd > 0) {
lSpd = 0;
}
}
return(lSpd);
}
function ObjShiftSet(lPos, sTag, divStep, usMax, usMin) {
var _local1;
if (lPos == sTag) {
return(lPos);
}
if (usMin == 0) {
usMin = 1;
}
_local1 = (sTag - lPos) * divStep;
if (usMax > 0) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin > 0) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ObjDiffSet(lPos, sTag, sSrc, divStep, usMax, usMin) {
if (lPos == sTag) {
return(lPos);
}
if (!usMin) {
usMin = 1;
}
var _local1;
_local1 = (lPos - sSrc) * divStep;
if (sTag > sSrc) {
if (_local1 < 0) {
_local1 = 0;
}
}
if (sTag < sSrc) {
if (_local1 > 0) {
_local1 = 0;
}
}
if (usMax) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ComputeNumBCDCode(val, valMax) {
if (val >= valMax) {
if (valMax == 0) {
val = 0;
} else {
val = valMax - 1;
}
}
var _local1;
var _local6 = 0;
var _local2 = valMax;
var _local4;
if (_local2 >= 100) {
_local2 = Math.floor(_local2 / 10);
_local1 = 0;
for(;;){
if (val >= _local2) {
_local4 = Math.floor(val / _local2);
_local6 = _local6 | (_local4 << _local1);
val = val - (_local4 * _local2);
}
_local1 = _local1 + 4;
if (_local2 <= 10) {
break;
}
_local2 = Math.floor(_local2 / 10);
};
}
_local6 = _local6 | (val << _local1);
var _local5 = _local1 / 4;
if (_local5 > 7) {
_local5 = 7;
} else if (_local5 < 0) {
_local5 = 0;
}
var _local9 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local8 = 0;
var _local7;
_local1 = 0;
while (_local1 < (_local5 + 1)) {
_local7 = (_local6 >> (4 * _local1)) & 15;
_local8 = _local8 | (_local7 << _local9[(7 - _local5) + _local1]);
_local1++;
}
return(_local8);
}
function ComputeTimeBCDCode(frameVal) {
var _local7 = [1080000, 108000, 18000, 1800, 300, 30, 10, 1];
var _local6 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local1;
var _local5 = 0;
var _local3;
var _local4;
_local1 = 0;
while (_local1 < 7) {
_local3 = _local7[_local1];
if (_local1 == 6) {
frameVal = Math.floor(frameVal * 3.4140625);
}
if (frameVal >= _local3) {
_local4 = Math.floor(frameVal / _local3);
_local5 = _local5 | (_local4 << _local6[_local1]);
frameVal = frameVal - (_local4 * _local3);
}
_local1++;
}
_local5 = _local5 | (frameVal << _local6[_local1]);
return(_local5);
}
function testVector3() {
}
function EffectTrickOk_Create(x, y, acttype) {
var _local2 = new Object();
_local2.taskflag = 0;
_local2.exec = effect_trickok_exec;
_local2.exit = effect_trickok_exit;
_local2.actno = acttype;
_local2.actflag = 0;
_local2.step = 0;
_local2.vib_timer = 8;
_local2.user_timer = 0;
_local2.pos_x = x;
_local2.pos_y = y;
_local2.sprite_mc = ScreenSpriteMan_CreateEffectFrontMC(_root.screenSpriteMgr, "TrickResultAnimation");
var _local3 = ((acttype == TRAP_ACTNO_TRICK_OK) ? "PAT_OK" : "PAT_NG");
_local2.sprite_mc.gotoAndPlay(_local3);
_local2.sprite_mc._x = _local2.pos_x;
_local2.sprite_mc._y = _local2.pos_y;
return(_local2);
}
function effect_trickok_exec() {
if ((++this.user_timer) > 24) {
this.taskflag = this.taskflag | GAME_TASKFLAG_KILL;
}
var _local3 = 0;
var _local2 = 0;
if (this.vib_timer) {
var _local5 = [1, 1, -1, -1, 2, 2, -2, -2, 4, 4, -4, -4, -4, 4, 4, -4];
this.vib_timer--;
var _local4 = Math.floor(this.vib_timer / 2);
_local3 = _local5[(_local4 + 0) & 15];
_local2 = _local5[(_local4 + 1) & 15];
}
this.sprite_mc._x = this.pos_x + _local3;
this.sprite_mc._y = this.pos_y + _local2;
}
function effect_trickok_exit() {
this.sprite_mc.removeMovieClip();
this.sprite_mc = null;
}
function vec3d_Create(x, y, z) {
return({x:x, y:y, z:z});
}
function vec3d_Clone(v) {
return({x:v.x, y:v.y, z:v.z});
}
function vec3d_Add(a, b) {
return({x:a.x + b.x, y:a.y + b.y, z:a.z + b.z});
}
function vec3d_Subtract(a, b) {
return({x:a.x - b.x, y:a.y - b.y, z:a.z - b.z});
}
function vec3d_Scale(a, v) {
return({x:a * v.x, y:a * v.y, z:a * v.z});
}
function vec3d_DotProduct(a, b) {
return(((a.x * b.x) + (a.y * b.y)) + (a.z * b.z));
}
function vec3d_CrossProduct(a, b) {
return({x:(a.y * b.z) - (a.z * b.y), y:(a.z * b.x) - (a.x * b.z), z:(a.x * b.y) - (a.y * b.x)});
}
function vec3d_Mag(v) {
return(Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z)));
}
function vec3d_Normalize(v) {
var _local2 = Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
if (_local2 > 0) {
_local2 = 1 / _local2;
}
return({x:v.x * _local2, y:v.y * _local2, z:v.z * _local2});
}
function vec3d_MultAdd(a, v1, v2) {
return({x:v2.x + (a * v1.x), y:v2.y + (a * v1.y), z:v2.z + (a * v1.z)});
}
function vec3d_Set(v, x, y, z) {
v.x = x;
v.y = y;
v.z = z;
}
function ObjSpdUpSet(lSpd, sSpd, sMaxSpd) {
lSpd = lSpd + sSpd;
if (sMaxSpd == 0) {
return(lSpd);
}
if (sSpd >= 0) {
if (lSpd > sMaxSpd) {
lSpd = sMaxSpd;
}
} else if (lSpd < (-sMaxSpd)) {
lSpd = -sMaxSpd;
}
return(lSpd);
}
function ObjSpdDownSet(lSpd, sSpd) {
if (lSpd > 0) {
lSpd = lSpd - sSpd;
if (lSpd < 0) {
lSpd = 0;
}
} else {
lSpd = lSpd + sSpd;
if (lSpd > 0) {
lSpd = 0;
}
}
return(lSpd);
}
function ObjShiftSet(lPos, sTag, divStep, usMax, usMin) {
var _local1;
if (lPos == sTag) {
return(lPos);
}
if (usMin == 0) {
usMin = 1;
}
_local1 = (sTag - lPos) * divStep;
if (usMax > 0) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin > 0) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ObjDiffSet(lPos, sTag, sSrc, divStep, usMax, usMin) {
if (lPos == sTag) {
return(lPos);
}
if (!usMin) {
usMin = 1;
}
var _local1;
_local1 = (lPos - sSrc) * divStep;
if (sTag > sSrc) {
if (_local1 < 0) {
_local1 = 0;
}
}
if (sTag < sSrc) {
if (_local1 > 0) {
_local1 = 0;
}
}
if (usMax) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ComputeNumBCDCode(val, valMax) {
if (val >= valMax) {
if (valMax == 0) {
val = 0;
} else {
val = valMax - 1;
}
}
var _local1;
var _local6 = 0;
var _local2 = valMax;
var _local4;
if (_local2 >= 100) {
_local2 = Math.floor(_local2 / 10);
_local1 = 0;
for(;;){
if (val >= _local2) {
_local4 = Math.floor(val / _local2);
_local6 = _local6 | (_local4 << _local1);
val = val - (_local4 * _local2);
}
_local1 = _local1 + 4;
if (_local2 <= 10) {
break;
}
_local2 = Math.floor(_local2 / 10);
};
}
_local6 = _local6 | (val << _local1);
var _local5 = _local1 / 4;
if (_local5 > 7) {
_local5 = 7;
} else if (_local5 < 0) {
_local5 = 0;
}
var _local9 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local8 = 0;
var _local7;
_local1 = 0;
while (_local1 < (_local5 + 1)) {
_local7 = (_local6 >> (4 * _local1)) & 15;
_local8 = _local8 | (_local7 << _local9[(7 - _local5) + _local1]);
_local1++;
}
return(_local8);
}
function ComputeTimeBCDCode(frameVal) {
var _local7 = [1080000, 108000, 18000, 1800, 300, 30, 10, 1];
var _local6 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local1;
var _local5 = 0;
var _local3;
var _local4;
_local1 = 0;
while (_local1 < 7) {
_local3 = _local7[_local1];
if (_local1 == 6) {
frameVal = Math.floor(frameVal * 3.4140625);
}
if (frameVal >= _local3) {
_local4 = Math.floor(frameVal / _local3);
_local5 = _local5 | (_local4 << _local6[_local1]);
frameVal = frameVal - (_local4 * _local3);
}
_local1++;
}
_local5 = _local5 | (frameVal << _local6[_local1]);
return(_local5);
}
function testVector3() {
}
function EffectWater01_Create() {
var _local2 = new Object();
_local2.taskflag = GAME_TASKFLAG_NOHIT;
_local2.exec = effect_water01_exec;
_local2.exit = effect_water01_exit;
_local2.actno = TRAP_ACTNO_WATER01;
_local2.actflag = 0;
_local2.step = 0;
_local2.body_radius = 0;
_local2.attack_radius = 0;
_local2.hitstop_timer = 0;
_local2.pos_line = vec3d_Create(0, 0, 0);
_local2.pos_stage = vec3d_Create(0, 0, 0);
_local2.stageObj = StageSpriteMan_CreateObject(_root.stageSpriteMgr, STAGESPRITE_TYPE_WATER);
_local2.stageObj.baseScale = EFFECT_WATER01_BASE_SCALE;
_local2.stage_mc = StageSpriteMan_CreateMC(_root.stageSpriteMgr, "Water01EffAnimation");
_local2.stage_mc._visible = false;
_local2.user_timer = 1;
return(_local2);
}
function effect_water01_exec() {
if ((_root.gameSeq.m_player.spd <= 0) || (_root.gameSeq.m_player.move_flag & OBD_MOVE_JUMP)) {
this.stage_mc._visible = false;
return(undefined);
}
this.stage_mc._visible = true;
var _local6 = 2;
var _local3 = _root.gameSeq.m_player.spd;
if (_local3 > _local6) {
_local3 = _local6;
}
var _local4 = this.user_timer * _local3;
if (_local4 > 2.5) {
_local4 = 2.5;
} else if (_local4 < 0.5) {
_local4 = 0.5;
}
this.stageObj.baseScale = EFFECT_WATER01_BASE_SCALE * _local4;
if (_local3 < (_local6 * 0.2)) {
var _local5;
_local5 = (_local3 / (_local6 * 0.2)) * 100;
if (_local5 > 100) {
_local5 = 100;
} else if (_local5 <= 0) {
_local5 = 0;
this.stage_mc._visible = false;
}
this.stage_mc._alpha = _local5;
} else {
this.stage_mc._alpha = 100;
}
this.pos_stage.x = _root.gameSeq.m_player.stageObj.pos.x;
this.pos_stage.y = _root.gameSeq.m_player.stageObj.pos.y - 0.75;
this.pos_stage.z = _root.gameSeq.m_player.stageObj.pos.z + 1;
this.stageObj.pos.x = this.pos_stage.x;
this.stageObj.pos.y = this.pos_stage.y;
this.stageObj.pos.z = this.pos_stage.z;
StageSpriteMan_AddOrder(_root.stageSpriteMgr, this.stageObj, this.stage_mc);
}
function effect_water01_exit() {
this.stageObj = null;
this.stage_mc.removeMovieClip();
this.stage_mc = null;
}
function vec3d_Create(x, y, z) {
return({x:x, y:y, z:z});
}
function vec3d_Clone(v) {
return({x:v.x, y:v.y, z:v.z});
}
function vec3d_Add(a, b) {
return({x:a.x + b.x, y:a.y + b.y, z:a.z + b.z});
}
function vec3d_Subtract(a, b) {
return({x:a.x - b.x, y:a.y - b.y, z:a.z - b.z});
}
function vec3d_Scale(a, v) {
return({x:a * v.x, y:a * v.y, z:a * v.z});
}
function vec3d_DotProduct(a, b) {
return(((a.x * b.x) + (a.y * b.y)) + (a.z * b.z));
}
function vec3d_CrossProduct(a, b) {
return({x:(a.y * b.z) - (a.z * b.y), y:(a.z * b.x) - (a.x * b.z), z:(a.x * b.y) - (a.y * b.x)});
}
function vec3d_Mag(v) {
return(Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z)));
}
function vec3d_Normalize(v) {
var _local2 = Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
if (_local2 > 0) {
_local2 = 1 / _local2;
}
return({x:v.x * _local2, y:v.y * _local2, z:v.z * _local2});
}
function vec3d_MultAdd(a, v1, v2) {
return({x:v2.x + (a * v1.x), y:v2.y + (a * v1.y), z:v2.z + (a * v1.z)});
}
function vec3d_Set(v, x, y, z) {
v.x = x;
v.y = y;
v.z = z;
}
function ObjSpdUpSet(lSpd, sSpd, sMaxSpd) {
lSpd = lSpd + sSpd;
if (sMaxSpd == 0) {
return(lSpd);
}
if (sSpd >= 0) {
if (lSpd > sMaxSpd) {
lSpd = sMaxSpd;
}
} else if (lSpd < (-sMaxSpd)) {
lSpd = -sMaxSpd;
}
return(lSpd);
}
function ObjSpdDownSet(lSpd, sSpd) {
if (lSpd > 0) {
lSpd = lSpd - sSpd;
if (lSpd < 0) {
lSpd = 0;
}
} else {
lSpd = lSpd + sSpd;
if (lSpd > 0) {
lSpd = 0;
}
}
return(lSpd);
}
function ObjShiftSet(lPos, sTag, divStep, usMax, usMin) {
var _local1;
if (lPos == sTag) {
return(lPos);
}
if (usMin == 0) {
usMin = 1;
}
_local1 = (sTag - lPos) * divStep;
if (usMax > 0) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin > 0) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ObjDiffSet(lPos, sTag, sSrc, divStep, usMax, usMin) {
if (lPos == sTag) {
return(lPos);
}
if (!usMin) {
usMin = 1;
}
var _local1;
_local1 = (lPos - sSrc) * divStep;
if (sTag > sSrc) {
if (_local1 < 0) {
_local1 = 0;
}
}
if (sTag < sSrc) {
if (_local1 > 0) {
_local1 = 0;
}
}
if (usMax) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ComputeNumBCDCode(val, valMax) {
if (val >= valMax) {
if (valMax == 0) {
val = 0;
} else {
val = valMax - 1;
}
}
var _local1;
var _local6 = 0;
var _local2 = valMax;
var _local4;
if (_local2 >= 100) {
_local2 = Math.floor(_local2 / 10);
_local1 = 0;
for(;;){
if (val >= _local2) {
_local4 = Math.floor(val / _local2);
_local6 = _local6 | (_local4 << _local1);
val = val - (_local4 * _local2);
}
_local1 = _local1 + 4;
if (_local2 <= 10) {
break;
}
_local2 = Math.floor(_local2 / 10);
};
}
_local6 = _local6 | (val << _local1);
var _local5 = _local1 / 4;
if (_local5 > 7) {
_local5 = 7;
} else if (_local5 < 0) {
_local5 = 0;
}
var _local9 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local8 = 0;
var _local7;
_local1 = 0;
while (_local1 < (_local5 + 1)) {
_local7 = (_local6 >> (4 * _local1)) & 15;
_local8 = _local8 | (_local7 << _local9[(7 - _local5) + _local1]);
_local1++;
}
return(_local8);
}
function ComputeTimeBCDCode(frameVal) {
var _local7 = [1080000, 108000, 18000, 1800, 300, 30, 10, 1];
var _local6 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local1;
var _local5 = 0;
var _local3;
var _local4;
_local1 = 0;
while (_local1 < 7) {
_local3 = _local7[_local1];
if (_local1 == 6) {
frameVal = Math.floor(frameVal * 3.4140625);
}
if (frameVal >= _local3) {
_local4 = Math.floor(frameVal / _local3);
_local5 = _local5 | (_local4 << _local6[_local1]);
frameVal = frameVal - (_local4 * _local3);
}
_local1++;
}
_local5 = _local5 | (frameVal << _local6[_local1]);
return(_local5);
}
function testVector3() {
}
function EffectWater02_Create(x, y, z) {
var _local2 = new Object();
_local2.taskflag = GAME_TASKFLAG_NOHIT;
_local2.exec = effect_water02_exec;
_local2.exit = effect_water02_exit;
_local2.actno = TRAP_ACTNO_WATER02;
_local2.actflag = 0;
_local2.step = 0;
_local2.body_radius = 0;
_local2.attack_radius = 0;
_local2.hitstop_timer = 0;
_local2.pos_line = vec3d_Create(0, 0, 0);
_local2.pos_stage = vec3d_Create(x, y, z);
_local2.stageObj = StageSpriteMan_CreateObject(_root.stageSpriteMgr, STAGESPRITE_TYPE_WATER);
_local2.stageObj.baseScale = 100;
_local2.stage_mc = StageSpriteMan_CreateMC(_root.stageSpriteMgr, "Water02EffAnimation");
_local2.stage_mc._visible = false;
_local2.spd_x = (_local2.spd_y = (_local2.spd_z = 0));
_local2.acc_x = (_local2.acc_y = (_local2.acc_z = 0));
_local2.spd_y = 0.03125 + ((Math.random() * 255) / 4096);
_local2.acc_y = -0.001953125;
_local2.spd_x = 0.09375 + ((Math.random() * 255) / 4096);
_local2.acc_x = -0.00390625;
if (Math.random() < 0.5) {
_local2.spd_x = -_local2.spd_x;
_local2.acc_x = -_local2.acc_x;
}
_local2.spd_z = 0.21875 + ((Math.random() * 127) / 4096);
var _local3 = (4096 - Math.floor(Math.random() * 2047)) / 4096;
_local2.stageObj.baseScale = _local3 * 100;
return(_local2);
}
function effect_water02_exec() {
this.pos_stage.x = this.pos_stage.x + this.spd_x;
this.pos_stage.y = this.pos_stage.y + this.spd_y;
this.pos_stage.z = this.pos_stage.z + this.spd_z;
this.spd_x = this.spd_x + this.acc_x;
this.spd_y = this.spd_y + this.acc_y;
this.spd_z = this.spd_z + this.acc_z;
this.stageObj.pos.x = this.pos_stage.x;
this.stageObj.pos.y = this.pos_stage.y;
this.stageObj.pos.z = this.pos_stage.z;
this.stage_mc._visible = true;
StageSpriteMan_AddOrder(_root.stageSpriteMgr, this.stageObj, this.stage_mc);
if (this.stage_mc._currentframe >= EFFECT_WATER02_PAT_END_FRAME) {
this.taskflag = this.taskflag | GAME_TASKFLAG_KILL;
}
}
function effect_water02_exit() {
this.stageObj = null;
this.stage_mc.removeMovieClip();
this.stage_mc = null;
}
function vec3d_Create(x, y, z) {
return({x:x, y:y, z:z});
}
function vec3d_Clone(v) {
return({x:v.x, y:v.y, z:v.z});
}
function vec3d_Add(a, b) {
return({x:a.x + b.x, y:a.y + b.y, z:a.z + b.z});
}
function vec3d_Subtract(a, b) {
return({x:a.x - b.x, y:a.y - b.y, z:a.z - b.z});
}
function vec3d_Scale(a, v) {
return({x:a * v.x, y:a * v.y, z:a * v.z});
}
function vec3d_DotProduct(a, b) {
return(((a.x * b.x) + (a.y * b.y)) + (a.z * b.z));
}
function vec3d_CrossProduct(a, b) {
return({x:(a.y * b.z) - (a.z * b.y), y:(a.z * b.x) - (a.x * b.z), z:(a.x * b.y) - (a.y * b.x)});
}
function vec3d_Mag(v) {
return(Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z)));
}
function vec3d_Normalize(v) {
var _local2 = Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
if (_local2 > 0) {
_local2 = 1 / _local2;
}
return({x:v.x * _local2, y:v.y * _local2, z:v.z * _local2});
}
function vec3d_MultAdd(a, v1, v2) {
return({x:v2.x + (a * v1.x), y:v2.y + (a * v1.y), z:v2.z + (a * v1.z)});
}
function vec3d_Set(v, x, y, z) {
v.x = x;
v.y = y;
v.z = z;
}
function ObjSpdUpSet(lSpd, sSpd, sMaxSpd) {
lSpd = lSpd + sSpd;
if (sMaxSpd == 0) {
return(lSpd);
}
if (sSpd >= 0) {
if (lSpd > sMaxSpd) {
lSpd = sMaxSpd;
}
} else if (lSpd < (-sMaxSpd)) {
lSpd = -sMaxSpd;
}
return(lSpd);
}
function ObjSpdDownSet(lSpd, sSpd) {
if (lSpd > 0) {
lSpd = lSpd - sSpd;
if (lSpd < 0) {
lSpd = 0;
}
} else {
lSpd = lSpd + sSpd;
if (lSpd > 0) {
lSpd = 0;
}
}
return(lSpd);
}
function ObjShiftSet(lPos, sTag, divStep, usMax, usMin) {
var _local1;
if (lPos == sTag) {
return(lPos);
}
if (usMin == 0) {
usMin = 1;
}
_local1 = (sTag - lPos) * divStep;
if (usMax > 0) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin > 0) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ObjDiffSet(lPos, sTag, sSrc, divStep, usMax, usMin) {
if (lPos == sTag) {
return(lPos);
}
if (!usMin) {
usMin = 1;
}
var _local1;
_local1 = (lPos - sSrc) * divStep;
if (sTag > sSrc) {
if (_local1 < 0) {
_local1 = 0;
}
}
if (sTag < sSrc) {
if (_local1 > 0) {
_local1 = 0;
}
}
if (usMax) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ComputeNumBCDCode(val, valMax) {
if (val >= valMax) {
if (valMax == 0) {
val = 0;
} else {
val = valMax - 1;
}
}
var _local1;
var _local6 = 0;
var _local2 = valMax;
var _local4;
if (_local2 >= 100) {
_local2 = Math.floor(_local2 / 10);
_local1 = 0;
for(;;){
if (val >= _local2) {
_local4 = Math.floor(val / _local2);
_local6 = _local6 | (_local4 << _local1);
val = val - (_local4 * _local2);
}
_local1 = _local1 + 4;
if (_local2 <= 10) {
break;
}
_local2 = Math.floor(_local2 / 10);
};
}
_local6 = _local6 | (val << _local1);
var _local5 = _local1 / 4;
if (_local5 > 7) {
_local5 = 7;
} else if (_local5 < 0) {
_local5 = 0;
}
var _local9 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local8 = 0;
var _local7;
_local1 = 0;
while (_local1 < (_local5 + 1)) {
_local7 = (_local6 >> (4 * _local1)) & 15;
_local8 = _local8 | (_local7 << _local9[(7 - _local5) + _local1]);
_local1++;
}
return(_local8);
}
function ComputeTimeBCDCode(frameVal) {
var _local7 = [1080000, 108000, 18000, 1800, 300, 30, 10, 1];
var _local6 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local1;
var _local5 = 0;
var _local3;
var _local4;
_local1 = 0;
while (_local1 < 7) {
_local3 = _local7[_local1];
if (_local1 == 6) {
frameVal = Math.floor(frameVal * 3.4140625);
}
if (frameVal >= _local3) {
_local4 = Math.floor(frameVal / _local3);
_local5 = _local5 | (_local4 << _local6[_local1]);
frameVal = frameVal - (_local4 * _local3);
}
_local1++;
}
_local5 = _local5 | (frameVal << _local6[_local1]);
return(_local5);
}
function testVector3() {
}
function EffectBoost_Create() {
var _local2 = new Object();
_local2.taskflag = GAME_TASKFLAG_NOHIT;
_local2.exec = effect_boost_exec;
_local2.exit = effect_boost_exit;
_local2.actno = TRAP_ACTNO_BOOST_A;
_local2.actflag = 0;
_local2.step = 0;
_local2.body_radius = 0;
_local2.attack_radius = 0;
_local2.hitstop_timer = 0;
_local2.pos_line = vec3d_Create(0, 0, 0);
_local2.pos_stage = vec3d_Create(0, 0, 0);
_local2.stageObj = StageSpriteMan_CreateObject(_root.stageSpriteMgr, STAGESPRITE_TYPE_BOOST);
_local2.stageObj.baseScale = 100;
_local2.stage_mc = StageSpriteMan_CreateMC(_root.stageSpriteMgr, "BoostEffAnimation");
_local2.stage_mc._visible = false;
return(_local2);
}
function effect_boost_exec() {
if (!(_root.gameSeq.m_player.user_flag & SBD_SHIP_FLAG_BOOST)) {
this.taskflag = this.taskflag | GAME_TASKFLAG_KILL;
}
this.pos_stage.x = _root.gameSeq.m_player.stageObj.pos.x;
this.pos_stage.y = _root.gameSeq.m_player.stageObj.pos.y + 0.25;
this.pos_stage.z = _root.gameSeq.m_player.stageObj.pos.z - 1.5;
this.stageObj.pos.x = this.pos_stage.x;
this.stageObj.pos.y = this.pos_stage.y;
this.stageObj.pos.z = this.pos_stage.z;
this.stage_mc._visible = true;
StageSpriteMan_AddOrder(_root.stageSpriteMgr, this.stageObj, this.stage_mc);
}
function effect_boost_exit() {
this.stageObj = null;
this.stage_mc.removeMovieClip();
this.stage_mc = null;
}
function vec3d_Create(x, y, z) {
return({x:x, y:y, z:z});
}
function vec3d_Clone(v) {
return({x:v.x, y:v.y, z:v.z});
}
function vec3d_Add(a, b) {
return({x:a.x + b.x, y:a.y + b.y, z:a.z + b.z});
}
function vec3d_Subtract(a, b) {
return({x:a.x - b.x, y:a.y - b.y, z:a.z - b.z});
}
function vec3d_Scale(a, v) {
return({x:a * v.x, y:a * v.y, z:a * v.z});
}
function vec3d_DotProduct(a, b) {
return(((a.x * b.x) + (a.y * b.y)) + (a.z * b.z));
}
function vec3d_CrossProduct(a, b) {
return({x:(a.y * b.z) - (a.z * b.y), y:(a.z * b.x) - (a.x * b.z), z:(a.x * b.y) - (a.y * b.x)});
}
function vec3d_Mag(v) {
return(Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z)));
}
function vec3d_Normalize(v) {
var _local2 = Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
if (_local2 > 0) {
_local2 = 1 / _local2;
}
return({x:v.x * _local2, y:v.y * _local2, z:v.z * _local2});
}
function vec3d_MultAdd(a, v1, v2) {
return({x:v2.x + (a * v1.x), y:v2.y + (a * v1.y), z:v2.z + (a * v1.z)});
}
function vec3d_Set(v, x, y, z) {
v.x = x;
v.y = y;
v.z = z;
}
function ObjSpdUpSet(lSpd, sSpd, sMaxSpd) {
lSpd = lSpd + sSpd;
if (sMaxSpd == 0) {
return(lSpd);
}
if (sSpd >= 0) {
if (lSpd > sMaxSpd) {
lSpd = sMaxSpd;
}
} else if (lSpd < (-sMaxSpd)) {
lSpd = -sMaxSpd;
}
return(lSpd);
}
function ObjSpdDownSet(lSpd, sSpd) {
if (lSpd > 0) {
lSpd = lSpd - sSpd;
if (lSpd < 0) {
lSpd = 0;
}
} else {
lSpd = lSpd + sSpd;
if (lSpd > 0) {
lSpd = 0;
}
}
return(lSpd);
}
function ObjShiftSet(lPos, sTag, divStep, usMax, usMin) {
var _local1;
if (lPos == sTag) {
return(lPos);
}
if (usMin == 0) {
usMin = 1;
}
_local1 = (sTag - lPos) * divStep;
if (usMax > 0) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin > 0) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ObjDiffSet(lPos, sTag, sSrc, divStep, usMax, usMin) {
if (lPos == sTag) {
return(lPos);
}
if (!usMin) {
usMin = 1;
}
var _local1;
_local1 = (lPos - sSrc) * divStep;
if (sTag > sSrc) {
if (_local1 < 0) {
_local1 = 0;
}
}
if (sTag < sSrc) {
if (_local1 > 0) {
_local1 = 0;
}
}
if (usMax) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ComputeNumBCDCode(val, valMax) {
if (val >= valMax) {
if (valMax == 0) {
val = 0;
} else {
val = valMax - 1;
}
}
var _local1;
var _local6 = 0;
var _local2 = valMax;
var _local4;
if (_local2 >= 100) {
_local2 = Math.floor(_local2 / 10);
_local1 = 0;
for(;;){
if (val >= _local2) {
_local4 = Math.floor(val / _local2);
_local6 = _local6 | (_local4 << _local1);
val = val - (_local4 * _local2);
}
_local1 = _local1 + 4;
if (_local2 <= 10) {
break;
}
_local2 = Math.floor(_local2 / 10);
};
}
_local6 = _local6 | (val << _local1);
var _local5 = _local1 / 4;
if (_local5 > 7) {
_local5 = 7;
} else if (_local5 < 0) {
_local5 = 0;
}
var _local9 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local8 = 0;
var _local7;
_local1 = 0;
while (_local1 < (_local5 + 1)) {
_local7 = (_local6 >> (4 * _local1)) & 15;
_local8 = _local8 | (_local7 << _local9[(7 - _local5) + _local1]);
_local1++;
}
return(_local8);
}
function ComputeTimeBCDCode(frameVal) {
var _local7 = [1080000, 108000, 18000, 1800, 300, 30, 10, 1];
var _local6 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local1;
var _local5 = 0;
var _local3;
var _local4;
_local1 = 0;
while (_local1 < 7) {
_local3 = _local7[_local1];
if (_local1 == 6) {
frameVal = Math.floor(frameVal * 3.4140625);
}
if (frameVal >= _local3) {
_local4 = Math.floor(frameVal / _local3);
_local5 = _local5 | (_local4 << _local6[_local1]);
frameVal = frameVal - (_local4 * _local3);
}
_local1++;
}
_local5 = _local5 | (frameVal << _local6[_local1]);
return(_local5);
}
function testVector3() {
}
function EffectSmoke_Create(x, y, z, acttype) {
var _local2 = new Object();
_local2.taskflag = GAME_TASKFLAG_NOHIT;
_local2.exec = effect_smoke_exec;
_local2.exit = effect_smoke_exit;
_local2.actno = TRAP_ACTNO_SMOKE;
_local2.actflag = 0;
_local2.step = 0;
_local2.body_radius = 0;
_local2.attack_radius = 0;
_local2.hitstop_timer = 0;
_local2.pos_line = vec3d_Create(0, 0, 0);
_local2.pos_stage = vec3d_Create(x, y, z);
_local2.stageObj = StageSpriteMan_CreateObject(_root.stageSpriteMgr, STAGESPRITE_TYPE_WATER);
_local2.stageObj.baseScale = 100;
_local2.stage_mc = StageSpriteMan_CreateMC(_root.stageSpriteMgr, "SmokeEffAnimation");
_local2.stage_mc._visible = false;
_local2.spd_x = (_local2.spd_y = (_local2.spd_z = 0));
_local2.acc_x = (_local2.acc_y = (_local2.acc_z = 0));
if (acttype == 0) {
_local2.spd_y = (512 - Math.floor(Math.random() * 127)) / 4096;
_local2.acc_y = (-(8 + Math.floor(Math.random() * 7))) / 4096;
_local2.spd_x = (128 - Math.floor(Math.random() * 255)) / 4096;
_local2.acc_x = (4 - Math.floor(Math.random() * 7)) / 4096;
_local2.spd_z = (128 - Math.floor(Math.random() * 255)) / 4096;
_local2.acc_z = (4 - Math.floor(Math.random() * 7)) / 4096;
var _local6 = (4096 - Math.floor(Math.random() * 2047)) / 4096;
_local2.stageObj.baseScale = _local6 * 100;
} else {
var _local7 = acttype;
var _local4 = 0;
var _local3 = 0;
_local4 = _local7 * SBD_EFF_DAMAGE_SMOKE_ANGLE;
if (_local4 >= 65536) {
_local3 = _local3 + SBD_EFF_DAMAGE_SMOKE_ANGLE_ADD;
}
_local3 = _local3 + _local4;
_local3 = _local3 & 65535;
var _local5 = (_local3 * (Math.PI*2)) / 65536;
_local2.spd_y = (-SBD_EFF_DAMAGE_SMOKE_SPD) * Math.sin(_local5);
_local2.spd_x = SBD_EFF_DAMAGE_SMOKE_SPD * Math.cos(_local5);
_local2.spd_z = 0;
_local2.acc_x = (-_local2.spd_x) * SBD_EFF_DAMAGE_SMOKE_ADD_SCALE;
_local2.acc_y = (-_local2.spd_y) * SBD_EFF_DAMAGE_SMOKE_ADD_SCALE;
_local2.acc_z = (-_local2.spd_z) * SBD_EFF_DAMAGE_SMOKE_ADD_SCALE;
}
return(_local2);
}
function effect_smoke_exec() {
this.pos_stage.x = this.pos_stage.x + this.spd_x;
this.pos_stage.y = this.pos_stage.y + this.spd_y;
this.pos_stage.z = this.pos_stage.z + this.spd_z;
this.spd_x = this.spd_x + this.acc_x;
this.spd_y = this.spd_y + this.acc_y;
this.spd_z = this.spd_z + this.acc_z;
this.stageObj.pos.x = this.pos_stage.x;
this.stageObj.pos.y = this.pos_stage.y;
this.stageObj.pos.z = this.pos_stage.z;
this.stage_mc._visible = true;
StageSpriteMan_AddOrder(_root.stageSpriteMgr, this.stageObj, this.stage_mc);
if (this.stage_mc._currentframe >= EFFECT_SMOKE_PAT_END_FRAME) {
this.taskflag = this.taskflag | GAME_TASKFLAG_KILL;
}
}
function effect_smoke_exit() {
this.stageObj = null;
this.stage_mc.removeMovieClip();
this.stage_mc = null;
}
function EffectSmokeDamage_Create(x, y, z) {
var _local1 = new Object();
_local1.taskflag = GAME_TASKFLAG_NOHIT;
_local1.exec = effect_smokedamage_exec;
_local1.exit = effect_smokedamage_exit;
_local1.actno = TRAP_ACTNO_SMOKE_DAMAGE;
_local1.actflag = 0;
_local1.step = 0;
_local1.body_radius = 0;
_local1.attack_radius = 0;
_local1.hitstop_timer = 0;
_local1.pos_line = vec3d_Create(0, 0, 0);
_local1.pos_stage = vec3d_Create(x, y, z);
_local1.stageObj = null;
_local1.stage_mc = null;
_local1.timer = 0;
return(_local1);
}
function effect_smokedamage_exec() {
_root.gameSeq.MakeEffect3d(this.pos_stage.x, this.pos_stage.y, this.pos_stage.z, TRAP_ACTNO_SMOKE, this.timer);
this.timer++;
if (this.timer >= SBD_EFF_DAMAGE_SMOKE_NUM) {
this.taskflag = this.taskflag | GAME_TASKFLAG_KILL;
}
}
function effect_smokedamage_exit() {
}
function vec3d_Create(x, y, z) {
return({x:x, y:y, z:z});
}
function vec3d_Clone(v) {
return({x:v.x, y:v.y, z:v.z});
}
function vec3d_Add(a, b) {
return({x:a.x + b.x, y:a.y + b.y, z:a.z + b.z});
}
function vec3d_Subtract(a, b) {
return({x:a.x - b.x, y:a.y - b.y, z:a.z - b.z});
}
function vec3d_Scale(a, v) {
return({x:a * v.x, y:a * v.y, z:a * v.z});
}
function vec3d_DotProduct(a, b) {
return(((a.x * b.x) + (a.y * b.y)) + (a.z * b.z));
}
function vec3d_CrossProduct(a, b) {
return({x:(a.y * b.z) - (a.z * b.y), y:(a.z * b.x) - (a.x * b.z), z:(a.x * b.y) - (a.y * b.x)});
}
function vec3d_Mag(v) {
return(Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z)));
}
function vec3d_Normalize(v) {
var _local2 = Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
if (_local2 > 0) {
_local2 = 1 / _local2;
}
return({x:v.x * _local2, y:v.y * _local2, z:v.z * _local2});
}
function vec3d_MultAdd(a, v1, v2) {
return({x:v2.x + (a * v1.x), y:v2.y + (a * v1.y), z:v2.z + (a * v1.z)});
}
function vec3d_Set(v, x, y, z) {
v.x = x;
v.y = y;
v.z = z;
}
function ObjSpdUpSet(lSpd, sSpd, sMaxSpd) {
lSpd = lSpd + sSpd;
if (sMaxSpd == 0) {
return(lSpd);
}
if (sSpd >= 0) {
if (lSpd > sMaxSpd) {
lSpd = sMaxSpd;
}
} else if (lSpd < (-sMaxSpd)) {
lSpd = -sMaxSpd;
}
return(lSpd);
}
function ObjSpdDownSet(lSpd, sSpd) {
if (lSpd > 0) {
lSpd = lSpd - sSpd;
if (lSpd < 0) {
lSpd = 0;
}
} else {
lSpd = lSpd + sSpd;
if (lSpd > 0) {
lSpd = 0;
}
}
return(lSpd);
}
function ObjShiftSet(lPos, sTag, divStep, usMax, usMin) {
var _local1;
if (lPos == sTag) {
return(lPos);
}
if (usMin == 0) {
usMin = 1;
}
_local1 = (sTag - lPos) * divStep;
if (usMax > 0) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin > 0) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ObjDiffSet(lPos, sTag, sSrc, divStep, usMax, usMin) {
if (lPos == sTag) {
return(lPos);
}
if (!usMin) {
usMin = 1;
}
var _local1;
_local1 = (lPos - sSrc) * divStep;
if (sTag > sSrc) {
if (_local1 < 0) {
_local1 = 0;
}
}
if (sTag < sSrc) {
if (_local1 > 0) {
_local1 = 0;
}
}
if (usMax) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ComputeNumBCDCode(val, valMax) {
if (val >= valMax) {
if (valMax == 0) {
val = 0;
} else {
val = valMax - 1;
}
}
var _local1;
var _local6 = 0;
var _local2 = valMax;
var _local4;
if (_local2 >= 100) {
_local2 = Math.floor(_local2 / 10);
_local1 = 0;
for(;;){
if (val >= _local2) {
_local4 = Math.floor(val / _local2);
_local6 = _local6 | (_local4 << _local1);
val = val - (_local4 * _local2);
}
_local1 = _local1 + 4;
if (_local2 <= 10) {
break;
}
_local2 = Math.floor(_local2 / 10);
};
}
_local6 = _local6 | (val << _local1);
var _local5 = _local1 / 4;
if (_local5 > 7) {
_local5 = 7;
} else if (_local5 < 0) {
_local5 = 0;
}
var _local9 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local8 = 0;
var _local7;
_local1 = 0;
while (_local1 < (_local5 + 1)) {
_local7 = (_local6 >> (4 * _local1)) & 15;
_local8 = _local8 | (_local7 << _local9[(7 - _local5) + _local1]);
_local1++;
}
return(_local8);
}
function ComputeTimeBCDCode(frameVal) {
var _local7 = [1080000, 108000, 18000, 1800, 300, 30, 10, 1];
var _local6 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local1;
var _local5 = 0;
var _local3;
var _local4;
_local1 = 0;
while (_local1 < 7) {
_local3 = _local7[_local1];
if (_local1 == 6) {
frameVal = Math.floor(frameVal * 3.4140625);
}
if (frameVal >= _local3) {
_local4 = Math.floor(frameVal / _local3);
_local5 = _local5 | (_local4 << _local6[_local1]);
frameVal = frameVal - (_local4 * _local3);
}
_local1++;
}
_local5 = _local5 | (frameVal << _local6[_local1]);
return(_local5);
}
function testVector3() {
}
function EffectHit_Create(x, y, z) {
var _local2 = new Object();
_local2.taskflag = GAME_TASKFLAG_NOHIT;
_local2.exec = effect_hit_exec;
_local2.exit = effect_hit_exit;
_local2.actno = TRAP_ACTNO_HIT;
_local2.actflag = 0;
_local2.step = 0;
_local2.body_radius = 0;
_local2.attack_radius = 0;
_local2.hitstop_timer = 0;
_local2.pos_line = vec3d_Create(0, 0, 0);
_local2.pos_stage = vec3d_Create(x, y, z);
_local2.stageObj = StageSpriteMan_CreateObject(_root.stageSpriteMgr, STAGESPRITE_TYPE_WATER);
_local2.stageObj.baseScale = 100;
_local2.stage_mc = StageSpriteMan_CreateMC(_root.stageSpriteMgr, "HitEffAnimation");
_local2.stage_mc._visible = false;
_local2.stageObj.pos.x = _local2.pos_stage.x;
_local2.stageObj.pos.y = _local2.pos_stage.y;
_local2.stageObj.pos.z = _local2.pos_stage.z;
return(_local2);
}
function effect_hit_exec() {
this.stage_mc._visible = true;
StageSpriteMan_AddOrder(_root.stageSpriteMgr, this.stageObj, this.stage_mc);
if (this.stage_mc._currentframe >= EFFECT_HIT_PAT_END_FRAME) {
this.taskflag = this.taskflag | GAME_TASKFLAG_KILL;
}
}
function effect_hit_exit() {
this.stageObj = null;
this.stage_mc.removeMovieClip();
this.stage_mc = null;
}
function vec3d_Create(x, y, z) {
return({x:x, y:y, z:z});
}
function vec3d_Clone(v) {
return({x:v.x, y:v.y, z:v.z});
}
function vec3d_Add(a, b) {
return({x:a.x + b.x, y:a.y + b.y, z:a.z + b.z});
}
function vec3d_Subtract(a, b) {
return({x:a.x - b.x, y:a.y - b.y, z:a.z - b.z});
}
function vec3d_Scale(a, v) {
return({x:a * v.x, y:a * v.y, z:a * v.z});
}
function vec3d_DotProduct(a, b) {
return(((a.x * b.x) + (a.y * b.y)) + (a.z * b.z));
}
function vec3d_CrossProduct(a, b) {
return({x:(a.y * b.z) - (a.z * b.y), y:(a.z * b.x) - (a.x * b.z), z:(a.x * b.y) - (a.y * b.x)});
}
function vec3d_Mag(v) {
return(Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z)));
}
function vec3d_Normalize(v) {
var _local2 = Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
if (_local2 > 0) {
_local2 = 1 / _local2;
}
return({x:v.x * _local2, y:v.y * _local2, z:v.z * _local2});
}
function vec3d_MultAdd(a, v1, v2) {
return({x:v2.x + (a * v1.x), y:v2.y + (a * v1.y), z:v2.z + (a * v1.z)});
}
function vec3d_Set(v, x, y, z) {
v.x = x;
v.y = y;
v.z = z;
}
function ObjSpdUpSet(lSpd, sSpd, sMaxSpd) {
lSpd = lSpd + sSpd;
if (sMaxSpd == 0) {
return(lSpd);
}
if (sSpd >= 0) {
if (lSpd > sMaxSpd) {
lSpd = sMaxSpd;
}
} else if (lSpd < (-sMaxSpd)) {
lSpd = -sMaxSpd;
}
return(lSpd);
}
function ObjSpdDownSet(lSpd, sSpd) {
if (lSpd > 0) {
lSpd = lSpd - sSpd;
if (lSpd < 0) {
lSpd = 0;
}
} else {
lSpd = lSpd + sSpd;
if (lSpd > 0) {
lSpd = 0;
}
}
return(lSpd);
}
function ObjShiftSet(lPos, sTag, divStep, usMax, usMin) {
var _local1;
if (lPos == sTag) {
return(lPos);
}
if (usMin == 0) {
usMin = 1;
}
_local1 = (sTag - lPos) * divStep;
if (usMax > 0) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin > 0) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ObjDiffSet(lPos, sTag, sSrc, divStep, usMax, usMin) {
if (lPos == sTag) {
return(lPos);
}
if (!usMin) {
usMin = 1;
}
var _local1;
_local1 = (lPos - sSrc) * divStep;
if (sTag > sSrc) {
if (_local1 < 0) {
_local1 = 0;
}
}
if (sTag < sSrc) {
if (_local1 > 0) {
_local1 = 0;
}
}
if (usMax) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ComputeNumBCDCode(val, valMax) {
if (val >= valMax) {
if (valMax == 0) {
val = 0;
} else {
val = valMax - 1;
}
}
var _local1;
var _local6 = 0;
var _local2 = valMax;
var _local4;
if (_local2 >= 100) {
_local2 = Math.floor(_local2 / 10);
_local1 = 0;
for(;;){
if (val >= _local2) {
_local4 = Math.floor(val / _local2);
_local6 = _local6 | (_local4 << _local1);
val = val - (_local4 * _local2);
}
_local1 = _local1 + 4;
if (_local2 <= 10) {
break;
}
_local2 = Math.floor(_local2 / 10);
};
}
_local6 = _local6 | (val << _local1);
var _local5 = _local1 / 4;
if (_local5 > 7) {
_local5 = 7;
} else if (_local5 < 0) {
_local5 = 0;
}
var _local9 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local8 = 0;
var _local7;
_local1 = 0;
while (_local1 < (_local5 + 1)) {
_local7 = (_local6 >> (4 * _local1)) & 15;
_local8 = _local8 | (_local7 << _local9[(7 - _local5) + _local1]);
_local1++;
}
return(_local8);
}
function ComputeTimeBCDCode(frameVal) {
var _local7 = [1080000, 108000, 18000, 1800, 300, 30, 10, 1];
var _local6 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local1;
var _local5 = 0;
var _local3;
var _local4;
_local1 = 0;
while (_local1 < 7) {
_local3 = _local7[_local1];
if (_local1 == 6) {
frameVal = Math.floor(frameVal * 3.4140625);
}
if (frameVal >= _local3) {
_local4 = Math.floor(frameVal / _local3);
_local5 = _local5 | (_local4 << _local6[_local1]);
frameVal = frameVal - (_local4 * _local3);
}
_local1++;
}
_local5 = _local5 | (frameVal << _local6[_local1]);
return(_local5);
}
function testVector3() {
}
function EffectBom_Create(x, y, z) {
var _local2 = new Object();
_local2.taskflag = GAME_TASKFLAG_NOHIT;
_local2.exec = effect_bom_exec;
_local2.exit = effect_bom_exit;
_local2.actno = TRAP_ACTNO_BOM;
_local2.actflag = 0;
_local2.step = 0;
_local2.body_radius = 0;
_local2.attack_radius = 0;
_local2.hitstop_timer = 0;
_local2.pos_line = vec3d_Create(0, 0, 0);
y = y + SBD_EFF_BOMB_OFST_Y;
_local2.pos_stage = vec3d_Create(x, y, z);
_local2.stageObj = StageSpriteMan_CreateObject(_root.stageSpriteMgr, STAGESPRITE_TYPE_BOOST);
_local2.stageObj.baseScale = 150;
_local2.stage_mc = StageSpriteMan_CreateMC(_root.stageSpriteMgr, "BomEffAnimation");
_local2.stage_mc._visible = false;
_local2.stageObj.pos.x = _local2.pos_stage.x;
_local2.stageObj.pos.y = _local2.pos_stage.y;
_local2.stageObj.pos.z = _local2.pos_stage.z;
return(_local2);
}
function effect_bom_exec() {
this.stage_mc._visible = true;
StageSpriteMan_AddOrder(_root.stageSpriteMgr, this.stageObj, this.stage_mc);
if (this.stage_mc._currentframe >= EFFECT_BOM_PAT_END_FRAME) {
this.taskflag = this.taskflag | GAME_TASKFLAG_KILL;
}
}
function effect_bom_exit() {
this.stageObj = null;
this.stage_mc.removeMovieClip();
this.stage_mc = null;
}
function vec3d_Create(x, y, z) {
return({x:x, y:y, z:z});
}
function vec3d_Clone(v) {
return({x:v.x, y:v.y, z:v.z});
}
function vec3d_Add(a, b) {
return({x:a.x + b.x, y:a.y + b.y, z:a.z + b.z});
}
function vec3d_Subtract(a, b) {
return({x:a.x - b.x, y:a.y - b.y, z:a.z - b.z});
}
function vec3d_Scale(a, v) {
return({x:a * v.x, y:a * v.y, z:a * v.z});
}
function vec3d_DotProduct(a, b) {
return(((a.x * b.x) + (a.y * b.y)) + (a.z * b.z));
}
function vec3d_CrossProduct(a, b) {
return({x:(a.y * b.z) - (a.z * b.y), y:(a.z * b.x) - (a.x * b.z), z:(a.x * b.y) - (a.y * b.x)});
}
function vec3d_Mag(v) {
return(Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z)));
}
function vec3d_Normalize(v) {
var _local2 = Math.sqrt(((v.x * v.x) + (v.y * v.y)) + (v.z * v.z));
if (_local2 > 0) {
_local2 = 1 / _local2;
}
return({x:v.x * _local2, y:v.y * _local2, z:v.z * _local2});
}
function vec3d_MultAdd(a, v1, v2) {
return({x:v2.x + (a * v1.x), y:v2.y + (a * v1.y), z:v2.z + (a * v1.z)});
}
function vec3d_Set(v, x, y, z) {
v.x = x;
v.y = y;
v.z = z;
}
function ObjSpdUpSet(lSpd, sSpd, sMaxSpd) {
lSpd = lSpd + sSpd;
if (sMaxSpd == 0) {
return(lSpd);
}
if (sSpd >= 0) {
if (lSpd > sMaxSpd) {
lSpd = sMaxSpd;
}
} else if (lSpd < (-sMaxSpd)) {
lSpd = -sMaxSpd;
}
return(lSpd);
}
function ObjSpdDownSet(lSpd, sSpd) {
if (lSpd > 0) {
lSpd = lSpd - sSpd;
if (lSpd < 0) {
lSpd = 0;
}
} else {
lSpd = lSpd + sSpd;
if (lSpd > 0) {
lSpd = 0;
}
}
return(lSpd);
}
function ObjShiftSet(lPos, sTag, divStep, usMax, usMin) {
var _local1;
if (lPos == sTag) {
return(lPos);
}
if (usMin == 0) {
usMin = 1;
}
_local1 = (sTag - lPos) * divStep;
if (usMax > 0) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin > 0) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ObjDiffSet(lPos, sTag, sSrc, divStep, usMax, usMin) {
if (lPos == sTag) {
return(lPos);
}
if (!usMin) {
usMin = 1;
}
var _local1;
_local1 = (lPos - sSrc) * divStep;
if (sTag > sSrc) {
if (_local1 < 0) {
_local1 = 0;
}
}
if (sTag < sSrc) {
if (_local1 > 0) {
_local1 = 0;
}
}
if (usMax) {
if (_local1 > usMax) {
_local1 = usMax;
}
if (_local1 < (-usMax)) {
_local1 = -usMax;
}
}
if (usMin) {
if (_local1 > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
} else if (_local1 < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
} else {
if ((sTag - lPos) > 0) {
if (_local1 < usMin) {
_local1 = usMin;
}
}
if ((sTag - lPos) < 0) {
if (_local1 > (-usMin)) {
_local1 = -usMin;
}
}
}
}
lPos = lPos + _local1;
if (_local1 > 0) {
if (lPos > sTag) {
lPos = sTag;
}
} else if (_local1 < 0) {
if (lPos < sTag) {
lPos = sTag;
}
}
return(lPos);
}
function ComputeNumBCDCode(val, valMax) {
if (val >= valMax) {
if (valMax == 0) {
val = 0;
} else {
val = valMax - 1;
}
}
var _local1;
var _local6 = 0;
var _local2 = valMax;
var _local4;
if (_local2 >= 100) {
_local2 = Math.floor(_local2 / 10);
_local1 = 0;
for(;;){
if (val >= _local2) {
_local4 = Math.floor(val / _local2);
_local6 = _local6 | (_local4 << _local1);
val = val - (_local4 * _local2);
}
_local1 = _local1 + 4;
if (_local2 <= 10) {
break;
}
_local2 = Math.floor(_local2 / 10);
};
}
_local6 = _local6 | (val << _local1);
var _local5 = _local1 / 4;
if (_local5 > 7) {
_local5 = 7;
} else if (_local5 < 0) {
_local5 = 0;
}
var _local9 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local8 = 0;
var _local7;
_local1 = 0;
while (_local1 < (_local5 + 1)) {
_local7 = (_local6 >> (4 * _local1)) & 15;
_local8 = _local8 | (_local7 << _local9[(7 - _local5) + _local1]);
_local1++;
}
return(_local8);
}
function ComputeTimeBCDCode(frameVal) {
var _local7 = [1080000, 108000, 18000, 1800, 300, 30, 10, 1];
var _local6 = [28, 24, 20, 16, 12, 8, 4, 0];
var _local1;
var _local5 = 0;
var _local3;
var _local4;
_local1 = 0;
while (_local1 < 7) {
_local3 = _local7[_local1];
if (_local1 == 6) {
frameVal = Math.floor(frameVal * 3.4140625);
}
if (frameVal >= _local3) {
_local4 = Math.floor(frameVal / _local3);
_local5 = _local5 | (_local4 << _local6[_local1]);
frameVal = frameVal - (_local4 * _local3);
}
_local1++;
}
_local5 = _local5 | (frameVal << _local6[_local1]);
return(_local5);
}
function testVector3() {
}
function EffectBoostWind_Create() {
var _local2 = new Object();
_local2.taskflag = GAME_TASKFLAG_NOHIT;
_local2.exec = effect_boostwind_exec;
_local2.exit = effect_boostwind_exit;
_local2.actno = TRAP_ACTNO_BOOST_WIND;
_local2.actflag = 0;
_local2.step = 0;
_local2.body_radius = 0;
_local2.attack_radius = 0;
_local2.hitstop_timer = 0;
_local2.pos_line = vec3d_Create(0, 0, 0);
_local2.pos_stage = vec3d_Create(0, 0, 0);
_local2.stageObj = StageSpriteMan_CreateObject(_root.stageSpriteMgr, STAGESPRITE_TYPE_BOOST_WIND);
_local2.stageObj.baseScale = 100;
_local2.stage_mc = StageSpriteMan_CreateEmptyMC(_root.stageSpriteMgr, "BoostWind");
_local2.stage_mc._visible = false;
_local2.timer = 0;
_local2.lives = new Array(SBD_EFF_BOOST_NUM);
_local2.lines = new Array();
var _local3;
_local3 = 0;
while (_local3 < _local2.lives.length) {
_local2.lives[_local3] = false;
_local3++;
}
return(_local2);
}
function effect_boostwind_exec() {
var _local11 = 0;
var _local12 = SBD_EFF_BW_START_POS_Y;
var _local13 = SBD_EFF_BW_START_POS_Z;
var _local3;
if (_root.gameSeq.m_player.user_flag & (SBD_SHIP_FLAG_BOOST | SBD_SHIP_FLAG_SPDUP)) {
var _local25 = this.lives.length;
var _local24;
var _local14;
var _local4;
var _local18;
var _local17;
var _local16;
_local3 = 0;
while (_local3 < _local25) {
if (!this.lives[_local3]) {
if ((this.timer >> 1) == (_local3 >> 1)) {
_local24 = Math.floor(Math.random() * 65535) & 65535;
_local14 = (_local24 * (Math.PI*2)) / 65536;
_local4 = new Object();
_local4.taskflag = 0;
_local4.live_id = _local3;
_local18 = SBD_EFF_BW_END_LENGTH * Math.sin(_local14);
_local17 = (SBD_EFF_BW_END_LENGTH * Math.cos(_local14)) + SBD_EFF_BW_END_POS_Y;
_local16 = 0;
_local4.dir_x = (_local18 - _local11) / 128;
_local4.dir_y = (_local17 - _local12) / 128;
_local4.dir_z = (_local16 - _local13) / 128;
_local4.move = SBD_EFF_BW_START_POS;
_local4.pos_s = vec3d_Create(0, 0, 0);
_local4.pos_e = vec3d_Create(0, 0, 0);
this.lines.push(_local4);
this.lives[_local3] = true;
}
}
_local3++;
}
}
var _local19 = -1;
var _local26 = this.lines.length;
var _local15;
_local3 = 0;
while (_local3 < _local26) {
_local15 = this.lines[_local3];
if (_local15.taskflag & GAME_TASKFLAG_KILL) {
if (this.lives[_local15.live_id]) {
this.lives[_local15.live_id] = false;
}
_local15.pos_s = null;
_local15.pos_e = null;
this.lines.splice(_local3, 1);
_local3 = _local19;
} else {
_local15.move = _local15.move + SBD_EFF_BW_MOVE;
_local15.pos_e.x = _local11 + (_local15.dir_x * (_local15.move + SBD_EFF_BW_LINE_LENGTH));
_local15.pos_e.y = _local12 + (_local15.dir_y * (_local15.move + SBD_EFF_BW_LINE_LENGTH));
_local15.pos_e.z = _local13 + (_local15.dir_z * (_local15.move + SBD_EFF_BW_LINE_LENGTH));
_local15.pos_s.x = _local11 + (_local15.dir_x * _local15.move);
_local15.pos_s.y = _local12 + (_local15.dir_y * _local15.move);
_local15.pos_s.z = _local13 + (_local15.dir_z * _local15.move);
if (_local15.move >= SBD_EFF_BW_END_POS) {
_local15.move = 0;
_local15.taskflag = _local15.taskflag | GAME_TASKFLAG_KILL;
}
}
_local19 = _local3;
_local3++;
}
var _local5 = (STAGE_SCREEN_HEIGHT / 2) * STAGE_FOVY_COTANGENT;
var _local10 = this.stage_mc;
if (_local10 != null) {
_local10.clear();
_local10.lineStyle(1, 14737632, 100);
}
_local26 = this.lines.length;
var _local9;
var _local8;
var _local7;
var _local23;
var _local21;
var _local6;
var _local22;
var _local20;
_local3 = 0;
while (_local3 < _local26) {
_local15 = this.lines[_local3];
_local9 = _root.sceneView.LocalizePosition(_local15.pos_s);
_local8 = _root.sceneView.LocalizePosition(_local15.pos_e);
_local7 = -_local9.z;
_local23 = ((_local5 * _local9.x) / _local7) + (STAGE_SCREEN_WIDTH / 2);
_local21 = (-((_local5 * _local9.y) / _local7)) + (STAGE_SCREEN_HEIGHT / 2);
_local6 = -_local8.z;
_local22 = ((_local5 * _local8.x) / _local6) + (STAGE_SCREEN_WIDTH / 2);
_local20 = (-((_local5 * _local8.y) / _local6)) + (STAGE_SCREEN_HEIGHT / 2);
if ((_local7 > 0) && (_local6 > 0)) {
if (_local10 != null) {
_local10.moveTo(_local23, _local21);
_local10.lineTo(_local22, _local20);
}
}
_local3++;
}
this.timer++;
if (this.timer >= SBD_EFF_BW_TIMER) {
this.timer = 0;
}
this.pos_stage.x = _root.gameSeq.m_player.stageObj.pos.x;
this.pos_stage.y = _root.gameSeq.m_player.stageObj.pos.y;
this.pos_stage.z = _root.gameSeq.m_player.stageObj.pos.z - 1.5;
this.stageObj.pos.x = this.pos_stage.x;
this.stageObj.pos.y = this.pos_stage.y;
this.stageObj.pos.z = this.pos_stage.z;
if (this.lines.length > 0) {
this.stage_mc._visible = true;
StageSpriteMan_AddOrder(_root.stageSpriteMgr, this.stageObj, this.stage_mc);
} else {
this.stage_mc._visible = false;
}
if (((this.lines.length == 0) && (!(_root.gameSeq.m_player.user_flag & SBD_SHIP_FLAG_BOOST))) && (!(_root.gameSeq.m_player.user_flag & SBD_SHIP_FLAG_SPDUP))) {
this.taskflag = this.taskflag | GAME_TASKFLAG_KILL;
}
}
function effect_boostwind_exit() {
this.stageObj = null;
this.stage_mc.removeMovieClip();
this.stage_mc = null;
var _local2;
var _local3 = this.lives.length;
_local2 = 0;
while (_local2 < _local3) {
this.lives[_local2] = null;
_local2++;
}
this.lives = null;
var _local4 = this.lines.length;
_local2 = 0;
while (_local2 < _local4) {
this.lines[_local2].pos_s = null;
this.lines[_local2].pos_e = null;
this.lines[_local2] = null;
_local2++;
}
this.lines = null;
}
function identityMtx44(mtx) {
mtx[0][0] = 1;
mtx[0][1] = 0;
mtx[0][2] = 0;
mtx[0][3] = 0;
mtx[1][0] = 0;
mtx[1][1] = 1;
mtx[1][2] = 0;
mtx[1][3] = 0;
mtx[2][0] = 0;
mtx[2][1] = 0;
mtx[2][2] = 1;
mtx[2][3] = 0;
mtx[3][0] = 0;
mtx[3][1] = 0;
mtx[3][2] = 0;
mtx[3][3] = 1;
}
function setPerspectiveMtx(fovy, aspect, near, far, mtx) {
var _local3 = far - near;
fovy = (fovy * Math.PI) / 180;
var _local4 = Math.cos(fovy) / Math.sin(fovy);
identityMtx44(mtx);
mtx[0][0] = _local4 / aspect;
mtx[1][1] = _local4;
mtx[2][2] = (-(far + near)) / _local3;
mtx[2][3] = -1;
mtx[3][2] = (-((2 * far) * near)) / _local3;
mtx[3][3] = 0;
}
function setInvPorjMtx(mtx) {
mtx[0][0] = 0.40446225;
mtx[0][1] = 0;
mtx[0][2] = 0;
mtx[0][3] = 0;
mtx[1][0] = 0;
mtx[1][1] = 0.30334669;
mtx[1][2] = 0;
mtx[1][3] = 0;
mtx[2][0] = 0;
mtx[2][1] = 0;
mtx[2][2] = 0;
mtx[2][3] = -0.49875003;
mtx[3][0] = 0;
mtx[3][1] = 0;
mtx[3][2] = -1;
mtx[3][3] = 0.50125003;
}
function transPos(mtx, pos) {
var _local7 = (((pos.x * mtx[0][0]) + (pos.y * mtx[1][0])) + (pos.z * mtx[2][0])) + mtx[3][0];
var _local6 = (((pos.x * mtx[0][1]) + (pos.y * mtx[1][1])) + (pos.z * mtx[2][1])) + mtx[3][1];
var _local5 = (((pos.x * mtx[0][2]) + (pos.y * mtx[1][2])) + (pos.z * mtx[2][2])) + mtx[3][2];
var _local4 = (((pos.x * mtx[0][3]) + (pos.y * mtx[1][3])) + (pos.z * mtx[2][3])) + mtx[3][3];
var _local3 = vec3d_Create(0, 0, 0);
_local3.x = _local7 / _local4;
_local3.y = _local6 / _local4;
_local3.z = _local5 / _local4;
return(_local3);
}
function seqGame_ComputeWorldRayFromScreenPos(sx, sy) {
var _local6 = 0;
var _local5 = 0;
var _local7 = STAGE_SCREEN_WIDTH;
var _local4 = STAGE_SCREEN_HEIGHT;
var _local9 = _local7 - _local6;
var _local8 = _local4 - _local5;
var _local3 = (sx - _local6) / _local9;
var _local2 = ((sy + _local5) - _local4) / (-_local8);
_local3 = (_local3 - 0.5) * 2;
_local2 = (_local2 - 0.5) * 2;
var _local11 = vec3d_Create(_local3, _local2, -1);
var _local12 = _root.transPos(invProjMtx, _local11);
var _local10 = _root.sceneView.GlobalizeDirection(_local12);
return(_local10);
}
function seqGame_GetPlayerSpdForMap() {
var _local2 = 0;
if (_root.gameSeq.m_player) {
if (_root.gameSeq.m_player.hitstop_timer) {
_local2 = 0;
} else {
_local2 = _root.gameSeq.m_player.spd;
}
}
return(_local2);
}
function seqGame_GetStageMapMove() {
if (_root.gameSeq.m_map) {
return(vec3d_Clone(_root.gameSeq.m_map.move));
}
return(vec3d_Create(0, 0, 0));
}
function seqGame_GetMapPos(linePos) {
return(vec3d_Create(linePos.x, linePos.y, -linePos.z));
}
function seqGame_GetStagePos(linePos) {
var _local2 = vec3d_Create(linePos.x, linePos.y, -linePos.z);
if (_root.gameSeq.m_map) {
_local2.x = _local2.x - _root.gameSeq.m_map.pos.x;
_local2.y = _local2.y - _root.gameSeq.m_map.pos.y;
_local2.z = _local2.z - _root.gameSeq.m_map.pos.z;
}
return(_local2);
}
function seqGame_checkCollideBody(mySeq) {
var _local4;
var _local5 = vec3d_Clone(mySeq.m_player.stageObj.pos);
var _local1 = vec3d_Create(0, 0, 0);
var _local8;
var _local7;
var _local3;
var _local9 = mySeq.m_traps.length;
_local4 = 0;
while (_local4 < _local9) {
_local3 = mySeq.m_traps[_local4];
if ((_local3.taskflag & (GAME_TASKFLAG_KILL | GAME_TASKFLAG_NOHIT)) || (_local3.body_radius <= 0)) {
} else {
_local1.x = _local3.stageObj.pos.x - _local5.x;
_local1.y = _local3.stageObj.pos.y - _local5.y;
_local1.z = _local3.stageObj.pos.z - _local5.z;
_local8 = ((_local1.x * _local1.x) + (_local1.y * _local1.y)) + (_local1.z * _local1.z);
_local7 = (_local3.body_radius + PLAYER_JETSKI_RADIUS) * (_local3.body_radius + PLAYER_JETSKI_RADIUS);
if (_local8 < _local7) {
Player_BodyHitCall(mySeq.m_player, _local3);
}
}
_local4++;
}
var _local2;
var _local10 = mySeq.m_rings.length;
_local4 = 0;
while (_local4 < _local10) {
_local2 = mySeq.m_rings[_local4];
if ((_local2.taskflag & (GAME_TASKFLAG_KILL | GAME_TASKFLAG_NOHIT)) || (_local2.body_radius <= 0)) {
} else {
_local1.x = _local2.stageObj.pos.x - _local5.x;
_local1.y = _local2.stageObj.pos.y - _local5.y;
_local1.z = _local2.stageObj.pos.z - _local5.z;
_local8 = ((_local1.x * _local1.x) + (_local1.y * _local1.y)) + (_local1.z * _local1.z);
_local7 = (_local2.body_radius + PLAYER_JETSKI_RADIUS) * (_local2.body_radius + PLAYER_JETSKI_RADIUS);
if (_local8 < _local7) {
Player_BodyHitCall(mySeq.m_player, _local2);
TrapRing_BodyHitCall(_local2);
}
}
_local4++;
}
}
function seqGame_checkCollideAttack(mySeq) {
var _local6 = 0;
if (mySeq.m_player.user_flag & SBD_SHIP_FLAG_BOOST) {
_local6 = PLAYER_JETSKI_BOOST_RADIUS;
} else if (mySeq.m_player.user_flag & SBD_SHIP_FLAG_TRICK) {
_local6 = PLAYER_JETSKI_TRICK_RADIUS;
} else {
return(undefined);
}
var _local3;
var _local4 = vec3d_Clone(mySeq.m_player.stageObj.pos);
var _local2 = vec3d_Create(0, 0, 0);
var _local8;
var _local7;
var _local9 = mySeq.m_traps.length;
var _local1;
_local3 = 0;
while (_local3 < _local9) {
_local1 = mySeq.m_traps[_local3];
if (((_local1.taskflag & (GAME_TASKFLAG_KILL | GAME_TASKFLAG_NOHIT)) || (!(_local1.taskflag & GAME_TASKFLAG_HIT_BRK))) || (_local1.body_radius <= 0)) {
} else {
_local2.x = _local1.stageObj.pos.x - _local4.x;
_local2.y = _local1.stageObj.pos.y - _local4.y;
_local2.z = _local1.stageObj.pos.z - _local4.z;
_local8 = ((_local2.x * _local2.x) + (_local2.y * _local2.y)) + (_local2.z * _local2.z);
_local7 = (_local1.body_radius + _local6) * (_local1.body_radius + _local6);
if (_local8 < _local7) {
Player_AttackHitCall(mySeq.m_player, _local1);
switch (_local1.actno) {
case TRAP_ACTNO_MINE :
TrapMine_AttackHitCall(_local1);
break;
case TRAP_ACTNO_SHARK :
TrapShark_AttackHitCall(_local1);
break;
case TRAP_ACTNO_BIRD :
TrapBird_AttackHitCall(_local1);
break;
case TRAP_ACTNO_BOB :
TrapBob_AttackHitCall(_local1);
}
}
}
_local3++;
}
}
function seqGame_updateTraps(mySeq) {
var _local1;
var _local3 = -1;
var _local5 = mySeq.m_traps.length;
var _local2;
_local1 = 0;
while (_local1 < _local5) {
_local2 = mySeq.m_traps[_local1];
if (_local2.taskflag & GAME_TASKFLAG_KILL) {
_local2.exit();
mySeq.m_traps.splice(_local1, 1);
_local1 = _local3;
} else {
_local2.exec();
}
_local3 = _local1;
_local1++;
}
}
function seqGame_updateRings(mySeq) {
var _local1;
var _local3 = -1;
var _local5 = mySeq.m_rings.length;
var _local2;
_local1 = 0;
while (_local1 < _local5) {
_local2 = mySeq.m_rings[_local1];
if (_local2.taskflag & GAME_TASKFLAG_KILL) {
_local2.exit();
mySeq.m_rings.splice(_local1, 1);
_local1 = _local3;
} else {
_local2.exec();
}
_local3 = _local1;
_local1++;
}
}
function seqGame_updateEffect2d(mySeq) {
var _local1;
var _local3 = -1;
var _local5 = mySeq.m_effect2ds.length;
var _local2;
_local1 = 0;
while (_local1 < _local5) {
_local2 = mySeq.m_effect2ds[_local1];
if (_local2.taskflag & GAME_TASKFLAG_KILL) {
_local2.exit();
mySeq.m_effect2ds.splice(_local1, 1);
_local1 = _local3;
} else {
_local2.exec();
}
_local3 = _local1;
_local1++;
}
}
function seqGame_updateEffect3d(mySeq) {
var _local1;
var _local3 = -1;
var _local5 = mySeq.m_effect3ds.length;
var _local2;
_local1 = 0;
while (_local1 < _local5) {
_local2 = mySeq.m_effect3ds[_local1];
if (_local2.taskflag & GAME_TASKFLAG_KILL) {
_local2.exit();
mySeq.m_effect3ds.splice(_local1, 1);
_local1 = _local3;
} else {
_local2.exec();
}
_local3 = _local1;
_local1++;
}
}
function seqGame_maketrap(lineZ, x, y, actno, acttype) {
var _local2 = null;
switch (actno) {
case TRAP_ACTNO_JUMP :
_local2 = TrapJump_Create(lineZ, x, y, acttype);
break;
case TRAP_ACTNO_RING :
_local2 = TrapRing_Create(lineZ, x, y);
break;
case TRAP_ACTNO_BUOY :
_local2 = TrapBuoy_Create(lineZ, x, y, acttype);
break;
case TRAP_ACTNO_ROCK :
_local2 = TrapRock_Create(lineZ, x, y, acttype);
break;
case TRAP_ACTNO_MINE :
_local2 = TrapMine_Create(lineZ, x, y, acttype);
break;
case TRAP_ACTNO_GOAL_LOGO :
_local2 = TrapGoalLogo_Create(lineZ, x, y);
break;
case TRAP_ACTNO_GOAL_RING :
_local2 = TrapGoalRing_Create(lineZ, x, y);
break;
case TRAP_ACTNO_SHARK :
_local2 = TrapShark_Create(lineZ, x, y, acttype);
break;
case TRAP_ACTNO_BIRD :
_local2 = TrapBird_Create(lineZ, x, y, acttype);
break;
case TRAP_ACTNO_BOB :
_local2 = TrapBob_Create(lineZ, x, y, acttype);
break;
case TRAP_ACTNO_GOAL_ISLAND :
_local2 = TrapGoalIsland_Create(lineZ, x, y);
break;
}
if (_local2 != null) {
if (actno != TRAP_ACTNO_RING) {
this.m_traps.push(_local2);
} else {
this.m_rings.push(_local2);
}
}
}
function seqGame_makeeffect2d(x, y, actno, acttype) {
var _local2 = null;
switch (actno) {
case TRAP_ACTNO_TRICK_NG :
case TRAP_ACTNO_TRICK_OK :
acttype = actno;
_local2 = EffectTrickOk_Create(x, y, acttype);
}
if (_local2 != null) {
this.m_effect2ds.push(_local2);
}
}
function seqGame_makeeffect3d(x, y, z, actno, acttype) {
var _local2 = null;
switch (actno) {
case TRAP_ACTNO_WATER01 :
_local2 = EffectWater01_Create();
break;
case TRAP_ACTNO_WATER02 :
_local2 = EffectWater02_Create(x, y, z);
break;
case TRAP_ACTNO_BOOST_A :
_local2 = EffectBoost_Create();
break;
case TRAP_ACTNO_SMOKE :
_local2 = EffectSmoke_Create(x, y, z, acttype);
break;
case TRAP_ACTNO_SMOKE_DAMAGE :
_local2 = EffectSmokeDamage_Create(x, y, z);
break;
case TRAP_ACTNO_HIT :
_local2 = EffectHit_Create(x, y, z, acttype);
break;
case TRAP_ACTNO_BOM :
_local2 = EffectBom_Create(x, y, z);
break;
case TRAP_ACTNO_BOOST_WIND :
_local2 = EffectBoostWind_Create();
break;
}
if (_local2 != null) {
this.m_effect3ds.push(_local2);
}
}
function seqGame_destroy() {
if (this.m_trickmarker != null) {
this.m_trickmarker.exit();
}
if (this.m_player != null) {
this.m_player.exit();
}
if (this.m_map != null) {
this.m_map.exit();
}
if (this.m_trapgen != null) {
this.m_trapgen.exit();
}
if (this.m_sea != null) {
this.m_sea.exit();
}
if (this.m_fix != null) {
this.m_fix.exit();
}
if (this.m_start != null) {
this.m_start.exit();
}
if (this.m_result != null) {
this.m_result.exit();
}
if (this.m_mapmarker != null) {
this.m_mapmarker.exit();
}
if (this.m_fade != null) {
this.m_fade.exit();
}
if (this.m_tips != null) {
this.m_tips.exit();
}
this.m_trickmarker = null;
this.m_player = null;
this.m_map = null;
this.m_trapgen = null;
this.m_sea = null;
this.m_fix = null;
this.m_start = null;
this.m_result = null;
this.m_mapmarker = null;
this.m_fade = null;
this.m_tips = null;
var _local2;
_local2 = 0;
while (_local2 < this.m_rings.length) {
this.m_rings[_local2].exit();
_local2++;
}
this.m_rings = null;
_local2 = 0;
while (_local2 < this.m_traps.length) {
this.m_traps[_local2].exit();
_local2++;
}
this.m_traps = null;
_local2 = 0;
while (_local2 < this.m_effect3ds.length) {
this.m_effect3ds[_local2].exit();
_local2++;
}
this.m_effect3ds = null;
_local2 = 0;
while (_local2 < this.m_effect2ds.length) {
this.m_effect2ds[_local2].exit();
_local2++;
}
this.m_effect2ds = null;
if (this.ring_mc != null) {
this.ring_mc.removeMovieClip();
this.ring_mc = null;
}
if (this.cnt_mc != null) {
this.cnt_mc.removeMovieClip();
this.cnt_mc = null;
}
}
function seqGame_pause_tasks(onoff) {
}
function seqGame_init(mySeq) {
stopAllSounds();
mySeq.m_gameflags = mySeq.m_gameflags | (SBD_MAIN_DEMO + SBD_MAIN_START);
mySeq.m_trickmarker = TrickMarker_Create();
mySeq.m_player = Player_Create();
mySeq.m_map = StageMap_Create();
StageMap_Setup(mySeq.m_map);
mySeq.m_trapgen = TrapGen_Create();
mySeq.m_sea = SeaBg_Create();
mySeq.m_fix = FixBg_Create();
mySeq.m_mapmarker = MapMarker_Create();
mySeq.m_tips = TipsPanel_Create();
mySeq.m_fade = ScreenFade_Create();
mySeq.m_frameCounter = 0;
mySeq.m_step = 0;
mySeq.m_mode = SEQ_MODE_START;
}
function seqGame_start(mySeq) {
switch (mySeq.m_step) {
case 0 :
mySeq.m_gameflags = mySeq.m_gameflags & (~SBD_MAIN_LAND);
ScreenFade_WhiteInRequest(mySeq.m_fade);
mySeq.m_start = StartLogo_Create();
_root.stageSoundMgr.PlayBGM(SOUND_BGM_GAME);
mySeq.m_step++;
break;
case 1 :
if (!(mySeq.m_start.taskflag & GAME_TASKFLAG_KILL)) {
break;
}
mySeq.m_start.exit();
mySeq.m_start = null;
mySeq.m_step = 0;
mySeq.m_mode = SEQ_MODE_GAME;
}
}
function seqGame_game(mySeq) {
switch (mySeq.m_step) {
case 0 :
mySeq.m_gameflags = mySeq.m_gameflags & (~(SBD_MAIN_DEMO + SBD_MAIN_START));
mySeq.m_gameflags = mySeq.m_gameflags & (~(SBD_MAIN_LAND | SBD_MAIN_LAND_PREV));
mySeq.m_record_timer = 0;
mySeq.m_fix.flag = mySeq.m_fix.flag | SBD_FIX_REQ_ENTER;
mySeq.m_step++;
case 1 :
if (mySeq.m_record_timer < SBD_SHIP_RECORD_TIME_MAX) {
mySeq.m_record_timer++;
}
if (mySeq.m_gameflags & SBD_MAIN_LAND_PREV) {
if (!(mySeq.m_gameflags & SBD_MAIN_GEN_TRAPGOAL)) {
var _local2 = mySeq.m_map.pos_line;
_local2 = Math.floor(_local2 / STAGEMAP_SEA_LINE_LENGTH) * STAGEMAP_SEA_LINE_LENGTH;
_local2 = _local2 + STAGEMAP_SEA_LINE_LENGTH;
mySeq.MakeTrap(_local2, 0, 0, TRAP_ACTNO_GOAL_LOGO, 0);
mySeq.MakeTrap(_local2, 0, 0, TRAP_ACTNO_GOAL_RING, 0);
mySeq.MakeTrap(_local2, 0, 0, TRAP_ACTNO_GOAL_ISLAND, 0);
mySeq.m_gameflags = mySeq.m_gameflags | SBD_MAIN_GEN_TRAPGOAL;
}
}
if (mySeq.m_gameflags & SBD_MAIN_LAND) {
player_JetGoalInit(mySeq.m_player);
mySeq.m_fix.flag = mySeq.m_fix.flag | SBD_FIX_REQ_LEAVE;
mySeq.m_gameflags = mySeq.m_gameflags | (SBD_MAIN_DEMO | SBD_MAIN_RESULT);
mySeq.m_step = 0;
mySeq.m_mode = SEQ_MODE_GOAL;
} else {
if (!(mySeq.m_gameflags & SBD_MAIN_GAMEOVER)) {
break;
}
mySeq.m_gameflags = mySeq.m_gameflags | (SBD_MAIN_DEMO | SBD_MAIN_GAMEOVER);
mySeq.m_step = 0;
mySeq.m_mode = SEQ_MODE_RETIRE;
}
}
}
function seqGame_goal(mySeq) {
switch (mySeq.m_step) {
case 0 :
mySeq.m_gameflags = mySeq.m_gameflags | (SBD_MAIN_DEMO | SBD_MAIN_RESULT);
_root.stageSoundMgr.StopBGM(SOUND_BGM_GAME);
_root.stageSoundMgr.PlayBGM(SOUND_BGM_DISCOVER);
mySeq.m_result = ResultPanel_Create();
Player_ShipScoreSetForResult(mySeq.m_player);
mySeq.m_step++;
break;
case 1 :
if (mySeq.m_result.taskflag & GAME_TASKFLAG_KILL) {
mySeq.m_result.exit();
mySeq.m_result = null;
ScreenFade_WhiteOutRequest(mySeq.m_fade);
mySeq.m_user_timer = 0;
mySeq.m_step++;
}
break;
case 2 :
if ((++mySeq.m_user_timer) > 30) {
mySeq.m_step++;
}
break;
case 3 :
mySeq.m_step = 0;
mySeq.m_mode = SEQ_MODE_NEXT;
}
}
function seqGame_retire(mySeq) {
switch (mySeq.m_step) {
case 0 :
mySeq.m_gameflags = mySeq.m_gameflags | (SBD_MAIN_DEMO | SBD_MAIN_GAMEOVER);
_root.stageSoundMgr.StopBGM(SOUND_BGM_GAME);
_root.stageSoundMgr.PlayBGM(SOUND_BGM_RETIRE);
mySeq.m_user_timer = 0;
mySeq.m_step++;
break;
case 1 :
var _local4 = 100;
var _local3 = 99;
mySeq.m_user_timer++;
if (_root.touchPen.m_pressed) {
if (mySeq.m_user_timer < _local3) {
mySeq.m_user_timer = _local3 + 1;
}
}
if (mySeq.m_user_timer > _local4) {
ScreenFade_WhiteOutRequest(mySeq.m_fade);
mySeq.m_user_timer = 0;
mySeq.m_step++;
}
break;
case 2 :
if ((++mySeq.m_user_timer) > 30) {
mySeq.m_step++;
}
break;
case 3 :
mySeq.m_step = 0;
mySeq.m_mode = SEQ_MODE_NEXT;
}
}
function seqGame_Update() {
touchPen.update(_root.theLowerScreen);
if (!(gameSeq.m_gameflags & SBD_MAIN_ENABLE_TIPS)) {
StageSpriteMan_ResetOrderArray(stageSpriteMgr);
switch (gameSeq.m_mode) {
case SEQ_MODE_INIT :
seqGame_init(gameSeq);
break;
case SEQ_MODE_START :
seqGame_start(gameSeq);
break;
case SEQ_MODE_GAME :
seqGame_game(gameSeq);
break;
case SEQ_MODE_GOAL :
seqGame_goal(gameSeq);
break;
case SEQ_MODE_RETIRE :
seqGame_retire(gameSeq);
break;
case SEQ_MODE_NEXT :
seqGame_Exit(true);
}
if (gameSeq.m_mode == SEQ_MODE_GAME) {
seqGame_checkCollideAttack(gameSeq);
seqGame_checkCollideBody(gameSeq);
}
var _local2 = gameSeq;
if (_local2.m_trickmarker != null) {
_local2.m_trickmarker.exec();
}
if (_local2.m_player != null) {
_local2.m_player.exec();
}
if (_local2.m_map != null) {
_local2.m_map.exec();
}
if (_local2.m_trapgen != null) {
_local2.m_trapgen.exec();
}
seqGame_updateTraps(_local2);
seqGame_updateRings(_local2);
seqGame_updateEffect3d(_local2);
seqGame_updateEffect2d(_local2);
if (_local2.m_fix) {
_local2.m_fix.exec();
}
if (_local2.m_sea != null) {
_local2.m_sea.exec();
}
if (_local2.m_mapmarker != null) {
_local2.m_mapmarker.exec();
}
if (_local2.m_start != null) {
_local2.m_start.exec();
}
if (_local2.m_result != null) {
_local2.m_result.exec();
}
if (_local2.m_fade != null) {
_local2.m_fade.exec();
}
gameSeq.m_gameflags = gameSeq.m_gameflags & (~SBD_MAIN_RING_SE);
gameSeq.m_frameCounter++;
StageSpriteMan_TransformOrderItems(stageSpriteMgr, sceneProjMtx, sceneView);
StageSpriteMan_ZSortOrderItems(stageSpriteMgr);
StageSpriteMan_DrawOrderItems(stageSpriteMgr);
}
if (gameSeq.m_tips != null) {
gameSeq.m_tips.exec();
}
}
function seqGame_Create() {
var _local2 = new Object();
_local2.m_mode = SEQ_MODE_INIT;
_local2.m_step = 0;
_local2.m_gameflags = 0;
_local2.m_record_timer = 0;
_local2.m_frameCounter = 0;
_local2.m_user_timer = 0;
_local2.m_trickmarker = null;
_local2.m_player = null;
_local2.m_map = null;
_local2.m_trapgen = null;
_local2.m_sea = null;
_local2.m_fix = null;
_local2.m_start = null;
_local2.m_result = null;
_local2.m_mapmarker = null;
_local2.m_fade = null;
_local2.m_tips = null;
_local2.m_rings = new Array();
_local2.m_traps = new Array();
_local2.m_effect3ds = new Array();
_local2.m_effect2ds = new Array();
_local2.MakeTrap = seqGame_maketrap;
_local2.MakeEffect2d = seqGame_makeeffect2d;
_local2.MakeEffect3d = seqGame_makeeffect3d;
_local2.Destroy = seqGame_destroy;
_local2.PauseTasks = seqGame_pause_tasks;
_local2.ring_mc = ScreenSpriteMan_CreateEffectMC(_root.screenSpriteMgr, "RingCommonAnimation");
_local2.ring_mc._x = COMMON_RING_XPOS;
_local2.ring_mc._y = COMMON_RING_YPOS;
_local2.cnt_mc = null;
return(_local2);
}
function seqGame_Exit(isNext) {
delete _root.onEnterFrame;
_root.gameSeq.Destroy();
_root.gameSeq = null;
StageSoundMan_Exit(_root.stageSoundMgr);
_root.stageSoundMgr = null;
ScreenSpriteMan_Exit(_root.screenSpriteMgr);
_root.screenSpriteMgr = null;
StageSpriteMan_Exit(_root.stageSpriteMgr);
_root.stageSpriteMgr = null;
_root.invProjMtx = null;
_root.sceneProjMtx = null;
_root.vFrom = null;
_root.vAt = null;
SceneView_Destroy(_root.sceneView);
MouseInput_Destroy(_root.touchPen);
_root.seaScene.removeMovieClip();
_root.seaScene = null;
_root.screenScene.removeMovieClip();
_root.screenScene = null;
_root.stageScene.removeMovieClip();
_root.stageScene = null;
if (isNext) {
_root.gotoAndPlay("seq_ending");
}
}
stop();
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var STAGESPRITE_GENE_DEPTH_START = 4096;
var STAGESPRITE_GENE_DEPTH_MASK = 8191;
var STAGESPRITE_SORT_DEPTH_START = 65536;
var STAGESPRITE_SORT_DEPTH_MASK = 8191;
var STAGESPRITE_SORT_INIT_DEPTH = 1;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var SCREENSPRITE_DEPTH_MASK = 16383;
var SCREENSPRITE_DEPTH_FIX = 196608;
var SCREENSPRITE_DEPTH_EFFECT_FRONT = 163840;
var SCREENSPRITE_DEPTH_MARKER = 131072;
var SCREENSPRITE_DEPTH_EFFECT = 65536;
var SCREENSPRITE_DEPTH_SOUND = 32768;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var SOUND_DEFAULT_LOOP_COUNT = 65536;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var SCREENFADE_STEP_IDLE = 0;
var SCREENFADE_STEP_FADE_IN = 1;
var SCREENFADE_STEP_FADE_OUT = 2;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var MAP_BLKTYPE_NONE = 0;
var MAP_BLKTYPE_ISLAND_PREV = 1;
var MAP_BLKTYPE_ISLAND = 2;
var PLAYER_JETSKI_POS = 8;
var PLAYER_JETSKI_SPDAD = 0.0087890625;
var PLAYER_JETSKI_SPDDO = 0.01708984375;
var PLAYER_JETSKI_SPDDO_OVER = 0.029296875;
var PLAYER_JETSKI_SPDMA = 1.25;
var PLAYER_JETSKI_SPDBO = 2;
var PLAYER_JETSKI_DASH_SPDBO = 1.75;
var PLAYER_JETSKI_JUMP_SPDBO = 1.375;
var PLAYER_JETSKI_ATK_SPDDO = 0.0322265625;
var PLAYER_SHIP_SPDAD_G1 = (PLAYER_JETSKI_SPDAD * 16);
var PLAYER_SHIP_SPDAD_G2 = (PLAYER_JETSKI_SPDAD * 4);
var PLAYER_SHIP_SPDAD_G3 = PLAYER_JETSKI_SPDAD;
var PLAYER_SHIP_SPDAD_G4 = (PLAYER_JETSKI_SPDAD * 0.5);
var PLAYER_SHIP_SPDAD_G5 = 0.000732421875;
var PLAYER_SHIP_SPD_TYOUSEI2 = 0.007568359375;
var PLAYER_SHIP_DOUBLE_TIME = 6;
var PLAYER_FALL_SPD = 0.0068359375;
var PLAYER_FALL_SPD_MAX = 0.5;
var PLAYER_JET_JUMP_SPD = 0.21875;
var PLAYER_SIDE_MOVE_DIVSTEP = 0.5;
var PLAYER_SIDE_MOVE_MAX = 16;
var PLAYER_SIDE_MOVE_MIN = 1;
var PLAYER_SIDE_MOVE_NOMOVE_DIVSTEP = 0.125;
var PLAYER_SIDE_MOVE_NOMOVE_MAX = 1;
var PLAYER_SIDE_MOVE_NOMOVE_MIN = 0.0078125;
var PLAYER_SIDE_MOVE_SLOW_DIVSTEP = 0.25;
var PLAYER_SIDE_MOVE_SLOW_MAX = 0.2666015625;
var PLAYER_SIDE_MOVE_SLOW_MIN = 0.0078125;
var PLAYER_SIDE_MOVE_BOOST_DIVSTEP = 0.25;
var PLAYER_SIDE_MOVE_BOOST_MAX = 3.75;
var PLAYER_SIDE_MOVE_BOOST_MIN = 0.009765625;
var PLAYER_TOUCH_POS_Y = 128;
var PLAYER_MS_JET_FW = 0;
var PLAYER_MS_JET_JUMP = 1;
var PLAYER_MS_JET_DAMAGE = 2;
var PLAYER_MS_JET_DIE = 3;
var PLAYER_MS_JET_GOAL = 4;
var PLAYER_MS_JET_STARTWAIT = 5;
var SBD_JETSKI_VIT_DEFAULT = SBD_JETSKI_VIT_MAX;
var SBD_JETSKI_TEN_DEFAULT = (SBD_JETSKI_TEN_MAX / 3);
var SBD_JETSKI_TEN_RING = 2;
var SBD_JETSKI_VIT_RING = 0.25;
var SBD_JETSKI_DAMAGE_SLOW_TIME = 60;
var SBD_SHIP_INVISIBLE_TIME = 64;
var SBD_JETSKI_DAMAGE_TIME = 32;
var SBD_JETSKI_COMBO_TIMER = 80;
var SBD_JETSKI_COMBO_COUNT = 4;
var SBD_DAMAGE_HITSTOP_TIME = 3;
var SBD_ATTACK_HITSTOP_TIME = 2;
var SBD_SHIP_BOOST_COMBO_TIME = 150;
var SBD_SHIP_BOOST_COMBO_RETIME = 90;
var SBD_SHIP_BOOST_COMBO_LIMIT_TIME = 200;
var SBD_SHIP_BOOST_CURVE_IGNORE_TIME = 45;
var SBD_BOOST_HANDYCAP_IGNORE_TIME = 500;
var SBD_BOOST_NO_EFFECT_TIME = 180;
var SBD_BOOST_IGNORE_TIME = 6;
var SBD_RING_SCORE = 100;
var SBD_MINE_SCORE = 300;
var SBD_BOB_SCORE = 400;
var SBD_BIRD_SCORE = 200;
var SBD_SHARK_SCORE = 500;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var SBD_TRICK_FALSE_TIME = 12;
var SBD_TRICK_WHILE = 1;
var SBD_TRICK_SET = 2;
var SBD_TRICK_DAMAGE_WAIT = 4;
var SBD_TRICK_FALSE = 8;
var SBD_MARKER_ENABLE = 1;
var SBD_MARKER_START = 2;
var SBD_MARKER_CLEAR = 4;
var SBD_MARKER_NODISP = 8;
var SBD_MARKER_WAIT1 = 16;
var SBD_MARKER_ACT_CHANGE_NOWAIT = 32;
var SBD_TRICK_CENTER_OFST_X = 30;
var SBD_TRICK_CENTER_OFST_Y = 20;
var SBD_TRICK_BETWEEN_CENTER_OFST_X = 256;
var SBD_TRICK_BETWEEN_CENTER_OFST_Y = 8;
var SBD_MARKER_TYPE_MAX = 16;
var SBD_MARKER_TYPE_1_4 = (SBD_MARKER_TYPE_MAX >> 2);
var SBD_MARKER_TYPE_2_4 = (SBD_MARKER_TYPE_MAX >> 1);
var SBD_MARKER_TYPE_3_4 = ((SBD_MARKER_TYPE_MAX >> 1) + (SBD_MARKER_TYPE_MAX >> 2));
var SBD_MARKER_ROT_SHIFT = 12;
var SBD_MARKER_TYPE_BETWEEN = (SBD_MARKER_TYPE_MAX + 1);
var SBD_TRICK1_SCORE = 2000;
var SBD_TRICK2_SCORE = 3000;
var SBD_TRICK3_SCORE = 6000;
var SBD_SHIP_BOOST_GET = 32;
var SBD_MF_T1 = 1;
var SBD_MF_T2 = 2;
var SBD_MF_T3 = 3;
var SBD_MF_T4 = 4;
var SBD_MF_TRICK_MASK = 7;
var SBD_MF_END = 16;
var SBD_MF_WAIT = 32;
var MARKER_MC_PAT_START_END_FRAME = 5;
var MARKER_MC_PAT_TOUCH_END_FRAME = 21;
var marker_file = new Array([], []);
marker_file = [[makeMarker(0, 1, 128, 124, 0), makeMarker(0, 1, 128, 108, 0), makeMarker(0, 2, 128, 92, 0), makeMarker(0, 2, 128, 76, 0), makeMarker(0, 3, 128, 60, SBD_MF_T1 | SBD_MF_END)], [makeMarker(8, 1, 128, 60, 0), makeMarker(8, 1, 128, 76, 0), makeMarker(8, 2, 128, 92, 0), makeMarker(8, 2, 128, 108, 0), makeMarker(8, 3, 128, 124, SBD_MF_T2 | SBD_MF_END)], [makeMarker(1, 1, 106, 136, 0), makeMarker(1, 1, 114, 121, 0), makeMarker(1, 2, 122, 105, 0), makeMarker(1, 2, 130, 89, 0), makeMarker(1, 3, 138, 73, 0), makeMarker(1, 3, 144, 56, SBD_MF_T1 | SBD_MF_END)], [makeMarker(15, 1, 144, 136, 0), makeMarker(15, 1, 136, 121, 0), makeMarker(15, 2, 128, 105, 0), makeMarker(15, 2, 120, 89, 0), makeMarker(15, 3, 112, 73, 0), makeMarker(15, 3, 106, 56, SBD_MF_T1 | SBD_MF_END)], [makeMarker(9, 1, 144, 56, 0), makeMarker(9, 1, 137, 71, 0), makeMarker(9, 2, 129, 87, 0), makeMarker(9, 2, 121, 103, 0), makeMarker(9, 3, 113, 119, 0), makeMarker(9, 3, 106, 136, SBD_MF_T2 | SBD_MF_END)], [makeMarker(7, 1, 106, 56, 0), makeMarker(7, 1, 113, 71, 0), makeMarker(7, 2, 121, 87, 0), makeMarker(7, 2, 129, 103, 0), makeMarker(7, 3, 137, 119, 0), makeMarker(7, 3, 144, 136, SBD_MF_T2 | SBD_MF_END)], [makeMarker(4, 1, 80, 80, 0), makeMarker(4, 1, 102, 86, 0), makeMarker(4, 2, 122, 86, 0), makeMarker(4, 2, 142, 86, 0), makeMarker(4, 3, 162, 86, 0), makeMarker(4, 3, 180, 80, SBD_MF_T1 | SBD_MF_END)], [makeMarker(12, 1, 180, 80, 0), makeMarker(12, 1, 158, 75, 0), makeMarker(12, 2, 138, 75, 0), makeMarker(12, 2, 118, 75, 0), makeMarker(12, 3, 98, 75, 0), makeMarker(12, 3, 80, 80, SBD_MF_T2 | SBD_MF_END)], [makeMarker(0, 1, 60, 92, 0), makeMarker(1, 1, 64, 72, 0), makeMarker(2, 2, 80, 54, 0), makeMarker(3, 2, 104, 44, 0), makeMarker(4, 3, 132, 42, 0), makeMarker(5, 3, 160, 37, 0), makeMarker(6, 4, 184, 60, SBD_MF_T3 | SBD_MF_END)], [makeMarker(0, 1, 196, 92, 0), makeMarker(15, 1, 192, 72, 0), makeMarker(14, 2, 174, 54, 0), makeMarker(13, 2, 152, 44, 0), makeMarker(12, 3, 122, 31, 0), makeMarker(11, 3, 96, 37, 0), makeMarker(10, 4, 72, 60, SBD_MF_T4 | SBD_MF_END)], [makeMarker(0, 1, 128, 135, 0), makeMarker(0, 1, 128, 115, 0), makeMarker(1, 2, 132, 92, 0), makeMarker(2, 2, 140, 72, 0), makeMarker(3, 3, 160, 58, 0), makeMarker(4, 3, 182, 50, SBD_MF_T3 | SBD_MF_END)], [makeMarker(0, 1, 128, 135, 0), makeMarker(0, 1, 128, 115, 0), makeMarker(15, 2, 124, 92, 0), makeMarker(14, 2, 116, 72, 0), makeMarker(13, 3, 96, 58, 0), makeMarker(12, 3, 74, 50, SBD_MF_T3 | SBD_MF_END)], [makeMarker(14, 1, 76, 136, 0), makeMarker(15, 2, 60, 116, 0), makeMarker(0, 2, 56, 96, 0), makeMarker(1, 3, 64, 72, 0), makeMarker(2, 3, 80, 54, 0), makeMarker(3, 4, 104, 44, 0), makeMarker(4, 4, 132, 42, 0), makeMarker(5, 5, 160, 37, 0), makeMarker(6, 5, 184, 49, 0), makeMarker(7, 6, 200, 69, 0), makeMarker(8, 6, 204, 93, 0), makeMarker(9, 7, 196, 117, SBD_MF_T4 | SBD_MF_END)], [makeMarker(2, 1, 184, 136, 0), makeMarker(1, 2, 200, 116, 0), makeMarker(0, 2, 204, 96, 0), makeMarker(15, 3, 196, 72, 0), makeMarker(14, 3, 180, 54, 0), makeMarker(13, 4, 156, 44, 0), makeMarker(12, 4, 128, 31, 0), makeMarker(11, 5, 100, 37, 0), makeMarker(10, 5, 76, 49, 0), makeMarker(9, 6, 60, 69, 0), makeMarker(8, 6, 56, 93, 0), makeMarker(7, 7, 64, 117, SBD_MF_T4 | SBD_MF_END)], [makeMarker(0, 1, 128, 124, 0), makeMarker(0, 1, 128, 108, 0), makeMarker(0, 2, 128, 92, 0), makeMarker(0, 2, 128, 76, 0), makeMarker(0, 3, 128, 60, SBD_MF_T1 | SBD_MF_END)], [makeMarker(8, 1, 128, 60, 0), makeMarker(8, 1, 128, 76, 0), makeMarker(8, 2, 128, 92, 0), makeMarker(8, 2, 128, 108, 0), makeMarker(8, 3, 128, 124, SBD_MF_T2 | SBD_MF_END)]];
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var TrapSet_Level00_Tbl = [makeTrap(((0 * STAGEMAP_SEA_LINE_LENGTH) + 64) + 0, 0, 0, TRAP_ACTNO_RING, 0), makeTrap(((0 * STAGEMAP_SEA_LINE_LENGTH) + 64) + 4, 0, 0, TRAP_ACTNO_RING, 0), makeTrap(((0 * STAGEMAP_SEA_LINE_LENGTH) + 64) + 8, 0, 0, TRAP_ACTNO_RING, 0), makeTrap(((0 * STAGEMAP_SEA_LINE_LENGTH) + 64) + 12, 0, 0, TRAP_ACTNO_RING, 0), makeTrap(((0 * STAGEMAP_SEA_LINE_LENGTH) + 64) + 16, 0, 0, TRAP_ACTNO_RING, 0), makeTrap(((0 * STAGEMAP_SEA_LINE_LENGTH) + 64) + 20, 0, 0, TRAP_ACTNO_RING, 0), makeTrap(((0 * STAGEMAP_SEA_LINE_LENGTH) + 64) + 24, 0, 0, TRAP_ACTNO_RING, 0), makeTrap(((0 * STAGEMAP_SEA_LINE_LENGTH) + 64) + 32, -5, 0, TRAP_ACTNO_ROCK, 0), makeTrap(((0 * STAGEMAP_SEA_LINE_LENGTH) + 64) + 32, 2, 0, TRAP_ACTNO_RING, 0), makeTrap(((0 * STAGEMAP_SEA_LINE_LENGTH) + 64) + 36, 2, 0, TRAP_ACTNO_RING, 0), makeTrap(((0 * STAGEMAP_SEA_LINE_LENGTH) + 64) + 40, 2, 0, TRAP_ACTNO_RING, 0), makeTrap(((0 * STAGEMAP_SEA_LINE_LENGTH) + 64) + 44, 2, 0, TRAP_ACTNO_RING, 0), makeTrap(((0 * STAGEMAP_SEA_LINE_LENGTH) + 64) + 48, -2, 0, TRAP_ACTNO_RING, 0), makeTrap(((0 * STAGEMAP_SEA_LINE_LENGTH) + 64) + 52, -2, 0, TRAP_ACTNO_RING, 0), makeTrap(((0 * STAGEMAP_SEA_LINE_LENGTH) + 64) + 56, -2, 0, TRAP_ACTNO_RING, 0), makeTrap(((0 * STAGEMAP_SEA_LINE_LENGTH) + 64) + 60, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((1 * STAGEMAP_SEA_LINE_LENGTH) + 0, -7, 0, TRAP_ACTNO_BUOY, 1), makeTrap((1 * STAGEMAP_SEA_LINE_LENGTH) + 4, 2, 0, TRAP_ACTNO_RING, 0), makeTrap((1 * STAGEMAP_SEA_LINE_LENGTH) + 4, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((1 * STAGEMAP_SEA_LINE_LENGTH) + 8, 2, 0, TRAP_ACTNO_RING, 0), makeTrap((1 * STAGEMAP_SEA_LINE_LENGTH) + 8, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((1 * STAGEMAP_SEA_LINE_LENGTH) + 10, 5, 0, TRAP_ACTNO_ROCK, 1), makeTrap((1 * STAGEMAP_SEA_LINE_LENGTH) + 10, 6, 0, TRAP_ACTNO_ROCK, 1), makeTrap((1 * STAGEMAP_SEA_LINE_LENGTH) + 12, 2, 0, TRAP_ACTNO_RING, 0), makeTrap((1 * STAGEMAP_SEA_LINE_LENGTH) + 12, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((1 * STAGEMAP_SEA_LINE_LENGTH) + 16, 2, 0, TRAP_ACTNO_RING, 0), makeTrap((1 * STAGEMAP_SEA_LINE_LENGTH) + 16, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((1 * STAGEMAP_SEA_LINE_LENGTH) + 20, 2, 0, TRAP_ACTNO_RING, 0), makeTrap((1 * STAGEMAP_SEA_LINE_LENGTH) + 20, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((1 * STAGEMAP_SEA_LINE_LENGTH) + 24, 2, 0, TRAP_ACTNO_RING, 0), makeTrap((1 * STAGEMAP_SEA_LINE_LENGTH) + 24, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((1 * STAGEMAP_SEA_LINE_LENGTH) + 28, 2, 0, TRAP_ACTNO_RING, 0), makeTrap((1 * STAGEMAP_SEA_LINE_LENGTH) + 28, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((1 * STAGEMAP_SEA_LINE_LENGTH) + 32, 2, 0, TRAP_ACTNO_RING, 0), makeTrap((1 * STAGEMAP_SEA_LINE_LENGTH) + 32, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((1 * STAGEMAP_SEA_LINE_LENGTH) + 36, 2, 0, TRAP_ACTNO_RING, 0), makeTrap((1 * STAGEMAP_SEA_LINE_LENGTH) + 36, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((1 * STAGEMAP_SEA_LINE_LENGTH) + 40, 0, 0, TRAP_ACTNO_JUMP, JUMP_TRICKTYPE_0), makeTrap((1 * STAGEMAP_SEA_LINE_LENGTH) + 72, 2, 0, TRAP_ACTNO_SHARK, 0), makeTrap((1 * STAGEMAP_SEA_LINE_LENGTH) + 72, -2, 0, TRAP_ACTNO_SHARK, 0), makeTrap((1 * STAGEMAP_SEA_LINE_LENGTH) + 80, -4, 0, TRAP_ACTNO_ROCK, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 0, -7, 0, TRAP_ACTNO_BUOY, 1), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 0, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 0, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 4, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 4, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 5, -7, 0, TRAP_ACTNO_ROCK, 1), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 8, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 8, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 12, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 12, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 16, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 16, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 20, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 20, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 30, -2, 0, TRAP_ACTNO_BIRD, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 35, -5, 0, TRAP_ACTNO_ROCK, 1), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 40, 2, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 40, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 44, 2, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 44, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 48, 2, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 48, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 52, 2, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 52, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 55, 4, 0, TRAP_ACTNO_ROCK, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 56, 2, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 56, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 60, 2, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 60, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 62, -2, 0, TRAP_ACTNO_BIRD, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 64, 2, 0, TRAP_ACTNO_JUMP, JUMP_TRICKTYPE_3), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 80, -4, 0, TRAP_ACTNO_ROCK, 1), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 80, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 80, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 84, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 84, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 88, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 88, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 92, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 92, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 96, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 96, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 100, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 100, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((2 * STAGEMAP_SEA_LINE_LENGTH) + 110, 3, 0, TRAP_ACTNO_ROCK, 0), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 0, -7, 0, TRAP_ACTNO_BUOY, 1), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 0, 0, 0, TRAP_ACTNO_MINE, 0), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 8, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 12, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 16, 2, 0, TRAP_ACTNO_RING, 0), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 20, 3, 0, TRAP_ACTNO_RING, 0), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 26, 0, 0, TRAP_ACTNO_JUMP, JUMP_TRICKTYPE_2), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 32, -5, 0, TRAP_ACTNO_ROCK, 0), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 36, 3, 0, TRAP_ACTNO_BIRD, 0), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 40, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 44, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 48, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 52, -3, 0, TRAP_ACTNO_RING, 0), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 56, -3, 0, TRAP_ACTNO_BIRD, 0), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 60, -1, 0, TRAP_ACTNO_BIRD, 0), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 64, -5, 0, TRAP_ACTNO_ROCK, 0), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 72, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 76, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 80, 2, 0, TRAP_ACTNO_RING, 0), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 84, 3, 0, TRAP_ACTNO_RING, 0), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 88, 0, 0, TRAP_ACTNO_SHARK, 0), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 96, 1, 0, TRAP_ACTNO_SHARK, 0), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 96, 6, 0, TRAP_ACTNO_ROCK, 0), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 100, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 104, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 104, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 108, 2, 0, TRAP_ACTNO_RING, 0), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 108, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 112, 3, 0, TRAP_ACTNO_RING, 0), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 112, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 116, -3, 0, TRAP_ACTNO_RING, 0), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 118, 0, 0, TRAP_ACTNO_SHARK, 0), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 120, -4, 0, TRAP_ACTNO_MINE, 0), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 120, -3, 0, TRAP_ACTNO_MINE, 0), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 120, -2, 0, TRAP_ACTNO_MINE, 0), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 120, 3, 0, TRAP_ACTNO_MINE, 0), makeTrap((3 * STAGEMAP_SEA_LINE_LENGTH) + 120, 4, 0, TRAP_ACTNO_MINE, 0), makeTrap((4 * STAGEMAP_SEA_LINE_LENGTH) + 0, -7, 0, TRAP_ACTNO_BUOY, 1), makeTrap((4 * STAGEMAP_SEA_LINE_LENGTH) + 20, 2, 0, TRAP_ACTNO_BIRD, 0), makeTrap((4 * STAGEMAP_SEA_LINE_LENGTH) + 30, 0, 0, TRAP_ACTNO_ROCK, 1), makeTrap((4 * STAGEMAP_SEA_LINE_LENGTH) + 30, 1, 0, TRAP_ACTNO_ROCK, 1), makeTrap((4 * STAGEMAP_SEA_LINE_LENGTH) + 70, -2, 0, TRAP_ACTNO_ROCK, 0), makeTrap((4 * STAGEMAP_SEA_LINE_LENGTH) + 70, 0, 0, TRAP_ACTNO_JUMP, JUMP_TRICKTYPE_1), makeTrap((4 * STAGEMAP_SEA_LINE_LENGTH) + 70, 2, 0, TRAP_ACTNO_ROCK, 1), makeTrap((4 * STAGEMAP_SEA_LINE_LENGTH) + 110, -3, 0, TRAP_ACTNO_ROCK, 0), makeTrap((4 * STAGEMAP_SEA_LINE_LENGTH) + 110, -1, 0, TRAP_ACTNO_MINE, 0), makeTrap((4 * STAGEMAP_SEA_LINE_LENGTH) + 110, 1, 0, TRAP_ACTNO_ROCK, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 0, -7, 0, TRAP_ACTNO_BUOY, 1), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 4, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 8, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 10, -2, 0, TRAP_ACTNO_MINE, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 10, 2, 0, TRAP_ACTNO_MINE, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 12, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 16, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 20, -2, 0, TRAP_ACTNO_MINE, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 20, 2, 0, TRAP_ACTNO_MINE, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 20, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 24, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 28, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 30, -2, 0, TRAP_ACTNO_MINE, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 30, 2, 0, TRAP_ACTNO_MINE, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 30, 0, 0, TRAP_ACTNO_SHARK, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 32, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 36, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 40, -2, 0, TRAP_ACTNO_MINE, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 40, 2, 0, TRAP_ACTNO_MINE, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 40, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 44, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 48, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 50, -2, 0, TRAP_ACTNO_MINE, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 50, 2, 0, TRAP_ACTNO_MINE, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 52, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 56, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 60, -3, 0, TRAP_ACTNO_MINE, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 60, 1, 0, TRAP_ACTNO_MINE, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 60, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 64, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 68, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 70, -3, 0, TRAP_ACTNO_MINE, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 70, 1, 0, TRAP_ACTNO_MINE, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 72, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 76, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 80, -2, 0, TRAP_ACTNO_MINE, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 80, 2, 0, TRAP_ACTNO_MINE, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 80, 0, 0, TRAP_ACTNO_SHARK, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 80, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 84, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 88, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 90, -1, 0, TRAP_ACTNO_MINE, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 90, 3, 0, TRAP_ACTNO_MINE, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 92, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 96, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 100, -1, 0, TRAP_ACTNO_MINE, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 100, 3, 0, TRAP_ACTNO_MINE, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 110, -2, 0, TRAP_ACTNO_MINE, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 110, 2, 0, TRAP_ACTNO_MINE, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 100, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 100, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 100, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 104, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 104, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 104, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 108, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 108, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 108, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 112, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 112, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((5 * STAGEMAP_SEA_LINE_LENGTH) + 112, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 0, -7, 0, TRAP_ACTNO_BUOY, 1), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 4, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 4, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 8, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 8, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 12, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 12, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 16, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 16, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 16, 3, 0, TRAP_ACTNO_ROCK, 1), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 20, 0, 0, TRAP_ACTNO_SHARK, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 24, -3, 0, TRAP_ACTNO_MINE, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 24, -2, 0, TRAP_ACTNO_MINE, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 24, -1, 0, TRAP_ACTNO_MINE, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 28, 2, 0, TRAP_ACTNO_RING, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 28, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 32, 2, 0, TRAP_ACTNO_RING, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 32, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 32, -3, 0, TRAP_ACTNO_ROCK, 1), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 36, 2, 0, TRAP_ACTNO_RING, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 36, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 40, 2, 0, TRAP_ACTNO_RING, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 40, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 44, 0, 0, TRAP_ACTNO_SHARK, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 48, 3, 0, TRAP_ACTNO_MINE, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 48, 2, 0, TRAP_ACTNO_MINE, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 48, 1, 0, TRAP_ACTNO_MINE, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 48, 4, 0, TRAP_ACTNO_ROCK, 1), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 52, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 52, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 56, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 56, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 60, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 60, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 64, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 64, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 64, -3, 0, TRAP_ACTNO_ROCK, 1), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 72, -2, 0, TRAP_ACTNO_MINE, 0), makeTrap((4 * STAGEMAP_SEA_LINE_LENGTH) + 72, 0, 0, TRAP_ACTNO_JUMP, JUMP_TRICKTYPE_1), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 72, 2, 0, TRAP_ACTNO_MINE, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 80, -5, 0, TRAP_ACTNO_ROCK, 1), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 88, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 92, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 96, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 96, 3, 0, TRAP_ACTNO_ROCK, 1), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 100, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 104, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 108, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 112, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 112, 3, 0, TRAP_ACTNO_ROCK, 1), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 116, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 120, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((6 * STAGEMAP_SEA_LINE_LENGTH) + 124, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 0, -7, 0, TRAP_ACTNO_BUOY, 1), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 20, -1, 0, TRAP_ACTNO_ROCK, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 20, 0, 0, TRAP_ACTNO_ROCK, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 20, 1, 0, TRAP_ACTNO_ROCK, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 40, 2, 0, TRAP_ACTNO_MINE, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 40, 3, 0, TRAP_ACTNO_MINE, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 40, -3, 0, TRAP_ACTNO_MINE, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 40, -2, 0, TRAP_ACTNO_MINE, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 60, 1, 0, TRAP_ACTNO_MINE, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 60, 0, 0, TRAP_ACTNO_MINE, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 60, -1, 0, TRAP_ACTNO_MINE, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 80, -4, 0, TRAP_ACTNO_ROCK, 1), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 80, -2, 0, TRAP_ACTNO_JUMP, JUMP_TRICKTYPE_10), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 80, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 80, 2, 0, TRAP_ACTNO_JUMP, JUMP_TRICKTYPE_11), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 80, 4, 0, TRAP_ACTNO_ROCK, 1), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 84, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 88, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 92, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 96, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 100, -3, 0, TRAP_ACTNO_MINE, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 100, -2, 0, TRAP_ACTNO_MINE, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 100, -1, 0, TRAP_ACTNO_MINE, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 100, 1, 0, TRAP_ACTNO_MINE, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 100, 2, 0, TRAP_ACTNO_MINE, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 100, 3, 0, TRAP_ACTNO_MINE, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 104, -3, 0, TRAP_ACTNO_MINE, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 104, -2, 0, TRAP_ACTNO_MINE, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 104, -1, 0, TRAP_ACTNO_MINE, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 104, 1, 0, TRAP_ACTNO_MINE, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 104, 2, 0, TRAP_ACTNO_MINE, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 104, 3, 0, TRAP_ACTNO_MINE, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 108, -3, 0, TRAP_ACTNO_MINE, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 108, -2, 0, TRAP_ACTNO_MINE, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 108, -1, 0, TRAP_ACTNO_MINE, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 108, 1, 0, TRAP_ACTNO_MINE, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 108, 2, 0, TRAP_ACTNO_MINE, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 108, 3, 0, TRAP_ACTNO_MINE, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 112, -3, 0, TRAP_ACTNO_MINE, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 112, -2, 0, TRAP_ACTNO_MINE, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 112, -1, 0, TRAP_ACTNO_MINE, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 112, 1, 0, TRAP_ACTNO_MINE, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 112, 2, 0, TRAP_ACTNO_MINE, 0), makeTrap((7 * STAGEMAP_SEA_LINE_LENGTH) + 112, 3, 0, TRAP_ACTNO_MINE, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 0, -7, 0, TRAP_ACTNO_BUOY, 1), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 8, -1, 0, TRAP_ACTNO_JUMP, JUMP_TRICKTYPE_6), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 8, 1, 0, TRAP_ACTNO_JUMP, JUMP_TRICKTYPE_7), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 8, -3, 0, TRAP_ACTNO_BOB, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 8, 3, 0, TRAP_ACTNO_BOB, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 12, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 12, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 12, 2, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 16, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 16, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 16, 2, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 20, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 20, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 20, 2, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 24, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 24, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 24, 2, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 28, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 28, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 28, 2, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 32, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 32, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 32, 2, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 36, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 36, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 36, 2, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 40, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 40, 0, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 40, 2, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 60, -3, 0, TRAP_ACTNO_MINE, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 60, -2, 0, TRAP_ACTNO_MINE, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 60, 2, 0, TRAP_ACTNO_MINE, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 60, 3, 0, TRAP_ACTNO_MINE, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 70, -3, 0, TRAP_ACTNO_MINE, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 70, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 70, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 70, 3, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 74, -3, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 74, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 74, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 74, 3, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 78, -3, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 78, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 78, 1, 0, TRAP_ACTNO_MINE, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 78, 3, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 82, -3, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 82, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 82, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 82, 3, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 86, -3, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 86, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 86, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 86, 3, 0, TRAP_ACTNO_MINE, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 90, -3, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 90, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 90, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 90, 3, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 94, -3, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 94, -1, 0, TRAP_ACTNO_MINE, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 94, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 94, 3, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 98, -3, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 98, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 98, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 98, 3, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 102, -3, 0, TRAP_ACTNO_MINE, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 102, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 102, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 102, 3, 0, TRAP_ACTNO_MINE, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 106, -3, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 106, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 106, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 106, 3, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 110, -3, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 110, -1, 0, TRAP_ACTNO_MINE, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 110, 1, 0, TRAP_ACTNO_MINE, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 110, 3, 0, TRAP_ACTNO_RING, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 118, -3, 0, TRAP_ACTNO_MINE, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 118, -2, 0, TRAP_ACTNO_MINE, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 118, 2, 0, TRAP_ACTNO_MINE, 0), makeTrap((8 * STAGEMAP_SEA_LINE_LENGTH) + 118, 3, 0, TRAP_ACTNO_MINE, 0), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 0, -7, 0, TRAP_ACTNO_BUOY, 1), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 0, 7, 0, TRAP_ACTNO_BUOY, 1), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 8, -3, 0, TRAP_ACTNO_RING, 0), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 8, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 12, -3, 0, TRAP_ACTNO_RING, 0), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 12, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 20, -3, 0, TRAP_ACTNO_RING, 0), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 20, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 24, -3, 0, TRAP_ACTNO_RING, 0), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 24, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 32, 0, 0, TRAP_ACTNO_JUMP, JUMP_TRICKTYPE_4), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 40, 2, 0, TRAP_ACTNO_RING, 0), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 40, 3, 0, TRAP_ACTNO_RING, 0), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 44, 2, 0, TRAP_ACTNO_RING, 0), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 44, 3, 0, TRAP_ACTNO_RING, 0), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 52, 2, 0, TRAP_ACTNO_RING, 0), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 52, 3, 0, TRAP_ACTNO_RING, 0), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 56, 2, 0, TRAP_ACTNO_RING, 0), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 56, 3, 0, TRAP_ACTNO_RING, 0), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 64, -3, 0, TRAP_ACTNO_MINE, 0), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 64, 0, 0, TRAP_ACTNO_JUMP, JUMP_TRICKTYPE_2), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 64, 3, 0, TRAP_ACTNO_MINE, 0), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 72, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 72, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 76, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 76, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 84, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 84, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 88, -2, 0, TRAP_ACTNO_RING, 0), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 88, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 96, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 96, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 100, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 100, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 108, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 108, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 112, 1, 0, TRAP_ACTNO_RING, 0), makeTrap((9 * STAGEMAP_SEA_LINE_LENGTH) + 112, -1, 0, TRAP_ACTNO_RING, 0), makeTrap((10 * STAGEMAP_SEA_LINE_LENGTH) + 0, -7, 0, TRAP_ACTNO_BUOY, 1), makeTrap((10 * STAGEMAP_SEA_LINE_LENGTH) + 0, 7, 0, TRAP_ACTNO_BUOY, 1), makeTrap((10 * STAGEMAP_SEA_LINE_LENGTH) + 0, 0, 0, TRAP_ACTNO_MINE, 0), makeTrap((10 * STAGEMAP_SEA_LINE_LENGTH) + 10, -2, 0, TRAP_ACTNO_MINE, 0), makeTrap((10 * STAGEMAP_SEA_LINE_LENGTH) + 10, 2, 0, TRAP_ACTNO_MINE, 0), makeTrap((10 * STAGEMAP_SEA_LINE_LENGTH) + 20, 0, 0, TRAP_ACTNO_MINE, 0), makeTrap((10 * STAGEMAP_SEA_LINE_LENGTH) + 30, -1, 0, TRAP_ACTNO_MINE, 0), makeTrap((10 * STAGEMAP_SEA_LINE_LENGTH) + 30, 1, 0, TRAP_ACTNO_MINE, 0), makeTrap((10 * STAGEMAP_SEA_LINE_LENGTH) + 40, 0, 0, TRAP_ACTNO_MINE, 0), makeTrap((10 * STAGEMAP_SEA_LINE_LENGTH) + 50, -3, 0, TRAP_ACTNO_MINE, 0), makeTrap((10 * STAGEMAP_SEA_LINE_LENGTH) + 50, 3, 0, TRAP_ACTNO_MINE, 0), makeTrap((10 * STAGEMAP_SEA_LINE_LENGTH) + 60, 0, 0, TRAP_ACTNO_MINE, 0), makeTrap((10 * STAGEMAP_SEA_LINE_LENGTH) + 70, -2, 0, TRAP_ACTNO_MINE, 0), makeTrap((10 * STAGEMAP_SEA_LINE_LENGTH) + 70, 2, 0, TRAP_ACTNO_MINE, 0), makeTrap((10 * STAGEMAP_SEA_LINE_LENGTH) + 80, 0, 0, TRAP_ACTNO_MINE, 0), makeTrap((10 * STAGEMAP_SEA_LINE_LENGTH) + 90, -1, 0, TRAP_ACTNO_MINE, 0), makeTrap((10 * STAGEMAP_SEA_LINE_LENGTH) + 90, 1, 0, TRAP_ACTNO_MINE, 0), makeTrap((10 * STAGEMAP_SEA_LINE_LENGTH) + 100, 0, 0, TRAP_ACTNO_MINE, 0), makeTrap((10 * STAGEMAP_SEA_LINE_LENGTH) + 110, -2, 0, TRAP_ACTNO_MINE, 0), makeTrap((10 * STAGEMAP_SEA_LINE_LENGTH) + 110, 2, 0, TRAP_ACTNO_MINE, 0), makeTrap((10 * STAGEMAP_SEA_LINE_LENGTH) + 120, -3, 0, TRAP_ACTNO_MINE, 0), makeTrap((10 * STAGEMAP_SEA_LINE_LENGTH) + 120, 3, 0, TRAP_ACTNO_MINE, 0), makeTrap((11 * STAGEMAP_SEA_LINE_LENGTH) + 0, -7, 0, TRAP_ACTNO_BUOY, 1), makeTrap((11 * STAGEMAP_SEA_LINE_LENGTH) + 0, 7, 0, TRAP_ACTNO_BUOY, 1), makeTrap((11 * STAGEMAP_SEA_LINE_LENGTH) + 32, 0, 0, TRAP_ACTNO_JUMP, JUMP_TRICKTYPE_0), makeTrap((11 * STAGEMAP_SEA_LINE_LENGTH) + 40, -7, 0, TRAP_ACTNO_BUOY, 1), makeTrap((11 * STAGEMAP_SEA_LINE_LENGTH) + 40, 7, 0, TRAP_ACTNO_BUOY, 1), makeTrap((11 * STAGEMAP_SEA_LINE_LENGTH) + 40, -3, 0, TRAP_ACTNO_BIRD, 0), makeTrap((11 * STAGEMAP_SEA_LINE_LENGTH) + 40, 3, 0, TRAP_ACTNO_BIRD, 0), makeTrap((11 * STAGEMAP_SEA_LINE_LENGTH) + 48, 2, 0, TRAP_ACTNO_BIRD, 0), makeTrap((11 * STAGEMAP_SEA_LINE_LENGTH) + 48, -2, 0, TRAP_ACTNO_BIRD, 0), makeTrap((11 * STAGEMAP_SEA_LINE_LENGTH) + 64, 2, 0, TRAP_ACTNO_BIRD, 0), makeTrap((11 * STAGEMAP_SEA_LINE_LENGTH) + 64, -2, 0, TRAP_ACTNO_BIRD, 0), makeTrap((11 * STAGEMAP_SEA_LINE_LENGTH) + 72, 3, 0, TRAP_ACTNO_BIRD, 0), makeTrap((11 * STAGEMAP_SEA_LINE_LENGTH) + 72, -3, 0, TRAP_ACTNO_BIRD, 0), makeTrap((11 * STAGEMAP_SEA_LINE_LENGTH) + 80, -7, 0, TRAP_ACTNO_BUOY, 1), makeTrap((11 * STAGEMAP_SEA_LINE_LENGTH) + 80, 7, 0, TRAP_ACTNO_BUOY, 1), makeTrap((11 * STAGEMAP_SEA_LINE_LENGTH) + 88, 2, 0, TRAP_ACTNO_BIRD, 0), makeTrap((11 * STAGEMAP_SEA_LINE_LENGTH) + 88, -2, 0, TRAP_ACTNO_BIRD, 0), makeTrap((11 * STAGEMAP_SEA_LINE_LENGTH) + 96, -3, 0, TRAP_ACTNO_BIRD, 0), makeTrap((11 * STAGEMAP_SEA_LINE_LENGTH) + 96, 3, 0, TRAP_ACTNO_BIRD, 0), makeTrap((11 * STAGEMAP_SEA_LINE_LENGTH) + 112, 2, 0, TRAP_ACTNO_BIRD, 0), makeTrap((11 * STAGEMAP_SEA_LINE_LENGTH) + 112, -2, 0, TRAP_ACTNO_BIRD, 0), makeTrap((12 * STAGEMAP_SEA_LINE_LENGTH) + 0, -3, 0, TRAP_ACTNO_BUOY, 1), makeTrap((12 * STAGEMAP_SEA_LINE_LENGTH) + 0, 3, 0, TRAP_ACTNO_BUOY, 1)];
var TRAPGEN_BORDER_NEAR = 0;
var TRAPGEN_BORDER_FAR = 72;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SEABG_SKY = 10;
var DEPTH_SEABG_SEA_U = 16;
var DEPTH_SEABG_SEA = 20;
var DEPTH_SEABG_GRA = 28;
var DEPTH_SEABG_PNT = 100;
var SKY_BG_HEIGHT = 96;
var SBD_SEA_WAVE_SPD = 768;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var SBD_FIX_COMBO_BLINK = 32;
var SBD_FIX_START = 1;
var SBD_FIX_START_FADE = 2;
var SBD_FIX_NODISP = 4;
var SBD_FIX_WARNING = 8;
var SBD_FIX_DANGER = 16;
var SBD_FIX_REQ_ENTER = 2048;
var SBD_FIX_REQ_LEAVE = 4096;
var SBD_FIX_BOOST_ACTION = 8192;
var SBD_FIX_BOOST_COMBO_ACTION = 16384;
var SBD_FIX_BOOST_OK_ACTION = 32768;
var SBD_FIX_DAMAGE_WAIT = 32;
var SBD_FIX_DAMAGE_VIB = 16;
var SBD_FIX_ENE_POS_X = 166;
var SBD_FIX_ENE_POS_Y = 4;
var SBD_FIX_T_BAR_POS_X = 175;
var SBD_FIX_T_BAR_POS_Y = 13;
var SBD_FIX_T_BAR_OFST_X = 0;
var SBD_FIX_WOOD_POS_X = -4;
var SBD_FIX_WOOD_POS_Y = -4;
var SBD_FIX_V_BAR_POS_X = 48;
var SBD_FIX_V_BAR_POS_Y = 17;
var SBD_FIX_START_OFST_Y = -48;
var SBD_FIX_START_FADE_DIVSTEP = 0.25;
var SBD_FIX_START_FADE_MIN = 0.25;
var SBD_FIX_START_FADE_MAX = 0;
var SBD_FIX_START_FADE_TIME = 8;
var FIXBG_DEPTH_BASE_TIMER = 0;
var FIXBG_DEPTH_BASE_SCORE = 16;
var FIXBG_DEPTH_BASE_COMBO = 128;
var FIXBG_DEPTH_BOOST_BASE = 32;
var FIXBG_DEPTH_BOOST_GAUGE = 34;
var FIXBG_DEPTH_BOOST_GAUGE_M = 36;
var FIXBG_DEPTH_BOOST_ICON = 40;
var FIXBG_DEPTH_VIT_BASE = 48;
var FIXBG_DEPTH_VIT_GAUGE = 50;
var FIXBG_COMBOTIMER_IDX_COMBO = 3;
var FIXBG_COMBOTIMER_IDX_MAX = 4;
var FIXBG_BOOSTMCS_IDX_ICON = 0;
var FIXBG_BOOSTMCS_IDX_BASE = 1;
var FIXBG_BOOSTMCS_IDX_MASK = 2;
var FIXBG_BOOSTMCS_IDX_GAUGE = 3;
var FIXBG_VITMCS_IDX_BASE = 0;
var FIXBG_VITMCS_IDX_MASK = 1;
var FIXBG_VITMCS_IDX_GAUGE = 2;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var SCREENSPRITE_DEPTH_MASK = 16383;
var SCREENSPRITE_DEPTH_FIX = 196608;
var SCREENSPRITE_DEPTH_EFFECT_FRONT = 163840;
var SCREENSPRITE_DEPTH_MARKER = 131072;
var SCREENSPRITE_DEPTH_EFFECT = 65536;
var SCREENSPRITE_DEPTH_SOUND = 32768;
var SBD_DM_START_TIME = 240;
var SBD_DM_LOGO_WAIT1 = 1;
var SBD_DM_LOGO_WAIT2 = 32;
var SBD_DM_LOGO_START_POS_X = 360;
var SBD_DM_LOGO_START_POS_Y = 64;
var SBD_DM_LOGO_MAIN_POS_X = 128;
var SBD_DM_LOGO_MAIN_POS_Y = 60;
var SBD_DM_LOGO_END_POS_X = -104;
var SBD_DM_LOGO_END_POS_Y = 64;
var SBD_DM_LOGO_CAPTION_WAIT1 = 14;
var SBD_DM_LOGO_CAPTION_WAIT2 = 30;
var SBD_DM_LOGO_CAPTION_MAIN_POS_X = 128;
var SBD_DM_LOGO_CAPTION_MAIN_POS_Y = 112;
var SBD_DM_READY_WAIT1 = 72;
var SBD_DM_READY_WAIT2 = 20;
var SBD_DM_GO_WAIT1 = 16;
var SBD_DM_READY_MAIN_POS_X = 128;
var SBD_DM_READY_MAIN_POS_Y = 80;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var SCREENSPRITE_DEPTH_MASK = 16383;
var SCREENSPRITE_DEPTH_FIX = 196608;
var SCREENSPRITE_DEPTH_EFFECT_FRONT = 163840;
var SCREENSPRITE_DEPTH_MARKER = 131072;
var SCREENSPRITE_DEPTH_EFFECT = 65536;
var SCREENSPRITE_DEPTH_SOUND = 32768;
var RSLT_SUBTASK_ID_FINISH = 0;
var RSLT_SUBTASK_ID_SCORE = 1;
var RSLT_SUBTASK_ID_TIME = 2;
var RSLT_SUBTASK_ID_RING = 3;
var RSLT_SUBTASK_ID_ENEMY = 4;
var RSLT_SUBTASK_ID_COMBO = 5;
var RSLT_SUBTASK_ID_MAX = 6;
var RSLT_STEP_WAIT_INIT = 0;
var RSLT_STEP_WAIT_MAIN = 1;
var RSLT_STEP_END_INIT = 2;
var RSLT_STEP_END_MAIN = 3;
var RSLT_STEP_NEXT = 4;
var SBD_DM_SCORE_DISP_SKIP = 1;
var SBD_DM_SCORE_COUNT_SE = 2;
var SBD_DM_SCORE_END = 32;
var SBD_DM_SKIP_IGNORE_TIME = 4;
var SBD_DM_COUNT_START_TIME = 70;
var SBD_DM_SCORE_END_TIME = 24;
var SBE_FIX_BOARD_RING = 0;
var SBE_FIX_BOARD_ENEMY = 1;
var SBE_FIX_BOARD_COMBO = 2;
var SBE_FIX_BOARD_MAX = 3;
var SBD_DM_CLEAR_WAIT1 = 1;
var SBD_DM_CLEAR_WAIT2 = 16;
var SBD_DM_CLEAR_POS_X = 128;
var SBD_DM_CLEAR_POS_Y = 96;
var SBD_DM_SCORE_DETAIL_WAIT1 = 56;
var SBD_DM_SCORE_DETAIL_WAIT1_OFST = 8;
var SBD_DM_SCORE_DETAIL_WAIT2 = 4;
var SBD_DM_SCORE_DETAIL_WAIT2_OFST = 2;
var SBD_DM_SCORE_DETAIL_START_POS_X = 360;
var SBD_DM_SCORE_DETAIL_START_POS_Y = 112;
var SBD_DM_SCORE_DETAIL_START_POS_Y_OFST = 24;
var SBD_DM_SCORE_DETAIL_MAIN_POS_X = 128;
var SBD_DM_SCORE_DETAIL_MAIN_POS_Y = 112;
var SBD_DM_SCORE_DETAIL_END_POS_X = -96;
var SBD_DM_SCORE_DETAIL_END_POS_Y = 112;
var SBD_DM_SCORE_DETAIL_OFST_X = 59;
var SBD_DM_SCORE_DETAIL_OFST_Y = -9;
var SBD_DM_SCORE_DETAIL_TITLE_OFST_X = -72;
var SBD_DM_SCORE_DETAIL_TITLE_OFST_Y = -6;
var SBD_DM_BOARD_SPD_DIVSTEP = 0.25;
var SBD_DM_BOARD_SPD_MAX = 0;
var SBD_DM_BOARD_SPD_MIN = 0.5;
var SBD_DM_SCORE_SPD_DIVSTEP = 0.0625;
var SBD_DM_SCORE_SPD_MAX = 0;
var SBD_DM_SCORE_SPD_MIN = 0;
var SBD_DM_BOARD_ESC_SPD_DIVSTEP = 0.5;
var SBD_DM_BOARD_ESC_SPD_MAX = 0;
var SBD_DM_BOARD_ESC_SPD_MIN = 1;
var SBD_DM_SCORE_HEAD_WAIT1 = 48;
var SBD_DM_SCORE_HEAD_START_POS_X = 360;
var SBD_DM_SCORE_HEAD_START_POS_Y2 = 56;
var SBD_DM_SCORE_HEAD_MAIN_POS_X = 128;
var SBD_DM_SCORE_HEAD_MAIN_POS_Y = 32;
var SBD_DM_SCORE_HEAD_END_POS_X = -96;
var SBD_DM_SCORE_HEAD_END_POS_Y = 32;
var SBD_DM_SCORE_OFST_X = 5;
var SBD_DM_SCORE_OFST_DEF_X = -6;
var SBD_DM_SCORE_OFST_Y = 12;
var SBD_DM_LOGO_WAIT2 = 32;
var SBD_DM_TIME_HEAD_WAIT1 = 40;
var SBD_DM_TIME_HEAD_WAIT2 = 2;
var SBD_DM_TIME_HEAD_START_POS_X = 360;
var SBD_DM_TIME_HEAD_START_POS_Y = 16;
var SBD_DM_TIME_HEAD_MAIN_POS_X = 128;
var SBD_DM_TIME_HEAD_MAIN_POS_Y = 16;
var SBD_DM_TIME_HEAD_END_POS_X = -96;
var SBD_DM_TIME_HEAD_END_POS_Y = 16;
var SBD_DM_TIME_HEAD_OFST_X = 20;
var SBD_DM_TIME_HEAD_OFST_Y = 12;
var RSLT_REQFLAGS_REQ_LEAVE = 1;
var SCORETITLE_STEP_APPEAR_INIT = 0;
var SCORETITLE_STEP_APPEAR_MAIN = 1;
var SCORETITLE_STEP_DISP_MAIN = 2;
var SCORETITLE_STEP_ESC_MAIN = 3;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var SBD_VSFIX_START_X = 22;
var SBD_VSFIX_START_Y = 172;
var SBD_VSFIX_GOAL_X = 228;
var SBD_VSFIX_GOAL_Y = 172;
var SBD_VSFIX_MARKER_S_Y_OFST = -15;
var SBD_VSFIX_LENGTH = (SBD_VSFIX_GOAL_X - SBD_VSFIX_START_X);
var SBD_VSFIX_DAMAGE_FLAG = 2;
var SBD_VSFIX_BOOST_FLAG = 4;
var SBD_VSFIX_TRICK_FLAG = 8;
var SBD_VSFIX_BRAKE_FLAG = 16;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var TIPS_BTN_XPOS = 473;
var TIPS_BTN_YPOS = 588;
var TIPS_BOARD_DEPTH = 10;
var TIPS_PANEL_DEPTH = 20;
var TIPS_BTN_DEPTH = 30;
var TIPS_FLAGS_BTN_DOWN = 1;
var TIPS_FLAGS_TIPS_ON = 2;
var TIPS_BTN_FRAME_BASE_JPN = 5;
var TIPS_BTN_FRAME_BASE_ENG = 1;
var TIPS_BTN_OFFSET_Y_MAX = 4;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var TRAP_BUOY_BASE_SCALE = 2.5;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var SBD_GOAL_OFST_Y = 1.953125;
var TRAP_GOAL_LOGO_BASE_SCALE = 2;
var TRAP_GOAL_RING_BASE_SCALE = 2.5;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var SBD_RING_CLEAR = 8;
var SBD_RING_RADIUS = 0.5;
var SBD_RING_Y_OFFSET = 0.5;
var SBD_RING_CLEAR_ACT_PATTERN = 6;
var SBD_RING_CLEAR_TIME = (2 * SBD_RING_CLEAR_ACT_PATTERN);
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var SBD_STONE_JET_RADIUS = 1.0859375;
var TRAP_ROCK_BASE_SCALE = 1.5;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var SBD_MINE_RADIUS = 0.375;
var SBD_BREAK_TIME = 24;
var SBD_BREAK_SPD = 1;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var SBD_JET_JUMP_MARK_OFST_Y = 2.125;
var SBD_JUMP_RADIUS = 0.75;
var TRAP_JUMP_BASE_SCALE = 1.25;
var TRAP_JUMP_SIGN_BASE_SCALE = 2.5;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var SBD_SHARK_RADIUS = 0.75;
var SBD_SHARK_HEIGHT = 0.25;
var SBD_SHARK_SPD = 0.25;
var SBD_SHARK_SPD_MUL = 0.03125;
var SBD_BREAK_TIME = 24;
var SBD_BREAK_SPD = 1;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var SBD_BIRD_RADIUS = 1;
var SBD_BIRD_HEIGHT = 0.75;
var SBD_SHARK_SPD = 0.25;
var SBD_SHARK_SPD_MUL = 0.03125;
var SBD_BREAK_TIME = 24;
var SBD_BREAK_SPD = 1;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var SBD_BOB_RADIUS = 1;
var SBD_BOB_HEIGHT = 2;
var SBD_BREAK_TIME = 24;
var SBD_BREAK_SPD = 1;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var TRAP_GOAL_ISLAND_BASE_SCALE = 64;
var SBD_MAP_LAND_LENGTH = ((STAGEMAP_SEA_LINE_LENGTH * 2) + (STAGEMAP_SEA_LINE_LENGTH / 2));
var SBD_LAND_LENGTH = 80;
var SBD_LAND_LENGTH_MAX = 384;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var EFFECT_WATER01_BASE_SCALE = 100;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var EFFECT_WATER02_PAT_END_FRAME = 11;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var EFFECT_BOOST_PAT_A_END_FRAME = 8;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var EFFECT_SMOKE_PAT_END_FRAME = 15;
var SBD_EFF_DAMAGE_SMOKE_SPD = 0.1484375;
var SBD_EFF_DAMAGE_SMOKE_ANGLE = 8192;
var SBD_EFF_DAMAGE_SMOKE_ANGLE_ADD = 4096;
var SBD_EFF_DAMAGE_SMOKE_NUM = 16;
var SBD_EFF_DAMAGE_SMOKE_ADD_SCALE = 0.03125;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var EFFECT_HIT_PAT_END_FRAME = 10;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var EFFECT_BOM_PAT_END_FRAME = 10;
var SBD_EFF_BOMB_OFST_Y = 0.25;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var SBD_EFF_BOOST_NUM = 16;
var SBD_EFF_BW_START_POS_Y = -1;
var SBD_EFF_BW_START_POS_Z = -150;
var SBD_EFF_BW_END_LENGTH = 2;
var SBD_EFF_BW_END_POS_Y = 2.5;
var SBD_EFF_BW_START_POS = 112;
var SBD_EFF_BW_END_POS = 144;
var SBD_EFF_BW_MOVE = 3;
var SBD_EFF_BW_LINE_LENGTH = 6;
var SBD_EFF_BW_TIMER = 16;
var SEQ_MODE_INIT = 0;
var SEQ_MODE_START = 1;
var SEQ_MODE_GAME = 2;
var SEQ_MODE_GOAL = 3;
var SEQ_MODE_RETIRE = 4;
var SEQ_MODE_NEXT = 5;
var COMMON_RING_XPOS = -40;
var COMMON_RING_YPOS = 0;
Seq_CleanUp();
var stageScene = _root.theLowerScreen.createEmptyMovieClip("GameStageScene", DEPTH_LOWER_SCENE_STAGE);
var screenScene = _root.theLowerScreen.createEmptyMovieClip("GameScreenScene", DEPTH_LOWER_SCENE_SCREEN);
var seaScene = _root.theLowerScreen.createEmptyMovieClip("GameSeaScene", DEPTH_LOWER_SCENE_SEA);
var touchPen = MouseInput_Create(_root.theLowerScreen);
var sceneView = SceneView_Create();
var vFrom = vec3d_Create(STAGE_CAMERA_X, STAGE_CAMERA_Y, STAGE_CAMERA_Z);
var vAt = vec3d_Create(STAGE_CAMERA_AT_X, STAGE_CAMERA_AT_Y, STAGE_CAMERA_AT_Z);
sceneView.SetParam(vFrom, vAt);
sceneView.SetCurrent();
var sceneProjMtx = new Array([], [], [], []);
setPerspectiveMtx(STAGE_FOVY, STAGE_ASPECTY, STAGE_NEAR, STAGE_FAR, sceneProjMtx);
var invProjMtx = new Array([], [], [], []);
setInvPorjMtx(invProjMtx);
var stageSpriteMgr = StageSpriteMan_Init(stageScene);
var screenSpriteMgr = ScreenSpriteMan_Init(screenScene);
var stageSoundMgr = StageSoundMan_Init(screenScene);
var gameSeq = seqGame_Create();
_root.onEnterFrame = seqGame_Update;
Frame 5
function ScreenFade_Create() {
var _local1 = new Object();
_local1.taskflag = 0;
_local1.exec = screenfade_exec;
_local1.exit = screenfade_exit;
_local1.step = 0;
_local1.alpha = 100;
_local1.color = 16777215 /* 0xFFFFFF */;
_local1.busy = false;
return(_local1);
}
function screenfade_exec() {
var SCREENFADE_FADE_SPD = 5;
var fUpdateBox = false;
switch (this.step) {
case SCREENFADE_STEP_IDLE :
break;
case SCREENFADE_STEP_FADE_IN :
this.alpha = this.alpha - SCREENFADE_FADE_SPD;
if (this.alpha < 0) {
this.alpha = 0;
this.step = SCREENFADE_STEP_IDLE;
this.busy = false;
}
fUpdateBox = true;
break;
case SCREENFADE_STEP_FADE_OUT :
this.alpha = this.alpha + SCREENFADE_FADE_SPD;
if (this.alpha > 100) {
this.alpha = 100;
this.step = SCREENFADE_STEP_IDLE;
this.busy = false;
}
fUpdateBox = true;
}
if (fUpdateBox) {
var alpha = Math.floor(this.alpha);
if (this.alpha > 0) {
with (_root.theUpperScreen.upperFadeBox_mc) {
_visible = true;
clear();
beginFill(this.color, alpha);
moveTo(0, 0);
lineTo(STAGE_SCREEN_WIDTH, 0);
lineTo(STAGE_SCREEN_WIDTH, STAGE_SCREEN_HEIGHT);
lineTo(0, STAGE_SCREEN_HEIGHT);
lineTo(0, 0);
endFill();
}
with (_root.theLowerScreen.lowerFadeBox_mc) {
_visible = true;
clear();
beginFill(this.color, alpha);
moveTo(0, 0);
lineTo(STAGE_SCREEN_WIDTH, 0);
lineTo(STAGE_SCREEN_WIDTH, STAGE_SCREEN_HEIGHT);
lineTo(0, STAGE_SCREEN_HEIGHT);
lineTo(0, 0);
endFill();
}
} else {
with (_root.theUpperScreen.upperFadeBox_mc) {
_visible = false;
}
with (_root.theLowerScreen.lowerFadeBox_mc) {
_visible = false;
}
}
}
}
function screenfade_exit() {
}
function ScreenFade_WhiteInRequest(myFade) {
myFade.alpha = 100;
myFade.color = 16777215 /* 0xFFFFFF */;
myFade.step = SCREENFADE_STEP_FADE_IN;
myFade.busy = true;
}
function ScreenFade_WhiteOutRequest(myFade) {
myFade.alpha = 0;
myFade.color = 16777215 /* 0xFFFFFF */;
myFade.step = SCREENFADE_STEP_FADE_OUT;
myFade.busy = true;
}
function endingSeq_Create() {
var _local2 = new Object();
_local2.Exec = endingSeq_exec;
_local2.Destroy = endingSeq_destroy;
_local2.m_mode = 0;
_local2.m_step = 0;
_local2.m_frameCounter = 0;
_local2.m_timer = 0;
_local2.m_key_state = 0;
_local2.m_fade = ScreenFade_Create();
_local2.m_lower_mc = _root.theLowerScreen.attachMovie("endingLowerAnimation", "endingLowerAnimation", DEPTH_LOWER_SCENE_ENDING);
_local2.m_upper_mc = _root.theUpperScreen.attachMovie("endingUpperAnimation", "endingUpperAnimation", DEPTH_UPPER_ENDING);
_local2.m_gallery_se = new Sound(_local2.m_upper_mc);
if (!UPPER_BG_IS_JPN) {
_local2.m_gallery_se.attachSound("se_yea_e");
} else {
_local2.m_gallery_se.attachSound("se_yea");
}
_local2.onMouseDown = endingSeq_MouseDownCallback;
_local2.onMouseUp = endingSeq_MouseUpCallback;
Mouse.addListener(_local2);
_local2.onKeyDown = endingSeq_KeyDownCallback;
_local2.onKeyUp = endingSeq_KeyUpCallback;
if (_root.UPPER_BG_IS_JPN) {
_local2.m_lower_mc.gotoAndPlay("PAT_JPN");
_local2.m_upper_mc.gotoAndPlay("PAT_JPN");
} else {
_local2.m_lower_mc.gotoAndPlay("PAT_ENG");
_local2.m_upper_mc.gotoAndPlay("PAT_ENG");
}
return(_local2);
}
function endingSeq_exec() {
switch (this.m_step) {
case 0 :
this.m_timer = 0;
this.m_step++;
break;
case 1 :
ScreenFade_WhiteInRequest(this.m_fade);
this.m_gallery_se.start(0);
this.m_timer = 0;
this.m_step++;
break;
case 2 :
this.m_timer++;
if (this.m_timer > 300) {
this.m_step++;
} else if (this.m_timer > 60) {
if (this.m_key_state & 3) {
this.m_step++;
}
}
break;
case 3 :
ScreenFade_WhiteOutRequest(this.m_fade);
this.m_timer = 0;
this.m_step++;
break;
case 4 :
if ((++this.m_timer) <= 30) {
break;
}
seqEnding_Exit(true);
return(undefined);
}
if (this.m_fade != null) {
this.m_fade.exec();
}
}
function endingSeq_destroy() {
stopAllSounds();
Mouse.removeListener(this);
if (this.m_fade != null) {
this.m_fade.exit();
this.m_fade = null;
}
if (this.m_lower_mc != null) {
this.m_lower_mc.removeMovieClip();
this.m_lower_mc = null;
}
if (this.m_upper_mc != null) {
this.m_upper_mc.removeMovieClip();
this.m_upper_mc = null;
}
if (this.m_gallery_se != null) {
this.m_gallery_se = null;
}
}
function endingSeq_MouseDownCallback() {
this.m_key_state = this.m_key_state | 1;
}
function endingSeq_MouseUpCallback() {
this.m_key_state = this.m_key_state & -2;
}
function endingSeq_KeyDownCallback() {
}
function endingSeq_KeyUpCallback() {
}
function seqEnding_MainLoop() {
if (_root.endingSeq != null) {
_root.endingSeq.Exec();
}
}
function seqEnding_Exit(isNext) {
delete _root.onEnterFrame;
_root.endingSeq.Destroy();
_root.endingSeq = null;
if (isNext) {
_root.gotoAndPlay("seq_game");
}
}
stop();
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var DEPTH_SCENE_DSPEN = 12500;
var DEPTH_SCENE_DSFRAME = 1000;
var DEPTH_SCENE_WINBG = 500;
var DEPTH_SCENE_UPPER = 900;
var DEPTH_SCENE_UPPER_MASK = 902;
var DEPTH_SCENE_LOWER = 800;
var DEPTH_SCENE_LOWER_MASK = 802;
var DEPTH_SCENE_BOOST_MASK = 10000;
var DEPTH_SCENE_VIT_MASK = 10002;
var DEPTH_SCENE_PLAYER_SEA_MASK = 10004;
var DEPTH_SCENE_PROGRESS_LOAD = 11000;
var DEPTH_SCENE_TIPS = 12000;
var DEPTH_SCENE_WINLOGO = 13000;
var DEPTH_UPPER_BG = 10;
var DEPTH_UPPER_GOAL = 20;
var DEPTH_UPPER_POINT = 30;
var DEPTH_UPPER_SONIC = 40;
var DEPTH_UPPER_ENDING = 50;
var DEPTH_UPPER_FADE = 100;
var DEPTH_UPPER_COUNTER = 400;
var DEPTH_LOWER_SCENE_STAGE = 40;
var DEPTH_LOWER_SCENE_SCREEN = 50;
var DEPTH_LOWER_SCENE_SEA = 30;
var DEPTH_LOWER_SCENE_ENDING = 60;
var DEPTH_LOWER_SCENE_FADE = 100;
var SCENE_UPPER_XPOS = 164;
var SCENE_UPPER_YPOS = 61;
var SCENE_LOWER_XPOS = 164;
var SCENE_LOWER_YPOS = 353;
var DSFRAME_XPOS = 292.5;
var DSFRAME_YPOS = 306.5;
var UPPER_BG_IS_JPN = true;
var STAGE_FOVY = 16.875;
var STAGE_FOVY_RAD = ((STAGE_FOVY * Math.PI) / 180);
var STAGE_FOVY_COTANGENT = (Math.cos(STAGE_FOVY_RAD) / Math.sin(STAGE_FOVY_RAD));
var STAGE_ASPECTY = 1.33333333333333;
var STAGE_NEAR = 1;
var STAGE_FAR = 400;
var STAGE_SCREEN_WIDTH = 256;
var STAGE_SCREEN_HEIGHT = 192;
var STAGE_CAMERA_X = 0;
var STAGE_CAMERA_Y = 3;
var STAGE_CAMERA_Z = 8;
var STAGE_CAMERA_AT_X = 0;
var STAGE_CAMERA_AT_Y = 1.5;
var STAGE_CAMERA_AT_Z = 0;
var STAGE_EVENT_JET_X_RAITO = 0.0390625;
var STAGE_EVENT_JET_Y_RAITO = 0.0390625;
var STAGEMAP_SEA_LINE_LENGTH = 128;
var STAGEMAP_LINESIZE = 12;
var STAGESPRITE_TYPE_NORMAL = 0;
var STAGESPRITE_TYPE_PLAYER = 1;
var STAGESPRITE_TYPE_WATER = 2;
var STAGESPRITE_TYPE_BOOST = 3;
var STAGESPRITE_TYPE_SHARK = 4;
var STAGESPRITE_TYPE_GOAL_ISLAND = 5;
var STAGESPRITE_TYPE_BOOST_WIND = 6;
var SBD_SHIP_RECORD_TIME_MAX = 17999;
var SBD_SHIP_RECORD_SCORE_MAX = 99999999;
var SBD_SHIP_RECORD_COMBO_MAX = 999;
var SBD_SHIP_RECORD_SCORE_ENEMY_MUL = 500;
var SBD_SHIP_RECORD_SCORE_RING_MUL = 100;
var SBD_SHIP_RECORD_SCORE_COMBO_MUL = 100;
var SBD_SHIP_RECORD_RING_MAX = 10000;
var SBD_SHIP_RECORD_ENEMY_KILL_MAX = 10000;
var SBD_MAIN_DEMO = 1;
var SBD_MAIN_RESULT = 2;
var SBD_MAIN_GAMEOVER = 8;
var SBD_MAIN_LAND = 32;
var SBD_MAIN_LAND_PREV = 512;
var SBD_MAIN_START = 2048;
var SBD_MAIN_RING_SE = 16777216;
var SBD_MAIN_GEN_TRAPGOAL = 536870912;
var SBD_MAIN_ENABLE_TIPS = 1073741824;
var PLAYER_TP_FLAG_ON = 1;
var PLAYER_TP_FLAG_PREV = 2;
var PLAYER_TP_FLAG_PUSH = 4;
var PLAYER_TP_FLAG_PULL = 8;
var PLAYER_TP_FLAG_RECT_IN = 16;
var PLAYER_TP_FLAG_ENABLE = 32;
var PLAYER_JETSKI_RADIUS = 0.46875;
var PLAYER_JETSKI_BOOST_RADIUS = 1;
var PLAYER_JETSKI_TRICK_RADIUS = 1.625;
var OBD_MOVE_UNDER = 1;
var OBD_MOVE_OVER = 2;
var OBD_MOVE_FRONT = 4;
var OBD_MOVE_BACK = 8;
var OBD_MOVE_COL_MASK = (((OBD_MOVE_UNDER | OBD_MOVE_OVER) | OBD_MOVE_FRONT) | OBD_MOVE_BACK);
var OBD_MOVE_JUMP = 16;
var OBD_MOVE_THROUGH = 32;
var OBD_MOVE_DIR = 64;
var OBD_MOVE_FALL = 128;
var SBD_SHIP_FLAG_BOOST = 1;
var SBD_SHIP_FLAG_DAMAGE = 2;
var SBD_SHIP_FLAG_TRICK = 4;
var SBD_SHIP_LAND_ARRIVE = 8;
var SBD_SHIP_NO_TOUCH_MOVE = 16;
var SBD_SHIP_INIT = 64;
var SBD_SHIP_FLAG_SPDUP = 128;
var SBD_SHIP_FLAG_GUARD = 1024;
var SBD_SHIP_FLAG_BOOST_COMBO_USE = 16384;
var SBD_SHIP_FLAG_REJUMP = 32768;
var SBD_SHIP_FLAG_SE_IDLING = 131072;
var SBD_SHIP_FLAG_SE_MAX_SPEED = 262144;
var SBD_SHIP_FLAG_SE_BOOST = 524288;
var SBD_SHIP_BOOST_USE2 = -30;
var SBD_SHIP_BOOST_USE3 = -2;
var SBD_SHIP_BOOST_USE4 = -0.125;
var SBD_SHIP_BOOST_USE5 = -10;
var SBD_SHIP_BOOST_USE6 = -144;
var SBD_SHIP_ENERGY_USE1 = 96;
var SBE_JET_FW = 0;
var SBE_JET_JUMP1 = 1;
var SBE_JET_JUMP2 = 2;
var SBE_JET_JUMP3 = 3;
var SBE_JET_JUMP4 = 4;
var SBE_JET_BOOST = 5;
var SBE_JET_DAMAGE = 6;
var SBE_JET_STOP = 7;
var SBE_JET_BRAKE1 = 8;
var SBE_JET_BRAKE2 = 9;
var SBE_JET_BRAKE3 = 10;
var SBE_JET_TRICK1 = 11;
var SBE_JET_TRICK2 = 12;
var SBE_JET_TRICK3 = 13;
var SBE_JET_TRICK4 = 14;
var SBE_JET_DOWN = 15;
var SBE_JET_SPIN1 = 16;
var SBE_JET_SPIN2 = 17;
var SBE_JET_MAX = 18;
var SBE_HOV_SPIN1 = SBE_JET_BRAKE1;
var SBE_HOV_SPIN2 = SBE_JET_BRAKE2;
var SBE_JET_JUMP2_FRAME_E = 59;
var SBE_JET_BRAKE1_FRAME_E = 5;
var SBE_JET_BRAKE3_FRAME_E = 20;
var SBD_JETSKI_VIT_MAX = 256;
var SBD_JETSKI_TEN_MAX = 288;
var GAME_TASKFLAG_KILL = 1;
var GAME_TASKFLAG_NOHIT = 2;
var GAME_TASKFLAG_HIT_DMG = 4;
var GAME_TASKFLAG_HIT_BRK = 8;
var GAME_TASKFLAG_COLLIDE = 16;
var TRAP_ACTNO_UNKNOWN = 0;
var TRAP_ACTNO_JUMP = 1;
var TRAP_ACTNO_RING = 2;
var TRAP_ACTNO_BUOY = 3;
var TRAP_ACTNO_ROCK = 4;
var TRAP_ACTNO_MINE = 5;
var TRAP_ACTNO_GOAL_LOGO = 6;
var TRAP_ACTNO_GOAL_RING = 7;
var TRAP_ACTNO_SHARK = 8;
var TRAP_ACTNO_BIRD = 9;
var TRAP_ACTNO_BOB = 10;
var TRAP_ACTNO_GOAL_ISLAND = 11;
var TRAP_ACTNO_WATER01 = 20;
var TRAP_ACTNO_WATER02 = 21;
var TRAP_ACTNO_BOOST_A = 22;
var TRAP_ACTNO_BOOST_B = 23;
var TRAP_ACTNO_SMOKE = 24;
var TRAP_ACTNO_SMOKE_DAMAGE = 25;
var TRAP_ACTNO_HIT = 26;
var TRAP_ACTNO_BOM = 27;
var TRAP_ACTNO_BOOST_WIND = 28;
var TRAP_ACTNO_TRICK_NG = 40;
var TRAP_ACTNO_TRICK_OK = 41;
var ACTFLAG_HIT_BODY = 1;
var ACTFLAG_HIT_ATTACK = 2;
var TRAP_FRAMEOUT_CENTER_Z = 40;
var TRAP_FRAMEOUT_RADIUS = 47;
var SBD_DAMAGE_DEFAULT = 64;
var SOUND_BGM_GAME = 0;
var SOUND_BGM_DISCOVER = 1;
var SOUND_BGM_RETIRE = 2;
var SOUND_BGM_RESULT = 3;
var SOUND_BGM_MAX = 4;
var SOUND_SE_ACCEL = 0;
var SOUND_SE_MAX_SPEED = 1;
var SOUND_SE_BRAKE = 2;
var SOUND_SE_BOOST_ON = 3;
var SOUND_SE_BOOST = 4;
var SOUND_SE_BOOST_END = 5;
var SOUND_SE_NO_ENERGY = 6;
var SOUND_SE_SKI_JUMP = 7;
var SOUND_SE_LAND_WATER = 8;
var SOUND_SE_TRICK_SLIDE = 9;
var SOUND_SE_TRICK_SUC = 10;
var SOUND_SE_TRICK_FAIL = 11;
var SOUND_SE_SPLASH = 12;
var SOUND_SE_DAMAGE = 13;
var SOUND_SE_COLLISION = 14;
var SOUND_SE_RETIRE = 15;
var SOUND_SE_EXPLOSION = 16;
var SOUND_SE_RING = 17;
var SOUND_SE_GOAL = 18;
var SOUND_SE_SCORE_INDICATION = 19;
var SOUND_SE_DRIFT = 20;
var SOUND_SE_IDLING = 21;
var SOUND_SE_GO = 22;
var SOUND_SE_OWA = 23;
var SOUND_SE_YAHOO = 24;
var SOUND_SE_YEA = 25;
var SOUND_SE_T_DECIDE = 26;
var SOUND_SE_MAX = 27;
var JUMP_TRICKTYPE_0 = 0;
var JUMP_TRICKTYPE_1 = 1;
var JUMP_TRICKTYPE_2 = 2;
var JUMP_TRICKTYPE_3 = 3;
var JUMP_TRICKTYPE_4 = 4;
var JUMP_TRICKTYPE_5 = 5;
var JUMP_TRICKTYPE_6 = 6;
var JUMP_TRICKTYPE_7 = 7;
var JUMP_TRICKTYPE_8 = 8;
var JUMP_TRICKTYPE_9 = 9;
var JUMP_TRICKTYPE_10 = 10;
var JUMP_TRICKTYPE_11 = 11;
var JUMP_TRICKTYPE_12 = 12;
var JUMP_TRICKTYPE_13 = 13;
var JUMP_TRICKTYPE_14 = 14;
var JUMP_TRICKTYPE_15 = 15;
var PAD_BUTTON_R = 256;
var PAD_BUTTON_L = 512;
var SCREENFADE_STEP_IDLE = 0;
var SCREENFADE_STEP_FADE_IN = 1;
var SCREENFADE_STEP_FADE_OUT = 2;
Seq_CleanUp();
var endingSeq = endingSeq_Create();
_root.onEnterFrame = seqEnding_MainLoop;
Symbol 13 MovieClip [GoalAnimation] Frame 1
stop();
Symbol 13 MovieClip [GoalAnimation] Frame 2
stop();
Symbol 16 MovieClip [DSPenAnimation] Frame 1
stop();
Symbol 16 MovieClip [DSPenAnimation] Frame 2
stop();
Symbol 27 MovieClip [WindowLogo] Frame 1
stop();
Symbol 27 MovieClip [WindowLogo] Frame 2
stop();
Symbol 64 MovieClip [dummySound] Frame 1
stop();
Symbol 64 MovieClip [dummySound] Frame 2
stop();
Symbol 64 MovieClip [dummySound] Frame 3
stop();
Symbol 64 MovieClip [dummySound] Frame 4
stop();
Symbol 64 MovieClip [dummySound] Frame 5
stop();
Symbol 64 MovieClip [dummySound] Frame 10
stop();
Symbol 64 MovieClip [dummySound] Frame 11
stop();
Symbol 64 MovieClip [dummySound] Frame 12
stop();
Symbol 64 MovieClip [dummySound] Frame 13
stop();
Symbol 64 MovieClip [dummySound] Frame 14
stop();
Symbol 64 MovieClip [dummySound] Frame 15
stop();
Symbol 64 MovieClip [dummySound] Frame 16
stop();
Symbol 64 MovieClip [dummySound] Frame 17
stop();
Symbol 64 MovieClip [dummySound] Frame 18
stop();
Symbol 64 MovieClip [dummySound] Frame 19
stop();
Symbol 64 MovieClip [dummySound] Frame 20
stop();
Symbol 64 MovieClip [dummySound] Frame 21
stop();
Symbol 64 MovieClip [dummySound] Frame 22
stop();
Symbol 64 MovieClip [dummySound] Frame 23
stop();
Symbol 64 MovieClip [dummySound] Frame 24
stop();
Symbol 64 MovieClip [dummySound] Frame 25
stop();
Symbol 64 MovieClip [dummySound] Frame 26
stop();
Symbol 64 MovieClip [dummySound] Frame 27
stop();
Symbol 64 MovieClip [dummySound] Frame 28
stop();
Symbol 64 MovieClip [dummySound] Frame 29
stop();
Symbol 64 MovieClip [dummySound] Frame 30
stop();
Symbol 64 MovieClip [dummySound] Frame 31
stop();
Symbol 64 MovieClip [dummySound] Frame 35
stop();
Symbol 64 MovieClip [dummySound] Frame 36
stop();
Symbol 64 MovieClip [dummySound] Frame 37
stop();
Symbol 64 MovieClip [dummySound] Frame 38
stop();
Symbol 64 MovieClip [dummySound] Frame 40
stop();
Symbol 64 MovieClip [dummySound] Frame 41
stop();
Symbol 64 MovieClip [dummySound] Frame 42
stop();
Symbol 64 MovieClip [dummySound] Frame 43
stop();
Symbol 64 MovieClip [dummySound] Frame 44
stop();
Symbol 88 MovieClip [BuoyGoalAnimation] Frame 13
gotoAndPlay ("PAT_GOAL");
Symbol 88 MovieClip [BuoyGoalAnimation] Frame 26
gotoAndPlay ("PAT_GREEN");
Symbol 99 MovieClip [endingLowerAnimation] Frame 1
stop();
Symbol 99 MovieClip [endingLowerAnimation] Frame 2
stop();
Symbol 104 MovieClip [endingUpperAnimation] Frame 1
stop();
Symbol 104 MovieClip [endingUpperAnimation] Frame 2
stop();
Symbol 119 MovieClip [BirdAnimation] Frame 2
stop();
Symbol 119 MovieClip [BirdAnimation] Frame 9
gotoAndPlay ("PAT_CRASH");
Symbol 154 MovieClip [BobAnimation] Frame 1
stop();
Symbol 154 MovieClip [BobAnimation] Frame 2
stop();
Symbol 154 MovieClip [BobAnimation] Frame 3
stop();
Symbol 154 MovieClip [BobAnimation] Frame 4
stop();
Symbol 154 MovieClip [BobAnimation] Frame 5
stop();
Symbol 154 MovieClip [BobAnimation] Frame 6
stop();
Symbol 154 MovieClip [BobAnimation] Frame 7
stop();
Symbol 154 MovieClip [BobAnimation] Frame 8
stop();
Symbol 154 MovieClip [BobAnimation] Frame 9
stop();
Symbol 154 MovieClip [BobAnimation] Frame 10
stop();
Symbol 154 MovieClip [BobAnimation] Frame 11
stop();
Symbol 154 MovieClip [BobAnimation] Frame 12
stop();
Symbol 154 MovieClip [BobAnimation] Frame 13
stop();
Symbol 154 MovieClip [BobAnimation] Frame 20
gotoAndPlay ("PAT_CRASH");
Symbol 157 MovieClip [MineAnimation] Frame 1
stop();
Symbol 188 MovieClip [SharkAnimation] Frame 8
gotoAndPlay ("PAT_SWIM");
Symbol 188 MovieClip [SharkAnimation] Frame 17
gotoAndPlay ("PAT_CRASH");
Symbol 198 MovieClip [fixBoostgaugeAnimation] Frame 9
gotoAndPlay ("PAT_NORMAL");
Symbol 198 MovieClip [fixBoostgaugeAnimation] Frame 18
gotoAndPlay ("PAT_BOOST");
Symbol 198 MovieClip [fixBoostgaugeAnimation] Frame 19
stop();
Symbol 209 MovieClip [fixBoostIconAnimation] Frame 2
stop();
Symbol 209 MovieClip [fixBoostIconAnimation] Frame 11
gotoAndPlay ("PAT_BOOST");
Symbol 230 MovieClip [fixComboFontAnimation] Frame 1
stop();
Symbol 230 MovieClip [fixComboFontAnimation] Frame 2
stop();
Symbol 230 MovieClip [fixComboFontAnimation] Frame 3
stop();
Symbol 230 MovieClip [fixComboFontAnimation] Frame 4
stop();
Symbol 230 MovieClip [fixComboFontAnimation] Frame 5
stop();
Symbol 230 MovieClip [fixComboFontAnimation] Frame 6
stop();
Symbol 230 MovieClip [fixComboFontAnimation] Frame 7
stop();
Symbol 230 MovieClip [fixComboFontAnimation] Frame 8
stop();
Symbol 230 MovieClip [fixComboFontAnimation] Frame 9
stop();
Symbol 230 MovieClip [fixComboFontAnimation] Frame 10
stop();
Symbol 261 MovieClip [fixLifegaugeAnimation] Frame 13
gotoAndPlay ("PAT_LV1");
Symbol 261 MovieClip [fixLifegaugeAnimation] Frame 26
gotoAndPlay ("PAT_LV2");
Symbol 261 MovieClip [fixLifegaugeAnimation] Frame 39
gotoAndPlay ("PAT_LV3");
Symbol 282 MovieClip [fixScoreAnimation] Frame 1
stop();
Symbol 282 MovieClip [fixScoreAnimation] Frame 2
stop();
Symbol 282 MovieClip [fixScoreAnimation] Frame 3
stop();
Symbol 282 MovieClip [fixScoreAnimation] Frame 4
stop();
Symbol 282 MovieClip [fixScoreAnimation] Frame 5
stop();
Symbol 282 MovieClip [fixScoreAnimation] Frame 6
stop();
Symbol 282 MovieClip [fixScoreAnimation] Frame 7
stop();
Symbol 282 MovieClip [fixScoreAnimation] Frame 8
stop();
Symbol 282 MovieClip [fixScoreAnimation] Frame 9
stop();
Symbol 282 MovieClip [fixScoreAnimation] Frame 10
stop();
Symbol 282 MovieClip [fixScoreAnimation] Frame 11
stop();
Symbol 307 MovieClip [fixTimeAnimation] Frame 1
stop();
Symbol 307 MovieClip [fixTimeAnimation] Frame 2
stop();
Symbol 307 MovieClip [fixTimeAnimation] Frame 3
stop();
Symbol 307 MovieClip [fixTimeAnimation] Frame 4
stop();
Symbol 307 MovieClip [fixTimeAnimation] Frame 5
stop();
Symbol 307 MovieClip [fixTimeAnimation] Frame 6
stop();
Symbol 307 MovieClip [fixTimeAnimation] Frame 7
stop();
Symbol 307 MovieClip [fixTimeAnimation] Frame 8
stop();
Symbol 307 MovieClip [fixTimeAnimation] Frame 9
stop();
Symbol 307 MovieClip [fixTimeAnimation] Frame 10
stop();
Symbol 307 MovieClip [fixTimeAnimation] Frame 11
stop();
Symbol 307 MovieClip [fixTimeAnimation] Frame 12
stop();
Symbol 312 MovieClip [IslandAnimation] Frame 1
stop();
Symbol 312 MovieClip [IslandAnimation] Frame 2
stop();
Symbol 317 MovieClip [JumpAnimation] Frame 1
stop();
Symbol 317 MovieClip [JumpAnimation] Frame 2
stop();
Symbol 317 MovieClip [JumpAnimation] Frame 3
stop();
Symbol 348 MovieClip [JumpSignAnimation] Frame 13
gotoAndPlay ("PAT_00");
Symbol 348 MovieClip [JumpSignAnimation] Frame 26
gotoAndPlay ("PAT_01");
Symbol 348 MovieClip [JumpSignAnimation] Frame 39
gotoAndPlay ("PAT_02");
Symbol 348 MovieClip [JumpSignAnimation] Frame 52
gotoAndPlay ("PAT_03");
Symbol 348 MovieClip [JumpSignAnimation] Frame 65
gotoAndPlay ("PAT_07");
Symbol 348 MovieClip [JumpSignAnimation] Frame 78
gotoAndPlay ("PAT_09");
Symbol 603 MovieClip [PlayerAnimation] Frame 6
stop();
Symbol 603 MovieClip [PlayerAnimation] Frame 16
gotoAndPlay ("brake2");
Symbol 603 MovieClip [PlayerAnimation] Frame 21
stop();
Symbol 603 MovieClip [PlayerAnimation] Frame 46
gotoAndPlay ("damage");
Symbol 603 MovieClip [PlayerAnimation] Frame 53
gotoAndPlay ("jump1");
Symbol 603 MovieClip [PlayerAnimation] Frame 59
stop();
Symbol 603 MovieClip [PlayerAnimation] Frame 60
stop();
Symbol 603 MovieClip [PlayerAnimation] Frame 64
gotoAndPlay ("jump3");
Symbol 603 MovieClip [PlayerAnimation] Frame 65
stop();
Symbol 603 MovieClip [PlayerAnimation] Frame 71
stop();
Symbol 603 MovieClip [PlayerAnimation] Frame 72
stop();
Symbol 603 MovieClip [PlayerAnimation] Frame 97
gotoAndPlay ("miss");
Symbol 603 MovieClip [PlayerAnimation] Frame 130
gotoAndPlay ("run1");
Symbol 603 MovieClip [PlayerAnimation] Frame 147
stop();
Symbol 603 MovieClip [PlayerAnimation] Frame 163
stop();
Symbol 603 MovieClip [PlayerAnimation] Frame 180
gotoAndPlay ("trick_tate");
Symbol 603 MovieClip [PlayerAnimation] Frame 197
gotoAndPlay ("trick_yoko");
Symbol 603 MovieClip [PlayerAnimation] Frame 198
stop();
Symbol 609 MovieClip [resultCleartimeAnimation] Frame 1
stop();
Symbol 640 MovieClip [resultFontAnimation] Frame 1
stop();
Symbol 640 MovieClip [resultFontAnimation] Frame 2
stop();
Symbol 640 MovieClip [resultFontAnimation] Frame 3
stop();
Symbol 640 MovieClip [resultFontAnimation] Frame 4
stop();
Symbol 640 MovieClip [resultFontAnimation] Frame 5
stop();
Symbol 640 MovieClip [resultFontAnimation] Frame 6
stop();
Symbol 640 MovieClip [resultFontAnimation] Frame 7
stop();
Symbol 640 MovieClip [resultFontAnimation] Frame 8
stop();
Symbol 640 MovieClip [resultFontAnimation] Frame 9
stop();
Symbol 640 MovieClip [resultFontAnimation] Frame 10
stop();
Symbol 640 MovieClip [resultFontAnimation] Frame 11
stop();
Symbol 640 MovieClip [resultFontAnimation] Frame 12
stop();
Symbol 678 MovieClip [RingAnimation] Frame 9
gotoAndPlay ("PAT_NORMAL");
Symbol 678 MovieClip [RingAnimation] Frame 22
stop();
Symbol 679 MovieClip [RingCommonAnimation] Frame 9
gotoAndPlay ("PAT_NORMAL");
Symbol 700 MovieClip [BomEffAnimation] Frame 11
stop();
Symbol 727 MovieClip [BoostEffAnimation] Frame 19
gotoAndPlay ("PAT_B_START");
Symbol 738 MovieClip [HitEffAnimation] Frame 11
stop();
Symbol 755 MovieClip [SmokeEffAnimation] Frame 17
stop();
Symbol 772 MovieClip [Water01EffAnimation] Frame 9
gotoAndPlay ("PAT_START");
Symbol 785 MovieClip [Water02EffAnimation] Frame 13
stop();
Symbol 792 MovieClip [startReadyGoAnimation] Frame 1
stop();
Symbol 792 MovieClip [startReadyGoAnimation] Frame 2
stop();
Symbol 825 MovieClip [Trick00Animation] Frame 6
stop();
Symbol 825 MovieClip [Trick00Animation] Frame 15
gotoAndPlay ("PAT_NOW");
Symbol 825 MovieClip [Trick00Animation] Frame 22
stop();
Symbol 852 MovieClip [Trick01Animation] Frame 6
stop();
Symbol 852 MovieClip [Trick01Animation] Frame 15
gotoAndPlay ("PAT_NOW");
Symbol 852 MovieClip [Trick01Animation] Frame 22
stop();
Symbol 879 MovieClip [Trick02Animation] Frame 6
stop();
Symbol 879 MovieClip [Trick02Animation] Frame 15
gotoAndPlay ("PAT_NOW");
Symbol 879 MovieClip [Trick02Animation] Frame 22
stop();
Symbol 906 MovieClip [Trick03Animation] Frame 6
stop();
Symbol 906 MovieClip [Trick03Animation] Frame 15
gotoAndPlay ("PAT_NOW");
Symbol 906 MovieClip [Trick03Animation] Frame 22
stop();
Symbol 920 MovieClip [Trick04Animation] Frame 6
stop();
Symbol 920 MovieClip [Trick04Animation] Frame 15
gotoAndPlay ("PAT_NOW");
Symbol 920 MovieClip [Trick04Animation] Frame 22
stop();
Symbol 947 MovieClip [TrickBetAnimation] Frame 6
stop();
Symbol 947 MovieClip [TrickBetAnimation] Frame 15
gotoAndPlay ("PAT_NOW");
Symbol 947 MovieClip [TrickBetAnimation] Frame 22
stop();
Symbol 952 MovieClip [TrickResultAnimation] Frame 1
stop();
Symbol 952 MovieClip [TrickResultAnimation] Frame 2
stop();
Symbol 957 MovieClip [UpBaseAnimation] Frame 1
stop();
Symbol 957 MovieClip [UpBaseAnimation] Frame 2
stop();
Symbol 974 MovieClip [UpGoalAnimation] Frame 25
gotoAndPlay ("PAT_START");
Symbol 979 MovieClip [UpSonic] Frame 1
stop();
Symbol 979 MovieClip [UpSonic] Frame 2
stop();
Symbol 984 MovieClip [TipsHintAnimation] Frame 1
stop();
Symbol 984 MovieClip [TipsHintAnimation] Frame 2
stop();
Symbol 993 MovieClip [TipsBtnAnimation] Frame 1
stop();
Symbol 993 MovieClip [TipsBtnAnimation] Frame 2
stop();
Symbol 993 MovieClip [TipsBtnAnimation] Frame 5
stop();
Symbol 993 MovieClip [TipsBtnAnimation] Frame 6
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 1
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 2
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 3
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 5
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 6
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 7
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 9
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 10
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 12
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 13
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 14
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 15
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 17
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 18
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 19
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 20
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 21
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 22
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 23
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 24
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 25
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 27
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 28
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 29
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 31
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 33
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 35
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 37
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 39
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 41
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 43
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 44
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 45
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 46
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 47
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 48
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 49
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 50
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 51
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 52
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 53
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 54
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 55
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 56
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 57
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 58
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 59
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 60
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 61
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 62
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 63
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 64
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 65
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 66
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 67
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 68
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 69
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 70
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 71
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 72
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 73
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 74
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 75
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 76
stop();
Symbol 994 MovieClip [dummyAnimation] Frame 77
stop();