//0 = not dead, 1 = dead, 2 = overkill public int dealDamage(int damage, HearthstoneBoard board) { if (divineShield) { foreach (Card c in board.getBoardFromMinion(this)) { c.performedAction(new DivineShieldLossAction(this), board); } divineShield = false; board.printDebugMessage("Damage taken: 0 (divine shield pop) on " + getReadableName(), HearthstoneBoard.OutputPriority.DAMAGES); return(0); } hp = hp - damage; board.printDebugMessage("Damage taken: " + damage + " on " + getReadableName(), HearthstoneBoard.OutputPriority.DAMAGES); performedAction(new DamageTakenAction(), board); if (hp <= 0) { board.addToPendingDeath(this); if (hp < 0) { return(2); } else { return(1); } } return(0); }
public override void doAction(Action cause, Card user, HearthstoneBoard board, List <Card> alwaysUse) { board.printDebugMessage("Performing action: make extra summon: " + user, HearthstoneBoard.OutputPriority.EFFECTTRIGGERS); BoardSide userboard = board.getBoardFromMinion(user); for (int i = 0; i < userboard.IndexOf(user); i++) { if (userboard[i].hasEffect(this)) { return; } } if (current < 1) { current = count; } else { Card c = ((CardSpawnedAction)cause).spawnedCard(); if (c == user) { return; } current--; board.printDebugMessage("khadgar effect used, count is now " + current, HearthstoneBoard.OutputPriority.INTENSEDEBUG); board.addNewMinionToBoard(board.getPlayerFromMinion(user), c.copy().setId(board.getRandomNumber(1, 9999)), board.getPositionFromMinion(c), true); } }
public override void doAction(Action cause, Card user, HearthstoneBoard board, List <Card> alwaysUse) { board.printDebugMessage("Performing action: deathrattle dmg bonus: " + user, HearthstoneBoard.OutputPriority.EFFECTTRIGGERS); BoardSide userBoard = board.getBoardFromMinion(user); if (userBoard.Count == 1) { return; } for (int i = 0; i < times; i++) { while (true) { int target = board.getRandomNumber(0, userBoard.Count); if (userBoard[target] != user) { board.printDebugMessage("Giving damage bonus to " + userBoard[target].getReadableName(), HearthstoneBoard.OutputPriority.INTENSEDEBUG); userBoard[target].addAttack(user.getAttack(board)); break;; } } } }
public override void doAction(Action cause, Card user, HearthstoneBoard board, List <Card> alwaysUse) { board.printDebugMessage("Performing action: deathrattledivine: " + user, HearthstoneBoard.OutputPriority.EFFECTTRIGGERS); BoardSide userBoard = board.getBoardFromMinion(user); for (int i = 0; i < times; i++) { bool stop = true; foreach (Card c in userBoard) { if (c != user && !c.divineShield) { board.printDebugMessage("Found minion without divine shield " + c.getReadableName(), HearthstoneBoard.OutputPriority.INTENSEDEBUG); stop = false; } } if (stop) { return; } while (true) { int target = board.getRandomNumber(0, userBoard.Count); if (!userBoard[target].divineShield && userBoard[target] != user) { board.printDebugMessage("Giving divine shield to " + userBoard[target].getReadableName(), HearthstoneBoard.OutputPriority.INTENSEDEBUG); userBoard[target].setDivineShield(true); break; } } } }
public void performAttack(Card target, HearthstoneBoard board) { board.printDebugMessage("attacker: " + this.getReadableName() + " defender: " + target.getReadableName(), HearthstoneBoard.OutputPriority.ATTACKERS); if (board.turnbyturn) { Console.WriteLine("--------------------------------------"); Console.WriteLine("Attacker: " + this.getReadableName()); Console.WriteLine("Defender: " + target.getReadableName()); Console.ReadLine(); } if (board.stopFlag) { board.attacker = this; board.defender = target; board.finishedWorkFlag = true; while (board.stopFlag) { Thread.Sleep(100); } board.finishedWorkFlag = false; board.stopFlag = true; } this.performedAction(new AttackingAction(target), board); int returnAttack = target.poisonous ? 9999999 : target.getAttack(board); //target.dealDamage(getAttack(board), board); causeDamageToTarget(target, board, getAttack(board)); if (this.dealDamage(returnAttack, board) > 0) { foreach (Card c in board.getBoardFromMinion(target)) { c.performedAction(new GotKillAction(target), board); } } board.deathCheck(); //target.deathCheck(board); //this.deathCheck(board); attackPriority = Card.MAX_PRIORITY; board.printDebugMessage("attack perform finished from " + this.getReadableName() + " to " + target.getReadableName(), HearthstoneBoard.OutputPriority.ATTACKERS); if (board.printPriority >= HearthstoneBoard.OutputPriority.ATTACKERS) { board.printState(); } if (board.turnbyturn) { Console.WriteLine("--------------------------------------"); board.printState(); Console.ReadLine(); } }
public bool doStartOfTurnEffect(HearthstoneBoard board) { board.printDebugMessage("Doing start of turn effect on board with count " + Count, HearthstoneBoard.OutputPriority.INTENSEDEBUG); if (Count == 0) { return(false); } int c = 0; while (c < Count) { if (this[c].attackPriority != Card.MAX_PRIORITY) { this[c].attackPriority = Card.MAX_PRIORITY; if (this[c].hasStartofTurnEffect()) { this[c].performedAction(new StartofCombatAction(), board); board.deathCheck(); return(true); } } c++; } return(false); }
public override void doAction(Action cause, Card user, HearthstoneBoard board, List <Card> alwaysUse) { board.printDebugMessage("Performing action: bomb deathrattle: " + user, HearthstoneBoard.OutputPriority.EFFECTTRIGGERS); BoardSide opponentBoard = board.getOpponentBoardFromMinion(user); List <Card> targets = new List <Card>(); for (int i = 0; i < times; i++) { if (opponentBoard.Count == 0) { return; } Card target = opponentBoard.getRandomCardAlive(board); if (target == null) { return; } user.causeDamageToTarget(target, board, 4); targets.Add(target); } foreach (Card c in targets) { c.deathCheck(board); } }
public void performedAction(Action a, HearthstoneBoard hearthstoneBoard) { hearthstoneBoard.printDebugMessage("Received action " + a.getName() + " on " + this.getReadableName(), HearthstoneBoard.OutputPriority.COMMUNICATION); foreach (Effect e in effects) { e.performedAction(a, this, hearthstoneBoard, null); } }
public override void doAction(Action cause, Card user, HearthstoneBoard board, List <Card> alwaysUse) { board.printDebugMessage("Performing action: Adjacent + 1 from: " + user, HearthstoneBoard.OutputPriority.EFFECTTRIGGERS); foreach (Card c in alwaysUse) { c.tempAttackBonus += 1; } }
public override void doAction(Action cause, Card user, HearthstoneBoard board, List <Card> alwaysUse) { board.printDebugMessage("Performing action: random dr summon: " + user, HearthstoneBoard.OutputPriority.EFFECTTRIGGERS); for (int i = 0; i < times; i++) { board.addNewMinionToBoard(board.getPlayerFromMinion(user), getRandomCard(board).setAttackPriority(user.attackPriority), board.getPositionFromMinion(user) + i, true); } }
public override void doAction(Action cause, Card user, HearthstoneBoard board, List <Card> alwaysUse) { board.printDebugMessage("Performing action: deathrattlesummon: " + user, HearthstoneBoard.OutputPriority.EFFECTTRIGGERS); for (int i = 0; i < count; i++) { board.addNewMinionToBoard(board.getPlayerFromMinion(user), CardCreatorFactory.createFromName(summon).setAttackPriority(user.attackPriority), board.getPositionFromMinion(user) + i, true); } }
public override void doAction(Action cause, Card user, HearthstoneBoard board, List <Card> alwaysUse) { board.printDebugMessage("Performing action: deathrattlebuff: " + user.getReadableName(), HearthstoneBoard.OutputPriority.EFFECTTRIGGERS); foreach (Card c in board.getBoardFromMinion(user)) { c.addStats(buff, buff); } }
public void deathCheck(HearthstoneBoard board) { board.printDebugMessage("Performing death check on " + getReadableName(), HearthstoneBoard.OutputPriority.COMMUNICATION); if (!isAlive() && board.containsCard(this)) { this.performedAction(new DeadAction(), board); board.killOf(this); } }
public override void doAction(Action cause, Card user, HearthstoneBoard board, List <Card> alwaysUse) { board.printDebugMessage("Performing action: Mal'ganis hacky SoT effect " + user.getReadableName(), HearthstoneBoard.OutputPriority.EFFECTTRIGGERS); foreach (Card c in board.getBoardFromMinion(user)) { if (c != user && c.typeMatches(Card.Type.Demon)) { c.addStats(buff, buff); } } }
public override void doAction(Action cause, Card user, HearthstoneBoard board, List <Card> alwaysUse) { board.printDebugMessage("Performing action: cleave attack: " + user, HearthstoneBoard.OutputPriority.EFFECTTRIGGERS); Card target = ((AttackingAction)cause).target; var adj = board.getAdjacents(target); foreach (Card c in adj) { user.causeDamageToTarget(c, board, user.getAttack(board)); } }
public override void doAction(Action cause, Card user, HearthstoneBoard board, List <Card> alwaysUse) { board.printDebugMessage("Performing action: reborn: " + user.getReadableName(), HearthstoneBoard.OutputPriority.EFFECTTRIGGERS); if (golden) { board.addNewMinionToBoard(board.getPlayerFromMinion(user), CardCreatorFactory.createGoldenFromName(user.cardID).setHp(1).setAttackPriority(user.attackPriority).removeReborn(), board.getPositionFromMinion(user), true); } else { board.addNewMinionToBoard(board.getPlayerFromMinion(user), CardCreatorFactory.createFromName(user.cardID).setHp(1).setAttackPriority(user.attackPriority).removeReborn(), board.getPositionFromMinion(user), true); } }
public override void doAction(Action cause, Card user, HearthstoneBoard board, List <Card> alwaysUse) { board.printDebugMessage("Performing action: malganis death debuffer: " + user.getReadableName(), HearthstoneBoard.OutputPriority.EFFECTTRIGGERS); foreach (Card c in board.getBoardFromMinion(user)) { if (c != user && c.typeMatches(Card.Type.Demon)) { c.addStats(-buff, -buff); if (c.getHp(board) < 1) { c.setHp(1); } } } }
public override void doAction(Action cause, Card user, HearthstoneBoard board, List <Card> alwaysUse) { board.printDebugMessage("Performing action: overkill fire: " + user, HearthstoneBoard.OutputPriority.EFFECTTRIGGERS); BoardSide opponentBoard = board.getOpponentBoardFromMinion(user); if (opponentBoard.Count != 0) { for (int i = 0; i < opponentBoard.Count; i++) { if (opponentBoard[i].isAlive()) { user.causeDamageToTarget(opponentBoard[i], board, dmg); break; } } } }
public override void doAction(Action cause, Card user, HearthstoneBoard board, List <Card> alwaysUse) { board.printDebugMessage("Performing action: kangorssummon: " + user, HearthstoneBoard.OutputPriority.EFFECTTRIGGERS); int currentCount = count; BoardSide current = board.getBoardFromMinion(user); int counterBcLazy = 0; for (int i = 0; i < current.graveyard.Count && currentCount > 0; i++) { if (Card.typesMatches(current.graveyard[i].type, Card.Type.Mech)) { board.addNewMinionToBoard(board.getPlayerFromMinion(user), current.graveyard[i].revive().setAttackPriority(user.attackPriority), board.getPositionFromMinion(user) + counterBcLazy, true); counterBcLazy++; currentCount--; } } }
public override void doAction(Action cause, Card user, HearthstoneBoard board, List <Card> alwaysUse) { board.printDebugMessage("Performing action: Murloc damage bonus " + user, HearthstoneBoard.OutputPriority.EFFECTTRIGGERS); user.tempAttackBonus -= bonus; foreach (Card c in board.p1Board) { if (c.typeMatches(Card.Type.Murloc)) { user.tempAttackBonus += bonus; } } foreach (Card c in board.p2Board) { if (c.typeMatches(Card.Type.Murloc)) { user.tempAttackBonus += bonus; } } }
public override void doAction(Action cause, Card user, HearthstoneBoard board, List <Card> alwaysUse) { board.printDebugMessage("Performing action: death AoE: " + user.getReadableName(), HearthstoneBoard.OutputPriority.EFFECTTRIGGERS); List <Card> targets = new List <Card>(); foreach (Card c in board.p1Board) { if (c != user) { targets.Add(c); } } foreach (Card c in board.p2Board) { if (c != user) { targets.Add(c); } } foreach (Card c in targets) { user.causeDamageToTarget(c, board, dmg); } }
public override void doAction(Action cause, Card user, HearthstoneBoard board, List <Card> alwaysUse) { board.printDebugMessage("Performing action: start of turn fire: " + user, HearthstoneBoard.OutputPriority.EFFECTTRIGGERS); BoardSide opponentBoard = board.getOpponentBoardFromMinion(user); BoardSide current = board.getBoardFromMinion(user); int counter = 0; foreach (Card c in current) { if (c.typeMatches(Card.Type.Dragon)) { counter++; } } for (int i = 0; i < times; i++) { if (opponentBoard.Count == 0) { return; } int target = board.getRandomNumber(0, opponentBoard.Count); if (board.stopFlag) { board.attacker = user; board.defender = opponentBoard[target]; board.finishedWorkFlag = true; while (board.stopFlag) { Thread.Sleep(100); } board.finishedWorkFlag = false; board.stopFlag = true; } user.causeDamageToTarget(opponentBoard[target], board, counter); } }
public override void doAction(Action cause, Card user, HearthstoneBoard board, List <Card> alwaysUse) { board.printDebugMessage("Double deathrattle on: " + ((CardKilledAction)cause).killedCard().getReadableName(), HearthstoneBoard.OutputPriority.EFFECTTRIGGERS); BoardSide userboard = board.getBoardFromMinion(user); for (int i = 0; i < userboard.IndexOf(user); i++) { if (userboard[i].hasEffect(this)) { return; } } //Hack for making mal'ganis. Inte så snyggt men men if (((CardKilledAction)cause).killedCard().getName().Equals("Mal'Ganis")) { return; } for (int i = 0; i < times; i++) { ((CardKilledAction)cause).killedCard().performedAction(new DeadAction(), board); } }
public int getAttack(HearthstoneBoard board) { foreach (Card c in board.getAdjacents(this)) { c.performAdjacantEffects(this, board); } foreach (Card c in board.getBoardFromMinion(this)) { if (c != this) { c.performedAction(new CardLookingForAtkBonusAction(this), board); } } performedAction(new GetDamageAction(), board); int result = attack + tempAttackBonus; board.printDebugMessage("damagebonus: " + tempAttackBonus + "on " + getReadableName(), HearthstoneBoard.OutputPriority.COMMUNICATION); tempAttackBonus = 0; if (board.DeathwingPlayer > 0) { result += 2; } return(result); }
public override void doAction(Action cause, Card user, HearthstoneBoard board, List <Card> alwaysUse) { board.printDebugMessage("Performing action: buff friendly minion dmg: " + user, HearthstoneBoard.OutputPriority.EFFECTTRIGGERS); ((CardLookingForAtkBonusAction)cause).card().tempAttackBonus += dmg; }
public override void doAction(Action cause, Card user, HearthstoneBoard board, List <Card> alwaysUse) { board.printDebugMessage("Performing action: summon on damage taken: " + user, HearthstoneBoard.OutputPriority.EFFECTTRIGGERS); board.addNewMinionToBoard(board.getPlayerFromMinion(user), CardCreatorFactory.createFromName(summon).setAttackPriority(user.attackPriority), board.getPositionFromMinion(user), false); }
public override void doAction(Action cause, Card user, HearthstoneBoard board, List <Card> alwaysUse) { board.printDebugMessage("Performing action: double damage attack: " + user, HearthstoneBoard.OutputPriority.EFFECTTRIGGERS); user.setAtk(user.getAttack(board) * multiplier); }
public override void doAction(Action cause, Card user, HearthstoneBoard board, List <Card> alwaysUse) { board.printDebugMessage("Performing action: regain divine shield: " + user, HearthstoneBoard.OutputPriority.EFFECTTRIGGERS); user.setDivineShield(true); user.addAttack(dmg); }
public override void doAction(Action cause, Card user, HearthstoneBoard board, List <Card> alwaysUse) { board.printDebugMessage("Performing action: refresh divine shield: " + user.getReadableName(), HearthstoneBoard.OutputPriority.EFFECTTRIGGERS); user.divineShield = true; }
public override void doAction(Action cause, Card user, HearthstoneBoard board, List <Card> alwaysUse) { board.printDebugMessage("Performing action: buff from friendly death: " + user.getReadableName(), HearthstoneBoard.OutputPriority.EFFECTTRIGGERS); user.addAttack(dmg); user.addHp(hp); }