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

Allows NPC morale sources to decay #2983

Merged
merged 1 commit into from
Jun 22, 2023
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
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