Feature - Implemented Normalize mood execution for the GUI and the Relay Browser

Veracity

Developer
Staff member
Moods fire before automatic adventuring or after relay adventuring.

In the GUI this is advantageous since it prepares the mood before your encounter. In the relay browser this does not ensure that the player has the correct buffs before adventuring, so it is clearly disadvantageous.
This is easy to fix.

Currently, we call between battle checks - script, moods, hp restore, mp restore - in KoLAdventure when we are about to adventure.
Currently, the Relay Browser will do moods, HP recover, and MP recovery when it gets a char pane refresh and sees that you've used a turn. However, the RelayRequest knows when it is "about to adventure" and could easily call between battle checks - script, moods, hp restore, mp restore - before letting you do that.

It tries to compensate for this flaw by always leaving 1 turn of buff, so that the next adventure is already buffed.
What is the "it" that tries to "compensate for this flaw"? The mood manager? The mood manager has no idea whether it is called because of automatic adventuring or manual adventuring. Therefore, you are describing current behavior for either automated or manual adventuring.

There is one drawback to this: It would break some things if moods were run before the turn instead of after. For example, I have a script that runs unconditionally as part of my mood. In this moodScript...

PHP:
if(item_amount($item[evil eye]) > 0) use(item_amount($item[evil eye]), $item[evil eye]);

That automatically uses my evil eyes as I gain them.
Looks like that could go in your betweenBattleScript.

If that was run before my turn instead of afterwards it may often take me one more turn to complete the Nook, unless I manually use the last evil eye.
... or unless it was in your betweenBattleScript which is executed when you are about to adventure in the Nook.

If you want to run moods are run before manually adventuring, then betweenBattleScripts need to run after adventuring in the relay browser so that I can move my moodScript stuff to a betweenBattleScript and keep the functionality.
Emphasis added. Why do you need it to run after adventuring, rather than before, as when autoadventuring? If running before the adventure is correct for automated adventuring, why would it not also be correct for manual adventuring?

Moods should run before all adventures regardless of relay or automatic and betweenBattleScripts should run after all adventures regardless of relay or automatic. That would solve things nicely.
Well, ok, that would make it consistent. However, would change the current behavior of between battle scripts for automated adventuring, since they currently run before adventuring. Why do you need that to change?

I'm inclined to run between battle scripts before adventuring when automating adventuring (the current behavior) and also before adventuring in the relay browser (new behavior, consistent with the current behavior of automated adventuring).

To summarize this feature request, since it is a little complex and everything needs to work together.

  1. Make moods run consistently before adventures in both the GUI and relay browser.
  2. Fix betweenBattleScript to run after relay browser adventure as well as GUI.
  3. Change moods to automatically recast buffs that increase stats at 1 turn remaining and other buffs at 0 turns remaining.
I agree with 1.
I don't see the motivation for 2. It would be a change for automated adventuring. Justify it in another Feature Request. Or, perhaps, splitting betweenBattleScript into postBattleScript and preBattleScript is the desired Feature. Currently, betweenBattleScript is a preBattleScript.
I think 3 is reasonable. I think it could stand its own Feature Request, as well, since this will be a standalone change to moods, once mood execution is consistent in automated or manual adventuring.

That would be cool, the mood thing still wouldn't be consistent but at least we'd have something firing before an adventure in the relay browser.
Yes it would. moods, HP recovery, MP recovery, and the betweenBattleScript are the "between battle actions".
 

Veracity

Developer
Staff member
By the way: it is easy to prove that the "betweenBattleScript" is actually a "beforeBattleScript".

> get betweenBattleScript

print Adventuring we go!

> adventure 2 Giant's Castle

Adventuring we go!

Request 1 of 2 (Beanstalk: Giant's Castle) in progress...

[34183] Giant's Castle
Encounter: Goth Giant
...
You gain 6 Fortitude
You gain 20 Enchantedness
You gain 10 Chutzpah

Adventuring we go!

Request 2 of 2 (Beanstalk: Giant's Castle) in progress...

[34184] Giant's Castle
Encounter: Goth Giant
...
You gain 4 Strongness
You gain 26 Mysteriousness
You gain 8 Sarcasm

Requests complete.
 

Veracity

Developer
Staff member
Revision 10396 and 10397 make manual adventuring and automated adventuring consistent: between battle checks - script, moods, HP recovery, and MP recovery - now happen when you are about to submit a URL that we recognize as an "adventure". It adds a new preference - relayRunsBeforeBattleScript - which controls whether your betweenBattleScript (which is, as I demonstrated, actually a beforeBattleScript) gets executed before adventuring in the Relay Browser.

If you want a new afterBattleScript to apply to automated and manual adventuring, that's a new Feature Request.

And if you want moods to only recast stat boosting effects when you are down to 1 turn left, that, too, is a new feature Request. A complicated and difficult one, since we'd have to go look at modifiers, or something, to decide that.
 

Stardock

Member
Ok, slight issue with this.

my_location() isn't getting updated properly before the mood fires and it isn't getting updated before the betweenBattleScript in the relay browser.
 
Top