diff --git a/index.css b/index.css index 30e7c63d954..be480ab6c78 100644 --- a/index.css +++ b/index.css @@ -19,9 +19,21 @@ html { body { margin: 0; + display:flex; + flex-direction: column; + align-items: center; background: #484050; } +#links { + width: 90%; + text-align: center; + position: fixed; + bottom: 0; + display: flex; + justify-content: space-around; +} + #app { display: flex; justify-content: center; @@ -195,6 +207,17 @@ input:-internal-autofill-selected { } } +#tnc-links { + font-size: xx-small; + position: relative; +} + +a { + color: #328cea; + margin-right: 4px; + margin-left: 4px; +} + /* Firefox old*/ @-moz-keyframes blink { 0% { diff --git a/index.html b/index.html index 3722bdd3422..ebe5b063c52 100644 --- a/index.html +++ b/index.html @@ -39,6 +39,7 @@ + - \ No newline at end of file diff --git a/src/data/egg.ts b/src/data/egg.ts index a924298c014..0c6b4f3f38c 100644 --- a/src/data/egg.ts +++ b/src/data/egg.ts @@ -219,7 +219,7 @@ export class Egg { let abilityIndex = undefined; if (pokemonSpecies.abilityHidden && (this._overrideHiddenAbility || (this._sourceType === EggSourceType.SAME_SPECIES_EGG && !Utils.randSeedInt(SAME_SPECIES_EGG_HA_RATE)))) { - abilityIndex = pokemonSpecies.ability2 ? 2 : 1; + abilityIndex = 2; } // This function has way to many optional parameters diff --git a/src/data/move.ts b/src/data/move.ts index a2b879a388b..ee7ad1abc02 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -717,9 +717,13 @@ export default class Move implements Localizable { * @returns The calculated power of the move. */ calculateBattlePower(source: Pokemon, target: Pokemon): number { - const power = new Utils.NumberHolder(this.power); + if (this.category === MoveCategory.STATUS) { + return -1; + } + const power = new Utils.NumberHolder(this.power); const typeChangeMovePowerMultiplier = new Utils.NumberHolder(1); + applyPreAttackAbAttrs(MoveTypeChangeAttr, source, target, this, typeChangeMovePowerMultiplier); const sourceTeraType = source.getTeraType(); diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index f396367e491..e812d47fe1a 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -140,10 +140,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { // If abilityIndex is not provided, determine it based on species and hidden ability if (species.abilityHidden && hasHiddenAbility) { // If the species has a hidden ability and the hidden ability is present - this.abilityIndex = species.ability2 ? 2 : 1; // Use ability index 2 if species has a second ability, otherwise use 1 + this.abilityIndex = 2; } else { // If there is no hidden ability or species does not have a hidden ability - this.abilityIndex = species.ability2 ? randAbilityIndex : 0; // Use random ability index if species has a second ability, otherwise use 0 + this.abilityIndex = species.ability2 !== species.ability1 ? randAbilityIndex : 0; // Use random ability index if species has a second ability, otherwise use 0 } } if (formIndex !== undefined) { @@ -1862,7 +1862,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { const types = this.getTypes(true, true); const cancelled = new Utils.BooleanHolder(false); + const power = move.calculateBattlePower(source, this); const typeless = move.hasAttr(TypelessAttr); + const typeMultiplier = new Utils.NumberHolder(!typeless && (moveCategory !== MoveCategory.STATUS || move.getAttrs(StatusMoveTypeImmunityAttr).find(attr => types.includes(attr.immuneType))) ? this.getAttackTypeEffectiveness(move, source, false, false) : 1); @@ -1887,7 +1889,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { case MoveCategory.PHYSICAL: case MoveCategory.SPECIAL: const isPhysical = moveCategory === MoveCategory.PHYSICAL; - const power = move.calculateBattlePower(source, this); const sourceTeraType = source.getTeraType(); if (!typeless) { diff --git a/src/ui/menu-ui-handler.ts b/src/ui/menu-ui-handler.ts index 88c9791c689..a0cea2f78d5 100644 --- a/src/ui/menu-ui-handler.ts +++ b/src/ui/menu-ui-handler.ts @@ -193,17 +193,31 @@ export default class MenuUiHandler extends MessageUiHandler { handler: () => { this.scene.gameData.tryExportData(GameDataType.SYSTEM); return true; + } + }, + { + label: "Consent Preferences", + handler: () => { + const consentLink = document.querySelector(".termly-display-preferences") as HTMLInputElement; + const clickEvent = new MouseEvent("click", { + view: window, + bubbles: true, + cancelable: true + }); + consentLink.dispatchEvent(clickEvent); + consentLink.focus(); + return true; }, keepOpen: true - }); - manageDataOptions.push({ + }, + { label: i18next.t("menuUiHandler:cancel"), handler: () => { this.scene.ui.revertMode(); return true; - } - } - ); + }, + keepOpen: true + }); this.manageDataConfig = { xOffset: 98,