1
0
forked from 0ad/0ad

Add attack ability to outposts.

Fix a issue with dying units with stance standground.

This was SVN commit r11697.
This commit is contained in:
leper 2012-04-29 18:43:10 +00:00
parent 10687410cd
commit d03d36b1f3
3 changed files with 30 additions and 7 deletions

View File

@ -166,10 +166,15 @@ Attack.prototype.GetAttackStrengths = function(type)
Attack.prototype.GetRange = function(type)
{
var max = +this.template[type].MaxRange;
var min = +(this.template[type].MinRange || 0);
var cmpTechMan = QueryOwnerInterface(this.entity, IID_TechnologyManager);
var max = cmpTechMan.ApplyModifications("Attack/" + type + "/MaxRange", +this.template[type].MaxRange, this.entity);
var min = cmpTechMan.ApplyModifications("Attack/" + type + "/MinRange", +(this.template[type].MinRange || 0), this.entity);
if (cmpTechMan)
{
max = cmpTechMan.ApplyModifications("Attack/" + type + "/MaxRange", max, this.entity);
min = cmpTechMan.ApplyModifications("Attack/" + type + "/MinRange", min, this.entity);
}
return { "max": max, "min": min };
};

View File

@ -164,10 +164,14 @@ function QueryOwnerInterface(ent, iid)
if (!cmpOwnership)
return null;
var playerEnt = cmpPlayerManager.GetPlayerByID(cmpOwnership.GetOwner());
var owner = cmpOwnership.GetOwner();
if (owner == -1)
return null;
var playerEnt = cmpPlayerManager.GetPlayerByID(owner);
if (!playerEnt)
return null;
return Engine.QueryInterface(playerEnt, iid);
}
@ -183,7 +187,7 @@ function QueryPlayerIDInterface(id, iid)
var playerEnt = cmpPlayerManager.GetPlayerByID(id);
if (!playerEnt)
return null;
return Engine.QueryInterface(playerEnt, iid);
}

View File

@ -5,7 +5,21 @@
<Pierce>5.0</Pierce>
<Crush>5.0</Crush>
</Armour>
<Attack disable=""/>
<Attack>
<Ranged>
<Hack>0.0</Hack>
<Pierce>25.0</Pierce>
<Crush>0.0</Crush>
<MaxRange>80.0</MaxRange>
<MinRange>16.0</MinRange>
<ProjectileSpeed>75.0</ProjectileSpeed>
<PrepareTime>1200</PrepareTime>
<RepeatTime>2000</RepeatTime>
</Ranged>
</Attack>
<BuildingAI>
<GarrisonArrowMultiplier>1</GarrisonArrowMultiplier>
</BuildingAI>
<BuildRestrictions>
<Territory>own neutral</Territory>
<Category>House</Category>