Skip to content

Conversation

@hirzalla
Copy link

Context

looking into potentially using the monsters.json dump from this repo, but noticed a couple things 👀


Issue 1: max_hit taken as a string

even tho the api provides multiple values, the script just takes the first one (which isn’t in a specific order)

response:
API response

json
Scraped JSON

w/ fix
With fix


Issue 2: some npcs return back a single string of multiple max hits separated by line break tags

similar to issue 1, but here the script grabs the entire string, which is then parsed as an int on the frontend—grabbing just the first number (also no specific order).

response:
API response 2

json
Scraped JSON 2

w/ fix
With fix 2


here's a dump of (diffs only) the re-scraped json monsters-diffs.txt

changes

  • scripts/generateMonsters.py:
    restructured max_hit into an array; split values on linebreaks when needed

  • src/lib/Monsters.ts:
    updated maxHit parsing for Monster to grab largest value from the array (if passed array)

@LlemonDuck
Copy link
Collaborator

I'm onboard with including this change if we're actually showing it in the UI, which is more of a @jayktaylor change. I can see it being nice to show something like the following mock:
image

Since we already ignore the value in calc, I can't see it being an issue? @jayktaylor?

@LlemonDuck LlemonDuck requested a review from jayktaylor April 1, 2025 00:00
@LlemonDuck
Copy link
Collaborator

LlemonDuck commented Apr 1, 2025

In the broader scope, I will add the caveat that I'm not interested in maintaining a json with fields that we don't use, I just actually see a use here for us. You're more than free to fork the repo (and I'd even recommend it here) and run the action yourself, it's the one in regenerate.yml, and only requires making a PAT for the repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants