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

Gradually decrease guilt for killing monsters such as zombie child #4323

Merged
merged 5 commits into from Nov 17, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
33 changes: 30 additions & 3 deletions mondeath.cpp
Expand Up @@ -252,6 +252,16 @@ void mdeath::disappear(game *g, monster *z) {

void mdeath::guilt(game *g, monster *z) {
const int MAX_GUILT_DISTANCE = 5;
int kill_count = g->kill_count(z->type->id);
int maxKills = 100; // this is when the player stop caring altogether.

// different message as we kill more of the same monster
std::string msg = "You feel guilty for killing %s."; // default guilt message
std::map<int, std::string> guilt_tresholds;
guilt_tresholds[75] = "You feel ashamed for killing %s.";
guilt_tresholds[50] = "You regret killing %s.";
guilt_tresholds[25] = "You feel remorse for killing %s.";

/* TODO: Replace default cannibal checks with more elaborate conditions,
and add a "PSYCHOPATH" trait for terminally guilt-free folk.
Guilty cannibals could make for good drama!
Expand All @@ -267,12 +277,29 @@ void mdeath::guilt(game *g, monster *z) {
// We probably didn't kill it
return;
}
if (kill_count >= maxKills){
// player no longer cares
if (kill_count == maxKills)
g->add_msg(_("After killing so many bloody %ss you no longer care "
"about their deaths anymore."), z->name().c_str());
return;
} else {
for (std::map<int, std::string>::iterator it = guilt_tresholds.begin();
it != guilt_tresholds.end(); it++){
if (kill_count >= it->first)
{
msg = it->second;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't you ned a break; here? Elsewise it seems like even if you are over 50 it will go on to evaluate as true and end up with the 25 message again.

break;

}
}
}

g->add_msg(_("Killing %s fills you with guilt."), z->name().c_str());
g->add_msg(_(msg.c_str()), z->name().c_str());

int moraleMalus = -50;
int moraleMalus = -50 * ((float) kill_count / maxKills);
int maxMalus = -250;
int duration = 300;
int duration = 300 * ((float) kill_count / maxKills);
int decayDelay = 30;
if (z->type->in_species("ZOMBIE")) {
moraleMalus /= 10;
Expand Down