Skip to content

Commit

Permalink
Fix mod weights + crash on load
Browse files Browse the repository at this point in the history
  • Loading branch information
LocalIdentity committed Dec 8, 2024
1 parent d296314 commit 9644106
Show file tree
Hide file tree
Showing 8 changed files with 1,430 additions and 1,358 deletions.
2,698 changes: 1,349 additions & 1,349 deletions src/Data/ModItem.lua

Large diffs are not rendered by default.

62 changes: 62 additions & 0 deletions src/Data/Skills/other.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,65 @@
--
local skills, mod, flag, skill = ...

skills["MeleeUnarmedPlayer"] = {
name = "Punch",
hidden = true,
incrementalEffectiveness = 0.054999999701977,
description = "Perform an [Unarmed|Unarmed] [Strike].",
skillTypes = { [SkillType.Attack] = true, [SkillType.MeleeSingleTarget] = true, [SkillType.Multistrikeable] = true, [SkillType.Melee] = true, [SkillType.Area] = true, },
statDescriptionScope = "skill_stat_descriptions",
castTime = 1,
baseFlags = {
attack = true,
area = true,
melee = true,
},
constantStats = {
{ "melee_conditional_step_distance", 10 },
},
stats = {
"is_area_damage",
},
levels = {
[1] = { },
[2] = { },
[3] = { },
[4] = { },
[5] = { },
[6] = { },
[7] = { },
[8] = { },
[9] = { },
[10] = { },
[11] = { },
[12] = { },
[13] = { },
[14] = { },
[15] = { },
[16] = { },
[17] = { },
[18] = { },
[19] = { },
[20] = { },
[21] = { },
[22] = { },
[23] = { },
[24] = { },
[25] = { },
[26] = { },
[27] = { },
[28] = { },
[29] = { },
[30] = { },
[31] = { },
[32] = { },
[33] = { },
[34] = { },
[35] = { },
[36] = { },
[37] = { },
[38] = { },
[39] = { },
[40] = { },
},
}
2 changes: 1 addition & 1 deletion src/Export/Classes/Dat64File.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ local dataTypes = {
size = 2,
read = function(b, o, d)
if o > #b - 1 then return 1337 end
return bytesToUInt(b, o)
return bytesToUShort(b, o)
end,
},
UInt = {
Expand Down
2 changes: 1 addition & 1 deletion src/Export/Classes/DatFile.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ local dataTypes = {
size = 2,
read = function(b, o, d)
if o > #b - 1 then return 1337 end
return bytesToUInt(b, o)
return bytesToUShort(b, o)
end,
},
UInt = {
Expand Down
14 changes: 10 additions & 4 deletions src/Export/Scripts/mods.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,17 @@ local function writeMods(outName, condFunc)
out:write('statOrder = { ', table.concat(orders, ', '), ' }, ')
out:write('level = ', mod.Level, ', group = "', mod.Type.Id, '", ')
out:write('weightKey = { ')
for _, tag in ipairs(mod.SpawnTags) do
out:write('"', tag.Id, '", ')
local GoldModPrices = dat("GoldModPrices"):GetRow("Id", dat("Mods"):GetRow("Id", mod.Id))
if GoldModPrices then
for _, tag in ipairs(GoldModPrices.SpawnTags) do
out:write('"', tag.Id, '", ')
end
out:write('}, ')
out:write('weightVal = { ', table.concat(GoldModPrices.SpawnWeights, ', '), ' }, ')
else
out:write('}, ')
out:write('weightVal = { ', table.concat(mod.SpawnWeights, ', '), ' }, ')
end
out:write('}, ')
out:write('weightVal = { ', table.concat(mod.SpawnWeights, ', '), ' }, ')
if mod.GenerationWeightTags[1] then
-- make large clusters only have 1 notable suffix
if mod.GenerationType == 2 and mod.Tags[1] and outName == "../Data/ModJewelCluster.lua" and mod.Tags[1].Id == "has_affliction_notable" then
Expand Down
4 changes: 4 additions & 0 deletions src/Export/Skills/other.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@
--
local skills, mod, flag, skill = ...

#noGem
#skill MeleeUnarmedPlayer
#flags attack area melee
#mods
4 changes: 2 additions & 2 deletions src/Export/spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5091,14 +5091,14 @@ return {
},
[6]={
list=true,
name="Tags",
name="SpawnTags",
refTo="Tags",
type="Key",
width=300
},
[7]={
list=true,
name="SpawnWeight",
name="SpawnWeights",
refTo="",
type="Int",
width=270
Expand Down
2 changes: 1 addition & 1 deletion src/Modules/CalcSetup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1633,7 +1633,7 @@ function calcs.initEnv(build, mode, override, specEnv)
if not env.player.mainSkill then
-- Add a default main skill if none are specified
local defaultEffect = {
grantedEffect = env.data.skills.Melee,
grantedEffect = env.data.skills.MeleeUnarmedPlayer,
level = 1,
quality = 0,
enabled = true,
Expand Down

0 comments on commit 9644106

Please sign in to comment.