rbodleyscott wrote: ↑Fri May 14, 2021 6:17 am
Has his unit dropped below the strength required to get the Keil POA?
If I understand the
FUNCTION PercentKeil(me) properly
Code: Select all
// Determines if unit has enough pikes, heavy weapon men and swordsmen left to qualify as a keil. Returns 0 if not keil, otherwise percent of men qualifying for keil POA
// No individual man should have more than one of these attribs.
FUNCTION PercentKeil(me)
{
int percent;
int original_block_size;
int block_size;
int ret;
ret = 0;
percent = GetAttrib(me, "Pike"); // Pikes
if ((percent >= 40) || ((percent >= 25) && (GetAttrib(me, "Heavy_Weapon") >= 25))) // Unit at least 40% pikes (or, to cope with Elizabethan foot, at least 25% pikes and 25% heavy weapon).
{
// Add heavy weapon men and swordsmen
percent = percent + GetAttrib(me, "Heavy_Weapon") + GetAttrib(me,"Swordsmen");
original_block_size = percent * GetBaseAttrib(me, "UnitSize"));
original_block_size /= 100;
if (original_block_size > 500) // Not >= because of 50:50 early Later Tercios
{
block_size = percent * GetAttrib(me, "UnitSize"));
block_size *= GetAttrib(me, "TotalMen");
block_size /= StartingStrength(me);
block_size /= 100;
if (block_size >= 400)
{
ret = percent;
}
}
}
return ret;
}
the current SnuggleBunnies'
block_size level is 50*1600*1697/1920/100 = 707, which is much more than 400. This parameter is 800 for initial Early Tercio, and this unit must lose about half of its original strength in order to lose the Keil feature.
The unit disorder parameter depends on stream characteristics (ordinary, large or medium and deep)
Code: Select all
// Return tile disorder value for unit (Returns a standard value if unit not specified)
FUNCTION TileDisorder(me, x, y)
{
int disorder;
int terrain;
disorder = 0;
terrain = GetTerrainCoverValue(x, y, 4);
// Medium or Heavy Fortifications
if (GetTerrainCoverValue(x, y, 3) > 1)
{
if (me == -1)
{
terrain = 3;
}
else
{
// If inside fortification, count as clear
if ((GetUnitX(me) == x) && (GetUnitY(me) == y))
{
terrain = 0;
}
else // If outside, count as difficult if across the fortifications
{
if (IsTileEdgeDefendibleObstacle(x, y, GetUnitX(me), GetUnitY(me)) > 1) // Fortified edge
{
terrain = 3;
}
else
{
terrain = 0;
}
}
}
}
// Difficult
if (terrain == 3)
{
if (me == -1)
{
disorder = 200;
}
else
{
if ((IsUnitSquadType(me, "Light_Foot") == 1) || (IsUnitSquadType(me, "Commanded_Shot") == 1))
{
disorder = 0;
}
else
{
if (IsUnitSquadType(me, "Mixed_Foot") == 1)
{
disorder = 134; // Quick and dirty estimate based on 1/3 pike, 2/3 shot. However, could be calculated according to proportion of weapon capabilities
}
else
{
if ((IsUnitSquadType(me, "Medium_Foot") == 1) || (IsUnitSquadType(me, "Warriors") == 1) || (IsUnitSquadType(me, "Dragoons") == 1) || (IsUnitSquadType(me, "Mob") == 1))
{
disorder = 100;
}
else
{
disorder = 200;
}
}
}
}
}
// Rough
if (terrain == 2)
{
if (me == -1)
{
disorder = 100;
}
else
{
if ((IsUnitSquadType(me, "Light_Foot") == 1) || (IsUnitSquadType(me, "Commanded_Shot") == 1) || (IsUnitSquadType(me, "Medium_Foot") == 1) || (IsUnitSquadType(me, "Warriors") == 1) || (IsUnitSquadType(me, "Dragoons") == 1) || (IsUnitSquadType(me, "Mob") == 1))
{
disorder = 0;
}
else
{
if (IsUnitSquadType(me, "Mixed_Foot") == 1)
{
disorder = 34; // Quick and dirty estimate based on 1/3 pike, 2/3 shot. However, could be calculated according to proportion of weapon capabilities
}
else
{
if ((IsUnitSquadType(me, "Artillery") == 1) || ((IsUnitSquadType(me, "Gendarmes") == 1) && (GetAttrib(me, "BodyArmour") > 200)))
{
disorder = 200;
}
else
{
disorder = 100;
}
}
}
}
}
return disorder;
}
terrain = GetTerrainCoverValue(x, y, 4) is the key script. Its value you can see in
Terrain.txt DATA folder for different kinds of stream
[Stream] COVERVALUE4
1 // 1 = not open but otherwise clear
[StreamMedium] COVERVALUE4
2 // 2 = Rough
[StreamDeep] COVERVALUE4
3 // 3 = Difficult
If Later Tercio is on Stream or Large/Medium Stream Early Tercio has +50 PoA during melee phase. If Later Tercio is on Deep Stream Early Tercio has no melee PoA advantage, as terrain is Difficult and disorder = 200 - severely disordered. Which is most likely in this case.
Moderately Disordered is not quite correct description for this I think. As well
Sligthly Disordered when Later Tercio is on Large/Medium Stream and no string of disorder when Later Tercio is on Stream.