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.
@ -134,6 +134,8 @@ void ABaseWeaponClass::CancelFire()
|
||||
|
||||
void ABaseWeaponClass::Fire()
|
||||
{
|
||||
if(MagazineSize > 0)
|
||||
{
|
||||
//do damage fallof based off distance
|
||||
FHitResult outHit;
|
||||
FVector traceStart;
|
||||
@ -151,12 +153,20 @@ void ABaseWeaponClass::Fire()
|
||||
//Debug line to see where the trace hit
|
||||
DrawDebugLine(this->GetWorld(), traceStart, traceEnd, FColor::Red, false, 5.0f, 0U, 2.5f);
|
||||
playerControllerRef->PlayerCameraManager->StartCameraShake(CameraShakeClass, 1);
|
||||
MagazineSize -= 1;
|
||||
UE_LOG(LogTemp, Display, TEXT("Ammo Count: %d"), MagazineSize);
|
||||
GenerateRecoilVector();
|
||||
ClickDetectionTimer();
|
||||
if (outHit.bBlockingHit)
|
||||
{
|
||||
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()
|
||||
|
Loading…
Reference in New Issue
Block a user