Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add deino/zweilous/hydreigon line #1712

Merged
merged 2 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 35 additions & 7 deletions app/core/abilities/abilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5727,15 +5727,17 @@ export class MagnetRiseStrategy extends AbilityStrategy {
) {
super.process(pokemon, state, board, target, crit, true)
const nbAlliesBuffed = [2, 4, 6][pokemon.stars - 1] ?? 6
const alliesBuffed = (board
.getAdjacentCells(pokemon.positionX, pokemon.positionY)
.map(cell => cell.value)
.filter((mon) => mon && mon.team === pokemon.team) as PokemonEntity[])
const alliesBuffed = (
board
.getAdjacentCells(pokemon.positionX, pokemon.positionY)
.map((cell) => cell.value)
.filter((mon) => mon && mon.team === pokemon.team) as PokemonEntity[]
)
.sort((a, b) => a.life - b.life)
.slice(0, nbAlliesBuffed)
.slice(0, nbAlliesBuffed)

alliesBuffed.push(pokemon)
alliesBuffed.forEach(ally => {
alliesBuffed.forEach((ally) => {
ally.status.triggerProtect(2000)
ally.addDodgeChance(0.1, true)
pokemon.simulation.room.broadcast(Transfer.ABILITY, {
Expand Down Expand Up @@ -8515,6 +8517,31 @@ export class PowerWhipStrategy extends AbilityStrategy {
}
}

export class DarkHarvestStrategy extends AbilityStrategy {
process(
pokemon: PokemonEntity,
state: PokemonState,
board: Board,
target: PokemonEntity,
crit: boolean
) {
super.process(pokemon, state, board, target, crit, true)

const mostSurroundedCoordinate =
state.getMostSurroundedCoordinateAvailablePlace(pokemon, board)

if (mostSurroundedCoordinate) {
pokemon.moveTo(
mostSurroundedCoordinate.x,
mostSurroundedCoordinate.y,
board
)
pokemon.status.triggerDarkHarvest(3200)
pokemon.status.triggerSilence(3000, pokemon, pokemon)
}
}
}

export * from "./hidden-power"

export const AbilityStrategies: { [key in Ability]: AbilityStrategy } = {
Expand Down Expand Up @@ -8834,5 +8861,6 @@ export const AbilityStrategies: { [key in Ability]: AbilityStrategy } = {
[Ability.PSYSHIELD_BASH]: new PsyshieldBashStrategy(),
[Ability.QUIVER_DANCE]: new QuiverDanceStrategy(),
[Ability.TORCH_SONG]: new TorchSongStrategy(),
[Ability.POWER_WHIP]: new PowerWhipStrategy()
[Ability.POWER_WHIP]: new PowerWhipStrategy(),
[Ability.DARK_HARVEST]: new DarkHarvestStrategy()
}
39 changes: 21 additions & 18 deletions app/models/colyseus-models/pokemon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1738,42 +1738,45 @@ export class Deino extends Pokemon {
stars = 1
evolution = Pkm.ZWEILOUS
hp = 80
atk = 5
def = 1
speDef = 1
maxPP = 100
atk = 6
def = 2
speDef = 2
maxPP = 50
range = 2
skill = Ability.DEFAULT
attackSprite = AttackSprite.FIRE_RANGE
skill = Ability.DARK_HARVEST
attackSprite = AttackSprite.DARK_RANGE
regional = true
}

export class Zweilous extends Pokemon {
types = new SetSchema<Synergy>([Synergy.DARK, Synergy.DRAGON])
rarity = Rarity.RARE
stars = 2
evolution = Pkm.HYDREIGON
hp = 120
atk = 9
def = 1
speDef = 1
hp = 130
atk = 12
def = 3
speDef = 3
maxPP = 100
range = 2
skill = Ability.DEFAULT
attackSprite = AttackSprite.FIRE_RANGE
skill = Ability.DARK_HARVEST
attackSprite = AttackSprite.DARK_RANGE
regional = true
}

export class Hydreigon extends Pokemon {
types = new SetSchema<Synergy>([Synergy.DARK, Synergy.DRAGON])
rarity = Rarity.RARE
stars = 3
hp = 220
atk = 18
def = 1
speDef = 1
hp = 230
atk = 22
def = 4
speDef = 4
maxPP = 100
range = 2
skill = Ability.DEFAULT
attackSprite = AttackSprite.FIRE_RANGE
skill = Ability.DARK_HARVEST
attackSprite = AttackSprite.DARK_RANGE
regional = true
}

export class Poliwag extends Pokemon {
Expand Down
52 changes: 52 additions & 0 deletions app/models/colyseus-models/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ export default class Status extends Schema implements IStatus {
drySkinCooldown = 1000
curseCooldown = 0
enrageDelay = 35000
darkHarvest = false
darkHarvestCooldown = 0
darkHarvestDamageCooldown = 0

clearNegativeStatus() {
this.burnCooldown = 0
Expand Down Expand Up @@ -177,6 +180,10 @@ export default class Status extends Schema implements IStatus {
this.updateSoulDew(dt, pokemon)
}

if (this.darkHarvest) {
this.updateDarkHarvest(dt, pokemon, board)
}

if (this.paralysis) {
this.updateParalysis(dt, pokemon)
}
Expand Down Expand Up @@ -384,6 +391,51 @@ export default class Status extends Schema implements IStatus {
}
}

triggerDarkHarvest(duration: number) {
this.darkHarvest = true
if (duration > this.darkHarvestCooldown) {
this.darkHarvestCooldown = duration
this.darkHarvestDamageCooldown = 0
}
}

updateDarkHarvest(dt: number, pkm: PokemonEntity, board: Board) {
if (this.darkHarvestDamageCooldown - dt <= 0) {
pkm.simulation.room.broadcast(Transfer.ABILITY, {
id: pkm.simulation.id,
skill: Ability.DARK_HARVEST,
positionX: pkm.positionX,
positionY: pkm.positionY
})
board.getAdjacentCells(pkm.positionX, pkm.positionY).forEach((cell) => {
if (cell?.value && cell.value.team !== pkm.team) {
const darkHarvestDamage =
pkm.stars === 3 ? 40 : pkm.stars === 2 ? 20 : 10

cell.value.handleDamage({
damage: darkHarvestDamage,
board,
attackType: AttackType.SPECIAL,
attacker: pkm,
shouldTargetGainMana: true
})

const factor = pkm.stars === 3 ? 0.4 : pkm.stars === 2 ? 0.3 : 0.2
pkm.handleHeal(Math.round(darkHarvestDamage * factor), pkm, 1)
this.darkHarvestDamageCooldown = 1000
}
})
} else {
this.darkHarvestDamageCooldown -= dt
}

if (this.darkHarvestCooldown - dt <= 0) {
this.darkHarvest = false
} else {
this.darkHarvestCooldown -= dt
}
}

triggerBurn(
duration: number,
pkm: PokemonEntity,
Expand Down
2 changes: 1 addition & 1 deletion app/models/precomputed/credits.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/models/precomputed/emotions-per-pokemon-index.json

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions app/models/precomputed/pokemons-data.csv
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ Index,Name,Category,Tier,Additional pick,Type 1,Type 2,Type 3,Type 4,HP,Attack,D
0085,DODRIO,EPIC,2,false,WILD,FLYING,NORMAL,,185,28,5,3,1,40,AGILITY,DODUO,WILD,FLYING,NORMAL,,false,true,2
0086,SEEL,UNCOMMON,1,true,ICE,AQUATIC,,,80,7,4,4,1,90,AURORA_BEAM,SEEL,ICE,AQUATIC,,,false,false,2
0087,DEWGONG,UNCOMMON,2,true,ICE,AQUATIC,,,170,16,4,4,1,90,AURORA_BEAM,SEEL,ICE,AQUATIC,,,false,false,2
0088,GRIMER,UNCOMMON,1,true,POISON,MONSTER,,,90,5,3,2,1,100,SLUDGE,GRIMER,POISON,MONSTER,,,false,false,2
0088,GRIMER,UNCOMMON,1,false,POISON,MONSTER,,,90,5,3,2,1,100,SLUDGE,GRIMER,POISON,MONSTER,,,false,true,2
0088-0001,ALOLAN_GRIMER,UNCOMMON,1,false,POISON,DARK,,,80,7,2,2,1,100,SLUDGE,ALOLAN_GRIMER,POISON,DARK,,,false,true,2
0089,MUK,UNCOMMON,2,true,POISON,MONSTER,,,190,10,6,4,1,100,SLUDGE,GRIMER,POISON,MONSTER,,,false,false,2
0089,MUK,UNCOMMON,2,false,POISON,MONSTER,,,190,10,6,4,1,100,SLUDGE,GRIMER,POISON,MONSTER,,,false,true,2
0089-0001,ALOLAN_MUK,UNCOMMON,2,false,POISON,DARK,,,160,15,6,4,1,100,SLUDGE,ALOLAN_GRIMER,POISON,DARK,,,false,true,2
0090,SHELLDER,UNCOMMON,1,true,WATER,ICE,ROCK,,70,5,5,2,1,110,SHELL_SMASH,SHELLDER,WATER,ICE,ROCK,,false,false,2
0091,CLOYSTER,UNCOMMON,2,true,WATER,ICE,ROCK,,150,11,8,2,1,110,SHELL_SMASH,SHELLDER,WATER,ICE,ROCK,,false,false,2
Expand Down Expand Up @@ -578,6 +578,9 @@ Index,Name,Category,Tier,Additional pick,Type 1,Type 2,Type 3,Type 4,HP,Attack,D
0621,DRUDDIGON,UNIQUE,3,false,DRAGON,WILD,MONSTER,,170,18,4,4,1,100,OUTRAGE,DRUDDIGON,DRAGON,WILD,MONSTER,,false,false,3
0624,PAWNIARD,ULTRA,1,false,DARK,STEEL,,,130,14,5,3,1,60,KOWTOW_CLEAVE,PAWNIARD,DARK,STEEL,,,false,false,3
0625,BISHARP,ULTRA,2,false,DARK,STEEL,,,250,26,8,4,1,60,KOWTOW_CLEAVE,PAWNIARD,DARK,STEEL,,,false,false,3
0633,DEINO,RARE,1,false,DARK,DRAGON,,,80,6,2,2,2,50,DARK_HARVEST,DEINO,DARK,DRAGON,,,false,false,3
0634,ZWEILOUS,RARE,2,false,DARK,DRAGON,,,130,12,3,3,2,100,DARK_HARVEST,DEINO,DARK,DRAGON,,,false,false,3
0635,HYDREIGON,RARE,3,false,DARK,DRAGON,,,230,22,4,4,2,100,DARK_HARVEST,DEINO,DARK,DRAGON,,,false,false,3
0636,LARVESTA,EPIC,1,true,FIRE,BUG,,,100,10,2,2,3,100,FIRE_BLAST,LARVESTA,FIRE,BUG,,,false,false,2
0637,VOLCARONA,EPIC,2,true,FIRE,BUG,,,200,20,2,2,3,100,FIRE_BLAST,LARVESTA,FIRE,BUG,,,false,false,2
0638,COBALION,UNIQUE,3,false,STEEL,FIGHTING,,,200,20,6,6,1,100,SEISMIC_TOSS,COBALION,STEEL,FIGHTING,,,false,false,3
Expand Down
2 changes: 1 addition & 1 deletion app/models/precomputed/pokemons-data.json

Large diffs are not rendered by default.

Loading
Loading