diff --git a/Source/Nakatomi/RandomWeapon.cpp b/Source/Nakatomi/RandomWeapon.cpp new file mode 100644 index 0000000..9225a96 --- /dev/null +++ b/Source/Nakatomi/RandomWeapon.cpp @@ -0,0 +1,19 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "RandomWeapon.h" + +ARandomWeapon::ARandomWeapon() +{ + RandomWeaponParameters = CreateDefaultSubobject(TEXT("Random Weapon Parameters")); +} + +void ARandomWeapon::BeginPlay() +{ + WeaponProperties = RandomWeaponParameters->GenerateRandomWeaponProperties(); + WeaponSkeletalMesh = RandomWeaponParameters->PickRandomMesh(); + FireSound = RandomWeaponParameters->PickRandomSoundBase(); + FieldSystemActor = RandomWeaponParameters->PickRandomFieldSystem(); + + Super::BeginPlay(); +} diff --git a/Source/Nakatomi/RandomWeapon.h b/Source/Nakatomi/RandomWeapon.h new file mode 100644 index 0000000..3158d14 --- /dev/null +++ b/Source/Nakatomi/RandomWeapon.h @@ -0,0 +1,29 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "RandomWeaponParameters.h" +#include "Weapon.h" +#include "RandomWeapon.generated.h" + +/** + * + */ +UCLASS() +class NAKATOMI_API ARandomWeapon : public AWeapon +{ + GENERATED_BODY() + +private: + + UPROPERTY(VisibleAnywhere, Category = "Random Weapon Parameters") + URandomWeaponParameters* RandomWeaponParameters; + +public: + + ARandomWeapon(); + +protected: + virtual void BeginPlay() override; +};