Initial push with roost fix

This commit is contained in:
Ishan Patel 2024-04-15 16:20:25 -04:00
parent af4e9ff66e
commit 1c077d1506
5 changed files with 12 additions and 3 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "pokemon-rogue-battle",
"version": "1.0.0",
"version": "1.0.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "pokemon-rogue-battle",
"version": "1.0.0",
"version": "1.0.1",
"dependencies": {
"@material/material-color-utilities": "^0.2.7",
"crypto-js": "^4.2.0",

View File

@ -1094,6 +1094,8 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: integer, sourc
return new BattlerTag(BattlerTagType.BYPASS_SLEEP, BattlerTagLapseType.TURN_END, turnCount, sourceMove);
case BattlerTagType.IGNORE_FLYING:
return new BattlerTag(tagType, BattlerTagLapseType.TURN_END, turnCount, sourceMove);
case BattlerTagType.GROUNDED:
return new BattlerTag(tagType, BattlerTagLapseType.TURN_END, turnCount - 1, sourceMove);
case BattlerTagType.SALT_CURED:
return new SaltCuredTag(sourceId);
case BattlerTagType.NONE:

View File

@ -47,5 +47,6 @@ export enum BattlerTagType {
IGNORE_ACCURACY = "IGNORE_ACCURACY",
BYPASS_SLEEP = "BYPASS_SLEEP",
IGNORE_FLYING = "IGNORE_FLYING",
GROUNDED = "GROUNDED",
SALT_CURED = "SALT_CURED"
}

View File

@ -4315,7 +4315,7 @@ export function initMoves() {
.attr(StatChangeAttr, BattleStat.SPATK, -2, true),
new SelfStatusMove(Moves.ROOST, "Roost", Type.FLYING, -1, 5, "The user lands and rests its body. This move restores the user's HP by up to half of its max HP.", -1, 0, 4)
.attr(HealAttr, 0.5)
.attr(AddBattlerTagAttr, BattlerTagType.IGNORE_FLYING, true, false, 1)
.attr(AddBattlerTagAttr, BattlerTagType.GROUNDED, true, false, 1)
.triageMove(),
new StatusMove(Moves.GRAVITY, "Gravity", Type.PSYCHIC, -1, 5, "This move enables Flying-type Pokémon or Pokémon with the Levitate Ability to be hit by Ground-type moves. Moves that involve flying can't be used.", -1, 0, 4)
.attr(AddArenaTagAttr, ArenaTagType.GRAVITY, 5)

View File

@ -698,6 +698,12 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
types.splice(flyingIndex, 1);
}
if (forDefend && (this.getTag(BattlerTagType.GROUNDED) || this.scene.arena.getTag(ArenaTagType.GRAVITY))) {
const flyingIndex = types.indexOf(Type.FLYING);
if (flyingIndex > -1)
types.splice(flyingIndex, 1);
}
if (!types.length)
types.push(Type.NORMAL);