Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easy debug console #221

Open
oskarrough opened this issue Oct 2, 2023 · 2 comments
Open

Easy debug console #221

oskarrough opened this issue Oct 2, 2023 · 2 comments

Comments

@oskarrough
Copy link
Owner

You can't modify the game.state directly, because it's immutable. Kind of annoying, but probably for the best. Instead we do it through actions. And we have many. However they are often cumbersome to call quickly.

Compare this:

  • in slay the spire console you write energy add 5
  • in slay the web console you write stw.game.enqueue({type: 'addEnergyToPlayer', amount: 5}); stw.game.update()

If you want to add a specific card into your hand, oh lord.

  • create the card, how?
  • insert into deck, how?

Can we make this nicer? Take inspiration from the sts base mod dev console, which is well made -> https://github.com/daviscook477/BaseMod/wiki/Console

@oskarrough
Copy link
Owner Author

Okay, now it's a bit nicer.

Before

stw.game.enqueue({type: 'addEnergyToPlayer', amount: 5}); stw.game.update()

After (shortcut for above)

stw.run('addEnergyToPlayer', {amount: 5})

@oskarrough
Copy link
Owner Author

Ideally it'll be easy nice to use as the CS 1.6 console.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant