Skip to content

Commit

Permalink
new psystrike ability (#1621)
Browse files Browse the repository at this point in the history
  • Loading branch information
keldaan-ag authored Apr 3, 2024
1 parent 199fb3e commit 509ea41
Show file tree
Hide file tree
Showing 18 changed files with 93 additions and 20 deletions.
56 changes: 54 additions & 2 deletions app/core/abilities/abilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7913,7 +7913,7 @@ export class PollenPuffStrategy extends AbilityStrategy {
board.cells.filter(
(cell) => cell && cell.team === pokemon.team
) as PokemonEntity[]
).sort((a, b) => a.life - b.life)[0]
).sort((a, b) => a.life - b.life)[0]

if (lowestHealthAlly) {
lowestHealthAlly.handleHeal(
Expand All @@ -7933,6 +7933,57 @@ export class PollenPuffStrategy extends AbilityStrategy {
}
}

export class PsystrikeStrategy extends AbilityStrategy {
process(
pokemon: PokemonEntity,
state: PokemonState,
board: Board,
target: PokemonEntity,
crit: boolean
) {
super.process(pokemon, state, board, target, crit, true)
const furthestTarget = state.getFarthestTarget(pokemon, board)
if (furthestTarget) {
pokemon.simulation.room.broadcast(Transfer.ABILITY, {
id: pokemon.simulation.id,
skill: Ability.PSYSTRIKE,
positionX: pokemon.positionX,
positionY: pokemon.positionY,
targetX: furthestTarget.positionX,
targetY: furthestTarget.positionY
})

const cells = board.getCellsBetween(
pokemon.positionX,
pokemon.positionY,
furthestTarget.positionX,
furthestTarget.positionY
)
cells.forEach((cell) => {
if (cell.value && cell.value.team != pokemon.team) {
cell.value.handleSpecialDamage(
100,
board,
AttackType.PHYSICAL,
pokemon,
crit
)

const teleportationCell = board.getTeleportationCell(
cell.value.positionX,
cell.value.positionY
)
if (teleportationCell) {
cell.value.moveTo(teleportationCell.x, teleportationCell.y, board)
} else {
logger.error("unable to teleport pokemon", cell.value)
}
}
})
}
}
}

export * from "./hidden-power"

export const AbilityStrategies: { [key in Ability]: AbilityStrategy } = {
Expand Down Expand Up @@ -8236,5 +8287,6 @@ export const AbilityStrategies: { [key in Ability]: AbilityStrategy } = {
[Ability.ZAP_CANNON]: new ZapCannonStrategy(),
[Ability.EXTREME_SPEED]: new ExtremeSpeedStrategy(),
[Ability.ICE_HAMMER]: new IceHammerStrategy(),
[Ability.POLLEN_PUFF]: new PollenPuffStrategy()
[Ability.POLLEN_PUFF]: new PollenPuffStrategy(),
[Ability.PSYSTRIKE]: new PsystrikeStrategy()
}
2 changes: 1 addition & 1 deletion app/models/colyseus-models/pokemon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5677,7 +5677,7 @@ export class Mewtwo extends Pokemon {
speDef = 5
maxPP = 110
range = 3
skill = Ability.DYNAMAX_CANNON
skill = Ability.PSYSTRIKE
attackSprite = AttackSprite.PSYCHIC_RANGE
}

Expand Down
2 changes: 1 addition & 1 deletion app/models/precomputed/pokemons-data.csv
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ Index,Name,Category,Tier,Additional pick,Type 1,Type 2,Type 3,Type 4,HP,Attack,D
0147,DRATINI,RARE,1,false,DRAGON,AQUATIC,FLYING,,80,5,4,4,1,110,DRAGON_BREATH,DRATINI,DRAGON,AQUATIC,FLYING,,false
0148,DRAGONAIR,RARE,2,false,DRAGON,AQUATIC,FLYING,,120,13,5,5,1,110,DRAGON_BREATH,DRATINI,DRAGON,AQUATIC,FLYING,,false
0149,DRAGONITE,RARE,3,false,DRAGON,AQUATIC,FLYING,,250,23,6,6,1,110,DRAGON_BREATH,DRATINI,DRAGON,AQUATIC,FLYING,,false
0150,MEWTWO,LEGENDARY,3,false,PSYCHIC,MONSTER,ARTIFICIAL,,200,30,2,5,3,110,DYNAMAX_CANNON,MEWTWO,PSYCHIC,MONSTER,ARTIFICIAL,,false
0150,MEWTWO,LEGENDARY,3,false,PSYCHIC,MONSTER,ARTIFICIAL,,200,30,2,5,3,110,PSYSTRIKE,MEWTWO,PSYCHIC,MONSTER,ARTIFICIAL,,false
0151,MEW,UNIQUE,3,false,WILD,PSYCHIC,,,200,16,2,2,4,80,TELEPORT,MEW,WILD,PSYCHIC,,,false
0152,CHIKORITA,UNCOMMON,1,false,GRASS,FLORA,,,70,6,1,1,2,90,STUN_SPORE,CHIKORITA,GRASS,FLORA,,,false
0153,BAYLEEF,UNCOMMON,2,false,GRASS,FLORA,,,140,12,1,1,2,90,STUN_SPORE,CHIKORITA,GRASS,FLORA,,,false
Expand Down
2 changes: 1 addition & 1 deletion app/models/precomputed/pokemons-data.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/models/precomputed/pokemons-per-ability.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion app/public/dist/client/changelog/patch-5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
- Unown B (BURN): PP ~~30~~ 60
- Unown F (FISH): fish ~~2~~ 3 pokemons
- Unown S (STOP): freeze duration ~~4~~ 2 seconds
- New ability for Magnemite : Zap Cannon (The caster fires an electric blast like a cannon to inflict [25,50,100,SP] SPECIAL and cause PARALYSIS and ARMOR_REDUCTION for [1,2,4] s)
- New ability for Magnemite: Zap Cannon
- New ability for Mewtwo: Psystrike

# Changes to Synergies

Expand Down
2 changes: 1 addition & 1 deletion app/public/dist/client/esbuild.meta.json

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions app/public/dist/client/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,8 @@
"ZAP_CANNON": "Zap Cannon",
"PSYCHO_BOOST": "Psycho Boost",
"ICE_HAMMER": "Ice Hammer",
"POLLEN_PUFF": "Pollen Puff"
"POLLEN_PUFF": "Pollen Puff",
"PSYSTRIKE": "Psystrike"
},
"pkm": {
"DEFAULT": "MissingNo.",
Expand Down Expand Up @@ -1368,7 +1369,7 @@
"ZAP_CANNON": "The caster fires an electric blast like a cannon to inflict [25,50,100,SP] SPECIAL and cause PARALYSIS and ARMOR_REDUCTION for [1,2,4] s",
"PSYCHO_BOOST": "Cut a slash horizontally around the target, dealing [140,SP] SPECIAL to all ennemies hit. Reduce the caster AP by 20 for each Pokémon hit",
"ICE_HAMMER": "Deals [50,100] SPECIAL to the target, causing it to FREEZE for 3s. PARALYSIS the caster for 3s",
"POLLEN_PUFF": "Give the lowest health ally a pollen puff that restores [20,40,80] HP"
"PSYSTRIKE": "The caster materializes a strange psychic wave towards the furthest enemy, inflicting [100,SP] PHYSICAL damage and teleporting everything in its path."
},
"effect": {
"INGRAIN": "Ingrain",
Expand Down
2 changes: 1 addition & 1 deletion app/public/dist/client/sw.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* Change this cache name every time you want to force players
to invalidate their cache and download all assets again */

const CACHE_NAME = "CACHE v4.9.0.107"
const CACHE_NAME = "CACHE v5.0.0.109"

// Cache-first strategy
const cacheFirst = (event) => {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/public/src/assets/atlas.json

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions app/public/src/game/components/abilities-animations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,24 @@ export function displayAbility(
break
}

case Ability.PSYSTRIKE: {
const specialProjectile = addAbilitySprite(
Ability.PSYSTRIKE,
coordinates
).setScale(2)
scene.tweens.add({
targets: specialProjectile,
x: coordinatesTarget[0],
y: coordinatesTarget[1],
ease: "linear",
duration: 1000,
onComplete: () => {
specialProjectile.destroy()
}
})
break
}

case Ability.EGGSPLOSION: {
const specialProjectile = addAbilitySprite(skill, coordinates).setScale(3)
scene.tweens.add({
Expand Down
3 changes: 2 additions & 1 deletion app/types/enum/Ability.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,5 +299,6 @@ export enum Ability {
ZAP_CANNON = "ZAP_CANNON",
EXTREME_SPEED = "EXTREME_SPEED",
ICE_HAMMER = "ICE_HAMMER",
POLLEN_PUFF = "POLLEN_PUFF"
POLLEN_PUFF = "POLLEN_PUFF",
PSYSTRIKE = "PSYSTRIKE"
}
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "pokemon-auto-chess",
"version": "4.9.0",
"version": "5.0.0",
"description": "",
"keywords": [],
"license": "BSD-3-Clause",
"engines": {
"node": "20.11.0",
"npm": "10.2.5"
"node": "20.12.0",
"npm": "10.5.0"
},
"homepage": "https://github.com/keldaanCommunity/pokemonAutoChess#readme",
"repository": {
Expand Down

0 comments on commit 509ea41

Please sign in to comment.