warscript 0.0.1-dev.858ac09 → 0.0.1-dev.88cffdd

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.
Files changed (33) hide show
  1. package/core/types/effect.d.ts +1 -3
  2. package/core/types/effect.lua +26 -29
  3. package/core/types/sound.d.ts +17 -25
  4. package/core/types/sound.lua +80 -44
  5. package/core/types/timer.d.ts +6 -7
  6. package/core/types/timer.lua +18 -21
  7. package/engine/behaviour/ability.d.ts +4 -1
  8. package/engine/behaviour/ability.lua +6 -4
  9. package/engine/buff.d.ts +12 -7
  10. package/engine/buff.lua +78 -47
  11. package/engine/internal/mechanics/ability-duration.lua +1 -1
  12. package/engine/object-data/auxiliary/attachment-preset.d.ts +7 -2
  13. package/engine/object-data/auxiliary/attachment-preset.lua +4 -3
  14. package/engine/object-data/auxiliary/sound-eax.d.ts +10 -0
  15. package/engine/object-data/auxiliary/sound-eax.lua +2 -0
  16. package/engine/object-data/entry/ability-type/berserk.d.ts +2 -0
  17. package/engine/object-data/entry/ability-type/berserk.lua +13 -0
  18. package/engine/object-data/entry/ability-type/carrion-swarm.d.ts +14 -0
  19. package/engine/object-data/entry/ability-type/carrion-swarm.lua +65 -0
  20. package/engine/object-data/entry/ability-type/ensnare.d.ts +12 -0
  21. package/engine/object-data/entry/ability-type/ensnare.lua +52 -0
  22. package/engine/object-data/entry/ability-type/phase-shift.d.ts +10 -0
  23. package/engine/object-data/entry/ability-type/phase-shift.lua +39 -0
  24. package/engine/object-data/entry/ability-type/shock-wave.d.ts +4 -0
  25. package/engine/object-data/entry/ability-type/shock-wave.lua +26 -0
  26. package/engine/object-data/entry/ability-type/web.d.ts +12 -0
  27. package/engine/object-data/entry/ability-type/web.lua +52 -0
  28. package/engine/object-data/entry/ability-type.d.ts +11 -11
  29. package/engine/object-data/entry/ability-type.lua +24 -10
  30. package/engine/object-data/entry/buff-type/applicable.lua +1 -0
  31. package/engine/object-data/entry/sound-preset.d.ts +17 -0
  32. package/engine/object-data/entry/sound-preset.lua +104 -0
  33. package/package.json +2 -2
@@ -3,7 +3,7 @@ import "../../internal/unit/ability";
3
3
  import { TupleOf } from "../../../utility/types";
4
4
  import { AnimationName } from "../auxiliary/animation-name";
5
5
  import { AnimationQualifier } from "../auxiliary/animation-qualifier";
6
- import { AttachmentPreset, AttachmentPresetInput } from "../auxiliary/attachment-preset";
6
+ import { AttachmentPresetInput, EffectPresetWithParameters, EffectPresetWithParametersInput } from "../auxiliary/attachment-preset";
7
7
  import { CombatClassifications } from "../auxiliary/combat-classification";
8
8
  import { Race } from "../auxiliary/race";
9
9
  import { TechTreeDependency, TechTreeDependencyInput } from "../auxiliary/tech-tree-dependency";
@@ -27,11 +27,11 @@ export declare abstract class AbilityType extends ObjectDataEntry<AbilityTypeId>
27
27
  set buttonPositionX(buttonPositionX: number);
28
28
  get buttonPositionY(): number;
29
29
  set buttonPositionY(buttonPositionY: number);
30
- get casterCastingEffectPresets(): AttachmentPreset[];
31
- set casterCastingEffectPresets(casterCastingEffectPresets: AttachmentPresetInput[]);
32
- get casterChannelingEffectPresets(): AttachmentPreset[];
33
- set casterChannelingEffectPresets(casterChannelingEffectPresets: AttachmentPresetInput[]);
34
- get casterAttachmentPresets(): TupleOf<AttachmentPreset, 0 | 1 | 2>;
30
+ get casterCastingEffectPresets(): EffectPresetWithParameters[];
31
+ set casterCastingEffectPresets(casterCastingEffectPresets: EffectPresetWithParametersInput[]);
32
+ get casterChannelingEffectPresets(): EffectPresetWithParameters[];
33
+ set casterChannelingEffectPresets(casterChannelingEffectPresets: EffectPresetWithParametersInput[]);
34
+ get casterAttachmentPresets(): TupleOf<EffectPresetWithParameters, 0 | 1 | 2>;
35
35
  set casterAttachmentPresets(casterAttachmentPresets: TupleOf<AttachmentPresetInput, 0 | 1 | 2>);
36
36
  get effectModelPaths(): string[];
37
37
  set effectModelPaths(effectModelPaths: string[]);
@@ -63,15 +63,15 @@ export declare abstract class AbilityType extends ObjectDataEntry<AbilityTypeId>
63
63
  set missileMovementArc(missileMovementArc: number);
64
64
  get missileMovementSpeed(): number;
65
65
  set missileMovementSpeed(missileMovementSpeed: number);
66
- get specialAttachmentPreset(): AttachmentPreset | undefined;
66
+ get specialAttachmentPreset(): EffectPresetWithParameters | undefined;
67
67
  set specialAttachmentPreset(specialAttachmentPreset: AttachmentPresetInput | undefined);
68
- get targetCastingEffectPresets(): AttachmentPreset[];
68
+ get targetCastingEffectPresets(): EffectPresetWithParameters[];
69
69
  set targetCastingEffectPresets(targetCastingEffectPresets: AttachmentPresetInput[]);
70
- get targetEffectPresets(): TupleOf<AttachmentPreset, 0 | 1 | 2 | 3 | 4 | 5 | 6>;
70
+ get targetEffectPresets(): TupleOf<EffectPresetWithParameters, 0 | 1 | 2 | 3 | 4 | 5 | 6>;
71
71
  set targetEffectPresets(targetEffectPresets: TupleOf<AttachmentPresetInput, 0 | 1 | 2 | 3 | 4 | 5 | 6>);
72
- get targetEffectPresetsSD(): TupleOf<AttachmentPreset, 0 | 1 | 2 | 3 | 4 | 5 | 6>;
72
+ get targetEffectPresetsSD(): TupleOf<EffectPresetWithParameters, 0 | 1 | 2 | 3 | 4 | 5 | 6>;
73
73
  set targetEffectPresetsSD(targetEffectPresetsSD: TupleOf<AttachmentPresetInput, 0 | 1 | 2 | 3 | 4 | 5 | 6>);
74
- get targetEffectPresetsHD(): TupleOf<AttachmentPreset, 0 | 1 | 2 | 3 | 4 | 5 | 6>;
74
+ get targetEffectPresetsHD(): TupleOf<EffectPresetWithParameters, 0 | 1 | 2 | 3 | 4 | 5 | 6>;
75
75
  set targetEffectPresetsHD(targetEffectPresetsHD: TupleOf<AttachmentPresetInput, 0 | 1 | 2 | 3 | 4 | 5 | 6>);
76
76
  get turnOffButtonPositionX(): number;
77
77
  set turnOffButtonPositionX(buttonPositionX: number);
@@ -20,7 +20,7 @@ local mapIndexed = ____arrays.mapIndexed
20
20
  local ____attachment_2Dpreset = require("engine.object-data.auxiliary.attachment-preset")
21
21
  local extractAttachmentPresetInputModelPath = ____attachment_2Dpreset.extractAttachmentPresetInputModelPath
22
22
  local extractAttachmentPresetInputNodeFQN = ____attachment_2Dpreset.extractAttachmentPresetInputNodeFQN
23
- local toAttachmentPreset = ____attachment_2Dpreset.toAttachmentPreset
23
+ local toEffectPreset = ____attachment_2Dpreset.toEffectPreset
24
24
  local ____combat_2Dclassification = require("engine.object-data.auxiliary.combat-classification")
25
25
  local combatClassificationsToStringArray = ____combat_2Dclassification.combatClassificationsToStringArray
26
26
  local stringArrayToCombatClassifications = ____combat_2Dclassification.stringArrayToCombatClassifications
@@ -36,7 +36,7 @@ local ____upgrade = require("engine.object-data.entry.upgrade")
36
36
  local Upgrade = ____upgrade.Upgrade
37
37
  local ____sound = require("core.types.sound")
38
38
  local Sound3D = ____sound.Sound3D
39
- local SoundPreset = ____sound.SoundPreset
39
+ local SoundSettings = ____sound.SoundSettings
40
40
  local castAnimationFQNByAbilityTypeId = {}
41
41
  local isButtonVisibleFalseAbilityTypes = {}
42
42
  local casterCastingEffectPresetsByAbilityTypeId = {}
@@ -118,7 +118,7 @@ __TS__SetDescriptor(
118
118
  return casterCastingEffectPresetsByAbilityTypeId[self.id] or ({})
119
119
  end,
120
120
  set = function(self, casterCastingEffectPresets)
121
- casterCastingEffectPresetsByAbilityTypeId[self.id] = map(casterCastingEffectPresets, toAttachmentPreset)
121
+ casterCastingEffectPresetsByAbilityTypeId[self.id] = map(casterCastingEffectPresets, toEffectPreset)
122
122
  end
123
123
  },
124
124
  true
@@ -131,7 +131,7 @@ __TS__SetDescriptor(
131
131
  return casterChannelingEffectPresetsByAbilityTypeId[self.id] or ({})
132
132
  end,
133
133
  set = function(self, casterChannelingEffectPresets)
134
- casterChannelingEffectPresetsByAbilityTypeId[self.id] = map(casterChannelingEffectPresets, toAttachmentPreset)
134
+ casterChannelingEffectPresetsByAbilityTypeId[self.id] = map(casterChannelingEffectPresets, toEffectPreset)
135
135
  end
136
136
  },
137
137
  true
@@ -370,7 +370,7 @@ __TS__SetDescriptor(
370
370
  return targetCastingEffectPresetsByAbilityTypeId[self.id] or ({})
371
371
  end,
372
372
  set = function(self, targetCastingEffectPresets)
373
- targetCastingEffectPresetsByAbilityTypeId[self.id] = map(targetCastingEffectPresets, toAttachmentPreset)
373
+ targetCastingEffectPresetsByAbilityTypeId[self.id] = map(targetCastingEffectPresets, toEffectPreset)
374
374
  end
375
375
  },
376
376
  true
@@ -991,16 +991,16 @@ for abilityTypeId, soundPresetId in pairs(postcompile(function() return targetEf
991
991
  4,
992
992
  function(caster, ability, target)
993
993
  if __TS__InstanceOf(target, Unit) then
994
- Sound3D:playFromLabel(soundPresetId, SoundPreset.Ability, target)
994
+ Sound3D:playFromLabel(soundPresetId, SoundSettings.Ability, target)
995
995
  else
996
- Sound3D:playFromLabel(soundPresetId, SoundPreset.Ability, target.x, target.y)
996
+ Sound3D:playFromLabel(soundPresetId, SoundSettings.Ability, target.x, target.y)
997
997
  end
998
998
  end
999
999
  )
1000
1000
  Unit.abilityPointTargetChannelingStartEvent[abilityTypeId]:addListener(
1001
1001
  4,
1002
1002
  function(caster, ability, x, y)
1003
- Sound3D:playFromLabel(soundPresetId, SoundPreset.Ability, x, y)
1003
+ Sound3D:playFromLabel(soundPresetId, SoundSettings.Ability, x, y)
1004
1004
  end
1005
1005
  )
1006
1006
  end
@@ -1017,10 +1017,17 @@ local casterCastingEffectAttachmentPointsByAbilityTypeId = postcompile(function(
1017
1017
  function(casterCastingEffectPresets) return map(casterCastingEffectPresets, extractAttachmentPresetInputNodeFQN) end
1018
1018
  )
1019
1019
  end)
1020
+ local casterCastingEffectParametersByAbilityTypeId = postcompile(function()
1021
+ return mapValues(
1022
+ casterCastingEffectPresetsByAbilityTypeId,
1023
+ function(casterCastingEffectPresets) return map(casterCastingEffectPresets, "parameters") end
1024
+ )
1025
+ end)
1020
1026
  local casterCastingEffectsByCaster = {}
1021
1027
  local function handleAbilityCastingStartEvent(caster, ability)
1022
1028
  local effectModelPaths = casterCastingEffectModelPathsByAbilityTypeId[ability.typeId]
1023
1029
  local attachmentPoints = casterCastingEffectAttachmentPointsByAbilityTypeId[ability.typeId]
1030
+ local parameters = casterCastingEffectParametersByAbilityTypeId[ability.typeId]
1024
1031
  local effects = {}
1025
1032
  if effectModelPaths ~= nil then
1026
1033
  for i = 1, #effectModelPaths do
@@ -1029,7 +1036,7 @@ local function handleAbilityCastingStartEvent(caster, ability)
1029
1036
  if attachmentPoint == nil or attachmentPoint == "" then
1030
1037
  attachmentPoint = "origin"
1031
1038
  end
1032
- effects[i] = Effect:createTarget(effectModelPath, caster, attachmentPoint)
1039
+ effects[i] = Effect:create(effectModelPath, caster, attachmentPoint, parameters and parameters[i])
1033
1040
  end
1034
1041
  end
1035
1042
  casterCastingEffectsByCaster[caster] = effects
@@ -1060,10 +1067,17 @@ local casterChannelingEffectAttachmentPointsByAbilityTypeId = postcompile(functi
1060
1067
  function(casterChannelingEffectPresets) return map(casterChannelingEffectPresets, extractAttachmentPresetInputNodeFQN) end
1061
1068
  )
1062
1069
  end)
1070
+ local casterChannelingEffectParametersByAbilityTypeId = postcompile(function()
1071
+ return mapValues(
1072
+ casterChannelingEffectPresetsByAbilityTypeId,
1073
+ function(casterChannelingEffectPresets) return map(casterChannelingEffectPresets, "parameters") end
1074
+ )
1075
+ end)
1063
1076
  local casterChannelingEffectsByCaster = {}
1064
1077
  local function handleAbilityChannelingStartEvent(caster, ability)
1065
1078
  local effectModelPaths = casterChannelingEffectModelPathsByAbilityTypeId[ability.typeId]
1066
1079
  local attachmentPoints = casterChannelingEffectAttachmentPointsByAbilityTypeId[ability.typeId]
1080
+ local parameters = casterChannelingEffectParametersByAbilityTypeId[ability.typeId]
1067
1081
  local effects = {}
1068
1082
  if effectModelPaths ~= nil then
1069
1083
  for i = 1, #effectModelPaths do
@@ -1072,7 +1086,7 @@ local function handleAbilityChannelingStartEvent(caster, ability)
1072
1086
  if attachmentPoint == nil or attachmentPoint == "" then
1073
1087
  attachmentPoint = "origin"
1074
1088
  end
1075
- effects[i] = Effect:createTarget(effectModelPath, caster, attachmentPoint)
1089
+ effects[i] = Effect:create(effectModelPath, caster, attachmentPoint, parameters and parameters[i])
1076
1090
  end
1077
1091
  end
1078
1092
  casterChannelingEffectsByCaster[caster] = effects
@@ -128,6 +128,7 @@ local applicatorAbilityTypeIdByApplicatorTypeByApplicableBuffTypeId, applicatorU
128
128
  local applicatorAbilityType = prepareAbilityType(BerserkAbilityType, applicableBuffType)
129
129
  applicatorAbilityType.attackSpeedIncreaseFactor = 0
130
130
  applicatorAbilityType.movementSpeedIncreaseFactor = 0
131
+ applicatorAbilityType.receivedDamageIncreaseFactor = 0
131
132
  applicatorAbilityType.buffTypeIds = {applicableBuffType.id}
132
133
  if applicatorAbilityType.levelCount > 1 then
133
134
  multilevelPhysicalPositiveApplicatorAbilityTypes[#multilevelPhysicalPositiveApplicatorAbilityTypes + 1] = applicatorAbilityType
@@ -1,5 +1,6 @@
1
1
  /** @noSelfInFile */
2
2
  import { ObjectDataEntry, ObjectDataEntryId } from "../entry";
3
+ import { SoundEax } from "../auxiliary/sound-eax";
3
4
  export type SoundPresetId = ObjectDataEntryId & string & {
4
5
  readonly __soundPresetId: unique symbol;
5
6
  };
@@ -13,4 +14,20 @@ export declare class SoundPreset extends ObjectDataEntry<SoundPresetId> {
13
14
  protected static getObjectData(map: WarMap): WarObjects;
14
15
  get filePaths(): string[];
15
16
  set filePaths(filePaths: string[]);
17
+ get volume(): number;
18
+ set volume(volume: number);
19
+ get pitch(): number;
20
+ set pitch(pitch: number);
21
+ get priority(): number;
22
+ set priority(priority: number);
23
+ get channel(): number;
24
+ set channel(channel: number);
25
+ get minimumDistance(): number;
26
+ set minimumDistance(minimumDistance: number);
27
+ get maximumDistance(): number;
28
+ set maximumDistance(maximumDistance: number);
29
+ get distanceCutoff(): number;
30
+ set distanceCutoff(distanceCutoff: number);
31
+ get eax(): SoundEax;
32
+ set eax(eax: SoundEax);
16
33
  }
@@ -33,4 +33,108 @@ __TS__SetDescriptor(
33
33
  },
34
34
  true
35
35
  )
36
+ __TS__SetDescriptor(
37
+ SoundPreset.prototype,
38
+ "volume",
39
+ {
40
+ get = function(self)
41
+ return self:getNumberField("Volume")
42
+ end,
43
+ set = function(self, volume)
44
+ self:setNumberField("Volume", volume)
45
+ end
46
+ },
47
+ true
48
+ )
49
+ __TS__SetDescriptor(
50
+ SoundPreset.prototype,
51
+ "pitch",
52
+ {
53
+ get = function(self)
54
+ return self:getNumberField("Pitch")
55
+ end,
56
+ set = function(self, pitch)
57
+ self:setNumberField("Pitch", pitch)
58
+ end
59
+ },
60
+ true
61
+ )
62
+ __TS__SetDescriptor(
63
+ SoundPreset.prototype,
64
+ "priority",
65
+ {
66
+ get = function(self)
67
+ return self:getNumberField("Priority")
68
+ end,
69
+ set = function(self, priority)
70
+ self:setNumberField("Priority", priority)
71
+ end
72
+ },
73
+ true
74
+ )
75
+ __TS__SetDescriptor(
76
+ SoundPreset.prototype,
77
+ "channel",
78
+ {
79
+ get = function(self)
80
+ return self:getNumberField("Channel")
81
+ end,
82
+ set = function(self, channel)
83
+ self:setNumberField("Channel", channel)
84
+ end
85
+ },
86
+ true
87
+ )
88
+ __TS__SetDescriptor(
89
+ SoundPreset.prototype,
90
+ "minimumDistance",
91
+ {
92
+ get = function(self)
93
+ return self:getNumberField("MinDistance")
94
+ end,
95
+ set = function(self, minimumDistance)
96
+ self:setNumberField("MinDistance", minimumDistance)
97
+ end
98
+ },
99
+ true
100
+ )
101
+ __TS__SetDescriptor(
102
+ SoundPreset.prototype,
103
+ "maximumDistance",
104
+ {
105
+ get = function(self)
106
+ return self:getNumberField("MaxDistance")
107
+ end,
108
+ set = function(self, maximumDistance)
109
+ self:setNumberField("MaxDistance", maximumDistance)
110
+ end
111
+ },
112
+ true
113
+ )
114
+ __TS__SetDescriptor(
115
+ SoundPreset.prototype,
116
+ "distanceCutoff",
117
+ {
118
+ get = function(self)
119
+ return self:getNumberField("DistanceCutoff")
120
+ end,
121
+ set = function(self, distanceCutoff)
122
+ self:setNumberField("DistanceCutoff", distanceCutoff)
123
+ end
124
+ },
125
+ true
126
+ )
127
+ __TS__SetDescriptor(
128
+ SoundPreset.prototype,
129
+ "eax",
130
+ {
131
+ get = function(self)
132
+ return self:getStringField("EAXFlags")
133
+ end,
134
+ set = function(self, eax)
135
+ self:setStringField("EAXFlags", eax)
136
+ end
137
+ },
138
+ true
139
+ )
36
140
  return ____exports
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.858ac09",
4
+ "version": "0.0.1-dev.88cffdd",
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.4",
26
26
  "lua-types": "^2.13.1",
27
- "warpack": "0.0.1-dev.dfbb169"
27
+ "warpack": "0.0.1-dev.8e8a660"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@typescript-eslint/eslint-plugin": "^8.13.0",