Ejemplo n.º 1
0
        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));
        }
        // DELETE: api/Spell/5
        public HttpResponseMessage Delete(int id)
        {
            SpellRepository.DeleteSpell(id);
            var response = Request.CreateResponse(HttpStatusCode.OK, id);

            return(response);
        }
        // POST: api/Spell
        public HttpResponseMessage Post(Spell spell)
        {
            SpellRepository.InsertSpell(spell);
            var    response = Request.CreateResponse(HttpStatusCode.Created, spell);
            string url      = Url.Link("DefaultApi", new { spell.Id });

            response.Headers.Location = new Uri(url);
            return(response);
        }
Ejemplo n.º 4
0
    //public SpellQueue spellQueue;

    private GameCore()
    {
        spellRepository  = new SpellRepository(this);
        itemRepository   = new ItemRepository();
        spellCastHandler = new SpellCastHandler();
        troopsHandler    = new TroopsHandler();
        chosenAccount    = new Account();
        chosenAccount.LoadAccData();
        chosenAdventure = new Adventure(-1);
        espellHandler   = new EnemySpellInfoHandler();
        //spellQueue = new SpellQueue();
    }
Ejemplo n.º 5
0
        /// <summary>
        /// Loads the entities in memory.
        /// </summary>
        public void LoadContent()
        {
            string itemPath   = Path.Combine(ApplicationPaths.EntitiesDirectory, "items.xml");
            string mobPath    = Path.Combine(ApplicationPaths.EntitiesDirectory, "mobs.xml");
            string prayerPath = Path.Combine(ApplicationPaths.EntitiesDirectory, "prayers.xml");
            string spellPath  = Path.Combine(ApplicationPaths.EntitiesDirectory, "spells.xml");

            ItemRepository   itemRepository   = new ItemRepository(itemPath);
            MobRepository    mobRepository    = new MobRepository(mobPath);
            PrayerRepository prayerRepository = new PrayerRepository(prayerPath);
            SpellRepository  spellRepository  = new SpellRepository(spellPath);

            items   = itemRepository.GetAll().ToDomainModels().ToList();
            mobs    = mobRepository.GetAll().ToDomainModels().ToList();
            prayers = prayerRepository.GetAll().ToDomainModels().ToList();
            spells  = spellRepository.GetAll().ToDomainModels().ToList();
        }
Ejemplo n.º 6
0
    public static string GetSpellDescription(CHAMPION classID, int num)
    {
        SpellRepository spellRepo = GameCore.Core.spellRepository;

        if (classID == CHAMPION.PALADIN)
        {
            switch (num)
            {
            case 0: return(spellRepo.Get(SPELL.WORD_OF_KINGS_LIGHT).GetSpellDescription());

            case 1: return(spellRepo.Get(SPELL.WORD_OF_KINGS_COURAGE).GetSpellDescription());

            case 2: return(spellRepo.Get(SPELL.WORD_OF_KINGS_FAITH).GetSpellDescription());

            case 3: return(spellRepo.Get(SPELL.WORD_OF_KINGS_LOYALTY).GetSpellDescription());

            case 4: return(spellRepo.Get(SPELL.DIVINE_INTERVENTION).GetSpellDescription());
            }
        }
        else
        if (classID == CHAMPION.SHADOWMANCER)
        {
            switch (num)
            {
            case 0: return(spellRepo.Get(SPELL.SOOTHING_VOID).GetSpellDescription());

            case 1: return(spellRepo.Get(SPELL.SHADOWSURGE).GetSpellDescription());

            case 2: return(spellRepo.Get(SPELL.TWILIGHT_BEAM).GetSpellDescription());

            case 3: return(spellRepo.Get(SPELL.SHADOWSONG).GetSpellDescription());

            case 4: return(spellRepo.Get(SPELL.SACRIFICE).GetSpellDescription());
            }
        }
        return("");
    }
 public SpellbookService(IDbContext context)
 {
     _spells     = new SpellRepository(context);
     _spellLists = new SpellListRepository(context);
     _characters = new CharacterRepository(context);
 }
Ejemplo n.º 8
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,
            });
        }
 // GET: api/Spell/5
 public Spell Get(int id)
 {
     return(SpellRepository.GetSpell().FirstOrDefault(p => p.Id == id));
 }
Ejemplo n.º 10
0
 // GET: api/Spell
 public IEnumerable <Spell> Get()
 {
     return(SpellRepository.GetSpell());
 }