private IEnumerable <ICard> SetupPlayerCards()
        {
            var potionItemTemplate = ItemTemplateRepository.Retrieve(ItemTemplateLookups.MinorHealthPotion);

            yield return(new ItemCard(new DefaultItem
            {
                ItemTemplate = potionItemTemplate,
                Modifications = new IModification[0],
                Variables = new DefaultItemVariables()
            }));

            yield return(new EffectCard(CardEffectsRepository.Retrieve(CardEffectLookups.MinorStrength)));

            var fireboltSpell = SpellRepository.Retrieve(SpellLookups.Firebolt);

            yield return(new SpellCard(fireboltSpell));

            var regenSpell = SpellRepository.Retrieve(SpellLookups.MinorRegen);

            yield return(new SpellCard(regenSpell));

            var cleaveAbility = AbilityRepository.Retrieve(AbilityLookups.Cleave);

            yield return(new AbilityCard(cleaveAbility));
        }
Example #2
0
        private ILootTable GenerateLootTable()
        {
            var potionItemTemplate = ItemTemplateRepository.Retrieve(ItemTemplateLookups.MinorHealthPotion);
            var potionItem         = new DefaultItem
            {
                ItemTemplate  = potionItemTemplate,
                Modifications = new IModification[0],
                Variables     = new DefaultItemVariables()
            };

            var cleaveAbility   = AbilityRepository.Retrieve(AbilityLookups.Cleave);
            var cleaveLootEntry = new CustomLootTableEntry {
                Ability = cleaveAbility
            };

            cleaveLootEntry.Variables.DropRate(0.02f);

            var attackAbility   = AbilityRepository.Retrieve(AbilityLookups.Attack);
            var attackLootEntry = new CustomLootTableEntry {
                Ability = attackAbility
            };

            attackLootEntry.Variables.DropRate(0.04f);

            var healAbility   = AbilityRepository.Retrieve(AbilityLookups.Heal);
            var healLootEntry = new CustomLootTableEntry {
                Ability = healAbility
            };

            healLootEntry.Variables.DropRate(0.02f);

            var fireboltSpell     = SpellRepository.Retrieve(SpellLookups.Firebolt);
            var fireboltLootEntry = new CustomLootTableEntry {
                Spell = fireboltSpell
            };

            fireboltLootEntry.Variables.DropRate(0.03f);

            var regenSpell     = SpellRepository.Retrieve(SpellLookups.Firebolt);
            var regenLootEntry = new CustomLootTableEntry {
                Spell = regenSpell
            };

            regenLootEntry.Variables.DropRate(0.03f);

            var lootEntries = new List <ILootTableEntry>
            {
                potionItem.GenerateCustomLootTableEntry(0.10f),
                cleaveLootEntry,
                attackLootEntry,
                healLootEntry,
                fireboltLootEntry,
                regenLootEntry
            };

            var allCardEffects = CardEffectsRepository.FindAll(new GetAllQuery <CardEffects>());

            foreach (var cardEffect in allCardEffects)
            {
                var lootEntry = new CustomLootTableEntry {
                    CardEffects = cardEffect
                };
                lootEntry.Variables.DropRate(0.05f);
                lootEntries.Add(lootEntry);
            }

            return(new DefaultLootTable
            {
                AvailableLoot = lootEntries,
                Randomizer = Randomizer,
            });
        }