1
0
forked from 0ad/0ad

XML / JavaScript changes for new case-aware XMB format. Mostly deals with changing things like structciv to structCiv and subtype to subType, and ensuring parent is specified with Parent on all entities.

This was SVN commit r4185.
This commit is contained in:
Matei 2006-08-01 03:29:10 +00:00
parent f007b1dc0c
commit f76d0ffdc6
33 changed files with 73 additions and 73 deletions

View File

@ -1,5 +1,5 @@
structciv,Construct Civic Buildings,
structmil,Construct Military Buildings,
structCiv,Construct Civic Buildings,
structMil,Construct Military Buildings,
train,Train,
research,Research,
barter,Barter,

View File

@ -18,7 +18,7 @@
</Footprint>
<Vision>
<LOS>2</LOS>
<Los>2</Los>
</Vision>
</Traits>

View File

@ -18,7 +18,7 @@
</Footprint>
<Vision>
<LOS>2</LOS>
<Los>2</Los>
</Vision>
</Traits>

View File

@ -18,7 +18,7 @@
</Footprint>
<Vision>
<LOS>3</LOS>
<Los>3</Los>
</Vision>
</Traits>

View File

@ -18,7 +18,7 @@
</Footprint>
<Vision>
<LOS>4</LOS>
<Los>4</Los>
</Vision>
</Traits>

View File

@ -18,7 +18,7 @@
</Footprint>
<Vision>
<LOS>5</LOS>
<Los>5</Los>
</Vision>
</Traits>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<Entity
parent="template_structure_military_fortress"
Parent="template_structure_military_fortress"
>
<Traits>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<Entity
parent="template_structure_civic_civil_centre"
Parent="template_structure_civic_civil_centre"
>
<Traits>

View File

@ -32,7 +32,7 @@
</Health>
<Vision>
<LOS>9</LOS>
<Los>9</Los>
</Vision>
<Display>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<Entity parent="template_structure_economic">
<Entity Parent="template_structure_economic">
<Traits
extant="true"
Extant="true"
>
<Id>
<Internal_Only />

View File

@ -16,7 +16,7 @@
</Id>
<Vision>
<LOS>0</LOS>
<Los>0</Los>
<Permanent />
</Vision>

View File

@ -68,7 +68,7 @@
</MiniMap>
<Vision>
<LOS>6</LOS>
<Los>6</Los>
</Vision>
<Display>

View File

@ -32,7 +32,7 @@
</Stamina>
<Loot>
<XP>200</XP>
<Xp>200</Xp>
<Food>1</Food>
<wood>1</wood>
<Stone>1</Stone>
@ -62,7 +62,7 @@
<Loot>
<Resources />
<XP />
<Xp />
</Loot>
<Move>

View File

@ -25,7 +25,7 @@
</Footprint>
<Loot>
<XP>10</XP>
<Xp>10</Xp>
</Loot>
<MiniMap>

View File

@ -12,9 +12,9 @@
</Id>
<AI>
<Ai>
<Behaviour>Passive</Behaviour>
</AI>
</Ai>
</Traits>
</Entity>

View File

@ -12,9 +12,9 @@
</Id>
<AI>
<Ai>
<Behaviour>Passive</Behaviour>
</AI>
</Ai>
</Traits>
</Entity>

View File

@ -12,9 +12,9 @@
</Id>
<AI>
<Ai>
<Behaviour>Aggressive</Behaviour>
</AI>
</Ai>
</Traits>
</Entity>

View File

@ -12,9 +12,9 @@
</Id>
<AI>
<Ai>
<Behaviour>Defensive</Behaviour>
</AI>
</Ai>
</Traits>
</Entity>

View File

@ -12,9 +12,9 @@
</Id>
<AI>
<Ai>
<Behaviour>Passive</Behaviour>
</AI>
</Ai>
</Traits>
</Entity>

View File

@ -12,9 +12,9 @@
</Id>
<AI>
<Ai>
<Behaviour>Skittish</Behaviour>
</AI>
</Ai>
</Traits>
</Entity>

View File

@ -12,9 +12,9 @@
</Id>
<AI>
<Ai>
<Behaviour>Violent</Behaviour>
</AI>
</Ai>
</Traits>
</Entity>

View File

@ -12,9 +12,9 @@
</Id>
<AI>
<Ai>
<Behaviour>Violent</Behaviour>
</AI>
</Ai>
</Traits>
</Entity>

View File

@ -12,9 +12,9 @@
</Id>
<AI>
<Ai>
<Behaviour>Defensive</Behaviour>
</AI>
</Ai>
</Traits>
</Entity>

View File

@ -12,9 +12,9 @@
</Id>
<AI>
<Ai>
<Behaviour>Passive</Behaviour>
</AI>
</Ai>
</Traits>
</Entity>

View File

@ -12,9 +12,9 @@
</Id>
<AI>
<Ai>
<Behaviour>Violent</Behaviour>
</AI>
</Ai>
</Traits>
</Entity>

View File

@ -24,7 +24,7 @@
</Health>
<Loot>
<XP>1000</XP>
<Xp>1000</Xp>
<Food>1</Food>
<wood>1</wood>
<Stone>1</Stone>

View File

@ -23,7 +23,7 @@
</Health>
<Loot>
<XP>800</XP>
<Xp>800</Xp>
<Food>1</Food>
<Wood>1</Wood>
<Stone>1</Stone>
@ -84,7 +84,7 @@
<Loot>
<Resources />
<XP />
<Xp />
</Loot>
<Repair>

View File

@ -18,7 +18,7 @@
</Health>
<Loot>
<XP>50</XP>
<Xp>50</Xp>
<Food>1</Food>
<wood>1</wood>
<Stone>1</Stone>

View File

@ -18,7 +18,7 @@
</Health>
<Loot>
<XP>10</XP>
<Xp>10</Xp>
<Food>1</Food>
<wood>1</wood>
<Stone>1</Stone>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<Entity
parent="template_unit_infantry_ranged_archer"
Parent="template_unit_infantry_ranged_archer"
>
<Traits>

View File

@ -1,5 +1,5 @@
<formation Tag="Form Box 2"
<formation tag="Form Box 2"
bonus="actions.move.speed_curr"
bonusbase="actions.move.speed"
bonustype="Melee"

View File

@ -215,7 +215,7 @@ function updateTab (tab, type, cellSheet, attribute, attribute2, arrayCells)
default:
if (type == "pick" && cellSheet != "Tab") // Force the tab background for pick lists,
setPortrait ("snStatusPaneCommand" + tabCounter + "_1", "IconSheet", cellSheet + "TabButton", cellGroup[cellSheet][tab].id);
else // Use the vertical tab. (Extends up).
else
setPortrait ("snStatusPaneCommand" + tabCounter + "_1", "IconSheet", cellSheet + "Button", cellGroup[cellSheet][tab].id);
break;
}
@ -462,7 +462,7 @@ function updateTab (tab, type, cellSheet, attribute, attribute2, arrayCells)
{
case "train":
// TODO: Remove this item from the production queue if right-clicked.
issueCommand(selection, NMT_Produce, PRODUCTION_TRAIN, ""+(Crd[getCrd (this.name, true)].entity));
issueCommand(selection, NMT_Produce, PRODUCTION_TRAiN, ""+(Crd[getCrd (this.name, true)].entity));
case "research":
// TODO: Remove this item from the production queue if right-clicked.
issueCommand(selection, NMT_Produce, PRODUCTION_RESEARCH, ""+(Crd[getCrd (this.name, true)].entity.name));
@ -471,8 +471,8 @@ function updateTab (tab, type, cellSheet, attribute, attribute2, arrayCells)
// Buy a quantity of this resource if left-clicked.
// Sell a quantity of this resource if right-clicked.
break;
case "structciv":
case "structmil":
case "structCiv":
case "structMil":
// Select building placement cursor.
tryConstruction( Crd[getCrd (this.name, true)].entity );
break;
@ -625,7 +625,7 @@ function refreshCommandButtons()
tabCounter = snStatusPaneCommand.split;
// Update commands. (Click "tab" button to do something; no list.)
updateTab ("patrol", "command", "", "selection[0].actions.patrol", "");
updateTab ("townbell", "command", "", "selection[0].actions.townbell", "");
updateTab ("townbell", "command", "", "selection[0].actions.townBell", "");
updateTab ("rally", "command", "", "selection[0].actions.create.rally", "");
updateTab ("explore", "command", "", "selection[0].actions.explore", "");
updateTab ("retreat", "command", "", "selection[0].actions.retreat", "");

View File

@ -144,17 +144,17 @@ function entityInit()
// If entity has supply, set current to same.
supply.curr = supply.max;
// If entity has type of supply and no subtype, set subtype to same
// (so we don't have to say type="wood", subtype="wood"
if (supply.type && !supply.subtype)
supply.subtype = supply.type;
// If entity has type of supply and no subType, set subType to same
// (so we don't have to say type="wood", subType="wood"
if (supply.type && !supply.subType)
supply.subType = supply.type;
// The "dropsite_count" array holds the number of units with gather aura in range of the object;
// this is important so that if you have two mills near something and one of them is destroyed,
// you can still gather from the thing. Initialize it to 0 (ungatherable) for every player unless
// the entity is forageable (e.g. for huntable animals).
var dropsite_count = new Array();
initialCount = supply.subtype.meat ? 1 : 0;
initialCount = supply.subType.meat ? 1 : 0;
for( i=0; i<=8; i++ )
{
dropsite_count[i] = initialCount;
@ -237,7 +237,7 @@ function entityInit()
this.player.resources.population += parseInt(this.traits.population.rem);
}
// Build Unit AI Stance list, and set default stance. ---> Can eventually be done in C++, since stances will likely be implemented in C++.
// Build Unit Ai Stance list, and set default stance. ---> Can eventually be done in C++, since stances will likely be implemented in C++.
if (this.actions && this.actions.move)
{
if ( !this.traits.ai )
@ -316,17 +316,17 @@ function entityInitQuasi()
// If entity has supply, set current to same.
supply.curr = supply.max;
// If entity has type of supply and no subtype, set subtype to same
// (so we don't have to say type="wood", subtype="wood"
if (supply.type && !supply.subtype)
supply.subtype = supply.type;
// If entity has type of supply and no subType, set subType to same
// (so we don't have to say type="wood", subType="wood"
if (supply.type && !supply.subType)
supply.subType = supply.type;
// The "dropsite_count" array holds the number of units with gather aura in range of the object;
// this is important so that if you have two mills near something and one of them is destroyed,
// you can still gather from the thing. Initialize it to 0 (ungatherable) for every player unless
// the entity is forageable (e.g. for huntable animals).
var dropsite_count = new Array();
initialCount = supply.subtype.meat ? 1 : 0;
initialCount = supply.subType.meat ? 1 : 0;
for( i=0; i<=8; i++ )
{
dropsite_count[i] = initialCount;
@ -688,8 +688,8 @@ function performGather( evt )
return;
}
if( g.resource[s.type][s.subtype])
gather_amt = parseFloat( g.resource[s.type][s.subtype] );
if( g.resource[s.type][s.subType])
gather_amt = parseFloat( g.resource[s.type][s.subType] );
else
gather_amt = parseFloat( g.resource[s.type] );
@ -880,7 +880,7 @@ function damage( dmg, inflictor )
{
switch( loot.toString().toUpperCase() )
{
case "XP":
case "XP":
// If the inflictor gains promotions, and he's capable of earning more ranks,
if (inflictor.traits.promotion && inflictor.traits.promotion.curr && inflictor.traits.promotion.req
&& inflictor.traits.promotion.newentity && inflictor.traits.promotion.newentity != ""
@ -957,7 +957,7 @@ function damage( dmg, inflictor )
else if( inflictor && this.actions && this.actions.attack )
{
// If we're not already doing something else, take a measured response - hit 'em back.
// You know, I think this is quite possibly the first AI code the AI divlead has written
// You know, I think this is quite possibly the first Ai code the Ai divlead has written
// for 0 A.D....
//When the entity changes order, we can readjust flank penalty. We must destroy the notifiers ourselves later,however.
this.requestNotification( inflictor, NOTIFY_ORDER_CHANGE, false, true );
@ -1150,12 +1150,12 @@ function entityEventTargetChanged( evt )
evt.defaultOrder = NMT_Generic;
evt.defaultAction = ACTION_GATHER;
// Set cursor (eg "action-gather-fruit").
evt.defaultCursor = "action-gather-" + evt.target.traits.supply.subtype;
evt.defaultCursor = "action-gather-" + evt.target.traits.supply.subType;
evt.secondaryOrder = NMT_Generic;
evt.secondaryAction = ACTION_GATHER;
// Set cursor (eg "action-gather-fruit").
evt.secondaryCursor = "action-gather-" + evt.target.traits.supply.subtype;
evt.secondaryCursor = "action-gather-" + evt.target.traits.supply.subType;
}
if ( canBuild( this, evt.target ) )
@ -1196,7 +1196,7 @@ function entityEventPrepareOrder( evt )
{
// This event gives us a chance to veto any order we're given before we execute it.
// Not sure whether this really belongs here like this: the alternative is to override it in
// subtypes - then you wouldn't need to check tags, you could hardcode results.
// subTypes - then you wouldn't need to check tags, you could hardcode results.
if ( !this.actions )
{
@ -1270,7 +1270,7 @@ function entityEventPrepareOrder( evt )
// Change our gather animation based on the type of target
var a = this.actions.gather;
this.setActionParams( ACTION_GATHER, 0.0, a.range, a.speed,
"gather_" + evt.target.traits.supply.subtype );
"gather_" + evt.target.traits.supply.subType );
break;
@ -1718,13 +1718,13 @@ function checkEntityReqs( player, template )
function canGather( source, target )
{
// Checks whether we're allowed to gather from a target entity (this involves looking at both the type and subtype).
// Checks whether we're allowed to gather from a target entity (this involves looking at both the type and subType).
if( !source.actions )
return false;
g = source.actions.gather;
s = target.traits.supply;
return ( g && s && g.resource && g.resource[s.type] &&
( s.subtype==s.type || g.resource[s.type][s.subtype] ) &&
( s.subType==s.type || g.resource[s.type][s.subType] ) &&
( s.curr > 0 || s.max == 0 ) &&
s.dropsite_count[source.player.id] );
}
@ -1744,7 +1744,7 @@ function canBuild( source, target )
function canRepair( source, target )
{
// Checks whether we're allowed to gather from a target entity (this involves looking at both the type and subtype).
// Checks whether we're allowed to gather from a target entity (this involves looking at both the type and subType).
if( !source.actions )
return false;
r = source.actions.repair;