Feature - Rejected Any chance to add a "boolean is_unlocked(location)" function?

HasteBro

Member
In the same vein of "boolean is_accessible( coinmaster )" and "boolean gnomads_available()", it would check the availability of a location. Considering how many places are either unavailable at the start of a run, or becomes unavailable after a certain period (Cola Wars, pre-quest cyrpt/cemetary), this could be used in many automation scripts.

Currently, the availability of a location can be checked in 2 ways:

1) Using the adventure() function (since it's a boolean, if the location is not accessible it returns false). The downside to this is that you absolutely have to spend at least one adventure if it happens to be available. In a script that automates quests or that need careful expenditure of adventures (clan dungeons), spending that single adventure could screw things up.

2) Using visit_url() with a matcher or contains_text(), which clutters the script, specially considering the amount of locations that have the availability limited.

My suggestion:
This could be done by setting character prefs, something like "(location)isunlocked = false/true". These prefs would be modified when someone adventures in that location for the first time, hits the unlock flag (talking to the trapper and opening goatlet/mines), hits a flag (level 6 locking Cola War), and reset at ascension. This would generate less server hits too.
 

Bale

Minion
I'm not the person to reject this feature, but I would like to point out that there is a well maintained script devoted to this subject. I'd suggest you check out CanAdv and import it to your script that needs to check for location availability.
 

HasteBro

Member
Ahh right, isn't there any chance that it could be integrate into mafia? It is something that's useful enough that mafia should just come with that function in my honest opinion.
 

roippi

Developer
I'm not the person to reject this feature

I am! CanAdv is great. This is not only a ton of upfront work to implement natively but also a lot of maintenance burden. I feel very comfortable just telling people to use CanAdv.
 

fronobulax

Developer
Staff member
The difference between CanAdv and native functionality is there is a greater chance that (a few years from now) native functionality will be better documented. I want to know whether I can adventure somewhere. There is a difference in answering the question "Can I adventure?" - at this moment, with current equipment and buffs - and "Can I adventure if I change gear or acquire items or buffs according to my preferences. Supporting the question "Why can't I adventure?" when the answer can be stats, equipment, effects or something else might be more easily done in mafia.

But since CanAdv exists I think the community would be better off if the effort were to document, update and tweak CanAdv as needed rather than add mafia functions.
 
Top