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

refactor(content): JSONize Pumps #3633

Merged
merged 13 commits into from
Nov 15, 2023
Merged

Conversation

Ali-Anomma
Copy link
Contributor

@Ali-Anomma Ali-Anomma commented Nov 11, 2023

Summary

SUMMARY: Infrastructure "Make pumps give their own custom liquids in written json, instead of giving hardcoded water variants."

Purpose of change

Describe the solution

By adding a new examine action, liquid_source; furnitures are now able to dispense liquids specified in new json field provides_liquids.

Describe alternatives you've considered

adding more hardcoded pump variety

Testing

used msys on win 10.
added beer pump item for debug purposes.

Additional context

image

  • fixed the time so liquids come fresh
  • reminder to convert old water pumps

@github-actions github-actions bot added src changes related to source code. JSON related to game datas in JSON format. labels Nov 11, 2023
@scarf005 scarf005 changed the title Add json Pumps refactor: JSONize Pumps Nov 11, 2023
@scarf005 scarf005 changed the title refactor: JSONize Pumps refactor(content): JSONize Pumps Nov 13, 2023
Copy link
Member

@scarf005 scarf005 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

this is cool. thanks for the contribution!

image

also, don't forget to create a new branch before opening PR (upload branch should be kept intact)

Comment on lines +3813 to 3823
//Note that these three functions are checked by pointer in map::water_from. Yes it's awful.
void iexamine::water_source( player &, const tripoint &examp )
{
liquid_handler::handle_liquid( examp );
}

//Note that these two functions are checked by pointer in map::water_from. Yes it's awful.
//Note that these three functions are checked by pointer in map::water_from. Yes it's awful.
void iexamine::clean_water_source( player &, const tripoint &examp )
{
liquid_handler::handle_liquid( examp );
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since iexamine::liquid_source can handle any liquid, it'd be great to be able to replace iexamine::water_source and iexamine::clean_water_source with it someday to cleanup more code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since iexamine::liquid_source can handle any liquid, it'd be great to be able to replace iexamine::water_source and iexamine::clean_water_source with it someday to cleanup more code.

but wont it break the older mods which has its own water sources? these two old functions should last until 0.5 at least.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could soft deprecate them by

  • making furn_t::crafting_pseudo_item_types call &iexamine::liquid_source for both water_source and clean_water_source
  • convert existing "examine_action": "water_source" into "examine_action": "liquid_source"

@scarf005 scarf005 added this pull request to the merge queue Nov 15, 2023
Merged via the queue into cataclysmbnteam:upload with commit 5cab4a4 Nov 15, 2023
14 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JSON related to game datas in JSON format. src changes related to source code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants