Add enchantment system #31

Closed
opened 2023-04-15 20:21:08 +00:00 by LunarTides · 0 comments
LunarTides commented 2023-04-15 20:21:08 +00:00 (Migrated from github.com)

This will make cards changing mana cost actually cooperate.

How it will work:
Enchantments will be an array added to cards.
The game can push something like:
+1 Mana
-1 Mana
Mana = 1
to the array in order to change the variable accordingly.
You can change all variables in a card. Do this by doing something like

card[key] -= val;

(key is 'mana', val is 1)

Have the = enchantment apply first. For example if a minion has the enchantments:
-1 Mana
Mana = 1
in that order, the resulting cost of that card should be 0.

The enchantments should be displayed when viewing a card.

The enchantments can apply when an enchantment is added. This means all variables need a baseline. You can use the backups variable for this.
Alternatively you can apply them in game.stats.updateCards when triggering game-passives. Not sure of the logistics of this route, but it may work better.

Add a whitelist of the numbers that will be reset to their baseline, and only do so if the number gets changed by an enchantment currently on the card.

  • Add most of the enchantment system
  • Add whitelist and only reset a variable if it is in the enchantment list
  • Update cards
  • Test cards
This will make cards changing mana cost actually cooperate. How it will work: Enchantments will be an array added to cards. The game can push something like: `+1 Mana` `-1 Mana` `Mana = 1` to the array in order to change the variable accordingly. You can change all variables in a card. Do this by doing something like ```js card[key] -= val; ``` (key is 'mana', val is 1) Have the = enchantment apply first. For example if a minion has the enchantments: `-1 Mana` `Mana = 1` in that order, the resulting cost of that card should be 0. The enchantments should be displayed when viewing a card. The enchantments can apply when an enchantment is added. This means all variables need a baseline. You can use the `backups` variable for this. Alternatively you can apply them in `game.stats.updateCards` when triggering game-passives. Not sure of the logistics of this route, but it may work better. Add a whitelist of the numbers that will be reset to their baseline, and only do so if the number gets changed by an enchantment currently on the card. - [x] Add most of the enchantment system - [x] Add whitelist and only reset a variable if it is in the enchantment list - [x] Update cards - [x] Test cards
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
LunarTides/Hearthstone.js#31
No description provided.