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

revert: Remove infinite book morale stacking #5995

Closed
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
13 changes: 13 additions & 0 deletions src/character_effects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "weather_gen.h"
#include "weather.h"

static const activity_id ACT_READ( "ACT_READ" );
static const trait_id trait_CENOBITE( "CENOBITE" );
static const trait_id trait_INT_SLIME( "INT_SLIME" );
static const trait_id trait_NAUSEA( "NAUSEA" );
Expand Down Expand Up @@ -178,6 +179,18 @@ int calc_focus_equilibrium( const Character &who )
{
int focus_equilibrium = 100;

if( who.activity->id() == ACT_READ ) {
safe_reference<item> loc = who.activity->targets[0];
if( loc && loc->is_book() ) {
auto &bt = *loc->type->book;
// apply a penalty when we're actually learning something
const SkillLevel &skill_level = who.get_skill_level_object( bt.skill );
if( skill_level.can_train() && skill_level < bt.level ) {
focus_equilibrium -= 50;
}
}
}

int eff_morale = who.get_morale_level();
// Factor in perceived pain, since it's harder to rest your mind while your body hurts.
// Cenobites don't mind, though
Expand Down
Loading