Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update name, volume, and weight json members to newer format #35857

Merged
merged 4 commits into from
Dec 4, 2019

Conversation

KorGgenT
Copy link
Member

@KorGgenT KorGgenT commented Dec 4, 2019

Summary

SUMMARY: Content "Update name, volume, and weight json members to newer format: bird, fish, defense_bot, drone"

Purpose of change

The prupose of this is to start to move name, volume, and weight json members to use the newer format.
For name, this is the translation object { "str": string, "str_pl": string } that can also have context.
For volume and weight, this is enforcing using the strings over raw integers (perhaps in order to deprecate reading the numbers from json entirely later on, so that it's truly enforced) And also using larger units where appropriate for readability (like "1 kg" instead of "1000 g")

Describe alternatives you've considered

Keep the inconsistencies i guess?

Testing

For each of the 4 json files, I made the edits and then spawned in 2-3 of the monsters that were in that file, then murdering them and checking their corpse size. For the robots, I think this type of test probably doesn't work, but i'm not sure how to check the volume of a monster in-game otherwise. The game loaded with no json errors and their names were correct as well.

Additional context

I sort of came upon this inconsistency writing another app that reads cdda's json. I didn't really see a reason for this particular inconsistency, and it likely stems from introducing a new way of reading the values from json without updating all of the json entries to suit. It should be a pretty low-impact change, due to the actual values not changing, just changing how they appear in json.

@KorGgenT KorGgenT added [JSON] Changes (can be) made in JSON Monsters Monsters both friendly and unfriendly. Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style labels Dec 4, 2019
@ZhilkinSerg ZhilkinSerg merged commit 0ec80bc into CleverRaven:master Dec 4, 2019
I-am-Erk pushed a commit to I-am-Erk/Cataclysm-DDA that referenced this pull request Dec 6, 2019
…aven#35857)

* update bird.json name, weight, volume

* update defense_bot.json name, volume, weight

* update drone.json name, abstract

* update fish.json name, weight, volume
@KorGgenT KorGgenT deleted the birb-json-update branch December 6, 2019 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style [JSON] Changes (can be) made in JSON Monsters Monsters both friendly and unfriendly.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants