Feature - Implemented Spelunky Helper

Veracity

Developer
Staff member
I've been working hard for the past month on souping up our Spelunky support.

- I improved the spoilers for all the choice adventures: many of the Gold ranges were wrong, rather than just saying "take damage", say "take 10 damage" (for opening the Altar), and so on.
- I fixed logging bugs - like losing track of the turn count when you have the joke book equipped, and logging the location when you fight the ghost.
- I fixed inventory tracking for automatically equipped items.
- And I added Damage Calculator, using the Wiki's Weapon Damage page to tell me how things work.

All that, plus Bale's essential Spelunky noncombat relay script, make things pretty sweet, in my opinion. So, in a sense, this Feature is late. However, I've opened it so that we can discuss bugs and suggestions for improvement.

(Here's a suggestion for improvement for Bale: things have changed since you made your script. For example, one of the early noncombats has been modified to give much more gold, as confirmed by comparing current session logs with those from January. I suggest you take a look at KoLmafia's choice spoilers and see if you can learn anything from them.)

1) The Wiki's formula for weapon damage (omitting skills and non-Spelunky modifiers) is this:

melee: min( Muscle - Monster Defense, 0) + weapon damage
ranged: min( .75 * Moxie - Monster Defense, 0 ) + weapon damage

However, it is clear that the second formula is wrong in Spelunky. The following is correct:

ranged: min( .75 * ( Moxie - Monster Defense), 0 ) + weapon damage

If we assume that Spelunky is supposed to have the same combat mechanisms as regular KoL, simplified by the lack of combat skills and most combat modifiers, one must wonder: is the Wiki's formula incorrect for non-Spelunky monsters, too?

2) heeheehee indicated that my expected monster damage is sometimes way too high. I think I understand that: I didn't realize that several items provide Damage Reduction. I will fix my formula and we will see how it works.

Any other bugs or suggestions for things that would be useful?
 
Last edited:
Something I would find fantastically useful would be adding a noncombat warning, a la semirare warning. However, sometimes, Mafia gets a bit out of sync with KoL in that regard.

- Ghost doesn't advance the counter until next combat.

The next two points could probably use verification, as I seem to remember these being the case from a long time ago:
- If you fight, say, four combats (via hell, killing lolmec, etc), then move on to use your noncombat, you will have 2 adventures until your next noncombat.
- If you keep fighting, you'll skip a phase of noncombats entirely (e.g. if you unlock altar, spend three combats, unlock Hell, adventure three more times in Hell, you can go to the Temple to pick up the idol).



I suppose I can check the damage formula with ranged weapons. I have 13093 moxie, 12138 muscle, disco ball equipped. Smoke monster has 8333 HP, 11111 attack / defense (and no Bs, so Bees Hate You won't be relevant here). I have 15 bonus weapon damage from Tenacity and Claws of the Walrus. Disco ball means I'll expect a variance of 1-2 damage.

You hit him for 1503 (+20) (+10) (+20) (+1) (+10) damage.
You twirl your disco ball above your head. Your opponent starts to panic! Then he runs blindly into a wall, sustaining 1502 (+20) (+10) (+20) (+1) (+10) damage.

This fits exactly with floor(0.75 * (13093 - 11111)) + 15 + rand(1,2).

A critical hit dealt 1504 physical damage. This is consistent with the critical multiplier being applied solely to weapon damage. A few more hits, 1502 and 1502.
 
Last edited:
All that, plus Bale's essential Spelunky noncombat relay script, make things pretty sweet, in my opinion. So, in a sense, this Feature is late. However, I've opened it so that we can discuss bugs and suggestions for improvement.

(Here's a suggestion for improvement for Bale: things have changed since you made your script. For example, one of the early noncombats has been modified to give much more gold, as confirmed by comparing current session logs with those from January. I suggest you take a look at KoLmafia's choice spoilers and see if you can learn anything from them.)

I'll dig into that. Thanks!
 
Something I would find fantastically useful would be adding a noncombat warning, a la semirare warning.
Absolutely. I just did a run to test the damage calculator with knowledge of Damage Reduction (it works) and, although I noticed the ghost waving every time, I screwed up and went to the Ice Cave rather than the City of Gold, once. Since the only option was "take 30 damage" (which was more health than I had), I not only didn't get the NC I wanted, I had to waste a turn resting at camp.

However, sometimes, Mafia gets a bit out of sync with KoL in that regard.
We should fix all of those - after verification. I, too, recall something funky a couple days ago when I spent an extra turn in Hell and then went on to get my NC. If the extra combat actually counts towards advancing the NC counter, no harm done - assuming we track it correctly. Now, skipping an NC so you can get the idol next time is really no advantage - surely there is SOMETHING you can do in phase 1 - but again, we need to track it correctly.

I think you have confirmed that the Wiki's Weapon Damage page has an error: the weapon type multiplier is applied to the difference of stat and defense, not to stat.

I also noticed something interesting when I was fighting a ghost with my boomerang and jetpack + spring boots and ropes (no bombs - a first for me). The Damage calculator was dropping his expected damage every time he lost attack and started to claim that his minimum damage was negative. No problem; I added a min( xxx, 1). Look at the transcript of the fight. I had the joke book of the dead (5 DR) and the mining helmet (2 DR) and 57 moxie. The ghost started with an attack rating of 70 (base damage of 14-17 - or 7-10, after DR) and was whittled down with each boomerang strike. Once it got down to 28 attack, I'd expect base damage of 5-7 and my 7 DR to completely negate it, but no.

Code:
{7} Base Camp
Encounter: the ghost
Round 0: Veracity wins initiative!
Round 1: Veracity casts USE ROPE!
Round 2: ghost (spelunky) takes 5 damage.
Round 2: Veracity casts USE ROPE!
Round 3: ghost (spelunky) takes 4 damage.
Round 3: Veracity casts USE ROPE!
Round 4: ghost (spelunky) takes 4 damage.
Round 4: Veracity attacks!
Round 5: ghost (spelunky) takes 4 damage. (57 moxie vs. 67 defense)
Round 5: ghost (spelunky) drops 3 attack power. (67 -> 64)
Round 5: ghost (spelunky) drops 3 defense. (67 -> 64)
Round 5: ghost (spelunky) takes 5 damage. (57 moxie vs. 67 defense)
Round 5: Veracity attacks!
Round 6: ghost (spelunky) takes 5 damage. (57 moxie vs. 62 defense)
Round 6: ghost (spelunky) drops 5 attack power. (62 -> 57)
Round 6: ghost (spelunky) drops 5 defense. (62 -> 57)
Round 6: ghost (spelunky) takes 5 damage. (57 moxie vs. 62 defense)
Round 6: Veracity casts USE ROPE!
Round 7: ghost (spelunky) takes 5 damage.
Round 7: Veracity attacks!
Round 8: ghost (spelunky) takes 5 damage. (57 moxie vs. 58 defense)
Round 8: ghost (spelunky) drops 5 attack power. (57 -> 52)
Round 8: ghost (spelunky) drops 4 defense. (58 -> 54)
Round 8: ghost (spelunky) takes 5 damage. (57 moxie vs. 58 defense)
Round 8: Veracity attacks!
Round 9: ghost (spelunky) takes 6 damage. (57 moxie vs. 53 defense)
Round 9: ghost (spelunky) drops 3 attack power. (54 -> 51)
Round 9: ghost (spelunky) drops 5 defense. (53 -> 48)
Round 9: ghost (spelunky) takes 4 damage. (57 moxie vs. 53 defense)
Round 9: Veracity casts USE ROPE!
Round 10: ghost (spelunky) takes 4 damage.
Round 10: Veracity attacks!
Round 11: ghost (spelunky) takes 8 damage. (57 moxie vs. 50 defense)
Round 11: ghost (spelunky) drops 3 attack power. (51 -> 48)
Round 11: ghost (spelunky) drops 3 defense. (50 -> 47)
Round 11: ghost (spelunky) takes 5 damage. (57 moxie vs. 50 defense)
Round 11: Veracity casts USE ROPE!
Round 12: ghost (spelunky) takes 4 damage.
Round 12: Veracity attacks!
Round 13: ghost (spelunky) takes 8 damage. (57 moxie vs. 45 defense)
Round 13: ghost (spelunky) drops 5 attack power. (46 -> 41)
Round 13: ghost (spelunky) drops 5 defense. (45 -> 40)
Round 13: ghost (spelunky) takes 5 damage. (57 moxie vs. 45 defense)
Round 13: Veracity casts USE ROPE!
Round 14: ghost (spelunky) takes 5 damage.
Round 14: Veracity attacks!
Round 15: ghost (spelunky) takes 10 damage. (57 moxie vs. 40 defense)
Round 15: ghost (spelunky) drops 5 attack power. (41 -> 36)
Round 15: ghost (spelunky) drops 5 defense. (40 -> 35)
Round 15: ghost (spelunky) takes 4 damage. (57 moxie vs. 40 defense)
Round 15: Veracity casts USE ROPE!
Round 16: ghost (spelunky) takes 5 damage.
Round 16: Veracity attacks!
Round 17: ghost (spelunky) takes 11 damage. (57 moxie vs. 36 defense)
Round 17: ghost (spelunky) drops 3 attack power. (38 -> 35)
Round 17: ghost (spelunky) drops 4 defense. (36 -> 32)
Round 17: ghost (spelunky) takes 5 damage. (57 moxie vs. 36 defense)
Round 17: You lose 1 hit point (38 attack vs. 57 moxie)
Round 17: Veracity attacks!
Round 18: ghost (spelunky) takes 13 damage. (57 moxie vs. 32 defense)
Round 18: ghost (spelunky) drops 3 attack power. (35 -> 32)
Round 18: ghost (spelunky) drops 4 defense. (32 -> 28)
Round 18: ghost (spelunky) takes 4 damage. (57 moxie vs. 32 defense)
Round 18: You lose 1 hit point (35 attack vs. 57 moxie)
Round 18: Veracity attacks!
Round 19: ghost (spelunky) takes 14 damage. (57 moxie vs. 28 defense)
Round 19: ghost (spelunky) drops 4 attack power. (31 -> 27)
Round 19: ghost (spelunky) drops 4 defense. (28 -> 24)
Round 19: ghost (spelunky) takes 5 damage. (57 moxie vs. 28 defense)
Round 19: You lose 1 hit point (31 attack vs. 57 moxie)
Round 19: Veracity attacks!
Round 20: ghost (spelunky) takes 15 damage. (57 moxie vs. 25 defense)
Round 20: ghost (spelunky) drops 3 attack power. (28 -> 25)
Round 20: ghost (spelunky) drops 3 defense. (25 -> 22)
Round 20: ghost (spelunky) takes 4 damage. (57 moxie vs. 25 defense)
Round 20: You lose 1 hit point (28 attack vs. 57 moxie)
Round 20: Veracity attacks!
Round 21: ghost (spelunky) takes 18 damage. (57 moxie vs. 20 defense)
Round 21: ghost (spelunky) drops 4 attack power. (24 -> 20)
Round 21: ghost (spelunky) drops 5 defense. (20 -> 15)
Round 21: ghost (spelunky) takes 4 damage. (57 moxie vs. 20 defense)
Round 21: You lose 1 hit point (24 attack vs. 57 moxie)
Round 21: Veracity attacks!
Round 22: ghost (spelunky) takes 18 damage. (57 moxie vs. 17 defense)
Round 22: ghost (spelunky) drops 5 attack power. (19 -> 14)
Round 22: ghost (spelunky) drops 3 defense. (17 -> 14)
Round 22: ghost (spelunky) takes 5 damage. (57 moxie vs. 17 defense)
Round 22: You lose 1 hit point (19 attack vs. 57 moxie)
Round 22: Veracity attacks!
Round 23: ghost (spelunky) takes 21 damage. (57 moxie vs. 13 defense)
Round 23: ghost (spelunky) drops 3 attack power. (16 -> 13)
Round 23: ghost (spelunky) drops 4 defense. (13 -> 9)
Round 23: ghost (spelunky) takes 5 damage. (57 moxie vs. 13 defense)
Round 23: You lose 1 hit point (16 attack vs. 57 moxie)
Round 23: Veracity attacks!
Round 24: ghost (spelunky) takes 25 damage. (57 moxie vs. 10 defense)
Round 24: ghost (spelunky) drops 3 attack power. (13 -> 10)
Round 24: ghost (spelunky) drops 3 defense. (10 -> 7)
Round 24: ghost (spelunky) takes 5 damage. (57 moxie vs. 10 defense)
Round 24: Veracity attacks!
Round 25: ghost (spelunky) takes 22 damage. (57 moxie vs. 7 defense)
Round 25: ghost (spelunky) drops 3 attack power. (10 -> 7)
Round 25: ghost (spelunky) drops 3 defense. (7 -> 4)
Round 25: Veracity wins the fight!
Look at the last few ghost attacks:

Code:
Round 20: You lose 1 hit point (28 attack vs. 57 moxie)
Round 21: You lose 1 hit point (24 attack vs. 57 moxie)
Round 22: You lose 1 hit point (19 attack vs. 57 moxie)
Round 23: You lose 1 hit point (16 attack vs. 57 moxie)
Even though those could do at most 7 hp and I had DR 7, I still lost 1 hp. That's why I added min( xxx, 1 ).

However, here is round 24:

Code:
Round 24: ghost (spelunky) takes 25 damage. (57 moxie vs. 10 defense)
Round 24: ghost (spelunky) drops 3 attack power. (13 -> 10)
Round 24: ghost (spelunky) drops 3 defense. (10 -> 7)
Round 24: ghost (spelunky) takes 5 damage. (57 moxie vs. 10 defense)
I didn't kill it - but notice that it did no damage to me. I think there was not even an "it attacks" message.
 
surely there is SOMETHING you can do in phase 1 - but again, we need to track it correctly.

Certainly. If you don't want to kill shopkeepers, don't want to or can't use the unlocked sidezone NCs, and don't want the bombs from the Temple, you can smash the pot in the Mines for 20 gold.

I didn't kill it - but notice that it did no damage to me. I think there was not even an "it attacks" message.
You mentioned you had spring boots equipped. Could it have triggered, perhaps?

This actually drew my attention to another situation: we've assumed that the ghost has 50% physical resistance. However, if that is the case, why is it taking full damage from your weapon attack in the first few rounds?

Also,
Round 24: ghost (spelunky) takes 25 damage. (57 moxie vs. 10 defense)
Round 24: ghost (spelunky) drops 3 attack power. (13 -> 10)
Round 24: ghost (spelunky) drops 3 defense. (10 -> 7)
Round 24: ghost (spelunky) takes 5 damage. (57 moxie vs. 10 defense)
3/4 * 47 is 35; applying 50% physical resistance causes this to be well below the range of possibility with weapon damage variance --- unless you landed a critical hit, and again, weapon damage in this scenario must not be affected by physical resistance.

There is one more note I'm not completely sure about, and that's whether deleveling is applied to the current round or not. Working under my current guess that base weapon damage bypasses physical resistance here, deleveling reduces monster defense after the damage of the attack is resolved.
Round 13: ghost (spelunky) takes 8 damage. (57 moxie vs. 45 defense)
Round 13: ghost (spelunky) drops 5 attack power. (46 -> 41)
Round 13: ghost (spelunky) drops 5 defense. (45 -> 40)
12 * 3/4 is 9; halved is 4.5. On the other hand, 17 * 3/4 is 12, halved is 6, which is already too high for 3-5 damage from weapon.

However, from experience I seem to remember that deleveling reduced the monster's damage in the same round. It certainly has a significant effect with Pocket Crumbs (pantsgiving).
 
Spelunky Override updated based on choice spoilers in the mafia code. If I missed anything, please let me know, but I'm pretty confident.
 
You mentioned you had spring boots equipped. Could it have triggered, perhaps?
Perhaps. We do not log:

- spring boots triggering
- spring boots + jetpack triggering (you hover...)
- thrusting a torch & burning the monster (although we record the damage)
- spiked boots (perhaps assisted by jetpack) damaging monster

We also do not log your companion's actions - skeleton punching the monster, for example, although we do note the damage. I haven't checked if there is a familiaraction comment. In any case, there is not a companion image.

I'll look into logging all of the above.
 
There is one more note I'm not completely sure about, and that's whether deleveling is applied to the current round or not. Working under my current guess that base weapon damage bypasses physical resistance here, deleveling reduces monster defense after the damage of the attack is resolved.
When we process the fight page, we do things in the order they appear.

First the player weapon damage is logged - so we use the initial monster defense
Then the deleveling effects of the weapon happen - so we adjust the attack and defense
Then the monster does its damage - so we (should) use the delevelled monster attack.

Code:
Round 23: ghost (spelunky) takes 21 damage. (57 moxie vs. 13 defense)
Round 23: ghost (spelunky) drops 3 attack power. (16 -> 13)
Round 23: ghost (spelunky) drops 4 defense. (13 -> 9)
Round 23: ghost (spelunky) takes 5 damage. (57 moxie vs. 13 defense)
Round 23: You lose 1 hit point (16 attack vs. 57 moxie)
So, why is the monster's attack log using its pre-delevelled attack? I think that is a bug.

However, from experience I seem to remember that deleveling reduced the monster's damage in the same round. It certainly has a significant effect with Pocket Crumbs (pantsgiving).
As I said, I think my monster attack logging has a bug...
 
So, why is the monster's attack log using its pre-delevelled attack? I think that is a bug.
Ha ha ha. Because this character has Manuel, we are using what Manuel reported about initial attack/defense/HP at the top of the round, rather than what those stats are at that point in the round. I did my initial testing of this logging with a character which did not have Manuel, so it showed the current state of the monster.

I do think that adjustments to monster stats occur in the order KoL shows them, rather than KoL calculating monster damage, say, at the top of the round and then logging it after player actions. That would make no sense, since player actions can prevent the monster from acting.
 
Ha ha ha again.

When KoL displays the fight page, Manuel displays the attack/defense/hp of the monster's state AFTER whatever the round's actions. So, if you delevel the monster, it shows you the deleveled stats. And if you have a torch, for example, on round zero, before you have a chance to act, "You thrust the torch in its face and do 8 points of damage", say - and Manuel tells you that the monster has 8 fewer than expected HP. So, we set that as the monster's original HP - and then later, when we parse the monster stats, we reduce the HP by an additional 8 HP.

I could not set original HP from Manuel in Spelunky, but I wonder if there are things in normal combat that can reduce monster attack/defense/HP on round zero?
 
Autoattack certainly can, as can skeleton... rogue? Arguably Ed and OCRS adjectives also can, but that could be construed as pre-fight.
 
It is true that if you explore a zone that has no noncombat adventures when your next noncombat is due, you can "catch up" on that noncombat without delaying your next noncombat. I haven't dared to try exploring past the noncombat's window entirely. I've been treating this as typical combat wins increasing the ghost entertainment level by 1, and triggering a noncombat as increasing the entertainment redemption level by 3.

Spiked boots and the torch also trigger damage at the beginning of the fight. To figure out the monster's initial maximum HP, you'll want to start at the end of the first round's text, then replay combat messages in reverse until you arrive at the beginning of the fight text. If you execute a multiple-round combat macro, then activity in subsequent rounds aren't reflected in Monster Manuel and the 'onturn' variable. However, if you check the 'monsterstats' variable in your browser, it contains the latest round information because it keeps overwriting that variable's data from older rounds on the same page.
 
Revision 15985 adjusts how we use Manuel stats: when we parse the fight text and see the "script" section that has the data, we parse it and save the data, but we only use that to adjust out internal idea of the monster's stats after we are done parsing. During parsing, when we log stats changing, we adjust from the stats as we knew them to be at the beginning of the round.

I have saved the following combat messages as being worth adding to the log, so we can see where otherwise unidentified damage to the monster is occurring:

Code:
<p>You leap out of your foe's reach with your springy boots, and hover there with your jetpack, sticking your tongue out at him.
<p>With your swoopy cape and your springy boots, you jump and swoop out of your foe's reach.
<p>With your spring-soled boots you leap out of your opponent's reach.  <i>SPROOOING</i>!
<p>He struggles against your rope, but can't break free.
These are all reasons the the monster did not attack.

Code:
<p>It finally breaks free of your rope. <B>(STUN RESISTED!)</b>
<p>You thrust your torch at your foe, dealing <font color=red><b>10</b></font> damage.
<p>Your skeleton buddy punches your foe for 8 damage.
...

Code:
<P>You blast upwards with your jetpack and then crash down on him with your spiked boots, dealing 14 damage.
There is also a similar message with only spiked boots. There might also be one with yellow cape and spiked boots. I'll check those next run.

Code:
<p>You toss a bomb at Yomama's face.  He opens his mouth and swallows it!
<p>You toss the torch at Yomama just as he begins to bellow at you.  The torch flies straight down his throat!
<p>Enraged, your skeleton buddy pummels Yomama for 18 damage.
<p>Yomama belches up some smoke as he takes <font color=red><b>14</b></font> damage from the torch he swallowed earlier.
Yomama-specific messages.
 
If you're curious, here's how I have choice adventure warnings set up:

If the adventuring link was clicked from fight.php, choice.php, or charpane.php, warn with the following message: "A choice adventure is ready, so you might want to adventure somewhere else. Proceed anyway?" This encourages me to visit the map first.

I have CSS turned off, so the clickable map spots are already in a linear list. Next to each spot, I summarize the benefits of the choice adventure corresponding to that location, and star the ones I usually prefer to visit. I handle the traps specially so that the summary text changes once a branch has been unlocked for that area (removing the star).

Other combat warnings I have:
  • "You might be heading into combat to summon a Skeleton, but you already have one. Proceed anyway?"
  • "You might not be prepared for a boss fight in the city. Proceed anyway?"
  • "You might want to explore the city instead of the temple. Proceed anyway?"
  • "You might want to explore the underworld instead of the temple. Proceed anyway?"
  • "You might be entering the lair unnecessarily early since you don't have a key. Proceed anyway?"
  • "You might want to summon a Skeleton to make the most of the fight, since you appear to be underpowered. Proceed anyway?"
  • "You might want to equip the cursed coffee cup to make the most of the fight, since you appear to be underpowered. Proceed anyway?"
  • "This might be your best chance or last chance to unlock the lair. Proceed anyway?"
  • "This might be your best chance or last chance to fight in the lair. Proceed anyway?"
  • "This is your last chance to explore the underworld to unlock the throne. Proceed anyway?"
  • "This is your last chance to fight at the throne. Proceed anyway?"
Choice adventure warnings:
  • "You might not be prepared to collect the idol treasure safely. Proceed anyway?"
  • "You might not be prepared to unlock the city. Proceed anyway?"
  • "Crates are safer and cheaper, but are not as beneficial as shops are. Proceed anyway?"
  • "You might not be prepared to unlock the burial grounds. Proceed anyway?"
  • "You might not be prepared to collect the Clown Crown. Proceed anyway?"
  • "You might not be prepared to collect the treasure chest safely. Proceed anyway?"
  • "You haven't visited the city yet, so unlocking the altar might be unproductive. Proceed anyway?"
 
Something I would find fantastically useful would be adding a noncombat warning, a la semirare warning. However, sometimes, Mafia gets a bit out of sync with KoL in that regard.
If I understand correctly:

1) Neither the ghost nor the shopkeeper advances the win counter. All other monsters do.

This is easy. We already check for the shopkeeper. The ghost was discovered later and the code has not yet been updated.

2) Once your win counter is >= 3, a noncombat is available.
3) If you go somewhere where there is no noncombat, the noncombat is still available - and extra combat(s) you took count towards the next one.
4) If you take 3 extra combats before taking a noncombat, the noncombat is still available - but at the next phase step.

2-4 tell me the following:

1) If the win counter hits 6, advance the phase step and set it to 3
2) When you take a noncombat, decrement the win counter by 3, rather than resetting to 0

I have a patch coded up to fix all of the above, but I'm out of turns, so I think I'll wait until tomorrow and actually test it.

Once we are accurate with the phase step, I'm thinking of coding a noncombat warning to tell you what all of your available noncombat options are at the current phase step, given what side areas you have open. I, too, tend to just go look at the map and see what Bale's script tells me, but if KoLmafia tells what your current choices are, even those without Bale's script will have some help.

I'm not so sure about some of cubeof11's other warnings, although we do have precedent for similar ones: we warn you if a Wossname is possible and you are about to do something which would make it impossible, for example. But, some of his seem to be "you are about to diverge from what cubeof11 would do." :)
 
If I understand correctly:

1) Neither the ghost nor the shopkeeper advances the win counter. All other monsters do.

This is easy. We already check for the shopkeeper. The ghost was discovered later and the code has not yet been updated.

2) Once your win counter is >= 3, a noncombat is available.
3) If you go somewhere where there is no noncombat, the noncombat is still available - and extra combat(s) you took count towards the next one.
4) If you take 3 extra combats before taking a noncombat, the noncombat is still available - but at the next phase step.

2-4 tell me the following:

1) If the win counter hits 6, advance the phase step and set it to 3
2) When you take a noncombat, decrement the win counter by 3, rather than resetting to 0
That logic overall seems correct.
 
Revision 15997 should track the win counter and the noncombat phase accurately, even if you go to Hell for more than 3 uninterrupted fights.
 
Revision 16001 provides a simple Spelunky noncombat warning. If spelunkyWinCount >= 3, it says something like:

The ghost is waving and a phase 3 noncombat is available. Are you sure you want to adventure in the The Ice Caves?

SpelunkyRequest.spelunkyNoncombatWarning generates that message. By and by, I will make it tell you every noncombat that is available to you: zone unlocked, equipment in inventory to make the option available, and so on - so if you have already unlocked the Altar, the "Unlock Altar" option will NOT be available for phase 3 Ice Cave and you will see that the only option is to take damage!
 
Revision 16002 has the first half of that - and better.

- If you click on any adventuring area and the ghost is waving, a warning screen pops up with an icon of the whip. It tells you that a noncombat is available and if you want to go where you clicked, click on the icon.
- Below that, there is a 2-column table.
-- The first column has the image from the map of the 4 main adventuring areas.
-- The second column lists all of the options you have available in the current phase step's noncombat if you go to that area

Options are "available" if you have enough consumable equipment (bomb, rope, or key), if required, if you have all required item(s) either equipped or in inventory, and, for sidezone unlocks, if you have not already unlocked one of the side zones corresponding to the main zone.

If you like one of the main area noncombats, you can use the Gear Changer to suit up, as appropriate, and then click on the image of the adventuring area on the warning page.

Now I need to do the same thing for the noncombat in the Snake Pit, Spider Hole, Ancient Burial Ground, Beehive, Crashed U.F.O., and City of Goooold. Those are easier, since they are the same regardless of phase step, but I am out of time to work on this for now. I'll get to them tomorrow, I expect, but I thought I'd get a little feedback first, perhaps.

Tell me how it looks to you.
 
Back
Top