peter1591 / hearthstone-ai

A Hearthstone AI based on Monte Carlo tree search and neural nets written in modern C++.
302 stars 49 forks source link

refine enchantments framework #22

Closed peter1591 closed 7 years ago

peter1591 commented 7 years ago

aura enchantment should be applied in-order

You play an Amani Berserker and Enrage it, giving it 5 Attack. You then play Humility on it, giving it 1 Attack. You then heal and Enrage it a second time - the new Enrage is at the end of order of play, going after the Humility effect and it now has 4 Attack.

use std::variant each enchantment entry is either an 'normal enchantment', or an 'aura enchantment'

peter1591 commented 7 years ago

When a minion is copied, all 'aura enchantments' should be removed

peter1591 commented 7 years ago

Rule 4d: Enchantments apply and modify Health/Attack/Mana costs the moment they are attached. However, during Aura Update (Health/Attack), the Enchantment List is re-processed and Health/Attack Auras, having a priority later than Health/Attack Enchantments, will be moved to the end of the Enchantment List during this timing. (However, Mana Cost Auras have no special priority compared to Mana Cost Enchantments.)

http://hearthstone.gamepedia.com/Advanced_rulebook#Enchantments

peter1591 commented 7 years ago

Fixed in commit: 98107028