diff --git a/Binaries/Win64/LegumeMixEditor.target b/Binaries/Win64/LegumeMixEditor.target index 7b8d3b5..314c033 100644 --- a/Binaries/Win64/LegumeMixEditor.target +++ b/Binaries/Win64/LegumeMixEditor.target @@ -21,6 +21,18 @@ "BuildId": "37670630" }, "BuildProducts": [ + { + "Path": "$(ProjectDir)/Binaries/Win64/UnrealEditor-LegumeMix.dll", + "Type": "DynamicLibrary" + }, + { + "Path": "$(ProjectDir)/Binaries/Win64/UnrealEditor-LegumeMix.pdb", + "Type": "SymbolFile" + }, + { + "Path": "$(ProjectDir)/Binaries/Win64/UnrealEditor.modules", + "Type": "RequiredResource" + }, { "Path": "$(EngineDir)/Binaries/ThirdParty/USD/UsdResources/Win64/plugins/ar/resources/plugInfo.json", "Type": "RequiredResource" @@ -2833,6 +2845,50 @@ "Path": "$(EngineDir)/Plugins/Animation/LiveLink/Binaries/Win64/UnrealEditor.modules", "Type": "RequiredResource" }, + { + "Path": "$(EngineDir)/Plugins/Animation/RigLogic/Binaries/Win64/UnrealEditor-RigLogicDeveloper.dll", + "Type": "DynamicLibrary" + }, + { + "Path": "$(EngineDir)/Plugins/Animation/RigLogic/Binaries/Win64/UnrealEditor-RigLogicEditor.dll", + "Type": "DynamicLibrary" + }, + { + "Path": "$(EngineDir)/Plugins/Animation/RigLogic/Binaries/Win64/UnrealEditor-RigLogicLib.dll", + "Type": "DynamicLibrary" + }, + { + "Path": "$(EngineDir)/Plugins/Animation/RigLogic/Binaries/Win64/UnrealEditor-RigLogicLibTest.dll", + "Type": "DynamicLibrary" + }, + { + "Path": "$(EngineDir)/Plugins/Animation/RigLogic/Binaries/Win64/UnrealEditor-RigLogicModule.dll", + "Type": "DynamicLibrary" + }, + { + "Path": "$(EngineDir)/Plugins/Animation/RigLogic/Binaries/Win64/UnrealEditor.modules", + "Type": "RequiredResource" + }, + { + "Path": "$(EngineDir)/Plugins/Bridge/Binaries/Win64/UnrealEditor-Bridge.dll", + "Type": "DynamicLibrary" + }, + { + "Path": "$(EngineDir)/Plugins/Bridge/Binaries/Win64/UnrealEditor-Bridge.pdb", + "Type": "SymbolFile" + }, + { + "Path": "$(EngineDir)/Plugins/Bridge/Binaries/Win64/UnrealEditor-MegascansPlugin.dll", + "Type": "DynamicLibrary" + }, + { + "Path": "$(EngineDir)/Plugins/Bridge/Binaries/Win64/UnrealEditor-MegascansPlugin.pdb", + "Type": "SymbolFile" + }, + { + "Path": "$(EngineDir)/Plugins/Bridge/Binaries/Win64/UnrealEditor.modules", + "Type": "RequiredResource" + }, { "Path": "$(EngineDir)/Plugins/Cameras/CameraShakePreviewer/Binaries/Win64/UnrealEditor-CameraShakePreviewer.dll", "Type": "DynamicLibrary" @@ -3665,6 +3721,18 @@ "Path": "$(EngineDir)/Plugins/Experimental/MeshModelingToolsetExp/Binaries/Win64/UnrealEditor.modules", "Type": "RequiredResource" }, + { + "Path": "$(EngineDir)/Plugins/Experimental/MetaHuman/MetaHumanSDK/Binaries/Win64/UnrealEditor-MetaHumanSDKEditor.dll", + "Type": "DynamicLibrary" + }, + { + "Path": "$(EngineDir)/Plugins/Experimental/MetaHuman/MetaHumanSDK/Binaries/Win64/UnrealEditor-MetaHumanSDKRuntime.dll", + "Type": "DynamicLibrary" + }, + { + "Path": "$(EngineDir)/Plugins/Experimental/MetaHuman/MetaHumanSDK/Binaries/Win64/UnrealEditor.modules", + "Type": "RequiredResource" + }, { "Path": "$(EngineDir)/Plugins/Experimental/NFORDenoise/Binaries/Win64/UnrealEditor-NFORDenoise.dll", "Type": "DynamicLibrary" @@ -3889,66 +3957,6 @@ "Path": "$(EngineDir)/Plugins/Interchange/Runtime/Binaries/Win64/UnrealEditor.modules", "Type": "RequiredResource" }, - { - "Path": "$(EngineDir)/Plugins/Marketplace/Developer/RiderLink/Binaries/Win64/UnrealEditor-RD.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Marketplace/Developer/RiderLink/Binaries/Win64/UnrealEditor-RD.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Marketplace/Developer/RiderLink/Binaries/Win64/UnrealEditor-RiderBlueprint.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Marketplace/Developer/RiderLink/Binaries/Win64/UnrealEditor-RiderBlueprint.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Marketplace/Developer/RiderLink/Binaries/Win64/UnrealEditor-RiderGameControl.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Marketplace/Developer/RiderLink/Binaries/Win64/UnrealEditor-RiderGameControl.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Marketplace/Developer/RiderLink/Binaries/Win64/UnrealEditor-RiderLC.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Marketplace/Developer/RiderLink/Binaries/Win64/UnrealEditor-RiderLC.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Marketplace/Developer/RiderLink/Binaries/Win64/UnrealEditor-RiderLink.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Marketplace/Developer/RiderLink/Binaries/Win64/UnrealEditor-RiderLink.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Marketplace/Developer/RiderLink/Binaries/Win64/UnrealEditor-RiderLogging.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Marketplace/Developer/RiderLink/Binaries/Win64/UnrealEditor-RiderLogging.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Marketplace/Developer/RiderLink/Binaries/Win64/UnrealEditor-RiderShaderInfo.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(EngineDir)/Plugins/Marketplace/Developer/RiderLink/Binaries/Win64/UnrealEditor-RiderShaderInfo.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(EngineDir)/Plugins/Marketplace/Developer/RiderLink/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" - }, { "Path": "$(EngineDir)/Plugins/Media/AndroidMedia/Binaries/Win64/UnrealEditor-AndroidMediaEditor.dll", "Type": "DynamicLibrary" @@ -4808,21 +4816,13 @@ { "Path": "$(EngineDir)/Plugins/XGEController/Binaries/Win64/UnrealEditor.modules", "Type": "RequiredResource" - }, - { - "Path": "$(ProjectDir)/Binaries/Win64/UnrealEditor-LegumeMix.dll", - "Type": "DynamicLibrary" - }, - { - "Path": "$(ProjectDir)/Binaries/Win64/UnrealEditor-LegumeMix.pdb", - "Type": "SymbolFile" - }, - { - "Path": "$(ProjectDir)/Binaries/Win64/UnrealEditor.modules", - "Type": "RequiredResource" } ], "RuntimeDependencies": [ + { + "Path": "$(ProjectDir)/LegumeMix.uproject", + "Type": "UFS" + }, { "Path": "$(EngineDir)/Binaries/ThirdParty/DbgHelp/dbghelp.dll", "Type": "NonUFS" @@ -29839,6 +29839,14 @@ "Path": "$(EngineDir)/Plugins/Animation/LiveLink/LiveLink.uplugin", "Type": "UFS" }, + { + "Path": "$(EngineDir)/Plugins/Animation/RigLogic/RigLogic.uplugin", + "Type": "UFS" + }, + { + "Path": "$(EngineDir)/Plugins/Bridge/Bridge.uplugin", + "Type": "UFS" + }, { "Path": "$(EngineDir)/Plugins/Cameras/CameraShakePreviewer/CameraShakePreviewer.uplugin", "Type": "UFS" @@ -30179,6 +30187,10 @@ "Path": "$(EngineDir)/Plugins/Experimental/MeshModelingToolsetExp/MeshModelingToolsetExp.uplugin", "Type": "UFS" }, + { + "Path": "$(EngineDir)/Plugins/Experimental/MetaHuman/MetaHumanSDK/MetaHumanSDK.uplugin", + "Type": "UFS" + }, { "Path": "$(EngineDir)/Plugins/Experimental/NFORDenoise/NFORDenoise.uplugin", "Type": "UFS" @@ -30239,10 +30251,6 @@ "Path": "$(EngineDir)/Plugins/Interchange/Runtime/Interchange.uplugin", "Type": "UFS" }, - { - "Path": "$(EngineDir)/Plugins/Marketplace/Developer/RiderLink/RiderLink.uplugin", - "Type": "UFS" - }, { "Path": "$(EngineDir)/Plugins/Media/AndroidMedia/AndroidMedia.uplugin", "Type": "UFS" @@ -30538,10 +30546,6 @@ { "Path": "$(EngineDir)/Plugins/XGEController/XGEController.uplugin", "Type": "UFS" - }, - { - "Path": "$(ProjectDir)/LegumeMix.uproject", - "Type": "UFS" } ], "BuildPlugins": [ @@ -30573,6 +30577,7 @@ "BaseCharacterFXEditor", "BlendSpaceMotionAnalysis", "BlueprintHeaderView", + "Bridge", "CLionSourceCodeAccess", "CableComponent", "CameraShakePreviewer", @@ -30661,6 +30666,7 @@ "MeshModelingToolset", "MeshModelingToolsetExp", "MeshPainting", + "MetaHumanSDK", "Metasound", "MobileLauncherProfileWizard", "MobilePatchingUtils", @@ -30699,8 +30705,8 @@ "RenderDocPlugin", "RenderGraphInsights", "ResonanceAudio", - "RiderLink", "RiderSourceCodeAccess", + "RigLogic", "RigVM", "SQLiteCore", "SequencerAnimTools", diff --git a/Binaries/Win64/UnrealEditor-LegumeMix.exp b/Binaries/Win64/UnrealEditor-LegumeMix.exp index a6c8e31..81cee73 100644 --- a/Binaries/Win64/UnrealEditor-LegumeMix.exp +++ b/Binaries/Win64/UnrealEditor-LegumeMix.exp @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2c7dbeab63810375b3130700a96467f2ff19c4a5ce65ef643464f197fbd48968 -size 21132 +oid sha256:539ff602aa1fa5ccacb50b1125dbb86199c549e0b24a8a7da2c9d4cb814b6f48 +size 34050 diff --git a/Binaries/Win64/UnrealEditor-LegumeMix.pdb b/Binaries/Win64/UnrealEditor-LegumeMix.pdb index 0e11f92..6e57268 100644 --- a/Binaries/Win64/UnrealEditor-LegumeMix.pdb +++ b/Binaries/Win64/UnrealEditor-LegumeMix.pdb @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c9a69dc83569b529cbab9a41a0b4a673d1954c0706a7d4fa86941384f9f7ec04 -size 60411904 +oid sha256:bfcad27449bf4813b3c20458b70d67afde0d17f6abcb3d968291708b64a76bd6 +size 60657664 diff --git a/Content/Legumix/BP_GameMode.uasset b/Content/Legumix/BP_GameMode.uasset index 5f71003..ae68f7c 100644 --- a/Content/Legumix/BP_GameMode.uasset +++ b/Content/Legumix/BP_GameMode.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ffcd01b1a1fbc3def3c8451957cb4dc49d6529b1ea90ba3303bc53d2bd2f22ef -size 20699 +oid sha256:6ef764f0d6d17fb2309efb34815b5a2714079966472e420a0d6181a5021a0b5e +size 21071 diff --git a/Content/Legumix/Weapon/BP_Ammo.uasset b/Content/Legumix/Weapon/BP_Ammo.uasset new file mode 100644 index 0000000..67df7d4 --- /dev/null +++ b/Content/Legumix/Weapon/BP_Ammo.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c05e55130308441515ad0dd36070015a59d36d0cd874aea6f533082a4603e29 +size 33124 diff --git a/Source/LegumeMix/Private/Weapon/Bazoucorn.cpp b/Source/LegumeMix/Private/LMGameMode.cpp similarity index 72% rename from Source/LegumeMix/Private/Weapon/Bazoucorn.cpp rename to Source/LegumeMix/Private/LMGameMode.cpp index 49fe2af..401236f 100644 --- a/Source/LegumeMix/Private/Weapon/Bazoucorn.cpp +++ b/Source/LegumeMix/Private/LMGameMode.cpp @@ -1,4 +1,5 @@ // Fill out your copyright notice in the Description page of Project Settings. -#include "Weapon/Bazoucorn.h" +#include "LMGameMode.h" + diff --git a/Source/LegumeMix/Private/Player/LMPlayer.cpp b/Source/LegumeMix/Private/Player/LMPlayer.cpp index 6d3e825..517a912 100644 --- a/Source/LegumeMix/Private/Player/LMPlayer.cpp +++ b/Source/LegumeMix/Private/Player/LMPlayer.cpp @@ -4,10 +4,12 @@ #include "Player/LMPlayer.h" #include "Camera/CameraComponent.h" +#include "Weapon/LMAmmo.h" #include "Weapon/LMWeaponManager.h" ALMPlayer::ALMPlayer() { + // Set this character to call Tick() every frame. You can turn this off to improve performance if you don't need it. PrimaryActorTick.bCanEverTick = true; Camera = CreateDefaultSubobject(TEXT("Camera")); @@ -19,9 +21,20 @@ ALMPlayer::ALMPlayer() WeaponSkeletalMeshComponent->SetupAttachment(Camera); } +// Called when the game starts or when spawned void ALMPlayer::BeginPlay() { Super::BeginPlay(); + +} + +void ALMPlayer::PickUpAmmo(ALMAmmo* Ammo) +{ + if (GEngine) + { + FString AmmoAmount = FString::Printf(TEXT("Quantité de munition : %i"), Ammo->GetAmmoAmount()); + GEngine->AddOnScreenDebugMessage(1, 30.f, FColor::Red, AmmoAmount); + } } void ALMPlayer::SetWeaponManager(ULMWeaponManager* Manager) @@ -37,13 +50,17 @@ void ALMPlayer::SetWeaponManager(ULMWeaponManager* Manager) WeaponManager->Initialize(WeaponSkeletalMeshComponent); } +// Called every frame void ALMPlayer::Tick(float DeltaTime) { Super::Tick(DeltaTime); + } +// Called to bind functionality to input void ALMPlayer::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) { Super::SetupPlayerInputComponent(PlayerInputComponent); + } diff --git a/Source/LegumeMix/Private/Player/LMPlayerController.cpp b/Source/LegumeMix/Private/Player/LMPlayerController.cpp index 06aff27..27bed09 100644 --- a/Source/LegumeMix/Private/Player/LMPlayerController.cpp +++ b/Source/LegumeMix/Private/Player/LMPlayerController.cpp @@ -19,12 +19,14 @@ void ALMPlayerController::BeginPlay() void ALMPlayerController::SetupInputComponent() { Super::SetupInputComponent(); - UEnhancedInputComponent* Input = Cast(InputComponent); - Input->BindAction(MoveAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Move); - Input->BindAction(JumpAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Jump); - Input->BindAction(LookAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Look); - Input->BindAction(FireAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Fire); - Input->BindAction(ReloadAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Reload); + if(UEnhancedInputComponent* Input = Cast(InputComponent)) + { + Input->BindAction(MoveAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Move); + Input->BindAction(JumpAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Jump); + Input->BindAction(LookAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Look); + Input->BindAction(FireAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Fire); + Input->BindAction(ReloadAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Reload); + } } void ALMPlayerController::Move(const FInputActionValue& InputValue) diff --git a/Source/LegumeMix/Private/Weapon/LMAmmo.cpp b/Source/LegumeMix/Private/Weapon/LMAmmo.cpp new file mode 100644 index 0000000..2fee821 --- /dev/null +++ b/Source/LegumeMix/Private/Weapon/LMAmmo.cpp @@ -0,0 +1,43 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "Weapon/LMAmmo.h" + +#include "Components/BoxComponent.h" +#include "Components/SphereComponent.h" +#include "Player/LMPlayer.h" + +// Sets default values +ALMAmmo::ALMAmmo() +{ + PrimaryActorTick.bCanEverTick = true; + AmmoMeshComponent = CreateDefaultSubobject(TEXT("AmmoMeshComponent")); + RootComponent = AmmoMeshComponent; + CollisionSphere = CreateDefaultSubobject(TEXT("CollisionSphere")); + CollisionSphere->SetupAttachment(RootComponent); + CollisionSphere->OnComponentBeginOverlap.AddDynamic(this, &ALMAmmo::OnSphereOverlap); + AmmoType = EAmmoType::EAT_RadishAmmo; + AmmoAmount = 1; + +} + +void ALMAmmo::BeginPlay() +{ + Super::BeginPlay(); +} + +void ALMAmmo::OnSphereOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, + UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult) +{ + if (ALMPlayer* Player = Cast(OtherActor)) + { + Player->PickUpAmmo(this); + Destroy(); + } +} + +void ALMAmmo::Tick(float DeltaTime) +{ + Super::Tick(DeltaTime); +} + diff --git a/Source/LegumeMix/Private/Weapon/LMBazoucorn.cpp b/Source/LegumeMix/Private/Weapon/LMBazoucorn.cpp new file mode 100644 index 0000000..9cc48fa --- /dev/null +++ b/Source/LegumeMix/Private/Weapon/LMBazoucorn.cpp @@ -0,0 +1,9 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "Weapon\LMBazoucorn.h" + +void ULMWeapon::Fire() +{ + //Fire like a Bazoucorn +} diff --git a/Source/LegumeMix/Private/Weapon/LMRadivolver.cpp b/Source/LegumeMix/Private/Weapon/LMRadivolver.cpp index f401218..21d995a 100644 --- a/Source/LegumeMix/Private/Weapon/LMRadivolver.cpp +++ b/Source/LegumeMix/Private/Weapon/LMRadivolver.cpp @@ -2,3 +2,9 @@ #include "Weapon/LMRadivolver.h" + +void ULMWeapon::Fire() +{ + //Fire like a Radivolver +} + diff --git a/Source/LegumeMix/Private/Weapon/LMWeapon.cpp b/Source/LegumeMix/Private/Weapon/LMWeapon.cpp index 21931da..16d8a30 100644 --- a/Source/LegumeMix/Private/Weapon/LMWeapon.cpp +++ b/Source/LegumeMix/Private/Weapon/LMWeapon.cpp @@ -29,5 +29,28 @@ void ULMWeapon::Reload() { //Do design reload logic OnReload(); + if(HasAmmoInClip()) + { + if(CurrentAmmoInInventory >= WeaponDataStructure.MaxClipAmmo) + { + CurrentClipAmmo = WeaponDataStructure.MaxClipAmmo; + CurrentAmmoInInventory -= WeaponDataStructure.MaxClipAmmo; + } + else + { + CurrentClipAmmo = CurrentAmmoInInventory; + CurrentAmmoInInventory = 0; + } + } +} + +void ULMWeapon::AddAmmo(int AmountOfAmmoToGet) +{ + CurrentAmmoInInventory += AmountOfAmmoToGet; +} + +void ULMWeapon::Fire() +{ + //Fire } diff --git a/Source/LegumeMix/Public/LMGameMode.h b/Source/LegumeMix/Public/LMGameMode.h new file mode 100644 index 0000000..d9f147b --- /dev/null +++ b/Source/LegumeMix/Public/LMGameMode.h @@ -0,0 +1,17 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "GameFramework/GameModeBase.h" +#include "LMGameMode.generated.h" + +/** + * + */ +UCLASS() +class LEGUMEMIX_API ALMGameMode : public AGameModeBase +{ + GENERATED_BODY() + +}; diff --git a/Source/LegumeMix/Public/Player/LMPlayer.h b/Source/LegumeMix/Public/Player/LMPlayer.h index 6bd8424..4027c1b 100644 --- a/Source/LegumeMix/Public/Player/LMPlayer.h +++ b/Source/LegumeMix/Public/Player/LMPlayer.h @@ -9,17 +9,24 @@ class UCameraComponent; class ULMWeaponManager; +class ALMAmmo; + UCLASS() class LEGUMEMIX_API ALMPlayer : public ACharacter { GENERATED_BODY() public: + // Sets default values for this character's properties ALMPlayer(); virtual void Tick(float DeltaTime) override; virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override; + + UFUNCTION() + void PickUpAmmo(ALMAmmo* Ammo); protected: + // Called when the game starts or when spawned virtual void BeginPlay() override; public: diff --git a/Source/LegumeMix/Public/Weapon/LMAmmo.h b/Source/LegumeMix/Public/Weapon/LMAmmo.h new file mode 100644 index 0000000..d397a72 --- /dev/null +++ b/Source/LegumeMix/Public/Weapon/LMAmmo.h @@ -0,0 +1,50 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "GameFramework/Actor.h" +#include "LMAmmo.generated.h" + +class USphereComponent; + +UENUM(BlueprintType) +enum class EAmmoType : uint8 +{ + EAT_RadishAmmo UMETA(DisplayName = "Radish Ammo"), + EAT_CornAmmo UMETA(DisplayName = "Corn Ammo") +}; + +UCLASS() +class LEGUMEMIX_API ALMAmmo : public AActor +{ + GENERATED_BODY() + +public: + ALMAmmo(); + virtual void Tick(float DeltaTime) override; + + UFUNCTION(BlueprintCallable) + inline int GetAmmoAmount() { return AmmoAmount; } + + UFUNCTION(BlueprintCallable) + inline EAmmoType GetAmmoType() { return AmmoType; } + +protected: + virtual void BeginPlay() override; + + UPROPERTY(EditAnywhere) + TObjectPtr AmmoMeshComponent; + + UPROPERTY(EditAnywhere) + TObjectPtr CollisionSphere; + + UPROPERTY(EditAnywhere) + EAmmoType AmmoType; + + UPROPERTY(EditAnywhere) + int AmmoAmount; + + UFUNCTION(BlueprintCallable) + void OnSphereOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult); +}; diff --git a/Source/LegumeMix/Public/Weapon/Bazoucorn.h b/Source/LegumeMix/Public/Weapon/LMBazoucorn.h similarity index 88% rename from Source/LegumeMix/Public/Weapon/Bazoucorn.h rename to Source/LegumeMix/Public/Weapon/LMBazoucorn.h index b644cb3..6d413c1 100644 --- a/Source/LegumeMix/Public/Weapon/Bazoucorn.h +++ b/Source/LegumeMix/Public/Weapon/LMBazoucorn.h @@ -4,7 +4,7 @@ #include "CoreMinimal.h" #include "LMWeapon.h" -#include "Bazoucorn.generated.h" +#include "LMBazoucorn.generated.h" /** * diff --git a/Source/LegumeMix/Public/Weapon/LMWeapon.h b/Source/LegumeMix/Public/Weapon/LMWeapon.h index 4dda398..d9c2e60 100644 --- a/Source/LegumeMix/Public/Weapon/LMWeapon.h +++ b/Source/LegumeMix/Public/Weapon/LMWeapon.h @@ -27,12 +27,14 @@ public: void Initialize(); void Fire(); + UFUNCTION(BlueprintCallable) - void Reload(); + void Reload(); //Reload current clip to max ammo in clip UFUNCTION(BlueprintCallable, BlueprintImplementableEvent) void OnReload(); //To call in blueprint for design utilities - void AddAmmo(); + + void AddAmmo(int AmountOfAmmoToGet); //Add ammo in inventory - bool HasAmmoInClip(); - bool HasAmmoInInventory(); + bool HasAmmoInClip(); //Check if there is ammo in clip (return a bool) + bool HasAmmoInInventory(); //Check if there is ammo in "inventory" (return a bool) }; diff --git a/Source/LegumeMix/Public/Weapon/LMWeaponDataStructure.h b/Source/LegumeMix/Public/Weapon/LMWeaponDataStructure.h index 053242a..033939a 100644 --- a/Source/LegumeMix/Public/Weapon/LMWeaponDataStructure.h +++ b/Source/LegumeMix/Public/Weapon/LMWeaponDataStructure.h @@ -1,5 +1,6 @@ #pragma once #include "AnimationBlueprintEditorSettings.h" +#include "LMAmmo.h" #include "LMWeaponDataStructure.generated.h" USTRUCT(BlueprintType) @@ -16,8 +17,8 @@ struct FLMWeaponDataStructure : public FTableRowBase UPROPERTY(EditAnywhere, BlueprintReadWrite) TObjectPtr MeshWeapon; //Mesh of the weapon display in the scene - //UPROPERTY(EditAnywhere, BlueprintReadWrite) - //enum AmmoType; //Type of ammo, which ammo this weapon is using + UPROPERTY(EditAnywhere, BlueprintReadWrite) + EAmmoType AmmoType; //Type of ammo, which ammo this weapon is using UPROPERTY(EditAnywhere, BlueprintReadWrite) TObjectPtr AnimationBluePrint; //The animation blueprint to animate the mesh