warscript 0.0.1-dev.e1acea3 → 0.0.1-dev.e72b4b0
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/attributes.d.ts +5 -0
- package/attributes.lua +8 -1
- package/config.d.ts +5 -0
- package/config.lua +10 -0
- package/core/types/effect.d.ts +2 -3
- package/core/types/effect.lua +95 -48
- package/core/types/sound.d.ts +17 -24
- package/core/types/sound.lua +99 -24
- package/core/types/timer.d.ts +6 -7
- package/core/types/timer.lua +18 -21
- package/core/util.d.ts +1 -1
- package/core/util.lua +12 -1
- package/decl/native.d.ts +840 -786
- package/engine/behaviour/ability/always-enabled.d.ts +7 -0
- package/engine/behaviour/ability/always-enabled.lua +31 -0
- package/engine/behaviour/ability/apply-buff.d.ts +5 -0
- package/engine/behaviour/ability/apply-buff.lua +32 -0
- package/engine/behaviour/ability/apply-unit-behavior.lua +1 -0
- package/engine/behaviour/ability/damage.d.ts +9 -3
- package/engine/behaviour/ability/damage.lua +26 -38
- package/engine/behaviour/ability/emulate-impact.lua +20 -7
- package/engine/behaviour/ability/on-command-impact.lua +7 -0
- package/engine/behaviour/ability/remove-buffs.d.ts +4 -1
- package/engine/behaviour/ability/remove-buffs.lua +8 -2
- package/engine/behaviour/ability.d.ts +15 -3
- package/engine/behaviour/ability.lua +78 -6
- package/engine/behaviour/unit.d.ts +24 -0
- package/engine/behaviour/unit.lua +150 -4
- package/engine/buff.d.ts +56 -41
- package/engine/buff.lua +295 -228
- package/engine/internal/ability.d.ts +15 -1
- package/engine/internal/ability.lua +84 -2
- package/engine/internal/item/ability.lua +112 -4
- package/engine/internal/item.d.ts +7 -4
- package/engine/internal/item.lua +131 -28
- package/engine/internal/mechanics/ability-duration.lua +1 -1
- package/engine/internal/misc/ability-disable-counter.d.ts +2 -0
- package/engine/internal/misc/ability-disable-counter.lua +13 -0
- package/engine/internal/misc/damage-metadata-by-target.d.ts +2 -0
- package/engine/internal/misc/damage-metadata-by-target.lua +5 -0
- package/engine/internal/object-data/auto-attack-speed-increase.d.ts +1 -1
- package/engine/internal/object-data/auto-attack-speed-increase.lua +2 -0
- package/engine/internal/object-data/evasion-probability.d.ts +2 -0
- package/engine/internal/object-data/evasion-probability.lua +16 -0
- package/engine/internal/unit/ability.d.ts +35 -0
- package/engine/internal/unit/ability.lua +62 -0
- package/engine/internal/unit/add-item-to-slot-init.d.ts +2 -0
- package/engine/internal/unit/add-item-to-slot-init.lua +23 -0
- package/engine/internal/unit/add-item-to-slot.d.ts +2 -0
- package/engine/internal/unit/add-item-to-slot.lua +52 -0
- package/engine/internal/unit/allowed-targets.d.ts +1 -1
- package/engine/internal/unit/allowed-targets.lua +9 -1
- package/engine/internal/unit/bonus.d.ts +2 -0
- package/engine/internal/unit/bonus.lua +17 -0
- package/engine/internal/unit/ignore-events-items.d.ts +2 -0
- package/engine/internal/unit/ignore-events-items.lua +5 -0
- package/engine/internal/unit/item.lua +6 -12
- package/engine/internal/unit/order.d.ts +20 -0
- package/engine/internal/unit/order.lua +136 -0
- package/engine/internal/unit+damage.d.ts +2 -11
- package/engine/internal/unit+damage.lua +10 -14
- package/engine/internal/unit+spellSteal.lua +1 -2
- package/engine/internal/unit-missile-launch.lua +1 -1
- package/engine/internal/unit.d.ts +30 -5
- package/engine/internal/unit.lua +247 -50
- package/engine/internal/utility.lua +12 -0
- package/engine/lightning.d.ts +12 -5
- package/engine/lightning.lua +48 -14
- package/engine/object-data/auxiliary/animation-name.d.ts +1 -0
- package/engine/object-data/auxiliary/animation-name.lua +16 -0
- package/engine/object-data/auxiliary/attachment-preset.d.ts +7 -2
- package/engine/object-data/auxiliary/attachment-preset.lua +4 -3
- package/engine/object-data/auxiliary/attack-type.d.ts +7 -8
- package/engine/object-data/auxiliary/attack-type.lua +42 -0
- package/engine/object-data/auxiliary/movement-type.d.ts +7 -7
- package/engine/object-data/auxiliary/movement-type.lua +22 -0
- package/engine/object-data/auxiliary/sound-eax.d.ts +10 -0
- package/engine/object-data/auxiliary/sound-eax.lua +2 -0
- package/engine/object-data/auxiliary/tech-tree-dependency.d.ts +1 -1
- package/engine/object-data/auxiliary/unit-attribute.d.ts +6 -0
- package/engine/object-data/auxiliary/unit-attribute.lua +9 -0
- package/engine/object-data/entry/ability-type/berserk.d.ts +2 -0
- package/engine/object-data/entry/ability-type/berserk.lua +13 -0
- package/engine/object-data/entry/ability-type/blank-configurable.lua +12 -1
- package/engine/object-data/entry/ability-type/carrion-swarm.d.ts +14 -0
- package/engine/object-data/entry/ability-type/carrion-swarm.lua +65 -0
- package/engine/object-data/entry/ability-type/disease-cloud.lua +2 -2
- package/engine/object-data/entry/ability-type/engineering-upgrade.lua +2 -2
- package/engine/object-data/entry/ability-type/ensnare.d.ts +12 -0
- package/engine/object-data/entry/ability-type/ensnare.lua +52 -0
- package/engine/object-data/entry/ability-type/feral-spirit.lua +2 -2
- package/engine/object-data/entry/ability-type/permanent-invisibility.d.ts +8 -0
- package/engine/object-data/entry/ability-type/permanent-invisibility.lua +26 -0
- package/engine/object-data/entry/ability-type/phase-shift.d.ts +10 -0
- package/engine/object-data/entry/ability-type/phase-shift.lua +39 -0
- package/engine/object-data/entry/ability-type/phoenix-morph.lua +4 -4
- package/engine/object-data/entry/ability-type/raise-dead.d.ts +17 -0
- package/engine/object-data/entry/ability-type/raise-dead.lua +78 -0
- package/engine/object-data/entry/ability-type/shock-wave.d.ts +4 -0
- package/engine/object-data/entry/ability-type/shock-wave.lua +26 -0
- package/engine/object-data/entry/ability-type/slow-poison.d.ts +10 -0
- package/engine/object-data/entry/ability-type/slow-poison.lua +58 -0
- package/engine/object-data/entry/ability-type/summon-quilbeast.lua +2 -2
- package/engine/object-data/entry/ability-type/summon-water-elemental.lua +2 -2
- package/engine/object-data/entry/ability-type/web.d.ts +12 -0
- package/engine/object-data/entry/ability-type/web.lua +52 -0
- package/engine/object-data/entry/ability-type.d.ts +19 -17
- package/engine/object-data/entry/ability-type.lua +89 -33
- package/engine/object-data/entry/buff-type/applicable.lua +18 -37
- package/engine/object-data/entry/buff-type.d.ts +6 -12
- package/engine/object-data/entry/buff-type.lua +13 -29
- package/engine/object-data/entry/destructible-type.d.ts +1 -1
- package/engine/object-data/entry/item-type.d.ts +3 -1
- package/engine/object-data/entry/item-type.lua +15 -2
- package/engine/object-data/entry/lightning-type.d.ts +1 -1
- package/engine/object-data/entry/sound-preset.d.ts +33 -0
- package/engine/object-data/entry/sound-preset.lua +140 -0
- package/engine/object-data/entry/unit-type.d.ts +10 -3
- package/engine/object-data/entry/unit-type.lua +155 -92
- package/engine/object-data/entry/upgrade.d.ts +1 -1
- package/engine/object-data/entry/upgrade.lua +4 -4
- package/engine/object-data/entry.d.ts +16 -14
- package/engine/object-data/entry.lua +60 -32
- package/engine/object-data/utility/object-data-entry-id-generator.lua +7 -0
- package/engine/object-field/ability.d.ts +10 -4
- package/engine/object-field/ability.lua +3 -0
- package/engine/object-field/unit.d.ts +50 -3
- package/engine/object-field/unit.lua +186 -7
- package/engine/object-field.d.ts +17 -6
- package/engine/object-field.lua +187 -89
- package/engine/standard/entries/buff-type.d.ts +3 -0
- package/engine/standard/entries/buff-type.lua +3 -0
- package/engine/standard/entries/sound-preset.d.ts +10 -0
- package/engine/standard/entries/sound-preset.lua +10 -0
- package/engine/standard/fields/ability.d.ts +2 -0
- package/engine/standard/fields/ability.lua +2 -0
- package/engine/standard/fields/unit.d.ts +3 -0
- package/engine/standard/fields/unit.lua +5 -0
- package/engine/text-tag.d.ts +36 -2
- package/engine/text-tag.lua +175 -10
- package/engine/unit.d.ts +2 -0
- package/engine/unit.lua +2 -0
- package/objutil/buff.lua +1 -2
- package/objutil/unit.lua +8 -0
- package/package.json +2 -2
- package/utility/arrays.d.ts +1 -0
- package/utility/arrays.lua +3 -0
- package/utility/functions.d.ts +1 -0
- package/utility/functions.lua +1 -0
- package/utility/linked-set.d.ts +1 -0
- package/utility/linked-set.lua +3 -0
- package/utility/lua-maps.d.ts +4 -0
- package/utility/lua-maps.lua +20 -0
- package/utility/lua-sets.d.ts +1 -0
- package/utility/lua-sets.lua +3 -0
- package/utility/reflection.lua +11 -7
- package/core/types/order.d.ts +0 -25
- package/core/types/order.lua +0 -55
package/engine/object-field.lua
CHANGED
|
@@ -20,6 +20,14 @@ local extractObjectDataEntryLevelFieldValue = ____entry.extractObjectDataEntryLe
|
|
|
20
20
|
local ObjectDataEntry = ____entry.ObjectDataEntry
|
|
21
21
|
local ____object_2Ddata_2Dentry_2Did_2Dgenerator = require("engine.object-data.utility.object-data-entry-id-generator")
|
|
22
22
|
local ObjectDataEntryIdGenerator = ____object_2Ddata_2Dentry_2Did_2Dgenerator.ObjectDataEntryIdGenerator
|
|
23
|
+
local ____linked_2Dset = require("utility.linked-set")
|
|
24
|
+
local mutableLinkedSet = ____linked_2Dset.mutableLinkedSet
|
|
25
|
+
local ____lua_2Dmaps = require("utility.lua-maps")
|
|
26
|
+
local emptyLuaMap = ____lua_2Dmaps.emptyLuaMap
|
|
27
|
+
local getOrPut = ____lua_2Dmaps.getOrPut
|
|
28
|
+
local mutableWeakLuaMap = ____lua_2Dmaps.mutableWeakLuaMap
|
|
29
|
+
local ____arrays = require("utility.arrays")
|
|
30
|
+
local emptyArray = ____arrays.emptyArray
|
|
23
31
|
local compiletimeDefaultValueByObjectDataEntryIdByObjectFieldId = {}
|
|
24
32
|
local defaultValueByObjectDataEntryIdByObjectFieldId = postcompile(function() return compiletimeDefaultValueByObjectDataEntryIdByObjectFieldId end)
|
|
25
33
|
local objectFieldById = {}
|
|
@@ -29,7 +37,11 @@ local idGenerator = __TS__New(
|
|
|
29
37
|
)
|
|
30
38
|
local ObjectFieldBase = __TS__Class()
|
|
31
39
|
ObjectFieldBase.name = "ObjectFieldBase"
|
|
32
|
-
function ObjectFieldBase.prototype.____constructor(self, id)
|
|
40
|
+
function ObjectFieldBase.prototype.____constructor(self, id, isGlobal)
|
|
41
|
+
if isGlobal == nil then
|
|
42
|
+
isGlobal = false
|
|
43
|
+
end
|
|
44
|
+
self.isGlobal = isGlobal
|
|
33
45
|
self.valueByInstance = setmetatable({}, {__mode = "k"})
|
|
34
46
|
if objectFieldById[id] ~= nil then
|
|
35
47
|
error(
|
|
@@ -46,10 +58,15 @@ end
|
|
|
46
58
|
function ObjectFieldBase.prototype.supports(self, instance)
|
|
47
59
|
return __TS__InstanceOf(instance, self.instanceClass)
|
|
48
60
|
end
|
|
49
|
-
function ObjectFieldBase.
|
|
61
|
+
function ObjectFieldBase.prototype.hasValue(self, instance)
|
|
62
|
+
local defaultValueByObjectDataEntryId = defaultValueByObjectDataEntryIdByObjectFieldId[self.id]
|
|
63
|
+
return self.isGlobal or defaultValueByObjectDataEntryId ~= nil and defaultValueByObjectDataEntryId[self:getObjectDataEntryId(instance)] ~= nil or self:hasNativeFieldValue(instance)
|
|
64
|
+
end
|
|
65
|
+
function ObjectFieldBase.create(self, id, isGlobal)
|
|
50
66
|
return __TS__New(
|
|
51
67
|
self,
|
|
52
|
-
id or idGenerator:next()
|
|
68
|
+
id or idGenerator:next(),
|
|
69
|
+
isGlobal
|
|
53
70
|
)
|
|
54
71
|
end
|
|
55
72
|
function ObjectFieldBase.of(self, id)
|
|
@@ -71,7 +88,7 @@ ____exports.ObjectField = __TS__Class()
|
|
|
71
88
|
local ObjectField = ____exports.ObjectField
|
|
72
89
|
ObjectField.name = "ObjectField"
|
|
73
90
|
__TS__ClassExtends(ObjectField, ObjectFieldBase)
|
|
74
|
-
function ObjectField.prototype.getValue(self, entry)
|
|
91
|
+
function ObjectField.prototype.getValue(self, entry, includeModifiers)
|
|
75
92
|
if __TS__InstanceOf(entry, ObjectDataEntry) then
|
|
76
93
|
local defaultValueByObjectDataEntryId = (warpack.compiletime and compiletimeDefaultValueByObjectDataEntryIdByObjectFieldId or defaultValueByObjectDataEntryIdByObjectFieldId)[self.id]
|
|
77
94
|
if defaultValueByObjectDataEntryId ~= nil then
|
|
@@ -82,22 +99,16 @@ function ObjectField.prototype.getValue(self, entry)
|
|
|
82
99
|
end
|
|
83
100
|
return self.defaultValue
|
|
84
101
|
end
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
____self_valueByInstance_entry_0 = defaultValue
|
|
102
|
+
if includeModifiers == false then
|
|
103
|
+
local originalValueByInstance = self.originalValueByInstance
|
|
104
|
+
if originalValueByInstance ~= nil then
|
|
105
|
+
local originalValue = originalValueByInstance[entry]
|
|
106
|
+
if originalValue ~= nil then
|
|
107
|
+
return originalValue
|
|
92
108
|
end
|
|
93
|
-
return ____self_valueByInstance_entry_0
|
|
94
109
|
end
|
|
95
110
|
end
|
|
96
|
-
|
|
97
|
-
if ____temp_1 == nil then
|
|
98
|
-
____temp_1 = self.defaultValue
|
|
99
|
-
end
|
|
100
|
-
return ____temp_1
|
|
111
|
+
return self:getActualValue(entry)
|
|
101
112
|
end
|
|
102
113
|
function ObjectField.prototype.setValue(self, entry, value)
|
|
103
114
|
if __TS__InstanceOf(entry, ObjectDataEntry) then
|
|
@@ -112,37 +123,53 @@ function ObjectField.prototype.setValue(self, entry, value)
|
|
|
112
123
|
defaultValueByObjectDataEntryId[entry.id] = value
|
|
113
124
|
return true
|
|
114
125
|
end
|
|
115
|
-
local
|
|
116
|
-
if
|
|
117
|
-
local
|
|
118
|
-
if
|
|
119
|
-
local
|
|
120
|
-
if
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
local ____self_valueByInstance_entry_2_3 = ____self_valueByInstance_entry_2
|
|
124
|
-
if ____self_valueByInstance_entry_2_3 == nil then
|
|
125
|
-
____self_valueByInstance_entry_2_3 = self.defaultValue
|
|
126
|
-
end
|
|
127
|
-
local previousValue = ____self_valueByInstance_entry_2_3
|
|
128
|
-
if value ~= previousValue then
|
|
129
|
-
self.valueByInstance[entry] = value
|
|
130
|
-
self:invokeValueChangeEvent(entry, self, previousValue, value)
|
|
126
|
+
local modifiersByInstance = self.modifiersByInstance
|
|
127
|
+
if modifiersByInstance ~= nil then
|
|
128
|
+
local modifiers = modifiersByInstance[entry]
|
|
129
|
+
if modifiers ~= nil and modifiers.size ~= 0 then
|
|
130
|
+
local originalValueByInstance = self.originalValueByInstance
|
|
131
|
+
if originalValueByInstance == nil then
|
|
132
|
+
originalValueByInstance = mutableWeakLuaMap()
|
|
133
|
+
self.originalValueByInstance = originalValueByInstance
|
|
131
134
|
end
|
|
132
|
-
|
|
135
|
+
originalValueByInstance[entry] = value
|
|
136
|
+
value = self:calculateActualValue(entry)
|
|
133
137
|
end
|
|
134
138
|
end
|
|
135
|
-
|
|
136
|
-
|
|
139
|
+
return self:setActualValue(entry, value)
|
|
140
|
+
end
|
|
141
|
+
function ObjectField.prototype.applyModifier(self, instance, modifier)
|
|
142
|
+
local modifiersByInstance = self.modifiersByInstance
|
|
143
|
+
if modifiersByInstance == nil then
|
|
144
|
+
modifiersByInstance = mutableWeakLuaMap()
|
|
145
|
+
self.modifiersByInstance = modifiersByInstance
|
|
146
|
+
end
|
|
147
|
+
if getOrPut(modifiersByInstance, instance, mutableLinkedSet):add(modifier) then
|
|
148
|
+
local originalValueByInstance = self.originalValueByInstance
|
|
149
|
+
if originalValueByInstance == nil then
|
|
150
|
+
originalValueByInstance = mutableWeakLuaMap()
|
|
151
|
+
self.originalValueByInstance = originalValueByInstance
|
|
152
|
+
end
|
|
153
|
+
originalValueByInstance[instance] = self:getActualValue(instance)
|
|
154
|
+
self:setActualValue(
|
|
155
|
+
instance,
|
|
156
|
+
self:calculateActualValue(instance)
|
|
157
|
+
)
|
|
137
158
|
end
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
159
|
+
end
|
|
160
|
+
function ObjectField.prototype.removeModifier(self, instance, modifier)
|
|
161
|
+
local modifiersByInstance = self.modifiersByInstance
|
|
162
|
+
if modifiersByInstance ~= nil then
|
|
163
|
+
local modifiers = modifiersByInstance[instance]
|
|
164
|
+
if modifiers ~= nil and modifiers:remove(modifier) then
|
|
165
|
+
self:setActualValue(
|
|
166
|
+
instance,
|
|
167
|
+
self:calculateActualValue(instance)
|
|
168
|
+
)
|
|
169
|
+
return true
|
|
142
170
|
end
|
|
143
|
-
self:invokeValueChangeEvent(entry, self, previousValue, value)
|
|
144
171
|
end
|
|
145
|
-
return
|
|
172
|
+
return false
|
|
146
173
|
end
|
|
147
174
|
function ObjectField.prototype.removeValue(self, entry)
|
|
148
175
|
if not warpack.compiletime then
|
|
@@ -164,6 +191,77 @@ function ObjectField.prototype.trySetValue(self, entry, value)
|
|
|
164
191
|
end
|
|
165
192
|
return self:setValue(entry, value)
|
|
166
193
|
end
|
|
194
|
+
function ObjectField.prototype.getActualValue(self, instance)
|
|
195
|
+
local defaultValueByObjectDataEntryId = defaultValueByObjectDataEntryIdByObjectFieldId[self.id]
|
|
196
|
+
if defaultValueByObjectDataEntryId ~= nil or self.isGlobal then
|
|
197
|
+
local defaultValue = (defaultValueByObjectDataEntryId or emptyLuaMap())[self:getObjectDataEntryId(instance)]
|
|
198
|
+
if defaultValue ~= nil or self.isGlobal then
|
|
199
|
+
local ____self_valueByInstance_instance_0 = self.valueByInstance[instance]
|
|
200
|
+
if ____self_valueByInstance_instance_0 == nil then
|
|
201
|
+
____self_valueByInstance_instance_0 = defaultValue
|
|
202
|
+
end
|
|
203
|
+
local ____self_valueByInstance_instance_0_1 = ____self_valueByInstance_instance_0
|
|
204
|
+
if ____self_valueByInstance_instance_0_1 == nil then
|
|
205
|
+
____self_valueByInstance_instance_0_1 = self.defaultValue
|
|
206
|
+
end
|
|
207
|
+
return ____self_valueByInstance_instance_0_1
|
|
208
|
+
end
|
|
209
|
+
end
|
|
210
|
+
local ____temp_2 = self:getNativeFieldValue(instance)
|
|
211
|
+
if ____temp_2 == nil then
|
|
212
|
+
____temp_2 = self.defaultValue
|
|
213
|
+
end
|
|
214
|
+
return ____temp_2
|
|
215
|
+
end
|
|
216
|
+
function ObjectField.prototype.setActualValue(self, instance, value)
|
|
217
|
+
local defaultValueByObjectDataEntryId = defaultValueByObjectDataEntryIdByObjectFieldId[self.id]
|
|
218
|
+
if defaultValueByObjectDataEntryId ~= nil or self.isGlobal then
|
|
219
|
+
local defaultValue = (defaultValueByObjectDataEntryId or emptyLuaMap())[self:getObjectDataEntryId(instance)]
|
|
220
|
+
if defaultValue ~= nil or self.isGlobal then
|
|
221
|
+
local ____self_valueByInstance_instance_3 = self.valueByInstance[instance]
|
|
222
|
+
if ____self_valueByInstance_instance_3 == nil then
|
|
223
|
+
____self_valueByInstance_instance_3 = defaultValue
|
|
224
|
+
end
|
|
225
|
+
local ____self_valueByInstance_instance_3_4 = ____self_valueByInstance_instance_3
|
|
226
|
+
if ____self_valueByInstance_instance_3_4 == nil then
|
|
227
|
+
____self_valueByInstance_instance_3_4 = self.defaultValue
|
|
228
|
+
end
|
|
229
|
+
local previousValue = ____self_valueByInstance_instance_3_4
|
|
230
|
+
if value ~= previousValue then
|
|
231
|
+
self.valueByInstance[instance] = value
|
|
232
|
+
self:invokeValueChangeEvent(instance, self, previousValue, value)
|
|
233
|
+
end
|
|
234
|
+
return true
|
|
235
|
+
end
|
|
236
|
+
end
|
|
237
|
+
if not self:hasNativeFieldValue(instance) then
|
|
238
|
+
return false
|
|
239
|
+
end
|
|
240
|
+
local previousValue = self:getNativeFieldValue(instance)
|
|
241
|
+
if value ~= previousValue then
|
|
242
|
+
if not self:setNativeFieldValue(instance, value) then
|
|
243
|
+
return false
|
|
244
|
+
end
|
|
245
|
+
self:invokeValueChangeEvent(instance, self, previousValue, value)
|
|
246
|
+
end
|
|
247
|
+
return true
|
|
248
|
+
end
|
|
249
|
+
function ObjectField.prototype.calculateActualValue(self, instance)
|
|
250
|
+
local ____opt_5 = self.originalValueByInstance
|
|
251
|
+
local originalValue = ____opt_5 and ____opt_5[instance]
|
|
252
|
+
local ____opt_7 = self.modifiersByInstance
|
|
253
|
+
local modifiers = ____opt_7 and ____opt_7[instance]
|
|
254
|
+
if originalValue ~= nil then
|
|
255
|
+
local value = originalValue
|
|
256
|
+
if modifiers ~= nil then
|
|
257
|
+
for modifier in pairs(modifiers) do
|
|
258
|
+
value = modifier(instance, value, originalValue)
|
|
259
|
+
end
|
|
260
|
+
end
|
|
261
|
+
return value
|
|
262
|
+
end
|
|
263
|
+
return self.defaultValue
|
|
264
|
+
end
|
|
167
265
|
function ObjectField.prototype.invokeValueChangeEvent(self, ...)
|
|
168
266
|
self:invokeValueChangeEventRecursive(
|
|
169
267
|
getClass(self),
|
|
@@ -217,37 +315,37 @@ function ObjectArrayField.prototype.getValue(self, entry, index)
|
|
|
217
315
|
if defaultValueByObjectDataEntryId ~= nil then
|
|
218
316
|
local value = defaultValueByObjectDataEntryId[entry.id]
|
|
219
317
|
if value ~= nil then
|
|
220
|
-
local
|
|
318
|
+
local ____temp_10
|
|
221
319
|
if index == nil then
|
|
222
|
-
|
|
320
|
+
____temp_10 = value
|
|
223
321
|
else
|
|
224
|
-
local
|
|
225
|
-
if
|
|
226
|
-
|
|
322
|
+
local ____value_index_9 = value[index + 1]
|
|
323
|
+
if ____value_index_9 == nil then
|
|
324
|
+
____value_index_9 = self.defaultValue
|
|
227
325
|
end
|
|
228
|
-
|
|
326
|
+
____temp_10 = ____value_index_9
|
|
229
327
|
end
|
|
230
|
-
return
|
|
328
|
+
return ____temp_10
|
|
231
329
|
end
|
|
232
330
|
end
|
|
233
331
|
return index == nil and ({}) or self.defaultValue
|
|
234
332
|
end
|
|
235
333
|
local defaultValueByObjectDataEntryId = defaultValueByObjectDataEntryIdByObjectFieldId[self.id]
|
|
236
|
-
if defaultValueByObjectDataEntryId ~= nil then
|
|
237
|
-
local defaultValue = defaultValueByObjectDataEntryId[self:getObjectDataEntryId(entry)]
|
|
238
|
-
if defaultValue ~= nil then
|
|
239
|
-
local value = self.valueByInstance[entry] or defaultValue
|
|
240
|
-
local
|
|
334
|
+
if defaultValueByObjectDataEntryId ~= nil or self.isGlobal then
|
|
335
|
+
local defaultValue = (defaultValueByObjectDataEntryId or emptyLuaMap())[self:getObjectDataEntryId(entry)]
|
|
336
|
+
if defaultValue ~= nil or self.isGlobal then
|
|
337
|
+
local value = self.valueByInstance[entry] or defaultValue or emptyArray()
|
|
338
|
+
local ____temp_12
|
|
241
339
|
if index == nil then
|
|
242
|
-
|
|
340
|
+
____temp_12 = value
|
|
243
341
|
else
|
|
244
|
-
local
|
|
245
|
-
if
|
|
246
|
-
|
|
342
|
+
local ____value_index_11 = value[index + 1]
|
|
343
|
+
if ____value_index_11 == nil then
|
|
344
|
+
____value_index_11 = self.defaultValue
|
|
247
345
|
end
|
|
248
|
-
|
|
346
|
+
____temp_12 = ____value_index_11
|
|
249
347
|
end
|
|
250
|
-
return
|
|
348
|
+
return ____temp_12
|
|
251
349
|
end
|
|
252
350
|
end
|
|
253
351
|
if index ~= nil then
|
|
@@ -292,36 +390,36 @@ function ObjectLevelField.prototype.getValue(self, entry, level)
|
|
|
292
390
|
if defaultValueByObjectDataEntryId ~= nil then
|
|
293
391
|
local valueByLevel = defaultValueByObjectDataEntryId[entry.id]
|
|
294
392
|
if valueByLevel ~= nil then
|
|
295
|
-
local
|
|
296
|
-
if
|
|
297
|
-
|
|
393
|
+
local ____valueByLevel_index_13 = valueByLevel[level + 1]
|
|
394
|
+
if ____valueByLevel_index_13 == nil then
|
|
395
|
+
____valueByLevel_index_13 = self.defaultValue
|
|
298
396
|
end
|
|
299
|
-
return
|
|
397
|
+
return ____valueByLevel_index_13
|
|
300
398
|
end
|
|
301
399
|
end
|
|
302
400
|
return self.defaultValue
|
|
303
401
|
end
|
|
304
402
|
local defaultValueByObjectDataEntryId = defaultValueByObjectDataEntryIdByObjectFieldId[self.id]
|
|
305
|
-
if defaultValueByObjectDataEntryId ~= nil then
|
|
306
|
-
local defaultValueByLevel = defaultValueByObjectDataEntryId[self:getObjectDataEntryId(entry)]
|
|
307
|
-
if defaultValueByLevel ~= nil then
|
|
308
|
-
local
|
|
309
|
-
local
|
|
310
|
-
if
|
|
311
|
-
|
|
403
|
+
if defaultValueByObjectDataEntryId ~= nil or self.isGlobal then
|
|
404
|
+
local defaultValueByLevel = (defaultValueByObjectDataEntryId or emptyLuaMap())[self:getObjectDataEntryId(entry)]
|
|
405
|
+
if defaultValueByLevel ~= nil or self.isGlobal then
|
|
406
|
+
local ____opt_14 = self.valueByInstance[entry]
|
|
407
|
+
local ____temp_16 = ____opt_14 and ____opt_14[level + 1]
|
|
408
|
+
if ____temp_16 == nil then
|
|
409
|
+
____temp_16 = (defaultValueByLevel or emptyArray())[level + 1]
|
|
312
410
|
end
|
|
313
|
-
local
|
|
314
|
-
if
|
|
315
|
-
|
|
411
|
+
local ____temp_16_17 = ____temp_16
|
|
412
|
+
if ____temp_16_17 == nil then
|
|
413
|
+
____temp_16_17 = self.defaultValue
|
|
316
414
|
end
|
|
317
|
-
return
|
|
415
|
+
return ____temp_16_17
|
|
318
416
|
end
|
|
319
417
|
end
|
|
320
|
-
local
|
|
321
|
-
if
|
|
322
|
-
|
|
418
|
+
local ____temp_18 = self:getNativeFieldValue(entry, level)
|
|
419
|
+
if ____temp_18 == nil then
|
|
420
|
+
____temp_18 = self.defaultValue
|
|
323
421
|
end
|
|
324
|
-
return
|
|
422
|
+
return ____temp_18
|
|
325
423
|
end
|
|
326
424
|
function ObjectLevelField.prototype.setValue(self, entry, levelOrValue, value)
|
|
327
425
|
if value == nil then
|
|
@@ -362,23 +460,23 @@ function ObjectLevelField.prototype.setValue(self, entry, levelOrValue, value)
|
|
|
362
460
|
return true
|
|
363
461
|
end
|
|
364
462
|
local defaultValueByObjectDataEntryId = defaultValueByObjectDataEntryIdByObjectFieldId[self.id]
|
|
365
|
-
if defaultValueByObjectDataEntryId ~= nil then
|
|
366
|
-
local defaultValueByLevel = defaultValueByObjectDataEntryId[self:getObjectDataEntryId(entry)]
|
|
367
|
-
if defaultValueByLevel ~= nil then
|
|
463
|
+
if defaultValueByObjectDataEntryId ~= nil or self.isGlobal then
|
|
464
|
+
local defaultValueByLevel = (defaultValueByObjectDataEntryId or emptyLuaMap())[self:getObjectDataEntryId(entry)]
|
|
465
|
+
if defaultValueByLevel ~= nil or self.isGlobal then
|
|
368
466
|
local valueByLevel = self.valueByInstance[entry]
|
|
369
467
|
if valueByLevel == nil then
|
|
370
468
|
valueByLevel = {}
|
|
371
469
|
self.valueByInstance[entry] = valueByLevel
|
|
372
470
|
end
|
|
373
|
-
local
|
|
374
|
-
if
|
|
375
|
-
|
|
471
|
+
local ____valueByLevel_index_19 = valueByLevel[level + 1]
|
|
472
|
+
if ____valueByLevel_index_19 == nil then
|
|
473
|
+
____valueByLevel_index_19 = (defaultValueByLevel or emptyArray())[level + 1]
|
|
376
474
|
end
|
|
377
|
-
local
|
|
378
|
-
if
|
|
379
|
-
|
|
475
|
+
local ____valueByLevel_index_19_20 = ____valueByLevel_index_19
|
|
476
|
+
if ____valueByLevel_index_19_20 == nil then
|
|
477
|
+
____valueByLevel_index_19_20 = self.defaultValue
|
|
380
478
|
end
|
|
381
|
-
local previousValue =
|
|
479
|
+
local previousValue = ____valueByLevel_index_19_20
|
|
382
480
|
if value ~= previousValue then
|
|
383
481
|
valueByLevel[level + 1] = value
|
|
384
482
|
self:invokeValueChangeEvent(
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @noSelfInFile */
|
|
2
|
+
import { StandardSoundPresetId } from "../../object-data/entry/sound-preset";
|
|
3
|
+
export declare const ABOMINATION_PISSED_SOUND_PRESET_ID: StandardSoundPresetId;
|
|
4
|
+
export declare const ABOMINATION_READY_SOUND_PRESET_ID: StandardSoundPresetId;
|
|
5
|
+
export declare const ABOMINATION_WAR_CRY_SOUND_PRESET_ID: StandardSoundPresetId;
|
|
6
|
+
export declare const AXE_MEDIUM_CHOP_WOOD_SOUND_PRESET_ID: StandardSoundPresetId;
|
|
7
|
+
export declare const IMPALE_SOUND_PRESET_ID: StandardSoundPresetId;
|
|
8
|
+
export declare const IMPALE_HIT_SOUND_PRESET_ID: StandardSoundPresetId;
|
|
9
|
+
export declare const IMPALE_LAND_SOUND_PRESET_ID: StandardSoundPresetId;
|
|
10
|
+
export declare const IMPALE_CAST_SOUND_PRESET_ID: StandardSoundPresetId;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
____exports.ABOMINATION_PISSED_SOUND_PRESET_ID = "AbominationPissed"
|
|
3
|
+
____exports.ABOMINATION_READY_SOUND_PRESET_ID = "AbominationReady"
|
|
4
|
+
____exports.ABOMINATION_WAR_CRY_SOUND_PRESET_ID = "AbominationWarcry"
|
|
5
|
+
____exports.AXE_MEDIUM_CHOP_WOOD_SOUND_PRESET_ID = "AxeMediumChopWood"
|
|
6
|
+
____exports.IMPALE_SOUND_PRESET_ID = "Impale"
|
|
7
|
+
____exports.IMPALE_HIT_SOUND_PRESET_ID = "ImpaleHit"
|
|
8
|
+
____exports.IMPALE_LAND_SOUND_PRESET_ID = "ImpaleLand"
|
|
9
|
+
____exports.IMPALE_CAST_SOUND_PRESET_ID = "ImpaleCast"
|
|
10
|
+
return ____exports
|
|
@@ -687,6 +687,8 @@ export declare const DISABLE_OTHER_ABILITIES_ABILITY_BOOLEAN_LEVEL_FIELD: Abilit
|
|
|
687
687
|
export declare const ALLOW_BOUNTY_ABILITY_BOOLEAN_LEVEL_FIELD: AbilityBooleanLevelField & symbol;
|
|
688
688
|
export declare const ICON_NORMAL_ABILITY_STRING_LEVEL_FIELD: AbilityStringLevelField & symbol;
|
|
689
689
|
export declare const CASTER_EFFECT_MODEL_PATHS_ABILITY_STRING_ARRAY_FIELD: AbilityStringArrayField & symbol;
|
|
690
|
+
export declare const CASTER_EFFECT_FIRST_ATTACHMENT_POINT_STRING_FIELD: AbilityStringField & symbol;
|
|
691
|
+
export declare const CASTER_EFFECT_SECOND_ATTACHMENT_POINT_STRING_FIELD: AbilityStringField & symbol;
|
|
690
692
|
export declare const TARGET_EFFECT_MODEL_PATHS_ABILITY_STRING_ARRAY_FIELD: AbilityStringArrayField & symbol;
|
|
691
693
|
export declare const TARGET_EFFECT_FIRST_ATTACHMENT_POINT_STRING_FIELD: AbilityStringField & symbol;
|
|
692
694
|
export declare const TARGET_EFFECT_SECOND_ATTACHMENT_POINT_STRING_FIELD: AbilityStringField & symbol;
|
|
@@ -698,6 +698,8 @@ ____exports.DISABLE_OTHER_ABILITIES_ABILITY_BOOLEAN_LEVEL_FIELD = AbilityBoolean
|
|
|
698
698
|
____exports.ALLOW_BOUNTY_ABILITY_BOOLEAN_LEVEL_FIELD = AbilityBooleanLevelField:create(fourCC("Ntm4"))
|
|
699
699
|
____exports.ICON_NORMAL_ABILITY_STRING_LEVEL_FIELD = AbilityStringLevelField:create(fourCC("aart"))
|
|
700
700
|
____exports.CASTER_EFFECT_MODEL_PATHS_ABILITY_STRING_ARRAY_FIELD = AbilityStringArrayField:create(fourCC("acat"))
|
|
701
|
+
____exports.CASTER_EFFECT_FIRST_ATTACHMENT_POINT_STRING_FIELD = AbilityStringField:create(fourCC("acap"))
|
|
702
|
+
____exports.CASTER_EFFECT_SECOND_ATTACHMENT_POINT_STRING_FIELD = AbilityStringField:create(fourCC("aca1"))
|
|
701
703
|
____exports.TARGET_EFFECT_MODEL_PATHS_ABILITY_STRING_ARRAY_FIELD = AbilityStringArrayField:create(fourCC("atat"))
|
|
702
704
|
____exports.TARGET_EFFECT_FIRST_ATTACHMENT_POINT_STRING_FIELD = AbilityStringField:create(fourCC("ata0"))
|
|
703
705
|
____exports.TARGET_EFFECT_SECOND_ATTACHMENT_POINT_STRING_FIELD = AbilityStringField:create(fourCC("ata1"))
|
package/engine/text-tag.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/** @noSelfInFile */
|
|
2
2
|
import { Color } from "../core/types/color";
|
|
3
|
+
import { Unit } from "./internal/unit";
|
|
4
|
+
import { AbstractDestroyable, Destructor } from "../destroyable";
|
|
3
5
|
export type TextTagPreset = {
|
|
4
6
|
fadepoint: number;
|
|
5
7
|
lifespan: number;
|
|
@@ -10,9 +12,39 @@ export type TextTagPreset = {
|
|
|
10
12
|
velocityY: number;
|
|
11
13
|
color: Color;
|
|
12
14
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
declare const enum TextTagPropertyKey {
|
|
16
|
+
UNIT = 100,
|
|
17
|
+
HANDLE = 101,
|
|
18
|
+
CONFIGURATION = 102,
|
|
19
|
+
TEXT = 103,
|
|
20
|
+
FONT_SIZE = 104,
|
|
21
|
+
COLOR = 105,
|
|
22
|
+
X = 106,
|
|
23
|
+
Y = 107
|
|
24
|
+
}
|
|
25
|
+
export declare class TextTag extends AbstractDestroyable {
|
|
26
|
+
private readonly [TextTagPropertyKey.HANDLE];
|
|
27
|
+
private [TextTagPropertyKey.CONFIGURATION]?;
|
|
28
|
+
private [TextTagPropertyKey.TEXT]?;
|
|
29
|
+
private [TextTagPropertyKey.FONT_SIZE]?;
|
|
30
|
+
private [TextTagPropertyKey.COLOR]?;
|
|
31
|
+
private [TextTagPropertyKey.UNIT]?;
|
|
32
|
+
private [TextTagPropertyKey.X]?;
|
|
33
|
+
private [TextTagPropertyKey.Y]?;
|
|
15
34
|
private constructor();
|
|
35
|
+
protected onDestroy(): Destructor;
|
|
36
|
+
get text(): string;
|
|
37
|
+
set text(text: string);
|
|
38
|
+
get fontSize(): number;
|
|
39
|
+
set fontSize(fontSize: number);
|
|
40
|
+
get color(): Color;
|
|
41
|
+
set color(color: Color);
|
|
42
|
+
get unit(): Unit | undefined;
|
|
43
|
+
set unit(unit: Unit | undefined);
|
|
44
|
+
get x(): number;
|
|
45
|
+
set x(x: number);
|
|
46
|
+
get y(): number;
|
|
47
|
+
set y(y: number);
|
|
16
48
|
static BASE: Readonly<TextTagPreset>;
|
|
17
49
|
static BASH: Readonly<TextTagPreset>;
|
|
18
50
|
static CRITICAL_STRIKE: Readonly<TextTagPreset>;
|
|
@@ -22,4 +54,6 @@ export declare class TextTag {
|
|
|
22
54
|
static MISS: Readonly<TextTagPreset>;
|
|
23
55
|
static SHADOW_STRIKE: Readonly<TextTagPreset>;
|
|
24
56
|
static flash(configuration: Readonly<TextTagPreset>, text: string, x: number, y: number, z?: number): void;
|
|
57
|
+
static create(configuration: Readonly<TextTagPreset>, text: string, unit: Unit): TextTag;
|
|
25
58
|
}
|
|
59
|
+
export {};
|