Cataclysm-dda: Add ability to set tiles for installed CBMs

Created on 11 Jan 2019  路  4Comments  路  Source: CleverRaven/Cataclysm-DDA

Just like with mutations, i want ability to create tiles for bionics when it is installed on player or NPCs.

Tiles / Sound

Most helpful comment

I ve been working on that in the past few days, but it's a slow process since I learn about c++ and CDDA's code as I go. Someone with more experience might pick it up and do it much faster

All 4 comments

I ve been working on that in the past few days, but it's a slow process since I learn about c++ and CDDA's code as I go. Someone with more experience might pick it up and do it much faster

The relevant logic is player::get_overlay_ids() .

You'll want to add something like:

for( const bionic &bio: *my_bionics ) {
    // this static cast is kind of gross
    const trait_id bio_as_trait( static_cast<trait_id>( bio.id ) );
    auto it = base_mutation_overlay_ordering.find( bio_as_trait );
    auto it2 = tileset_mutation_overlay_ordering.find( bio_as_trait );
    int value = 9999;
    if( it != base_mutation_overlay_ordering.end() ) {
        value = it->second;
    }
    if( it2 != tileset_mutation_overlay_ordering.end() ) {
        value = it2->second;
    }
    mutation_sorting.insert( std::pair<int, std::string>( value, bio_as_trait.str() ) );
}

added between the existing get_mutations() for loop and the mutation_sorting for_loop. Then you'd just need to add the bionic overlays to the tileset data and everything else should fall into place, hopefully.

@Fris0uman, are you still working on this one? I'm interested in trying it if you're not.

Go ahead, sorry for the delay but real life got in the way of my progress

Was this page helpful?
0 / 5 - 0 ratings

Related issues

2birdie picture 2birdie  路  3Comments

jeremyshannon picture jeremyshannon  路  3Comments

natsirt721 picture natsirt721  路  3Comments

RogueYun picture RogueYun  路  3Comments

Tsunder picture Tsunder  路  3Comments