Hardened Fertilin per Ingestion, should help with #39

This commit is contained in:
Vegapnk 2023-06-04 15:46:30 +02:00
parent b9a2466425
commit 5d35102338

View file

@ -17,12 +17,17 @@ namespace RJW_Genes
public static void OffsetLifeForce(IGeneResourceDrain drain, float offset) public static void OffsetLifeForce(IGeneResourceDrain drain, float offset)
{ {
if (drain.Resource != null && drain.Resource.Active) {
float old_value = drain.Resource.Value; float old_value = drain.Resource.Value;
drain.Resource.Value += offset; drain.Resource.Value += offset;
PostOffSetLifeForce(drain, old_value); PostOffSetLifeForce(drain, old_value);
} }
}
public static void PostOffSetLifeForce(IGeneResourceDrain drain, float old_value) public static void PostOffSetLifeForce(IGeneResourceDrain drain, float old_value)
{
if (drain.Resource != null && drain.Resource.Active)
{ {
if (old_value > 0.2f && drain.Resource.Value <= 0.2f) if (old_value > 0.2f && drain.Resource.Value <= 0.2f)
{ {
@ -37,6 +42,7 @@ namespace RJW_Genes
} }
} }
} }
}
public static bool HasLowLifeForce(Pawn pawn) public static bool HasLowLifeForce(Pawn pawn)