Merge branch 'weapon-workbench' into dev
# Conflicts: # EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset # EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/BP_BaseWeapon.uasset # EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp # EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp
This commit is contained in:
		
						commit
						50f4b46549
					
				
							
								
								
									
										
											BIN
										
									
								
								EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/BP_BaseWeapon.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/BP_BaseWeapon.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/BP_BasePistolWeapon.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/BP_BasePistolWeapon.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Shotguns/BP_BaseShotgun.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Shotguns/BP_BaseShotgun.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Snipers/BaseSniper.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Snipers/BaseSniper.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								EndlessVendetta/Content/FirstPerson/Blueprints/DoorBP/BP_Door.uasset
									 (Stored with Git LFS)
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								EndlessVendetta/Content/FirstPerson/Blueprints/DoorBP/BP_Door.uasset
									 (Stored with Git LFS)
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								EndlessVendetta/Content/FirstPerson/Blueprints/DoorBP/WBP_DoorPrompt.uasset
									 (Stored with Git LFS)
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								EndlessVendetta/Content/FirstPerson/Blueprints/DoorBP/WBP_DoorPrompt.uasset
									 (Stored with Git LFS)
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								EndlessVendetta/Content/FirstPerson/Blueprints/DoorPrompt/BP_Door.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								EndlessVendetta/Content/FirstPerson/Blueprints/DoorPrompt/BP_Door.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								EndlessVendetta/Content/FirstPerson/Blueprints/DoorPrompt/WBP_DoorPrompt.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								EndlessVendetta/Content/FirstPerson/Blueprints/DoorPrompt/WBP_DoorPrompt.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/BP_WeaponWorkbench.uasset
									 (Stored with Git LFS)
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/BP_WeaponWorkbench.uasset
									 (Stored with Git LFS)
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/Workbench_UI/WBP_Workbench.uasset
									 (Stored with Git LFS)
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/Workbench_UI/WBP_Workbench.uasset
									 (Stored with Git LFS)
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/0/24/JBARER4CBJ0QZT5CZY8ID6.uasset
									 (Stored with Git LFS)
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/0/24/JBARER4CBJ0QZT5CZY8ID6.uasset
									 (Stored with Git LFS)
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/9/PG/AISD2CY0WTWKV1BJDYTYJ3.uasset
									 (Stored with Git LFS)
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/9/PG/AISD2CY0WTWKV1BJDYTYJ3.uasset
									 (Stored with Git LFS)
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/D/HT/HCK94DMZ442FV8M21GRO0Q.uasset
									 (Stored with Git LFS)
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/D/HT/HCK94DMZ442FV8M21GRO0Q.uasset
									 (Stored with Git LFS)
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							@ -334,6 +334,7 @@ void AEndlessVendettaCharacter::ToggleCombat()
 | 
			
		||||
void AEndlessVendettaCharacter::EquipPrimary()
 | 
			
		||||
{
 | 
			
		||||
	if (PlayerOnShip) return;
 | 
			
		||||
	if (!IsValid(PrimaryWeaponClass)) return;
 | 
			
		||||
	FActorSpawnParameters spawnParams;
 | 
			
		||||
	spawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
 | 
			
		||||
	FAttachmentTransformRules AttachmentRules(EAttachmentRule::SnapToTarget, true);
 | 
			
		||||
@ -385,6 +386,7 @@ void AEndlessVendettaCharacter::EquipPrimary()
 | 
			
		||||
 | 
			
		||||
void AEndlessVendettaCharacter::EquipSecondary()
 | 
			
		||||
{
 | 
			
		||||
	if (!IsValid(SecondaryWeaponClass)) return;
 | 
			
		||||
	if (PlayerOnShip) return;
 | 
			
		||||
	FActorSpawnParameters spawnParams;
 | 
			
		||||
	spawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
 | 
			
		||||
 | 
			
		||||
@ -107,7 +107,9 @@ public:
 | 
			
		||||
	float WalkSpeed;
 | 
			
		||||
	float OriginalWalkSpeed;
 | 
			
		||||
 | 
			
		||||
	UPROPERTY(BlueprintReadWrite)
 | 
			
		||||
	AActor* PrimaryWeaponActor;
 | 
			
		||||
	UPROPERTY(BlueprintReadWrite)
 | 
			
		||||
	AActor* SecondaryWeaponActor;
 | 
			
		||||
	bool bIsPrimaryWeaponCreated = false;
 | 
			
		||||
	bool bIsSecondaryWeaponCreated = false;
 | 
			
		||||
@ -155,13 +157,15 @@ public:
 | 
			
		||||
	UFUNCTION(BlueprintCallable, Category = Weapon)
 | 
			
		||||
	bool GetHasRifle();
 | 
			
		||||
 | 
			
		||||
	UPROPERTY(EditAnywhere, Category = "Weapons")
 | 
			
		||||
	UPROPERTY(EditAnywhere, Category = "Weapons", BlueprintReadWrite)
 | 
			
		||||
	TSubclassOf<ABaseWeaponClass> PrimaryWeaponClass;
 | 
			
		||||
 | 
			
		||||
	UPROPERTY(EditAnywhere, Category = "Weapons")
 | 
			
		||||
	UPROPERTY(EditAnywhere, Category = "Weapons", BlueprintReadWrite)
 | 
			
		||||
	TSubclassOf<ABaseWeaponClass> SecondaryWeaponClass;
 | 
			
		||||
 | 
			
		||||
	UPROPERTY(BlueprintReadWrite)
 | 
			
		||||
	ABaseWeaponClass* PrimaryWeapon;
 | 
			
		||||
	UPROPERTY(BlueprintReadWrite)
 | 
			
		||||
	ABaseWeaponClass* SecondaryWeapon;
 | 
			
		||||
 | 
			
		||||
	UFUNCTION(BlueprintCallable, Category = "Weapons")
 | 
			
		||||
 | 
			
		||||
@ -13,6 +13,7 @@
 | 
			
		||||
#include <EndlessVendetta/EndlessVendettaGameMode.h>
 | 
			
		||||
 | 
			
		||||
#include "EndlessVendetta/BountySystem/ControlsTraining/TargetDummy.h"
 | 
			
		||||
#include "EndlessVendetta/Workbench&Attachments/SilencerAttachmentClass.h"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Sets default values
 | 
			
		||||
@ -254,19 +255,14 @@ void ABaseWeaponClass::InteractPrompt()
 | 
			
		||||
	WeaponStatsPopUp();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// void ABaseWeaponClass::GetOutHit(FHitResult OutHit)
 | 
			
		||||
// {
 | 
			
		||||
// 	if(IsValid(this))
 | 
			
		||||
// 	{
 | 
			
		||||
// 		endlessVendettaChar->PrimaryWeapon->Destroy();
 | 
			
		||||
// 	}
 | 
			
		||||
// 	if (OutHit.GetActor()->ActorHasTag(FName("AssaultRifle")))
 | 
			
		||||
// 	{
 | 
			
		||||
// 		endlessVendettaChar->EquipPrimary();
 | 
			
		||||
// 	}
 | 
			
		||||
// 	AActor* HitActor = Cast<ABaseWeaponClass>(endlessVendettaChar->PrimaryWeaponClass);
 | 
			
		||||
// 	endlessVendettaChar->PrimaryWeapon = Cast<ABaseWeaponClass>(HitActor);
 | 
			
		||||
// }
 | 
			
		||||
void ABaseWeaponClass::SetupSilencerAttachment(UStaticMesh* SilencerMesh)
 | 
			
		||||
{
 | 
			
		||||
	FTransform emptytransform;
 | 
			
		||||
	UActorComponent* SilencerComponent = AddComponentByClass(USilencerAttachmentClass::StaticClass(), true, emptytransform, false);
 | 
			
		||||
	Cast<USilencerAttachmentClass>(SilencerComponent)->AttachToComponent(RootComponent, FAttachmentTransformRules::SnapToTargetIncludingScale);
 | 
			
		||||
	TArray<UActorComponent*> SilencerMeshSocketArray (GetComponentsByTag(UStaticMeshComponent::StaticClass(), FName("SilencerMeshSocket")));
 | 
			
		||||
	Cast<UStaticMeshComponent>(SilencerMeshSocketArray[0])->SetStaticMesh(SilencerMesh);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -176,6 +176,9 @@ public:
 | 
			
		||||
 | 
			
		||||
	//void GetOutHit(FHitResult OutHit);
 | 
			
		||||
 | 
			
		||||
	UFUNCTION(BlueprintCallable)
 | 
			
		||||
	void SetupSilencerAttachment(UStaticMesh* SilencerMesh);
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
	UArrowComponent* GunStartArrow;
 | 
			
		||||
	bool bStopShooting = false;
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,35 @@
 | 
			
		||||
// Fill out your copyright notice in the Description page of Project Settings.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#include "SilencerAttachmentClass.h"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Sets default values for this component's properties
 | 
			
		||||
USilencerAttachmentClass::USilencerAttachmentClass()
 | 
			
		||||
{
 | 
			
		||||
	// Set this component to be initialized when the game starts, and to be ticked every frame.  You can turn these features
 | 
			
		||||
	// off to improve performance if you don't need them.
 | 
			
		||||
	PrimaryComponentTick.bCanEverTick = true;
 | 
			
		||||
 | 
			
		||||
	// ...
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Called when the game starts
 | 
			
		||||
void USilencerAttachmentClass::BeginPlay()
 | 
			
		||||
{
 | 
			
		||||
	Super::BeginPlay();
 | 
			
		||||
 | 
			
		||||
	// ADD THE LOGIC HERE LATER AFTER DEMO TO ACTUALLY MAKE THE GUN "SILENT" EVEN THO WE HAVE NO AUDIO IN THE GAME.
 | 
			
		||||
	
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Called every frame
 | 
			
		||||
void USilencerAttachmentClass::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
 | 
			
		||||
{
 | 
			
		||||
	Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
 | 
			
		||||
 | 
			
		||||
	// ...
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,29 @@
 | 
			
		||||
// Fill out your copyright notice in the Description page of Project Settings.
 | 
			
		||||
 | 
			
		||||
#pragma once
 | 
			
		||||
 | 
			
		||||
#include "CoreMinimal.h"
 | 
			
		||||
#include "Components/SceneComponent.h"
 | 
			
		||||
#include "SilencerAttachmentClass.generated.h"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent))
 | 
			
		||||
class ENDLESSVENDETTA_API USilencerAttachmentClass : public USceneComponent
 | 
			
		||||
{
 | 
			
		||||
	GENERATED_BODY()
 | 
			
		||||
 | 
			
		||||
public:
 | 
			
		||||
	// Sets default values for this component's properties
 | 
			
		||||
	USilencerAttachmentClass();
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
	// Called when the game starts
 | 
			
		||||
	virtual void BeginPlay() override;
 | 
			
		||||
 | 
			
		||||
public:
 | 
			
		||||
	// Called every frame
 | 
			
		||||
	virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
 | 
			
		||||
 | 
			
		||||
	UPROPERTY(EditAnywhere)
 | 
			
		||||
	UStaticMeshComponent* SilencerMesh;
 | 
			
		||||
};
 | 
			
		||||
@ -0,0 +1,38 @@
 | 
			
		||||
// Fill out your copyright notice in the Description page of Project Settings.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#include "WeaponWorkbenchClass.h"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Sets default values
 | 
			
		||||
AWeaponWorkbenchClass::AWeaponWorkbenchClass()
 | 
			
		||||
{
 | 
			
		||||
	// Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
 | 
			
		||||
	PrimaryActorTick.bCanEverTick = true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Called when the game starts or when spawned
 | 
			
		||||
void AWeaponWorkbenchClass::BeginPlay()
 | 
			
		||||
{
 | 
			
		||||
	Super::BeginPlay();
 | 
			
		||||
	PlayerCharacterRef = Cast<AEndlessVendettaCharacter>(GetWorld()->GetFirstPlayerController()->GetCharacter());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Called every frame
 | 
			
		||||
void AWeaponWorkbenchClass::Tick(float DeltaTime)
 | 
			
		||||
{
 | 
			
		||||
	Super::Tick(DeltaTime);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void AWeaponWorkbenchClass::Interact()
 | 
			
		||||
{
 | 
			
		||||
	if (!PlayerCharacterRef->bHasRifle) return;
 | 
			
		||||
	UE_LOG(LogTemp, Display, TEXT("Opening Workbench"));
 | 
			
		||||
	WorkbenchUI();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void AWeaponWorkbenchClass::InteractPrompt()
 | 
			
		||||
{
 | 
			
		||||
	//THIS IS PROMPT WHERE WILL BE PRESS F TO INTERACT OR WHATEVER
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,35 @@
 | 
			
		||||
// Fill out your copyright notice in the Description page of Project Settings.
 | 
			
		||||
 | 
			
		||||
#pragma once
 | 
			
		||||
 | 
			
		||||
#include "CoreMinimal.h"
 | 
			
		||||
#include "EndlessVendetta/EndlessVendettaCharacter.h"
 | 
			
		||||
#include "EndlessVendetta/InteractionInterface.h"
 | 
			
		||||
#include "GameFramework/Actor.h"
 | 
			
		||||
#include "WeaponWorkbenchClass.generated.h"
 | 
			
		||||
 | 
			
		||||
UCLASS()
 | 
			
		||||
class ENDLESSVENDETTA_API AWeaponWorkbenchClass : public AActor, public IInteractionInterface
 | 
			
		||||
{
 | 
			
		||||
	GENERATED_BODY()
 | 
			
		||||
 | 
			
		||||
public:
 | 
			
		||||
	// Sets default values for this actor's properties
 | 
			
		||||
	AWeaponWorkbenchClass();
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
	// Called when the game starts or when spawned
 | 
			
		||||
	virtual void BeginPlay() override;
 | 
			
		||||
 | 
			
		||||
public:
 | 
			
		||||
	// Called every frame
 | 
			
		||||
	virtual void Tick(float DeltaTime) override;
 | 
			
		||||
 | 
			
		||||
	void Interact() override;
 | 
			
		||||
	void InteractPrompt() override;
 | 
			
		||||
 | 
			
		||||
	UFUNCTION(BlueprintImplementableEvent)
 | 
			
		||||
	void WorkbenchUI();
 | 
			
		||||
 | 
			
		||||
	AEndlessVendettaCharacter* PlayerCharacterRef;
 | 
			
		||||
};
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user