Пример #1
0
    public float GetHitTime()
    {
        Vector3 vDestPos = (this.ListBeAttackPos.Count > 0) ? Hexagon.GetHex3DPos(this.ListBeAttackPos[0], Space.World) : Vector3.zero;
        long    targetId = (this.ListBeAttackerId.Count > 0) ? this.ListBeAttackerId[0] : 0u;

        return(SkillGameManager.GetSkillHitTime(this.SkillID, this.AttackerId, targetId, vDestPos));
    }
Пример #2
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);
    }
Пример #3
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);
    }
Пример #4
0
    public float GetHitTime()
    {
        Vector3 vDestPos = this.BeAttackPos.Count > 0 ? Hexagon.GetHex3DPos(this.BeAttackPos[0], Space.World) : Vector3.zero;

        return(SkillGameManager.GetSkillHitTime(this.SkillId, this.AttackerId, this.BeAttackerId, vDestPos));
    }