Exemple #1
0
        public static WikiCard ParseAbility(ValveSet set, ValveCard card)
        {
            var wcard = new WikiCard(set.set_info.set_id, card);

            wcard.SubCard = new WikiAbility(card);
            return(wcard);
        }
Exemple #2
0
        public static WikiCard ParseItem(ValveSet set, ValveCard card)
        {
            var wcard = new WikiCard(set.set_info.set_id, card);

            wcard.SubCard = new WikiItem(wcard.Abilities, card);
            return(wcard);
        }
Exemple #3
0
 public WikiItem(Dictionary <int, WikiAbility> abilities, ValveCard item) : base(item.card_id, item.card_name["english"])
 {
     GoldCost = item.gold_cost;
     foreach (var reference in item.references)
     {
         abilities[reference.card_id] = new WikiAbility(reference, null);
     }
 }
Exemple #4
0
 public WikiSpell(Dictionary <int, WikiAbility> abilities, ValveCard spell) : base(spell.card_id, spell.card_name["english"])
 {
     CardSpawnedID = spell.references.Where(x => x.ref_type == ArtifactReferenceType.References).Select(x => x.card_id).FirstOrDefault();
     CardSpawned   = null;
     ManaCost      = spell.mana_cost;
     Charges       = spell.charges;
     IsCrosslane   = spell.is_crosslane;
 }
Exemple #5
0
        public WikiCard(int setID, ValveCard card) : this()
        {
            ID            = card.card_id;
            BaseID        = card.base_card_id;
            MarketplaceID = card.item_def;
            Name          = card.card_name["english"];
            SetID         = setID;
            CardType      = card.card_type;
            SubType       = card.sub_type;
            Rarity        = card.rarity;

            Aliases = new List <string>()
            {
                this.Name
            };
            if (Regex.IsMatch(Name, @"[^ \w]"))
            {
                Aliases.Add(Regex.Replace(Name, @"[^ \w]", ""));
            }

            if (card.is_black)
            {
                Color = ArtifactColor.Black;
            }
            else if (card.is_blue)
            {
                Color = ArtifactColor.Blue;
            }
            else if (card.is_green)
            {
                Color = ArtifactColor.Green;
            }
            else if (card.is_red)
            {
                Color = ArtifactColor.Red;
            }
            else
            {
                Color = ArtifactColor.None;
            }

            SignatureOf = null;
            //We manually set all signatures, tokens, and abilities to false
            IsCollectable = true;

            TextAPI      = card.card_text.GetValueOrDefault("english");
            CardImage    = GetImageName(this, "card");
            CardImageRaw = GetImageName(this, "cardraw");
            CardIconRaw  = GetImageName(this, "iconborder");
            CardIcon     = GetImageName(this, "icon");
            Illustrator  = card.illustrator;

            foreach (var reference in card.references)
            {
                References[reference.card_id] = new WikiCardReference(reference);
            }
        }
Exemple #6
0
 public WikiCreep(Dictionary <int, WikiAbility> abilities, ValveCard creep) : base(creep.card_id, creep.card_name["english"])
 {
     ManaCost = creep.mana_cost;
     Attack   = creep.attack;
     Armor    = creep.armor;
     Health   = creep.hit_points;
     foreach (var reference in creep.references)
     {
         abilities[reference.card_id] = new WikiAbility(reference, null);
     }
 }
Exemple #7
0
 public WikiHero(Dictionary <int, WikiAbility> abilities, int setID, ValveCard hero) : base(hero.card_id, hero.card_name["english"])
 {
     Attack      = hero.attack;
     Armor       = hero.armor;
     Health      = hero.hit_points;
     HeroIcon    = WikiCard.GetImageName(setID, hero, "herocolor", extension: "png");
     HeroIconRaw = WikiCard.GetImageName(setID, hero, "hero", extension: "png");
     foreach (var reference in hero.references)
     {
         if (reference.ref_type == ArtifactReferenceType.Signature)
         {
             SignatureCardID = reference.card_id;
         }
         else
         {
             abilities[reference.card_id] = new WikiAbility(reference, null);
         }
     }
 }
Exemple #8
0
        public WikiAbility(ValveCard card) : base(card.card_id, card.card_name["english"] + (card.card_type != ArtifactCardType.Ability && card.card_type != ArtifactCardType.PassiveAbility ? ":Effect" : ""))
        {
            switch (card.card_type)
            {
            case ArtifactCardType.Ability:
                AbilityType = ArtifactAbilityType.Active;
                break;

            case ArtifactCardType.PassiveAbility:
                AbilityType = ArtifactAbilityType.Passive;
                break;

            default:
                AbilityType = ArtifactAbilityType.None;
                break;
            }
            PassiveAbilityType = ArtifactPassiveAbilityType.None;
            Charges            = card.charges;
        }
Exemple #9
0
 public static WikiCard ParseCard(ValveSet set, ValveCard card)
 {
     return(new WikiCard(set.set_info.set_id, card));
 }
Exemple #10
0
 public static string GetImageName(int setID, ValveCard card, string imageType, string language = "default", string extension = "jpg")
 {
     return($"{setID.ToString("00")}_{ScrubString(card.card_name["english"])}_{card.card_id}_{imageType}_{language}.{extension}");
 }
Exemple #11
0
 public WikiSpell(ValveCard spell)
 {
 }
Exemple #12
0
 public WikiHero(ValveCard hero) : this()
 {
 }
Exemple #13
0
 public WikiCreep(ValveCard creep) : this()
 {
 }
Exemple #14
0
 public WikiAbility(ValveCard card)
 {
 }
Exemple #15
0
 public WikiCard(ValveCard card) : this()
 {
 }