Commit Graph

23714 Commits

Author SHA1 Message Date
Guangcong Luo
d5c8ac1d88 Fix more chainbreeding learnset check bugs
- Level-up moves can always be chainbred
2013-02-19 20:12:29 -08:00
Marty-D
f4c0d9ac78 Add Darmanitan-Z as an alias. 2013-02-19 17:02:34 -05:00
Guangcong Luo
c77afcbe85 Scripts can now override the Battle prototype
(well, pseudo-prototype, I've yet to refactor Battle to actually use
prototypes)
2013-02-18 23:44:39 -08:00
Guangcong Luo
7346f76824 Report HP as pixels 2013-02-18 20:18:04 -08:00
Marty-D
74b0fd7b6c Fix Gravity and Smack Down. 2013-02-18 21:39:07 -05:00
Cathy J. Fitzpatrick
eb09fbb507 Fix race conditions in writing logs/lastbattle.txt
This fixes two race conditions in writing lastbattle.txt:

1) Previously, there could be several calls to `fs.writeFile` on
   lastbattle.txt queued at the same time. The order these would run in
   was undefined, so lastbattle.txt did not necessarily represent the
   actual last battle at any given time.

2) Since `fs.writeFile` clears the file before writing to it, it
   was possible to end up with an empty lastbattle.txt if the process
   terminated while the call to `fs.writeFile` was being processed
   asynchronously. This commit fixes the issue by writing to a file
   named logs/lastbattle.txt.0 and then renaming that file to
   logs/lastbattle.txt. On POSIX, `rename` changes the target
   file's link to point to the soruce file (which is an atomic
   operation). Thus, this removes the possibility of ending up with
   an empty logs/lastbattle.txt on POSIX.

   Unfortunately, on Windows, `rename` will throw an error if the
   target file exists, which it will. In case of an error, this
   code still writes to logs/lastbattle.txt, but in a way that
   has a possibility of a race condition. As such, race conditions
   in writing to logs/lastbattle.txt are still possible on Windows, but
   they are fixed on POSIX at least.
2013-02-18 19:28:10 -07:00
Cathy J. Fitzpatrick
5f78f746c9 Better error messages in tools.js 2013-02-18 17:26:55 -07:00
Guangcong Luo
b39ff77883 Support for config/formats.js 2013-02-18 11:33:05 -08:00
The Immortal
b3cc407ec9 Capitilize 'pokemon' in Sky Drop message 2013-02-18 22:37:11 +04:00
Cathy J. Fitzpatrick
bae54aa8a9 Implement /refreshpage command 2013-02-18 00:02:25 -07:00
Cathy J. Fitzpatrick
4c8ecfa56f Better documentation of /highlight 2013-02-17 20:55:41 -07:00
Cathy J. Fitzpatrick
7a07826291 Fix accidental introduction of global variable 2013-02-17 15:00:57 -07:00
Cathy J. Fitzpatrick
8f03ccb232 Changes to logging & broadcasting of some commands
- /fr and /frt now behave as follows:

    1) Regardless of whether they are used in a battle or in the lobby,
       both commands show a message to all users in the lobby with the
       `receiveauthmessages` permission (which is % and up by default).

    2) If used in a battle, the message is also shown to all users in
       the battle, even if they are not auth. In addition, the message
       is written to the lobby file logs.

- use of /lockdown, /endlockdown, /kill, /crashfixed, and /crashnoted
  is now written to the lobby file logs (including the identity of the
  person who used the command)
2013-02-17 14:44:42 -07:00
Guangcong Luo
618868b50c Better error messages for the learnset checker 2013-02-17 13:22:32 -08:00
Cathy J. Fitzpatrick
e436d41a49 Fix selfdestruct status moves 2013-02-17 12:47:12 -07:00
Bill Meltsner
f7b3a757fa Fix No Guard missing against Pokemon in the middle of Fly/Dig/Dive/Shadow Force 2013-02-17 11:41:01 -08:00
Guangcong Luo
d2865c0c84 NEXT: unban/nerf Minimize and Moody 2013-02-17 03:46:45 -08:00
Guangcong Luo
72ffbc0359 Really fix level forcing 2013-02-17 01:08:38 -08:00
Guangcong Luo
abde83ddae Fix validation bug with maxLevel
(affects LC)
2013-02-17 00:15:58 -08:00
Guangcong Luo
53d62da175 Describe the event system in comments
also add a few other comments
2013-02-16 22:37:31 -08:00
Guangcong Luo
2ef0a42b9d Learnset checker is more forgiving for VGC
- if you bring a level 50 pokemon to VGC, it'll be treated as level 100
  for the purposes of checking level-up moves
- we introduce a new flag 'maxForcedLevel' for this
2013-02-16 21:34:30 -08:00
Guangcong Luo
67b063f910 Fix base power 0
Now it actually means 'don't deal damage' rather than 'deal 0 damage'
this removes the need to specialcase secondaries and status moves, too
2013-02-16 21:34:30 -08:00
Cathy J. Fitzpatrick
1c367d8170 Fix some interactions with Encore
Encore's `onBeforeTurn` event handler was causing problems with
interactions with Taunt and Torment (and possibly other things)
by changing move decisions from Struggle to the Encored move.

The `onBeforeTurn` event handler is not a necessary part of the
Encore implementation because `battle.parseChoice` already calls
`pokemon.getValidMoves`, which in turn calls `pokemon.getMoves`,
which checks if the selected move is disabled. The `encore` effect
already disables all moves other than the Encored one, so they
cannot be selected even without the `onBeforeTurn` handler.

In the result, this commit deletes the `onBeforeTurn` handler.
2013-02-16 16:34:35 -07:00
Guangcong Luo
e81945e5f5 Timer commands don't default to 'on' anymore
specifically, '/timer aoiwjefoiawe' will now error instead of turning on
the timer
2013-02-16 15:13:25 -08:00
Guangcong Luo
0753524a5d NEXT: Virizion gets Horn Leech 2013-02-16 15:13:25 -08:00
The Immortal
ed1bd85dd1 Randbat script update 2013-02-17 01:14:09 +04:00
Guangcong Luo
4125d6b5e7 NEXT: accuracy changes, nerf Justified CC, other changes
- all accuracy is now rounded up to the nearest multiple of 10%
- except for Fire Blast / Blue Flare, which have different changes
- Justified caps base power at 100 mostly: Sacred Sword has a use now!
- Surf has 10% chance to lower Speed
2013-02-16 01:22:04 -08:00
Guangcong Luo
2e6926f22f Genderless pokemon can't pass egg moves
(Fix learnset checker suggesting otherwise
2013-02-15 19:31:20 -08:00
Guangcong Luo
44bc9bf687 Cloyster gets Rapid Spin for chainbreeding
- Fixes LC Tentacool's Rapid Spin + Toxic Spikes set
2013-02-15 19:31:20 -08:00
Cathy J. Fitzpatrick
d2187a672e Decrease chance of a race condition with /updateserver 2013-02-15 19:04:27 -07:00
Cathy J. Fitzpatrick
b075c11f86 Changes to logging.md
- Refer to the project as 'Pokemon Showdown' rather than 'Showdown'
- Up to date information about the logging features of Pokemon Showdown
- Use UNIX line endings (like the rest of the project does)
2013-02-15 18:06:44 -07:00
Cathy J. Fitzpatrick
7d1cb22050 Log users leaving the lobby 2013-02-15 17:56:58 -07:00
Cathy J. Fitzpatrick
22d5f6fd4b Use console permission for /updateserver rather than hotpatch
This is mainly because there is a chance (however small) that dealing
with the result of /updateserver will require shell access to the
server. There's also a race condition when two people update at once
when there are changes to the working directory or index, and limiting
this to the `console` permission will help avoid that.
2013-02-15 17:48:08 -07:00
Guangcong Luo
3eb106d761 Fix links to CAP analyses 2013-02-15 16:14:01 -08:00
Guangcong Luo
601ebcffb9 Temporary fix to the team preview issue 2013-02-15 16:14:01 -08:00
Cathy J. Fitzpatrick
39818e9546 Implement /updateserver
This command updates the server code to the upstream repository
version. It requires that `git` be on the PATH, which may not be
the case on a Windows installation.
2013-02-15 16:57:39 -07:00
Cathy J. Fitzpatrick
c0a1cae7da Fix syntax error in sametypeclause 2013-02-15 16:01:06 -07:00
Guangcong Luo
3e9d8ebbd8 Same Type Clause implemented
- not currently used anywhere, but will be nice for future custom games
2013-02-15 14:37:10 -08:00
Guangcong Luo
6cc0de47d2 Better messages for /potd 2013-02-15 14:21:40 -08:00
Cathy J. Fitzpatrick
91d4d6df69 Changes to scrollback buffering and lobby logging
- When `config.reportjoins` is enabled, joins are no longer included in
  the scrollback buffer sent to the client when joining the lobby.

- Leaving the lobby is now included in the lobby file logs.

- The identity of users using /birkal is now included in the lobby file
  logs (but still not shown in the content sent to the client).
2013-02-15 15:04:14 -07:00
Cathy J. Fitzpatrick
281713f09e Add demotion message for user who was demoted 2013-02-15 00:55:19 -07:00
Cathy J. Fitzpatrick
b563e09977 Fix display bug in message for /demote 2013-02-15 00:45:04 -07:00
Cathy J. Fitzpatrick
e0ec0cd91f Add private feedback message when demoting a user 2013-02-15 00:38:11 -07:00
Cathy J. Fitzpatrick
2518f779f3 Remove buggy debug string 2013-02-14 23:58:12 -07:00
Marty-D
144b97af80 Add support for both types of 'miss' messages. 2013-02-14 16:04:23 -05:00
Cathy J. Fitzpatrick
a51b66b5e7 Fix debug message for overriding Battle properties 2013-02-14 13:34:43 -07:00
Cathy J. Fitzpatrick
0fdb3fdec9 Allow BattleScripts to override properties of Battle
This allows functions defined as properties of `BattleScripts`
(i.e. in scripts.js) to override properties of a `Battle` object.
2013-02-14 13:26:52 -07:00
Cathy J. Fitzpatrick
19e0a5ad5b Fix ReferenceError in gen3 Bide
The gen3 moves.js was throwing an exception on load because it
calls a function which does not exist. This commit does not properly
fix Bide, but it does fix the ReferenceError exception.
2013-02-14 12:31:58 -07:00
Cathy J. Fitzpatrick
6506f492f9 Add better error message when mod file fails to load 2013-02-14 12:30:20 -07:00
The Immortal
da3bdadff8 Randbats script updates
- Add a few move combinations to be prevented
- If legal, set Swift Swim for Pokemon with Rain Dance
2013-02-14 23:22:02 +04:00