@@ -0,0 +1,2899 @@
+package com.davidvyee.battlebattle.simulator.card.impl;%0A%0Aimport com.davidvyee.battlebattle.simulator.card.Action;%0Aimport com.davidvyee.battlebattle.simulator.card.Card;%0A%0Apublic class Barbarian extends Card %7B%0A    private int damageBonus = 1;%0A    private int damageReceiveFactor = 2;%0A    private int numberOfExtraDice = 2;%0A%0A    public Barbarian() %7B%0A        super(6, 0);%0A    %7D%0A%0A    public Barbarian(int health, int tokens) %7B%0A        super(health, tokens);%0A    %7D%0A%0A    public Barbarian(Barbarian copy) %7B%0A        super(copy);%0A        damageBonus = copy.damageBonus;%0A        damageReceiveFactor = copy.damageReceiveFactor;%0A        numberOfExtraDice = copy.numberOfExtraDice;%0A    %7D%0A%0A    @Override%0A    public int roll() %7B%0A        int roll = super.roll();%0A%0A        if (roll == 1 %7C%7C roll == 2 %7C%7C roll == 3)%0A            return 4;%0A%0A        return roll;%0A    %7D%0A%0A    @Override%0A    public void applyPassiveBeforeEvaluation(Action myAction, Action opponentAction) %7B%0A        myAction.getDamageReceive().setFactor(damageReceiveFactor);%0A    %7D%0A%0A    @Override%0A    public void applyPassiveAfterEvaluation(Action myAction, Action opponentAction) %7B%0A        int opponentHealth = opponentAction.getCard().getHealth();%0A        int bonusDamage = 0;%0A%0A        for (int i = 0; i %3C numberOfExtraDice; ++i) %7B%0A            int roll = super.roll();%0A            if (roll %3E opponentAction.getInitialAttack()) %7B%0A                bonusDamage += damageBonus;%0A            %7D%0A        %7D%0A%0A        bonusDamage *= opponentAction.getDamageReceive().getFactor();%0A%0A        if (bonusDamage %3E 0) %7B%0A            LOGGER.debug(String.format(%0A                    %22%25s rolled %25d extra dice and beat the opponent's initial roll of %25d to do a total extra damage of %25d!%22,%0A                    this.getClass().getSimpleName(), numberOfExtraDice, opponentAction.getInitialAttack(),%0A                    bonusDamage));%0A        %7D%0A%0A        opponentHealth -= bonusDamage;%0A        opponentAction.getCard().setHealth(opponentHealth);%0A    %7D%0A%0A    @Override%0A    public Action getBestAction(Action myRoll, Action theirRoll) %7B%0A        if (myRoll.isBestAction())%0A            return myRoll;%0A%0A        Action action = myRoll.copy();%0A        action.setBestAction(true);%0A%0A        return action;%0A    %7D%0A%0A    protected int getDamageBonus() %7B%0A        return damageBonus;%0A    %7D%0A%0A    protected void setDamageBonus(int damageBonus) %7B%0A        this.damageBonus = damageBonus;%0A    %7D%0A%0A    protected int getDamageReceiveFactor() %7B%0A        return damageReceiveFactor;%0A    %7D%0A%0A    protected void setDamageReceiveFactor(int damageReceiveFactor) %7B%0A        this.damageReceiveFactor = damageReceiveFactor;%0A    %7D%0A%0A    protected int getNumberOfExtraDice() %7B%0A        return numberOfExtraDice;%0A    %7D%0A%0A    protected void setNumberOfExtraDice(int numberOfExtraDice) %7B%0A        this.numberOfExtraDice = numberOfExtraDice;%0A    %7D%0A%0A    @Override%0A    public Card copy() %7B%0A        return new Barbarian(this);%0A    %7D%0A%0A%7D%0A

Add Barbarian card