1
0
forked from 0ad/0ad

# Added 4 sample techs.

Also modified the entity script to allow for gathering fractional
resources, and modified the GUI to round resources to the nearest
integer. This is necessary since techs will likely push resource
gathering amounts to fractional numbers.

This was SVN commit r4161.
This commit is contained in:
Matei 2006-07-21 22:54:01 +00:00
parent cddd4cab14
commit b8456f0702
8 changed files with 176 additions and 5 deletions

View File

@ -19,4 +19,17 @@
<Actor>structures/hellenes/mill.xml</Actor>
<Actions>
<Create>
<List>
<Research>
<Hele_Stone_1 />
<Hele_Wedge_And_Mallet />
<Hele_Helots />
<Hele_Slaves />
</Research>
</List>
</Create>
</Actions>
</Entity>

View File

@ -106,7 +106,7 @@ function refreshResource (resourceName, resourceIndex)
var resourceIconObject = getGUIObjectByName ("snResourceCounterIcon_" + (resourceIndex + 1));
// Update counter caption (since we need to have up-to-date text to determine the length of the counter).
var caption = localPlayer.resources[resourceName.toLowerCase()];
var caption = parseInt( localPlayer.resources[resourceName.toLowerCase()] );
// The Population counter also lists the amount of available housing.
if (resourceName == "Population")
caption += "/" + localPlayer.resources["housing"];

View File

@ -689,9 +689,9 @@ function performGather( evt )
}
if( g.resource[s.type][s.subtype])
gather_amt = parseInt( g.resource[s.type][s.subtype] );
gather_amt = parseFloat( g.resource[s.type][s.subtype] );
else
gather_amt = parseInt( g.resource[s.type] );
gather_amt = parseFloat( g.resource[s.type] );
if( s.max > 0 )
{

View File

@ -1,4 +1,4 @@
function techExample()
function techExample( player )
{
console.write("Dude, it works!");
console.write("Player " + player + " got the tech!");
}

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<Tech>
<ID>
<Generic>Ore Mining 2</Generic>
<Specific>Helots</Specific>
<Icon>PortraitSheetTech</Icon>
<Icon_Cell>0</Icon_Cell>
<Classes>Buff</Classes>
<Rollover></Rollover>
<History></History>
</ID>
<Req>
<Time>5</Time>
<Resource>
<Food>100</Food>
<Wood>200</Wood>
<Stone>0</Stone>
<Ore>0</Ore>
</Resource>
<Tech>hele_wedge_and_mallet</Tech>
<Tech>hele_stone_1</Tech>
</Req>
<Effect>
<Target>Worker</Target>
<Pair>hele_slaves</Pair>
<Modifier>
<Attribute>actions.gather.resource.ore</Attribute>
<Value>15%</Value>
</Modifier>
</Effect>
</Tech>

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<Tech>
<ID>
<Generic>Stone Mining 2</Generic>
<Specific>Slaves</Specific>
<Icon>PortraitSheetTech</Icon>
<Icon_Cell>0</Icon_Cell>
<Classes>Buff</Classes>
<Rollover></Rollover>
<History></History>
</ID>
<Req>
<Time>5</Time>
<Resource>
<Food>200</Food>
<Wood>100</Wood>
<Stone>0</Stone>
<Ore>0</Ore>
</Resource>
<Tech>hele_wedge_and_mallet</Tech>
<Tech>hele_stone_1</Tech>
</Req>
<Effect>
<Target>Worker</Target>
<Pair>hele_helots</Pair>
<Modifier>
<Attribute>actions.gather.resource.stone</Attribute>
<Value>15%</Value>
</Modifier>
</Effect>
</Tech>

View File

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<Tech>
<ID>
<Generic>Stone Mining 1</Generic>
<Specific>Unnamed... For Now</Specific>
<Icon>PortraitSheetTech</Icon>
<Icon_Cell>0</Icon_Cell>
<Classes>Buff</Classes>
<Rollover></Rollover>
<History></History>
</ID>
<Req>
<Time>5</Time>
<Resource>
<Food>100</Food>
<Wood>50</Wood>
<Stone>0</Stone>
<Ore>0</Ore>
</Resource>
</Req>
<Effect>
<Target>Worker</Target>
<Pair>hele_wedge_and_mallet</Pair>
<Modifier>
<Attribute>actions.gather.resource.stone</Attribute>
<Value>15%</Value>
</Modifier>
</Effect>
</Tech>

View File

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<Tech>
<ID>
<Generic>Ore Mining 1</Generic>
<Specific>Wedge and Mallet</Specific>
<Icon>PortraitSheetTech</Icon>
<Icon_Cell>0</Icon_Cell>
<Classes>Buff</Classes>
<Rollover></Rollover>
<History></History>
</ID>
<Req>
<Time>5</Time>
<Resource>
<Food>50</Food>
<Wood>100</Wood>
<Stone>0</Stone>
<Ore>0</Ore>
</Resource>
</Req>
<Effect>
<Target>Worker</Target>
<Pair>hele_stone_1</Pair>
<Modifier>
<Attribute>actions.gather.resource.ore</Attribute>
<Value>15%</Value>
</Modifier>
</Effect>
</Tech>