Skip to content

Commit

Permalink
Added amount param to ade/adec and playerid to adec
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiephan committed Jan 25, 2021
1 parent c75f24b commit 1ebdc59
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 9 deletions.
41 changes: 37 additions & 4 deletions (10)trymemode.stormmap/base.stormdata/Modules/LibUnits.galaxy
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,19 @@ void libUNIT_gt_MapInit_Init () {
// Trigger: Add Effects to Camera
//--------------------------------------------------------------------------------------------------
bool libUNIT_gt_AddEffectstoCamera_Func (bool testConds, bool runActions) {
// Variable Declarations
int lv_player;
int lv_i;
int lv_count;

// Automatic Variable Declarations
int auto64624EFA_ae;
const int auto64624EFA_ai = 1;

// Variable Initialization
lv_player = EventPlayer();
lv_count = 1;

// Conditions
if (testConds) {
if (!(((StringWord(EventChatMessage(false), 1) == "adec") || (StringWord(EventChatMessage(false), 1) == "addeffectcamera")))) {
Expand All @@ -168,16 +180,36 @@ bool libUNIT_gt_AddEffectstoCamera_Func (bool testConds, bool runActions) {
}

if ((StringWord(EventChatMessage(false), 2) == null)) {
UIDisplayMessage(PlayerGroupAll(), c_messageAreaDebug, StringToText("Usage: <adec|addeffectcamera> <EffectName>"));
UIDisplayMessage(PlayerGroupAll(), c_messageAreaDebug, StringToText("Usage: <adec|addeffectcamera> <EffectName> [amount] [playerId]"));
}
else {
if ((CatalogEntryIsValid(c_gameCatalogEffect, (StringWord(EventChatMessage(false), 2))) == false)) {
UIDisplayMessage(PlayerGroupAll(), c_messageAreaDebug, StringToText((("Error: Effect \"" + StringWord(EventChatMessage(false), 2)) + "\" does not exist.")));
return true;
}

PlayerCreateEffectPoint(EventPlayer(), (StringWord(EventChatMessage(false), 2)), CameraGetTarget(EventPlayer()));
UIDisplayMessage(PlayerGroupAll(), c_messageAreaDebug, StringToText(("Added Effect \"" + (StringWord(EventChatMessage(false), 2) + ("\" on camera location " + libNtve_gf_ConvertPointToString(CameraGetTarget(EventPlayer())))))));
lv_count = StringToInt(StringWord(EventChatMessage(false), 3));
if ((lv_count <= 0)) {
lv_count = 1;
}

lv_player = StringToInt(StringWord(EventChatMessage(false), 4));
if ((StringWord(EventChatMessage(false), 4) == "")) {
lv_player = EventPlayer();
}
else {
if ((lv_player < 0)) {
lv_player = EventPlayer();
UIDisplayMessage(PlayerGroupAll(), c_messageAreaDebug, StringToText(("Warn: Invalid Player ID \"" + (StringWord(EventChatMessage(false), 4) + ("\". Player Id set to Player " + IntToString(EventPlayer()))))));
}

}
auto64624EFA_ae = lv_count;
lv_i = 1;
for ( ; ( (auto64624EFA_ai >= 0 && lv_i <= auto64624EFA_ae) || (auto64624EFA_ai < 0 && lv_i >= auto64624EFA_ae) ) ; lv_i += auto64624EFA_ai ) {
PlayerCreateEffectPoint(lv_player, (StringWord(EventChatMessage(false), 2)), CameraGetTarget(EventPlayer()));
}
UIDisplayMessage(PlayerGroupAll(), c_messageAreaDebug, StringToText(((("Added " + IntToString(lv_count)) + " Effects \"") + (StringWord(EventChatMessage(false), 2) + ((("\" with the effect owner of Player " + IntToString(lv_player)) + " on camera location ") + libNtve_gf_ConvertPointToString(CameraGetTarget(EventPlayer())))))));
}
return true;
}
Expand Down Expand Up @@ -245,6 +277,7 @@ bool libUNIT_gt_AddEffects_Func (bool testConds, bool runActions) {
const int auto82B5A334_ai = 1;

// Variable Initialization
lv_count = 1;

// Conditions
if (testConds) {
Expand All @@ -268,7 +301,7 @@ bool libUNIT_gt_AddEffects_Func (bool testConds, bool runActions) {
}

lv_count = StringToInt(StringWord(EventChatMessage(false), 3));
if ((lv_count == 0)) {
if ((lv_count <= 0)) {
lv_count = 1;
}

Expand Down
Binary file not shown.
35 changes: 34 additions & 1 deletion (10)trymemode.stormmap/base.stormdata/Modules/doc.json
Original file line number Diff line number Diff line change
Expand Up @@ -793,16 +793,27 @@
"required": true,
"description": "Defines the effect id to be added to selected unit(s).",
"type": "string"
},
{
"name": "amount",
"required": false,
"description": "Defines the amount of effects to be added to the units",
"type": "integer",
"defaultValue": "1"
}
],
"examples": [
{
"command": "{command} StormSuicide",
"description": "Make the unit \"suicide\" a.k.a kill the unit"
"description": "Make all selected units \"suicide\" a.k.a kill the unit"
},
{
"command": "{shortCommand} MedivhPolyBombPersistent",
"description": "Make all selected units affect by Medivh's Polybomb"
},
{
"command": "{shortCommand} GreymaneCursedBulletDamagePercentDamage 5",
"description": "Make all selected units hit by Greymane's Cursed Bullet (damage) 5 times in a row."
}
]
},
Expand All @@ -817,6 +828,20 @@
"required": true,
"description": "Defines the effect id to be added to the center of the camera.",
"type": "string"
},
{
"name": "amount",
"required": false,
"description": "Defines the amount of effects to be added to the center of the camera.",
"type": "integer",
"defaultValue": "1"
},
{
"name": "PlayerID",
"required": false,
"description": "The Player ID for the effect owner",
"type": "integer",
"defaultValue": "The player id of whoever used this command."
}
],
"examples": [
Expand All @@ -827,6 +852,14 @@
{
"command": "{shortCommand} UnderworldBossRootsCreatePersistent",
"description": "Add Haunted Mines's boss root animation to camera location"
},
{
"command": "{command} NecromancerRaiseSkeletonCreationPersistent 10",
"description": "Spawn 10 Xul's Sekelton to camera location"
},
{
"command": "{shortCommand} NecromancerRaiseSkeletonCreationPersistent 10 6",
"description": "Spawn 10 Xul's Sekelton to camera location with the effect owner of Player 6"
}
]
},
Expand Down
29 changes: 25 additions & 4 deletions 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, 23 Jan 2021 03:49:13 GMT)*</sup>
<sup>*(Generated from [doc.json](./(10)trymemode.stormmap/base.stormdata/Modules/doc.json) at Mon, 25 Jan 2021 01:25:32 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 @@ -787,7 +787,7 @@ Add a behavior to selected unit(s). Which are generally from `<CBehavior*>`, suc

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

## (`addeffect` | `ade`) `<EffectId>`
## (`addeffect` | `ade`) `<EffectId>` `[amount]`
<a name="cmd-addeffect-description"></a>

#### ✏ Description:
Expand All @@ -800,13 +800,20 @@ Add an Effect to selected unit(s). Which are generally from `<CEffect*>`, such a
Required: true
Type: string
Usage: Defines the effect id to be added to selected unit(s).
[amount]
Required: false
Type: integer
Usage: Defines the amount of effects to be added to the units
Default: 1
<a name="cmd-addeffect-examples"></a>

#### 🔧 Examples:
> addeffect StormSuicide
(Make the unit "suicide" a.k.a kill the unit)
(Make all selected units "suicide" a.k.a kill the unit)
> ade MedivhPolyBombPersistent
(Make all selected units affect by Medivh's Polybomb)
> ade GreymaneCursedBulletDamagePercentDamage 5
(Make all selected units hit by Greymane's Cursed Bullet (damage) 5 times in a row.)
<a name="cmd-addeffect-uiAvailability"></a>

#### 🖼 UI Availability:
Expand All @@ -820,7 +827,7 @@ Add an Effect to selected unit(s). Which are generally from `<CEffect*>`, such a

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

## (`addeffectcamera` | `adec`) `<EffectId>`
## (`addeffectcamera` | `adec`) `<EffectId>` `[amount]` `[PlayerID]`
<a name="cmd-addeffectcamera-description"></a>

#### ✏ Description:
Expand All @@ -833,13 +840,27 @@ Add an Effect to the center of the camera. Which are generally from `<CEffect*>`
Required: true
Type: string
Usage: Defines the effect id to be added to the center of the camera.
[amount]
Required: false
Type: integer
Usage: Defines the amount of effects to be added to the center of the camera.
Default: 1
[PlayerID]
Required: false
Type: integer
Usage: The Player ID for the effect owner
Default: The player id of whoever used this command.
<a name="cmd-addeffectcamera-examples"></a>

#### 🔧 Examples:
> addeffectcamera DropUnderworldPowerupPersistent
(Add some Haunted Mines Skulls to camera location)
> adec UnderworldBossRootsCreatePersistent
(Add Haunted Mines's boss root animation to camera location)
> addeffectcamera NecromancerRaiseSkeletonCreationPersistent 10
(Spawn 10 Xul's Sekelton to camera location)
> adec NecromancerRaiseSkeletonCreationPersistent 10 6
(Spawn 10 Xul's Sekelton to camera location with the effect owner of Player 6)
<a name="cmd-addeffectcamera-uiAvailability"></a>

#### 🖼 UI Availability:
Expand Down

0 comments on commit 1ebdc59

Please sign in to comment.