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

feat: Military ID cards can deactivate plutonium generator security for retrieval #5790

Merged

Conversation

karxi
Copy link
Contributor

@karxi karxi commented Dec 5, 2024

Checklist

Required

Purpose of change

The recent changes to Advanced Deconstruction make plutonium generators significantly more irritating to retrieve. While this is a good change overall, for those of us who took them and disassembled them (instead of installing them somewhere), it's a little frustrating.

Describe the solution

I've added a few functions, and adjusted the terrain object's JSON, so that military ID cards can be used to turn the terrain into an item without deconstructing it. I think this is reasonable: military ID cards are typically used to claim military items, so spending one to gain access to a military generator (instead of a military armory) seems fair.

Note that this does not give the other items that deconstruction would. The idea is that the generator separates itself (ejects plugs, closes, hatches, that kind of thing), which isn't as tidy for the surrounding wiring.

Describe alternatives you've considered

None, really. Having talked this out with others, it seems like a solid idea.

Testing

Set terrain to t_plut_generator → interact with it → if the player has at least one military ID card, they'll be prompted to use it. If not, they'll get a message suggesting that they'll have to disconnect it manually.

Changing the terrain (under the player) for testing can be done by pasting this (excruciatingly ugly) line of Lua into the console:

gapi.get_map():set_ter_at(gapi.get_avatar():get_pos_ms(), TerIntId.new(TerId.new("t_plut_generator")))

Additional context

image
image

@github-actions github-actions bot added src changes related to source code. JSON related to game datas in JSON format. labels Dec 5, 2024
Copy link
Contributor

autofix-ci bot commented Dec 5, 2024

Autofix has formatted code style violation in this PR.

I edit commits locally (e.g: git, github desktop) and want to keep autofix
  1. Run git pull. this will merge the automated commit into your local copy of the PR branch.
  2. Continue working.
I do not want the automated commit
  1. Format your code locally, then commit it.
  2. Run git push --force to force push your branch. This will overwrite the automated commit on remote with your local one.
  3. Continue working.

If you don't do this, your following commits will be based on the old commit, and cause MERGE CONFLICT.

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.

while the changes look good it the examine feature is too limited; it only works for plutonium generators. maybe we could rename it e.g deconstruct_cardreader and make it applicable to any furniture? that way other furnitures or modders could use this action too.

@karxi
Copy link
Contributor Author

karxi commented Dec 5, 2024

That's beyond my purview; we already have 3 different card reader examine functions. If someone else wants to add that functionality, they'll have to change all of them; until then, I don't think a fourth will hurt.

@scarf005 scarf005 changed the title feat(content): Military ID cards can deactivate plutonium generator security for retrieval feat: Military ID cards can deactivate plutonium generator security for retrieval Dec 5, 2024
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
image

i'm worried of adding another overly specific iuse function but still it's better than not having one.

@scarf005 scarf005 merged commit ab1cda7 into cataclysmbnteam:main Dec 5, 2024
12 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