New Content - Implemented World Event: Shadow Rifts

Veracity

Developer
Staff member
They appear in multiple locations.

Code:
place.php?whichplace=8bit&action=8rift
place.php?whichplace=beanstalk&action=stalk_rift
place.php?whichplace=cemetery&action=cem_shadowrift
place.php?whichplace=desertbeach&action=db_shadowrift
place.php?whichplace=forestvillage&action=fv_shadowrift
place.php?whichplace=giantcastle&action=castle_shadowrift
place.php?whichplace=hiddencity&action=hc_shadowrift
place.php?whichplace=manor3&action=manor3_shadowrift
place.php?whichplace=mclargehuge&action=mcl_shadowrift
place.php?whichplace=plains&action=plains_shadowrift
place.php?whichplace=pyramid&action=pyramid_shadowrift
place.php?whichplace=town_right&action=townright_shadowrift
place.php?whichplace=woods&action=woods_shadowrift

They lead to the same snarfblat,

Code:
Unknown Adventure #567 = adventure.php?snarfblat=567

But depending which one you enter, there are different monsters.

Code:
*** Monster 'shadow bat' has monsterId = 2271 and image 'shadowbat.gif'
*** Monster 'shadow cow' has monsterId = 2272 and image 'shadowcow.gif'
*** Monster 'shadow devil' has monsterId = 2273 and image 'shadowdevil.gif'
*** Monster 'shadow guy' has monsterId = 2274 and image 'shadowguy.gif'
*** Monster 'shadow hexagon' has monsterId = 2275 and image 'shadowhexagon.gif'
*** Monster 'shadow orb' has monsterId = 2276 and image 'shadoworb.gif'
*** Monster 'shadow prism' has monsterId = 2277 and image 'shadowprism.gif'
*** Monster 'shadow slab' has monsterId = 2278 and image 'shadowslab.gif'
*** Monster 'shadow snake' has monsterId = 2279 and image 'shadowsnake.gif'
*** Monster 'shadow spider' has monsterId = 2280 and image 'shadowspider.gif'
*** Monster 'shadow stalk' has monsterId = 2281 and image 'shadowstalk.gif'
*** Monster 'shadow tree' has monsterId = 2282 and image 'shadowtree.gif'

gausie has a Draft PR working on that.

G_D thread says the following:

Code:
8-bit: hexagon, orb, prism
Ancient Buried Pyramid: bat, slab, snake
The Castle in the Clouds in the Sky: bat, guy, orb
Desert Beach: devil, snake, orb
The Distant Woods: devil, stalk, tree
Forest Village: guy, hexagon, spider
The Hidden City: slab, snake, stalk
Misspelled Cemetary; guy, slab, tree
Mt. McLargeHuge: cow, hexagon, tree
The Nearby Plains: bat, cow, spider
The Right Side of the Tracks: cow, guy, prism
Somewhere Over the Beanstalk: prism, orb, stalk
Spookyraven Manor Third Floor: bat, devil, spider

G_D_ says this about monster drops:

Code:
Shadow Bat: shadow sausage (food, awesome quality, size 3)
Shadow Cow: shadow skin (back item, Serious Spooky Resistance (+3), Serious Cold Resistance (+3))
Shadow Devil: shadow flame (potion, gives effect "Inflamed With Shadows" (Serious Cold Resistance (+3), Serious Spooky Resistance (+3)) for 100 adventures)
Shadow Guy: shadow bread (food, awesome quality, size 3)
Shadow Hexagon: shadow ice (combat item, "Stun an opponent for a very long time")
Shadow Orb: shadow fluid (booze, awesome quality, size 3)
Shadow Prism: shadow glass (combat item, "Refracts prismatic damage at your foes again and again")
Shadow Slab: shadow brick (combat item, "Instantly destroy an enemy (limit 13/day)")
Shadow Snake: shadow sinew (combat item, "Weakens and briefly stuns an opponent")
Shadow Spider: shadow venom (booze, awesome quality, size 3)
Shadow Stalk: shadow nectar (spleen item, size 13)
Shadow Tree: shadow stick (1-handed weapon, +13 Spooky Damage, +13 Cold Damage, Successful hit weakens opponent)

KoLmafia says this about items:

Code:
--------------------
11135    shadow sausage    652604537    shadowsausage.gif    food    t,d    13
shadow sausage    3    1    awesome    0    0    0    0    Unspaded
# shadow sausage
--------------------
--------------------
11136    shadow skin    229167773    shadowskin.gif    container    t,d    13
shadow skin    0    Mys: 100
Item    shadow skin    Spooky Resistance: +3, Cold Resistance: +3
--------------------
--------------------
11137    shadow flame    384167669    shadowflame.gif    potion, usable    t,d    13
Item    shadow flame    Effect: "Inflamed With Shadows", Effect Duration: 100
--------------------
--------------------
2790    Inflamed With Shadows    shadowflame.gif    0c6776b080a2f22de525a6430c662869    neutral    none    use 1 shadow flame
Effect    Inflamed With Shadows    Cold Resistance: +3, Spooky Resistance: +3
--------------------
--------------------
11138    shadow bread    459420704    shadowbread.gif    food    t,d    13
shadow bread    3    1    awesome    0    0    0    0    Unspaded
# shadow bread
--------------------
--------------------
11139    shadow ice    972345634    shadowice.gif    none, combat    t,d    13
# shadow ice: Stun an opponent for a very long time
--------------------
--------------------
11140    shadow fluid    685274860    shadowfluid.gif    drink    t,d    13
shadow fluid    3    1    awesome    0    0    0    0    Unspaded
# shadow fluid
--------------------
--------------------
11141    shadow glass    992149302    shadowprism.gif    none, combat    t,d    13
# shadow glass: Refracts prismatic damage at your foes again and again
--------------------
--------------------
11142    shadow brick    219021049    shadowbrick.gif    none, combat    t,d    13
# shadow brick: Instantly destroy an enemy
# shadow brick: (limit 13/day)
--------------------
--------------------
11143    shadow sinew    543197207    shadowsinew.gif    none, combat    t,d    13
# shadow sinew: Weakens and briefly stuns an opponent
--------------------
--------------------
11144    shadow venom    737945530    shadowvenom.gif    drink    t,d    13
shadow venom    3    1    awesome    0    0    0    0    Unspaded
# shadow venom
--------------------
--------------------
11145    shadow nectar    676525146    shadownectar.gif    spleen, usable    t,d    13
shadow nectar    13    13        0    0    0    0    Unspaded
# shadow nectar
--------------------
--------------------
11146    shadow stick    609454674    shadowstick.gif    weapon    t,d    13
shadow stick    130    Mus: 50    1-handed club
Item    shadow stick    Spooky Damage: +13, Cold Damage: +13, Weakens Monster
--------------------
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
I think I have all of this covered now. One of the unfortunate side-effects of multiple entryways to one zone is that navigating programmatically to a new zone requires something like

Code:
function riftFight(turns: number, place: string) {
  visitUrl(`place.php?whichplace=${place}&action=${getRiftActionForPlace(place)}`);
  runCombat();
  adventure(Location.get("Shadow Rift"), turns - 1);
}

Because it didn't seem right to make "pseudolocations" that all point to a new zone.

I'm thinking I could add a new pref called "desiredShadowRiftIngress" and attempting to adventure in $location[Shadow Rift] will check that "shadowRiftIngress" and "desiredShadowRiftIngress" are the same, else remedy it by visiting the necessary place.php. Interested to hear thoughts/alternative ideas on that
 

Veracity

Developer
Staff member
So "adventuring" in the Shadow Rift with "desiredShadowRiftIngress" would actually go to place.php (redirecting to fight.php) rather than adventure.php? It could actually always do that, right? Seems like one redirect to fight.php is the same as any other redirect to fight.php.
Just need to make sure that registerRequest knows that the 12 place.php actions are adventuring locations so it logs right.

canAdventure() for Shadow Rift would have to verify that you have access to the desired ingress.
Moot unless you are in-run. Today on day two of a run, I visited multiple rifts - but I have not opened the pyramid yet.
prepareForAdventure() will have to equip continuum transfunctioner before going to 8-bit Realm Rift. "8rift"
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
I suppose we could flip it so that shadowRealmIngress is both pro- and descriptive and remove the need for a second pref...
 

matt.chugg

Moderator
Thanks for quick implementation!

I've just noticed when looking at my MM Relay Script

Code:
Monster #2279 has name 'shadow spider' but Manuel calls it 'shadow snake'
Manuel    says that 'shadow snake' (2279) has unrecognized image 'shadowsnake.gif'
 

Veracity

Developer
Staff member
Yeah. shadow snake is 2279 and shadow spider is 2280.
The shadow monsters are alphabetical.
 

Ryo_Sangnoir

Developer
Staff member
PirateRealm Island does do the pseudo-location thing (in the data files) but I don't know how that works in practice.
 

Veracity

Developer
Staff member
How about this:

Shadow Rift is a zone under Events

Shadow Rift is an adventure in the Shadow Rift zone
adventure.php?snarfblat=567

Shadow Rift (Desert Beach) is an adventure in the Shadow Rift zone
place.php?whichplace=desertbeach&action=db_shadowrift

Shadow Rift (Beanstalk) is an adventure in the Shadow Rift zone
place.php?whichplace=beanstalk&action=stalk_rift

ShadowRift (Giant Castle) is an adventure in the Shadow Rift zone
place.php?whichplace=giantcastle&action=castle_shadowrift

And so on.

adventure(1, $location[Shadow Rift]) -> uses adventure.php, which will redirect to a fight with a monster from the last ingress you used.
adventure(1, $location[ Shadow Rift (Giant Castle)]) -> uses place.php?whichplace=giantcastle&action=castle_shadowrift, which will redirect to a fight from a monster from specifically that ingress.

canAdventure() for the specific rifts will verify you have access to the specific place.php container zone
prepareForAdventure() will equip (obtaining, if needed), a continuum transfunctioner

Code:
place.php?whichplace=8bit&action=8rift
place.php?whichplace=beanstalk&action=stalk_rift
place.php?whichplace=cemetery&action=cem_shadowrift
place.php?whichplace=desertbeach&action=db_shadowrift
place.php?whichplace=forestvillage&action=fv_shadowrift
place.php?whichplace=giantcastle&action=castle_shadowrift
place.php?whichplace=hiddencity&action=hc_shadowrift
place.php?whichplace=manor3&action=manor3_shadowrift
place.php?whichplace=mclargehuge&action=mcl_shadowrift
place.php?whichplace=plains&action=plains_shadowrift
place.php?whichplace=pyramid&action=pyramid_shadowrift
place.php?whichplace=town_right&action=townright_shadowrift
place.php?whichplace=woods&action=woods_shadowrift

Note that not every KoL "place" is a KoLmafia "zone".

Code:
place.php?whichplace=8bit -> The 8-Bit Realm
place.php?whichplace=beanstalk -> Beanstalk
place.php?whichplace=cemetery
place.php?whichplace=desertbeach -> Beach
place.php?whichplace=forestvillage
place.php?whichplace=giantcastle
place.php?whichplace=hiddencity -> HiddenCity
place.php?whichplace=manor3 -> Manor3
place.php?whichplace=mclargehuge -> McLarge
place.php?whichplace=plains -> Plains
place.php?whichplace=pyramid -> Pyramid
place.php?whichplace=town_right
place.php?whichplace=woods -> Woods

That's OK. We could (should) use similar names, for this purpose, as KoL uses as the name of the "container zones" in the Browser.
 

Veracity

Developer
Staff member
I just experimented a bit.

Going through the rift in the right side of the tracks:

Code:
https://www.kingdomofloathing.com/place.php?whichplace=town_right
https://www.kingdomofloathing.com/place.php?whichplace=town_right&action=townright_shadowrift
Field: location = [adventure.php?snarfblat=567]
https://www.kingdomofloathing.com/adventure.php?snarfblat=567
Field: location = [fight.php?ireallymeanit=1676313921]
https://www.kingdomofloathing.com/fight.php?ireallymeanit=1676313921
https://www.kingdomofloathing.com/charpane.php
https://www.kingdomofloathing.com/fight.php?action=attack
https://www.kingdomofloathing.com/charpane.php

After entering Spookyraven Manor and climbing the stairs:

Code:
https://www.kingdomofloathing.com/place.php?whichplace=manor3
https://www.kingdomofloathing.com/place.php?whichplace=manor3&action=manor3_shadowrift
Field: location = [adventure.php?snarfblat=567]
https://www.kingdomofloathing.com/adventure.php?snarfblat=567
Field: location = [fight.php?ireallymeanit=1676313982]
https://www.kingdomofloathing.com/fight.php?ireallymeanit=1676313982
https://www.kingdomofloathing.com/charpane.php
https://www.kingdomofloathing.com/fight.php?action=attack
https://www.kingdomofloathing.com/charpane.php

Clicking the adventure again link in the charpane - Shadow Rift:

Code:
https://www.kingdomofloathing.com/adventure.php?snarfblat=567
Field: location = [fight.php?ireallymeanit=1676314038]
https://www.kingdomofloathing.com/fight.php?ireallymeanit=1676314038
https://www.kingdomofloathing.com/charpane.php
https://www.kingdomofloathing.com/fight.php?action=attack
https://www.kingdomofloathing.com/charpane.php

So yeah:

adventure.php redirects to fight.php

place.php redirects to adventure.php redirects to fight.php

We could/should go straight to adventure.php if we are requesting to go to the rift which matches shadowRiftIngress.
Otherwise, go to the place.php ingress requested by the adventure area - which will set the property and eliminate the extra redirection for subsequent adventuring in the same adventure area.

A script (or the GUI) will specify the particular ingress they want a KoLmafia will activate it by going to place.php first - only if needed - or straight to adventure.php. Either will ent up redirecting to a fight.
 

ckb

Minion
Staff member
The shadow monsters scale and get added resistance the more you fight. Currently I believe the elemental resistance is +1% per monster fought per day (max 90%) - similar to how the Crimbo monsters scaled in resistance.
It would be helpful to have a preference of "_shadowMonstersFought" or some such.
 

Veracity

Developer
Staff member
r27196 adds the 13 Shadow Rift ingresses as distinct adventure areas, with the specific monsters you'll find when the Shadow Rift is entered that way. Property "shadowRiftIngress" tracks the last ingress you went through, and if does not agree with where you're trying to adventure, we'll hit place.php to visit the rift (which will redirect to adventure.php and then to fight.php). If your last Shadow Rift adventure was via the same ingress, we'll skip the place.php call and go right to adventure.php.
 

Veracity

Developer
Staff member
I think I have a bug.

Adventure through one ingress - goes to place.php and sets property.
Adventure through another ingress - goes to place.php and sets property.
Adventure through the first again - does not go to place.php

I understand what is happening and can test and fix this. Stay tuned.

Edit: r27198 should do it.
 

Magus_Prime

Well-known member
Is the following the expected behavior? This is with r27199.

I adventured in the relay browser, through the rift in the Forest Village - this properly set the location in the adventure pane.
I then automated forty adventures in that rift from the adventure pane.
I then visited the rift in The Ancient Buried Pyramid, via the relay browser, and killed a shadow monster.
The location in the adventure pane remained "Shadow Rift: Shadow Rift (Forest Village)"

If I manually select the location in the adventure pane and automate for N turns it adventures in the expected zone.

On another character the first thing I did was adventure, via the relay browser, in the rift in The Ancient Buried Pyramid and killed a shadow monster.
The adventure pane has the location as "Shadow Rift: Shadow Rift (Somewhere Over the Beanstalk)".
 
Last edited:

Veracity

Developer
Staff member
I guess that is expected, in that I did not write code to update the GUI when switching rifts in the relay browser.
But, even though I am not surprised, it is not intended. I'll look at it.

Something else I noticed that is a KoL "feature".

I had a character who had never gone through a rift (yet).
I selected "Shadow Rift: Shadow Rift" in the GUI. I.e., go straight to adventure.php without having selected a rift.
KoL allowed that - and gave me tumbleweeds.

In the charpane (and api), KoL tells you your last adventure. api has this:

Code:
"lastadv":{"id":"567","name":"Shadow Rift","link":"adventure.php?snarfblat=567","container":null}

We use the "lastRiftIngress" property to figure out where you actually were. If that is not set, we shrug and give you the generic Shadow Rift adventure, rather than the rift-specific one.

I'm thinking can_adventure($location[Shadow Rift]) will have to return false, if "shadowRiftIngress" is empty. We are willing to submit the generic URL - and if you entered a rift outside KoLmafia, it will take you ... somewhere. But we should require that property to have been set to something.

I wonder if that is a once-ever thing for KoL? If you have never opened a rift, you get tumbleweeds. KoL remembers your chosen rift over rollover, at least. Across ascension? If I ascend, does KoL forget it, or does it remember where I last went in my previous life?

I.e., if I ascend and my first visit to the Shadow Rift is via automation to simply "Shadow Rift", will I get tumbleweeds again?
 

matt.chugg

Moderator
I.e., if I ascend and my first visit to the Shadow Rift is via automation to simply "Shadow Rift", will I get tumbleweeds again?

I've just ascended into the new challenge path so tested this by:

1: Adventure in Shadow Rift (The Distant Woods) so last adv is an accessible area after ascending
2: Ascend
3: Adventure in Shadow Rift: Shadow Rift

result: (should have equipped something first!)

Code:
Visit to Shadow Rift: Shadow Rift in progress...
Preference    lastAdventure changed from Shadow Rift (The Distant Woods) to Shadow Rift

[1]    Shadow Rift
Preference lastEncounter changed from Into the Shadows to    tumbleweed
Encounter: tumbleweed
Preference _lastCombatStarted    changed from to 20230215150437
Preference singleFamiliarRun changed    from 0 to 288
Round 0: mskc wins initiative!
Preference    lastNemesisReset changed from 284 to 285
Round 1: mskc executes a macro!
Round    1: mskc attacks!
Round 2: tumbleweed takes 1 damage.
Round 2: You    lose 14 hit points
Round 2: Culinarian Tomicus looks off in the    distance before speaking, "As I recall, Yeast of Boris was common in The    Haunted Pantry, back in my day. Perhaps if you kill an undead elbow    macaroni, you'll find one."
Preference _lastCombatWon changed from    true to false
 

Veracity

Developer
Staff member
Thanks for taking one for the team! I guess you didn't need a weapon.

As it turns out, gausie already cleared "shadowRiftIngress" on ascension.
It's almost as if he knew it would work that way. ;)
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
Thanks for taking one for the team! I guess you didn't need a weapon.

As it turns out, gausie already cleared "shadowRiftIngress" on ascension.
It's almost as if he knew it would work that way. ;)
While I did indeed know it would work that way, I also waited until I had seen someone spade it. Which in this case was done very quickly on the ASS discord (as is often the case).
 
Top