Feature - Implemented Composable Moods

vacknevbimeg

New member
I would like to define moods for things like +muscle, +combat, -combat, +item, and be able to turn more than one of them on at the same time.
 

Winterbay

Active member
YOu can. YOu can call one mood from within another mood, I can't remember how at the moment though so I hope someone else comes along and explains it shortly...
 

slyz

Developer
Holatuwol added and tweaked this functionality with r9181, r9183, r9184 and r9190, but apart from the commit messages, little has been said about it, and I don't think many people use it.

These changes allow you to define moods ("parent" moods) which can be referenced by other moods ("child" moods).

For example, let's say you have the following moods:
Code:
[B]general[/B]
- Leash of Linguini
- Springy Fusili
- The Magical Mojomuscular Melody

[B]+combat[/B]
- Musk of the Moose
- Carlweather's Cantata of Confrontation

[B]-combat[/B]
- Smooth Movement
- The Sonata of Sneakiness

[B]meat[/B]
- The Polka of Plenty
- Wasabi Sinuses

[B]item[/B]
- Fat Leon's Phat Loot Lyric
- Peeled Eyeballs
These can be used as "parent" moods. You can now create "child" moods which reference those by using the "extends" keyword in the mood's name. For example, I can create a mood named "castle extends general, +combat, meat". You will end up with a mood like this:
Code:
[B]castle extends general, +combat, meat[/B]
- Leash of Linguini
- Springy Fusili
- The Magical Mojomuscular Melody
- Musk of the Moose
- Carlweather's Cantata of Confrontation
- The Polka of Plenty
- Wasabi Sinuses
The actual name of the mood is still "castle", though, and that's what you should use if you want to change your mood in the gCLI. To use the "castle" mood, simply use the following command:
Code:
mood castle
If you decide you also want to run +item in the castle, you can redefine parent moods (to add or remove parents) via the gCLI by using this command:
Code:
mood castle extends general, +combat, meat, item
If you decide you want to use reodorants for +combat, you can add it to the +combat mood, and it will automatically be added to the castle mood.
You can also add triggers that are specific to the "castle" mood. Those will stay even if you remove its parents.
If you want to clear out all the parents of the "castle" mood, simply do the following in the gCLI:
Code:
mood castle extends apathetic



The change in r9190 is of particular interest to scripters (and directly answers vacknevbimeg's request). With the above parent moods defined, you can set the current mood like this:
Code:
mood general, -combat, item
It will create a temporary mood with no name which uses the specified list of moods for its parents. This mood gets its parents replaced whenever you specify another mood with the mood command.
 
Last edited:

vampirewolf3

New member
Alternate Moods Interface

Hey guys,

I recently had an idea for changing the interface for mood setup. The current list method is somewhat cumbersome in-run. My current method of managing moods is to have three different moods for when I want +combat, -combat, or neither. However, there are other factors that influence what buffs I want to be running, and to create different moods for all of these combinations would be fairly impractical.

So, what I am suggesting is a checkbox-based mood creator. The user can can create custom categories (for example, +combat, -combat, +meat, etc.), and these groups can be toggled on and off such that the real "mood" is simply the aggregate of all effects that are currently turned on. Individual effects should also be toggle-able.

Not sure if I'm making myself clear enough, or if there is already some way of doing this, but I think this will be a nifty feature for Mafia.

Thanks for making this great program, and keep up the great work!

Cheers,
-vw3
 

vampirewolf3

New member
Thanks. Functionally, this is exactly what I was looking for. It would be incredibly convenient if there was some sort of graphical interface for this, but this will work very nicely for now.
 

Bale

Minion
It would be incredibly convenient if there was some sort of graphical interface for this.

Yup, that would be incredibly convenient. Unfortunately our devs do not like taking time away from their jobs and families for things that are low priority unless they personally find it fun. That's why it isn't likely to happen since we have the functionality.

Yeah, I know you get that already. It's just easy to forget for a few moments that it sounds snippy to other people when you say a thing like that.
 
So wait, if I want to add stuff and then remove it at the end of a script, I can do that by creating a mood with what I want to add, then creating another mood that extends default, my_mood. And when the script is done, I can return to the user's mood with mood default and deleting the two I created?
 
So, starting with the player's default mood we do

cli_execute("mood extends default");

# that creates a new, temporary unnamed mood with all the elements in the default mood
<do stuff to add other triggers to the now current unnamed mood>
...
at the end of the script, reset the players mood with cli_execute("mood default"); #will delete the temp unnamed mood?
 

holatuwol

Developer
The idea of an unnamed mood is when you specify multiple moods at once (the idea of "extends" doesn't come to play with this unnamed/anonymous mood); unless I had some miraculous foresight, I do not believe you can have the unnamed/anonymous mood have just one parent without cheating using apathetic.

For example: mood default, apathetic will create a new mood that has both default and apathetic as its parents, and assuming you didn't fill the apathetic mood with informational triggers (basically taking advantage of the fact that apathetic doesn't execute), this will create a temporary mood with no name that descends from default. You can add triggers to this temporary mood, and when you logout of KoLmafia or switch to any other mood, the data in it will vanish.
 
Last edited:

Bale

Minion
I have a mood called "nuns" that contains this:

Code:
[ nuns ]
lose_effect greedy resolve => ashq if(item_amount($item[resolution: be wealthier]) > 0) use(1, $item[resolution: be wealthier])
lose_effect heart of pink => ashq if(item_amount($item[pink candy heart]) > 0) use(1, $item[pink candy heart])
lose_effect polka of plenty => cast 1 the polka of plenty
lose_effect sinuses for miles => ashq if(item_amount($item[ Mick's IcyVapoHotness Inhaler]) > 0) use(1, $item[ Mick's IcyVapoHotness Inhaler])
lose_effect wasabi sinuses => ashq if(dispensary_available() && my_path() != "Bees Hate You") use(1, $item[Knob Goblin nasal spray])

Then when I want to go to the nuns I enter this command:

Code:
mood default, nuns

That results in mafia maintaining both nuns and default at the same time. It saves me a pile of time when I need to set up my mood for Themthar Hills. Here are a few of my other modular moods:

Code:
[combat ]
gain_effect the sonata of sneakiness => shrug The Sonata of Sneakiness
lose_effect carlweather's cantata of confrontation => cast 1 carlweather's cantata of confrontation
lose_effect hippy stench => ashq if(can_interact() || (my_location() == $location[Wartime Sonofa Beach] && item_amount($item[handful of pine needles]) + item_amount($item[reodorant]) > 0)) cli_execute("use either 1 handful of pine needles, 1 reodorant");
lose_effect musk of the moose => cast 1 musk of the moose

[ default ]
unconditional => call betweenBattleMood.ash
gain_effect coated in slime => call chamois.ash
gain_effect just the best anapests => uneffect Just the Best Anapests

[ noncom ]
gain_effect carlweather's cantata of confrontation => shrug Carlweather's Cantata of Confrontation
lose_effect fresh scent => ashq if(can_interact()) cli_execute("use either 1 chunk of rock salt, 1 deodorant");
lose_effect smooth movements => cast 1 smooth movement
lose_effect the sonata of sneakiness => cast 1 the sonata of sneakiness

[ orchard ]
lose_effect fat leon's phat loot lyric => cast 1 fat leon's phat loot lyric
lose_effect heart of lavender => ashq if(item_amount($item[lavender candy heart]) > 0) use(1, $item[lavender candy heart])
lose_effect joyful resolve => ashq if(item_amount($item[resolution: be happier]) > 0) use(1, $item[resolution: be happier])
lose_effect juiced and jacked => ashq if(item_amount($item[pumpkin juice]) > 0) use(1, $item[pumpkin juice])
lose_effect one very clear eye => ashq if(item_amount($item[cyclops eyedrops]) > 0) use(1, $item[cyclops eyedrops])
lose_effect peeled eyeballs => ashq if(dispensary_available() && my_path() != "Bees Hate You") use(1, $item[Knob Goblin eyedrops])
 
Last edited:
Top