public void SetEffect()
    {
        if (this.m_CardBackManager == null)
        {
            this.m_CardBackManager = CardBackManager.Get();
            if (this.m_CardBackManager == null)
            {
                Debug.LogError("Failed to get CardBackManager!");
                base.enabled = false;
                return;
            }
        }
        bool   friendlySide = true;
        Entity entity       = this.m_Actor.GetEntity();

        if (entity != null)
        {
            Player controller = entity.GetController();
            if ((controller != null) && (controller.GetSide() == Player.Side.OPPOSING))
            {
                friendlySide = false;
            }
        }
        this.m_CardBackManager.UpdateDragEffect(base.gameObject, friendlySide);
        CardBack cardBack = this.m_CardBackManager.GetCardBack(this.m_Actor);

        if (cardBack != null)
        {
            this.m_Min = cardBack.m_EffectMinVelocity;
            this.m_Max = cardBack.m_EffectMaxVelocity;
        }
    }
Exemplo n.º 2
0
        void picBox_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            PictureBox senderControl = (PictureBox)sender;
            choosenCardBack = (CardBack)senderControl.Tag;
            this.DialogResult = DialogResult.OK;

            //throw new NotImplementedException();
        }
Exemplo n.º 3
0
        public async Task GetCardBackByIdTest()
        {
            CardBack cardBack = await _sdk.GetCardBackById(Region.eu, "155-pizza-stone",
                                                           Locale.ru_RU, _accessToken);

            Assert.IsNotNull(cardBack);
            Assert.AreEqual(cardBack.slug, "155-pizza-stone");
            Assert.IsNotNull(cardBack.image);
        }
Exemplo n.º 4
0
        void picBox_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            PictureBox senderControl = (PictureBox)sender;

            choosenCardBack   = (CardBack)senderControl.Tag;
            this.DialogResult = DialogResult.OK;


            //throw new NotImplementedException();
        }
Exemplo n.º 5
0
 public bool ChangeActor(Actor actor, CollectionManagerDisplay.ViewMode vtype)
 {
     if (!this.m_actorCacheInit)
     {
         this.m_actorCacheInit = true;
         this.m_actorCache.AddActorLoadedListener(new HandActorCache.ActorLoadedCallback(this.OnCardActorLoaded));
         this.m_actorCache.Initialize();
     }
     if (!this.m_actorCache.IsInitializing())
     {
         this.m_visualType = vtype;
         if (this.m_visualType != CollectionManagerDisplay.ViewMode.CARD_BACKS)
         {
             EntityDef entityDef = actor.GetEntityDef();
             CardFlair cardFlair = actor.GetCardFlair();
             bool      flag      = entityDef != this.m_entityDef;
             bool      flag2     = !cardFlair.Equals(this.m_cardFlair);
             if (flag || flag2)
             {
                 this.m_entityDef = entityDef;
                 this.m_cardFlair = cardFlair;
                 this.m_cardActor = this.m_actorCache.GetActor(entityDef, cardFlair);
                 if (this.m_cardActor == null)
                 {
                     return(false);
                 }
                 if (flag)
                 {
                     CollectionCardCache.Get().LoadCardDef(this.m_entityDef.GetCardId(), new CollectionCardCache.LoadCardDefCallback(this.OnCardDefLoaded), new CardPortraitQuality(1, this.m_cardFlair.Premium), null);
                 }
                 else
                 {
                     this.InitDeckTileActor();
                     this.InitCardActor();
                 }
             }
             return(true);
         }
         if (actor != null)
         {
             this.m_entityDef       = null;
             this.m_cardFlair       = null;
             this.m_currentCardBack = actor.GetComponentInChildren <CardBack>();
             this.m_cardActor       = this.m_cardBackActor;
             this.m_cardBackActor.SetCardbackUpdateIgnore(true);
             return(true);
         }
     }
     return(false);
 }
Exemplo n.º 6
0
 public PossibleTrailSlot(Location location, Power power, TimeOfDay timeOfDay, CardBack cardBack)
 {
     Location = location;
     Power = power;
     TimeOfDay = timeOfDay;
     CardBack = cardBack;
     if (power == Power.Feed || power == Power.DarkCall)
     {
         IsRevealed = true;
     }
     else
     {
         IsRevealed = false;
     }
 }
Exemplo n.º 7
0
 public PossibleTrailSlot(Location location, Power power)
 {
     Location = location;
     Power = power;
     if (power == Power.Feed || power == Power.DarkCall)
     {
         IsRevealed = true;
     }
     else
     {
         IsRevealed = false;
     }
     TimeOfDay = TimeOfDay.None;
     CardBack = CardBack.None;
 }
Exemplo n.º 8
0
    private void UpdateEchoTexture()
    {
        if (this.m_CardBackManager == null)
        {
            this.m_CardBackManager = CardBackManager.Get();
            if (this.m_CardBackManager == null)
            {
                Debug.LogError("CardBackSummonIn failed to get CardBackManager!");
                base.enabled = false;
            }
        }
        if (this.m_Actor == null)
        {
            this.m_Actor = SceneUtils.FindComponentInParents <Actor>(base.gameObject);
            if (this.m_Actor == null)
            {
                Debug.LogError("CardBackSummonIn failed to get Actor!");
            }
        }
        Texture mainTexture = base.GetComponent <Renderer>().material.mainTexture;

        if (this.m_CardBackManager.IsActorFriendly(this.m_Actor))
        {
            CardBack friendlyCardBack = this.m_CardBackManager.GetFriendlyCardBack();
            if (friendlyCardBack != null)
            {
                mainTexture = friendlyCardBack.m_HiddenCardEchoTexture;
            }
        }
        else
        {
            CardBack opponentCardBack = this.m_CardBackManager.GetOpponentCardBack();
            if (opponentCardBack != null)
            {
                mainTexture = opponentCardBack.m_HiddenCardEchoTexture;
            }
        }
        if (mainTexture != null)
        {
            base.GetComponent <Renderer>().material.mainTexture = mainTexture;
        }
    }
Exemplo n.º 9
0
        public GameState(Game1 _game, GraphicsDevice _graphicsDevice, ContentManager _content) : base(_game, _graphicsDevice, _content)
        {
            background = content.Load <Texture2D>("Images/Backgrounds/background2");
            gameFont   = content.Load <SpriteFont>("gameFont");

            deckManager = new DeckManager();
            deckManager.MakeDeck(deckManager.CardsInPlay["Deck"], _content);
            deckManager.ShuffleCards(deckManager.CardsInPlay["Deck"]);

            cardBack = new CardBack()
            {
                SpriteTexture = content.Load <Texture2D>("Images/Cards/Backs/2")
            };

            cardShadow = content.Load <Texture2D>("Images/Cards/cardShadow");

            playAgainButton = content.Load <Texture2D>("Images/MenuItems/playAgainButton");
            exitButton      = content.Load <Texture2D>("Images/MenuItems/exitButton");

            postit = content.Load <Texture2D>("Images/MenuItems/postit");
            pencil = content.Load <SpriteFont>("pencil");
            score  = 0;

            deckManager.CreateFoundationPiles(_content);
            deckManager.PopulateTableaus();

            selectMenuItem = content.Load <SoundEffect>("Sounds/SoundEffects/selectMenuItem");
            draw           = content.Load <SoundEffect>("Sounds/SoundEffects/draw");
            returnToDeck   = content.Load <SoundEffect>("Sounds/SoundEffects/returnToDeck");
            placeCard      = content.Load <SoundEffect>("Sounds/SoundEffects/placeCard");
            smiPlayed      = false;

            pmState = Mouse.GetState();

            clickTimer = 0;

            canWin = false;

            mcm = new MovingCardManager();

            msm = new MovingStackManager();
        }
Exemplo n.º 10
0
 public void DrawCardBack(Point topLeft, CardBack cardBack, int frameNo)
 {
     this.EnsureDC();
     this.lastReturnValue = NativeMethods.cdtAnimate(this.graphicsDC, (int)cardBack, topLeft.X, topLeft.Y, frameNo);
 }
Exemplo n.º 11
0
 public void DrawCardBack(Point topLeft, CardBack cardBack)
 {
     this.EnsureDC();
     this.lastReturnValue = NativeMethods.cdtDraw(this.graphicsDC, topLeft.X, topLeft.Y, (int)cardBack, 1, 16777215);
 }
Exemplo n.º 12
0
 internal Card(String name, Category category, Source source, Location location, Group group, CardBack cardBack)
     : this(name, category, source, location, group)
 {
     _CardBack = cardBack;
 }
Exemplo n.º 13
0
 /// <summary>
 /// Helper that converts card's background image index into card index.
 /// </summary>
 /// <param name="back"></param>
 /// <returns></returns>
 public static int ToCardIndex(CardBack back)
 {
     return((int)back);
 }
Exemplo n.º 14
0
        /// <summary>
        /// Draws a card with a given background
        /// </summary>
        /// <param name="topLeft">Top left location to start drawing the card.</param>
        /// <param name="cardBack">Background image index. See CardBack enumeration.</param>
        public void DrawCardBack(Point topLeft, CardBack cardBack)
        {
            int ci = (int)cardBack;

            this.graphicsSurface.DrawImage(cardImages[ci], new Rectangle(topLeft.X, topLeft.Y, DefaultWidth, DefaultHeight));
        }
Exemplo n.º 15
0
 /// <summary>
 /// Draws a card with a given background
 /// </summary>
 /// <param name="topLeft">Top left location to start drawing the card.</param>
 /// <param name="cardBack">Background image index. See CardBack enumeration.</param>
 public void DrawCardBack(Point topLeft, CardBack cardBack)
 {
     int ci = (int)cardBack;
     this.graphicsSurface.DrawImage(cardImages[ci], new Rectangle(topLeft.X, topLeft.Y, DefaultWidth, DefaultHeight));
 }
Exemplo n.º 16
0
 /// <summary>
 /// Gets the index of the card.
 /// </summary>
 /// <param name="back">The back.</param>
 /// <returns></returns>
 public static int GetCardIndex(CardBack back)
 {
     return (int)back;
 }
Exemplo n.º 17
0
 public CardBackViewModel(string key, CardBack back)
 {
     Key  = key;
     Name = back.Name;
     Path = back.Path;
 }