Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (this.ShouldBeDowned())
- {
- if (!this.forceDowned && dinfo != null && dinfo.Value.Def.ExternalViolenceFor(this.pawn) && !this.pawn.IsWildMan() && (this.pawn.Faction == null || !this.pawn.Faction.IsPlayer) && (this.pawn.HostFaction == null || !this.pawn.HostFaction.IsPlayer))
- {
- bool flag = ModsConfig.BiotechActive && this.pawn.genes != null && this.pawn.genes.HasGene(GeneDefOf.Deathless);
- float num;
- if (flag && this.pawn.Faction == Faction.OfPlayer)
- {
- num = 0f;
- }
- else if (this.pawn.RaceProps.Animal)
- {
- num = 0.5f;
- }
- else if (this.pawn.RaceProps.IsMechanoid)
- {
- num = 1f;
- }
- else
- {
- num = (Find.Storyteller.difficulty.unwaveringPrisoners ? HealthTuning.DeathOnDownedChance_NonColonyHumanlikeFromPopulationIntentCurve : HealthTuning.DeathOnDownedChance_NonColonyHumanlikeFromPopulationIntentCurve_WaveringPrisoners).Evaluate(StorytellerUtilityPopulation.PopulationIntent) * Find.Storyteller.difficulty.enemyDeathOnDownedChanceFactor;
- }
- if (Rand.Chance(num))
- {
- if (DebugViewSettings.logCauseOfDeath)
- {
- Log.Message("CauseOfDeath: chance on downed " + num.ToStringPercent());
- }
- if (flag && !this.pawn.Dead)
- {
- this.pawn.health.AddHediff(HediffDefOf.MissingBodyPart, this.pawn.health.hediffSet.GetBrain(), dinfo, null);
- return;
- }
- this.pawn.Kill(dinfo, null);
- return;
- }
- }
- this.forceDowned = false;
- this.MakeDowned(dinfo, hediff);
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement