Hi there, is there a way to randomly discard a card from your hand zone?
like say an enemy has an ability that causes you on your next turn to discard / remove 1 card at random after you draw?
or maybe you use a card that discard or removes a card at random?
and what about an ability like scry that lets you look at 3 random cards from your deck then can put a card of the 3 on top of the deck?
Viewing post in How would I do this? (Q&A Thread)
Hey Kobaltblue, while we don't have Random Discard as a Card Action keyword, you can do this using a Card Action Eval.
<Card Action> Eval SceneManager._scene._skillWindow.discardCard(Math.floor(Math.random() * (BattleManager.actor().handSize) + SceneManager._scene._skillWindow._itemsBeforeCards)) </Card Action>
This will discard a random card from your Hand. If you wanted to remove the card instead, you can use the following:
<Card Action> Eval SceneManager._scene._skillWindow.removeCard(Math.floor(Math.random() * (BattleManager.actor().handSize) + SceneManager._scene._skillWindow._itemsBeforeCards)) </Card Action>
If you wanted to discard/remove multiple at random, using the Conditional Card Actions statements, you can create a Loop like so:
<Card Actions> Eval $gameVariables.setValue(1, 3); Label Start If ($gameVariables.value(1) <= 0) Jump to End Eval SceneManager._scene._skillWindow.discardCard(Math.floor(Math.random() * (BattleManager.actor().handSize) + SceneManager._scene._skillWindow._itemsBeforeCards)) Wait 5 Eval $gameVariables.setValue(1, $gameVariables.value(1) - 1) Jump to Start Label End </Card Actions>This would Discard 3 Cards at Random from the hand of the current Actor.
As for Scry type effects, we have that working! You will need the new Card Action Pack 1 plugin that is available to supporters of our Patreon. We will eventually grandfather in the Patron plugin into CGC proper a few months down the line :)