internal BattlefieldCardReference(CardReference card, Player controller) : base(card, false) { if (plainsAbility == null) plainsAbility = new ActivatedAbility(new Cost(), new AddToManaPoolAction(controller, ManaAmount.Parse("W")), true, true); if (islandAbility == null) islandAbility = new ActivatedAbility(new Cost(), new AddToManaPoolAction(controller, ManaAmount.Parse("U")), true, true); if (swampAbility == null) swampAbility = new ActivatedAbility(new Cost(), new AddToManaPoolAction(controller, ManaAmount.Parse("B")), true, true); if (mountainAbility == null) mountainAbility = new ActivatedAbility(new Cost(), new AddToManaPoolAction(controller, ManaAmount.Parse("R")), true, true); if (forestAbility == null) forestAbility = new ActivatedAbility(new Cost(), new AddToManaPoolAction(controller, ManaAmount.Parse("G")), true, true); this.controller = controller; UpdateAbilities(); }
/// <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); List<MagicCard> list = new List<MagicCard>() {LoadCard("Dryad Arbor", GraphicsDevice, table), LoadCard("Dryad Arbor", GraphicsDevice, table), LoadCard("Dryad Arbor", GraphicsDevice, table), LoadCard("Dryad Arbor", GraphicsDevice, table), LoadCard("Dryad Arbor", GraphicsDevice, table), LoadCard("Fusion Elemental", GraphicsDevice, table), LoadCard("Memnite", GraphicsDevice, table), LoadCard("Catacomb Slug", GraphicsDevice, table), LoadCard("Air Elemental", GraphicsDevice, table), LoadCard("Swamp", GraphicsDevice, table), LoadCard("Air Elemental", GraphicsDevice, table), LoadCard("Island", GraphicsDevice, table), LoadCard("Air Elemental", GraphicsDevice, table), LoadCard("Plains", GraphicsDevice, table), LoadCard("Island", GraphicsDevice, table), LoadCard("Swamp", GraphicsDevice, table), LoadCard("Air Elemental", GraphicsDevice, table), LoadCard("Plains", GraphicsDevice, table), LoadCard("Island", GraphicsDevice, table), LoadCard("Mountain", GraphicsDevice, table), LoadCard("Forest", GraphicsDevice, table) }; list.Shuffle(); List<MagicCard> list2 = new List<MagicCard>(list); Deck deck = new NormalDeck(list); Deck deck2 = new NormalDeck(list2); player = new TestPlayer(host, deck); player2 = new DefaultPlayer(host, deck2); ui = new MagicUI(player, Content, GraphicsDevice); host.ReadyGameForStart(); // TODO: use this.Content to load your game content here cardBack = Content.Load<Texture2D>("card-back"); }
internal void Add(Player player) { players.Add(player); }
public MagicUI(Player viewingPlayer, ContentManager content, GraphicsDevice device) { this.viewingPlayer = viewingPlayer; font = content.Load<SpriteFont>("Font"); Texture2D normalButtonTexture = Texture2D.FromStream(device, File.OpenRead("Content/button3d.png")); Texture2D hoverButtonTexture = Texture2D.FromStream(device, File.OpenRead("Content/button3d_hover.png")); Texture2D pressButtonTexture = Texture2D.FromStream(device, File.OpenRead("Content/button3d_pressed.png")); cardBack = Texture2D.FromStream(device, File.OpenRead("Content/card-back.jpg")); symbolsTexture = Texture2D.FromStream(device, File.OpenRead("Content/mtgsymbols.png")); basicButtonStyle = new UIButtonStyleSet( new UIButtonStyle(font, Color.Black, normalButtonTexture, Color.White), new UIButtonStyle(font, Color.Yellow, hoverButtonTexture, Color.White), new UIButtonStyle(font, Color.Yellow, pressButtonTexture, Color.White, new Vector2(0,1)) ); buttons = new List<UIButton>() { new UIButton("Continue", new Rectangle(690, 420, 100, 50), basicButtonStyle, OnPressContinue) }; }
protected internal void DeclareAttacker(BattlefieldCardReference reference, Player toAttack) { if (reference.controller != this) return; attacking.Add(new KeyValuePair<BattlefieldCardReference, Player>(reference, toAttack)); }