Some trait info moved from GlobalDefaults to sane places
This commit is contained in:
@@ -94,7 +94,6 @@
|
||||
<Compile Include="Effects\Smoke.cs" />
|
||||
<Compile Include="Effects\TeslaZap.cs" />
|
||||
<Compile Include="Exts.cs" />
|
||||
<Compile Include="GameRules\GeneralInfo.cs" />
|
||||
<Compile Include="GameRules\ActorInfo.cs" />
|
||||
<Compile Include="GameRules\TechTree.cs" />
|
||||
<Compile Include="GameRules\UserSettings.cs" />
|
||||
|
||||
@@ -27,6 +27,8 @@ namespace OpenRA.Traits
|
||||
{
|
||||
class ProductionQueueInfo : ITraitInfo
|
||||
{
|
||||
public readonly float BuildSpeed = 0.4f;
|
||||
public readonly int LowPowerSlowdown = 3;
|
||||
public object Create(Actor self) { return new ProductionQueue(self); }
|
||||
}
|
||||
|
||||
@@ -57,7 +59,7 @@ namespace OpenRA.Traits
|
||||
var unit = Rules.Info[order.TargetString];
|
||||
var ui = unit.Traits.Get<BuildableInfo>();
|
||||
var time = ui.Cost
|
||||
* self.World.Defaults.BuildSpeed /* todo: country-specific build speed bonus */
|
||||
* self.Owner.PlayerActor.Info.Traits.Get<ProductionQueueInfo>().BuildSpeed /* todo: country-specific build speed bonus */
|
||||
* (25 * 60) /* frames per min */ /* todo: build acceleration, if we do that */
|
||||
/ 1000;
|
||||
|
||||
@@ -226,14 +228,13 @@ namespace OpenRA.Traits
|
||||
if (player.GetPowerState() != PowerState.Normal)
|
||||
{
|
||||
if (--slowdown <= 0)
|
||||
slowdown = player.World.Defaults.LowPowerSlowdown;
|
||||
slowdown = player.PlayerActor.Info.Traits.Get<ProductionQueueInfo>().LowPowerSlowdown;
|
||||
else
|
||||
return;
|
||||
}
|
||||
|
||||
var costThisFrame = RemainingCost / RemainingTime;
|
||||
if (costThisFrame != 0 && !player.TakeCash(costThisFrame)) return;
|
||||
|
||||
RemainingCost -= costThisFrame;
|
||||
RemainingTime -= 1;
|
||||
if (RemainingTime > 0) return;
|
||||
|
||||
@@ -42,7 +42,6 @@ namespace OpenRA.Traits
|
||||
public readonly int Incoming = 10;
|
||||
|
||||
/* Income & Production */
|
||||
public readonly float BuildSpeed = 0.4f;
|
||||
public readonly float BuildupTime = 0.06f;
|
||||
public readonly float OreTruckRate = 1;
|
||||
public readonly bool SeparateAircraft = false;
|
||||
@@ -75,12 +74,9 @@ namespace OpenRA.Traits
|
||||
public readonly int LZScanRadius = 16;
|
||||
public readonly bool MineAware = true;
|
||||
public readonly float Stray = 2.0f;
|
||||
public readonly float SubmergeDelay = 0.02f;
|
||||
public readonly float SuspendDelay = 2.0f;
|
||||
public readonly int SuspendPriority = 20;
|
||||
public readonly float TeamDelay = 0.6f;
|
||||
|
||||
public readonly int LowPowerSlowdown = 3;
|
||||
}
|
||||
|
||||
public class GlobalDefaults {}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
Player:
|
||||
ProductionQueue:
|
||||
BuildSpeed: .4
|
||||
LowPowerSlowdown: 3
|
||||
PlaceBuilding:
|
||||
NukePower:
|
||||
Image: atomicnh
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
Player:
|
||||
ProductionQueue:
|
||||
BuildSpeed: .4
|
||||
LowPowerSlowdown: 3
|
||||
PlaceBuilding:
|
||||
GpsPower:
|
||||
Image: gpssicon
|
||||
|
||||
Reference in New Issue
Block a user