Add map::on_matching_stairs() that checks whether two positions
are connected by stairs (same XY, 1 z-level apart, lower has
GOES_UP, upper has GOES_DOWN).
Exempt matching stairs from the four cross-z melee blocks:
- Character::melee_attack
- Character::can_reach_attack
- monster::attack_at
- monster::move z-gate
Rooftop and ledge attacks remain disabled.
- matrix.yml SKIP condition referenced non-existent job names
(skip-duplicates, skip-duplicates-mods); corrected to match declared
jobs (skip-duplicates-code, skip-duplicates-data). Same fix for the
commented emscripten block.
- tests/Makefile batch runs now use --user-dir with a unique PID-based
path so parallel shard execution doesn't collide on filesystem state.
- Normalized comma-separated TEST_CASE tags to space-separated across
9 test files (25 declarations). Comma syntax is deprecated in Catch2
v2 and removed in v3. Also fixed a missing space between adjacent
tags in throwing_test.cpp.
* add visibility update
* vis update when peeking
* fix autodrive visibility
* revert visibility optimization
* only cache tile visibility on access
* use apparent_light_at to handle visibility cache
* Revert "use apparent_light_at to handle visibility cache"
This reverts commit 37f66fda9e.
* Revert "only cache tile visibility on access"
This reverts commit b52cd59827.
* pos and time visibility invalidation
Co-Authored-By: andrei <68240139+andrei8l@users.noreply.github.com>
* fix peek and look around
* fix tests
---------
Co-authored-by: andrei <68240139+andrei8l@users.noreply.github.com>
* Convert integer parsing test to use normal TEST_CASEs
* Rename test name too similar to another
* Test to enforce normalized test names
* Normalize TEST_CASE names (scripted)
* Grabs the first
C++ and documentation
* Tests, Tweaks, Docs
* Rebase fixes
* Update src/mattack_actors.cpp
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Src tweaks
Mattack proper, was_loaded
* JSON changes
Including WIP second grabs, mods, but no dinos
* Apply suggestions from code review
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Src oopsie
* Update src/mattack_actors.cpp
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Update src/mattack_actors.cpp
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Src Oopsie 2
* Backup WIP (don't ask)
* Dinomod part 1
* Dinomod Part Two
* Final?
* Apply suggestions from code review
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Clang
* Ampersin
* We used to talk, Basic Build
You could complain about more than a single file at once, back then
* Mamaaaa
* Update monster_attack_test.cpp
* Armor
* Teleport oopsie
* Clang?
* Plop
* Clang me up, Scotty
* Un-complexify the grab test
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: David Seguin <davidseguin@live.ca>
* First
No JSON, Flexbuffers are mean
* JSON
* astyle, clang?
* Claaang
* It puts the astyle on its code or it gets the hose again
* Clang??
* Apply suggestions from code review
Co-authored-by: Anton Burmistrov <Night_Pryanik@mail.ru>
* Global?
* effect limb score modifiers
* WIP
* Doneish
* Tweak
* Monster attacks
* Test WIP
* Test fixes
* Tweak
* Clang
* Actually clang
* astyle
---------
Co-authored-by: Anton Burmistrov <Night_Pryanik@mail.ru>
* Enable clang-tidy check modernize-avoid-c-arrays
Convert various arrays to std::array
* Fix more array warnings
These issues were found in CI due to it compiling with different
features than me.
* Don't us sizeof( std::array )
It's clearer to use .size().
This test was flaky because the variance in damage was pretty high. We
didn't want to make the test slower by adding more samples all the time,
but luckily the test_statistics helper classes already have a function
to help with this issue. Rather than unconditionally stopping after 100
samples, we continue sampling until the test is certain about whether
the average damage is contained within the specified range.
For the specific failing example I was testing with, this cause 22
additional samples (for a total of 122) and then the test passed.
* Added monster support and Slime Ocularium
Currently the Ocularium cannot be created, this is intentional - Slimewave is still useful through slime minions from Omnicellular
* Large camera and rendering changes
Makes cameras independent from player vision radius limits, dirties vision cache while cameras are active, and adds better vision falloff to cameras.
In addition, removes recalculation of seen_cache during long activities except on refresh frames - an optimization that arose from camera needs.
* Updates tests, bugfixes player half-seeing monsters
Player was able to detect a monster existed, especially on the compass, but not see their location, when the mosnter was outside of sight_max range (usually 9999, but sometimes much smaller for certain mutations and effects)
* Vision lightcasting now checks sightmax first
Also upped MYOPIC vision radius, preventing an adverse effect of excessive blindness - and somehow making a much nicer vision effect for short-sighted characters.
Mirrors were giving inaccurate vision ranges - also I nerfed mirrors because its now possible to nerf mirrors.
Co-authored-by: bombasticSlacks <dillon.matchett@gmail.com>
Co-authored-by: Kevin Granade <kevin.granade@gmail.com>
Our string_id constants were a mixture of temporaries, locals, and
globals. Pull them all out as globals, for consistency and efficiency.
The efficiency comes from the fact that each string_id instance caches
its respective int_id, and sharing one instance means that value need
not be recomputed.
* Route feral human and other rock throwing through the throwing code
Necessitated some touchups on the sanity test for same.
* Extend the rock throwing sanity test to check multiple ranges
Change to tripoint_abs_ms:
- goal [was map-relative]
- wander_pos [was map-relative]
- patrol_route [was absolute but not typed]
Remove serialization for path.
Invalidate path on map shift.
Made goal optional, unset when reached.
Rename goal-related functions for consistency/readability.
Catch2 provides a customization point for converting our types to
strings by specializing the StringMaker template.
We have some specializations in stringmaker.h, but this feature was only
working intermittently. I finally figured out that was due to an ODR
violation. The test files that didn't include stringmaker.h were
compiling a different specialization than the ones that did.
Re-jig the test includes so that any file including catch.hpp also
includes stringmaker.h, thereby ensuring that the custom
specializations are used everywhere and there is no ODR violation.
I achieved this by adding a new cata_catch.h header and making all
existing headers include catch.hpp via the new header.
* added sees check and debugmsg
(cherry picked from commit 752f0c444b)
* Update src/monster.cpp
Co-authored-by: anothersimulacrum <anothersimulacrum@gmail.com>
(cherry picked from commit da7c76072f)
* excempt stairs&ramps from vision check
(cherry picked from commit 152980e928)
* monster::melee_attack returns false for zlvl violations
(cherry picked from commit cc7b3b7a5d)
* Require daytime for sees in monster_attack test.
Make sure there should be enough light for things to be visible;
weather might also need checking.
(cherry picked from commit 6d253c9f75)
* Set time to daytime.
It wasn't previously (see results of REQUIRE).
(cherry picked from commit 321404f26c)
* Move forward by 2 hours.
It gets set to daytime, but isn't?
(cherry picked from commit 592d0c1f43)
* See if can get info on hour of day.
(cherry picked from commit ea65b7e9bc)
* Try again on checking hour of day.
(cherry picked from commit 874bccf2f4)
* Blasted parenthesis.
In case you're wondering why I don't seem to be compiling locally
before sending things - even with everything else already present
as an object file, the version+ar+compiling the test+putting together
the test executable still takes something like 5-10 minutes...
(cherry picked from commit 23e1394c23)
* Template problem
I'm still learning my way around C++ where it differs from C.
(cherry picked from commit 1282f44ae3)
* Set weather, update sight limits
If this doesn't work, I'll try the steps in vision_test.cpp.
(cherry picked from commit 2062bbc71d)
* Wipe visibility, map caches in monster_attack
This is in case something is left over in one of these caches that's
causing problems.
(cherry picked from commit ce394e20c0)
* Set WEATHER_NULL for weather_override in tests
This sets weather_override to WEATHER_NULL in two places, namely after
(if no exceptions occur!) the monster_attack test and before the
weather realism test. The former should be replaced by
scoped_weather_override (#48227) after that's been merged.
(cherry picked from commit dcacb3d11e)
* Use scoped_weather_override in monster_attack test
Simply doing get_weather().weather_override = WEATHER_NULL at the end
is not sufficient, since it will not be run in the event of an
exception, such as from Catch2.
(cherry picked from commit 49d5f2473b)
* Wrong syntax for scoped_weather_override.
As mentioned before, I'm still learning regarding C++ differences
from C.
(cherry picked from commit c90ae42aa5)
* Start on unifying sees requirement with testing
This is a unification of most of #47993 with most of #48202, in an
attempt to remove problems (seen in #42845, which this hopefully
will fix) with players unable to see monsters on different z-levels
(and, as it turns out, the other way around) but they are still able
to attack the player. This is additionally complicated by that,
when fov_3d is enabled, the player can see the monsters and vice-versa,
and they should be able to attack each other (when at an appropriate
distance).
* Use is_adjacent with fov_3d for melee attacks
This changes the melee_attack code in melee.cpp for
Character::melee_attack to consider non-adjacent anything across
z-levels when fov_3d is false. (It is possible that an actual sees
check will be needed, but let's see how this does - no pun intended.)
reach_attack may be a problem still.
Co-authored-by: Jamuro-g <toenli.e@gmail.com>
Co-authored-by: Jamuro-g <76928284+Jamuro-g@users.noreply.github.com>
Co-authored-by: actual-nh <actual-nh@users.noreply.github.com>
* Remove different behavior for debug_mode in Creature::sees()
Creature::sees(), if its parameter was a creature, was ignoring
a false fov_3d combined with different z-levels if debug_mode was
true. This is not true for Creature::sees() for a specific tripoint,
which is inconsistent, and having debug mode result in significantly
different in-game behavior is undesirable.
* Remove debug_mode check from monster attack test
This PR removes the relevance of `debug` to `sees`. Thus, capturing
its value is no longer needed.
Co-authored-by: actual-nh <actual-nh@users.noreply.github.com>
* Change _ctype.h and __locale to cctype and clocale
* Change _wctype.h to cwctype in game.cpp
* Change __functional_base to functional
* Remove libcxx internal headers
* Remove UNIX system headers
* Fix clang-tidy error with -nostdinc++