mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-04 15:32:18 +02:00
Implemented Disguise
Somehow it works.
This commit is contained in:
parent
b116828b07
commit
7a6307d200
BIN
public/images/pokemon/icons/778-busted.png
Normal file
BIN
public/images/pokemon/icons/778-busted.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 283 B |
BIN
public/images/pokemon/icons/778s-busted.png
Normal file
BIN
public/images/pokemon/icons/778s-busted.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 333 B |
@ -4923,6 +4923,48 @@
|
|||||||
"h": 22
|
"h": 22
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"filename": "778-busted",
|
||||||
|
"rotated": false,
|
||||||
|
"trimmed": true,
|
||||||
|
"sourceSize": {
|
||||||
|
"w": 40,
|
||||||
|
"h": 30
|
||||||
|
},
|
||||||
|
"spriteSourceSize": {
|
||||||
|
"x": 13,
|
||||||
|
"y": 5,
|
||||||
|
"w": 17,
|
||||||
|
"h": 22
|
||||||
|
},
|
||||||
|
"frame": {
|
||||||
|
"x": 156,
|
||||||
|
"y": 443,
|
||||||
|
"w": 17,
|
||||||
|
"h": 22
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename": "778s-busted",
|
||||||
|
"rotated": false,
|
||||||
|
"trimmed": true,
|
||||||
|
"sourceSize": {
|
||||||
|
"w": 40,
|
||||||
|
"h": 30
|
||||||
|
},
|
||||||
|
"spriteSourceSize": {
|
||||||
|
"x": 13,
|
||||||
|
"y": 5,
|
||||||
|
"w": 17,
|
||||||
|
"h": 22
|
||||||
|
},
|
||||||
|
"frame": {
|
||||||
|
"x": 217,
|
||||||
|
"y": 367,
|
||||||
|
"w": 17,
|
||||||
|
"h": 22
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"filename": "741s-pompom",
|
"filename": "741s-pompom",
|
||||||
"rotated": false,
|
"rotated": false,
|
||||||
|
@ -235,7 +235,7 @@ export class StabBoostAbAttr extends AbAttr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class ReceivedMoveDamageMultiplierAbAttr extends PreDefendAbAttr {
|
export class ReceivedMoveDamageMultiplierAbAttr extends PreDefendAbAttr {
|
||||||
private condition: PokemonDefendCondition;
|
protected condition: PokemonDefendCondition;
|
||||||
private powerMultiplier: number;
|
private powerMultiplier: number;
|
||||||
|
|
||||||
constructor(condition: PokemonDefendCondition, powerMultiplier: number) {
|
constructor(condition: PokemonDefendCondition, powerMultiplier: number) {
|
||||||
@ -261,6 +261,21 @@ export class ReceivedTypeDamageMultiplierAbAttr extends ReceivedMoveDamageMultip
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class SetMovePowerToOneAbAttr extends ReceivedMoveDamageMultiplierAbAttr {
|
||||||
|
constructor(condition: PokemonDefendCondition) {
|
||||||
|
super(condition, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
applyPreDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, cancelled: Utils.BooleanHolder, args: any[]): boolean {
|
||||||
|
if (this.condition(pokemon, attacker, move.getMove())) {
|
||||||
|
(args[0] as Utils.NumberHolder).value = 0.001;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export class TypeImmunityAbAttr extends PreDefendAbAttr {
|
export class TypeImmunityAbAttr extends PreDefendAbAttr {
|
||||||
private immuneType: Type;
|
private immuneType: Type;
|
||||||
private condition: AbAttrCondition;
|
private condition: AbAttrCondition;
|
||||||
@ -386,6 +401,26 @@ export class PostDefendAbAttr extends AbAttr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class PostDefendDisguiseAbAttr extends PostDefendAbAttr {
|
||||||
|
|
||||||
|
constructor(damageRatio?: number) {
|
||||||
|
super(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean {
|
||||||
|
if (pokemon.formIndex == 0 && pokemon.battleData.hitCount != 0 && (move.getMove().category == MoveCategory.SPECIAL || move.getMove().category == MoveCategory.PHYSICAL)) {
|
||||||
|
const recoilDamage = Math.ceil((pokemon.getMaxHp() / 8) - attacker.turnData.damageDealt);
|
||||||
|
if (!recoilDamage)
|
||||||
|
return false;
|
||||||
|
pokemon.damageAndUpdate(recoilDamage, HitResult.OTHER);
|
||||||
|
pokemon.scene.queueMessage(getPokemonMessage(pokemon, '\'s disguise was busted!'));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export class FieldPriorityMoveImmunityAbAttr extends PreDefendAbAttr {
|
export class FieldPriorityMoveImmunityAbAttr extends PreDefendAbAttr {
|
||||||
applyPreDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, cancelled: Utils.BooleanHolder, args: any[]): boolean {
|
applyPreDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, cancelled: Utils.BooleanHolder, args: any[]): boolean {
|
||||||
const attackPriority = new Utils.IntegerHolder(move.getMove().priority);
|
const attackPriority = new Utils.IntegerHolder(move.getMove().priority);
|
||||||
@ -2669,7 +2704,10 @@ export function initAbilities() {
|
|||||||
.attr(UncopiableAbilityAbAttr)
|
.attr(UncopiableAbilityAbAttr)
|
||||||
.attr(UnswappableAbilityAbAttr)
|
.attr(UnswappableAbilityAbAttr)
|
||||||
.attr(UnsuppressableAbilityAbAttr),
|
.attr(UnsuppressableAbilityAbAttr),
|
||||||
new Ability(Abilities.DISGUISE, "Disguise (N)", "Once per battle, the shroud that covers the Pokémon can protect it from an attack.", 7)
|
new Ability(Abilities.DISGUISE, "Disguise (T)", "Once per battle, the shroud that covers the Pokémon can protect it from an attack.", 7)
|
||||||
|
.attr(SetMovePowerToOneAbAttr, (target, user, move) => target.formIndex == 0)
|
||||||
|
.attr(PostTurnFormChangeAbAttr, pokemon => pokemon.battleData.hitCount === 0 ? 0 : 1)
|
||||||
|
.attr(PostDefendDisguiseAbAttr)
|
||||||
.attr(UncopiableAbilityAbAttr)
|
.attr(UncopiableAbilityAbAttr)
|
||||||
.attr(UnswappableAbilityAbAttr)
|
.attr(UnswappableAbilityAbAttr)
|
||||||
.attr(UnsuppressableAbilityAbAttr)
|
.attr(UnsuppressableAbilityAbAttr)
|
||||||
|
@ -565,6 +565,10 @@ export const pokemonFormChanges: PokemonFormChanges = {
|
|||||||
new SpeciesFormChange(Species.MINIOR, 'violet-meteor', 'violet', new SpeciesFormChangeManualTrigger(), true),
|
new SpeciesFormChange(Species.MINIOR, 'violet-meteor', 'violet', new SpeciesFormChangeManualTrigger(), true),
|
||||||
new SpeciesFormChange(Species.MINIOR, 'violet', 'violet-meteor', new SpeciesFormChangeManualTrigger(), true)
|
new SpeciesFormChange(Species.MINIOR, 'violet', 'violet-meteor', new SpeciesFormChangeManualTrigger(), true)
|
||||||
],
|
],
|
||||||
|
[Species.MIMIKYU]: [
|
||||||
|
new SpeciesFormChange(Species.MIMIKYU, 'disguised', 'busted', new SpeciesFormChangeManualTrigger(), true),
|
||||||
|
new SpeciesFormChange(Species.MIMIKYU, 'busted', 'disquised', new SpeciesFormChangeManualTrigger(), true)
|
||||||
|
],
|
||||||
[Species.NECROZMA]: [
|
[Species.NECROZMA]: [
|
||||||
new SpeciesFormChange(Species.NECROZMA, '', 'dawn-wings', new SpeciesFormChangeItemTrigger(FormChangeItem.N_LUNARIZER)),
|
new SpeciesFormChange(Species.NECROZMA, '', 'dawn-wings', new SpeciesFormChangeItemTrigger(FormChangeItem.N_LUNARIZER)),
|
||||||
new SpeciesFormChange(Species.NECROZMA, '', 'dusk-mane', new SpeciesFormChangeItemTrigger(FormChangeItem.N_SOLARIZER))
|
new SpeciesFormChange(Species.NECROZMA, '', 'dusk-mane', new SpeciesFormChangeItemTrigger(FormChangeItem.N_SOLARIZER))
|
||||||
|
Loading…
Reference in New Issue
Block a user