public override void ApplyOnPawn(Pawn pawn, BodyPartRecord part, Pawn billDoer, List <Thing> ingredients, Bill bill) { bool flag = MedicalRecipesUtility.IsClean(pawn, part); bool flag2 = this.IsViolationOnPawn(pawn, part, Faction.OfPlayer); if (billDoer != null) { if (base.CheckSurgeryFail(billDoer, pawn, ingredients, part, bill)) { return; } TaleRecorder.RecordTale(TaleDefOf.DidSurgery, billDoer, pawn); MedicalRecipesUtility.SpawnNaturalPartIfClean(pawn, part, billDoer.Position, billDoer.Map); MedicalRecipesUtility.SpawnThingsFromHediffs(pawn, part, billDoer.Position, billDoer.Map); } DamageDef surgicalCut = DamageDefOf.SurgicalCut; int amount = 99999; pawn.TakeDamage(new DamageInfo(surgicalCut, amount, -1f, null, part, null, DamageInfo.SourceCategory.ThingOrUnknown)); if (flag) { if (pawn.Dead) { ThoughtUtility.GiveThoughtsForPawnExecuted(pawn, PawnExecutionKind.OrganHarvesting); } else { ThoughtUtility.GiveThoughtsForPawnOrganHarvested(pawn); } } if (flag2) { pawn.Faction.AffectGoodwillWith(billDoer.Faction, -20f); } }
public override void ApplyOnPawn(Pawn pawn, BodyPartRecord part, Pawn billDoer, List <Thing> ingredients, Bill bill) { if (IsViolationOnPawn(pawn, part, Faction.OfPlayer)) { ReportViolation(pawn, billDoer, pawn.FactionOrExtraMiniOrHomeFaction, -100, "GoodwillChangedReason_EuthanizedPawn".Translate(pawn.Named("PAWN"))); } ExecutionUtility.DoExecutionByCut(billDoer, pawn); ThoughtUtility.GiveThoughtsForPawnExecuted(pawn, PawnExecutionKind.GenericHumane); }
protected override IEnumerable <Toil> MakeNewToils() { this.FailOnAggroMentalState(TargetIndex.A); yield return(Toils_Interpersonal.GotoPrisoner(pawn, Victim, PrisonerInteractionModeDefOf.Execution).FailOn(() => !Victim.IsPrisonerOfColony || !Victim.guest.PrisonerIsSecure)); Toil execute = new Toil(); execute.initAction = delegate { ExecutionUtility.DoExecutionByCut(execute.actor, Victim); ThoughtUtility.GiveThoughtsForPawnExecuted(Victim, PawnExecutionKind.GenericBrutal); TaleRecorder.RecordTale(TaleDefOf.ExecutedPrisoner, pawn, Victim); }; execute.defaultCompleteMode = ToilCompleteMode.Instant; yield return(execute); }
public override void ApplyOnPawn(Pawn pawn, BodyPartRecord part, Pawn billDoer, List <Thing> ingredients, Bill bill) { bool flag = MedicalRecipesUtility.IsClean(pawn, part); bool flag2 = this.IsViolationOnPawn(pawn, part, Faction.OfPlayer); if (billDoer != null) { if (base.CheckSurgeryFail(billDoer, pawn, ingredients, part, bill)) { return; } TaleRecorder.RecordTale(TaleDefOf.DidSurgery, new object[] { billDoer, pawn }); MedicalRecipesUtility.SpawnNaturalPartIfClean(pawn, part, billDoer.Position, billDoer.Map); MedicalRecipesUtility.SpawnThingsFromHediffs(pawn, part, billDoer.Position, billDoer.Map); } DamageDef surgicalCut = DamageDefOf.SurgicalCut; float amount = 99999f; float armorPenetration = 999f; pawn.TakeDamage(new DamageInfo(surgicalCut, amount, armorPenetration, -1f, null, part, null, DamageInfo.SourceCategory.ThingOrUnknown, null)); if (flag) { if (pawn.Dead) { ThoughtUtility.GiveThoughtsForPawnExecuted(pawn, PawnExecutionKind.OrganHarvesting); } ThoughtUtility.GiveThoughtsForPawnOrganHarvested(pawn); } if (flag2 && pawn.Faction != null && billDoer.Faction != null) { Faction faction = pawn.Faction; Faction faction2 = billDoer.Faction; int goodwillChange = -15; string reason = "GoodwillChangedReason_RemovedBodyPart".Translate(new object[] { part.LabelShort }); GlobalTargetInfo?lookTarget = new GlobalTargetInfo?(pawn); faction.TryAffectGoodwillWith(faction2, goodwillChange, true, true, reason, lookTarget); } }
public override void ApplyOnPawn(Pawn pawn, BodyPartRecord part, Pawn billDoer, List <Thing> ingredients, Bill bill) { pawn.health.AddHediff(base.recipe.addsHediff, part, null); ThoughtUtility.GiveThoughtsForPawnExecuted(pawn, PawnExecutionKind.GenericHumane); }
public override void ApplyOnPawn(Pawn pawn, BodyPartRecord part, Pawn billDoer, List <Thing> ingredients, Bill bill) { ExecutionUtility.DoExecutionByCut(billDoer, pawn); ThoughtUtility.GiveThoughtsForPawnExecuted(pawn, PawnExecutionKind.GenericHumane); }