Skip to content

Commit

Permalink
Allows NPC morale to decay (cataclysmbnteam#2983)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyantime committed Jun 22, 2023
1 parent 94df22d commit d4f6513
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
11 changes: 11 additions & 0 deletions src/character_turn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,17 @@ void Character::process_turn()
} );

suffer();

// Handle player and NPC morale ticks

if( calendar::once_every( 1_minutes ) ) {
update_morale();
}

if( calendar::once_every( 9_turns ) ) {
check_and_recover_morale();
}

// NPCs currently don't make any use of their scent, pointless to calculate it
// TODO: make use of NPC scent.
if( !is_npc() ) {
Expand Down
8 changes: 0 additions & 8 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1583,14 +1583,6 @@ bool game::do_turn()
character_funcs::update_body_wetness( u, get_weather().get_precise() );
u.apply_wetness_morale( weather.temperature );

if( calendar::once_every( 1_minutes ) ) {
u.update_morale();
}

if( calendar::once_every( 9_turns ) ) {
u.check_and_recover_morale();
}

if( !u.is_deaf() ) {
sfx::remove_hearing_loss();
}
Expand Down

0 comments on commit d4f6513

Please sign in to comment.