mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-21 06:49:35 +02:00
moved aorund function
This commit is contained in:
parent
60a581074a
commit
c8f8f6a9c2
107
src/data/move.ts
107
src/data/move.ts
@ -5923,23 +5923,10 @@ export class CopyBiomeTypeAttr extends MoveEffectAttr {
|
|||||||
|
|
||||||
const terrainType = user.scene.arena.getTerrainType();
|
const terrainType = user.scene.arena.getTerrainType();
|
||||||
let typeChange: Type;
|
let typeChange: Type;
|
||||||
switch (terrainType) {
|
if (terrainType !== TerrainType.NONE) {
|
||||||
case TerrainType.ELECTRIC:
|
typeChange = this.getTypeForTerrain(user.scene.arena.getTerrainType());
|
||||||
typeChange = Type.ELECTRIC;
|
} else {
|
||||||
break;
|
typeChange = this.getTypeForBiome(user.scene.arena.biomeType);
|
||||||
case TerrainType.MISTY:
|
|
||||||
typeChange = Type.FAIRY;
|
|
||||||
break;
|
|
||||||
case TerrainType.GRASSY:
|
|
||||||
typeChange = Type.GRASS;
|
|
||||||
break;
|
|
||||||
case TerrainType.PSYCHIC:
|
|
||||||
typeChange = Type.PSYCHIC;
|
|
||||||
break;
|
|
||||||
case TerrainType.NONE:
|
|
||||||
default:
|
|
||||||
typeChange = user.scene.arena.getTypeForBiome();
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
user.summonData.types = [ typeChange ];
|
user.summonData.types = [ typeChange ];
|
||||||
@ -5949,6 +5936,92 @@ export class CopyBiomeTypeAttr extends MoveEffectAttr {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves a type from the current terrain
|
||||||
|
* @param terrainType {@linkcode TerrainType}
|
||||||
|
* @returns {@linkcode Type}
|
||||||
|
*/
|
||||||
|
private getTypeForTerrain(terrainType: TerrainType): Type {
|
||||||
|
switch (terrainType) {
|
||||||
|
case TerrainType.ELECTRIC:
|
||||||
|
return Type.ELECTRIC;
|
||||||
|
case TerrainType.MISTY:
|
||||||
|
return Type.FAIRY;
|
||||||
|
case TerrainType.GRASSY:
|
||||||
|
return Type.GRASS;
|
||||||
|
case TerrainType.PSYCHIC:
|
||||||
|
return Type.PSYCHIC;
|
||||||
|
case TerrainType.NONE:
|
||||||
|
default:
|
||||||
|
return Type.UNKNOWN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves a type from the current biome
|
||||||
|
* @param biomeType {@linkcode Biome}
|
||||||
|
* @returns {@linkcode Type}
|
||||||
|
*/
|
||||||
|
private getTypeForBiome(biomeType: Biome): Type {
|
||||||
|
switch (biomeType) {
|
||||||
|
case Biome.TOWN:
|
||||||
|
case Biome.PLAINS:
|
||||||
|
case Biome.METROPOLIS:
|
||||||
|
return Type.NORMAL;
|
||||||
|
case Biome.GRASS:
|
||||||
|
case Biome.TALL_GRASS:
|
||||||
|
return Type.GRASS;
|
||||||
|
case Biome.FOREST:
|
||||||
|
case Biome.JUNGLE:
|
||||||
|
return Type.BUG;
|
||||||
|
case Biome.SLUM:
|
||||||
|
case Biome.SWAMP:
|
||||||
|
return Type.POISON;
|
||||||
|
case Biome.SEA:
|
||||||
|
case Biome.BEACH:
|
||||||
|
case Biome.LAKE:
|
||||||
|
case Biome.SEABED:
|
||||||
|
return Type.WATER;
|
||||||
|
case Biome.MOUNTAIN:
|
||||||
|
return Type.FLYING;
|
||||||
|
case Biome.BADLANDS:
|
||||||
|
return Type.GROUND;
|
||||||
|
case Biome.CAVE:
|
||||||
|
case Biome.DESERT:
|
||||||
|
return Type.ROCK;
|
||||||
|
case Biome.ICE_CAVE:
|
||||||
|
case Biome.SNOWY_FOREST:
|
||||||
|
return Type.ICE;
|
||||||
|
case Biome.MEADOW:
|
||||||
|
case Biome.FAIRY_CAVE:
|
||||||
|
case Biome.ISLAND:
|
||||||
|
return Type.FAIRY;
|
||||||
|
case Biome.POWER_PLANT:
|
||||||
|
return Type.ELECTRIC;
|
||||||
|
case Biome.VOLCANO:
|
||||||
|
return Type.FIRE;
|
||||||
|
case Biome.GRAVEYARD:
|
||||||
|
case Biome.TEMPLE:
|
||||||
|
return Type.GHOST;
|
||||||
|
case Biome.DOJO:
|
||||||
|
case Biome.CONSTRUCTION_SITE:
|
||||||
|
return Type.FIGHTING;
|
||||||
|
case Biome.FACTORY:
|
||||||
|
case Biome.LABORATORY:
|
||||||
|
return Type.STEEL;
|
||||||
|
case Biome.RUINS:
|
||||||
|
case Biome.SPACE:
|
||||||
|
return Type.PSYCHIC;
|
||||||
|
case Biome.WASTELAND:
|
||||||
|
case Biome.END:
|
||||||
|
return Type.DRAGON;
|
||||||
|
case Biome.ABYSS:
|
||||||
|
return Type.DARK;
|
||||||
|
default:
|
||||||
|
return Type.UNKNOWN;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ChangeTypeAttr extends MoveEffectAttr {
|
export class ChangeTypeAttr extends MoveEffectAttr {
|
||||||
|
@ -224,66 +224,6 @@ export class Arena {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
getTypeForBiome() {
|
|
||||||
switch (this.biomeType) {
|
|
||||||
case Biome.TOWN:
|
|
||||||
case Biome.PLAINS:
|
|
||||||
case Biome.METROPOLIS:
|
|
||||||
return Type.NORMAL;
|
|
||||||
case Biome.GRASS:
|
|
||||||
case Biome.TALL_GRASS:
|
|
||||||
return Type.GRASS;
|
|
||||||
case Biome.FOREST:
|
|
||||||
case Biome.JUNGLE:
|
|
||||||
return Type.BUG;
|
|
||||||
case Biome.SLUM:
|
|
||||||
case Biome.SWAMP:
|
|
||||||
return Type.POISON;
|
|
||||||
case Biome.SEA:
|
|
||||||
case Biome.BEACH:
|
|
||||||
case Biome.LAKE:
|
|
||||||
case Biome.SEABED:
|
|
||||||
return Type.WATER;
|
|
||||||
case Biome.MOUNTAIN:
|
|
||||||
return Type.FLYING;
|
|
||||||
case Biome.BADLANDS:
|
|
||||||
return Type.GROUND;
|
|
||||||
case Biome.CAVE:
|
|
||||||
case Biome.DESERT:
|
|
||||||
return Type.ROCK;
|
|
||||||
case Biome.ICE_CAVE:
|
|
||||||
case Biome.SNOWY_FOREST:
|
|
||||||
return Type.ICE;
|
|
||||||
case Biome.MEADOW:
|
|
||||||
case Biome.FAIRY_CAVE:
|
|
||||||
case Biome.ISLAND:
|
|
||||||
return Type.FAIRY;
|
|
||||||
case Biome.POWER_PLANT:
|
|
||||||
return Type.ELECTRIC;
|
|
||||||
case Biome.VOLCANO:
|
|
||||||
return Type.FIRE;
|
|
||||||
case Biome.GRAVEYARD:
|
|
||||||
case Biome.TEMPLE:
|
|
||||||
return Type.GHOST;
|
|
||||||
case Biome.DOJO:
|
|
||||||
case Biome.CONSTRUCTION_SITE:
|
|
||||||
return Type.FIGHTING;
|
|
||||||
case Biome.FACTORY:
|
|
||||||
case Biome.LABORATORY:
|
|
||||||
return Type.STEEL;
|
|
||||||
case Biome.RUINS:
|
|
||||||
case Biome.SPACE:
|
|
||||||
return Type.PSYCHIC;
|
|
||||||
case Biome.WASTELAND:
|
|
||||||
case Biome.END:
|
|
||||||
return Type.DRAGON;
|
|
||||||
case Biome.ABYSS:
|
|
||||||
return Type.DARK;
|
|
||||||
default:
|
|
||||||
return Type.UNKNOWN;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
getBgTerrainColorRatioForBiome(): number {
|
getBgTerrainColorRatioForBiome(): number {
|
||||||
switch (this.biomeType) {
|
switch (this.biomeType) {
|
||||||
case Biome.SPACE:
|
case Biome.SPACE:
|
||||||
|
Loading…
Reference in New Issue
Block a user