예제 #1
0
    public void AbilityResult(pt_scene_skill_effect_c006 _pt)
    {
        HasServerConfirm = true;
        result_list      = _pt.effect_list;
        endPosX          = _pt.shift_x;
        endPosY          = _pt.shift_y;
        endPosZ          = _pt.shift_z;
        runeID           = (int)_pt.rune;
        needHitAnim      = (_pt.effect_sort != (byte)(int)AbilityResultCAUSEType.BUFF);

        if (UserActor != null)
        {
            UserActor.AbilityMove(this);
        }
        for (int i = 0; i < result_list.Count; i++)
        {
            int        instanceID = (int)result_list[i].target_id;
            ObjectType type       = (ObjectType)result_list[i].target_sort;
            ActorInfo  actor      = null;
            switch (type)
            {
            case ObjectType.Player:
                if (instanceID == GameCenter.curMainPlayer.id)
                {
                    actor = GameCenter.mainPlayerMng.MainPlayerInfo;
                }
                if (actor == null)
                {
                    actor = GameCenter.sceneMng.GetOPCInfo(instanceID);
                }
                break;

            case ObjectType.MOB:
                actor = GameCenter.sceneMng.GetMobInfo(instanceID);
                break;

            case ObjectType.Entourage:
                if (GameCenter.curMainEntourage != null && instanceID == GameCenter.curMainEntourage.id)
                {
                    actor = GameCenter.mercenaryMng.curMercernaryInfo;
                }
                else
                {
                    actor = GameCenter.sceneMng.GetEntourageInfo(instanceID);
                }
                break;
            }
            if (actor != null)
            {
                actor.BeInfluencedByOther(this, result_list[i]);
            }
            else
            {
                Debug.LogError("找不到技能承受对象 " + instanceID);
            }
        }
    }
예제 #2
0
    public AbilityInstance(pt_scene_skill_effect_c006 _pt, SmartActor _user)
    {
        abilityID        = (int)_pt.skill;
        runeID           = (int)_pt.rune;
        level            = (int)_pt.lev;
        UserActor        = _user;
        endPosX          = _pt.shift_x;
        endPosY          = _pt.shift_y;
        endPosZ          = _pt.shift_z;
        target           = GameCenter.curGameStage.GetInterActiveObj((int)_pt.target_id) as SmartActor;
        HasServerConfirm = true;
        needPrepare      = false;
        result_list      = _pt.effect_list;
        if (UserActor != null)
        {
            UserActor.AbilityMove(this);
        }
        for (int i = 0; i < result_list.Count; i++)
        {
            int        instanceID = (int)result_list[i].target_id;
            ObjectType type       = (ObjectType)result_list[i].target_sort;
            ActorInfo  actor      = null;

            switch (type)
            {
            case ObjectType.Player:
                if (instanceID == GameCenter.curMainPlayer.id)
                {
                    actor = GameCenter.mainPlayerMng.MainPlayerInfo;
                }
                if (actor == null)
                {
                    actor = GameCenter.sceneMng.GetOPCInfo(instanceID);
                }
                break;

            case ObjectType.MOB:
                actor = GameCenter.sceneMng.GetMobInfo(instanceID);
                break;

            case ObjectType.Entourage:
                if (GameCenter.curMainEntourage != null && instanceID == GameCenter.curMainEntourage.id)
                {
                    actor = GameCenter.mercenaryMng.curMercernaryInfo;
                }
                else
                {
                    actor = GameCenter.sceneMng.GetEntourageInfo(instanceID);
                }
                break;
            }

            if (actor != null)
            {
                actor.BeInfluencedByOther(this, result_list[i]);
            }
            else
            {
                Debug.LogError("找不到技能承受对象 " + instanceID);
            }
        }
    }