mirror of
				https://gitgud.io/c0ffeeeeeeee/rimworld-animations.git
				synced 2024-08-15 00:43:45 +00:00 
			
		
		
		
	Start new animation for neverendingsex
This commit is contained in:
		
							parent
							
								
									41b5411c73
								
							
						
					
					
						commit
						138ac25019
					
				
					 3 changed files with 26 additions and 2 deletions
				
			
		
										
											Binary file not shown.
										
									
								
							| 
						 | 
				
			
			@ -24,4 +24,30 @@ namespace Rimworld_Animations
 | 
			
		|||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    [HarmonyPatch(typeof(JobDriver_Sex), "SexTick")]
 | 
			
		||||
    public class HarmonyPatch_JobDriver_Sex2
 | 
			
		||||
    {
 | 
			
		||||
        public static void Postfix(JobDriver_Sex __instance, Pawn pawn)
 | 
			
		||||
        {
 | 
			
		||||
            //if neverending sex and pawn doesn't have an animation,
 | 
			
		||||
            if (__instance.neverendingsex 
 | 
			
		||||
                && __instance is JobDriver_SexBaseReciever receiverJobDriver
 | 
			
		||||
                && !pawn.TryGetComp<CompExtendedAnimator>().IsAnimating)
 | 
			
		||||
            {
 | 
			
		||||
 | 
			
		||||
                //start a new animation for all the pawns paired with receiver job driver
 | 
			
		||||
                List<Pawn> participants = receiverJobDriver.parteners.Append(pawn).ToList();
 | 
			
		||||
                GroupAnimationDef animation = AnimationUtility.FindGroupAnimation(participants, out int reorder);
 | 
			
		||||
                if (animation != null)
 | 
			
		||||
                {
 | 
			
		||||
                    Thing anchor = (Thing)__instance.Bed ?? pawn;
 | 
			
		||||
                    AnimationUtility.StartGroupAnimation(participants, animation, reorder, anchor);
 | 
			
		||||
                }
 | 
			
		||||
                
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -48,8 +48,6 @@ namespace Rimworld_Animations {
 | 
			
		|||
							participantJobDriver.orgasmStartTick = animTicks;
 | 
			
		||||
							participantJobDriver.duration = animTicks;
 | 
			
		||||
						}
 | 
			
		||||
 | 
			
		||||
						
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue