Uses xml attributes instead of elements for obstructions shapes.

This was SVN commit r12093.
This commit is contained in:
Badmadblacksad 2012-07-12 20:00:38 +00:00
parent 8f2ed2586f
commit 51b9fa6186
15 changed files with 84 additions and 180 deletions

View File

@ -27,7 +27,11 @@
<History>A cheap, quick wooden gate</History>
</Identity>
<Obstruction>
<Static width="14" depth="2.0"/>
<Obstructions>
<Right width="2" depth="2" x="6" z="0"/>
<Left width="2" depth="2" x="-6" z="0"/>
<Door width="10" depth="2" x="0" z="0"/>
</Obstructions>
</Obstruction>
<StatusBars>
<HeightOffset>9.0</HeightOffset>

View File

@ -13,20 +13,11 @@
<History>The Athenian city wall was pierced by numerous gates and posterns of various sizes and importance. The "Sacred Gate" was the gate on the road to Eleusis. Another gate was the Dipylon Gate, whose name literally means "Double Gate."</History>
</Identity>
<Obstruction>
<Cluster>
<Right width="12" depth="6.5">
<PosX>13</PosX>
<PosZ>0</PosZ>
</Right>
<Left width="12" depth="6.5">
<PosX>-13</PosX>
<PosZ>0</PosZ>
</Left>
<Door width="14.0" depth="6.5">
<PosX>0</PosX>
<PosZ>0</PosZ>
</Door>
</Cluster>
<Obstructions>
<Right width="12" depth="6.5" x="13" z="0"/>
<Left width="12" depth="6.5" x="-13" z="0"/>
<Door width="14.0" depth="6.5" x="0" z="0"/>
</Obstructions>
</Obstruction>
<VisualActor>
<Actor>structures/hellenes/wall_gate.xml</Actor>

View File

@ -20,20 +20,11 @@
<History>The Romans called this wall 'Murus Gallicus'. Translated, it means 'Gaulish wall'. It was extremely resistant to assault by battering ram. Julius Caesar described a type of wood and stone wall, known as a Murus Gallicus, in his account of the Gallic Wars. These walls were made of a stone wall filled with rubble, with wooden logs inside for stability. Caesar noted how the flexibility of the wood added to the strength of the fort in case of battering ram attack.</History>
</Identity>
<Obstruction>
<Cluster>
<Right width="6" depth="8">
<PosX>9.5</PosX>
<PosZ>0</PosZ>
</Right>
<Left width="6" depth="8">
<PosX>-9.5</PosX>
<PosZ>0</PosZ>
</Left>
<Door width="13.0" depth="8">
<PosX>0</PosX>
<PosZ>0</PosZ>
</Door>
</Cluster>
<Obstructions>
<Right width="6" depth="8" x="9.5" z="0"/>
<Left width="6" depth="8" x="-9.5" z="0"/>
<Door width="13" depth="8" x="0" z="0"/>
</Obstructions>
</Obstruction>
<VisualActor>
<Actor>structures/celts/wall_gate.xml</Actor>

View File

@ -20,20 +20,11 @@
<History>The Romans called this wall 'Murus Gallicus'. Translated, it means 'Gaulish wall'. It was extremely resistant to assault by battering ram. Julius Caesar described a type of wood and stone wall, known as a Murus Gallicus, in his account of the Gallic Wars. These walls were made of a stone wall filled with rubble, with wooden logs inside for stability. Caesar noted how the flexibility of the wood added to the strength of the fort in case of battering ram attack.</History>
</Identity>
<Obstruction>
<Cluster>
<Right width="5" depth="8">
<PosX>10</PosX>
<PosZ>0</PosZ>
</Right>
<Left width="5" depth="8">
<PosX>-10</PosX>
<PosZ>0</PosZ>
</Left>
<Door width="15.0" depth="8">
<PosX>0</PosX>
<PosZ>0</PosZ>
</Door>
</Cluster>
<Obstructions>
<Right width="5" depth="8" x="10" z="0"/>
<Left width="5" depth="8" x="-10" z="0"/>
<Door width="15" depth="8" x="0" z="0"/>
</Obstructions>
</Obstruction>
<VisualActor>
<Actor>structures/celts/wall_gate.xml</Actor>

View File

@ -20,20 +20,11 @@
<History>The Romans called this wall 'Murus Gallicus'. Translated, it means 'Gaulish wall'. It was extremely resistant to assault by battering ram. Julius Caesar described a type of wood and stone wall, known as a Murus Gallicus, in his account of the Gallic Wars. These walls were made of a stone wall filled with rubble, with wooden logs inside for stability. Caesar noted how the flexibility of the wood added to the strength of the fort in case of battering ram attack.</History>
</Identity>
<Obstruction>
<Cluster>
<Right width="7" depth="8">
<PosX>9</PosX>
<PosZ>0</PosZ>
</Right>
<Left width="7" depth="8">
<PosX>-9</PosX>
<PosZ>0</PosZ>
</Left>
<Door width="11.0" depth="8">
<PosX>0</PosX>
<PosZ>0</PosZ>
</Door>
</Cluster>
<Obstructions>
<Right width="7" depth="8" x="9" z="0"/>
<Left width="7" depth="8" x="-9" z="0"/>
<Door width="11" depth="8" x="0" z="0"/>
</Obstructions>
</Obstruction>
<VisualActor>
<Actor>structures/celts/wall_gate.xml</Actor>

View File

@ -13,20 +13,11 @@
<History>(Insert history)</History>
</Identity>
<Obstruction>
<Cluster>
<Right width="12" depth="6.5">
<PosX>13</PosX>
<PosZ>0</PosZ>
</Right>
<Left width="12" depth="6.5">
<PosX>-13</PosX>
<PosZ>0</PosZ>
</Left>
<Door width="14.0" depth="6.5">
<PosX>0</PosX>
<PosZ>0</PosZ>
</Door>
</Cluster>
<Obstructions>
<Right width="12" depth="6.5" x="13" z="0"/>
<Left width="12" depth="6.5" x="-13" z="0"/>
<Door width="14.0" depth="6.5" x="0" z="0"/>
</Obstructions>
</Obstruction>
<VisualActor>
<Actor>structures/hellenes/wall_gate.xml</Actor>

View File

@ -10,20 +10,11 @@
<History>One of the central attributes of the Iberians civ is that it was a highly defensive one that constantly gave the Carthaginians trouble in their bid to conquer the peninsula (which they never really did) and took the Romans another 200 years to subdue, along with incredibly large cumulative loss of Roman soldier's lives. This doubled gate has been found incorporated into walls surrounding Iberian villages, Oppidum, and fortresses, Castros. It presents rather formidable aspects with its 4 towers, 2 gates, and a courtyard-like interior wherein enemy forces could become entrapped between the two gates, combined with a monolithically strong stone structure. The concept comes from archeologist and paleontologist descriptions of the remains of such gates at various locations scattered about the Iberian Peninsula.</History>
</Identity>
<Obstruction>
<Cluster>
<Right width="10" depth="8.5">
<PosX>13</PosX>
<PosZ>0</PosZ>
</Right>
<Left width="10" depth="8.5">
<PosX>-13</PosX>
<PosZ>0</PosZ>
</Left>
<Door width="16.0" depth="8.5">
<PosX>0</PosX>
<PosZ>0</PosZ>
</Door>
</Cluster>
<Obstructions>
<Right width="10" depth="8.5" x="13" z="0"/>
<Left width="10" depth="8.5" x="-13" z="0"/>
<Door width="16.0" depth="8.5" x="0" z="0"/>
</Obstructions>
</Obstruction>
<VisualActor>
<Actor>structures/iberians/wall_gate.xml</Actor>

View File

@ -13,20 +13,11 @@
<History>(Insert history)</History>
</Identity>
<Obstruction>
<Cluster>
<Right width="12" depth="6.5">
<PosX>13</PosX>
<PosZ>0</PosZ>
</Right>
<Left width="12" depth="6.5">
<PosX>-13</PosX>
<PosZ>0</PosZ>
</Left>
<Door width="14.0" depth="6.5">
<PosX>0</PosX>
<PosZ>0</PosZ>
</Door>
</Cluster>
<Obstructions>
<Right width="12" depth="6.5" x="13" z="0"/>
<Left width="12" depth="6.5" x="-13" z="0"/>
<Door width="14" depth="6.5" x="0" z="0"/>
</Obstructions>
</Obstruction>
<VisualActor>
<Actor>structures/hellenes/wall_gate.xml</Actor>

View File

@ -23,7 +23,11 @@
<Icon>structures/gate.png</Icon>
</Identity>
<Obstruction>
<Static width="36.0" depth="13.0"/>
<Obstructions>
<Right width="11" depth="13" x="12.5" z="0"/>
<Left width="11" depth="13" x="-12.5" z="0"/>
<Door width="14" depth="13" x="0" z="0"/>
</Obstructions>
</Obstruction>
<TerritoryInfluence>
<Root>true</Root>

View File

@ -16,20 +16,11 @@
<History>Persepolis, the Persian royal capital, was constructed on an immense man-made terrace with strong defensive walls.</History>
</Identity>
<Obstruction>
<Cluster>
<Right width="11" depth="7.0">
<PosX>13</PosX>
<PosZ>0</PosZ>
</Right>
<Left width="11" depth="7.0">
<PosX>-13</PosX>
<PosZ>0</PosZ>
</Left>
<Door width="15.0" depth="7.0">
<PosX>0</PosX>
<PosZ>0</PosZ>
</Door>
</Cluster>
<Obstructions>
<Right width="11" depth="7" x="13" z="0"/>
<Left width="11" depth="7" x="-13" z="0"/>
<Door width="15" depth="7" x="0" z="0"/>
</Obstructions>
</Obstruction>
<VisualActor>
<Actor>structures/persians/wall_gate.xml</Actor>

View File

@ -28,20 +28,11 @@
<History>(Insert History Here)</History>
</Identity>
<Obstruction>
<Cluster>
<Right width="12" depth="5">
<PosX>12.5</PosX>
<PosZ>0</PosZ>
</Right>
<Left width="12" depth="5">
<PosX>-12.5</PosX>
<PosZ>0</PosZ>
</Left>
<Door width="13.0" depth="5">
<PosX>0</PosX>
<PosZ>0</PosZ>
</Door>
</Cluster>
<Obstructions>
<Right width="12" depth="5" x="12.5" z="0"/>
<Left width="12" depth="5" x="-12.5" z="0"/>
<Door width="13" depth="5" x="0" z="0"/>
</Obstructions>
</Obstruction>
<TerritoryDecay>
<HealthDecayRate>1</HealthDecayRate>

View File

@ -10,20 +10,11 @@
<History>Rome had a number of gates piercing its city walls. One of the most famous of these was the Appian Gate.</History>
</Identity>
<Obstruction>
<Cluster>
<Right width="13" depth="7">
<PosX>12</PosX>
<PosZ>0</PosZ>
</Right>
<Left width="13" depth="7">
<PosX>-12</PosX>
<PosZ>0</PosZ>
</Left>
<Door width="11.0" depth="7">
<PosX>0</PosX>
<PosZ>0</PosZ>
</Door>
</Cluster>
<Obstructions>
<Right width="13" depth="7" x="12" z="0"/>
<Left width="13" depth="7" x="-12" z="0"/>
<Door width="11" depth="7" x="0" z="0"/>
</Obstructions>
</Obstruction>
<VisualActor>
<Actor>structures/romans/wall_gate.xml</Actor>

View File

@ -10,20 +10,11 @@
<History>(Insert history)</History>
</Identity>
<Obstruction>
<Cluster>
<Right width="12" depth="6.5">
<PosX>13</PosX>
<PosZ>0</PosZ>
</Right>
<Left width="12" depth="6.5">
<PosX>-13</PosX>
<PosZ>0</PosZ>
</Left>
<Door width="14.0" depth="6.5">
<PosX>0</PosX>
<PosZ>0</PosZ>
</Door>
</Cluster>
<Obstructions>
<Right width="12" depth="6.5" x="12" z="0"/>
<Left width="12" depth="6.5" x="-12" z="0"/>
<Door width="14" depth="6.5" x="0" z="0"/>
</Obstructions>
</Obstruction>
<VisualActor>
<Actor>structures/hellenes/wall_gate.xml</Actor>

View File

@ -39,20 +39,11 @@
<metal>0</metal>
</Loot>
<Obstruction>
<Cluster>
<Right width="5" depth="5">
<PosX>10</PosX>
<PosZ>0</PosZ>
</Right>
<Left width="5" depth="5">
<PosX>-10</PosX>
<PosZ>0</PosZ>
</Left>
<Door width="20.0" depth="6.5">
<PosX>0</PosX>
<PosZ>0</PosZ>
</Door>
</Cluster>
<Obstructions>
<Right width="5" depth="5" x="10" z="0"/>
<Left width="5" depth="5" x="-10" z="0"/>
<Door width="20.0" depth="6.5" x="0" z="0"/>
</Obstructions>
</Obstruction>
<RallyPoint disable=""/>
<Sound>

View File

@ -120,16 +120,20 @@ public:
"<ref name='positiveDecimal'/>"
"</attribute>"
"</element>"
"<element name='Cluster'>"
"<element name='Obstructions'>"
"<zeroOrMore>"
"<element>"
"<anyName/>"
"<element name='PosX'>"
"<data type='decimal'/>"
"</element>"
"<element name='PosZ'>"
"<data type='decimal'/>"
"</element>"
"<optional>"
"<attribute name='x'>"
"<data type='decimal'/>"
"</attribute>"
"</optional>"
"<optional>"
"<attribute name='z'>"
"<data type='decimal'/>"
"</attribute>"
"</optional>"
"<attribute name='width'>"
"<ref name='positiveDecimal'/>"
"</attribute>"
@ -197,14 +201,14 @@ public:
m_Type = CLUSTER;
CFixedVector2D max = CFixedVector2D(fixed::FromInt(0), fixed::FromInt(0));
CFixedVector2D min = CFixedVector2D(fixed::FromInt(0), fixed::FromInt(0));
const CParamNode::ChildrenMap& clusterMap = paramNode.GetChild("Cluster").GetChildren();
const CParamNode::ChildrenMap& clusterMap = paramNode.GetChild("Obstructions").GetChildren();
for(CParamNode::ChildrenMap::const_iterator it = clusterMap.begin(); it != clusterMap.end(); ++it)
{
Shape b;
b.size0 = it->second.GetChild("@width").ToFixed();
b.size1 = it->second.GetChild("@depth").ToFixed();
b.dx = it->second.GetChild("PosX").ToFixed();
b.dz = it->second.GetChild("PosZ").ToFixed();
b.dx = it->second.GetChild("@x").ToFixed();
b.dz = it->second.GetChild("@z").ToFixed();
b.da = entity_angle_t::FromInt(0);
b.flags = m_Flags;
m_Shapes.push_back(b);