mirror of
https://github.com/NohamR/Pocket-Bird.git
synced 2026-05-24 19:59:36 +00:00
Spawn hats based on time again
This commit is contained in:
34
dist/web/birb.embed.js
vendored
34
dist/web/birb.embed.js
vendored
@@ -2032,7 +2032,8 @@
|
||||
|
||||
// Timing constants (in milliseconds)
|
||||
const UPDATE_INTERVAL = 1000 / 60; // 60 FPS
|
||||
const AFK_TIME = isDebug() ? 0 : 1000 * 5;
|
||||
const AFK_TIME = isDebug() ? 0 : 1000 * 5; // 5 seconds
|
||||
const SUPER_AFK_TIME = 1000 * 60 * 60; // 1 hour
|
||||
const PET_MENU_COOLDOWN = 1000;
|
||||
const URL_CHECK_INTERVAL = 150;
|
||||
const HOP_DELAY = 500;
|
||||
@@ -2041,7 +2042,7 @@
|
||||
const HOP_CHANCE = 1 / (60 * 2.5); // Every 2.5 seconds
|
||||
const FOCUS_SWITCH_CHANCE = 1 / (60 * 20); // Every 20 seconds
|
||||
const FEATHER_CHANCE = 1 / (60 * 60 * 60 * 2); // Every 2 hours
|
||||
const HAT_CHANCE = 1 / 50; // Every 50 webpages
|
||||
const HAT_CHANCE = 1 / (60 * 60 * 10); // Every 10 minutes
|
||||
|
||||
// Feathers
|
||||
const FEATHER_FALL_SPEED = 1;
|
||||
@@ -2146,7 +2147,7 @@
|
||||
insertModal(`${birdBirb()} Mode`, message);
|
||||
}),
|
||||
new Separator(),
|
||||
new MenuItem(() => `2026.1.21 ${isPetBoostActive() ? "❤" : ""}`, () => { alert("Thank you for using Pocket Bird! You are on version: 2026.1.21"); }, false),
|
||||
new MenuItem(() => `2026.1.22 ${isPetBoostActive() ? "❤" : ""}`, () => { alert("Thank you for using Pocket Bird! You are on version: 2026.1.22"); }, false),
|
||||
];
|
||||
|
||||
const styleElement = document.createElement("style");
|
||||
@@ -2333,24 +2334,12 @@
|
||||
log("Path changed from '" + lastPath + "' to '" + currentPath + "'");
|
||||
lastPath = currentPath;
|
||||
drawStickyNotes(stickyNotes, save, deleteStickyNote);
|
||||
determineHatUnlock();
|
||||
}
|
||||
}, URL_CHECK_INTERVAL);
|
||||
|
||||
setInterval(update, UPDATE_INTERVAL);
|
||||
|
||||
focusOnElement(true);
|
||||
|
||||
determineHatUnlock();
|
||||
}
|
||||
|
||||
function determineHatUnlock() {
|
||||
if (Math.random() < (HAT_CHANCE * (isPetBoostActive() ? PET_HAT_BOOST : 1))) {
|
||||
insertHat();
|
||||
} else if (location.hostname === "127.0.0.1") {
|
||||
log("Inserting hat for debug purposes");
|
||||
insertHat();
|
||||
}
|
||||
}
|
||||
|
||||
function update() {
|
||||
@@ -2383,12 +2372,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Double the chance of a feather if recently pet
|
||||
const petMod = isPetBoostActive() ? PET_FEATHER_BOOST : 1;
|
||||
if (birb.isVisible() && Math.random() < FEATHER_CHANCE * petMod) {
|
||||
lastPetTimestamp = 0;
|
||||
activateFeather();
|
||||
if (birb.isVisible() && Date.now() - lastActionTimestamp < SUPER_AFK_TIME) {
|
||||
if (Math.random() < FEATHER_CHANCE * (isPetBoostActive() ? PET_FEATHER_BOOST : 1)) {
|
||||
lastPetTimestamp = 0;
|
||||
activateFeather();
|
||||
}
|
||||
if (Math.random() < (HAT_CHANCE * (isPetBoostActive() ? PET_HAT_BOOST : 1))) {
|
||||
lastPetTimestamp = 0;
|
||||
insertHat();
|
||||
}
|
||||
}
|
||||
|
||||
updateFeather();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user