Skip to content

Commit

Permalink
Added Minion Wave Interval Command
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiephan committed Dec 30, 2020
1 parent 61f00c8 commit 4d2bd1b
Show file tree
Hide file tree
Showing 4 changed files with 128 additions and 2 deletions.
52 changes: 52 additions & 0 deletions (10)trymemode.stormmap/base.stormdata/Modules/LibUtilities.galaxy
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ trigger libUTIL_gt_SetCameraObject;
trigger libUTIL_gt_ResetCameraObject;
trigger libUTIL_gt_ForceRunTrigger;
trigger libUTIL_gt_ToggleACTS;
trigger libUTIL_gt_MinionWaveInterval;

// Library Initialization
void libUTIL_InitVariables ();
Expand Down Expand Up @@ -544,6 +545,56 @@ void libUTIL_gt_ToggleACTS_Init () {
TriggerAddEventChatMessage(libUTIL_gt_ToggleACTS, c_playerAny, "alliancecontrolteamselection", true);
}

//--------------------------------------------------------------------------------------------------
// Trigger: Minion Wave Interval
//--------------------------------------------------------------------------------------------------
bool libUTIL_gt_MinionWaveInterval_Func (bool testConds, bool runActions) {
// Variable Declarations
trigger lv_minionSpawnTrigger;
fixed lv_seconds;

// Automatic Variable Declarations
// Variable Initialization
lv_seconds = 30.0;

// Conditions
if (testConds) {
if (!(((StringWord(EventChatMessage(false), 1) == "mwi") || (StringWord(EventChatMessage(false), 1) == "minonwaveinterval")))) {
return false;
}
}

// Actions
if (!runActions) {
return true;
}

if ((StringWord(EventChatMessage(false), 2) == null)) {
lv_seconds = libCore_gv_bALMinionWaveInterval;
UIDisplayMessage(PlayerGroupAll(), c_messageAreaDebug, StringToText(("Minion Wave Interval is: " + FixedToString(lv_seconds, c_fixedPrecisionAny))));
}
else {
lv_seconds = StringToFixed(StringWord(EventChatMessage(false), 2));
if ((lv_seconds > 0.0)) {
libCore_gv_bALMinionWaveInterval = lv_seconds;
libGame_gf_MinionStartStopMinionSpawnCycle(false);
libGame_gf_MinionStartStopMinionSpawnCycle(true);
UIDisplayMessage(PlayerGroupAll(), c_messageAreaDebug, StringToText(("Minion Wave Interval set to: " + FixedToString(lv_seconds, c_fixedPrecisionAny))));
}
else {
UIDisplayMessage(PlayerGroupAll(), c_messageAreaDebug, StringToText(("Invalid Interval Value: " + StringWord(EventChatMessage(false), 2))));
}
}
return true;
}

//--------------------------------------------------------------------------------------------------
void libUTIL_gt_MinionWaveInterval_Init () {
libUTIL_gt_MinionWaveInterval = TriggerCreate("libUTIL_gt_MinionWaveInterval_Func");
TriggerAddEventChatMessage(libUTIL_gt_MinionWaveInterval, c_playerAny, "mwi", false);
TriggerAddEventChatMessage(libUTIL_gt_MinionWaveInterval, c_playerAny, "minionwaveinterval", false);
}

void libUTIL_InitTriggers () {
libUTIL_gt_MapInit_Init();
libUTIL_gt_ClearTextMessage_Init();
Expand All @@ -560,6 +611,7 @@ void libUTIL_InitTriggers () {
libUTIL_gt_ResetCameraObject_Init();
libUTIL_gt_ForceRunTrigger_Init();
libUTIL_gt_ToggleACTS_Init();
libUTIL_gt_MinionWaveInterval_Init();
}

//--------------------------------------------------------------------------------------------------
Expand Down
Binary file not shown.
36 changes: 35 additions & 1 deletion (10)trymemode.stormmap/base.stormdata/Modules/doc.json
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,41 @@
"description": "Toggle Alliance Control + Multi-Selection"
}
]
},
{
"shortCommand": "mwi",
"command": "minionwaveinterval",
"description": [
"Get or Set the minion wave interval (Times to spawn a minion. Usually 30s but for 15s in ARAM.)"
],
"uiAvailable": false,
"parameters": [
{
"name": "seconds",
"required": false,
"description": "Defines interval for minion wave to spawn",
"defaultValue": "(The map's original interval, usually 30 but 15 for ARAMs)",
"type": "float"
}
],
"examples": [
{
"command": "mwi",
"description": "Get the minion wave interval"
},
{
"command": "minionwaveinterval",
"description": "Get the minion wave interval"
},
{
"command": "mwi 0.0625",
"description": "Set the minion wave to spawn every 0.0625 seconds (each game loop)"
},
{
"command": "mwi 100",
"description": "Set the minion wave to spawn every 100 seconds."
}
]
}
]
},
Expand Down Expand Up @@ -1382,7 +1417,6 @@
" - Some of the fields are READ-ONLY, meaning it cannot be modified, e.g `Unit,HeroChromie,PlaneArray[Air]` (Unable to make Chromie become an air unit like Medivh Raven). This would require an override to the XML instead (see [MODDING.md](MODDING.md)).",
" - The catalog modification is applied after parental inheritance, meaning that it is not possible to modify a parent (`parent=\"xxx\"`) for its effect to apply to all child catalogs. You must need to do it on each of the child catalogs.",
" - It is not possible \"create\" a value that does not exist after the map loaded. Meaning it can only modify value based on existed ones (after inherit attributes from parent)"

],
"uiAvailable": false,
"parameters": [
Expand Down
42 changes: 41 additions & 1 deletion USAGE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<a name="meta-top"></a>

# Usage
<sup>*(Generated from [doc.json](./(10)trymemode.stormmap/base.stormdata/Modules/doc.json) at Sat, 26 Dec 2020 01:59:03 GMT)*</sup>
<sup>*(Generated from [doc.json](./(10)trymemode.stormmap/base.stormdata/Modules/doc.json) at Wed, 30 Dec 2020 02:59:36 GMT)*</sup>

Generally, most of the functionalities are using chat commands. Simply type the commands in the chat box (like how you would normally chat with teammates).
>Note: Remember to either use allies or all chat channel when try to use the commands. Public chat channels and Private Messages (PM) does not work.
Expand Down Expand Up @@ -36,6 +36,8 @@ Some of the commands have an UI counterpart implemented, which will display a me

- 💭 [Command: `forceruntrigger`](#cmd-forceruntrigger)

- 💭 [Command: `minionwaveinterval`](#cmd-minionwaveinterval)

- 💭 [Command: `resetcameraobject`](#cmd-resetcameraobject)

- 💭 [Command: `restartgame`](#cmd-restartgame)
Expand Down Expand Up @@ -282,6 +284,44 @@ Force to Run a Trigger created by `TriggerCreate()` with ignoring conditions and



[\[Return to Table of Contents 🧾\]](#meta-toc)

[\[Return to Top ⬆\]](#meta-top)

<a name="cmd-minionwaveinterval"></a>

## (`minionwaveinterval` | `mwi`) `[seconds]`
<a name="cmd-minionwaveinterval-description"></a>

#### ✏ Description:
Get or Set the minion wave interval (Times to spawn a minion. Usually 30s but for 15s in ARAM.)

<a name="cmd-minionwaveinterval-parameters"></a>

#### ⚙ Parameters:
[seconds]
Required: false
Type: float
Usage: Defines interval for minion wave to spawn
Default: (The map's original interval, usually 30 but 15 for ARAMs)
<a name="cmd-minionwaveinterval-examples"></a>

#### 🔧 Examples:
> mwi
(Get the minion wave interval)
> minionwaveinterval
(Get the minion wave interval)
> mwi 0.0625
(Set the minion wave to spawn every 0.0625 seconds (each game loop))
> mwi 100
(Set the minion wave to spawn every 100 seconds.)
<a name="cmd-minionwaveinterval-uiAvailability"></a>

#### 🖼 UI Availability:
-**Not Implemented**



[\[Return to Table of Contents 🧾\]](#meta-toc)

[\[Return to Top ⬆\]](#meta-top)
Expand Down

0 comments on commit 4d2bd1b

Please sign in to comment.