Skip to content
Snippets Groups Projects
Commit a40859c1 authored by Ed86's avatar Ed86
Browse files

cleanup whoring jobgiver

parent ce9a2400
No related branches found
No related tags found
No related merge requests found
......@@ -130,8 +130,8 @@ namespace rjw
if (!potentialClients.Any()) return null;
//Log.Message("[RJW] JobGiver_WhoreInvitingVisitors::FindAttractivePawn whore: " + xxx.get_pawnname(whore));
//Log.Message("[RJW] JobGiver_WhoreInvitingVisitors::FindAttractivePawn number of potential clients pass1 " + potentialClients.Count());
//Log.Message(" FindAttractivePawn whore: " + xxx.get_pawnname(whore));
//Log.Message(" FindAttractivePawn number of all potential clients " + potentialClients.Count());
List<Pawn> valid_targets = new List<Pawn>();
......@@ -146,36 +146,34 @@ namespace rjw
&& !MemoryChecker(x, ThoughtDef.Named("RJWFailedSolicitation"))
&& x != LovePartnerRelationUtility.ExistingLovePartner(whore));
//Log.Message("[RJW] JobGiver_WhoreInvitingVisitors::FindAttractivePawn number of potential clients pass2 " + potentialClients.Count());
if (guestsSpawned.Any())
{
//Log.Message("[RJW] JobGiver_WhoreInvitingVisitors::FindAttractivePawn number of acceptable guests " + guestsSpawned.Count());
//Log.Message(" FindAttractivePawn number of acceptable Guests " + guestsSpawned.Count());
return guestsSpawned.RandomElement();
}
//Log.Message("[RJW] JobGiver_WhoreInvitingVisitors::FindAttractivePawn - found no guests, trying colonists");
//Log.Message(" FindAttractivePawn - found no guests, trying colonists");
if (!WhoringHelper.WillPawnTryHookup(whore))
if (!WhoringHelper.WillPawnTryHookup(whore))// will hookup colonists?
{
return null;
}
IEnumerable<Pawn> freeColonists = valid_targets.Where(x => x.Faction == whore.Faction
&& Roll_to_skip(x, whore));
//Log.Message("[RJW] JobGiver_WhoreInvitingVisitors::FindAttractivePawn number of free colonists " + freeColonists.Count());
//Log.Message(" FindAttractivePawn number of free colonists " + freeColonists.Count());
freeColonists = freeColonists.Where(x => client.RelationCheckPass(x) && !MemoryChecker(x, ThoughtDef.Named("RJWTurnedDownWhore")));
//Log.Message("[RJW] JobGiver_WhoreInvitingVisitors::FindAttractivePawn number of acceptable colonists " + freeColonists.Count());
if (freeColonists.Any())
{
//Log.Message("[RJW] JobGiver_WhoreInvitingVisitors::FindAttractivePawn number of acceptable guests " + guestsSpawned.Count());
//Log.Message(" FindAttractivePawn number of acceptable Colonists " + freeColonists.Count());
return freeColonists.RandomElement();
}
//Log.Message(" FindAttractivePawn - found no clients found");
return null;
}
......@@ -194,19 +192,24 @@ namespace rjw
return null;
}
Building_Bed whorebed = xxx.FindBed(pawn);
if (whorebed == null || !xxx.CanUse(pawn, whorebed))
{
return null;
}
int price;
Pawn client = FindAttractivePawn(pawn, out price);
//Log.Message("[RJW] JobGiver_WhoreInvitingVisitors::TryGiveJob( " + xxx.get_pawnname(pawn) + " ) called1 - pawn2 is " + (pawn2 == null ? "NULL" : xxx.get_pawnname(pawn2)));
if (client == null)
{
return null;
}
Building_Bed whorebed = xxx.FindBed(pawn);
if (whorebed == null || !xxx.CanUse(pawn, whorebed) || !client.CanReach(whorebed, PathEndMode.OnCell, Danger.Some))
if (!client.CanReach(whorebed, PathEndMode.OnCell, Danger.Some))
{
return null;
}
//Log.Message("[RJW] JobGiver_WhoreInvitingVisitors::TryGiveJob( " + xxx.get_pawnname(pawn) + " ) whore - " + xxx.get_pawnname(client) + " is client.");
//Log.Message("[RJW] JobGiver_WhoreInvitingVisitors::TryGiveJob( " + xxx.get_pawnname(pawn) + " ) is whore, " + xxx.get_pawnname(client) + " is client.");
//whorebed.priceOfWhore = price;
return new Job(xxx.whore_inviting_visitors, client, whorebed);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment