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

nit: capitalization #3

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion 383a6ac2-6e52-40a5-980f-fade09e4908b/definition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,13 @@
<cardaction menu="Discard" shortcut="Del" execute="discard" />
<cardaction menu="Add Power Stage" shortcut="F1" execute="addCounter" />
<cardaction menu="Lower Power Stage" shortcut="F2" execute="removeCounter" />
<cardaction menu="Set Power Stage" shortcut="F3" execute="setCounter" />
<cardaction menu="Set Power Stage" shortcut="F3" execute="setCounter" />
<cardaction menu="Take Damage" shortcut="Ctrl+F1" execute="takeDamage" />
<cardactions menu="Take Qualified Damage">
<cardaction menu="Take Unpreventable Damage" shortcut="Ctrl+F2" execute="takeUnpreventableDamage" />
<cardaction menu="Take Banished Damage" shortcut="Ctrl+F3" execute="takeBanishedDamage" />
<cardaction menu="Take Unpreventable Banished Damage" shortcut="Ctrl+F4" execute="takeUnpreventableBanishedDamage" />
</cardactions>
<groupaction menu="Move to Next phase." default="False" shortcut="Ctrl+Enter" execute="nextPhase" />
<groupactions menu="Game Setup Automation">
<groupaction menu="Enable Automation" shortcut="Ctrl+A" execute="enableSetupAutomation" />
Expand Down
20 changes: 18 additions & 2 deletions 383a6ac2-6e52-40a5-980f-fade09e4908b/scripts/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,23 @@ def setCounter(card, x = 0, y = 0):
mute()
quantity = askInteger("How many counters", 0)
notify("{} sets {} counters on {}.".format(me, quantity, card))
card.markers[CounterMarker] = quantity
card.markers[CounterMarker] = quantity

def takeDamage(card, x = 0, y = 0):
mute()
manageDamage(card)

def takeUnpreventableDamage(card, x = 0, y = 0):
mute()
manageDamage(card, True, False)

def takeBanishedDamage(card, x = 0, y = 0):
mute()
manageDamage(card, False, True)

def takeUnpreventableBanishedDamage(card, x = 0, y = 0):
mute()
manageDamage(card, True, True)

def play(card, x = 0, y = 0):
mute()
Expand All @@ -112,7 +128,7 @@ def play(card, x = 0, y = 0):
card.moveToTable(cardPlayed_x_offset, cardPlayed_y_offset)
notify("{} plays {} from their {}.".format(me, card, src.name))
# When playing allies, automatically start at 3 stages
if "Ally" in card.Type:
if "Ally" in card.type:
card.markers[CounterMarker] = 3

def mulligan(group):
Expand Down
60 changes: 60 additions & 0 deletions 383a6ac2-6e52-40a5-980f-fade09e4908b/scripts/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,66 @@ def rejuvenate(cards = [], silent = False):
for card in cards:
card.moveToBottom(me.piles["Life Deck"])

def manageDamage(card, unpreventable = False, banished = False):
mute()
stageDamage = askInteger("How many STAGES of damage?", 0)
remainingLifeDamage = askInteger("How many LIFE CARDS of damage?", 0)
takenDamage = []
firstDragonBallRevealed = ""
if stageDamage > card.markers[CounterMarker]:
remainingLifeDamage += stageDamage - card.markers[CounterMarker]
if card.markers[CounterMarker] > 0:
notify("{} takes {} stages of damage on {}.".format(me, card.markers[CounterMarker], card))
card.markers[CounterMarker] = 0
elif stageDamage > 0:
notify("{} takes {} stages of damage on {}.".format(me, stageDamage, card))
card.markers[CounterMarker] -= stageDamage
while remainingLifeDamage > 0:
if len(me.piles["Life Deck"]) == 0:
notify("{}'s Life Deck is empty".format(me))
return
damageCard = me.piles["Life Deck"].top()
if banished:
damageCard.moveTo(me.piles["Removed from game"])
else:
damageCard.moveTo(me.piles["Discard Pile"])
remainingLifeDamage -= 1
notify("{} reveals {} as damage.".format(me, damageCard))
# add "if discarded from deck" check to pause damage
if len(me.piles["Life Deck"]) == 0:
notify("{}'s Life Deck is empty".format(me))
return
if "Dragon Ball" in damageCard.name:
dbInPlay = False
for c in table:
if c.name == damageCard.name:
dbInPlay = True
break
if dbInPlay:
damageCard.moveTo(me.piles["Removed from game"])
notify("{} is already in play, banishing this copy...".format(damageCard))
elif firstDragonBallRevealed == damageCard.name:
notify("{} is in a Dragon Ball Loop".format(me))
return
else:
if firstDragonBallRevealed == "":
firstDragonBallRevealed = damageCard.name
remainingLifeDamage += 1
notify("{} is not in play, returning to bottom of Life Deck".format(damageCard))
damageCard.moveToBottom(me.piles["Life Deck"])
if damageCard.endurance != "":
preventableAmount = int(damageCard.endurance)
if preventableAmount > remainingLifeDamage:
preventableAmount = remainingLifeDamage
if unpreventable:
preventableAmount = 0
choices = ['Banish to prevent {} life cards'.format(preventableAmount), 'Decline']
choice = askChoice("Revealed {}. Remaining damage = {}. Banish this card for endurance?".format(damageCard.name, remainingLifeDamage), choices)
if choice == 1:
damageCard.moveTo(me.piles["Removed from game"])
remainingLifeDamage -= preventableAmount
notify("{} prevented {} life cards of damage by banishing {} for endurance.".format(me, preventableAmount, damageCard))

def lookupAttackTable(group, x = 0, y = 0):
mute()
defenderPL = remoteCall(players[1], "lookupPowerLevel", [group, x, y])
Expand Down