Rename GiveMcvCrateAction to GiveBaseBuilderCrateAction.
This commit is contained in:
committed by
Pavel Penev
parent
c916a00624
commit
37afd6094e
@@ -14,18 +14,18 @@ using System.Linq;
|
|||||||
namespace OpenRA.Mods.Common.Traits
|
namespace OpenRA.Mods.Common.Traits
|
||||||
{
|
{
|
||||||
[Desc("Spawns units when collected.", "Adjust selection shares when player has no base.")]
|
[Desc("Spawns units when collected.", "Adjust selection shares when player has no base.")]
|
||||||
class GiveMcvCrateActionInfo : GiveUnitCrateActionInfo
|
class GiveBaseBuilderCrateActionInfo : GiveUnitCrateActionInfo
|
||||||
{
|
{
|
||||||
[Desc("The selection shares to use if the collector has no base.")]
|
[Desc("The selection shares to use if the collector has no actor with `" + nameof(BaseBuilding) + ".")]
|
||||||
public readonly int NoBaseSelectionShares = 1000;
|
public readonly int NoBaseSelectionShares = 1000;
|
||||||
|
|
||||||
public override object Create(ActorInitializer init) { return new GiveMcvCrateAction(init.Self, this); }
|
public override object Create(ActorInitializer init) { return new GiveBaseBuilderCrateAction(init.Self, this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
class GiveMcvCrateAction : GiveUnitCrateAction
|
class GiveBaseBuilderCrateAction : GiveUnitCrateAction
|
||||||
{
|
{
|
||||||
readonly GiveMcvCrateActionInfo info;
|
readonly GiveBaseBuilderCrateActionInfo info;
|
||||||
public GiveMcvCrateAction(Actor self, GiveMcvCrateActionInfo info)
|
public GiveBaseBuilderCrateAction(Actor self, GiveBaseBuilderCrateActionInfo info)
|
||||||
: base(self, info)
|
: base(self, info)
|
||||||
{
|
{
|
||||||
this.info = info;
|
this.info = info;
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
#region Copyright & License Information
|
||||||
|
/*
|
||||||
|
* Copyright (c) The OpenRA Developers and Contributors
|
||||||
|
* This file is part of OpenRA, which is free software. It is made
|
||||||
|
* available to you 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. For more
|
||||||
|
* information, see COPYING.
|
||||||
|
*/
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace OpenRA.Mods.Common.UpdateRules.Rules
|
||||||
|
{
|
||||||
|
public class RenameMcvCrateAction : UpdateRule
|
||||||
|
{
|
||||||
|
public override string Name => "Rename 'GiveMcvCrateAction' to 'GiveBaseBuilderCrateAction'.";
|
||||||
|
|
||||||
|
public override string Description => "The 'GiveMcvCrateAction' has been renamed to 'GiveBaseBuilderCrateAction'.";
|
||||||
|
|
||||||
|
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
|
||||||
|
{
|
||||||
|
foreach (var node in actorNode.ChildrenMatching("GiveMcvCrateAction"))
|
||||||
|
node.RenameKey("GiveBaseBuilderCrateAction");
|
||||||
|
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -94,6 +94,7 @@ namespace OpenRA.Mods.Common.UpdateRules
|
|||||||
new RenameEngineerRepair(),
|
new RenameEngineerRepair(),
|
||||||
new ProductionTabsWidgetAddTabButtonCollection(),
|
new ProductionTabsWidgetAddTabButtonCollection(),
|
||||||
new RemoveTSRefinery(),
|
new RemoveTSRefinery(),
|
||||||
|
new RenameMcvCrateAction(),
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ CRATE:
|
|||||||
SelectionShares: 5
|
SelectionShares: 5
|
||||||
Sequence: cloak
|
Sequence: cloak
|
||||||
Condition: cloak-crate-collected
|
Condition: cloak-crate-collected
|
||||||
GiveMcvCrateAction:
|
GiveBaseBuilderCrateAction:
|
||||||
SelectionShares: 0
|
SelectionShares: 0
|
||||||
NoBaseSelectionShares: 50
|
NoBaseSelectionShares: 50
|
||||||
Units: mcv
|
Units: mcv
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ crate:
|
|||||||
Units: deviator
|
Units: deviator
|
||||||
ValidFactions: ordos
|
ValidFactions: ordos
|
||||||
Prerequisites: techlevel.high, heavy_factory, research_centre
|
Prerequisites: techlevel.high, heavy_factory, research_centre
|
||||||
GiveMcvCrateAction:
|
GiveBaseBuilderCrateAction:
|
||||||
SelectionShares: 0
|
SelectionShares: 0
|
||||||
NoBaseSelectionShares: 9001
|
NoBaseSelectionShares: 9001
|
||||||
Units: mcv
|
Units: mcv
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ FORTCRATE:
|
|||||||
ExplodeCrateAction@bigboom:
|
ExplodeCrateAction@bigboom:
|
||||||
Weapon: SCUD
|
Weapon: SCUD
|
||||||
SelectionShares: 5
|
SelectionShares: 5
|
||||||
GiveMcvCrateAction:
|
GiveBaseBuilderCrateAction:
|
||||||
SelectionShares: 0
|
SelectionShares: 0
|
||||||
NoBaseSelectionShares: 1000
|
NoBaseSelectionShares: 1000
|
||||||
Units: mobiletent
|
Units: mobiletent
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ CRATE:
|
|||||||
MaxAmount: 5
|
MaxAmount: 5
|
||||||
MinAmount: 1
|
MinAmount: 1
|
||||||
MaxDuplicateValue: 1500
|
MaxDuplicateValue: 1500
|
||||||
GiveMcvCrateAction:
|
GiveBaseBuilderCrateAction:
|
||||||
SelectionShares: 0
|
SelectionShares: 0
|
||||||
NoBaseSelectionShares: 100
|
NoBaseSelectionShares: 100
|
||||||
Units: mcv
|
Units: mcv
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ CRATE:
|
|||||||
RevealMapCrateAction:
|
RevealMapCrateAction:
|
||||||
SelectionShares: 1
|
SelectionShares: 1
|
||||||
Sequence: reveal-map
|
Sequence: reveal-map
|
||||||
GiveMcvCrateAction:
|
GiveBaseBuilderCrateAction:
|
||||||
SelectionShares: 0
|
SelectionShares: 0
|
||||||
NoBaseSelectionShares: 100
|
NoBaseSelectionShares: 100
|
||||||
Units: mcv
|
Units: mcv
|
||||||
|
|||||||
Reference in New Issue
Block a user