public static void AdministerTransfusion(Pawn pawn, CompBlood bloodPack) { Hediff bloodLossHediff = pawn.health.hediffSet.GetFirstHediffOfDef(HediffDefOf.BloodLoss); if (bloodLossHediff == null || bloodPack == null) { return; } bloodLossHediff.Severity -= bloodPack.Props.bloodAmount; pawn.health.Notify_HediffChanged(bloodLossHediff); }
public override void ApplyOnPawn(Pawn pawn, BodyPartRecord part, Pawn billDoer, List <Thing> ingredients, Bill bill) { CompBlood compBlood = ingredients[0].TryGetComp <CompBlood>(); if (compBlood != null) { BloodBankUtilities.AdministerTransfusion(pawn, compBlood); } else { Log.Error($"Blood Bank - Give blood operation failed (ingredients[0] ({ingredients[0].def.defName}) has no CompBlood)"); } }