Added functional defense points
This commit is contained in:
parent
2e2aae16f8
commit
fbe444689f
@ -39566,7 +39566,7 @@ MonoBehaviour:
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 1177353681}
|
||||
m_TargetAssemblyTypeName: Player, Assembly-CSharp
|
||||
m_MethodName: AddHealthPoint
|
||||
m_MethodName: AddDefensePoint
|
||||
m_Mode: 1
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
|
@ -128,6 +128,21 @@ public class Player : MonoBehaviour
|
||||
|
||||
public void TakeDamage(float damage, bool isPanelEnabled = true)
|
||||
{
|
||||
|
||||
defensePoints = PlayerPrefs.GetInt("defensePoints");
|
||||
if(defensePoints == 1)
|
||||
{
|
||||
damage = damage * 0.95f;
|
||||
}
|
||||
else if(defensePoints == 2)
|
||||
{
|
||||
damage = damage * 0.9f;
|
||||
}
|
||||
else if(defensePoints == 3)
|
||||
{
|
||||
damage = damage * 0.85f;
|
||||
}
|
||||
|
||||
currentHealth = PlayerPrefs.GetFloat("health");
|
||||
currentHealth = currentHealth - damage;
|
||||
PlayerPrefs.SetFloat("health", currentHealth);
|
||||
@ -258,6 +273,10 @@ public class Player : MonoBehaviour
|
||||
if (currentHealth < maxHealth)
|
||||
{
|
||||
currentHealth = currentHealth + 1;
|
||||
if (currentHealth > maxHealth)
|
||||
{
|
||||
currentHealth = maxHealth;
|
||||
}
|
||||
PlayerPrefs.SetFloat("health", currentHealth);
|
||||
timerTick = 0f;
|
||||
}
|
||||
@ -353,7 +372,7 @@ public class Player : MonoBehaviour
|
||||
{
|
||||
defensePoints = PlayerPrefs.GetInt("defensePoints");
|
||||
defensePoints = defensePoints + 1;
|
||||
PlayerPrefs.SetInt("defensePoitns", defensePoints);
|
||||
PlayerPrefs.SetInt("defensePoints", defensePoints);
|
||||
}
|
||||
|
||||
public void ManageIntelligence()
|
||||
|
@ -9,17 +9,17 @@ EditorUserSettings:
|
||||
value: 22424703114646680e0b0227036c7c1100123d24383a273e2e2c5326ece92021
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-1:
|
||||
value: 22424703114646680e0b0227036c72111f1958072926337e38271427fb
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-2:
|
||||
value: 22424703114646680e0b0227036c6c111b07142f1f2b233e2867083debf42d
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-3:
|
||||
value: 22424703114646680e0b0227036c68190c160a2e042733232867083debf42d
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-4:
|
||||
RecentlyUsedScenePath-2:
|
||||
value: 22424703114646680e0b0227036c70050204112e291f2f2a2c3b1920caef212be7a923e7ee2e26
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-3:
|
||||
value: 22424703114646680e0b0227036c72111f1958072926337e38271427fb
|
||||
flags: 0
|
||||
RecentlyUsedScenePath-4:
|
||||
value: 22424703114646680e0b0227036c6c111b07142f1f2b233e2867083debf42d
|
||||
flags: 0
|
||||
vcSharedLogLevel:
|
||||
value: 0d5e400f0650
|
||||
flags: 0
|
||||
|
Loading…
Reference in New Issue
Block a user