135 - Submachine Gun
This commit is contained in:
parent
05ea304d46
commit
4e35bbf8a4
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -273,6 +273,9 @@ void ABlasterCharacter::PlayReloadMontage()
|
|||
case EWeaponType::EWT_Pistol:
|
||||
SectionName = FName("Rifle"); // Todo: create pistol reload montage section
|
||||
break;
|
||||
case EWeaponType::EWT_SubmachineGun:
|
||||
SectionName = FName("Rifle"); // Todo: create SMG reload montage section
|
||||
break;
|
||||
default:
|
||||
SectionName = FName("Rifle");
|
||||
break;
|
||||
|
|
|
@ -457,4 +457,5 @@ void UCombatComponent::InitializeCarriedAmmo()
|
|||
CarriedAmmoMap.Emplace(EWeaponType::EWT_AssaultRifle, StartingARAmmo);
|
||||
CarriedAmmoMap.Emplace(EWeaponType::EWT_RocketLauncher, StartingRocketAmmo);
|
||||
CarriedAmmoMap.Emplace(EWeaponType::EWT_Pistol, StartingPistolAmmo);
|
||||
CarriedAmmoMap.Emplace(EWeaponType::EWT_SubmachineGun, StartingSMGAmmo);
|
||||
}
|
||||
|
|
|
@ -129,6 +129,9 @@ private:
|
|||
UPROPERTY(EditAnywhere)
|
||||
int32 StartingPistolAmmo = 15;
|
||||
|
||||
UPROPERTY(EditAnywhere)
|
||||
int32 StartingSMGAmmo = 15;
|
||||
|
||||
void InitializeCarriedAmmo();
|
||||
|
||||
UPROPERTY(ReplicatedUsing=OnRep_CombatState)
|
||||
|
|
|
@ -58,6 +58,15 @@ void AHitScanWeapon::Fire(const FVector& HitTarget)
|
|||
FireHit.ImpactNormal.Rotation()
|
||||
);
|
||||
}
|
||||
|
||||
if (HitSound)
|
||||
{
|
||||
UGameplayStatics::PlaySoundAtLocation(
|
||||
this,
|
||||
HitSound,
|
||||
FireHit.ImpactPoint
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (BeamParticles)
|
||||
|
@ -73,5 +82,22 @@ void AHitScanWeapon::Fire(const FVector& HitTarget)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (MuzzleFlash)
|
||||
{
|
||||
UGameplayStatics::SpawnEmitterAtLocation(
|
||||
World,
|
||||
MuzzleFlash,
|
||||
SocketTransform
|
||||
);
|
||||
}
|
||||
if (FireSound)
|
||||
{
|
||||
UGameplayStatics::PlaySoundAtLocation(
|
||||
this,
|
||||
FireSound,
|
||||
GetActorLocation()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,4 +29,12 @@ private:
|
|||
UPROPERTY(EditAnywhere)
|
||||
UParticleSystem* BeamParticles;
|
||||
|
||||
UPROPERTY(EditAnywhere)
|
||||
UParticleSystem* MuzzleFlash;
|
||||
|
||||
UPROPERTY(EditAnywhere)
|
||||
USoundCue* FireSound;
|
||||
|
||||
UPROPERTY(EditAnywhere)
|
||||
USoundCue* HitSound;
|
||||
};
|
||||
|
|
|
@ -6,6 +6,7 @@ enum class EWeaponType: uint8
|
|||
EWT_AssaultRifle UMETA(DisplayName="Assault Rifle"),
|
||||
EWT_RocketLauncher UMETA(DisplayName="Rocket Launcher"),
|
||||
EWT_Pistol UMETA(DisplayName="Pistol"),
|
||||
EWT_SubmachineGun UMETA(DisplayName="Submachine Gun"),
|
||||
|
||||
EWT_MAX UMETA(DisplayName="DefaultMAX")
|
||||
};
|
Loading…
Reference in New Issue