warscript 0.0.1-dev.c8d6bc0 → 0.0.1-dev.cc63edd
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/types/missile.d.ts +2 -2
- package/core/types/missile.lua +8 -2
- package/engine/behaviour/ability/instant-impact.lua +4 -0
- package/engine/behaviour/ability.d.ts +8 -1
- package/engine/behaviour/ability.lua +62 -0
- package/engine/internal/unit-missile-launch.lua +1 -1
- package/engine/internal/unit.d.ts +36 -8
- package/engine/internal/unit.lua +215 -63
- package/engine/object-data/entry/ability-type/mine.d.ts +10 -0
- package/engine/object-data/entry/ability-type/mine.lua +39 -0
- package/engine/object-data/entry/ability-type/spirit-touch.d.ts +2 -2
- package/engine/object-data/entry/ability-type/spirit-touch.lua +6 -6
- package/engine/object-data/entry/unit-type.d.ts +21 -1
- package/engine/object-data/entry/unit-type.lua +223 -49
- package/engine/standard/entries/unit-type.d.ts +39 -1
- package/engine/standard/entries/unit-type.lua +39 -1
- package/engine/standard/fields/ability.d.ts +1 -1
- package/engine/standard/fields/ability.lua +1 -1
- package/package.json +2 -2
- package/string.d.ts +14 -0
- package/string.lua +9 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "warscript",
|
|
4
|
-
"version": "0.0.1-dev.
|
|
4
|
+
"version": "0.0.1-dev.cc63edd",
|
|
5
5
|
"description": "A typescript library for Warcraft III using Warpack.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"warcraft",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@warscript/language-extensions": "^0.0.1",
|
|
25
25
|
"@warscript/tstl-plugin": "^0.0.3",
|
|
26
26
|
"lua-types": "^2.13.1",
|
|
27
|
-
"warpack": "0.0.1-dev.
|
|
27
|
+
"warpack": "0.0.1-dev.1976a88"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@typescript-eslint/eslint-plugin": "^5.59.11",
|
package/string.d.ts
CHANGED
|
@@ -103,4 +103,18 @@ declare global {
|
|
|
103
103
|
function isNotBlank(string: string): boolean;
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
+
declare global {
|
|
107
|
+
namespace string {
|
|
108
|
+
/**
|
|
109
|
+
* Returns the number of characters matching the given predicate.
|
|
110
|
+
*/
|
|
111
|
+
function count(string: string, predicate: (char: string) => boolean): number;
|
|
112
|
+
}
|
|
113
|
+
interface String {
|
|
114
|
+
/**
|
|
115
|
+
* Returns the number of characters matching the given predicate.
|
|
116
|
+
*/
|
|
117
|
+
count(predicate: (char: string) => boolean): number;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
106
120
|
export {};
|
package/string.lua
CHANGED
|
@@ -31,4 +31,13 @@ end
|
|
|
31
31
|
_G.string.isNotBlank = function(____string)
|
|
32
32
|
return (match(____string, "^%s*$")) == nil
|
|
33
33
|
end
|
|
34
|
+
_G.string.count = function(____string, predicate)
|
|
35
|
+
local result = 0
|
|
36
|
+
for i = 1, #____string do
|
|
37
|
+
if predicate(sub(____string, i, i)) then
|
|
38
|
+
result = result + 1
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
return result
|
|
42
|
+
end
|
|
34
43
|
return ____exports
|