-
-
Notifications
You must be signed in to change notification settings - Fork 67
fix sixth sense behaviour + extras #244
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
Conversation
|
i don't think this needs to be reviewed thoroughly |
|
ok now it does |
| # align sixth sense trigger behaviour with vanilla - STEAMODDED BUG | ||
| [[patches]] | ||
| [patches.pattern] | ||
| target = "card.lua" | ||
| pattern = '''if self.ability.name == 'Sixth Sense' and #context.full_hand == 1 and context.full_hand[1]:get_id() == 6 and G.GAME.current_round.hands_played == 0 then''' | ||
| position = 'after' | ||
| payload = '''if ( SMODS.find_card('j_sixth_sense') )[1] ~= self then return end''' | ||
| match_indent = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait what's the actual bug here? multiple sixth sense jokers all creating spectrals when only one should be created? or something else? also which steamodded code path even creates this behavior?
code injection is brutal to debug - we've seen this play out with talisman where the codebase is basically archaeological at this point. could we consider monkey patching / overriding the relevant steamodded method or sixth sense evaluation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
basically the card destruction calculate in vanilla looks like:
for j = 1, #G.jokers.cards do
destroyed = G.jokers.cards[j]:calculate_joker({destroying_card = scoring_hand[i], full_hand = G.play.cards})
if destroyed then break end
endthis is pretty simple, if a card destruction effect returns true for the card, then calculation loop is stopped early
smods calculation rework runs the cards and jokers through a bunch of stuff and doesn't exactly present an easy opportunity for the break to happen, so much so that steamodded discord is discussing a similar hardcode for this behaviour
this is the easiest fix for now, i hope a new smods release will fix this and we can remove this eventually
|
btw if this could merge after the lobby refactor that’d be goated - would save me from merge conflict hell |
|
Git is confusing me with this merge resolve.. cuz I think its neither, it was conflicting because literally none of those functions on either side exist anymore. Hopefully I didn't break anything |
fix sixth sense behaviour + extras
fix sixth sense behaviour + extras
one patch pr