Minor tweaks for rjw 4.1.0 +

Relevant animation context when applicable
This commit is contained in:
Platinum 2020-04-18 08:24:09 -07:00
parent e2c80c9423
commit 7f1e2314dd
8 changed files with 44 additions and 13 deletions

View file

@ -14,7 +14,7 @@ namespace Rimworld_Animations {
Note: always make the list in this order:
Female pawns, animal female pawns, male pawns, animal male pawns
*/
public static AnimationDef tryFindAnimation(ref List<Pawn> participants) {
public static AnimationDef tryFindAnimation(ref List<Pawn> participants, rjw.xxx.rjwSextype sexType = 0) {
//aggressors first
participants = participants.OrderByDescending(p => p.jobs.curDriver is rjw.JobDriver_SexBaseInitiator).ToList();
@ -84,6 +84,13 @@ namespace Rimworld_Animations {
return true;
});
List<AnimationDef> optionsWithSexType = options.ToList().FindAll(x => x.sexTypes.Contains(sexType));
if (optionsWithSexType.Any()) {
Log.Message("Selecting animation for rjwSexType " + sexType.ToStringSafe() + "...");
return optionsWithSexType.RandomElement();
}
if (options != null && options.Any()) {
Log.Message("Randomly selecting animation...");
return options.RandomElement();