Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makes Chlormorph an explicit upgrade over Roots/Rooter #55399

Merged
merged 3 commits into from
Apr 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions data/json/mutations/mutations.json
Original file line number Diff line number Diff line change
Expand Up @@ -6444,6 +6444,7 @@
"prereqs": [ "ROOTS2" ],
"prereqs2": [ "SAPROPHAGE" ],
"threshreq": [ "THRESH_PLANT" ],
"changes_to": [ "CHLOROMORPH" ],
"category": [ "PLANT" ],
"encumbrance_covered": [ [ "foot_l", 10 ], [ "foot_r", 10 ] ]
},
Expand All @@ -6457,7 +6458,7 @@
"description": "Every inch of your skin is packed with chlorophyll and you have strong roots. Sleeping on diggable soil will satisfy any hunger or thirst you might have. Activate this mutation to force yourself to sleep until nightfall.",
"purifiable": false,
"types": [ "LEGS" ],
"prereqs": [ "ROOTS2", "ROOTS3" ],
"prereqs": [ "ROOTS3" ],
"prereqs2": [ "SAPROPHAGE" ],
"threshreq": [ "THRESH_PLANT" ],
"cancels": [ "SMELLY", "SMELLY2" ],
Expand All @@ -6473,7 +6474,7 @@
"name": { "str": "Mycorrhizal Communion" },
"points": 2,
"description": "You have gained the ability to commune with trees and comprehend their ancient wisdom. Activate next to a tree to gradually gain overmap vision through connected forests.",
"prereqs": [ "HAIRROOTS", "ROOTS2", "ROOTS3" ],
"prereqs": [ "HAIRROOTS", "ROOTS2", "ROOTS3", "CHLOROMORPH" ],
"threshreq": [ "THRESH_PLANT", "THRESH_ELFA" ],
"category": [ "PLANT", "ELFA" ],
"active": true,
Expand Down
11 changes: 6 additions & 5 deletions src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4606,7 +4606,7 @@ needs_rates Character::calc_needs_rates() const
if( has_activity( ACT_TREE_COMMUNION ) ) {
// Much of the body's needs are taken care of by the trees.
// Hair Roots don't provide any bodily needs.
if( has_trait( trait_ROOTS2 ) || has_trait( trait_ROOTS3 ) ) {
if( has_trait( trait_ROOTS2 ) || has_trait( trait_ROOTS3 ) || has_trait( trait_CHLOROMORPH ) ) {
rates.hunger *= 0.5f;
rates.thirst *= 0.5f;
rates.fatigue *= 0.5f;
Expand Down Expand Up @@ -7641,7 +7641,7 @@ void Character::update_vitamins( const vitamin_id &vit )
void Character::rooted_message() const
{
bool wearing_shoes = footwear_factor() == 1.0;
if( ( has_trait( trait_ROOTS2 ) || has_trait( trait_ROOTS3 ) ) &&
if( ( has_trait( trait_ROOTS2 ) || has_trait( trait_ROOTS3 ) || has_trait( trait_CHLOROMORPH ) ) &&
get_map().has_flag( ter_furn_flag::TFLAG_PLOWABLE, pos() ) &&
!wearing_shoes ) {
add_msg( m_info, _( "You sink your roots into the soil." ) );
Expand All @@ -7655,10 +7655,10 @@ void Character::rooted()
// TODO: The rates for iron, calcium, and thirst should probably be pulled from the nutritional data rather than being hardcoded here, so that future balance changes don't break this.
{
double shoe_factor = footwear_factor();
if( ( has_trait( trait_ROOTS2 ) || has_trait( trait_ROOTS3 ) ) &&
if( ( has_trait( trait_ROOTS2 ) || has_trait( trait_ROOTS3 ) || has_trait( trait_CHLOROMORPH ) ) &&
get_map().has_flag( ter_furn_flag::TFLAG_PLOWABLE, pos() ) && shoe_factor != 1.0 ) {
int time_to_full = 43200; // 12 hours
if( has_trait( trait_ROOTS3 ) ) {
if( has_trait( trait_ROOTS3 ) || has_trait( trait_CHLOROMORPH ) ) {
time_to_full += -14400; // -4 hours
}
if( x_in_y( 96, time_to_full ) ) {
Expand Down Expand Up @@ -8915,7 +8915,8 @@ int Character::run_cost( int base_cost, bool diag ) const
movecost += 8;
}

if( has_trait( trait_ROOTS3 ) && here.has_flag( ter_furn_flag::TFLAG_DIGGABLE, pos() ) ) {
if( ( has_trait( trait_ROOTS3 ) || has_trait( trait_CHLOROMORPH ) ) &&
here.has_flag( ter_furn_flag::TFLAG_DIGGABLE, pos() ) ) {
movecost += 10 * footwear_factor();
}

Expand Down
3 changes: 2 additions & 1 deletion src/morale.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ static const efftype_id effect_took_prozac_bad( "took_prozac_bad" );

static const trait_id trait_BADTEMPER( "BADTEMPER" );
static const trait_id trait_CENOBITE( "CENOBITE" );
static const trait_id trait_CHLOROMORPH( "CHLOROMORPH" );
static const trait_id trait_FLOWERS( "FLOWERS" );
static const trait_id trait_LEAVES2( "LEAVES2" );
static const trait_id trait_LEAVES3( "LEAVES3" );
Expand Down Expand Up @@ -1081,7 +1082,7 @@ void player_morale::update_constrained_penalty()
pen += bp_pen( bodypart_id( "head" ), 10 );
}
if( has_mutation( trait_ROOTS1 ) || has_mutation( trait_ROOTS2 ) ||
has_mutation( trait_ROOTS3 ) ) {
has_mutation( trait_ROOTS3 ) || has_mutation( trait_CHLOROMORPH ) ) {
pen += bp_pen( bodypart_id( "foot_l" ), 5 );
pen += bp_pen( bodypart_id( "foot_r" ), 5 );
}
Expand Down
10 changes: 6 additions & 4 deletions src/mutation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ static const mutation_category_id mutation_category_ANY( "ANY" );

static const trait_id trait_BURROW( "BURROW" );
static const trait_id trait_BURROWLARGE( "BURROWLARGE" );
static const trait_id trait_CHLOROMORPH( "CHLOROMORPH" );
static const trait_id trait_DEBUG_BIONIC_POWER( "DEBUG_BIONIC_POWER" );
static const trait_id trait_DEBUG_BIONIC_POWERGEN( "DEBUG_BIONIC_POWERGEN" );
static const trait_id trait_DEX_ALPHA( "DEX_ALPHA" );
Expand Down Expand Up @@ -764,7 +765,7 @@ void Character::activate_mutation( const trait_id &mut )
return;
}

if( has_trait( trait_ROOTS2 ) || has_trait( trait_ROOTS3 ) ) {
if( has_trait( trait_ROOTS2 ) || has_trait( trait_ROOTS3 ) || has_trait( trait_CHLOROMORPH ) ) {
add_msg_if_player( _( "You reach out to the trees with your roots." ) );
} else {
add_msg_if_player(
Expand All @@ -773,9 +774,10 @@ void Character::activate_mutation( const trait_id &mut )

assign_activity( ACT_TREE_COMMUNION );

if( has_trait( trait_ROOTS2 ) || has_trait( trait_ROOTS3 ) ) {
const time_duration startup_time = has_trait( trait_ROOTS3 ) ? rng( 15_minutes,
30_minutes ) : rng( 60_minutes, 90_minutes );
if( has_trait( trait_ROOTS2 ) || has_trait( trait_ROOTS3 ) || has_trait( trait_CHLOROMORPH ) ) {
const time_duration startup_time = ( has_trait( trait_ROOTS3 ) ||
has_trait( trait_CHLOROMORPH ) ) ? rng( 15_minutes,
30_minutes ) : rng( 60_minutes, 90_minutes );
activity.values.push_back( to_turns<int>( startup_time ) );
return;
} else {
Expand Down