Bug - Fixed Olfaction incorrectly reported in gCLI

Magus_Prime

Well-known member
With r15783 I olfacted a banshee librarian in The Haunted Library and this was displayed in the gCLI:

Code:
Encounter: banshee librarian
Round 0: Arbos wins initiative!
You lose 1 hit point
Round 1: Arbos casts TRANSCENDENT OLFACTION!
You acquire an effect: On the Trail [Bob Racecar]

The relay browser displays the correct monster. Bob Racecar was the last monster olfacted, approximately 100 turns back.

Approximately 50 turns later when I olfacted a Tomb Rat the gCLI was again one monster back and reported that I was olfacting a Banshee Librarian.
 
Last edited:

lostcalpolydude

Developer
Staff member
The issue is that olfactedMonster is updated after the effect is parsed, and that seems nontrivial to change. I wonder if it would make sense to just not add that to the effect name in AdventureResult.
 

Veracity

Developer
Staff member
This is a side effect of how we report gaining effects. Used to be, we'd print the effect name and the duration. Now, we simply print the AdventureResult object. That's why AT songs now have the little musical note and why olfaction now tells you the monster from olfactedMonster.

We could easily go back to the old-style method of printing and just pull the effect name and duration out of the AdventureResult object.
 
The issue is that olfactedMonster is updated after the effect is parsed, and that seems nontrivial to change. I wonder if it would make sense to just not add that to the effect name in AdventureResult.
This confused me today. I vote for removing the monster name from the reported effect gain.
 

Veracity

Developer
Staff member
From ResultProcessor.java:

Code:
	public static boolean processEffect( boolean combatResults, String acquisition, AdventureResult result, List<AdventureResult> data )
	{
		if ( data != null )
		{
			AdventureResult.addResultToList( data, result );
			return false;
		}

		String message = acquisition + " " + result.toString();

		RequestLogger.printLine( message );
		if ( Preferences.getBoolean( "logStatusEffects" ) )
		{
			RequestLogger.updateSessionLog( message );
		}

		return ResultProcessor.processResult( combatResults, result );
	}
As you can see, this currently lets the toString() method of AdventureResult decide how to format the effect. From AdventureResult.java:toString():

Code:
		if ( this.priority == AdventureResult.EFFECT_PRIORITY )
		{
			if ( name.equals( "On the Trail" ) )
			{
				String monster = Preferences.getString( "olfactedMonster" );
				if ( !monster.equals( "" ) )
				{
					name = name + " [" + monster + "]";
				}
			}
			else
			{
				String skillName = UneffectRequest.effectToSkill( name );
				if ( SkillDatabase.contains( skillName ) )
				{
					int skillId = SkillDatabase.getSkillId( skillName );
					if ( SkillDatabase.isAccordionThiefSong( skillId ) )
					{
						name = "\u266B " + name;
					}
					if ( SkillDatabase.isExpression( skillId ) )
					{
						name = "\u263A " + name;
					}
				}
			}
		}
For Olfaction, it prints the monster name. For AT songs, it prints a musical note. For expressions, it prints a face.

That is nice enough for looking at the list of Active Effects on the Skill Casting frame, but it's not useful for logging in the gCLI or session log, in my opinion. Simply printing "<effect name> (<duration>)", as we used to, seems good enough.
 
Top