Feature Identify combats from NCs

ckb

Minion
Staff member
It would be very useful if Mafia could identify when a combat / fight came from a Noncombat.
NC fights (like those from Peridot or NC choices in some locations) work differently, especially with respect to BCZ: Refracted Gaze (that is, it does not work at all). Identifying when the fight you are in came from a NC would help players know when not to cast Refract.

I do not know enough about Mafia to implement this.
The best I can think of is to set a property for specific listed Noncombat choices, then reset it after every fight. I could start with a list of possible NC Encounters and choices that lead to fights, but it would be nicer if there was a generic way to do this.


Edit: Maybe this is handled by Mafia in GenericRequest.checkChoiceRedirection, and I can just set a property there?
 
Last edited:
[partial] List of NCs that lead to fights:

Code:
Random Lack of an Encounter, 182/1
The Case of the Closet, 399/1
No Rest for the Room, 400/1
Raising Cane, 401/1
Doing the Maths, 1103/?
Travel to a Recent Fight, 1196/?
It Hasn't Ended, It's Just Paused, 1324/5
Burning Leaves, 1510/?
Leading Yourself Right to Them, 1435/1
Peering Through Your Peridot, 1557/1
 
Last edited:
Someone who knows better will have to clarify or verify, but I think fights which come from non-combats don't work right with those skills, because they aren't in a location and mafia's get_location() function should reflect that.
 
The location will be [none] for some of the skill-based NCs that lead to fights, but not for the adventure based ones.
This includes Peridot and Map the Monsters, as well as normal adventures in the Airship, Castle, Mer-kin Elementary School, etc. All of these fights are strange singular encounters that act differently and will not drop any items using Refract.
 
NC-derived combats, including Map/Peridot, skip the part of combat involving the "combat selection vector", which, although still counts for being in-zone wrt Patriotic Eagle RWB as well as delay/scheduled NCs, causes BCZ refract to not work. They are indeed in the stated location, which is different from putty/mimic/parachute/etc, which are not in-zone at all.
A separate problem is that mafia erroneously believes parachute is in-zone, which is occasionally a problem for zones such as Hidden Apartment/Office.
 
This issue hosed me a few times in my last run, so I put some time into trying to implement it by way of setting a Boolean property "_fightFromchoice" for and choice that leads to a fight.

Unfortunately after digging through Mafia code I just don't know enough about Mafia or Java to solve this on my own. Hoping someone can help get this started.
 
Since I could not solve this in Mafia I scripted around it. Its not perfect but it does what I want. Ultimately it would be great to have a mafia ash function or something that returned whether a fight came from a choice.

In the meantime, I set a custom property to true in my choiceadv script and set it to false in my afteradv script, so if a choice gets encountered in an adventure() call, then this gets set to true, and it gets reset to false after the adventure() completes.
 
There's also Map The Monsters skill, which allows 3 uses per day. The Peridot works similar to it, but Map the Monsters doesn't have the yellow screen.
 
Is "did this combat come from a noncombat?" really the correct thing to try to identify? There's other cases where a refract wouldn't work. As an obvious example, it won't work if the combat was initiated from an item, but I think chained combats also break refracts.
 
Back
Top