diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/AssaultRifles/Assault_Rifle/BP_AssaultRifle.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/AssaultRifles/Assault_Rifle/BP_AssaultRifle.uasset index 4021dad8..0408d75e 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/AssaultRifles/Assault_Rifle/BP_AssaultRifle.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/AssaultRifles/Assault_Rifle/BP_AssaultRifle.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:eb337be8dced3c95715b4ec5aea6394bdeb4f4a256330a0b1fa16658c44e8f86 -size 144576 +oid sha256:1c8a2905539a08c09f1c657607d4914d6ef02e31cced20cb3acbbab359280adc +size 144333 diff --git a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/BP_BasePistolWeapon_Animated.uasset b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/BP_BasePistolWeapon_Animated.uasset index c17fcf86..aa129d1f 100644 --- a/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/BP_BasePistolWeapon_Animated.uasset +++ b/EndlessVendetta/Content/FirstPerson/Blueprints/BaseWeapons/Pistols/AnimatedPistol/BP_BasePistolWeapon_Animated.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f2d95b940b89ced4dfbb4526ee5deff7e7c1a54f51cb4f500a9d474ce74a6b06 -size 219992 +oid sha256:0d4e9fa7f1883a6cb86a683b88e48aa124951fcff61c3549e189431a20adfa4a +size 219428 diff --git a/EndlessVendetta/Content/Levels/TempLevels/NewTutorialMap.umap b/EndlessVendetta/Content/Levels/TempLevels/NewTutorialMap.umap index 9d517ced..2415c2ca 100644 --- a/EndlessVendetta/Content/Levels/TempLevels/NewTutorialMap.umap +++ b/EndlessVendetta/Content/Levels/TempLevels/NewTutorialMap.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6a612b5dff941aee43df77b5587c939a5e46f162b4de7e1185e2ab4ad7cb1c73 -size 1980003 +oid sha256:a986f15a961c82f2aad7cd7d3c664de7179a4efd946fb2cb08a396facf41d548 +size 1979874 diff --git a/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset b/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset index 0f990580..eccfe898 100644 --- a/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset +++ b/EndlessVendetta/Content/StarterContent/HDRI/HDRI_Epic_Courtyard_Daylight.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bc35eb2d43a47427d30aba0196f9eac90d089dd3abca319528c5d25c83510d0d -size 72364642 +oid sha256:e21529b8bc6eb0a80134783942a0b4f213bb5ecc096688a236427b03fb36c585 +size 66790690 diff --git a/EndlessVendetta/Content/StarterContent/Materials/M_Concrete_Poured.uasset b/EndlessVendetta/Content/StarterContent/Materials/M_Concrete_Poured.uasset index 42e022aa..604f8675 100644 --- a/EndlessVendetta/Content/StarterContent/Materials/M_Concrete_Poured.uasset +++ b/EndlessVendetta/Content/StarterContent/Materials/M_Concrete_Poured.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2aed4da3bb184800c5fc417beae8cb8c0c189643b7ef9e5ad2b3b13b3d3c3ffa -size 31011 +oid sha256:69d453cc3372ddb78381716e4eafa298a39c10564cd6bf4ce6f269f8d5c5001e +size 30606 diff --git a/EndlessVendetta/Content/StarterContent/Materials/M_Rock_Sandstone.uasset b/EndlessVendetta/Content/StarterContent/Materials/M_Rock_Sandstone.uasset index 0f385ed7..f19b524f 100644 --- a/EndlessVendetta/Content/StarterContent/Materials/M_Rock_Sandstone.uasset +++ b/EndlessVendetta/Content/StarterContent/Materials/M_Rock_Sandstone.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ca38836b1f0dd81f0a754eb25babecb100b7ce44d1a577a43f677fb940376032 -size 36843 +oid sha256:3206845341fd89bf1e51a23599d504eea53ea289f6e066df32def3a603095bb3 +size 36603 diff --git a/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset b/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset index e578a0cc..bf2e4391 100644 --- a/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset +++ b/EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1ae833306527449a22484d5936f4581b96676d3ab6398797fcd33d7054df30eb -size 53268 +oid sha256:01ef616c7a8bd90cd1b7a13efb18a56f33346efbae51efa31f09804478b7621d +size 43456 diff --git a/EndlessVendetta/Source/EndlessVendetta/MainSaveGameClass.h b/EndlessVendetta/Source/EndlessVendetta/MainSaveGameClass.h index 41f79711..ba034b70 100644 --- a/EndlessVendetta/Source/EndlessVendetta/MainSaveGameClass.h +++ b/EndlessVendetta/Source/EndlessVendetta/MainSaveGameClass.h @@ -55,4 +55,10 @@ public: UPROPERTY() TArray> OpenWorldCheckpointsClassesSave; + + UPROPERTY() + bool bPistolHasSupressor; + + UPROPERTY() + bool bAssaultSupressor; }; diff --git a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp index 05707c3e..6f8d813f 100644 --- a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.cpp @@ -12,6 +12,8 @@ #include "EndlessVendetta/AI/EnemyCharacter.h" #include +#include "PistolClass.h" +#include "ShotgunClass.h" #include "EndlessVendetta/BountySystem/ControlsTraining/TargetDummy.h" #include "EndlessVendetta/Workbench&Attachments/ExtendedMagAttachmentClass.h" #include "EndlessVendetta/Workbench&Attachments/GripAttachmentClass.h" @@ -49,8 +51,9 @@ void ABaseWeaponClass::BeginPlay() if (!IsValid(endlessVendettaChar)) return; - for (UActorComponent* actorComp : playerInWorld->GetComponentsByTag(UArrowComponent::StaticClass(), - FName("GunStart"))) + + + for (UActorComponent* actorComp : playerInWorld->GetComponentsByTag(UArrowComponent::StaticClass(),FName("GunStart"))) { GunStartArrow = Cast(actorComp); break; @@ -60,6 +63,21 @@ void ABaseWeaponClass::BeginPlay() { playerControllerRef = UGameplayStatics::GetPlayerController(GetWorld(), 0); } + + UEVGameInstance* EV = Cast(GetGameInstance()); + if (!IsValid(EV->MainSaveGameInstanceRef)) return; + if (IsA(APistolClass::StaticClass()) && EV->MainSaveGameInstanceRef->bPistolHasSupressor) + { + FTransform EmptyTransform = FTransform(); + //auto Supressor = Cast(GetWorld()->SpawnActor(SupressorMesh)); + SetupSilencerAttachment(SupressorMesh); + } + else if (EV->MainSaveGameInstanceRef->bPistolHasSupressor) + { + FTransform EmptyTransform = FTransform(); + //auto Supressor = Cast(GetWorld()->SpawnActor(SupressorMesh)); + SetupSilencerAttachment(SupressorMesh); + } } @@ -324,6 +342,19 @@ void ABaseWeaponClass::SetupSilencerAttachment(UStaticMesh* SilencerMesh) StaticMeshComp->CreationMethod = EComponentCreationMethod::Instance; StaticMeshComp->RegisterComponent(); } + UEVGameInstance* EV = Cast(GetGameInstance()); + if (!IsValid(EV->MainSaveGameInstanceRef)) return; + if (IsA(APistolClass::StaticClass())) + { + EV->MainSaveGameInstanceRef->bPistolHasSupressor = true; + UGameplayStatics::SaveGameToSlot(EV->MainSaveGameInstanceRef, "MainSave", 0); + } + else + { + EV->MainSaveGameInstanceRef->bAssaultSupressor = true; + UGameplayStatics::SaveGameToSlot(EV->MainSaveGameInstanceRef, "MainSave", 0); + } + } } } diff --git a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.h b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.h index 45d2f5bc..df4bb1c5 100644 --- a/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.h +++ b/EndlessVendetta/Source/EndlessVendetta/WeaponSystem/BaseWeaponClass.h @@ -23,6 +23,11 @@ public: // Sets default values for this actor's properties ABaseWeaponClass(); + UPROPERTY(EditDefaultsOnly, Category = "Marcel") + UStaticMesh* SupressorMesh; + + + protected: // Called when the game starts or when spawned virtual void BeginPlay() override;