Esempio n. 1
0
        public static Card CreateBonusPenaltyCard(string rollKind, int modifier, int powerLevel, bool isSecret, CardData cardData, Deck parentDeck)
        {
            Card card = cardData.AddCard(parentDeck);

            CardFactory.SetRarity(card, powerLevel, modifier);
            card.Name      = GetDieModTitle(isSecret, rollKind, modifier);
            card.StylePath = "Die Mods";
            string cardName;
            string modType          = GetModType(rollKind);
            int    lastIndexOfSpace = card.Name.LastIndexOf(' ');
            string value            = "0";

            if (lastIndexOfSpace > 0)
            {
                value = card.Name.Substring(lastIndexOfSpace).Trim();
                value = value.TrimStart('+');
            }

            if (isSecret)
            {
                cardName          = "a secret card";
                card.CardReceived = $"GiveMagic(CardRecipient, \"SecretCardMod\", CardUserName, CardGuid, \"{modType}\", {value});";
            }
            else
            {
                cardName        = card.Name;
                card.CardPlayed = $"GiveMagic(CardRecipient, \"ActiveCardMod\", CardUserName, CardGuid, \"{modType}\", {value});";
            }

            card.AlertMessage = $"{{{{username}}}} gave {cardName} to {{{{recipient}}}}.";
            card.Description  = GetDieModDescription(rollKind, modifier, isSecret);
            CardFactory.QuickAddAllLayerDetails(card);
            SetDieModLayerVisibilities(card, rollKind, modifier, isSecret);
            string bonusPenalty = GetBonusPenaltyNoun(modifier);

            CardFactory.AddPlayerNpcRecipientField(cardData, card, bonusPenalty);
            return(card);
        }
Esempio n. 2
0
        public static Card AddGiftSpellCard(SpellDto spellDto, CardData CardData, Deck ActiveDeck)
        {
            double placeholderWidth;
            double placeholderHeight;
            Card   scroll = CreateSpellCard("Gift", spellDto, CardData, ActiveDeck);

            scroll.Description            = GetSpellDescription(spellDto, true);
            scroll.AdditionalInstructions = "Give this spell scroll to a player, NPC, or monster (enter their name below).";
            scroll.AlertMessage           = $"{userName} gave the {spellDto.name} spell scroll to {recipient}.";
            scroll.Expires = CardExpires.Never;
            CardFactory.AddPlayerNpcRecipientField(CardData, scroll, "scroll");
            if (!CardStyles.Apply(scroll))
            {
                int randomValue = CardFactory.random.Next(0, 100);
                if (randomValue < 40)
                {
                    placeholderWidth  = 155;
                    placeholderHeight = 152;
                    scroll.StylePath  = "Scrolls\\Rods";
                }
                else if (randomValue < 60)
                {
                    placeholderWidth  = 131;
                    placeholderHeight = 130;
                    scroll.StylePath  = "Scrolls\\Smooth Light";
                }
                else
                {
                    placeholderWidth  = 128;
                    placeholderHeight = 127;
                    scroll.StylePath  = "Scrolls\\Tan";
                }
                scroll.ScalePlaceholder(placeholderWidth, placeholderHeight);
            }
            return(scroll);
        }