Skip to content

Commit

Permalink
Fix some skills not being triggered due to source skills not being a hit
Browse files Browse the repository at this point in the history
  • Loading branch information
Musholic committed Apr 26, 2024
1 parent 67c601f commit 5af24a0
Show file tree
Hide file tree
Showing 8 changed files with 494 additions and 247 deletions.
6 changes: 3 additions & 3 deletions gameFileExtractScript/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,9 @@ def set_stats_from_damage_data(skill, damage_data, skill_tags):
if damage_data['isHit'] == "1":
skill["baseFlags"]["hit"] = True
match int(skill_tags):
case val if val & 4096:
damage_tag = "dot"
skill["baseFlags"]["dot"] = True
case val if val & 256:
damage_tag = "spell"
skill["baseFlags"]["spell"] = True
Expand All @@ -544,9 +547,6 @@ def set_stats_from_damage_data(skill, damage_data, skill_tags):
damage_tag = "bow"
skill["baseFlags"]["projectile"] = True
skill["baseFlags"]["attack"] = True
case val if val & 4096:
damage_tag = "dot"
skill["baseFlags"]["dot"] = True
case other:
damage_tag = str(other)
for i, damageStr in enumerate(damage_data['damage']):
Expand Down
17 changes: 15 additions & 2 deletions gameFileExtractScript/processSkillsAndAilments.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ def load_file_from_guid(ability_guid, suffix=None):
"baseFlags": {},
"stats": {}
}
match int(skillData['tags']):
case val if val & 256:
skill["baseFlags"]["spell"] = True
case val if val & 512:
skill["baseFlags"]["melee"] = True
skill["baseFlags"]["attack"] = True
case val if val & 1024:
skill["baseFlags"]["projectile"] = True
skill["baseFlags"]["attack"] = True
case val if val & 2048:
skill["baseFlags"]["projectile"] = True
skill["baseFlags"]["attack"] = True
for attributeScalingData in skillData['attributeScaling']:
if len(attributeScalingData['stats']):
match int(attributeScalingData['attribute']):
Expand All @@ -50,7 +62,7 @@ def load_file_from_guid(ability_guid, suffix=None):
# if stats['addedValue']:
# skill['stats'].append("added_damage_per_" + attribute)
# skill['level'][len(skill['stats'])] = stats['addedValue']
for prefabSuffix in {"", "End", "Aoe", "Hit"}:
for prefabSuffix in {"", "End", "Aoe", "Hit", " Damage"}:
skillPrefabData = load_file_from_guid(skillData['abilityPrefab'], prefabSuffix)
for data in skillPrefabData:
if data.get('MonoBehaviour') and data['MonoBehaviour'].get('baseDamageStats'):
Expand Down Expand Up @@ -78,7 +90,8 @@ def load_file_from_guid(ability_guid, suffix=None):
"name": ailmentData['displayName'],
"skillTypeTags": ailmentData['tags'],
"baseFlags": {
"duration": True
"duration": True,
"ailment": True
},
"stats": {
"base_skill_effect_duration": float(ailmentData['duration']) * 1000,
Expand Down
2 changes: 1 addition & 1 deletion spec/System/TestBuildImport_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ expose("BuildImport #buildImport", function()

--TODO: Ignite dps, Blessing support
assert.are.equals("Fireball", build.calcsTab.mainEnv.player.mainSkill.skillCfg.skillName)
assert.are.equals(7030, round(build.calcsTab.mainOutput.FullDPS))
assert.are.equals(9183, round(build.calcsTab.mainOutput.FullDPS))
end)
end)
1 change: 1 addition & 0 deletions src/Data/Global.lua
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ GlobalCache = {
noCache = nil,
useFullDPS = false,
numActiveSkillInFullDPS = 0,
grantedTriggeredSkills = {},
ailmentsStacks = {}
}

6 changes: 3 additions & 3 deletions src/Data/SkillStatMap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2046,8 +2046,8 @@ local result = {
for _,sourceType in ipairs(DamageSourceTypes) do
for _,damageType in ipairs(DamageTypes) do
result[sourceType:lower().."_base_".. damageType:lower() .."_damage"] = {
skill(damageType.."Min", "BASE", nil, 0, KeywordFlag[sourceType]),
skill(damageType.."Max", "BASE", nil, 0, KeywordFlag[sourceType]),
skill(damageType.."Min", nil),
skill(damageType.."Max", nil),
}
end
end
Expand All @@ -2068,7 +2068,7 @@ end

for skillId, grantedEffect in pairs(data.skills) do
result["chance_to_cast_" .. skillId .. "_on_hit_%"] = {
mod("ChanceToTriggerOnHit_"..skillId, "BASE", nil, ModFlag.Hit, 0),
mod("ChanceToTriggerOnHit_"..skillId, "BASE", nil, 0, 0),
}
end

Expand Down
Loading

0 comments on commit 5af24a0

Please sign in to comment.