예제 #1
0
        /// <summary>
        /// 根据神兽ID取得技能攻击的特效
        /// </summary>
        /// <param name="beastId"></param>
        /// <param name="attackerEffectId"></param>
        /// <param name="beAttackerEffectId"></param>
        /// <returns></returns>
        public bool GetEffectId(long beastId, ref int attackerEffectId, ref int beAttackerEffectId)
        {
            Beast beast = Singleton <BeastManager> .singleton.GetBeastById(beastId);

            if (null == beast)
            {
                return(false);
            }
            //如果普通攻击的话,要根据神兽类型id * 100取得DataSkillShow
            else if (this.m_unskillId == 1)
            {
                DataSkillShow data = beast.GetSkillShow(beast.BeastTypeId * 100);
                if (data != null)
                {
                    attackerEffectId   = data.AttackerEffectId;
                    beAttackerEffectId = data.BeAttackerEffectId;
                    return(true);
                }
                else
                {
                    this.m_log.Debug("找不到该技能");
                }
            }
            else
            {
                DataSkillShow data = beast.GetSkillShow(this.m_unskillId);
                if (data != null)
                {
                    attackerEffectId   = data.AttackerEffectId;
                    beAttackerEffectId = data.BeAttackerEffectId;
                    return(true);
                }
            }
            return(false);
        }
예제 #2
0
    /// <summary>
    /// 创建摄像机移动特效
    /// </summary>
    /// <param name="fStartTime"></param>
    /// <param name="fAnimCtrlEndtime"></param>
    /// <param name="data"></param>
    /// <returns></returns>
    private float BuildCameraAnimShow(float fStartTime, ref float fAnimCtrlEndtime, DataSkillShow data)
    {
        float time = fStartTime;

        if (data != null)
        {
            if (this.CameraAnimEft == 0)
            {
                if (data.CameraMove == 1)
                {
                    this.record = new CameraMoveRecord();
                    CameraGoTrigger cameraGoTrigger = new CameraGoTrigger();
                    cameraGoTrigger.record         = this.record;
                    cameraGoTrigger.StartTime      = time;
                    cameraGoTrigger.AttackerId     = this.AttackerId;
                    cameraGoTrigger.BeAttackIdList = this.BeAttackerList;
                    cameraGoTrigger.Duration       = data.CameraMoveDurationTime;
                    base.AddEvent(cameraGoTrigger);
                    time = cameraGoTrigger.StartTime + cameraGoTrigger.Duration;
                }
            }
            else
            {
                CameraAnimTrigger cameraAnimTrigger = new CameraAnimTrigger();
                cameraAnimTrigger.StartTime = time;
                cameraAnimTrigger.EffectId  = this.CameraAnimEft;
                cameraAnimTrigger.PlayerId  = this.AttackerId;
                cameraAnimTrigger.Duration  = cameraAnimTrigger.GetDuration();
                base.AddEvent(cameraAnimTrigger);
                fAnimCtrlEndtime = cameraAnimTrigger.StartTime + EffectManager.Instance.GetEffectCameraControlTime(this.CameraAnimEft);
                time             = cameraAnimTrigger.StartTime + EffectManager.Instance.GetEffectCameraControlDelay(this.CameraAnimEft);
            }
        }
        return(time);
    }
예제 #3
0
        public virtual void OnCastSkillEffect(CastSkillParam castSkillParam)
        {
            if (castSkillParam != null)
            {
                Beast beast = Singleton <BeastManager> .singleton.GetBeastById(castSkillParam.m_unMasterBeastId);

                if (beast != null)
                {
                    DataSkillShow data             = beast.GetSkillShow(this.m_unskillId);
                    int           attackEffectId   = 0;
                    int           beAttackEffectId = 0;
                    this.GetEffectId(beast.Id, ref attackEffectId, ref beAttackEffectId);
                    if (castSkillParam.listTargetRoleID.Count == 1)
                    {
                        this.m_nEffectId = EffectManager.Instance.PlayEffect(attackEffectId, beast.Id,
                                                                             Hexagon.GetHex3DPos(this.GetHeroPosByCastSkillParam(castSkillParam), Space.World)
                                                                             , null, castSkillParam.listTargetRoleID[0],
                                                                             Hexagon.GetHex3DPos(castSkillParam.vec3TargetPos, Space.World), null, Vector3.zero);
                    }
                    if (data != null && data.IsEffectForward)
                    {
                        this.AdjustAttackDirection(castSkillParam, beast);
                    }
                }
            }
        }
예제 #4
0
    /// <summary>
    /// 开始屏幕模糊
    /// </summary>
    /// <param name="fStartTime"></param>
    /// <param name="dataSkillShow"></param>
    /// <param name="bEnter"></param>
    /// <returns></returns>
    private float BuildScreenBlurShow(float fStartTime, DataSkillShow dataSkillShow, bool bEnter)
    {
        float time = fStartTime;

        if (dataSkillShow != null)
        {
            if (dataSkillShow.ScreenBlur == 1)
            {
                ScreenBlurTrigger screenBlurTrigger = new ScreenBlurTrigger();
                screenBlurTrigger.m_vAffectedPlayer.AddRange(this.BeAttackerList);
                if (!screenBlurTrigger.m_vAffectedPlayer.Contains(this.AttackerId))
                {
                    screenBlurTrigger.m_vAffectedPlayer.Add(this.AttackerId);
                }
                screenBlurTrigger.StartTime     = time;
                screenBlurTrigger.bindPlayerID  = this.AttackerId;
                screenBlurTrigger.endDisable    = !bEnter;
                screenBlurTrigger.m_fStartAlpha = (bEnter ? 0f : (dataSkillShow.BlackDepth * 0.5f));
                screenBlurTrigger.m_fEndAlpha   = (bEnter ? (dataSkillShow.BlackDepth * 0.5f) : 0f);
                screenBlurTrigger.Duration      = (bEnter ? dataSkillShow.ScreenBlurDurationTime1 : dataSkillShow.ScreenBlurDurationTime2);
                base.AddEvent(screenBlurTrigger);
                time = screenBlurTrigger.StartTime + screenBlurTrigger.Duration;
            }
        }
        return(time);
    }
예제 #5
0
    public override void Trigger()
    {
        int attackEftId   = 0;
        int beAttackEftId = 0;

        SkillGameManager.GetSkillAttackEffectId(this.SkillId, this.AttackerId, ref attackEftId, ref beAttackEftId);
        Beast beast = Singleton <BeastManager> .singleton.GetBeastById(this.AttackerId);

        if (beast != null)
        {
            DataSkillShow data = beast.GetSkillShow(this.SkillId);
            if (!this.MainBeAttacker && data != null)
            {
                if (data.SubHitEffectId != 0)
                {
                    beAttackEftId = data.SubHitEffectId;
                }
            }
            if (bShowMissEffect)
            {
                //显示MIss漂浮字样
            }
            else if (beAttackEftId > 0)
            {
                //取得被攻击者的位置,然后播放特效
                Vector3 vTargetPos = this.BeAttackPos.Count > 0 ? Hexagon.GetHex3DPos(this.BeAttackPos[0], Space.World) : Vector3.zero;
                EffectManager.Instance.PlayEffect(beAttackEftId,
                                                  this.BeAttackerId, Vector3.zero, null, 0L, vTargetPos, null, Vector3.zero);
            }
        }
    }
예제 #6
0
    /// <summary>
    /// 根据技能id取得技能Show的数据
    /// </summary>
    /// <param name="skillId"></param>
    /// <returns></returns>
    public DataSkillShow GetSkillShow(int skillId)
    {
        //按理来讲应该和皮肤结合起来取得不同的skill
        DataSkillShow data = null;

        //如果是普通攻击,那么就返回普通攻击的DataSkillShow的数据,具体的索引是根据神兽的类型id * 100来取得的
        if (skillId == 1)
        {
            data = GameData <DataSkillShow> .dataMap[this.m_dwBeastTypeId * 100];
        }
        else
        {
            data = GameData <DataSkillShow> .dataMap[skillId];
        }
        return(data);
    }
예제 #7
0
    public float BuildSkillAction()
    {
        float allTime       = this.LastAnimEndTime;
        float fLastAnimTime = this.LastAnimEndTime;
        Beast attackBeast   = Singleton <BeastManager> .singleton.GetBeastById(this.AttackerId);

        DataSkillShow data;

        if (attackBeast != null)
        {
            data = attackBeast.GetSkillShow(this.SkillId);
        }
        else
        {
            data = new DataSkillShow();
        }
        //allTime = this.BuildScreenBlurShow(allTime, data, true);
        //float fCameraAnimEndTime = 0f;
        //allTime = this.BuildCameraAnimShow(allTime, ref fCameraAnimEndTime, data);
        this.BuildAttackSkillAnimShow(allTime, ref fLastAnimTime, data);
        float fSkillEffectTime = this.BuildAttackSkillEffectShow(allTime);

        this.BuildAttackPosChangeShow(allTime, ref fLastAnimTime, data);
        bool flag           = true;
        bool beAttackEffect = data != null && data.BeAttackEffectHitPoint;

        foreach (long current in this.BeAttackerList)
        {
            float fBeAttackAnimStartTime = 0;
            float beAttackTime           = this.BuildBeAttackSkillAnimShow(current, allTime, flag, data, ref fBeAttackAnimStartTime);
            if (beAttackEffect)
            {
                fSkillEffectTime = fBeAttackAnimStartTime;
            }
            this.BuildBeAttackSkillEffectShow(fSkillEffectTime, true, current);
            float beAttackPosChangeTime = this.BuildBeAttackPosChangeShow(current, allTime, data, ref fLastAnimTime);
            float time = Mathf.Max(beAttackTime, beAttackPosChangeTime);
            time    = this.BuildBeAttackDeadShow(current, time);
            flag    = false;
            allTime = Mathf.Max(allTime, time);
        }
        return(allTime);
    }
예제 #8
0
    /// <summary>
    /// 创建摄像机震动的特效表现
    /// </summary>
    /// <param name="fStartTime"></param>
    /// <param name="data"></param>
    private float BuildCameraShakeShow(float fStartTime, DataSkillShow data)
    {
        float allTime = fStartTime;

        if (this.CameraAnimEft == 0)
        {
            if (data != null && data.CameraMove == 1)
            {
                CameraBackSmoothTrigger trigger = new CameraBackSmoothTrigger();
                trigger.AttackerId = this.AttackerId;
                trigger.record     = this.record;
                trigger.StartTime  = fStartTime;
                trigger.Duration   = data.CameraMoveDurationTime;
                base.AddEvent(trigger);
                allTime = Mathf.Max(allTime, trigger.StartTime + trigger.Duration);
            }
        }
        return(allTime);
    }
예제 #9
0
    /// <summary>
    /// 创建被攻击者位置改变表现
    /// </summary>
    /// <param name="beAttackId"></param>
    /// <param name="fStartTime"></param>
    /// <param name="data"></param>
    /// <param name="fAnimEndTime"></param>
    /// <returns></returns>
    private float BuildBeAttackPosChangeShow(long beAttackId, float fStartTime, DataSkillShow data, ref float fAnimEndTime)
    {
        float   allTime     = fStartTime;
        float   delayTime   = data == null ? 0f : data.BeAttackJumpStartDelayTime;
        Vector3 vec3DestPos = (this.BeAttackPosList.Count > 0) ? Hexagon.GetHex3DPos(this.BeAttackPosList[0], Space.World) : Vector3.zero;
        float   hitTime     = SkillGameManager.GetSkillHitTime(this.SkillId, this.AttackerId, beAttackId, vec3DestPos, EffectInstanceType.Trace);

        if (this.BeAttackerPosChanges.ContainsKey(beAttackId))
        {
            foreach (var current in this.BeAttackerPosChanges[beAttackId])
            {
                ChangePosTrigger trigger = new ChangePosTrigger();
                trigger.SkillId              = this.SkillId;
                trigger.TargetPlayerID       = this.AttackerId;
                trigger.controlData.type     = current.type;
                trigger.controlData.PlayerId = current.PlayerId;
                trigger.controlData.DestPos.AddRange(current.DestPos);
                trigger.IsForward = SkillGameManager.IsBeAttackForward(this.SkillId);
                if (null != data)
                {
                    trigger.JumpEndAnim  = data.BeAttackJumpEndAnim;
                    trigger.JumpDuraAnim = data.BeAttackJumpDuraAnim;
                    if (current.type == ChangePosType.e_Jump)
                    {
                        trigger.Jumptime = ((data.BeAttackJumpSpeed <= 0f) ? data.BeAttackJumpTime : (this.GetDistanceByPos(current.DestPos[0]) / data.BeAttackJumpSpeed));
                        trigger.Height   = data.BeAttackJumpHeight;
                        trigger.EffectId = data.BeAttackJumpEffect;
                    }
                    else if (current.type == ChangePosType.e_Walk)
                    {
                        trigger.EffectId = data.BeAttackJumpEffect;
                    }
                }
                trigger.StartTime = allTime + delayTime + hitTime;
                trigger.Duration  = trigger.GetDuration();
                base.AddEvent(trigger);
                allTime      = trigger.StartTime + trigger.Duration;
                fAnimEndTime = allTime;
            }
        }
        return(allTime);
    }
예제 #10
0
    /// <summary>
    /// 攻击者技能攻击动画的表现,返回攻击动作的时间
    /// </summary>
    /// <param name="fStartTime"></param>
    /// <param name="fAnimEndTime"></param>
    /// <param name="data"></param>
    /// <returns></returns>
    private float BuildAttackSkillAnimShow(float fStartTime, ref float fAnimEndTime, DataSkillShow data)
    {
        float time = fStartTime;

        if (data != null)
        {
            float delayTime            = data.AttackAnimStartDelayTime > 0 ? data.AttackAnimStartDelayTime : 0f;
            AttackSkillTrigger trigger = new AttackSkillTrigger();
            trigger.SkillId       = this.SkillId;
            trigger.AttackerId    = this.AttackerId;
            trigger.BeAttackerId  = this.BeAttackerList;
            trigger.BeAttackerPos = this.BeAttackPosList;
            trigger.StartTime     = time + delayTime;
            trigger.Duration      = trigger.GetDuration();
            base.AddEvent(trigger);
            time         = trigger.StartTime + trigger.Duration;
            fAnimEndTime = time;
        }
        return(time);
    }
예제 #11
0
    /// <summary>
    /// 创建攻击者位置改变表现
    /// </summary>
    /// <param name="fStartTime"></param>
    /// <param name="fAnimEndTime"></param>
    /// <param name="dataSkillShow"></param>
    /// <returns></returns>
    private float BuildAttackPosChangeShow(float fStartTime, ref float fAnimEndTime, DataSkillShow dataSkillShow)
    {
        float time      = fStartTime;
        float delayTime = dataSkillShow == null ? 0f : dataSkillShow.AttackJumpStartDelayTime;

        foreach (var current in this.AttackerPosChanges)
        {
            ChangePosTrigger trigger = new ChangePosTrigger();
            trigger.controlData = current;
            trigger.StartTime   = time + delayTime;
            if (dataSkillShow != null)
            {
                trigger.JumpEndAnim  = dataSkillShow.AttackJumpEndAnim;
                trigger.JumpDuraAnim = dataSkillShow.AttackJumpDuraAnim;
                if (current.type == ChangePosType.e_Jump)
                {
                    trigger.Jumptime = ((dataSkillShow.AttackJumpSpeed <= 0f) ? dataSkillShow.AttackJumpTime : (this.GetDistanceByPos(current.DestPos[0]) / dataSkillShow.AttackJumpSpeed));
                    trigger.EffectId = dataSkillShow.AttackJumpEffect;
                    trigger.Height   = dataSkillShow.AttackJumpHeight;
                }
                else if (current.type == ChangePosType.e_Walk)
                {
                    trigger.EffectId = dataSkillShow.AttackJumpEffect;
                }
            }
            trigger.Duration  = trigger.GetDuration();
            trigger.SkillId   = this.SkillId;
            trigger.IsForward = SkillGameManager.IsAttackForward(this.SkillId);
            if (!current.IgnoreDuration)
            {
                time         = trigger.StartTime + trigger.Duration + 0.1f;
                fAnimEndTime = time;
            }
            if (this.BeAttackerList.Count > 0 && this.AttackerId != this.BeAttackerList[0])
            {
                trigger.TargetPlayerID = this.BeAttackerList[0];
            }
            base.AddEvent(trigger);
        }
        return(time);
    }
예제 #12
0
        /// <summary>
        /// 取得技能动作的时间延迟
        /// </summary>
        /// <param name="attakerId"></param>
        /// <param name="beAttacker"></param>
        /// <param name="targetPos"></param>
        /// <returns></returns>
        public virtual float GetDuration(long attakerId, List <long> beAttacker, Vector3 targetPos)
        {
            float result = 0;
            Beast beast  = Singleton <BeastManager> .singleton.GetBeastById(attakerId);

            if (beast != null)
            {
                DataSkillShow data = beast.GetSkillShow(this.m_unskillId);
                if (data != null && data.SkillAction == 1)
                {
                    if (string.IsNullOrEmpty(data.AttackAction))
                    {
                        result = beast.GetAnimPlayTime(this.GetSkillAnimName(attakerId));
                    }
                    else
                    {
                        result = beast.GetAnimPlayTime(data.AttackAction);
                    }
                }
            }
            return(result);
        }
예제 #13
0
        /// <summary>
        /// 技能释放表现
        /// </summary>
        /// <param name="param"></param>
        public virtual void OnCastAction(CastSkillParam param)
        {
            if (param != null)
            {
                long masterBeastId = param.m_unMasterBeastId;
                XLog.Log.Debug("OnCast:" + this.m_unskillId);
                Beast beast = Singleton <BeastManager> .singleton.GetBeastById(masterBeastId);

                if (beast != null)
                {
                    DataSkillShow data = beast.GetSkillShow(this.m_unskillId);
                    if (data != null)
                    {
                        if (this.IsActive)
                        {
                            if (!data.IsEffectForward)
                            {
                                this.AdjustAttackDirection(param, beast);
                            }
                            this.AdjustBeAttackerDirection(param, beast);
                        }
                        if (data.SkillAction == 1)
                        {
                            if (string.IsNullOrEmpty(data.AttackAction))
                            {
                                beast.PlayAnim(this.GetSkillAnimName(masterBeastId));
                            }
                            else
                            {
                                beast.PlayAnim(data.AttackAction);
                            }
                        }
                    }
                }
            }
        }
예제 #14
0
    private float BuildBeAttackSkillAnimShow(long beAttacker, float fStartTime, bool bMainBeAttack, DataSkillShow data, ref float fBeAttackStartTime)
    {
        float allTime = fStartTime;

        if (data != null)
        {
            Debug.Log("f32f3");
            Vector3 pos     = this.BeAttackPosList.Count > 0 ? Hexagon.GetHex3DPos(this.BeAttackPosList[0], Space.World) : Vector3.zero;
            float   hitTime = 0;
            //如果是普通攻击的话
            if (this.SkillId == 1)
            {
                hitTime = SkillGameManager.GetSkillHitTime(this.SkillId, this.AttackerId, beAttacker, pos);
            }
            else
            {
                //如果是技能的话
                hitTime = SkillGameManager.GetSkillHitTime(this.SkillId, this.AttackerId, beAttacker, pos, EffectInstanceType.Trace);
                if (data.AttackJumpSpeed > 0)
                {
                    hitTime += this.GetDistanceByTargetBeastId(beAttacker) / data.AttackJumpSpeed;
                }
            }
            float beAttackAnimStartDelayTime = data.AttackAnimStartDelayTime;
            allTime           += beAttackAnimStartDelayTime + hitTime;
            fBeAttackStartTime = allTime;
            if (this.HpChangeInfo.ContainsKey(beAttacker))
            {
                Debug.Log("3f2332");
                bool ShowAnim = false;
                if (!this.MissInfo.Contains(beAttacker))
                {
                    for (int i = 0; i < this.HpChangeInfo[beAttacker].Count; i++)
                    {
                        KeyValuePair <int, int> keyValuePair = this.HpChangeInfo[beAttacker][i];
                        if (keyValuePair.Key < keyValuePair.Value)
                        {
                            ShowAnim = true;
                        }
                    }
                }
                //配置文件里面配置被攻击者是否被攻击次数多次,如果不是就是默认1次
                int      attackCount = data.BeAttackCount > 0 ? data.BeAttackCount : 1;
                string[] arrayTime   = string.IsNullOrEmpty(data.BeAttackSpaceTime) ? new string[0] : data.BeAttackSpaceTime.Split(';');
                for (int i = 0; i < attackCount; i++)
                {
                    Debug.Log("ff23f23rfwecw");
                    BeAttackSkillTrigger trigger = new BeAttackSkillTrigger();
                    trigger.AttackerId   = this.AttackerId;
                    trigger.BeAttackerId = beAttacker;
                    trigger.StartTime    = allTime;
                    if (arrayTime.Length > 0)
                    {
                        trigger.IsSpaceAnim = i < attackCount - 1;
                        float duration = 0;
                        if (i < arrayTime.Length)
                        {
                            float.TryParse(arrayTime[i], out duration);
                        }
                        trigger.Duration = duration;
                    }
                    else if (data.BeAttackDuraTime > 0)
                    {
                        trigger.IsDuraAnim = true;
                        trigger.Duration   = data.BeAttackDuraTime;
                    }
                    else
                    {
                        trigger.Duration = trigger.GetDuration();
                    }
                    trigger.MainBeAttcker = beAttacker;
                    trigger.ShowAnim      = ShowAnim;
                    if (this.HpChangeInfo[beAttacker].Count > 0)
                    {
                        trigger.HpChange = this.HpChangeInfo[beAttacker][0].Key - this.HpChangeInfo[beAttacker][0].Value;
                    }
                    base.AddEvent(trigger);
                    if (i == attackCount - 1)
                    {
                        float fStartTime1 = data.BeAttackDuraTime > 0 ? trigger.StartTime + trigger.Duration : allTime;
                        this.BuildHpChangeShow(fStartTime1, beAttacker);
                    }
                    allTime = trigger.StartTime + trigger.Duration;
                }
            }
        }
        return(allTime);
    }