* Make `/uno autostart` command.
* Add autostart help + specify game ended.
* Update uno.js
* Specify if game is ended or started.
* Remove extra condition from Timeout
* Add const and add another condition.
* make these things one line
* remove extra stuff
* Allow to turn off autostart timer
* Tools.toId -> toId
* Check timer while turning it off
* Fix grammar
* Specify seconds and UNO game
Adds some more magic to make Chat.plural more readable when used to
count things.
Overall, it's not _nearly_ as concise as I'd like, but it might be the
best we can get for now.
Add a new "uno" state (that does absolutely nothing except define what is going on), so that the previous player can't play their last card during the 750ms grace period for the player to slap the UNO button.
Credits to PS user "Java SE Runtime" for catching this
- announces the presence of a game when a user joins the room. Players will immediately see their hand instead.
- wild cards will cause the top card display to inherit the changed colour
This is a surprisingly minor refactor considering how many files it
touches, but most of this is only renames.
In terms of file renames:
- `tools.js` is now `sim/dex.js`
- `battle-engine.js` is now `sim/index.js` and its three classes are
in `sim/battle.js`, `sim/side.js`, and `sim/pokemon.js`
- `prng.js` is now `sim/prng.js`
In terms of variable renames:
- `Tools` is now `Dex`
- `BattleEngine` is now `Sim`
- `BattleEngine.Battle` is now `Sim.Battle`
- `BattleEngine.BattleSide` is now `Sim.Side`
- `BattleEngine.BattlePokemon` is now `Sim.Pokemon`
This allows for users to be highlighted on their turns (currently a big problem) and also allows users to know if it's their turn in cases of disconnections (the current code does not).
- made the darker end of the blue card less blue
- made the yellows go to a paler yellow for one end and use a slight orange tinge for the "darker" spectrum of the yellow
- gradients to cards for Slayer-senpai
- use the button class for cards
- make pass/draw buttons less hard
- put in Zarel-senpai's recommendations for text shadows
- display updated cards after playing anything
Display changes:
- done to Zarel's request/suggestions!
- hides the UNO button automatically the turn after
Drawing:
- refactored regular drawing of a card to be an "event" of its own (onDraw)
- prevents users from drawing a card after playing a colour card (drawing can only happen in during the "play" state now)
- only drawing on your own turn will show you your hand display (you can still view your hand any time using ``/uno`` or ``/uno hand``)
UNO handling:
- handles uno parsing if the next player draws, refactored into it's own function as well (since it occurs at both the draw and the playing part)
- for 2p games, if the user does not say uno before playing their last card (Skip => [last card]), they can draw/play without having to say UNO and be penalized 2 cards (in official rules, iirc you have to beat the next player's actions, and not your own)
- used Array#find for checking if the card exists.
- split the html for hand display into several lines (had to use + to join the strings since template strings allow newlines just by pressing enter) - Do we __have to__ do it using client-side css? I'm pretty sure that hangman and other chat plugins just list the styling stuff in the HTML as well.
- used a simpler sort ``this.hand.sort((a, b) => (a.colour > b.colour) || (a.colour === b.colour && a.value > b.value))`` Sorry Slayer, your method doesnt seem to work since it mixes between sorting by colour and value
- limited timer to max 300 seconds (5 minutes)... PS users already complain that 150 seconds for battles is already too much...