Exemplo n.º 1
0
    public PlayerCombatMovement(MonoBehaviour monoBehaviour,
                                BasicCollisionHandler playerCollisionHandler,
                                PlayerController playerController, PlayerStatusVariables playerStatusVariables,
                                PlayerStatusController playerStatusController, PlayerHorizontalMovement playerHorizontalMovement,
                                Inventory inventory,
                                float cqcDistance, float cqcDamage, float offsetForThrowableItemPosition,
                                float rangeForShortThrowableItemPosition) : base(
            monoBehaviour)
    {
        this.playerStatusVariables    = playerStatusVariables;
        this.playerStatusController   = playerStatusController;
        this.playerHorizontalMovement = playerHorizontalMovement;
        this.monoBehaviour            = monoBehaviour;
        this.playerController         = playerController;
        this.playerCollisionHandler   = playerCollisionHandler;
        this.inventory  = inventory;
        this.collider2D = monoBehaviour.GetComponent <Collider2D>();
        this.offsetForThrowableItemPosition     = offsetForThrowableItemPosition;
        this.rangeForShortThrowableItemPosition = rangeForShortThrowableItemPosition;
        this.cqcDistance = cqcDistance;
        this.cqcDamage   = cqcDamage;

        this.throwableItemPosition =
            new Vector3(playerCollisionHandler.BoxColliderBounds.topRight.x + offsetForThrowableItemPosition,
                        playerCollisionHandler.BoxColliderBounds.topRight.y);
    }
Exemplo n.º 2
0
    void Start()
    {
        //PlayerStatusVariables = new PlayerStatusVariables();
        PlayerStatusVariables  = GetComponent <PlayerStatusVariables>();
        PlayerStatusController = GetComponent <PlayerStatusController>();

        PlayerCollisionHandler = new BasicCollisionHandler(this, maxAngle, layerMaskForCollisions);

        PlayerController = new PlayerController(transform);

        HorizontalMovement = new PlayerHorizontalMovement(this, maxSpeed, acceleration,
                                                          dodgeForce, crouchingSpeed, PlayerCollisionHandler, PlayerController, PlayerStatusVariables,
                                                          PlayerStatusController);

        VerticalMovement = new PlayerVerticalMovement(this, jumpForce, climbingLadderSmoothness,
                                                      climbingObstacleSmoothness, climbLadderVelocity, minimumFallingDistanceForDamage, minimumDamageForFalling,
                                                      PlayerCollisionHandler,
                                                      PlayerController,
                                                      PlayerStatusVariables, PlayerStatusController);

        MiscellaneousMovement = new PlayerMiscellaneousMovement(this, cameraZoomSize, PlayerCollisionHandler,
                                                                PlayerController,
                                                                PlayerStatusVariables, Inventory, diary, InGameMenuController);

        CombatMovement = new PlayerCombatMovement(this, PlayerCollisionHandler, PlayerController,
                                                  PlayerStatusVariables, PlayerStatusController, HorizontalMovement, Inventory, cqcDistance, cqcDamage,
                                                  offsetForThrowableItemPosition,
                                                  rangeForShortThrowableItemPosition);
    }
Exemplo n.º 3
0
 public ApostleHorizontalMovement(MonoBehaviour monoBehaviour,
                                  float maxSpeed, float acceleration, BasicCollisionHandler apostleCollisionHandler,
                                  ApostleController apostleController, ApostleStatusVariables apostleStatusVariables) : base(monoBehaviour)
 {
     this.apostleStatusVariables = apostleStatusVariables;
     this.monoBehaviour          = monoBehaviour;
     this.maxSpeed                = maxSpeed;
     this.acceleration            = acceleration;
     this.apostleController       = apostleController;
     this.apostleCollisionHandler = apostleCollisionHandler;
 }
Exemplo n.º 4
0
    private void Start()
    {
        var apostleManager = GetComponent <ApostleManager>();

        this.apostleCollisionHandler = apostleManager.ApostleCollisionHandler;
        this.apostleStatusVariables  = apostleManager.ApostleStatusVariables;
        if (GameManager.instance.NavigationAcessor == null)
        {
            GameManager.instance.NavigationAcessor =
                GameObject.FindGameObjectWithTag("Navigation").GetComponent <Navigation>();
        }
        navigation = GameManager.instance.NavigationAcessor;
        CreateTriggerArea();

        startPointPatrolInfo =
            new PatrolPointInfo(startPointTransform, startPointFloorCollider, startPointTransitionFloorType,
                                navigation);

        endPointPatrolInfo =
            new PatrolPointInfo(endPointTransform, endPointFloorCollider, endPointTransitionFloorType, navigation);

        patrolTransitionFloorList = new List <TransitionFloor>();


        var teste = new List <Floor>();

        navigation.CalculatePath(startPointPatrolInfo.currentFloor, endPointPatrolInfo.currentFloor, teste);
        foreach (var floor in teste)
        {
            Debug.Log(floor);
        }
        currentAimNode = new NavigationNode(startPointTransform, TransitionFloorType.None, null);

        navigationNodes = new List <NavigationNode>
        {
            new NavigationNode(startPointTransform, TransitionFloorType.None, null),
            new NavigationNode(endPointTransform, TransitionFloorType.None, null),
        };

        foreach (var transitionFloor in patrolTransitionFloorList)
        {
            if (transitionFloor.transform == null)
            {
                continue;
            }

            navigationNodes.Insert(
                navigationNodes.FindIndex(lambdaExpression => lambdaExpression.transform == endPointTransform),
                new NavigationNode(transitionFloor.transform, transitionFloor.type, transitionFloor.floors));
        }
    }
 public PlayerMiscellaneousMovement(MonoBehaviour monoBehaviour, float cameraZoomSize,
                                    BasicCollisionHandler playerCollisionHandler,
                                    PlayerController playerController, PlayerStatusVariables playerStatusVariables, Inventory inventory,
                                    Diary diary,
                                    InGameMenuController inGameMenuController) : base(
         monoBehaviour)
 {
     this.playerController       = playerController;
     this.playerCollisionHandler = playerCollisionHandler;
     this.playerStatusVariables  = playerStatusVariables;
     this.inventory            = inventory;
     this.diary                = diary;
     this.inGameMenuController = inGameMenuController;
     this.cameraZoomSize       = cameraZoomSize;
 }
Exemplo n.º 6
0
 public PlayerHorizontalMovement(MonoBehaviour monoBehaviour,
                                 float maxSpeed, float acceleration,
                                 float dodgeForce, float crouchingSpeed, BasicCollisionHandler playerCollisionHandler,
                                 PlayerController playerController, PlayerStatusVariables playerStatusVariables,
                                 PlayerStatusController player) : base(
         monoBehaviour)
 {
     this.playerStatusVariables = playerStatusVariables;
     this.monoBehaviour         = monoBehaviour;
     this.maxSpeed               = maxSpeed;
     this.acceleration           = acceleration;
     this.dodgeForce             = dodgeForce;
     this.crouchingSpeed         = crouchingSpeed;
     this.characterHeight        = capsuleCollider2D.bounds.size.y;
     this.playerController       = playerController;
     this.playerCollisionHandler = playerCollisionHandler;
     this.player             = player;
     this.VelocityMultiplier = 1f;
 }
Exemplo n.º 7
0
 public ApostleVerticalMovement(MonoBehaviour monoBehaviour,
                                float climbingLadderSmoothness,
                                float climbingObstacleSmoothness, float climbLadderVelocity, float minimumFallingDistanceForDamage
                                , float minimumDamageForFalling,
                                BasicCollisionHandler apostleCollisionHandler,
                                ApostleController apostleController, ApostleStatusVariables apostleStatusVariables,
                                Enemy apostle) : base(
         monoBehaviour)
 {
     this.apostleStatusVariables          = apostleStatusVariables;
     this.apostleCollisionHandler         = apostleCollisionHandler;
     this.apostleController               = apostleController;
     this.climbingLadderSmoothness        = climbingLadderSmoothness;
     this.climbingObstacleSmoothness      = climbingObstacleSmoothness;
     this.minimumFallingDistanceForDamage = minimumFallingDistanceForDamage;
     this.minimumDamageForFalling         = minimumDamageForFalling;
     this.currentGravityScale             = rigidbody2D.gravityScale;
     this.climbLadderVelocity             = climbLadderVelocity;
     this.apostle = apostle;
 }
Exemplo n.º 8
0
 public PlayerVerticalMovement(MonoBehaviour monoBehaviour,
                               float jumpForce, float climbingLadderSmoothness,
                               float climbingObstacleSmoothness, float climbLadderVelocity, float minimumFallingDistanceForDamage
                               , float minimumDamageForFalling,
                               BasicCollisionHandler playerCollisionHandler,
                               PlayerController playerController, PlayerStatusVariables playerStatusVariables,
                               PlayerStatusController player) : base(
         monoBehaviour)
 {
     this.playerStatusVariables  = playerStatusVariables;
     this.playerCollisionHandler = playerCollisionHandler;
     this.playerController       = playerController;
     this.jumpForce = jumpForce;
     this.climbingLadderSmoothness        = climbingLadderSmoothness;
     this.climbingObstacleSmoothness      = climbingObstacleSmoothness;
     this.minimumFallingDistanceForDamage = minimumFallingDistanceForDamage;
     this.minimumDamageForFalling         = minimumDamageForFalling;
     this.currentGravityScale             = rigidbody2D.gravityScale;
     this.climbLadderVelocity             = climbLadderVelocity;
     this.player = player;
 }
Exemplo n.º 9
0
    void Start()
    {
        ApostleStatusVariables = GetComponent <ApostleStatusVariables>();
        Apostle             = GetComponent <Enemy>();
        ApostleInputHandler = GetComponent <ApostleInputHandler>();

        ApostleCollisionHandler =
            new BasicCollisionHandler(this, maxAngle, layerMaskForCollisions);


        ApostleController = new ApostleController(this, ApostleInputHandler);

        HorizontalMovement = new ApostleHorizontalMovement(this, maxSpeed, acceleration, ApostleCollisionHandler,
                                                           ApostleController,
                                                           ApostleStatusVariables);

        VerticalMovement =
            new ApostleVerticalMovement(this, climbingLadderSmoothness, climbingObstacleSmoothness, climbLadderVelocity,
                                        minimumFallingDistanceForDamage, minimumDamageForFalling, ApostleCollisionHandler, ApostleController,
                                        ApostleStatusVariables, Apostle);
    }