146 - Grenade Throw Montage
This commit is contained in:
parent
b225f72e46
commit
ecf950ba75
|
@ -19,6 +19,7 @@ r.GenerateMeshDistanceFields=True
|
||||||
r.DynamicGlobalIlluminationMethod=1
|
r.DynamicGlobalIlluminationMethod=1
|
||||||
r.ReflectionMethod=1
|
r.ReflectionMethod=1
|
||||||
r.Shadow.Virtual.Enable=1
|
r.Shadow.Virtual.Enable=1
|
||||||
|
r.CustomDepth=3
|
||||||
|
|
||||||
[/Script/WorldPartitionEditor.WorldPartitionEditorSettings]
|
[/Script/WorldPartitionEditor.WorldPartitionEditorSettings]
|
||||||
bEnableWorldPartition=False
|
bEnableWorldPartition=False
|
||||||
|
@ -139,3 +140,7 @@ bMirrorAchievementsToEOS=False
|
||||||
bUseEOSSessions=False
|
bUseEOSSessions=False
|
||||||
bMirrorPresenceToEAS=False
|
bMirrorPresenceToEAS=False
|
||||||
|
|
||||||
|
[/Script/Engine.PhysicsSettings]
|
||||||
|
bSubstepping=True
|
||||||
|
MaxSubstepDeltaTime=0.008000
|
||||||
|
|
||||||
|
|
|
@ -69,6 +69,7 @@ bUseMouseForTouch=False
|
||||||
bEnableMouseSmoothing=True
|
bEnableMouseSmoothing=True
|
||||||
bEnableFOVScaling=True
|
bEnableFOVScaling=True
|
||||||
bCaptureMouseOnLaunch=True
|
bCaptureMouseOnLaunch=True
|
||||||
|
bEnableLegacyInputScales=True
|
||||||
bAlwaysShowTouchInterface=False
|
bAlwaysShowTouchInterface=False
|
||||||
bShowConsoleOnFourFingerTap=True
|
bShowConsoleOnFourFingerTap=True
|
||||||
bEnableGestureRecognizer=False
|
bEnableGestureRecognizer=False
|
||||||
|
@ -83,6 +84,7 @@ DoubleClickTime=0.200000
|
||||||
+ActionMappings=(ActionName="Aim",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=RightMouseButton)
|
+ActionMappings=(ActionName="Aim",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=RightMouseButton)
|
||||||
+ActionMappings=(ActionName="Fire",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=LeftMouseButton)
|
+ActionMappings=(ActionName="Fire",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=LeftMouseButton)
|
||||||
+ActionMappings=(ActionName="Reload",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=R)
|
+ActionMappings=(ActionName="Reload",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=R)
|
||||||
|
+ActionMappings=(ActionName="ThrowGrenade",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=G)
|
||||||
+AxisMappings=(AxisName="MoveForward",Scale=1.000000,Key=W)
|
+AxisMappings=(AxisName="MoveForward",Scale=1.000000,Key=W)
|
||||||
+AxisMappings=(AxisName="MoveForward",Scale=-1.000000,Key=S)
|
+AxisMappings=(AxisName="MoveForward",Scale=-1.000000,Key=S)
|
||||||
+AxisMappings=(AxisName="MoveRight",Scale=1.000000,Key=D)
|
+AxisMappings=(AxisName="MoveRight",Scale=1.000000,Key=D)
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -73,7 +73,7 @@ void UBlasterAnimInstance::NativeUpdateAnimation(float DeltaTime)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bUseFABRIK = BlasterCharacter->GetCombatState() != ECombatState::ECS_Reloading;
|
bUseFABRIK = BlasterCharacter->GetCombatState() == ECombatState::ECS_Unoccupied;
|
||||||
bUseAimOffsets = BlasterCharacter->GetCombatState() != ECombatState::ECS_Reloading && !BlasterCharacter->GetDisableGameplay();
|
bUseAimOffsets = BlasterCharacter->GetCombatState() == ECombatState::ECS_Unoccupied && !BlasterCharacter->GetDisableGameplay();
|
||||||
bTransformRightHand = BlasterCharacter->GetCombatState() != ECombatState::ECS_Reloading && !BlasterCharacter->GetDisableGameplay();
|
bTransformRightHand = BlasterCharacter->GetCombatState() == ECombatState::ECS_Unoccupied && !BlasterCharacter->GetDisableGameplay();
|
||||||
}
|
}
|
||||||
|
|
|
@ -231,6 +231,7 @@ void ABlasterCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputCo
|
||||||
PlayerInputComponent->BindAction("Fire", IE_Pressed, this, &ABlasterCharacter::FireButtonPressed);
|
PlayerInputComponent->BindAction("Fire", IE_Pressed, this, &ABlasterCharacter::FireButtonPressed);
|
||||||
PlayerInputComponent->BindAction("Fire", IE_Released, this, &ABlasterCharacter::FireButtonReleased);
|
PlayerInputComponent->BindAction("Fire", IE_Released, this, &ABlasterCharacter::FireButtonReleased);
|
||||||
PlayerInputComponent->BindAction("Reload", IE_Pressed, this, &ABlasterCharacter::ReloadButtonPressed);
|
PlayerInputComponent->BindAction("Reload", IE_Pressed, this, &ABlasterCharacter::ReloadButtonPressed);
|
||||||
|
PlayerInputComponent->BindAction("ThrowGrenade", IE_Pressed, this, &ABlasterCharacter::GrenadeButtonPressed);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ABlasterCharacter::PostInitializeComponents()
|
void ABlasterCharacter::PostInitializeComponents()
|
||||||
|
@ -307,6 +308,15 @@ void ABlasterCharacter::PlayEliminatedMontage()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ABlasterCharacter::PlayThrowGrenadeMontage()
|
||||||
|
{
|
||||||
|
UAnimInstance* AnimInstance = GetMesh()->GetAnimInstance();
|
||||||
|
if (AnimInstance && ThrowGrenadeMontage)
|
||||||
|
{
|
||||||
|
AnimInstance->Montage_Play(ThrowGrenadeMontage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ABlasterCharacter::PlayHitReactMontage()
|
void ABlasterCharacter::PlayHitReactMontage()
|
||||||
{
|
{
|
||||||
if (Combat == nullptr || Combat->EquippedWeapon == nullptr) return;
|
if (Combat == nullptr || Combat->EquippedWeapon == nullptr) return;
|
||||||
|
@ -434,6 +444,14 @@ void ABlasterCharacter::AimButtonReleased()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ABlasterCharacter::GrenadeButtonPressed()
|
||||||
|
{
|
||||||
|
if (Combat)
|
||||||
|
{
|
||||||
|
Combat->ThrowGrenade();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
float ABlasterCharacter::CalculateSpeed()
|
float ABlasterCharacter::CalculateSpeed()
|
||||||
{
|
{
|
||||||
FVector Velocity = GetVelocity();
|
FVector Velocity = GetVelocity();
|
||||||
|
|
|
@ -28,6 +28,7 @@ public:
|
||||||
void PlayFireMontage(bool bAiming);
|
void PlayFireMontage(bool bAiming);
|
||||||
void PlayReloadMontage();
|
void PlayReloadMontage();
|
||||||
void PlayEliminatedMontage();
|
void PlayEliminatedMontage();
|
||||||
|
void PlayThrowGrenadeMontage();
|
||||||
|
|
||||||
void Eliminated();
|
void Eliminated();
|
||||||
|
|
||||||
|
@ -52,6 +53,7 @@ protected:
|
||||||
void CrouchButtonPressed();
|
void CrouchButtonPressed();
|
||||||
void AimButtonPressed();
|
void AimButtonPressed();
|
||||||
void AimButtonReleased();
|
void AimButtonReleased();
|
||||||
|
void GrenadeButtonPressed();
|
||||||
void CalculateAO_Pitch();
|
void CalculateAO_Pitch();
|
||||||
void AimOffset(float DeltaTime);
|
void AimOffset(float DeltaTime);
|
||||||
void SimProxiesTurn();
|
void SimProxiesTurn();
|
||||||
|
@ -115,6 +117,9 @@ private:
|
||||||
UPROPERTY(EditAnywhere, Category = Combat)
|
UPROPERTY(EditAnywhere, Category = Combat)
|
||||||
class UAnimMontage* EliminatedMontage;
|
class UAnimMontage* EliminatedMontage;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, Category = Combat)
|
||||||
|
class UAnimMontage* ThrowGrenadeMontage;
|
||||||
|
|
||||||
void HideCameraIfCharacterClose();
|
void HideCameraIfCharacterClose();
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere)
|
UPROPERTY(EditAnywhere)
|
||||||
|
|
|
@ -146,6 +146,7 @@ void UCombatComponent::MulticastFire_Implementation(const FVector_NetQuantize& T
|
||||||
void UCombatComponent::EquipWeapon(AWeapon* WeaponToEquip)
|
void UCombatComponent::EquipWeapon(AWeapon* WeaponToEquip)
|
||||||
{
|
{
|
||||||
if (Character == nullptr || WeaponToEquip == nullptr) return;
|
if (Character == nullptr || WeaponToEquip == nullptr) return;
|
||||||
|
if (CombatState != ECombatState::ECS_Unoccupied) return;
|
||||||
if (EquippedWeapon)
|
if (EquippedWeapon)
|
||||||
{
|
{
|
||||||
EquippedWeapon->Dropped();
|
EquippedWeapon->Dropped();
|
||||||
|
@ -191,7 +192,7 @@ void UCombatComponent::EquipWeapon(AWeapon* WeaponToEquip)
|
||||||
|
|
||||||
void UCombatComponent::Reload()
|
void UCombatComponent::Reload()
|
||||||
{
|
{
|
||||||
if (CarriedAmmo > 0 && CombatState != ECombatState::ECS_Reloading)
|
if (CarriedAmmo > 0 && CombatState == ECombatState::ECS_Unoccupied)
|
||||||
{
|
{
|
||||||
ServerReload();
|
ServerReload();
|
||||||
}
|
}
|
||||||
|
@ -271,6 +272,11 @@ void UCombatComponent::JumpToShotgunEnd()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UCombatComponent::ThrowGrenadeFinished()
|
||||||
|
{
|
||||||
|
CombatState = ECombatState::ECS_Unoccupied;
|
||||||
|
}
|
||||||
|
|
||||||
void UCombatComponent::OnRep_CombatState()
|
void UCombatComponent::OnRep_CombatState()
|
||||||
{
|
{
|
||||||
switch (CombatState)
|
switch (CombatState)
|
||||||
|
@ -284,6 +290,12 @@ void UCombatComponent::OnRep_CombatState()
|
||||||
Fire();
|
Fire();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case ECombatState::ECS_ThrowingGrenade:
|
||||||
|
if (Character && !Character->IsLocallyControlled())
|
||||||
|
{
|
||||||
|
Character->PlayThrowGrenadeMontage();
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -306,6 +318,33 @@ int32 UCombatComponent::AmountToReload()
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UCombatComponent::ThrowGrenade()
|
||||||
|
{
|
||||||
|
if (CombatState != ECombatState::ECS_Unoccupied) return;
|
||||||
|
|
||||||
|
CombatState = ECombatState::ECS_ThrowingGrenade;
|
||||||
|
|
||||||
|
if (Character)
|
||||||
|
{
|
||||||
|
Character->PlayThrowGrenadeMontage();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Character && !Character->HasAuthority())
|
||||||
|
{
|
||||||
|
ServerThrowGrenade();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void UCombatComponent::ServerThrowGrenade_Implementation()
|
||||||
|
{
|
||||||
|
CombatState = ECombatState::ECS_ThrowingGrenade;
|
||||||
|
|
||||||
|
if (Character)
|
||||||
|
{
|
||||||
|
Character->PlayThrowGrenadeMontage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void UCombatComponent::OnRep_EquippedWeapon()
|
void UCombatComponent::OnRep_EquippedWeapon()
|
||||||
{
|
{
|
||||||
if (EquippedWeapon && Character)
|
if (EquippedWeapon && Character)
|
||||||
|
|
|
@ -33,6 +33,9 @@ public:
|
||||||
|
|
||||||
void JumpToShotgunEnd();
|
void JumpToShotgunEnd();
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintCallable)
|
||||||
|
void ThrowGrenadeFinished();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void BeginPlay() override;
|
virtual void BeginPlay() override;
|
||||||
void SetAiming(bool bIsAiming);
|
void SetAiming(bool bIsAiming);
|
||||||
|
@ -59,6 +62,11 @@ protected:
|
||||||
|
|
||||||
void HandleReload();
|
void HandleReload();
|
||||||
int32 AmountToReload();
|
int32 AmountToReload();
|
||||||
|
|
||||||
|
void ThrowGrenade();
|
||||||
|
|
||||||
|
UFUNCTION(Server, Reliable)
|
||||||
|
void ServerThrowGrenade();
|
||||||
private:
|
private:
|
||||||
UPROPERTY()
|
UPROPERTY()
|
||||||
class ABlasterCharacter* Character;
|
class ABlasterCharacter* Character;
|
||||||
|
|
|
@ -5,6 +5,7 @@ enum class ECombatState : uint8
|
||||||
{
|
{
|
||||||
ECS_Unoccupied UMETA(DisplayName = "Unoccupied"),
|
ECS_Unoccupied UMETA(DisplayName = "Unoccupied"),
|
||||||
ECS_Reloading UMETA(DisplayName = "Reloading"),
|
ECS_Reloading UMETA(DisplayName = "Reloading"),
|
||||||
|
ECS_ThrowingGrenade UMETA(DisplayName = "Throwing Grenade"),
|
||||||
|
|
||||||
ECS_MAX UMETA(DisplayName = "DefaultMAX")
|
ECS_MAX UMETA(DisplayName = "DefaultMAX")
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue