private bool DoesTargetPawnAcceptAdvance() { //if (xxx.config.always_accept_whores) // return true; //Log.Message("[RJW]JobDriver_InvitingVisitors::DoesTargetPawnAcceptAdvance() is called"); if (PawnUtility.EnemiesAreNearby(TargetPawn)) { //Log.Message("[RJW]JobDriver_InvitingVisitors::DoesTargetPawnAcceptAdvance() fail - enemy near"); return(false); } if (!allowedJobs.Contains(TargetPawn.jobs.curJob.def)) { //Log.Message("[RJW]JobDriver_InvitingVisitors::DoesTargetPawnAcceptAdvance() fail - not allowed job"); return(false); } //Log.Message("Will try " + WhoringHelper.WillPawnTryHookup(TargetPawn)); //Log.Message("Appeal " + WhoringHelper.IsHookupAppealing(TargetPawn, W***e)); //Log.Message("Afford " + WhoringHelper.CanAfford(TargetPawn, W***e)); //Log.Message("Need sex " + (xxx.need_some_sex(TargetPawn) >= 1)); W***e.skills.Learn(SkillDefOf.Social, 1.2f); return(WhoringHelper.WillPawnTryHookup(TargetPawn) && WhoringHelper.IsHookupAppealing(TargetPawn, W***e) && WhoringHelper.CanAfford(TargetPawn, W***e) && xxx.need_some_sex(TargetPawn) >= 1f); }
private bool DoesTargetPawnAcceptAdvance() { if (RJWSettings.DebugWhoring) { Log.Message($"JobDriver_InvitingVisitors::DoesTargetPawnAcceptAdvance() - {xxx.get_pawnname(TargetPawn)}"); } //if (RJWSettings.WildMode) return true; if (PawnUtility.EnemiesAreNearby(TargetPawn)) { if (RJWSettings.DebugWhoring) { Log.Message($" fail - enemy near"); } return(false); } if (!allowedJobs.Contains(TargetPawn.jobs.curJob.def)) { if (RJWSettings.DebugWhoring) { Log.Message($" fail - not allowed job"); } return(false); } if (RJWSettings.DebugWhoring) { Log.Message("Will try hookup " + WhoringHelper.WillPawnTryHookup(TargetPawn)); Log.Message("Is w***e appealing " + WhoringHelper.IsHookupAppealing(TargetPawn, W***e)); Log.Message("Can afford w***e " + WhoringHelper.CanAfford(TargetPawn, W***e)); Log.Message("Need sex " + (xxx.need_some_sex(TargetPawn) >= 1)); } if (WhoringHelper.WillPawnTryHookup(TargetPawn) && WhoringHelper.IsHookupAppealing(TargetPawn, W***e) && WhoringHelper.CanAfford(TargetPawn, W***e) && xxx.need_some_sex(TargetPawn) >= 1f) { W***e.skills.Learn(SkillDefOf.Social, 1.2f); return(true); } return(false); }
public static Pawn FindAttractivePawn(Pawn w***e, out int price) { price = 0; if (w***e == null || xxx.is_asexual(w***e)) { if (RJWSettings.DebugWhoring) { Log.Message($" {xxx.get_pawnname(w***e)} is asexual, abort"); } return(null); } //Rand.PopState(); //Rand.PushState(RJW_Multiplayer.PredictableSeed()); FindAttractivePawnHelper client = new FindAttractivePawnHelper { w***e = w***e }; price = WhoringHelper.PriceOfWhore(w***e); int priceOfWhore = price; IntVec3 pos = w***e.Position; IEnumerable <Pawn> potentialClients = w***e.Map.mapPawns.AllPawnsSpawned; potentialClients = potentialClients.Where(x => x != w***e && !x.IsForbidden(w***e) && !x.HostileTo(w***e) && !x.IsPrisoner && x.Position.DistanceTo(pos) < 100 && w***e.CanReserveAndReach(x, PathEndMode.ClosestTouch, Danger.Some, 1) && xxx.is_healthy_enough(x)); potentialClients = potentialClients.Except(potentialClients.Where(client.TraitCheckFail)); if (!potentialClients.Any()) { return(null); } if (RJWSettings.DebugWhoring) { Log.Message($" FindAttractivePawn number of all potential clients {potentialClients.Count()}"); } List <Pawn> valid_targets = new List <Pawn>(); foreach (Pawn target in potentialClients) { if (xxx.can_path_to_target(w***e, target.Position)) { valid_targets.Add(target); } } IEnumerable <Pawn> guestsSpawned = valid_targets.Where(x => x.Faction != w***e.Faction && WhoringHelper.CanAfford(x, w***e, priceOfWhore) && !MemoryChecker(x, ThoughtDef.Named("RJWFailedSolicitation")) && x != LovePartnerRelationUtility.ExistingLovePartner(w***e)); if (guestsSpawned.Any()) { if (RJWSettings.DebugWhoring) { Log.Message($" FindAttractivePawn number of all acceptable Guests {guestsSpawned.Count()}"); } return(guestsSpawned.RandomElement()); } return(null); //use casual sex for colonist hooking if (RJWSettings.DebugWhoring) { Log.Message($" FindAttractivePawn found no guests, trying colonists"); } if (!WhoringHelper.WillPawnTryHookup(w***e)) // will hookup colonists? { return(null); } IEnumerable <Pawn> freeColonists = valid_targets.Where(x => x.Faction == w***e.Faction && Roll_to_skip(x, w***e)); if (RJWSettings.DebugWhoring) { Log.Message($" FindAttractivePawn number of free colonists {freeColonists.Count()}"); } freeColonists = freeColonists.Where(x => client.RelationCheckPass(x) && !MemoryChecker(x, ThoughtDef.Named("RJWTurnedDownWhore"))); if (freeColonists.Any()) { if (RJWSettings.DebugWhoring) { Log.Message($" FindAttractivePawn number of all acceptable Colonists {freeColonists.Count()}"); } return(freeColonists.RandomElement()); } return(null); }