public override void CompTick() { base.CompTick(); if (this.parent.GetComp <CompEquippable>().PrimaryVerb.CasterPawn == null && LastGainTick > Find.TickManager.TicksGame) { Pawn p = this.parent.GetComp <CompEquippable>().PrimaryVerb.CasterPawn; ChaosFollowerPawnKindDef pdef = p.kindDef as ChaosFollowerPawnKindDef; Need_Soul n_soul = p.needs.TryGetNeed <Need_Soul>(); var resistence = pdef.AfflictionProperty.ResolveFactor; n_soul.GainNeed(amount(cprops.Category, resistence)); LastGainTick = Find.TickManager.TicksGame + 120; } }
public void CalculateSoulChanges(Need_Soul nsoul) { float num; switch (SProps.Category) { case (SoulItemCategories.Neutral): { // Log.Message("NeutralItem"); sign = 0; break; } case (SoulItemCategories.Corruption): { // Log.Message("Corrupted Item"); sign = -1; break; } case (SoulItemCategories.Redemption): { // Log.Message("Redemptive Item"); sign = 0.5f; break; } default: { Log.Error("No Soul Item Category Found"); break; } } num = sign * this.SProps.GainRate * 0.2f / 14000; // Log.Message(num.ToString()); nsoul.GainNeed(num); }