2023-01-16 16:16:25 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Verse;
|
|
|
|
|
using Verse.AI;
|
|
|
|
|
using rjw;
|
|
|
|
|
namespace RJW_Genes
|
|
|
|
|
{
|
|
|
|
|
public class ThinkNode_NewFlirtTarget : ThinkNode
|
|
|
|
|
{
|
|
|
|
|
public override ThinkResult TryIssueJobPackage(Pawn pawn, JobIssueParams jobParams)
|
|
|
|
|
{
|
2023-01-17 15:44:08 +00:00
|
|
|
|
List<Pawn> validTargets = ValidTargets(pawn, pawn.Map).ToList();
|
|
|
|
|
Pawn new_target = validTargets.NullOrEmpty() ? null : validTargets.RandomElement();
|
2023-01-16 16:16:25 +00:00
|
|
|
|
if (new_target != null)
|
|
|
|
|
{
|
|
|
|
|
pawn.mindState.duty.focus = new_target;
|
|
|
|
|
}
|
|
|
|
|
return ThinkResult.NoJob;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private IEnumerable<Pawn> ValidTargets(Pawn pawn, Map map)
|
|
|
|
|
{
|
|
|
|
|
foreach (Pawn pawn2 in map.mapPawns.FreeAdultColonistsSpawned)
|
|
|
|
|
{
|
|
|
|
|
if (pawn != null && pawn2 != null && pawn != pawn2 && !pawn2.jobs.curDriver.asleep && SexAppraiser.would_fuck(pawn, pawn2) > 0.1f)
|
|
|
|
|
{
|
|
|
|
|
yield return pawn2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//IEnumerator<Pawn> enumerator = null;
|
|
|
|
|
yield break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|