public static void Postfix(ref IEnumerable <Thing> __result, RecipeDef recipeDef, Pawn worker, List <Thing> ingredients) { List <Thing> list = (__result as List <Thing>) ?? __result.ToList <Thing>(); foreach (Corpse corpse in ingredients.OfType <Corpse>() .Where(corpse => corpse.InnerPawn != null && PawnHelper.is_human(corpse.InnerPawn))) { Thing var = ThingMaker.MakeThing(Constants.GeneSeed); if (var != null) { //if astarte more. var.stackCount = corpse.InnerPawn.def == Constants.Astarte ? 20 : 1; list.Add(var); } else { Log.Error("Failed to make GeneSeed"); } } __result = list; return; }
protected override bool BlowOffParts(bool keep) { foreach (var astarteBodyPart in Constants.AstarteBodyParts) { foreach (var part in pawn.def.race.body.GetPartsWithDef(astarteBodyPart)) { PawnHelper.MutatePart(pawn, part); } } return(false); }
protected virtual void GeneSeedMutation() { if (ticks % 1000 != 0) { return; } if (!Rand.MTBEventOccurs(0.5f, 60000f, 1000f)) { return; } //Mutate PawnHelper.mutate(pawn); }