Compare commits
3 Commits
8e03d3e27d
...
6575630649
Author | SHA1 | Date |
---|---|---|
baz | 6575630649 | |
baz | ed3747037c | |
baz | e1ae4f60a8 |
BIN
Content/ParticleEffects/BulletImpact/NS_BulletImpact.uasset (Stored with Git LFS)
BIN
Content/ParticleEffects/BulletImpact/NS_BulletImpact.uasset (Stored with Git LFS)
Binary file not shown.
|
@ -144,6 +144,18 @@ void AEnemyCharacter::ProcessHits(TArray<FHitResult> hits, FVector dir)
|
||||||
healthComponent->TakeDamage(Hit.GetActor(), CurrentWeapon->GetWeaponProperties()->WeaponDamage, nullptr,
|
healthComponent->TakeDamage(Hit.GetActor(), CurrentWeapon->GetWeaponProperties()->WeaponDamage, nullptr,
|
||||||
GetController(), this);
|
GetController(), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto character = Cast<ANakatomiCharacter>(Hit.GetActor());
|
||||||
|
|
||||||
|
if (character && character->GetOnDamagedHitNiagaraSystem())
|
||||||
|
{
|
||||||
|
UNiagaraFunctionLibrary::SpawnSystemAtLocation(this,
|
||||||
|
character->GetOnDamagedHitNiagaraSystem(),
|
||||||
|
Hit.ImpactPoint,
|
||||||
|
dir.MirrorByVector(Hit.ImpactNormal).Rotation(),
|
||||||
|
FVector(1),
|
||||||
|
true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto staticMeshComponent = Hit.GetActor()->GetComponentByClass<UStaticMeshComponent>();
|
auto staticMeshComponent = Hit.GetActor()->GetComponentByClass<UStaticMeshComponent>();
|
||||||
|
|
|
@ -257,6 +257,11 @@ bool ANakatomiCharacter::GetCrouched()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UNiagaraSystem* ANakatomiCharacter::GetOnDamagedHitNiagaraSystem()
|
||||||
|
{
|
||||||
|
return OnDamagedHitNiagaraSystem;
|
||||||
|
}
|
||||||
|
|
||||||
void ANakatomiCharacter::CalculateHits(TArray<FHitResult>* hits, FVector* dir)
|
void ANakatomiCharacter::CalculateHits(TArray<FHitResult>* hits, FVector* dir)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,6 +45,9 @@ public:
|
||||||
UPROPERTY(EditDefaultsOnly)
|
UPROPERTY(EditDefaultsOnly)
|
||||||
TArray<UAnimMontage*> OnDamagedHitAnimMontages;
|
TArray<UAnimMontage*> OnDamagedHitAnimMontages;
|
||||||
|
|
||||||
|
UPROPERTY(EditDefaultsOnly)
|
||||||
|
UNiagaraSystem* OnDamagedHitNiagaraSystem;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Meta = (AllowPrivateAccess = "true"))
|
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Meta = (AllowPrivateAccess = "true"))
|
||||||
UNakatomiCMC* NakatomiCMC;
|
UNakatomiCMC* NakatomiCMC;
|
||||||
|
@ -115,6 +118,8 @@ public:
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
bool GetCrouched();
|
bool GetCrouched();
|
||||||
|
|
||||||
|
UNiagaraSystem* GetOnDamagedHitNiagaraSystem();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void CalculateHits(TArray<FHitResult>* hits, FVector* dir);
|
virtual void CalculateHits(TArray<FHitResult>* hits, FVector* dir);
|
||||||
|
|
||||||
|
|
|
@ -407,6 +407,18 @@ void APlayerCharacter::ProcessHits(TArray<FHitResult> hits, FVector dir)
|
||||||
healthComponent->TakeDamage(Hit.GetActor(), CurrentWeapon->GetWeaponProperties()->WeaponDamage, nullptr,
|
healthComponent->TakeDamage(Hit.GetActor(), CurrentWeapon->GetWeaponProperties()->WeaponDamage, nullptr,
|
||||||
GetController(), this);
|
GetController(), this);
|
||||||
|
|
||||||
|
auto character = Cast<ANakatomiCharacter>(Hit.GetActor());
|
||||||
|
|
||||||
|
if (character && character->GetOnDamagedHitNiagaraSystem())
|
||||||
|
{
|
||||||
|
UNiagaraFunctionLibrary::SpawnSystemAtLocation(this,
|
||||||
|
character->GetOnDamagedHitNiagaraSystem(),
|
||||||
|
Hit.ImpactPoint,
|
||||||
|
dir.MirrorByVector(Hit.ImpactNormal).Rotation(),
|
||||||
|
FVector(1),
|
||||||
|
true);
|
||||||
|
}
|
||||||
|
|
||||||
if (!healthComponent->GetIsDead())
|
if (!healthComponent->GetIsDead())
|
||||||
{
|
{
|
||||||
OnEnemyHit.ExecuteIfBound();
|
OnEnemyHit.ExecuteIfBound();
|
||||||
|
|
Loading…
Reference in New Issue