Skip to content

Commit

Permalink
Health powerup restores full health instead of half health now
Browse files Browse the repository at this point in the history
  • Loading branch information
HansenDJ committed Apr 7, 2022
1 parent 86f0f53 commit ad55bf0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
13 changes: 1 addition & 12 deletions Game/Powerup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,7 @@ public static void IsShieldedEffect()

public static void IsRestoredHealthEffect()
{
if (PlayerStats.playerHealth < PlayerStats.maxPlayerHealth / 2)
{
PlayerStats.playerHealth = PlayerStats.maxPlayerHealth / 2;
}
else if ((PlayerStats.playerHealth >= PlayerStats.maxPlayerHealth / 2) && (PlayerStats.playerHealth <= PlayerStats.maxPlayerHealth))
{
PlayerStats.playerHealth += 50;
if (PlayerStats.playerHealth >= PlayerStats.maxPlayerHealth)
{
PlayerStats.playerHealth = PlayerStats.maxPlayerHealth;
}
}
PlayerStats.playerHealth = PlayerStats.maxPlayerHealth;
isHealthHit1 = false;
isHealthhit2 = false;
isRestoredHealth = true;
Expand Down
7 changes: 2 additions & 5 deletions Game/SpawnDestroy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -551,11 +551,8 @@ public void PowerUpFall(Player player)

if (PowerUpList[i].ID == 1)
{
if (PlayerStats.playerHealth <= PlayerStats.maxPlayerHealth / 2)
{
AudioService.PlayAudio(AudioService.healPlayer);
PlayerStats.playerHealth = PlayerStats.maxPlayerHealth / 2;
}
AudioService.PlayAudio(AudioService.healPlayer);
PlayerStats.playerHealth = PlayerStats.maxPlayerHealth;
destroyed = true;
} else if (PowerUpList[i].ID == 2)
{
Expand Down

0 comments on commit ad55bf0

Please sign in to comment.