示例#1
0
 public Boolean DoAddCard()
 {
     if (Session[Keys.SESSION_ADMIN_INFO] == null)
     {
         return(false);
     }
     else
     {
         Master master = Session[Keys.SESSION_ADMIN_INFO] as Master;
         if (rcm.GetRoleCompetence(master.RoleId, 11252))
         {
             cardsname cn = new cardsname();
             cn.gameid   = int.Parse(Request["GameId"]);
             cn.serverid = int.Parse(Request["ServerId"]);
             cn.cardname = Request["CardName"];
             cn.urls     = Request["Url"];
             cn.islock   = Request["IsLock"] == "on" ? 1 : 0;
             cn.img      = Request["Img"];
             cn.carddesc = Request["CardDesc"];
             return(cm.AddCard(cn));
         }
         else
         {
             return(false);
         }
     }
 }
示例#2
0
        public void AddDiscoverCard(IMonster mon, int cardId, int level, DiscoverCardActionType type)
        {
            switch (type)
            {
            case DiscoverCardActionType.AddCard: CardManager.AddCard(cardId, level, 0); break;

            case DiscoverCardActionType.Add2Cards: CardManager.AddCard(cardId, level, 0); CardManager.AddCard(cardId, level, 0); break;
            }
            AddCardReason(mon, Frag.AddCardReason.Discover);
        }
示例#3
0
        public void AddRandomCardJob(IMonster mon, int job, int lv)
        {
            var cardId = CardConfigManager.GetRandomJobCard(job);

            if (cardId != 0)
            {
                CardManager.AddCard(cardId, lv, 0);
                AddCardReason(mon, Frag.AddCardReason.RandomCard);
            }
        }
示例#4
0
        public void AddRandomCardRace(IMonster mon, int race, int lv)
        {
            var cardId = CardConfigManager.GetRandomRaceCard(race);

            if (cardId != 0)
            {
                CardManager.AddCard(cardId, lv, 0);
                AddCardReason(mon, Frag.AddCardReason.RandomCard);
            }
        }
示例#5
0
        public void AddRandomCard(IMonster mon, int type, int lv)
        {
            int cardId = CardConfigManager.GetRandomTypeCard(type);

            if (cardId != 0)
            {
                CardManager.AddCard(cardId, lv, 0);
                AddCardReason(mon, Frag.AddCardReason.RandomCard);
            }
        }
示例#6
0
        public override void Run()
        {
            Console.WriteLine("Searching for cards...\n");
            bool gotGuaranteedSR = false;

            for (int i = 0; i < 10; ++i)
            {
                var        rand    = new Random();
                var        lottery = rand.Next(100);
                RarityType rarity  = RarityType.R;

                if (lottery < SSRChance)
                {
                    rarity = RarityType.SSR;
                }
                else if (lottery < SRChance)
                {
                    rarity = RarityType.SR;
                }

                if (i == 9 && rarity == RarityType.R && !gotGuaranteedSR)
                {
                    rarity = RarityType.SR;
                }

                while (true)
                {
                    var cardData = CardManager.AllCards().ToArray()[rand.Next(CardManager.AllCards().Count)];

                    if (cardData.Rarity == rarity)
                    {
                        bool   isDupe   = CardManager.Cards().Any(item => item.cardId == cardData.GetID());
                        string dupeText = isDupe ? "                 " : rarityNewString[rarity];
                        var    cardText = $"    {dupeText}{cardData.Name.str} ({cardData.Attribute})";
                        foreach (var c in cardText)
                        {
                            Console.Write(c);
                            Thread.Sleep(2);
                        }
                        Console.Write("\n");

                        CardManager.AddCard(cardData);

                        if (cardData.Rarity != RarityType.R)
                        {
                            gotGuaranteedSR = true;
                        }

                        Thread.Sleep(50);
                        break;
                    }
                }
            }
        }
示例#7
0
        public override void InitialCards()
        {
            base.InitialCards();

#if DEBUG
            int[] cardToGive = new[] { 52000045, 52000127 };
            foreach (var cardId in cardToGive)
            {
                CardManager.AddCard(new ActiveCard(cardId, 1, 0));
            }
#endif
        }
示例#8
0
        public async Task <IActionResult> GetOrderStatusNewCard([FromQuery] string orderId)
        {
            int id = Int32.Parse(User.Claims.First(c => c.Type == "UserId").Value);

            try
            {
                OrderStatusModel orderStatus = await PaymentManager.GetOrderStatus(orderId);

                Uri domain = new Uri(Request.GetDisplayUrl());
                Uri uri    = new Uri(domain.Scheme + "://" + domain.Host + (domain.IsDefaultPort ? "" : ":" + domain.Port));
                host             = uri.ToString();
                orderStatus.Date = DateTime.Now.ToString();
                CardManager.AddCard(orderStatus.BindingInfo.BindingId);
                return(Ok());
            }
            catch
            {
                return(BadRequest());
            }
        }
示例#9
0
        public override void Run()
        {
            Console.WriteLine("Searching for cards...\n");
            Console.WriteLine("Do you really want all the cards? [yes/no]: ");
            var response = Console.ReadLine();

            if (response == "yes")
            {
                Console.WriteLine("");
                foreach (var cardData in CardManager.AllCards())
                {
                    bool   isDupe   = CardManager.Cards().Any(item => item.cardId == cardData.GetID());
                    string dupeText = isDupe ? "                 " : rarityNewString[cardData.Rarity];
                    var    cardText = $"    {dupeText}{cardData.Name.str} ({cardData.Attribute})";

                    Console.WriteLine(cardText);
                    CardManager.AddCard(cardData);
                    Thread.Sleep(10);
                }
            }
        }
示例#10
0
 public void AddCard(IMonster mon, int cardId, int level, int modify)
 {
     CardManager.AddCard(cardId, level, modify);
     AddCardReason(mon, Frag.AddCardReason.GetCertainCard);
 }