From b32a8361e5f99d3a7f2f73047fd017e6f704f1b4 Mon Sep 17 00:00:00 2001 From: Acumen Date: Sun, 22 Jan 2006 05:28:41 +0000 Subject: [PATCH] AI stance properties and extended animal templates. This was SVN commit r3390. --- .../official/entities/gaia/fauna_deer.xml | 2 +- .../mods/official/entities/gaia/fauna_pig.xml | 2 +- .../official/entities/gaia/fauna_rabbit.xml | 4 +- .../official/entities/gaia/fauna_sheep.xml | 9 +---- .../entities/template_entity_script.js | 30 ++++++++++++++- .../entities/template_unit_cavalry.xml | 23 ++++++----- .../entities/template_unit_cavalry_melee.xml | 22 +++++++++++ .../entities/template_unit_cavalry_ranged.xml | 17 ++++++--- .../official/entities/template_unit_fauna.xml | 7 ---- .../entities/template_unit_fauna_breed.xml | 23 +++++++++++ .../template_unit_fauna_breed_passive.xml | 20 ++++++++++ .../entities/template_unit_fauna_herd.xml | 29 ++++++++++++++ .../template_unit_fauna_herd_passive.xml | 20 ++++++++++ .../entities/template_unit_fauna_hunt.xml | 22 +++++++++++ .../template_unit_fauna_hunt_aggressive.xml | 20 ++++++++++ .../template_unit_fauna_hunt_defensive.xml | 20 ++++++++++ .../template_unit_fauna_hunt_passive.xml | 20 ++++++++++ .../template_unit_fauna_hunt_skittish.xml | 20 ++++++++++ .../template_unit_fauna_hunt_violent.xml | 20 ++++++++++ .../entities/template_unit_fauna_wild.xml | 16 ++++++++ .../template_unit_fauna_wild_aggressive.xml | 20 ++++++++++ .../template_unit_fauna_wild_defensive.xml | 20 ++++++++++ .../template_unit_fauna_wild_passive.xml | 20 ++++++++++ .../template_unit_fauna_wild_violent.xml | 20 ++++++++++ .../official/entities/template_unit_hero.xml | 31 ++++++++++----- .../entities/template_unit_infantry.xml | 13 ++----- .../entities/template_unit_infantry_melee.xml | 22 +++++++++++ .../template_unit_infantry_ranged.xml | 11 ++++-- .../template_unit_mechanical_ship.xml | 13 +++++++ ...emplate_unit_mechanical_siege_ballista.xml | 2 +- .../template_unit_mechanical_siege_ram.xml | 13 +++++++ .../official/entities/template_unit_super.xml | 38 +++++++++++++++---- .../entities/template_unit_super_cavalry.xml | 10 +++++ .../entities/template_unit_support.xml | 4 ++ .../entities/units/hele_super_infantry_m.xml | 4 ++ 35 files changed, 522 insertions(+), 65 deletions(-) create mode 100644 binaries/data/mods/official/entities/template_unit_fauna_breed.xml create mode 100644 binaries/data/mods/official/entities/template_unit_fauna_breed_passive.xml create mode 100644 binaries/data/mods/official/entities/template_unit_fauna_herd.xml create mode 100644 binaries/data/mods/official/entities/template_unit_fauna_herd_passive.xml create mode 100644 binaries/data/mods/official/entities/template_unit_fauna_hunt.xml create mode 100644 binaries/data/mods/official/entities/template_unit_fauna_hunt_aggressive.xml create mode 100644 binaries/data/mods/official/entities/template_unit_fauna_hunt_defensive.xml create mode 100644 binaries/data/mods/official/entities/template_unit_fauna_hunt_passive.xml create mode 100644 binaries/data/mods/official/entities/template_unit_fauna_hunt_skittish.xml create mode 100644 binaries/data/mods/official/entities/template_unit_fauna_hunt_violent.xml create mode 100644 binaries/data/mods/official/entities/template_unit_fauna_wild.xml create mode 100644 binaries/data/mods/official/entities/template_unit_fauna_wild_aggressive.xml create mode 100644 binaries/data/mods/official/entities/template_unit_fauna_wild_defensive.xml create mode 100644 binaries/data/mods/official/entities/template_unit_fauna_wild_passive.xml create mode 100644 binaries/data/mods/official/entities/template_unit_fauna_wild_violent.xml diff --git a/binaries/data/mods/official/entities/gaia/fauna_deer.xml b/binaries/data/mods/official/entities/gaia/fauna_deer.xml index 6967884073..82adca22a5 100644 --- a/binaries/data/mods/official/entities/gaia/fauna_deer.xml +++ b/binaries/data/mods/official/entities/gaia/fauna_deer.xml @@ -1,7 +1,7 @@ diff --git a/binaries/data/mods/official/entities/gaia/fauna_pig.xml b/binaries/data/mods/official/entities/gaia/fauna_pig.xml index 60ae4528d5..d7ff6a8903 100644 --- a/binaries/data/mods/official/entities/gaia/fauna_pig.xml +++ b/binaries/data/mods/official/entities/gaia/fauna_pig.xml @@ -1,7 +1,7 @@ diff --git a/binaries/data/mods/official/entities/gaia/fauna_rabbit.xml b/binaries/data/mods/official/entities/gaia/fauna_rabbit.xml index 2911af36bd..283e510619 100644 --- a/binaries/data/mods/official/entities/gaia/fauna_rabbit.xml +++ b/binaries/data/mods/official/entities/gaia/fauna_rabbit.xml @@ -1,14 +1,14 @@ - Rabbot + Rabbit diff --git a/binaries/data/mods/official/entities/gaia/fauna_sheep.xml b/binaries/data/mods/official/entities/gaia/fauna_sheep.xml index 1ec2287bb5..186db44542 100644 --- a/binaries/data/mods/official/entities/gaia/fauna_sheep.xml +++ b/binaries/data/mods/official/entities/gaia/fauna_sheep.xml @@ -1,7 +1,7 @@ @@ -12,13 +12,6 @@ - - - 20 - - - - fauna/sheep1.xml diff --git a/binaries/data/mods/official/entities/template_entity_script.js b/binaries/data/mods/official/entities/template_entity_script.js index e5f442b390..5fb4f2c9e7 100644 --- a/binaries/data/mods/official/entities/template_entity_script.js +++ b/binaries/data/mods/official/entities/template_entity_script.js @@ -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). diff --git a/binaries/data/mods/official/entities/template_unit_cavalry.xml b/binaries/data/mods/official/entities/template_unit_cavalry.xml index 39b1a8f42f..713cbfc69d 100644 --- a/binaries/data/mods/official/entities/template_unit_cavalry.xml +++ b/binaries/data/mods/official/entities/template_unit_cavalry.xml @@ -22,6 +22,10 @@ 1.5 7.5 + + + 2.0 + 200 @@ -38,20 +42,21 @@ 900 + + + + 1 + 50 + 0 + 0.9 + 0.1 + + - - 10.0 - 0.0 - 0.5 - 0.5 - 2.0 - 1500 - - diff --git a/binaries/data/mods/official/entities/template_unit_cavalry_melee.xml b/binaries/data/mods/official/entities/template_unit_cavalry_melee.xml index 003c61fb20..dd67eae33c 100644 --- a/binaries/data/mods/official/entities/template_unit_cavalry_melee.xml +++ b/binaries/data/mods/official/entities/template_unit_cavalry_melee.xml @@ -13,5 +13,27 @@ + + + + + 10.0 + 0.0 + 0.5 + 0.5 + 2.0 + 1500 + + + + 20.0 + 0.0 + 0.5 + 0.5 + 2.0 + 1500 + + + \ No newline at end of file diff --git a/binaries/data/mods/official/entities/template_unit_cavalry_ranged.xml b/binaries/data/mods/official/entities/template_unit_cavalry_ranged.xml index 13439bc405..75acab50cb 100644 --- a/binaries/data/mods/official/entities/template_unit_cavalry_ranged.xml +++ b/binaries/data/mods/official/entities/template_unit_cavalry_ranged.xml @@ -14,10 +14,15 @@ - - - 16.0 - 1500 - - + + + + 10.0 + 0.0 + 0.5 + 0.5 + 16.0 + 1500 + + \ No newline at end of file diff --git a/binaries/data/mods/official/entities/template_unit_fauna.xml b/binaries/data/mods/official/entities/template_unit_fauna.xml index f4a46d027f..a88dccf082 100644 --- a/binaries/data/mods/official/entities/template_unit_fauna.xml +++ b/binaries/data/mods/official/entities/template_unit_fauna.xml @@ -32,12 +32,5 @@ 16 - - 100 - food - meat - - - \ No newline at end of file diff --git a/binaries/data/mods/official/entities/template_unit_fauna_breed.xml b/binaries/data/mods/official/entities/template_unit_fauna_breed.xml new file mode 100644 index 0000000000..b54ec80000 --- /dev/null +++ b/binaries/data/mods/official/entities/template_unit_fauna_breed.xml @@ -0,0 +1,23 @@ + + + + + + + + + Breed + + + + + + 20 + + + + + + \ No newline at end of file diff --git a/binaries/data/mods/official/entities/template_unit_fauna_breed_passive.xml b/binaries/data/mods/official/entities/template_unit_fauna_breed_passive.xml new file mode 100644 index 0000000000..511aab415b --- /dev/null +++ b/binaries/data/mods/official/entities/template_unit_fauna_breed_passive.xml @@ -0,0 +1,20 @@ + + + + + + + + + Passive + + + + + Passive + + + + \ No newline at end of file diff --git a/binaries/data/mods/official/entities/template_unit_fauna_herd.xml b/binaries/data/mods/official/entities/template_unit_fauna_herd.xml new file mode 100644 index 0000000000..be5ff90c50 --- /dev/null +++ b/binaries/data/mods/official/entities/template_unit_fauna_herd.xml @@ -0,0 +1,29 @@ + + + + + + + + + Edible, Herd + + + + + + 20 + + + + + + 100 + food + meat + + + + \ No newline at end of file diff --git a/binaries/data/mods/official/entities/template_unit_fauna_herd_passive.xml b/binaries/data/mods/official/entities/template_unit_fauna_herd_passive.xml new file mode 100644 index 0000000000..4c8b5019b7 --- /dev/null +++ b/binaries/data/mods/official/entities/template_unit_fauna_herd_passive.xml @@ -0,0 +1,20 @@ + + + + + + + + + Passive + + + + + Passive + + + + \ No newline at end of file diff --git a/binaries/data/mods/official/entities/template_unit_fauna_hunt.xml b/binaries/data/mods/official/entities/template_unit_fauna_hunt.xml new file mode 100644 index 0000000000..207cfee5ac --- /dev/null +++ b/binaries/data/mods/official/entities/template_unit_fauna_hunt.xml @@ -0,0 +1,22 @@ + + + + + + + + + Edible + + + + + 100 + food + meat + + + + \ No newline at end of file diff --git a/binaries/data/mods/official/entities/template_unit_fauna_hunt_aggressive.xml b/binaries/data/mods/official/entities/template_unit_fauna_hunt_aggressive.xml new file mode 100644 index 0000000000..213896c12e --- /dev/null +++ b/binaries/data/mods/official/entities/template_unit_fauna_hunt_aggressive.xml @@ -0,0 +1,20 @@ + + + + + + + + + Aggressive + + + + + Aggressive + + + + \ No newline at end of file diff --git a/binaries/data/mods/official/entities/template_unit_fauna_hunt_defensive.xml b/binaries/data/mods/official/entities/template_unit_fauna_hunt_defensive.xml new file mode 100644 index 0000000000..1816964906 --- /dev/null +++ b/binaries/data/mods/official/entities/template_unit_fauna_hunt_defensive.xml @@ -0,0 +1,20 @@ + + + + + + + + + Defensive + + + + + Defensive + + + + \ No newline at end of file diff --git a/binaries/data/mods/official/entities/template_unit_fauna_hunt_passive.xml b/binaries/data/mods/official/entities/template_unit_fauna_hunt_passive.xml new file mode 100644 index 0000000000..f560bc2fc3 --- /dev/null +++ b/binaries/data/mods/official/entities/template_unit_fauna_hunt_passive.xml @@ -0,0 +1,20 @@ + + + + + + + + + Passive + + + + + Passive + + + + \ No newline at end of file diff --git a/binaries/data/mods/official/entities/template_unit_fauna_hunt_skittish.xml b/binaries/data/mods/official/entities/template_unit_fauna_hunt_skittish.xml new file mode 100644 index 0000000000..43e5b9051c --- /dev/null +++ b/binaries/data/mods/official/entities/template_unit_fauna_hunt_skittish.xml @@ -0,0 +1,20 @@ + + + + + + + + + Skittish + + + + + Skittish + + + + \ No newline at end of file diff --git a/binaries/data/mods/official/entities/template_unit_fauna_hunt_violent.xml b/binaries/data/mods/official/entities/template_unit_fauna_hunt_violent.xml new file mode 100644 index 0000000000..067d8acc24 --- /dev/null +++ b/binaries/data/mods/official/entities/template_unit_fauna_hunt_violent.xml @@ -0,0 +1,20 @@ + + + + + + + + + Violent + + + + + Violent + + + + \ No newline at end of file diff --git a/binaries/data/mods/official/entities/template_unit_fauna_wild.xml b/binaries/data/mods/official/entities/template_unit_fauna_wild.xml new file mode 100644 index 0000000000..12d5e19fa7 --- /dev/null +++ b/binaries/data/mods/official/entities/template_unit_fauna_wild.xml @@ -0,0 +1,16 @@ + + + + + + + + + Wild + + + + + \ No newline at end of file diff --git a/binaries/data/mods/official/entities/template_unit_fauna_wild_aggressive.xml b/binaries/data/mods/official/entities/template_unit_fauna_wild_aggressive.xml new file mode 100644 index 0000000000..72050d10be --- /dev/null +++ b/binaries/data/mods/official/entities/template_unit_fauna_wild_aggressive.xml @@ -0,0 +1,20 @@ + + + + + + + + + Violent + + + + + Violent + + + + \ No newline at end of file diff --git a/binaries/data/mods/official/entities/template_unit_fauna_wild_defensive.xml b/binaries/data/mods/official/entities/template_unit_fauna_wild_defensive.xml new file mode 100644 index 0000000000..f9956d3929 --- /dev/null +++ b/binaries/data/mods/official/entities/template_unit_fauna_wild_defensive.xml @@ -0,0 +1,20 @@ + + + + + + + + + Defensive + + + + + Defensive + + + + \ No newline at end of file diff --git a/binaries/data/mods/official/entities/template_unit_fauna_wild_passive.xml b/binaries/data/mods/official/entities/template_unit_fauna_wild_passive.xml new file mode 100644 index 0000000000..da44be042e --- /dev/null +++ b/binaries/data/mods/official/entities/template_unit_fauna_wild_passive.xml @@ -0,0 +1,20 @@ + + + + + + + + + Passive + + + + + Passive + + + + \ No newline at end of file diff --git a/binaries/data/mods/official/entities/template_unit_fauna_wild_violent.xml b/binaries/data/mods/official/entities/template_unit_fauna_wild_violent.xml new file mode 100644 index 0000000000..72050d10be --- /dev/null +++ b/binaries/data/mods/official/entities/template_unit_fauna_wild_violent.xml @@ -0,0 +1,20 @@ + + + + + + + + + Violent + + + + + Violent + + + + \ No newline at end of file diff --git a/binaries/data/mods/official/entities/template_unit_hero.xml b/binaries/data/mods/official/entities/template_unit_hero.xml index e3817b42b4..118fa4d4fb 100644 --- a/binaries/data/mods/official/entities/template_unit_hero.xml +++ b/binaries/data/mods/official/entities/template_unit_hero.xml @@ -17,7 +17,11 @@ 0.3 0.3 0.3 - + + + + 5.0 + 1000 @@ -34,16 +38,25 @@ - - 20.0 - 0.0 - 0.5 - 0.5 - 5.0 - 1500 - + + 20.0 + 0.0 + 0.5 + 0.5 + 5.0 + 1500 + + + 40.0 + 0.0 + 0.5 + 0.5 + 5.0 + 1500 + + \ No newline at end of file diff --git a/binaries/data/mods/official/entities/template_unit_infantry.xml b/binaries/data/mods/official/entities/template_unit_infantry.xml index 9cbff2f576..c35eb560fa 100644 --- a/binaries/data/mods/official/entities/template_unit_infantry.xml +++ b/binaries/data/mods/official/entities/template_unit_infantry.xml @@ -17,6 +17,10 @@ 0.75 0.25 + + + 3.0 + 800 @@ -38,15 +42,6 @@ - - 10.0 - 0.0 - 0.5 - 0.5 - 5.0 - 1500 - - diff --git a/binaries/data/mods/official/entities/template_unit_infantry_melee.xml b/binaries/data/mods/official/entities/template_unit_infantry_melee.xml index e6b261743b..d79f8f676c 100644 --- a/binaries/data/mods/official/entities/template_unit_infantry_melee.xml +++ b/binaries/data/mods/official/entities/template_unit_infantry_melee.xml @@ -12,5 +12,27 @@ + + + + + 10.0 + 0.0 + 0.5 + 0.5 + 5.0 + 1500 + + + + 10.0 + 0.0 + 0.5 + 0.5 + 5.0 + 1500 + + + \ No newline at end of file diff --git a/binaries/data/mods/official/entities/template_unit_infantry_ranged.xml b/binaries/data/mods/official/entities/template_unit_infantry_ranged.xml index 487b80c313..e79c257b3a 100644 --- a/binaries/data/mods/official/entities/template_unit_infantry_ranged.xml +++ b/binaries/data/mods/official/entities/template_unit_infantry_ranged.xml @@ -17,9 +17,14 @@ - - 24.0 - 1500 + + 10.0 + 0.0 + 0.5 + 0.5 + 24.0 + 1500 + diff --git a/binaries/data/mods/official/entities/template_unit_mechanical_ship.xml b/binaries/data/mods/official/entities/template_unit_mechanical_ship.xml index 60481c9279..aec762cb6f 100644 --- a/binaries/data/mods/official/entities/template_unit_mechanical_ship.xml +++ b/binaries/data/mods/official/entities/template_unit_mechanical_ship.xml @@ -27,5 +27,18 @@ + + + + + 20.0 + 0.0 + 0.5 + 0.5 + 2.0 + 1500 + + + \ No newline at end of file diff --git a/binaries/data/mods/official/entities/template_unit_mechanical_siege_ballista.xml b/binaries/data/mods/official/entities/template_unit_mechanical_siege_ballista.xml index 02188cb170..76db75a3ab 100644 --- a/binaries/data/mods/official/entities/template_unit_mechanical_siege_ballista.xml +++ b/binaries/data/mods/official/entities/template_unit_mechanical_siege_ballista.xml @@ -14,5 +14,5 @@ - + \ No newline at end of file diff --git a/binaries/data/mods/official/entities/template_unit_mechanical_siege_ram.xml b/binaries/data/mods/official/entities/template_unit_mechanical_siege_ram.xml index 005ef48220..9636e2addf 100644 --- a/binaries/data/mods/official/entities/template_unit_mechanical_siege_ram.xml +++ b/binaries/data/mods/official/entities/template_unit_mechanical_siege_ram.xml @@ -14,5 +14,18 @@ + + + + + 20.0 + 0.0 + 0.5 + 0.5 + 2.0 + 1500 + + + \ No newline at end of file diff --git a/binaries/data/mods/official/entities/template_unit_super.xml b/binaries/data/mods/official/entities/template_unit_super.xml index 3a8deb67ef..c2b5f27683 100644 --- a/binaries/data/mods/official/entities/template_unit_super.xml +++ b/binaries/data/mods/official/entities/template_unit_super.xml @@ -12,6 +12,10 @@ Military, Super + + + 5.0 + 50 @@ -24,16 +28,34 @@ - - 15.0 - 0.0 - 0.5 - 0.5 - 5.0 - 1500 - + + 15.0 + 0.0 + 0.5 + 0.5 + 5.0 + 1500 + + + 30.0 + 0.0 + 0.5 + 0.5 + 5.0 + 1500 + + + + 10.0 + 0.0 + 0.5 + 0.5 + 24.0 + 1500 + + \ No newline at end of file diff --git a/binaries/data/mods/official/entities/template_unit_super_cavalry.xml b/binaries/data/mods/official/entities/template_unit_super_cavalry.xml index 4cc93bc81c..037d0e5797 100644 --- a/binaries/data/mods/official/entities/template_unit_super_cavalry.xml +++ b/binaries/data/mods/official/entities/template_unit_super_cavalry.xml @@ -15,6 +15,16 @@ + + + 1 + 50 + 0 + 0.9 + 0.1 + + + \ No newline at end of file diff --git a/binaries/data/mods/official/entities/template_unit_support.xml b/binaries/data/mods/official/entities/template_unit_support.xml index 0b6c1511b3..f84d335c3c 100644 --- a/binaries/data/mods/official/entities/template_unit_support.xml +++ b/binaries/data/mods/official/entities/template_unit_support.xml @@ -13,6 +13,10 @@ + + 4.0 + + 10 1 diff --git a/binaries/data/mods/official/entities/units/hele_super_infantry_m.xml b/binaries/data/mods/official/entities/units/hele_super_infantry_m.xml index 93cdce04d6..2b749f08b3 100644 --- a/binaries/data/mods/official/entities/units/hele_super_infantry_m.xml +++ b/binaries/data/mods/official/entities/units/hele_super_infantry_m.xml @@ -16,9 +16,13 @@ + + 8.0 + + units/hellenes/super_unit_3.xml