Ejemplo n.º 1
0
    public IEnumerator Spell(SpellCommand spellCommand)
    {
        BattleCharacter owner        = spellCommand.owner;
        int             spellMp      = spellCommand.spellData.mp;
        string          spellMessage = spellCommand.owner.CharacterName + "はじゅもんをとなえた";

        yield return(StartCoroutine(message.ShowAuto(spellMessage)));

        if (owner.status.mp <= spellMp)
        {
            yield return(StartCoroutine(message.ShowAuto("しかし MPが たりない!")));

            yield break;
        }

        owner.GainMp(spellMp);
        yield return(StartCoroutine(effectExecutor.Execution(spellCommand)));

        yield break;
    }
Ejemplo n.º 2
0
        public async Task <SpellCommand> UdateSpellCommand(SpellCommand spellCommand)
        {
            var sc = _context.SpellCommands.Find(spellCommand.SpellCommandId);

            if (sc == null)
            {
                return(spellCommand);
            }
            try
            {
                sc.Command = spellCommand.Command;
                sc.Name    = spellCommand.Name;
                _context.SaveChanges();
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(sc);
        }
Ejemplo n.º 3
0
 public async Task <SpellCommand> InsertSpellCommand(SpellCommand spellCommand)
 {
     return(await _repo.Add(spellCommand));
 }
Ejemplo n.º 4
0
 internal SpellCommandToolInvokeArgs(IHtmlEditor associatedEditor, SpellCommand invokedCommand)
 {
     AssociatedEditor = associatedEditor;
     InvokedCommand   = invokedCommand;
 }
Ejemplo n.º 5
0
    public void OnClick(Spell spellData)
    {
        SpellCommand spell = new SpellCommand(spellData);

        BattleInputController.instance.SelectCommand(spell);
    }
Ejemplo n.º 6
0
    // when this stuff gets enabled, no gameplay is allowed as of right now
    //private void Awake()
    //{
    //    List<GameObject> neverUnloadRootObjects = new List<GameObject>();
    //    Scene neverUnload = SceneManager.GetSceneByName("NeverUnload");
    //    neverUnload.GetRootGameObjects(neverUnloadRootObjects);

    //    // spell button objects
    //    BigSpellW.SetActive(true);
    //    BigSpellQ.SetActive(true);
    //    SmallSpellW.SetActive(true);
    //    SmallSpellQ.SetActive(true);

    //    // enemy objects
    //    currentEnemy.SetActive(true);
    //    EnemyUI.SetActive(true);

    //    // find game objects
    //    BigSpellW = GameObject.Find("BigSpellW");
    //    BigSpellQ = GameObject.Find("BigSpellQ");
    //    SmallSpellW = GameObject.Find("SmallSpellW");
    //    SmallSpellQ = GameObject.Find("SmallSpellQ");

    //    currentEnemy = GameObject.Find("currentEnemy");
    //    EnemyUI = GameObject.Find("EnemyUI");
    //}


    //TODO Alex changement for Keegan : change function from Start to Awake
    private void Awake()
    {
        List <GameObject> neverUnloadRootObjects = new List <GameObject>();
        Scene             neverUnload            = SceneManager.GetSceneByName("NeverUnload");

        neverUnload.GetRootGameObjects(neverUnloadRootObjects);



        //// enemy objects
        //currentEnemy.SetActive(true);
        //EnemyUI.SetActive(true);

        //// find game objects
        ///TODO Alex changements for Keegan, I completed the Find() function.
        BigSpellW   = GameObject.Find("PlayerUI/BigUI/BigSpellSlotW");
        BigSpellQ   = GameObject.Find("PlayerUI/BigUI/BigSpellSlotQ");
        SmallSpellW = GameObject.Find("PlayerUI/SmallUI/SmallSpellSlotW");
        SmallSpellQ = GameObject.Find("PlayerUI/SmallUI/SmallSpellSlotQ");


        // spell button objects
        //BigSpellW.SetActive(true);
        //BigSpellQ.SetActive(true);
        //SmallSpellW.SetActive(true);
        //SmallSpellQ.SetActive(true);



        //currentEnemy = GameObject.Find("currentEnemy");
        //EnemyUI = GameObject.Find("EnemyUI");



        _BigTextHP   = _PublicVariableHolder._BigTextHP;
        _SmallTextHP = _PublicVariableHolder._SmallTextHP;

        /*
         * _BigSpellQ = _PublicVariableHolder._BigSpellQ;
         * _BigSpellW = _PublicVariableHolder._BigSpellW;
         * _SmallSpellQ = _PublicVariableHolder._SmallSpellQ;
         * _SmallSpellW = _PublicVariableHolder._SmallSpellW;
         */

        _HealImage      = _PublicVariableHolder._HealImage;
        _ExplosionImage = _PublicVariableHolder._ExplosionImage;
        _ShieldImage    = _PublicVariableHolder._ShieldImage;
        _StunImage      = _PublicVariableHolder._StunImage;

        _BigPicture   = _PublicVariableHolder._BigPicture;
        _SmallPicture = _PublicVariableHolder._SmallPicture;

        _BoySprite  = _PublicVariableHolder._BoySprite;
        _GirlSprite = _PublicVariableHolder._GirlSprite;

        _SmallSlider = _PublicVariableHolder._SmallSlider;
        _BigSlider   = _PublicVariableHolder._BigSlider;

        _GirlHealthUI = _PublicVariableHolder._GirlHealthUI;
        _BoyHealthUI  = _PublicVariableHolder._BoyHealthUI;

        _GirlSpellCommandScript = _PublicVariableHolder._GirlSpellCommandScript;
        _BoySpellCommandScript  = _PublicVariableHolder._BoySpellCommandScript;

        _BigQCooldowntext   = _PublicVariableHolder._BigQCooldowntext;
        _BigWCooldowntext   = _PublicVariableHolder._BigWCooldowntext;
        _SmallQCooldowntext = _PublicVariableHolder._SmallQCooldowntext;
        _SmallWCooldowntext = _PublicVariableHolder._SmallWCooldowntext;

        _CooldownBigQImage   = _PublicVariableHolder._CooldownBigQImage;
        _CooldownBigWImage   = _PublicVariableHolder._CooldownBigWImage;
        _CooldownSmallQImage = _PublicVariableHolder._CooldownSmallQImage;
        _CooldownSmallWImage = _PublicVariableHolder._CooldownSmallWImage;

        _GirlMovementScript = _PublicVariableHolder._GirlMovementScript;
        _BoyMovementScript  = _PublicVariableHolder._BoyMovementScript;

        EnemyUI          = _PublicVariableHolder.EnemyUI;
        EnemyNameUI      = _PublicVariableHolder.EnemyNameUI;
        CurrentEnemyHPUI = _PublicVariableHolder.CurrentEnemyHPUI;
        SliderEnemyHPUI  = _PublicVariableHolder.SliderEnemyHPUI;

        BigSpellQ   = _PublicVariableHolder.BigSpellQ;
        BigSpellW   = _PublicVariableHolder.BigSpellW;
        SmallSpellQ = _PublicVariableHolder.SmallSpellQ;
        SmallSpellW = _PublicVariableHolder.SmallSpellW;
    }
Ejemplo n.º 7
0
        public SpellAssociatedRecords SP_GetSpellCommands_old(int spellId, int RuleSetID)
        {
            SpellAssociatedRecords result                  = new SpellAssociatedRecords();
            List <SpellCommand>    _spellCommand           = new List <SpellCommand>();
            List <BuffAndEffect>   _BuffAndEffects         = new List <BuffAndEffect>();
            List <BuffAndEffect>   _selectedBuffAndEffects = new List <BuffAndEffect>();
            string connectionString = _configuration.GetSection("ConnectionStrings").GetSection("DefaultConnection").Value;
            // string qry = "EXEC Spell_GetSpellCommands @SpellId = '" + spellId + "'";

            SqlConnection  connection = new SqlConnection(connectionString);
            SqlCommand     command    = new SqlCommand();
            SqlDataAdapter adapter    = new SqlDataAdapter();
            DataSet        ds         = new DataSet();

            try
            {
                connection.Open();
                command = new SqlCommand("Spell_GetSpellCommands", connection);

                // Add the parameters for the SelectCommand.
                command.Parameters.AddWithValue("@SpellId", spellId);
                command.Parameters.AddWithValue("@RulesetID", RuleSetID);
                command.CommandType = CommandType.StoredProcedure;

                adapter.SelectCommand = command;

                adapter.Fill(ds);
                command.Dispose();
                connection.Close();
            }
            catch (Exception ex)
            {
                command.Dispose();
                connection.Close();
            }

            if (ds.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    SpellCommand _spellCmd = new SpellCommand();

                    _spellCmd.Command        = row["Command"] == DBNull.Value ? null : row["Command"].ToString();
                    _spellCmd.SpellId        = row["SpellId"] == DBNull.Value ? 0 : Convert.ToInt32(row["SpellId"].ToString());
                    _spellCmd.SpellCommandId = row["SpellCommandId"] == DBNull.Value ? 0 : Convert.ToInt32(row["SpellCommandId"].ToString());
                    _spellCmd.IsDeleted      = row["IsDeleted"] == DBNull.Value ? false : Convert.ToBoolean(row["IsDeleted"]);
                    _spellCmd.Name           = row["Name"] == DBNull.Value ? null : row["Name"].ToString();

                    _spellCommand.Add(_spellCmd);
                }
            }
            if (ds.Tables[1].Rows.Count > 0)
            {
                foreach (DataRow row in ds.Tables[1].Rows)
                {
                    BuffAndEffect i = new BuffAndEffect();
                    i.BuffAndEffectId = row["BuffAndEffectId"] == DBNull.Value ? 0 : Convert.ToInt32(row["BuffAndEffectId"]);
                    i.RuleSetId       = row["RuleSetId"] == DBNull.Value ? 0 : Convert.ToInt32(row["RuleSetId"]);
                    i.Name            = row["Name"] == DBNull.Value ? null : row["Name"].ToString();
                    i.ImageUrl        = row["ImageUrl"] == DBNull.Value ? null : row["ImageUrl"].ToString();

                    _BuffAndEffects.Add(i);/////////
                }
            }
            if (ds.Tables[2].Rows.Count > 0)
            {
                foreach (DataRow row in ds.Tables[2].Rows)
                {
                    BuffAndEffect i = new BuffAndEffect();
                    i.BuffAndEffectId = row["BuffAndEffectId"] == DBNull.Value ? 0 : Convert.ToInt32(row["BuffAndEffectId"]);
                    i.RuleSetId       = row["RuleSetId"] == DBNull.Value ? 0 : Convert.ToInt32(row["RuleSetId"]);
                    i.Name            = row["Name"] == DBNull.Value ? null : row["Name"].ToString();
                    i.ImageUrl        = row["ImageUrl"] == DBNull.Value ? null : row["ImageUrl"].ToString();

                    _selectedBuffAndEffects.Add(i);///////
                }
            }

            result.SpellCommands          = _spellCommand;
            result.BuffAndEffectsList     = _BuffAndEffects;
            result.SelectedBuffAndEffects = _selectedBuffAndEffects;
            return(result);
        }