Implement Embody Aspect abilities

More work toward getting Ogerpon's unique Terastal forms functional. Also fixes the graphics for the Terastal Ogerpon forms, as they were scaled incorrectly.
pull/27/head^2
Madmadness65 2024-04-02 18:03:49 -05:00
parent db960d9a98
commit 08beae9cee
19 changed files with 140 additions and 92 deletions

View File

@ -4,30 +4,30 @@
"image": "1017-cornerstone-mask-tera.png",
"format": "RGBA8888",
"size": {
"w": 144,
"h": 144
"w": 94,
"h": 94
},
"scale": 0.5,
"scale": 0.333,
"frames": [
{
"filename": "0001.png",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 144,
"h": 144
"w": 96,
"h": 96
},
"spriteSourceSize": {
"x": 0,
"x": 1,
"y": 2,
"w": 144,
"h": 140
"w": 94,
"h": 92
},
"frame": {
"x": 0,
"y": 0,
"w": 144,
"h": 140
"w": 94,
"h": 92
}
}
]
@ -36,6 +36,6 @@
"meta": {
"app": "https://www.codeandweb.com/texturepacker",
"version": "3.0",
"smartupdate": "$TexturePacker:SmartUpdate:dcbefd71783ecd9e243d3426e927b845:1f7ab2bf8ba8848c6f73ec7bc9e81921:19983e2c44c76def68513841019a938a$"
"smartupdate": "$TexturePacker:SmartUpdate:7445fc98c3d4d220190fb1c24e70d3ab:1f7ab2bf8ba8848c6f73ec7bc9e81921:19983e2c44c76def68513841019a938a$"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -4,30 +4,30 @@
"image": "1017-hearthflame-mask-tera.png",
"format": "RGBA8888",
"size": {
"w": 144,
"h": 144
"w": 96,
"h": 96
},
"scale": 0.5,
"scale": 0.333,
"frames": [
{
"filename": "0001.png",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 144,
"h": 144
"w": 96,
"h": 96
},
"spriteSourceSize": {
"x": 3,
"y": 0,
"w": 136,
"h": 144
"w": 89,
"h": 96
},
"frame": {
"x": 0,
"y": 0,
"w": 136,
"h": 144
"w": 89,
"h": 96
}
}
]
@ -36,6 +36,6 @@
"meta": {
"app": "https://www.codeandweb.com/texturepacker",
"version": "3.0",
"smartupdate": "$TexturePacker:SmartUpdate:e85adb80edf2c01ef6f95faf83de58ce:c7ed7dc68c465d2334a81deca3c86664:a668acdf23dbfab4355fc0c90e8f5362$"
"smartupdate": "$TexturePacker:SmartUpdate:f9e0b5ff9ac2b57d131d6f27661d1aaa:c7ed7dc68c465d2334a81deca3c86664:a668acdf23dbfab4355fc0c90e8f5362$"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -4,30 +4,30 @@
"image": "1017-teal-mask-tera.png",
"format": "RGBA8888",
"size": {
"w": 144,
"h": 144
"w": 96,
"h": 96
},
"scale": 0.5,
"scale": 0.333,
"frames": [
{
"filename": "0001.png",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 144,
"h": 144
"w": 96,
"h": 96
},
"spriteSourceSize": {
"x": 0,
"x": 1,
"y": 0,
"w": 144,
"h": 144
"w": 94,
"h": 96
},
"frame": {
"x": 0,
"y": 0,
"w": 144,
"h": 144
"w": 94,
"h": 96
}
}
]
@ -36,6 +36,6 @@
"meta": {
"app": "https://www.codeandweb.com/texturepacker",
"version": "3.0",
"smartupdate": "$TexturePacker:SmartUpdate:a84c3152ca2c84a0dccb8d85180893c0:c65956e68f88f806b48f40f2e2b3aefc:9f6debc3cc730be60b9cc5260e70873a$"
"smartupdate": "$TexturePacker:SmartUpdate:d3820bf4209f076190e819598a6ec8d7:c65956e68f88f806b48f40f2e2b3aefc:9f6debc3cc730be60b9cc5260e70873a$"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -4,30 +4,30 @@
"image": "1017-wellspring-mask-tera.png",
"format": "RGBA8888",
"size": {
"w": 144,
"h": 144
"w": 96,
"h": 96
},
"scale": 0.5,
"scale": 0.333,
"frames": [
{
"filename": "0001.png",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 144,
"h": 144
"w": 96,
"h": 96
},
"spriteSourceSize": {
"x": 0,
"y": 8,
"w": 144,
"h": 130
"y": 6,
"w": 96,
"h": 85
},
"frame": {
"x": 0,
"y": 0,
"w": 144,
"h": 130
"w": 96,
"h": 85
}
}
]
@ -36,6 +36,6 @@
"meta": {
"app": "https://www.codeandweb.com/texturepacker",
"version": "3.0",
"smartupdate": "$TexturePacker:SmartUpdate:5d527aed445f4210bf0f76a29b0718ef:b9a6688aea29bea33c6b1b518f1da693:f4f8b58743ad897a5774e4ca3d3eff03$"
"smartupdate": "$TexturePacker:SmartUpdate:689ff4514c071d220bf0457da26850d5:b9a6688aea29bea33c6b1b518f1da693:f4f8b58743ad897a5774e4ca3d3eff03$"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -4,30 +4,30 @@
"image": "1017-cornerstone-mask-tera.png",
"format": "RGBA8888",
"size": {
"w": 144,
"h": 144
"w": 94,
"h": 94
},
"scale": 0.5,
"scale": 0.333,
"frames": [
{
"filename": "0001.png",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 144,
"h": 144
"w": 96,
"h": 96
},
"spriteSourceSize": {
"x": 0,
"x": 1,
"y": 2,
"w": 144,
"h": 140
"w": 94,
"h": 92
},
"frame": {
"x": 0,
"y": 0,
"w": 144,
"h": 140
"w": 94,
"h": 92
}
}
]
@ -36,6 +36,6 @@
"meta": {
"app": "https://www.codeandweb.com/texturepacker",
"version": "3.0",
"smartupdate": "$TexturePacker:SmartUpdate:2c54519746e1aca46c247179ac5bef04:c40781d9ba7317d9195c41c46a2b386c:19983e2c44c76def68513841019a938a$"
"smartupdate": "$TexturePacker:SmartUpdate:33c1ac8f12234ff41459d7738281c92f:c40781d9ba7317d9195c41c46a2b386c:19983e2c44c76def68513841019a938a$"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -4,30 +4,30 @@
"image": "1017-hearthflame-mask-tera.png",
"format": "RGBA8888",
"size": {
"w": 144,
"h": 144
"w": 96,
"h": 96
},
"scale": 0.5,
"scale": 0.333,
"frames": [
{
"filename": "0001.png",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 144,
"h": 144
"w": 96,
"h": 96
},
"spriteSourceSize": {
"x": 3,
"y": 0,
"w": 136,
"h": 144
"w": 89,
"h": 96
},
"frame": {
"x": 0,
"y": 0,
"w": 136,
"h": 144
"w": 89,
"h": 96
}
}
]
@ -36,6 +36,6 @@
"meta": {
"app": "https://www.codeandweb.com/texturepacker",
"version": "3.0",
"smartupdate": "$TexturePacker:SmartUpdate:8b38cc19c7295a495d9e91ae10718e62:75bb98cbf7a7074508abbada1dbfc94c:a668acdf23dbfab4355fc0c90e8f5362$"
"smartupdate": "$TexturePacker:SmartUpdate:84ef49fd74c1e18eea1fbf1ccbdf3667:75bb98cbf7a7074508abbada1dbfc94c:a668acdf23dbfab4355fc0c90e8f5362$"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -4,30 +4,30 @@
"image": "1017-teal-mask-tera.png",
"format": "RGBA8888",
"size": {
"w": 144,
"h": 144
"w": 96,
"h": 96
},
"scale": 0.5,
"scale": 0.333,
"frames": [
{
"filename": "0001.png",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 144,
"h": 144
"w": 96,
"h": 96
},
"spriteSourceSize": {
"x": 0,
"x": 1,
"y": 0,
"w": 144,
"h": 144
"w": 94,
"h": 96
},
"frame": {
"x": 0,
"y": 0,
"w": 144,
"h": 144
"w": 94,
"h": 96
}
}
]
@ -36,6 +36,6 @@
"meta": {
"app": "https://www.codeandweb.com/texturepacker",
"version": "3.0",
"smartupdate": "$TexturePacker:SmartUpdate:5395c9c1661c7d728723b2c2a457aa66:b5288f0e4ffc7614f30c6b606d36647b:9f6debc3cc730be60b9cc5260e70873a$"
"smartupdate": "$TexturePacker:SmartUpdate:46c5307225fee0ace2c1e637ebc20c5b:b5288f0e4ffc7614f30c6b606d36647b:9f6debc3cc730be60b9cc5260e70873a$"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -4,30 +4,30 @@
"image": "1017-wellspring-mask-tera.png",
"format": "RGBA8888",
"size": {
"w": 144,
"h": 144
"w": 96,
"h": 96
},
"scale": 0.5,
"scale": 0.333,
"frames": [
{
"filename": "0001.png",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 144,
"h": 144
"w": 96,
"h": 96
},
"spriteSourceSize": {
"x": 0,
"y": 8,
"w": 144,
"h": 130
"y": 6,
"w": 96,
"h": 85
},
"frame": {
"x": 0,
"y": 0,
"w": 144,
"h": 130
"w": 96,
"h": 85
}
}
]
@ -36,6 +36,6 @@
"meta": {
"app": "https://www.codeandweb.com/texturepacker",
"version": "3.0",
"smartupdate": "$TexturePacker:SmartUpdate:a1bf5253f2d6ae6d8c33f2be9d591228:12d1e5242ab1c5174bbe31202f0e13e8:f4f8b58743ad897a5774e4ca3d3eff03$"
"smartupdate": "$TexturePacker:SmartUpdate:2cd8c5adc90abae707acf2863021a2ef:12d1e5242ab1c5174bbe31202f0e13e8:f4f8b58743ad897a5774e4ca3d3eff03$"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -155,6 +155,42 @@ export class PostBattleInitFormChangeAbAttr extends PostBattleInitAbAttr {
}
}
export class PostBattleInitStatChangeAbAttr extends PostBattleInitAbAttr {
private stats: BattleStat[];
private levels: integer;
private selfTarget: boolean;
constructor(stats: BattleStat | BattleStat[], levels: integer, selfTarget?: boolean) {
super();
this.stats = typeof(stats) === 'number'
? [ stats as BattleStat ]
: stats as BattleStat[];
this.levels = levels;
this.selfTarget = !!selfTarget;
}
applyPostBattleInit(pokemon: Pokemon, args: any[]): boolean {
const statChangePhases: StatChangePhase[] = [];
if (this.selfTarget)
statChangePhases.push(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, this.stats, this.levels));
else {
for (let opponent of pokemon.getOpponents())
statChangePhases.push(new StatChangePhase(pokemon.scene, opponent.getBattlerIndex(), false, this.stats, this.levels));
}
for (let statChangePhase of statChangePhases) {
if (!this.selfTarget && !statChangePhase.getPokemon().summonData)
pokemon.scene.pushPhase(statChangePhase); // TODO: This causes the ability bar to be shown at the wrong time
else
pokemon.scene.unshiftPhase(statChangePhase);
}
return true;
}
}
type PreDefendAbAttrCondition = (pokemon: Pokemon, attacker: Pokemon, move: PokemonMove) => boolean;
export class PreDefendAbAttr extends AbAttr {
@ -2605,10 +2641,14 @@ export function initAbilities() {
new Ability(Abilities.SUPERSWEET_SYRUP, "Supersweet Syrup (N)", "A sickly sweet scent spreads across the field the first time the Pokémon enters a battle, lowering the evasiveness of opposing Pokémon.", 9),
new Ability(Abilities.HOSPITALITY, "Hospitality (N)", "When the Pokémon enters a battle, it showers its ally with hospitality, restoring a small amount of the ally's HP.", 9),
new Ability(Abilities.TOXIC_CHAIN, "Toxic Chain (N)", "The power of the Pokémon's toxic chain may badly poison any target the Pokémon hits with a move.", 9),
new Ability(Abilities.EMBODY_ASPECT_TEAL, "Embody Aspect (N)", "The Pokémon's heart fills with memories, causing the Teal Mask to shine and the Pokémon's Speed stat to be boosted.", 9),
new Ability(Abilities.EMBODY_ASPECT_WELLSPRING, "Embody Aspect (N)", "The Pokémon's heart fills with memories, causing the Wellspring Mask to shine and the Pokémon's Sp. Def stat to be boosted.", 9),
new Ability(Abilities.EMBODY_ASPECT_HEARTHFLAME, "Embody Aspect (N)", "The Pokémon's heart fills with memories, causing the Hearthflame Mask to shine and the Pokémon's Attack stat to be boosted.", 9),
new Ability(Abilities.EMBODY_ASPECT_CORNERSTONE, "Embody Aspect (N)", "The Pokémon's heart fills with memories, causing the Cornerstone Mask to shine and the Pokémon's Defense stat to be boosted.", 9),
new Ability(Abilities.EMBODY_ASPECT_TEAL, "Embody Aspect", "The Pokémon's heart fills with memories, causing the Teal Mask to shine and the Pokémon's Speed stat to be boosted.", 9)
.attr(PostBattleInitStatChangeAbAttr, BattleStat.SPD, 1, true),
new Ability(Abilities.EMBODY_ASPECT_WELLSPRING, "Embody Aspect", "The Pokémon's heart fills with memories, causing the Wellspring Mask to shine and the Pokémon's Sp. Def stat to be boosted.", 9)
.attr(PostBattleInitStatChangeAbAttr, BattleStat.SPDEF, 1, true),
new Ability(Abilities.EMBODY_ASPECT_HEARTHFLAME, "Embody Aspect", "The Pokémon's heart fills with memories, causing the Hearthflame Mask to shine and the Pokémon's Attack stat to be boosted.", 9)
.attr(PostBattleInitStatChangeAbAttr, BattleStat.ATK, 1, true),
new Ability(Abilities.EMBODY_ASPECT_CORNERSTONE, "Embody Aspect", "The Pokémon's heart fills with memories, causing the Cornerstone Mask to shine and the Pokémon's Defense stat to be boosted.", 9)
.attr(PostBattleInitStatChangeAbAttr, BattleStat.DEF, 1, true),
new Ability(Abilities.TERA_SHIFT, "Tera Shift", "When the Pokémon enters a battle, it absorbs the energy around itself and transforms into its Terastal Form.", 9)
.attr(PostSummonFormChangeAbAttr, p => p.getFormKey() ? 0 : 1),
new Ability(Abilities.TERA_SHELL, "Tera Shell (N)", "The Pokémon's shell contains the powers of each type. All damage-dealing moves that hit the Pokémon when its HP is full will not be very effective.", 9)

View File

@ -637,7 +637,15 @@ export const pokemonFormChanges: PokemonFormChanges = {
[Species.OGERPON]: [
new SpeciesFormChange(Species.OGERPON, 'teal-mask', 'wellspring-mask', new SpeciesFormChangeItemTrigger(FormChangeItem.WELLSPRING_MASK)),
new SpeciesFormChange(Species.OGERPON, 'teal-mask', 'hearthflame-mask', new SpeciesFormChangeItemTrigger(FormChangeItem.HEARTHFLAME_MASK)),
new SpeciesFormChange(Species.OGERPON, 'teal-mask', 'cornerstone-mask', new SpeciesFormChangeItemTrigger(FormChangeItem.CORNERSTONE_MASK))
new SpeciesFormChange(Species.OGERPON, 'teal-mask', 'cornerstone-mask', new SpeciesFormChangeItemTrigger(FormChangeItem.CORNERSTONE_MASK)),
new SpeciesFormChange(Species.OGERPON, 'teal-mask', 'teal-mask-tera', new SpeciesFormChangeManualTrigger(), true), //When holding a Grass Tera Shard
new SpeciesFormChange(Species.OGERPON, 'teal-mask-tera', 'teal-mask', new SpeciesFormChangeManualTrigger(), true), //When no longer holding a Grass Tera Shard
new SpeciesFormChange(Species.OGERPON, 'wellspring-mask', 'wellspring-mask-tera', new SpeciesFormChangeManualTrigger(), true), //When holding a Water Tera Shard
new SpeciesFormChange(Species.OGERPON, 'wellspring-mask-tera', 'wellspring-mask', new SpeciesFormChangeManualTrigger(), true), //When no longer holding a Water Tera Shard
new SpeciesFormChange(Species.OGERPON, 'hearthflame-mask', 'hearthflame-mask-tera', new SpeciesFormChangeManualTrigger(), true), //When holding a Fire Tera Shard
new SpeciesFormChange(Species.OGERPON, 'hearthflame-mask-tera', 'hearthflame-mask', new SpeciesFormChangeManualTrigger(), true), //When no longer holding a Fire Tera Shard
new SpeciesFormChange(Species.OGERPON, 'cornerstone-mask', 'cornerstone-mask-tera', new SpeciesFormChangeManualTrigger(), true), //When holding a Rock Tera Shard
new SpeciesFormChange(Species.OGERPON, 'cornerstone-mask-tera', 'cornerstone-mask', new SpeciesFormChangeManualTrigger(), true) //When no longer holding a Rock Tera Shard
],
[Species.TERAPAGOS]: [
new SpeciesFormChange(Species.TERAPAGOS, '', 'terastal', new SpeciesFormChangeManualTrigger(), true)