Add reviver seed item (untested)

This commit is contained in:
Flashfyre committed 2023-06-06 08:16:07 -04:00
1 parent 59c63234a5
commit ffa4c60011
6 files changed
+1197 -1136

No files matched your search

+4
View File
@@ -561,6 +561,9 @@ const modifierTypes = {
SACRED_ASH: () => new AllPokemonFullReviveModifierType('SACRED ASH'),
REVIVER_SEED: () => new PokemonHeldItemModifierType('REVIVER SEED', 'Revives the holder for 1/2 HP upon fainting',
(type, args) => new Modifiers.PokemonInstantReviveModifier(type, (args[0] as Pokemon).id)),
ETHER: () => new PokemonPpRestoreModifierType('ETHER', 10),
MAX_ETHER: () => new PokemonPpRestoreModifierType('MAX ETHER', -1),
@@ -723,6 +726,7 @@ const modifierPool = {
new WeightedModifierType(modifierTypes.MAX_LURE, 4),
new WeightedModifierType(modifierTypes.ATTACK_TYPE_BOOSTER, 4),
new WeightedModifierType(modifierTypes.TM_ULTRA, 5),
new WeightedModifierType(modifierTypes.REVIVER_SEED, 3),
new WeightedModifierType(modifierTypes.CANDY_JAR, 3),
new WeightedModifierType(modifierTypes.GRIP_CLAW, 2),
new WeightedModifierType(modifierTypes.HEALING_CHARM, 1),
+26
View File
@@ -666,6 +666,32 @@ export class PreserveBerryModifier extends PersistentModifier {
}
}
export class PokemonInstantReviveModifier extends PokemonHeldItemModifier {
constructor(type: ModifierType, pokemonId: integer, stackCount?: integer) {
super(type, pokemonId, stackCount);
}
matchType(modifier: Modifier) {
return modifier instanceof PokemonInstantReviveModifier;
}
clone() {
return new PokemonInstantReviveModifier(this.type, this.pokemonId, this.stackCount);
}
apply(args: any[]): boolean {
const pokemon = args[0] as Pokemon;
pokemon.scene.unshiftPhase(new PokemonHealPhase(pokemon.scene, pokemon.getBattlerIndex(), Math.max(Math.floor(pokemon.getMaxHp() / 2)), getPokemonMessage(pokemon, ` was revived\nby its ${this.type.name}!`), false));
return true;
}
getMaxStackCount(): integer {
return 10;
}
}
export abstract class ConsumablePokemonModifier extends ConsumableModifier {
public pokemonId: integer;