diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/BP_BaseWeapon.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/BP_BaseWeapon.uasset index 2ef319e4..d5d8a380 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/BP_BaseWeapon.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/BP_BaseWeapon.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c20c755e25ce7a0993636889cf8bf6196888a85f4428e15eb600c48cb357d5f4 -size 123751 +oid sha256:0e23dc0f3a3090c3b7bcca01e9123e96b564867646215f48b4871eeb8fc157b5 +size 127141 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/BP_BasePistolWeapon.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/BP_BasePistolWeapon.uasset index 4b1c45a0..f516b5b6 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/BP_BasePistolWeapon.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/BP_BasePistolWeapon.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6f31b971cc0237138a2bd8e0aa68d0ac68cac907b0a05aa9617c69883a711cd5 -size 125774 +oid sha256:f9b033aff080a0e32f37aed5b6a02c7e31aa216dc029b70518a5754cd12feb70 +size 127890 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Shotguns/BP_BaseShotgun.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Shotguns/BP_BaseShotgun.uasset index 8e445757..bcb197a6 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Shotguns/BP_BaseShotgun.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Shotguns/BP_BaseShotgun.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d4bcd23aa245c0819235be1d2d992930fed4440aabdafba514d6a1f99a418fcb -size 124531 +oid sha256:678f82f6a80f2cf13d5d74b24d768045b58bb9b030f70510a095a90f40fb0d29 +size 126463 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Snipers/BaseSniper.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Snipers/BaseSniper.uasset index 881c555d..deebf3b8 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Snipers/BaseSniper.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Snipers/BaseSniper.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d3335a1091802c5f484bcc99a573e0cbd388e3cbb586147614ede78c274a14fc -size 124510 +oid sha256:02029898c211501ff276d6996d6fddb8fdbb470aebc1f7f4bb26bfcfbd1928a0 +size 126654 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/DoorBP/BP_Door.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/DoorBP/BP_Door.uasset new file mode 100644 index 00000000..6c55793e --- /dev/null +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/DoorBP/BP_Door.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d577d68165ea935df55d93682617ee4cde6015fd49125424514f6d7f4724246a +size 69897 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/DoorBP/WBP_DoorPrompt.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/DoorBP/WBP_DoorPrompt.uasset new file mode 100644 index 00000000..b55b152d --- /dev/null +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/DoorBP/WBP_DoorPrompt.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b7cff7bcd8f753a0c636853df512555687c1450a25dd908391b55b7589c220ec +size 79813 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/DoorPrompt/BP_Door.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/DoorPrompt/BP_Door.uasset deleted file mode 100644 index 2e39669d..00000000 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/DoorPrompt/BP_Door.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:03cc628cc4a9ab85f3fb7754903bb0b4f5cbf3db50b0cb2044f6812aec991c82 -size 71627 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/DoorPrompt/WBP_DoorPrompt.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/DoorPrompt/WBP_DoorPrompt.uasset deleted file mode 100644 index 5608096e..00000000 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/DoorPrompt/WBP_DoorPrompt.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:dd2cc6201da826cdd7357a5f683f0c9d0638cd2c44ebaab60b6585f1c2659159 -size 81251 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/BP_WeaponWorkbench.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/BP_WeaponWorkbench.uasset new file mode 100644 index 00000000..84b26b2c --- /dev/null +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/BP_WeaponWorkbench.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3dbeac730ab96ed8a3fdb5ed3842fe792784887ee6c342020f708872851b788e +size 49997 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/Workbench_UI/WBP_Workbench.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/Workbench_UI/WBP_Workbench.uasset new file mode 100644 index 00000000..26b8081a --- /dev/null +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/Workbench_WeaponAttachments/Workbench_UI/WBP_Workbench.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8b0b18849fe2fb41c53b6835e8c1d882a5ed56dfa96a403797277280ffd3067b +size 136669 diff --git a/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/0/24/JBARER4CBJ0QZT5CZY8ID6.uasset b/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/0/24/JBARER4CBJ0QZT5CZY8ID6.uasset new file mode 100644 index 00000000..60e887d3 --- /dev/null +++ b/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/0/24/JBARER4CBJ0QZT5CZY8ID6.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:461d223dbbabb2824e1ad8bac0d5732bb55d731e0b74285715f207e458b609f4 +size 6878 diff --git a/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/9/PG/AISD2CY0WTWKV1BJDYTYJ3.uasset b/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/9/PG/AISD2CY0WTWKV1BJDYTYJ3.uasset new file mode 100644 index 00000000..b2990eba --- /dev/null +++ b/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/9/PG/AISD2CY0WTWKV1BJDYTYJ3.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bb7fd3b17bbcc170b84fda39c7712b526f201a4a45ea48d1ac36415e0ca366ee +size 7007 diff --git a/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/D/HT/HCK94DMZ442FV8M21GRO0Q.uasset b/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/D/HT/HCK94DMZ442FV8M21GRO0Q.uasset new file mode 100644 index 00000000..b8758f85 --- /dev/null +++ b/EndlessVendetta/Content/__ExternalActors__/Levels/DoorTestLevel/D/HT/HCK94DMZ442FV8M21GRO0Q.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4eba44b03ff058bd86a49a05814cbb134bd5c24beb99148a7b8e7c2c7e71eb21 +size 5152 diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp index 0e80ae88..fd933101 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp @@ -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; diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h index 3b1c9641..0a0b6a37 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h +++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.h @@ -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 PrimaryWeaponClass; - UPROPERTY(EditAnywhere, Category = "Weapons") + UPROPERTY(EditAnywhere, Category = "Weapons", BlueprintReadWrite) TSubclassOf SecondaryWeaponClass; + UPROPERTY(BlueprintReadWrite) ABaseWeaponClass* PrimaryWeapon; + UPROPERTY(BlueprintReadWrite) ABaseWeaponClass* SecondaryWeapon; UFUNCTION(BlueprintCallable, Category = "Weapons") diff --git a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp index 9d14975d..dde8cb8c 100644 --- a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp @@ -13,6 +13,7 @@ #include #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(endlessVendettaChar->PrimaryWeaponClass); -// endlessVendettaChar->PrimaryWeapon = Cast(HitActor); -// } +void ABaseWeaponClass::SetupSilencerAttachment(UStaticMesh* SilencerMesh) +{ + FTransform emptytransform; + UActorComponent* SilencerComponent = AddComponentByClass(USilencerAttachmentClass::StaticClass(), true, emptytransform, false); + Cast(SilencerComponent)->AttachToComponent(RootComponent, FAttachmentTransformRules::SnapToTargetIncludingScale); + TArray SilencerMeshSocketArray (GetComponentsByTag(UStaticMeshComponent::StaticClass(), FName("SilencerMeshSocket"))); + Cast(SilencerMeshSocketArray[0])->SetStaticMesh(SilencerMesh); +} diff --git a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.h b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.h index 2637e31f..455752b0 100644 --- a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.h +++ b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.h @@ -176,6 +176,9 @@ public: //void GetOutHit(FHitResult OutHit); + UFUNCTION(BlueprintCallable) + void SetupSilencerAttachment(UStaticMesh* SilencerMesh); + protected: UArrowComponent* GunStartArrow; bool bStopShooting = false; diff --git a/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/SilencerAttachmentClass.cpp b/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/SilencerAttachmentClass.cpp new file mode 100644 index 00000000..7f31f73b --- /dev/null +++ b/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/SilencerAttachmentClass.cpp @@ -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); + + // ... +} + diff --git a/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/SilencerAttachmentClass.h b/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/SilencerAttachmentClass.h new file mode 100644 index 00000000..c84b624f --- /dev/null +++ b/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/SilencerAttachmentClass.h @@ -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; +}; diff --git a/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/WeaponWorkbenchClass.cpp b/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/WeaponWorkbenchClass.cpp new file mode 100644 index 00000000..5fbb7457 --- /dev/null +++ b/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/WeaponWorkbenchClass.cpp @@ -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(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 +} + diff --git a/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/WeaponWorkbenchClass.h b/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/WeaponWorkbenchClass.h new file mode 100644 index 00000000..c1e54793 --- /dev/null +++ b/EndlessVendetta/Source/EndlessVendetta/Workbench&Attachments/WeaponWorkbenchClass.h @@ -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; +};