Traits can now resolve orders (ATM, they all resolve the orders they issue)
This commit is contained in:
@@ -10,12 +10,26 @@ namespace OpenRa.Game.Traits
|
||||
{
|
||||
public McvDeploy(Actor self) { }
|
||||
|
||||
public Order Order(Actor self, int2 xy, bool lmb, Actor underCursor)
|
||||
public Order IssueOrder(Actor self, int2 xy, bool lmb, Actor underCursor)
|
||||
{
|
||||
if (lmb) return null;
|
||||
if( xy != self.Location ) return null;
|
||||
|
||||
return OpenRa.Game.Order.DeployMcv(self);
|
||||
return Order.DeployMcv(self);
|
||||
}
|
||||
|
||||
public void ResolveOrder( Actor self, Order order )
|
||||
{
|
||||
if( order.OrderString == "DeployMcv" )
|
||||
{
|
||||
var factBuildingInfo = (UnitInfo.BuildingInfo)Rules.UnitInfo[ "fact" ];
|
||||
if( Game.CanPlaceBuilding( factBuildingInfo, self.Location - new int2( 1, 1 ), self, false ) )
|
||||
{
|
||||
self.CancelActivity();
|
||||
self.QueueActivity( new Traits.Activities.Turn( 96 ) );
|
||||
self.QueueActivity( new Traits.Activities.DeployMcv() );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user