Пример #1
0
    public Genes CrossGenes(Genes other, Genes out_)
    {
        //crosses all genes on object and puts result into out_
        List <Gene> newGenes = new List <Gene>();

        foreach (Gene gene in genes)
        {
            try
            {
                Gene matching = other.GetGene(gene.name);
                newGenes.Add(gene.CrossGene(matching, gene.name));
            }
            catch (ArgumentException e)
            {
                print(e);
                Debug.LogWarning(String.Format("'{0}' Could not find a matching gene for '{1}' in '{2}', skipping...", name, gene.name, other.gameObject.name), gameObject);
            }
        }

        out_.genes.Clear();
        foreach (Gene gene in newGenes)
        {
            out_.SetGene(gene);
        }

        return(out_);
    }
Пример #2
0
            static public void Postfix(ref float __result, ref Pawn __instance)
            {
                if (!Genes.EffectsThing(__instance))
                {
                    return;
                }

                __result = __result * Genes.GetGene(__instance, AnimalGenetics.Health);
            }
Пример #3
0
            static public void Postfix(ref int __result, CompShearable __instance)
            {
                if (!Genes.EffectsThing(__instance.parent))
                {
                    return;
                }

                __result = (int)(__result * Genes.GetGene((Pawn)(__instance.parent), AnimalGenetics.GatherYield));
            }
Пример #4
0
            static public void Postfix(ref float __result, Pawn __1)
            {
                if (!Genes.EffectsThing(__1))
                {
                    return;
                }

                __result = __result * Genes.GetGene(__1, AnimalGenetics.Damage);
            }
Пример #5
0
            static public void Postfix(ref float __result, Pawn __0)
            {
                if (!Genes.EffectsThing(__0))
                {
                    return;
                }

                __result = __result * Genes.GetGene(__0, StatDefOf.CarryingCapacity);
            }
Пример #6
0
 public static void AlphaAnimals_get_ResourceAmount_Patch(ref int __result, CompHasGatherableBodyResource __instance)
 {
     __result = (int)(__result * Genes.GetGene((Pawn)__instance.parent, AnimalGenetics.GatherYield));
 }
Пример #7
0
 public static void ChemicalsAndNeutroamine_get_ResourceAmountPatch(ref int __result, CompHasGatherableBodyResource __instance)
 {
     __result = (int)(__result * Genes.GetGene((Pawn)__instance.parent, AnimalGenetics.GatherYield));
 }