Commit Graph

44 Commits

Author SHA1 Message Date
Kris Johnson
ebf61ab347 SSB: Fix Theia's username 2023-07-25 23:39:38 -06:00
Leonard Craft III
156a39405f
Refactor some move lists to move flags (#9396) 2023-03-18 22:21:00 -05:00
pyuk-bot
e3b791f310
Fix changing, blocking, and reacting to stat boosts (#9322) 2023-01-21 12:17:22 -05:00
pyuk-bot
2bc2100a7b
Make -Ate abilities share a ...Boosted property (#9174) 2022-12-13 21:43:52 -06:00
pyuk-bot
7a6a8441cc
Fix Protosynthesis/Quark Drive/Booster Energy (#9118) 2022-12-04 16:20:21 -05:00
Hisuian Zoroark
9eebb0f0b2
SSB: Prevent Sectonia from having infinite PP (#8801)
Also adds an easter egg.
2022-06-01 10:50:27 -04:00
Leonard Craft III
a6d321e5d1
Fix Bird-type crashes (#8639)
* Fix crash with Bird type in Revelationmons Mod

* Fix Wild Magic Surge and Bird type
2022-01-24 19:07:37 -07:00
Kris Johnson
9140510dfa SSB: Change quotes to use |c:| 2021-11-07 19:55:01 -07:00
pacmanboss256
23b35498f6
Rename the "mystery" and "authentic" move flags (#8445)
* mystery -> allyanim
* authentic -> bypasssub
2021-08-30 23:07:50 -07:00
Kris Johnson
ca37942f5c SSB: Fix infinite loop with Shared Power 2021-07-01 12:39:44 -06:00
Kris Johnson
32de43c7ce SSB: Remove quadrophenic 2021-06-08 00:10:14 -06:00
Instruct
d50c77fb4d
SSB: Bugfixes and Cosmetic Updates (#8318) 2021-05-26 14:23:09 -07:00
pacmanboss256
4186ef5f4f
Refactor Mold Breaker effect (#8291) 2021-05-14 08:32:41 -04:00
Guangcong Luo
f9fdc73133
Support per-pokemon Residual handlers in Side/Field conditions (#8222)
For side conditions, `onStart`/`onRestart`/`onResidual`/`onEnd`
have been renamed `onSideStart`/`onSideRestart`/`onSideResidual`/`onSideEnd`,
with the `onResidualOrder` properties renamed `onSideResidualOrder`.

For field conditions, `onStart`/`onRestart`/`onResidual`/`onEnd`
have been renamed `onFieldStart`/`onFieldRestart`/`onFieldResidual`/`onFieldEnd`,
with the `onResidualOrder` properties renamed `onFieldResidualOrder`.

(The `onField` and `onSide` part helps make it clear to the type system
that the first argument is a Field or Side, not a Pokemon.)

Side and field conditions can now use `onResidual` to tick separately
on each pokemon in Speed order. `onResidualOrder` (the per-pokemon
tick) can be timed separate from `onSideResidualOrder` (the
per-condition tick), allowing conditions to end at a different priority
than they tick per-pokemon.

Relatedly, `onTeamPreview` and `onStart` in formats now need to be
`onFieldTeamPreview` and `onFieldStart`.

Unrelatedly, `effectData` has been renamed `effectState`, and the
corresponding state containers (`pokemon.statusData`,
`pokemon.speciesData`, `pokemon.itemData`, `pokemon.abilityData`,
`field.weatherData`, `field.terrainData`) have been similarly renamed. I
renamed the types a while ago, but I was holding off renaming the fields
because it would be a breaking change. But this is a breaking change
anyway, so we might as well do it now.

Note: `onResidual` will tick even on `onSideEnd` turns, although
`onSideResidual` won't. When refactoring weather, remember to
check `this.state.duration` so you don't deal weather damage on the
ending turn.

Intended as a better fix for #8216
2021-04-25 10:55:54 -07:00
pyuk-bot
3639079d1f
Protective Pads should not apply to Gulp Missile (#8207)
Co-authored-by: Leonard Craft III <leonardcraft64@gmail.com>
2021-04-19 12:39:33 -04:00
Guangcong Luo
5233559183 Refactor Dex types 2021-04-08 07:08:56 -07:00
Guangcong Luo
13189fdb02
Update Dex API (#8181)
This is the change that renames:

- `Dex.getMove` -> `Dex.moves.get`
- `Dex.getAbility` -> `Dex.abilities.get`
- `Dex.getItem` -> `Dex.items.get`
- `Dex.getSpecies` -> `Dex.species.get`
- `Dex.getEffect` -> `Dex.conditions.get`
- `Dex.getNature` -> `Dex.natures.get`
- `Dex.getType` -> `Dex.types.get`
- `Dex.getFormat` -> `Dex.formats.get`

In addition, some other APIs have been updated:

- `getByID` methods have also been added to every other table.
- `Dex.moves.all()` now gets an array of all moves
  - Plus equivalent methods for `abilities`, `items`, `species`, `formats`, `natures`, `types`
  - Note: there's no `Dex.conditions.all()`
- new API: `Dex.stats` for naming/iterating stats
- `Dex.getEffectByID` -> `Dex.conditions.getByID`
- `Dex.getType` -> `Dex.types.get`
- `Dex.data.Formats` -> `Dex.data.Rulesets`
- `Dex.formats` -> now an array `Dex.formats.all()`
- `Dex.getRuleTable` -> `Dex.formats.getRuleTable`
- `Dex.validateFormat` -> `Dex.formats.validate`

Team functions have been split off into a new `sim/teams` package:

- `Dex.packTeam` -> `Teams.pack`
- `Dex.fastUnpackTeam` -> `Teams.unpack`
- `Dex.generateTeam` -> `Teams.generate`
- `Dex.stringifyTeam` -> `Teams.export`

`Teams.export` has also been rewritten to better match how it works in client.

This implements #8178
2021-04-08 03:00:37 -07:00
Guangcong Luo
3b5e8cbfc2
Refactor for multi battles (#8152) 2021-03-31 20:27:07 -07:00
Guangcong Luo
d18c0a4e1f Refactor more things to use pokemon.allies/foes
(This will make multi battles easier to implement.)
2021-03-28 20:06:18 -07:00
Guangcong Luo
ed454ef76a
Refactor scripts to battle-actions (#8138)
This introduces a new class, BattleActions, available as `battle.actions`,
moving all functions from `data/scripts.ts` to `sim/battle-actions.ts`.

This makes it so that "go to definition" will now work correctly for
functions previously in scripts; we no longer need UnimplementedError,
and there's now a clean conceptual separation between `battle` and
`battle-actions` (whereas the previous distinction between `battle` and
`scripts` was basically nonexistent).

This will be a difficult migration if you maintain a fork with custom
scripted mods. I'm sorry! Migration instructions are here:

https://github.com/smogon/pokemon-showdown/pull/8138
2021-03-28 12:01:38 -07:00
Instruct
6c5a97e342
SSB4: Bugfixes and Balance changes (#8109) 2021-03-22 22:06:59 -04:00
Kris Johnson
aeecf8d24c
Dexsearch: Add support for searching by mods (#8064) 2021-02-28 14:37:00 -08:00
Instruct
9e5693a338
SSB: Prevent Data Corruption from being reverted by forme changes (#8040) 2021-02-15 21:10:06 -08:00
Leonard Craft III
220cac3aa7
Convert modifiers from hex to decimal (#8003) 2021-02-10 17:02:18 -05:00
Instruct
67cc1fbe98
SSB: More Bugfixes (#8006)
* Fix 1-1 edgecase

* Fix winter hail not affecting hail based attacks
2021-02-07 23:18:29 -05:00
Instruct
e42dfe12d8
SSB4: Bugfixes (#7994) 2021-02-07 04:43:17 +04:00
Instruct
d8de06a83c
SSB4: Clarifications and Description Edits (#7976) 2021-01-31 20:34:49 -08:00
Instruct
0685e88e4f
SSB4: Balance changes and Bugfixes, pt 2 (#7954) 2021-01-30 23:34:41 +04:00
Instruct
18dea767a9
SSB4: Fix Urgent Bug and Descriptions (#7941) 2021-01-22 21:02:00 -05:00
Instruct
0d1c9fe098
SSB4: Bugfixes and Balance Patches (#7889) 2021-01-22 14:56:26 +04:00
Instruct
27f05678c0
SSB4: Balance changes and bugfixes (#7856) 2021-01-01 18:46:27 +04:00
Instruct
47a8a04aa9
SSB: Nerf Forever Winter Nights (#7841) 2020-12-27 19:47:20 +04:00
Instruct
b73efd84ab
SSB4: Bugfixes and balance changes (#7838) 2020-12-25 21:36:07 -07:00
Instruct
1f9954b374
SSB4: Bug & crashfixes (#7837) 2020-12-24 21:51:11 -05:00
Instruct
901c1d8573
SSB: Fix Winter Hail decrease amt. Add discussion thread to format. small QC changes. (#7833) 2020-12-24 13:24:18 -05:00
Instruct
5b441c2013
Super Staff Bros 4 (#7793)
Collaborative Project lead by @xInstruct with many contributors.

See the Special Thanks section of https://www.smogon.com/articles/super-staff-bros-4
2020-12-24 11:21:02 -05:00
Guangcong Luo
9d87616176
Add more style linting rules (#7537)
* Lint arrow-body-style

* Lint prefer-object-spread

Object spread is faster _and_ more readable.

This also fixes a few unnecessary object clones.

* Enable no-parameter-properties

This isn't currently used, but this makes clear that it shouldn't be.

* Refactor more Promises to async/await

* Remove unnecessary code from getDataMoveHTML etc

* Lint prefer-string-starts-ends-with

* Stop using no-undef

According to the typescript-eslint FAQ, this is redundant with
TypeScript, and they're not wrong. This will save us from needing to
specify globals in two different places which will be nice.
2020-10-19 02:42:28 -07:00
Mia
deeed6c789
Remove sim/ and data/'s globals (#7091) 2020-08-07 06:44:15 -07:00
Kris Johnson
5fb36bcc62
SSB: Remove Flare (#7170) 2020-08-07 12:36:12 +04:00
Guangcong Luo
4d09f7acde Rename more instances of Effect to Condition 2020-07-26 11:26:23 -07:00
Guangcong Luo
2f805c93a2
Remove "Battle" prefix from data exports (#7039)
`BattlePokedex` is now `Pokedex`, `BattleItems` is now `Items`, etc.

I also renamed `Movedex` to `Moves` and `Statuses` to `Conditions`.

`TypeChart` isn't `Types` yet, because unlike the others, it's not
indexed by ID. That should probably be fixed one day.
2020-07-24 12:42:26 -07:00
Guangcong Luo
e0f6453b60 Refactor data definitions
- `Modded[Effect]Data` are now correctly defined: they must either have
  `inherit: true` and be partial, or not have `inherit: true` and be a
	complete `[Effect]Data` entry

- `id` is no longer allowed; instead, it's calculated directly from
  `toID(name)`. The one exception, Hidden Power, gets a `realMove`
	property to track this (it's still used to set `.id`, though;
	TODO: really fix it properly).

- `num` is still required in `data/pokedex.ts` (dex number),
  `data/moves.ts` (move index number, for Metronome), and
	`data/items.ts` (minisprite sprite-sheet location). It's still not
	required for mod-only items and moves.

- `num` is no longer allowed for PureEffects (in `statuses.ts`) where
  it's always been meaningless.

- `color` and `heightm`, being completely flavor, are still not
  required for `pokedex.ts` in mods. They're still required in the base
	pokedex.
2020-04-30 21:39:29 -07:00
Guangcong Luo
c5faebd739 Remove extraneous properties from BasicEffect
BasicEffect always had a `status` property to support the pattern of
testing it to see if it's a move that sets status directly.

This is just a situation that TypeScript is bad at.

Another possibility would be to set `status: undefined` on PureEffect,
Ability, Item, and Species, but I think that's also ugly. Casting to
Move is probably the best approach, so that's what we do now.
2020-04-25 12:57:46 -07:00
Kris Johnson
28bf388b98
Typescript data (#6553) 2020-04-23 09:16:09 -07:00