Anonymous

Template:Disambiguation/doc: Difference between revisions

From Melvor Idle
Remove Item Charge items from Shop Purchases; Condensed Potions; Replaced Combat Effects with a manual list
m (Filter out purchases with just 1 item as these will use a different icon type)
(Remove Item Charge items from Shop Purchases; Condensed Potions; Replaced Combat Effects with a manual list)
Line 17: Line 17:
extras = extras.replaceAll('${NAME}', `${item.name}`);
extras = extras.replaceAll('${NAME}', `${item.name}`);
let expIcon = `${item.namespace.includes('TotH') ? ' {{TotH}}' : item.namespace.includes('AoD') ? ' {{AoD}}' : item.namespace.includes('ItA') ? ' {{ItA}}' : ' {{Melvor}}'}`;
let expIcon = `${item.namespace.includes('TotH') ? ' {{TotH}}' : item.namespace.includes('AoD') ? ' {{AoD}}' : item.namespace.includes('ItA') ? ' {{ItA}}' : ' {{Melvor}}'}`;
let iconTemplate = icon === 'Link' ? ` [[${extras}]]` : ` {{${icon}|${item.name}${extras}}}`;
let iconTemplate = icon === 'Link' ? ` [[${extras}]]` : ` {{${icon}|${item.name.replace('Potion I', 'Potion')}${extras}}}`;
return `*${expIcon}${iconTemplate}${postText}`;
return `*${expIcon}${iconTemplate}${postText}`;
}
}
Line 36: Line 36:
pushResults(game.items.equipment.filter(x => search(x) && x.validSlots.includes('Quiver')), '\n== Equipment ==', 'ItemIcon');
pushResults(game.items.equipment.filter(x => search(x) && x.validSlots.includes('Quiver')), '\n== Equipment ==', 'ItemIcon');
pushResults(game.items.equipment.filter(x => search(x) && !(x instanceof WeaponItem) && !x.validSlots.includes('Quiver')), '\n== Equipment ==', 'ItemIcon');
pushResults(game.items.equipment.filter(x => search(x) && !(x instanceof WeaponItem) && !x.validSlots.includes('Quiver')), '\n== Equipment ==', 'ItemIcon');
pushResults(game.items.filter(x => x.validSlots == undefined && !(x instanceof OpenableItem) && !(x instanceof BoneItem) && !(x instanceof SoulItem) && !(x instanceof FoodItem) && search(x)), '\n== Items ==', 'ItemIcon');
pushResults(game.items.filter(x => x.validSlots == undefined && !(x instanceof OpenableItem) && !(x instanceof BoneItem) && !(x instanceof SoulItem) && !(x instanceof FoodItem) && !['potion_ii', 'potion_iii', 'potion_iv'].some(y => x.id.toLowerCase().includes(y)) && search(x)), '\n== Items ==', 'ItemIcon');
pushResults(game.items.openables.filter(x => search(x)), '\n== Openables ==', 'ItemIcon');
pushResults(game.items.openables.filter(x => search(x)), '\n== Openables ==', 'ItemIcon');
pushResults(game.items.bones.filter(x => search(x)), '\n== Bones ==', 'ItemIcon');
pushResults(game.items.bones.filter(x => search(x)), '\n== Bones ==', 'ItemIcon');
Line 45: Line 45:
pushResults(game.attackSpellbooks.allObjects.filter(x => search(x)), '\n== Spells & Spellbooks ==', 'SpellbookIcon');
pushResults(game.attackSpellbooks.allObjects.filter(x => search(x)), '\n== Spells & Spellbooks ==', 'SpellbookIcon');
pushResults([...game.attackSpells.allObjects, ...game.curseSpells.allObjects, ...game.auroraSpells.allObjects, ...game.altMagic.actions.allObjects].filter(x => search(x)), '\n== Spells & Spellbooks ==', 'SpellIcon');
pushResults([...game.attackSpells.allObjects, ...game.curseSpells.allObjects, ...game.auroraSpells.allObjects, ...game.altMagic.actions.allObjects].filter(x => search(x)), '\n== Spells & Spellbooks ==', 'SpellIcon');
pushResults(game.shop.purchases.filter(x => x.contains.items?.length !== 1 && search(x)), '\n== Purchases ==', 'UpgradeIcon');
pushResults(game.shop.purchases.filter(x => x.contains.items?.length !== 1 && !x.contains.itemCharges && search(x)), '\n== Purchases ==', 'UpgradeIcon');
pushResults(game.prayers.filter(x => search(x)), '\n== Prayers ==', 'PrayerIcon');
pushResults(game.prayers.filter(x => search(x)), '\n== Prayers ==', 'PrayerIcon');
pushResults([...game.township.buildings.allObjects, ...game.township.seasons.allObjects, ...game.township.biomes.allObjects, ...game.township.resources.allObjects].filter(x => !['melvorF:GP', 'melvorItA:AP'].includes(x.id) && search(x)), '\n== Township ==', 'TownshipIcon');
pushResults([...game.township.buildings.allObjects, ...game.township.seasons.allObjects, ...game.township.biomes.allObjects, ...game.township.resources.allObjects].filter(x => !['melvorF:GP', 'melvorItA:AP'].includes(x.id) && search(x)), '\n== Township ==', 'TownshipIcon');
Line 53: Line 53:
pushResults(game.thieving.actions.filter(x => search(x)), '\n== Skill Actions ==', 'Icon', '|type=thieving');
pushResults(game.thieving.actions.filter(x => search(x)), '\n== Skill Actions ==', 'Icon', '|type=thieving');
pushResults(game.pets.filter(x => search(x)), '\n== Pets ==', 'PetIcon');
pushResults(game.pets.filter(x => search(x)), '\n== Pets ==', 'PetIcon');
pushResults(game.combatEffects.allObjects.filter(x => search(x)), '\n== Combat Effects ==', 'EffectIcon');
pushResults(game.combatEffects.allObjects.filter(x => ['Shadeveil', 'Ablaze', 'Affliction', 'Barrier Burn', 'Bleed', 'Burn', 'Deadly Poison', 'Eldritch Curse', 'Fear', 'Freeze', 'Frostburn', 'Laceration', 'Nulled', 'Poison', 'Shock', 'Silence', 'Sleep', 'Slow', 'Stun', 'Toxin', 'Voidburst', 'Wither'].includes(x.name) && search(x)), '\n== Combat Effects ==', 'EffectIcon');
pushResults(game.currencies.allObjects.filter(x => search(x)), '\n== Others ==', 'Icon');
pushResults(game.currencies.allObjects.filter(x => search(x)), '\n== Others ==', 'Icon');
pushResults(game.gamemodes.allObjects.filter(x => !x.isEvent && x.id !== 'melvorD:Unset' && search(x)), '\n== Others ==', 'Icon');
pushResults(game.gamemodes.allObjects.filter(x => !x.isEvent && x.id !== 'melvorD:Unset' && search(x)), '\n== Others ==', 'Icon');