diff --git a/.gitignore b/.gitignore index cb4ee5998b..871d120b0a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ obj *.vcproj* *.suo *.user +mods/*/*.dll # Red Alert binary files *.[mM][iI][xX] @@ -15,4 +16,4 @@ obj sheet-*.png log.txt -/replay.rep \ No newline at end of file +/replay.rep diff --git a/OpenRa.Game/Effects/Bullet.cs b/OpenRa.Game/Effects/Bullet.cs index c90c42181b..9d672f35a8 100755 --- a/OpenRa.Game/Effects/Bullet.cs +++ b/OpenRa.Game/Effects/Bullet.cs @@ -5,7 +5,7 @@ using OpenRa.Traits; namespace OpenRa.Effects { - class Bullet : IEffect + public class Bullet : IEffect { readonly Player Owner; readonly Actor FiredBy; diff --git a/OpenRa.Game/GameRules/ActorInfo.cs b/OpenRa.Game/GameRules/ActorInfo.cs index c5b495abd7..369b6d0bf5 100644 --- a/OpenRa.Game/GameRules/ActorInfo.cs +++ b/OpenRa.Game/GameRules/ActorInfo.cs @@ -56,7 +56,8 @@ namespace OpenRa.GameRules static Pair[] ModAssemblies = { Pair.New( typeof(ITraitInfo).Assembly, typeof(ITraitInfo).Namespace ), - Pair.New( Assembly.LoadFile(Path.GetFullPath(@"mods\ra\OpenRa.Mods.RA.dll")), "OpenRa.Mods.RA" ) + Pair.New( Assembly.LoadFile(Path.GetFullPath(@"mods\ra\OpenRa.Mods.RA.dll")), "OpenRa.Mods.RA" ), + Pair.New( Assembly.LoadFile(Path.GetFullPath(@"mods\aftermath\OpenRa.Mods.Aftermath.dll")), "OpenRa.Mods.Aftermath" ) }; static ITraitInfo LoadTraitInfo(string traitName, MiniYaml my) diff --git a/OpenRa.Game/OpenRa.Game.csproj b/OpenRa.Game/OpenRa.Game.csproj index 382dc47bb1..b54e0211b0 100644 --- a/OpenRa.Game/OpenRa.Game.csproj +++ b/OpenRa.Game/OpenRa.Game.csproj @@ -222,7 +222,6 @@ - diff --git a/OpenRa.Game/Traits/AttackBase.cs b/OpenRa.Game/Traits/AttackBase.cs index 272b04a0aa..4eae9534da 100644 --- a/OpenRa.Game/Traits/AttackBase.cs +++ b/OpenRa.Game/Traits/AttackBase.cs @@ -6,7 +6,7 @@ using OpenRa.Effects; namespace OpenRa.Traits { - class AttackBaseInfo : ITraitInfo + public class AttackBaseInfo : ITraitInfo { public readonly string PrimaryWeapon = null; public readonly string SecondaryWeapon = null; diff --git a/OpenRa.Game/Traits/AttackInfo.cs b/OpenRa.Game/Traits/AttackInfo.cs index d874e080fe..433a9b1a72 100644 --- a/OpenRa.Game/Traits/AttackInfo.cs +++ b/OpenRa.Game/Traits/AttackInfo.cs @@ -2,7 +2,7 @@ namespace OpenRa.Traits { - class AttackInfo + public class AttackInfo { public Actor Attacker; public WarheadInfo Warhead; diff --git a/OpenRa.Game/Traits/Chronoshiftable.cs b/OpenRa.Game/Traits/Chronoshiftable.cs index 34008d515c..18498faa93 100644 --- a/OpenRa.Game/Traits/Chronoshiftable.cs +++ b/OpenRa.Game/Traits/Chronoshiftable.cs @@ -10,7 +10,7 @@ namespace OpenRa.Traits public object Create(Actor self) { return new Chronoshiftable(self); } } - class Chronoshiftable : IResolveOrder, ISpeedModifier, ITick + public class Chronoshiftable : IResolveOrder, ISpeedModifier, ITick { // Return-to-sender logic [Sync] diff --git a/OpenRa.Game/Traits/Chronosphere.cs b/OpenRa.Game/Traits/Chronosphere.cs index db5cd3baea..9280e89905 100644 --- a/OpenRa.Game/Traits/Chronosphere.cs +++ b/OpenRa.Game/Traits/Chronosphere.cs @@ -1,13 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - + namespace OpenRa.Traits { class ChronosphereInfo : StatelessTraitInfo { } - class Chronosphere : IResolveOrder + public class Chronosphere : IResolveOrder { public void ResolveOrder(Actor self, Order order) { diff --git a/OpenRa.Game/Traits/DemoTruck.cs b/OpenRa.Game/Traits/DemoTruck.cs index 7f8bfd65b5..8845e5bb54 100644 --- a/OpenRa.Game/Traits/DemoTruck.cs +++ b/OpenRa.Game/Traits/DemoTruck.cs @@ -6,46 +6,5 @@ using OpenRa.Orders; namespace OpenRa.Traits { - class DemoTruckInfo : ITraitInfo - { - public object Create(Actor self) { return new DemoTruck(self); } - } - class DemoTruck : Chronoshiftable, IResolveOrder, INotifyDamage - { - public DemoTruck(Actor self) : base(self) {} - - public new void ResolveOrder(Actor self, Order order) - { - // Override chronoshifting action to detonate vehicle - var movement = self.traits.GetOrDefault(); - var chronosphere = Game.world.Actors.Where(a => a.Owner == order.Subject.Owner && a.traits.Contains()).FirstOrDefault(); - if (order.OrderString == "Chronoshift" && movement.CanEnterCell(order.TargetLocation)) - { - self.InflictDamage(chronosphere, self.Health, Rules.WarheadInfo["Super"]); - return; - } - - base.ResolveOrder(self, order); - } - - // Fire primary on death - public void Damaged(Actor self, AttackInfo e) - { - if (e.DamageState == DamageState.Dead) - Detonate(self, e.Attacker); - } - - public void Detonate(Actor self, Actor detonatedBy) - { - self.InflictDamage(detonatedBy, self.Health, Rules.WarheadInfo["Super"]); - var unit = self.traits.GetOrDefault(); - var altitude = unit != null ? unit.Altitude : 0; - int2 detonateLocation = self.CenterLocation.ToInt2(); - - Game.world.AddFrameEndTask( - w => w.Add( new Bullet( self.Info.Traits.Get().PrimaryWeapon, detonatedBy.Owner, detonatedBy, - detonateLocation, detonateLocation, altitude, altitude))); - } - } } diff --git a/OpenRa.Game/Traits/TraitsInterfaces.cs b/OpenRa.Game/Traits/TraitsInterfaces.cs index cfe91c65a5..84157ad002 100644 --- a/OpenRa.Game/Traits/TraitsInterfaces.cs +++ b/OpenRa.Game/Traits/TraitsInterfaces.cs @@ -17,13 +17,13 @@ namespace OpenRa.Traits public interface IIssueOrder { Order IssueOrder( Actor self, int2 xy, MouseInput mi, Actor underCursor ); } public interface IResolveOrder { void ResolveOrder(Actor self, Order order); } - interface INotifySold { void Sold(Actor self); } - interface INotifyDamage { void Damaged(Actor self, AttackInfo e); } - interface INotifyBuildComplete { void BuildingComplete (Actor self); } - interface INotifyProduction { void UnitProduced(Actor self, Actor other); } + public interface INotifySold { void Sold(Actor self); } + public interface INotifyDamage { void Damaged(Actor self, AttackInfo e); } + public interface INotifyBuildComplete { void BuildingComplete(Actor self); } + public interface INotifyProduction { void UnitProduced(Actor self, Actor other); } - interface IAcceptThief { void OnSteal(Actor self, Actor thief); } - interface IAcceptSpy { void OnInfiltrate(Actor self, Actor spy); } + public interface IAcceptThief { void OnSteal(Actor self, Actor thief); } + public interface IAcceptSpy { void OnInfiltrate(Actor self, Actor spy); } interface IProducer { @@ -31,7 +31,7 @@ namespace OpenRa.Traits void SetPrimaryProducer(Actor self, bool isPrimary); } public interface IOccupySpace { IEnumerable OccupiedCells(); } - interface INotifyAttack { void Attacking(Actor self); } + public interface INotifyAttack { void Attacking(Actor self); } public interface IRenderModifier { IEnumerable ModifyRender(Actor self, IEnumerable r); } public interface IDamageModifier { float GetDamageModifier(); } public interface ISpeedModifier { float GetSpeedModifier(); } diff --git a/OpenRa.Game/Traits/Unit.cs b/OpenRa.Game/Traits/Unit.cs index 0594bf9955..3ac586d671 100755 --- a/OpenRa.Game/Traits/Unit.cs +++ b/OpenRa.Game/Traits/Unit.cs @@ -11,7 +11,7 @@ namespace OpenRa.Traits public object Create( Actor self ) { return new Unit( self ); } } - class Unit : INotifyDamage + public class Unit : INotifyDamage { [Sync] public int Facing; diff --git a/OpenRa.Mods.Aftermath/DemoTruck.cs b/OpenRa.Mods.Aftermath/DemoTruck.cs new file mode 100644 index 0000000000..03ec10db80 --- /dev/null +++ b/OpenRa.Mods.Aftermath/DemoTruck.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using OpenRa.Traits; +using OpenRa.Effects; + +namespace OpenRa.Mods.Aftermath +{ + class DemoTruckInfo : ITraitInfo + { + public object Create(Actor self) { return new DemoTruck(self); } + } + + class DemoTruck : Chronoshiftable, IResolveOrder, INotifyDamage + { + public DemoTruck(Actor self) : base(self) { } + + public new void ResolveOrder(Actor self, Order order) + { + // Override chronoshifting action to detonate vehicle + var movement = self.traits.GetOrDefault(); + var chronosphere = Game.world.Actors.Where(a => a.Owner == order.Subject.Owner && a.traits.Contains()).FirstOrDefault(); + if (order.OrderString == "Chronoshift" && movement.CanEnterCell(order.TargetLocation)) + { + self.InflictDamage(chronosphere, self.Health, Rules.WarheadInfo["Super"]); + return; + } + + base.ResolveOrder(self, order); + } + + // Fire primary on death + public void Damaged(Actor self, AttackInfo e) + { + if (e.DamageState == DamageState.Dead) + Detonate(self, e.Attacker); + } + + public void Detonate(Actor self, Actor detonatedBy) + { + self.InflictDamage(detonatedBy, self.Health, Rules.WarheadInfo["Super"]); + var unit = self.traits.GetOrDefault(); + var altitude = unit != null ? unit.Altitude : 0; + int2 detonateLocation = self.CenterLocation.ToInt2(); + + Game.world.AddFrameEndTask( + w => w.Add(new Bullet(self.Info.Traits.Get().PrimaryWeapon, detonatedBy.Owner, detonatedBy, + detonateLocation, detonateLocation, altitude, altitude))); + } + } +} diff --git a/OpenRa.Mods.Aftermath/OpenRa.Mods.Aftermath.csproj b/OpenRa.Mods.Aftermath/OpenRa.Mods.Aftermath.csproj new file mode 100644 index 0000000000..6805a88558 --- /dev/null +++ b/OpenRa.Mods.Aftermath/OpenRa.Mods.Aftermath.csproj @@ -0,0 +1,73 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {2E1F8D8B-AEF5-4BCE-A95C-50223A0C7331} + Library + Properties + OpenRa.Mods.Aftermath + OpenRa.Mods.Aftermath + v3.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + 3.5 + + + 3.5 + + + 3.5 + + + + + + + + + + + {BDAEAB25-991E-46A7-AF1E-4F0E03358DAA} + OpenRa.FileFormats + + + {0DFB103F-2962-400F-8C6D-E2C28CCBA633} + OpenRa.Game + + + + + + mkdir "$(SolutionDir)mods/aftermath/" +copy "$(TargetPath)" "$(SolutionDir)mods/aftermath/" + + \ No newline at end of file diff --git a/OpenRa.Mods.Aftermath/Properties/AssemblyInfo.cs b/OpenRa.Mods.Aftermath/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..39dcccdbbf --- /dev/null +++ b/OpenRa.Mods.Aftermath/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("OpenRa.Mods.Aftermath")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("OpenRa.Mods.Aftermath")] +[assembly: AssemblyCopyright("Copyright © 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("cc21537e-3011-4c80-9068-ad302431e784")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/OpenRa.sln b/OpenRa.sln index 97694b7989..53d44a4f14 100644 --- a/OpenRa.sln +++ b/OpenRa.sln @@ -19,6 +19,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRa.Mods.RA", "OpenRa.Mo EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mods", "Mods", "{F80861C1-DD5C-40A4-94B4-02D96318AE95}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRa.Mods.Aftermath", "OpenRa.Mods.Aftermath\OpenRa.Mods.Aftermath.csproj", "{2E1F8D8B-AEF5-4BCE-A95C-50223A0C7331}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug (x86)|Any CPU = Debug (x86)|Any CPU @@ -185,11 +187,32 @@ Global {4A8A43B5-A9EF-4ED0-99DD-4BAB10A0DB6E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {4A8A43B5-A9EF-4ED0-99DD-4BAB10A0DB6E}.Release|Mixed Platforms.Build.0 = Release|Any CPU {4A8A43B5-A9EF-4ED0-99DD-4BAB10A0DB6E}.Release|Win32.ActiveCfg = Release|Any CPU + {2E1F8D8B-AEF5-4BCE-A95C-50223A0C7331}.Debug (x86)|Any CPU.ActiveCfg = Debug|Any CPU + {2E1F8D8B-AEF5-4BCE-A95C-50223A0C7331}.Debug (x86)|Any CPU.Build.0 = Debug|Any CPU + {2E1F8D8B-AEF5-4BCE-A95C-50223A0C7331}.Debug (x86)|Mixed Platforms.ActiveCfg = Debug|Any CPU + {2E1F8D8B-AEF5-4BCE-A95C-50223A0C7331}.Debug (x86)|Mixed Platforms.Build.0 = Debug|Any CPU + {2E1F8D8B-AEF5-4BCE-A95C-50223A0C7331}.Debug (x86)|Win32.ActiveCfg = Debug|Any CPU + {2E1F8D8B-AEF5-4BCE-A95C-50223A0C7331}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2E1F8D8B-AEF5-4BCE-A95C-50223A0C7331}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2E1F8D8B-AEF5-4BCE-A95C-50223A0C7331}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {2E1F8D8B-AEF5-4BCE-A95C-50223A0C7331}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {2E1F8D8B-AEF5-4BCE-A95C-50223A0C7331}.Debug|Win32.ActiveCfg = Debug|Any CPU + {2E1F8D8B-AEF5-4BCE-A95C-50223A0C7331}.Release (x86)|Any CPU.ActiveCfg = Release|Any CPU + {2E1F8D8B-AEF5-4BCE-A95C-50223A0C7331}.Release (x86)|Any CPU.Build.0 = Release|Any CPU + {2E1F8D8B-AEF5-4BCE-A95C-50223A0C7331}.Release (x86)|Mixed Platforms.ActiveCfg = Release|Any CPU + {2E1F8D8B-AEF5-4BCE-A95C-50223A0C7331}.Release (x86)|Mixed Platforms.Build.0 = Release|Any CPU + {2E1F8D8B-AEF5-4BCE-A95C-50223A0C7331}.Release (x86)|Win32.ActiveCfg = Release|Any CPU + {2E1F8D8B-AEF5-4BCE-A95C-50223A0C7331}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2E1F8D8B-AEF5-4BCE-A95C-50223A0C7331}.Release|Any CPU.Build.0 = Release|Any CPU + {2E1F8D8B-AEF5-4BCE-A95C-50223A0C7331}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {2E1F8D8B-AEF5-4BCE-A95C-50223A0C7331}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {2E1F8D8B-AEF5-4BCE-A95C-50223A0C7331}.Release|Win32.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {4A8A43B5-A9EF-4ED0-99DD-4BAB10A0DB6E} = {F80861C1-DD5C-40A4-94B4-02D96318AE95} + {2E1F8D8B-AEF5-4BCE-A95C-50223A0C7331} = {F80861C1-DD5C-40A4-94B4-02D96318AE95} EndGlobalSection EndGlobal diff --git a/mods/ra/OpenRa.Mods.RA.dll b/mods/ra/OpenRa.Mods.RA.dll deleted file mode 100644 index 64be244297..0000000000 Binary files a/mods/ra/OpenRa.Mods.RA.dll and /dev/null differ