Skip to content

Creating new Counters

icyethics edited this page Sep 5, 2025 · 3 revisions

Design Approach

Counters were made with a couple of assumptions about their design. You can dismiss some of these if your implementation conflicts with them. If so, however, it is good to consider whether your concept would be better implemented as another card layer, such as a Sticker or a Seal.

  • Counters have a numerical value (Mandatory)

Counters will always have a value that is numerical. Counters will have values applied automatically, and also be removed automatically when their value is 0.

  • Counters have an integer value (Recommended)

Counters are meant to count the number of times an effect is supposed to apply. The base assumption the API makes is that counters have an integer value so it is graspable for a player. However, counters will function with floats as values.

  • Cards can only have one type of Counter at the same time (Mandatory)

A card can only have one type of Counter, and applying a Counter will immediately remove the existing Counters and replace them with the newly applied ones. There is no visual system to easily handle multiple Counters being applied.

  • A Counter type can be applied to both a Joker and Playing Card (Recommended)

All counters that are provided currently apply to both Jokers and Playing Cards. To do this, Counters need two sprites, as Jokers display the sprite on their top-left corner, while playing cards do so on the bottom left.

  • Counter behaviour between Jokers and Playing Cards is symmetrical (Recommended)

Counters try and observe a consistent gameplay logic, meaning that if they trigger upon scoring, they will do so for both playing cards, and jokers. This helps players understand effects more intuitively, and avoids needing to adapt description based on the object it is applied to.

Counter Sprites

Counter sprites are 73x97 pixels, with the border pixel intended to remain transparent

Counters need two sprites, by default, as they are assumed to be able to be applied to playing cards and jokers. The API will assume that counter sprites are on the same atlas, with the Joker counter directly above the Playing Card counter. If this is the case, you will only need to provide one atlas, with the coordinates indicating the Joker counter.

Counter Object: Blockbuster.Counters.Counter

Class prefix: 'counter'

  • Required Parameters:
  • 'key'
  • 'loc_txt' or localization entry
  • Optional parameters (defaults):
  • 'atlas = 'blockbuster_counters', pos = { x = 0, y = 0 }'
  • 'config = {cap = 99}, no_collection, prefix_config'
  • 'discovered = false'
  • 'joker_only = false'
  • 'pcard_only = false'
  • 'counter_class = {}'

Counters will never increase their value beyond 99. Add a cap variable to the config and set it to a value of choice (below 99) to use it as the new maximum value.

The counter_class table allows you to add counters to specific pools that can be interacted with. The base mod adds the following classes:

'beneficial' > Any counters that have purely positive effects 'neutral' > Any counters with an effect that isn't purely positive or negative 'detrimental' > Any counters that have purely negative effects 'status' > any counter who's effect can be seen as a status effect 'score' > any counters that directly give score 'economy' > any counter that interacts with the game's economy 'debuff' > any counter that debuffs the parent card in some way

API methods

  • 'calculate(self, card, context)'

Functions identically to the calculate functions of Seals and Enhancements. If your counter has the default behaviour of ticking down by 1 when scored, use card:bb_increment_counter here. For counters that debuff cards, a new context was added, context.after_debuff, which is ran after context.after, and will ignore debuffs. Counters can use this to still increment while debuffed.

  • 'increment = function(self, card, number)'

Triggers when more counters are added. Does not trigger on the initial application.

  • 'add_counter = function(self, card, number)'

Triggers when counters are applied for the first time.

  • 'remove_counter = function(self, card)'

Triggers when the counters are removed from the card. Will not trigger when the card is destroyed.

  • 'remove_from_deck = function(from_debuff)'

Triggers when the card this counter is applied to is destroyed or removed in some way.

Clone this wiki locally