A hauler loads up to twice what the door took on its last fresh visit
Self: a carrier that brings only what was taken last time can never find a door that has grown hungrier. LoadLimit is ProbeFactor (2) times the units taken (at least one when any was), capped as before by the hold and by what From holds; a fresh outright refusal still caps it at zero and a good with no fresh sight loads whole. ALoadFollowsWhatTheDoorTook pins six for three taken. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
14e9e11ecd
commit
051020dc5b
2 changed files with 10 additions and 6 deletions
|
|
@ -43,13 +43,16 @@ public static class HaulRun
|
|||
return refused;
|
||||
}
|
||||
|
||||
// How many units of the good the hauler loads: what To took of it on its last visit while that sight is fresh, none of a good it saw
|
||||
// refused outright, and the whole hold of a good it has no fresh sight of (it learns by trying).
|
||||
// How many units of the good the hauler loads: up to ProbeFactor times what To took of it on its last visit while that sight is fresh (a
|
||||
// carrier that brings only what was taken last time never finds a door that has grown hungrier), none of a good it saw refused
|
||||
// outright, and the whole hold of a good it has no fresh sight of (it learns by trying). The hold and what From has cap it further.
|
||||
public const int ProbeFactor = 2;
|
||||
|
||||
private static int LoadLimit(Ship ship, CultRecordKey good)
|
||||
{
|
||||
var sight = ship.HaulSeen?.Sights.FirstOrDefault(candidate => candidate.Good.Key.Equals(good));
|
||||
if (sight == null || !Fresh(ship, sight)) return int.MaxValue;
|
||||
return sight.Took > 0 ? sight.Took : sight.Left > 0 ? 0 : int.MaxValue;
|
||||
return sight.Took > 0 ? Math.Max(1, ProbeFactor * sight.Took) : sight.Left > 0 ? 0 : int.MaxValue;
|
||||
}
|
||||
|
||||
// The units of the good the hold may still take at From: its load limit less what it carries.
|
||||
|
|
|
|||
Loading…
Reference in a new issue