mirror of
https://github.com/vegapnk/RJW-Genes.git
synced 2024-08-15 00:23:31 +00:00
Put Licentia Parts back in, but commented out so I dont forget
This commit is contained in:
parent
90653ddc9e
commit
ee2be0375c
5 changed files with 105 additions and 4 deletions
56
Source/Genes/Damage/Gene_Elasticity.cs
Normal file
56
Source/Genes/Damage/Gene_Elasticity.cs
Normal file
|
@ -0,0 +1,56 @@
|
|||
//using LicentiaLabs;
|
||||
using Verse;
|
||||
|
||||
|
||||
// TODO: Re-Introduce this once Licentia is 1.5
|
||||
// It should be rather simple
|
||||
namespace RJW_Genes
|
||||
{
|
||||
/// <summary>
|
||||
/// This Gene adds Licentia-Labs Elasticised Hediff to a Pawn.
|
||||
/// Note: I had a HarmonyPatch first, similar to skipping cumflation, but the Stretching Logic is called quite a lot and for both pawns actually.
|
||||
/// Hence, I think choosing the Elasticiced Hediff was good as then everything is covered by "Licentia-Logic".
|
||||
/// </summary>
|
||||
public class Gene_Elasticity : Gene
|
||||
{
|
||||
private const int RESET_INTERVAL = 60000; // 60k should be 1 day
|
||||
|
||||
/*
|
||||
public override void PostAdd()
|
||||
{
|
||||
base.PostAdd();
|
||||
// Doing it like this will add the hediff with a severity of ~0.5, but it will decay.
|
||||
// Hence we check with the Ticks to update.
|
||||
this.pawn.health.AddHediff(Licentia.HediffDefs.Elasticised);
|
||||
ResetSeverity();
|
||||
}
|
||||
|
||||
public override void Tick()
|
||||
{
|
||||
base.Tick();
|
||||
if (pawn.IsHashIntervalTick(RESET_INTERVAL))
|
||||
ResetSeverity();
|
||||
}
|
||||
|
||||
public override void PostRemove()
|
||||
{
|
||||
Hediff candidate = pawn.health.hediffSet.GetFirstHediffOfDef(Licentia.HediffDefs.Elasticised);
|
||||
if (candidate != null)
|
||||
{
|
||||
pawn.health.RemoveHediff(candidate);
|
||||
}
|
||||
base.PostRemove();
|
||||
}
|
||||
|
||||
|
||||
private void ResetSeverity(float severity = 0.7f)
|
||||
{
|
||||
Hediff candidate = pawn.health.hediffSet.GetFirstHediffOfDef(Licentia.HediffDefs.Elasticised);
|
||||
if (candidate != null)
|
||||
{
|
||||
candidate.Severity = severity;
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue