đŸ§ĢInheritance

Inheritance

Inheritance of traits is a peculiarity of the Weird Apes, in fact each Baby will inherit some traits from its parents and other traits will be completely new. Mutated traits will be rarer than inherited traits, and the probability of being able to observe a mutation on Babies increases as the number of breeds a Lady has had increases, in fact:

The probability of mutation of Babies increases/decreases in a range of 50% of the original probability if the rarity of the parents is higher/lower, in this case the rarity of Genesis affects 40% of the mutation, while the rarity Ladies affect 60%.

def NumberMutations(RankGen, RankLad, b):
    # b = n. of remaining Babies of a Lady
    Rg, Rl = float((2500-RankGen)/2500), float((2000-RankLad)/2000)
    R = 0.4*Rg + 0.6*Rl - 0.5  # +-1/2
    V, D = [+2500, +1666, +625, +166], [0,0,0,0]
    for i in range(4):
        D[i] = V[i]*(4-b)*(1+R/2)
    end1 = 1000*(80+5*b-(20-5*b)*(R/2))
    end2,end3,end4,end5 = end1+D[0],end2+D[1],end2+D[2],end2+D[3]
    n = random.randint(1, 100000)
    if 1 <= n <= end1:
        return 0
    elif end1 < n <= end2:
        return 1
    elif end2 < n <= end3:
        return 2
    elif end3 < n <= end4:
        return 3
    elif end4 < n <= end5:
        return 4
    else:                   
        return 5

Last updated