mirror of
https://github.com/NohamR/Pocket-Bird.git
synced 2026-05-24 19:59:36 +00:00
Implement rarity calculations
This commit is contained in:
BIN
dist/extension.zip
vendored
BIN
dist/extension.zip
vendored
Binary file not shown.
16
dist/extension/birb.js
vendored
16
dist/extension/birb.js
vendored
@@ -618,13 +618,12 @@
|
|||||||
"#373737": PALETTE.FEATHER_SPINE,
|
"#373737": PALETTE.FEATHER_SPINE,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
const RARITY = Object.freeze(/** @type {const} */ ({
|
||||||
* @type {Record<string, string>}
|
|
||||||
*/
|
|
||||||
const RARITY = {
|
|
||||||
FAMILIAR: "familiar",
|
FAMILIAR: "familiar",
|
||||||
UNCOMMON: "uncommon"
|
UNCOMMON: "uncommon"
|
||||||
};
|
}));
|
||||||
|
|
||||||
|
/** @typedef {typeof RARITY[keyof typeof RARITY]} Rarity */
|
||||||
|
|
||||||
class BirdType {
|
class BirdType {
|
||||||
/**
|
/**
|
||||||
@@ -632,7 +631,7 @@
|
|||||||
* @param {string} description
|
* @param {string} description
|
||||||
* @param {Record<string, string>} colors
|
* @param {Record<string, string>} colors
|
||||||
* @param {string[]} [tags]
|
* @param {string[]} [tags]
|
||||||
* @param {string} [rarity]
|
* @param {Rarity} [rarity]
|
||||||
*/
|
*/
|
||||||
constructor(name, description, colors, tags = [], rarity = RARITY.FAMILIAR) {
|
constructor(name, description, colors, tags = [], rarity = RARITY.FAMILIAR) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
@@ -665,6 +664,7 @@
|
|||||||
/** @type {Record<string, string>} */
|
/** @type {Record<string, string>} */
|
||||||
this.colors = { ...defaultColors, ...colors, [PALETTE.THEME_HIGHLIGHT]: colors[PALETTE.THEME_HIGHLIGHT] ?? colors.hood ?? colors.face };
|
this.colors = { ...defaultColors, ...colors, [PALETTE.THEME_HIGHLIGHT]: colors[PALETTE.THEME_HIGHLIGHT] ?? colors.hood ?? colors.face };
|
||||||
this.tags = tags;
|
this.tags = tags;
|
||||||
|
/** @type {Rarity} */
|
||||||
this.rarity = rarity;
|
this.rarity = rarity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2398,6 +2398,7 @@
|
|||||||
const HOP_CHANCE = 1 / (60 * 2.5); // Every 2.5 seconds
|
const HOP_CHANCE = 1 / (60 * 2.5); // Every 2.5 seconds
|
||||||
const FOCUS_SWITCH_CHANCE = 1 / (60 * 20); // Every 20 seconds
|
const FOCUS_SWITCH_CHANCE = 1 / (60 * 20); // Every 20 seconds
|
||||||
const FEATHER_CHANCE = 1 / (60 * 60 * 60 * 2); // Every 2 hours
|
const FEATHER_CHANCE = 1 / (60 * 60 * 60 * 2); // Every 2 hours
|
||||||
|
const UNCOMMON_FEATHER_CHANCE = 0.1; // 10% of feathers are uncommon
|
||||||
const HAT_CHANCE = 1 / (60 * 60 * 25); // Every 25 minutes
|
const HAT_CHANCE = 1 / (60 * 60 * 25); // Every 25 minutes
|
||||||
|
|
||||||
// Feathers
|
// Feathers
|
||||||
@@ -2849,7 +2850,8 @@
|
|||||||
if (document.querySelector("#" + FEATHER_ID)) {
|
if (document.querySelector("#" + FEATHER_ID)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const speciesToUnlock = Object.keys(SPECIES).filter((species) => !unlockedSpecies.includes(species));
|
const rarity = Math.random() < UNCOMMON_FEATHER_CHANCE ? RARITY.UNCOMMON : RARITY.FAMILIAR;
|
||||||
|
const speciesToUnlock = Object.keys(SPECIES).filter((species) => !unlockedSpecies.includes(species) && SPECIES[species].rarity === rarity);
|
||||||
if (speciesToUnlock.length === 0) {
|
if (speciesToUnlock.length === 0) {
|
||||||
// No more species to unlock
|
// No more species to unlock
|
||||||
return;
|
return;
|
||||||
|
|||||||
16
dist/obsidian/main.js
vendored
16
dist/obsidian/main.js
vendored
@@ -623,13 +623,12 @@ module.exports = class PocketBird extends Plugin {
|
|||||||
"#373737": PALETTE.FEATHER_SPINE,
|
"#373737": PALETTE.FEATHER_SPINE,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
const RARITY = Object.freeze(/** @type {const} */ ({
|
||||||
* @type {Record<string, string>}
|
|
||||||
*/
|
|
||||||
const RARITY = {
|
|
||||||
FAMILIAR: "familiar",
|
FAMILIAR: "familiar",
|
||||||
UNCOMMON: "uncommon"
|
UNCOMMON: "uncommon"
|
||||||
};
|
}));
|
||||||
|
|
||||||
|
/** @typedef {typeof RARITY[keyof typeof RARITY]} Rarity */
|
||||||
|
|
||||||
class BirdType {
|
class BirdType {
|
||||||
/**
|
/**
|
||||||
@@ -637,7 +636,7 @@ module.exports = class PocketBird extends Plugin {
|
|||||||
* @param {string} description
|
* @param {string} description
|
||||||
* @param {Record<string, string>} colors
|
* @param {Record<string, string>} colors
|
||||||
* @param {string[]} [tags]
|
* @param {string[]} [tags]
|
||||||
* @param {string} [rarity]
|
* @param {Rarity} [rarity]
|
||||||
*/
|
*/
|
||||||
constructor(name, description, colors, tags = [], rarity = RARITY.FAMILIAR) {
|
constructor(name, description, colors, tags = [], rarity = RARITY.FAMILIAR) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
@@ -670,6 +669,7 @@ module.exports = class PocketBird extends Plugin {
|
|||||||
/** @type {Record<string, string>} */
|
/** @type {Record<string, string>} */
|
||||||
this.colors = { ...defaultColors, ...colors, [PALETTE.THEME_HIGHLIGHT]: colors[PALETTE.THEME_HIGHLIGHT] ?? colors.hood ?? colors.face };
|
this.colors = { ...defaultColors, ...colors, [PALETTE.THEME_HIGHLIGHT]: colors[PALETTE.THEME_HIGHLIGHT] ?? colors.hood ?? colors.face };
|
||||||
this.tags = tags;
|
this.tags = tags;
|
||||||
|
/** @type {Rarity} */
|
||||||
this.rarity = rarity;
|
this.rarity = rarity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2431,6 +2431,7 @@ module.exports = class PocketBird extends Plugin {
|
|||||||
const HOP_CHANCE = 1 / (60 * 2.5); // Every 2.5 seconds
|
const HOP_CHANCE = 1 / (60 * 2.5); // Every 2.5 seconds
|
||||||
const FOCUS_SWITCH_CHANCE = 1 / (60 * 20); // Every 20 seconds
|
const FOCUS_SWITCH_CHANCE = 1 / (60 * 20); // Every 20 seconds
|
||||||
const FEATHER_CHANCE = 1 / (60 * 60 * 60 * 2); // Every 2 hours
|
const FEATHER_CHANCE = 1 / (60 * 60 * 60 * 2); // Every 2 hours
|
||||||
|
const UNCOMMON_FEATHER_CHANCE = 0.1; // 10% of feathers are uncommon
|
||||||
const HAT_CHANCE = 1 / (60 * 60 * 25); // Every 25 minutes
|
const HAT_CHANCE = 1 / (60 * 60 * 25); // Every 25 minutes
|
||||||
|
|
||||||
// Feathers
|
// Feathers
|
||||||
@@ -2882,7 +2883,8 @@ module.exports = class PocketBird extends Plugin {
|
|||||||
if (document.querySelector("#" + FEATHER_ID)) {
|
if (document.querySelector("#" + FEATHER_ID)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const speciesToUnlock = Object.keys(SPECIES).filter((species) => !unlockedSpecies.includes(species));
|
const rarity = Math.random() < UNCOMMON_FEATHER_CHANCE ? RARITY.UNCOMMON : RARITY.FAMILIAR;
|
||||||
|
const speciesToUnlock = Object.keys(SPECIES).filter((species) => !unlockedSpecies.includes(species) && SPECIES[species].rarity === rarity);
|
||||||
if (speciesToUnlock.length === 0) {
|
if (speciesToUnlock.length === 0) {
|
||||||
// No more species to unlock
|
// No more species to unlock
|
||||||
return;
|
return;
|
||||||
|
|||||||
16
dist/userscript/birb.user.js
vendored
16
dist/userscript/birb.user.js
vendored
@@ -632,13 +632,12 @@
|
|||||||
"#373737": PALETTE.FEATHER_SPINE,
|
"#373737": PALETTE.FEATHER_SPINE,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
const RARITY = Object.freeze(/** @type {const} */ ({
|
||||||
* @type {Record<string, string>}
|
|
||||||
*/
|
|
||||||
const RARITY = {
|
|
||||||
FAMILIAR: "familiar",
|
FAMILIAR: "familiar",
|
||||||
UNCOMMON: "uncommon"
|
UNCOMMON: "uncommon"
|
||||||
};
|
}));
|
||||||
|
|
||||||
|
/** @typedef {typeof RARITY[keyof typeof RARITY]} Rarity */
|
||||||
|
|
||||||
class BirdType {
|
class BirdType {
|
||||||
/**
|
/**
|
||||||
@@ -646,7 +645,7 @@
|
|||||||
* @param {string} description
|
* @param {string} description
|
||||||
* @param {Record<string, string>} colors
|
* @param {Record<string, string>} colors
|
||||||
* @param {string[]} [tags]
|
* @param {string[]} [tags]
|
||||||
* @param {string} [rarity]
|
* @param {Rarity} [rarity]
|
||||||
*/
|
*/
|
||||||
constructor(name, description, colors, tags = [], rarity = RARITY.FAMILIAR) {
|
constructor(name, description, colors, tags = [], rarity = RARITY.FAMILIAR) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
@@ -679,6 +678,7 @@
|
|||||||
/** @type {Record<string, string>} */
|
/** @type {Record<string, string>} */
|
||||||
this.colors = { ...defaultColors, ...colors, [PALETTE.THEME_HIGHLIGHT]: colors[PALETTE.THEME_HIGHLIGHT] ?? colors.hood ?? colors.face };
|
this.colors = { ...defaultColors, ...colors, [PALETTE.THEME_HIGHLIGHT]: colors[PALETTE.THEME_HIGHLIGHT] ?? colors.hood ?? colors.face };
|
||||||
this.tags = tags;
|
this.tags = tags;
|
||||||
|
/** @type {Rarity} */
|
||||||
this.rarity = rarity;
|
this.rarity = rarity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2393,6 +2393,7 @@
|
|||||||
const HOP_CHANCE = 1 / (60 * 2.5); // Every 2.5 seconds
|
const HOP_CHANCE = 1 / (60 * 2.5); // Every 2.5 seconds
|
||||||
const FOCUS_SWITCH_CHANCE = 1 / (60 * 20); // Every 20 seconds
|
const FOCUS_SWITCH_CHANCE = 1 / (60 * 20); // Every 20 seconds
|
||||||
const FEATHER_CHANCE = 1 / (60 * 60 * 60 * 2); // Every 2 hours
|
const FEATHER_CHANCE = 1 / (60 * 60 * 60 * 2); // Every 2 hours
|
||||||
|
const UNCOMMON_FEATHER_CHANCE = 0.1; // 10% of feathers are uncommon
|
||||||
const HAT_CHANCE = 1 / (60 * 60 * 25); // Every 25 minutes
|
const HAT_CHANCE = 1 / (60 * 60 * 25); // Every 25 minutes
|
||||||
|
|
||||||
// Feathers
|
// Feathers
|
||||||
@@ -2844,7 +2845,8 @@
|
|||||||
if (document.querySelector("#" + FEATHER_ID)) {
|
if (document.querySelector("#" + FEATHER_ID)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const speciesToUnlock = Object.keys(SPECIES).filter((species) => !unlockedSpecies.includes(species));
|
const rarity = Math.random() < UNCOMMON_FEATHER_CHANCE ? RARITY.UNCOMMON : RARITY.FAMILIAR;
|
||||||
|
const speciesToUnlock = Object.keys(SPECIES).filter((species) => !unlockedSpecies.includes(species) && SPECIES[species].rarity === rarity);
|
||||||
if (speciesToUnlock.length === 0) {
|
if (speciesToUnlock.length === 0) {
|
||||||
// No more species to unlock
|
// No more species to unlock
|
||||||
return;
|
return;
|
||||||
|
|||||||
16
dist/web/birb.embed.js
vendored
16
dist/web/birb.embed.js
vendored
@@ -618,13 +618,12 @@
|
|||||||
"#373737": PALETTE.FEATHER_SPINE,
|
"#373737": PALETTE.FEATHER_SPINE,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
const RARITY = Object.freeze(/** @type {const} */ ({
|
||||||
* @type {Record<string, string>}
|
|
||||||
*/
|
|
||||||
const RARITY = {
|
|
||||||
FAMILIAR: "familiar",
|
FAMILIAR: "familiar",
|
||||||
UNCOMMON: "uncommon"
|
UNCOMMON: "uncommon"
|
||||||
};
|
}));
|
||||||
|
|
||||||
|
/** @typedef {typeof RARITY[keyof typeof RARITY]} Rarity */
|
||||||
|
|
||||||
class BirdType {
|
class BirdType {
|
||||||
/**
|
/**
|
||||||
@@ -632,7 +631,7 @@
|
|||||||
* @param {string} description
|
* @param {string} description
|
||||||
* @param {Record<string, string>} colors
|
* @param {Record<string, string>} colors
|
||||||
* @param {string[]} [tags]
|
* @param {string[]} [tags]
|
||||||
* @param {string} [rarity]
|
* @param {Rarity} [rarity]
|
||||||
*/
|
*/
|
||||||
constructor(name, description, colors, tags = [], rarity = RARITY.FAMILIAR) {
|
constructor(name, description, colors, tags = [], rarity = RARITY.FAMILIAR) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
@@ -665,6 +664,7 @@
|
|||||||
/** @type {Record<string, string>} */
|
/** @type {Record<string, string>} */
|
||||||
this.colors = { ...defaultColors, ...colors, [PALETTE.THEME_HIGHLIGHT]: colors[PALETTE.THEME_HIGHLIGHT] ?? colors.hood ?? colors.face };
|
this.colors = { ...defaultColors, ...colors, [PALETTE.THEME_HIGHLIGHT]: colors[PALETTE.THEME_HIGHLIGHT] ?? colors.hood ?? colors.face };
|
||||||
this.tags = tags;
|
this.tags = tags;
|
||||||
|
/** @type {Rarity} */
|
||||||
this.rarity = rarity;
|
this.rarity = rarity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2373,6 +2373,7 @@
|
|||||||
const HOP_CHANCE = 1 / (60 * 2.5); // Every 2.5 seconds
|
const HOP_CHANCE = 1 / (60 * 2.5); // Every 2.5 seconds
|
||||||
const FOCUS_SWITCH_CHANCE = 1 / (60 * 20); // Every 20 seconds
|
const FOCUS_SWITCH_CHANCE = 1 / (60 * 20); // Every 20 seconds
|
||||||
const FEATHER_CHANCE = 1 / (60 * 60 * 60 * 2); // Every 2 hours
|
const FEATHER_CHANCE = 1 / (60 * 60 * 60 * 2); // Every 2 hours
|
||||||
|
const UNCOMMON_FEATHER_CHANCE = 0.1; // 10% of feathers are uncommon
|
||||||
const HAT_CHANCE = 1 / (60 * 60 * 25); // Every 25 minutes
|
const HAT_CHANCE = 1 / (60 * 60 * 25); // Every 25 minutes
|
||||||
|
|
||||||
// Feathers
|
// Feathers
|
||||||
@@ -2824,7 +2825,8 @@
|
|||||||
if (document.querySelector("#" + FEATHER_ID)) {
|
if (document.querySelector("#" + FEATHER_ID)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const speciesToUnlock = Object.keys(SPECIES).filter((species) => !unlockedSpecies.includes(species));
|
const rarity = Math.random() < UNCOMMON_FEATHER_CHANCE ? RARITY.UNCOMMON : RARITY.FAMILIAR;
|
||||||
|
const speciesToUnlock = Object.keys(SPECIES).filter((species) => !unlockedSpecies.includes(species) && SPECIES[species].rarity === rarity);
|
||||||
if (speciesToUnlock.length === 0) {
|
if (speciesToUnlock.length === 0) {
|
||||||
// No more species to unlock
|
// No more species to unlock
|
||||||
return;
|
return;
|
||||||
|
|||||||
16
dist/web/birb.js
vendored
16
dist/web/birb.js
vendored
@@ -618,13 +618,12 @@
|
|||||||
"#373737": PALETTE.FEATHER_SPINE,
|
"#373737": PALETTE.FEATHER_SPINE,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
const RARITY = Object.freeze(/** @type {const} */ ({
|
||||||
* @type {Record<string, string>}
|
|
||||||
*/
|
|
||||||
const RARITY = {
|
|
||||||
FAMILIAR: "familiar",
|
FAMILIAR: "familiar",
|
||||||
UNCOMMON: "uncommon"
|
UNCOMMON: "uncommon"
|
||||||
};
|
}));
|
||||||
|
|
||||||
|
/** @typedef {typeof RARITY[keyof typeof RARITY]} Rarity */
|
||||||
|
|
||||||
class BirdType {
|
class BirdType {
|
||||||
/**
|
/**
|
||||||
@@ -632,7 +631,7 @@
|
|||||||
* @param {string} description
|
* @param {string} description
|
||||||
* @param {Record<string, string>} colors
|
* @param {Record<string, string>} colors
|
||||||
* @param {string[]} [tags]
|
* @param {string[]} [tags]
|
||||||
* @param {string} [rarity]
|
* @param {Rarity} [rarity]
|
||||||
*/
|
*/
|
||||||
constructor(name, description, colors, tags = [], rarity = RARITY.FAMILIAR) {
|
constructor(name, description, colors, tags = [], rarity = RARITY.FAMILIAR) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
@@ -665,6 +664,7 @@
|
|||||||
/** @type {Record<string, string>} */
|
/** @type {Record<string, string>} */
|
||||||
this.colors = { ...defaultColors, ...colors, [PALETTE.THEME_HIGHLIGHT]: colors[PALETTE.THEME_HIGHLIGHT] ?? colors.hood ?? colors.face };
|
this.colors = { ...defaultColors, ...colors, [PALETTE.THEME_HIGHLIGHT]: colors[PALETTE.THEME_HIGHLIGHT] ?? colors.hood ?? colors.face };
|
||||||
this.tags = tags;
|
this.tags = tags;
|
||||||
|
/** @type {Rarity} */
|
||||||
this.rarity = rarity;
|
this.rarity = rarity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2373,6 +2373,7 @@
|
|||||||
const HOP_CHANCE = 1 / (60 * 2.5); // Every 2.5 seconds
|
const HOP_CHANCE = 1 / (60 * 2.5); // Every 2.5 seconds
|
||||||
const FOCUS_SWITCH_CHANCE = 1 / (60 * 20); // Every 20 seconds
|
const FOCUS_SWITCH_CHANCE = 1 / (60 * 20); // Every 20 seconds
|
||||||
const FEATHER_CHANCE = 1 / (60 * 60 * 60 * 2); // Every 2 hours
|
const FEATHER_CHANCE = 1 / (60 * 60 * 60 * 2); // Every 2 hours
|
||||||
|
const UNCOMMON_FEATHER_CHANCE = 0.1; // 10% of feathers are uncommon
|
||||||
const HAT_CHANCE = 1 / (60 * 60 * 25); // Every 25 minutes
|
const HAT_CHANCE = 1 / (60 * 60 * 25); // Every 25 minutes
|
||||||
|
|
||||||
// Feathers
|
// Feathers
|
||||||
@@ -2824,7 +2825,8 @@
|
|||||||
if (document.querySelector("#" + FEATHER_ID)) {
|
if (document.querySelector("#" + FEATHER_ID)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const speciesToUnlock = Object.keys(SPECIES).filter((species) => !unlockedSpecies.includes(species));
|
const rarity = Math.random() < UNCOMMON_FEATHER_CHANCE ? RARITY.UNCOMMON : RARITY.FAMILIAR;
|
||||||
|
const speciesToUnlock = Object.keys(SPECIES).filter((species) => !unlockedSpecies.includes(species) && SPECIES[species].rarity === rarity);
|
||||||
if (speciesToUnlock.length === 0) {
|
if (speciesToUnlock.length === 0) {
|
||||||
// No more species to unlock
|
// No more species to unlock
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -98,13 +98,12 @@ export const DEFAULT_COLOR_OVERRIDES = {
|
|||||||
[PALETTE.WING_SPOTS]: PALETTE.WING,
|
[PALETTE.WING_SPOTS]: PALETTE.WING,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
export const RARITY = Object.freeze(/** @type {const} */ ({
|
||||||
* @type {Record<string, string>}
|
|
||||||
*/
|
|
||||||
export const RARITY = {
|
|
||||||
FAMILIAR: "familiar",
|
FAMILIAR: "familiar",
|
||||||
UNCOMMON: "uncommon"
|
UNCOMMON: "uncommon"
|
||||||
}
|
}));
|
||||||
|
|
||||||
|
/** @typedef {typeof RARITY[keyof typeof RARITY]} Rarity */
|
||||||
|
|
||||||
export class BirdType {
|
export class BirdType {
|
||||||
/**
|
/**
|
||||||
@@ -112,7 +111,7 @@ export class BirdType {
|
|||||||
* @param {string} description
|
* @param {string} description
|
||||||
* @param {Record<string, string>} colors
|
* @param {Record<string, string>} colors
|
||||||
* @param {string[]} [tags]
|
* @param {string[]} [tags]
|
||||||
* @param {string} [rarity]
|
* @param {Rarity} [rarity]
|
||||||
*/
|
*/
|
||||||
constructor(name, description, colors, tags = [], rarity = RARITY.FAMILIAR) {
|
constructor(name, description, colors, tags = [], rarity = RARITY.FAMILIAR) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
@@ -145,6 +144,7 @@ export class BirdType {
|
|||||||
/** @type {Record<string, string>} */
|
/** @type {Record<string, string>} */
|
||||||
this.colors = { ...defaultColors, ...colors, [PALETTE.THEME_HIGHLIGHT]: colors[PALETTE.THEME_HIGHLIGHT] ?? colors.hood ?? colors.face };
|
this.colors = { ...defaultColors, ...colors, [PALETTE.THEME_HIGHLIGHT]: colors[PALETTE.THEME_HIGHLIGHT] ?? colors.hood ?? colors.face };
|
||||||
this.tags = tags;
|
this.tags = tags;
|
||||||
|
/** @type {Rarity} */
|
||||||
this.rarity = rarity;
|
this.rarity = rarity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,6 +110,7 @@ const HOP_DELAY = 500;
|
|||||||
const HOP_CHANCE = 1 / (60 * 2.5); // Every 2.5 seconds
|
const HOP_CHANCE = 1 / (60 * 2.5); // Every 2.5 seconds
|
||||||
const FOCUS_SWITCH_CHANCE = 1 / (60 * 20); // Every 20 seconds
|
const FOCUS_SWITCH_CHANCE = 1 / (60 * 20); // Every 20 seconds
|
||||||
const FEATHER_CHANCE = 1 / (60 * 60 * 60 * 2); // Every 2 hours
|
const FEATHER_CHANCE = 1 / (60 * 60 * 60 * 2); // Every 2 hours
|
||||||
|
const UNCOMMON_FEATHER_CHANCE = 0.1; // 10% of feathers are uncommon
|
||||||
const HAT_CHANCE = 1 / (60 * 60 * 25); // Every 25 minutes
|
const HAT_CHANCE = 1 / (60 * 60 * 25); // Every 25 minutes
|
||||||
|
|
||||||
// Feathers
|
// Feathers
|
||||||
@@ -564,7 +565,8 @@ function startApplication(birbPixels, featherPixels, hatsPixels) {
|
|||||||
if (document.querySelector("#" + FEATHER_ID)) {
|
if (document.querySelector("#" + FEATHER_ID)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const speciesToUnlock = Object.keys(SPECIES).filter((species) => !unlockedSpecies.includes(species));
|
const rarity = Math.random() < UNCOMMON_FEATHER_CHANCE ? RARITY.UNCOMMON : RARITY.FAMILIAR;
|
||||||
|
const speciesToUnlock = Object.keys(SPECIES).filter((species) => !unlockedSpecies.includes(species) && SPECIES[species].rarity === rarity);
|
||||||
if (speciesToUnlock.length === 0) {
|
if (speciesToUnlock.length === 0) {
|
||||||
// No more species to unlock
|
// No more species to unlock
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user