public void EndTurn_timerExpired() { activePlayer.SufferWounds(); UpdateZoneChanges(); // activePlayer = activePlayer.opponent; activePlayer.BeginMyTurn(); foreach (ConvergeObject obj in Game1.inPlayList) { obj.BeginAnyTurn(activePlayer); } endTurnButton.visible = true; }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); // TODO: use this.Content to load your game content here data = new JSONTable("Content/data.json"); mouseOverGlow = new RichImage(data.getJSON("mouseOverGlow"), Content); cardFrame = new RichImage(data.getJSON("cardFrame"), Content); whiteFrame = new RichImage(data.getJSON("whiteFrame"), Content); blueFrame = new RichImage(data.getJSON("blueFrame"), Content); blackFrame = new RichImage(data.getJSON("blackFrame"), Content); redFrame = new RichImage(data.getJSON("redFrame"), Content); greenFrame = new RichImage(data.getJSON("greenFrame"), Content); goldFrame = new RichImage(data.getJSON("goldFrame"), Content); font = Content.Load <SpriteFont>("Arial"); shieldbg = Content.Load <Texture2D>("shieldbg"); powerbg = Content.Load <Texture2D>("powerbg"); woundbg = Content.Load <Texture2D>("woundbg"); tappedicon = Content.Load <Texture2D>("tapped"); abilityHighlight = Content.Load <Texture2D>("abilityHighlight"); targetArrow = Content.Load <Texture2D>("targetArrow"); targetBeam = Content.Load <Texture2D>("targetBeam"); badTargetArrow = Content.Load <Texture2D>("badTargetArrow"); badTargetBeam = Content.Load <Texture2D>("badTargetBeam"); attackBeam = Content.Load <Texture2D>("attackBeam"); resourceTextures = new Texture2D[] { Content.Load <Texture2D>("total_resources"), Content.Load <Texture2D>("white_hats"), Content.Load <Texture2D>("blue_science"), Content.Load <Texture2D>("black_hats"), Content.Load <Texture2D>("red_munitions"), Content.Load <Texture2D>("green_seeds"), }; ui = new UIContainer(); self = new ConvergePlayer(data.getJSON("self"), Content); opponent = new ConvergePlayer(data.getJSON("opponent"), Content); self.opponent = opponent; opponent.opponent = self; ui.Add(new ConvergeUIObject(self.homeBase)); ui.Add(new ConvergeUIObject(opponent.homeBase)); UIButtonStyle defaultStyle = UIButton.GetDefaultStyle(Content); endTurnButton = new UIButton("End Turn", new Rectangle(600, 400, 80, 40), defaultStyle, EndTurn_action, uiActions); ui.Add(endTurnButton); UIButton newHandButton = new UIButton("Cheat:New Hand", new Rectangle(600, 300, 80, 40), defaultStyle, NewHand_action, uiActions); ui.Add(newHandButton); JSONTable allCardsTemplate = data.getJSON("cards"); foreach (string cardName in allCardsTemplate.Keys) { ConvergeCardSpec newSpec = new ConvergeCardSpec(); ConvergeCardSpec.allCards.Add(cardName, newSpec); newSpec.Init(allCardsTemplate.getJSON(cardName), Content); } foreach (string cardName in data.getArray("mydeck").asStrings()) { //ConvergeObject handCard = new ConvergeObject(ConvergeCardSpec.allCards[cardName], self.laboratory); //ui.Add(new ConvergeUIObject(handCard)); } foreach (string cardName in data.getArray("oppdeck").asStrings()) { //ConvergeObject handCard = new ConvergeObject(ConvergeCardSpec.allCards[cardName], opponent.laboratory); //ui.Add(new ConvergeUIObject(handCard)); } UpdateZoneChanges(); self.BeginGame(); opponent.BeginGame(); activePlayer = self; self.BeginMyTurn(); opponent.numLandsPlayed = 1; // can't play a land in your first response phase }