Skip to content

Commit

Permalink
Merge pull request #30 from kbatbouta/development-tactics
Browse files Browse the repository at this point in the history
Small tweak
  • Loading branch information
kbatbouta authored Feb 3, 2023
2 parents d8201ee + 6493f33 commit b87449b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Binary file modified 1.4/Assemblies/CombatAI.dll
Binary file not shown.
6 changes: 3 additions & 3 deletions Source/Rule56/Comps/ThingComp_CombatAI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public ThingComp_CombatAI()

public bool IsSapping
{
get => cellBefore.IsValid && sapperNodes.Count > 0 && GenTicks.TicksGame - sapperStartTick < 4800;
get => cellBefore.IsValid && sapperNodes.Count > 0 && GenTicks.TicksGame - sapperStartTick < 4800 && parent.Position.DistanceToSquared(cellBefore) < 1600;
}

public bool CanSappOrEscort
Expand Down Expand Up @@ -576,7 +576,7 @@ public void StartSapper(List<IntVec3> blocked, IntVec3 cellBefore, bool findEsco
{
return;
}
if (IsSapping)
if (cellBefore.IsValid && sapperNodes.Count > 0 && GenTicks.TicksGame - sapperStartTick < 4800)
{
ReleaseEscorts();
}
Expand Down Expand Up @@ -708,7 +708,7 @@ private void TryStartSapperJob()
if (findEscorts && Rand.Chance(1 - Maths.Max(1f / (escorts.Count + 1f), 0.85f)))
{
int count = escorts.Count;
int countTarget = Rand.Int % 4 + 3 + Maths.Min(sapperNodes.Count, 10);
int countTarget = Rand.Int % 4 + 3 + Maths.Min(sapperNodes.Count, 10) - Maths.Min(Mathf.CeilToInt(pawn.Position.DistanceTo(cellBefore) / 10f), 5);
Faction faction = pawn.Faction;
Predicate<Thing> validator = t =>
{
Expand Down

0 comments on commit b87449b

Please sign in to comment.