Exemplo n.º 1
0
    /// <summary>
    /// 更新战斗属性,主要是移动速度
    /// </summary>
    public void UpdateBattleAttribute()
    {
        if (ParentActor == null)
        {
            return;
        }

        if (mActorAttr != null)
        {
            if (ParentActor.ActorAttribute != null)
            {
                mActorAttr.MoveSpeedScale = (int)(ParentActor.ActorAttribute.MoveSpeedScale);
                mActorAttr.MoveSpeedAdd   = (int)(ParentActor.ActorAttribute.MoveSpeedAdd);
                SetMoveSpeedScale(mActorAttr.MoveSpeedScale * GlobalConst.AttrConvert, mActorAttr.MoveSpeedAdd);
            }
        }

        AnimationOptions op = GetWalkAniOptions();

        if (op != null)
        {
            AnimationOptions parent_actor_walk_options = ParentActor.GetWalkAniOptions();
            if (parent_actor_walk_options != null)
            {
                op.Speed = parent_actor_walk_options.Speed;
            }

            // 护送NPC的走路动作要使用原始速度
            if (IsEscortNPC == true)
            {
                mAnimationSpeed = mOriginalWalkAniSpeed / op.Speed;
                SetAnimationSpeed(mAnimationSpeed);
            }
        }
    }
Exemplo n.º 2
0
    /// <summary>
    /// 更新战斗属性
    /// </summary>
    public virtual void UpdateBattleAttribute()
    {
        if (ParentActor == null)
        {
            return;
        }
        this.AttackSpeed = ParentActor.AttackSpeed;

        mActorAttr.MoveSpeedScale = ParentActor.ActorAttribute.MoveSpeedScale;
        mActorAttr.MoveSpeedAdd   = ParentActor.ActorAttribute.MoveSpeedAdd;

        AnimationOptions parent_actor_walk_options = ParentActor.GetWalkAniOptions();
        AnimationOptions op = GetWalkAniOptions();

        if (op != null && parent_actor_walk_options != null)
        {
            op.Speed = parent_actor_walk_options.Speed;
        }
    }