diff --git a/Content/Assets/Items/MagneticShield_BP.uasset b/Content/Assets/Items/MagneticShield_BP.uasset index 8dd8391..dd5e85a 100644 --- a/Content/Assets/Items/MagneticShield_BP.uasset +++ b/Content/Assets/Items/MagneticShield_BP.uasset Binary files differ diff --git a/Content/Assets/Items/Overcharge_BP.uasset b/Content/Assets/Items/Overcharge_BP.uasset deleted file mode 100644 index b3533e6..0000000 --- a/Content/Assets/Items/Overcharge_BP.uasset +++ /dev/null Binary files differ diff --git a/Content/Assets/NormieAsset/Test_anim.uasset b/Content/Assets/NormieAsset/Test_anim.uasset index aee88a9..b45bb95 100644 --- a/Content/Assets/NormieAsset/Test_anim.uasset +++ b/Content/Assets/NormieAsset/Test_anim.uasset Binary files differ diff --git a/Content/Levels/Sergio_Level.umap b/Content/Levels/Sergio_Level.umap index c328913..68785d3 100644 --- a/Content/Levels/Sergio_Level.umap +++ b/Content/Levels/Sergio_Level.umap Binary files differ diff --git a/Source/SkyFrontier/Private/HealthSystem.cpp b/Source/SkyFrontier/Private/HealthSystem.cpp index 92990cc..d158630 100644 --- a/Source/SkyFrontier/Private/HealthSystem.cpp +++ b/Source/SkyFrontier/Private/HealthSystem.cpp @@ -16,6 +16,7 @@ // This is here for now, but if you ever do anything serialization related you might not want this. Health = MaxHealth; + Shield = 0; } float UHealthSystem::GetHealth() const @@ -33,6 +34,11 @@ return Health / MaxHealth; } +float UHealthSystem::GetShield() const +{ + return Shield; +} + void UHealthSystem::ModifyHealth(const float Amount) { if(Amount == 0) @@ -61,4 +67,14 @@ OnDamageHealedEvent.Broadcast(Amount); } +} + +void UHealthSystem::ReceiveShield(const float Amount) +{ + if(Amount > 0) + { + Shield += Amount; + + OnShieldReceiveEvent.Broadcast(Amount); + } } \ No newline at end of file diff --git a/Source/SkyFrontier/Public/HealthSystem.h b/Source/SkyFrontier/Public/HealthSystem.h index 2e0e911..29880f3 100644 --- a/Source/SkyFrontier/Public/HealthSystem.h +++ b/Source/SkyFrontier/Public/HealthSystem.h @@ -8,6 +8,7 @@ DECLARE_EVENT_OneParam(UCPP_HealthComponent, DamageTakenEvent, float ) DECLARE_EVENT_OneParam(UCPP_HealthComponent, HealDamageEvent, float ) +DECLARE_EVENT_OneParam(UCPP_HealthComponent, ShieldReceiveEvent, float ) UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) ) class SKYFRONTIER_API UHealthSystem : public UActorComponent @@ -24,6 +25,8 @@ float GetMaxHealth() const; UFUNCTION(BlueprintPure) float GetHealthAsPercentage() const; + UFUNCTION(BlueprintPure) + float GetShield() const; UFUNCTION(BlueprintCallable) void ModifyHealth(float Amount); @@ -32,6 +35,8 @@ void TakeDamage(float Amount); UFUNCTION(BlueprintCallable) void RecoverHealth(float Amount); + UFUNCTION(BlueprintCallable) + void ReceiveShield(float Amount); protected: // Functions @@ -41,6 +46,7 @@ DamageTakenEvent OnDamageTakenEvent; HealDamageEvent OnDamageHealedEvent; + ShieldReceiveEvent OnShieldReceiveEvent; private: // This can be protected if we want to subclass the Health Component @@ -48,5 +54,7 @@ float Health; UPROPERTY(EditAnywhere) float MaxHealth; + UPROPERTY(VisibleAnywhere) + float Shield; };