Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ActorSpawnManager.SpawnInterval supports 1 or 2 values #18794

Merged

Conversation

phrohdoh
Copy link
Member

If merged this will close #18788.

Testcase:

diff --git a/mods/d2k/rules/world.yaml b/mods/d2k/rules/world.yaml
index 2029bd603..3e5d7a01b 100644
--- a/mods/d2k/rules/world.yaml
+++ b/mods/d2k/rules/world.yaml
@@ -133,6 +133,7 @@ World:
                ProductionPaletteWidget: PRODUCTION_PALETTE
        ActorSpawnManager:
                Actors: sandworm
+               SpawnInterval: 2000, 8000
        CrateSpawner:
                Minimum: 0
                Maximum: 2

@phrohdoh phrohdoh force-pushed the feat/actor-spawn-manager_interval-range branch from c0ec777 to 361f0fe Compare October 31, 2020 12:29
@@ -25,8 +25,8 @@ public class ActorSpawnManagerInfo : ConditionalTraitInfo, Requires<MapCreepsInf
[Desc("Maximum number of actors.")]
public readonly int Maximum = 4;

[Desc("Time (in ticks) between actor spawn.")]
public readonly int SpawnInterval = 6000;
[Desc("Time (in ticks) between actor spawn. Supports 1 or 2 values.\nIf 2 values are provided they are used as a range from which a value is randomly selected.")]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The \n is not strictly necessary, can remove it if we want.

@phrohdoh phrohdoh force-pushed the feat/actor-spawn-manager_interval-range branch from 361f0fe to c89661f Compare October 31, 2020 13:56
@phrohdoh phrohdoh force-pushed the feat/actor-spawn-manager_interval-range branch from c89661f to 1ef0eeb Compare October 31, 2020 14:00
Copy link
Member

@abcdefg30 abcdefg30 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes lgtm otherwise, and worms spawn as expected.

OpenRA.Mods.Common/Traits/World/ActorSpawnManager.cs Outdated Show resolved Hide resolved
Providing 2 values creates a range from which a value is randomly selected.
@phrohdoh phrohdoh force-pushed the feat/actor-spawn-manager_interval-range branch from 1ef0eeb to ffed034 Compare October 31, 2020 15:36
Copy link
Member

@pchote pchote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

@pchote pchote merged commit 2671e40 into OpenRA:bleed Dec 24, 2020
@phrohdoh phrohdoh deleted the feat/actor-spawn-manager_interval-range branch December 24, 2020 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change the interval of ActorSpawnManager from single number to a two value interval.
3 participants