# How to add a trait that seeks flags in items

**URL:** <https://discourse.cataclysmdda.org/t/how-to-add-a-trait-that-seeks-flags-in-items/10436>\
**Category:** The Toolbox\
**Created:** [August 30, 2015, 9:51pm UTC](https://discourse.cataclysmdda.org/t/how-to-add-a-trait-that-seeks-flags-in-items/10436 "2015-08-30T21:51:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![FrankyPlaysGames](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/frankyplaysgames/32/32_2.png) [@FrankyPlaysGames](https://discourse.cataclysmdda.org/u/FrankyPlaysGames)\
**Post date:** [August 30, 2015, 9:51pm UTC](https://discourse.cataclysmdda.org/t/how-to-add-a-trait-that-seeks-flags-in-items/10436/1 "2015-08-30T21:51:11Z")

</div>

Hopefully that title isn’t too herpderp, I’m trying my hand at a mod for the second time and want to actually do something.

Basically, I’m looking to create a flag that I can add to weapons and clothing to give a morale boost to the character that has the matching trait. How would I go about that? I can make my own .json files but I can’t figure out where the mutations (or almost anything) draws the flags from. Any help? I also don’t want to give too much away with what I’m doing.

---

<div class="post-metadata">

**Author:** ![Random\_dragon](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@Random\_dragon](https://discourse.cataclysmdda.org/u/Random_dragon)\
**Post date:** [August 31, 2015, 1:07am UTC](https://discourse.cataclysmdda.org/t/how-to-add-a-trait-that-seeks-flags-in-items/10436/2 "2015-08-31T01:07:50Z")

</div>

Sadly a lot of the mutation properties are still hard-coded, so expanding on this would require source tweaks.

For an example, player.cpp in the source checks for mutation “WOOLALLERGY” during the code for equipping clothes.

---

<div class="post-metadata">

**Author:** ![Coolthulhu](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/coolthulhu/32/2446_2.png) [@Coolthulhu](https://discourse.cataclysmdda.org/u/Coolthulhu)\
**Post date:** [August 31, 2015, 8:49am UTC](https://discourse.cataclysmdda.org/t/how-to-add-a-trait-that-seeks-flags-in-items/10436/3 "2015-08-31T08:49:43Z")

</div>

Most of those should be hardcoded in player.cpp.

Whether you’re making an ability like Stylish or one like Gourmand, both should be implemented mostly (if not totally) in player.cpp.

EDIT: You could also try implementing it in lua, depending on what you’re trying to do.
