warscript 0.0.1-dev.1d4a073 → 0.0.1-dev.1da5f63

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/engine/buff.d.ts CHANGED
@@ -57,6 +57,7 @@ export type BuffParameters<T extends Buff<any> = Buff> = Buff extends T ? {
57
57
  armorIncreaseFactor?: NumberParameterValueType;
58
58
  attackSpeedIncreaseFactor?: NumberParameterValueType;
59
59
  movementSpeedIncreaseFactor?: NumberParameterValueType;
60
+ manaRegenerationRateIncreaseFactor?: NumberParameterValueType;
60
61
  evasionProbability?: NumberParameterValueType;
61
62
  missProbability?: NumberParameterValueType;
62
63
  damageFactor?: NumberParameterValueType;
@@ -265,6 +266,8 @@ export declare class Buff<AdditionalParameters extends Prohibit<Record<string, a
265
266
  set movementSpeedIncreaseFactor(movementSpeedIncreaseFactor: number);
266
267
  get evasionProbability(): number;
267
268
  set evasionProbability(evasionProbability: number);
269
+ get manaRegenerationRateIncreaseFactor(): number;
270
+ set manaRegenerationRateIncreaseFactor(manaRegenerationRateIncreaseFactor: number);
268
271
  get duration(): number;
269
272
  get remainingDuration(): number;
270
273
  set remainingDuration(remainingDuration: number);
package/engine/buff.lua CHANGED
@@ -103,6 +103,7 @@ local buffParametersKeys = {
103
103
  armorIncreaseFactor = true,
104
104
  attackSpeedIncreaseFactor = true,
105
105
  movementSpeedIncreaseFactor = true,
106
+ manaRegenerationRateIncreaseFactor = true,
106
107
  evasionProbability = true,
107
108
  missProbability = true,
108
109
  damageFactor = true,
@@ -190,6 +191,7 @@ local buffNumberParameters = {
190
191
  "durationIncreaseOnAutoAttack",
191
192
  "attackSpeedIncreaseFactor",
192
193
  "movementSpeedIncreaseFactor",
194
+ "manaRegenerationRateIncreaseFactor",
193
195
  "evasionProbability",
194
196
  "armorIncrease",
195
197
  "damageFactor",
@@ -1254,6 +1256,19 @@ __TS__SetDescriptor(
1254
1256
  },
1255
1257
  true
1256
1258
  )
1259
+ __TS__SetDescriptor(
1260
+ Buff.prototype,
1261
+ "manaRegenerationRateIncreaseFactor",
1262
+ {
1263
+ get = function(self)
1264
+ return self:getUnitBonus(UnitBonusType.MANA_REGENERATION_RATE_FACTOR)
1265
+ end,
1266
+ set = function(self, manaRegenerationRateIncreaseFactor)
1267
+ self:addOrUpdateOrRemoveUnitBonus(UnitBonusType.MANA_REGENERATION_RATE_FACTOR, manaRegenerationRateIncreaseFactor)
1268
+ end
1269
+ },
1270
+ true
1271
+ )
1257
1272
  __TS__SetDescriptor(
1258
1273
  Buff.prototype,
1259
1274
  "duration",
@@ -0,0 +1,2 @@
1
+ /** @noSelfInFile */
2
+ export {};
@@ -0,0 +1,16 @@
1
+ local ____exports = {}
2
+ local ____mana_2Dregeneration = require("engine.object-data.entry.ability-type.mana-regeneration")
3
+ local ManaRegenerationAbilityType = ____mana_2Dregeneration.ManaRegenerationAbilityType
4
+ ---
5
+ -- @internal For use by internal systems.
6
+ ____exports.MANA_REGENERATION_RATE_INCREASE_FACTOR_DUMMY_ABILITY_TYPE_ID = compiletime(function()
7
+ local abilityType = ManaRegenerationAbilityType:create()
8
+ abilityType.isInternal = true
9
+ abilityType.isButtonVisible = false
10
+ abilityType.manaRegenerationRateIncreaseFactor = 4
11
+ return abilityType.id
12
+ end)
13
+ ---
14
+ -- @internal For use by internal systems.
15
+ ____exports.MANA_REGENERATION_RATE_INCREASE_FACTOR_ABILITY_FIELD = ABILITY_RLF_MANA_REGENERATION_BONUS_AS_FRACTION_OF_NORMAL
16
+ return ____exports
@@ -0,0 +1,17 @@
1
+ /** @noSelfInFile */
2
+ declare module "../unit" {
3
+ interface Unit {
4
+ strengthBase: number;
5
+ }
6
+ }
7
+ declare module "../unit" {
8
+ interface Unit {
9
+ agilityBase: number;
10
+ }
11
+ }
12
+ declare module "../unit" {
13
+ interface Unit {
14
+ intelligenceBase: number;
15
+ }
16
+ }
17
+ export {};
@@ -0,0 +1,46 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local __TS__ObjectDefineProperty = ____lualib.__TS__ObjectDefineProperty
3
+ local ____exports = {}
4
+ local ____unit = require("engine.internal.unit")
5
+ local Unit = ____unit.Unit
6
+ local ____unit = require("engine.standard.fields.unit")
7
+ local AGILITY_UNIT_FIELD = ____unit.AGILITY_UNIT_FIELD
8
+ local INTELLIGENCE_UNIT_FIELD = ____unit.INTELLIGENCE_UNIT_FIELD
9
+ local STRENGTH_UNIT_FIELD = ____unit.STRENGTH_UNIT_FIELD
10
+ __TS__ObjectDefineProperty(
11
+ Unit.prototype,
12
+ "strengthBase",
13
+ {
14
+ get = function(self)
15
+ return STRENGTH_UNIT_FIELD:getValue(self)
16
+ end,
17
+ set = function(self, value)
18
+ STRENGTH_UNIT_FIELD:setValue(self, value)
19
+ end
20
+ }
21
+ )
22
+ __TS__ObjectDefineProperty(
23
+ Unit.prototype,
24
+ "agilityBase",
25
+ {
26
+ get = function(self)
27
+ return AGILITY_UNIT_FIELD:getValue(self)
28
+ end,
29
+ set = function(self, value)
30
+ AGILITY_UNIT_FIELD:setValue(self, value)
31
+ end
32
+ }
33
+ )
34
+ __TS__ObjectDefineProperty(
35
+ Unit.prototype,
36
+ "intelligenceBase",
37
+ {
38
+ get = function(self)
39
+ return INTELLIGENCE_UNIT_FIELD:getValue(self)
40
+ end,
41
+ set = function(self, value)
42
+ INTELLIGENCE_UNIT_FIELD:setValue(self, value)
43
+ end
44
+ }
45
+ )
46
+ return ____exports
@@ -12,6 +12,7 @@ export type UnitAutoAttackDamageBonusId = UnitBonusId<"autoAttackDamage">;
12
12
  export type UnitDamageFactorBonusId = UnitBonusId<"damageFactor">;
13
13
  export type UnitReceivedDamageFactorBonusId = UnitBonusId<"receivedDamageFactor">;
14
14
  export type UnitEvasionProbabilityBonusId = UnitBonusId<"evasionProbability">;
15
+ export type UnitManaRegenerationRateFactorBonusId = UnitBonusId<"manaRegenerationRateFactor">;
15
16
  export type UnitBonusType<Id extends UnitBonusId = UnitBonusId> = ({
16
17
  abilityTypeId: AbilityTypeId;
17
18
  field: jabilityintegerlevelfield;
@@ -36,6 +37,7 @@ export declare namespace UnitBonusType {
36
37
  const DAMAGE_FACTOR: UnitBonusType<UnitReceivedDamageFactorBonusId>;
37
38
  const RECEIVED_DAMAGE_FACTOR: UnitBonusType<UnitReceivedDamageFactorBonusId>;
38
39
  const EVASION_PROBABILITY: UnitBonusType<UnitEvasionProbabilityBonusId>;
40
+ const MANA_REGENERATION_RATE_FACTOR: UnitBonusType<UnitManaRegenerationRateFactorBonusId>;
39
41
  }
40
42
  export declare const addUnitBonus: <Id extends UnitBonusId>(unit: Unit, bonusType: UnitBonusType<Id>, value: number) => Id;
41
43
  export declare const removeUnitBonus: <Id extends UnitBonusId>(unit: Unit, bonusType: UnitBonusType<Id>, id: Id) => boolean;
@@ -24,6 +24,9 @@ local MOVEMENT_SPEED_INCREASE_FACTOR_DUMMY_ABILITY_TYPE_ID = ____movement_2Dspee
24
24
  local ____evasion_2Dprobability = require("engine.internal.object-data.evasion-probability")
25
25
  local EVASION_PROBABILITY_ABILITY_FIELD = ____evasion_2Dprobability.EVASION_PROBABILITY_ABILITY_FIELD
26
26
  local EVASION_PROBABILITY_DUMMY_ABILITY_TYPE_ID = ____evasion_2Dprobability.EVASION_PROBABILITY_DUMMY_ABILITY_TYPE_ID
27
+ local ____mana_2Dregeneration_2Drate_2Dincrease_2Dfactor = require("engine.internal.object-data.mana-regeneration-rate-increase-factor")
28
+ local MANA_REGENERATION_RATE_INCREASE_FACTOR_ABILITY_FIELD = ____mana_2Dregeneration_2Drate_2Dincrease_2Dfactor.MANA_REGENERATION_RATE_INCREASE_FACTOR_ABILITY_FIELD
29
+ local MANA_REGENERATION_RATE_INCREASE_FACTOR_DUMMY_ABILITY_TYPE_ID = ____mana_2Dregeneration_2Drate_2Dincrease_2Dfactor.MANA_REGENERATION_RATE_INCREASE_FACTOR_DUMMY_ABILITY_TYPE_ID
27
30
  local damageFactorByUnit = {}
28
31
  local receivedDamageFactorByUnit = {}
29
32
  local function atLeastOnceProbability(array)
@@ -73,6 +76,13 @@ do
73
76
  reduce = atLeastOnceProbability,
74
77
  initialValue = 0
75
78
  }
79
+ UnitBonusType.MANA_REGENERATION_RATE_FACTOR = {
80
+ abilityTypeId = MANA_REGENERATION_RATE_INCREASE_FACTOR_DUMMY_ABILITY_TYPE_ID,
81
+ field = MANA_REGENERATION_RATE_INCREASE_FACTOR_ABILITY_FIELD,
82
+ integer = false,
83
+ reduce = sum,
84
+ initialValue = 0
85
+ }
76
86
  end
77
87
  local bonusesByUnitByBonusType = {}
78
88
  local nextId = 1
@@ -4,16 +4,16 @@ local ____exports = {}
4
4
  local ____unit = require("engine.internal.unit")
5
5
  local Unit = ____unit.Unit
6
6
  local ____unit = require("engine.standard.fields.unit")
7
- local FLY_HEIGHT_UNIT_FLOAT_FIELD = ____unit.FLY_HEIGHT_UNIT_FLOAT_FIELD
7
+ local FLY_HEIGHT_UNIT_FIELD = ____unit.FLY_HEIGHT_UNIT_FIELD
8
8
  __TS__ObjectDefineProperty(
9
9
  Unit.prototype,
10
10
  "flyHeight",
11
11
  {
12
12
  get = function(self)
13
- return FLY_HEIGHT_UNIT_FLOAT_FIELD:getValue(self)
13
+ return FLY_HEIGHT_UNIT_FIELD:getValue(self)
14
14
  end,
15
15
  set = function(self, value)
16
- FLY_HEIGHT_UNIT_FLOAT_FIELD:setValue(self, value)
16
+ FLY_HEIGHT_UNIT_FIELD:setValue(self, value)
17
17
  end
18
18
  }
19
19
  )
@@ -4,16 +4,16 @@ local ____exports = {}
4
4
  local ____unit = require("engine.internal.unit")
5
5
  local Unit = ____unit.Unit
6
6
  local ____unit = require("engine.standard.fields.unit")
7
- local SCALING_VALUE_UNIT_FLOAT_FIELD = ____unit.SCALING_VALUE_UNIT_FLOAT_FIELD
7
+ local SCALING_VALUE_UNIT_FIELD = ____unit.SCALING_VALUE_UNIT_FIELD
8
8
  __TS__ObjectDefineProperty(
9
9
  Unit.prototype,
10
10
  "scale",
11
11
  {
12
12
  get = function(self)
13
- return SCALING_VALUE_UNIT_FLOAT_FIELD:getValue(self)
13
+ return SCALING_VALUE_UNIT_FIELD:getValue(self)
14
14
  end,
15
15
  set = function(self, value)
16
- SCALING_VALUE_UNIT_FLOAT_FIELD:setValue(self, value)
16
+ SCALING_VALUE_UNIT_FIELD:setValue(self, value)
17
17
  end
18
18
  }
19
19
  )
@@ -177,16 +177,10 @@ export declare class Unit extends Handle<junit> {
177
177
  set xp(v: number);
178
178
  get primaryAttribute(): UnitAttribute;
179
179
  set primaryAttribute(primaryAttribute: UnitAttribute);
180
- get strengthBase(): number;
181
- set strengthBase(strengthBase: number);
182
180
  get strengthBonus(): number;
183
181
  get strength(): number;
184
- get agilityBase(): number;
185
- set agilityBase(agilityBase: number);
186
182
  get agilityBonus(): number;
187
183
  get agility(): number;
188
- get intelligenceBase(): number;
189
- set intelligenceBase(intelligenceBase: number);
190
184
  get intelligenceBonus(): number;
191
185
  get intelligence(): number;
192
186
  get name(): string;
@@ -318,6 +312,7 @@ export declare class Unit extends Handle<junit> {
318
312
  static getInCollisionRange(x: number, y: number, range: number, predicate?: (unit: Unit) => boolean): Unit[];
319
313
  static getInSector(pos: Vec2, range: number, offsetAngle: number, centralAngle: number): Unit[];
320
314
  static getSelectionOf(player: Player, target?: Unit[]): Unit[];
315
+ static readonly levelChangedEvent: UnitTriggerEvent<[]>;
321
316
  static readonly deathEvent: UnitTriggerEvent<[Unit]>;
322
317
  static readonly onDecay: UnitTriggerEvent<[]>;
323
318
  static readonly onResurrect: InitializingEvent<[Unit], void>;
@@ -73,16 +73,12 @@ local getUnitRealField = BlzGetUnitRealField
73
73
  local getHeroStr = GetHeroStr
74
74
  local getHeroAgi = GetHeroAgi
75
75
  local getHeroInt = GetHeroInt
76
- local setHeroStr = SetHeroStr
77
- local setHeroAgi = SetHeroAgi
78
- local setHeroInt = SetHeroInt
79
76
  local getUnitBooleanField = BlzGetUnitBooleanField
80
77
  local getUnitStringField = BlzGetUnitStringField
81
78
  local setUnitIntegerField = BlzSetUnitIntegerField
82
79
  local setUnitRealField = BlzSetUnitRealField
83
80
  local setUnitBooleanField = BlzSetUnitBooleanField
84
81
  local setUnitStringField = BlzSetUnitStringField
85
- local setUnitScale = SetUnitScale
86
82
  local setUnitPosition = SetUnitPosition
87
83
  local setUnitTimeScale = SetUnitTimeScale
88
84
  local getHandleId = GetHandleId
@@ -1392,19 +1388,6 @@ __TS__SetDescriptor(
1392
1388
  },
1393
1389
  true
1394
1390
  )
1395
- __TS__SetDescriptor(
1396
- Unit.prototype,
1397
- "strengthBase",
1398
- {
1399
- get = function(self)
1400
- return getHeroStr(self.handle, false)
1401
- end,
1402
- set = function(self, strengthBase)
1403
- setHeroStr(self.handle, strengthBase, true)
1404
- end
1405
- },
1406
- true
1407
- )
1408
1391
  __TS__SetDescriptor(
1409
1392
  Unit.prototype,
1410
1393
  "strengthBonus",
@@ -1422,19 +1405,6 @@ __TS__SetDescriptor(
1422
1405
  end},
1423
1406
  true
1424
1407
  )
1425
- __TS__SetDescriptor(
1426
- Unit.prototype,
1427
- "agilityBase",
1428
- {
1429
- get = function(self)
1430
- return getHeroAgi(self.handle, false)
1431
- end,
1432
- set = function(self, agilityBase)
1433
- setHeroAgi(self.handle, agilityBase, true)
1434
- end
1435
- },
1436
- true
1437
- )
1438
1408
  __TS__SetDescriptor(
1439
1409
  Unit.prototype,
1440
1410
  "agilityBonus",
@@ -1452,19 +1422,6 @@ __TS__SetDescriptor(
1452
1422
  end},
1453
1423
  true
1454
1424
  )
1455
- __TS__SetDescriptor(
1456
- Unit.prototype,
1457
- "intelligenceBase",
1458
- {
1459
- get = function(self)
1460
- return getHeroInt(self.handle, false)
1461
- end,
1462
- set = function(self, intelligenceBase)
1463
- setHeroInt(self.handle, intelligenceBase, true)
1464
- end
1465
- },
1466
- true
1467
- )
1468
1425
  __TS__SetDescriptor(
1469
1426
  Unit.prototype,
1470
1427
  "intelligenceBonus",
@@ -2172,6 +2129,11 @@ __TS__SetDescriptor(
2172
2129
  end},
2173
2130
  true
2174
2131
  )
2132
+ Unit.levelChangedEvent = __TS__New(
2133
+ ____exports.UnitTriggerEvent,
2134
+ EVENT_PLAYER_HERO_LEVEL,
2135
+ function() return ____exports.Unit:of(getTriggerUnit()) end
2136
+ )
2175
2137
  Unit.deathEvent = __TS__New(
2176
2138
  ____exports.UnitTriggerEvent,
2177
2139
  EVENT_PLAYER_UNIT_DEATH,
@@ -12,7 +12,7 @@ export declare class LocalClient {
12
12
  static get isHD(): boolean;
13
13
  static get graphicsMode(): GraphicsMode;
14
14
  static get isActive(): boolean;
15
- static pingMinimap(x: number, y: number, duration: number, ...parameters: [] | [red: number, green: number, blue: number, extraEffects?: boolean] | [color: Color, extraEffects?: boolean]): void;
15
+ static pingMinimap(x: number, y: number, duration: number, ...parameters: [] | [red: number, green: number, blue: number, flashy?: boolean] | [color: Color, flashy?: boolean]): void;
16
16
  static get mouseFocusUnit(): Async<Unit> | undefined;
17
17
  static get mainSelectedUnit(): Async<Unit> | undefined;
18
18
  static get mainSelectedUnitChangeEvent(): Event<[
@@ -67,7 +67,7 @@ local LocalClient = ____exports.LocalClient
67
67
  LocalClient.name = "LocalClient"
68
68
  function LocalClient.prototype.____constructor(self)
69
69
  end
70
- function LocalClient.pingMinimap(self, x, y, duration, redOrColor, greenOrExtraEffects, blue, extraEffects)
70
+ function LocalClient.pingMinimap(self, x, y, duration, redOrColor, greenOrFlashy, blue, flashy)
71
71
  if redOrColor == nil then
72
72
  pingMinimap(x, y, duration)
73
73
  elseif __TS__InstanceOf(redOrColor, Color) then
@@ -78,7 +78,7 @@ function LocalClient.pingMinimap(self, x, y, duration, redOrColor, greenOrExtraE
78
78
  redOrColor.r,
79
79
  redOrColor.g,
80
80
  redOrColor.b,
81
- greenOrExtraEffects or false
81
+ greenOrFlashy or false
82
82
  )
83
83
  else
84
84
  pingMinimapEx(
@@ -86,9 +86,9 @@ function LocalClient.pingMinimap(self, x, y, duration, redOrColor, greenOrExtraE
86
86
  y,
87
87
  duration,
88
88
  redOrColor,
89
- greenOrExtraEffects,
89
+ greenOrFlashy,
90
90
  blue,
91
- extraEffects or false
91
+ flashy or false
92
92
  )
93
93
  end
94
94
  end
@@ -0,0 +1,8 @@
1
+ /** @noSelfInFile */
2
+ export declare const enum HealthRegenerationType {
3
+ NONE = 0,
4
+ ALWAYS = 1,
5
+ BLIGHT = 2,
6
+ DAY = 3,
7
+ NIGHT = 4
8
+ }
@@ -0,0 +1,2 @@
1
+ local ____exports = {}
2
+ return ____exports
@@ -0,0 +1,8 @@
1
+ /** @noSelfInFile */
2
+ import { AbilityType, AbilityTypeId } from "../ability-type";
3
+ import { ObjectDataEntryLevelFieldValueSupplier } from "../../entry";
4
+ export declare class ManaRegenerationAbilityType extends AbilityType {
5
+ static readonly BASE_ID: AbilityTypeId;
6
+ get manaRegenerationRateIncreaseFactor(): number[];
7
+ set manaRegenerationRateIncreaseFactor(manaRegenerationRateIncreaseFactor: ObjectDataEntryLevelFieldValueSupplier<number>);
8
+ }
@@ -0,0 +1,26 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local __TS__Class = ____lualib.__TS__Class
3
+ local __TS__ClassExtends = ____lualib.__TS__ClassExtends
4
+ local __TS__SetDescriptor = ____lualib.__TS__SetDescriptor
5
+ local ____exports = {}
6
+ local ____ability_2Dtype = require("engine.object-data.entry.ability-type")
7
+ local AbilityType = ____ability_2Dtype.AbilityType
8
+ ____exports.ManaRegenerationAbilityType = __TS__Class()
9
+ local ManaRegenerationAbilityType = ____exports.ManaRegenerationAbilityType
10
+ ManaRegenerationAbilityType.name = "ManaRegenerationAbilityType"
11
+ __TS__ClassExtends(ManaRegenerationAbilityType, AbilityType)
12
+ ManaRegenerationAbilityType.BASE_ID = fourCC("AIrn")
13
+ __TS__SetDescriptor(
14
+ ManaRegenerationAbilityType.prototype,
15
+ "manaRegenerationRateIncreaseFactor",
16
+ {
17
+ get = function(self)
18
+ return self:getNumberLevelField("Imrp")
19
+ end,
20
+ set = function(self, manaRegenerationRateIncreaseFactor)
21
+ self:setNumberLevelField("Imrp", manaRegenerationRateIncreaseFactor)
22
+ end
23
+ },
24
+ true
25
+ )
26
+ return ____exports
@@ -15,12 +15,16 @@ export declare abstract class DestructibleType extends ObjectDataEntry<Destructi
15
15
  protected static getObjectData(map: WarMap): WarObjects;
16
16
  get fixedFacing(): number;
17
17
  set fixedFacing(fixedFacing: number);
18
+ get flyOverHeight(): number;
19
+ set flyOverHeight(flyOverHeight: number);
18
20
  get modelPath(): string;
19
21
  set modelPath(modelPath: string);
20
22
  get modelPathSD(): string;
21
23
  set modelPathSD(modelPathSD: string);
22
24
  get modelPathHD(): string;
23
25
  set modelPathHD(modelPathHD: string);
26
+ get occlusionHeight(): number;
27
+ set occlusionHeight(occlusionHeight: number);
24
28
  get armorSoundType(): ArmorSoundType;
25
29
  set armorSoundType(armorSoundType: ArmorSoundType);
26
30
  get armorSoundTypeSD(): ArmorSoundType;
@@ -29,8 +33,14 @@ export declare abstract class DestructibleType extends ObjectDataEntry<Destructi
29
33
  set armorSoundTypeHD(armorSoundTypeHD: ArmorSoundType);
30
34
  get combatClassifications(): CombatClassifications;
31
35
  set combatClassifications(combatClassifications: CombatClassifications);
36
+ get cliffHeight(): number;
37
+ set cliffHeight(cliffHeight: number);
38
+ get isWalkable(): boolean;
39
+ set isWalkable(isWalkable: boolean);
32
40
  get pathingTexturePath(): string;
33
41
  set pathingTexturePath(pathingTexturePath: string);
34
42
  get deadPathingTexturePath(): string;
35
43
  set deadPathingTexturePath(deadPathingTexturePath: string);
44
+ get name(): string;
45
+ set name(name: string);
36
46
  }
@@ -40,6 +40,19 @@ __TS__SetDescriptor(
40
40
  },
41
41
  true
42
42
  )
43
+ __TS__SetDescriptor(
44
+ DestructibleType.prototype,
45
+ "flyOverHeight",
46
+ {
47
+ get = function(self)
48
+ return self:getNumberField("bflh")
49
+ end,
50
+ set = function(self, flyOverHeight)
51
+ self:setNumberField("bflh", flyOverHeight)
52
+ end
53
+ },
54
+ true
55
+ )
43
56
  __TS__SetDescriptor(
44
57
  DestructibleType.prototype,
45
58
  "modelPath",
@@ -79,6 +92,19 @@ __TS__SetDescriptor(
79
92
  },
80
93
  true
81
94
  )
95
+ __TS__SetDescriptor(
96
+ DestructibleType.prototype,
97
+ "occlusionHeight",
98
+ {
99
+ get = function(self)
100
+ return self:getNumberField("boch")
101
+ end,
102
+ set = function(self, occlusionHeight)
103
+ self:setNumberField("boch", occlusionHeight)
104
+ end
105
+ },
106
+ true
107
+ )
82
108
  __TS__SetDescriptor(
83
109
  DestructibleType.prototype,
84
110
  "armorSoundType",
@@ -134,6 +160,32 @@ __TS__SetDescriptor(
134
160
  },
135
161
  true
136
162
  )
163
+ __TS__SetDescriptor(
164
+ DestructibleType.prototype,
165
+ "cliffHeight",
166
+ {
167
+ get = function(self)
168
+ return self:getNumberField("bclh")
169
+ end,
170
+ set = function(self, cliffHeight)
171
+ self:setNumberField("bclh", cliffHeight)
172
+ end
173
+ },
174
+ true
175
+ )
176
+ __TS__SetDescriptor(
177
+ DestructibleType.prototype,
178
+ "isWalkable",
179
+ {
180
+ get = function(self)
181
+ return self:getBooleanField("bwal")
182
+ end,
183
+ set = function(self, isWalkable)
184
+ self:setBooleanField("bwal", isWalkable)
185
+ end
186
+ },
187
+ true
188
+ )
137
189
  __TS__SetDescriptor(
138
190
  DestructibleType.prototype,
139
191
  "pathingTexturePath",
@@ -160,6 +212,19 @@ __TS__SetDescriptor(
160
212
  },
161
213
  true
162
214
  )
215
+ __TS__SetDescriptor(
216
+ DestructibleType.prototype,
217
+ "name",
218
+ {
219
+ get = function(self)
220
+ return self:getStringField("bnam")
221
+ end,
222
+ set = function(self, name)
223
+ self:setStringField("bnam", name)
224
+ end
225
+ },
226
+ true
227
+ )
163
228
  implementReadonlyNumberIndexSupplier(
164
229
  ____exports.DestructibleType,
165
230
  function(id)
@@ -5,6 +5,7 @@ import { UnitType, UnitTypeId } from "../object-data/entry/unit-type";
5
5
  import { ReadonlyNonEmptyLinkedSet } from "../../utility/linked-set";
6
6
  import { AttackType } from "../object-data/auxiliary/attack-type";
7
7
  import { UnitClassifications } from "../object-data/auxiliary/unit-classification";
8
+ import { HealthRegenerationType } from "../object-data/auxiliary/health-regeneration-type";
8
9
  export declare abstract class UnitField<ValueType extends number | string | boolean = number | string | boolean, NativeFieldType = any> extends ObjectField<UnitType, Unit, ValueType, NativeFieldType> {
9
10
  protected get instanceClass(): typeof Unit;
10
11
  protected getObjectDataEntryId(instance: Unit): UnitTypeId;
@@ -25,11 +26,11 @@ export declare class UnitFloatField extends UnitField<number, junitrealfield> {
25
26
  protected setNativeFieldValue(instance: Unit, value: number): boolean;
26
27
  static get valueChangeEvent(): ObjectFieldValueChangeEvent<ReadonlyObjectFieldType<UnitFloatField>>;
27
28
  }
28
- export declare class UnitIntegerField extends UnitField<number, junitintegerfield> {
29
- protected get defaultValue(): number;
29
+ export declare class UnitIntegerField<T extends number = number> extends UnitField<T, junitintegerfield> {
30
+ protected get defaultValue(): T;
30
31
  protected getNativeFieldById(id: number): junitintegerfield;
31
- protected getNativeFieldValue(instance: Unit): number;
32
- protected setNativeFieldValue(instance: Unit, value: number): boolean;
32
+ protected getNativeFieldValue(instance: Unit): T;
33
+ protected setNativeFieldValue(instance: Unit, value: T): boolean;
33
34
  static get valueChangeEvent(): ObjectFieldValueChangeEvent<ReadonlyObjectFieldType<UnitIntegerField>>;
34
35
  }
35
36
  export declare class UnitStringField extends UnitField<string, junitstringfield> {
@@ -76,6 +77,8 @@ export declare class UnitPropulsionWindowField extends UnitFloatField {
76
77
  protected getNativeFieldValue(instance: Unit): number;
77
78
  protected setNativeFieldValue(instance: Unit, value: number): boolean;
78
79
  }
80
+ export declare class UnitHealthRegenerationTypeField extends UnitIntegerField<HealthRegenerationType> {
81
+ }
79
82
  export declare class UnitScalingValueField extends UnitFloatField {
80
83
  protected setNativeFieldValue(instance: Unit, value: number): boolean;
81
84
  }
@@ -298,6 +298,10 @@ function UnitPropulsionWindowField.prototype.setNativeFieldValue(self, instance,
298
298
  setUnitPropulsionWindow(instance.handle, value)
299
299
  return true
300
300
  end
301
+ ____exports.UnitHealthRegenerationTypeField = __TS__Class()
302
+ local UnitHealthRegenerationTypeField = ____exports.UnitHealthRegenerationTypeField
303
+ UnitHealthRegenerationTypeField.name = "UnitHealthRegenerationTypeField"
304
+ __TS__ClassExtends(UnitHealthRegenerationTypeField, ____exports.UnitIntegerField)
301
305
  ____exports.UnitScalingValueField = __TS__Class()
302
306
  local UnitScalingValueField = ____exports.UnitScalingValueField
303
307
  UnitScalingValueField.name = "UnitScalingValueField"
@@ -46,6 +46,7 @@ export declare abstract class ObjectField<ObjectDataEntryType extends ObjectData
46
46
  private modifiersByInstance?;
47
47
  getValue(entry: ObjectDataEntryType | InstanceType, includeModifiers?: boolean): ValueType;
48
48
  setValue(entry: ObjectDataEntryType | InstanceType, value: ValueType): boolean;
49
+ updateActualValue(instance: InstanceType): void;
49
50
  applyModifier(instance: InstanceType, modifier: ObjectFieldModifier<InstanceType, ValueType>): void;
50
51
  removeModifier(instance: InstanceType, modifier: ObjectFieldModifier<InstanceType, ValueType>): boolean;
51
52
  removeValue(entry: ObjectDataEntryType): boolean;
@@ -89,6 +90,7 @@ export declare abstract class ObjectLevelField<ObjectDataEntryType extends Objec
89
90
  protected abstract getLevelCount(entry: ObjectDataEntryType | InstanceType): number;
90
91
  getValue<LevelType extends [number] | []>(entry: ObjectDataEntryType | InstanceType, ...[level]: LevelType): LevelType extends [number] ? ValueType : ValueType[];
91
92
  setValue(entry: ObjectDataEntryType | InstanceType, ...[levelOrValue, value]: [value: ObjectDataEntryLevelFieldValueSupplier<InputValueType, ValueType>] | [level: number, value: InputValueType]): boolean;
93
+ updateActualValue(instance: InstanceType, level?: number): void;
92
94
  applyModifier(instance: InstanceType, modifier: ObjectLevelFieldModifier<InstanceType, ValueType>): void;
93
95
  removeModifier(instance: InstanceType, modifier: ObjectLevelFieldModifier<InstanceType, ValueType>): boolean;
94
96
  trySetValue(entry: ObjectDataEntryType | InstanceType, levelOrValue: number | unknown, value?: unknown): boolean;
@@ -139,7 +139,7 @@ function ObjectField.prototype.setValue(self, entry, value)
139
139
  return true
140
140
  end
141
141
  originalValueByInstance[entry] = value
142
- value = self:calculateActualValue(entry)
142
+ value = (self:calculateActualValue(entry))
143
143
  end
144
144
  end
145
145
  local previousValue = self:setActualValue(entry, value)
@@ -163,6 +163,12 @@ function ObjectField.prototype.setValue(self, entry, value)
163
163
  end
164
164
  return true
165
165
  end
166
+ function ObjectField.prototype.updateActualValue(self, instance)
167
+ local actualValue, hasModifiers = self:calculateActualValue(instance)
168
+ if hasModifiers then
169
+ self:setActualValue(instance, actualValue)
170
+ end
171
+ end
166
172
  function ObjectField.prototype.applyModifier(self, instance, modifier)
167
173
  local modifiersByInstance = self.modifiersByInstance
168
174
  if modifiersByInstance == nil then
@@ -182,10 +188,7 @@ function ObjectField.prototype.applyModifier(self, instance, modifier)
182
188
  ____originalValueByInstance_instance_3 = self:getActualValue(instance)
183
189
  end
184
190
  ____originalValueByInstance_4[____instance_5] = ____originalValueByInstance_instance_3
185
- self:setActualValue(
186
- instance,
187
- self:calculateActualValue(instance)
188
- )
191
+ self:setActualValue(instance, (self:calculateActualValue(instance)))
189
192
  end
190
193
  end
191
194
  function ObjectField.prototype.removeModifier(self, instance, modifier)
@@ -193,10 +196,7 @@ function ObjectField.prototype.removeModifier(self, instance, modifier)
193
196
  if modifiersByInstance ~= nil then
194
197
  local modifiers = modifiersByInstance[instance]
195
198
  if modifiers ~= nil and modifiers:remove(modifier) then
196
- self:setActualValue(
197
- instance,
198
- self:calculateActualValue(instance)
199
- )
199
+ self:setActualValue(instance, (self:calculateActualValue(instance)))
200
200
  return true
201
201
  end
202
202
  end
@@ -283,10 +283,11 @@ function ObjectField.prototype.calculateActualValue(self, instance)
283
283
  for modifier in pairs(modifiers) do
284
284
  value = modifier(instance, value, originalValue)
285
285
  end
286
+ return value, true
286
287
  end
287
- return value
288
+ return value, false
288
289
  end
289
- return self.defaultValue
290
+ return self.defaultValue, false
290
291
  end
291
292
  function ObjectField.prototype.invokeValueChangeEvent(self, ...)
292
293
  self:invokeValueChangeEventRecursive(
@@ -512,6 +513,27 @@ function ObjectLevelField.prototype.setValue(self, entry, levelOrValue, value)
512
513
  end
513
514
  return true
514
515
  end
516
+ function ObjectLevelField.prototype.updateActualValue(self, instance, level)
517
+ local modifiersByInstance = self.modifiersByInstance
518
+ if modifiersByInstance == nil then
519
+ return
520
+ end
521
+ local modifiers = modifiersByInstance[instance]
522
+ if modifiers == nil or modifiers.size == 0 then
523
+ return
524
+ end
525
+ if level == nil then
526
+ for i = 0, self:getLevelCount(instance) - 1 do
527
+ self:updateActualValue(instance, i)
528
+ end
529
+ return
530
+ end
531
+ self:setActualValue(
532
+ instance,
533
+ level,
534
+ self:calculateActualValue(instance, level)
535
+ )
536
+ end
515
537
  function ObjectLevelField.prototype.applyModifier(self, instance, modifier)
516
538
  local modifiersByInstance = self.modifiersByInstance
517
539
  if modifiersByInstance == nil then
@@ -1,6 +1,12 @@
1
1
  /** @noSelfInFile */
2
- import { UnitClassificationsField, UnitFlyHeightField, UnitPropulsionWindowField, UnitScalingValueField } from "../../object-field/unit";
3
- export declare const PROPULSION_WINDOW_UNIT_FLOAT_FIELD: UnitPropulsionWindowField & symbol;
4
- export declare const UNIT_CLASSIFICATIONS_FIELD: UnitClassificationsField & symbol;
5
- export declare const FLY_HEIGHT_UNIT_FLOAT_FIELD: UnitFlyHeightField & symbol;
6
- export declare const SCALING_VALUE_UNIT_FLOAT_FIELD: UnitScalingValueField & symbol;
2
+ import { UnitClassificationsField, UnitFloatField, UnitFlyHeightField, UnitHealthRegenerationTypeField, UnitIntegerField, UnitPropulsionWindowField, UnitScalingValueField } from "../../object-field/unit";
3
+ export declare const PROPULSION_WINDOW_UNIT_FIELD: UnitPropulsionWindowField & symbol;
4
+ export declare const CLASSIFICATIONS_UNIT_FIELD: UnitClassificationsField & symbol;
5
+ export declare const FLY_HEIGHT_UNIT_FIELD: UnitFlyHeightField & symbol;
6
+ export declare const SCALING_VALUE_UNIT_FIELD: UnitScalingValueField & symbol;
7
+ export declare const HEALTH_REGENERATION_RATE_UNIT_FIELD: UnitFloatField & symbol;
8
+ export declare const MANA_REGENERATION_RATE_UNIT_FIELD: UnitFloatField & symbol;
9
+ export declare const HEALTH_REGENERATION_TYPE_UNIT_FIELD: UnitHealthRegenerationTypeField & symbol;
10
+ export declare const STRENGTH_UNIT_FIELD: UnitIntegerField<number> & symbol;
11
+ export declare const AGILITY_UNIT_FIELD: UnitIntegerField<number> & symbol;
12
+ export declare const INTELLIGENCE_UNIT_FIELD: UnitIntegerField<number> & symbol;
@@ -1,11 +1,20 @@
1
1
  local ____exports = {}
2
2
  local ____unit = require("engine.object-field.unit")
3
3
  local UnitClassificationsField = ____unit.UnitClassificationsField
4
+ local UnitFloatField = ____unit.UnitFloatField
4
5
  local UnitFlyHeightField = ____unit.UnitFlyHeightField
6
+ local UnitHealthRegenerationTypeField = ____unit.UnitHealthRegenerationTypeField
7
+ local UnitIntegerField = ____unit.UnitIntegerField
5
8
  local UnitPropulsionWindowField = ____unit.UnitPropulsionWindowField
6
9
  local UnitScalingValueField = ____unit.UnitScalingValueField
7
- ____exports.PROPULSION_WINDOW_UNIT_FLOAT_FIELD = UnitPropulsionWindowField:create(fourCC("urpw"))
8
- ____exports.UNIT_CLASSIFICATIONS_FIELD = UnitClassificationsField:create(fourCC("utyp"))
9
- ____exports.FLY_HEIGHT_UNIT_FLOAT_FIELD = UnitFlyHeightField:create(fourCC("ufyh"))
10
- ____exports.SCALING_VALUE_UNIT_FLOAT_FIELD = UnitScalingValueField:create(fourCC("usca"))
10
+ ____exports.PROPULSION_WINDOW_UNIT_FIELD = UnitPropulsionWindowField:create(fourCC("urpw"))
11
+ ____exports.CLASSIFICATIONS_UNIT_FIELD = UnitClassificationsField:create(fourCC("utyp"))
12
+ ____exports.FLY_HEIGHT_UNIT_FIELD = UnitFlyHeightField:create(fourCC("ufyh"))
13
+ ____exports.SCALING_VALUE_UNIT_FIELD = UnitScalingValueField:create(fourCC("usca"))
14
+ ____exports.HEALTH_REGENERATION_RATE_UNIT_FIELD = UnitFloatField:create(fourCC("uhpr"))
15
+ ____exports.MANA_REGENERATION_RATE_UNIT_FIELD = UnitFloatField:create(fourCC("umpr"))
16
+ ____exports.HEALTH_REGENERATION_TYPE_UNIT_FIELD = UnitHealthRegenerationTypeField:create(fourCC("uhrt"))
17
+ ____exports.STRENGTH_UNIT_FIELD = UnitIntegerField:create(fourCC("ustc"))
18
+ ____exports.AGILITY_UNIT_FIELD = UnitIntegerField:create(fourCC("uagc"))
19
+ ____exports.INTELLIGENCE_UNIT_FIELD = UnitIntegerField:create(fourCC("uinc"))
11
20
  return ____exports
package/engine/unit.d.ts CHANGED
@@ -19,6 +19,7 @@ import "./internal/unit/invulnerability-counter";
19
19
  import "./internal/unit/detach-missiles";
20
20
  import "./internal/unit/main-selected";
21
21
  import "./internal/unit/add-item-to-slot-init";
22
+ import "./internal/unit/attributes";
22
23
  import "./internal/unit/fly-height";
23
24
  import "./internal/unit/scale";
24
25
  import "./internal/unit/band-aids/ancestral-spirit-cannibalize";
package/engine/unit.lua CHANGED
@@ -19,6 +19,7 @@ require("engine.internal.unit.invulnerability-counter")
19
19
  require("engine.internal.unit.detach-missiles")
20
20
  require("engine.internal.unit.main-selected")
21
21
  require("engine.internal.unit.add-item-to-slot-init")
22
+ require("engine.internal.unit.attributes")
22
23
  require("engine.internal.unit.fly-height")
23
24
  require("engine.internal.unit.scale")
24
25
  require("engine.internal.unit.band-aids.ancestral-spirit-cannibalize")
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.1d4a073",
4
+ "version": "0.0.1-dev.1da5f63",
5
5
  "description": "A typescript library for Warcraft III using Warpack.",
6
6
  "keywords": [
7
7
  "warcraft",