new support power impl
This commit is contained in:
@@ -3,19 +3,16 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Drawing;
|
||||
using OpenRa.Traits;
|
||||
using OpenRa.SupportPowers;
|
||||
|
||||
namespace OpenRa.Orders
|
||||
{
|
||||
class ChronoshiftDestinationOrderGenerator : IOrderGenerator
|
||||
{
|
||||
public readonly Actor self;
|
||||
SupportPower power;
|
||||
|
||||
public ChronoshiftDestinationOrderGenerator(Actor self, SupportPower power)
|
||||
public ChronoshiftDestinationOrderGenerator(Actor self)
|
||||
{
|
||||
this.self = self;
|
||||
this.power = power;
|
||||
}
|
||||
|
||||
public IEnumerable<Order> Order(World world, int2 xy, MouseInput mi)
|
||||
@@ -25,8 +22,9 @@ namespace OpenRa.Orders
|
||||
Game.controller.CancelInputMode();
|
||||
yield break;
|
||||
}
|
||||
yield return new Order("Chronoshift", self, null, xy,
|
||||
power != null ? power.Name : null);
|
||||
|
||||
yield return new Order("Chronoshift", self, xy);
|
||||
yield return new Order("ChronosphereFinish", self.Owner.PlayerActor);
|
||||
}
|
||||
|
||||
public void Tick( World world ) {}
|
||||
|
||||
@@ -3,17 +3,12 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRa.GameRules;
|
||||
using OpenRa.Traits;
|
||||
using OpenRa.SupportPowers;
|
||||
|
||||
namespace OpenRa.Orders
|
||||
{
|
||||
class ChronosphereSelectOrderGenerator : IOrderGenerator
|
||||
{
|
||||
SupportPower power;
|
||||
public ChronosphereSelectOrderGenerator(SupportPower power)
|
||||
{
|
||||
this.power = power;
|
||||
}
|
||||
public ChronosphereSelectOrderGenerator() {}
|
||||
|
||||
public IEnumerable<Order> Order(World world, int2 xy, MouseInput mi)
|
||||
{
|
||||
@@ -32,10 +27,12 @@ namespace OpenRa.Orders
|
||||
.Where(a => a.Owner == world.LocalPlayer
|
||||
&& a.traits.Contains<Chronoshiftable>()
|
||||
&& a.traits.Contains<Selectable>()).FirstOrDefault();
|
||||
|
||||
|
||||
if (underCursor != null)
|
||||
yield return new Order("ChronosphereSelect", underCursor, null, int2.Zero, power.Name);
|
||||
yield return new Order("ChronosphereSelect", world.LocalPlayer.PlayerActor, underCursor);
|
||||
}
|
||||
|
||||
yield break;
|
||||
}
|
||||
|
||||
public void Tick( World world )
|
||||
@@ -43,8 +40,9 @@ namespace OpenRa.Orders
|
||||
var hasChronosphere = world.Actors
|
||||
.Any(a => a.Owner == world.LocalPlayer && a.traits.Contains<Chronosphere>());
|
||||
|
||||
if (!hasChronosphere)
|
||||
Game.controller.CancelInputMode();
|
||||
// HACK: re-enable this
|
||||
//if (!hasChronosphere)
|
||||
// Game.controller.CancelInputMode();
|
||||
}
|
||||
|
||||
public void Render( World world ) { }
|
||||
|
||||
@@ -3,7 +3,6 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRa.GameRules;
|
||||
using OpenRa.Traits;
|
||||
using OpenRa.SupportPowers;
|
||||
|
||||
namespace OpenRa.Orders
|
||||
{
|
||||
@@ -34,8 +33,10 @@ namespace OpenRa.Orders
|
||||
&& a.traits.Contains<Selectable>()).FirstOrDefault();
|
||||
|
||||
if (underCursor != null)
|
||||
yield return new Order("IronCurtain", underCursor, null, int2.Zero, power.Name);
|
||||
yield return new Order("IronCurtain", underCursor.Owner.PlayerActor, underCursor);
|
||||
}
|
||||
|
||||
yield break;
|
||||
}
|
||||
|
||||
public void Tick( World world )
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace OpenRa.Orders
|
||||
yield break;
|
||||
}
|
||||
|
||||
yield return new Order("PlaceBuilding", Producer.Owner.PlayerActor, null, topLeft, Building);
|
||||
yield return new Order("PlaceBuilding", Producer.Owner.PlayerActor, topLeft, Building);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace OpenRa.Orders
|
||||
&& a.traits.Contains<Selectable>()).FirstOrDefault();
|
||||
|
||||
if (underCursor != null)
|
||||
yield return new Order("PowerDown", underCursor, null, int2.Zero, null);
|
||||
yield return new Order("PowerDown", underCursor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace OpenRa.Orders
|
||||
var building = underCursor != null ? underCursor.Info.Traits.Get<BuildingInfo>() : null;
|
||||
|
||||
if (building != null && building.Repairable && underCursor.Health < building.HP)
|
||||
yield return new Order("Repair", underCursor, null, int2.Zero, null);
|
||||
yield return new Order("Repair", underCursor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace OpenRa.Orders
|
||||
var building = underCursor != null ? underCursor.Info.Traits.Get<BuildingInfo>() : null;
|
||||
|
||||
if (building != null && !building.Unsellable)
|
||||
yield return new Order("Sell", underCursor, null, int2.Zero, null);
|
||||
yield return new Order("Sell", underCursor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user