Skip to content

Instantly share code, notes, and snippets.

@coldino
Last active March 1, 2025 16:19
Show Gist options
  • Save coldino/32044ac7bc0460bb30572e61b291c2eb to your computer and use it in GitHub Desktop.
Save coldino/32044ac7bc0460bb30572e61b291c2eb to your computer and use it in GitHub Desktop.
ASB Naming Patterns

ASB Naming Patterns by coldino

Currently just one naming pattern for ASB.

ASA Mutation Focus (uber-asa.js)

Here's a naming pattern designed to show ASA mutations well. Of course you'll need a good way of extracting those mutation levels before it'll work - either fully extracting/fixing parent stat mutations and a bit of luck, or the export gun.

Some examples:

<---------------------->   <- max length
M H99 S99 F99 W99 D99      <- just wild stats, unmutated
M H60+255 D60+255 W60+99   <- when mutated, showing combo wild+mut
M H+255 D+255              <- when mutated, showing just mutations
M H60+255 (+100000)        <- shows mutation counter only when you have ghost mutations

To use, simply copy/paste the contents as a naming pattern. Feel free to customise the first section, which has some basic comments to describe what each field does. It's written in JavaScript, so should be fairly readable and customisable.

#!javascript
// Examples
// <----------------------> <- max length
// M H99 S99 F99 W99 D99 <- just wild stats, unmutated
// M H60+255 D60+255 W60+99 <- when mutated, showing combo wild+mut
// M H+255 D+255 <- when mutated, showing just mutations
// M H60+255 (+100000) <- shows mutation counter only when you have ghost mutations
// Customise these
let stats_to_show = 'HSWDC'; // add/remove stats to show from stat_values below
let dont_show_stats_below = 1; // or set to a minimum such as 30
let include_id = false; // set to true to include a species index e.g. M12, or false for just M
let show_wild_on_mut = false; // set to true for H50+255 or false for H+255
let sep = " "; // the separator between each part e.g. M_H50_S40 or M-H50-S40 or MH50S40
// Customise stats displayed for some species
// use displayed species name in lowercase, without anything in brackets
// So for "Dodo (ASA)" use "dodo"
const stat_overrides = {
'gasbags': 'HSOW',
'ovis': 'HSFW',
'daeodon': 'HSFWD',
};
// Rest of the code
const name_index = this['alreadyExists']? index : tn;
const name_part = `${sex_short}${include_id?name_index:''}`;
const parts = [name_part];
const stat_values = {
'H': [hp, hp_m],
'S': [st, st_m],
'O': [ox, ox_m],
'F': [fo, fo_m],
'W': [we, we_m],
'D': [dm, dm_m],
'C': [cr, cr_m],
};
const species_name = this['species'].replace(/\s+\(.*\)$/, '').toLowerCase();
stats_to_show = stat_overrides[species_name] || stats_to_show;
if (muta == 0) {
// Build up a name using stats_to_show, if they are over dont_show_stats_below
for (const c of stats_to_show) {
const [wild,mut] = stat_values[c];
if (wild >= dont_show_stats_below) parts.push(`${c}${wild}`);
}
} else {
// Build up a name of the mutated stats only
muts_count = muta * 2;
for (let h=1; h<7; h++) {
const stat_first_char = this[`highest${h}s_m`].substring(0, 1);
const [wild,mut] = stat_values[stat_first_char];
if (mut) {
if (show_wild_on_mut && wild >= dont_show_stats_below)
parts.push(`${stat_first_char}${wild}+${mut}`);
else
parts.push(`${stat_first_char}+${mut}`);
muts_count -= mut;
}
}
// If there are any ghost mutations...
if (muts_count > 0) {
parts.push(`(+${muts_count})`);
}
}
return parts.join(' ');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment