CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
9.98k stars 4.09k forks source link

Allow the CVD machine to coat non-steel weapons #56678

Open AmarinReyny opened 2 years ago

AmarinReyny commented 2 years ago

Is your feature request related to a problem? Please describe.

Certain weapons cannot be diamond-coated due to the materials they're made of, such as bronze or iron. I really wanted a diamond khopesh, too...!

Solution you would like.

I'd like for the CVD machine to be able to coat non-steel weapons.

Describe alternatives you have considered.

Making steel variations of bronze weapons, and switching all iron weapons to steel (basically what I've been doing in my own self-modded game anyway).

Additional context

No response

Maleclypse commented 2 years ago
{
    // Select an item to which it is possible to apply a diamond coating
    item_location loc = g->inv_map_splice( []( const item & e ) {
        return ( e.is_melee( damage_type::CUT ) || e.is_melee( damage_type::STAB ) ) &&
               e.made_of( material_steel ) &&
               !e.has_flag( flag_DIAMOND ) && !e.has_flag( flag_NO_CVD );
    }, _( "Apply diamond coating" ), 1, _( "You don't have a suitable item to coat with diamond" ) );

    if( !loc ) {
        return;
    }

Here in iexamine.cpp is where this would need to be changed. There may be irl reasons that it only works on steel but assuming that's not the case it should be pretty easy to add additional materials.