コード例 #1
0
ファイル: Shoot.cs プロジェクト: tuita520/RL_CardGame
    public IEnumerator IEStartSkill(BattleRoleData source, BattleRoleData target, int dmgVal)
    {
        source.unit_character_model.CurrentCharacterModel.ChangeModelAnim
            (source.unit_character_model.CurrentCharacterModel.anim_cast, false);
        SLEffectManager.Instance.playCommonEffectCast(source.transform.position);
        yield return(new WaitForSeconds(castLastTime));

        source.playBulletCastAnimation(bullet, source.unit_model.position, target.unit_model.position);
        yield return(new WaitForSeconds(bulletLastTime));

        #region 计算技能状态
        source.SkillCheck(this, target);
        IsCausedCritDmg = source.CritHappen;
        IsCausedMiss    = !source.AccurHappen;
        IsCausedFault   = source.FaultHappen;
        float criD = 1;
        if (IsCausedCritDmg)
        {
            criD
                = AllRandomSetClass.SimplePercentToDecimal
                      (source.ThisBasicRoleProperty().CRIDmg + 100);
        }
        int NowExpect = (int)(UnityEngine.Random.Range(-1f, 1f) * source.ExpectResult);
        #endregion
        dmgVal  = (int)(dmgVal * criD);
        dmgVal += NowExpect;
        Debug.Log(source.name + "shoot cause" + dmgVal + " damage to " + target.name);
        //source.unit_character_model.CurrentCharacterModel.ChangeModelAnim(SDConstants.AnimName_IDLE, true);
        #region  输技能状态
        target.HpController.isCriDmg    = IsCausedCritDmg;
        target.HpController.isEvoHappen = IsCausedMiss;
        target.HpController.isFault     = IsCausedFault;
        #endregion
        dmgVal = (int)(dmgVal * AllRandomSetClass.SimplePercentToDecimal(100 + target.PhysModify));
        target.HpController.getDamage(dmgVal, _skillKind);

        yield return(new WaitForSeconds(skillLastTime));

        StartCoroutine(IEWaitForEnd(source));
    }
コード例 #2
0
    public IEnumerator IEStartSkill(BattleRoleData source, BattleRoleData target
                                    , int physicalVal, int elementalVal, int arcaneVal)
    {
        source.unit_character_model.CurrentCharacterModel.ChangeModelAnim
            (source.unit_character_model.CurrentCharacterModel.anim_cast, false);
        SLEffectManager.Instance.playCommonEffectCast(source.transform.position);
        yield return(new WaitForSeconds(castLastTime));

        source.playBulletCastAnimation(bullet, source.unit_model.position, target.unit_model.position);
        yield return(new WaitForSeconds(bulletLastTime));

        int d0 = physicalVal;
        int d1 = elementalVal;
        int d2 = arcaneVal;

        #region 计算技能状态
        source.SkillCheck(this, target);
        IsCausedCritDmg = source.CritHappen;
        IsCausedMiss    = !source.AccurHappen;
        IsCausedFault   = source.FaultHappen;
        if (IsCausedCritDmg)
        {
            float criD
                = AllRandomSetClass.SimplePercentToDecimal
                      (source.ThisBasicRoleProperty().CRIDmg + 100);
            d0 = (int)(d0 * criD);
            d1 = (int)(d1 * criD);
            d2 = (int)(d2 * criD);
        }
        #endregion
        #region Expect
        int NowExpect = (int)(UnityEngine.Random.Range(-1f, 1f) * source.ExpectResult);
        d0       += NowExpect;
        NowExpect = (int)(UnityEngine.Random.Range(-1f, 1f) * source.ExpectResult);
        d1       += NowExpect;
        NowExpect = (int)(UnityEngine.Random.Range(-1f, 1f) * source.ExpectResult);
        d2       += NowExpect;
        #endregion
        #region  输技能状态
        target.HpController.isCriDmg    = IsCausedCritDmg;
        target.HpController.isEvoHappen = IsCausedMiss;
        target.HpController.isFault     = IsCausedFault;
        #endregion
        float DECIMAL = AllRandomSetClass.SimplePercentToDecimal(100 + target.PhysModify);
        d0 = (int)(d0 * DECIMAL);
        d1 = (int)(d1 * DECIMAL);
        d2 = (int)(d2 * DECIMAL);

        Debug.Log(source.name + " slash cause "
                  + d0 + " physical damage "
                  + d1 + " elemental damage "
                  + d2 + " arcane damage"
                  + " to " + target.name);
        target.HpController.getDamage(d0, SkillKind.Physical);
        target.HpController.getDamage(d1, SkillKind.Elemental);
        target.HpController.getDamage(d2, SkillKind.Arcane);

        yield return(new WaitForSeconds(skillLastTime));

        StartCoroutine(IEWaitForEnd(source));
    }