コード例 #1
0
#Simple variables
NAME = "Generator"
DESC = "Grants 1 energy."
ENERGY = 1
TRIGGER = None


#What happens when you play it
def playFunc(ply, enemy):
    return


#Abilities that only happens when the Node is spawned
def oneTimeFunc(ply, enemy):
    return


#What happens when it's sacrificed/killed
def deathFunc(ply, enemy):
    return


#What happens when the TRIGGER is triggered
def triggerFunc(ply, enemy):
    return


addNode(NAME, DESC, playFunc, oneTimeFunc, ENERGY, deathFunc, TRIGGER,
        triggerFunc)
コード例 #2
0
ファイル: Swarmer.py プロジェクト: timswyzen/discordTCG
#!/user/bin/env python

from cardList import addNode
import mechanics

# Simple variables
from classes.NodeFunction import NodeFunction

NAME = "Swarmer"
DESC = "At the start of your turn, deal 1 damage to your opponent for each Swarmer you control."
ENERGY = -3


# What happens when you play it (at the start of your turn)
async def turn_func(ply, enemy, data, affected_player):
    if affected_player == "self":
        await mechanics.damage(enemy, ply.nodes.count('Swarmer'))
    else:
        return False


FUNC_LIST = [NodeFunction(func=turn_func, trigger_type="TURN_START")]

addNode(NAME, DESC, ENERGY, FUNC_LIST)