mirror of
				https://gitgud.io/c0ffeeeeeeee/rjw-toys-and-masturbation.git
				synced 2024-08-15 00:43:44 +00:00 
			
		
		
		
	Add project files.
This commit is contained in:
		
							parent
							
								
									d2dbc71d94
								
							
						
					
					
						commit
						39924e2af5
					
				
					 17 changed files with 487 additions and 0 deletions
				
			
		
							
								
								
									
										17
									
								
								Source/ThingComps/CompProperties_SexToy.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								Source/ThingComps/CompProperties_SexToy.cs
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,17 @@
 | 
			
		|||
using System;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using System.Text;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
using RimWorld;
 | 
			
		||||
using Verse;
 | 
			
		||||
 | 
			
		||||
namespace RJW_ToysAndMasturbation {
 | 
			
		||||
    public class CompProperties_SexToy : CompProperties {
 | 
			
		||||
 | 
			
		||||
        public CompProperties_SexToy() {
 | 
			
		||||
            compClass = typeof(CompSexToy);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										59
									
								
								Source/ThingComps/CompSexToy.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										59
									
								
								Source/ThingComps/CompSexToy.cs
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,59 @@
 | 
			
		|||
using System;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using System.Text;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
using Verse;
 | 
			
		||||
using RimWorld;
 | 
			
		||||
using Verse.AI;
 | 
			
		||||
using rjw;
 | 
			
		||||
 | 
			
		||||
namespace RJW_ToysAndMasturbation {
 | 
			
		||||
    public class CompSexToy : ThingComp {
 | 
			
		||||
 | 
			
		||||
		public static IntVec3 FapLocation(Pawn p) => (new JobGiver_Masturbate()).FindFapLocation(p);
 | 
			
		||||
 | 
			
		||||
		public override IEnumerable<FloatMenuOption> CompFloatMenuOptions(Pawn pawn) {
 | 
			
		||||
 | 
			
		||||
			if (!pawn.CanReach(parent, PathEndMode.Touch, Danger.Deadly)) {
 | 
			
		||||
				yield return new FloatMenuOption(FloatMenuOptionLabel(pawn) + " (" + "NoPath".Translate() + ")", null);
 | 
			
		||||
			}
 | 
			
		||||
			else if (!pawn.CanReserve(parent)) {
 | 
			
		||||
				yield return new FloatMenuOption(FloatMenuOptionLabel(pawn) + " (" + "Reserved".Translate() + ")", null);
 | 
			
		||||
			}
 | 
			
		||||
			else if (!pawn.health.capacities.CapableOf(PawnCapacityDefOf.Manipulation)) {
 | 
			
		||||
				yield return new FloatMenuOption(FloatMenuOptionLabel(pawn) + " (" + "Incapable".Translate() + ")", null);
 | 
			
		||||
			}
 | 
			
		||||
			else if (!xxx.can_be_fucked(pawn) && !xxx.can_fuck(pawn)) {
 | 
			
		||||
				yield return new FloatMenuOption(FloatMenuOptionLabel(pawn) + " (" + "Incapable".Translate() + ")", null);
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			else {
 | 
			
		||||
 | 
			
		||||
				yield return new FloatMenuOption(FloatMenuOptionLabel(pawn), delegate {
 | 
			
		||||
 | 
			
		||||
					if (RJWPreferenceSettings.FapInBed && pawn.jobs.curDriver is JobDriver_LayDown) {
 | 
			
		||||
						Building_Bed bed = ((JobDriver_LayDown)pawn.jobs.curDriver).Bed;
 | 
			
		||||
						if (bed != null) {
 | 
			
		||||
							Job j = JobMaker.MakeJob(MasturbateToyDefOf.MasturbateWithToy, parent, bed, bed.Position);
 | 
			
		||||
							j.count = 1;
 | 
			
		||||
							pawn.jobs.TryTakeOrderedJob(j);
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
					else {
 | 
			
		||||
						Job j = JobMaker.MakeJob(MasturbateToyDefOf.MasturbateWithToy, parent, null, FapLocation(pawn));
 | 
			
		||||
						j.count = 1;
 | 
			
		||||
						pawn.jobs.TryTakeOrderedJob(j);
 | 
			
		||||
					}
 | 
			
		||||
				});
 | 
			
		||||
				
 | 
			
		||||
				
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		private string FloatMenuOptionLabel(Pawn pawn) {
 | 
			
		||||
			return "Use sex toy";
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue