oops; we don't want mod binaries in the repo; demotruck in aftermath mod.

This commit is contained in:
Chris Forbes
2010-01-17 10:21:44 +13:00
parent a3ab1d77e7
commit 9c78406f08
16 changed files with 202 additions and 62 deletions

3
.gitignore vendored
View File

@@ -6,6 +6,7 @@ obj
*.vcproj* *.vcproj*
*.suo *.suo
*.user *.user
mods/*/*.dll
# Red Alert binary files # Red Alert binary files
*.[mM][iI][xX] *.[mM][iI][xX]
@@ -15,4 +16,4 @@ obj
sheet-*.png sheet-*.png
log.txt log.txt
/replay.rep /replay.rep

View File

@@ -5,7 +5,7 @@ using OpenRa.Traits;
namespace OpenRa.Effects namespace OpenRa.Effects
{ {
class Bullet : IEffect public class Bullet : IEffect
{ {
readonly Player Owner; readonly Player Owner;
readonly Actor FiredBy; readonly Actor FiredBy;

View File

@@ -56,7 +56,8 @@ namespace OpenRa.GameRules
static Pair<Assembly, string>[] ModAssemblies = static Pair<Assembly, string>[] ModAssemblies =
{ {
Pair.New( typeof(ITraitInfo).Assembly, typeof(ITraitInfo).Namespace ), 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) static ITraitInfo LoadTraitInfo(string traitName, MiniYaml my)

View File

@@ -222,7 +222,6 @@
<Compile Include="Traits\Chronoshiftable.cs" /> <Compile Include="Traits\Chronoshiftable.cs" />
<Compile Include="Traits\ChronoshiftPaletteEffect.cs" /> <Compile Include="Traits\ChronoshiftPaletteEffect.cs" />
<Compile Include="Traits\Chronosphere.cs" /> <Compile Include="Traits\Chronosphere.cs" />
<Compile Include="Traits\DemoTruck.cs" />
<Compile Include="Traits\EngineerCapture.cs" /> <Compile Include="Traits\EngineerCapture.cs" />
<Compile Include="Traits\Explodes.cs" /> <Compile Include="Traits\Explodes.cs" />
<Compile Include="Traits\ChronoshiftDeploy.cs" /> <Compile Include="Traits\ChronoshiftDeploy.cs" />

View File

@@ -6,7 +6,7 @@ using OpenRa.Effects;
namespace OpenRa.Traits namespace OpenRa.Traits
{ {
class AttackBaseInfo : ITraitInfo public class AttackBaseInfo : ITraitInfo
{ {
public readonly string PrimaryWeapon = null; public readonly string PrimaryWeapon = null;
public readonly string SecondaryWeapon = null; public readonly string SecondaryWeapon = null;

View File

@@ -2,7 +2,7 @@
namespace OpenRa.Traits namespace OpenRa.Traits
{ {
class AttackInfo public class AttackInfo
{ {
public Actor Attacker; public Actor Attacker;
public WarheadInfo Warhead; public WarheadInfo Warhead;

View File

@@ -10,7 +10,7 @@ namespace OpenRa.Traits
public object Create(Actor self) { return new Chronoshiftable(self); } public object Create(Actor self) { return new Chronoshiftable(self); }
} }
class Chronoshiftable : IResolveOrder, ISpeedModifier, ITick public class Chronoshiftable : IResolveOrder, ISpeedModifier, ITick
{ {
// Return-to-sender logic // Return-to-sender logic
[Sync] [Sync]

View File

@@ -1,13 +1,9 @@
using System; 
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OpenRa.Traits namespace OpenRa.Traits
{ {
class ChronosphereInfo : StatelessTraitInfo<Chronosphere> { } class ChronosphereInfo : StatelessTraitInfo<Chronosphere> { }
class Chronosphere : IResolveOrder public class Chronosphere : IResolveOrder
{ {
public void ResolveOrder(Actor self, Order order) public void ResolveOrder(Actor self, Order order)
{ {

View File

@@ -6,46 +6,5 @@ using OpenRa.Orders;
namespace OpenRa.Traits 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<IMovement>();
var chronosphere = Game.world.Actors.Where(a => a.Owner == order.Subject.Owner && a.traits.Contains<Chronosphere>()).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<Unit>();
var altitude = unit != null ? unit.Altitude : 0;
int2 detonateLocation = self.CenterLocation.ToInt2();
Game.world.AddFrameEndTask(
w => w.Add( new Bullet( self.Info.Traits.Get<AttackBaseInfo>().PrimaryWeapon, detonatedBy.Owner, detonatedBy,
detonateLocation, detonateLocation, altitude, altitude)));
}
}
} }

View File

@@ -17,13 +17,13 @@ namespace OpenRa.Traits
public interface IIssueOrder { Order IssueOrder( Actor self, int2 xy, MouseInput mi, Actor underCursor ); } public interface IIssueOrder { Order IssueOrder( Actor self, int2 xy, MouseInput mi, Actor underCursor ); }
public interface IResolveOrder { void ResolveOrder(Actor self, Order order); } public interface IResolveOrder { void ResolveOrder(Actor self, Order order); }
interface INotifySold { void Sold(Actor self); } public interface INotifySold { void Sold(Actor self); }
interface INotifyDamage { void Damaged(Actor self, AttackInfo e); } public interface INotifyDamage { void Damaged(Actor self, AttackInfo e); }
interface INotifyBuildComplete { void BuildingComplete (Actor self); } public interface INotifyBuildComplete { void BuildingComplete(Actor self); }
interface INotifyProduction { void UnitProduced(Actor self, Actor other); } public interface INotifyProduction { void UnitProduced(Actor self, Actor other); }
interface IAcceptThief { void OnSteal(Actor self, Actor thief); } public interface IAcceptThief { void OnSteal(Actor self, Actor thief); }
interface IAcceptSpy { void OnInfiltrate(Actor self, Actor spy); } public interface IAcceptSpy { void OnInfiltrate(Actor self, Actor spy); }
interface IProducer interface IProducer
{ {
@@ -31,7 +31,7 @@ namespace OpenRa.Traits
void SetPrimaryProducer(Actor self, bool isPrimary); void SetPrimaryProducer(Actor self, bool isPrimary);
} }
public interface IOccupySpace { IEnumerable<int2> OccupiedCells(); } public interface IOccupySpace { IEnumerable<int2> OccupiedCells(); }
interface INotifyAttack { void Attacking(Actor self); } public interface INotifyAttack { void Attacking(Actor self); }
public interface IRenderModifier { IEnumerable<Renderable> ModifyRender(Actor self, IEnumerable<Renderable> r); } public interface IRenderModifier { IEnumerable<Renderable> ModifyRender(Actor self, IEnumerable<Renderable> r); }
public interface IDamageModifier { float GetDamageModifier(); } public interface IDamageModifier { float GetDamageModifier(); }
public interface ISpeedModifier { float GetSpeedModifier(); } public interface ISpeedModifier { float GetSpeedModifier(); }

View File

@@ -11,7 +11,7 @@ namespace OpenRa.Traits
public object Create( Actor self ) { return new Unit( self ); } public object Create( Actor self ) { return new Unit( self ); }
} }
class Unit : INotifyDamage public class Unit : INotifyDamage
{ {
[Sync] [Sync]
public int Facing; public int Facing;

View File

@@ -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<IMovement>();
var chronosphere = Game.world.Actors.Where(a => a.Owner == order.Subject.Owner && a.traits.Contains<Chronosphere>()).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<Unit>();
var altitude = unit != null ? unit.Altitude : 0;
int2 detonateLocation = self.CenterLocation.ToInt2();
Game.world.AddFrameEndTask(
w => w.Add(new Bullet(self.Info.Traits.Get<AttackBaseInfo>().PrimaryWeapon, detonatedBy.Owner, detonatedBy,
detonateLocation, detonateLocation, altitude, altitude)));
}
}
}

View File

@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{2E1F8D8B-AEF5-4BCE-A95C-50223A0C7331}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OpenRa.Mods.Aftermath</RootNamespace>
<AssemblyName>OpenRa.Mods.Aftermath</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="DemoTruck.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenRa.FileFormats\OpenRa.FileFormats.csproj">
<Project>{BDAEAB25-991E-46A7-AF1E-4F0E03358DAA}</Project>
<Name>OpenRa.FileFormats</Name>
</ProjectReference>
<ProjectReference Include="..\OpenRa.Game\OpenRa.Game.csproj">
<Project>{0DFB103F-2962-400F-8C6D-E2C28CCBA633}</Project>
<Name>OpenRa.Game</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<PropertyGroup>
<PostBuildEvent>mkdir "$(SolutionDir)mods/aftermath/"
copy "$(TargetPath)" "$(SolutionDir)mods/aftermath/"</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@@ -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")]

View File

@@ -19,6 +19,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRa.Mods.RA", "OpenRa.Mo
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mods", "Mods", "{F80861C1-DD5C-40A4-94B4-02D96318AE95}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mods", "Mods", "{F80861C1-DD5C-40A4-94B4-02D96318AE95}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRa.Mods.Aftermath", "OpenRa.Mods.Aftermath\OpenRa.Mods.Aftermath.csproj", "{2E1F8D8B-AEF5-4BCE-A95C-50223A0C7331}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug (x86)|Any CPU = Debug (x86)|Any CPU 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.ActiveCfg = Release|Any CPU
{4A8A43B5-A9EF-4ED0-99DD-4BAB10A0DB6E}.Release|Mixed Platforms.Build.0 = 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 {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 EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
GlobalSection(NestedProjects) = preSolution GlobalSection(NestedProjects) = preSolution
{4A8A43B5-A9EF-4ED0-99DD-4BAB10A0DB6E} = {F80861C1-DD5C-40A4-94B4-02D96318AE95} {4A8A43B5-A9EF-4ED0-99DD-4BAB10A0DB6E} = {F80861C1-DD5C-40A4-94B4-02D96318AE95}
{2E1F8D8B-AEF5-4BCE-A95C-50223A0C7331} = {F80861C1-DD5C-40A4-94B4-02D96318AE95}
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

Binary file not shown.