コード例 #1
0
ファイル: SkillBuff.cs プロジェクト: ConstTeam/HeroProject
 public override void DoSkill(SkillDataSon skillDataSon, CharHandler charHandler, List <CharHandler> targets, int skillInstId)
 {
     for (int i = 0; i < targets.Count; ++i)
     {
         TickData tickData = new TickData(charHandler, targets[i], skillDataSon, i, skillInstId);
         targets[i].m_CharTick.AddTick(tickData);
     }
 }
コード例 #2
0
 private static void Connect(float fValue, CharHandler aimCharHandler, TickData tickData, int skillInstId)
 {
     BattleManager.GetInst().m_TriggerManager.AddConnectChar(skillInstId, aimCharHandler, fValue);
     if (null != tickData)
     {
         tickData.funcTick = null;
         tickData.funcEnd += (bool bCancel) =>
         {
             BattleManager.GetInst().m_TriggerManager.RemoveConnectChar(skillInstId, aimCharHandler);
         };
     }
 }
コード例 #3
0
 private static void UbBeatable(CharHandler aimCharHandler, TickData tickData)
 {
     aimCharHandler.m_CharData.UnBeatable.AddNew(tickData.m_iInstanceID, true);
     if (null != tickData)
     {
         tickData.funcTick = null;
         tickData.funcEnd += (bool bCancel) =>
         {
             aimCharHandler.m_CharData.UnBeatable.Value = false;
         };
     }
 }
コード例 #4
0
 private static void SoulSkillInvalid(CharHandler aimCharHandler, TickData tickData)
 {
     aimCharHandler.m_CharData.SoulSkillInvalid.AddNew(tickData.m_iInstanceID, true);
     if (null != tickData)
     {
         tickData.funcTick = null;
         tickData.funcEnd += (bool bCancel) =>
         {
             aimCharHandler.m_CharData.SoulSkillInvalid.Value = false;
         };
     }
 }
コード例 #5
0
 private static void Rebound(float fValue, CharHandler aimCharHandler, TickData tickData)
 {
     aimCharHandler.m_CharData.Rebound.AddNew(tickData.m_iInstanceID, fValue);
     if (null != tickData)
     {
         tickData.funcTick = null;
         tickData.funcEnd += (bool bCancel) =>
         {
             aimCharHandler.m_CharData.Rebound.Value = 0;
         };
     }
 }
コード例 #6
0
 private static void Stun(CharHandler aimCharHandler, TickData tickData)
 {
     aimCharHandler.m_CharData.Stun.AddNew(tickData.m_iInstanceID, true);
     aimCharHandler.ToDizzy();
     if (null != tickData)
     {
         tickData.funcTick = null;
         tickData.funcEnd += (bool bCancel) =>
         {
             aimCharHandler.m_CharData.Stun.Value = false;
             if (!aimCharHandler.m_CharData.Stun.Value)
             {
                 aimCharHandler.DizzyEnd();
             }
         };
     }
 }
コード例 #7
0
        private static void SuperAbsorb(float fValue, CharHandler aimCharHandler, TickData tickData)
        {
            aimCharHandler.m_CharData.Absorb.AddNew(tickData.m_iInstanceID, fValue);
            if (null != tickData)
            {
                tickData.funcTick = null;
                tickData.funcEnd += (bool bCancel) =>
                {
                    aimCharHandler.m_CharData.Absorb.Value = 0;

                    if (!bCancel)
                    {
                        aimCharHandler.m_CharData.CurHP = aimCharHandler.m_CharData.MaxHP;
                    }
                };
            }
        }
コード例 #8
0
        private static void Concentrate(CharHandler aimCharHandler, TickData tickData)
        {
            HUDTextMgr.GetInst().NewText(ConfigData.GetHUDText("19"), aimCharHandler, HUDTextMgr.HUDTextType.BUFF);               //"集火目标"

            aimCharHandler.m_CharData.Concentrate.AddNew(tickData.m_iInstanceID, true);
            if (null != tickData)
            {
                tickData.funcTick = null;
                tickData.funcEnd += (bool bCancel) =>
                {
                    aimCharHandler.m_CharData.Concentrate.Value = false;
                    if (!aimCharHandler.m_CharData.Concentrate.Value)
                    {
                        HUDTextMgr.GetInst().NewText(ConfigData.GetHUDText("20"), aimCharHandler, HUDTextMgr.HUDTextType.BUFF);                           //"集火结束"
                    }
                };
            }
        }
コード例 #9
0
 public void AddTick(TickData tickData)
 {
     _lstTick.Add(tickData);
 }
コード例 #10
0
        private static void _ChangeBool(CharHandler charHandler, CharHandler aimCharHandler, bool bFlag, TickData tickData, ChangeBoolFunc func, string beginText, string endText)
        {
            HUDTextMgr.GetInst().NewText(beginText, aimCharHandler, HUDTextMgr.HUDTextType.BUFF);

            func(aimCharHandler, bFlag);
            if (null != tickData)
            {
                tickData.funcTick = null;
                tickData.funcEnd += (bool bCancel) =>
                {
                    func(aimCharHandler, !bFlag);
                    HUDTextMgr.GetInst().NewText(endText, aimCharHandler, HUDTextMgr.HUDTextType.BUFF);
                };
            }
        }
コード例 #11
0
        private static void _AddValue(CharHandler charHandler, CharHandler aimCharHandler, float fValue, TickData tickData, AddValueFunc func, string beginText, string endText)
        {
            HUDTextMgr.GetInst().NewText(string.Format(beginText, fValue, fValue > 0 ? "+" : string.Empty), aimCharHandler, HUDTextMgr.HUDTextType.BUFF);
            func(aimCharHandler, fValue);
            if (null != tickData)
            {
                if (tickData.m_fUnitSec == tickData.m_fTotalSec)
                {
                    tickData.funcTick = null;
                }
                else
                {
                    tickData.funcTick = () => { func(aimCharHandler, fValue); }
                };

                tickData.funcEnd += (bool bCancel) =>
                {
                    func(aimCharHandler, -fValue);
                    HUDTextMgr.GetInst().NewText(string.Format(endText, fValue, fValue > 0 ? "-" : string.Empty), aimCharHandler, HUDTextMgr.HUDTextType.BUFF);
                };
            }
        }
コード例 #12
0
        public static void Change(SkillData skillData, CharHandler charHandler, CharHandler aimCharHandler, int aimCharIndex, TickData tickData = null, int skillInstId = -1)
        {
            float fValue = 0.0f;

            if (string.Empty != skillData.m_sEffectExpress)
            {
                fValue = Mathf.Max(0, BattleCalculate.ExcuteFormula(skillData.m_sEffectExpress, skillData.m_sEffectExpressMax, charHandler, aimCharHandler)) * skillData.m_iHurtTypeSign;
                fValue = RatioCoefficient(fValue, skillData.m_Parent.m_Parent.m_eSkillKind, charHandler, aimCharHandler);

                if (skillData.m_Parent.m_bDeliver)
                {
                    fValue *= aimCharIndex + 1;
                }
            }

            SkillEnum.SkillSonType hurtType = skillData.m_eSkillSonType;
            switch (hurtType)
            {
                #region --攻防血魔
            case SkillEnum.SkillSonType.Attack:
                fValue = CtrlValue(aimCharHandler.m_CharData.CurAttack, fValue);
                _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddAttack, ConfigData.GetHUDText("23"), ConfigData.GetHUDText("23"));                             //"攻 {1}{0:N0}"
                break;

            case SkillEnum.SkillSonType.Defence:
                fValue = CtrlValue(aimCharHandler.m_CharData.CurDefence, fValue);
                _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddDefence, ConfigData.GetHUDText("24"), ConfigData.GetHUDText("24"));                                //"防 {1}{0:N0}"
                break;

            case SkillEnum.SkillSonType.HP:
                _ChangeHP(aimCharHandler, fValue, charHandler, skillData);
                if (null != tickData)
                {
                    if (tickData.m_fUnitSec == tickData.m_fTotalSec)
                    {
                        tickData.funcTick = null;
                    }
                    else
                    {
                        tickData.funcTick = () => { _ChangeHP(aimCharHandler, fValue, charHandler, skillData); }
                    };
                }
                break;

            case SkillEnum.SkillSonType.MP:
                _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddMP, ConfigData.GetHUDText("25"), ConfigData.GetHUDText("25"));                            //"士气 {1}{0:N0}"
                break;

                #endregion
                #region --三维属性
            case SkillEnum.SkillSonType.Force:
                _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddForce, ConfigData.GetHUDText("26"), ConfigData.GetHUDText("26"));                          // "武 {1}{0:N0}"
                break;

            case SkillEnum.SkillSonType.Soul:
                _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddSoul, ConfigData.GetHUDText("27"), ConfigData.GetHUDText("27"));                           //"魂 {1}{0:N0}"
                break;

            case SkillEnum.SkillSonType.Magic:
                _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddMagic, ConfigData.GetHUDText("28"), ConfigData.GetHUDText("28"));                             //"法 {1}{0:N0}"
                break;

            case SkillEnum.SkillSonType.ForceRatio:
                _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddForceRatio, ConfigData.GetHUDText("29"), ConfigData.GetHUDText("30"));                            //"武提升 {1}{0:P1}","武提升结束"
                break;

            case SkillEnum.SkillSonType.SoulRatio:
                _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddSoulRatio, ConfigData.GetHUDText("31"), ConfigData.GetHUDText("32"));                            //"魂提升 {1}{0:P1}","魂提升结束"
                break;

            case SkillEnum.SkillSonType.MagicRatio:
                _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddMagicRatio, ConfigData.GetHUDText("33"), ConfigData.GetHUDText("34"));                            //"法提升 {1}{0:P1}","法提升结束"
                break;

                #endregion
                #region --武功魂技法术系数
            case SkillEnum.SkillSonType.ForceSkillAtkRatio:
                _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddForceSkillAtkRatio, ConfigData.GetHUDText("35"), ConfigData.GetHUDText("36"));                          // "武功提升 {1}{0:P1}","武功提升结束"
                break;

            case SkillEnum.SkillSonType.SoulSkillAtkRatio:
                _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddSoulSkillAtkRatio, ConfigData.GetHUDText("37"), ConfigData.GetHUDText("38"));                            // "魂技提升 {1}{0:P1}","魂技提升结束"
                break;

            case SkillEnum.SkillSonType.MagicSkillAtkRatio:
                _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddMagicSkillAtkRatio, ConfigData.GetHUDText("39"), ConfigData.GetHUDText("40"));                          //"法术提升 {1}{0:P1}", "法术提升结束"
                break;

            case SkillEnum.SkillSonType.ForceSkillDefRatio:
                _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddForceSkillDefRatio, ConfigData.GetHUDText("41"), ConfigData.GetHUDText("42"));                          // "武功免伤 {1}{0:P1}", "武功免伤结束"
                break;

            case SkillEnum.SkillSonType.SoulSkillDefRatio:
                _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddSoulSkillDefRatio, ConfigData.GetHUDText("43"), ConfigData.GetHUDText("44"));                           //"魂技免伤 {1}{0:P1}","魂技免伤结束"
                break;

            case SkillEnum.SkillSonType.MagicSkillDefRatio:
                _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddMagicSkillDefRatio, ConfigData.GetHUDText("45"), ConfigData.GetHUDText("46"));                          // "法术免伤 {1}{0:P1}", "法术免伤结束"
                break;

                #endregion
                #region --暴击治疗系数
            case SkillEnum.SkillSonType.CriticalRatio:
                _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddCriticalRatio, ConfigData.GetHUDText("47"), ConfigData.GetHUDText("48"));                         // "暴击率 {1}{0:P1}","暴击率恢复"
                break;

            case SkillEnum.SkillSonType.CureUpRatio:
                _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddCureUpRatio, ConfigData.GetHUDText("49"), ConfigData.GetHUDText("50"));                         // "治疗提升 {1}{0:P1}","治疗提升结束"
                break;

            case SkillEnum.SkillSonType.CureDownRatio:
                _AddValue(charHandler, aimCharHandler, fValue, tickData, _AddCureDownRatio, ConfigData.GetHUDText("51"), ConfigData.GetHUDText("52"));                            //"治疗压制 {1}{0:P1}","治疗压制结束"
                break;

                #endregion
                #region --数值盾
            case SkillEnum.SkillSonType.Absorb:
                Absorb(fValue, aimCharHandler, tickData);
                break;

            case SkillEnum.SkillSonType.AbsorbHP:
                AbsorbHP(fValue, aimCharHandler, tickData);
                break;

            case SkillEnum.SkillSonType.Rebound:
                Rebound(fValue, aimCharHandler, tickData);
                break;

            case SkillEnum.SkillSonType.SuperAbsorb:
                SuperAbsorb(fValue, aimCharHandler, tickData);
                break;

                #endregion
            case SkillEnum.SkillSonType.SkillForbid:
                SkillForbid(aimCharHandler, tickData);
                break;

            case SkillEnum.SkillSonType.SoulSkillInvalid:
                SoulSkillInvalid(aimCharHandler, tickData);
                break;

            case SkillEnum.SkillSonType.Stun:
                Stun(aimCharHandler, tickData);
                break;

            case SkillEnum.SkillSonType.Unbeatable:
                UbBeatable(aimCharHandler, tickData);
                break;

            case SkillEnum.SkillSonType.Concentrate:
                Concentrate(aimCharHandler, tickData);
                break;

            case SkillEnum.SkillSonType.Connect:
                Connect(fValue, aimCharHandler, tickData, skillInstId);
                break;

            default:
                break;
            }
        }