sloppyness → sloppiness
Patch By: Nescio Differential Revision: D3003 This was SVN commit r24040.
This commit is contained in:
1 parent
d54ba356b6
commit
7335fc793a
7 files changed
+40
-14
No files matched your search
@@ -37,7 +37,7 @@ Formation.prototype.Schema =
|
||||
"<element name='WidthDepthRatio' a:help='Average width-to-depth ratio, counted in number of units.'>" +
|
||||
"<ref name='nonNegativeDecimal'/>" +
|
||||
"</element>" +
|
||||
"<element name='Sloppyness' a:help='Sloppyness in meters (the max difference between the actual and the perfectly aligned formation position.'>" +
|
||||
"<element name='Sloppiness' a:help='The maximum difference between the actual and the perfectly aligned formation position, in meters.'>" +
|
||||
"<ref name='nonNegativeDecimal'/>" +
|
||||
"</element>" +
|
||||
"<optional>" +
|
||||
@@ -99,7 +99,7 @@ Formation.prototype.Init = function(deserialized = false)
|
||||
"width": +this.template.UnitSeparationWidthMultiplier,
|
||||
"depth": +this.template.UnitSeparationDepthMultiplier
|
||||
};
|
||||
this.sloppyness = +this.template.Sloppyness;
|
||||
this.sloppiness = +this.template.Sloppiness;
|
||||
this.widthDepthRatio = +this.template.WidthDepthRatio;
|
||||
this.minColumns = +(this.template.MinColumns || 0);
|
||||
this.maxColumns = +(this.template.MaxColumns || 0);
|
||||
@@ -762,8 +762,8 @@ Formation.prototype.ComputeFormationOffsets = function(active, positions)
|
||||
x += side * centerGap / 2;
|
||||
}
|
||||
let column = Math.ceil(n / 2) + Math.ceil(c / 2) * side;
|
||||
let r1 = randFloat(-1, 1) * this.sloppyness;
|
||||
let r2 = randFloat(-1, 1) * this.sloppyness;
|
||||
let r1 = randFloat(-1, 1) * this.sloppiness;
|
||||
let r2 = randFloat(-1, 1) * this.sloppiness;
|
||||
|
||||
offsets.push(new Vector2D(x + r1, z + r2));
|
||||
offsets[offsets.length - 1].row = r + 1;
|
||||
|
||||
@@ -212,8 +212,21 @@ function TestFormationExiting(mode)
|
||||
GetHitpoints: function() { return 0; },
|
||||
});
|
||||
|
||||
var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|
||||
var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
|
||||
let controllerFormation = ConstructComponent(controller, "Formation", {
|
||||
"FormationName": "Line Closed",
|
||||
"FormationShape": "square",
|
||||
"ShiftRows": "false",
|
||||
"SortingClasses": "",
|
||||
"WidthDepthRatio": 1,
|
||||
"UnitSeparationWidthMultiplier": 1,
|
||||
"UnitSeparationDepthMultiplier": 1,
|
||||
"SpeedMultiplier": 1,
|
||||
"Sloppiness": 0
|
||||
});
|
||||
let controllerAI = ConstructComponent(controller, "UnitAI", {
|
||||
"FormationController": "true",
|
||||
"DefaultStance": "aggressive"
|
||||
});
|
||||
|
||||
AddMock(controller, IID_Position, {
|
||||
JumpTo: function(x, z) { this.x = x; this.z = z; },
|
||||
@@ -366,8 +379,21 @@ function TestMoveIntoFormationWhileAttacking()
|
||||
GetHitpoints: function() { return 40; },
|
||||
});
|
||||
|
||||
var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|
||||
var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
|
||||
let controllerFormation = ConstructComponent(controller, "Formation", {
|
||||
"FormationName": "Line Closed",
|
||||
"FormationShape": "square",
|
||||
"ShiftRows": "false",
|
||||
"SortingClasses": "",
|
||||
"WidthDepthRatio": 1,
|
||||
"UnitSeparationWidthMultiplier": 1,
|
||||
"UnitSeparationDepthMultiplier": 1,
|
||||
"SpeedMultiplier": 1,
|
||||
"Sloppiness": 0
|
||||
});
|
||||
let controllerAI = ConstructComponent(controller, "UnitAI", {
|
||||
"FormationController": "true",
|
||||
"DefaultStance": "aggressive"
|
||||
});
|
||||
|
||||
AddMock(controller, IID_Position, {
|
||||
"GetTurretParent": () => INVALID_ENTITY,
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
<FormationName>Close Order</FormationName>
|
||||
<MinColumns>3</MinColumns>
|
||||
<WidthDepthRatio>4</WidthDepthRatio>
|
||||
<Sloppyness>0.25</Sloppyness>
|
||||
<Sloppiness>0.25</Sloppiness>
|
||||
</Formation>
|
||||
</Entity>
|
||||
@@ -7,6 +7,6 @@
|
||||
<UnitSeparationDepthMultiplier>1.5</UnitSeparationDepthMultiplier>
|
||||
<WidthDepthRatio>4</WidthDepthRatio>
|
||||
<MinColumns>3</MinColumns>
|
||||
<Sloppyness>0.5</Sloppyness>
|
||||
<Sloppiness>0.5</Sloppiness>
|
||||
</Formation>
|
||||
</Entity>
|
||||
@@ -22,7 +22,7 @@
|
||||
6..6,1..-1: syntagma_04;
|
||||
7...-1,1..-1: syntagma_back
|
||||
</AnimationVariants>
|
||||
<Sloppyness>0.15</Sloppyness>
|
||||
<Sloppiness>0.15</Sloppiness>
|
||||
</Formation>
|
||||
<FormationAttack>
|
||||
<CanAttackAsFormation>false</CanAttackAsFormation>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<FormationName>Wedge</FormationName>
|
||||
<FormationShape>triangle</FormationShape>
|
||||
<ShiftRows>true</ShiftRows>
|
||||
<Sloppyness>0.25</Sloppyness>
|
||||
<Sloppiness>0.25</Sloppiness>
|
||||
<UnitSeparationWidthMultiplier>1.1</UnitSeparationWidthMultiplier>
|
||||
<UnitSeparationDepthMultiplier>1.1</UnitSeparationDepthMultiplier>
|
||||
</Formation>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
-->
|
||||
<Formation>
|
||||
<RequiredMemberCount>2</RequiredMemberCount>
|
||||
<DisabledTooltip>Requires at least 2 Soldiers or Siege engines.</DisabledTooltip>
|
||||
<DisabledTooltip>Requires at least 2 Soldiers or Siege Engines.</DisabledTooltip>
|
||||
<SpeedMultiplier>1</SpeedMultiplier>
|
||||
<FormationShape>square</FormationShape>
|
||||
<SortingClasses>Hero Champion Cavalry Melee Ranged</SortingClasses>
|
||||
@@ -31,7 +31,7 @@
|
||||
<UnitSeparationWidthMultiplier>1</UnitSeparationWidthMultiplier>
|
||||
<UnitSeparationDepthMultiplier>1</UnitSeparationDepthMultiplier>
|
||||
<WidthDepthRatio>1</WidthDepthRatio>
|
||||
<Sloppyness>0</Sloppyness>
|
||||
<Sloppiness>0</Sloppiness>
|
||||
<AnimationVariants/>
|
||||
</Formation>
|
||||
<FormationAttack>
|
||||
|
||||
Reference in new issue
Block a user