presidents-brigade/Source/PresidentsBrigade/BasePawn.h
Sara Montecino 1a864c9a73 Add enemies
2022-11-11 16:44:16 -08:00

89 lines
2.1 KiB
C++
Executable File

// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Pawn.h"
#include "Components/BoxComponent.h"
#include "BasePawn.generated.h"
class UFloatingPawnMovement;
UCLASS()
class PRESIDENTSBRIGADE_API ABasePawn : public APawn
{
GENERATED_BODY()
public:
// Sets default values for this pawn's properties
ABasePawn(const FObjectInitializer &object_initializer);
FVector get_location() const;
// Called every frame
virtual void Tick(float DeltaTime) override;
virtual void handle_move_right(float axis);
virtual void handle_move_forward(float axis);
virtual void shoot();
virtual void handle_death();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
UFUNCTION()
virtual void handle_hit(
UPrimitiveComponent* hit_component,
AActor* other_actor,
UPrimitiveComponent* other_component,
FVector normal_impulse,
const FHitResult& hit
);
virtual UPawnMovementComponent* GetMovementComponent() const;
UPROPERTY(EditAnywhere, Category="Player")
UBoxComponent* collision;
UPROPERTY(EditAnywhere, Category="Player")
UStaticMeshComponent* player_mesh;
UPROPERTY(EditAnywhere, Category="Movement")
UFloatingPawnMovement* movement_component;
/**
* Root component.
*/
UPROPERTY(EditAnywhere, Category="Player")
USceneComponent* root_component;
/**
* Bullet class for projectiles spawned by this object.
*/
UPROPERTY(EditAnywhere, Category = "Attack")
TSubclassOf<class AActor> bullet_actor_class;
/**
* Impact class for death scene.
*/
UPROPERTY(EditAnywhere, Category = "Attack")
TSubclassOf<class AActor> death_class;
/**
* Classes that can do damage to this object.
*/
UPROPERTY(EditAnywhere, Category = "Attack")
TMap<UClass*, int> damage_class_map;
/**
* Maximum health for this characater. Will spawn
* with this amount of health.
*/
UPROPERTY(EditAnywhere, Category = "Attack")
int32 max_health;
/**
* Current health for character.
*/
int32 current_health;
};