AI stance properties and extended animal templates.

This was SVN commit r3390.
This commit is contained in:
Acumen
2006-01-22 05:28:41 +00:00
parent 1290c3dcfd
commit b32a8361e5
35 changed files with 522 additions and 65 deletions
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<Entity
Parent="template_unit_fauna"
Parent="template_unit_fauna_hunt_skittish"
>
<Traits>
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<Entity
Parent="template_unit_fauna"
Parent="template_unit_fauna_herd_passive"
>
<Traits>
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<Entity
Parent="template_unit_fauna"
Parent="template_unit_fauna_hunt_skittish"
>
<Traits>
<Id>
<Specific>Rabbot</Specific>
<Specific>Rabbit</Specific>
</Id>
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<Entity
Parent="template_unit_fauna"
Parent="template_unit_fauna_herd_passive"
>
<Traits>
@@ -12,13 +12,6 @@
</Id>
<Auras>
<Infidelity>
<Radius>20</Radius>
<Time>0</Time>
</Infidelity>
</Auras>
</Traits>
<Actor>fauna/sheep1.xml</Actor>
@@ -68,7 +68,7 @@ function entityInit()
// 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).
this.traits.supply.dropsitecount = new Array();
initialCount = this.traits.supply.forageable ? 1 : 0;
initialCount = this.traits.supply.subtype.meat ? 1 : 0;
for( i=0; i<=8; i++ )
{
this.traits.supply.dropsitecount[i] = initialCount;
@@ -198,6 +198,34 @@ function entityInit()
if (this.traits.population.rem)
getGUIGlobal().giveResources ("Population", this.traits.population.rem);
}
// Build Unit AI Stance list, and set default stance.
if ( !this.traits.ai )
this.traits.ai = new Object();
if ( !this.traits.ai.stance )
this.traits.ai.stance = new Object();
if ( !this.traits.ai.stance.list )
this.traits.ai.stance.list = new Object();
// Create standard stances that all units have.
this.traits.ai.stance.list.avoid = new Object();
this.traits.ai.stance.list.hold = new Object();
if ( this.actions.attack )
{
// Create stances that units only have if they can attack.
this.traits.ai.stance.list.aggress = new Object();
this.traits.ai.stance.list.defend = new Object();
this.traits.ai.stance.list.stand = new Object();
// Set default stance for combat units.
this.traits.ai.stance.curr = "Defend";
}
else
{
// Set default stance for non-combat units.
this.traits.ai.stance.curr = "Avoid";
}
/*
// Generate entity's personal name (if it needs one).
@@ -22,6 +22,10 @@
<Radius>1.5</Radius>
<Height>7.5</Height>
</Footprint>
<Health>
<Regen_Rate>2.0</Regen_Rate>
</Health>
<Loot>
<XP>200</XP>
@@ -38,20 +42,21 @@
<Promotion>
<Req>900</Req>
</Promotion>
<Auras>
<Trample>
<Radius>1</Radius>
<Damage>50</Damage>
<Crush>0</Crush>
<Hack>0.9</Hack>
<Pierce>0.1</Pierce>
</Trample>
</Auras>
</Traits>
<Actions>
<Attack>
<Damage>10.0</Damage>
<Crush>0.0</Crush>
<Hack>0.5</Hack>
<Pierce>0.5</Pierce>
<Range>2.0</Range>
<Speed>1500</Speed>
</Attack>
<Gather>
<Resource>
<Food>
@@ -13,5 +13,27 @@
</Id>
</Traits>
<Actions>
<Attack>
<Melee>
<Damage>10.0</Damage>
<Crush>0.0</Crush>
<Hack>0.5</Hack>
<Pierce>0.5</Pierce>
<Range>2.0</Range>
<Speed>1500</Speed>
</Melee>
<Charge>
<Damage>20.0</Damage>
<Crush>0.0</Crush>
<Hack>0.5</Hack>
<Pierce>0.5</Pierce>
<Range>2.0</Range>
<Speed>1500</Speed>
</Charge>
</Attack>
</Actions>
</Entity>
@@ -14,10 +14,15 @@
</Traits>
<Attack>
<Ranged />
<Range>16.0</Range>
<Speed>1500</Speed>
</Attack>
<Actions>
<Attack>
<Ranged>
<Damage>10.0</Damage>
<Crush>0.0</Crush>
<Hack>0.5</Hack>
<Pierce>0.5</Pierce>
<Range>16.0</Range>
<Speed>1500</Speed>
</Ranged>
</Attack>
</Entity>
@@ -32,12 +32,5 @@
<Blue>16</Blue>
</MiniMap>
<Supply>
<Max>100</Max>
<Type>food</Type>
<SubType>meat</SubType>
<Forageable />
</Supply>
</Traits>
</Entity>
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<Entity
Parent="template_unit_fauna"
>
<Traits>
<Id>
<Internal_Only />
<Classes>Breed</Classes>
</Id>
<Auras>
<Infidelity>
<Radius>20</Radius>
<Time>0</Time>
</Infidelity>
</Auras>
</Traits>
</Entity>
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<Entity
Parent="template_unit_fauna_breed"
>
<Traits>
<Id>
<Internal_Only />
<Classes>Passive</Classes>
</Id>
<AI>
<Behaviour>Passive</Behaviour>
</AI>
</Traits>
</Entity>
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<Entity
Parent="template_unit_fauna"
>
<Traits>
<Id>
<Internal_Only />
<Classes>Edible, Herd</Classes>
</Id>
<Auras>
<Infidelity>
<Radius>20</Radius>
<Time>0</Time>
</Infidelity>
</Auras>
<Supply>
<Max>100</Max>
<Type>food</Type>
<SubType>meat</SubType>
</Supply>
</Traits>
</Entity>
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<Entity
Parent="template_unit_fauna_herd"
>
<Traits>
<Id>
<Internal_Only />
<Classes>Passive</Classes>
</Id>
<AI>
<Behaviour>Passive</Behaviour>
</AI>
</Traits>
</Entity>
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<Entity
Parent="template_unit_fauna"
>
<Traits>
<Id>
<Internal_Only />
<Classes>Edible</Classes>
</Id>
<Supply>
<Max>100</Max>
<Type>food</Type>
<SubType>meat</SubType>
</Supply>
</Traits>
</Entity>
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<Entity
Parent="template_unit_fauna_hunt"
>
<Traits>
<Id>
<Internal_Only />
<Classes>Aggressive</Classes>
</Id>
<AI>
<Behaviour>Aggressive</Behaviour>
</AI>
</Traits>
</Entity>
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<Entity
Parent="template_unit_fauna_hunt"
>
<Traits>
<Id>
<Internal_Only />
<Classes>Defensive</Classes>
</Id>
<AI>
<Behaviour>Defensive</Behaviour>
</AI>
</Traits>
</Entity>
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<Entity
Parent="template_unit_fauna_hunt"
>
<Traits>
<Id>
<Internal_Only />
<Classes>Passive</Classes>
</Id>
<AI>
<Behaviour>Passive</Behaviour>
</AI>
</Traits>
</Entity>
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<Entity
Parent="template_unit_fauna_hunt"
>
<Traits>
<Id>
<Internal_Only />
<Classes>Skittish</Classes>
</Id>
<AI>
<Behaviour>Skittish</Behaviour>
</AI>
</Traits>
</Entity>
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<Entity
Parent="template_unit_fauna_hunt"
>
<Traits>
<Id>
<Internal_Only />
<Classes>Violent</Classes>
</Id>
<AI>
<Behaviour>Violent</Behaviour>
</AI>
</Traits>
</Entity>
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<Entity
Parent="template_unit_fauna"
>
<Traits>
<Id>
<Internal_Only />
<Classes>Wild</Classes>
</Id>
</Traits>
</Entity>
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<Entity
Parent="template_unit_fauna_wild"
>
<Traits>
<Id>
<Internal_Only />
<Classes>Violent</Classes>
</Id>
<AI>
<Behaviour>Violent</Behaviour>
</AI>
</Traits>
</Entity>
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<Entity
Parent="template_unit_fauna_wild"
>
<Traits>
<Id>
<Internal_Only />
<Classes>Defensive</Classes>
</Id>
<AI>
<Behaviour>Defensive</Behaviour>
</AI>
</Traits>
</Entity>
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<Entity
Parent="template_unit_fauna_wild"
>
<Traits>
<Id>
<Internal_Only />
<Classes>Passive</Classes>
</Id>
<AI>
<Behaviour>Passive</Behaviour>
</AI>
</Traits>
</Entity>
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<Entity
Parent="template_unit_fauna_wild"
>
<Traits>
<Id>
<Internal_Only />
<Classes>Violent</Classes>
</Id>
<AI>
<Behaviour>Violent</Behaviour>
</AI>
</Traits>
</Entity>
@@ -17,7 +17,11 @@
<Crush>0.3</Crush>
<Hack>0.3</Hack>
<Pierce>0.3</Pierce>
</Armour>
</Armour>
<Health>
<Regen_Rate>5.0</Regen_Rate>
</Health>
<Loot>
<XP>1000</XP>
@@ -34,16 +38,25 @@
</Traits>
<Actions>
<Attack>
<Damage>20.0</Damage>
<Crush>0.0</Crush>
<Hack>0.5</Hack>
<Pierce>0.5</Pierce>
<Range>5.0</Range>
<Speed>1500</Speed>
</Attack>
<Melee>
<Damage>20.0</Damage>
<Crush>0.0</Crush>
<Hack>0.5</Hack>
<Pierce>0.5</Pierce>
<Range>5.0</Range>
<Speed>1500</Speed>
</Melee>
<Charge>
<Damage>40.0</Damage>
<Crush>0.0</Crush>
<Hack>0.5</Hack>
<Pierce>0.5</Pierce>
<Range>5.0</Range>
<Speed>1500</Speed>
</Charge>
</Attack>
</Actions>
</Entity>
@@ -17,6 +17,10 @@
<Hack>0.75</Hack>
<Pierce>0.25</Pierce>
</Armour>
<Health>
<Regen_Rate>3.0</Regen_Rate>
</Health>
<Loot>
<XP>800</XP>
@@ -38,15 +42,6 @@
<Actions>
<Attack>
<Damage>10.0</Damage>
<Crush>0.0</Crush>
<Hack>0.5</Hack>
<Pierce>0.5</Pierce>
<Range>5.0</Range>
<Speed>1500</Speed>
</Attack>
<Create>
<List>
<StructCiv>
@@ -12,5 +12,27 @@
</Id>
</Traits>
<Actions>
<Attack>
<Melee>
<Damage>10.0</Damage>
<Crush>0.0</Crush>
<Hack>0.5</Hack>
<Pierce>0.5</Pierce>
<Range>5.0</Range>
<Speed>1500</Speed>
</Melee>
<Charge>
<Damage>10.0</Damage>
<Crush>0.0</Crush>
<Hack>0.5</Hack>
<Pierce>0.5</Pierce>
<Range>5.0</Range>
<Speed>1500</Speed>
</Charge>
</Attack>
</Actions>
</Entity>
@@ -17,9 +17,14 @@
<Actions>
<Attack>
<Ranged />
<Range>24.0</Range>
<Speed>1500</Speed>
<Ranged>
<Damage>10.0</Damage>
<Crush>0.0</Crush>
<Hack>0.5</Hack>
<Pierce>0.5</Pierce>
<Range>24.0</Range>
<Speed>1500</Speed>
</Ranged>
</Attack>
</Actions>
@@ -27,5 +27,18 @@
</Health>
</Traits>
<Actions>
<Charge>
<Damage>20.0</Damage>
<Crush>0.0</Crush>
<Hack>0.5</Hack>
<Pierce>0.5</Pierce>
<Range>2.0</Range>
<Speed>1500</Speed>
</Charge>
</Actions>
</Entity>
@@ -14,5 +14,5 @@
</Id>
</Traits>
</Entity>
@@ -14,5 +14,18 @@
</Id>
</Traits>
<Actions>
<Charge>
<Damage>20.0</Damage>
<Crush>0.0</Crush>
<Hack>0.5</Hack>
<Pierce>0.5</Pierce>
<Range>2.0</Range>
<Speed>1500</Speed>
</Charge>
</Actions>
</Entity>
@@ -12,6 +12,10 @@
<Classes>Military, Super</Classes>
</Id>
<Health>
<Regen_Rate>5.0</Regen_Rate>
</Health>
<Loot>
<XP>50</XP>
@@ -24,16 +28,34 @@
</Traits>
<Actions>
<Attack>
<Damage>15.0</Damage>
<Crush>0.0</Crush>
<Hack>0.5</Hack>
<Pierce>0.5</Pierce>
<Range>5.0</Range>
<Speed>1500</Speed>
</Attack>
<Melee>
<Damage>15.0</Damage>
<Crush>0.0</Crush>
<Hack>0.5</Hack>
<Pierce>0.5</Pierce>
<Range>5.0</Range>
<Speed>1500</Speed>
</Melee>
<Charge>
<Damage>30.0</Damage>
<Crush>0.0</Crush>
<Hack>0.5</Hack>
<Pierce>0.5</Pierce>
<Range>5.0</Range>
<Speed>1500</Speed>
</Charge>
<Ranged>
<Damage>10.0</Damage>
<Crush>0.0</Crush>
<Hack>0.5</Hack>
<Pierce>0.5</Pierce>
<Range>24.0</Range>
<Speed>1500</Speed>
</Ranged>
</Attack>
</Actions>
</Entity>
@@ -15,6 +15,16 @@
</Id>
<Auras>
<Trample>
<Radius>1</Radius>
<Damage>50</Damage>
<Crush>0</Crush>
<Hack>0.9</Hack>
<Pierce>0.1</Pierce>
</Trample>
</Auras>
</Traits>
</Entity>
@@ -13,6 +13,10 @@
</Id>
<Health>
<Regen_Rate>4.0</Regen_Rate>
</Health>
<Loot>
<XP>10</XP>
<Food>1</Food>
@@ -16,9 +16,13 @@
</Id>
</Traits>
<Actions>
<Attack>
<Melee>
<Range>8.0</Range>
</Melee>
</Attack>
</Actions>
<Actor>units/hellenes/super_unit_3.xml</Actor>