示例#1
0
 public Card(string name, string description, string path, CardTypes type)
 {
     this.Name        = name;
     this.Description = description;
     this.Path        = path;
     this.Type        = type;
 }
示例#2
0
        public void SendInvitation(string hostNick, string opponentNick, CardTypes cards)
        {
            if (!AllPlayers.ContainsKey(opponentNick) || AllPlayers[opponentNick].Playing)
            {
                return;
            }
            if (AllPlayers[hostNick].Playing) //if he already plays (could happen)
            {
                return;
            }

            _gameId++;
            if (AllPlayers[opponentNick].Client.ReceiveInvitation(_gameId, cards, hostNick))
            {
                if (AllPlayers[hostNick].Playing) //if he already plays (could happen as well)
                {
                    return;
                }
                var game = new CurrentGame(AllPlayers[hostNick], AllPlayers[opponentNick], cards, _gameId);
                CurrentGames.Add(_gameId, game);
                var area = CreateRandomArea(cards);
                game.Host.Playing     = true;
                game.Opponent.Playing = true;
                game.Host.Client.StartGame(_gameId, area, opponentNick, true);
                game.Opponent.Client.StartGame(_gameId, area, hostNick, false);
                game.Start(ForceFinishGame);
                return;
            }
            _gameId--;
        }
示例#3
0
        private void SetActiveTypeFields(CardTypes cardType)
        {
            grpUnit.Enabled  = false;
            grpSpell.Enabled = false;
            grpItem.Enabled  = false;

            switch (cardType)
            {
            case CardTypes.Unit:
                grpUnit.Enabled = true;
                break;

            case CardTypes.Spell:
                grpSpell.Enabled = true;
                break;

            case CardTypes.Item:
                grpItem.Enabled = true;
                break;

            case CardTypes.Default:
            default:
                break;
            }
        }
示例#4
0
    public static BaseInfo Deserialze(DataStream reader)
    {
        int PictureID     = reader.ReadSInt32();
        int cardNameCount = reader.ReadSInt32();
        SortedDictionary <string, string> CardNames = new SortedDictionary <string, string>();

        for (int i = 0; i < cardNameCount; i++)
        {
            string ls    = reader.ReadString8();
            string value = reader.ReadString8();
            CardNames[ls] = value;
        }

        bool      IsTemp        = reader.ReadByte() == 0x01;
        bool      IsHide        = reader.ReadByte() == 0x01;
        int       Metal         = reader.ReadSInt32();
        int       Energy        = reader.ReadSInt32();
        int       Coin          = reader.ReadSInt32();
        int       EffectFactor  = reader.ReadSInt32();
        int       LimitNum      = reader.ReadSInt32();
        int       CardRareLevel = reader.ReadSInt32();
        int       ShopPrice     = reader.ReadSInt32();
        CardTypes CardType      = (CardTypes)reader.ReadSInt32();

        return(new BaseInfo(PictureID, CardNames, IsTemp, IsHide, Metal, Energy, Coin, EffectFactor, LimitNum, CardRareLevel, ShopPrice, CardType));
    }
示例#5
0
        public void SelectCard(int playerId, CardTypes card)
        {
            //remove card from hand and add to played cards
            Player player = playerList.Find(x => x.Id == playerId);

            player.ChooseCard(card);
            numChosenCards++;
            //if all players have chosen a card, pass cards
            if (numChosenCards == playerCount)
            {
                //reset
                numChosenCards = 0;
                round--;

                //if last card, score round
                if (round == 0)
                {
                    foreach (Player currPlayer in playerList)
                    {
                        currPlayer.ScoreCards();
                        currPlayer.Hand = _Deck.DealHand(numRounds);
                    }
                }

                PassCards();
            }
        }
示例#6
0
 public CardData(CardTypes Type, string Description, Sprite CardSprite, PathCardData PathData)
 {
     this.Type        = Type;
     this.Description = Description;
     this.CardSprite  = CardSprite;
     this.PathData    = PathData;
 }
示例#7
0
        /// <summary>
        /// 创建优惠券
        /// </summary>
        /// <returns></returns>
        public ActionResult Edit(long merchantid, long?id = null, CardTypes type = CardTypes.DISCOUNT)
        {
            //var xx = this.WeChat.DeleteCardCoupon("p8ntH0ly5Wtdauv5pLm4NuX1W8jI");
            //xx = this.WeChat.DeleteCardCoupon("p8ntH0uMYrVs9q1jcw4W2iuUIbmg");
            //xx = this.WeChat.DeleteCardCoupon("p8ntH0nfTZdBv8NwTY2afZUoojD8");

            if (this.Auth.GetAuthenticatedUser() == null)
            {
                return(this.RedirectLocal("/access/sign?signin=true"));
            }

            var merchant = this.Merchant.GetDefaultMerchant(merchantid);

            //如果商户没有创建则返回到商户管理界面,
            if (merchant == null)
            {
                this.RedirectLocal("/merchant/mymerchant");
            }
            var viewModel = id == null
                ? type.Initialize(merchant).Convert()
                : this.CardCoupon.GetCardCounpon(id.Value).Convert();

            viewModel.MerchantId = merchant.Id;

            viewModel.SubMerchantBrandName = merchant.BrandName;
            return(View(type.GetViewName(), viewModel));
        }
示例#8
0
            /// <summary>
            /// Gets the supported card types based on a provided card type list. If no card type list is provided, return the full supported list.
            /// </summary>
            /// <param name="chosenCardTypes">The provided card types.</param>
            /// <returns>The supported card types.</returns>
            public static string GetSupportedCardTypes(string chosenCardTypes)
            {
                string[] chosenCardTypeArray = CardTypes.ToArray(chosenCardTypes);

                if (chosenCardTypeArray == null || chosenCardTypeArray.Length == 0)
                {
                    // Return the full list of supported card types
                    return(CardTypes.ToString(CardTypes.supportedCardTypes));
                }
                else
                {
                    // Filter unsupported card types
                    var supportedChosenCardTypes = new List <string>();

                    foreach (var chosenCardType in chosenCardTypeArray)
                    {
                        foreach (var supportedCardType in CardTypes.supportedCardTypes)
                        {
                            if (supportedCardType.Equals(chosenCardType, StringComparison.OrdinalIgnoreCase))
                            {
                                supportedChosenCardTypes.Add(supportedCardType);
                            }
                        }
                    }

                    return(CardTypes.ToString(supportedChosenCardTypes.ToArray()));
                }
            }
示例#9
0
    public int PutCardToTopByType(CardTypes cardType, int number)
    {
        List <CardInfo_Base> res = new List <CardInfo_Base>();

        foreach (CardInfo_Base cb in Cards)
        {
            if (cb.BaseInfo.CardType == cardType)
            {
                number--;
                res.Add(cb);
                if (number == 0)
                {
                    break;
                }
            }
        }

        foreach (CardInfo_Base cb in res)
        {
            RemoveCard(cb);
            AddCard(cb, 0);
        }

        return(res.Count);
    }
示例#10
0
 public void SetCard(CardTypes type, float cardreachseconds)
 {
     Type             = type;
     gameObject.name  = type.ToString();
     CardReachSeconds = cardreachseconds;
     gameObject.transform.SetParent(OwnerSet.transform);
 }
示例#11
0
 public Card(CardTypes color, CardValues value, int trumpvalue, int nonTrumpvalue)
 {
     Color         = color;
     Value         = value;
     Trumpvalue    = trumpvalue;
     NonTrumpvalue = nonTrumpvalue;
 }
示例#12
0
 public void SetCardType(string type)
 {
     if (type == "Choice")
     {
         cardType = CardTypes.Choice;
     }
     else if (type == "Guide")
     {
         cardType = CardTypes.Guide;
     }
     else if (type == "Risk")
     {
         cardType = CardTypes.Risk;
     }
     else if (type == "Share")
     {
         cardType = CardTypes.Share;
     }
     else if (type == "Smarts")
     {
         cardType = CardTypes.Smarts;
     }
     else
     {
         Debug.LogError("Couldn't find the type " + type);
     }
 }
示例#13
0
 public User(string firstname, string lastName, CardTypes cardType, string school = "") //string school = "" opsiyonelllik jkatıyo bu paramtreye
 {
     FirstName = firstname;
     LastName  = lastName;
     CardType  = cardType;
     School    = school;
 }
示例#14
0
        public static AdvancedInfo WithInitializeSettings(this AdvancedInfo info, CardTypes type, MerchantModel merchant)
        {
            info.UseCondition = new UseCondition()
            {
                AcceptCategory          = string.Empty,
                CanUseWithOtherDiscount = false,
                LeastCost      = null,
                RejectCategory = string.Empty
            };
            info.Abstract = new Abstract()
            {
                AbstractX   = string.Empty,
                IconUrlList = new string[] { string.Empty }
            };
            info.TextImageList = new System.Collections.Generic.List <TextImage>()
            {
                new TextImage()
                {
                },
                new TextImage()
                {
                },
                new TextImage()
                {
                }
            };

            info.BusinessService = Constants.BusinessService.Keys.ToArray();
            info.Abstract        = new Abstract()
            {
            };
            return(info);
        }
示例#15
0
 protected CardBase(int cardId, string name, CardTypes cardType, CardRarities cardRarity)
 {
     Id         = cardId;
     Name       = name;
     CardType   = cardType;
     CardRarity = cardRarity;
 }
示例#16
0
        private void Lane_LaneRequestingAddCard(object sender, AddCardArgs e)
        {
            //Open dialog to capture card detials
            var result = new AddCardDialog().ShowDialog();
            //Create card
            var parentLaneId    = e.LaneId;
            var parentLane      = e.Target;
            var cardName        = result.Item1;
            var cardDescription = result.Item2;
            var cardPoints      = result.Item3;
            var dialogResult    = result.Item4;
            var cardType        = result.Item5;

            if (dialogResult == DialogResult.Cancel || cardName == string.Empty)
            {
                return;
            }

            CardTypes parsedCardType;

            CardTypes.TryParse(cardType, true, out parsedCardType);
            //Insert card to UserControl Lane passed in Args
            var cardId =
                _cardDatabaseService.Insert(parentLaneId, cardName, cardDescription, cardPoints, parsedCardType);
            var card = new Card(parentLaneId, cardName, cardDescription, cardPoints, cardId, GlobalToolTip, parsedCardType);

            parentLane.AddCard(card);
        }
示例#17
0
        public static Color GetColor(CardTypes cardType)
        {
            var returnValue = Color.AliceBlue;

            switch (cardType)
            {
            case CardTypes.Idea:
                returnValue = Color.CornflowerBlue;
                break;

            case CardTypes.Bug:
                returnValue = Color.DarkRed;
                break;

            case CardTypes.ExternalRequirement:
                returnValue = Color.Chartreuse;
                break;

            case CardTypes.Requirement:
                returnValue = Color.DarkOrchid;
                break;
            }

            return(returnValue);
        }
示例#18
0
    IEnumerator StartMiddleObsoleteTimer(float seconds, CardTypes type, int PlayerID)
    {
        float InitialSeconds = seconds;
        bool  Shaked         = false;

        while (seconds > 0)
        {
            seconds -= Time.deltaTime;
            if (seconds <= InitialSeconds / 1.5f)
            {
                if (!Shaked)
                {
                    MiddleSet.ShakeMiddleSet(InitialSeconds / 1.5f);
                    Shaked = true;
                }
            }
            yield return(new WaitForEndOfFrame());
        }
        if (propertiesObject.SameTypeInMiddle)
        {
            //The players failed to click the middle within time, continuing the game.
            Debug.Log("The player has failed to middle click, playing the card again. FOR FOCKS SAKE GAME PLEASE DONT BREAK FOR FOCKS SAKE");
            Server.PlayedCard(PlayerID, type, false);
        }
    }
示例#19
0
/********************************************************************************************************************************************************
******** Function: Deck default constructor
******** Description: assigns properties to deck array consisting of 52 Card objects
******** Parameters: none
******** Pre-Conditions: Card array must be initialized
******** Post-Conditions: each Card object in the array now has its own unique properties
********************************************************************************************************************************************************/
        public Deck()
        {
            for (int i = 0; i < 52; i++)
            {
                deckArr[i] = new Card();
            }
            int index = 0;

            //double for loop, outer assigns suits and inner assigns the type of the card
            for (CardSuits suit = CardSuits.hearts; suit <= CardSuits.clubs; suit++)
            {
                for (CardTypes type = CardTypes.ace; type <= CardTypes.king; type++)
                {
                    deckArr[index].setName(type);
                    deckArr[index].setValue((int)type);

                    //for the purpose of blackjack all face cards have a value of 10
                    if ((int)type > 10)
                    {
                        deckArr[index].setValue(10);
                    }
                    index++;
                }
            }
        }
示例#20
0
    public CardInfo(string cardFileName)      //初始化构造函数
    {
        var splits = cardFileName.Split('_'); //文件名:卡牌名_卡牌类型_卡牌索引.png

        this.isSelected    = false;
        this._cardFileName = cardFileName;
        this.cardName      = splits[0];         //获取卡牌名称
        Debug.Log(String.Format("CardName:{0}", cardName));
        cardIndex = Convert.ToInt32(splits[2]); //获取卡牌索引

        switch (splits[1])
        {
        case "1":
            cardType = CardTypes.Artifact;
            Debug.Log("CardTypes.Artifact");
            break;

        case "2":
            cardType = CardTypes.Character;
            Debug.Log("CardTypes.Character");
            break;

        case "3":
            cardType = CardTypes.Event;
            Debug.Log("CardTypes.Event");
            break;

        default:
            return;
        }
    }
示例#21
0
 public static bool isAccountPremium(WorldMap map)
 {
     if (premium)
     {
         return(true);
     }
     return(CardTypes.isPremiumToken(map.UserCardData.premiumCard) && (VillageMap.getCurrentServerTime() < map.UserCardData.premiumCardExpiry));
 }
示例#22
0
 public static bool Required(this CardTypes type, CardTypes current)
 {
     if (current == CardTypes.None)
     {
         return(false);
     }
     return(type == current);
 }
示例#23
0
    public void AddCard(CardTypes type, float cardreachseconds)
    {
        GameObject g = Instantiate(Card.CardObject, this.transform, true);

        NetworkServer.SpawnWithClientAuthority(g, OwnerPlayer.connectionToClient);
        g.GetComponent <Card>().OwnerPlayerID = OwnerPlayerID;
        g.GetComponent <Card>().PreSetCard(OwnerPlayerID, type, cardreachseconds);
    }
示例#24
0
        public PowerCtrl(CardTypes type, Power p)
        {
            InitializeComponent();
            power = p;
            this.type = type;

            LoadData();
        }
示例#25
0
 public CardInfo(string title, CardTypes cardType, Factions faction, int power, SkillInfo skill)
 {
     Title     = title;
     CardTypes = cardType;
     Factions  = faction;
     Power     = power;
     Skill     = skill;
 }
示例#26
0
 private async Models.ConnectorSubmissionResult SubmitCard(CardTypes cardType)
 {
     return(new Models.ConnectorSubmissionResult
     {
         Status = System.Net.HttpStatusCode.OK,
         Message = "Processing message here"
     });
 }
示例#27
0
 public CardInfo(string name, CardTypes cardType, Factions faction, int power, string text, string art)
 {
     Title    = name;
     CardType = cardType;
     Faction  = faction;
     Power    = power;
     Text     = text;
     Art      = ResourceLoader.Load <Texture>(art);
 }
示例#28
0
    //Yes, I know this is messy as hell but I WANT to get this game done already it's 4PM and neither Tuğkan or Ferhat has come.
    public static bool isSameType(CardTypes t1, CardTypes t2)
    {
        if ((t1 == CardTypes.p0 || t1 == CardTypes.l0 || t1 == CardTypes.f0 || t1 == CardTypes.c0) && (t2 == CardTypes.p0 || t2 == CardTypes.l0 || t2 == CardTypes.f0 || t2 == CardTypes.c0))
        {
            return(true);
        }
        if ((t1 == CardTypes.p1 || t1 == CardTypes.l1 || t1 == CardTypes.f1 || t1 == CardTypes.c1) && (t2 == CardTypes.p1 || t2 == CardTypes.l1 || t2 == CardTypes.f1 || t2 == CardTypes.c1))
        {
            return(true);
        }
        if ((t1 == CardTypes.p2 || t1 == CardTypes.l2 || t1 == CardTypes.f2 || t1 == CardTypes.c2) && (t2 == CardTypes.p2 || t2 == CardTypes.l2 || t2 == CardTypes.f2 || t2 == CardTypes.c2))
        {
            return(true);
        }
        if ((t1 == CardTypes.p3 || t1 == CardTypes.l3 || t1 == CardTypes.f3 || t1 == CardTypes.c3) && (t2 == CardTypes.p3 || t2 == CardTypes.l3 || t2 == CardTypes.f3 || t2 == CardTypes.c3))
        {
            return(true);
        }
        if ((t1 == CardTypes.p4 || t1 == CardTypes.l4 || t1 == CardTypes.f4 || t1 == CardTypes.c4) && (t2 == CardTypes.p4 || t2 == CardTypes.l4 || t2 == CardTypes.f4 || t2 == CardTypes.c4))
        {
            return(true);
        }
        if ((t1 == CardTypes.p5 || t1 == CardTypes.l5 || t1 == CardTypes.f5 || t1 == CardTypes.c5) && (t2 == CardTypes.p5 || t2 == CardTypes.l5 || t2 == CardTypes.f5 || t2 == CardTypes.c5))
        {
            return(true);
        }
        if ((t1 == CardTypes.p6 || t1 == CardTypes.l6 || t1 == CardTypes.f6 || t1 == CardTypes.c6) && (t2 == CardTypes.p6 || t2 == CardTypes.l6 || t2 == CardTypes.f6 || t2 == CardTypes.c6))
        {
            return(true);
        }
        if ((t1 == CardTypes.p7 || t1 == CardTypes.l7 || t1 == CardTypes.f7 || t1 == CardTypes.c7) && (t2 == CardTypes.p7 || t2 == CardTypes.l7 || t2 == CardTypes.f7 || t2 == CardTypes.c7))
        {
            return(true);
        }
        if ((t1 == CardTypes.p8 || t1 == CardTypes.l8 || t1 == CardTypes.f8 || t1 == CardTypes.c8) && (t2 == CardTypes.p8 || t2 == CardTypes.l8 || t2 == CardTypes.f8 || t2 == CardTypes.c8))
        {
            return(true);
        }
        if ((t1 == CardTypes.p9 || t1 == CardTypes.l9 || t1 == CardTypes.f9 || t1 == CardTypes.c9) && (t2 == CardTypes.p9 || t2 == CardTypes.l9 || t2 == CardTypes.f9 || t2 == CardTypes.c9))
        {
            return(true);
        }
        if ((t1 == CardTypes.pj || t1 == CardTypes.lj || t1 == CardTypes.fj || t1 == CardTypes.cj) && (t2 == CardTypes.pj || t2 == CardTypes.lj || t2 == CardTypes.fj || t2 == CardTypes.cj))
        {
            return(true);
        }
        if ((t1 == CardTypes.pq || t1 == CardTypes.lq || t1 == CardTypes.fq || t1 == CardTypes.cq) && (t2 == CardTypes.pq || t2 == CardTypes.lq || t2 == CardTypes.fq || t2 == CardTypes.cq))
        {
            return(true);
        }
        if ((t1 == CardTypes.pk || t1 == CardTypes.lk || t1 == CardTypes.fk || t1 == CardTypes.ck) && (t2 == CardTypes.pk || t2 == CardTypes.lk || t2 == CardTypes.fk || t2 == CardTypes.ck))
        {
            return(true);
        }

        return(false);
    }
示例#29
0
 public Card(CardTypes type, string n, UltimateCrew.Roles r, UltimateCrew.Fleets f, int bv)
 {
     cardType    = type;
     name        = n;
     role        = r;
     fleet       = f;
     buyValue    = bv;
     resaleValue = buyValue / 2;
 }
示例#30
0
        public Card(CardTypes type)
        {
            if (type != CardTypes.Joker)
            {
                throw new ArgumentException("Invalid Card Type", "type");
            }

            _type = type;
        }
        public void Pay(double total)
        {
            Console.Clear();
            Console.WriteLine($"Total: ${NumberToDollarFormat.Execute(total)}\n"); //might not need based on how user interface is set up
            Console.WriteLine("Please choose a Card Type: \n[1] VISA \n[2] MASTER \n[3] DISC \n[4] AMEX");


            while (true)
            {
                string cardType   = Console.ReadLine();         // USER VALIDATION, possibly use TryCatch
                bool   ignoreCase = true;

                if (Enum.TryParse <CardTypes>(cardType, ignoreCase, out CardTypes result))
                {
                    cardEnum = result;
                    if (cardEnum == CardTypes.VISA | cardEnum == CardTypes.MASTER | cardEnum == CardTypes.DISC)
                    {
                        Console.Write("\nPlease enter the credit card number(no dashes or spaces): ");
                        CardNumber = ValidateCardNumber1(Console.ReadLine());


                        Console.Write("\nExpiration Date (MM/YY) or (MM/YYYY): ");
                        ExpirationDate = ValidateExpDate(Console.ReadLine());


                        Console.Write("\nCVV: ");
                        CVVCode = ValidateCVVCode1(Console.ReadLine());


                        Console.WriteLine("Your transaction has been processed.");
                        break;
                    }
                    else if (cardEnum == CardTypes.AMEX)
                    {
                        Console.Write("\nPlease enter the credit card number(no dashes or spaces): ");
                        CardNumber = ValidateCardNumber2(Console.ReadLine());


                        Console.Write("\nExpiration Date (MM/YY) or (MM/YYYY): ");
                        ExpirationDate = ValidateExpDate(Console.ReadLine());


                        Console.Write("\nCVV:");
                        CVVCode = ValidateCVVCode2(Console.ReadLine());


                        Console.WriteLine("Your transaction has been processed.");
                        break;
                    }
                    else
                    {
                        Console.WriteLine("This is not a valid card type. Please try again.");
                        continue;
                    }
                }
            }
        }
 public void init(CardTypes.CardDefinition def, CardClickPlayDelegate callback)
 {
     this.m_callback = callback;
     base.clearControls();
     this.background.Size = base.Size;
     this.background.Position = new Point(0, 0);
     base.addControl(this.background);
     this.background.Create((Image) GFXLibrary.cardpanel_grey_9slice_left_top, (Image) GFXLibrary.cardpanel_grey_9slice_middle_top, (Image) GFXLibrary.cardpanel_grey_9slice_right_top, (Image) GFXLibrary.cardpanel_grey_9slice_left_middle, (Image) GFXLibrary.cardpanel_grey_9slice_middle_middle, (Image) GFXLibrary.cardpanel_grey_9slice_right_middle, (Image) GFXLibrary.cardpanel_grey_9slice_left_bottom, (Image) GFXLibrary.cardpanel_grey_9slice_middle_bottom, (Image) GFXLibrary.cardpanel_grey_9slice_right_bottom);
     this.topLeftImage.Image = (Image) GFXLibrary.cardpanel_grey_9slice_gradation_top_left;
     this.topLeftImage.Position = new Point(0, 0);
     this.background.addControl(this.topLeftImage);
     this.bottomRightImage.Image = (Image) GFXLibrary.cardpanel_grey_9slice_gradation_bottom;
     this.bottomRightImage.Position = new Point(this.background.Width - this.bottomRightImage.Image.Width, this.background.Height - this.bottomRightImage.Image.Height);
     this.background.addControl(this.bottomRightImage);
     CustomSelfDrawPanel.UICard control = BuyCardsPanel.makeUICard(def, RemoteServices.Instance.UserID, 0x2710);
     GFXLibrary.Instance.closeBigCardsLoader();
     control.Position = new Point(0x75, 50);
     this.background.addControl(control);
     this.confirmLabel.Text = SK.Text("ConfirmPlayCardPanel_Are_You_Sure", "Are you sure you want to play this card?");
     this.confirmLabel.Color = ARGBColors.Black;
     this.confirmLabel.Position = new Point(0, 10);
     this.confirmLabel.Font = FontManager.GetFont("Arial", 14f, FontStyle.Regular);
     this.confirmLabel.Size = new Size(this.background.Width, 50);
     this.confirmLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
     this.background.addControl(this.confirmLabel);
     this.confirmButton.Text.Text = SK.Text("ConfirmPlayCardPanel_Play_Card", "Play Card");
     this.confirmButton.TextYOffset = -2;
     this.confirmButton.Text.Color = ARGBColors.Black;
     this.confirmButton.Text.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
     this.confirmButton.ImageNorm = (Image) GFXLibrary.cardpanel_button_blue_normal;
     this.confirmButton.ImageOver = (Image) GFXLibrary.cardpanel_button_blue_over;
     this.confirmButton.ImageClick = (Image) GFXLibrary.cardpanel_button_blue_pressed;
     this.confirmButton.Position = new Point(230, 310);
     this.confirmButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.playCard), "ConfirmPlayCardPanel_confirm_play_card");
     this.background.addControl(this.confirmButton);
     this.cancelButton.Text.Text = SK.Text("GENERIC_Cancel", "Cancel");
     this.cancelButton.TextYOffset = -2;
     this.cancelButton.Text.Color = ARGBColors.Black;
     this.cancelButton.Text.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
     this.cancelButton.ImageNorm = (Image) GFXLibrary.cardpanel_button_blue_normal;
     this.cancelButton.ImageOver = (Image) GFXLibrary.cardpanel_button_blue_over;
     this.cancelButton.ImageClick = (Image) GFXLibrary.cardpanel_button_blue_pressed;
     this.cancelButton.Position = new Point(30, 310);
     this.cancelButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.closeClick), "ConfirmPlayCardPanel_cancel");
     this.background.addControl(this.cancelButton);
     this.confirmCheck.CheckedImage = (Image) GFXLibrary.reports_checkbox_checked;
     this.confirmCheck.UncheckedImage = (Image) GFXLibrary.reports_checkbox_empty;
     this.confirmCheck.Position = new Point(20, 360);
     this.confirmCheck.Checked = true;
     this.confirmCheck.CBLabel.Text = SK.Text("ConfirmPlayCardPanel_Always", "Always confirm playing cards?");
     this.confirmCheck.CBLabel.Color = ARGBColors.Black;
     this.confirmCheck.CBLabel.Position = new Point(20, -1);
     this.confirmCheck.CBLabel.Size = new Size(360, 0x23);
     this.confirmCheck.CBLabel.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     this.background.addControl(this.confirmCheck);
 }
示例#33
0
 internal int GetCardCountByType(CardTypes type)
 {
     if (type == CardTypes.Null)
     {
         return Cards.Count;
     }
     int count = 0;
     foreach (DeckCard cd in Cards.Values)
     {
         if (CardAssistant.GetCardType(cd.BaseId) == type)
         {
             count++;
         }
     }
     return count;
 }
示例#34
0
 public PowerCtrl(CardTypes type, out Power t)
 {
     InitializeComponent();
     this.type = type;
     switch (type)
     {
         case CardTypes.AtWill:
             power = new AtWill();
             break;
         case CardTypes.Encounter:
             power = new Encounter();
             break;
         case CardTypes.Daily:
             power = new Daily();
             break;
         default:
             throw new InvalidOperationException("Unsupported CardType");
     }
     t = power;
 }
示例#35
0
 private static int GetHitvalue(CardTypes dealerShowing)
 {
     int hitvalue;
     switch (dealerShowing)
     {
         case CardTypes.Jack:
         case CardTypes.Queen:
         case CardTypes.King:
         case CardTypes.Ten:
         case CardTypes.Seven:
         case CardTypes.Eight:
         case CardTypes.Nine:
             hitvalue = 17;
             break;
         case CardTypes.Two:
         case CardTypes.Three:
             hitvalue = 11;
             break;
         default:
             hitvalue = 11;
             break;
     }
     return hitvalue;
 }
        public static CustomSelfDrawPanel.UICard makeUICard(CardTypes.CardDefinition def, int userid, int playerRank)
        {
            Color red;
            CustomSelfDrawPanel.UICard card = new CustomSelfDrawPanel.UICard {
                UserID = userid
            };
            card.UserIDList.Add(userid);
            card.Definition = def;
            switch (card.Definition.cardColour)
            {
                case 1:
                    card.bigFrame = GFXLibrary.BlueCardOverlayBig;
                    card.bigFrameOver = GFXLibrary.BlueCardOverlayBigOver;
                    break;

                case 2:
                    card.bigFrame = GFXLibrary.GreenCardOverlayBig;
                    card.bigFrameOver = GFXLibrary.GreenCardOverlayBigOver;
                    break;

                case 3:
                    card.bigFrame = GFXLibrary.PurpleCardOverlayBig;
                    card.bigFrameOver = GFXLibrary.PurpleCardOverlayBigOver;
                    break;

                case 4:
                    card.bigFrame = GFXLibrary.RedCardOverlayBig;
                    card.bigFrameOver = GFXLibrary.RedCardOverlayBigOver;
                    break;

                case 5:
                    card.bigFrame = GFXLibrary.YellowCardOverlayBig;
                    card.bigFrameOver = GFXLibrary.YellowCardOverlayBigOver;
                    break;
            }
            card.bigImage = GFXLibrary.Instance.getCardImageBig(card.Definition.id);
            card.Size = card.bigFrame.Size;
            card.CustomTooltipID = 0x2775;
            card.CustomTooltipData = card.Definition.id;
            card.bigGradeImage = new CustomSelfDrawPanel.CSDImage();
            int num = CardTypes.getGrade(card.Definition.cardGrade);
            switch (num)
            {
                case 0x10000:
                    card.bigGradeImage.Image = (Image) GFXLibrary.CardGradeBronze;
                    card.bigGradeImage.Position = new Point(card.Width - card.bigGradeImage.Width, 0);
                    break;

                case 0x20000:
                    card.bigGradeImage.Image = (Image) GFXLibrary.CardGradeSilver;
                    card.bigGradeImage.Position = new Point(card.Width - card.bigGradeImage.Width, 0);
                    break;

                case 0x40000:
                    card.bigGradeImage.Image = (Image) GFXLibrary.card_gold_anim[0];
                    card.bigGradeImage.Position = new Point((card.Width - card.bigGradeImage.Width) - 3, 0);
                    break;

                case 0x200000:
                    card.bigGradeImage.Image = (Image) GFXLibrary.card_diamond3_anim[0];
                    card.bigGradeImage.Position = new Point((card.Width - card.bigGradeImage.Width) - 3, -10);
                    break;

                case 0x400000:
                    card.bigGradeImage.Image = (Image) GFXLibrary.card_sapphire_anim[0];
                    card.bigGradeImage.Position = new Point((card.Width - card.bigGradeImage.Width) - 3, -12);
                    break;

                case 0x80000:
                    card.bigGradeImage.Image = (Image) GFXLibrary.card_diamond_anim[0];
                    card.bigGradeImage.Position = new Point((card.Width - card.bigGradeImage.Width) - 3, -2);
                    break;

                case 0x100000:
                    card.bigGradeImage.Image = (Image) GFXLibrary.card_diamond2_anim[0];
                    card.bigGradeImage.Position = new Point((card.Width - card.bigGradeImage.Width) - 3, -7);
                    break;

                default:
                    card.bigGradeImage.Image = (Image) GFXLibrary.CardGradeBronze;
                    card.bigGradeImage.Position = new Point(card.Width - card.bigGradeImage.Width, 0);
                    break;
            }
            card.bigBaseImage = new CustomSelfDrawPanel.CSDImage();
            card.bigBaseImage.Position = new Point(10, 11);
            card.bigBaseImage.Size = card.bigImage.Size;
            card.bigBaseImage.Image = (Image) card.bigImage;
            card.addControl(card.bigBaseImage);
            card.bigFrameImage = new CustomSelfDrawPanel.CSDImage();
            card.bigFrameImage.Position = new Point(0, 0);
            card.bigFrameImage.Size = card.bigFrame.Size;
            card.bigFrameImage.Image = (Image) card.bigFrame;
            card.addControl(card.bigFrameImage);
            switch (num)
            {
                case 0x40000:
                    card.bigFrameExtraImage = new CustomSelfDrawPanel.CSDImage();
                    card.bigFrameExtraImage.Position = new Point(0, 0);
                    card.bigFrameExtraImage.Image = (Image) GFXLibrary.card_frame_overlay_gold;
                    card.addControl(card.bigFrameExtraImage);
                    break;

                case 0x80000:
                case 0x100000:
                case 0x200000:
                    card.bigFrameExtraImage = new CustomSelfDrawPanel.CSDImage();
                    card.bigFrameExtraImage.Position = new Point(0, 0);
                    card.bigFrameExtraImage.Image = (Image) GFXLibrary.card_frame_overlay_diamond;
                    card.addControl(card.bigFrameExtraImage);
                    break;

                case 0x400000:
                    card.bigFrameExtraImage = new CustomSelfDrawPanel.CSDImage();
                    card.bigFrameExtraImage.Position = new Point(0, 0);
                    card.bigFrameExtraImage.Image = (Image) GFXLibrary.card_frame_overlay_sapphire;
                    card.addControl(card.bigFrameExtraImage);
                    break;
            }
            card.bigGradeImage.Size = card.bigGradeImage.Image.Size;
            card.addControl(card.bigGradeImage);
            card.bigTitle = new CustomSelfDrawPanel.CSDLabel();
            card.bigTitle.Text = CardTypes.getDescriptionFromCard(card.Definition.id);
            card.bigTitle.Size = new Size(110, 0x30);
            card.bigTitle.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
            if (((((card.Definition.id == 0x709) || (card.Definition.id == 0x606)) || ((card.Definition.id == 0xc41) || (card.Definition.id == 0x50a))) || ((card.Definition.id == 0x605) || (card.Definition.id == 0x607))) && (Program.mySettings.LanguageIdent == "de"))
            {
                card.bigTitle.Font = FontManager.GetFont("Arial", 8f, FontStyle.Bold);
            }
            else
            {
                card.bigTitle.Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
            }
            card.bigTitle.Color = ARGBColors.White;
            card.bigTitle.DropShadowColor = ARGBColors.Black;
            card.bigTitle.Position = new Point(0x26, 12);
            card.addControl(card.bigTitle);
            card.bigEffect = new CustomSelfDrawPanel.CSDLabel();
            card.bigEffect.Text = card.Definition.EffectText;
            card.bigEffect.Size = new Size(150, 0x40);
            card.bigEffect.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
            card.bigEffect.Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
            if ((Program.mySettings.LanguageIdent == "de") && CardTypes.isGermanSmallDesc(card.Definition.id))
            {
                card.bigEffect.Font = FontManager.GetFont("Arial", 8f, FontStyle.Bold);
            }
            card.bigEffect.Color = ARGBColors.White;
            card.bigEffect.DropShadowColor = ARGBColors.Black;
            card.bigEffect.Position = new Point(14, 0xae);
            card.addControl(card.bigEffect);
            CustomSelfDrawPanel.CSDLabel control = new CustomSelfDrawPanel.CSDLabel {
                Position = new Point(2, 2),
                Size = new Size(card.Width, card.Height),
                Text = "",
                Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT,
                Font = FontManager.GetFont("Arial", 18f, FontStyle.Bold),
                Color = ARGBColors.Yellow,
                DropShadowColor = ARGBColors.Black
            };
            card.addControl(control);
            card.countLabel = control;
            if (playerRank < card.Definition.cardRank)
            {
                red = ARGBColors.Red;
            }
            else
            {
                red = ARGBColors.White;
            }
            CustomSelfDrawPanel.CSDLabel label2 = new CustomSelfDrawPanel.CSDLabel {
                Position = new Point(150, 220),
                Size = new Size(20, 13),
                Text = card.Definition.cardRank.ToString(),
                Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER,
                Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold),
                Color = red,
                DropShadowColor = ARGBColors.Black
            };
            card.addControl(label2);
            card.rankLabel = label2;
            if (playerRank < card.Definition.cardRank)
            {
                card.Hilight(ARGBColors.Gray);
            }
            else
            {
                card.Hilight(ARGBColors.White);
            }
            card.ScaleAll(0.95);
            return card;
        }
示例#37
0
 public Card(CardTypes cardtype)
 {
     CardType = cardtype;
 }
示例#38
0
 private string TypesToString(CardTypes? t)
 {
     StringBuilder sb = new StringBuilder();
     foreach(CardTypes type in Enum.GetValues(typeof(CardTypes)))
     {
         sb.Append(type.ToString() + " ");
     }
     return sb.ToString().Trim();
 }
示例#39
0
 public void OnUseCard(CardTypes type)
 {
     List<Spike> toRemove = null;
     if (type == CardTypes.Monster)
     {
         toRemove = spikeList.FindAll(a => a.RemoveOnUseMonster);
     }
     else if (type == CardTypes.Spell)
     {
         toRemove = spikeList.FindAll(a => a.RemoveOnUseSpell);
     }
     else if (type == CardTypes.Weapon)
     {
         toRemove = spikeList.FindAll(a => a.RemoveOnUseWeapon);
     }
     if (toRemove != null)
     {
         foreach (var spike in toRemove)
         {
             RemoveSpike(spike.Id);
         }
     }
 }
示例#40
0
        private void PlayerPlays(Player player, CardTypes dealerShowing)
        {
            var hitvalue = GetHitvalue(dealerShowing);

            while (player.Total < hitvalue && player.Total < 21)
            {
                player.GiveCard(shoe.GetCard());
            }
        }
 private void autoPlayCard(int userID, CardTypes.CardDefinition def, bool fromClick, bool fromValidate)
 {
     if (!this.waitingResponse)
     {
         this.waitingResponse = true;
         XmlRpcCardsProvider provider = XmlRpcCardsProvider.CreateForEndpoint(URLs.ProfileProtocol, URLs.ProfileServerAddressCards, URLs.ProfileServerPort, URLs.ProfileCardPath);
         int villageID = -1;
         int num2 = InterfaceMgr.Instance.getSelectedMenuVillage();
         if (!GameEngine.Instance.World.isCapital(num2))
         {
             villageID = num2;
         }
         int num3 = GameEngine.Instance.World.getRank() + 1;
         if (def.cardRank > num3)
         {
             MyMessageBox.Show(SK.Text("BuyCardsPanel_Rank_Too_low", "Your rank is too low to play this card.") + Environment.NewLine + SK.Text("BuyCardsPanel_Current_Rank", "Current Rank") + " : " + num3.ToString() + Environment.NewLine + SK.Text("BuyCardsPanel_Required_Rank", "Required Rank") + " : " + def.cardRank.ToString(), SK.Text("BuyCardsPanel_Cannot_Play_Cards", "Could not play card."));
             this.waitingResponse = false;
         }
         else
         {
             this.autoCardUserID = userID;
             this.autoCardVillageID = villageID;
             this.autoCardDef = def;
             if (fromClick && Program.mySettings.ConfirmPlayCard)
             {
                 GameEngine.Instance.playInterfaceSound("PlayCardsPanel_play_card_open_confirmation");
                 base.PanelActive = false;
                 this.waitingResponse = false;
                 InterfaceMgr.Instance.openConfirmPlayCardPopup(this.autoCardDef, new ConfirmPlayCardPanel.CardClickPlayDelegate(this.autoPlayCardDelegate));
             }
             else if (!fromValidate && CardTypes.cardNeedsValidation(CardTypes.getCardType(this.autoCardDef.id)))
             {
                 this.validateCardPossible(CardTypes.getCardType(this.autoCardDef.id), villageID);
             }
             else
             {
                 if (InterfaceMgr.Instance.getCardWindow() != null)
                 {
                     CursorManager.SetCursor(CursorManager.CursorType.WaitCursor, InterfaceMgr.Instance.getCardWindow());
                 }
                 GameEngine.Instance.playInterfaceSound("PlayCardsPanel_play_card");
                 StatTrackingClient.Instance().ActivateTrigger(0x10, this.buyAndPlayCheckBox.Checked);
                 provider.PlayUserCard(new XmlRpcCardsRequest(RemoteServices.Instance.UserGuid.ToString().Replace("-", ""), RemoteServices.Instance.SessionGuid.ToString().Replace("-", ""), userID.ToString(), villageID.ToString(), RemoteServices.Instance.ProfileWorldID.ToString()), new CardsEndResponseDelegate(this.CardPlayed), this);
                 try
                 {
                     GameEngine.Instance.World.removeProfileCard(userID);
                 }
                 catch (Exception exception)
                 {
                     MyMessageBox.Show(exception.Message, SK.Text("BuyCardsPanel_Error_Report", "ERROR: Please report this error message"));
                 }
             }
         }
     }
 }
示例#42
0
        internal CardProduct[] GetCardProductsByType(CardTypes type)
        {
            int time = TimeTool.DateTimeToUnixTime(DateTime.Now);
            if (CardProducts == null || UserProfile.InfoRecord.GetRecordById((int)MemPlayerRecordTypes.LastCardShopTime) < time - GameConstants.CardShopDura)
            {
                CardProducts = new List<CardProduct>();
                ReinstallCardProducts();
                UserProfile.InfoRecord.SetRecordById((int)MemPlayerRecordTypes.LastCardShopTime, TimeManager.GetTimeOnNextInterval(UserProfile.InfoRecord.GetRecordById((int)MemPlayerRecordTypes.LastCardShopTime), time, GameConstants.CardShopDura));
            }

            List<CardProduct> pros = new List<CardProduct>();
            foreach (CardProduct cardProduct in CardProducts)
            {
                if (CardAssistant.GetCardType(cardProduct.Cid) == type)
                    pros.Add(cardProduct);
            }

            return pros.ToArray();
        }
 public void init(CardTypes.CardDefinition def, ConfirmPlayCardPanel.CardClickPlayDelegate callback)
 {
     this.confirmPanel.init(def, callback);
 }
示例#44
0
        public bool MatchesType(CardTypes? types)
        {
            if(types == null) return false;

            foreach(CardTypes flag in Enum.GetValues(typeof(CardTypes)))
            {
                if((types & flag) != 0 && (this.Type & flag) == 0)
                    return false;
            }

            return true;
        }
示例#45
0
 public ConfirmPlayCardPopup openConfirmPlayCardPopup(CardTypes.CardDefinition def, ConfirmPlayCardPanel.CardClickPlayDelegate callback)
 {
     this.closePopupWindow(this.m_confirmPlayCardPopup);
     this.m_confirmPlayCardPopup = new ConfirmPlayCardPopup();
     this.positionWindow(this.m_confirmPlayCardPopup, false, false);
     this.m_confirmPlayCardPopup.init(def, callback);
     this.m_confirmPlayCardPopup.Show(this.getCardWindow());
     return this.m_confirmPlayCardPopup;
 }