.. as suggested by the comment in cata_catch.h:
// To avoid ODR violations, it's important that whenever a file includes
// catch.hpp it also includes stringmaker.h, so that all specializations of
// StringMaker match. Therefore, all test code should include catch.hpp via
// this file.
Honestly, i'm not exactly sure how valuable this is, given that we've
been running with the current odr-violating(?) setup for a while nand
not had many issues, but sure, why not.
* updated json flags
Updated json flags to accommodate for future items
* obsoleted exoskeleton helmets
Exoskeleton helmets serve no function anymore
* Update power_armor.json
Still very much WIP but the abstract exoskeleton item should give an idea of what I'm going for.
Also implemented abstract item for armor parts.
* Revert "Merge branch 'CombatExoskeletonUpdate' of https://github.com/BalthazarArgall/Cataclysm-DDA into CombatExoskeletonUpdate"
This reverts commit 7b9b9b66b6, reversing
changes made to 3d13b2ae66.
* Update power_armor.json
* Update power_armor.json
Definitive weight and volume for exoskeleton armor parts
* Obsoleted frame and generator frame
I don't see any point in them now that you can equip a backpack alongside exoskeletons and generator frames make little sense in my opinion.
* Update power_armor.json
Almost done with exoskeletons themselves, all I have to do is descriptions, touching up the flags and the salvaged version
* Update flags.json
Deleted unused exoskeleton flags
* Update power_armor.json
Final values in place, only the descriptions to do, maybe some flags
* Create power_armor.json
Added recipes for the armor parts
* Updated recipes and power_armor.json
* Solved all errors when launching with modified files
* Fixed spelling error "micromotors" to "micro motors".
* NO_UNLOAD flag removed from abstract exoskeleton
Users can now see/remove etc. the different exoskeleton attachments
* Added a volume_encumber_modifier of 0 to exoskeleton pockets to avoid insane amounts of encumbrance when wearing the armor parts
This may be the final commit, everything looks like it works, finally. I'm probably going to polish everything up, adjust values and changes a few descriptions.
* reworked, tested and polished the final version
* adjusted power consumption
* adjusted weight
* deleted unneeded plural names
* Double spaced the descriptions, re added plural names where needed
* updated description and carry weight bonus enchantment
* Revert "Revert "Merge branch 'CombatExoskeletonUpdate' of https://github.com/BalthazarArgall/Cataclysm-DDA into CombatExoskeletonUpdate""
This reverts commit 572fe896c3.
* Revert "Merge branch 'CombatExoskeletonUpdate' of https://github.com/BalthazarArgall/Cataclysm-DDA into CombatExoskeletonUpdate"
This reverts commit 7b9b9b66b6, reversing
changes made to 3d13b2ae66.
* Revert "Revert "Merge branch 'CombatExoskeletonUpdate' of https://github.com/BalthazarArgall/Cataclysm-DDA into CombatExoskeletonUpdate""
This reverts commit 6e1232e70f.
* Revert "Merge branch 'CleverRaven:master' into CombatExoskeletonUpdate"
This reverts commit e75fd82312, reversing
changes made to 0f10db9aa8.
* Revert "Revert "Merge branch 'CombatExoskeletonUpdate' of https://github.com/BalthazarArgall/Cataclysm-DDA into CombatExoskeletonUpdate""
This reverts commit 572fe896c3.
* Revert "Merge branch 'CombatExoskeletonUpdate' of https://github.com/BalthazarArgall/Cataclysm-DDA into CombatExoskeletonUpdate"
This reverts commit 7b9b9b66b6, reversing
changes made to 3d13b2ae66.
* Revert "Revert "Merge branch 'CombatExoskeletonUpdate' of https://github.com/BalthazarArgall/Cataclysm-DDA into CombatExoskeletonUpdate""
This reverts commit 572fe896c3.
* make code content identical to master
* deleting references to power armor
* replaced references to power armor
* sort lines alphabetically
* replaced references to depowered armor
* reworked the rework
* Repalced dots with ellipsis
* modified activation message
* fixed carry weight carry over and clarified effect description
* Adjusted encumbrance values, slightly adjusted and rounded energy consumption
* Adjusted encumbrance values slightly
* adjusted pocket sizes, adjusted armored zombie drops, deleted unused recipes, fixed armor recipes, added MOLLE/tactical pockets to a few items
* fixed armor pockets access cost
* fixed typo in flags, reverted pocket access cost
* Restart tests, just to make sure
* Maybe stuff is drying at the proper rate now
* adjusted battery stuff, integrated exertion modifer, made enchantments appear in the UI
* pockets probably cannot have holster while being MAGAZINE_WELL
* pockets probably cannot have holster while being MAGAZINE_WELL
* just revert the holster change
* update test, still failing
* Give exoskeletons their own itemgroup
* Adjust encumbrance values of reinforced armor and exoskeletons
* added welding requirements to reinforced armor
* Fix missing double space in description
* fix tests
* astyle formatting try 1
* astyle formatting try 2
* Are you happy now clang?
* clang, I swear to god...
* forgot to adjust crafting difficulty, slightly increased
* Restart tests, yes I changed my mind
* Update data/json/items/armor/combat_exoskeleton.json
Applied Drew suggestion for salvaged exoskeleton description
Co-authored-by: Drew4484 <57647637+Drew4484@users.noreply.github.com>
* Update data/json/items/armor/combat_exoskeleton.json
remove environmental flags from salvaged exoskeleton
Co-authored-by: Drew4484 <57647637+Drew4484@users.noreply.github.com>
* multiple changes, rough implementation
* multiple changes smoother implementation
* updated flag descriptions to accomodate combat exoskeletons
* updated reinforced versions crafting time
* remove exosuit management menu
* multiple changes, should be quite polished
* fixe a copy paste error
* fixes descriptions for exoskeleton armor
* anti-material typo
* Reload test
---------
Co-authored-by: Drew4484 <57647637+Drew4484@users.noreply.github.com>
* Cache results of `has_item_with_flag` and `all_items_with_flag`
Adds new functions `add_to_flagged_item_cache` and `remove_from_flagged_item_cache`, as well as new overloads in `visitable` to accomplish this
* Replace some `items_with` with `all_items_with_flag`
* Add special handling for the unique LIGHT flag
* Handle flagged item cache in `item::convert`
* Add note to flag_LIGHT that it's not a real flag
* Open the cache up to expansion beyond just `flag_id`s
* Rename "cache" to "caches"
* Add function `all_items_with` for inventory searches. Replaces `all_items_with_flag`.
There are three overloads for this function. One searches for an item flag, as `all_items_with_flag` did. One searches for all items that pass a specified boolean function. The last one does both. All three add the results to the cache.
* Fix cache handling for item contents
* Embed cache clearing into more item removal functions
Replaces `Character.worn.clear()` with `Character.clear_worn()`. `Character` is now a friend of `outfit` to accomplish this
* Use inv search cache for seeds
* Use inv search cache for cash cards
* Use inv search cache for npc food
* Update some implementations of `all_items_with`
* Use inv search cache for relic processing
* Change cache names to use the function name for simplicity
* Use `all_items_with` for relics in `recalculate_enchantment_cache`
* Include `set` in iexamine
* Use `on_item_acquire` in `convert`
* Handle `i_add` with charged items directly in the function itself
This lets us always assume that calls to the `try_add` overload with copies should, in fact, be doing so
* Adjust `try_add` copies to add all added items to the cache
It used to only add the first item. There's a CPU impact of this change when spawning huge amounts of items, but it's very slight
* Use `has_item_with_flag` instead of `all_items_with` in `link_up_actor`
* Use `all_items_with` for bionic cable functions
* Make `get_cable_vehicle` const
* Make `all_items_with` key use a const reference
* Add `clear_inv` for clearing Character's inventory and cache
* astyle invlet test
* Revert "Add `clear_inv` for clearing Character's inventory and cache"
This reverts commit 944d768dd1.
* Make cache use vectors of items instead of sets
* Deduplicate code in `all_items_with` overloads
Co-authored-by: andrei <68240139+andrei8l@users.noreply.github.com>
* Fix iteration in `remove_from_inv_search_caches`
Temporary measure while I rethink how the cache works. Co-authored-by: andrei <68240139+andrei8l@users.noreply.github.com>
* Greatly rework the item search cache and all its functions
The cache now uses safe references rather than direct item pointers. `all_items_with` replaced with `do_on_items_with`, a function that iterates through the cache, applying a given function to the items and removing invalid item pointers as it goes. There's also an overload that gives the function a boolean `abort` parameter that, if ever set to true, exits the loop immediately and returns true. Also adds `get_items_with` for creating a vector of all the cached item pointers.
* Remove `remove_from_inv_search_caches`
Also reverts changes that were made earlier to accomodate manual cache removal
* Replace `has_item_with_flag` with `has_any_item_with`
I went with a unique function name rather than overloading `read_only_visitable::has_item_with` since visitable can't use the caches, so they're worth differentiating
* Consolidate `do_to_items_with_until` and `has_any_item_with`
They basically did the same thing
* Leftover debug line
* Add `do_and_check_func` to `get_items_with`. Adds const versions
* Rename `get_items_with` to `all_items_with`
* Make `has_any_item_with` use const item references.
The const_cast added to radiocontrol is temporary
* Fix returns
* Fix radio control handling
Specifically, fixes the game letting you activate an RC with a bomb in your inventory (it doesn't activate but it also doesn't warn you). Adds a const version of the item pocket chain's `get_item_with`s to accomplish this
* Add additional overload to inv search functions that looks for an item type id
* Only cache flags of the item's type, not the item specifically.
We should only use const flags for caches, not ones that can be set/unset
* Add `can_link_up` for optimizing cable finding
* Implement inv search cache functions
* Temporary fix for item tests
I need to think about how to handle non-type flags
* Change all the item search function names to specifically mention the cache
I grew to dislike the "almost but not quite the same as visitable" names I've been using. These names are clearer
* Make separate const versions of `cache_visit_items_with`
It's better design to do this; `inv_search_caches` being mutable was causing ambiguity
* Bring back `has_item_with_flag`
Now that `cache_visit_items_with` only accepts item type flags, the original functionality to check for non-type flags like WET has been lost. This brings that back.
* Unused lambda captures
* Reference the references
---------
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)
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.
* Make `weapon` private
* Update tests
* Rebase
* Appley suggestions
* Fix weapon dorping
* fix weapon saving
* Rename to get_wielded_item
* rename to set_wielded_item
* fixes
* Post rebase fixes
* fixes
* fix weapon saving
* fixes
* more rebase and fixes
* Apply suggestions
* post rebase fixes
Move the player so game::load_npcs will actually spawn the NPCs.
Add REQUIREs to make the game not crash on failing to spawn NPCs.
Remove the weather setting because it doesn't change the tests, and
causes vision tests failures due to side effects!
Adjust the values of the m16a4 test to start passing.
* create npc_attack class
This implements a class that owns all of the logic for an npc evaluating the best weapon to use in the moment.
* Tests for npc_attack
* add a debug mode that shows potential values