Пример #1
0
 private void Hand_CardOutHover(Card sender, EventArgs e)
 {
     sender.Position = new Vector2(
         x: sender.Position.X,
         y: GlobalSetting.Default.PlayerHand.Y + 0);
 }
Пример #2
0
 public void Show(Card _card)
 {
     //System.Diagnostics.Trace.WriteLine("Atttack from: " + (_card as Monster).Original.Name);
     this.Position = new Vector2(_card.Sprite.Bound.Center.X, _card.Sprite.Bound.Center.Y);
     this.Sprite.Frame = new Rectangle(0, 0, 35, 70);
     this.IsShow = true;
     this.Status = STATUS.SWORD_FULL;
 }
Пример #3
0
 /// <summary>
 /// Add Card to Deck's Top (Last of List)
 /// </summary>
 /// <param name="_card"></param>
 public virtual void AddTop(Card _card)
 {
     ListCard.AddLast(_card);
     OnCardAdded(new CardEventArgs(_card));
 }
Пример #4
0
 public virtual void SendTo(Card _card, eDeckId _deck)
 {
     this.OutCard = this.RemoveCard(_card);
     this.DestDeck = _deck;
 }
Пример #5
0
 private void MonsterField_CardLeftClick(Card sender, EventArgs e)
 {
     switch (PlayScene.Player.Status)
     {
         case ePlayerStatus.IDLE:
             break;
         case ePlayerStatus.WAITFORTRIBUTE:
             break;
         case ePlayerStatus.SUMONNING:
             break;
         case ePlayerStatus.ATTACKING:
             //PlayScene.Player.MonsterBeAttack = sender;
             break;
         default:
             break;
     }
 }
Пример #6
0
 private void MonsterField_CardRightClick(Card sender, EventArgs e)
 {
     // System.Diagnostics.Debug.WriteLine("Right click");
 }
Пример #7
0
 public override void AddTop(Card _card)
 {
     base.AddTop(_card);
 }
Пример #8
0
 private void Hand_CardOutHover(Card sender, EventArgs e)
 {
     sender.Position = new Vector2(
         x: sender.Position.X,
         y: ComputerSetting.Default.Hand.Y - Hand.ListCard.First.Value.Sprite.Bound.Height);
 }
Пример #9
0
 private void SpellField_CardOutHover(Card sender, EventArgs e)
 {
 }
Пример #10
0
        private void Hand_CardLeftClick(Card sender, EventArgs e)
        {
            if (this.Status != ePlayerStatus.IDLE)
                return;
            if (IsTurn == false)
                return;
            if (Phase != ePhase.MAIN1 && Phase != ePhase.MAIN2)
                return;
            switch (sender.CardType)
            {
                case eCardType.MONSTER:
                    if (this.CurNormalSummon <= 0)
                        return;
                    if (this.MonsterField.Count == MonsterField.MaxCard)
                        return;
                    this.tribute = 0;
                    this.RequireTribute = 0;
                    if (((Monster)sender).Original.Level >= 5 && this.Status == ePlayerStatus.IDLE)
                    {
                        if (((Monster)sender).Original.Level == 5 || ((Monster)sender).Original.Level == 6)
                        {
                            this.RequireTribute = 1;
                        }
                        else
                        {
                            this.RequireTribute = 2;
                        }
                        if (this.MonsterField.Count < this.RequireTribute)
                            return;
                        this.Status = ePlayerStatus.WAITFORTRIBUTE;
                        if (!PlayScene.YNDialog.IsShow && this.SummonBuffer == null)
                        {
                            PlayScene.YNDialog.Show("Summon this monster require " + this.RequireTribute.ToString() + " monster tribute. Do you want to summon?");
                            this.SummonBuffer = sender;
                            //sender.STATUS = STATUS.ATK;
                            (sender as Monster).BattlePosition = eBattlePosition.ATK;
                            return;
                        }
                    }

                    SummonBuffer = sender;
                    this.Status = ePlayerStatus.SUMONNING;
                    //sender.STATUS = STATUS.ATK;
                    (sender as Monster).BattlePosition = eBattlePosition.ATK;

                    break;
                case eCardType.TRAP:
                    break;
                case eCardType.SPELL:
                    Hand.SendTo(sender, eDeckId.SPELLFIELD);
                    break;
                case eCardType.XYZ:
                    break;
                case eCardType.SYNCHRO:
                    break;
                case eCardType.FUSION:
                    break;
                default:
                    break;
            } // switch
        }
Пример #11
0
 private void SpellField_CardLeftClick(Card sender, EventArgs e)
 {
     // System.Diagnostics.Debug.WriteLine("Clicked");
     //this.MonsterField.RemoveCard(sender);
 }
Пример #12
0
 private void MonsterField_CardOnHover(Card sender, EventArgs e)
 {
     PlayScene.DetailSideBar.SetCardPreview(sender.ToString());
 }
Пример #13
0
        private void MonsterField_CardLeftClick(Card sender, EventArgs e)
        {
            switch (this.Status)
            {
                case ePlayerStatus.IDLE:
                    if ((sender as Monster).SwitchBattlePosition == false)
                        break;
                    if (this.Phase == ePhase.BATTLE)
                        break;
                    switch ((sender as Monster).BattlePosition)
                    {
                        case eBattlePosition.ATK:
                            (sender as Monster).SwitchToDef();
                            break;
                        case eBattlePosition.DEF:
                            (sender as Monster).SwitchToAtk();
                            break;
                        default:
                            break;
                    }
                    break;
                case ePlayerStatus.WAITFORTRIBUTE:
                    sender.STATUS = STATUS.TRIBUTE;

                    this.MonsterField.SendTo(sender, eDeckId.GRAVEYARD);
                    this.tribute++;
                    if (this.tribute == this.RequireTribute)
                    {
                        this.Status = ePlayerStatus.SUMONNING;
                    }
                    break;
                case ePlayerStatus.SUMONNING:
                    break;
                default:
                    break;
            }
        }
Пример #14
0
 public void AttackTo(Card _card)
 {
     //System.Diagnostics.Trace.WriteLine("Atttack to: " + (_card as Monster).Original.Name);
     this.Rotation = this.SetRotation(_card.Sprite.Bound.Center);
     this.AddMoveTo(
         new MoveTo(0.25f, new Vector2(
               _card.Sprite.Bound.Center.X,
               _card.Sprite.Bound.Center.Y)));
 }
Пример #15
0
 public override LinkedListNode<Card> RemoveCard(Card _card)
 {
     return base.RemoveCard(_card);
 }
Пример #16
0
 private void Hand_CardOnHover(Card sender, EventArgs e)
 {
     if (sender.IsAction)
         return;
     if (this.Hand.Count >= 6)
     {
         var card = this.Hand.ListCard.Find(sender).Previous;
         if (card != null)
             if (card.Value.Button.Hovered == true)
             {
                 card.Value.outHovered(EventArgs.Empty);
             }
     }
     if (sender.IsAction)
         return;
     sender.Position = new Vector2(
         x: sender.Position.X,
         y: ComputerSetting.Default.Hand.Y + 30 - Hand.ListCard.First.Value.Sprite.Bound.Height);
 }
 public CardEventArgs(Card card)
 {
     this.Card = card;
 }
Пример #18
0
 private void Hand_CardRightClick(Card sender, EventArgs e)
 {
 }
Пример #19
0
 private void computer_card_LeftClick(Card sender, EventArgs e)
 {
     if (this.Step != eBattleStep.BATTLE_STEP)
         return;
     if (this.MonsterATK != null && this.MonsterBeATK == null)
     {
         this.MonsterBeATK = (sender as Monster);
     }
 }
Пример #20
0
 private void MonsterField_CardOutHover(Card sender, EventArgs e)
 {
 }
Пример #21
0
 private void player_card_LeftClick(Card sender, EventArgs e)
 {
     if (this.Step != eBattleStep.BATTLE_STEP)
         return;
     if (this.MonsterATK == null)
         this.MonsterATK = (sender as Monster);
 }
Пример #22
0
 public virtual void AddBot(Card _card)
 {
     ListCard.AddFirst(_card);
     OnCardAdded(new CardEventArgs(_card));
 }
Пример #23
0
 private void Card_Hovered(Card sender, EventArgs e)
 {
     //#if DEBUG
     //            if (true)
     //#else
     if (sender.IsFaceUp)
     //#endif
         PlayScene.DetailSideBar.SetCardPreview(sender.ToString());
     else
     {
         PlayScene.DetailSideBar.SetDefaultCardPreview();
     }
 }
Пример #24
0
 public virtual LinkedListNode<Card> RemoveCard(Card _card)
 {
     LinkedListNode<Card> temp = ListCard.Find(_card);
         ListCard.Remove(temp);
     OnCardRemoved(new CardEventArgs(temp.Value));
     return temp;
 }
Пример #25
0
 protected void Tribute(Card _card)
 {
     this.MonsterField.SendTo(_card, eDeckId.GRAVEYARD);
     this.tribute++;
 }
Пример #26
0
        public void Shuffle()
        {
            Card[] _cards = new Card[ListCard.Count];
            bool[] _index = new bool[ListCard.Count];

            int temp = 0;
            foreach (Card item in ListCard)
            {
                while (true)
                {
                    temp = Rnd.Rand(0, ListCard.Count - 1);
                    if (_index[temp] == false)
                        break;
                }
                _cards[temp] = item;
                _index[temp] = true;
            }
            ListCard.Clear();
            foreach (Card c in _cards)
            {
                ListCard.AddLast(c);
            }
        }
Пример #27
0
 private void Hand_CardOnHover(Card sender, EventArgs e)
 {
     if (sender.IsAction)
         return;
     if (this.Hand.Count >= 6)
     {
         var card = this.Hand.ListCard.Find(sender).Previous;
         if (card != null)
             if (card.Value.Button.Hovered == true)
             {
                 card.Value.outHovered(EventArgs.Empty);
                 card.Value.Button.Hovered = false;
             }
     }
     sender.Position = new Vector2(
         x: sender.Position.X,
         y: GlobalSetting.Default.PlayerHand.Y - 30);
 }