public ISpellStatBlock FindById(int Id)
        {
            SpellService spellService = new SpellService(ConnectionString);
            spell        tempSpell    = spellService.FindBy(Id);

            return(MapThisToSpellStatBlockObject(tempSpell));
        }
Esempio n. 2
0
 private static void NewSpell(spell spell, Menu parent)
 {
     if (Player.GetSpellSlot(spell.Name) != SpellSlot.Unknown)
     {
         spelldata.mypells.Add(spell.CreateMenu(parent));
     }
 }
Esempio n. 3
0
    /*=======================================-Spell Information-=============================================*/



    /*=======================================+Creates New Spell+=============================================*/
    public static spell createSpell()
    {
        spell test = new spell();


        return(test);
    }
        public ISpellStatBlock GetSpellByName(string name)
        {
            SpellService spellService = new SpellService(ConnectionString);
            spell        tempSpell    = spellService.GetSpellByName(name);

            return(MapThisToSpellStatBlockObject(tempSpell));
        }
Esempio n. 5
0
 void Update()
 {
     if (spell_list.Count == 0)
     {
         return;
     }
     for (int i = spell_list.Count - 1; i >= 0; i--)
     {
         spell spell = spell_list[i];
         if (spell.wait_time > 0)
         {
             spell.wait_time--;
         }
         else
         {
             GameObject obj = Instantiate(spell_map[get_code(spell.spell_code)]) as GameObject;
             obj.SetActive(false);
             spell_script spell_script = obj.GetComponent <spell_script> ();
             spell_script.set_speller(spell.speller);
             spell_script.set_direction(spell.direction2);
             spell_script.set_move_mode(spell.move_mode);
             obj.SetActive(true);
             spell_list.Remove(spell);
         }
     }
 }
 public IEnumerable <string> UpdateSpell(spell spell)
 {
     return(base.Update <spell>(spell));
     //using (IRepository<spell> spellRepository = CreateRepository<spell>())
     //{
     //    IEnumerable<string> rules;
     //    spellRepository.Update(Spell, out rules);
     //    return rules;
     //}
 }
 public IEnumerable <string> AddSpell(spell newSpell)
 {
     return(base.Add <spell>(newSpell));
     //using (IRepository<spell> spellRepository = CreateRepository<spell>())
     //{
     //    IEnumerable<string> rules;
     //    spellRepository.Add(newSpell, out rules);
     //    return rules;
     //}
 }
        public IHttpActionResult AddSpell([FromBody] spell spell)
        {
            if (spell == null)
            {
                return(Ok("Spell Empty"));
            }

            _spellService = GetSpellService();
            IEnumerable <string> Error = _spellService.AddSpell(spell);

            return(Ok(Error));
        }
 private static SpellStatBlock MapThisToSpellStatBlockObject(spell Spell)
 {
     return(Mapper.Map <spell, SpellStatBlock>(Spell));
 }
Esempio n. 10
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(gameObject);
            return;
        }


        //we are not destroyed so create the list of combinations that must be met
        _mseals = new List <spell>();

        spell temp = new spell
        {
            spellString = new List <KeyValuePair <string, string> >()
        };

        temp.spellString.Add(new KeyValuePair <string, string>("blue", "Yog"));
        _mseals.Add(temp);

        temp = new spell
        {
            spellString = new List <KeyValuePair <string, string> >()
        };

        temp.spellString.Add(new KeyValuePair <string, string>("blue", "Yog"));
        temp.spellString.Add(new KeyValuePair <string, string>("red", "Kholw"));
        _mseals.Add(temp);

        temp = new spell
        {
            spellString = new List <KeyValuePair <string, string> >()
        };

        temp.spellString.Add(new KeyValuePair <string, string>("blue", "Yog"));
        temp.spellString.Add(new KeyValuePair <string, string>("red", "Kholw"));
        temp.spellString.Add(new KeyValuePair <string, string>("green", "Dojhu"));
        _mseals.Add(temp);

        temp = new spell
        {
            spellString = new List <KeyValuePair <string, string> >()
        };

        temp.spellString.Add(new KeyValuePair <string, string>("blue", "Yog"));
        temp.spellString.Add(new KeyValuePair <string, string>("red", "Kholw"));
        temp.spellString.Add(new KeyValuePair <string, string>("green", "Dojhu"));
        temp.spellString.Add(new KeyValuePair <string, string>("blue", "Yog"));
        _mseals.Add(temp);


        //Here we should look for a list of allies in the GameManager
        if (GameManager.SelectedAllies != null &&
            GameManager.SelectedAllies.Count > 0)
        {
            //list of allies should be strings that will match
            //allies ids in a list
            //using the ID from the game manager
            //create a new insatnce of the ally with proper
            //stats/spells
        }
    }
Esempio n. 11
0
    public static void castSymbol(symbolController symbol)
    {
        Debug.Log("Cast Symbol");
        Debug.Log(symbol.color);
        Debug.Log(symbol.symbol);

        //get the top spell off the seal list
        spell currentSpell = _mseals[0];

        //restore spell is referring to a backup copy of the target spell
        //if the player does not put it in, in the correct order
        ///then the curernt spell will revert to the restore spell.
        if (restoreSpell == null)
        {
            restoreSpell = new spell()
            {
                spellString = new List <KeyValuePair <string, string> >()
            };
            foreach (KeyValuePair <string, string> s in currentSpell.spellString)
            {
                restoreSpell.spellString.Add(new KeyValuePair <string, string>(s.Key.ToString(), s.Value.ToString()));
            }
            // restoreSpell.spellString = currentSpell.spellString;
        }
        else
        {
            Debug.Log("ITS been SET");
        }

        //loop through current allies
        //for each ally loop through their spell and see if
        //this symbol matches any of them


        KeyValuePair <string, string> currentSymbol = currentSpell.spellString[0];

        bool correctSymbol = false;

        if (currentSymbol.Key == symbol.color)
        {
            if (currentSymbol.Value == symbol.symbol)
            {
                correctSymbol = true;
            }
        }

        if (correctSymbol)
        {
            //remove the symbol
            currentSpell.spellString.Remove(currentSymbol);
            if (currentSpell.spellString.Count <= 0)
            {
                _mseals.Remove(currentSpell);
                restoreSpell.spellString.Clear();
                // restoreSpell = _mseals[0];
                foreach (KeyValuePair <string, string> s in _mseals[0].spellString)
                {
                    restoreSpell.spellString.Add(new KeyValuePair <string, string>(s.Key.ToString(), s.Value.ToString()));
                }
            }
        }
        else
        {
            _mseals[0].spellString.Clear();
            //restore the spell
            foreach (KeyValuePair <string, string> s in restoreSpell.spellString)
            {
                _mseals[0].spellString.Add(new KeyValuePair <string, string>(s.Key, s.Value));
            }
        }
    }
Esempio n. 12
0
    spell getSpellCombo(spell spell1, spell spell2, bool switched = false)
    {
        switch (spell1)
        {
        case spell.PUSH:
            switch (spell2)
            {
            case spell.PUSH:
                return(spell.DOUBLE_PUSH);

            case spell.DESTROY:
                return(spell.PULL);
            }
            break;

        case spell.CREATE_BLOCK:
            switch (spell2)
            {
            case spell.PUSH:
                return(spell.CREATE_PUSHBLOCK);
            }
            break;

        case spell.DESTROY:
            switch (spell2)
            {
            case spell.CREATE_BLOCK:
                return(spell.CREATE_RAMP);

            case spell.DESTROY:
                return(spell.CREATE_VOID);
            }
            break;

        case spell.CREATE_ICE:
            switch (spell2)
            {
            case spell.CREATE_VOID:
                return(spell.REMOVE_ICE);

            case spell.RAISE:
                return(spell.ICE_ABOVE);
            }
            break;

        case spell.RAISE:
            switch (spell2)
            {
            case spell.CREATE_VOID:
                return(spell.LOWER);

            case spell.RAISE:
                return(spell.DOUBLE_RAISE);

            case spell.PUSH:
                return(spell.RAISE_PUSH);
            }
            break;
        }
        return(switched ? spell.NO_EFFECT : getSpellCombo(spell2, spell1, true));
    }
Esempio n. 13
0
    private void putIn(spell s, string n, Sprite theS)
    {
        SpellStruct sp = new SpellStruct(s, theS, n);

        spells.Add(sp);
    }