28 lines
957 B
Python
Executable File
28 lines
957 B
Python
Executable File
import json
|
|
from deepdiff import DeepDiff
|
|
|
|
|
|
with open("/tmp/boss_spawns.json", "r") as f:
|
|
old_spawns = json.load(f)
|
|
|
|
with open("/tmp/spawn.json", "r") as f:
|
|
new_spawns = json.load(f)
|
|
|
|
diff = DeepDiff(old_spawns, new_spawns, ignore_order=True, verbose_level=2)
|
|
|
|
# Get the differences between the two JSON blobs
|
|
# Iterate through the diff to find spawnChance differences
|
|
for key, changes in diff.items():
|
|
if key == "values_changed":
|
|
for path, change in changes.items():
|
|
# Access the level and boss name directly from the path
|
|
level, boss = (
|
|
path.split("[")[1].split("]")[0],
|
|
path.split("[")[2].split("]")[0],
|
|
)
|
|
# Print the relevant difference in spawnChance
|
|
if "new_value" in change:
|
|
print(
|
|
f"Level: {level}, Boss: {boss}, Diff in spawnChance: {change['old_value']} -> {change['new_value']}"
|
|
)
|