warscript 0.0.1-dev.e5e97e8 → 0.0.1-dev.e698bed

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.
@@ -100,7 +100,7 @@ function ObjectField.prototype.getValue(self, entry, includeModifiers)
100
100
  end
101
101
  return self.defaultValue
102
102
  end
103
- if includeModifiers == false then
103
+ if not includeModifiers then
104
104
  local originalValueByInstance = self.originalValueByInstance
105
105
  if originalValueByInstance ~= nil then
106
106
  local originalValue = originalValueByInstance[entry]
@@ -235,10 +235,8 @@ function ObjectField.prototype.setActualValue(self, instance, value)
235
235
  ____self_valueByInstance_instance_6_7 = self.defaultValue
236
236
  end
237
237
  local previousValue = ____self_valueByInstance_instance_6_7
238
- if value ~= previousValue then
239
- self.valueByInstance[instance] = value
240
- self:invokeValueChangeEvent(instance, self, previousValue, value)
241
- end
238
+ self.valueByInstance[instance] = value
239
+ self:invokeValueChangeEvent(instance, self, previousValue, value)
242
240
  return true
243
241
  end
244
242
  end
@@ -246,12 +244,10 @@ function ObjectField.prototype.setActualValue(self, instance, value)
246
244
  return false
247
245
  end
248
246
  local previousValue = self:getNativeFieldValue(instance)
249
- if value ~= previousValue then
250
- if not self:setNativeFieldValue(instance, value) then
251
- return false
252
- end
253
- self:invokeValueChangeEvent(instance, self, previousValue, value)
247
+ if value ~= previousValue and not self:setNativeFieldValue(instance, value) then
248
+ return false
254
249
  end
250
+ self:invokeValueChangeEvent(instance, self, previousValue, value)
255
251
  return true
256
252
  end
257
253
  function ObjectField.prototype.calculateActualValue(self, instance)
@@ -407,6 +403,12 @@ function ObjectLevelField.prototype.getValue(self, entry, level)
407
403
  end
408
404
  return self.defaultValue
409
405
  end
406
+ local ____opt_19 = self.originalValueByLevelByInstance
407
+ local ____opt_17 = ____opt_19 and ____opt_19[entry]
408
+ local originalValue = ____opt_17 and ____opt_17[level]
409
+ if originalValue ~= nil then
410
+ return originalValue
411
+ end
410
412
  return self:getActualValue(entry, level)
411
413
  end
412
414
  function ObjectLevelField.prototype.setValue(self, entry, levelOrValue, value)
@@ -477,11 +479,11 @@ function ObjectLevelField.prototype.applyModifier(self, instance, modifier)
477
479
  local originalValueByLevel = getOrPut(originalValueByLevelByInstance, instance, mutableLuaMap)
478
480
  local levelCount = self:getLevelCount(instance)
479
481
  for level = 0, levelCount - 1 do
480
- local ____originalValueByLevel_level_17 = originalValueByLevel[level]
481
- if ____originalValueByLevel_level_17 == nil then
482
- ____originalValueByLevel_level_17 = self:getActualValue(instance, level)
482
+ local ____originalValueByLevel_level_21 = originalValueByLevel[level]
483
+ if ____originalValueByLevel_level_21 == nil then
484
+ ____originalValueByLevel_level_21 = self:getActualValue(instance, level)
483
485
  end
484
- originalValueByLevel[level] = ____originalValueByLevel_level_17
486
+ originalValueByLevel[level] = ____originalValueByLevel_level_21
485
487
  self:setActualValue(
486
488
  instance,
487
489
  level,
@@ -528,23 +530,23 @@ function ObjectLevelField.prototype.getActualValue(self, instance, level)
528
530
  if defaultValueByObjectDataEntryId ~= nil or self.isGlobal then
529
531
  local defaultValueByLevel = (defaultValueByObjectDataEntryId or emptyLuaMap())[self:getObjectDataEntryId(instance)]
530
532
  if defaultValueByLevel ~= nil or self.isGlobal then
531
- local ____opt_18 = self.valueByInstance[instance]
532
- local ____temp_20 = ____opt_18 and ____opt_18[level + 1]
533
- if ____temp_20 == nil then
534
- ____temp_20 = (defaultValueByLevel or emptyArray())[level + 1]
533
+ local ____opt_22 = self.valueByInstance[instance]
534
+ local ____temp_24 = ____opt_22 and ____opt_22[level + 1]
535
+ if ____temp_24 == nil then
536
+ ____temp_24 = (defaultValueByLevel or emptyArray())[level + 1]
535
537
  end
536
- local ____temp_20_21 = ____temp_20
537
- if ____temp_20_21 == nil then
538
- ____temp_20_21 = self.defaultValue
538
+ local ____temp_24_25 = ____temp_24
539
+ if ____temp_24_25 == nil then
540
+ ____temp_24_25 = self.defaultValue
539
541
  end
540
- return ____temp_20_21
542
+ return ____temp_24_25
541
543
  end
542
544
  end
543
- local ____temp_22 = self:getNativeFieldValue(instance, level)
544
- if ____temp_22 == nil then
545
- ____temp_22 = self.defaultValue
545
+ local ____temp_26 = self:getNativeFieldValue(instance, level)
546
+ if ____temp_26 == nil then
547
+ ____temp_26 = self.defaultValue
546
548
  end
547
- return ____temp_22
549
+ return ____temp_26
548
550
  end
549
551
  function ObjectLevelField.prototype.setActualValue(self, instance, level, value)
550
552
  local defaultValueByObjectDataEntryId = defaultValueByObjectDataEntryIdByObjectFieldId[self.id]
@@ -557,25 +559,23 @@ function ObjectLevelField.prototype.setActualValue(self, instance, level, value)
557
559
  valueByLevel = {}
558
560
  self.valueByInstance[instance] = valueByLevel
559
561
  end
560
- local ____valueByLevel_index_23 = valueByLevel[level + 1]
561
- if ____valueByLevel_index_23 == nil then
562
- ____valueByLevel_index_23 = (defaultValueByLevel or emptyArray())[level + 1]
563
- end
564
- local ____valueByLevel_index_23_24 = ____valueByLevel_index_23
565
- if ____valueByLevel_index_23_24 == nil then
566
- ____valueByLevel_index_23_24 = self.defaultValue
562
+ local ____valueByLevel_index_27 = valueByLevel[level + 1]
563
+ if ____valueByLevel_index_27 == nil then
564
+ ____valueByLevel_index_27 = (defaultValueByLevel or emptyArray())[level + 1]
567
565
  end
568
- local previousValue = ____valueByLevel_index_23_24
569
- if value ~= previousValue then
570
- valueByLevel[level + 1] = value
571
- self:invokeValueChangeEvent(
572
- instance,
573
- self,
574
- level,
575
- previousValue,
576
- value
577
- )
566
+ local ____valueByLevel_index_27_28 = ____valueByLevel_index_27
567
+ if ____valueByLevel_index_27_28 == nil then
568
+ ____valueByLevel_index_27_28 = self.defaultValue
578
569
  end
570
+ local previousValue = ____valueByLevel_index_27_28
571
+ valueByLevel[level + 1] = value
572
+ self:invokeValueChangeEvent(
573
+ instance,
574
+ self,
575
+ level,
576
+ previousValue,
577
+ value
578
+ )
579
579
  return true
580
580
  end
581
581
  end
@@ -583,26 +583,24 @@ function ObjectLevelField.prototype.setActualValue(self, instance, level, value)
583
583
  return false
584
584
  end
585
585
  local previousValue = self:getNativeFieldValue(instance, level)
586
- if value ~= previousValue then
587
- if not self:setNativeFieldValue(instance, level, value) then
588
- return false
589
- end
590
- self:invokeValueChangeEvent(
591
- instance,
592
- self,
593
- level,
594
- previousValue,
595
- value
596
- )
586
+ if value ~= previousValue and not self:setNativeFieldValue(instance, level, value) then
587
+ return false
597
588
  end
589
+ self:invokeValueChangeEvent(
590
+ instance,
591
+ self,
592
+ level,
593
+ previousValue,
594
+ value
595
+ )
598
596
  return true
599
597
  end
600
598
  function ObjectLevelField.prototype.calculateActualValue(self, instance, level)
601
- local ____opt_27 = self.originalValueByLevelByInstance
602
- local ____opt_25 = ____opt_27 and ____opt_27[instance]
603
- local originalValue = ____opt_25 and ____opt_25[level]
604
- local ____opt_29 = self.modifiersByInstance
605
- local modifiers = ____opt_29 and ____opt_29[instance]
599
+ local ____opt_31 = self.originalValueByLevelByInstance
600
+ local ____opt_29 = ____opt_31 and ____opt_31[instance]
601
+ local originalValue = ____opt_29 and ____opt_29[level]
602
+ local ____opt_33 = self.modifiersByInstance
603
+ local modifiers = ____opt_33 and ____opt_33[instance]
606
604
  if originalValue ~= nil then
607
605
  local value = originalValue
608
606
  if modifiers ~= nil then
@@ -376,8 +376,8 @@ export declare const INVISIBILITY_TRANSITION_TIME_ABILITY_FLOAT_LEVEL_FIELD: Abi
376
376
  export declare const ACTIVATION_RADIUS_ABILITY_FLOAT_LEVEL_FIELD: AbilityFloatLevelField & symbol;
377
377
  export declare const AMOUNT_REGENERATED_ABILITY_FLOAT_LEVEL_FIELD: AbilityFloatLevelField & symbol;
378
378
  export declare const DAMAGE_PER_SECOND_POI1_ABILITY_FLOAT_LEVEL_FIELD: AbilityFloatLevelField & symbol;
379
- export declare const ATTACK_SPEED_FACTOR_POI2_ABILITY_FLOAT_LEVEL_FIELD: AbilityFloatLevelField & symbol;
380
- export declare const MOVEMENT_SPEED_FACTOR_POI3_ABILITY_FLOAT_LEVEL_FIELD: AbilityFloatLevelField & symbol;
379
+ export declare const MOVEMENT_SPEED_FACTOR_POI2_ABILITY_FLOAT_LEVEL_FIELD: AbilityFloatLevelField & symbol;
380
+ export declare const ATTACK_SPEED_FACTOR_POI3_ABILITY_FLOAT_LEVEL_FIELD: AbilityFloatLevelField & symbol;
381
381
  export declare const EXTRA_DAMAGE_POA1_ABILITY_FLOAT_LEVEL_FIELD: AbilityFloatLevelField & symbol;
382
382
  export declare const DAMAGE_PER_SECOND_POA2_ABILITY_FLOAT_LEVEL_FIELD: AbilityFloatLevelField & symbol;
383
383
  export declare const ATTACK_SPEED_FACTOR_POA3_ABILITY_FLOAT_LEVEL_FIELD: AbilityFloatLevelField & symbol;
@@ -387,8 +387,8 @@ ____exports.INVISIBILITY_TRANSITION_TIME_ABILITY_FLOAT_LEVEL_FIELD = AbilityFloa
387
387
  ____exports.ACTIVATION_RADIUS_ABILITY_FLOAT_LEVEL_FIELD = AbilityFloatLevelField:create(fourCC("Neu1"))
388
388
  ____exports.AMOUNT_REGENERATED_ABILITY_FLOAT_LEVEL_FIELD = AbilityFloatLevelField:create(fourCC("Arm1"))
389
389
  ____exports.DAMAGE_PER_SECOND_POI1_ABILITY_FLOAT_LEVEL_FIELD = AbilityFloatLevelField:create(fourCC("Poi1"))
390
- ____exports.ATTACK_SPEED_FACTOR_POI2_ABILITY_FLOAT_LEVEL_FIELD = AbilityFloatLevelField:create(fourCC("Poi2"))
391
- ____exports.MOVEMENT_SPEED_FACTOR_POI3_ABILITY_FLOAT_LEVEL_FIELD = AbilityFloatLevelField:create(fourCC("Poi3"))
390
+ ____exports.MOVEMENT_SPEED_FACTOR_POI2_ABILITY_FLOAT_LEVEL_FIELD = AbilityFloatLevelField:create(fourCC("Poi2"))
391
+ ____exports.ATTACK_SPEED_FACTOR_POI3_ABILITY_FLOAT_LEVEL_FIELD = AbilityFloatLevelField:create(fourCC("Poi3"))
392
392
  ____exports.EXTRA_DAMAGE_POA1_ABILITY_FLOAT_LEVEL_FIELD = AbilityFloatLevelField:create(fourCC("Poa1"))
393
393
  ____exports.DAMAGE_PER_SECOND_POA2_ABILITY_FLOAT_LEVEL_FIELD = AbilityFloatLevelField:create(fourCC("Poa2"))
394
394
  ____exports.ATTACK_SPEED_FACTOR_POA3_ABILITY_FLOAT_LEVEL_FIELD = AbilityFloatLevelField:create(fourCC("Poa3"))
@@ -1,4 +1,6 @@
1
1
  /** @noSelfInFile */
2
- import { UnitClassificationsField, UnitPropulsionWindowField } from "../../object-field/unit";
2
+ import { UnitClassificationsField, UnitFlyHeightField, UnitPropulsionWindowField, UnitScalingValueField } from "../../object-field/unit";
3
3
  export declare const PROPULSION_WINDOW_UNIT_FLOAT_FIELD: UnitPropulsionWindowField & symbol;
4
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;
@@ -1,7 +1,11 @@
1
1
  local ____exports = {}
2
2
  local ____unit = require("engine.object-field.unit")
3
3
  local UnitClassificationsField = ____unit.UnitClassificationsField
4
+ local UnitFlyHeightField = ____unit.UnitFlyHeightField
4
5
  local UnitPropulsionWindowField = ____unit.UnitPropulsionWindowField
6
+ local UnitScalingValueField = ____unit.UnitScalingValueField
5
7
  ____exports.PROPULSION_WINDOW_UNIT_FLOAT_FIELD = UnitPropulsionWindowField:create(fourCC("urpw"))
6
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"))
7
11
  return ____exports
package/engine/unit.d.ts CHANGED
@@ -19,6 +19,8 @@ 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/fly-height";
23
+ import "./internal/unit/scale";
22
24
  import "./internal/unit/band-aids/ancestral-spirit-cannibalize";
23
25
  export { Unit, DamagingEvent, DamageEvent } from "./internal/unit";
24
26
  export * from "./internal/unit+damage";
package/engine/unit.lua CHANGED
@@ -19,6 +19,8 @@ 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.fly-height")
23
+ require("engine.internal.unit.scale")
22
24
  require("engine.internal.unit.band-aids.ancestral-spirit-cannibalize")
23
25
  do
24
26
  local ____unit = require("engine.internal.unit")
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.e5e97e8",
4
+ "version": "0.0.1-dev.e698bed",
5
5
  "description": "A typescript library for Warcraft III using Warpack.",
6
6
  "keywords": [
7
7
  "warcraft",