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