Feature - Implemented Revisit "Four Songs" and "Additional Song" boolean modifiers

fxer

Member
There are now several ways to go over holding 4 songs in your head. Currently a non-AT can get up to 5, an AT can go all the way to 7.

If it is considered a bug: the boolean_modifier("additional song") returns true when you have the AT passive skill Mariachi Memory, but was originally designed to denote you had a La Hebilla del Cinturón de Lopez equipped.

So there is no apparent way to tell if you have a La Hebilla stacking bonus currently, other than have_equipped(), and likewise with the zombie accordion stacking bonus.

The passive skill Mariachi Memory also raises some questions about the "Four Songs" modifier. With it you can hold four songs by default but the boolean_modifier("Four Songs") returns false. It only returns true when you equip one of the "four instead of three" pieces of equipment. However if you have Mariachi Memory and equip a "four instead of three" you can actually hold "five instead of four" songs.

I'm not sure what the best course of action is but the current setup doesn't seem ideal anymore


The "640k is enough" build notes:
Revision: 8190
Added "Additional Song" boolean modifier, currently only provided by the AT
epic accessory. I'm assuming that any future sources of this enchantment
won't stack.
 

lostcalpolydude

Developer
Staff member
Changed this from Bug to Feature.

With the current implementation, you can check for the Four Songs boolean, and update the base value from 3 to 4 no matter how many instances there are. Then you could iterate over all skills, equipment, and effects, and add 1 for each instance of Additional Song. So currently, Four Songs is a non-stackable version of Additional Song.

There might be a better way to implement it, but you haven't actually suggested one.
 

fxer

Member
there's also the "+four songs" maximizer command, where even if you have base 4 songs it equips something to give you 5 songs. And I don't believe there's a way to make it fully maximize songs up to 7
 

fxer

Member
Well ultimately I guess being able to "maximize songs" would do the job. It would select one of the "four instead of three" items to equip, and if you're an AT would equip the La Hebilla and zombie accordion if available. I assume the maximizer handles edge cases like if you *don't* have dual wield weapons but *do* have the zombie accordion, it can't use the boom box as it's "four instead of three" selection.

Additionally perhaps tracking "Maximum Songs" where it would return (currently) between 3 and 7, and tracking "Current Songs"? That would make it much easier to track if you needed to shrug a buff before casting a new one.

Currently I have this function to track Current Songs
Code:
// Return total number of active AT buffs
int active_songs(){
	int total = 0;
	foreach buff in my_effects(){
		if( buff.to_skill().class == $class[accordion thief] && buff.to_skill().buff ){ total += 1; }
	}
	return total;
}
 
Last edited:

heeheehee

Developer
Staff member
Make "Additional Song" a numeric modifier? That seems like the most straightforward fix to me.

edit: the equivalent maximize there would probably be "maximize additional song, +four songs"
 

fxer

Member
Based off what lostcal said this is one of my workaround functions for tracking song capacity, if it helps anyone:

PHP:
// Number of AT songs you currently have active
int active_songs(){
	int total = 0;
	foreach activeEffect in my_effects(){
		if( activeEffect.to_skill().class == $class[accordion thief] && activeEffect.to_skill().buff ){ total += 1; }
	}
	return total;
}

// Return the number of songs you can currently hold in your head
int available_songs(){
	int total = 3;

	// Check for the non-stacking "Four Songs" effect
	if(boolean_modifier("Four Songs")){ total += 1; }

	// Check for skills that grant stacking Additional Songs, like Mariachi Memory
	foreach s in $skills[] {
		if(have_skill(s) && boolean_modifier(s, "additional song")){
				total += 1;
		}
	}

	// Check if any effects give Additional Songs
	foreach e in my_effects(){
		if(boolean_modifier(e, "additional song")){
			total += 1;
		}
	}

	// Check equipment for stacking Additional Songs effect
	// and ensure effect is available to your class
	foreach s in $slots[]{
		if(boolean_modifier(equipped_item(s), "additional song")
				&& class_modifier(equipped_item(s), "class") == my_class()){
					total += 1;
		}
	}
	return total;
}
 
Last edited:

heeheehee

Developer
Staff member
Hardcoding is not future-proof.
Code:
> ash class_modifier($item[zombie accordion], "Class")

Returned: Accordion Thief
primestat => Moxie
 

fxer

Member
That's fantastic, didn't know about the class_modifier method, updated post above to reflect the change. Thanks for the tip heex3!
 

fxer

Member
Additionally, this is what I've made to attempt to increase my song cap (say, to listen to ode without shrugging other buffs) in the absence of a maximizer command:

PHP:
// Return true if a slot is already giving a +songs bonus, false otherwise
boolean has_songs_bonus(slot itemSlot){
	if(boolean_modifier(equipped_item(itemSlot), "four songs")
			|| boolean_modifier(equipped_item(itemSlot), "additional song")){
				return true;
			}
	return false;
}

// Try to equip an item for a +songs bonus
boolean _equip_songs_bonus(item it){
	if(available_amount(it) > 0
			&& (equipped_amount(it) < 1 || !boolean_modifier(it, "single equip"))
			&& (class_modifier(it, "class") == $class[none] || class_modifier(it, "class") == my_class())){
				// make sure we don't un-equip an item giving us +songs currently
				if(has_songs_bonus(to_slot(it))){
					if(to_slot(it) == $slot[acc1]){
						// Special handling for accessory slot
						foreach s in $slots[acc1, acc2, acc3]{
							if(!has_songs_bonus(s)){
								return equip(s, it);
							}
						}
					}
				}
				else {
					return equip(it);
				}
	}
	return false;
}

// Change gear to attempt to increase your Accordion song limit by 1
boolean increase_songs_limit(){
	// Start with the "4 instead of 3" items, as you can only benefit from one
	if(!boolean_modifier("four songs")){
		foreach it in $items[] {
			if(boolean_modifier(it, "four songs") && _equip_songs_bonus(it)){
				return true;
			}
		}
	}

	// Look for Additional Song modifier items
	foreach it in $items[] {
		if(boolean_modifier(it, "additional song") && _equip_songs_bonus(it)){
			return true;
		}
	}
	return false;
}
 
Last edited:

Darzil

Developer
r17020 makes additional songs a numeric. Which is just as well, as UseSkillRequest.songLimit() thought it already was one, so was thinking you could cast 3 + (1 if Four Songs) + Mysticality Percent songs.
 
Top