CanAdv -- check whether you can adventure at a given location

Theraze

Active member
So true. Been waiting to think about how to best handle this. Will probably use the new .name since either option means we've got the proper quest item for this ascension type.
 

Theraze

Active member
LOVE has a... something? that tracks its unlock? Maybe multiple somethings? Can't note it without that.
Think after I get the library key sorted I'll probably tweak the reporting request because as it stands, it's not really useful in any productive way.

Plan for library key is probably going to be following function. Let me know if anyone sees potential issues today before I get it in.
Code:
boolean have_ambiguous_inventory(string tocheck) {
    foreach it in get_inventory() {
        if (it.name == tocheck) {
            return true;
        }
    }
    return false;
}
 

zarqon

Well-known member
Why not just check $items[1764, 7302]?

Also:
Code:
case $location[The Tunnel of L.O.V.E.]: return get_property("loveTunnelAvailable").to_boolean();
 

Theraze

Active member
Because it's not just the library key, it's also the palindrome book and possibly future quest items. Also, [1764, 7302] is not human readable as anything useful. :)
 

Theraze

Active member
A while ago I tried to use those fuzzy bits and it failed. Still does when I try what seems reasonable.
> ash (get_inventory() contains $items[1764, 7302])

Cannot apply operator contains to get_inventory() (int [item]) and aggregate boolean [item] (boolean [item]) ()
Returned: void
So... *shrugs*
 

lostcalpolydude

Developer
Staff member
You probably only need to check for $item[[7302]spookyraven library key] for most cases anyway. Though itemcheck( item1 ) || itemcheck( item2 ) is easy to add anyway, now that I've looked at the code.
 

Theraze

Active member
For most cases, yes. But not for all cases. And I'm going to need to do similar to CanAdv, BCA, and at least my personal copy of BBB since it still complains about the ambiguous library key, I'd rather something more future-resistant than hardcoded values. A single item key check may be right in many cases, but I want better than partially right. So...
 

zarqon

Well-known member
In my scripts, I switched to use only the higher (newer) number. I feel like characters that still have the years-old items are probably pretty set in their ways and won't be thrown off by this.
 

Theraze

Active member
Ah. If it and the palindrome book and all of the other suchlikes are all fully depreciated, then I'm fine saying there's only one itemid ever. If this specific example is the only one where I'm only screwing the never-ascenders and the other ambiguous items may still affect things, I may as well not damage those ultrafarmers who don't actually use CA.
 

zarqon

Well-known member
There is still overlap with the ancient amulet and Staff of Ed, but these checks would probably need to be separate anyway. I can post my current version when I get home in case seeing how I did it would be helpful.
 

zarqon

Well-known member
Ok, just had a quick diff between our two versions. Stole a few alphabetizations and Drunkula's glass checks.

The differences that remain (there are many) are mostly qprop => qprop conversions (using ZLib's built-in function rather than CanAdv's).

Which unfortunately means the remaining differences are a little harder to spot, but in all cases of ambiguous items the check can be made simply with a single item check rather than needing to check for multiple items.

(EDIT: outdated attachment removed)
 
Last edited:

Theraze

Active member
Synced in the CanGo changes including removing CanAdv qprop, adding LOVE, and possibly a few other tweaks.
 

zarqon

Well-known member
Interestingly, some of the IsleWar locations are available before the IsleWar is started. Namely, the Wartime Frat House (Hippy Disguise) and Wartime Hippy Camp (Frat Disguise). I had to make the following changes:

To the zone check:
Code:
      case "IsleWar": return levelcheck(12) && !qprop("questL12War");

And to the IsleWar section:
Code:
  // islewar
   case $location[Wartime Hippy Camp (Frat Disguise)]: return outfitcheck("frat boy ensemble") || outfitcheck("frat warrior fatigues");
   case $location[Wartime Frat House (Hippy Disguise)]: return outfitcheck("filthy hippy disguise") || outfitcheck("war hippy fatigues");
   case $location[The Battlefield (Frat Uniform)]: return qprop("questL12War >= step1") && outfitcheck("frat warrior fatigues") && get_property("hippiesDefeated") != "1000";
   case $location[The Battlefield (Hippy Uniform)]: return qprop("questL12War >= step1") && outfitcheck("war hippy fatigues") && get_property("fratboysDefeated") != "1000";
   case $location[The Themthar Hills]: return qprop("questL12War >= step1") && get_property("sidequestNunsCompleted") == "none";

If you wish to confirm, next time before starting the war adventure in either camp with the lower-level outfit on (i.e. in the Frat House with the Filthy Hippy Disguise on) and check the snarfblat.
 

fronobulax

Developer
Staff member
CanAdv says I cannot adventure in the Castle. KoL does.

Code:
> call scripts\CanCastle.ash

Top: false
Ground: false
Basement: false
Hole: true
SOCK: 0
questL10Garbage: finished
lastCastleGroundUnlock: 0
lastCastleTopUnlock: 0
my_ascensions: 0

Character has been around for at least a decade and has never ascended. I believe the relevant KoL settings are correct. Character has an intergalactic rowboat.

My CanCastle.ash attached. I know I don't need to_string as much as I have used it.
 

Attachments

  • CanCastle.ash
    747 bytes · Views: 22

zarqon

Well-known member
We should probably add the rowboat check back in. For characters who haven't ascended since the advent of the S.O.C.K., the entire castle will be reported as unavailable.
 
Top