1
0
forked from 0ad/0ad

Fixes #2937. Thanks to Lion_Kanzen and Pureon for making icons.

This was SVN commit r16064.
This commit is contained in:
scythetwirler 2014-12-25 05:12:39 +00:00
parent b2650e08ba
commit 286112e0aa
18 changed files with 36 additions and 17 deletions

Binary file not shown.

View File

@ -132,7 +132,7 @@
],
"Formations":
[
"formations/scatter",
"formations/null",
"formations/box",
"formations/column_closed",
"formations/line_closed",

View File

@ -114,7 +114,7 @@
],
"Formations":
[
"formations/scatter",
"formations/null",
"formations/box",
"formations/column_closed",
"formations/line_closed",

View File

@ -135,7 +135,7 @@
],
"Formations":
[
"formations/scatter",
"formations/null",
"formations/box",
"formations/column_closed",
"formations/line_closed",

View File

@ -151,7 +151,7 @@
],
"Formations":
[
"formations/scatter",
"formations/null",
"formations/box",
"formations/column_closed",
"formations/line_closed",

View File

@ -110,7 +110,7 @@
],
"Formations":
[
"formations/scatter",
"formations/null",
"formations/box",
"formations/column_closed",
"formations/line_closed",

View File

@ -167,7 +167,7 @@
],
"Formations":
[
"formations/scatter",
"formations/null",
"formations/box",
"formations/column_closed",
"formations/line_closed",

View File

@ -108,7 +108,7 @@
],
"Formations":
[
"formations/scatter",
"formations/null",
"formations/box",
"formations/column_closed",
"formations/line_closed",

View File

@ -137,7 +137,7 @@
],
"Formations":
[
"formations/scatter",
"formations/null",
"formations/box",
"formations/column_closed",
"formations/line_closed",

View File

@ -122,7 +122,7 @@
],
"Formations":
[
"formations/scatter",
"formations/null",
"formations/box",
"formations/column_closed",
"formations/line_closed",

View File

@ -127,7 +127,7 @@
],
"Formations":
[
"formations/scatter",
"formations/null",
"formations/box",
"formations/column_closed",
"formations/line_closed",

View File

@ -136,7 +136,7 @@
],
"Formations":
[
"formations/scatter",
"formations/null",
"formations/box",
"formations/column_closed",
"formations/line_closed",

View File

@ -112,7 +112,7 @@
],
"Formations":
[
"formations/scatter",
"formations/null",
"formations/box",
"formations/column_closed",
"formations/line_closed",

View File

@ -133,7 +133,7 @@
],
"Formations":
[
"formations/scatter",
"formations/null",
"formations/box",
"formations/column_closed",
"formations/line_closed",

View File

@ -128,7 +128,7 @@
],
"Formations":
[
"formations/scatter",
"formations/null",
"formations/box",
"formations/column_closed",
"formations/line_closed",

View File

@ -121,7 +121,7 @@
],
"Formations":
[
"formations/scatter",
"formations/null",
"formations/box",
"formations/column_closed",
"formations/line_closed",

View File

@ -1275,10 +1275,15 @@ function GetFormationUnitAIs(ents, player, formationTemplate)
// TODO: We only check if the formation is usable by some units
// if we move them to it. We should check if we can use formations
// for the other cases.
if (cmpIdentity && cmpIdentity.CanUseFormation(formationTemplate || "formations/line_closed"))
var nullFormation = (formationTemplate || cmpUnitAI.GetLastFormationTemplate()) == "formations/null";
if (!nullFormation && cmpIdentity && cmpIdentity.CanUseFormation(formationTemplate || "formations/line_closed"))
formedEnts.push(ent);
else
{
if (nullFormation)
cmpUnitAI.SetLastFormationTemplate("formations/null");
nonformedUnitAIs.push(cmpUnitAI);
}
}
if (formedEnts.length == 0)
@ -1319,6 +1324,7 @@ function GetFormationUnitAIs(ents, player, formationTemplate)
if (cmpFormation)
cmpFormation.RemoveMembers(formation.members[fid]);
}
// TODO replace the fixed 60 with something sensible, based on vision range f.e.
var formationSeparation = 60;
var clusters = ClusterEntities(formation.entities, formationSeparation);
@ -1358,7 +1364,7 @@ function GetFormationUnitAIs(ents, player, formationTemplate)
formationUnitAIs.push(Engine.QueryInterface(formationEnt, IID_UnitAI));
cmpFormation.SetFormationSeparation(formationSeparation);
cmpFormation.SetMembers(cluster);
for each (var ent in formationEnts)
cmpFormation.RegisterTwinFormation(ent);

View File

@ -36,6 +36,16 @@
<Identity>
<GenericName>Unit</GenericName>
<Classes datatype="tokens">Unit ConquestCritical</Classes>
<Formations datatype="tokens">
formations/null
formations/box
formations/column_closed
formations/line_closed
formations/column_open
formations/line_open
formations/flank
formations/battle_line
</Formations>
</Identity>
<Looter/>
<Minimap>