Skip to content

Instantly share code, notes, and snippets.

@wooningeire
Last active December 9, 2023 05:46
Show Gist options
  • Save wooningeire/e3f0868fc7447fa6c52b1e6d245c2c35 to your computer and use it in GitHub Desktop.
Save wooningeire/e3f0868fc7447fa6c52b1e6d245c2c35 to your computer and use it in GitHub Desktop.
const g = Map.prototype.get
// l = [1,2,3,4,5,6,7,8,9,10,11,23];
const l = Array(24).fill().map((_, i) => i);
Map.prototype.get = function (...args) {
const c = g.apply(this, args);
console.log(c);
if (c?.def) {
// c.def.img = "/fruit/watermelon.png";
// c.def.size = {x:778,y:776.8229954614221};
// c.def.score = 300000000;
// c.type = 11;
// c.combine = function () {
// return {
// combine: true,
// output: l[Math.floor(Math.random() * l.length)],
// score: Math.random() * 20000 -10000,
// };
// }
c.context.falling_fruit = c;
c.context.last_drop_time = -Infinity;
}
return c;
};
// https://suika.world/play/offline
const g = Map.prototype.get
// l = [1,2,3,4,5,6,7,8,9,10,11,23];
const l = Array(24).fill().map((_, i) => i);
let fruits;
Map.prototype.get = function (...args) {
const c = g.apply(this, args);
// console.log(c);
if (c?.def) {
// c.def.img = "/fruit/watermelon.png";
// c.def.size = {x:778,y:776.8229954614221};
// c.def.score = 300000000;
// c.type = 11;
c.combine = function () {
return {
combine: true,
output: l[Math.floor(Math.random() * l.length)],
score: Math.random() * 10000,
};
}
if (!fruits) {
fruits = c.context.fruits;
}
}
return c;
};
document.documentElement.addEventListener("pointerup", () => {
setTimeout(() => {
console.log([...fruits.values()]);
});
});
// https://suika.world/play/offline
const g = Map.prototype.get
// l = [1,2,3,4,5,6,7,8,9,10,11,23];
const l = Array(24).fill().map((_, i) => i);
Map.prototype.get = function (...args) {
const c = g.apply(this, args);
// console.log(c);
if (c?.def) {
// c.def.img = "/fruit/watermelon.png";
// c.def.size = {x:778,y:776.8229954614221};
// c.def.score = 300000000;
// c.type = 11;
c.combine = function () {
return {
combine: true,
output: l[Math.floor(Math.random() * l.length)],
score: Math.random() * 20000 -10000,
};
}
}
return c;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment