Esempio n. 1
0
    public void    SetInfo(Hashtable acttioninfo, sdGameActor actor)
    {
        stateData = acttioninfo;
        object iEffectid = stateData["sSkillEffect[8]"];

        if (iEffectid != null)
        {
            int[] idArray = (int[])iEffectid;
            skillEffect = new SkillEffect[idArray.Length];
            for (int i = 0; i < idArray.Length; i++)
            {
                int         id = idArray[i];
                Hashtable   skillEffectArray = actor.GetSkillEffect();
                SkillEffect effect           = skillEffectArray[id] as SkillEffect;
                skillEffect[i] = effect;
            }
        }
        object effectHitPoint = stateData["sSkillEffectHitPoint[8]"];

        if (effectHitPoint != null)
        {
            skillEffectHitPoint = (int[])effectHitPoint;
        }

        // 有特殊攻击动作则使用,否则使用默认攻击动作aa
        string kSkillAnimation = stateData["animation"] as string;

        if (kSkillAnimation != null && kSkillAnimation != "")
        {
            info = kSkillAnimation;
        }
        else
        {
            info = "skill01";
        }


        WeaponTrailLife = (int)stateData["WeaponTrailLife"];
        bCalcDamage     = ((int)stateData["CalcDamage"] == 1);
    }
Esempio n. 2
0
    public void checkDeathHitPoint(sdGameActor _gameActor)
    {
        if (_gameActor == null || _gameActor.AnimController == null)
        {
            return;
        }
        if (this != _gameActor.logicTSM.die)
        {
            return;
        }
        if (skillEffect == null)
        {
            object deathEffect = _gameActor.GetProperty()["DeathEffect"];
            if (deathEffect == null)
            {
                return;
            }
            int[] effectArray = null;
            if (deathEffect.GetType() == typeof(int))
            {
                effectArray = new int[1] {
                    (int)deathEffect
                };
            }
            else
            {
                effectArray = (int[])deathEffect;
            }

            skillEffect = new SkillEffect[effectArray.Length];
            for (int i = 0; i < effectArray.Length; i++)
            {
                int         id = effectArray[i];
                Hashtable   skillEffectArray = _gameActor.GetSkillEffect();
                SkillEffect effect           = skillEffectArray[id] as SkillEffect;
                skillEffect[i] = effect;
            }
        }

        object hitpoint = _gameActor.GetProperty()["DeathHitPoint"];

        if (hitpoint == null)
        {
            return;
        }


        if (skillEffectHitPoint == null)
        {
            object deathEffectHitPoint = _gameActor.GetProperty()["sSkillEffectHitPoint"];
            if (deathEffectHitPoint != null)
            {
                skillEffectHitPoint = null;
                if (deathEffectHitPoint.GetType() == typeof(int))
                {
                    skillEffectHitPoint = new int[1] {
                        (int)deathEffectHitPoint
                    };
                }
                else
                {
                    skillEffectHitPoint = (int[])deathEffectHitPoint;
                }
            }
        }


        AnimationState aniStateTemp = aniState;

        if (aniStateTemp == null)
        {
            return;
        }

        {
            object  hitPointData = hitpoint;
            float[] hitPoints    = null;
            if (hitPointData.GetType().IsArray)
            {
                hitPoints = (float[])hitPointData;
            }
            else
            {
                hitPoints = new float[1] {
                    (float)(int)hitPointData
                };
            }
            float fCompareTime = aniStateTemp.normalizedTime;
            fCompareTime -= Mathf.Floor(fCompareTime);
            for (int k = 0; k < hitPoints.Length; ++k)
            {
                float testPoint = hitPoints[k] * 0.0001f;

                if (testPoint > _gameActor.PreviousTime && testPoint <= fCompareTime)
                {
                    if (sdGameLevel.instance != null && sdGameLevel.instance.battleSystem != null)
                    {
                        AddSkillEffect(
                            _gameActor,
                            HeaderProto.ESkillTimingConditionType.SKILL_TIMING_CONDITION_TYPE_HIT,
                            k + 1,
                            skillEffect,
                            skillEffectHitPoint,
                            null,
                            0);


                        CallStateEvent(eStateEventType.eSET_hit);
                    }
                }
            }
            _gameActor.PreviousTime = fCompareTime;
        }
    }