* Add clang-tidy check to ensure fs::u8path is used to construct path from utf-8 string
* Fix fs::u8path and nullptr warnings
* Print error instead of showing a popup in test mode in write_to_file
* Remove cata::fstream wrappers
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.
* Add a test to check for monfaction reciprocity
It is possible for monfaction A to have a relationship of FRIENDLY or
NEUTRAL to monfaction B, which has a relationship of BY_MOOD or HATE
vs monfaction A. This leads to B attacking A without the possibility
of the reverse.
* Reformatting, possibly refactoring test
* Use c_str() instead of str() for printf.
* Fix non-reciprocal monster faction relationships
These are my current proposed changes to remove the monster faction
relationship reciprocity problems. @candlebury, I needed to alter
the player _monster_ faction (which does not affect, AFAIK, the
behavior of NPCs, much less the avatar) so that it would be at least
neutral to the robofac_spy; to avoid needing to do this for the larger
human monster faction (which includes exodii), I removed friendly
towards humans from the robofac_spy.
* Try to satisfy clang-tidy.
* Fix was wrong way around re mi-go and slime
Slime, instead of being neutral vs mi-go as a nether-derived faction,
was being by_mood, as per nether?
Co-authored-by: actual-nh <actual-nh@users.noreply.github.com>
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.
* Check reverse attitudes for monfactions_test matrix
It is desirable for attitudes and reverse attitudes between monster
factions to be congruent. Most troublesome is when one has
MFA_FRIENDLY or MFA_NEUTRAL and the other has MFA_BY_MOOD or
MFA_HOSTILE, whereupon the second will attack the first but the
first does not retaliate.
* Eliminate monster faction contradictions
Fixes#48071.
* Make fish and most others neutral vs each other
This removes land-based animals from being potential attackers of fish,
and vice-versa, avoiding possible problems due to their visibility as
pointed out by Venera3.
* Fix more fish faction relationships.
Limit non-neutral by/vs fish further to prevent either too much fish
death or fish attacking without retaliation.
* Adjust small_animal<->animal
Should default to neutral, as per the test.
* Take care of otter, razorclaw, exodii
Otters (and all other factions in obsolete.json) still show up on the
listing (can an "obsolete" flag or something be checked for?); removed
by_mood for them vs fish. Razorclaws are now neutral toward fish (and
vice-versa). Exodi are now by_mood vs (other) humans (and vice-versa).
* Fix test; bear/big_cat to by_mood vs fish
Swapped out dog for bear in monfactions_attitude test - has the same
pattern. I also changed bear and big_cat to by_mood vs fish.
* Fix infighting by human snails, amigara horrors
Amigara horrors and human snails were down as of the "mutant" faction,
which has by_mood toward itself, resulting in fighting within the
spawned groups. Changed amigara horror to mutant-derived faction
"amigara"; since human snails spawn with vortices and twisted bodies,
changed human snails and twisted bodies to "vortex". As a precaution,
also put shadows (including mon_darkman) and breathers (both) into
their own (nether-derived) factions.
* Remove unneeded breather and shadow factions.
I got mixed up; not needed, just "nether" does fine.
* Move slime back to neutral vs nether; cleanup
* Make mi-go/slime/nether NEUTRAL vs each other
Because they all spawn in the same groups (monstergroups/nether.json);
previously, they were NEUTRAL one-way and BY_MOOD the other in some
pairings, and I had put them as BY_MOOD both ways.
* Put human snail, twisted body in own faction
This prevents infighting between them when they appear together
(spiral) and they are made NEUTRAL to vortex and vice-versa.
* Fix Aftershock monster factions
Some Aftershock monster factions had BY_MOOD|HATE versus other factions
that had NEUTRAL/FRIENDLY toward them. This, upon an encounter, would
result in the first potentially (or definitely) attacking the latter,
while the latter would not retaliate. See #48077 for further
information.
* Hevel as herbivore, venandi as wolf
Also changes hevel, herbivore so NEUTRAL instead of friendly to other
one.
* Aftershock cryo adjustments; bloated corvid fix
* As per @Maleclypse, BY_MOOD changes for cryo
Changed cryo to BY_MOOD for herbivore/carnivore (which essentially
means just having "animal" in "by_mood"). Currently, insects are still
in HATE; I don't know if this is preferable or not.
* Change beavers from small_animal to herbivore.
One distinction between small_animal and larger is that the former are
not of interest to zombies, because they can't zombify. Beavers can,
and at ~20 kg are above the weight of the largest creature that can't
zombify (chonker cats).
* Start on fixing DinoMod factions
This has some example age-divided factions, various sizes of
predator, and no potential attacks without counterattack.
* Added monfactions.txt to .gitignore
Avoid accidental upload of a test-result file.
* Split up mosasaurus by ages
This splits up mosasaurus into mosasaurus and mosasaurus_young. THe
latter has both hatchlings and juveniles. (One problem I noticed with
the hatchlings - they have fins, and are AQUATIC... but are said to
be indistinguishable from others. That will need to be fixed in
0.F-dev (the description would need translating).
* Use copy-from for modifying base monster factions
From testing, it is possible for two mods that are both changing
the same base/vanilla monster factions to both work, provided both are
using copy-from. Change Aftershock to do so.
* Use copy-from in DinoMod vanilla faction changes
Mods that need to make changes in the same vanilla factions, generally
due to base_faction's copying of the base faction's attitude toward
itself, need to use "copy-from" in order not to conflict.
* Behavioral adjustments to dinosaurs.
Remove ATTACKMON - should not be needed with fixes to factions. Have
added PUSH_MON to some (the ones of very large size and/or DESTROYS),
to represent that they may push other monsters aside. I have also
removed STALK from the anger triggers for those not expected to be
berserk; this is partially to compensate for the MEAT pacification
trigger no longer being functional.
* Remove WARM from hatchling/juvenile mosasaurus.
They aren't large enough to have significant warmth retained without
specific mechanisms promoting this, and that would not be advantageous
in swimming - see <https://scholar.google.com/scholar_lookup?journal=Nature+Ecology+&+Evolution&title=A+general+scaling+law+reveals+why+the+largest+animals+are+not+the+fastest&author=MR+Hirt&author=W+Jetz&author=BC+Rall&author=U+Brose&volume=1&publication_year=2017&pages=1116-22&pmid=29046579&>.
* Adjust abilities of some tyranids + deinonychus
Adjusted abilities of tyrannids to take into account faster turning
speed. Also gave deinonychus max_dist for pathing of 10 (may need to
be higher), to allow for more intelligent routing.
* Adjust hadrosaurs, juvenile tyrannids, sauropods
Juvenile tyrannids: Dodge increased to reflect greater agility; still
not as high as adult (need to check on why "STUMBLES" is there).
Juvenile sauropods: Massive ones should not be quite as nervous as
other juveniles, particularly in a group (all appear in monstergroups
with a pack_size); gave GROUP_MORALE.
Hadrosaurs: Decreased agility -> decreased melee skill (dodge already
zero); see <https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6387760/>.
* DOGFOOD vs CATFOOD
Co-authored-by: LyleSY <lyle.sollayates@Gmail.com>
* Remove "STUMBLES"
Co-authored-by: LyleSY <lyle.sollayates@Gmail.com>
* Remove remainder of STUMBLES from juveniles
* Remove plpaceholder monsters for obsolete factions
* Make Moxies concentrate on humans, etc if they're around.
* Implement fix from #48588 for Deinonychus
I had added PATH_AVOID_DANGER_2 to Deinonychus, to be more appropriate
to their capabilities; there turns out to be a bug in it - this is
a fix (although it can be improved once there's something for avoiding
obvious fields).
Co-authored-by: actual-nh <actual-nh@users.noreply.github.com>
Co-authored-by: LyleSY <lyle.sollayates@Gmail.com>
* Check reverse attitudes for monfactions_test matrix
It is desirable for attitudes and reverse attitudes between monster
factions to be congruent. Most troublesome is when one has
MFA_FRIENDLY or MFA_NEUTRAL and the other has MFA_BY_MOOD or
MFA_HOSTILE, whereupon the second will attack the first but the
first does not retaliate.
* 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++
* switch monfactions to generic factory
speedup monfaction::attitude by changing the underlying data structure to vector
add missing factions to json
add basic unit tests