Compare commits

...

2 Commits

Author SHA1 Message Date
Alessandro Bruzzese
89411d7b3e
Update Italian ability-trigger.ts (#861) 2024-05-14 10:38:52 -05:00
Xavion3
d1187c7174
Modify legend gacha to be even split (#858)
* Modify egg gacha to be even split

* Update to a daily cycle

* Add spaces

* Removes now unused getSunday function
2024-05-14 11:34:40 -04:00
3 changed files with 10 additions and 10 deletions

View File

@ -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;
}

View File

@ -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;

View File

@ -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);
}