I read a lot of forum posts/wiki stuff etc. over the last week about taming thrumbos. Here is why; I heal-bonded a 29 yo thrumbo female early in game and wanted to have a mate for her. However, all male thrumbo's (five of 'em through several events) that followed would rather get killed than being tamed or bond. So I began thinking. Was it a fluke, was it because of her low age, should I use animal beds or medicine? It slowly drove me 'mad'. So I eventually decided to decompile and look in the Assembly. Of course things can (and probably will) change with new releases. This is from Alpha 16 sources.
I'm posting this as a new topic, because previous topics about this subject are already some months old (or older) and necroing them might not be appropriate.
I can't find any spoiler tags so, please stop reading here if you do not want to.
.
.
.
.
For me it's quite obvious. Of course I left out a lot of code and added some stuff in brackets to summarize or clarify parts. But for the bond chance, this is basically it.
TryDevelopBondRelation is called with a bond chance of .004 So that makes this base chance 1 in 250, which is only modified (chances diminish) by other active bonds.
Nothing about the faction patching you up, had riddled you with bullets just earlier, comfortable animal beds, a good roof, the animals skill... just a base chance on every heal applied. This is not mentioned as a critique of any kind, it's just what it is, and means I just have to try a little harder to get Antonina her mate.
I'm posting this as a new topic, because previous topics about this subject are already some months old (or older) and necroing them might not be appropriate.
I can't find any spoiler tags so, please stop reading here if you do not want to.
.
.
.
.
For me it's quite obvious. Of course I left out a lot of code and added some stuff in brackets to summarize or clarify parts. But for the bond chance, this is basically it.
Code Select
// RimWorld.TendUtility
public static void DoTend(Pawn doctor, Pawn patient, Medicine medicine)
{
...
if (doctor != null && doctor.RaceProps.Humanlike && patient.RaceProps.Animal && RelationsUtility.TryDevelopBondRelation(doctor, patient, 0.004f) && doctor.Faction != null && doctor.Faction != patient.Faction)
{
InteractionWorker_RecruitAttempt.DoRecruit(doctor, patient, 1f, false); (this function only formalizes the bond and does some UI stuff)
}
...
}
// RimWorld.RelationsUtility
public static bool TryDevelopBondRelation(Pawn humanlike, Pawn animal, float baseChance)
{
... (breaking conditions, like the bond already exists, or animal already has a bond are handled first)
...
int num = 0; (base chance is reduced through animal or humanlike having other, active (as in not dead), direct relations)
List<DirectPawnRelation> directRelations = animal.relations.DirectRelations;
for (int i = 0; i < directRelations.Count; i++)
{
if (directRelations[i].def == PawnRelationDefOf.Bond && !directRelations[i].otherPawn.Dead)
{
num++;
}
}
int num2 = 0;
List<DirectPawnRelation> directRelations2 = humanlike.relations.DirectRelations;
for (int j = 0; j < directRelations2.Count; j++)
{
if (directRelations2[j].def == PawnRelationDefOf.Bond && !directRelations2[j].otherPawn.Dead)
{
num2++;
}
}
if (num > 0)
{
baseChance *= Mathf.Pow(0.2f, (float)num);
}
if (num2 > 0)
{
baseChance *= Mathf.Pow(0.55f, (float)num2);
}
...
if (Rand.Value < baseChance) (Rand.Value is a random float between (and including) 0 and 1)
{
... (relation is added)
return true
}
return false
}
TryDevelopBondRelation is called with a bond chance of .004 So that makes this base chance 1 in 250, which is only modified (chances diminish) by other active bonds.
Nothing about the faction patching you up, had riddled you with bullets just earlier, comfortable animal beds, a good roof, the animals skill... just a base chance on every heal applied. This is not mentioned as a critique of any kind, it's just what it is, and means I just have to try a little harder to get Antonina her mate.