This commit is contained in:
Antoine Caru 2025-03-14 17:20:51 +01:00
commit 1682543893
28 changed files with 58 additions and 46 deletions

4
.gitignore vendored
View File

@ -47,8 +47,8 @@ SourceArt/**/*.png
SourceArt/**/*.tga SourceArt/**/*.tga
# Binary Files # Binary Files
#Binaries/* Binaries/*
#Plugins/**/Binaries/* Plugins/**/Binaries/*
# Builds # Builds
Build/* Build/*

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Content/Legumix/Levels/LVL_GYM_00.umap (Stored with Git LFS)

Binary file not shown.

BIN
Content/Legumix/Player/BP_Play.uasset (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Content/Legumix/Weapon/Shotgun/Animations/ABP_Shotgun.uasset (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -2,7 +2,6 @@
#include "LMWaveManager.h" #include "LMWaveManager.h"
#include "IPropertyTable.h"
#include "Components/CapsuleComponent.h" #include "Components/CapsuleComponent.h"
#include "Enemy/LMEnemy.h" #include "Enemy/LMEnemy.h"

View File

@ -58,7 +58,7 @@ void ULMHealthComponent::Kill()
void ULMHealthComponent::HitBoxHit(ULMHitBox* HitBox, const float Damage, const FVector& Origin, const FHitResult& HitInfo) void ULMHealthComponent::HitBoxHit(ULMHitBox* HitBox, const float Damage, const FVector& Origin, const FHitResult& HitInfo)
{ {
TakeDamage(Damage); TakeDamage(Damage);
OnHit(Damage, Origin, HitInfo); OnHit.Broadcast(Damage, Origin, HitInfo);
} }

View File

@ -14,11 +14,15 @@ ULMHitBox::ULMHitBox()
void ULMHitBox::OnHit(const FLMBulletInfo& BulletInfo, const FHitResult& Hit) void ULMHitBox::OnHit(const FLMBulletInfo& BulletInfo, const FHitResult& Hit)
{ {
const float Damage = BulletInfo.Damage;
const double Distance = FVector::Distance(BulletInfo.Origin, GetComponentLocation()); const double Distance = FVector::Distance(BulletInfo.Origin, GetComponentLocation());
const float TotalDamage = CalculateDamage(Damage, Distance, BulletInfo.Falloff, BulletInfo.MaxDistance); const float TotalDamage = CalculateDamage(BulletInfo.Damage, Distance, BulletInfo.Falloff, BulletInfo.MaxDistance);
OnHitBoxHit.Broadcast(this, TotalDamage, BulletInfo.Origin, Hit); OnHitSimple(TotalDamage, BulletInfo.Origin, Hit);
}
void ULMHitBox::OnHitSimple(float const Damage, FVector const Origin, const FHitResult& Hit)
{
OnHitBoxHit.Broadcast(this, Damage, Origin, Hit);
} }
bool ULMHitBox::CanBeHitByTeam(const ETeam Team) const bool ULMHitBox::CanBeHitByTeam(const ETeam Team) const

View File

@ -154,7 +154,6 @@ bool ULMMovementComponent::IsCustomMovementMode(ECustomMovementModes InCustomMov
void ULMMovementComponent::EnterSlide() void ULMMovementComponent::EnterSlide()
{ {
UE_LOG(LogTemp, Error, TEXT("Entering Slide"));
bWantsToCrouch = true; bWantsToCrouch = true;
Velocity += Velocity.GetSafeNormal2D() * SlideEnterImpulse; Velocity += Velocity.GetSafeNormal2D() * SlideEnterImpulse;
SetMovementMode(EMovementMode::MOVE_Custom, ECustomMovementModes::ECMM_Sliding); SetMovementMode(EMovementMode::MOVE_Custom, ECustomMovementModes::ECMM_Sliding);
@ -162,7 +161,6 @@ void ULMMovementComponent::EnterSlide()
void ULMMovementComponent::ExitSlide() void ULMMovementComponent::ExitSlide()
{ {
UE_LOG(LogTemp, Error, TEXT("Exiting Slide"));
bWantsToCrouch = false; bWantsToCrouch = false;
FQuat NewRotation = FRotationMatrix::MakeFromXZ(UpdatedComponent->GetForwardVector().GetSafeNormal2D(), FVector::UpVector).ToQuat(); FQuat NewRotation = FRotationMatrix::MakeFromXZ(UpdatedComponent->GetForwardVector().GetSafeNormal2D(), FVector::UpVector).ToQuat();

View File

@ -30,7 +30,6 @@ void ALMRevolver::PrimaryFire()
return; return;
} }
PlayEvent(FireEvent);
PlayAnimation(PrimaryFireAnimation); PlayAnimation(PrimaryFireAnimation);
Player->PlayAnimation(PrimaryFireArmsAnimation); Player->PlayAnimation(PrimaryFireArmsAnimation);

View File

@ -30,8 +30,8 @@ void ALMShotgun::PrimaryFire()
return; return;
} }
PlayEvent(FireEvent);
PlayAnimation(PrimaryFireAnimation); PlayAnimation(PrimaryFireAnimation);
Player->PlayAnimation(PrimaryFireArmsAnimation);
const FVector Origin = Player->GetWeaponFiringOrigin(); const FVector Origin = Player->GetWeaponFiringOrigin();
const FVector Direction = Player->GetAimVector(); const FVector Direction = Player->GetAimVector();

View File

@ -100,12 +100,13 @@ bool ALMWeaponBase::DefaultReload()
if (ClipAmmo >= MaxClip) if (ClipAmmo >= MaxClip)
return false; return false;
// TODO: replace with anim notifies
PlayEvent(ReloadSound); PlayEvent(ReloadSound);
PlayAnimation(ReloadAnimation); PlayAnimation(ReloadAnimation);
Player->PlayAnimation(ReloadArmsAnimation);
State = EWeaponState::EWS_Reloading; State = EWeaponState::EWS_Reloading;
// TODO: Use Animations
OnDefaultReload(); OnDefaultReload();
GetWorldTimerManager().SetTimer(ReloadTimer, this, &ALMWeaponBase::AllowRefire, ReloadDelay); GetWorldTimerManager().SetTimer(ReloadTimer, this, &ALMWeaponBase::AllowRefire, ReloadDelay);
Player->OnReload(); Player->OnReload();

View File

@ -17,6 +17,7 @@ class LEGUMEMIX_API ULMHealthComponent : public UActorComponent
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnHealthChangedSignature, float, Health, float, Damage); DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnHealthChangedSignature, float, Health, float, Damage);
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnDeathSignature); DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnDeathSignature);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FOnHitSignature, float, Damage, const FVector&, Origin, const FHitResult&, HitInfo);
public: public:
ULMHealthComponent(); ULMHealthComponent();
@ -78,8 +79,8 @@ public:
* @param Origin The origin of the damage. * @param Origin The origin of the damage.
* @param HitInfo The collisions informations. * @param HitInfo The collisions informations.
*/ */
UFUNCTION(BlueprintImplementableEvent, Category=Legumix, meta=(Keywords = "Refill")) UPROPERTY(BlueprintCallable, BlueprintAssignable, Category=Legumix)
void OnHit(float Damage, const FVector& Origin, const FHitResult& HitInfo); FOnHitSignature OnHit;
/** /**
* Completely refill the health of the component. * Completely refill the health of the component.

View File

@ -20,7 +20,12 @@ class LEGUMEMIX_API ULMHitBox : public UCapsuleComponent
public: public:
ULMHitBox(); ULMHitBox();
UFUNCTION(BlueprintCallable, Category=Legumix)
void OnHit(const FLMBulletInfo& BulletInfo, const FHitResult& Hit); void OnHit(const FLMBulletInfo& BulletInfo, const FHitResult& Hit);
UFUNCTION(BlueprintCallable, Category=Legumix)
void OnHitSimple(float const Damage, FVector const Origin, const FHitResult& Hit);
void SetHealthComponent(ULMHealthComponent* NewHealthComponent) { HealthComponent = NewHealthComponent; } void SetHealthComponent(ULMHealthComponent* NewHealthComponent) { HealthComponent = NewHealthComponent; }
bool CanBeHitByTeam(ETeam Team) const; bool CanBeHitByTeam(ETeam Team) const;

View File

@ -72,10 +72,6 @@ protected: /* Weapon Data */
FTimerHandle FireTimer; FTimerHandle FireTimer;
FTimerHandle ReloadTimer; FTimerHandle ReloadTimer;
/** The sound to play when firing. */
UPROPERTY(EditAnywhere, BlueprintReadWrite,Category="Legumix|Sounds")
TObjectPtr<UFMODEvent> FireEvent;
UPROPERTY(EditAnywhere, BlueprintReadWrite,Category="Legumix|Sounds") UPROPERTY(EditAnywhere, BlueprintReadWrite,Category="Legumix|Sounds")
TObjectPtr<UFMODEvent> ReloadSound; TObjectPtr<UFMODEvent> ReloadSound;