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: allow treating steel targets as practice targets #4143

Merged
merged 6 commits into from
Feb 4, 2024

Conversation

chaosvolt
Copy link
Member

@chaosvolt chaosvolt commented Jan 21, 2024

Purpose of change

This allows you to treat steel targets as shootable like you can with practice target traps, via a new flag that can in turn be used for other targets should we opt to add them in the future.

Describe the solution

C++ changes:

  1. In ranged.cpp, set target_ui::choose_initial_target so it also counts terrain or furniture with the SHOOT_ME flag as selectable targets too.

JSON changes:
2. Added SHOOT_ME flag to steel target furniture.

Documentation changes:

  1. Documented new flag in json_flags.md

Describe alternatives you've considered

  1. Hardcoding it so only specific furniture IDs can be shot at. That'd be kinda silly so meh.
  2. Coding in support for traps having flags so that practice target traps can be JSONized too.

Testing

  1. Checked affected JSON for syntax and lint errors.
  2. Compiled and load-tested.
  3. Spawned in a gun and a steel target, confirmed I can aim and shoot at it.
  4. Confirmed doing so grants me EXP.
  5. Spawned in a practice target too, aim function prioritizes practice target traps over steel targets.
  6. Spawned in a debug monster, aim prioritizes the monster over either.

Additional context

Checklist

@github-actions github-actions bot added src changes related to source code. JSON related to game datas in JSON format. labels Jan 21, 2024
@github-actions github-actions bot added the docs PRs releated to docs page label Jan 21, 2024
Copy link
Contributor

autofix-ci bot commented Jan 21, 2024

The Autofix app has found code style violation and automatically formatted this Pull Request.

I locally edit my commits (e.g: git, github desktop)

Please choose following options:

I'd like to accept the automated commit
  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.

This PR is complete and I don't want to edit it anymore

It's safe to ignore this message.

I edit this PR through web UI

You can ignore this message and continue working.

I have no idea what this message is talking about

You can ignore this message and continue working. If you find any problem, please ask for help and ping @scarf005.

@scarf005 scarf005 merged commit d937e8f into cataclysmbnteam:main Feb 4, 2024
12 checks passed
@chaosvolt chaosvolt deleted the shootable-steel-targets branch February 4, 2024 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs PRs releated to docs page 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