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

@ -4,6 +4,10 @@
<defName>Quadruped_Doggystyle</defName>
<label>quadruped doggystyle</label>
<sounds>true</sounds>
<sexTypes>
<li>Anal</li>
<li>Vaginal</li>
</sexTypes>
<actors>
<li>
<defNames>
@ -19,6 +23,8 @@
<isFucking>true</isFucking>
</li>
</actors>
<animationStages>
<li>

View file

@ -4,6 +4,9 @@
<defName>Tribadism</defName>
<label>scissoring</label>
<sounds>true</sounds>
<sexTypes>
<li>Scissoring</li>
</sexTypes>
<actors>
<li>
<defNames>

View file

@ -4,6 +4,9 @@
<defName>Double_Penetration</defName>
<label>double penetration</label>
<sounds>true</sounds>
<sexTypes>
<li>DoublePenetration</li>
</sexTypes>
<actors>
<li>
<defNames>

View file

@ -5,6 +5,10 @@
<defName>Doggystyle</defName>
<label>doggystyle</label>
<sounds>true</sounds>
<sexTypes>
<li>Vaginal</li>
<li>Anal</li>
</sexTypes>
<actors>
<li>
<!--each type cooresponds to an animation clip in each animationStage-->
@ -450,6 +454,9 @@
<defName>Blowjob</defName>
<label>blowjob</label>
<sounds>true</sounds>
<sexTypes>
<li>Oral</li>
</sexTypes>
<actors>
<li>
<!--each type cooresponds to an animation clip in each animationStage-->
@ -847,6 +854,10 @@
<defName>ReverseStandAndCarry</defName>
<label>ReverseStandAndCarry</label>
<sounds>true</sounds>
<sexTypes>
<li>Anal</li>
<li>Oral</li>
</sexTypes>
<actors>
<li>
<!--each type cooresponds to an animation clip in each animationStage-->

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();

View file

@ -13,6 +13,7 @@ namespace Rimworld_Animations {
public List<Actor> actors;
public int animationTimeTicks = 0; //do not set manually
public bool sounds = false;
public List<rjw.xxx.rjwSextype> sexTypes;
public override void PostLoad() {
base.PostLoad();

View file

@ -19,7 +19,7 @@ namespace Rimworld_Animations {
return;
}
Pawn Target = __instance.Target;
Pawn Target = __instance.Target as Pawn;
Pawn pawn = __instance.pawn;
Building_Bed bed = __instance.Bed;
@ -33,22 +33,22 @@ namespace Rimworld_Animations {
bed = (__instance as JobDriver_SexCasualForAnimation).Bed;
}
if (__instance.Target.jobs?.curDriver is JobDriver_SexBaseReciever) {
if ((__instance.Target as Pawn).jobs?.curDriver is JobDriver_SexBaseReciever) {
if (!(Target.jobs.curDriver as JobDriver_SexBaseReciever).parteners.Contains(pawn)) {
(Target.jobs.curDriver as JobDriver_SexBaseReciever).parteners.Add(pawn);
}
if (bed != null) {
RerollAnimations(Target, __instance.duration, bed as Thing);
RerollAnimations(Target, __instance.duration, bed as Thing, __instance.sexType);
}
else {
RerollAnimations(Target, __instance.duration);
RerollAnimations(Target, __instance.duration, sexType: __instance.sexType);
}
}
}
public static void RerollAnimations(Pawn pawn, int duration, Thing bed = null) {
public static void RerollAnimations(Pawn pawn, int duration, Thing bed = null, xxx.rjwSextype sexType = xxx.rjwSextype.None) {
if(pawn == null || !(pawn.jobs?.curDriver is JobDriver_SexBaseReciever)) {
Log.Message("Error: Tried to reroll animations when pawn isn't sexing");
@ -61,7 +61,7 @@ namespace Rimworld_Animations {
pawnsToAnimate = pawnsToAnimate.Append(pawn).ToList();
}
AnimationDef anim = AnimationUtility.tryFindAnimation(ref pawnsToAnimate);
AnimationDef anim = AnimationUtility.tryFindAnimation(ref pawnsToAnimate, sexType);
if (anim != null) {
@ -138,10 +138,10 @@ namespace Rimworld_Animations {
__instance.pawn.mindState.canLovinTick = Find.TickManager.TicksGame + ticksToNextLovin;
}
if (__instance.Target.jobs?.curDriver is JobDriver_SexBaseReciever) {
if ((__instance.Target as Pawn)?.jobs?.curDriver is JobDriver_SexBaseReciever) {
if (__instance.pawn.TryGetComp<CompBodyAnimator>().isAnimating) {
List<Pawn> parteners = (__instance.Target.jobs.curDriver as JobDriver_SexBaseReciever).parteners;
List<Pawn> parteners = ((__instance.Target as Pawn)?.jobs.curDriver as JobDriver_SexBaseReciever).parteners;
for (int i = 0; i < parteners.Count; i++) {
@ -153,13 +153,13 @@ namespace Rimworld_Animations {
__instance.Target.TryGetComp<CompBodyAnimator>().isAnimating = false;
if (xxx.is_human(__instance.Target)) {
__instance.Target.Drawer.renderer.graphics.ResolveApparelGraphics();
PortraitsCache.SetDirty(__instance.Target);
if (xxx.is_human((__instance.Target as Pawn))) {
(__instance.Target as Pawn)?.Drawer.renderer.graphics.ResolveApparelGraphics();
PortraitsCache.SetDirty((__instance.Target as Pawn));
}
}
(__instance.Target.jobs.curDriver as JobDriver_SexBaseReciever).parteners.Remove(__instance.pawn);
((__instance.Target as Pawn)?.jobs.curDriver as JobDriver_SexBaseReciever).parteners.Remove(__instance.pawn);
}