MM: MM1: Strip off trailing spaces on monster names

This commit is contained in:
Paul Gilbert
2023-01-22 20:07:51 +01:00
committed by Eugene Sandulenko
parent 3aae2eb554
commit 01d8d1abc7
4 changed files with 11 additions and 2 deletions
@@ -365,6 +365,7 @@ dialogs:
party_plus: "PARTY +"
monster_plus: "MONSTER +"
and_goes_down: "AND GOES DOWN!!!"
goes_down: "GOES DOWN!!!"
dies: "DIES!"
defeating1: "! FOR DEFEATING THE MONSTERS !"
defeating2: "! EACH SURVIVOR RECEIVES !"
+3 -1
View File
@@ -38,8 +38,10 @@ bool Monsters::load() {
assert(line.size() > 20 && line[0] == '"' && line[16] == '"');
mon._name = Common::String(line.c_str() + 1, line.c_str() + 15);
line = Common::String(line.c_str() + 17);
while (mon._name.hasSuffix(" "))
mon._name.deleteLastChar();
line = Common::String(line.c_str() + 17);
mon._count = getNextValue(line);
mon._fleeThreshold = getNextValue(line);
mon._defaultHP = getNextValue(line);
+1 -1
View File
@@ -889,7 +889,7 @@ void Combat::updateMonsterStatus() {
if (val <= 0) {
enc._monsterList[_monsterIndex]._hp = 0;
enc._monsterList[_monsterIndex]._status = MONFLAG_DEAD;
warning("TODO: message that monster goes down");
} else {
enc._monsterList[_monsterIndex]._hp = val;
enc._monsterList[_monsterIndex]._status &= ~(MONFLAG_ASLEEP | MONFLAG_HELD);
+6
View File
@@ -768,6 +768,12 @@ void Combat::writeCharAttackDamage() {
_isShooting = false;
writeString(0, 21, getAttackString());
if (_monsterP->_status == MONFLAG_DEAD) {
writeString(0, 22, Common::String::format("%s %s",
_monsterP->_name.c_str(),
STRING["dialogs.combat.goes_down"].c_str()));
}
}
void Combat::writeCharAttackNoEffect() {