You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -271,16 +265,13 @@ local function spawnBloodEffect(position)
271
265
end
272
266
273
267
localfunctiononHit(data)
274
-
ifauxUtil.callEventHandlers(onHitHandlers, data) then
275
-
return
276
-
end
277
268
ifdata.successfulandnotgodMode() then
278
269
I.Combat.applyArmor(data)
279
270
I.Combat.adjustDamageForDifficulty(data)
280
271
ifgetDamage(data, 'health') >0then
281
272
core.sound.playSound3d('Health Damage', self)
282
273
ifdata.hitPosthen
283
-
spawnBloodEffect(data.hitPos)
274
+
I.Combat.spawnBloodEffect(data.hitPos)
284
275
end
285
276
end
286
277
elseifdata.attackerandPlayer.objectIsInstance(data.attacker) then
@@ -289,142 +280,20 @@ local function onHit(data)
289
280
Actor._onHit(self, data)
290
281
end
291
282
292
-
---
293
-
-- Table of possible attack source types
294
-
-- @type AttackSourceType
295
-
-- @field #string Magic
296
-
-- @field #string Melee
297
-
-- @field #string Ranged
298
-
-- @field #string Unspecified
299
-
300
-
---
301
-
-- @type AttackInfo
302
-
-- @field [parent=#AttackInfo] #table damage A table mapping a stat name (health, fatigue, or magicka) to a number. For example, {health = 50, fatigue = 10} will cause 50 damage to health and 10 to fatigue (before adjusting for armor and difficulty). This field is ignored for failed attacks.
303
-
-- @field [parent=#AttackInfo] #number strength A number between 0 and 1 representing the attack strength. This field is ignored for failed attacks.
304
-
-- @field [parent=#AttackInfo] #boolean successful Whether the attack was successful or not.
305
-
-- @field [parent=#AttackInfo] #AttackSourceType sourceType What class of attack this is.
306
-
-- @field [parent=#AttackInfo] openmw.self#ATTACK_TYPE type (Optional) Attack variant if applicable. For melee attacks this represents chop vs thrust vs slash. For unarmed creatures this implies which of its 3 possible attacks were used. For other attacks this field can be ignored.
307
-
-- @field [parent=#AttackInfo] openmw.types#Actor attacker (Optional) Attacking actor
-- @field [parent=#AttackInfo] #string ammo (Optional) Ammo record ID
310
-
-- @field [parent=#AttackInfo] openmw.util#Vector3 hitPos (Optional) Where on the victim the attack is landing. Used to spawn blood effects. Blood effects are skipped if nil.
311
-
return {
312
-
--- Basic combat interface
313
-
-- @module Combat
314
-
-- @usage require('openmw.interfaces').Combat
315
-
--
316
-
--I.Combat.addOnHitHandler(function(attack)
317
-
-- -- Adds fatigue loss when hit by draining fatigue when taking health damage
318
-
-- if attack.damage.health and not attack.damage.fatigue then
319
-
-- local strengthFactor = Actor.stats.attributes.strength(self).modified / 100 * 0.66
320
-
-- local enduranceFactor = Actor.stats.attributes.endurance(self).modified / 100 * 0.34
321
-
-- local factor = 1 - math.min(strengthFactor + enduranceFactor, 1)
0 commit comments