public override string GetLabelWhenUsedOn(Pawn pawn, BodyPartRecord part) { if (pawn.RaceProps.IsMechanoid || pawn.health.hediffSet.PartOrAnyAncestorHasDirectlyAddedParts(part)) { return(RecipeDefOf.RemoveBodyPart.label); } BodyPartRemovalIntent bodyPartRemovalIntent = HealthUtility.PartRemovalIntent(pawn, part); if (bodyPartRemovalIntent != BodyPartRemovalIntent.Amputate) { if (bodyPartRemovalIntent != BodyPartRemovalIntent.Harvest) { throw new InvalidOperationException(); } return("HarvestOrgan".Translate()); } else { if (part.depth == BodyPartDepth.Inside || part.def.socketed) { return("RemoveOrgan".Translate()); } return("Amputate".Translate()); } }
public override bool IsViolationOnPawn(Pawn pawn, BodyPartRecord part, Faction billDoerFaction) { if ((pawn.Faction == billDoerFaction || pawn.Faction == null) && !pawn.IsQuestLodger()) { return(false); } if (recipe.addsHediff.addedPartProps != null && recipe.addsHediff.addedPartProps.betterThanNatural) { return(false); } return(HealthUtility.PartRemovalIntent(pawn, part) == BodyPartRemovalIntent.Harvest); }
public override bool IsViolationOnPawn(Pawn pawn, BodyPartRecord part, Faction billDoerFaction) { if ((pawn.Faction == billDoerFaction || pawn.Faction == null) && !pawn.IsQuestLodger()) { return(false); } if (HealthUtility.PartRemovalIntent(pawn, part) == BodyPartRemovalIntent.Harvest) { return(true); } return(false); }
public override string GetLabelWhenUsedOn(Pawn pawn, BodyPartRecord part) { if (!pawn.RaceProps.IsMechanoid && !pawn.health.hediffSet.PartOrAnyAncestorHasDirectlyAddedParts(part)) { switch (HealthUtility.PartRemovalIntent(pawn, part)) { case BodyPartRemovalIntent.Amputate: if (part.depth != BodyPartDepth.Inside && !part.def.useDestroyedOutLabel) { return("Amputate".Translate()); } return("RemoveOrgan".Translate()); case BodyPartRemovalIntent.Harvest: return("Harvest".Translate()); default: throw new InvalidOperationException(); } } return(RecipeDefOf.RemoveBodyPart.LabelCap); }
//True if the body part has nothing wrong with it, false otherwise static bool IsClean(Pawn pawn, BodyPartRecord part) { return(Verse.BodyPartRemovalIntent.Harvest == HealthUtility.PartRemovalIntent(pawn, part)); }
public static bool IsViolationOnPawn(Pawn pawn, BodyPartRecord part, Faction billDoerFaction) { return pawn.Faction != billDoerFaction || HealthUtility.PartRemovalIntent(pawn, part) == BodyPartRemovalIntent.Harvest; }
public override bool IsViolationOnPawn(Pawn pawn, BodyPartRecord part, Faction billDoerFaction) { return(pawn.Faction != billDoerFaction && HealthUtility.PartRemovalIntent(pawn, part) == BodyPartRemovalIntent.Harvest); }
public override bool IsViolationOnPawn(Pawn pawn, BodyPartRecord part, Faction billDoerFaction) { return(pawn.Faction != billDoerFaction && !this.recipe.addsHediff.addedPartProps.betterThanNatural && HealthUtility.PartRemovalIntent(pawn, part) == BodyPartRemovalIntent.Harvest); }