New Content - Implemented Monsters now show how much hp they regain when healing

Rinn

Developer
The text will need to be spaded, but here's a heads up

[14:00]
System Message: A new trivial update has been posted: All monsters that heal themselves (such as physicians) now display how many HP they're regaining.
 

Rinn

Developer
Nevermind, quiet healers don't heal themselves, what are some monsters that do I can access in aftercore?
 
Last edited:

GValko

Member
"Enemy regains 2 HP"

Here's the HTML
Code:
<table><tr><td><img src=http://images.kingdomofloathing.com/itemimages/hp.gif width=30 height=30></td><td valign=center>Enemy regains <b>2</b> HP</td></tr></table>


Apparently the hook should be like "regains X HP", since the antecedent varies.
 
Last edited:

Rinn

Developer
Code:
 regains <b>25</b> HP

Also potions of healing didn't show a message, unknown if that's a bug or not.
 
Last edited:
Naughty Sorority Nurse fights add "She regains X HP" lines to Session Results

I hope this hasn't been reported elsewhere... I searched and couldn't find anything.

Tonight I ran a bunch of turns on the Battlefield (Hippy uniform), and when I finished, to my surprise, I found the following lines in my Session Results:
She regains 100 HP (2)
She regains 75 HP (1)
She regains 83 HP (3)
She regains 88 HP (1)
She regains 90 HP (1)
She regains 93 HP (1)
She regains 95 HP (1)
She regains 96 HP (1)​

I assume these are from Naughty Sorority Nurse fights. I'm using v14.8 r9833; let me know if I can provide any other information to help in tracking down the bug.
 

Bale

Minion
This is not a bug. Read KoL's trivial announcement for yesterday. This is a new feature that KoLmafia intends to support so I'll merge your thread over into the new content thread.
 

slyz

Developer
Here is the complete HTML:
Code:
<table><tr><td><img src=/images/itemimages/hp.gif width=30 height=30></td><td valign=center>Enemy regains <b>6</b> HP</td></tr></table>
This is what I got in the gCLI:
Code:
Round 6: gluttonous ghuol takes 3 damage.
Unknown item found: Enemy regains 6 HP

FightRequest.java probably thinks it is an item because of this bit in FightRequest.processNode():
PHP:
if ( image.equals( "hp.gif" ) ||
     image.equals( "mp.gif" ) )
{
	// You gain HP or MP
	if ( status.mosquito )
	{
		status.mosquito = false;
		Matcher m = INT_PATTERN.matcher( str );
		int damage = m.find() ? StringUtilities.parseInt( m.group() ) : 0;
		if ( status.logMonsterHealth )
		{
			FightRequest.logMonsterAttribute( action, damage, HEALTH );
		}
		MonsterStatusTracker.damageMonster( damage );
	}

	status.shouldRefresh |= ResultProcessor.processGainLoss( str, null );
	return;
}
Since the text doesn't start with "You gain", and doesn't contain meat, it is passed around ResultProcessor until it can't be anything except an item.

I guess this is where the tracking should be done. And FightRequest.updateMonsterHealth() probably has to be cleaned up quite a bit.
 

slyz

Developer
This patch seems to do the trick, but I would like someone more familiar with FightRequest and ResultProcessor to take a look before it is submitted.

EDIT: patch updated with the NS message
 

Attachments

  • monsterHP.patch
    6 KB · Views: 16
Last edited:

slyz

Developer
Apparently there are other healing messages that do not contain "regains". From the KoL forum:
Code:
Edit: Facing the NS, 2nd form:
[healing message]
[HP heart image goes here] She looks about 106 HP healthier than before.

EDIT: patch above updated with the NS message.
 
Last edited:
Top