1
0
forked from 0ad/0ad

Revert UnitAI changes of 79fb493da3 (besides the patrol comment) and use an exotic template instead.

The originally intended approach to support move-orders independent of
the Identity classes can be discussed in an independent proposal.

Reviewed By: fatherbushido
Differential Revision: https://code.wildfiregames.com/D176
This was SVN commit r19323.
This commit is contained in:
elexis 2017-03-22 22:38:22 +00:00
parent 19f9fa17fa
commit cd6c31e76e
3 changed files with 16 additions and 6 deletions

View File

@ -1,6 +1,6 @@
const debugLog = false;
var attackerTemplate = "gaia/fauna_wolf_snow";
var attackerTemplate = "trigger/fauna_wolf_snow_domestic";
var minWaveSize = 1;
var maxWaveSize = 3;

View File

@ -182,7 +182,8 @@ UnitAI.prototype.UnitFsmSpec = {
// Called when being told to walk as part of a formation
"Order.FormationWalk": function(msg) {
if (this.IsTurret())
// Let players move captured domestic animals around
if (this.IsAnimal() && !this.IsDomestic() || this.IsTurret())
{
this.FinishOrder();
return;
@ -254,7 +255,8 @@ UnitAI.prototype.UnitFsmSpec = {
},
"Order.Walk": function(msg) {
if (this.IsTurret())
// Let players move captured domestic animals around
if (this.IsAnimal() && !this.IsDomestic() || this.IsTurret())
{
this.FinishOrder();
return;
@ -282,7 +284,8 @@ UnitAI.prototype.UnitFsmSpec = {
},
"Order.WalkAndFight": function(msg) {
if (this.IsTurret())
// Let players move captured domestic animals around
if (this.IsAnimal() && !this.IsDomestic() || this.IsTurret())
{
this.FinishOrder();
return;
@ -308,7 +311,8 @@ UnitAI.prototype.UnitFsmSpec = {
"Order.WalkToTarget": function(msg) {
if (this.IsTurret())
// Let players move captured domestic animals around
if (this.IsAnimal() && !this.IsDomestic() || this.IsTurret())
{
this.FinishOrder();
return;
@ -511,7 +515,7 @@ UnitAI.prototype.UnitFsmSpec = {
},
"Order.Patrol": function(msg) {
if (this.IsTurret())
if (this.IsAnimal() || this.IsTurret())
{
this.FinishOrder();
return;

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="gaia/fauna_wolf_snow">
<Identity>
<Classes datatype="tokens">Domestic</Classes>
</Identity>
</Entity>