Merge branch 'master' of git://github.com/chrisforbes/OpenRA into cpu-independent
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace OpenRa.Traits.Activities
|
namespace OpenRa.Traits.Activities
|
||||||
{
|
{
|
||||||
class Rearm : IActivity
|
public class Rearm : IActivity
|
||||||
{
|
{
|
||||||
public IActivity NextActivity { get; set; }
|
public IActivity NextActivity { get; set; }
|
||||||
bool isCanceled;
|
bool isCanceled;
|
||||||
|
|||||||
@@ -5,12 +5,15 @@ using System.Text;
|
|||||||
|
|
||||||
namespace OpenRa.Traits.Activities
|
namespace OpenRa.Traits.Activities
|
||||||
{
|
{
|
||||||
class Repair : IActivity
|
public class Repair : IActivity
|
||||||
{
|
{
|
||||||
public IActivity NextActivity { get; set; }
|
public IActivity NextActivity { get; set; }
|
||||||
bool isCanceled;
|
bool isCanceled;
|
||||||
|
bool playHostAnim;
|
||||||
int remainingTicks;
|
int remainingTicks;
|
||||||
|
|
||||||
|
public Repair(bool playHostAnim) { this.playHostAnim = playHostAnim; }
|
||||||
|
|
||||||
public IActivity Tick(Actor self)
|
public IActivity Tick(Actor self)
|
||||||
{
|
{
|
||||||
if (isCanceled) return NextActivity;
|
if (isCanceled) return NextActivity;
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ namespace OpenRa.Traits
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ResolveOrder( Actor self, Order order )
|
public void ResolveOrder(Actor self, Order order)
|
||||||
{
|
{
|
||||||
if (reservation != null)
|
if (reservation != null)
|
||||||
{
|
{
|
||||||
@@ -49,7 +49,7 @@ namespace OpenRa.Traits
|
|||||||
{
|
{
|
||||||
self.CancelActivity();
|
self.CancelActivity();
|
||||||
self.QueueActivity(new HeliFly(Util.CenterOfCell(order.TargetLocation)));
|
self.QueueActivity(new HeliFly(Util.CenterOfCell(order.TargetLocation)));
|
||||||
self.QueueActivity( new Turn( self.Info.Traits.GetOrDefault<UnitInfo>().InitialFacing ) );
|
self.QueueActivity(new Turn(self.Info.Traits.GetOrDefault<UnitInfo>().InitialFacing));
|
||||||
self.QueueActivity(new HeliLand(true));
|
self.QueueActivity(new HeliLand(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,10 +66,10 @@ namespace OpenRa.Traits
|
|||||||
|
|
||||||
self.CancelActivity();
|
self.CancelActivity();
|
||||||
self.QueueActivity(new HeliFly(order.TargetActor.CenterLocation + offsetVec));
|
self.QueueActivity(new HeliFly(order.TargetActor.CenterLocation + offsetVec));
|
||||||
self.QueueActivity( new Turn( self.Info.Traits.GetOrDefault<UnitInfo>().InitialFacing ) );
|
self.QueueActivity(new Turn(self.Info.Traits.GetOrDefault<UnitInfo>().InitialFacing));
|
||||||
self.QueueActivity(new HeliLand(false));
|
self.QueueActivity(new HeliLand(false));
|
||||||
self.QueueActivity(order.TargetActor.Info.Name == "hpad"
|
self.QueueActivity(order.TargetActor.Info.Name == "hpad"
|
||||||
? (IActivity)new Rearm() : new Repair());
|
? (IActivity)new Rearm() : new Repair(true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ namespace OpenRa.Traits
|
|||||||
self.CancelActivity();
|
self.CancelActivity();
|
||||||
self.QueueActivity(new ReturnToBase(self, order.TargetActor));
|
self.QueueActivity(new ReturnToBase(self, order.TargetActor));
|
||||||
self.QueueActivity(order.TargetActor.Info.Name == "afld"
|
self.QueueActivity(order.TargetActor.Info.Name == "afld"
|
||||||
? (IActivity)new Rearm() : new Repair());
|
? (IActivity)new Rearm() : new Repair(true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ namespace OpenRa.Traits
|
|||||||
self.CancelActivity();
|
self.CancelActivity();
|
||||||
self.QueueActivity(new Move(((1 / 24f) * order.TargetActor.CenterLocation).ToInt2(), order.TargetActor));
|
self.QueueActivity(new Move(((1 / 24f) * order.TargetActor.CenterLocation).ToInt2(), order.TargetActor));
|
||||||
self.QueueActivity(new Rearm());
|
self.QueueActivity(new Rearm());
|
||||||
self.QueueActivity(new Repair());
|
self.QueueActivity(new Repair(true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,6 +57,7 @@
|
|||||||
<Compile Include="Minelayer.cs" />
|
<Compile Include="Minelayer.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="RenderSpy.cs" />
|
<Compile Include="RenderSpy.cs" />
|
||||||
|
<Compile Include="RepairableNear.cs" />
|
||||||
<Compile Include="Spy.cs" />
|
<Compile Include="Spy.cs" />
|
||||||
<Compile Include="Thief.cs" />
|
<Compile Include="Thief.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
37
OpenRa.Mods.RA/RepairableNear.cs
Normal file
37
OpenRa.Mods.RA/RepairableNear.cs
Normal file
@@ -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<RepairableNear> { }
|
||||||
|
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
artsrc/website-mockup.psd
Normal file
BIN
artsrc/website-mockup.psd
Normal file
Binary file not shown.
@@ -15,3 +15,6 @@
|
|||||||
@copy SequenceEditor\bin\x86\debug\SequenceEditor.exe ..\openra-bin\
|
@copy SequenceEditor\bin\x86\debug\SequenceEditor.exe ..\openra-bin\
|
||||||
@copy OpenRA.Game\bin\x86\debug\*.dll ..\openra-bin\
|
@copy OpenRA.Game\bin\x86\debug\*.dll ..\openra-bin\
|
||||||
@copy OpenRA.Game\bin\x86\debug\OpenRa.Game.exe ..\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\
|
||||||
5
ra.yaml
5
ra.yaml
@@ -491,6 +491,7 @@ SS:
|
|||||||
FireDelay: 2
|
FireDelay: 2
|
||||||
Chronoshiftable:
|
Chronoshiftable:
|
||||||
IronCurtainable:
|
IronCurtainable:
|
||||||
|
RepairableNear:
|
||||||
|
|
||||||
DD:
|
DD:
|
||||||
Inherits: ^Ship
|
Inherits: ^Ship
|
||||||
@@ -519,6 +520,7 @@ DD:
|
|||||||
AutoTarget:
|
AutoTarget:
|
||||||
Chronoshiftable:
|
Chronoshiftable:
|
||||||
IronCurtainable:
|
IronCurtainable:
|
||||||
|
RepairableNear:
|
||||||
|
|
||||||
CA:
|
CA:
|
||||||
Inherits: ^Ship
|
Inherits: ^Ship
|
||||||
@@ -549,6 +551,7 @@ CA:
|
|||||||
AutoTarget:
|
AutoTarget:
|
||||||
Chronoshiftable:
|
Chronoshiftable:
|
||||||
IronCurtainable:
|
IronCurtainable:
|
||||||
|
RepairableNear:
|
||||||
|
|
||||||
LST:
|
LST:
|
||||||
Inherits: ^Ship
|
Inherits: ^Ship
|
||||||
@@ -570,6 +573,7 @@ LST:
|
|||||||
PassengerTypes: Foot,Wheel,Track
|
PassengerTypes: Foot,Wheel,Track
|
||||||
Passengers: 5
|
Passengers: 5
|
||||||
IronCurtainable:
|
IronCurtainable:
|
||||||
|
RepairableNear:
|
||||||
|
|
||||||
PT:
|
PT:
|
||||||
Inherits: ^Ship
|
Inherits: ^Ship
|
||||||
@@ -598,6 +602,7 @@ PT:
|
|||||||
AutoTarget:
|
AutoTarget:
|
||||||
Chronoshiftable:
|
Chronoshiftable:
|
||||||
IronCurtainable:
|
IronCurtainable:
|
||||||
|
RepairableNear:
|
||||||
|
|
||||||
MIG:
|
MIG:
|
||||||
Inherits: ^Plane
|
Inherits: ^Plane
|
||||||
|
|||||||
10
units.ini
10
units.ini
@@ -121,21 +121,21 @@ PT
|
|||||||
Description=Submarine
|
Description=Submarine
|
||||||
WaterBound=yes
|
WaterBound=yes
|
||||||
BuiltAt=spen
|
BuiltAt=spen
|
||||||
Traits=Unit, Mobile, RenderUnit, Submarine, AttackBase, Chronoshiftable, IronCurtainable
|
Traits=Unit, Mobile, RenderUnit, Submarine, AttackBase, Chronoshiftable, IronCurtainable, RepairableNear
|
||||||
FireDelay=2
|
FireDelay=2
|
||||||
LongDesc=Submerged anti-ship unit armed with \ntorpedoes.\n Strong vs Ships\n Weak vs Everything\n Special Ability: Submerge
|
LongDesc=Submerged anti-ship unit armed with \ntorpedoes.\n Strong vs Ships\n Weak vs Everything\n Special Ability: Submerge
|
||||||
[DD]
|
[DD]
|
||||||
Description=Destroyer
|
Description=Destroyer
|
||||||
WaterBound=yes
|
WaterBound=yes
|
||||||
BuiltAt=syrd
|
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
|
PrimaryOffset=0,-8,0,-3
|
||||||
LongDesc=Fast multi-role ship. \n Strong vs Submarines, Aircraft\n Weak vs Infantry, Tanks
|
LongDesc=Fast multi-role ship. \n Strong vs Submarines, Aircraft\n Weak vs Infantry, Tanks
|
||||||
[CA]
|
[CA]
|
||||||
Description=Cruiser
|
Description=Cruiser
|
||||||
WaterBound=yes
|
WaterBound=yes
|
||||||
BuiltAt=syrd
|
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
|
PrimaryOffset=0,17,0,-2
|
||||||
SecondaryOffset=0,-17,0,-2
|
SecondaryOffset=0,-17,0,-2
|
||||||
LongDesc=Very slow long-range ship. \n Strong vs Buildings\n Weak vs Ships, Submarines
|
LongDesc=Very slow long-range ship. \n Strong vs Buildings\n Weak vs Ships, Submarines
|
||||||
@@ -143,14 +143,14 @@ Recoil=3
|
|||||||
[LST]
|
[LST]
|
||||||
Description=Transport
|
Description=Transport
|
||||||
WaterBound=yes
|
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
|
LongDesc=General-purpose naval transport.\nCan carry infantry and tanks.\n Unarmed
|
||||||
PassengerTypes=Foot,Wheel,Track
|
PassengerTypes=Foot,Wheel,Track
|
||||||
[PT]
|
[PT]
|
||||||
Description=Gunboat
|
Description=Gunboat
|
||||||
WaterBound=yes
|
WaterBound=yes
|
||||||
BuiltAt=syrd
|
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
|
PrimaryOffset=0,-6,0,-1
|
||||||
LongDesc=Light scout & support ship. \n Strong vs Ships, Submarines\n Weak vs Aircraft
|
LongDesc=Light scout & support ship. \n Strong vs Ships, Submarines\n Weak vs Aircraft
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user