diff --git a/Echoes of Valor/echoes_of_valor.lua b/Echoes of Valor/echoes_of_valor.lua new file mode 100644 index 0000000..953d53e --- /dev/null +++ b/Echoes of Valor/echoes_of_valor.lua @@ -0,0 +1,1439 @@ +require 'herorealms' +require 'decks' +require 'stdlib' +require 'timeoutai' +require 'hardai_2' +require 'aggressiveai' + +function p1BuffDef() + return createGlobalBuff({ + id = "starting_player_logic", + name = "Starting Player, skills and Ogre", + abilities = { + createAbility({ + id = "expend_all_skills_start", + trigger = startOfGameTrigger, + effect = moveTarget(loc(ownerPid, skillSacrificePloc)).apply(selectLoc(loc(ownerPid, skillsPloc))) + }), + createAbility({ + id = "return_all_skills", + trigger = endOfTurnTrigger, + check = getTurnsPlayed(ownerPid).lte(1) + .And(selectLoc(loc(ownerPid, discardPloc)).count().lte(0)), + effect = moveTarget(loc(ownerPid, skillsPloc)).apply(selectLoc(loc(ownerPid, skillSacrificePloc))) + }), + createAbility({ + id = "draw_logic_non_elves", + trigger = endOfTurnTrigger, + check = selectLoc(loc(ownerPid, buffsPloc)).where(isCardType(elfType)).count().lte(0), + effect = drawCardsEffect(5) + }), + createAbility({ + id = "draw_logic_elf_t1_starter", + trigger = endOfTurnTrigger, + check = getTurnsPlayed(ownerPid).lte(1) + .And(selectLoc(loc(ownerPid, buffsPloc)).where(isCardType(elfType)).count().gte(1)) + .And( + (selectLoc(loc(oppPid, buffsPloc)).where(isCardType(elfType)).count().lte(0) + .And(selectLoc(loc(oppPid, handPloc)).count().eq(5))) + .Or(selectLoc(loc(oppPid, buffsPloc)).where(isCardType(elfType)).count().gte(1) + .And(selectLoc(loc(oppPid, handPloc)).count().eq(3))) + ), + effect = drawCardsEffect(5) + }), + createAbility({ + id = "draw_logic_elf_t1_second", + trigger = endOfTurnTrigger, + check = getTurnsPlayed(ownerPid).lte(1) + .And(selectLoc(loc(ownerPid, discardPloc)).count().lte(0)) + .And(selectLoc(loc(ownerPid, buffsPloc)).where(isCardType(elfType)).count().gte(1)), + effect = drawCardsEffect(3) + }), + createAbility({ + id = "draw_logic_elf_t2+", + trigger = endOfTurnTrigger, + check = getTurnsPlayed(ownerPid).gte(2) + .And(selectLoc(loc(ownerPid, buffsPloc)).where(isCardType(elfType)).count().gte(1)), + effect = drawCardsEffect(5) + }), + createAbility({ + id = "ogre_affordability", + trigger = startOfGameTrigger, + check = selectLoc(loc(ownerPid, buffsPloc)).where(isCardType(ogreType)).count().gte(1), + effect = gainGoldEffect(1) + }) + } + }) +end + +function may_i_carddef() + return createActionDef({ + id = "may_i", + name = "May I?", + types = {actionType, noStealType}, + acquireCost = 0, + abilities = { + createAbility({ + id = "noElves", + trigger = onAcquireTrigger, + check = selectLoc(loc(currentPid, buffsPloc)) + .union(selectLoc(loc(oppPid, buffsPloc))) + .where(isCardType(elfType)).count().lte(0), + effect = drawCardsEffect(3).seq(drawToLocationEffect(5, loc(oppPid, handPloc))).seq(sacrificeTarget().apply(selectSource())) + }), + createAbility({ + id = "oneElf_currentPid", + trigger = onAcquireTrigger, + check = selectLoc(loc(currentPid, buffsPloc)).where(isCardType(elfType)).count().gte(1) + .And(selectLoc(loc(oppPid, buffsPloc)).where(isCardType(elfType)).count().lte(0)), + effect = drawCardsEffect(1).seq(drawToLocationEffect(5, loc(oppPid, handPloc))).seq(sacrificeTarget().apply(selectSource())) + }), + createAbility({ + id = "oneElf_oppPid", + trigger = onAcquireTrigger, + check = selectLoc(loc(currentPid, buffsPloc)).where(isCardType(elfType)).count().lte(0) + .And(selectLoc(loc(oppPid, buffsPloc)).where(isCardType(elfType)).count().gte(1)), + effect = drawCardsEffect(3).seq(drawToLocationEffect(3, loc(oppPid, handPloc))).seq(sacrificeTarget().apply(selectSource())) + }), + createAbility({ + id = "twoElves", + trigger = onAcquireTrigger, + check = selectLoc(loc(currentPid, buffsPloc)).where(isCardType(elfType)).count().gte(1) + .And(selectLoc(loc(oppPid, buffsPloc)).where(isCardType(elfType)).count().gte(1)), + effect = drawCardsEffect(1).seq(drawToLocationEffect(3, loc(oppPid, handPloc))).seq(sacrificeTarget().apply(selectSource())) + }), + createAbility({ + id = "cleanMarket", + trigger = onAcquireTrigger, + effect = sacrificeTarget().apply(selectLoc(centerRowLoc).union(selectLoc(loc(currentPid, discardPloc))).where(isCardType(noStealType))) + .seq(moveTarget(loc(currentPid, skillsPloc)).apply(selectLoc(loc(currentPid, skillSacrificePloc)))) + .seq(createCardEffect(preventDualAbilityUse(), loc(currentPid, buffsPloc))) + }) + }, + layout = createLayout({ + name = "May I?", + art = "art/epicart/dark_offering", + frame = "frames/coop_campaign_cardframe", + text = "You start the game.", + }) + }) +end + +function allow_me_carddef() + return createActionDef({ + id = "allow_me", + name = "Allow Me", + types = {actionType, noStealType}, + acquireCost = 0, + abilities = { + createAbility({ + id = "noElves", + trigger = onAcquireTrigger, + check = selectLoc(loc(currentPid, buffsPloc)) + .union(selectLoc(loc(oppPid, buffsPloc))) + .where(isCardType(elfType)).count().lte(0), + effect = drawCardsEffect(3).seq(drawToLocationEffect(5, loc(oppPid, handPloc))).seq(sacrificeTarget().apply(selectSource())) + }), + createAbility({ + id = "oneElf_currentPid", + trigger = onAcquireTrigger, + check = selectLoc(loc(currentPid, buffsPloc)).where(isCardType(elfType)).count().gte(1) + .And(selectLoc(loc(oppPid, buffsPloc)).where(isCardType(elfType)).count().lte(0)), + effect = drawCardsEffect(1).seq(drawToLocationEffect(5, loc(oppPid, handPloc))).seq(sacrificeTarget().apply(selectSource())) + }), + createAbility({ + id = "oneElf_oppPid", + trigger = onAcquireTrigger, + check = selectLoc(loc(currentPid, buffsPloc)).where(isCardType(elfType)).count().lte(0) + .And(selectLoc(loc(oppPid, buffsPloc)).where(isCardType(elfType)).count().gte(1)), + effect = drawCardsEffect(3).seq(drawToLocationEffect(3, loc(oppPid, handPloc))).seq(sacrificeTarget().apply(selectSource())) + }), + createAbility({ + id = "twoElves", + trigger = onAcquireTrigger, + check = selectLoc(loc(currentPid, buffsPloc)).where(isCardType(elfType)).count().gte(1) + .And(selectLoc(loc(oppPid, buffsPloc)).where(isCardType(elfType)).count().gte(1)), + effect = drawCardsEffect(1).seq(drawToLocationEffect(3, loc(oppPid, handPloc))).seq(sacrificeTarget().apply(selectSource())) + }), + createAbility({ + id = "cleanMarket", + trigger = onAcquireTrigger, + effect = sacrificeTarget().apply(selectLoc(centerRowLoc).union(selectLoc(loc(currentPid, discardPloc))).where(isCardType(noStealType))) + .seq(moveTarget(loc(currentPid, skillsPloc)).apply(selectLoc(loc(currentPid, skillSacrificePloc)))) + .seq(createCardEffect(preventDualAbilityUse(), loc(currentPid, buffsPloc))) + }), + }, + layout = createLayout({ + name = "Allow Me", + art = "art/epicart/cast_out", + frame = "frames/coop_campaign_cardframe", + text = "You start the game.", + }) + }) +end + +function after_you_carddef() + return createActionDef({ + id = "after_you", + name = "After You", + types = {actionType, noStealType}, + acquireCost = 0, + abilities = { + createAbility({ + id = "noElves", + trigger = onAcquireTrigger, + check = selectLoc(loc(currentPid, buffsPloc)) + .union(selectLoc(loc(oppPid, buffsPloc))) + .where(isCardType(elfType)).count().lte(0), + effect = drawCardsEffect(0).seq(drawToLocationEffect(3, loc(oppPid, handPloc))).seq(sacrificeTarget().apply(selectSource())) + }), + createAbility({ + id = "oneElf_currentPid", + trigger = onAcquireTrigger, + check = selectLoc(loc(currentPid, buffsPloc)).where(isCardType(elfType)).count().gte(1) + .And(selectLoc(loc(oppPid, buffsPloc)).where(isCardType(elfType)).count().lte(0)), + effect = drawCardsEffect(0).seq(drawToLocationEffect(3, loc(oppPid, handPloc))).seq(sacrificeTarget().apply(selectSource())) + }), + createAbility({ + id = "oneElf_oppPid", + trigger = onAcquireTrigger, + check = selectLoc(loc(currentPid, buffsPloc)).where(isCardType(elfType)).count().lte(0) + .And(selectLoc(loc(oppPid, buffsPloc)).where(isCardType(elfType)).count().gte(1)), + effect = drawCardsEffect(0).seq(drawToLocationEffect(1, loc(oppPid, handPloc))).seq(sacrificeTarget().apply(selectSource())) + }), + createAbility({ + id = "twoElves", + trigger = onAcquireTrigger, + check = selectLoc(loc(currentPid, buffsPloc)).where(isCardType(elfType)).count().gte(1) + .And(selectLoc(loc(oppPid, buffsPloc)).where(isCardType(elfType)).count().gte(1)), + effect = drawCardsEffect(0).seq(drawToLocationEffect(1, loc(oppPid, handPloc))).seq(sacrificeTarget().apply(selectSource())) + }), + createAbility({ + id = "cleanMarket", + trigger = onAcquireTrigger, + effect = sacrificeTarget().apply(selectLoc(centerRowLoc).union(selectLoc(loc(currentPid, discardPloc))).where(isCardType(noStealType))) + }), + }, + layout = createLayout({ + name = "After You", + art = "art/epicart/inner_peace", + frame = "frames/coop_campaign_cardframe", + text = "Opponent starts the game.", + }) + }) +end + +function go_ahead_carddef() + return createActionDef({ + id = "go_ahead", + name = "Please, Go Ahead", + types = {actionType, noStealType}, + acquireCost = 0, + abilities = { + createAbility({ + id = "noElves", + trigger = onAcquireTrigger, + check = selectLoc(loc(currentPid, buffsPloc)) + .union(selectLoc(loc(oppPid, buffsPloc))) + .where(isCardType(elfType)).count().lte(0), + effect = drawCardsEffect(0).seq(drawToLocationEffect(3, loc(oppPid, handPloc))).seq(sacrificeTarget().apply(selectSource())) + }), + createAbility({ + id = "oneElf_currentPid", + trigger = onAcquireTrigger, + check = selectLoc(loc(currentPid, buffsPloc)).where(isCardType(elfType)).count().gte(1) + .And(selectLoc(loc(oppPid, buffsPloc)).where(isCardType(elfType)).count().lte(0)), + effect = drawCardsEffect(0).seq(drawToLocationEffect(3, loc(oppPid, handPloc))).seq(sacrificeTarget().apply(selectSource())) + }), + createAbility({ + id = "oneElf_oppPid", + trigger = onAcquireTrigger, + check = selectLoc(loc(currentPid, buffsPloc)).where(isCardType(elfType)).count().lte(0) + .And(selectLoc(loc(oppPid, buffsPloc)).where(isCardType(elfType)).count().gte(1)), + effect = drawCardsEffect(0).seq(drawToLocationEffect(1, loc(oppPid, handPloc))).seq(sacrificeTarget().apply(selectSource())) + }), + createAbility({ + id = "twoElves", + trigger = onAcquireTrigger, + check = selectLoc(loc(currentPid, buffsPloc)).where(isCardType(elfType)).count().gte(1) + .And(selectLoc(loc(oppPid, buffsPloc)).where(isCardType(elfType)).count().gte(1)), + effect = drawCardsEffect(0).seq(drawToLocationEffect(1, loc(oppPid, handPloc))).seq(sacrificeTarget().apply(selectSource())) + }), + createAbility({ + id = "cleanMarket", + trigger = onAcquireTrigger, + effect = sacrificeTarget().apply(selectLoc(centerRowLoc).union(selectLoc(loc(currentPid, discardPloc))).where(isCardType(noStealType))) + }), + }, + layout = createLayout({ + name = "Please, Go Ahead", + art = "art/epicart/blind_faith", + frame = "frames/coop_campaign_cardframe", + text = "Opponent starts the game.", + }) + }) +end + +function let_s_see_carddef() + return createActionDef({ + id = "let_s_see", + name = "Let's See", + types = {actionType, noStealType}, + acquireCost = 0, + abilities = { + createAbility({ + id = "noElves", + trigger = onAcquireTrigger, + check = selectLoc(loc(currentPid, buffsPloc)).where(isCardType(elfType)).count().lte(0) + .And(selectLoc(loc(oppPid, buffsPloc)).where(isCardType(elfType)).count().lte(0)), + effect = randomEffect({ + valueItem(1, drawCardsEffect(3).seq(drawToLocationEffect(5, loc(oppPid, handPloc))).seq(sacrificeTarget().apply(selectSource())) + .seq(moveTarget(loc(currentPid, skillsPloc)).apply(selectLoc(loc(currentPid, skillSacrificePloc))))), + valueItem(1, drawCardsEffect(0).seq(drawToLocationEffect(3, loc(oppPid, handPloc))).seq(sacrificeTarget().apply(selectSource()))), + }) + }), + createAbility({ + id = "oneElf_currentPid", + trigger = onAcquireTrigger, + check = selectLoc(loc(currentPid, buffsPloc)).where(isCardType(elfType)).count().gte(1) + .And(selectLoc(loc(oppPid, buffsPloc)).where(isCardType(elfType)).count().lte(0)), + effect = randomEffect({ + valueItem(1, drawCardsEffect(1).seq(drawToLocationEffect(5, loc(oppPid, handPloc))).seq(sacrificeTarget().apply(selectSource())) + .seq(moveTarget(loc(currentPid, skillsPloc)).apply(selectLoc(loc(currentPid, skillSacrificePloc))))), + valueItem(1, drawCardsEffect(0).seq(drawToLocationEffect(3, loc(oppPid, handPloc))).seq(sacrificeTarget().apply(selectSource()))), + }) + }), + createAbility({ + id = "oneElf_oppPid", + trigger = onAcquireTrigger, + check = selectLoc(loc(currentPid, buffsPloc)).where(isCardType(elfType)).count().lte(0) + .And(selectLoc(loc(oppPid, buffsPloc)).where(isCardType(elfType)).count().gte(1)), + effect = randomEffect({ + valueItem(1, drawCardsEffect(3).seq(drawToLocationEffect(3, loc(oppPid, handPloc))).seq(sacrificeTarget().apply(selectSource())) + .seq(moveTarget(loc(currentPid, skillsPloc)).apply(selectLoc(loc(currentPid, skillSacrificePloc))))), + valueItem(1, drawCardsEffect(0).seq(drawToLocationEffect(1, loc(oppPid, handPloc))).seq(sacrificeTarget().apply(selectSource()))), + }) + }), + createAbility({ + id = "twoElves0", + trigger = onAcquireTrigger, + check = selectLoc(loc(currentPid, buffsPloc)).where(isCardType(elfType)).count().gte(1) + .And(selectLoc(loc(oppPid, buffsPloc)).where(isCardType(elfType)).count().gte(1)), + effect = randomEffect({ + valueItem(1, drawCardsEffect(1).seq(drawToLocationEffect(3, loc(oppPid, handPloc))).seq(sacrificeTarget().apply(selectSource())) + .seq(moveTarget(loc(currentPid, skillsPloc)).apply(selectLoc(loc(currentPid, skillSacrificePloc))))), + valueItem(1, drawCardsEffect(0).seq(drawToLocationEffect(1, loc(oppPid, handPloc))).seq(sacrificeTarget().apply(selectSource()))), + }) + }), + createAbility({ + id = "cleanMarket", + trigger = onSacrificeTrigger, + effect = sacrificeTarget().apply(selectLoc(centerRowLoc).where(isCardType(noStealType))).seq(sacrificeTarget().apply(selectSource())) + .seq(createCardEffect(preventDualAbilityUse(), loc(currentPid, buffsPloc))) + }), + }, + layout = createLayout({ + name = "Let's See", + art = "art/epicart/temporize", + frame = "frames/coop_campaign_cardframe", + text = "Let fate decide.", + }) + }) +end + +function setupGame(g) + registerCards(g, { --- THIS + go_ahead_carddef(), + let_s_see_carddef(), + allow_me_carddef(), + after_you_carddef(), + may_i_carddef(), + }) + standardSetup(g, { + description = "Echoes of Valor
The Realms Rising Commuity Event
Official Script
Special Thanks to Emil", + playerOrder = { plid1, plid2 }, + ai = ai.CreateKillSwitchAi(createAggressiveAI(), createHardAi2()), + timeoutAi = createTimeoutAi(), + opponents = { { plid1, plid2 } }, + centerRow = { "may_i" , "allow_me" , "let_s_see" , "after_you" , "go_ahead" }, --- THIS + players = { + { + id = plid1, + startDraw = 0, + init = { + fromEnv = plid1 + }, + cards = { + buffs = { + drawCardsCountAtTurnEndDef(0),--- THIS + p1BuffDef(),--- THIS + discardCardsAtTurnStartDef(), + fatigueCount(40, 1, "FatigueP1") + } + } + }, + { + id = plid2, + --isAi = true, + startDraw = 0, + init = { + fromEnv = plid2 + }, + cards = { + buffs = { + forceExplosion(), + drawCardsCountAtTurnEndDef(5), + discardCardsAtTurnStartDef(), + fatigueCount(40, 1, "FatigueP2") + } + } + } + } + }) +end + +function endGame(g) +end + + function setupMeta(meta) + meta.name = "echoes_of_valor" + meta.minLevel = 0 + meta.maxLevel = 0 + meta.introbackground = "" + meta.introheader = "" + meta.introdescription = "" + meta.path = "C:/Users/xTheC/Desktop/Git Repositories/hero-realms-lua-scripts/Echoes of Valor/echoes_of_valor.lua" + meta.features = { +} +end + +function forceExplosion() + --If Player 1 did not choose who was going first, player 2 goes first + return createGlobalBuff({ + id="forced_explosion", + name = "Forced Explosion", + abilities = { + createAbility({ + id="forced_ex_go", + cost = sacrificeSelfCost, + trigger = startOfTurnTrigger, + effect = ifElseEffect(selectLoc(loc(currentPid, handPloc)).count().gte(1), + nullEffect(), + moveTarget(loc(oppPid, deckPloc)).apply(selectLoc(loc(oppPid, handPloc)).take(5)) + .seq(acquireForFreeTarget().apply(selectLoc(centerRowLoc).where(isCardName("may_i")))) + ) + }), + } + }) +end + +function preventDualAbilityUse() + -- + return createGlobalBuff({ + id="prevent_dual_ability_use", + name = "Prevent Dual Ability Use", + abilities = {}, + cardEffectAbilities = { + createCardEffectAbility({ + id="prevent_dual_use", + cost = noCost, + trigger = locationChangedCardTrigger, + activations = multipleActivations, + effect = ifElseEffect(selectTargets().where(isCardAtLoc(skillSacrificePloc).And(isCardAbility()).And(isCardType(ancestryType).invert())).count().gte(1), + disableTarget({ endOfTurnExpiry }).apply(selectLoc(loc(currentPid, skillsPloc)).where(isCardAbility().And(isCardType(ancestryType).invert()))) + .seq(sacrificeSelf()), + nullEffect() + ) + }), + } + }) +end + + +--Card Overrides +--======================================================================================================= +-- +--Fighter +--======================================================================================================= +function fighter_rallying_flag_carddef() + local cardLayout = createLayout({ + name = "Rallying Flag", + art = "art/t_fighter_rallying_flag", + frame = "frames/Warrior_CardFrame", + cardTypeLabel = "Champion", + isGuard = true, + health = 1, + types = { championType, humanType, fighterType }, + xmlText = [[ + + + + ]] + }) + return createChampionDef({ + id = "fighter_rallying_flag", + name = "Rallying Flag", + acquireCost = 0, + health = 1, + isGuard = true, + layout = cardLayout, + types = { championType, humanType, fighterType }, + factions = {}, + abilities = { + createAbility({ + id = "fighter_rallying_flag", + trigger = autoTrigger, + activations = multipleActivations, + cost = expendCost, + effect = gainCombatEffect(1).seq(gainGoldEffect(1)) + }), + } + }) + end + --========================================= + function fighter_helm_of_fury_carddef() + local cardLayout = createLayout({ + name = "Helm of Fury", + art = "art/t_fighter_helm_of_fury", + frame = "frames/Warrior_CardFrame", + cardTypeLabel = "Magical Armor", + xmlText =[[ + + + + + + + + + + ]] + }) + local guardChamps = selectLoc(loc(currentPid, inPlayPloc)).where(isGuard()).count() + local disableHelm = disableTarget({ endOfTurnExpiry }).apply(selectLoc(loc(currentPid, skillsPloc)).where(isCardType(magicArmorType))) + -- + return createMagicArmorDef({ + id = "fighter_helm_of_fury", + name = "Helm of Fury", + types = {fighterType, magicArmorType, treasureType, headType}, + layout = cardLayout, + layoutPath = "icons/fighter_helm_of_fury", + abilities = { + createAbility({ + id = "helmGuard", + trigger = autoTrigger, + check = minHealthCurrent(20).And(guardChamps.gte(1)), + effect = gainCombatEffect(1).seq(gainGoldEffect(1)).seq(disableHelm) + }), + createAbility({ + id = "helmLateGuard", + trigger = onPlayTrigger, + activations = singleActivation, + check = minHealthCurrent(20), + effect = ifElseEffect(guardChamps.gte(1), + gainCombatEffect(1).seq(gainGoldEffect(1)).seq(disableHelm), + nullEffect()) + }), + createAbility({ + id = "helmHeal", + trigger = gainedHealthTrigger, + activations = singleActivation, + check = minHealthCurrent(20), + effect = ifElseEffect(guardChamps.gte(1), + gainCombatEffect(1).seq(gainGoldEffect(1)).seq(disableHelm), + nullEffect()) + }), + } + }) +end + +--Wizard +--======================================================================================================= +function wizard_treasure_map_carddef() + local cardLayout = createLayout({ + name = "Treasure Map", + art = "art/treasures/t_treasure_map", + frame = "frames/Wizard_CardFrame", + cardTypeLabel = "Item", + xmlText =[[ + + + + + + + + + + + + + + + + + + ]] + }) + -- + return createItemDef({ + id = "wizard_treasure_map", + name = "Treasure Map", + acquireCost = 0, + cardTypeLabel = "Item", + types = { itemType, noStealType, wizardType, reserveType}, + factions = {}, + layout = cardLayout, + playLocation = castPloc, + abilities = { + createAbility({ + id = "mapMain", + trigger = autoTrigger, + effect = gainGoldEffect(1), + }), + createAbility({ + id = "mapUI", + trigger = uiTrigger, + activations = multipleActivations, + check = hasPlayerSlot(currentPid, "mapNecro").Or(hasPlayerSlot(currentPid, "mapWild")), + effect = pushChoiceEffect({ + choices={ + { + effect = pushTargetedEffect({ + desc="Sacrifice a card in your hand or discard pile.", + min=0, + max=1, + validTargets = selectLoc(loc(currentPid, discardPloc)).union(selectLoc(loc(currentPid, handPloc))), + targetEffect = sacrificeTarget(), + }).seq(removeSlotFromPlayerEffect(currentPid, "mapNecro")), + layout = layoutCard({ + title = "Necros", + art = "art/treasures/t_treasure_map", + text = " Scrap a card in your hand or discard pile.", + }), + condition = hasPlayerSlot(currentPid, "mapNecro") + }, + { + effect = drawCardsEffect(1) + .seq(pushTargetedEffect({ + desc = "Discard a card.", + min = 1, + max = 1, + validTargets = selectLoc(loc(currentPid, handPloc)), + targetEffect = discardTarget(), + })) + .seq(removeSlotFromPlayerEffect(currentPid, "mapWild")), + layout = layoutCard({ + title = "Wild", + art = "art/treasures/t_treasure_map", + text = " Draw a card, then discard a card.", + }), + condition = hasPlayerSlot(currentPid, "mapWild") + } + } + }), + }), + createAbility({ + id = "necrosMain", + trigger = autoTrigger, + tags = {allyTag}, + allyFactions = {necrosFaction}, + effect = addSlotToPlayerEffect(currentPid, createPlayerSlot({ key = "mapNecro", expiry = { endOfTurnExpiry } })), + }), + createAbility({ + id = "guildMain", + trigger = autoTrigger, + tags = {allyTag}, + allyFactions = {guildFaction}, + effect = gainGoldEffect(2) + }), + createAbility({ + id = "wildMain", + trigger = autoTrigger, + tags = {allyTag}, + allyFactions = {wildFaction}, + effect = addSlotToPlayerEffect(currentPid, createPlayerSlot({ key = "mapWild", expiry = { endOfTurnExpiry } })), + }), + createAbility({ + id = "impMain", + trigger = autoTrigger, + tags = {allyTag}, + allyFactions = {imperialFaction}, + effect = gainHealthEffect(4) + }) + } + }) +end + +--Ranger +--======================================================================================================= +function ranger_honed_black_arrow_carddef() + local cardLayout = createLayout({ + name = "Honed Black Arrow", + art = "art/t_ranger_honed_black_arrow", + frame = "frames/Ranger_CardFrame", + cardTypeLabel = "Item", + xmlText =[[ + + + + + + + ]] + }) + -- + local bowInPlay = selectLoc(loc(currentPid, castPloc)).where(isCardType(bowType)).count() + -- + return createItemDef({ + id = "ranger_honed_black_arrow", + name = "Honed Black Arrow", + acquireCost = 0, + cardTypeLabel = "Item", + types = { itemType, noStealType, rangerType, arrowType}, + factions = {}, + layout = cardLayout, + playLocation = castPloc, + abilities = { + createAbility({ + id = "ranger_honed_black_arrow_combat", + effect =gainCombatEffect(4), + cost = noCost, + trigger = onPlayTrigger, + playAllType = noPlayPlayType, + tags = { gainCombatTag ,aiPlayAllTag } + }), + createAbility({ + id = "ranger_honed_black_arrow_draw", + effect = drawCardsWithAnimation(1), + cost = noCost, + trigger = autoTrigger, + activations = singleActivation, + check = selectLoc(currentInPlayLoc).union(selectLoc(currentCastLoc)).where(isCardType(bowType)).count().gte(1), + tags = { draw1Tag }, + aiPriority = ifInt( + selectLoc(currentInPlayLoc). + union(selectLoc(currentCastLoc)). + where(isCardType(bowType)).count().gte(1), toIntExpression(300), toIntExpression(-1)) + }) + }, + }) +end + +--Cleric +--======================================================================================================= +function cleric_redeemed_ruinos_carddef() + local cardLayout = createLayout({ + name = "Redeemed Ruinos", + art = "art/t_cleric_redeemed_ruinos", + frame = "frames/Cleric_CardFrame", + cardTypeLabel = "Champion", + isGuard = false, + health = 2, + types = { championType, noStealType, humanType, clericType, noKillType}, + xmlText = [[ + + + + + + + + + + + + + ]] + }) + return createChampionDef({ + id = "cleric_redeemed_ruinos", + name = "Redeemed Ruinos", + acquireCost = 0, + health = 2, + isGuard = false, + layout = cardLayout, + factions = {}, + types = { championType, noStealType, humanType, clericType, noKillType}, + tags = {noAttackButtonTag}, + abilities = { + createAbility({ + id = "cleric_redeemed_ruinos", + trigger = autoTrigger, + activations = multipleActivations, + cost = expendCost, + effect = gainGoldEffect(1) + }), + createAbility({ + id = "cleric_redeemed_ruinos_stunned", + trigger = onStunTrigger, + effect = healPlayerEffect(ownerPid, 2).seq(simpleMessageEffect("2 gained from Redeemed Ruinos")), + tags = { gainHealthTag } + }) + } + }) +end + +function ruinosDrawBuff() + return createGlobalBuff({ + id="cleric_redeemed_ruinos_stunned", + name="Ruinos Draw", + abilities = { + createAbility({ + id = "ruinos_draw", + triggerPriority = 10, + trigger = startOfTurnTrigger, + cost = sacrificeSelfCost, + effect = drawCardsEffect(1) + }), + }, + buffDetails = createBuffDetails({ + name = "Redeemed Ruinos", + art = "art/t_cleric_redeemed_ruinos", + text = "Draw a card." + }) + }) +end + +--========================================= +function cleric_brightstar_shield_carddef() + local cardLayout = createLayout({ + name = "Brightstar Shield", + art = "art/t_cleric_brightstar_shield", + frame = "frames/Cleric_CardFrame", + cardTypeLabel = "Item", + xmlText =[[ + + + + ]] + }) + local fetchShields = moveTarget(loc(ownerPid, discardPloc)).apply(selectLoc(loc(oppPid, asidePloc))) + -- local fetchShields = moveTarget(loc(ownerPid, discardPloc)).apply(selectLoc(loc(currentPid, asidePloc))) + --.seq(moveTarget(loc(ownerPid, discardPloc)).apply(selectLoc(loc(oppPid, asidePloc)))) + -- + local oneChamp = prepareTarget().apply(selectLoc(loc(currentPid,inPlayPloc))) + .seq(grantHealthTarget(2, { SlotExpireEnum.LeavesPlay }, fetchShields, "shield").apply(selectLoc(loc(currentPid,inPlayPloc)))) + .seq(moveTarget(asidePloc).apply(selectLoc(loc(currentPid, castPloc)).where(isCardName("cleric_brightstar_shield")))) + -- + local multiChamp = pushTargetedEffect({ + desc="Choose a champion to prepare and gain +2 defense from brightstar shield", + min=1, + max=1, + validTargets = selectLoc(loc(currentPid,inPlayPloc)).where(isCardChampion()), + targetEffect = prepareTarget().seq(grantHealthTarget(2, { SlotExpireEnum.LeavesPlay },fetchShields,"shield").apply(selectTargets())), + }) + .seq(moveTarget(asidePloc).apply(selectLoc(loc(currentPid, castPloc)).where(isCardName("cleric_brightstar_shield")))) + -- + local numChamps = selectLoc(loc(currentPid,inPlayPloc)).where(isCardChampion()).count() + -- + return createItemDef({ + id = "cleric_brightstar_shield", + name = "Brightstar Shield", + acquireCost = 0, + cardTypeLabel = "Item", + types = { itemType, noStealType, clericType, attachmentType}, + factions = {}, + layout = cardLayout, + playLocation = castPloc, + abilities = { + createAbility({ + id = "brightMain", + trigger = autoTrigger, + playAllType = blockPlayType, + effect = drawCardsEffect(1).seq(ifElseEffect(numChamps.eq(0), + nullEffect(), + ifElseEffect(numChamps.eq(1), + oneChamp, + multiChamp))) + }), + }, + }) +end + +--========================================= +function cleric_shining_breastplate_carddef() + local card_name = "cleric_shining_breastplate" + local cardLayout = createLayout({ + name = "Shining Breastplate", + art = "art/t_cleric_shining_breastplate", + frame = "frames/Cleric_CardFrame", + cardTypeLabel = "Magical Armor", + xmlText =[[ + + + + ]] + }) + local noCostChamps = selectLoc(loc(currentPid, discardPloc)).where(isCardChampion().And(getCardCost().eq(0))) + local gainedHealthKey = "gainedHealthThisTurn" + local gainedHealthSlot = createPlayerSlot({ key = gainedHealthKey, expiry = { endOfTurnExpiry } }) + return createMagicArmorDef({ + id = card_name, + name = "Shining Breastplate", + description = "Available at level 9", + acquireCost = 0, + types = { clericType, magicArmorType, treasureType, chestType }, + tags = { clericGalleryCardTag }, + level = 9, + abilities = { + createAbility({ + id = card_name .. "_auto_armor_on_start_turn_ability", + effect = pushTargetedEffect( + { + desc = "Choose a champion without a cost to put in play", + validTargets = noCostChamps, + min = 0, + max = 1, + targetEffect = moveTarget(currentInPlayLoc), + tags = {toughestTag} + } + ), + trigger = uiTrigger, + cost = expendCost, + check = getPlayerHealth(currentPid).eq(getPlayerMaxHealth(currentPid)) + .Or(hasPlayerSlot(currentPlayer(), gainedHealthKey)) + .And(noCostChamps.count().gte(1)) + .And(getPlayerHealth(currentPid).gte(25)), + tags = { gainCombatTag } + }), + createAbility({ + id = card_name .. "_track_health_gained", + effect = showTextEffect("Congrats on the heal!").seq( + addSlotToPlayerEffect(currentPlayer(), gainedHealthSlot)), + trigger = gainedHealthTrigger, + cost = noCost, + tags = { toughestTag } + }), + }, + layoutPath = "icons/" .. card_name, + layout = cardLayout + }) +end + +--Thief +--======================================================================================================= +function thief_silent_boots_carddef() + -- + local cardLayout = createLayout({ + name = "Silent Boots", + art = "art/t_thief_silent_boots", + frame = "frames/Thief_armor_frame", + xmlText = [[ + + + + + + + + + ]] + }) + -- + local cardLayoutBuy = createLayout({ + name = "Silent Boots", + art = "art/t_thief_silent_boots", + frame = "frames/Thief_armor_frame", + xmlText = [[ + + + + + + ]] + }) + -- + local cardLayoutTopDeck = createLayout({ + name = "Silent Boots", + art = "art/t_thief_silent_boots", + frame = "frames/Thief_armor_frame", + xmlText = [[ + + + + + + ]] + }) + -- + local effReveal = noUndoEffect().seq(moveTarget(revealPloc).apply(selectLoc(tradeDeckLoc).take(2).reverse()) + .seq(pushTargetedEffect({ + desc="Select one card to Sacrifice. The other card may be acquired for 1 less or put back on top of the market deck.", + min = 1, + max = 1, + validTargets = selectLoc(revealLoc), + targetEffect = sacrificeTarget(), + }))) + -- + local checkSelector = selectLoc(revealLoc).Where(isCardAcquirable().And(getCardCost().lte(getPlayerGold(currentPid).add(toIntExpression(1))))) + -- + local effTopOrBuy = noUndoEffect().seq(pushChoiceEffect({ + choices={ + { + effect = acquireTarget(1,discardPloc).apply(selectLoc(revealLoc)), + layout = cardLayoutBuy, + condition = checkSelector.count().gte(1), + }, + { + effect = moveTarget(tradeDeckLoc).apply(selectLoc(revealLoc)), + layout = cardLayoutTopDeck, + } + } + })) + -- + return createMagicArmorDef({ + id = "thief_silent_boots", + name = "Silent Boots", + types = { magicArmorType, thiefType, feetType, treasureType }, + layout = cardLayout, + abilities = { + createAbility({ + id = "triggerBoots", + trigger = uiTrigger, + layout = cardLayout, + promptType = showPrompt, + check = minHealthCurrent(10), + effect = noUndoEffect().seq(effTopOrBuy).seq(effReveal), + }), + }, + layoutPath = "icons/thief_silent_boots" + }) +end + +--========================================= +function thief_enchanted_garrote_carddef() + local cardLayout = createLayout({ + name = "Enchanted Garrote", + art = "art/t_thief_enchanted_garrote", + frame = "frames/Thief_CardFrame", + cardTypeLabel = "Item", + xmlText =[[ + + + + + + + ]] + }) + --Discard for chapions, Sacrificed for tokens + local stunnedChamps = selectLoc(loc(oppPid, discardPloc)).union(selectLoc(loc(oppPid, sacrificePloc))).where(isCardStunned()).count() + -- + return createItemDef({ + id = "thief_enchanted_garrote", + name = "Enchanted Garrote", + acquireCost = 0, + cardTypeLabel = "Item", + types = { itemType, noStealType, thiefType, garoteType, weaponType}, + factions = {}, + layout = cardLayout, + playLocation = castPloc, + abilities = { + createAbility({ + id = "garroteMain", + trigger = autoTrigger, + check = stunnedChamps.eq(0), + effect = gainCombatEffect(1).seq(gainGoldEffect(1)).seq(addSlotToPlayerEffect(currentPid, createPlayerSlot({ key = "champStunnedSlot", expiry = { endOfTurnExpiry } }))) + }), + createAbility({ + id = "garroteSlot", + trigger = autoTrigger, + check = hasPlayerSlot(currentPid, "champStunnedSlot").invert().And(stunnedChamps.gte(1)), + effect = gainCombatEffect(1).seq(gainGoldEffect(2)) + }), + createAbility({ + id = "garroteStun", + trigger = onStunGlobalTrigger, + activations = singleActivation, + effect = ifElseEffect(hasPlayerSlot(currentPid, "champStunnedSlot").And(stunnedChamps.gte(1)), + gainGoldEffect(1), + nullEffect()) + }) + }, + }) +end + + +--Barbarian +--======================================================================================================= +function barbarian_serrated_hand_axe_carddef() + local function isBerserk() + return countPlayerSlots(currentPid, berserkSlotKey).gte(1) + end + + local cardLayout = createLayout({ + name = "Serrated Hand Axe", + art = "art/classes/barbarian/serrated_hand_axe", + frame = "frames/barbarian_frames/barbarian_item_cardframe", + cardTypeLabel = "Item", + xmlText =[[ + + + + + + + + + + + ]] + }) + + return createItemDef({ + id = "barbarian_serrated_hand_axe", + name = "Serrated Hand Axe", + description = "Available at level 5", + types = { barbarianType, meleeWeaponType, weaponType, axeType }, + tags = { barbarianGalleryCardTag }, + level = 5, + acquireCost = 0, + abilities = { + createAbility({ + id = "barbarian_serrated_hand_axe_ability", + effect = gainCombatEffect(2), + cost = noCost, + trigger = onPlayTrigger, + tags = { gainCombatTag, aiPlayAllTag } + }), + createAbility({ + id = "barbarian_serrated_hand_axe_ability_auto", + effect = gainCombatEffect(4), + cost = noCost, + activations = singleActivation, + trigger = autoTrigger, + check = isBerserk(), + tags = { gainCombatTag, aiPlayAllTag } + }), + }, + layout = cardLayout + }) +end + +--Alchemist +--======================================================================================================= +function alchemist_spectrum_spectacles_carddef() + local cardLayout = createLayout({ + name = "Spectrum Spectacles", + art = "art/classes/alchemist/spectrum_spectacles", + frame = "frames/alchemist_frames/alchemist_skill_cardframe", + cardTypeLabel = "Magic Armor", + xmlText =[[ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]] + }) + -- + return createMagicArmorDef({ + id = "alchemist_spectrum_spectacles", + name = "Spectrum Spectacles", + acquireCost = 0, + cardTypeLabel = "Magic Armor", + types = { magicArmorType, noStealType, alchemistType}, + factions = {}, + layout = cardLayout, + playLocation = castPloc, + abilities = { + createAbility({ + id = "impMain", + trigger = autoTrigger, + tags = {allyTag}, + allyFactions = { imperialFaction, imperialFaction }, + check = minHealthCurrent(30), + effect = gainHealthEffect(2) + }), + createAbility({ + id = "necrosMain", + trigger = autoTrigger, + tags = {allyTag}, + allyFactions = {necrosFaction,necrosFaction}, + check = minHealthCurrent(30), + effect = gainCombatEffect(2) + }), + createAbility({ + id = "wildMain", + trigger = uiTrigger, + tags = {allyTag}, + allyFactions = {wildFaction,wildFaction}, + check = minHealthCurrent(30), + effect = drawCardsEffect(1).seq(pushTargetedEffect({ + desc = "Discard a card.", + min = 1, + max = 1, + validTargets = selectLoc(loc(currentPid, handPloc)), + targetEffect = discardTarget(), + })) + }), + createAbility({ + id = "guildMain", + trigger = autoTrigger, + tags = {allyTag}, + allyFactions = {guildFaction,guildFaction}, + check = minHealthCurrent(30), + effect = gainGoldEffect(1) + }), + } + }) +end + +--Necromancer +--======================================================================================================= +function necromancer_plague_belt_carddef() + local card_name = "necromancer_plague_belt" + local selector = selectLoc(currentInPlayLoc).where(isCardName("necromancer_skeleton_servant")) + + local cardLayout = createLayout({ + name = "Plague Belt", + art = "art/classes/necromancer/plague_belt", + frame = "frames/necromancer_frames/necromancer_skill_cardframe", + cardTypeLabel = "Magic Armor", + xmlText =[[ + + + + ]] + }) + + return createMagicArmorDef({ + id = card_name, + name = "Plague Belt", + description = "Available at level 9", + acquireCost = 0, + types = { necromancerType, magicArmorType }, + tags = { necromancerGalleryCardTag }, + level = 9, + abilities = { + createAbility({ + id = card_name .. "_ability", + effect = pushTargetedEffect({ + desc = "Choose a Skeleton Servant", + validTargets = selector, + min = 1, + max = 1, + targetEffect = transformTarget("necromancer_skeleton_warrior") + .seq(ignoreTarget(gainCombatEffect(selectTargets().count()))) + }), + cost = expendCost, + trigger = uiTrigger, + promptType = showPrompt, + check = getPlayerHealth(currentPid).gte(30).And(selector.count().gte(1)), + tags = { gainCombatTag, expendTag }, + aiPriority = toIntExpression(100), + layout = cardLayout + }) + }, + layoutPath = "icons/necromancer/" .. card_name, + layout = cardLayout + }) +end + +--========================================= +local function isSkeletonLimitExceeded() + return selectCurrentChampions().where(isCardType(skeletonType).And(isCardType(tokenType))).count().gte(12) +end + +local function createSkeletonInPlay(card) + return ifEffect( + isSkeletonLimitExceeded().invert(), + createCardEffect(card, currentInPlayLoc) + ) +end + + +function necromancer_voidstone_carddef() + local card_name = "necromancer_voidstone" + local selector = sacrificeSelector(selectLoc(currentDiscardLoc).union(selectLoc(centerRowLoc))) + + local cardLayout = createLayout({ + name = "Voidstone", + art = "art/classes/necromancer/voidstone", + frame = "frames/necromancer_frames/necromancer_item_cardframe", + cardTypeLabel = "Item", + xmlText =[[ + + + ]] + }) + + return createItemDef({ + id = card_name, + name = "Voidstone", + description = "Available at level 11", + types = { necromancerType }, + tags = { necromancerGalleryCardTag }, + level = 11, + acquireCost = 0, + abilities = { + createAbility({ + id = card_name .. "_ability_on_play", + effect = gainGoldEffect(2).seq(pushTargetedEffect({ + desc = "Sacrifice a card in your discard pile or in the market", + validTargets = selector, + min = 0, + max = 1, + targetEffect = ignoreTarget(ifEffect( + selectTargets().where(isCardChampion()).count().gte(1), + createSkeletonInPlay(necromancer_skeleton_warrior_carddef()))) + .seq(sacrificeTarget()) + })), + cost = noCost, + trigger = onPlayTrigger, + tags = { gainGoldTag }, + aiPriority = toIntExpression(100) + }) + }, + layoutPath = "icons/necromancer/" .. card_name, + layout = cardLayout + }) +end + +--Bard +--======================================================================================================= +function bard_coat_of_encores_carddef() + local card_name = "bard_coat_of_encores" + local cardLayout = createLayout({ + name = "Coat of Encores", + art = "art/classes/bard/bard_coat_of_encores", + frame = "frames/bard_frames/bard_item_cardframe", + cardTypeLabel = "Magical Armor", + xmlText = [[ + + + + + ]] + }) + local deckLayout = createLayout({ + name = "Coat of Encores", + art = "art/classes/bard/bard_coat_of_encores", + frame = "frames/bard_frames/bard_item_cardframe", + text = "Put a Song from your deck into your hand." + }) + local discardLayout = createLayout({ + name = "Coat of Encores", + art = "art/classes/bard/bard_coat_of_encores", + frame = "frames/bard_frames/bard_item_cardframe", + text = "Put a Song from your discard pile into your hand." + }) + + local deckSelector = selectLoc(currentDeckLoc).where(isCardType(songType)) + local discardSelector = selectLoc(currentDiscardLoc).where(isCardType(songType)) + + return createMagicArmorDef({ + id = card_name, + name = "Coat of Encores", + description = "Available at level 9", + acquireCost = 0, + types = { bardType, magicArmorType, backType }, + tags = { bardGalleryCardTag }, + level = 9, + abilities = { + createAbility({ + id = card_name .. "_ability", + effect = pushTargetedEffect({ + desc = "Discard a card to return a Song to your hand.", + min = 0, + max = 1, + validTargets = currentHand(), + targetEffect = discardTarget().seq(pushChoiceEffect({ + choices = { + { + effect = targeted( + toStringExpression("Choose a Song from your discard pile to put it in your hand."), + discardSelector, + 1, + 1, + moveTarget(currentHandLoc), + { fromdiscardtohandTag } + ), + layout = discardLayout, + condition = discardSelector.count().gte(1) + }, + { + effect = targeted( + toStringExpression("Choose a Song from your deck to put it in your hand."), + deckSelector, + 1, + 1, + moveTarget(currentHandLoc).seq(shuffleEffect(currentDeckLoc)).seq(animateShuffleDeckEffect(currentPlayer())), + { fromDeckToHandTag } + ), + layout = deckLayout, + condition = deckSelector.count().gte(1) + } + }, + })) + }), + cost = expendCost, + trigger = uiTrigger, + check = getPlayerHealth(currentPid).gte(30).And(currentHand().count().gte(1)), + promptType = showPrompt, + tags = { expendTag }, + aiPriority = toIntExpression(100), + layout = cardLayout + }) + }, + layoutPath = "icons/bard/bard_coat_of_encores", + layout = cardLayout + }) +end \ No newline at end of file diff --git a/Knights of Balance/knights_of_balance_v1.lua b/Knights of Balance/knights_of_balance_v1.lua index 34daec6..96fe732 100644 --- a/Knights of Balance/knights_of_balance_v1.lua +++ b/Knights of Balance/knights_of_balance_v1.lua @@ -34,7 +34,8 @@ function setupGame(g) }, hand = { --{ qty = 1, card = thief_enchanted_garrote_carddef() }, - --{ qty = 1, card = ranger_honed_black_arrow_carddef() }, + --{ qty = 1, card = ranger_parrot_carddef() }, + --{ qty = 1, card = cleric_redeemed_ruinos_carddef()}, --{ qty = 2, card = cleric_follower_b_carddef() }, --{ qty = 2, card = cleric_imperial_sailor_carddef() }, --{ qty = 1, card = cleric_brightstar_shield_carddef() }, @@ -74,6 +75,7 @@ function setupGame(g) deck = { }, hand = { + --{ qty = 1, card = thief_enchanted_garrote_carddef() }, --{ qty = 1, card = ranger_light_crossbow_carddef() }, --{ qty = 1, card = ranger_honed_black_arrow_carddef() }, --{ qty = 2, card = cleric_follower_b_carddef() }, @@ -116,6 +118,9 @@ end --Card Overrides --======================================================================================================= +-- +--Fighter +--======================================================================================================= function fighter_rallying_flag_carddef() local cardLayout = createLayout({ name = "Rallying Flag", @@ -127,7 +132,7 @@ function fighter_rallying_flag_carddef() types = { championType, humanType, fighterType }, xmlText = [[ - + ]] }) @@ -146,173 +151,71 @@ function fighter_rallying_flag_carddef() trigger = autoTrigger, activations = multipleActivations, cost = expendCost, - effect = gainCombatEffect(1).seq(gainGoldEffect(2)) + effect = gainCombatEffect(1).seq(gainGoldEffect(1)) }), } }) end --========================================= -function cleric_redeemed_ruinos_carddef() +function fighter_helm_of_fury_carddef() local cardLayout = createLayout({ - name = "Redeemed Ruinos", - art = "art/t_cleric_redeemed_ruinos", - frame = "frames/Cleric_CardFrame", - cardTypeLabel = "Champion", - isGuard = false, - health = 1, - types = { championType, noStealType, humanType, clericType, noKillType}, - xmlText = [[ - - - - - - - - - - + name = "Helm of Fury", + art = "art/t_fighter_helm_of_fury", + frame = "frames/Warrior_CardFrame", + cardTypeLabel = "Magical Armor", + xmlText =[[ + + + + + + + - + ]] }) - return createChampionDef({ - id = "cleric_redeemed_ruinos", - name = "Redeemed Ruinos", - acquireCost = 0, - health = 1, - isGuard = false, + local guardChamps = selectLoc(loc(currentPid, inPlayPloc)).where(isGuard()).count() + local disableHelm = disableTarget({ endOfTurnExpiry }).apply(selectLoc(loc(currentPid, skillsPloc)).where(isCardType(magicArmorType))) + --local disableHelm = nullEffect() + -- + return createMagicArmorDef({ + id = "fighter_helm_of_fury", + name = "Helm of Fury", + types = {fighterType, magicArmorType, treasureType, headType}, layout = cardLayout, - factions = {}, - types = { championType, noStealType, humanType, clericType, noKillType}, - tags = {noAttackButtonTag}, + layoutPath = "icons/fighter_helm_of_fury", abilities = { - createAbility({ - id = "cleric_redeemed_ruinos", - trigger = autoTrigger, - activations = multipleActivations, - cost = expendCost, - effect = gainHealthEffect(1).seq(gainGoldEffect(1)) - }), - createAbility({ - id = "cleric_redeemed_ruinos_stunned", - trigger = onStunTrigger, - effect = createCardEffect(ruinosDrawBuff(), oppBuff()).seq(simpleMessageEffect("Drawing a card next turn.")), - }) - } + createAbility({ + id = "helmGuard", + trigger = autoTrigger, + check = minHealthCurrent(20).And(guardChamps.gte(1)), + effect = gainCombatEffect(1).seq(gainGoldEffect(1)).seq(disableHelm) + }), + createAbility({ + id = "helmLateGuard", + trigger = onPlayTrigger, + activations = singleActivation, + check = minHealthCurrent(20), + effect = ifElseEffect(guardChamps.gte(1), + gainCombatEffect(1).seq(gainGoldEffect(1)).seq(disableHelm), + nullEffect()) + }), + createAbility({ + id = "helmHeal", + trigger = gainedHealthTrigger, + activations = singleActivation, + check = minHealthCurrent(20), + effect = ifElseEffect(guardChamps.gte(1), + gainCombatEffect(1).seq(gainGoldEffect(1)).seq(disableHelm), + nullEffect()) + }) + } }) end -function ruinosDrawBuff() - return createGlobalBuff({ - id="cleric_redeemed_ruinos_stunned", - name="Ruinos Draw", - abilities = { - createAbility({ - id = "ruinos_draw", - triggerPriority = 10, - trigger = startOfTurnTrigger, - cost = sacrificeSelfCost, - effect = drawCardsEffect(1) - }), - }, - buffDetails = createBuffDetails({ - name = "Redeemed Ruinos", - art = "art/t_cleric_redeemed_ruinos", - text = "Draw a card." - }) - }) - end ---========================================= --- function ranger_parrot_carddef() --- local cardLayout = createLayout({ --- name = "Parrot", --- art = "art/treasures/t_parrot", --- frame = "frames/Ranger_CardFrame", --- cardTypeLabel = "Champion", --- isGuard = false, --- health = 1, --- types = { championType, rangerType, reserveType, noKillType, parrotType}, --- xmlText = [[ --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ]] --- }) --- return createChampionDef({ --- id = "ranger_parrot", --- name = "Parrot", --- acquireCost = 0, --- health = 1, --- isGuard = false, --- layout = cardLayout, --- factions = {}, --- types = { championType, rangerType, reserveType, noKillType, parrotType}, --- tags = {noAttackButtonTag}, --- abilities = { --- createAbility({ --- id = "ranger_parrot", --- trigger = autoTrigger, --- activations = multipleActivations, --- cost = expendCost, --- effect = gainGoldEffect(2).seq(gainCombatEffect(1)) --- }), --- createAbility({ --- id = "ranger_parrot_discarded", --- trigger = onDiscardTrigger, --- activations = multipleActivations, --- effect = ifElseEffect(getPlayerDamageReceivedThisTurn(currentPid).eq(getPlayerDamageReceivedThisTurn(ownerPid)), --- drawCardsEffect(1), --- createCardEffect(parrotDrawBuff(), oppBuff()).seq(simpleMessageEffect("Drawing a card next turn."))) --- }), --- createAbility({ --- id = "ranger_parrot_killed", --- trigger = onLeavePlayTrigger, --- activations = multipleActivations, --- effect = createCardEffect(parrotDrawBuff(), oppBuff()).seq(simpleMessageEffect("Drawing a card next turn.")) --- }) --- } --- }) --- end - --- function parrotDrawBuff() --- return createGlobalBuff({ --- id="ranger_parrot_stunned", --- name="Parrot Draw", --- abilities = { --- createAbility({ --- id = "parrot_draw", --- triggerPriority = 10, --- trigger = startOfTurnTrigger, --- cost = sacrificeSelfCost, --- effect = drawCardsEffect(1) --- }), --- }, --- buffDetails = createBuffDetails({ --- name = "Parrot", --- art = "art/treasures/t_parrot", --- text = "Draw a card." --- }) --- }) --- end ---========================================= +--Wizard +--======================================================================================================= function wizard_treasure_map_carddef() local cardLayout = createLayout({ name = "Treasure Map", @@ -364,7 +267,7 @@ function wizard_treasure_map_carddef() choices={ { effect = pushTargetedEffect({ - desc="Sacrifice a card in your hand or dicard pile.", + desc="Sacrifice a card in your hand or discard pile.", min=0, max=1, validTargets = selectLoc(loc(currentPid, discardPloc)).union(selectLoc(loc(currentPid, handPloc))), @@ -373,7 +276,7 @@ function wizard_treasure_map_carddef() layout = layoutCard({ title = "Necros", art = "art/treasures/t_treasure_map", - text = " Scrap a card", + text = " Scrap a card in your hand or discard pile.", }), condition = hasPlayerSlot(currentPid, "mapNecro") }, @@ -429,186 +332,133 @@ function wizard_treasure_map_carddef() }) end ---============================================================== ---This map is kept here for record ---============================================================== -function TESTwizard_treasure_map_carddef() +--Ranger +--======================================================================================================= +function ranger_honed_black_arrow_carddef() local cardLayout = createLayout({ - name = "Treasure Map", - art = "art/treasures/t_treasure_map", - frame = "frames/Wizard_CardFrame", + name = "Honed Black Arrow", + art = "art/t_ranger_honed_black_arrow", + frame = "frames/Ranger_CardFrame", cardTypeLabel = "Item", xmlText =[[ - - - - - - - + + - - - - - - - + + ]] }) -- + local bowInPlay = selectLoc(loc(currentPid, castPloc)).where(isCardType(bowType)).count() + -- return createItemDef({ - id = "wizard_treasure_map", - name = "Treasure Map", + id = "ranger_honed_black_arrow", + name = "Honed Black Arrow", acquireCost = 0, cardTypeLabel = "Item", - types = { itemType, noStealType, wizardType, reserveType}, + types = { itemType, noStealType, rangerType, arrowType}, factions = {}, layout = cardLayout, playLocation = castPloc, abilities = { createAbility({ - id = "necrosMain", - trigger = uiTrigger, - tags = {allyTag}, - allyFactions = {necrosFaction}, - effect = pushTargetedEffect({ - desc="Sacrifice a card in your hand or dicard pile.", - min=0, - max=1, - validTargets = selectLoc(loc(currentPid, discardPloc)).union(selectLoc(loc(currentPid, handPloc))), - targetEffect = sacrificeTarget(), - }), - }), - createAbility({ - id = "guildMain", - trigger = autoTrigger, - tags = {allyTag}, - allyFactions = {guildFaction}, - effect = gainGoldEffect(2) - }), - createAbility({ - id = "wildMain", - trigger = uiTrigger, - tags = {allyTag}, - allyFactions = {wildFaction}, - effect = gainCombatEffect(2) - }), + id = "ranger_honed_black_arrow_combat", + effect =gainCombatEffect(4), + cost = noCost, + trigger = onPlayTrigger, + playAllType = noPlayPlayType, + tags = { gainCombatTag ,aiPlayAllTag } + }), createAbility({ - id = "impMain", - trigger = autoTrigger, - tags = {allyTag}, - allyFactions = {imperialFaction}, - effect = gainHealthEffect(4) - }) - } + id = "ranger_honed_black_arrow_draw", + effect = drawCardsWithAnimation(1), + cost = noCost, + trigger = autoTrigger, + activations = singleActivation, + check = selectLoc(currentInPlayLoc).union(selectLoc(currentCastLoc)).where(isCardType(bowType)).count().gte(1), + tags = { draw1Tag }, + aiPriority = ifInt( + selectLoc(currentInPlayLoc). + union(selectLoc(currentCastLoc)). + where(isCardType(bowType)).count().gte(1), toIntExpression(300), toIntExpression(-1)) + }) + }, }) end ---========================================= -function barbarian_plunder_carddef() + +--Cleric +--======================================================================================================= +function cleric_redeemed_ruinos_carddef() local cardLayout = createLayout({ - name = "Plunder", - art = "art/classes/barbarian/plunder", - frame = "frames/barbarian_frames/barbarian_skill_cardframe", - acquireCost = 0, - cardTypeLabel = "Action", - types = { actionType, barbarianType}, - factions = {}, - layout = cardLayout, - playLocation = castPloc, - xmlText = [[ - - + name = "Redeemed Ruinos", + art = "art/t_cleric_redeemed_ruinos", + frame = "frames/Cleric_CardFrame", + cardTypeLabel = "Champion", + isGuard = false, + health = 2, + types = { championType, noStealType, humanType, clericType, noKillType}, + xmlText = [[ + + + + + + + + + + - ]] + + ]] }) - -- - return createActionDef({ - id = "barbarian_plunder", - name = "Plunder", + return createChampionDef({ + id = "cleric_redeemed_ruinos", + name = "Redeemed Ruinos", acquireCost = 0, + health = 2, + isGuard = false, layout = cardLayout, - types = { actionType, barbarianType}, factions = {}, + types = { championType, noStealType, humanType, clericType, noKillType}, + tags = {noAttackButtonTag}, abilities = { createAbility({ - id = "barbarian_plunder", + id = "cleric_redeemed_ruinos", trigger = autoTrigger, - activations = sigleActivations, - cost = noCost, - effect = ifElseEffect(hasPlayerSlot(currentPid, berserkSlotKey), - pushTargetedEffect({ - desc="Acquire a card for free.", - min=0, - max=1, - validTargets = selectLoc(centerRowLoc).union(selectLoc(fireGemsLoc)).where(isCardAcquirable().And(getCardCost().lte(3))), - targetEffect = acquireForFreeTarget(), - }), - pushTargetedEffect({ - desc="Acquire a card for free.", - min=0, - max=1, - validTargets = selectLoc(centerRowLoc).union(selectLoc(fireGemsLoc)).where(isCardAcquirable().And(getCardCost().lte(2))), - targetEffect = acquireForFreeTarget(), - }) - ) + activations = multipleActivations, + cost = expendCost, + effect = gainGoldEffect(1) }), + createAbility({ + id = "cleric_redeemed_ruinos_stunned", + trigger = onStunTrigger, + effect = healPlayerEffect(ownerPid, 2).seq(simpleMessageEffect("2 gained from Redeemed Ruinos")), + tags = { gainHealthTag } + }) } }) end ---========================================= -function ranger_honed_black_arrow_carddef() - local cardLayout = createLayout({ - name = "Honed Black Arrow", - art = "art/t_ranger_honed_black_arrow", - frame = "frames/Ranger_CardFrame", - cardTypeLabel = "Item", - xmlText =[[ - - - - - - - ]] - }) - -- - local bowInPlay = selectLoc(loc(currentPid, castPloc)).where(isCardType(bowType)).count() - -- - return createItemDef({ - id = "ranger_honed_black_arrow", - name = "Honed Black Arrow", - acquireCost = 0, - cardTypeLabel = "Item", - types = { itemType, noStealType, rangerType, arrowType}, - factions = {}, - layout = cardLayout, - playLocation = castPloc, - abilities = { - createAbility({ - id = "honedMain", - trigger = autoTrigger, - playAllType = blockPlayType, - check = bowInPlay.gte(1), - effect = gainCombatEffect(4).seq(drawCardsEffect(1)) - }), - createAbility({ - id = "honedSlot", - trigger = autoTrigger, - playAllType = blockPlayType, - check = bowInPlay.eq(0), - effect = gainCombatEffect(4).seq(addSlotToPlayerEffect(currentPid, createPlayerSlot({ key = "bowPlayedSlot", expiry = { endOfTurnExpiry } }))) - }), - createAbility({ - id = "honedDraw", - trigger = onPlayTrigger, - activations = multipleActivations, - effect = ifElseEffect(hasPlayerSlot(currentPid, "bowPlayedSlot").And(bowInPlay.gte(1)), - drawCardsEffect(1), - nullEffect()) - }) - }, + +function ruinosDrawBuff() + return createGlobalBuff({ + id="cleric_redeemed_ruinos_stunned", + name="Ruinos Draw", + abilities = { + createAbility({ + id = "ruinos_draw", + triggerPriority = 10, + trigger = startOfTurnTrigger, + cost = sacrificeSelfCost, + effect = drawCardsEffect(1) + }), + }, + buffDetails = createBuffDetails({ + name = "Redeemed Ruinos", + art = "art/t_cleric_redeemed_ruinos", + text = "Draw a card." + }) }) end @@ -670,37 +520,33 @@ end --========================================= function cleric_shining_breastplate_carddef() - local cardLayout = createLayout({ + local card_name = "cleric_shining_breastplate" + local cardLayout = createLayout({ name = "Shining Breastplate", art = "art/t_cleric_shining_breastplate", frame = "frames/Cleric_CardFrame", cardTypeLabel = "Magical Armor", - xmlText =[[ - - - - - - - - - ]] + xmlText =[[ + + + + ]] }) - local noCostChamps = selectLoc(loc(currentPid, discardPloc)).where(isCardChampion().And(getCardCost().eq(0))) - -- + local noCostChamps = selectLoc(loc(currentPid, discardPloc)).where(isCardChampion().And(getCardCost().eq(0))) + local gainedHealthKey = "gainedHealthThisTurn" + local gainedHealthSlot = createPlayerSlot({ key = gainedHealthKey, expiry = { endOfTurnExpiry } }) return createMagicArmorDef({ - id = "cleric_shining_breastplate", + id = card_name, name = "Shining Breastplate", - types = {clericType, magicArmorType, treasureType, chestType}, - layout = cardLayout, - layoutPath = "icons/cleric_shining_breastplate", + description = "Available at level 9", + acquireCost = 0, + types = { clericType, magicArmorType, treasureType, chestType }, + tags = { clericGalleryCardTag }, + level = 9, abilities = { - createAbility( { - id = "cleric_shining_breastplate", - trigger = uiTrigger, - activations = singleActivation, - promptType = showPrompt, - layout = cardLayout, + createAbility({ + id = card_name .. "_auto_armor_on_start_turn_ability", effect = pushTargetedEffect( { desc = "Choose a champion without a cost to put in play", @@ -711,14 +557,30 @@ function cleric_shining_breastplate_carddef() tags = {toughestTag} } ), + trigger = uiTrigger, cost = expendCost, - check = minHealthCurrent(10).And(noCostChamps.count().gte(1)) - }) - } + check = getPlayerHealth(currentPid).eq(getPlayerMaxHealth(currentPid)) + .Or(hasPlayerSlot(currentPlayer(), gainedHealthKey)) + .And(noCostChamps.count().gte(1)) + .And(getPlayerHealth(currentPid).gte(25)), + tags = { gainCombatTag } + }), + createAbility({ + id = card_name .. "_track_health_gained", + effect = showTextEffect("Congrats on the heal!").seq( + addSlotToPlayerEffect(currentPlayer(), gainedHealthSlot)), + trigger = gainedHealthTrigger, + cost = noCost, + tags = { toughestTag } + }), + }, + layoutPath = "icons/" .. card_name, + layout = cardLayout }) end ---========================================= +--Thief +--======================================================================================================= function thief_silent_boots_carddef() -- local cardLayout = createLayout({ @@ -731,7 +593,7 @@ function thief_silent_boots_carddef() - + ]] @@ -757,32 +619,32 @@ function thief_silent_boots_carddef() xmlText = [[ - + ]] }) -- - local effReveal = noUndoEffect().seq(moveTarget(currentRevealLoc).apply(selectLoc(tradeDeckLoc).take(2).reverse()) + local effReveal = noUndoEffect().seq(moveTarget(revealPloc).apply(selectLoc(tradeDeckLoc).take(2).reverse()) .seq(pushTargetedEffect({ desc="Select one card to Sacrifice. The other card may be acquired for 1 less or put back on top of the market deck.", min = 1, max = 1, - validTargets = selectLoc(currentRevealLoc), + validTargets = selectLoc(revealLoc), targetEffect = sacrificeTarget(), }))) -- - local checkSelector = selectLoc(currentRevealLoc).Where(isCardAcquirable().And(getCardCost().lte(getPlayerGold(currentPid).add(toIntExpression(1))))) + local checkSelector = selectLoc(revealLoc).Where(isCardAcquirable().And(getCardCost().lte(getPlayerGold(currentPid).add(toIntExpression(1))))) -- local effTopOrBuy = noUndoEffect().seq(pushChoiceEffect({ choices={ { - effect = acquireTarget(1,discardPloc).apply(selectLoc(currentRevealLoc)), + effect = acquireTarget(1,discardPloc).apply(selectLoc(revealLoc)), layout = cardLayoutBuy, condition = checkSelector.count().gte(1), }, { - effect = moveTarget(tradeDeckLoc).apply(selectLoc(currentRevealLoc)), + effect = moveTarget(tradeDeckLoc).apply(selectLoc(revealLoc)), layout = cardLayoutTopDeck, } } @@ -823,8 +685,8 @@ function thief_enchanted_garrote_carddef() ]] }) - -- - local stunnedChamps = selectLoc(loc(oppPid, discardPloc)).where(isCardStunned()).count() + --Discard for chapions, Sacrificed for tokens + local stunnedChamps = selectLoc(loc(oppPid, discardPloc)).union(selectLoc(loc(oppPid, sacrificePloc))).where(isCardStunned()).count() -- return createItemDef({ id = "thief_enchanted_garrote", @@ -860,65 +722,65 @@ function thief_enchanted_garrote_carddef() }) end ---========================================= -function fighter_helm_of_fury_carddef() - local cardLayout = createLayout({ - name = "Helm of Fury", - art = "art/t_fighter_helm_of_fury", - frame = "frames/Warrior_CardFrame", - cardTypeLabel = "Magical Armor", + +--Barbarian +--======================================================================================================= +function barbarian_serrated_hand_axe_carddef() + local function isBerserk() + return countPlayerSlots(currentPid, berserkSlotKey).gte(1) + end + + local cardLayout = createLayout({ + name = "Serrated Hand Axe", + art = "art/classes/barbarian/serrated_hand_axe", + frame = "frames/barbarian_frames/barbarian_item_cardframe", + cardTypeLabel = "Item", xmlText =[[ - - - - - - - - - - ]] + + + + + + + + + + + ]] }) - local guardChamps = selectLoc(loc(currentPid, inPlayPloc)).where(isGuard()).count() - local disableHelm = disableTarget({ endOfTurnExpiry }).apply(selectLoc(loc(currentPid, skillsPloc)).where(isCardType(magicArmorType))) - --local disableHelm = nullEffect() - -- - return createMagicArmorDef({ - id = "fighter_helm_of_fury", - name = "Helm of Fury", - types = {fighterType, magicArmorType, treasureType, headType}, - layout = cardLayout, - layoutPath = "icons/fighter_helm_of_fury", + + return createItemDef({ + id = "barbarian_serrated_hand_axe", + name = "Serrated Hand Axe", + description = "Available at level 5", + types = { barbarianType, meleeWeaponType, weaponType, axeType }, + tags = { barbarianGalleryCardTag }, + level = 5, + acquireCost = 0, abilities = { - createAbility({ - id = "helmGuard", - trigger = autoTrigger, - check = minHealthCurrent(20).And(guardChamps.gte(1)), - effect = gainCombatEffect(1).seq(gainGoldEffect(1)).seq(disableHelm) - }), - createAbility({ - id = "helmLateGuard", - trigger = onPlayTrigger, - activations = singleActivation, - check = minHealthCurrent(20), - effect = ifElseEffect(guardChamps.gte(1), - gainCombatEffect(1).seq(gainGoldEffect(1)).seq(disableHelm), - nullEffect()) - }), - createAbility({ - id = "helmHeal", - trigger = gainedHealthTrigger, - activations = singleActivation, - check = minHealthCurrent(20), - effect = ifElseEffect(guardChamps.gte(1), - gainCombatEffect(1).seq(gainGoldEffect(1)).seq(disableHelm), - nullEffect()) - }) - } + createAbility({ + id = "barbarian_serrated_hand_axe_ability", + effect = gainCombatEffect(2), + cost = noCost, + trigger = onPlayTrigger, + tags = { gainCombatTag, aiPlayAllTag } + }), + createAbility({ + id = "barbarian_serrated_hand_axe_ability_auto", + effect = gainCombatEffect(4), + cost = noCost, + activations = singleActivation, + trigger = autoTrigger, + check = isBerserk(), + tags = { gainCombatTag, aiPlayAllTag } + }), + }, + layout = cardLayout }) end ---========================================= +--Alchemist +--======================================================================================================= function alchemist_spectrum_spectacles_carddef() local cardLayout = createLayout({ name = "Spectrum Spectacles", @@ -986,48 +848,7 @@ function alchemist_spectrum_spectacles_carddef() ]] - -- xmlText =[[ - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- ]] - }) + }) -- return createMagicArmorDef({ id = "alchemist_spectrum_spectacles", @@ -1081,90 +902,205 @@ function alchemist_spectrum_spectacles_carddef() }) end ---========================================= -function barbarian_disorienting_headbutt_carddef() - local cardLayout = createLayout({ - name = "Disorienting Headbutt", - art = "art/classes/barbarian/disorienting_headbutt", - frame = "frames/barbarian_frames/barbarian_skill_cardframe", - acquireCost = 0, - cardTypeLabel = "Action", - types = { actionType, barbarianType, currencyType, coinType}, - factions = {}, - layout = cardLayout, - playLocation = castPloc, - xmlText = [[ - - - - - - - ]] +--Necromancer +--======================================================================================================= +function necromancer_plague_belt_carddef() + local card_name = "necromancer_plague_belt" + local selector = selectLoc(currentInPlayLoc).where(isCardName("necromancer_skeleton_servant")) + + local cardLayout = createLayout({ + name = "Plague Belt", + art = "art/classes/necromancer/plague_belt", + frame = "frames/necromancer_frames/necromancer_skill_cardframe", + cardTypeLabel = "Magic Armor", + xmlText =[[ + + + + ]] }) - local isBerserk = hasPlayerSlot(currentPid, berserkSlotKey) - -- - return createActionDef({ - id = "disorienting_headbutt", - name = "Disorienting Headbutt", + + return createMagicArmorDef({ + id = card_name, + name = "Plague Belt", + description = "Available at level 9", acquireCost = 0, - layout = cardLayout, - types = { actionType, barbarianType, currencyType, coinType}, - factions = {}, + types = { necromancerType, magicArmorType }, + tags = { necromancerGalleryCardTag }, + level = 9, abilities = { - createAbility({ - id = "dhbSlot", - trigger = autoTrigger, - check = isBerserk.invert(), - effect = gainCombatEffect(1).seq(addSlotToPlayerEffect(currentPid, createPlayerSlot({ key = "notBerserkSlot", expiry = { endOfTurnExpiry } }))) - }), - createAbility({ - id = "dhbMain", - trigger = autoTrigger, - check = isBerserk, - effect = gainCombatEffect(1).seq(oppDiscardEffect(1)).seq(createCardEffect(disorientingHeadbuttBuff(), oppBuff())) + createAbility({ + id = card_name .. "_ability", + effect = pushTargetedEffect({ + desc = "Choose a Skeleton Servant", + validTargets = selector, + min = 1, + max = 1, + targetEffect = transformTarget("necromancer_skeleton_warrior") + .seq(ignoreTarget(gainCombatEffect(selectTargets().count()))) }), - createAbility({ - id = "dhbBerserkPostPlay", - trigger = onPlayTrigger, - effect = ifElseEffect(hasPlayerSlot(currentPid, "notBerserkSlot").And(isBerserk), - drawCardsEffect(100), - nullEffect()) - }) - } + cost = expendCost, + trigger = uiTrigger, + promptType = showPrompt, + check = getPlayerHealth(currentPid).gte(30).And(selector.count().gte(1)), + tags = { gainCombatTag, expendTag }, + aiPriority = toIntExpression(100), + layout = cardLayout + }) + }, + layoutPath = "icons/necromancer/" .. card_name, + layout = cardLayout }) end -function disorientingHeadbuttBuff() - local theftCards = selectLoc(loc(oppPid, discardPloc)).where(getCardCost().gte(1)).take(100) - local acquirableCards = selectLoc(centerRowLoc).union(selectLoc(fireGemsLoc)).union(theftCards).take(100) - return createGlobalBuff({ - id="disorienting_headbutt_buff", - name="Disorienting Headbutt", +--========================================= +local function isSkeletonLimitExceeded() + return selectCurrentChampions().where(isCardType(skeletonType).And(isCardType(tokenType))).count().gte(12) +end + +local function createSkeletonInPlay(card) + return ifEffect( + isSkeletonLimitExceeded().invert(), + createCardEffect(card, currentInPlayLoc) + ) +end + + +function necromancer_voidstone_carddef() + local card_name = "necromancer_voidstone" + local selector = sacrificeSelector(selectLoc(currentDiscardLoc).union(selectLoc(centerRowLoc))) + + local cardLayout = createLayout({ + name = "Voidstone", + art = "art/classes/necromancer/voidstone", + frame = "frames/necromancer_frames/necromancer_item_cardframe", + cardTypeLabel = "Item", + xmlText =[[ + + + ]] + }) + + return createItemDef({ + id = card_name, + name = "Voidstone", + description = "Available at level 11", + types = { necromancerType }, + tags = { necromancerGalleryCardTag }, + level = 11, + acquireCost = 0, abilities = { createAbility({ - id = "disorienting_headbutt_buff", - triggerPriority = 10, - trigger = startOfTurnTrigger, - effect = addSlotToTarget(createCostChangeSlot(-1, { endOfTurnExpiry })).apply(acquirableCards) - }), - createAbility({ - id = "disorienting_headbutt_buy", - triggerPriority = 10, - trigger = onAcquireGlobalTrigger, - effect = addSlotToTarget(createCostChangeSlot(1, { endOfTurnExpiry })).apply(acquirableCards).seq(sacrificeSelf()) - }), - createAbility({ - id = "disorienting_headbutt_cleanup", - triggerPriority = 10, - trigger = endOfTurnTrigger, - effect = sacrificeSelf() - }), + id = card_name .. "_ability_on_play", + effect = gainGoldEffect(2).seq(pushTargetedEffect({ + desc = "Sacrifice a card in your discard pile or in the market", + validTargets = selector, + min = 0, + max = 1, + targetEffect = ignoreTarget(ifEffect( + selectTargets().where(isCardChampion()).count().gte(1), + createSkeletonInPlay(necromancer_skeleton_warrior_carddef()))) + .seq(sacrificeTarget()) + })), + cost = noCost, + trigger = onPlayTrigger, + tags = { gainGoldTag }, + aiPriority = toIntExpression(100) + }) }, - buffDetails = createBuffDetails({ - name = "Disorienting Headbutt", - art = "art/classes/barbarian/disorienting_headbutt", - text = "If you're Berserk, opponent discards 1 and the next card they acquire this turn costs +1 gold." - }) + layoutPath = "icons/necromancer/" .. card_name, + layout = cardLayout + }) +end + +--Bard +--======================================================================================================= +function bard_coat_of_encores_carddef() + local card_name = "bard_coat_of_encores" + local cardLayout = createLayout({ + name = "Coat of Encores", + art = "art/classes/bard/bard_coat_of_encores", + frame = "frames/bard_frames/bard_item_cardframe", + cardTypeLabel = "Magical Armor", + xmlText = [[ + + + + + ]] + }) + local deckLayout = createLayout({ + name = "Coat of Encores", + art = "art/classes/bard/bard_coat_of_encores", + frame = "frames/bard_frames/bard_item_cardframe", + text = "Put a Song from your deck into your hand." + }) + local discardLayout = createLayout({ + name = "Coat of Encores", + art = "art/classes/bard/bard_coat_of_encores", + frame = "frames/bard_frames/bard_item_cardframe", + text = "Put a Song from your discard pile into your hand." + }) + + local deckSelector = selectLoc(currentDeckLoc).where(isCardType(songType)) + local discardSelector = selectLoc(currentDiscardLoc).where(isCardType(songType)) + + return createMagicArmorDef({ + id = card_name, + name = "Coat of Encores", + description = "Available at level 9", + acquireCost = 0, + types = { bardType, magicArmorType, backType }, + tags = { bardGalleryCardTag }, + level = 9, + abilities = { + createAbility({ + id = card_name .. "_ability", + effect = pushTargetedEffect({ + desc = "Discard a card to return a Song to your hand.", + min = 0, + max = 1, + validTargets = currentHand(), + targetEffect = discardTarget().seq(pushChoiceEffect({ + choices = { + { + effect = targeted( + toStringExpression("Choose a Song from your discard pile to put it in your hand."), + discardSelector, + 1, + 1, + moveTarget(currentHandLoc), + { fromdiscardtohandTag } + ), + layout = discardLayout, + condition = discardSelector.count().gte(1) + }, + { + effect = targeted( + toStringExpression("Choose a Song from your deck to put it in your hand."), + deckSelector, + 1, + 1, + moveTarget(currentHandLoc).seq(shuffleEffect(currentDeckLoc)).seq(animateShuffleDeckEffect(currentPlayer())), + { fromDeckToHandTag } + ), + layout = deckLayout, + condition = deckSelector.count().gte(1) + } + }, + })) + }), + cost = expendCost, + trigger = uiTrigger, + check = getPlayerHealth(currentPid).gte(30).And(currentHand().count().gte(1)), + promptType = showPrompt, + tags = { expendTag }, + aiPriority = toIntExpression(100), + layout = cardLayout + }) + }, + layoutPath = "icons/bard/bard_coat_of_encores", + layout = cardLayout }) - end \ No newline at end of file +end \ No newline at end of file