public override void ApplyOnPawn(Pawn pawn, BodyPartRecord part, Pawn billDoer, List<Thing> ingredients, Bill bill) { CompBloodProduct compBloodProduct = ingredients[0].TryGetComp<CompBloodProduct>(); if (compBloodProduct != null) BloodBankUtilities.AdministerBooster(pawn, compBloodProduct); else Log.Error($"Blood Bank - Give booster operation failed (ingredients[0] ({ingredients[0].def.defName}) has no CompBloodProduct)"); }
public static void AdministerBooster(Pawn pawn, CompBloodProduct bloodProduct) { if (bloodProduct == null) { return; } Hediff hediff = pawn.health.hediffSet.GetFirstHediffOfDef(bloodProduct.Props.hediffDef) ?? pawn.health.AddHediff(bloodProduct.Props.hediffDef); hediff.Severity = bloodProduct.Props.severity; pawn.health.Notify_HediffChanged(hediff); }