(Trying again, as it timed out last time I tried this.) Added various entity attributes, and struggled to get them to appear in GUI (seem to be issues with numeric interpretation and icons sometimes don't appear), but it's a start. Also made start on training

This was SVN commit r1450.
This commit is contained in:
Acumen
2004-12-04 21:38:52 +00:00
parent 936fc885a1
commit 944397c4cf
29 changed files with 544 additions and 106 deletions
@@ -8,6 +8,18 @@
type.gaia.group.fauna="true"
/>
<MiniMap
type="Food"
red="253"
green="141"
blue="21"
/>
<Supply
curr="100"
max="100"
type="food"
subtype="meat"
/>
</Traits>
<Footprint Radius="1.0"/>
</Entity>
@@ -11,8 +11,20 @@
rollover="Chop these down to accumulate Wood."
/>
<Health
hitpoints="100"
max="100"
curr="100"
/>
<MiniMap
type="Wood"
red="0"
green="128"
blue="0"
/>
<Supply
curr="200"
max="200"
type="wood"
subtype="wood"
/>
</Traits>
</Entity>
@@ -8,5 +8,17 @@
rollover="A mineral deposit, providing access to rare forms of precious metal."
/>
<MiniMap
type="Ore"
red="192"
green="192"
blue="0"
/>
<Supply
curr="100"
max="100"
type="ore"
subtype="ore"
/>
</Traits>
</Entity>
@@ -8,5 +8,17 @@
rollover="A lump of hard common mineral. It can be mined to provide stone building material."
/>
<MiniMap
type="Stone"
red="128"
green="128"
blue="128"
/>
<Supply
curr="50"
max="50"
type="stone"
subtype="stone"
/>
</Traits>
</Entity>
@@ -8,6 +8,9 @@
type.gaia.group.special="true"
/>
<MiniMap
type="Special"
/>
</Traits>
<Footprint Radius="1.0"/>
</Entity>
@@ -6,6 +6,9 @@
icon="gaia_st"
internal_only="false"
/>
<MiniMap
type="Settlement"
/>
</Traits>
<Actor>Settlement</Actor>
</Entity>
@@ -10,7 +10,13 @@
specific="Apoikia"
history="During the Great Colonisation, the Hellenes built numerous colonies all over the shores of the Mediterranean and Black Seas, which became miniature versions of Greece on foreign soil."
/>
</Traits>
<Actions>
<Create
unitlist="hele_fem_b1;hele_isp_u1"
/>
</Actions>
<Actor>Hellenes Civilisation Centre</Actor>
</Entity>
@@ -12,9 +12,13 @@
type.structure.group.housing="true"
type.structure.phase.vp="true"
/>
<Garrison
curr="0"
max="15"
/>
<Health
curr="1000"
hitpoints="1000"
max="1000"
/>
<Population
add="10"
@@ -13,7 +13,10 @@
/>
<Health
curr="600"
hitpoints="600"
max="600"
/>
<Population
add="5"
/>
</Traits>
<Footprint Width="18.0" Height="18.0"/>
@@ -11,9 +11,13 @@
type.structure.phase.vp="true"
/>
<Garrison
curr="0"
max="3"
/>
<Health
curr="60"
hitpoints="60"
max="60"
/>
</Traits>
<Footprint Width="6.0" Height="6.0"/>
@@ -11,9 +11,13 @@
type.structure.phase.vp="true"
/>
<Garrison
curr="0"
max="5"
/>
<Health
curr="80"
hitpoints="80"
max="80"
/>
</Traits>
<Footprint Width="6.0" Height="6.0"/>
@@ -11,9 +11,13 @@
type.structure.phase.vp="true"
/>
<Garrison
curr="0"
max="5"
/>
<Health
curr="50"
hitpoints="50"
max="50"
/>
</Traits>
<Footprint Width="12.0" Height="12.0"/>
@@ -13,7 +13,14 @@
/>
<Health
curr="600"
hitpoints="600"
max="600"
/>
<Garrison
curr="0"
max="10"
/>
<Population
add="10"
/>
</Traits>
<Footprint Width="18.0" Height="18.0"/>
@@ -11,9 +11,16 @@
type.structure.phase.cp="true"
/>
<Garrison
curr="0"
max="30"
/>
<Health
curr="1000"
hitpoints="1000"
max="1000"
/>
<Population
add="20"
/>
</Traits>
<Footprint Width="24.0" Height="24.0"/>
@@ -13,7 +13,10 @@
/>
<Health
curr="600"
hitpoints="600"
max="600"
/>
<Population
add="15"
/>
</Traits>
<Footprint Width="18.0" Height="18.0"/>
@@ -11,9 +11,23 @@
type.structure.phase.vp="true"
/>
<Garrison
curr="0"
max="6"
/>
<Health
curr="50"
hitpoints="50"
max="50"
/>
<!-- Infinite Supply to gather -->
<Supply
curr="0"
max="0"
type="food"
subtype="milk"
/>
<Vision
los="0"
/>
</Traits>
<Footprint Width="12.0" Height="12.0"/>
@@ -11,9 +11,23 @@
type.structure.phase.vp="true"
/>
<Garrison
curr="0"
max="1"
/>
<Health
curr="50"
hitpoints="50"
max="50"
/>
<!-- Infinite Supply to gather -->
<Supply
curr="0"
max="0"
type="food"
subtype="grain"
/>
<Vision
los="0"
/>
</Traits>
<Footprint Width="12.0" Height="12.0"/>
@@ -12,7 +12,7 @@
specific="Ghune"
rollover="Greek women were kept under tight control by their husbands, rarely leaving the home for anything beyond the necessities of daily life. They could not own anything or be involved in any business or legal transaction. They acted as household cook, nurse, seamstress, and early educator to young children. Spartan women were an exception to the normal code of conduct and enjoyed many freedoms."
history="Greek women were kept under tight control by their husbands, rarely leaving the home for anything beyond the necessities of daily life. They could not own anything or be involved in any business or legal transaction. They acted as household cook, nurse, seamstress, and early educator to young children. Spartan women were an exception to the normal code of conduct and enjoyed many freedoms."
/>
</Traits>
<Actor>The Dudette</Actor>
@@ -21,7 +21,10 @@
/>
<Health
curr="150"
hitpoints="150"
max="150"
/>
<MiniMap
type="Unit"
/>
<Up
rank="0"
@@ -18,5 +18,8 @@
stone="1"
ore="1"
/>
<MiniMap
type="Hero"
/>
</Traits>
</Entity>
@@ -15,5 +15,11 @@
stone="1"
ore="1"
/>
<MiniMap
type="Support"
/>
<Population
sub="1"
/>
</Traits>
</Entity>
@@ -690,52 +690,32 @@
]]></action>
</object>
<!-- GARRISON COUNTER -->
<object type="button" name="session_panel_status_icon_garrison" textcolor="100 100 255" font="verdana11" text-align="left" text-valign="bottom" ghost="true" z="70" hidden="false">
<!-- GARRISON/SUPPLY COUNTER -->
<object type="button" name="session_panel_status_stat1" font="verdana11" textcolor="255 255 255" text-align="center" text-valign="bottom" ghost="true" z="70" hidden="false">
<action on="Load"><![CDATA[
AddSizeCoord(this.name,
crd_status_orb_garrison_x, crd_status_orb_garrison_y, crd_status_orb_garrison_x+crd_status_orb_garrison_width, crd_status_orb_garrison_y+crd_status_orb_garrison_height, left_screen, top_screen, left_screen, top_screen,
crd_status_orb_garrison_x, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_garrison_y, crd_status_orb_garrison_x+crd_status_orb_garrison_width, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_garrison_y+crd_status_orb_garrison_height, left_screen, bottom_screen, left_screen, bottom_screen);
crd_status_orb_stat1_x, crd_status_orb_stat1_y, crd_status_orb_stat1_x+crd_status_orb_stat1_width, crd_status_orb_stat1_y+crd_status_orb_stat1_height, left_screen, top_screen, left_screen, top_screen,
crd_status_orb_stat1_x, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_stat1_y, crd_status_orb_stat1_x+crd_status_orb_stat1_width, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_stat1_y+crd_status_orb_stat1_height, left_screen, bottom_screen, left_screen, bottom_screen);
getGUIObjectByName("session_panel_status_icon_garrison").caption = "[icon=icon_statistic_garrison] 23/30";
]]></action>
</object>
<!-- SUPPLY COUNTER -->
<object type="button" name="session_panel_status_icon_supply" textcolor="252 148 78" font="verdana11" text-align="left" text-valign="bottom" ghost="true" z="70" hidden="false">
<action on="Load"><![CDATA[
AddSizeCoord(this.name,
crd_status_orb_supply_x, crd_status_orb_supply_y, crd_status_orb_supply_x+crd_status_orb_supply_width, crd_status_orb_supply_y+crd_status_orb_supply_height, left_screen, top_screen, left_screen, top_screen,
crd_status_orb_supply_x, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_supply_y, crd_status_orb_supply_x+crd_status_orb_supply_width, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_supply_y+crd_status_orb_supply_height, left_screen, bottom_screen, left_screen, bottom_screen);
getGUIObjectByName("session_panel_status_icon_supply").caption = "[icon=icon_resource_wood] 1575";
getGUIObjectByName("session_panel_status_stat1").caption = "[icon=icon_statistic_garrison] 23/30 [icon=icon_resource_wood] 1575";
]]></action>
</object>
<!-- ATTACK STATS -->
<object type="text" name="session_panel_status_attack" font="verdana10" textcolor="200 200 200" ghost="true" z="70" hidden="false">
<object type="text" name="session_panel_status_stat2" font="verdana10" textcolor="200 200 200" ghost="true" z="70" hidden="false">
<action on="Load"><![CDATA[
AddSizeCoord(this.name,
crd_status_orb_attack_x, crd_status_orb_attack_y, crd_status_orb_attack_x+crd_status_orb_attack_width, crd_status_orb_attack_y+crd_status_orb_attack_height, left_screen, top_screen, left_screen, top_screen,
crd_status_orb_attack_x, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_attack_y, crd_status_orb_attack_x+crd_status_orb_attack_width, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_attack_y+crd_status_orb_attack_height, left_screen, bottom_screen, left_screen, bottom_screen);
crd_status_orb_stat2_x, crd_status_orb_stat2_y, crd_status_orb_stat2_x+crd_status_orb_stat2_width, crd_status_orb_stat2_y+crd_status_orb_stat2_height, left_screen, top_screen, left_screen, top_screen,
crd_status_orb_stat2_x, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_stat2_y, crd_status_orb_stat2_x+crd_status_orb_stat2_width, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_stat2_y+crd_status_orb_stat2_height, left_screen, bottom_screen, left_screen, bottom_screen);
]]></action>
</object>
<!-- ARMOUR STATS -->
<object type="text" name="session_panel_status_armour" font="verdana10" textcolor="200 200 200" ghost="true" z="70" hidden="false">
<object type="text" name="session_panel_status_stat3" font="verdana10" textcolor="200 200 200" ghost="true" z="70" hidden="false">
<action on="Load"><![CDATA[
AddSizeCoord(this.name,
crd_status_orb_armour_x, crd_status_orb_armour_y, crd_status_orb_armour_x+crd_status_orb_armour_width, crd_status_orb_armour_y+crd_status_orb_armour_height, left_screen, top_screen, left_screen, top_screen,
crd_status_orb_armour_x, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_armour_y, crd_status_orb_armour_x+crd_status_orb_armour_width, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_armour_y+crd_status_orb_armour_height, left_screen, bottom_screen, left_screen, bottom_screen);
]]></action>
</object>
<!-- OTHER STATS -->
<object type="text" name="session_panel_status_other" font="verdana10" textcolor="200 200 200" ghost="true" z="70" hidden="false">
<action on="Load"><![CDATA[
AddSizeCoord(this.name,
crd_status_orb_other_x, crd_status_orb_other_y, crd_status_orb_other_x+crd_status_orb_other_width, crd_status_orb_other_y+crd_status_orb_other_height, left_screen, top_screen, left_screen, top_screen,
crd_status_orb_other_x, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_other_y, crd_status_orb_other_x+crd_status_orb_other_width, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_armour_y+crd_status_orb_other_height, left_screen, bottom_screen, left_screen, bottom_screen);
crd_status_orb_stat3_x, crd_status_orb_stat3_y, crd_status_orb_stat3_x+crd_status_orb_stat3_width, crd_status_orb_stat3_y+crd_status_orb_stat3_height, left_screen, top_screen, left_screen, top_screen,
crd_status_orb_stat3_x, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_stat3_y, crd_status_orb_stat3_x+crd_status_orb_stat3_width, -crd_status_orb_bkg_y-crd_status_orb_bkg_height+crd_status_orb_stat3_y+crd_status_orb_stat3_height, left_screen, bottom_screen, left_screen, bottom_screen);
]]></action>
</object>
@@ -747,6 +727,55 @@
crd_status_orb_command_1_x, -crd_status_orb_command_1_y-crd_status_orb_command_1_height, crd_status_orb_command_1_x+crd_status_orb_command_1_width, -crd_status_orb_command_1_y, left_screen, bottom_screen, left_screen, bottom_screen);
]]></action>
</object>
<object type="button" name="session_panel_status_command_pri_1_1" style="portrait" textcolor="255 255 255" z="70" hidden="false">1
<action on="Load"><![CDATA[
AddSizeCoord(this.name,
crd_status_orb_command_1_1_x, crd_status_orb_command_1_1_y, crd_status_orb_command_1_1_x+crd_status_orb_command_1_1_width, crd_status_orb_command_1_1_y+crd_status_orb_command_1_1_height, left_screen, top_screen, left_screen, top_screen,
crd_status_orb_command_1_1_x, -crd_status_orb_command_1_1_y-crd_status_orb_command_1_1_height, crd_status_orb_command_1_1_x+crd_status_orb_command_1_1_width, -crd_status_orb_command_1_1_y, left_screen, bottom_screen, left_screen, bottom_screen);
]]></action>
</object>
<object type="button" name="session_panel_status_command_pri_1_2" style="portrait" textcolor="255 255 255" z="70" hidden="false">2
<action on="Load"><![CDATA[
AddSizeCoord(this.name,
crd_status_orb_command_1_2_x, crd_status_orb_command_1_2_y, crd_status_orb_command_1_2_x+crd_status_orb_command_1_2_width, crd_status_orb_command_1_2_y+crd_status_orb_command_1_2_height, left_screen, top_screen, left_screen, top_screen,
crd_status_orb_command_1_2_x, -crd_status_orb_command_1_2_y-crd_status_orb_command_1_2_height, crd_status_orb_command_1_2_x+crd_status_orb_command_1_2_width, -crd_status_orb_command_1_2_y, left_screen, bottom_screen, left_screen, bottom_screen);
]]></action>
</object>
<object type="button" name="session_panel_status_command_pri_1_3" style="portrait" textcolor="255 255 255" z="70" hidden="false">3
<action on="Load"><![CDATA[
AddSizeCoord(this.name,
crd_status_orb_command_1_3_x, crd_status_orb_command_1_3_y, crd_status_orb_command_1_3_x+crd_status_orb_command_1_3_width, crd_status_orb_command_1_3_y+crd_status_orb_command_1_3_height, left_screen, top_screen, left_screen, top_screen,
crd_status_orb_command_1_3_x, -crd_status_orb_command_1_3_y-crd_status_orb_command_1_3_height, crd_status_orb_command_1_3_x+crd_status_orb_command_1_3_width, -crd_status_orb_command_1_3_y, left_screen, bottom_screen, left_screen, bottom_screen);
]]></action>
</object>
<object type="button" name="session_panel_status_command_pri_1_4" style="portrait" textcolor="255 255 255" z="70" hidden="false">4
<action on="Load"><![CDATA[
AddSizeCoord(this.name,
crd_status_orb_command_1_4_x, crd_status_orb_command_1_4_y, crd_status_orb_command_1_4_x+crd_status_orb_command_1_4_width, crd_status_orb_command_1_4_y+crd_status_orb_command_1_4_height, left_screen, top_screen, left_screen, top_screen,
crd_status_orb_command_1_4_x, -crd_status_orb_command_1_4_y-crd_status_orb_command_1_4_height, crd_status_orb_command_1_4_x+crd_status_orb_command_1_4_width, -crd_status_orb_command_1_4_y, left_screen, bottom_screen, left_screen, bottom_screen);
]]></action>
</object>
<object type="button" name="session_panel_status_command_pri_1_5" style="portrait" textcolor="255 255 255" z="70" hidden="false">5
<action on="Load"><![CDATA[
AddSizeCoord(this.name,
crd_status_orb_command_1_5_x, crd_status_orb_command_1_5_y, crd_status_orb_command_1_5_x+crd_status_orb_command_1_5_width, crd_status_orb_command_1_5_y+crd_status_orb_command_1_5_height, left_screen, top_screen, left_screen, top_screen,
crd_status_orb_command_1_5_x, -crd_status_orb_command_1_5_y-crd_status_orb_command_1_5_height, crd_status_orb_command_1_5_x+crd_status_orb_command_1_5_width, -crd_status_orb_command_1_5_y, left_screen, bottom_screen, left_screen, bottom_screen);
]]></action>
</object>
<object type="button" name="session_panel_status_command_pri_1_6" style="portrait" textcolor="255 255 255" z="70" hidden="false">6
<action on="Load"><![CDATA[
AddSizeCoord(this.name,
crd_status_orb_command_1_6_x, crd_status_orb_command_1_6_y, crd_status_orb_command_1_6_x+crd_status_orb_command_1_6_width, crd_status_orb_command_1_6_y+crd_status_orb_command_1_6_height, left_screen, top_screen, left_screen, top_screen,
crd_status_orb_command_1_6_x, -crd_status_orb_command_1_6_y-crd_status_orb_command_1_6_height, crd_status_orb_command_1_6_x+crd_status_orb_command_1_6_width, -crd_status_orb_command_1_6_y, left_screen, bottom_screen, left_screen, bottom_screen);
]]></action>
</object>
<object type="button" name="session_panel_status_command_pri_2" style="portrait" textcolor="255 255 255" z="70" hidden="false">2
<action on="Load"><![CDATA[
AddSizeCoord(this.name,
@@ -49,8 +49,8 @@ function manualDisplay()
ManualRollover.caption += "Civilisation: " + selection[0].traits.id.civ + "\n";
// Display hitpoints.
if (selection[0].traits.health.curr && selection[0].traits.health.hitpoints && selection[0].traits.health)
ManualRollover.caption += "Hitpoints: " + selection[0].traits.health.curr + "/" + selection[0].traits.health.hitpoints + "\n";
if (selection[0].traits.health.curr && selection[0].traits.health.max && selection[0].traits.health)
ManualRollover.caption += "Hitpoints: " + selection[0].traits.health.curr + "/" + selection[0].traits.health.max + "\n";
// Display rank.
if (selection[0].traits.up.rank)
@@ -60,6 +60,37 @@ function manualDisplay()
if (selection[0].traits.up && selection[0].traits.up.curr && selection[0].traits.up.req)
ManualRollover.caption += "XP: " + selection[0].traits.up.curr + "/" + selection[0].traits.up.req + "\n";
// Display population.
if (selection[0].traits.population)
{
if (selection[0].traits.population.sub)
ManualRollover.caption += "Pop: -" + selection[0].traits.population.sub + "\n";
if (selection[0].traits.population.add)
ManualRollover.caption += "Housing: +" + selection[0].traits.population.add + "\n";
}
// Display garrison.
if (selection[0].traits.garrison)
{
if (selection[0].traits.garrison.curr && selection[0].traits.garrison.max)
ManualRollover.caption += "Garrison: " + selection[0].traits.garrison.curr + "/" + selection[0].traits.garrison.max + "\n";
}
// Display supply.
if (selection[0].traits.supply)
{
if (selection[0].traits.supply.curr && selection[0].traits.supply.max && selection[0].traits.supply.type)
{
// If Supply is infinite,
if (selection[0].traits.supply.curr == "0" && selection[0].traits.supply.max == "0")
// Use infinity symbol.
ManualRollover.caption += "Supply: " + selection[0].traits.supply.curr + "/" + selection[0].traits.supply.max + " " + selection[0].traits.supply.type + " (" + selection[0].traits.supply.subtype + ")\n";
else
// Use numbers.
ManualRollover.caption += "Supply: 8 " + selection[0].traits.supply.type + " (" + selection[0].traits.supply.subtype + ")\n";
}
}
if (selection[0].traits.loot)
{
// Display UP on death.
@@ -82,6 +113,17 @@ function manualDisplay()
}
}
// Display minimap.
if (selection[0].traits.minimap)
{
if (selection[0].traits.minimap && selection[0].traits.minimap.type)
ManualRollover.caption += "Map Type: " + selection[0].traits.minimap.type + "\n";
if (selection[0].traits.minimap && selection[0].traits.minimap.red && selection[0].traits.minimap.green && selection[0].traits.minimap.blue)
ManualRollover.caption += "Map Colour: " + selection[0].traits.minimap.red + "-" + selection[0].traits.minimap.green + "-" + selection[0].traits.minimap.blue + "\n";
}
// Armour.
if (selection[0].traits.armour)
{
@@ -127,6 +169,9 @@ function manualDisplay()
if (selection[0].actions.attack.range)
ManualRollover.caption += "Attack Range: " + selection[0].actions.attack.range + "\n";
if (selection[0].actions.attack.accuracy)
ManualRollover.caption += "Attack Accuracy: " + selection[0].actions.attack.accuracy*100 + "%\n";
}
// Speed.
@@ -173,6 +218,14 @@ function manualDisplay()
if (selection[0].traits.id.version)
ManualRollover.caption += "Version: " + selection[0].traits.id.version + "\n";
// Lists.
if (selection[0].actions.create)
{
if (selection[0].actions.create.unitlist)
ManualRollover.caption += "Trains: " + selection[0].actions.create.unitlist + "\n";
}
// Display types.
if (selection[0].traits.id.type)
{
@@ -10,11 +10,11 @@ function initStatusOrb()
crd_status_orb_heading_width = crd_status_orb_bkg_width;
crd_status_orb_heading_height = 14;
crd_status_orb_heading_x = crd_status_orb_bkg_x+2;
crd_status_orb_heading_y = crd_status_orb_bkg_y;
crd_status_orb_heading_y = crd_status_orb_bkg_y+3;
// Status Orb large portrait.
crd_status_orb_portrait_x = crd_status_orb_heading_x+5;
crd_status_orb_portrait_y = crd_status_orb_heading_y+crd_status_orb_heading_height+5;
crd_status_orb_portrait_y = crd_status_orb_heading_y+crd_status_orb_heading_height+7;
crd_status_orb_portrait_width = crd_portrait_lrg_width;
crd_status_orb_portrait_height = crd_portrait_lrg_height;
@@ -57,37 +57,25 @@ function initStatusOrb()
crd_status_orb_xpbar_text_width = crd_status_orb_hpbar_text_width;
crd_status_orb_xpbar_text_height = crd_status_orb_hpbar_text_height;
// Garrison counter.
crd_status_orb_garrison_span_x = 5;
crd_status_orb_garrison_span_y = 2;
crd_status_orb_garrison_width = 65;
crd_status_orb_garrison_height = 30;
crd_status_orb_garrison_x = crd_status_orb_hpbar_text_x+crd_status_orb_hpbar_text_width;
crd_status_orb_garrison_y = crd_status_orb_hpbar_y-(crd_status_orb_garrison_height/3);
// Garrison/Supply counter.
crd_status_orb_stat1_span_x = 5;
crd_status_orb_stat1_span_y = 2;
crd_status_orb_stat1_width = 126;
crd_status_orb_stat1_height = 30;
crd_status_orb_stat1_x = crd_status_orb_hpbar_text_x+crd_status_orb_hpbar_text_width;
crd_status_orb_stat1_y = crd_status_orb_hpbar_y-crd_mini_icon_width+1;
// Supply counter.
crd_status_orb_supply_x = crd_status_orb_garrison_x+crd_status_orb_garrison_width;
crd_status_orb_supply_y = crd_status_orb_garrison_y;
crd_status_orb_supply_width = crd_status_orb_garrison_width-4;
crd_status_orb_supply_height = crd_status_orb_garrison_height;
// Attack Stats.
crd_status_orb_stat2_x = crd_status_orb_portrait_x;
crd_status_orb_stat2_y = crd_status_orb_xpbar_y+crd_status_orb_xpbar_height+2;
crd_status_orb_stat2_width = crd_status_orb_bkg_width-8;
crd_status_orb_stat2_height = (crd_status_orb_bkg_y+crd_status_orb_bkg_height-5-crd_status_orb_stat2_y)/2;
// Attack.
crd_status_orb_attack_width = crd_status_orb_bkg_width-8;
crd_status_orb_attack_height = 22;
crd_status_orb_attack_x = crd_status_orb_portrait_x;
crd_status_orb_attack_y = crd_status_orb_xpbar_y+crd_status_orb_xpbar_height;
// Armour.
crd_status_orb_armour_width = crd_status_orb_attack_width;
crd_status_orb_armour_height = crd_status_orb_attack_height;
crd_status_orb_armour_x = crd_status_orb_attack_x;
crd_status_orb_armour_y = crd_status_orb_attack_y+crd_status_orb_attack_height;
// Other.
crd_status_orb_other_width = crd_status_orb_armour_width;
crd_status_orb_other_height = crd_status_orb_armour_height;
crd_status_orb_other_x = crd_status_orb_armour_x;
crd_status_orb_other_y = crd_status_orb_armour_y+crd_status_orb_armour_height;
// Armour & Other Stats.
crd_status_orb_stat3_width = crd_status_orb_stat2_width;
crd_status_orb_stat3_height = crd_status_orb_stat2_height;
crd_status_orb_stat3_x = crd_status_orb_stat2_x;
crd_status_orb_stat3_y = crd_status_orb_stat2_y+crd_status_orb_stat2_height;
// Command Button 1.
crd_status_orb_command_1_width = crd_portrait_sml_width;
@@ -96,6 +84,42 @@ function initStatusOrb()
crd_status_orb_command_1_y = crd_status_orb_bkg_height+1;
crd_status_orb_command_span = 2;
// Command Button 1_1.
crd_status_orb_command_1_1_width = crd_status_orb_command_1_width;
crd_status_orb_command_1_1_height = crd_status_orb_command_1_height;
crd_status_orb_command_1_1_x = crd_status_orb_command_1_x;
crd_status_orb_command_1_1_y = crd_status_orb_command_1_y+crd_status_orb_command_1_height+crd_status_orb_command_span;
// Command Button 1_2.
crd_status_orb_command_1_2_width = crd_status_orb_command_1_width;
crd_status_orb_command_1_2_height = crd_status_orb_command_1_height;
crd_status_orb_command_1_2_x = crd_status_orb_command_1_x;
crd_status_orb_command_1_2_y = crd_status_orb_command_1_1_y+crd_status_orb_command_1_1_height+crd_status_orb_command_span;
// Command Button 1_3.
crd_status_orb_command_1_3_width = crd_status_orb_command_1_width;
crd_status_orb_command_1_3_height = crd_status_orb_command_1_height;
crd_status_orb_command_1_3_x = crd_status_orb_command_1_x;
crd_status_orb_command_1_3_y = crd_status_orb_command_1_2_y+crd_status_orb_command_1_2_height+crd_status_orb_command_span;
// Command Button 1_4.
crd_status_orb_command_1_4_width = crd_status_orb_command_1_width;
crd_status_orb_command_1_4_height = crd_status_orb_command_1_height;
crd_status_orb_command_1_4_x = crd_status_orb_command_1_x;
crd_status_orb_command_1_4_y = crd_status_orb_command_1_3_y+crd_status_orb_command_1_3_height+crd_status_orb_command_span;
// Command Button 1_5.
crd_status_orb_command_1_5_width = crd_status_orb_command_1_width;
crd_status_orb_command_1_5_height = crd_status_orb_command_1_height;
crd_status_orb_command_1_5_x = crd_status_orb_command_1_x;
crd_status_orb_command_1_5_y = crd_status_orb_command_1_4_y+crd_status_orb_command_1_4_height+crd_status_orb_command_span;
// Command Button 1_6.
crd_status_orb_command_1_6_width = crd_status_orb_command_1_width;
crd_status_orb_command_1_6_height = crd_status_orb_command_1_height;
crd_status_orb_command_1_6_x = crd_status_orb_command_1_x;
crd_status_orb_command_1_6_y = crd_status_orb_command_1_5_y+crd_status_orb_command_1_5_height+crd_status_orb_command_span;
// Command Button 2.
crd_status_orb_command_2_width = crd_status_orb_command_1_width;
crd_status_orb_command_2_height = crd_status_orb_command_1_height;
@@ -169,6 +193,20 @@ function initStatusOrb()
crd_status_orb_command_13_y = crd_status_orb_command_12_y-crd_status_orb_command_12_height-(crd_status_orb_command_span/2);
}
// ====================================================================
/*
function getCommandSlot()
{
if (crd_status_orb_command_1.length == 0)
return "1";
if (crd_status_orb_command_2.length == 0)
return "2";
if (crd_status_orb_command_3.length == 0)
return "3";
if (crd_status_orb_command_4.length == 0)
return "4";
}
*/
// ====================================================================
function UpdateStatusOrb()
@@ -223,11 +261,11 @@ function UpdateStatusOrb()
getGUIObjectByName("session_panel_status_icon_rank").sprite = "";
// Update hitpoints
if (selection[0].traits.health.curr && selection[0].traits.health.hitpoints)
if (selection[0].traits.health.curr && selection[0].traits.health.max)
{
getGUIObjectByName("session_panel_status_icon_hp_text").caption = Math.round(selection[0].traits.health.curr) + "/" + Math.round(selection[0].traits.health.hitpoints);
getGUIObjectByName("session_panel_status_icon_hp_text").caption = Math.round(selection[0].traits.health.curr) + "/" + Math.round(selection[0].traits.health.max);
getGUIObjectByName("session_panel_status_icon_hp_text").hidden = false;
getGUIObjectByName("session_panel_status_icon_hp_bar").caption = ((Math.round(selection[0].traits.health.curr) * 100 ) / Math.round(selection[0].traits.health.hitpoints));
getGUIObjectByName("session_panel_status_icon_hp_bar").caption = ((Math.round(selection[0].traits.health.curr) * 100 ) / Math.round(selection[0].traits.health.max));
getGUIObjectByName("session_panel_status_icon_hp_bar").hidden = false;
}
else
@@ -250,36 +288,104 @@ function UpdateStatusOrb()
getGUIObjectByName("session_panel_status_icon_xp_bar").hidden = true;
}
// Update stats
if (selection[0].actions.attack && selection[0].actions.attack.damage && selection[0].actions.attack.damage > 0 && selection[0].actions.attack.crush && selection[0].actions.attack.hack && selection[0].actions.attack.pierce)
// Update Supply/Garrison
GUIObject = getGUIObjectByName("session_panel_status_stat1");
GUIObject.caption = '';
if (selection[0].traits.garrison)
{
getGUIObjectByName("session_panel_status_attack").caption = "[icon=icon_statistic_attack]" + selection[0].actions.attack.damage + " [icon=icon_statistic_hack]" + Math.round(selection[0].actions.attack.hack*100) + "% [icon=icon_statistic_pierce]" + Math.round(selection[0].actions.attack.pierce*100) + "% [icon=icon_statistic_crush]" + Math.round(selection[0].actions.attack.crush*100) + "%";
if (selection[0].traits.garrison.curr && selection[0].traits.garrison.max)
{
GUIObject.caption += '[icon="icon_statistic_garrison"] [color="100 100 255"]' + selection[0].traits.garrison.curr + '/' + selection[0].traits.garrison.max + '[/color] ';
}
}
else
getGUIObjectByName("session_panel_status_attack").caption = "";
if (selection[0].traits.armour && selection[0].traits.armour.value && selection[0].traits.armour.value > 0 && selection[0].traits.armour.crush && selection[0].traits.armour.hack && selection[0].traits.armour.pierce)
if (selection[0].traits.supply)
{
getGUIObjectByName("session_panel_status_armour").caption = "[icon=icon_statistic_armour]" + selection[0].traits.armour.value + " [icon=icon_statistic_hack]" + Math.round(selection[0].traits.armour.hack*100) + "% [icon=icon_statistic_pierce]" + Math.round(selection[0].traits.armour.pierce*100) + "% [icon=icon_statistic_crush]" + Math.round(selection[0].traits.armour.crush*100) + "%";
if (selection[0].traits.supply.curr && selection[0].traits.supply.max && selection[0].traits.supply.type)
{
GUIObject.caption += '[icon="icon_resource_' + selection[0].traits.supply.type + '"] [color="255 100 100"]';
// Special case for infinity.
if (selection[0].traits.supply.curr == "0" && selection[0].traits.supply.max == "0")
GUIObject.caption += '8 ';
else
GUIObject.caption += selection[0].traits.supply.curr + '/' + selection[0].traits.supply.max;
}
}
else
getGUIObjectByName("session_panel_status_armour").caption = "";
GUIObject = getGUIObjectByName("session_panel_status_other");
GUIObject.caption = "";
if (selection[0].actions.attack && selection[0].actions.attack.range)
// Update Attack stats
GUIObject = getGUIObjectByName("session_panel_status_stat2");
GUIObject.caption = '';
if (selection[0].actions.attack)
{
GUIObject.caption += "[icon=icon_statistic_accuracy]" + selection[0].actions.attack.range + " ";
if (selection[0].actions.attack.damage && selection[0].actions.attack.damage > 0)
GUIObject.caption += '[icon="icon_statistic_attack"]' + selection[0].actions.attack.damage + ' ';
if (selection[0].actions.attack.hack && selection[0].actions.attack.hack > 0)
GUIObject.caption += '[icon="icon_statistic_hack"]' + Math.round(selection[0].actions.attack.hack*100) + '% ';
if (selection[0].actions.attack.pierce && selection[0].actions.attack.pierce > 0)
GUIObject.caption += '[icon="icon_statistic_pierce"]' + Math.round(selection[0].actions.attack.pierce*100) + '% ';
if (selection[0].actions.attack.crush && selection[0].actions.attack.crush > 0)
GUIObject.caption += '[icon="icon_statistic_crush"]' + Math.round(selection[0].actions.attack.crush*100) + '% ';
if (selection[0].actions.attack.range)
GUIObject.caption += '[icon="icon_statistic_range"]' + selection[0].actions.attack.range + ' ';
if (selection[0].actions.attack.accuracy)
GUIObject.caption += '[icon="icon_statistic_accuracy"]' + Math.round(selection[0].actions.attack.accuracy*100) + '% ';
}
// Update Armour & Other stats
GUIObject = getGUIObjectByName("session_panel_status_stat3");
GUIObject.caption = '';
if (selection[0].traits.armour)
{
if (selection[0].traits.armour.value && selection[0].traits.armour.value > 0)
GUIObject.caption += '[icon="icon_statistic_armour"]' + selection[0].traits.armour.value + ' ';
if (selection[0].traits.armour.hack && selection[0].traits.armour.hack > 0)
GUIObject.caption += '[icon="icon_statistic_hack"]' + Math.round(selection[0].traits.armour.hack*100) + '% ';
if (selection[0].traits.armour.pierce && selection[0].traits.armour.pierce > 0)
GUIObject.caption += '[icon="icon_statistic_pierce"]' + Math.round(selection[0].traits.armour.pierce*100) + '% ';
if (selection[0].traits.armour.crush && selection[0].traits.armour.crush > 0)
GUIObject.caption += '[icon="icon_statistic_crush"]' + Math.round(selection[0].traits.armour.crush*100) + '% ';
}
if (selection[0].actions.move && selection[0].actions.move.speed)
{
GUIObject.caption += "[icon=icon_statistic_speed]" + selection[0].actions.move.speed + " ";
}
GUIObject.caption += '[icon="icon_statistic_speed"]' + selection[0].actions.move.speed + ' ';
if (selection[0].traits.vision && selection[0].traits.vision.los)
{
GUIObject.caption += "[icon=icon_statistic_los]" + selection[0].traits.vision.los + " ";
}
GUIObject.caption += '[icon="icon_statistic_los"]' + selection[0].traits.vision.los + ' ';
// Reveal Status Orb
getGUIObjectByName("session_status_orb").hidden = false;
// Build unit list.
if (selection[0].actions.create)
{
if (selection[0].actions.create.unitlist)
{
// Enable tab portrait.
setPortrait("session_panel_status_command_pri_1", "tab_train");
getGUIObjectByName("session_panel_status_command_pri_1").hidden = false;
// commandSlot = getCommandSlot();
// Extract entity list into an array.
// (Give it a string literally identical to the attribute, as for some reason it doesn't work right now. :(
// crd_status_orb_command_1 = parseDelimiterString(selection[0].actions.create.unitlist, ";");
crd_status_orb_command_1 = parseDelimiterString("hele_fem_b1;hele_isp_u1", ";");
}
}
else
getGUIObjectByName("session_panel_status_command_pri_1").hidden = true;
// Populate appropriate command buttons.
for (createLoop = 1; createLoop <= 6; createLoop++)
{
if (selection[0].actions.create && selection[0].actions.create.unitlist && createLoop < crd_status_orb_command_1.length+1)
{
if (getEntityTemplate(crd_status_orb_command_1[createLoop-1]).traits.id.icon_cell && getEntityTemplate(crd_status_orb_command_1[createLoop-1]).traits.id.icon_cell != "")
setPortrait("session_panel_status_command_pri_1_" + createLoop, getEntityTemplate(crd_status_orb_command_1[createLoop-1]).traits.id.icon + "_" + getEntityTemplate(crd_status_orb_command_1[createLoop-1]).traits.id.icon_cell);
else
setPortrait("session_panel_status_command_pri_1_" + createLoop, getEntityTemplate(crd_status_orb_command_1[createLoop-1]).traits.id.icon);
getGUIObjectByName("session_panel_status_command_pri_1_" + createLoop).hidden = false;
}
else
getGUIObjectByName("session_panel_status_command_pri_1_" + createLoop).hidden = true;
}
}
@@ -8,4 +8,42 @@ function getRandom(randomMin, randomMax)
return Math.round(randomNum);
}
// ====================================================================
function parseDelimiterString (parseString, Delimiter)
{
// Seeks through the delimiters in a string and populates the elements of an array with fields found between them.
// Declare local variables.
parseLoop = 0;
parseElement = 0;
seekDelimiter = 0;
parseArray = new Array();
// While we're still within the bounds of the string,
while (parseLoop <= parseString.length)
{
// Seek until we find a delimiter.
seekDelimiter = parseLoop;
while (parseString[seekDelimiter] != Delimiter && seekDelimiter <= parseString.length)
seekDelimiter++;
// If we found a delimiter within the string,
if (seekDelimiter != parseString.length)
{
// Store sub-string between start point and delimiter in array element.
parseArray[parseElement] = parseString.substring(parseLoop, seekDelimiter);
parseElement++;
}
// Move to after delimiter position for next seek.
parseLoop = seekDelimiter+1;
}
// Store length of array.
parseArray.length = parseElement;
return parseArray;
}
// ====================================================================
@@ -397,10 +397,86 @@
<image texture="ui_icon_statistic_pierce_20.png" texture-size="0 0 32 32" size="0 0 100% 100%" />
</sprite>
<sprite name="statistic_range">
<image texture="ui_icon_statistic_accuracy_20.png" texture-size="0 0 32 32" size="0 0 100% 100%" />
</sprite>
<sprite name="statistic_speed">
<image texture="ui_icon_statistic_speed_20.png" texture-size="0 0 32 32" size="0 0 100% 100%" />
</sprite>
<!--
==========================================
TAB PORTRAITS
==========================================
-->
<!-- Unit List (Train) portrait. -->
<sprite name="ui_portrait_tab_train_64">
<image texture="ui_portrait_tab_train_64.png" texture-size="0 0 100% 100%" size="0 0 100% 100%" />
</sprite>
<sprite name="ui_portrait_tab_train_64-lit">
<image texture="ui_portrait_tab_train_64-lit.png" texture-size="0 0 100% 100%" size="0 0 100% 100%" />
</sprite>
<sprite name="ui_portrait_tab_train_64-grey">
<image texture="ui_portrait_tab_train_64-grey.png" texture-size="0 0 100% 100%" size="0 0 100% 100%" />
</sprite>
<!-- Structure List (Build Civil) portrait. -->
<sprite name="ui_portrait_tab_buildciv_64">
<image texture="ui_portrait_tab_buildciv_64.png" texture-size="0 0 100% 100%" size="0 0 100% 100%" />
</sprite>
<sprite name="ui_portrait_tab_buildciv_64-lit">
<image texture="ui_portrait_tab_buildciv_64-lit.png" texture-size="0 0 100% 100%" size="0 0 100% 100%" />
</sprite>
<sprite name="ui_portrait_tab_buildciv_64-grey">
<image texture="ui_portrait_tab_buildciv_64-grey.png" texture-size="0 0 100% 100%" size="0 0 100% 100%" />
</sprite>
<!-- Structure List (Build Military) portrait. -->
<sprite name="ui_portrait_tab_buildmil_64">
<image texture="ui_portrait_tab_buildciv_64.png" texture-size="0 0 100% 100%" size="0 0 100% 100%" />
</sprite>
<sprite name="ui_portrait_tab_buildmil_64-lit">
<image texture="ui_portrait_tab_buildciv_64-lit.png" texture-size="0 0 100% 100%" size="0 0 100% 100%" />
</sprite>
<sprite name="ui_portrait_tab_buildmil_64-grey">
<image texture="ui_portrait_tab_buildciv_64-grey.png" texture-size="0 0 100% 100%" size="0 0 100% 100%" />
</sprite>
<!-- Tech List (Research) portrait. -->
<sprite name="ui_portrait_tab_research_64">
<image texture="ui_portrait_tab_research_64.png" texture-size="0 0 100% 100%" size="0 0 100% 100%" />
</sprite>
<sprite name="ui_portrait_tab_research_64-lit">
<image texture="ui_portrait_tab_research_64-lit.png" texture-size="0 0 100% 100%" size="0 0 100% 100%" />
</sprite>
<sprite name="ui_portrait_tab_research_64-grey">
<image texture="ui_portrait_tab_research_64-grey.png" texture-size="0 0 100% 100%" size="0 0 100% 100%" />
</sprite>
<!-- Formation portrait. -->
<sprite name="ui_portrait_tab_formation_64">
<image texture="ui_portrait_tab_formation_64.png" texture-size="0 0 100% 100%" size="0 0 100% 100%" />
</sprite>
<sprite name="ui_portrait_tab_formation_64-lit">
<image texture="ui_portrait_tab_formation_64-lit.png" texture-size="0 0 100% 100%" size="0 0 100% 100%" />
</sprite>
<sprite name="ui_portrait_tab_formation_64-grey">
<image texture="ui_portrait_tab_formation_64-grey.png" texture-size="0 0 100% 100%" size="0 0 100% 100%" />
</sprite>
<!-- Behaviour portrait. -->
<sprite name="ui_portrait_tab_behaviour_64">
<image texture="ui_portrait_tab_behaviour_64.png" texture-size="0 0 100% 100%" size="0 0 100% 100%" />
</sprite>
<sprite name="ui_portrait_tab_behaviour_64-lit">
<image texture="ui_portrait_tab_behaviour_64-lit.png" texture-size="0 0 100% 100%" size="0 0 100% 100%" />
</sprite>
<sprite name="ui_portrait_tab_behaviour_64-grey">
<image texture="ui_portrait_tab_behaviour_64-grey.png" texture-size="0 0 100% 100%" size="0 0 100% 100%" />
</sprite>
<!--
==========================================
ENTITY SINGLE PORTRAITS
Binary file not shown.