demilich1 / metastone

Hearthstone simulator written in Java with full GUI support
GNU General Public License v2.0
132 stars 80 forks source link

Attack Debuff? #375

Closed KillaKing closed 7 years ago

KillaKing commented 7 years ago

Is there any way to code an attack debuff similar to how it's stated on this card?

DominusMaximus commented 7 years ago

This works:

{
    "name": "Glorious Defender",
    "baseManaCost": 6,
    "type": "MINION",
    "baseAttack": 7,
    "baseHp": 5,
    "heroClass": "ANY",
    "rarity": "RARE",
    "description": "Taunt. Battlecry: Gain -1/+1 for each enemy minion on the battlefield.",
    "battlecry": {
        "targetSelection": "NONE",
        "spell": {
            "class": "MetaSpell",
            "spells": [
                {
                    "class": "BuffSpell",
                    "target": "SELF",
                    "attackBonus": {
                        "class": "EntityCounter",
                        "target": "ENEMY_MINIONS",
                        "multiplier": -1
                    }
                },
                {
                    "class": "BuffSpell",
                    "target": "SELF",
                    "hpBonus": {
                        "class": "EntityCounter",
                        "target": "ENEMY_MINIONS"
                    }
                }
            ]
        }
    },
    "attributes": {
        "BATTLECRY": true,
        "TAUNT": true
    },
    "collectible": true,
    "set": "CLASSIC",
    "fileFormatVersion": 1
}