Skip to content

Commit

Permalink
Update fix_ascendancy_positions.py to support new extra tree nodes (P…
Browse files Browse the repository at this point in the history
…athOfBuildingCommunity#4357)

* add Initial support for adding non-Tree nodes to Tree (Nine lives)

* update positions and add other dummy nodes

* separate stats and reminder text and add new nodes

* rest of nodes

* Fix comma

* fix spelling of sapped

* update spec.lua for passiveSkills

* remove unrelated spec

* update file to hardcode group and node IDs, and correct ascendency

* update to new tree

* spelling fix

Co-authored-by: LocalIdentity <localidentity2@gmail.com>
  • Loading branch information
Regisle and LocalIdentity committed Aug 12, 2022
1 parent 872d4e2 commit c819a68
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 1 deletion.
49 changes: 48 additions & 1 deletion fix_ascendancy_positions.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
logging.basicConfig(level=logging.INFO)


@dataclasses.dataclass(frozen=True, slots=True)
@dataclasses.dataclass(frozen=True) #, slots=True) #, slots breaks becouse its already defined?
class Point2D:
"""Two-dimensional point. Supports subtracting points."""
x: int
Expand Down Expand Up @@ -40,6 +40,42 @@ def __sub__(self, other: Point2D) -> Point2D:
"Saboteur": Point2D(10200, -2200),
"Ascendant": Point2D(-7800, 7200),
}
EXTRA_NODES = {
"Necromancer": [{"Node": {"name": "Nine Lives", "icon": "Art/2DArt/SkillIcons/passives/Ascendants/Int.png", "isNotable": True, "skill" : 27602},
"offset": Point2D(-1500, -1000)}],
"Guardian": [{"Node": {"name": "Searing Purity", "icon": "Art/2DArt/SkillIcons/passives/Ascendants/StrInt.png", "isNotable": True, "skill" : 57568},
"offset": Point2D(-1000, 1500)}],
"Berserker": [{"Node": {"name": "Indomitable Resolve", "icon": "Art/2DArt/SkillIcons/passives/Ascendants/Str.png", "isNotable": True, "skill" : 52435},
"offset": Point2D(-1000, 0)}],
"Ascendant": [{"Node": {"name": "Unleashed Potential", "icon": "Art/2DArt/SkillIcons/passives/Ascendants/SkillPoint.png", "skill" : 19355},
"offset": Point2D(-1000, 1000)}],
"Champion": [{"Node": {"name": "Fatal Flourish", "icon": "Art/2DArt/SkillIcons/passives/Ascendants/StrDex.png", "isNotable": True, "skill" : 42469},
"offset": Point2D(0, 1000)}],
"Raider": [{"Node": {"name": "Fury of Nature", "icon": "Art/2DArt/SkillIcons/passives/Ascendants/Dex.png", "isNotable": True, "skill" : 18054},
"offset": Point2D(1000, -1500)}],
"Saboteur": [{"Node": {"name": "Harness the Void", "icon": "Art/2DArt/SkillIcons/passives/Ascendants/DexInt.png", "isNotable": True, "skill" : 57331},
"offset": Point2D(1000, -1500)}],
}
EXTRA_NODE_IDS = { #these can be any value but for now they are hardcoded to what random numbers generated last time for consistancy, the "hash" value is what we should probs use though as its the value in the ggpk
"Nine Lives": {"NodeID": 33600, "GroupID" : 44472},
"Searing Purity": {"NodeID": 22278, "GroupID" : 50933},
"Soul Drinker": {"NodeID": 19264, "GroupID" : 37841, "hash" : 45999},
"Harness the Void": {"GroupID" : 37841},
"Fury of Nature": {"NodeID": 62630, "GroupID" : 56600},
"Fatal Flourish": {"NodeID": 11264, "GroupID" : 63033},
"Indomitable Resolve": {"NodeID": 15386, "GroupID" : 25519},
"Unleashed Potential": {"NodeID": 55193, "GroupID" : 60495},
}
EXTRA_NODES_STATS = { # these should not be hardcoded here, but should by inserted later via the exporter from the ggpk (they are AsendencySpecialEdlritch in PassiveSkills.dat, though reminder text seems to be missing)
"Nine Lives": {"stats": ["25% of Damage taken Recouped as Life, Mana and Energy Shield", "Recoup Effects instead occur over 3 seconds"], "reminderText": ["(Only Damage from Hits can be Recouped, over 4 seconds following the Hit)"]},
"Searing Purity": {"stats": ["45% of Chaos Damage taken as Fire Damage", "45% of Chaos Damage taken as Lightning Damage"], "reminderText": []},
"Soul Drinker": {"stats": ["2% of Damage Leeched as Energy Shield", "20% increased Attack and Cast Speed while Leeching Energy Shield", "Energy Shield Leech effects are not removed when Energy Shield is Filled"], "reminderText": ["(Leeched Energy Shield is recovered over time. Multiple Leeches can occur simultaneously, up to a maximum rate)"]},
"Harness the Void": {"stats": ["27% chance to gain 25% of Non-Chaos Damage with Hits as Extra Chaos Damage", "13% chance to gain 50% of Non-Chaos Damage with Hits as Extra Chaos Damage", "7% chance to gain 100% of Non-Chaos Damage with Hits as Extra Chaos Damage"], "reminderText": []},
"Fury of Nature" : {"stats": ["Non-Damaging Elemental Ailments you inflict spread to nearby enemies in a radius of 20", "Non-Damaging Elemental Ailments you inflict have 100% more Effect"], "reminderText": ["(Elemental Ailments are Ignited, Scorched, Chilled, Frozen, Brittled, Shocked, and Sapped)"]},
"Fatal Flourish": {"stats": ["Final Repeat of Attack Skills deals 60% more Damage", "Non-Travel Attack Skills Repeat an additional Time"], "reminderText": []},
"Indomitable Resolve": {"stats": ["Deal 10% less Damage", "Take 25% less Damage"], "reminderText": []},
"Unleashed Potential" : {"stats": ["400% increased Endurance, Frenzy and Power Charge Duration", "25% chance to gain a Power, Frenzy or Endurance Charge on Kill", "+1 to Maximum Endurance Charges", "+1 to Maximum Frenzy Charges", "+1 to Maximum Power Charges"], "reminderText": []},
}


def fix_ascendancy_positions(path: os.PathLike) -> None:
Expand Down Expand Up @@ -70,6 +106,17 @@ def fix_ascendancy_positions(path: os.PathLike) -> None:
offset = NODE_GROUPS[ascendancy] - ascendancy_starting_point[ascendancy]
group["x"] += offset.x
group["y"] += offset.y
for ascendancy in EXTRA_NODES:
for node in EXTRA_NODES[ascendancy]:
if str(EXTRA_NODE_IDS[node["Node"]["name"]]["GroupID"]) in data["groups"]: #using hardcoded value from last time, can use another method instead, like just grabbing the next avalible value
print("GroupID already taken")
return
node["Node"]["group"] = EXTRA_NODE_IDS[node["Node"]["name"]]["GroupID"]
data["groups"][node["Node"]["group"]] = {"x": NODE_GROUPS[ascendancy].x + node["offset"].x, "y": NODE_GROUPS[ascendancy].y + node["offset"].y, "orbits": [0], "nodes": [node["Node"]["skill"]]}
data["nodes"][node["Node"]["skill"]] = node["Node"] | {"ascendancyName": ascendancy, "orbit": 0, "orbitIndex": 0, "out": [], "in": [], "stats": [], "reminderText": []}
if node["Node"]["name"] in EXTRA_NODES_STATS:
data["nodes"][node["Node"]["skill"]]["stats"] = EXTRA_NODES_STATS[node["Node"]["name"]]["stats"]
data["nodes"][node["Node"]["skill"]]["reminderText"] = EXTRA_NODES_STATS[node["Node"]["name"]]["reminderText"]
with open(path, "w", encoding="utf-8") as o:
json.dump(data, o, indent=4)

Expand Down
14 changes: 14 additions & 0 deletions src/Export/spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6686,6 +6686,20 @@ return {
refTo="PassiveSkillMasteryGroups",
type="Key",
width=150
},
[32]={
list=false,
name="AtlasMastery_rid",
refTo="",
type="Key",
width=150
},
[33]={
list=false,
name="SoundEffect",
refTo="SoundEffects",
type="Key",
width=150
}
},
PassiveTreeExpansionJewelSizes={
Expand Down

0 comments on commit c819a68

Please sign in to comment.