Bug - Fixed Banished Monster List & Spring Loaded Front Bumper Tracking Issues

Tokoeka

Member
using r26337

Had a script abort (on turn 181) because it was trying to use Spring-Loaded Front Bumper skill from the Asdon martin workshed, but skill was not available. Finished the combat manually, then went to check my workshed. Had the correct workshed and >50 fuel, so should have been able to use the skill if it was available.

Checked in session Log, and my last use of the skill was on turn 171, so skill should definitely not have been available.
[171] The Hidden Office Building Preference lastEncounter changed from ancient protector spirit to pygmy headhunter
Encounter: pygmy headhunter
Round 0: asmodais wins initiative!
Preference cosmicBowlingBallReturnCombats changed from 16 to 15
Round 1: You lose 1 hit point
Round 1: asmodais executes a macro!
Round 1: asmodais casts ASDON MARTIN: SPRING-LOADED FRONT BUMPER!
Preference banishedMonsters changed from pygmy janitor:snokebomb:161:pygmy witch lawyer:KGB tranquilizer dart:161:pygmy headhunter:Throw Latte on Opponent:162:pygmy witch accountant:Bowl a Curveball:162
to pygmy janitor:snokebomb:161:pygmy witch lawyer:KGB tranquilizer dart:161:pygmy headhunter:Throw Latte on Opponent:162:pygmy witch accountant:Bowl a Curveball:162:pygmy headhunter:Spring-Loaded Front Bumper:170

Doing a bit more digging, I noticed the following:

[177] The Haunted Boiler Room
Preference lastEncounter changed from steam elemental to coaltergeist
Encounter: coaltergeist Round 0: asmodais loses initiative!
Preference cosmicBowlingBallReturnCombats changed from 12 to 11
Round 1: You lose 47 hit points
Round 1: asmodais executes a macro!
Round 1: asmodais casts THROW LATTE ON OPPONENT!
Preference _latteBanishUsed changed from false to true
Preference banishedMonsters changed from pygmy janitor:snokebomb:161:pygmy headhunter:Throw Latte on Opponent:162:pygmy witch accountant:Bowl a Curveball:162:pygmy headhunter:Spring-Loaded Front Bumper:170:steam elemental:KGB tranquilizer dart:176
to pygmy janitor:snokebomb:161:pygmy witch accountant:Bowl a Curveball:162:steam elemental:KGB tranquilizer dart:176
Preference banishedMonsters changed from pygmy janitor:snokebomb:161:pygmy witch accountant:Bowl a Curveball:162:steam elemental:KGB tranquilizer dart:176
to pygmy janitor:snokebomb:161:pygmy witch accountant:Bowl a Curveball:162:steam elemental:KGB tranquilizer dart:176:coaltergeist:Throw Latte on Opponent:176
Preference lastCopyableMonster changed from steam elemental to coaltergeist
The notable thing is that the first autochange to banishedMonsters removed both instances of the banished pygmy headhunter from the list, even though only one was due to the latte banish.

This has the knock-on effect of making mafia think the Spring-Loaded front bumper can be used again, because it looks like the only tracking that is used for when it is available is whether it is in the banishedMonsters list.

Attempted a manual fix of adding the line to the banishedMonsters list myself, but it appears mafia will not allow that preference to be edited or something, as it autoremoves it immediately afterwatrd

> set banishedMonsters = pygmy janitor:snokebomb:161:pygmy witch accountant:Bowl a Curveball:162:pygmy headhunter:Spring-Loaded Front Bumper:170:steam elemental:KGB tranquilizer dart:176:coaltergeist:Throw Latte on Opponent:176:slick lihc:louder than bomb:180

banishedMonsters => pygmy janitor:snokebomb:161:pygmy witch accountant:Bowl a Curveball:162:pygmy headhunter:Spring-Loaded Front Bumper:170:steam elemental:KGB tranquilizer dart:176:coaltergeist:Throw Latte on Opponent:176:slick lihc:louder than bomb:180
Preference banishedMonsters changed from pygmy janitor:snokebomb:161:pygmy witch accountant:Bowl a Curveball:162:steam elemental:KGB tranquilizer dart:176:coaltergeist:Throw Latte on Opponent:176:slick lihc:louder than bomb:180
to pygmy janitor:snokebomb:161:pygmy witch accountant:Bowl a Curveball:162:pygmy headhunter:Spring-Loaded Front Bumper:170:steam elemental:KGB tranquilizer dart:176:coaltergeist:Throw Latte on Opponent:176:slick lihc:louder than bomb:180
Preference banishedMonsters changed from pygmy janitor:snokebomb:161:pygmy witch accountant:Bowl a Curveball:162:pygmy headhunter:Spring-Loaded Front Bumper:170:steam elemental:KGB tranquilizer dart:176:coaltergeist:Throw Latte on Opponent:176:slick lihc:louder than bomb:180 to pygmy janitor:snokebomb:161:pygmy witch accountant:Bowl a Curveball:162:steam elemental:KGB tranquilizer dart:176:coaltergeist:Throw Latte on Opponent:176:slick lihc:louder than bomb:180
 
Last edited by a moderator:

Manendra

New member
I ran into this bug today, so I spent a few minutes digging around in the code to find out why it's happening. To my amateur eye, it looks like this is not so much a bug in BanishManager than it is a problem with using banishedMonsters as a proxy for "is bumper available". banishedMonsters is properly showing what is currently banishing the pygmy headhunter in the example above. Maybe the solution is just to add a pref that tracks the last turn bumper was used?
 
It sounds like this issue may have started when you banish a monster with 2 different sources. Then one of them wore off, and it removed both banishes from the list (probably searching for the monster, and not for the banish source). I assume that KoL would treat the monster as still banished, so this would mean that mafia's banish tracking gets out of sync at this point, too.

In addition to considering tracking Asdon Martin skill availability differently, this potentially problematic handling of banish-ending should probably be looked at, too.
 
Top