# Change the "use\_action": musical\_instrument/add a new "use\_action": "type"

**URL:** https://discourse.cataclysmdda.org/t/change-the-use-action-musical-instrument-add-a-new-use-action-type/11496
**Category:** The Drawing Board
**Created:** [March 1, 2016, 8:37am UTC](https://discourse.cataclysmdda.org/t/change-the-use-action-musical-instrument-add-a-new-use-action-type/11496 "2016-03-01T08:37:52Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mattychan](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/mattychan/32/294_2.png) [@mattychan](https://discourse.cataclysmdda.org/u/mattychan)
#### Post date: [March 1, 2016, 8:37am UTC](https://discourse.cataclysmdda.org/t/change-the-use-action-musical-instrument-add-a-new-use-action-type/11496/1 "2016-03-01T08:37:52Z")

</div>

Okay so, I made this item as an example.

`{
        "type" : "TOOL_ARMOR",
        "id" : "gameboy",
        "name" : "gameboy",
        "name_plural": "gameboys",
        "category" : "tools",
        "weight" : 2300,
        "color" : "green",
        "covers" : ["HANDS"],
        "to_hit" : -2,
        "max_charges": 100,
        "initial_charges": 100,
        "charges_per_use": 1,
        "turns_per_charge": 1,
        "ammo": "battery",
        "use_action": {
            "type": "musical_instrument",
            "speed_penalty": 15,
            "volume": 10,
            "fun": 2,
            "fun_bonus": 2,
            "description_frequency": 20,
            "descriptions": [
                "The game character jumps over an enemy.",
                "The game character collects a coin.",
                "You beat a level."
            ]
}`  
I know a game-pad item exists already, but if I did add this item into the json file it would give a moral boost called music. I simply propose (if possible) to pull the moral boost defining method out of the hard code. Something like this.

` "use_action": {
            "type": "moral_device",
            "moral_boost_name": "gaming",
            "speed_penalty": 15,
            "volume": 10,
            "fun": 2,
            "fun_bonus": 2,
            "description_frequency": 20,`  
This would allow for different and unique items to be made without needing to compile for every different item type. The “fun” and “fun\_bonus” variables could still handle the math of the moral boost you receive. As far as I know anyway.

I never could compile the code so sadly all I can do is post the idea. I have a lack of understanding on how to do it, but I won’t bother anyone further. However if there is an in depth tutorial on the matter please send it my way. I had used a program called code:blocks I think, but the code would not compile even if I changed nothing.
