Lua Effect Documentation v1.4
WARNING: There's a special random algorithm inside the engine. It is impossible to use lua or any other random inside the script without breaking a game while running your script.

Changes in 1.5

  1. Bug fixed where some layouts were not working with string expressions
  1. getCardNameStringExpression(selector) added, returning name of the first card in selector, so you can use it to display card name whereever you want as string expression
  1. getFactionCount(selector) added, counting number of distinct factions in selector
  1. Reserve should now be working whenever you have any cards in reserve scroller
  1. skillSacrificePloc exposed. Contains cards sacrificed from skills scroller (abilities etc)
  1. moveToBottomDeckTarget(isHidden, order, playerExpression) added, allowing bottomdecking to any player’s deck
  1. createCardFromIdEffect(id, locExpression) added allowing creating a card using card string id. Like “influence”
  1. createAbilitySlot(t) now accepts t.displayText to be displayed when buffed card is zoomed in
  1. winEndReason, concedeEndReason extra end game reasons exposed over API
  1. appendEffect(effect) added, allowing to send an effect to the end of current effects queue (needed for endturneffect)
  1. .OrBool(boolExpression) added to allow chaining simple bool check along with card bool expressions. selector.where(isChampion().And(isCardStunned().OrBool(yourBookCheckHere)))
  1. player.cards.reserve added. you may put reserve cards there in script init data structure, no extra scripting needed
  1. reservePloc exposed via API
  1. randomStringExpression(expressions) added, allowing to pick one random from the list provided
  1. setPlayerNameExpressionEffect(name, player) added, so you can set player name using string expression
  1. noHeal player slot added, when on player - they can’t be healed
  1. healOverride player slot added. when on player - they get healed for 5 on their turn start instead of discarding a card
  1. healInsteadOfEffect(effect, healAmount) effect added. It heals for healAmount if healOverride is on current player
  1. controllerPid added - current card controller. Different from owner - player the card originated from
  1. isCardWithSlot(slotKey) card bool expression added
  1. isCardWithSlotString(slotKey, stringValue) - checks if card has a slot with a key and certain string value
  1. isCardAffordableExt(extraGold) - same as isCardAffordable, but you may also specify amount if virtual gold added to you actual gold (usable for cases like
  1. hasCardTag(tag) bool card expression added to check if card has given tag

Changes in 1.4

  1. divide(intDividendExpression, intDivisorExpression) added
  1. selector.avg(intCardExpression) added
  1. showTextExpressionEffect added
  1. Dynamic layouts - see “Dynamic string generation” section

Changes in 1.3

  1. getHeroLevel intExpression added
  1. getCardPrintedCost intExpression added
  1. intExpression players slots added

Changes in 1.2

  1. More ability triggers
  1. Custom ability triggers

Changes in 1.1

  1. IMPORTANT - set of mandatory player buffs changed. Check updated example scripts and update your scripts correspondingly
  1. transformTarget now properly changes card face on the board
  1. nuUndoEffect renamed to noUndoEffect
  1. createNoStunSlot added
  1. createNoDamageSlot added
  1. onZeroHealthTrigger added
  1. onLeavePlay trigger added
  1. drawToLocation can now directly accept integer
  1. createLayout(t) is now only way to create layouts for all types of items - cards, abilities, choices
  1. deck management fixed and should be more flexible now. you may easily clear hero deck on start now. See example_script_vs_ai_advanced_deck_management.lua for reference
  1. more frames. Frames with faction icon on another side added