Add spliced type sharing and fix move description scrolling
parent
f3ed8e925e
commit
b2d7895c7b
|
@ -453,7 +453,7 @@ export class EvolutionItemModifierType extends PokemonModifierType implements Ge
|
||||||
|
|
||||||
export class FusePokemonModifierType extends PokemonModifierType {
|
export class FusePokemonModifierType extends PokemonModifierType {
|
||||||
constructor(name: string, iconImage?: string) {
|
constructor(name: string, iconImage?: string) {
|
||||||
super(name, 'Combines two Pokémon, giving the first Pokémon the ability of the second', (_type, args) => new Modifiers.FusePokemonModifier(this, (args[0] as PlayerPokemon).id, (args[1] as PlayerPokemon).id),
|
super(name, 'Combines two Pokémon (transfers ability, splits base stats and types, shares move pool)', (_type, args) => new Modifiers.FusePokemonModifier(this, (args[0] as PlayerPokemon).id, (args[1] as PlayerPokemon).id),
|
||||||
(pokemon: PlayerPokemon) => {
|
(pokemon: PlayerPokemon) => {
|
||||||
if (pokemon.isFusion())
|
if (pokemon.isFusion())
|
||||||
return PartyUiHandler.NoEffectMessage;
|
return PartyUiHandler.NoEffectMessage;
|
||||||
|
|
|
@ -518,7 +518,16 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||||
const speciesForm = this.getSpeciesForm();
|
const speciesForm = this.getSpeciesForm();
|
||||||
|
|
||||||
types.push(speciesForm.type1);
|
types.push(speciesForm.type1);
|
||||||
if (speciesForm.type2 !== null)
|
|
||||||
|
const fusionSpeciesForm = this.getFusionSpeciesForm();
|
||||||
|
if (fusionSpeciesForm) {
|
||||||
|
if (fusionSpeciesForm.type2 !== null && fusionSpeciesForm.type2 !== speciesForm.type1)
|
||||||
|
types.push(fusionSpeciesForm.type2);
|
||||||
|
else if (fusionSpeciesForm.type1 !== speciesForm.type1)
|
||||||
|
types.push(fusionSpeciesForm.type1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (types.length === 1 && speciesForm.type2 !== null)
|
||||||
types.push(speciesForm.type2);
|
types.push(speciesForm.type2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,11 +23,17 @@ export function initGameSpeed() {
|
||||||
return originalAddEvent.apply(this, [ config ]);
|
return originalAddEvent.apply(this, [ config ]);
|
||||||
};
|
};
|
||||||
const originalTweensAdd = this.tweens.add;
|
const originalTweensAdd = this.tweens.add;
|
||||||
this.tweens.add = function (config: Phaser.Types.Tweens.TweenBuilderConfig | object) {
|
this.tweens.add = function (config: Phaser.Types.Tweens.TweenBuilderConfig | Phaser.Types.Tweens.TweenChainBuilderConfig | Phaser.Tweens.Tween | Phaser.Tweens.TweenChain) {
|
||||||
if (config.duration)
|
if (config.duration)
|
||||||
config.duration = transformValue(config.duration);
|
config.duration = transformValue(config.duration);
|
||||||
if (config.delay)
|
if (config.delay)
|
||||||
config.delay = transformValue(config.delay);
|
config.delay = transformValue(config.delay);
|
||||||
|
if (config.repeatDelay)
|
||||||
|
config.repeatDelay = transformValue(config.repeatDelay);
|
||||||
|
if (config.loopDelay)
|
||||||
|
config.loopDelay = transformValue(config.loopDelay);
|
||||||
|
if (config.hold)
|
||||||
|
config.hold = transformValue(config.hold);
|
||||||
return originalTweensAdd.apply(this, [ config ]);
|
return originalTweensAdd.apply(this, [ config ]);
|
||||||
};
|
};
|
||||||
const originalAddCounter = this.tweens.addCounter;
|
const originalAddCounter = this.tweens.addCounter;
|
||||||
|
@ -36,6 +42,12 @@ export function initGameSpeed() {
|
||||||
config.duration = transformValue(config.duration);
|
config.duration = transformValue(config.duration);
|
||||||
if (config.delay)
|
if (config.delay)
|
||||||
config.delay = transformValue(config.delay);
|
config.delay = transformValue(config.delay);
|
||||||
|
if (config.repeatDelay)
|
||||||
|
config.repeatDelay = transformValue(config.repeatDelay);
|
||||||
|
if (config.loopDelay)
|
||||||
|
config.loopDelay = transformValue(config.loopDelay);
|
||||||
|
if (config.hold)
|
||||||
|
config.hold = transformValue(config.hold);
|
||||||
return originalAddCounter.apply(this, [ config ]);
|
return originalAddCounter.apply(this, [ config ]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -380,14 +380,11 @@ export default class SummaryUiHandler extends UiHandler {
|
||||||
this.moveDescriptionText.setY(84);
|
this.moveDescriptionText.setY(84);
|
||||||
this.moveDescriptionScrollTween = this.scene.tweens.add({
|
this.moveDescriptionScrollTween = this.scene.tweens.add({
|
||||||
targets: this.moveDescriptionText,
|
targets: this.moveDescriptionText,
|
||||||
delay: 2000,
|
delay: Utils.fixedInt(2000),
|
||||||
loop: -1,
|
loop: -1,
|
||||||
loopDelay: 2000,
|
hold: Utils.fixedInt(2000),
|
||||||
duration: (moveDescriptionLineCount - 3) * 2000,
|
duration: Utils.fixedInt((moveDescriptionLineCount - 3) * 2000),
|
||||||
y: `-=${14.83 * (moveDescriptionLineCount - 3)}`,
|
y: `-=${14.83 * (moveDescriptionLineCount - 3)}`
|
||||||
onLoop: () => {
|
|
||||||
this.moveDescriptionText.setY(84);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -496,9 +493,10 @@ export default class SummaryUiHandler extends UiHandler {
|
||||||
return typeIcon;
|
return typeIcon;
|
||||||
};
|
};
|
||||||
|
|
||||||
profileContainer.add(getTypeIcon(0, this.pokemon.species.type1));
|
const types = this.pokemon.getTypes(true);
|
||||||
if (this.pokemon.species.type2)
|
profileContainer.add(getTypeIcon(0, types[0]));
|
||||||
profileContainer.add(getTypeIcon(1, this.pokemon.species.type2));
|
if (types.length > 1)
|
||||||
|
profileContainer.add(getTypeIcon(1, types[1]));
|
||||||
|
|
||||||
const ability = this.pokemon.getAbility();
|
const ability = this.pokemon.getAbility();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue