Bug - Waiting for Info The Spaghetti Demon

slyz

Developer
monsters.txt has this entry for Spaghetti Demon:
Code:
Spaghetti Demon	HP: 600 Def: 200 Atk: 200 Init: 100
but there aren't any decorations when fighting him.

After the fight, Mafia registered him as a new monster:
Code:
> ash $monster[ the spaghetti demon ]

Returned: the spaghetti demon
base_hp => 0
base_attack => 0
base_defense => 0
base_initiative => 0
attack_element => none
defense_element => none
min_meat => 0
max_meat => 0
phylum => none
poison => none

> ash $monster[ spaghetti demon ]

Returned: Spaghetti Demon
base_hp => 600
base_attack => 200
base_defense => 180
base_initiative => 100
attack_element => none
defense_element => none
min_meat => 0
max_meat => 0
phylum => none
poison => none

Is changing the monsters.txt entry to
Code:
The Spaghetti Demon	HP: 600 Def: 200 Atk: 200 Init: 100
enough?

I'm asking since I won't be able to test this for a while.

EDIT: the same goes for Spaghetti Elemental and "the spaghetti elemental"
 
On the KoL code level, it is almost certainly the case that the official name is "Spaghetti Demon" and that the "The" is just serving in the "article" role (misnomer though that tends to be). Not terribly relevant for mafia, I think, as it just needs to do whatever it needs to do to recognize it, just wanted to point that out. The difference can be told by looking at the page source. There would be an extra space if "The" was part of the official name. Unless they "fixed" that. If not, the game formats the line as "You're fighting {article} {name}", so if the article doesn't exist you'll get two spaces between "fighting" and "{name}".
 

slyz

Developer
I found this in CombatActionManager.java.
PHP:
public static final String encounterKey( String line, final boolean changeCase )
{
	line = StringUtilities.globalStringReplace( line.trim(), "  ", " " );
	String key = StringUtilities.getCanonicalName( line );

	if ( key.startsWith( "a " ) )
	{
		key = key.substring( 2 );
		line = line.substring( 2 );
	}
	else if ( key.startsWith( "an " ) )
	{
		key = key.substring( 3 );
		line = line.substring( 3 );
	}
	else if ( key.startsWith( "the " ) )
	{
		// It really is "The Man" or "The Astronomer"
	}
	else if ( key.startsWith( "some " ) )
	{
		key = key.substring( 5 );
		line = line.substring( 5 );
	}

	return changeCase ? key : line;
}
"a", "an" and "some" are stripped from the name, but not "the", because of those two monsters.
 

Veracity

Developer
Staff member
I don't particularly care how KoL itself stores the monster names internally. I care that we can recognize the monster and match it with our database and that the session log looks reasonable. The code slyz quoted is there because is that I think the following (from a Nov 2008 session log)

[1702] Battlefield (Hippy Uniform)
Encounter: The Last Stand, Man
choice.php?whichchoice=173&option=2&pwd
Encounter: Man
Round 0: Veracity wins initiative!
Round 1: Veracity tries to steal an item! (auto-attack)
You lose 13 hit points
Round 2: Veracity uses the flaregun!
1 frat boy defeated; 1000 down, 0 left.
You gain 70 Strongness
You gain 66 Enchantedness
You gain 132 Cheek
You acquire an item: Order of the Silver Wossname
does NOT look reasonable, whereas the following (from a July 2011 session log)

bigisland.php?action=bossfight&pwd
Encounter: The Man
Round 0: Veracity wins initiative!
You lose 85 hit points
Round 1: Veracity casts ENTANGLING NOODLES!
Round 2: Veracity casts SAUCEGEYSER!
Round 3: the man takes 376 damage.
Round 3: Veracity casts WAVE OF SAUCE!
Round 4: the man takes 190 damage.
You acquire an effect: Soul Freeze (duration: 1 Adventure)
You lose 28 hit points
Round 4: Veracity casts WAVE OF SAUCE!
Round 5: the man takes 186 damage.
You gain 31 Mana Points
You lose 12 hit points
Round 5: Veracity casts SAUCEGEYSER!
Round 6: the man takes 368 damage.
You lose 13 hit points
Round 6: Veracity casts SAUCEGEYSER!
Round 7: the man takes 376 damage.
You lose 13 hit points
Round 7: Veracity casts SAUCEGEYSER!
Round 8: the man takes 368 damage.
You lose 12 hit points
Round 8: Veracity casts SAUCEGEYSER!
Round 9: the man takes 376 damage.
Round 9: Veracity wins the fight!
You acquire an item: really dense meat stack
After Battle: Spiritual Grrl smiles at you, a knowing gleam in his eye.
You gain 73 Beefiness
You gain 146 Wizardliness
You gain 67 Roguishness
War finished: fratboys defeated
You acquire an item: Green Clover of Justice
DOES look more-or-less reasonable.

I do have some observations:

1) It didn't give me an adventure number for the boss fight. That's a bug, in my opinion.
2) I like that the Encounter was with "The Man", but why did "the man" take xxx damage? I know why - we normalize/lower-case the encounter name - but it would be more "pretty" if "The Man took xxx damage".

That last is the same issue I have in a note I have to myself:

[106] Dark Heart of the Woods
Encounter: P imp
...: p imp takes 31 damage

Why not "P imp takes 31 damage"?
In any case, we include "The" in monsters, because, whether or not KoL store them as "The xxx" or "The" (as an article) "xxx", they LOOK like "unique" monsters and we want the session log to show them as such.
 

slyz

Developer
So if KoL tells us we are fighting "the XXX", we should add "The XXX" in combats.txt. That's all I needed to know :)
 
Top