diff --git a/(10)trymemode.stormmap/base.stormdata/Modules/LibUnits.galaxy b/(10)trymemode.stormmap/base.stormdata/Modules/LibUnits.galaxy index f0e419d..3adbb5e 100644 --- a/(10)trymemode.stormmap/base.stormdata/Modules/LibUnits.galaxy +++ b/(10)trymemode.stormmap/base.stormdata/Modules/LibUnits.galaxy @@ -1339,6 +1339,7 @@ bool libUNIT_gt_ModifyUnitProperty_Func (bool testConds, bool runActions) { int lv_i; // Automatic Variable Declarations + string autoA4188EC6_val; int auto4B2220AA_ae; const int auto4B2220AA_ai = 1; int auto5C02B8F9_ae; @@ -1362,13 +1363,85 @@ bool libUNIT_gt_ModifyUnitProperty_Func (bool testConds, bool runActions) { return true; } - lv_type = StringToInt(StringWord(EventChatMessage(false), 2)); + autoA4188EC6_val = StringCase(StringWord(EventChatMessage(false), 2), false); + if (autoA4188EC6_val == "life") { + lv_type = c_unitPropLife; + } + else if (autoA4188EC6_val == "lifepercent") { + lv_type = c_unitPropLifePercent; + } + else if (autoA4188EC6_val == "lifemax") { + lv_type = c_unitPropLifeMax; + } + else if (autoA4188EC6_val == "liferegen") { + lv_type = c_unitPropLifeRegen; + } + else if (autoA4188EC6_val == "energy") { + lv_type = c_unitPropEnergy; + } + else if (autoA4188EC6_val == "energypercent") { + lv_type = c_unitPropEnergyPercent; + } + else if (autoA4188EC6_val == "energymax") { + lv_type = c_unitPropEnergyMax; + } + else if (autoA4188EC6_val == "energyregen") { + lv_type = c_unitPropEnergyRegen; + } + else if (autoA4188EC6_val == "shields") { + lv_type = c_unitPropShields; + } + else if (autoA4188EC6_val == "shieldspercent") { + lv_type = c_unitPropShieldsPercent; + } + else if (autoA4188EC6_val == "shieldsmax") { + lv_type = c_unitPropShieldsMax; + } + else if (autoA4188EC6_val == "shieldsregen") { + lv_type = c_unitPropShieldsRegen; + } + else if (autoA4188EC6_val == "kills") { + lv_type = c_unitPropKills; + } + else if (autoA4188EC6_val == "height") { + lv_type = c_unitPropHeight; + } + else if (autoA4188EC6_val == "movementspeed") { + lv_type = c_unitPropMovementSpeed; + } + else if (autoA4188EC6_val == "resources") { + lv_type = c_unitPropResources; + } + else if (autoA4188EC6_val == "radius") { + lv_type = c_unitPropRadius; + } + else if (autoA4188EC6_val == "xp") { + lv_type = c_unitPropXP; + } + else if (autoA4188EC6_val == "level") { + lv_type = c_unitPropLevel; + } + else if (autoA4188EC6_val == "killxp") { + lv_type = c_unitPropKillXP; + } + else if (autoA4188EC6_val == "basemovementspeed") { + lv_type = c_unitPropBaseMovementSpeed; + } + else if (autoA4188EC6_val == "movementspeedcurrent") { + lv_type = c_unitPropMovementSpeedCurrent; + } + else if (autoA4188EC6_val == "lifeexpectedpercent") { + lv_type = c_unitPropLifeExpectedPercent; + } + else { + lv_type = StringToInt(StringWord(EventChatMessage(false), 2)); + } if ((StringWord(EventChatMessage(false), 3) != null)) { lv_value = StringToFixed(StringWord(EventChatMessage(false), 3)); auto5C02B8F9_ae = UnitGroupCount(UnitGroupSelected(EventPlayer()), c_unitCountAlive); lv_i = 1; for ( ; ( (auto5C02B8F9_ai >= 0 && lv_i <= auto5C02B8F9_ae) || (auto5C02B8F9_ai < 0 && lv_i >= auto5C02B8F9_ae) ) ; lv_i += auto5C02B8F9_ai ) { - lv_unittype = UnitGetType(UnitGroupUnit(UnitGroupSelected(1), lv_i)); + lv_unittype = UnitGetType(UnitGroupUnit(UnitGroupSelected(EventPlayer()), lv_i)); UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, (StringToText((lv_unittype)) + StringToText(": Changed Property"))); UnitSetPropertyFixed(UnitGroupUnit(UnitGroupSelected(EventPlayer()), lv_i), lv_type, lv_value); } @@ -1377,7 +1450,7 @@ bool libUNIT_gt_ModifyUnitProperty_Func (bool testConds, bool runActions) { auto4B2220AA_ae = UnitGroupCount(UnitGroupSelected(EventPlayer()), c_unitCountAlive); lv_i = 1; for ( ; ( (auto4B2220AA_ai >= 0 && lv_i <= auto4B2220AA_ae) || (auto4B2220AA_ai < 0 && lv_i >= auto4B2220AA_ae) ) ; lv_i += auto4B2220AA_ai ) { - lv_unittype = UnitGetType(UnitGroupUnit(UnitGroupSelected(1), lv_i)); + lv_unittype = UnitGetType(UnitGroupUnit(UnitGroupSelected(EventPlayer()), lv_i)); UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, (StringToText(((lv_unittype) + "'s property value: ")) + StringToText(FixedToString(UnitGetPropertyFixed(UnitGroupUnit(UnitGroupSelected(EventPlayer()), lv_i), lv_type, c_unitPropCurrent), c_fixedPrecisionAny)))); } } diff --git a/(10)trymemode.stormmap/base.stormdata/Modules/Modules_Editor.SC2Mod b/(10)trymemode.stormmap/base.stormdata/Modules/Modules_Editor.SC2Mod index 875119e..e5734ca 100644 Binary files a/(10)trymemode.stormmap/base.stormdata/Modules/Modules_Editor.SC2Mod and b/(10)trymemode.stormmap/base.stormdata/Modules/Modules_Editor.SC2Mod differ diff --git a/(10)trymemode.stormmap/base.stormdata/Modules/doc.json b/(10)trymemode.stormmap/base.stormdata/Modules/doc.json index 35765ec..f50c7f2 100644 --- a/(10)trymemode.stormmap/base.stormdata/Modules/doc.json +++ b/(10)trymemode.stormmap/base.stormdata/Modules/doc.json @@ -628,39 +628,42 @@ "command": "unitproperty", "description": [ "Allow to show / modify a selected units' property, such as max health, regen, movement speed etc.", - "|Type|Galaxy file constant|", - "|-|-|", - "|0|c_unitPropLife|", - "|1|c_unitPropLifePercent|", - "|2|c_unitPropLifeMax|", - "|3|c_unitPropLifeRegen|", - "|4|c_unitPropEnergy|", - "|5|c_unitPropEnergyPercent|", - "|6|c_unitPropEnergyMax|", - "|7|c_unitPropEnergyRegen|", - "|8|c_unitPropShields|", - "|9|c_unitPropShieldsPercent|", - "|10|c_unitPropShieldsMax|", - "|11|c_unitPropShieldsRegen|", - "|12|c_unitPropKills|", - "|17|c_unitPropHeight|", - "|18|c_unitPropMovementSpeed|", - "|20|c_unitPropResources|", - "|21|c_unitPropRadius|", - "|22|c_unitPropXP|", - "|23|c_unitPropLevel|", - "|24|c_unitPropKillXP|", - "|28|c_unitPropBaseMovementSpeed|", - "|29|c_unitPropMovementSpeedCurrent|", - "|30|c_unitPropLifeExpectedPercent|" + "If the `type` parameter is not supplied, it will return the value of the property. If the `type` parameter was set, it will modify the selected unit's property.", + "", + "The `type` parameters accept either the `Type (int)` or `Type (string)` below.", + "| Type (int) | Type (string) | Galaxy file constant |", + "|-|-|-|", + "| 0 | life | c_unitLife |", + "| 1 | lifepercent | c_unitPropLifePercent |", + "| 2 | lifemax | c_unitPropLifeMax |", + "| 3 | liferegen | c_unitPropLifeRegen |", + "| 4 | energy | c_unitPropEnergy |", + "| 5 | energypercent | c_unitPropEnergyPercent |", + "| 6 | energymax | c_unitPropEnergyMax |", + "| 7 | energyregen | c_unitPropEnergyRegen |", + "| 8 | shields | c_unitPropShields |", + "| 9 | shieldspercent | c_unitPropShieldsPercent |", + "| 10 | shieldsmax | c_unitPropShieldsMax |", + "| 11 | shieldsregen | c_unitPropShieldsRegen |", + "| 12 | kills | c_unitPropKills |", + "| 17 | height | c_unitPropHeight |", + "| 18 | movementspeed | c_unitPropMovementSpeed |", + "| 20 | resources | c_unitPropResources |", + "| 21 | radius | c_unitPropRadius |", + "| 22 | xp | c_unitPropXP |", + "| 23 | level | c_unitPropLevel |", + "| 24 | killxp | c_unitPropKillXP |", + "| 28 | basemovementspeed | c_unitPropBaseMovementSpeed |", + "| 29 | movementspeedcurrent | c_unitPropMovementSpeedCurrent |", + "| 30 | lifeexpectedpercent | c_unitPropLifeExpectedPercent |" ], "uiAvailable": false, "parameters": [ { "name": "type", "required": true, - "description": "Set the type of the property to be modified. Please refer to the table above.", - "type": "integer" + "description": "Set the type of the property to be get / modified. Please refer to the table above.", + "type": "integer/string" }, { "name": "value", @@ -672,7 +675,7 @@ ], "examples": [ { - "command": "{shortCommand} 0", + "command": "{shortCommand} life", "description": "Shows the unit's current HP" }, { @@ -684,7 +687,7 @@ "description": "Show the selected unit's Max Energy, usually refers as resource bar, such as mana, Tracer bullet, Chen's brew etc." }, { - "command": "{command} 6 10000", + "command": "{command} energymax 10000", "description": "Set the selected unit's Max Energy for 10000, usually refers as resource bar, such as mana, Tracer bullet, Chen's brew etc." }, { @@ -692,7 +695,7 @@ "description": "Shows the base movement speed of selected units." }, { - "command": "{command} 28 10", + "command": "{command} basemovementspeed 10", "description": "Set the base movement speed of selected units to 10. Note that base speed for heroes is 4.8398" } ] diff --git a/USAGE.md b/USAGE.md index 2697fc0..f5ffb09 100644 --- a/USAGE.md +++ b/USAGE.md @@ -1,7 +1,7 @@ # Usage -*(Generated from [doc.json](./(10)trymemode.stormmap/base.stormdata/Modules/doc.json) at Mon, 25 Jan 2021 01:25:32 GMT)* +*(Generated from [doc.json](./(10)trymemode.stormmap/base.stormdata/Modules/doc.json) at Mon, 25 Jan 2021 02:13:04 GMT)* 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. @@ -1550,39 +1550,42 @@ Toggle displaying units' id mode. Which will shows the unit's id on the screen w #### ✏ Description: Allow to show / modify a selected units' property, such as max health, regen, movement speed etc. -|Type|Galaxy file constant| -|-|-| -|0|c_unitPropLife| -|1|c_unitPropLifePercent| -|2|c_unitPropLifeMax| -|3|c_unitPropLifeRegen| -|4|c_unitPropEnergy| -|5|c_unitPropEnergyPercent| -|6|c_unitPropEnergyMax| -|7|c_unitPropEnergyRegen| -|8|c_unitPropShields| -|9|c_unitPropShieldsPercent| -|10|c_unitPropShieldsMax| -|11|c_unitPropShieldsRegen| -|12|c_unitPropKills| -|17|c_unitPropHeight| -|18|c_unitPropMovementSpeed| -|20|c_unitPropResources| -|21|c_unitPropRadius| -|22|c_unitPropXP| -|23|c_unitPropLevel| -|24|c_unitPropKillXP| -|28|c_unitPropBaseMovementSpeed| -|29|c_unitPropMovementSpeedCurrent| -|30|c_unitPropLifeExpectedPercent| +If the `type` parameter is not supplied, it will return the value of the property. If the `type` parameter was set, it will modify the selected unit's property. + +The `type` parameters accept either the `Type (int)` or `Type (string)` below. +| Type (int) | Type (string) | Galaxy file constant | +|-|-|-| +| 0 | life | c_unitLife | +| 1 | lifepercent | c_unitPropLifePercent | +| 2 | lifemax | c_unitPropLifeMax | +| 3 | liferegen | c_unitPropLifeRegen | +| 4 | energy | c_unitPropEnergy | +| 5 | energypercent | c_unitPropEnergyPercent | +| 6 | energymax | c_unitPropEnergyMax | +| 7 | energyregen | c_unitPropEnergyRegen | +| 8 | shields | c_unitPropShields | +| 9 | shieldspercent | c_unitPropShieldsPercent | +| 10 | shieldsmax | c_unitPropShieldsMax | +| 11 | shieldsregen | c_unitPropShieldsRegen | +| 12 | kills | c_unitPropKills | +| 17 | height | c_unitPropHeight | +| 18 | movementspeed | c_unitPropMovementSpeed | +| 20 | resources | c_unitPropResources | +| 21 | radius | c_unitPropRadius | +| 22 | xp | c_unitPropXP | +| 23 | level | c_unitPropLevel | +| 24 | killxp | c_unitPropKillXP | +| 28 | basemovementspeed | c_unitPropBaseMovementSpeed | +| 29 | movementspeedcurrent | c_unitPropMovementSpeedCurrent | +| 30 | lifeexpectedpercent | c_unitPropLifeExpectedPercent | #### ⚙ Parameters: Required: true - Type: integer - Usage: Set the type of the property to be modified. Please refer to the table above. + Type: integer/string + Usage: Set the type of the property to be get / modified. Please refer to the table above. [value] Required: false Type: float @@ -1591,17 +1594,17 @@ Allow to show / modify a selected units' property, such as max health, regen, mo #### 🔧 Examples: - > up 0 + > up life (Shows the unit's current HP) > up 0 1 (Set the selected units's Current HP to 1; MAX SPEEDZ TAZZZZDINGO) > unitproperty 6 (Show the selected unit's Max Energy, usually refers as resource bar, such as mana, Tracer bullet, Chen's brew etc.) - > unitproperty 6 10000 + > unitproperty energymax 10000 (Set the selected unit's Max Energy for 10000, usually refers as resource bar, such as mana, Tracer bullet, Chen's brew etc.) > unitproperty 28 (Shows the base movement speed of selected units.) - > unitproperty 28 10 + > unitproperty basemovementspeed 10 (Set the base movement speed of selected units to 10. Note that base speed for heroes is 4.8398)