Compare commits

..

No commits in common. "3ed7649ce53a9bde7b77475fddefb3e5bc0eced7" and "5440c0b40c96884a4e08d822247e7180e1109d76" have entirely different histories.

5 changed files with 4 additions and 35 deletions

View File

@ -235,15 +235,6 @@ export default class BattleScene extends SceneBase {
this.nextCommandPhaseQueue = []; this.nextCommandPhaseQueue = [];
} }
/**
* Conditionally swaps the ACTION and CANCEL button
* @param standard When true, uses the default values
*/
setGamepadConfirm(standard: boolean) {
this.gamepadKeyConfig[Button.ACTION] = standard ? 0 : 1;
this.gamepadKeyConfig[Button.CANCEL] = standard ? 1 : 0;
}
loadPokemonAtlas(key: string, atlasPath: string, experimental?: boolean) { loadPokemonAtlas(key: string, atlasPath: string, experimental?: boolean) {
if (experimental === undefined) if (experimental === undefined)
experimental = this.experimentalSprites; experimental = this.experimentalSprites;

View File

@ -2876,7 +2876,7 @@ export class AddArenaTagAttr extends MoveEffectAttr {
public tagType: ArenaTagType; public tagType: ArenaTagType;
public turnCount: integer; public turnCount: integer;
private failOnOverlap: boolean; private failOnOverlap: boolean;
public selfSideTarget: boolean; private selfSideTarget: boolean;
constructor(tagType: ArenaTagType, turnCount?: integer, failOnOverlap: boolean = false, selfSideTarget: boolean = false) { constructor(tagType: ArenaTagType, turnCount?: integer, failOnOverlap: boolean = false, selfSideTarget: boolean = false) {
super(true, MoveEffectTrigger.POST_APPLY, true); super(true, MoveEffectTrigger.POST_APPLY, true);
@ -2909,10 +2909,9 @@ export class AddArenaTagAttr extends MoveEffectAttr {
export class AddArenaTrapTagAttr extends AddArenaTagAttr { export class AddArenaTrapTagAttr extends AddArenaTagAttr {
getCondition(): MoveConditionFunc { getCondition(): MoveConditionFunc {
return (user, target, move) => { return (user, target, move) => {
const side = (this.selfSideTarget ? user : target).isPlayer() ? ArenaTagSide.PLAYER : ArenaTagSide.ENEMY; if (move.category !== MoveCategory.STATUS || !user.scene.arena.getTag(this.tagType))
if (move.category !== MoveCategory.STATUS || !user.scene.arena.getTagOnSide(this.tagType, side))
return true; return true;
const tag = user.scene.arena.getTagOnSide(this.tagType, side) as ArenaTrapTag; const tag = user.scene.arena.getTag(this.tagType) as ArenaTrapTag;
return tag.layers < tag.maxLayers; return tag.layers < tag.maxLayers;
}; };
} }

View File

@ -492,7 +492,7 @@ export class Arena {
} }
addTag(tagType: ArenaTagType, turnCount: integer, sourceMove: Moves, sourceId: integer, side: ArenaTagSide = ArenaTagSide.BOTH, targetIndex?: BattlerIndex): boolean { addTag(tagType: ArenaTagType, turnCount: integer, sourceMove: Moves, sourceId: integer, side: ArenaTagSide = ArenaTagSide.BOTH, targetIndex?: BattlerIndex): boolean {
const existingTag = this.getTagOnSide(tagType, side); const existingTag = this.getTag(tagType);
if (existingTag) { if (existingTag) {
existingTag.onOverlap(this); existingTag.onOverlap(this);
return false; return false;

View File

@ -1904,21 +1904,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
applyAbAttrs(ReduceStatusEffectDurationAbAttr, this, null, effect, statusCureTurn); applyAbAttrs(ReduceStatusEffectDurationAbAttr, this, null, effect, statusCureTurn);
this.setFrameRate(4); this.setFrameRate(4);
// If the user is invulnerable, lets remove their invulnerability when they fall asleep
const invulnerableTags = [
BattlerTagType.UNDERGROUND,
BattlerTagType.UNDERWATER,
BattlerTagType.HIDDEN,
BattlerTagType.FLYING
];
const tag = invulnerableTags.find((t) => this.getTag(t));
if (tag) {
this.removeTag(tag);
this.getMoveQueue().pop();
}
} }
this.status = new Status(effect, 0, statusCureTurn?.value); this.status = new Status(effect, 0, statusCureTurn?.value);

View File

@ -25,7 +25,6 @@ export enum Setting {
Fusion_Palette_Swaps = "FUSION_PALETTE_SWAPS", Fusion_Palette_Swaps = "FUSION_PALETTE_SWAPS",
Player_Gender = "PLAYER_GENDER", Player_Gender = "PLAYER_GENDER",
Gamepad_Support = "GAMEPAD_SUPPORT", Gamepad_Support = "GAMEPAD_SUPPORT",
Swap_A_and_B = "SWAP_A_B", // Swaps which gamepad button handles ACTION and CANCEL
Touch_Controls = "TOUCH_CONTROLS", Touch_Controls = "TOUCH_CONTROLS",
Vibration = "VIBRATION" Vibration = "VIBRATION"
} }
@ -57,7 +56,6 @@ export const settingOptions: SettingOptions = {
[Setting.Fusion_Palette_Swaps]: [ 'Off', 'On' ], [Setting.Fusion_Palette_Swaps]: [ 'Off', 'On' ],
[Setting.Player_Gender]: [ 'Boy', 'Girl' ], [Setting.Player_Gender]: [ 'Boy', 'Girl' ],
[Setting.Gamepad_Support]: [ 'Auto', 'Disabled' ], [Setting.Gamepad_Support]: [ 'Auto', 'Disabled' ],
[Setting.Swap_A_and_B]: [ 'Enabled', 'Disabled' ],
[Setting.Touch_Controls]: [ 'Auto', 'Disabled' ], [Setting.Touch_Controls]: [ 'Auto', 'Disabled' ],
[Setting.Vibration]: [ 'Auto', 'Disabled' ] [Setting.Vibration]: [ 'Auto', 'Disabled' ]
}; };
@ -81,7 +79,6 @@ export const settingDefaults: SettingDefaults = {
[Setting.Fusion_Palette_Swaps]: 1, [Setting.Fusion_Palette_Swaps]: 1,
[Setting.Player_Gender]: 0, [Setting.Player_Gender]: 0,
[Setting.Gamepad_Support]: 0, [Setting.Gamepad_Support]: 0,
[Setting.Swap_A_and_B]: 1, // Set to 'Disabled' by default
[Setting.Touch_Controls]: 0, [Setting.Touch_Controls]: 0,
[Setting.Vibration]: 0 [Setting.Vibration]: 0
}; };
@ -151,9 +148,6 @@ export function setSetting(scene: BattleScene, setting: Setting, value: integer)
case Setting.Gamepad_Support: case Setting.Gamepad_Support:
scene.gamepadSupport = settingOptions[setting][value] !== 'Disabled'; scene.gamepadSupport = settingOptions[setting][value] !== 'Disabled';
break; break;
case Setting.Swap_A_and_B:
scene.setGamepadConfirm(settingOptions[setting][value] !== 'Enabled');
break;
case Setting.Touch_Controls: case Setting.Touch_Controls:
scene.enableTouchControls = settingOptions[setting][value] !== 'Disabled' && hasTouchscreen(); scene.enableTouchControls = settingOptions[setting][value] !== 'Disabled' && hasTouchscreen();
const touchControls = document.getElementById('touchControls'); const touchControls = document.getElementById('touchControls');