// Scenario script for 2001 Terrorist Defense // Amerian cities location_t washingtonLoc; location_t newYorkLoc; location_t chicagoLoc; location_t miamiLoc; // Terrorist cities location_t kabulLoc; location_t heratLoc; //--------------------------------- // Stuff to do when the game starts //----------------------------------- void_f TD_InitLocations() { // American cities MakeLocation(washingtonLoc, 55, 70); MakeLocation(newYorkLoc, 59, 66); MakeLocation(chicagoLoc, 57, 60); MakeLocation(miamiLoc, 51, 78); // Terrorist cities MakeLocation(kabulLoc, 13, 65); MakeLocation(heratLoc, 12, 61); } HandleEvent(BeginTurn) 'TD_Start' pre { TD_InitLocations(); Message (1, 'TD_AmericanStartMessage'); Message (2, 'TD_TerroristStartMessage'); DisableTrigger('TD_Start'); } //---------------------// // Start game messages // //---------------------// messagebox 'TD_AmericanStartMessage' { Show(); Title(ID_TD_START_TITLE); Text(ID_TD_START_A); Button(ID_BUTTON_RULES) { Kill(); LibraryConcept(72);//links to GL } } messagebox 'TD_TerroristStartMessage' { Show(); Title(ID_TD_START_TITLE); Text(ID_TD_Start_B); Button(ID_BUTTON_RULES) { Kill(); LibraryConcept(72);//links to GL } } //---------------// // City handlers // //---------------// // If A units move 2 square away from Kabul FTO (First Time Only) HandleEvent(MoveUnits) 'TD_NearKabul_F' pre { army_t tmpArmy; location_t tmpLoc; tmpArmy = army[0]; player[0] = tmpArmy.owner; if (player[0] == 1) { tmpLoc = location[1]; if (Distance(tmpLoc, kabulLoc) < 3) { Message(1, 'TD_NearKabul'); DisableTrigger('TD_NearKabul_F'); return STOP; } } } // If T units move 1 square away from Washington FTO HandleEvent(MoveUnits) 'TD_NearWashington_F' pre { army_t tmpArmy; location_t tmpLoc; tmpArmy = army[0]; player[0] = tmpArmy.owner; if (player[0] == 2) { tmpLoc = location[1]; if (Distance(tmpLoc, washingtonLoc) < 2) { Message(2, 'TD_NearWashington'); DisableTrigger('TD_NearWashington_F'); return STOP; } } } Messagebox 'TD_NearKabul' { Show(); Text(ID_TD_NEAR_KABUL); } Messagebox 'TD_NearWashington' { Show(); Text(ID_TD_NEAR_WASHINGTON); } //HandleEvent(MoveUnits) 'TD_ApproachEnemyCity' pre { // //int_t j; //location_t tmpLoc; //city_t tmpCity; //int_t tmpPlayer; // // if (army[0].owner == 1) { // tmpPlayer=2; // } // else{ // tmpplayer=1; // } // tmpLoc = location[1]; // // for(j=0;j