// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "GameplayTagAssetInterfacE.h" #include "MInteractableActor.h" #include "GameFramework/Pawn.h" #include "MPlayerMech.generated.h" class UWidgetComponent; class AMCharacter; class UCameraComponent; class UMHealthComponent; class UBoxComponent; class UEnvQuery; class USpringArmComponent; struct FEnvQueryResult; UCLASS() class MECHDEFENCE_API AMPlayerMech : public APawn, public IGameplayTagAssetInterface, public IMInteractableActor { GENERATED_BODY() public: AMPlayerMech(); protected: UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Components") UCameraComponent* CameraComponent; UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Components") USpringArmComponent* SpringArmComponent; UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Components") USkeletalMeshComponent* MeshComponent; UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Components") UWidgetComponent* StatusIndicatorWidget; UPROPERTY(EditDefaultsOnly, Category = "Tags") FGameplayTagContainer ActorTags; UPROPERTY(EditDefaultsOnly, Category = "Mech") float PlayerDismountRadius; UPROPERTY(EditDefaultsOnly, Category = "Mech") FName PlayerAttachmentSocket; UPROPERTY(EditDefaultsOnly, Category = "Mech", meta = (Tooltip = "Offset from the ground to add to the dismount location calculated for the player")) float PlayerDismountGroundOffset; UPROPERTY(EditDefaultsOnly, Category = "Mech", meta = (Tooltip = "Offset from the ground to add to the vehicle when it has been reset")); float ResetZOffset; UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Mech") UMHealthComponent* HealthComponent; UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Mech") UEnvQuery* DismountEQS; UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Mech") USoundBase* MountSound; // Reference to the player that has mounted this mech AMCharacter* MountedPlayerCharacter; virtual void BeginPlay() override; void SetupHealthIndicator(); void MoveForward(float ScaleValue); void MoveRight(float ScaleValue); void RequestDismount(); void RevertOrientation(); void HandleDismountResponse(TSharedPtr QueryResult); public: virtual void Tick(float DeltaTime) override; virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override; void MountPlayerCharacter(AMCharacter* PlayerCharacter); virtual void GetOwnedGameplayTags(FGameplayTagContainer& TagContainer) const override; virtual UMeshComponent* GetHoveredMeshComponent() override; static int32 DebugMechDrawing; };