Implemented weapon hit sounds (normal + critical)
This commit is contained in:
parent
284b9c135d
commit
ae400c39e5
BIN
Content/Legumix/Player/BP_Play.uasset
(Stored with Git LFS)
BIN
Content/Legumix/Player/BP_Play.uasset
(Stored with Git LFS)
Binary file not shown.
@ -158,6 +158,7 @@ void ALMPlayer::FireBullets(const FLMBulletInfo Settings)
|
||||
FVector ShotVector;
|
||||
FHitResult OutHit = FHitResult();
|
||||
bool HitSomething = false;
|
||||
float HighestDamageModifier = 0.f;
|
||||
|
||||
OnFire();
|
||||
|
||||
@ -192,6 +193,8 @@ void ALMPlayer::FireBullets(const FLMBulletInfo Settings)
|
||||
|
||||
HitSomething = true;
|
||||
HitBox->OnHit(Settings, OutHit);
|
||||
if (HitBox->GetDamageModifier() > HighestDamageModifier)
|
||||
HighestDamageModifier = HitBox->GetDamageModifier();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -201,7 +204,7 @@ void ALMPlayer::FireBullets(const FLMBulletInfo Settings)
|
||||
|
||||
if (HitSomething)
|
||||
{
|
||||
OnEnnemyHit();
|
||||
OnEnnemyHit(HighestDamageModifier);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,8 @@ public:
|
||||
UFUNCTION(BlueprintCallable, BlueprintNativeEvent, Category=Legumix)
|
||||
float CalculateDamage(float Damage, float Distance, UCurveFloat* Falloff, float MaxDistance);
|
||||
|
||||
float GetDamageModifier() const { return DamageModifier; }
|
||||
|
||||
public:
|
||||
/** Delegate called when the hitbox is hit.
|
||||
* @param HitBox: The Hitbox that was hit.
|
||||
|
@ -97,7 +97,7 @@ public:
|
||||
void OnAmmoPickup();
|
||||
|
||||
UFUNCTION(BlueprintImplementableEvent)
|
||||
void OnEnnemyHit();
|
||||
void OnEnnemyHit(float DamageModifier);
|
||||
|
||||
UFUNCTION(BlueprintImplementableEvent, Category=Legumix)
|
||||
void OnFire();
|
||||
|
Reference in New Issue
Block a user