sIKE23 / Mage-Wars

Mage Wars for OCTGN
7 stars 5 forks source link

isInSameZone(card): function #322

Closed sIKE23 closed 8 years ago

sIKE23 commented 8 years ago

Many of the new effects and such in the game are zone based effects like Sol's. My thought was we could add this as function. This would let us do cool things like Unicorn regeneration. I know there are the following existing functions:

def getCardsInZone(zone) getZoneContaining(card)

so alot of the work is already done.

Now for the card I mention eairler:

processing Burns:

    if len(cardsWithBurn) > 0:
        notify("Resolving Burns for {}...".format(me))  #found at least one
        for card in cardsWithBurn:
            numMarkers = card.markers[Burn]
            burnDamage = 0
            burnsRemoved = 0
            for i in range(0, numMarkers):
                roll = rnd(0, 2)
                if roll == 0 and not isInSameZone(card, "Sol, Blazing Angel"):
                    card.markers[Burn] -= 1
                    burnsRemoved += 1
                burnDamage += roll
            #apply damage

you would pass the function the card with the Burn and the card you want to check for as a modifier. I just used the name of the angel as a place holder so you would see the logic.

Thoughts?

sIKE23 commented 8 years ago

I fiddled with the existing functions and I think I worked this out.....