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

Implement use method for card logic #112

Merged
merged 30 commits into from
Dec 12, 2020
Merged

Implement use method for card logic #112

merged 30 commits into from
Dec 12, 2020

Conversation

oskarrough
Copy link
Owner

@oskarrough oskarrough commented Aug 22, 2020

Idea is to allow more advanced card logic. Cards should be able to call actions themselves. How exactly it needs to work this we'll try to learn by experimenting in this PR. See #109 for discussion.

@oskarrough oskarrough added the feature New feature or request label Aug 22, 2020
@oskarrough
Copy link
Owner Author

oskarrough commented Aug 22, 2020

Important note: actions and cards currently know nothing about queueing and dequeuing. I'm not sure we can implement this without changing that.

Ideally the use() method gains access to the entire game object and not just state. This way you can do everything.

@oskarrough
Copy link
Owner Author

Something is working… I use the actions directly inside the card.use. For now without any game/queue/dequeue logic. Wanted to add drawCard as well to test multiple actions inside one use() but drawCard is bugged because of the animations…

public/game/cards.js Outdated Show resolved Hide resolved
@SamuelRott
Copy link
Collaborator

The way I am taken would have for consequences that use() and condition() are going to be the same for every cards.
I guess they shouldn't be cards methods anymore.

public/ui/app.js Outdated Show resolved Hide resolved
public/ui/app.js Outdated Show resolved Hide resolved
public/ui/app.js Outdated Show resolved Hide resolved
public/game/cards.js Outdated Show resolved Hide resolved
public/game/cards.js Outdated Show resolved Hide resolved
@oskarrough oskarrough marked this pull request as ready for review December 12, 2020 14:59
@oskarrough oskarrough merged commit 9b3e1e9 into master Dec 12, 2020
oskarrough added a commit that referenced this pull request Aug 27, 2022
Implement use method for card logic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants