Load [Aftermath] setttings from aftrmath.ini; use ChronoTankDuration in ChronoshiftDeploy

This commit is contained in:
pchote
2009-12-18 16:41:28 -08:00
parent cdea6b642b
commit 3d41d35226
3 changed files with 11 additions and 4 deletions

View File

@@ -18,6 +18,7 @@ namespace OpenRa.Game
public static InfoLoader<ProjectileInfo> ProjectileInfo; public static InfoLoader<ProjectileInfo> ProjectileInfo;
public static InfoLoader<VoiceInfo> VoiceInfo; public static InfoLoader<VoiceInfo> VoiceInfo;
public static GeneralInfo General; public static GeneralInfo General;
public static AftermathInfo Aftermath;
public static TechTree TechTree; public static TechTree TechTree;
public static Map Map; public static Map Map;
public static TileSet TileSet; public static TileSet TileSet;
@@ -46,6 +47,9 @@ namespace OpenRa.Game
General = new GeneralInfo(); General = new GeneralInfo();
FieldLoader.Load(General, AllRules.GetSection("General")); FieldLoader.Load(General, AllRules.GetSection("General"));
Aftermath = new AftermathInfo();
FieldLoader.Load(Aftermath, AllRules.GetSection("Aftermath"));
LoadCategories( LoadCategories(
"Building", "Building",
"Defense", "Defense",

View File

@@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion> <ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion> <SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{0DFB103F-2962-400F-8C6D-E2C28CCBA633}</ProjectGuid> <ProjectGuid>{0DFB103F-2962-400F-8C6D-E2C28CCBA633}</ProjectGuid>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
@@ -85,6 +85,7 @@
<Compile Include="Effects\TeslaZap.cs" /> <Compile Include="Effects\TeslaZap.cs" />
<Compile Include="Exts.cs" /> <Compile Include="Exts.cs" />
<Compile Include="GameRules\ActorInfo.cs" /> <Compile Include="GameRules\ActorInfo.cs" />
<Compile Include="GameRules\AftermathInfo.cs" />
<Compile Include="GameRules\GeneralInfo.cs" /> <Compile Include="GameRules\GeneralInfo.cs" />
<Compile Include="GameRules\TechTree.cs" /> <Compile Include="GameRules\TechTree.cs" />
<Compile Include="GameRules\VoiceInfo.cs" /> <Compile Include="GameRules\VoiceInfo.cs" />
@@ -163,7 +164,9 @@
<Compile Include="Traits\AttackTurreted.cs" /> <Compile Include="Traits\AttackTurreted.cs" />
<Compile Include="Traits\AutoTarget.cs" /> <Compile Include="Traits\AutoTarget.cs" />
<Compile Include="Traits\Building.cs" /> <Compile Include="Traits\Building.cs" />
<Compile Include="Traits\Explodes.cs" /> <Compile Include="Traits\ChronoshiftDeploy.cs" /> <Compile Include="Traits\Harvester.cs" /> <Compile Include="Traits\Explodes.cs" />
<Compile Include="Traits\ChronoshiftDeploy.cs" />
<Compile Include="Traits\Harvester.cs" />
<Compile Include="Traits\Helicopter.cs" /> <Compile Include="Traits\Helicopter.cs" />
<Compile Include="Traits\ProductionQueue.cs" /> <Compile Include="Traits\ProductionQueue.cs" />
<Compile Include="Traits\RenderBuildingCharge.cs" /> <Compile Include="Traits\RenderBuildingCharge.cs" />

View File

@@ -6,8 +6,8 @@ namespace OpenRa.Game.Traits
{ {
public ChronoshiftDeploy(Actor self) { } public ChronoshiftDeploy(Actor self) { }
bool chronoshiftActive = false; // Is the chronoshift engine active? bool chronoshiftActive = false; // Is the chronoshift engine active?
const int chargeTime = 100; // How many frames between uses? int remainingChargeTime = 0; // How long until we can chronoshift again?
int remainingChargeTime = 0; int chargeTime = (int)(Rules.Aftermath.ChronoTankDuration * 60 * 25); // How long between shifts?
public void Tick(Actor self) public void Tick(Actor self)
{ {