-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
…yPartDamage, modified bulletHealth to work with BodyPartDamage
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
public class AdrenalineTrigger : MonoBehaviour | ||
{ | ||
private float adrenalineLevel = 0f; | ||
public float adrenalineTriggerThreshold = 20f; // Threshold for adrenaline boost | ||
public Image adrenalineBar; | ||
HealthRegeneration healthScript; | ||
|
||
private void Start() | ||
{ | ||
healthScript = GetComponent<HealthRegeneration>(); | ||
} | ||
|
||
private void Update() | ||
{ | ||
if (healthScript.currentHealth <= adrenalineTriggerThreshold && adrenalineLevel < 100f) | ||
{ | ||
adrenalineLevel += Time.deltaTime * 50f; // Increase adrenaline | ||
UpdateAdrenalineBar(); | ||
} | ||
else | ||
{ | ||
adrenalineLevel = 0f; | ||
UpdateAdrenalineBar(); | ||
} | ||
} | ||
|
||
private void UpdateAdrenalineBar() | ||
{ | ||
if(adrenalineBar != null) | ||
{ | ||
adrenalineBar.fillAmount = adrenalineLevel / 100f; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
public class HealthRegeneration : MonoBehaviour | ||
{ | ||
public float maxHealth = 100f; | ||
private float currentHealth; | ||
public Image healthBar; | ||
|
||
private void Start() | ||
{ | ||
currentHealth = maxHealth; | ||
} | ||
|
||
private void Update() | ||
{ | ||
// Regenerate health logic | ||
if (currentHealth < maxHealth) | ||
{ | ||
currentHealth += Time.deltaTime * 5f; // Regeneration rate | ||
currentHealth = Mathf.Min(currentHealth, maxHealth); | ||
UpdateHealthBar(); | ||
} | ||
} | ||
|
||
private void UpdateHealthBar() | ||
{ | ||
if(healthBar != null) | ||
{ | ||
healthBar.fillAmount = currentHealth / maxHealth; | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
public class AdrenalineTrigger : MonoBehaviour | ||
{ | ||
private float adrenalineLevel = 0f; | ||
public float adrenalineTriggerThreshold = 20f; // Threshold for adrenaline boost | ||
public Image adrenalineBar; | ||
private HealthRegeneration healthScript; | ||
|
||
private void Start() | ||
{ | ||
healthScript = GetComponent<HealthRegeneration>(); | ||
} | ||
|
||
private void Update() | ||
{ | ||
if (healthScript.GetCurrentHealth() <= adrenalineTriggerThreshold && adrenalineLevel < 100f) | ||
{ | ||
adrenalineLevel += Time.deltaTime * 50f; // Increase adrenaline | ||
UpdateAdrenalineBar(); | ||
} | ||
else | ||
{ | ||
adrenalineLevel = 0f; | ||
UpdateAdrenalineBar(); | ||
} | ||
} | ||
|
||
private void UpdateAdrenalineBar() | ||
{ | ||
if (adrenalineBar != null) | ||
{ | ||
adrenalineBar.fillAmount = adrenalineLevel / 100f; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using UnityEngine; | ||
using UnityEngine.UI; // Required for UI elements | ||
|
||
public class ArmorIntegrity : MonoBehaviour | ||
{ | ||
public float maxIntegrity = 100f; | ||
private float currentIntegrity; | ||
|
||
public Image integrityBar; // UI Image to represent armor integrity visually | ||
|
||
void Start() | ||
{ | ||
currentIntegrity = maxIntegrity; | ||
UpdateArmorUI(); // Initialize UI | ||
} | ||
|
||
void Update() | ||
{ | ||
// Optional: Add any continuous logic, if required | ||
} | ||
|
||
public void TakeDamage(float damage) | ||
{ | ||
currentIntegrity -= damage; | ||
currentIntegrity = Mathf.Clamp(currentIntegrity, 0, maxIntegrity); | ||
UpdateArmorUI(); | ||
} | ||
|
||
public void RepairArmor(float repairAmount) | ||
{ | ||
currentIntegrity += repairAmount; | ||
currentIntegrity = Mathf.Clamp(currentIntegrity, 0, maxIntegrity); | ||
UpdateArmorUI(); | ||
} | ||
|
||
private void UpdateArmorUI() | ||
{ | ||
if (integrityBar != null) | ||
{ | ||
integrityBar.fillAmount = currentIntegrity / maxIntegrity; | ||
} | ||
// If using Text UI, update the text to display currentIntegrity | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
using UnityEngine; | ||
using UnityEngine.UI; // Required for UI elements | ||
|
||
public class AugmentationIntegrity : MonoBehaviour | ||
{ | ||
public float maxIntegrity = 100f; | ||
private float currentIntegrity; | ||
|
||
public Image integrityBar; // UI element to represent integrity visually | ||
|
||
void Start() | ||
{ | ||
currentIntegrity = maxIntegrity; | ||
UpdateAugmentationUI(); // Initialize UI | ||
} | ||
|
||
void Update() | ||
{ | ||
// Optional: Add any continuous logic, if required | ||
} | ||
|
||
public void TakeDamage(float damage) | ||
{ | ||
currentIntegrity -= damage; | ||
currentIntegrity = Mathf.Clamp(currentIntegrity, 0, maxIntegrity); | ||
CheckForMalfunctions(); | ||
UpdateAugmentationUI(); | ||
} | ||
|
||
public void RepairAugmentation(float repairAmount) | ||
{ | ||
currentIntegrity += repairAmount; | ||
currentIntegrity = Mathf.Clamp(currentIntegrity, 0, maxIntegrity); | ||
UpdateAugmentationUI(); | ||
} | ||
|
||
private void CheckForMalfunctions() | ||
{ | ||
if (currentIntegrity <= 0) | ||
{ | ||
// Handle augmentation malfunction, e.g., disable certain abilities | ||
} | ||
} | ||
|
||
private void UpdateAugmentationUI() | ||
{ | ||
if (integrityBar != null) | ||
{ | ||
integrityBar.fillAmount = currentIntegrity / maxIntegrity; | ||
} | ||
} | ||
} | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
public class BioToxicityMeter : MonoBehaviour | ||
{ | ||
public float maxBioToxicity = 100f; | ||
private float currentBioToxicity = 0f; | ||
public Image bioToxicityBar; // Assign this in the Inspector | ||
|
||
void Update() | ||
{ | ||
// Update logic, if any, goes here | ||
} | ||
|
||
public void IncreaseToxicity(float amount) | ||
{ | ||
currentBioToxicity += amount; | ||
currentBioToxicity = Mathf.Clamp(currentBioToxicity, 0, maxBioToxicity); | ||
UpdateToxicityUI(); | ||
} | ||
|
||
public void DecreaseToxicity(float amount) | ||
{ | ||
currentBioToxicity -= amount; | ||
currentBioToxicity = Mathf.Clamp(currentBioToxicity, 0, maxBioToxicity); | ||
UpdateToxicityUI(); | ||
} | ||
|
||
private void UpdateToxicityUI() | ||
{ | ||
bioToxicityBar.fillAmount = currentBioToxicity / maxBioToxicity; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
public class BloodLossStatus : MonoBehaviour | ||
{ | ||
public float maxBlood = 100f; | ||
private float currentBlood; | ||
public Image bloodBar; | ||
|
||
void Start() | ||
{ | ||
currentBlood = maxBlood; | ||
UpdateBloodBar(); | ||
} | ||
|
||
void Update() | ||
{ | ||
// Logic to decrease blood based on player injuries | ||
currentBlood = Mathf.Clamp(currentBlood, 0, maxBlood); | ||
UpdateBloodBar(); | ||
} | ||
|
||
public void ReceiveInjury(float amount) | ||
{ | ||
currentBlood -= amount; | ||
currentBlood = Mathf.Clamp(currentBlood, 0, maxBlood); | ||
UpdateBloodBar(); | ||
} | ||
|
||
private void UpdateBloodBar() | ||
{ | ||
if (bloodBar != null) | ||
{ | ||
bloodBar.fillAmount = currentBlood / maxBlood; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.