Feature - Implemented Rain Main does not play well with Gremlins

Bale

Minion
Using Rain Man you can summon a tool using Gremlin. You know it is tool using because it is the second one of his type in the list.

Normally, when Gremlins are encountered in the Junkyard, mafia will identify the correct attack messages and highlight the tool so that the user can easily notice it. Mafia also selects the Molybdeum Magnet in the items drop-down to make it easy. This is a wonderful feature, but it does not apply to faxed gremlins.

My feature request is for mafia to offer this help with faxed gremlins. Until now we only got 1 fax a day so it was too wasteful to summon gremlins. With Rain Man we get gazoodles of them and it seems like a fun idea so this is suddenly relevant.
 

Veracity

Developer
Staff member
Let me make sure I understand this, since I think it applies to more than Heavy Rains.

When Yossarian say "go to X and get item Y", we know that item Y drops from gremlin Z.
As it turns out, you can find gremlin Z in other zones - and it still might drop item Y.
However, there are two kinds of each gremlin Z, only one of which drops item Y.

Now, for years and years, I have been going to the areas Yossarian directs me to, in order, and have gotten the items in order.
I have never gone to areas out of order and stasised gremlins that MIGHT drop an item I didn't have.

lost has told me that I am wrong about this; a vegetable gremlin might drop a screwdriver, even if you are not in the zone that Yossarian sent me to to find the screwdriver.

Am I correct about that?

If so, this request is saying "I want to fax (rain man) in vegetable gremlin #2 and stasis to get a screwdriver, regardless of whether Yossarian has asked for a screwdriver."

And the essence of this request is that if you encounter a vegetable golem, whether or not it is in the zone that Yossarian sent you to to get a screwdriver, consider that a screwdriver is possible, recognize the message that says "wrong gremlin", and if the gremlin DOES produce the desired item, highlight it in pink and automatically select the molybdenum magnet, if you have it, so you can steal it.

(Obviously the latter will only be of value once you have accepted Yossarian's quest).

Do I have that right?
 

Bale

Minion
You are correct. You can go to areas out of order and get tools in any order you desire. In order to make best use of banishing I frequently do areas out of order. (My second zone is always home to a monster I banish from the first zone and so on.)


If so, this request is saying "I want to fax (rain man) in vegetable gremlin #2 and stasis to get a screwdriver, regardless of whether Yossarian has asked for a screwdriver."

YUP! I just did that. Before visiting ANY of the zones I Rain Man'ed the erudite gremlin and waited for him to give me the right message. I used the molybdenum magnet and he dropped the crescent wrench.

And the essence of this request is that if you encounter a vegetable golem, whether or not it is in the zone that Yossarian sent you to to get a screwdriver, consider that a screwdriver is possible, recognize the message that says "wrong gremlin", and if the gremlin DOES produce the desired item, highlight it in pink and automatically select the molybdenum magnet, if you have it, so you can steal it.

Well, if you are in the wrong zone for the tool granting monster then you will never get the version of the monster that gives that tool, but if you encounter the monster though an abnormal adventuring situation, like faxing or I suppose a wandering monster, then it might have the tool.

For instance, if you encounter the erudite gremlin by adventuring Out By that Rusted-Out Car he will not drop the tool, regardless of how long you wait.

Probably the easiest way to implement this would be to assume that he is a non-tool granting verison only if he is encountered where you normally only encounter the version that doesn't drop a tool.
  • vegetable gremlin - Never drops a tool Next to that Barrel with Something Burning in it.
  • spider gremlin - Never drops a tool Over Where the Old Tires Are.
  • batwinged gremlin - Never drops a tool Near an Abandoned Refrigerator
  • erudite gremlin - Never drops a tool Out By that Rusted-Out Car.
 
Last edited:

lostcalpolydude

Developer
Staff member
For instance, if you encounter the erudite gremlin by adventuring Out By that Rusted-Out Car he will not drop the tool, regardless of how long you wait.

Probably the easiest way to implement this would be to assume that he is a non-tool granting verison only if he is encountered where you normally only encounter the version that doesn't drop a tool.

Technically you could arrow the correct one and it could show up in one of the other zones, but that case probably isn't important enough to worry about.

I just made some changes localy that nicely handle highlighting tools for a gremlin regardless of where you see it, but now I realize that it no longer fails to highlight the tool for the wrong gremlin in a zone, and for most people that wouldn't actually be an improvement...
 

lostcalpolydude

Developer
Staff member
I updated my code to include a location check. I found an erudite gremlin in Out by that Rusted-Out Car, and the tool wasn't highlighted, which is correct. Then I cast Rain Man to fight an erudite gremlin (the correct one, but mafia has no way of knowing that), but KoLAdventure.lastAdventureId() wasn't changed (I think) so it still wasn't decorated.
 

Veracity

Developer
Staff member
Then I cast Rain Man to fight an erudite gremlin (the correct one, but mafia has no way of knowing that), but KoLAdventure.lastAdventureId() wasn't changed (I think) so it still wasn't decorated.
Yeah. GenericRequest.checkItemRedirection handles logging the adventure and setting nextAdventure to none. We don't do the equivalent when we cast Rain Man. ChoiceManager does EncounterManager.ignoreSpecialMonsters when you take the choice, but not the rest of the stuff. Logging the "cast" with a turn number should happen in UseSkillRequest.registerRequest, but the other special things that checkItemRedirection does could be in ChoiceManager.

Having done that, when you encounter a gremlin with location "None", you could assume it is the correct one and highlight it.
 

lostcalpolydude

Developer
Staff member
I have the code mostly working. Everything works right in the zone, and stuff is decorated for Rain Man fights... initially at least. Starting on Round 3, the gremlin is no longer decorated, and my_location() starts reporting Out by that Rusted-Out Car instead of none.
 

Veracity

Developer
Staff member
Did it fetch api.php or charpane.php and update the last location from what KoL says was the last location? In other words, was Out by that Rusted-Out Car the last location you actually visited?

Edit: I expect that KoL requests charpane requests mid fight when your HP or MP or Meat changes.

CharPaneRequest.setLastAdventure will set the adventure from the charpane. I suppose it could not do that if you are in the middle of a fight -- FightRequest.currentRound != 0 - but I don't know what unexpected consequences that might have. Probably none, since the charpane will reset after the battle is over, and it can set the location then.
 
Last edited:

lostcalpolydude

Developer
Staff member
That was the last location I was in. It was actually set from charpane.php since this was in the relay browser, but it looks like api.php would do the same thing. Checking FightRequest.currentRound and ChoiceManager.handlingChoice will probably work there without breaking anything...
 

lostcalpolydude

Developer
Staff member
14561. I did some testing to check that the current location updates properly, but there's always a chance I missed some edge case.
 

Veracity

Developer
Staff member
That was the last location I was in. It was actually set from charpane.php since this was in the relay browser, but it looks like api.php would do the same thing. Checking FightRequest.currentRound and ChoiceManager.handlingChoice will probably work there without breaking anything...
When I was thinking about this in the shower just now, I thought that maybe EncounterManager.ignoreSpecialMonsters might be the best thing to check, since it will apply to exactly the monsters for which we set location to None.
 

lostcalpolydude

Developer
Staff member
When I was thinking about this in the shower just now, I thought that maybe EncounterManager.ignoreSpecialMonsters might be the best thing to check, since it will apply to exactly the monsters for which we set location to None.

That is usually reset by the time we get to Round 1 though. Maybe that could be changed, since it's also reset at the end of the fight now.

Unrelated, having access to devster accounts makes testing these changes so much easier.
 

lostcalpolydude

Developer
Staff member
Also, the location shouldn't change in the middle of a fight or choice, so making it not update in the middle of those is probably a (negligible) performance improvement.
 
Top