mirror of
https://github.com/vegapnk/RJW-Genes.git
synced 2024-08-15 00:23:31 +00:00
Hardened Fertilin per Ingestion, should help with #39
This commit is contained in:
parent
b9a2466425
commit
5d35102338
1 changed files with 17 additions and 11 deletions
|
@ -17,23 +17,29 @@ namespace RJW_Genes
|
|||
|
||||
public static void OffsetLifeForce(IGeneResourceDrain drain, float offset)
|
||||
{
|
||||
float old_value = drain.Resource.Value;
|
||||
drain.Resource.Value += offset;
|
||||
PostOffSetLifeForce(drain, old_value);
|
||||
if (drain.Resource != null && drain.Resource.Active) {
|
||||
float old_value = drain.Resource.Value;
|
||||
drain.Resource.Value += offset;
|
||||
PostOffSetLifeForce(drain, old_value);
|
||||
}
|
||||
}
|
||||
|
||||
public static void PostOffSetLifeForce(IGeneResourceDrain drain, float old_value)
|
||||
{
|
||||
if (old_value > 0.2f && drain.Resource.Value <= 0.2f)
|
||||
{
|
||||
//TODO: Mood debuff
|
||||
}
|
||||
else if (old_value > 0f && drain.Resource.Value <= 0f)
|
||||
|
||||
if (drain.Resource != null && drain.Resource.Active)
|
||||
{
|
||||
Pawn pawn = drain.Pawn;
|
||||
if (!drain.Pawn.health.hediffSet.HasHediff(HediffDefOf.rjw_genes_fertilin_craving))
|
||||
if (old_value > 0.2f && drain.Resource.Value <= 0.2f)
|
||||
{
|
||||
drain.Pawn.health.AddHediff(HediffDefOf.rjw_genes_fertilin_craving);
|
||||
//TODO: Mood debuff
|
||||
}
|
||||
else if (old_value > 0f && drain.Resource.Value <= 0f)
|
||||
{
|
||||
Pawn pawn = drain.Pawn;
|
||||
if (!drain.Pawn.health.hediffSet.HasHediff(HediffDefOf.rjw_genes_fertilin_craving))
|
||||
{
|
||||
drain.Pawn.health.AddHediff(HediffDefOf.rjw_genes_fertilin_craving);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue