• v1.2.0 41ba7b0843

    v1.2.0 Stable

    LunarTides released this 2023-05-14 13:21:27 +00:00 | 1446 commits to main since this release

    Version 1.2 is here!

    After a week of work, update 1.2 is finished.
    Here are the changes:

    Player changes

    Ai attack models #34

    You can now switch between ai attack models by changing AIAttackModel in the ai config. Setting this value to 1 will make the ai use the old attacking code, before 3ff32b7. Setting this to any other values makes the ai use the default one.

    Creator changes

    BREAKING CHANGE: Renamed game passives to events #39

    All functions work the same, just with different names.

    game.functions.addPassive has been renamed to game.functions.addEventListener

    game.GameStats has been renamed to game.EventManager.
    game.passives has been renamed to game.eventListeners
    game.stats has been renamed to game.events
    game.stats.update has been renamed to game.events.broadcast
    game.updatePassives has been renamed to game.triggerEventListeners
    All event names have been changed. Look at events.txt.

    BREAKING CHANGE: functions.getCards now returns a list instead of an object #16

    This now returns a list of blueprints, instead of an object like it used to. This is because I was always just doing Object.values(functions.getCards()) regardless. If you want the keys of the old version, you can just do functions.getCards().map(c => c.name).

    Improved backups #33

    The card class now has the createBackup and restoreBackup functions. This will allow you to create and restore infinite amounts of backups of cards. Why? ...

    Added functions to copy cards #50

    The card class now has the perfectCopy and imperfectCopy functions. perfectCopy will make a perfect copy of the card, this is rarely useful. imperfectCopy will make an imperfect copy of the card, this happens when, for example, shuffling a card into the player's deck.

    Added a way to run the vanilla card creator through the runner #48

    You can now add vanilla cards through the runner, instead of having to open up the folder and running it from there.

    Added breaking change script #54

    Added a breaking change script. You can type in a regular expression to search for, and it will show every card that matches the search. You can then run a command for each of them, like vim. This will make it a lot easier to make breaking changes, but there are a lot of other uses this has.

    Added missing docstrings #12

    All functions in the source code now have docstrings!

    Small changes

    Made the tester handle crashes #41

    The tester (test.js) will now show more information when the game crashes, it will show the ai's history, and the general history.

    Made the card creator more readable #53

    The card creator code has always been a mess, even before the rewrite (19d2384). The card creator code should now be more readable, except for the doCode function. I'm not brave enough yet. <-- #81 for 1.3

    Fixed a bug in the deck creator #47

    The deck creator got confused when you added cards that began with p, a, or r, without typing a command before it, and thought you were trying to do other commands. I'm surprised it took me this long to notice that.

    Made the ai trade #66

    Before this, the ai would never trade.

    Changelog:

    Full Changelog: https://github.com/LunarTides/Hearthstone.js/compare/v0.1.0...v1.2.0

    Downloads