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;
|
FVector ShotVector;
|
||||||
FHitResult OutHit = FHitResult();
|
FHitResult OutHit = FHitResult();
|
||||||
bool HitSomething = false;
|
bool HitSomething = false;
|
||||||
|
float HighestDamageModifier = 0.f;
|
||||||
|
|
||||||
OnFire();
|
OnFire();
|
||||||
|
|
||||||
@ -192,6 +193,8 @@ void ALMPlayer::FireBullets(const FLMBulletInfo Settings)
|
|||||||
|
|
||||||
HitSomething = true;
|
HitSomething = true;
|
||||||
HitBox->OnHit(Settings, OutHit);
|
HitBox->OnHit(Settings, OutHit);
|
||||||
|
if (HitBox->GetDamageModifier() > HighestDamageModifier)
|
||||||
|
HighestDamageModifier = HitBox->GetDamageModifier();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -201,7 +204,7 @@ void ALMPlayer::FireBullets(const FLMBulletInfo Settings)
|
|||||||
|
|
||||||
if (HitSomething)
|
if (HitSomething)
|
||||||
{
|
{
|
||||||
OnEnnemyHit();
|
OnEnnemyHit(HighestDamageModifier);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,6 +35,8 @@ public:
|
|||||||
UFUNCTION(BlueprintCallable, BlueprintNativeEvent, Category=Legumix)
|
UFUNCTION(BlueprintCallable, BlueprintNativeEvent, Category=Legumix)
|
||||||
float CalculateDamage(float Damage, float Distance, UCurveFloat* Falloff, float MaxDistance);
|
float CalculateDamage(float Damage, float Distance, UCurveFloat* Falloff, float MaxDistance);
|
||||||
|
|
||||||
|
float GetDamageModifier() const { return DamageModifier; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/** Delegate called when the hitbox is hit.
|
/** Delegate called when the hitbox is hit.
|
||||||
* @param HitBox: The Hitbox that was hit.
|
* @param HitBox: The Hitbox that was hit.
|
||||||
|
@ -97,7 +97,7 @@ public:
|
|||||||
void OnAmmoPickup();
|
void OnAmmoPickup();
|
||||||
|
|
||||||
UFUNCTION(BlueprintImplementableEvent)
|
UFUNCTION(BlueprintImplementableEvent)
|
||||||
void OnEnnemyHit();
|
void OnEnnemyHit(float DamageModifier);
|
||||||
|
|
||||||
UFUNCTION(BlueprintImplementableEvent, Category=Legumix)
|
UFUNCTION(BlueprintImplementableEvent, Category=Legumix)
|
||||||
void OnFire();
|
void OnFire();
|
||||||
|
Reference in New Issue
Block a user