Getting modifiers for effects when you don't already know which modifier to check

MCroft

Developer
Staff member
Veracity provided this script snippet which finds items with non-Adventure Rollover Effects:

Code:
foreach it in $items[] {
    if ( !it.can_equip() )
	continue;
    effect roe = it.effect_modifier( "Rollover Effect" );
    if ( roe == $effect[none ] )
	continue;
    int duration = it.numeric_modifier( "Rollover Effect Duration" );
    print( it + " -> " + roe + " (" + duration + "}" );
}
--thank you, very helpful!

> roe.ash

Sasq™ watch -> The Rich Get Richer (30}
ninjammies -> Morninja (50}
ratskin pajama pants -> Pajama Party (40}
red LavaCo Lamp™ -> Red Menace (50}
blue LavaCo Lamp™ -> Blue Eyed Devil (50}
green LavaCo Lamp™ -> Green Peace (50}
Royal scepter -> It's Good To Be Royal! (5}
octolus-skin cloak -> Octolus Gift (30}
Quartet of Flare Masters Jacket -> Eldritch Concentration (1}
Uncle Crimbo's hat -> The Spirit of Crimbo (100}
Spacegate scientist's insignia -> Spirit of Galactic Unity (30}
Spacegate military insignia -> Spirit of Galactic Unity (30}
silent nightlight -> Nightlit (50}
novelty monorail ticket -> Favored by Lyle (100}
Crimbolex watch -> Watched Over (100}
hewn moon-rune spoon -> Spoon Boon (50}

So now I have the effect, but I don't know that 'Morninja' means '100% combat initiative'. I can see how to get the value if I know the modifier, but I am missing the connecting glue to get all the modifiers (much less figure out something like Spoon Boon).

Do I need to loop through all of them, skipping any blanks, or is there a better (and future-proofed) way?
 

lostcalpolydude

Developer
Staff member
You can use
Code:
string_modifier( $effect[morninja], "Modifiers" )
to see the modifier an effect gives. That gives a string. Doing more with it depends on what your goal is, probably.
 

MCroft

Developer
Staff member
Thanks! I'm looking to make a good decision on what to put on for rollover. If I either don't have any +adv items for a slot, or I have to choose between, for instance, +1 adv vs. 50 turns of Spoon Boon, I want to know what I could equip and what the effects of that equipment are (not just the effect name).

Since these are all-over-the-place, it's not something I think the maximizer can decide (e.g. is +100% initiative for 50 turns better than all the stuff in Spoon Boon?), so (for now) I'm just looking to list what it does.



I think I have the right pieces now (or at least enough to move along). I'll dig a little bit more and come back if I don't get what I'm looking for.
 

MCroft

Developer
Staff member
Got it!

The idea is if I have no adv maximizing pants, the ratskin pajama pants are a better than nothing (literally).

And I can look at the Spoon Boon and decide I'd rather have it than a 1 adv gold wedding ring.

Two questions:
1: Is there a complete guide to the ASH language?
I'm looking for something like string.split() to break up the multi- modifiers like Spoon Boon to make it easier to read.
2: The Spirit of Crimbo doesn't seem to be returning anything. Is that just an oddity of my setup or is that a data issue?



Checking Additional Rolloever Effects
Storage: 1 Sasq™ watch(acc1) for The Rich Get Richer (30)
Meat Drop: +50
Storage: 1 ratskin pajama pants(pants) for Pajama Party (40)
Familiar Weight: +10
Storage: 1 Uncle Crimbo's hat(hat) for The Spirit of Crimbo (100)

Storage: 1 Spacegate scientist's insignia(acc1) for Spirit of Galactic Unity (30)
Familiar Weight: +10
Storage: 1 silent nightlight(acc1) for Nightlit (50)
Muscle: +10, Mysticality: +10, Moxie: +10
Storage: 1 novelty monorail ticket(off-hand) for Favored by Lyle (100)
Muscle Percent: +10, Mysticality Percent: +10, Moxie Percent: +10
Onhand: hewn moon-rune spoon(acc1) for Spoon Boon (50)
Muscle Percent: +10, Mysticality Percent: +10, Moxie Percent: +10, Hot Damage: +5, Cold Damage: +5, Stench Damage: +5, Spooky Damage: +5, Sleaze Damage: +5, Hot Spell Damage: +10, Cold Spell Damage: +10, Stench Spell Damage: +10, Spooky Spell Damage: +10, Sleaze Spell Damage: +10, Hot Resistance: +2, Cold Resistance: +2, Stench Resistance: +2, Spooky Resistance: +2, Sleaze Resistance: +2
Requests complete.
 

ckb

Minion
Staff member
If you are looking to parse modifiers, both CHIT and WTF have modifier parsing functions as an example of how this might be done. You could use WTF.ash directly if you want.
 
2: The Spirit of Crimbo doesn't seem to be returning anything. Is that just an oddity of my setup or is that a data issue?

The spirit of crimbo doesn't do anything, so that might be entirely correct.

Got it!

The idea is if I have no adv maximizing pants, the ratskin pajama pants are a better than nothing (literally).

My catch for that is to give a low weight to rollover effect duration in my end of day maximization. Sure that means it will prefer longer weaker buffs over shorter stronger ones, but it's mostly there as a tie breaker.
There's some extra trickery involved to account for straight-edgy+stooper, but the basic maximization is made up from this:
Code:
string s = "adv, +pvpValue+" pvp fights, 0.001 rollover effect duration, switch tot, switch disembodied hand"
 
Last edited:
Top