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(balance): allow reading at penalty with full night vision, other visual/detection improvements #4172

Merged
merged 6 commits into from
Feb 7, 2024

Conversation

chaosvolt
Copy link
Member

@chaosvolt chaosvolt commented Jan 28, 2024

Purpose of change

This assembles together an assortment of minor vision/detection-related tweaks and improvements I'd written down on my todo list. Of note is finally allowing Full Night Vision to enable reading (slowly) in the dark. :3

Describe the solution

C++ changes:

  1. In avatar_action.cpp, changed avatar_action::move so that the "bump into walls while blind" thing also depends on if you have clairvoyance. Since clairvoyance of any strength shows you nearby walls, bumping into walls with it seems a tad pointless.
  2. In character.cpp, updated Character::sees to extend the range of detection with antennae from 3 to a more potentially useful 5. Additionally, set it so non-flying enemies are detected within this distance if you have the sonar CBM active (separate from the effect of can_see_with_specials in that it allows sonar CBM to sense any monster that's on the ground if you're close enough, as opposed to getting a thermal ping from any distance). This also means that monsters detected by sonar are also indentified when you get close enough.
  3. Also in character.cpp, updated Character::sees_with_specials so it will show thermal blips for enemies detected by antennae and non-flying enemies close enough to a sonar user. This fixes an issue I noticed where the antennae detection only shows a detected monster on your compass (not even showing direction since it's TECHNICALLY on screen), this way enemies detected by either are properly called out visually if they're nearby in darkness.
  4. In character_functions.cpp, set fine_detail_vision_mod so that having Full Night Vision just barely allows you to read in complete darkness. Bonus is get such that it's zero if night vision bonus is too low, but once high enough is set to an amount that just barely enables reading in complete darkness.
  5. In game.cpp, updated game::print_items_info so that the "there's stuff here but you can't see it" messages to not display if you're able to see that tile due to clairvoyance. Again an improvement for blindness+clairvoyance, since tile-wise it shows you item sprites there just fine.
  6. Also in game.cpp, updated the "can't see what that is" message in game::place_player to care if the player can see things just fine due to clairvoyance.

JSON changes:

  1. Updated description of Full Night Vision mutation.

Doc updates:

  1. Updated documentation on what night_vision_range does in json_info.md

Describe alternatives you've considered

Axing any of these should the potential performance impact feel too spicy.

Testing

  1. Compiled and load-tested.
  2. Gave myself a bionic setup to use ground sonar, confirmed the enemy radar shows nearby zeds through walls when close enough, and likewise tells me the name of detected worms when they're nearby.
  3. Tested I can't read in a basement with Night Vision or High Night Vision, but upgrading to Full Night Vision allows me to read with it saying it's slower.
  4. Blindfolded myself and bumped into walls, confirmed that granting myself a clairvoyance artifact stops me from wasting moves against walls I can now see.
  5. Looked at a pile of items while blind but clairvoyant, confirmed I can see what's there like normal, and confirmed that walking onto the pile tells me what's there with clairvoyance but still prints the "can't see shit fam" message without clairvoyance.
  6. Checked affected files for astyle.

Interesting note though: it doesn't actually show the detected monster's tile when antennae or ground sonar lets you "see" a nearby enemy, instead it just shows them on the enemy compass (not even showing direction, since it's almost always going to be an on-screen enemy at that distance). Hence having it also add a thermal marker now.

Additional context

Checklist

@github-actions github-actions bot added the src changes related to source code. label Jan 28, 2024
@Zireael07
Copy link
Contributor

I'm kinda iffy on FNV allowing you to read books. How would that even works, magic blob causes your eyes to magnify photons like night vision goggles do?

src/character.cpp Outdated Show resolved Hide resolved
@chaosvolt
Copy link
Member Author

I'm kinda iffy on FNV allowing you to read books. How would that even works, magic blob causes your eyes to magnify photons like night vision goggles do?

Sounds about right to be honest:

    "description": "You can see in pitch blackness as if you were wearing night-vision goggles.  Activate to toggle NV-visible areas on or off.",

There likely is some degree of light-amplification or possibly near-infrared involved, especially for Elfa-A and Trog mutants that get it. As noted, it's still the absolute bare minimum bonus to be able to read at all, which means it's slower than reading in proper lighting.

@Zireael07
Copy link
Contributor

degree of light-amplification or possibly near-infrared involved

Would be nice to have it spelled out in the description if that's the case.

@github-actions github-actions bot added the JSON related to game datas in JSON format. label Jan 29, 2024
chaosvolt and others added 2 commits January 29, 2024 13:10
Co-Authored-By: joveeater <6675689+joveeater@users.noreply.github.com>
@github-actions github-actions bot added the docs PRs releated to docs page label Jan 30, 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.

code duplication pain

@chaosvolt chaosvolt merged commit 19099e8 into cataclysmbnteam:main Feb 7, 2024
12 checks passed
@chaosvolt chaosvolt deleted the assorted-vision-updoots branch February 7, 2024 04:13
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.

3 participants