Section 13 complete, Damage numbers, added Block chance and Critical Hit chance

This commit is contained in:
2025-11-09 16:27:22 -05:00
parent 2dbdfa5bf8
commit b51c555d9e
112 changed files with 11164 additions and 9455 deletions

View File

@@ -4,6 +4,7 @@
#include "AbilitySystemBlueprintLibrary.h"
#include "AuraGameplayTags.h"
#include "EnhancedInputSubsystems.h"
#include "MovieSceneTracksComponentTypes.h"
#include "NavigationPath.h"
#include "NavigationSystem.h"
#include "AbilitySystem/AuraAbilitySystemComponent.h"
@@ -11,6 +12,9 @@
#include "Components/SplineComponent.h"
#include "Input/AuraInputComponent.h"
#include "Interact/EnemyInterface.h"
#include "GameFramework/Character.h"
#include "UI/Widget/DamageTextComponent.h"
AAuraPlayerController::AAuraPlayerController()
{
@@ -27,6 +31,18 @@ void AAuraPlayerController::PlayerTick(float DeltaTime)
}
void AAuraPlayerController::ShowDamageNumber_Implementation(float DamageAmount, ACharacter* TargetCharacter, bool bCritical, bool bBlocked)
{
if (IsValid(TargetCharacter) && DamageTextComponentClass)
{
UDamageTextComponent* DamageText = NewObject<UDamageTextComponent>(TargetCharacter, DamageTextComponentClass);
DamageText->RegisterComponent();
DamageText->AttachToComponent(TargetCharacter->GetRootComponent(), FAttachmentTransformRules::KeepRelativeTransform);
DamageText->DetachFromComponent(FDetachmentTransformRules::KeepWorldTransform);
DamageText->SetDamageText(DamageAmount, bCritical, bBlocked);
}
}
void AAuraPlayerController::AutoRun()
{
if (!bAutoRunning) return;
@@ -91,8 +107,8 @@ void AAuraPlayerController::AbilityInputTagReleased(FGameplayTag InputTag)
{
APawn* ControlledPawn = GetPawn();
//Why no Splines?
const FString msg = FString::Printf(TEXT("NavPoints: ActorLoc: %s - CachedLoc: %s"), *ControlledPawn->GetActorLocation().ToString(), *CachedDestination.ToString());
GEngine->AddOnScreenDebugMessage(5,8.f, FColor::Blue,msg);
//const FString msg = FString::Printf(TEXT("NavPoints: ActorLoc: %s - CachedLoc: %s"), *ControlledPawn->GetActorLocation().ToString(), *CachedDestination.ToString());
//GEngine->AddOnScreenDebugMessage(5,8.f, FColor::Blue,msg);
if (FollowTime <= ShortPressThreshold && ControlledPawn)
{
@@ -104,7 +120,7 @@ void AAuraPlayerController::AbilityInputTagReleased(FGameplayTag InputTag)
for (const FVector& PointLoc : NavPath->PathPoints)
{
Spline->AddSplinePoint(PointLoc, ESplineCoordinateSpace::World);
DrawDebugSphere(GetWorld(), PointLoc, 8.f, 8, FColor::Green, false, 5.f);
//DrawDebugSphere(GetWorld(), PointLoc, 8.f, 8, FColor::Green, false, 5.f);
CachedDestination = NavPath->PathPoints.Last();
}
bAutoRunning = true;