Skip to content
Permalink
Browse files

Delay mutation_branch name & description translation

  • Loading branch information...
Qrox committed Sep 27, 2018
1 parent bf705c2 commit 90fb76b55b67effdf02bc5526fa2f4d43a331af0
Showing with 265 additions and 249 deletions.
  1. +2 −2 lua/class_definitions.lua
  2. +1 −1 src/handle_action.cpp
  3. +1 −1 src/iuse.cpp
  4. +12 −12 src/mutation.cpp
  5. +209 −204 src/mutation.h
  6. +15 −5 src/mutation_data.cpp
  7. +8 −8 src/mutation_ui.cpp
  8. +5 −4 src/newcharacter.cpp
  9. +1 −1 src/npc.cpp
  10. +4 −4 src/player.cpp
  11. +5 −5 src/player_display.cpp
  12. +2 −2 src/wish.cpp
@@ -133,11 +133,9 @@ classes = {
bodytemp_sleep = { type = "int", writable = true },
cooldown = { type = "int", writable = true },
cost = { type = "int", writable = true },
description = { type = "string", writable = true },
fatigue = { type = "bool", writable = true },
hunger = { type = "bool", writable = true },
mixed_effect = { type = "bool", writable = true },
name = { type = "string", writable = true },
points = { type = "int", writable = true },
profession = { type = "bool", writable = true },
purifiable = { type = "bool", writable = true },
@@ -149,6 +147,8 @@ classes = {
visibility = { type = "int", writable = true },
},
functions = {
{ name = "name", rval = "string", args = { } },
{ name = "desc", rval = "string", args = { } },
{ name = "get_display_color", rval = "nc_color", args = { } },
}
},
@@ -727,7 +727,7 @@ static void sleep()
for( auto &mut : u.get_mutations() ) {
const auto &mdata = mut.obj();
if( mdata.cost > 0 && u.has_active_mutation( mut ) ) {
active.push_back( mdata.name );
active.push_back( mdata.name() );
}
}
std::stringstream data;
@@ -1094,7 +1094,7 @@ int iuse::purify_smart( player *p, item *it, bool, const tripoint & )
p->purifiable( traits_iter.first ) ) {
//Looks for active mutation
valid.push_back( traits_iter.first );
valid_names.push_back( traits_iter.first->name );
valid_names.push_back( traits_iter.first->name() );
}
}
if( valid.empty() ) {
@@ -309,7 +309,7 @@ void player::activate_mutation( const trait_id &mut )
( mdata.fatigue && get_fatigue() >= EXHAUSTED ) ) {
// Insufficient Foo to *maintain* operation is handled in player::suffer
add_msg_if_player( m_warning, _( "You feel like using your %s would kill you!" ),
mdata.name.c_str() );
mdata.name() );
return;
}
if( tdata.powered && tdata.charge > 0 ) {
@@ -895,10 +895,10 @@ bool player::mutate_towards( const trait_id &mut )
add_msg_player_or_npc( rating,
_( "Your %1$s mutation turns into %2$s!" ),
_( "<npcname>'s %1$s mutation turns into %2$s!" ),
replace_mdata.name.c_str(), mdata.name.c_str() );
replace_mdata.name(), mdata.name() );
add_memorial_log( pgettext( "memorial_male", "'%s' mutation turned into '%s'" ),
pgettext( "memorial_female", "'%s' mutation turned into '%s'" ),
replace_mdata.name.c_str(), mdata.name.c_str() );
replace_mdata.name(), mdata.name() );
unset_mutation( replacing );
mutation_loss_effect( replacing );
mutation_effect( mut );
@@ -918,10 +918,10 @@ bool player::mutate_towards( const trait_id &mut )
add_msg_player_or_npc( rating,
_( "Your %1$s mutation turns into %2$s!" ),
_( "<npcname>'s %1$s mutation turns into %2$s!" ),
replace_mdata.name.c_str(), mdata.name.c_str() );
replace_mdata.name(), mdata.name() );
add_memorial_log( pgettext( "memorial_male", "'%s' mutation turned into '%s'" ),
pgettext( "memorial_female", "'%s' mutation turned into '%s'" ),
replace_mdata.name.c_str(), mdata.name.c_str() );
replace_mdata.name(), mdata.name() );
unset_mutation( replacing2 );
mutation_loss_effect( replacing2 );
mutation_effect( mut );
@@ -944,10 +944,10 @@ bool player::mutate_towards( const trait_id &mut )
add_msg_player_or_npc( rating,
_( "Your innate %1$s trait turns into %2$s!" ),
_( "<npcname>'s innate %1$s trait turns into %2$s!" ),
cancel_mdata.name.c_str(), mdata.name.c_str() );
cancel_mdata.name(), mdata.name() );
add_memorial_log( pgettext( "memorial_male", "'%s' mutation turned into '%s'" ),
pgettext( "memorial_female", "'%s' mutation turned into '%s'" ),
cancel_mdata.name.c_str(), mdata.name.c_str() );
cancel_mdata.name(), mdata.name() );
unset_mutation( canceltrait[i] );
mutation_loss_effect( canceltrait[i] );
mutation_effect( mut );
@@ -967,10 +967,10 @@ bool player::mutate_towards( const trait_id &mut )
add_msg_player_or_npc( rating,
_( "You gain a mutation called %s!" ),
_( "<npcname> gains a mutation called %s!" ),
mdata.name.c_str() );
mdata.name() );
add_memorial_log( pgettext( "memorial_male", "Gained the mutation '%s'." ),
pgettext( "memorial_female", "Gained the mutation '%s'." ),
mdata.name.c_str() );
mdata.name() );
mutation_effect( mut );
}

@@ -1078,7 +1078,7 @@ void player::remove_mutation( const trait_id &mut )
add_msg_player_or_npc( rating,
_( "Your %1$s mutation turns into %2$s." ),
_( "<npcname>'s %1$s mutation turns into %2$s." ),
mdata.name.c_str(), replace_mdata.name.c_str() );
mdata.name(), replace_mdata.name() );
set_mutation( replacing );
mutation_loss_effect( mut );
mutation_effect( replacing );
@@ -1098,7 +1098,7 @@ void player::remove_mutation( const trait_id &mut )
add_msg_player_or_npc( rating,
_( "Your %1$s mutation turns into %2$s." ),
_( "<npcname>'s %1$s mutation turns into %2$s." ),
mdata.name.c_str(), replace_mdata.name.c_str() );
mdata.name(), replace_mdata.name() );
set_mutation( replacing2 );
mutation_loss_effect( mut );
mutation_effect( replacing2 );
@@ -1117,7 +1117,7 @@ void player::remove_mutation( const trait_id &mut )
add_msg_player_or_npc( rating,
_( "You lose your %s mutation." ),
_( "<npcname> loses their %s mutation." ),
mdata.name.c_str() );
mdata.name() );
mutation_loss_effect( mut );
}

0 comments on commit 90fb76b

Please sign in to comment.
You can’t perform that action at this time.