public void Main() { NWPlaceable objSelf = (_.OBJECT_SELF); NWObject parent = (objSelf.GetLocalObject("STRUCTURE_TEMP_PARENT")); parent.DeleteLocalObject("STRUCTURE_TEMP_INVENTORY_OPENED"); objSelf.DestroyAllInventoryItems(); objSelf.Destroy(); }
public void Main() { NWPlaceable objSelf = (NWGameObject.OBJECT_SELF); NWObject parent = (objSelf.GetLocalObject("CONTROL_TOWER_PARENT")); parent.DeleteLocalObject("CONTROL_TOWER_RESOURCE_BAY"); objSelf.DestroyAllInventoryItems(); objSelf.Destroy(); }
public void Main() { NWPlaceable objSelf = (_.OBJECT_SELF); NWObject parent = (objSelf.GetLocalObject("CONTROL_TOWER_PARENT")); parent.DeleteLocalObject("CONTROL_TOWER_FUEL_BAY"); objSelf.SetLocalBool("SETUP", true); objSelf.DestroyAllInventoryItems(); objSelf.Destroy(); }
public bool Run(params object[] args) { NWPlaceable objSelf = (Object.OBJECT_SELF); NWObject parent = (objSelf.GetLocalObject("STRUCTURE_TEMP_PARENT")); parent.DeleteLocalObject("STRUCTURE_TEMP_INVENTORY_OPENED"); objSelf.DestroyAllInventoryItems(); objSelf.Destroy(); return(true); }
public bool Run(params object[] args) { NWPlaceable objSelf = (Object.OBJECT_SELF); NWObject parent = (objSelf.GetLocalObject("CONTROL_TOWER_PARENT")); parent.DeleteLocalObject("CONTROL_TOWER_FUEL_BAY"); objSelf.DestroyAllInventoryItems(); objSelf.Destroy(); return(true); }
public bool Run(params object[] args) { NWPlaceable objSelf = NWPlaceable.Wrap(Object.OBJECT_SELF); foreach (NWItem item in objSelf.InventoryItems) { item.Destroy(); } NWObject parent = NWObject.Wrap(objSelf.GetLocalObject("STRUCTURE_TEMP_PARENT")); parent.DeleteLocalObject("STRUCTURE_TEMP_INVENTORY_OPENED"); objSelf.Destroy(); return(true); }
private void LoadMainPage() { NWObject table = _.OBJECT_SELF; NWPlayer pc = GetPC(); game = PazaakService.GetCurrentGame(table); if (game == null && table.GetLocalInt("IN_GAME") == 2) { // Belt and bracers clean up code. table.DeleteLocalInt("IN_GAME"); } // Check whether we have a game, or whether we should create one. if (table.GetLocalInt("IN_GAME") == 2) { CheckEndRound(table); if (game.nextTurn == pc) { // Our turn. BuildTurnOptions(pc); } else if (game.player2.IsNPC) { // NPC turn. Handle some DoNPCTurn(game); CheckEndRound(table); if (game.nextTurn == game.player2) { DoNPCTurn(game); } BuildTurnOptions(pc); } else { // Other player turn. SetPageHeader("MainPage", "It is not currently your turn."); ClearPageResponses("MainPage"); } } // Table is open for a second player. else if (table.GetLocalInt("IN_GAME") == 1) { NWObject collection = pc.GetLocalObject("ACTIVE_COLLECTION"); if (GetName(table.GetLocalObject("PLAYER_1")) == pc.Name) { SetPageHeader("MainPage", "You are waiting for an opponent here. Or play against the host."); ClearPageResponses("MainPage"); AddResponseToPage("MainPage", "Table host (NPC)"); } // Check that the player has an active Pazaak deck. else if (collection.IsValid) { SetPageHeader("MainPage", GetName(table.GetLocalObject("PLAYER_1")) + " is waiting for an opponent. Join game?"); ClearPageResponses("MainPage"); AddResponseToPage("MainPage", "Join game"); } else { SetPageHeader("MainPage", "Use your Pazaak Collection on this table to join the game."); ClearPageResponses("MainPage"); } } // Create a game. Offer the PC a choice of vs NPC or vs Player. else { NWObject collection = pc.GetLocalObject("ACTIVE_COLLECTION"); // Check that the player has an active Pazaak deck. if (collection.IsValid) { table.SetLocalInt("IN_GAME", 1); table.SetLocalObject("PLAYER_1", pc); table.DeleteLocalObject("PLAYER_2"); SetPageHeader("MainPage", "Game created. Will this be against another player, or the table owner?"); ClearPageResponses("MainPage"); AddResponseToPage("MainPage", "A player"); AddResponseToPage("MainPage", "Table host (NPC)"); } else { SetPageHeader("MainPage", "Use your Pazaak Collection on this table to join the game."); ClearPageResponses("MainPage"); } } }