public ConvergeObject(ConvergeCardSpec original, ConvergeZone zone)
        {
            this.original  = original;
            this.art       = original.art;
            this.power     = original.power;
            this.toughness = original.toughness;
            this.keywords  = original.keywords;
            GenerateKeywordsText();
            this.owner      = zone.owner;
            this.controller = owner;
            this.originalActivatedAbilities = new List <ConvergeActivatedAbility>();
            foreach (ConvergeActivatedAbilitySpec spec in original.activatedAbilities)
            {
                originalActivatedAbilities.Add(new ConvergeActivatedAbility(spec, this));
            }
            activatedAbilities = originalActivatedAbilities;

            this.originalTriggeredAbilities = new List <ConvergeTriggeredAbility>();
            foreach (ConvergeTriggeredAbilitySpec spec in original.triggeredAbilities)
            {
                originalTriggeredAbilities.Add(new ConvergeTriggeredAbility(spec, this));
            }
            this.triggeredAbilities = originalTriggeredAbilities;
            MoveZone(zone);
        }
Пример #2
0
        /// <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
        }
 public ConvergeCommand_Spawn(JSONArray template, ContentManager Content)
 {
     players  = ConvergeSelector.New(template.getProperty(1));
     cardSpec = ConvergeCardSpec.allCards[template.getString(2)];
     zoneId   = (ConvergeZoneId)Enum.Parse(typeof(ConvergeZoneId), template.getString(3, "Defense"));
 }