1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-11-30 17:04:32 +00:00

Absorb changes from !4996

This commit is contained in:
Evil Eye 2025-11-24 17:59:50 +01:00
parent dcde01dee9
commit b4018b1962
2 changed files with 12 additions and 12 deletions

View file

@ -68,15 +68,15 @@ end
local function skillLevelUpHandler(skillid, source, params)
local skillStat = NPC.stats.skills[skillid](self)
if (skillStat.base >= 100 and params.skillIncreaseValue > 0) or
(skillStat.base <= 0 and params.skillIncreaseValue < 0) then
return false
if (skillStat.base >= 100 and params.skillIncreaseValue > 0) or
(skillStat.base <= 0 and params.skillIncreaseValue < 0) then
return false
end
if params.skillIncreaseValue then
skillStat.base = skillStat.base + params.skillIncreaseValue
end
local levelStat = Actor.stats.level(self)
if params.levelUpProgress then
levelStat.progress = levelStat.progress + params.levelUpProgress
@ -106,11 +106,11 @@ local function skillLevelUpHandler(skillid, source, params)
end
ui.showMessage(message, { showInDialogue = false })
if levelStat.progress >= core.getGMST('iLevelUpTotal') then
ui.showMessage('#{sLevelUpMsg}', { showInDialogue = false })
end
if not source or source == I.SkillProgression.SKILL_INCREASE_SOURCES.Usage then skillStat.progress = 0 end
end
end
@ -119,14 +119,14 @@ local function jailTimeServed(days)
if not days or days <= 0 then
return
end
local oldSkillLevels = {}
local skillByNumber = {}
for skillid, skillStat in pairs(NPC.stats.skills) do
oldSkillLevels[skillid] = skillStat(self).base
skillByNumber[#skillByNumber+1] = skillid
end
math.randomseed(core.getSimulationTime())
for day=1,days do
local skillid = skillByNumber[math.random(#skillByNumber)]
@ -151,7 +151,7 @@ local function jailTimeServed(days)
message = message..'\n'..string.format(skillMsg, skillRecord.name, skillStat(self).base)
end
end
I.UI.showInteractiveMessage(message)
end

View file

@ -14,7 +14,7 @@ local onHitHandlers = {}
---
-- @type AttackInfo
-- @field [parent=#AttackInfo] #table damage A table mapping stat name (health, fatigue, or magicka) to 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.
-- @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.
-- @field [parent=#AttackInfo] #number strength A number between 0 and 1 representing the attack strength. This field is ignored for failed attacks.
-- @field [parent=#AttackInfo] #boolean successful Whether the attack was successful or not.
-- @field [parent=#AttackInfo] #AttackSourceType sourceType What class of attack this is.
@ -48,7 +48,7 @@ return {
--- Add new onHit handler for this actor
-- If `handler(attack)` returns false, other handlers for
-- the call will be skipped. where attack is the same @{#AttackInfo} passed to #Combat.onHit
-- the call will be skipped. Where attack is the same @{#AttackInfo} passed to #Combat.onHit
-- @function [parent=#Combat] addOnHitHandler
-- @param #function handler The handler.
addOnHitHandler = function(handler)
@ -64,7 +64,7 @@ return {
-- @return #number Damage adjusted for armor
adjustDamageForArmor = function(damage, actor) return damage end,
--- Calculates a difficulty multiplier based on current difficulty settings
--- Calculates a difficulty multiplier based on the current difficulty settings
-- and adjusts damage accordingly. Has no effect if both this actor and the
-- attacker are NPCs, or if both are Players.
-- @function [parent=#Combat] adjustDamageForDifficulty