removed need to define Harvester/BaseBuildingUnit manually
This commit is contained in:
@@ -36,8 +36,6 @@ namespace OpenRA.Mods.RA.AI
|
||||
public readonly string RallypointTestBuilding = "fact"; // temporary hack to maintain previous rallypoint behavior.
|
||||
public readonly string[] UnitQueues = {"Vehicle", "Infantry", "Plane"};
|
||||
public readonly bool ShouldRepairBuildings = true;
|
||||
public readonly string HarvesterUnit = "harv";
|
||||
public readonly string[] BaseBuildUnit = {"mcv"};
|
||||
|
||||
string IBotInfo.Name { get { return this.Name; } }
|
||||
|
||||
@@ -68,7 +66,6 @@ namespace OpenRA.Mods.RA.AI
|
||||
{
|
||||
bool enabled;
|
||||
public int ticks;
|
||||
public string FoundBaseBuildUnit;
|
||||
public Player p;
|
||||
PowerManager playerPower;
|
||||
readonly BuildingInfo rallypointTestBuilding; // temporary hack
|
||||
@@ -264,14 +261,14 @@ namespace OpenRA.Mods.RA.AI
|
||||
assignRolesTicks = Info.AssignRolesInterval;
|
||||
|
||||
var newUnits = self.World.ActorsWithTrait<IMove>()
|
||||
.Where(a => a.Actor.Owner == p && a.Actor.Info != Rules.Info[FoundBaseBuildUnit]
|
||||
.Where(a => a.Actor.Owner == p && !a.Actor.HasTrait<BaseBuilding>()
|
||||
&& !activeUnits.Contains(a.Actor))
|
||||
.Select(a => a.Actor).ToArray();
|
||||
|
||||
foreach (var a in newUnits)
|
||||
{
|
||||
BotDebug("AI: Found a newly built unit");
|
||||
if (a.Info == Rules.Info[Info.HarvesterUnit])
|
||||
if (a.HasTrait<Harvester>())
|
||||
world.IssueOrder( new Order( "Harvest", a, false ) );
|
||||
else
|
||||
unitsHangingAroundTheBase.Add(a);
|
||||
@@ -421,20 +418,16 @@ namespace OpenRA.Mods.RA.AI
|
||||
void DeployMcv(Actor self)
|
||||
{
|
||||
/* find our mcv and deploy it */
|
||||
foreach (var m in Info.BaseBuildUnit)
|
||||
{
|
||||
var mcv = self.World.Actors
|
||||
.FirstOrDefault(a => a.Owner == p && a.Info == Rules.Info[m]);
|
||||
var mcv = self.World.Actors
|
||||
.FirstOrDefault(a => a.Owner == p && a.HasTrait<BaseBuilding>());
|
||||
|
||||
if (mcv != null)
|
||||
{
|
||||
baseCenter = mcv.Location;
|
||||
world.IssueOrder(new Order("DeployTransform", mcv, false));
|
||||
FoundBaseBuildUnit = m; //remember the type to exclude it from attack forces
|
||||
}
|
||||
else
|
||||
BotDebug("AI: Can't find BaseBuildUnit {0}.", m);
|
||||
if (mcv != null)
|
||||
{
|
||||
baseCenter = mcv.Location;
|
||||
world.IssueOrder(new Order("DeployTransform", mcv, false));
|
||||
}
|
||||
else
|
||||
BotDebug("AI: Can't find BaseBuildUnit.");
|
||||
}
|
||||
|
||||
internal IEnumerable<ProductionQueue> FindQueues(string category)
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
# support separate turret sequence with RenderBuildingTurreted
|
||||
# ornithocopter should flap (might need new RenderOrni code for proper animation)
|
||||
# R8 converter needs infantry frame resorter
|
||||
# add infantry dieing animation
|
||||
# add trooper
|
||||
# add engineer
|
||||
# add fremen
|
||||
|
||||
@@ -9,6 +9,7 @@ Player:
|
||||
OnHoldAudio: AI_HOLD.AUD
|
||||
ReadyAudio: AI_BDRDY.AUD
|
||||
CancelledAudio: AI_CANCL.AUD
|
||||
BlockedAudio: AI_NROOM.AUD
|
||||
ClassicProductionQueue@Defense:
|
||||
Type: Defense
|
||||
BuildSpeed: .4
|
||||
@@ -17,6 +18,7 @@ Player:
|
||||
OnHoldAudio: AI_HOLD.AUD
|
||||
ReadyAudio: AI_BDRDY.AUD
|
||||
CancelledAudio: AI_CANCL.AUD
|
||||
BlockedAudio: AI_NROOM.AUD
|
||||
ClassicProductionQueue@Vehicle:
|
||||
Type: Vehicle
|
||||
BuildSpeed: .4
|
||||
@@ -25,6 +27,7 @@ Player:
|
||||
QueuedAudio:AI_TRAIN.AUD
|
||||
OnHoldAudio: AI_HOLD.AUD
|
||||
CancelledAudio: AI_CANCL.AUD
|
||||
BlockedAudio: AI_NROOM.AUD
|
||||
ClassicProductionQueue@Infantry:
|
||||
Type: Infantry
|
||||
BuildSpeed: .4
|
||||
@@ -33,6 +36,7 @@ Player:
|
||||
QueuedAudio:AI_TRAIN.AUD
|
||||
OnHoldAudio: AI_HOLD.AUD
|
||||
CancelledAudio: AI_CANCL.AUD
|
||||
BlockedAudio: AI_NROOM.AUD
|
||||
ClassicProductionQueue@Plane:
|
||||
Type: Plane
|
||||
BuildSpeed: .4
|
||||
@@ -41,6 +45,7 @@ Player:
|
||||
QueuedAudio:AI_TRAIN.AUD
|
||||
OnHoldAudio: AI_HOLD.AUD
|
||||
CancelledAudio: AI_CANCL.AUD
|
||||
BlockedAudio: AI_NROOM.AUD
|
||||
PlaceBuilding:
|
||||
SupportPowerManager:
|
||||
ConquestVictoryConditions:
|
||||
@@ -55,8 +60,6 @@ Player:
|
||||
HackyAI@Omnius:
|
||||
Name:Omnius
|
||||
RallypointTestBuilding: conyarda
|
||||
HarvesterUnit: harvester
|
||||
BaseBuildUnit: mcva,mcvh,mcvo
|
||||
BuildingFractions:
|
||||
refa: 30%
|
||||
refh: 30%
|
||||
|
||||
@@ -150,8 +150,8 @@ rifle:
|
||||
Start: 26
|
||||
Length: 7
|
||||
die-crushed: rifledeath
|
||||
Start: 33
|
||||
Length: 7
|
||||
Start: 54
|
||||
Length: 22
|
||||
Tick: 1600
|
||||
|
||||
conyarda:
|
||||
|
||||
Reference in New Issue
Block a user