Example #1
0
 public void DisableAbnormalStateById(eAbnormalState _abnormalState, int _actionId)
 {
     if (abnormalStateCategoryDataDictionary[GetAbnormalStateCategory(_abnormalState)].ActionId == _actionId)
     {
         EnableAbnormalState(_abnormalState, false, false, false);
     }
 }
Example #2
0
        private void SwitchAbnormalState(eAbnormalState abnormalState, AbnormalStateEffectPrefabData _specialEffectData)
        {
            AbnormalStateCategoryData categoryData = abnormalStateCategoryDataDictionary[GetAbnormalStateCategory(abnormalState)];

            EnableAbnormalState(categoryData.CurrentAbnormalState, false, false, true);
            EnableAbnormalState(abnormalState, true, false, false);
            categoryData.CurrentAbnormalState = abnormalState;
            //处理特效
        }
Example #3
0
        public void SetAbnormalState(UnitCtrl source, eAbnormalState abnormalState, float effectTime, ActionParameter action, Skill skill, float value, float value2, bool reduceEnergy, float reduceEnergyRate)
        {
            if (action != null)
            {
                //获取特效
            }
            if ((this.staticBattleManager.GameState == eGameBattleState.FIGHTING) && ((!this.IsAbnormalState(eAbnormalState.NO_DAMAGE_MOTION) && !this.IsAbnormalState(eAbnormalState.NO_ABNORMAL)) || ABNORMAL_CONST_DATA[abnormalState].IsBuff))
            {
                switch (abnormalState)
                {
                case eAbnormalState.BURN:
                case eAbnormalState.CURSE:
                case eAbnormalState.SLOW:
                case eAbnormalState.INHIBIT_HEAL:
                case eAbnormalState.FAINT:
                    this.OnSlipDamage();
                    break;
                }
                int effecttime_int = (int)(staticBattleManager.FrameRate * effectTime);
                if (abnormalState == eAbnormalState.GUANG_BOTH && IsAbnormalState(eAbnormalState.DRAIN_BOTH) ||
                    abnormalState == eAbnormalState.GUARD_ATK && IsAbnormalState(eAbnormalState.DRAIN_ATK) ||
                    abnormalState == eAbnormalState.GUARG_MGC && IsAbnormalState(eAbnormalState.DRAIN_MGC))
                {
                    //设置特效
                    return;
                }
                AbnormalStateCategoryData categoryData = abnormalStateCategoryDataDictionary[GetAbnormalStateCategory(abnormalState)];
                if (isDead)
                {
                    return;
                }
                if (IsAbnormalState(GetAbnormalStateCategory(abnormalState)))
                {
                    SwitchAbnormalState(abnormalState, null);
                }
                categoryData.Time             = effectTime;
                categoryData.Duration         = effectTime;
                categoryData.MainValue        = value;
                categoryData.SubValue         = value2;
                categoryData.EnergyReduceRate = reduceEnergyRate;

                categoryData.ActionId           = action == null ? 0 : action.ActionId;
                categoryData.IsEnergyReduceMode = reduceEnergy;
                categoryData.Skill  = skill;
                categoryData.Source = source;
                if (!IsAbnormalState(GetAbnormalStateCategory(abnormalState)))
                {
                    categoryData.CurrentAbnormalState = abnormalState;
                    StartCoroutine(UpdateAbnormalState(abnormalState, null));
                }
                return;
            }
            if (IsAbnormalState(eAbnormalState.NO_ABNORMAL))
            {
                SetMissAtk(source, eMissLogType.DODGE_BY_NO_DAMAGE_MOTION, eDamageEffectType.NORMAL, null, 1);
            }
        }
Example #4
0
        public static eAbnormalStateCategory GetAbnormalStateCategory(eAbnormalState abnormalState)
        {
            int k = (int)abnormalState - 1;

            if (k > 46 || k < 0)
            {
                return(eAbnormalStateCategory.NONE);
            }
            else
            {
                return((eAbnormalStateCategory)k);
            }
        }
Example #5
0
 public void SetAbnormalState(UnitCtrl _source, eAbnormalState abnomeralState, float effectTime, ActionParameter action, Skill skill, float value, float value2, bool reduceEnergy, float reduceEnergyRate)
 {
     if ((this.staticBattleManager.GameState == eGameBattleState.FIGHTING) && ((!this.IsAbnormalState(eAbnormalState.NO_DAMAGE_MOTION) && !this.IsAbnormalState(eAbnormalState.NO_ABNORMAL)) || ABNORMAL_CONST_DATA[abnomeralState].IsBuff))
     {
         switch (((int)abnomeralState))
         {
         case 9:
         case 10:
         case 11:
         case 0x22:
         case 0x27:
             this.OnSlipDamage();
             break;
         }
     }
 }
Example #6
0
        private IEnumerator UpdateAbnormalState(eAbnormalState _abnormalState, AbnormalStateEffectPrefabData _specialEffectData)
        {
            eAbnormalStateCategory    category     = GetAbnormalStateCategory(_abnormalState);
            AbnormalStateCategoryData categoryData = abnormalStateCategoryDataDictionary[category];

            categoryData.Time = categoryData.Duration;
            //特效处理
            EnableAbnormalState(_abnormalState, true, categoryData.IsEnergyReduceMode, false);
            while (true)
            {
                if (IsAbnormalState(category))
                {
                    _abnormalState = categoryData.CurrentAbnormalState;
                    if (categoryData.IsEnergyReduceMode)
                    {
                        float energy_min = categoryData.EnergyReduceRate * DeltaTimeForPause_BUFF;
                        SetEnergy(Energy - energy_min, eSetEnergyType.BY_MODE_CHANGE, null);
                        if (Energy <= 0)
                        {
                            EnableAbnormalState(_abnormalState, false);
                            yield break;
                        }
                    }
                    else
                    {
                        categoryData.Time -= DeltaTimeForPause_BUFF;
                        if (categoryData.Time <= 0)
                        {
                            EnableAbnormalState(_abnormalState, false);
                            yield break;
                        }
                    }
                    if (!IsDead)
                    {
                        yield return(null);

                        continue;
                    }
                    EnableAbnormalState(_abnormalState, false);
                    break;
                }
                break;
            }
        }
Example #7
0
        private void EnableAbnormalState(eAbnormalState abnormalState, bool enable, bool reduceEnergy = false, bool _switch = false)
        {
            eAbnormalStateCategory    category     = GetAbnormalStateCategory(abnormalState);
            AbnormalStateCategoryData categoryData = abnormalStateCategoryDataDictionary[category];

            if (!enable)
            {
                //销毁特效
                categoryData.MainValue = 0;
                categoryData.Time      = 0;
                categoryData.Duration  = 0;
            }
            categoryData.enable            = enable;
            m_abnormalState[abnormalState] = enable;
            switch (abnormalState)
            {
            case eAbnormalState.HASTE:
                if (enable)
                {
                    if (actionState == eActionState.IDLE)
                    {
                        spineController.SetTimeScale(timeScale * 2.0f);
                        break;
                    }
                }
                else if (!IsUnableActionState() && !isPause)
                {
                    spineController.Resume();
                }
                break;

            case eAbnormalState.POISON:
            case eAbnormalState.BURN:
            case eAbnormalState.CURSE:
            case eAbnormalState.NO_EFFECT_SLIP_DAMAGE:
            case eAbnormalState.VENOM:
            case eAbnormalState.HEX:
            case eAbnormalState.COMPENSATION:
                if (enable)
                {
                    slipDamageIdDictionary[category]++;
                    StartCoroutine(UpdateSlipDamage(category, slipDamageIdDictionary[category]));
                }
                break;

            case eAbnormalState.SLOW:
                if (enable)
                {
                    //改变颜色
                    if (actionState == eActionState.IDLE)
                    {
                        spineController.SetTimeScale(timeScale * 0.5f);
                    }
                }
                else
                {
                    //改变颜色
                    if (!IsUnableActionState())
                    {
                        spineController.Resume();
                    }
                }
                break;

            case eAbnormalState.PARALYSIS:
            case eAbnormalState.FREEZE:
            case eAbnormalState.CHAINED:
            case eAbnormalState.SLEEP:
            case eAbnormalState.STUN:
            case eAbnormalState.DETAIN:
            case eAbnormalState.FAINT:
                if (enable)
                {
                    if (actionState != eActionState.DAMAGE)
                    {
                        SetState(eActionState.DAMAGE, 0);
                        break;
                    }
                }
                else if (!IsUnableActionState() && !_switch)
                {
                    SetMotionResume();
                }
                break;

            case eAbnormalState.CONVERT:
            case eAbnormalState.CONFUSION:
                SetLeftDirection(IsNearestEnemyLeft());
                if (actionState == eActionState.ATK || actionState == eActionState.IDLE || actionState == eActionState.SKILL1 || actionState == eActionState.SKILL)
                {
                    cancalByCovert          = true;
                    idleStartAfterWaitFrame = m_fCastTimer <= DeltaTimeForPause;
                }
                if (Hp >= 1 && !IsUnableActionState() && actionState != eActionState.DAMAGE)
                {
                    SetState(eActionState.IDLE, 0);
                }
                break;

            case eAbnormalState.CONTINUOUS_ATTACK_NEARBY:
                Debug.LogError("咕咕咕!");
                break;

            case eAbnormalState.DECOY:
                Debug.LogError("咕咕咕!");
                break;

            case eAbnormalState.STONE:
                if (enable)
                {
                    if (actionState != eActionState.DAMAGE)
                    {
                        SetState(eActionState.DAMAGE, 0);
                    }
                    //设置石化颜色
                }
                else
                {
                    if (!IsUnableActionState() && !_switch)
                    {
                        SetMotionResume();
                    }
                    //设置石化颜色
                }
                break;

            case eAbnormalState.REGENERATION:
                if (enable)
                {
                    currentHpRegeneId++;
                    StartCoroutine(UpdateHpRegeneration(currentHpRegeneId));
                }
                break;

            case eAbnormalState.TP_REGENERATION:
                if (enable)
                {
                    currentTpRegeneId++;
                    StartCoroutine(UpdateTpRegeneration(currentHpRegeneId));
                }
                break;

            default:
                break;
            }
            OnChangeState?.Invoke(this, ABNORMAL_CONST_DATA[abnormalState].IconType, enable);
            if (!enable && !_switch)
            {
                //Elements_Battle_BattleManager__RestartAbnormalStateField(v43, this, abnormalState, 0LL)
            }
        }
Example #8
0
 private void EnableAbnormalState(eAbnormalState _abnormalState, bool _enable, bool _reduceEnergy = false, bool _switch = false)
 {
 }
Example #9
0
 public static eAbnormalStateCategory GetAbnormalStateCategory(eAbnormalState abnormalState)
 {
     return((eAbnormalStateCategory)abnormalStateSwitch[(int)abnormalState]);
 }