#pragma once #pragma region CPL License /* Nuclex Unreal Module Copyright (C) 2014-2021 Nuclex Development Labs This library is free software; you can redistribute it and/or modify it under the terms of the IBM Common Public License as published by the IBM Corporation; either version 1.0 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the IBM Common Public License for more details. You should have received a copy of the IBM Common Public License along with this library */ #pragma endregion // CPL License #include #include #include "PlatformerPawnAbilities.generated.h" // --------------------------------------------------------------------------------------------- // /// Stores the abilities of a platformer pawn controlled by the moves system UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent), Blueprintable) class NUCLEX_API UPlatformerPawnAbilities : public UObject { GENERATED_BODY() /// Initializes a new ability definition public: UPlatformerPawnAbilities(); /// Number of jumps the character can do (reset upon ground contact) /// @remarks /// Setting this number to zero prevents the character from jumping at all, /// a value of 1 would allow normal jumping off the ground at 2 would allow /// for one "air-jump" where the character gets an upwards impulse in mid-air. /// /// Running off a platform also counts as one jump, so with this value set to 2, /// after falling off a platform, the character can only jump off in mid-air once. public: UPROPERTY(EditAnywhere, BlueprintReadWrite) int32 JumpCount; /// How high the character can jump with a normal jump in Unreal units /// @remarks /// Player-controlled characters can control their jump high by how long the jump /// key is held. This is the maximum height the character will achieve when /// the jump key is not released until the apex of the jump or later. public: UPROPERTY(EditAnywhere, BlueprintReadWrite) float JumpHeight = 200.0f; #if defined(SUPER_JUMPS) /// How high the character can jump with a super jump /// @remarks /// A super jump is done from when squatting and allows the character to jump /// extra high, but without much horizontal momentum (and leaving the character /// vulnerable while stopping and preparing the jump). public: UPROPERTY(EditAnywhere, BlueprintReadWrite) float SuperJumpHeight = 300.0f; #endif /// How much the character can be controlled during a jump or fall /// @remarks /// A factor of 1.0 means that the player can control the character's horizontal /// movement in the air just as good as on the ground, a factor of 0.0 would prevent /// the player from altering the character's trajectory at all after jumping off. public: UPROPERTY(EditAnywhere, BlueprintReadWrite) float AirControlFactor = 1.0f; /// How fast the character moves horizontally when sneaking /// @remarks /// This is, of course, in Unral units per second public: UPROPERTY(EditAnywhere, BlueprintReadWrite) float SneakingSpeed = 500.0f; /// How fast the character moves horizontally when walking /// @remarks /// This is, of course, in Unral units per second public: UPROPERTY(EditAnywhere, BlueprintReadWrite) float WalkingSpeed = 1000.0f; /// How fast the character moves horizontally when running /// @remarks /// This is, of course, in Unral units per second public: UPROPERTY(EditAnywhere, BlueprintReadWrite) float RunningSpeed = 1500.0f; /// How fast the character moves horizontally when dashing /// @remarks /// This is, of course, in Unral units per second public: UPROPERTY(EditAnywhere, BlueprintReadWrite) float DashingSpeed = 2500.0f; /// How quickly the character accelerates /// @remarks /// This goes for all movement speeds, so if the user holds the sprint key, /// the character will accelerate quicker, still reaching the full speed /// within this time. public: UPROPERTY(EditAnywhere, BlueprintReadWrite) float SecondsToFullSpeed = 0.25f; /// How long the jump button needs to be held for maximum jump height /// @remarks /// If this is set to 0, the actor will always jump to the maximum height /// without allowing the player to make smaller jumps. Other values indicate /// the time for which the player has to hold the jump key to achieve maximum /// height, allowing for smaller jumps by pressing the jump key for a shorter /// duration /// /// This works by 'boosting' the jump during the initial stage (applying /// the required upwards force over a small time frame) rather than /// applying the full force as a single impulse. Having extremely long boost /// durations will not work because public: UPROPERTY(EditAnywhere, BlueprintReadWrite) float JumpBoostDuration = 0.25f; /// Speed at which the character can slide across the floor /// @remarks /// This is an action-movie styled slide where the character throws him/herself /// onto the ground from a run and slides a short distance across the ground, /// possibly clearing an obstacle or evading a bullet. /// /// Setting the required speed to infinity effectively disables floor sliding. public: UPROPERTY(EditAnywhere, BlueprintReadWrite) float SpeedForFloorSlide = 0.0f; /// Whether the character can move extra fast /// @remarks /// This is a simple sprint function that makes the character move faster when /// the player holds the 'sprint' button. public: UPROPERTY(EditAnywhere, BlueprintReadWrite) bool CanSprint = false; /// Whether the character is able to burst into a high speed slide /// /// Dashing is a popular ability made famous by the Megaman games. The character /// will assume a horizontal pose and receive a boost in speed for a short moment, /// allowing him/her to slide under obstacles or cross a gap at high speed. /// public: UPROPERTY(EditAnywhere, BlueprintReadWrite) bool CanDash = false; /// How far the actor will dash when the dash key is pressed public: UPROPERTY(EditAnywhere, BlueprintReadWrite) float DashDistance = 2.0f; /// Whether the character can dash in mid-jump public: UPROPERTY(EditAnywhere, BlueprintReadWrite) bool CanAirDash = false; /// Whether the player can jump off walls public: UPROPERTY(EditAnywhere, BlueprintReadWrite) bool CanWallJump = false; /// Whether the character can slide down on a wall /// @remarks /// If this is set with prohibited, pressing into a wall will /// always have the character slide down said wall. With /// enabled, pressing into the wall will fix the character and sliding will only occur if /// the 'down' key is pressed at the same time. public: UPROPERTY(EditAnywhere, BlueprintReadWrite) bool CanWallSlide = false; #if defined(HAVE_UNITY_ENUMS_PORTED) /// Whether the character is able to hang onto a wall /// @remarks /// How the character handles walls where he/she is able to grab the top of /// the wall with his/her hands. See the documentation of the /// enumeration for an exaplanation of the options. public: UPROPERTY(EditAnywhere, BlueprintReadWrite) LedgeHangMode WallHanging = LedgeHangMode.Prohibit; /// Whether the character is able to hang onto a floating obstacle /// @remarks /// How the character handles floating obstacles he/she is able to grab /// the top of but has no foot support. Things like poles and floating platforms. /// See the documentation of the enumeration for /// an exaplanation of the options. public: UPROPERTY(EditAnywhere, BlueprintReadWrite) LedgeHangMode PoleHanging = LedgeHangMode.Prohibit; #endif // defined(HAVE_UNITY_ENUMS_PORTED) /// Whether the character can squat, lowering his/her height /// @remarks /// This is an ability normally used for bullet avoidal. The character will /// assume a squatting stance (knees bent, upper body upright). Together with /// it could also be used for silent movement. public: UPROPERTY(EditAnywhere, BlueprintReadWrite) bool CanSquat = false; #if defined(HAVE_UNITY_ENUMS_PORTED) /// How movement is handled while the character is squatting /// @remarks /// See the documentation of the enumeration /// for an explanation of the various modes. public: UPROPERTY(EditAnywhere, BlueprintReadWrite) SquatMovementMode SquatMovement = SquatMovementMode.Prohibit; #endif // defined(HAVE_UNITY_ENUMS_PORTED) }; // --------------------------------------------------------------------------------------------- //