acpennington / GoatController

The next great ygo sim
1 stars 2 forks source link

Add script to give opponent cards #270

Open scheibo opened 3 years ago

scheibo commented 3 years ago

I think the following cards are the only ones which this applies to:

I think in the case of the first 3 cards it's possible they don't just stay in the hand (if for example Reload is used, or Morphing Jar #2 on Amazoness Chain Master's stolen card, etc). In order to implement these we need a way of marking out which card is the opponent's card (it should retain the opponent's sleeve just like it would IRL, so its visible in the hand/deck if the players are using different sleeves) so that it can be returned to the original owner's graveyard when it is destroyed (I think this is how exchanged cards are ruled, etc.

I think the "simplest" way to accomplish this is through continued use of the 'sentinel' system introduced to handle alternative card arts - when a card is taken from an opponent, a * marker is added after the standard sentinel separator:

"Jinzo" -> "Jinzo|*"

Likewise, if the card is returned to its original player we simply remove the sentinel

"Jinzo|*" -> "Jinzo".

In the even that the card is using an alternative artwork this simply stacks

"Dark Magician|2" -> "Dark Magician|2*"

acpennington commented 3 years ago

We already have a boolean notOwned attribute that we can assign to any card, so it seems best to just stick with that. No need to use the sentinels I'm pretty sure.

scheibo commented 3 years ago

Isn't the representation of the deck and hand just a list of strings on the server? If not we probably need to fix the pending reveal hand PR.

acpennington commented 3 years ago

Currently the deck is represented in the following form: [ {name: Card A}, {name: Card B}, etc]. You can easily add notOwned in which case the list would look like [ {name: Card A, notOwned: true}, etc]

scheibo commented 3 years ago

Wonderful! Then I agree, {name: Card A, notOwned: true} is the right representation here. I've also fixed #263 to take into consideration that the deck/hand are Array<{name: string, notOwned?: boolean}> instead of just Array<string>

scheibo commented 3 years ago

So actually, reading through the rulings that are available and the official rule book, I think only Parasite Paracide can actually make it into the opponents deck (face up). It seems like the reload or morphing jar #2 etc cases would all return the cards back to original owner's deck. This doesnt really help a ton implementation wise as PP still exists, but I was interested in seeing how this mechanic worked so i did a deep dive.