Skip to content

Commit

Permalink
refactor(CharArmor): Format resistance
Browse files Browse the repository at this point in the history
  • Loading branch information
octfx committed Apr 2, 2024
1 parent 1df4723 commit a6e114a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Item/CharArmor/CharArmor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ end
---
--- @param smwSetObject table
function p.addSmwProperties( apiData, frameArgs, smwSetObject )
local common = require( 'Module:Common' )

smwCommon.addSmwProperties(
apiData,
frameArgs,
Expand All @@ -38,6 +40,11 @@ function p.addSmwProperties( apiData, frameArgs, smwSetObject )

smwCommon.setFromTable( setData, apiData:get( 'clothing.resistances' ), 'type', 'multiplier', 'ModifierDamageTaken', translate )

-- Todo make format FN of Module:Common/SMW "public"
for key, value in pairs( setData ) do
setData[ key ] = common.formatNum( value )
end

mw.smw.set( setData )
end

Expand Down Expand Up @@ -141,4 +148,4 @@ function p.getShortDescription( frameArgs, smwData )
end


return p
return p

0 comments on commit a6e114a

Please sign in to comment.