Ejemplo n.º 1
0
    protected void UseItemInCover(E_ItemID gadget, E_CoverPose coverPose, E_CoverDirection coverDirection, uLink.NetworkMessageInfo info)
    {
        if (Owner.BlackBoard.DontUpdate)
        {
            return;
        }

#if !DEADZONE_CLIENT
        if (Owner.IsServer)
        {
            ServerAnticheat.ReportUseItemInCover(Owner.NetworkView.owner, gadget, coverPose, coverDirection, info);
            Owner.NetworkView.RPC("UseItemInCover", uLink.RPCMode.OthersExceptOwner, gadget, coverPose, coverDirection);
        }
#endif

        Owner.BlackBoard.KeepMotion     = false;
        Owner.BlackBoard.Desires.Gadget = gadget;

        AgentActionUseItem a = AgentActionFactory.Create(AgentActionFactory.E_Type.UseItem) as AgentActionUseItem;

        a.CoverDirection = coverDirection;
        a.CoverPose      = coverPose;

        Owner.BlackBoard.ActionAdd(a);

        Owner.WorldState.SetWSProperty(E_PropKey.AtTargetPos, true);
    }
Ejemplo n.º 2
0
    public override string GetCoverAnim(E_CoverAnim type, E_CoverPose pose, E_CoverDirection direction)
    {
        switch (type)
        {
        case E_CoverAnim.Enter:
            return(pose == E_CoverPose.Stand ? "CoverStandEnter" : "CoverCrouchEnter");

        case E_CoverAnim.Leave:
            return(pose == E_CoverPose.Stand ? "CoverStandLeave" : "CoverCrouchLeave");

        case E_CoverAnim.AimStart:
            switch (direction)
            {
            case E_CoverDirection.Left:
                return(pose == E_CoverPose.Stand ? "CoverStandAimLeftStart" : "CoverCrouchAimLeftStart");

            case E_CoverDirection.Right:
                return(pose == E_CoverPose.Stand ? "CoverStandAimRightStart" : "CoverCrouchAimRightStart");

            default:
                return(pose == E_CoverPose.Stand ? "" : "CoverCrouchAimCenterStart");
            }

        case E_CoverAnim.AimEnd:
            switch (direction)
            {
            case E_CoverDirection.Left:
                return(pose == E_CoverPose.Stand ? "CoverStandAimLeftBack" : "CoverCrouchAimLeftBack");

            case E_CoverDirection.Right:
                return(pose == E_CoverPose.Stand ? "CoverStandAimRightBack" : "CoverCrouchAimRightBack");

            default:
                return(pose == E_CoverPose.Stand ? "" : "CoverCrouchAimCenterBack");
            }

        case E_CoverAnim.JumpOver:
            return("JumpOverToIdle");

        case E_CoverAnim.JumpUp:
            return("CoverCrouchJumpUp");

        case E_CoverAnim.LeaveLeft:
            return(pose == E_CoverPose.Stand ? "CoverStandLeftLeave" : "CoverCrouchLeftLeave");

        case E_CoverAnim.LeaveRight:
            return(pose == E_CoverPose.Stand ? "CoverStandRightLeave" : "CoverCrouchRightLeave");
        }

        throw new System.ArgumentOutOfRangeException();
    }
Ejemplo n.º 3
0
    public override string GetGadgetAnim(E_ItemID gadget, E_CoverPose coverPose, E_CoverDirection coverDirection)
    {
        ItemSettings setting = ItemSettingsManager.Instance.Get(gadget);

        switch (setting.ItemBehaviour)
        {
// FIX IT
        case E_ItemBehaviour.Throw:
            if (BlackBoard.Cover)
            {
                if (coverDirection == E_CoverDirection.Middle)
                {
                    return(coverPose == E_CoverPose.Stand ? "" : "CoverCrouchThrowCenter");
                }
                else if (coverDirection == E_CoverDirection.Left)
                {
                    return(coverPose == E_CoverPose.Stand ? "CoverStandThrowLeft" : "CoverCrouchThrowLeft");
                }
                else if (coverDirection == E_CoverDirection.Right)
                {
                    return(coverPose == E_CoverPose.Stand ? "CoverStandThrowRight" : "CoverCrouchThrowRight");
                }
            }
            else
            {
                return("RunThrow");                //now we're using the same half-body anim for both idle and move

/*					if ( BlackBoard.MotionType == E_MotionType.Walk || BlackBoard.MotionType == E_MotionType.Run )
 *                                              return "RunThrow";
 *                                      else
 *                      return "IdleThrow";
 */
            }
            break;

        case E_ItemBehaviour.Place:
            return("Drop");
        }

        throw new System.ArgumentOutOfRangeException(" Gadget: " + gadget + " behaviour " + setting.ItemBehaviour);
    }
Ejemplo n.º 4
0
    protected void CoverFireStart(E_CoverPose pose, E_CoverDirection direction, uLink.NetworkMessageInfo info)
    {
        if (Owner.BlackBoard.DontUpdate)
        {
            return;
        }

#if !DEADZONE_CLIENT
        if (Owner.IsServer)
        {
            ServerAnticheat.ReportCoverFireStart(Owner.NetworkView.owner, pose, direction, info);
            Owner.NetworkView.RPC("CoverFireStart", uLink.RPCMode.OthersExceptOwner, pose, direction);
        }
#endif

        if (Owner.IsInCover)
        {
            AgentActionCoverFire action = AgentActionFactory.Create(AgentActionFactory.E_Type.CoverFire) as AgentActionCoverFire;
            action.CoverPose      = pose;
            action.CoverDirection = direction;

            Owner.BlackBoard.ActionAdd(action);
        }
    }
Ejemplo n.º 5
0
 public abstract string GetGadgetAnim(E_ItemID gadget, E_CoverPose pos, E_CoverDirection direction);
Ejemplo n.º 6
0
 public abstract string GetAimAnim(E_AimDirection direction, E_CoverPose pose, E_CoverDirection position);
Ejemplo n.º 7
0
 public abstract string GetCoverAnim(E_CoverAnim type, E_CoverPose pose, E_CoverDirection direction);
Ejemplo n.º 8
0
 public static void ReportUseItemInCover(uLink.NetworkPlayer player, E_ItemID gadget, E_CoverPose coverPose, E_CoverDirection coverDirection, uLink.NetworkMessageInfo info)
 {
 }
Ejemplo n.º 9
0
 public static void ReportCoverFireStart(uLink.NetworkPlayer player, E_CoverPose pose, E_CoverDirection direction, uLink.NetworkMessageInfo info)
 {
 }
Ejemplo n.º 10
0
    public override string GetAimAnim(E_AimDirection direction, E_CoverPose pose, E_CoverDirection position)
    {
        if (BlackBoard.Cover != null)
        {
            switch (direction)
            {
            case E_AimDirection.Left:
                switch (position)
                {
                case E_CoverDirection.Left:
                    return(pose == E_CoverPose.Stand ? "CoverStandAimLeftMaxL" : "CoverCrouchAimLeftMaxL");

                case E_CoverDirection.Right:
                    return(pose == E_CoverPose.Stand ? "CoverStandAimRightMaxL" : "CoverCrouchAimRightMaxL");

                default:
                    return(pose == E_CoverPose.Stand ? "" : "CoverCrouchAimCenterMaxL");
                }

            case E_AimDirection.Right:
                switch (position)
                {
                case E_CoverDirection.Left:
                    return(pose == E_CoverPose.Stand ? "CoverStandAimLeftMaxR" : "CoverCrouchAimLeftMaxR");

                case E_CoverDirection.Right:
                    return(pose == E_CoverPose.Stand ? "CoverStandAimRightMaxR" : "CoverCrouchAimRightMaxR");

                default:
                    return(pose == E_CoverPose.Stand ? "" : "CoverCrouchAimCenterMaxR");
                }

            case E_AimDirection.Up:
                switch (position)
                {
                case E_CoverDirection.Left:
                    return(pose == E_CoverPose.Stand ? "CoverStandAimLeftMaxU" : "CoverCrouchAimLeftMaxU");

                case E_CoverDirection.Right:
                    return(pose == E_CoverPose.Stand ? "CoverStandAimRightMaxU" : "CoverCrouchAimRightMaxU");

                default:
                    return(pose == E_CoverPose.Stand ? "" : "CoverCrouchAimCenterMaxU");
                }

            case E_AimDirection.Down:
                switch (position)
                {
                case E_CoverDirection.Left:
                    return(pose == E_CoverPose.Stand ? "CoverStandAimLeftMaxD" : "CoverCrouchAimLeftMaxD");

                case E_CoverDirection.Right:
                    return(pose == E_CoverPose.Stand ? "CoverStandAimRightMaxD" : "CoverCrouchAimRightMaxD");

                default:
                    return(pose == E_CoverPose.Stand ? "" : "CoverCrouchAimCenterMaxD");
                }
            }
        }
        else
        {
            if (direction == E_AimDirection.Down)
            {
                return("AimD");
            }
            else if (direction == E_AimDirection.Up)
            {
                return("AimU");
            }
        }

        throw new System.ArgumentOutOfRangeException();
    }