mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-10 18:32:16 +02:00
Compare commits
2 Commits
7061bb0d70
...
89411d7b3e
Author | SHA1 | Date | |
---|---|---|---|
|
89411d7b3e | ||
|
d1187c7174 |
@ -95,9 +95,16 @@ export function getLegendaryGachaSpeciesForTimestamp(scene: BattleScene, timesta
|
||||
|
||||
let ret: Species;
|
||||
|
||||
// 86400000 is the number of miliseconds in one day
|
||||
const timeDate = new Date(timestamp);
|
||||
const dayDate = new Date(Date.UTC(timeDate.getUTCFullYear(), timeDate.getUTCMonth(), timeDate.getUTCDate()));
|
||||
const dayTimestamp = timeDate.getTime(); // Timestamp of current week
|
||||
const offset = Math.floor(Math.floor(dayTimestamp / 86400000) / legendarySpecies.length); // Cycle number
|
||||
const index = Math.floor(dayTimestamp / 86400000) % legendarySpecies.length // Index within cycle
|
||||
|
||||
scene.executeWithSeedOffset(() => {
|
||||
ret = Utils.randSeedItem(legendarySpecies);
|
||||
}, Utils.getSunday(new Date(timestamp)).getTime(), EGG_SEED.toString());
|
||||
ret = Phaser.Math.RND.shuffle(legendarySpecies)[index];
|
||||
}, offset, EGG_SEED.toString());
|
||||
|
||||
return ret;
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
import { SimpleTranslationEntries } from "#app/plugins/i18n";
|
||||
|
||||
export const abilityTriggers: SimpleTranslationEntries = {
|
||||
'blockRecoilDamage' : `{{pokemonName}}'s {{abilityName}}\nprotected it from recoil!`,
|
||||
'blockRecoilDamage' : `{{abilityName}} di {{pokemonName}}\nl'ha protetto dal contraccolpo!`,
|
||||
} as const;
|
@ -116,13 +116,6 @@ export function randSeedEasedWeightedItem<T>(items: T[], easingFunction: string
|
||||
return items[Math.floor(easedValue * items.length)];
|
||||
}
|
||||
|
||||
export function getSunday(date: Date): Date {
|
||||
const day = date.getUTCDay();
|
||||
const diff = date.getUTCDate() - day;
|
||||
const newDate = new Date(date.setUTCDate(diff));
|
||||
return new Date(Date.UTC(newDate.getUTCFullYear(), newDate.getUTCMonth(), newDate.getUTCDate()));
|
||||
}
|
||||
|
||||
export function getFrameMs(frameCount: integer): integer {
|
||||
return Math.floor((1 / 60) * 1000 * frameCount);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user