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

Add scripting for Destiny Unfolds #174

Merged
merged 11 commits into from
Nov 25, 2024

Conversation

pyrrhicPachyderm
Copy link
Contributor

I had to refactor some of the global card-dealing code, so that I wouldn't have to duplicate all of it in Destiny Unfolds.

In preparation for Destiny Unfolds using getCardPositions().
In preparation for use in Destiny Unfolds.
In preparation for the two-player mode of Destiny Unfolds.
As taking a function from another object doesn't work properly.
…Unfolds.

To avoid duplication of magic numbers.
…ts().

This was not updated when power zone location went from
being based on hand position to being based on table position,
in 2e05b15.
The power zone position is calculated by an addition, and this seems
to contain a little error that requires a little leeway in the check.
I don't beleive this is necessary for the x check, as this is taken
directly, without any addition.
script.lua Show resolved Hide resolved
objects/c4e8cd/script.lua Show resolved Hide resolved
function PostSetup(_)
if round <= 2 then
-- Lock out card gains for the duration
Wait.condition(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i feel like there's something i'm missing here but this just sets the variable true one time? how does that tie into the "duration" part?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It gets set false again in cleanUp(), once the whole Destiny Unfolds drafting business is done. Basically, the point of this code is to prevent any of the "Gain a Major/Minor" buttons from working for the entire duration of the time Destiny Unfolds is doing its scripted thing, to avoid them clearing the power zones and messing everything up. For this purpose, I'm using the Global scriptWorkingCardC variable, which is otherwise used by the global code for double-click protection on the "Gain a Major/Minor".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh i see how this works now, thanks

objects/c4e8cd/script.lua Show resolved Hide resolved
@iakona iakona merged commit 863ecbb into spirit-island:beta Nov 25, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants