- #pragma once
- #include "CoreMinimal.h"
- #include "Components/ActorComponent.h"
- #include "DamageSystem.generated.h"
- DECLARE_EVENT_OneParam(UCPP_DamageComponent, IncreaseDamageEvent, float )
- DECLARE_EVENT_OneParam(UCPP_DamageComponent, DecreaseDamageEvent, float )
- UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
- class SKYFRONTIER_API UDamageSystem : public UActorComponent
- {
- GENERATED_BODY()
- public:
- UDamageSystem();
- UFUNCTION(BlueprintPure)
- float GetShootingDamage() const;
- UFUNCTION(BlueprintPure)
- float GetMissileDamage() const;
- UFUNCTION(BlueprintCallable)
- void MultiplyDamage(float Amount);
- UFUNCTION(BlueprintCallable)
- void RestoreDamage(float Amount);
-
- protected:
-
- virtual void BeginPlay() override;
-
- public:
- IncreaseDamageEvent OnIncreaseDamageEvent;
- DecreaseDamageEvent OnDecreaseDamageEvent;
-
- private:
- UPROPERTY(EditAnywhere)
- float ShootingDamage;
- UPROPERTY(EditAnywhere)
- float MissileDamage;
-
- };