Add spliced type sharing and fix move description scrolling

This commit is contained in:
Flashfyre 2023-12-01 10:07:21 -05:00
parent f3ed8e925e
commit b2d7895c7b
4 changed files with 32 additions and 13 deletions

View File

@ -453,7 +453,7 @@ export class EvolutionItemModifierType extends PokemonModifierType implements Ge
export class FusePokemonModifierType extends PokemonModifierType {
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) => {
if (pokemon.isFusion())
return PartyUiHandler.NoEffectMessage;

View File

@ -518,7 +518,16 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
const speciesForm = this.getSpeciesForm();
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);
}

View File

@ -23,11 +23,17 @@ export function initGameSpeed() {
return originalAddEvent.apply(this, [ config ]);
};
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)
config.duration = transformValue(config.duration);
if (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 ]);
};
const originalAddCounter = this.tweens.addCounter;
@ -36,6 +42,12 @@ export function initGameSpeed() {
config.duration = transformValue(config.duration);
if (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 ]);
};

View File

@ -380,14 +380,11 @@ export default class SummaryUiHandler extends UiHandler {
this.moveDescriptionText.setY(84);
this.moveDescriptionScrollTween = this.scene.tweens.add({
targets: this.moveDescriptionText,
delay: 2000,
delay: Utils.fixedInt(2000),
loop: -1,
loopDelay: 2000,
duration: (moveDescriptionLineCount - 3) * 2000,
y: `-=${14.83 * (moveDescriptionLineCount - 3)}`,
onLoop: () => {
this.moveDescriptionText.setY(84);
}
hold: Utils.fixedInt(2000),
duration: Utils.fixedInt((moveDescriptionLineCount - 3) * 2000),
y: `-=${14.83 * (moveDescriptionLineCount - 3)}`
});
}
}
@ -496,9 +493,10 @@ export default class SummaryUiHandler extends UiHandler {
return typeIcon;
};
profileContainer.add(getTypeIcon(0, this.pokemon.species.type1));
if (this.pokemon.species.type2)
profileContainer.add(getTypeIcon(1, this.pokemon.species.type2));
const types = this.pokemon.getTypes(true);
profileContainer.add(getTypeIcon(0, types[0]));
if (types.length > 1)
profileContainer.add(getTypeIcon(1, types[1]));
const ability = this.pokemon.getAbility();