diff --git a/OpenRa.Game/Traits/Activities/Rearm.cs b/OpenRa.Game/Traits/Activities/Rearm.cs index d1917a9c6d..479f55d449 100644 --- a/OpenRa.Game/Traits/Activities/Rearm.cs +++ b/OpenRa.Game/Traits/Activities/Rearm.cs @@ -2,7 +2,7 @@ namespace OpenRa.Traits.Activities { - class Rearm : IActivity + public class Rearm : IActivity { public IActivity NextActivity { get; set; } bool isCanceled; diff --git a/OpenRa.Game/Traits/Activities/Repair.cs b/OpenRa.Game/Traits/Activities/Repair.cs index 918b2417a6..49254828df 100644 --- a/OpenRa.Game/Traits/Activities/Repair.cs +++ b/OpenRa.Game/Traits/Activities/Repair.cs @@ -5,12 +5,15 @@ using System.Text; namespace OpenRa.Traits.Activities { - class Repair : IActivity + public class Repair : IActivity { public IActivity NextActivity { get; set; } bool isCanceled; + bool playHostAnim; int remainingTicks; + public Repair(bool playHostAnim) { this.playHostAnim = playHostAnim; } + public IActivity Tick(Actor self) { if (isCanceled) return NextActivity; diff --git a/OpenRa.Game/Traits/Helicopter.cs b/OpenRa.Game/Traits/Helicopter.cs index 540cb953a3..53223925a0 100644 --- a/OpenRa.Game/Traits/Helicopter.cs +++ b/OpenRa.Game/Traits/Helicopter.cs @@ -37,7 +37,7 @@ namespace OpenRa.Traits return null; } - public void ResolveOrder( Actor self, Order order ) + public void ResolveOrder(Actor self, Order order) { if (reservation != null) { @@ -49,7 +49,7 @@ namespace OpenRa.Traits { self.CancelActivity(); self.QueueActivity(new HeliFly(Util.CenterOfCell(order.TargetLocation))); - self.QueueActivity( new Turn( self.Info.Traits.GetOrDefault().InitialFacing ) ); + self.QueueActivity(new Turn(self.Info.Traits.GetOrDefault().InitialFacing)); self.QueueActivity(new HeliLand(true)); } @@ -66,10 +66,10 @@ namespace OpenRa.Traits self.CancelActivity(); self.QueueActivity(new HeliFly(order.TargetActor.CenterLocation + offsetVec)); - self.QueueActivity( new Turn( self.Info.Traits.GetOrDefault().InitialFacing ) ); + self.QueueActivity(new Turn(self.Info.Traits.GetOrDefault().InitialFacing)); self.QueueActivity(new HeliLand(false)); self.QueueActivity(order.TargetActor.Info.Name == "hpad" - ? (IActivity)new Rearm() : new Repair()); + ? (IActivity)new Rearm() : new Repair(true)); } } diff --git a/OpenRa.Game/Traits/Plane.cs b/OpenRa.Game/Traits/Plane.cs index 6297fd071e..f83a1f3f02 100644 --- a/OpenRa.Game/Traits/Plane.cs +++ b/OpenRa.Game/Traits/Plane.cs @@ -62,7 +62,7 @@ namespace OpenRa.Traits self.CancelActivity(); self.QueueActivity(new ReturnToBase(self, order.TargetActor)); self.QueueActivity(order.TargetActor.Info.Name == "afld" - ? (IActivity)new Rearm() : new Repair()); + ? (IActivity)new Rearm() : new Repair(true)); } } diff --git a/OpenRa.Game/Traits/Repairable.cs b/OpenRa.Game/Traits/Repairable.cs index 93005c34b7..e4f0095046 100644 --- a/OpenRa.Game/Traits/Repairable.cs +++ b/OpenRa.Game/Traits/Repairable.cs @@ -48,7 +48,7 @@ namespace OpenRa.Traits self.CancelActivity(); self.QueueActivity(new Move(((1 / 24f) * order.TargetActor.CenterLocation).ToInt2(), order.TargetActor)); self.QueueActivity(new Rearm()); - self.QueueActivity(new Repair()); + self.QueueActivity(new Repair(true)); } } } diff --git a/OpenRa.Mods.RA/OpenRa.Mods.RA.csproj b/OpenRa.Mods.RA/OpenRa.Mods.RA.csproj index ff9b901130..a1ed1d7c47 100644 --- a/OpenRa.Mods.RA/OpenRa.Mods.RA.csproj +++ b/OpenRa.Mods.RA/OpenRa.Mods.RA.csproj @@ -57,6 +57,7 @@ + diff --git a/OpenRa.Mods.RA/RepairableNear.cs b/OpenRa.Mods.RA/RepairableNear.cs new file mode 100644 index 0000000000..721833d1c5 --- /dev/null +++ b/OpenRa.Mods.RA/RepairableNear.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using OpenRa.Traits; +using OpenRa.Traits.Activities; + +namespace OpenRa.Mods.RA +{ + class RepairableNearInfo : StatelessTraitInfo { } + + class RepairableNear : IIssueOrder, IResolveOrder + { + public Order IssueOrder(Actor self, int2 xy, MouseInput mi, Actor underCursor) + { + if (mi.Button != MouseButton.Right) return null; + if (underCursor == null) return null; + + if (underCursor.Owner == self.Owner && + (underCursor.Info.Name == "spen" || underCursor.Info.Name == "syrd") && + self.Health < self.GetMaxHP()) + return new Order("Enter", self, underCursor, int2.Zero, null); + + return null; + } + + public void ResolveOrder(Actor self, Order order) + { + if (order.OrderString == "Enter") + { + self.CancelActivity(); + self.QueueActivity(new Move(order.TargetActor, 1)); + self.QueueActivity(new Repair(false)); + } + } + } +} diff --git a/artsrc/website-mockup.psd b/artsrc/website-mockup.psd new file mode 100644 index 0000000000..0edcff6b8b Binary files /dev/null and b/artsrc/website-mockup.psd differ diff --git a/makedist.cmd b/makedist.cmd index 491b62eefe..f5c9d8e457 100644 --- a/makedist.cmd +++ b/makedist.cmd @@ -15,3 +15,6 @@ @copy SequenceEditor\bin\x86\debug\SequenceEditor.exe ..\openra-bin\ @copy OpenRA.Game\bin\x86\debug\*.dll ..\openra-bin\ @copy OpenRA.Game\bin\x86\debug\OpenRa.Game.exe ..\openra-bin\ +@xcopy /E mods ..\openra-bin\mods\ +@copy *.yaml ..\openra-bin\ +@copy bogus.* ..\openra-bin\ \ No newline at end of file diff --git a/ra.yaml b/ra.yaml index c4dd2271b0..c28a57d3d4 100644 --- a/ra.yaml +++ b/ra.yaml @@ -491,6 +491,7 @@ SS: FireDelay: 2 Chronoshiftable: IronCurtainable: + RepairableNear: DD: Inherits: ^Ship @@ -519,6 +520,7 @@ DD: AutoTarget: Chronoshiftable: IronCurtainable: + RepairableNear: CA: Inherits: ^Ship @@ -549,6 +551,7 @@ CA: AutoTarget: Chronoshiftable: IronCurtainable: + RepairableNear: LST: Inherits: ^Ship @@ -570,6 +573,7 @@ LST: PassengerTypes: Foot,Wheel,Track Passengers: 5 IronCurtainable: + RepairableNear: PT: Inherits: ^Ship @@ -598,6 +602,7 @@ PT: AutoTarget: Chronoshiftable: IronCurtainable: + RepairableNear: MIG: Inherits: ^Plane diff --git a/units.ini b/units.ini index f504743fdf..1fdf75dc95 100644 --- a/units.ini +++ b/units.ini @@ -121,21 +121,21 @@ PT Description=Submarine WaterBound=yes BuiltAt=spen -Traits=Unit, Mobile, RenderUnit, Submarine, AttackBase, Chronoshiftable, IronCurtainable +Traits=Unit, Mobile, RenderUnit, Submarine, AttackBase, Chronoshiftable, IronCurtainable, RepairableNear FireDelay=2 LongDesc=Submerged anti-ship unit armed with \ntorpedoes.\n Strong vs Ships\n Weak vs Everything\n Special Ability: Submerge [DD] Description=Destroyer WaterBound=yes BuiltAt=syrd -Traits=Unit, Mobile, Turreted, AttackTurreted, RenderUnitTurreted, AutoTarget, Chronoshiftable, IronCurtainable +Traits=Unit, Mobile, Turreted, AttackTurreted, RenderUnitTurreted, AutoTarget, Chronoshiftable, IronCurtainable, RepairableNear PrimaryOffset=0,-8,0,-3 LongDesc=Fast multi-role ship. \n Strong vs Submarines, Aircraft\n Weak vs Infantry, Tanks [CA] Description=Cruiser WaterBound=yes BuiltAt=syrd -Traits=Unit, Mobile, Turreted, AttackTurreted, RenderUnitTurreted, AutoTarget, Chronoshiftable, IronCurtainable +Traits=Unit, Mobile, Turreted, AttackTurreted, RenderUnitTurreted, AutoTarget, Chronoshiftable, IronCurtainable, RepairableNear PrimaryOffset=0,17,0,-2 SecondaryOffset=0,-17,0,-2 LongDesc=Very slow long-range ship. \n Strong vs Buildings\n Weak vs Ships, Submarines @@ -143,14 +143,14 @@ Recoil=3 [LST] Description=Transport WaterBound=yes -Traits=Unit, Mobile, RenderUnit, Cargo, IronCurtainable +Traits=Unit, Mobile, RenderUnit, Cargo, IronCurtainable, RepairableNear LongDesc=General-purpose naval transport.\nCan carry infantry and tanks.\n Unarmed PassengerTypes=Foot,Wheel,Track [PT] Description=Gunboat WaterBound=yes BuiltAt=syrd -Traits=Unit, Mobile, Turreted, AttackTurreted, RenderUnitTurreted, AutoTarget, Chronoshiftable, IronCurtainable +Traits=Unit, Mobile, Turreted, AttackTurreted, RenderUnitTurreted, AutoTarget, Chronoshiftable, IronCurtainable, RepairableNear PrimaryOffset=0,-6,0,-1 LongDesc=Light scout & support ship. \n Strong vs Ships, Submarines\n Weak vs Aircraft