Added working ammo count to all weapons
This commit is contained in:
parent
c025d84a90
commit
3c75d16e4b
BIN
EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/AssaultRifles/BP_BaseAssaultRifle.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/AssaultRifles/BP_BaseAssaultRifle.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset
(Stored with Git LFS)
Binary file not shown.
@ -133,6 +133,8 @@ void ABaseWeaponClass::CancelFire()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ABaseWeaponClass::Fire()
|
void ABaseWeaponClass::Fire()
|
||||||
|
{
|
||||||
|
if(MagazineSize > 0)
|
||||||
{
|
{
|
||||||
//do damage fallof based off distance
|
//do damage fallof based off distance
|
||||||
FHitResult outHit;
|
FHitResult outHit;
|
||||||
@ -151,6 +153,8 @@ void ABaseWeaponClass::Fire()
|
|||||||
//Debug line to see where the trace hit
|
//Debug line to see where the trace hit
|
||||||
DrawDebugLine(this->GetWorld(), traceStart, traceEnd, FColor::Red, false, 5.0f, 0U, 2.5f);
|
DrawDebugLine(this->GetWorld(), traceStart, traceEnd, FColor::Red, false, 5.0f, 0U, 2.5f);
|
||||||
playerControllerRef->PlayerCameraManager->StartCameraShake(CameraShakeClass, 1);
|
playerControllerRef->PlayerCameraManager->StartCameraShake(CameraShakeClass, 1);
|
||||||
|
MagazineSize -= 1;
|
||||||
|
UE_LOG(LogTemp, Display, TEXT("Ammo Count: %d"), MagazineSize);
|
||||||
GenerateRecoilVector();
|
GenerateRecoilVector();
|
||||||
ClickDetectionTimer();
|
ClickDetectionTimer();
|
||||||
if (outHit.bBlockingHit)
|
if (outHit.bBlockingHit)
|
||||||
@ -158,6 +162,12 @@ void ABaseWeaponClass::Fire()
|
|||||||
UE_LOG(LogTemp, Display, TEXT("hit item: %s"), *outHit.GetActor()->GetName());
|
UE_LOG(LogTemp, Display, TEXT("hit item: %s"), *outHit.GetActor()->GetName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if(MagazineSize <= 0)
|
||||||
|
{
|
||||||
|
UE_LOG(LogTemp, Display, TEXT("No ammo, Ammo count: %d"), MagazineSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void ABaseWeaponClass::WeaponScopedFire()
|
void ABaseWeaponClass::WeaponScopedFire()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user