//================================================================ // // 4-2 スクリプト、 // 2006/06/02現在、時限爆弾カウントの処理が入っています。 // //================================================================ #define BOMB_TIMER 5400 // 時限爆弾のカウント数、現在は3分00秒 #define BOMB_MISSION 0 // 本当は1 #define BOMB_END 3350 // ヴァリアブルの"Bomb_G"が3350になったら、時限爆弾の駆動解除 int g_BombTimerTask; // ミッションがスタートするとこのmain()から始まります。 func main() { int stage_clear; // print "mission 04-02 start"; // デバッグ、ミッションが1と仮定して処理を進める。 ScriptSetMissionNo(BOMB_MISSION); while( stage_clear == 0 ) { //ミッションナンバーが1のためミッション1の内容で調べる if ( ScriptGetMissionNo() == BOMB_MISSION ) { // print "mission1 start"; g_BombTimerTask = 0; mission_1(); } // 2006/06/02 特に明確なスクリプト終了条件がないため // 無理矢理終わらせてしまう。 if( g_BombTimerTask == 4 ) { stage_clear = 1; // g_BombTimerTask = 0; } //クリア状態かどうか取得 // stage_clear = ScriptGetStageClear(); //ゲームに処理を返す //sync != 0 の時処理を抜ける //1だとこのままWhileのトップに行く sync(1); } // print "mission 04-02 end"; } func mission_1() { //デバッグ文字出力 // print "mission1 start"; int getData; int getVariable; int loopData; int bombNowTime; loopData = 1; bombNowTime = 0; // ミッション1の処理 while ( loopData == 1 ) { // print "mission1_loop", bombNowTime; //イベントボックス "temp"がONになっているか調べる if ( ScriptGetEventBoxStatus( "bomb_timer") ) { // print "loop? ", g_BombTimerTask; if ( g_BombTimerTask == 0 ) { // 時限爆弾発動処理。 // print "BombTimer_Create"; ScriptEndBombTimer(); getData = ScriptCreateBombTimer( BOMB_TIMER ); // 時間設定。 g_BombTimerTask = 1; bombNowTime = 0; } if ( g_BombTimerTask == 1 ){ // if ( bombNowTime == 0 ){ // print "BombTimer_Create_Exe_Start"; // } // print "BombNowTime = ", bombNowTime; bombNowTime = bombNowTime + 1; // タイマーが0でないか取得。 // 時限爆弾のカウントを管理する。 ScriptExeBombTimer(); // 時限爆弾が時間切れになっていないかチェック。 getData = ScriptGetBombTimer(); if( getData <= 0 ) { g_BombTimerTask = 2; } // ゲーム側で爆弾を止めたかチェック。 getVariable = ScriptGetMissionVariable( "Bomb_G" ); if( getVariable == 3350 ) { g_BombTimerTask = 3; } } // 時限爆弾の起動終了処理。 if ( g_BombTimerTask == 2 ){ // ScriptEndBombTimer(); g_BombTimerTask = 4; loopData = 2; } // 時限爆弾の起動強制終了処理。 if ( g_BombTimerTask == 3 ){ ScriptEndBombTimer(); g_BombTimerTask = 4; loopData = 2; } } sync(1); // now_mission = ScriptGetMissionNo(); } // print "mission1 end?"; }