//------------------// // Nexus Power Core // //------------------// //The following definitions section defines values for constants that will be used throughout this script. #ifndef __NEXUSCORE_DEFS__ #define __NEXUSCORE_DEFS__ #define NULL 0 #define FILLED 1 #define IMBA 2 #define CELL1 "cell01" #define CELL2 "cell02" #define CELL3 "cell03" #define CELL4 "cell04" #define CELL5 "cell05" #define ONE 1 #endif //These are the Global Variables that the script will use. float order1 = NULL; float order2 = NULL; float order3 = NULL; float order4 = NULL; float order5 = NULL; void elevatorUpIntro() { sys.wait(0.1); $FirstUp.moveTo($upit); } void door40() { $rightd_40.open(); $leftd_40.open(); aiScriptedTetherMoveWait($glad_40, $tether_40); $rightd_40.close(); $leftd_40.close(); } void door141() { $rightd_141.open(); $leftd_141.open(); aiScriptedTetherMoveWait($mgunner_141, $tether_141); $rightd_141.close(); $leftd_141.close(); aiScriptedTetherMoveWait($monster_iron_maiden_7, $tether_143); } void door142() { $rightd_142.open(); $leftd_142.open(); aiScriptedTetherMoveWait($mgunner_142, $tether_142); $rightd_142.close(); $leftd_142.close(); } void waitTillDead(entity enemyDude) { while(isValidEntity(enemyDude)) { sys.wait(1.0); } } void moveEnemy(entity fromWhere) { entity theEnemy1 = sys.getEntity("enemy1"); entity theEnemy2 = sys.getEntity("enemy2"); entity theEnemy3 = sys.getEntity("enemy3"); entity theEnemy4 = sys.getEntity("enemy4"); entity theEnemy5 = sys.getEntity("enemy5"); if (isValidEntity(theEnemy1) || isValidEntity(theEnemy2) || isValidEntity(theEnemy3) || isValidEntity(theEnemy4) || isValidEntity(theEnemy5)) { string enemyLocale = fromWhere.getKey("name"); if (enemyLocale == CELL1) { theEnemy1.unbind(); //aiScriptedTetherMoveWait(theEnemy1, $tether1); waitTillDead(theEnemy1); } else if (enemyLocale == CELL2) { theEnemy2.unbind(); //aiScriptedTetherMoveWait(theEnemy2, $tether2); waitTillDead(theEnemy2); } else if (enemyLocale == CELL3) { theEnemy3.unbind(); //aiScriptedTetherMoveWait(theEnemy3, $tether3); waitTillDead(theEnemy3); } else if (enemyLocale == CELL4) { theEnemy4.unbind(); //aiScriptedTetherMoveWait(theEnemy4, $tether4); waitTillDead(theEnemy4); } else if (enemyLocale == CELL5) { theEnemy5.unbind(); //aiScriptedTetherMoveWait(theEnemy5, $tether5); waitTillDead(theEnemy5); } else { sys.println("You found a cell that doesn't exist. Excellent work; check moveEnemy()."); } } else { sys.println("No enemy has been spawned."); } } void spawnEnemy(string location) { if (location == CELL1) { sys.trigger($enemy_spawner_1); } else if (location == CELL2) { sys.trigger($enemy_spawner_2); } else if (location == CELL3) { sys.trigger($enemy_spawner_3); } else if (location == CELL4) { sys.trigger($enemy_spawner_4); } else if (location == CELL5) { sys.trigger($enemy_spawner_5); } else { sys.println("You're good at breaking things. Check spawnEnemy()."); } } void nullify(entity uncheck) { string test = uncheck.getKey("name"); if (test == CELL1) { order5 = NULL; sys.println("Setting order5 back to null: " + order5); } else if (test == CELL3) { order4 = NULL; } else if (test == CELL4) { order3 = NULL; } else if (test == CELL2) { order2 = NULL; } else if (test == CELL5) { order1 = NULL; } } void makeImba(entity isopen) { string test = isopen.getKey("name"); if (test == CELL1) { order5 = IMBA; sys.println("Setting order5 to IMBA: " + order5); } else if (test == CELL3) { order4 = IMBA; } else if (test == CELL4) { order3 = IMBA; } else if (test == CELL2) { order2 = IMBA; } else if (test == CELL5) { order1 = IMBA; } } void orderizer(entity checkme) { string test = checkme.getKey("name"); sys.println(test); if (order1 == NULL && order2 == NULL && order3 == NULL && order4 == NULL && order5 == NULL) { if (test == CELL5) { $justdoit_10.show(); $justdoit_5.hide(); sys.trigger($guiright); order1 = FILLED; } else { makeImba(checkme); //sys.println("Enemy spawning should happen."); spawnEnemy(test); sys.trigger($guiwrong); } } else if (order1 != IMBA && order2 == NULL && order3 == NULL && order4 == NULL && order5 == NULL) { if (test == CELL2) { $justdoit_7.show(); $justdoit_2.hide(); sys.trigger($guiright); order2 = FILLED; } else { makeImba(checkme); spawnEnemy(test); sys.trigger($guiwrong); } } else if (order1 != IMBA && order2 != IMBA && order3 == NULL && order4 == NULL && order5 == NULL) { if (test == CELL4) { $justdoit_9.show(); $justdoit_4.hide(); sys.trigger($guiright); order3 = FILLED; } else { makeImba(checkme); spawnEnemy(test); sys.trigger($guiwrong); } } else if (order1 != IMBA && order2 != IMBA && order3 != IMBA && order4 == NULL && order5 == NULL) { if (test == CELL3) { $justdoit_8.show(); $justdoit_3.hide(); sys.trigger($guiright); order4 = FILLED; } else { makeImba(checkme); spawnEnemy(test); sys.trigger($guiwrong); } } else if (order1 != IMBA && order2 != IMBA && order3 != IMBA && order4 != IMBA && order5 == NULL) { if (test == CELL1) { $justdoit_6.show(); $justdoit_1.hide(); sys.trigger($guiright); order5 = FILLED; } else { makeImba(checkme); spawnEnemy(test); sys.trigger($guiwrong); } } else { makeImba(checkme); spawnEnemy(test); sys.trigger($guiwrong); //sys.println("Something is IMBA, enemy spawned."); } if (order1 == FILLED && order2 == FILLED && order3 == FILLED && order4 == FILLED && order5 == FILLED) { //unlock the door sys.println("The door is now unlocked!"); sys.trigger($youwin); $exitopen.show(); $exitlocked.hide(); $endright.show(); $lastdoorright.hide(); $endleft.show(); $lastdoorleft.hide(); sys.trigger($obj_complete_1); } } void nonactiveguis() { $justdoit_1.setGuiParm("noninteractive", "1"); $justdoit_2.setGuiParm("noninteractive", "1"); $justdoit_3.setGuiParm("noninteractive", "1"); $justdoit_4.setGuiParm("noninteractive", "1"); $justdoit_5.setGuiParm("noninteractive", "1"); } void activeguis() { $justdoit_1.setGuiParm("noninteractive", "0"); $justdoit_2.setGuiParm("noninteractive", "0"); $justdoit_3.setGuiParm("noninteractive", "0"); $justdoit_4.setGuiParm("noninteractive", "0"); $justdoit_5.setGuiParm("noninteractive", "0"); } void cellControl(entity cell, entity up, entity down, entity top, entity upTop, entity downTop, entity playClip, entity monClip, entity theGUI) { string cellPos = cell.getKey("myPosition"); // *DEBUG* // sys.println(cellPos); if (cellPos == "up") { //theGUI.setGuiParm("noninteractive", "1"); nonactiveguis(); playClip.show(); nullify(cell); cell.setKey("myPosition", "moving"); top.setKey("myPosition", "moving"); cell.time(2.0); top.time(2.0); cell.accelTime(0.5); top.accelTime(0.5); cell.decelTime(0.5); top.decelTime(0.5); cell.moveTo(down); top.moveTo(upTop); top.rotateDownTo(1, 0); sys.wait(2.1); monClip.show(); playClip.hide(); cell.setKey("myPosition", "down"); top.setKey("myPosition", "up"); activeguis(); //theGUI.setGuiParm("noninteractive", "0"); sys.wait(1.0); sys.trigger($guiready); } else if (cellPos == "down") { //theGUI.setGuiParm("noninteractive", "1"); nonactiveguis(); playClip.show(); orderizer(cell); cell.setKey("myPosition", "moving"); top.setKey("myPosition", "moving"); cell.time(2.0); top.time(2.0); cell.accelTime(0.5); top.accelTime(0.5); cell.decelTime(0.5); top.decelTime(0.5); cell.moveTo(up); top.moveTo(downTop); top.rotateUpTo(1, 270); sys.wait(2.1); monClip.hide(); playClip.hide(); moveEnemy(cell); cell.setKey("myPosition", "up"); top.setKey("myPosition", "down"); if (order1 == IMBA || order2 == IMBA || order3 == IMBA || order4 == IMBA || order5 == IMBA) { cellControl(cell, up, down, top, upTop, downTop, playClip, monClip, theGUI); } //theGUI.setGuiParm("noninteractive", "0"); activeguis(); sys.trigger($guiready); } else if (cellPos == "moving") { sys.println("The cell is currently busy moving and may not change directions."); } else { sys.println("You are an insane bug finder. FUNCTION: cellControl()"); } } void cell01Call() { //This is GUI model that was used. string thatGUI = "justdoit_1"; entity whichgui = sys.getEntity(thatGUI); //This is the monster clip mover. string monclip = "monclip_1"; entity mc = sys.getEntity(monclip); //This is the player clip that keeps the player from messing up the cell. string playc = "pc_1"; entity pc = sys.getEntity(playc); //These are the necessary entities for the cell. string cellName = CELL1; // Must match the name of an entity in the map. entity theCell = sys.getEntity(cellName); string cellUpPositionName = "cell01up"; // Must match the name of an entity in the map. entity cellUp = sys.getEntity(cellUpPositionName); string cellDownPositionName = "cell01down"; // Must match the name of an entity in the map. entity cellDown = sys.getEntity(cellDownPositionName); //These are the necessary entities for the top piece which lowers the enemy. string whichTop = "top01"; // Must match the name of an entity in the map. entity topper = sys.getEntity(whichTop); string topUpPositionName = "top01up"; // Must match the name of an entity in the map. entity topUp = sys.getEntity(topUpPositionName); string topDownPositionName = "top01down"; // Must match the name of an entity in the map. entity topDown = sys.getEntity(topDownPositionName); //This checks to make sure all the entities are valid. if (isValidEntity(theCell) && isValidEntity(cellUp) && isValidEntity(cellDown) && isValidEntity(topper) && isValidEntity(topUp) && isValidEntity(topDown)) { sys.println("Got entities successfully."); cellControl(theCell, cellUp, cellDown, topper, topUp, topDown, pc, mc, whichgui); } else { sys.println("Entity not found. Likely, the cellName, cellUpPositionName, or cellDownPositionName was incorrect. FUNCTION: cell01Call()."); } } void cell02Call() { //This is GUI model that was used. string thatGUI = "justdoit_2"; entity whichgui = sys.getEntity(thatGUI); //This is the monster clip mover. string monclip = "monclip_2"; entity mc = sys.getEntity(monclip); //This is the player clip that keeps the player from messing up the cell. string playc = "pc_2"; entity pc = sys.getEntity(playc); //These are the necessary entities for the cell. string cellName = CELL2; // Must match the name of an entity in the map. entity theCell = sys.getEntity(cellName); string cellUpPositionName = "cell02up"; // Must match the name of an entity in the map. entity cellUp = sys.getEntity(cellUpPositionName); string cellDownPositionName = "cell02down"; // Must match the name of an entity in the map. entity cellDown = sys.getEntity(cellDownPositionName); //These are the necessary entities for the top piece which lowers the enemy. string whichTop = "top02"; // Must match the name of an entity in the map. entity topper = sys.getEntity(whichTop); string topUpPositionName = "top02up"; // Must match the name of an entity in the map. entity topUp = sys.getEntity(topUpPositionName); string topDownPositionName = "top02down"; // Must match the name of an entity in the map. entity topDown = sys.getEntity(topDownPositionName); //This checks to make sure all the entities are valid. if (isValidEntity(theCell) && isValidEntity(cellUp) && isValidEntity(cellDown) && isValidEntity(topper) && isValidEntity(topUp) && isValidEntity(topDown)) { sys.println("Got entities successfully."); cellControl(theCell, cellUp, cellDown, topper, topUp, topDown, pc, mc, whichgui); } else { sys.println("Entity not found. Likely, the cellName, cellUpPositionName, or cellDownPositionName was incorrect. FUNCTION: cell02Call()."); } } void cell03Call() { //This is GUI model that was used. string thatGUI = "justdoit_3"; entity whichgui = sys.getEntity(thatGUI); //This is the monster clip mover. string monclip = "monclip_3"; entity mc = sys.getEntity(monclip); //This is the player clip that keeps the player from messing up the cell. string playc = "pc_3"; entity pc = sys.getEntity(playc); //These are the necessary entities for the cell. string cellName = CELL3; // Must match the name of an entity in the map. entity theCell = sys.getEntity(cellName); string cellUpPositionName = "cell03up"; // Must match the name of an entity in the map. entity cellUp = sys.getEntity(cellUpPositionName); string cellDownPositionName = "cell03down"; // Must match the name of an entity in the map. entity cellDown = sys.getEntity(cellDownPositionName); //These are the necessary entities for the top piece which lowers the enemy. string whichTop = "top03"; // Must match the name of an entity in the map. entity topper = sys.getEntity(whichTop); string topUpPositionName = "top03up"; // Must match the name of an entity in the map. entity topUp = sys.getEntity(topUpPositionName); string topDownPositionName = "top03down"; // Must match the name of an entity in the map. entity topDown = sys.getEntity(topDownPositionName); //This checks to make sure all the entities are valid. if (isValidEntity(theCell) && isValidEntity(cellUp) && isValidEntity(cellDown) && isValidEntity(topper) && isValidEntity(topUp) && isValidEntity(topDown)) { sys.println("Got entities successfully."); cellControl(theCell, cellUp, cellDown, topper, topUp, topDown, pc, mc, whichgui); } else { sys.println("Entity not found. Likely, the cellName, cellUpPositionName, or cellDownPositionName was incorrect. FUNCTION: cell03Call()."); } } void cell04Call() { //This is GUI model that was used. string thatGUI = "justdoit_4"; entity whichgui = sys.getEntity(thatGUI); //This is the monster clip mover. string monclip = "monclip_4"; entity mc = sys.getEntity(monclip); //This is the player clip that keeps the player from messing up the cell. string playc = "pc_4"; entity pc = sys.getEntity(playc); //These are the necessary entities for the cell. string cellName = CELL4; // Must match the name of an entity in the map. entity theCell = sys.getEntity(cellName); string cellUpPositionName = "cell04up"; // Must match the name of an entity in the map. entity cellUp = sys.getEntity(cellUpPositionName); string cellDownPositionName = "cell04down"; // Must match the name of an entity in the map. entity cellDown = sys.getEntity(cellDownPositionName); //These are the necessary entities for the top piece which lowers the enemy. string whichTop = "top04"; // Must match the name of an entity in the map. entity topper = sys.getEntity(whichTop); string topUpPositionName = "top04up"; // Must match the name of an entity in the map. entity topUp = sys.getEntity(topUpPositionName); string topDownPositionName = "top04down"; // Must match the name of an entity in the map. entity topDown = sys.getEntity(topDownPositionName); //This checks to make sure all the entities are valid. if (isValidEntity(theCell) && isValidEntity(cellUp) && isValidEntity(cellDown) && isValidEntity(topper) && isValidEntity(topUp) && isValidEntity(topDown)) { sys.println("Got entities successfully."); cellControl(theCell, cellUp, cellDown, topper, topUp, topDown, pc, mc, whichgui); } else { sys.println("Entity not found. Likely, the cellName, cellUpPositionName, or cellDownPositionName was incorrect. FUNCTION: cell04Call()."); } } void cell05Call() { //This is GUI model that was used. string thatGUI = "justdoit_5"; entity whichgui = sys.getEntity(thatGUI); //This is the monster clip mover. string monclip = "monclip_5"; entity mc = sys.getEntity(monclip); //This is the player clip that keeps the player from messing up the cell. string playc = "pc_5"; entity pc = sys.getEntity(playc); //These are the necessary entities for the cell. string cellName = CELL5; // Must match the name of an entity in the map. entity theCell = sys.getEntity(cellName); string cellUpPositionName = "cell05up"; // Must match the name of an entity in the map. entity cellUp = sys.getEntity(cellUpPositionName); string cellDownPositionName = "cell05down"; // Must match the name of an entity in the map. entity cellDown = sys.getEntity(cellDownPositionName); //These are the necessary entities for the top piece which lowers the enemy. string whichTop = "top05"; // Must match the name of an entity in the map. entity topper = sys.getEntity(whichTop); string topUpPositionName = "top05up"; // Must match the name of an entity in the map. entity topUp = sys.getEntity(topUpPositionName); string topDownPositionName = "top05down"; // Must match the name of an entity in the map. entity topDown = sys.getEntity(topDownPositionName); //This checks to make sure all the entities are valid. if (isValidEntity(theCell) && isValidEntity(cellUp) && isValidEntity(cellDown) && isValidEntity(topper) && isValidEntity(topUp) && isValidEntity(topDown)) { sys.println("Got entities successfully."); cellControl(theCell, cellUp, cellDown, topper, topUp, topDown, pc, mc, whichgui); } else { sys.println("Entity not found. Likely, the cellName, cellUpPositionName, or cellDownPositionName was incorrect. FUNCTION: cell05Call()."); } } void lockDoor1() { $border1locked.show(); $border1open.hide(); $door1rlocked.show(); $door1ropen.hide(); $door1llocked.show(); $door1lopen.hide(); } void main() { elevatorUpIntro(); $justdoit_1.setGuiParm("noninteractive", "0"); $justdoit_2.setGuiParm("noninteractive", "0"); $justdoit_3.setGuiParm("noninteractive", "0"); $justdoit_4.setGuiParm("noninteractive", "0"); $justdoit_5.setGuiParm("noninteractive", "0"); }