warscript 0.0.1-dev.797e3f9 → 0.0.1-dev.7fd7bc7

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.
@@ -8,11 +8,33 @@ ____exports.RIFLEMAN_UNIT_TYPE_ID = fourCC("hrif")
8
8
  ____exports.SIEGE_ENGINE_UNIT_TYPE_ID = fourCC("hmtt")
9
9
  ____exports.SORCERESS_UNIT_TYPE_ID = fourCC("hsor")
10
10
  ____exports.SPELLBREAKER_UNIT_TYPE_ID = fourCC("hspt")
11
- ____exports.PALADIN_HERO_UNIT_TYPE_ID = fourCC("Hpal")
12
11
  ____exports.ARCHMAGE_HERO_UNIT_TYPE_ID = fourCC("Hamg")
12
+ ____exports.BLOOD_MAGE_HERO_UNIT_TYPE_ID = fourCC("Hblm")
13
+ ____exports.MOUNTAIN_KING_HERO_UNIT_TYPE_ID = fourCC("Hmkg")
14
+ ____exports.PALADIN_HERO_UNIT_TYPE_ID = fourCC("Hpal")
15
+ ____exports.ARCHER_HIGH_ELF_UNIT_TYPE_ID = fourCC("nhea")
13
16
  ____exports.CAPTAIN_UNIT_TYPE_ID = fourCC("hcth")
17
+ ____exports.SWORDSMAN_UNIT_TYPE_ID = fourCC("hhes")
18
+ ____exports.ADMIRAL_PROUDMOORE_HERO_UNIT_TYPE_ID = fourCC("Hapm")
19
+ ____exports.ANASTERIAN_SUNSTRIDER_HERO_UNIT_TYPE_ID = fourCC("Hssa")
20
+ ____exports.ANTONIDAS_HERO_UNIT_TYPE_ID = fourCC("Hant")
21
+ ____exports.ANTONIDAS_GHOST_HERO_UNIT_TYPE_ID = fourCC("Hgam")
14
22
  ____exports.ARTHAS_HERO_UNIT_TYPE_ID = fourCC("Hart")
15
23
  ____exports.ARTHAS_WITH_FROSTMOURNE_HERO_UNIT_TYPE_ID = fourCC("Harf")
24
+ ____exports.DAGREN_THE_ORCSLAYER_HERO_UNIT_TYPE_ID = fourCC("Hdgo")
25
+ ____exports.HALAHK_THE_LIFEBRINGER_HERO_UNIT_TYPE_ID = fourCC("Hhkl")
26
+ ____exports.JAINA_HERO_UNIT_TYPE_ID = fourCC("Hjai")
27
+ ____exports.JENNALLA_DEEMSPRING_HERO_UNIT_TYPE_ID = fourCC("Hjnd")
28
+ ____exports.KAEL_HERO_UNIT_TYPE_ID = fourCC("Hkal")
29
+ ____exports.KELEN_THE_SEEKER_HERO_UNIT_TYPE_ID = fourCC("Haah")
30
+ ____exports.LORD_GARITHOS_HERO_UNIT_TYPE_ID = fourCC("Hlgr")
31
+ ____exports.LORD_NICHOLAS_BUZAN_HERO_UNIT_TYPE_ID = fourCC("Hpb1")
32
+ ____exports.MAGROTH_THE_DEFENDER_HERO_UNIT_TYPE_ID = fourCC("Hmgd")
33
+ ____exports.MURADIN_BRONZEBEARD_HERO_UNIT_TYPE_ID = fourCC("Hmbr")
34
+ ____exports.SIR_GREGORY_EDMUNSON_HERO_UNIT_TYPE_ID = fourCC("Hpb2")
35
+ ____exports.SYLVANAS_WINDRUNNER_HERO_UNIT_TYPE_ID = fourCC("Hvwd")
36
+ ____exports.THALORIEN_DAWNSEEKER_HERO_UNIT_TYPE_ID = fourCC("Hddt")
37
+ ____exports.UTHER_HERO_UNIT_TYPE_ID = fourCC("Huth")
16
38
  ____exports.BATRIDER_UNIT_TYPE_ID = fourCC("otbr")
17
39
  ____exports.DEMOLISHER_UNIT_TYPE_ID = fourCC("ocat")
18
40
  ____exports.GRUNT_UNIT_TYPE_ID = fourCC("ogru")
@@ -24,7 +46,22 @@ ____exports.SPIRIT_WALKER_UNIT_TYPE_ID = fourCC("ospw")
24
46
  ____exports.TAUREN_UNIT_TYPE_ID = fourCC("otau")
25
47
  ____exports.WIND_RIDER_UNIT_TYPE_ID = fourCC("owyv")
26
48
  ____exports.WITCH_DOCTOR_UNIT_TYPE_ID = fourCC("odoc")
49
+ ____exports.ARCHER_UNIT_TYPE_ID = fourCC("earc")
50
+ ____exports.CHIMAERA_UNIT_TYPE_ID = fourCC("echm")
51
+ ____exports.DRUID_OF_THE_CLAW_UNIT_TYPE_ID = fourCC("edoc")
52
+ ____exports.DRUID_OF_THE_TALON_UNIT_TYPE_ID = fourCC("edot")
53
+ ____exports.DRYAD_UNIT_TYPE_ID = fourCC("edry")
54
+ ____exports.FAERIE_DRAGON_UNIT_TYPE_ID = fourCC("efdr")
55
+ ____exports.GLAIVE_THROWER_UNIT_TYPE_ID = fourCC("ebal")
56
+ ____exports.HIPPOGRYPH_UNIT_TYPE_ID = fourCC("ehip")
57
+ ____exports.HIPPOGRYPH_RIDER_UNIT_TYPE_ID = fourCC("ehpr")
58
+ ____exports.HUNTRESS_UNIT_TYPE_ID = fourCC("esen")
59
+ ____exports.MOUNTAIN_GIANT_THROWER_UNIT_TYPE_ID = fourCC("emtg")
60
+ ____exports.WISP_UNIT_TYPE_ID = fourCC("ewsp")
27
61
  ____exports.DEMON_HUNTER_HERO_UNIT_TYPE_ID = fourCC("Edem")
62
+ ____exports.KEEPER_OF_THE_GROVE_HERO_UNIT_TYPE_ID = fourCC("Ekee")
63
+ ____exports.MOON_PRIESTESS_HERO_UNIT_TYPE_ID = fourCC("Emoo")
64
+ ____exports.WARDEN_HERO_UNIT_TYPE_ID = fourCC("Ewar")
28
65
  ____exports.DEMON_HUNTER_DEMON_FORM_HERO_UNIT_TYPE_ID = fourCC("Edmm")
29
66
  ____exports.ABOMINATION_UNIT_TYPE_ID = fourCC("uabo")
30
67
  ____exports.GHOUL_UNIT_TYPE_ID = fourCC("ugho")
@@ -60,6 +97,7 @@ ____exports.WENDIGO_UNIT_TYPE_ID = fourCC("nwen")
60
97
  ____exports.WENDIGO_SHAMAN_UNIT_TYPE_ID = fourCC("nwns")
61
98
  ____exports.WILDKIN_UNIT_TYPE_ID = fourCC("nowb")
62
99
  ____exports.WRAITH_UNIT_TYPE_ID = fourCC("ngh2")
100
+ ____exports.GOBLIN_LAND_MINE_UNIT_TYPE_ID = fourCC("nglm")
63
101
  ____exports.CIRCLE_OF_POWER_UNIT_TYPE_ID = fourCC("ncop")
64
102
  ____exports.CIRCLE_OF_POWER_MEDIUM_UNIT_TYPE_ID = fourCC("ncp2")
65
103
  ____exports.CIRCLE_OF_POWER_LARGE_UNIT_TYPE_ID = fourCC("ncp3")
@@ -16,7 +16,7 @@ export declare const LEVEL_SKIP_REQUIREMENT_ABILITY_INTEGER_FIELD: AbilityIntege
16
16
  export declare const HERO_ABILITY_ABILITY_BOOLEAN_FIELD: AbilityBooleanField & symbol;
17
17
  export declare const ITEM_ABILITY_ABILITY_BOOLEAN_FIELD: AbilityBooleanField & symbol;
18
18
  export declare const CHECK_DEPENDENCIES_ABILITY_BOOLEAN_FIELD: AbilityBooleanField & symbol;
19
- export declare const ARF_MISSILE_ARC_ABILITY_FLOAT_FIELD: AbilityFloatField & symbol;
19
+ export declare const MISSILE_ARC_ABILITY_FLOAT_FIELD: AbilityFloatField & symbol;
20
20
  export declare const NAME_ABILITY_STRING_FIELD: AbilityStringField & symbol;
21
21
  export declare const ICON_ACTIVATED_ABILITY_STRING_FIELD: AbilityStringField & symbol;
22
22
  export declare const ICON_RESEARCH_ABILITY_STRING_FIELD: AbilityStringField & symbol;
@@ -27,7 +27,7 @@ ____exports.LEVEL_SKIP_REQUIREMENT_ABILITY_INTEGER_FIELD = AbilityIntegerField:c
27
27
  ____exports.HERO_ABILITY_ABILITY_BOOLEAN_FIELD = AbilityBooleanField:create(fourCC("aher"))
28
28
  ____exports.ITEM_ABILITY_ABILITY_BOOLEAN_FIELD = AbilityBooleanField:create(fourCC("aite"))
29
29
  ____exports.CHECK_DEPENDENCIES_ABILITY_BOOLEAN_FIELD = AbilityBooleanField:create(fourCC("achd"))
30
- ____exports.ARF_MISSILE_ARC_ABILITY_FLOAT_FIELD = AbilityFloatField:create(fourCC("amac"))
30
+ ____exports.MISSILE_ARC_ABILITY_FLOAT_FIELD = AbilityFloatField:create(fourCC("amac"))
31
31
  ____exports.NAME_ABILITY_STRING_FIELD = AbilityStringField:create(fourCC("anam"))
32
32
  ____exports.ICON_ACTIVATED_ABILITY_STRING_FIELD = AbilityStringField:create(fourCC("auar"))
33
33
  ____exports.ICON_RESEARCH_ABILITY_STRING_FIELD = AbilityStringField:create(fourCC("arar"))
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.797e3f9",
4
+ "version": "0.0.1-dev.7fd7bc7",
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.5bdabe5"
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
@@ -59,6 +59,22 @@ declare global {
59
59
  function toNumber(string: string): number;
60
60
  }
61
61
  }
62
+ declare global {
63
+ namespace string {
64
+ /**
65
+ * Returns the index within the string of the first occurrence of the specified substring, starting from the specified `startIndex`,
66
+ * or -1 if the string does not contain such substring.
67
+ */
68
+ function indexOf(string: string, substring: string, startIndex?: number): number;
69
+ }
70
+ interface String {
71
+ /**
72
+ * Returns the index within this string of the first occurrence of the specified substring, starting from the specified `startIndex`,
73
+ * or -1 if the string does not contain such substring.
74
+ */
75
+ indexOf(substring: string, startIndex?: number): number;
76
+ }
77
+ }
62
78
  declare global {
63
79
  interface String {
64
80
  /**
package/string.lua CHANGED
@@ -2,6 +2,7 @@ local ____exports = {}
2
2
  local ____error = _G.error
3
3
  local tonumber = _G.tonumber
4
4
  local match = string.match
5
+ local find = string.find
5
6
  local sub = string.sub
6
7
  _G.string.removePrefix = function(____string, prefix)
7
8
  local prefixLength = #prefix
@@ -17,6 +18,10 @@ end
17
18
  _G.string.toNumber = function(____string)
18
19
  return tonumber(____string) or ____error(("'" .. ____string) .. "' is not a valid representation of a number.")
19
20
  end
21
+ _G.string.indexOf = function(____string, substring, startIndex)
22
+ local index = find(____string, substring, (startIndex or 0) + 1, true)
23
+ return (index or 0) - 1
24
+ end
20
25
  _G.string.indexOfLast = function(____string, predicate)
21
26
  for i = #____string, 1, -1 do
22
27
  if predicate(sub(____string, i, i)) then