mirror of
https://gitgud.io/Ed86/rjw-whoring.git
synced 2024-08-15 00:03:25 +00:00
- checking if the soliciting memory is related to the correct pawns during whoring hookup attempts
- more logging for whoring hookup attempts
This commit is contained in:
parent
2b326e0e97
commit
2a2556ec36
2 changed files with 40 additions and 4 deletions
Binary file not shown.
|
@ -19,6 +19,23 @@ namespace rjwwhoring
|
||||||
return val == null ? false : true;
|
return val == null ? false : true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Thought_Memory GetMemory(Pawn pawn, Pawn target, ThoughtDef thought)
|
||||||
|
{
|
||||||
|
Thought_Memory val = pawn.needs.mood.thoughts.memories.Memories.Find(
|
||||||
|
(Thought_Memory x) =>
|
||||||
|
{
|
||||||
|
if (x.def != thought)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (x.otherPawn == null || x.otherPawn != target)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
//[SyncMethod]
|
//[SyncMethod]
|
||||||
private static bool Roll_to_skip(Pawn client, Pawn whore)
|
private static bool Roll_to_skip(Pawn client, Pawn whore)
|
||||||
{
|
{
|
||||||
|
@ -185,10 +202,29 @@ namespace rjwwhoring
|
||||||
|
|
||||||
//if (RJWSettings.DebugWhoring) ModLog.Message($" number of clients can memory OK {guestsSpawned.Count()}");
|
//if (RJWSettings.DebugWhoring) ModLog.Message($" number of clients can memory OK {guestsSpawned.Count()}");
|
||||||
|
|
||||||
IEnumerable<Pawn> guestsSpawned = valid_targets.Where(x => x.Faction != whore.Faction
|
List<Pawn> guestsSpawned = new List<Pawn>();
|
||||||
&& !MemoryChecker(x, ThoughtDef.Named("RJWFailedSolicitation"))
|
|
||||||
&& WhoringHelper.CanAfford(x, whore, priceOfWhore)
|
foreach(Pawn x in valid_targets)
|
||||||
&& x != LovePartnerRelationUtility.ExistingLovePartner(whore));
|
{
|
||||||
|
bool canAfford = WhoringHelper.CanAfford(x, whore, priceOfWhore);
|
||||||
|
Thought_Memory refusedMmeory = GetMemory(x, whore, ThoughtDef.Named("RJWFailedSolicitation"));
|
||||||
|
bool refused = refusedMmeory != null;
|
||||||
|
DirectPawnRelation relationship = LovePartnerRelationUtility.ExistingLoveRealtionshipBetween(whore, x);
|
||||||
|
bool relation = relationship != null;
|
||||||
|
bool differentFaction = x.Faction != whore.Faction;
|
||||||
|
|
||||||
|
bool finalResult = canAfford && !refused && !relation && differentFaction;
|
||||||
|
|
||||||
|
if (WhoringBase.DebugWhoring)
|
||||||
|
{
|
||||||
|
ModLog.Message($"Pawn {x.Name} is an {(finalResult ? "acceptable" : "unacceptable")} client for {whore.Name}. Explanation: canAfford {canAfford.ToString()} refused: {refused.ToString()} relation: {relation.ToString()} differentFaction: {differentFaction.ToString()}");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (canAfford && !refused && !relation && differentFaction)
|
||||||
|
guestsSpawned.Add(x);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (guestsSpawned.Any())
|
if (guestsSpawned.Any())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue