Everything is now OpenRA, not OpenRa

This commit is contained in:
alzeih
2010-02-27 21:10:22 +13:00
parent 11b926a422
commit 7881deca30
299 changed files with 26919 additions and 21 deletions

View File

@@ -0,0 +1,78 @@
<?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>{2881135D-4D62-493E-8F83-5EEE92CCC6BE}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OpenRA.Mods.Cnc</RootNamespace>
<AssemblyName>OpenRA.Mods.Cnc</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="ProductionAirdrop.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TiberiumRefinery.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>
<ProjectReference Include="..\OpenRA.Mods.RA\OpenRA.Mods.RA.csproj">
<Project>{4A8A43B5-A9EF-4ED0-99DD-4BAB10A0DB6E}</Project>
<Name>OpenRA.Mods.RA</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/cnc/"
copy "$(TargetPath)" "$(SolutionDir)mods/cnc/"</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,84 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using OpenRA.GameRules;
using OpenRA.Traits;
using OpenRA.Traits.Activities;
namespace OpenRA.Mods.Cnc
{
public class ProductionAirdropInfo : ProductionInfo
{
public override object Create(Actor self) { return new ProductionAirdrop(self); }
}
class ProductionAirdrop : Production
{
public ProductionAirdrop(Actor self) : base(self) { }
public override bool Produce( Actor self, ActorInfo producee )
{
var owner = self.Owner;
// Start beyond the edge of the map, to give a finite delay, and ability to land when AFLD is on map edge
var startPos = new int2(owner.World.Map.XOffset + owner.World.Map.Width+15, self.Location.Y);
var endPos = new int2(owner.World.Map.XOffset, self.Location.Y);
var unloadOffset = new int2(1,1);
var exitOffset = new int2(3,1);
var rp = self.traits.GetOrDefault<RallyPoint>();
owner.World.AddFrameEndTask(w =>
{
var a = w.CreateActor("C17", startPos, owner);
var cargo = a.traits.Get<Cargo>();
var newUnit = new Actor(self.World, producee.Name, new int2(0, 0), self.Owner);
cargo.Load(a, newUnit);
a.CancelActivity();
a.QueueActivity(new Land(self));
a.QueueActivity(new CallFunc(() =>
{
if (self.IsDead)
return;
var actor = cargo.Unload(self);
self.World.AddFrameEndTask(ww =>
{
ww.Add(actor);
actor.traits.Get<Mobile>().TeleportTo(actor, self.Location + unloadOffset);
newUnit.traits.Get<Unit>().Facing = 192;
actor.CancelActivity();
actor.QueueActivity(new Move(self.Location + exitOffset, self));
actor.QueueActivity(new Move(rp.rallyPoint, 0));
foreach (var t in self.traits.WithInterface<INotifyProduction>())
t.UnitProduced(self, actor);
});
}));
a.QueueActivity(new Fly(endPos));
a.QueueActivity(new RemoveSelf());
});
return true;
}
}
}

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.Cnc")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OpenRA.Mods.Cnc")]
[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("3b31edcf-34e4-4a58-8130-88b15b046d10")]
// 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

@@ -0,0 +1,61 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using OpenRA.Traits;
using OpenRA.Traits.Activities;
namespace OpenRA.Mods.Cnc
{
class TiberiumRefineryInfo : ITraitInfo
{
public object Create(Actor self) { return new TiberiumRefinery(self); }
}
class TiberiumRefinery : IAcceptOre
{
Actor self;
public TiberiumRefinery(Actor self)
{
this.self = self;
self.World.AddFrameEndTask(
w =>
{ /* create the free harvester! */
var harvester = w.CreateActor("harv", self.Location + new int2(0, 2), self.Owner);
var unit = harvester.traits.Get<Unit>();
unit.Facing = 64;
harvester.QueueActivity(new Harvest());
});
}
public int2 DeliverOffset { get { return new int2(0, 2); } }
public void OnDock(Actor harv, DeliverOre dockOrder)
{
// Todo: need to be careful about cancellation and multiple harvs
harv.QueueActivity(new Move(self.Location + new int2(1,1), self));
harv.QueueActivity(new Turn(96));
harv.QueueActivity( new CallFunc( () =>
self.traits.Get<RenderBuilding>().PlayCustomAnimThen(self, "active", () => {
harv.traits.Get<Harvester>().Deliver(harv, self);
harv.QueueActivity(new Move(self.Location + DeliverOffset, self));
harv.QueueActivity(new Harvest());
})));
}
}
}