Search in sources :

Example 1 with Minion

use of Minions.Minion in project cardgame1 by joey101937.

the class Hero method onTurnEnd.

public void onTurnEnd() {
    if (Board.playerHero == this)
        InputHandler.enabled = false;
    ArrayList<Minion> done = new ArrayList<>();
    while (true) {
        try {
            for (Minion m : minions.getStorage()) {
                if (m != null && !done.contains(m)) {
                    m.onTurnEnd();
                    done.add(m);
                }
            }
            break;
        } catch (ConcurrentModificationException cme) {
            System.out.println("cme at hero 134");
        }
    }
    this.turn = false;
}
Also used : ConcurrentModificationException(java.util.ConcurrentModificationException) Minion(Minions.Minion) ArrayList(java.util.ArrayList)

Example 2 with Minion

use of Minions.Minion in project cardgame1 by joey101937.

the class InputHandler method mouseReleased.

@Override
public void mouseReleased(MouseEvent e) {
    if (!Board.playerHero.turn || !enabled)
        return;
    Minion target = getMinionAt(e.getX() / Board.xScale, e.getY() / Board.yScale);
    Hero targetH = getHeroAt(e.getX() / Board.xScale, e.getY() / Board.yScale);
    if (target != null && selectedMinion != null && selectedMinion.owner != target.owner) {
        // Minion attacking minion
        selectedMinion.attack(target);
    }
    if (targetH != null && selectedMinion != null && selectedMinion.owner != targetH) {
        // Minion attacking hero
        selectedMinion.attack(targetH);
    }
    if (target != null && selectedCard != null && selectedCard.isTargeted) {
        // card cast with minion target
        selectedCard.cast(target);
    }
    if (targetH != null && selectedCard != null && selectedCard.isTargeted) {
        selectedCard.castOnHero(targetH);
    }
    selectedMinion = null;
    selectedCard = null;
}
Also used : Minion(Minions.Minion)

Example 3 with Minion

use of Minions.Minion in project cardgame1 by joey101937.

the class VisualEffectHandler method drawLineM.

/**
 * draws line from selected minion to location of the mouse
 * @param g
 */
public void drawLineM(Graphics2D g) {
    Minion selected = InputHandler.selectedMinion;
    if (selected == null)
        return;
    g.drawLine(selected.getXCordinate() + Minion.WIDTH / 2, selected.getYcoordinate() + Minion.HEIGHT / 2, Board.mouseX, Board.mouseY);
}
Also used : Minion(Minions.Minion)

Example 4 with Minion

use of Minions.Minion in project cardgame1 by joey101937.

the class CarnifishMinion method onSummon.

@Override
public void onSummon() {
    for (Minion m : owner.minions.getOccupants()) {
        if (m.name.equals("Baitfish")) {
            Sticker s = new Sticker(SpriteHandler.bloodMedium, this, AI.AI.speed);
            Main.wait(AI.AI.speed);
            m.destroy();
        }
    }
}
Also used : Sticker(cardgame1.Sticker) Minion(Minions.Minion)

Example 5 with Minion

use of Minions.Minion in project cardgame1 by joey101937.

the class SeaSerpentMinion method onSummon.

@Override
public void onSummon() {
    Sticker s = new Sticker(SpriteHandler.bloodMedium, this, AI.AI.speed / 2);
    Main.wait(AI.AI.speed / 2);
    for (Minion m : owner.minions.getOccupants()) {
        if (m.tribe != Tribe.Fish) {
            m.takeDamage(1);
        }
    }
    for (Minion m : owner.opponent.minions.getOccupants()) {
        if (m.tribe != Tribe.Fish) {
            m.takeDamage(1);
        }
    }
}
Also used : Sticker(cardgame1.Sticker) Minion(Minions.Minion)

Aggregations

Minion (Minions.Minion)28 Sticker (cardgame1.Sticker)7 Hero (cardgame1.Hero)5 ArrayList (java.util.ArrayList)3 ConcurrentModificationException (java.util.ConcurrentModificationException)2 SimulatedMinion (AI.SimulatedMinion)1 Card (Cards.Card)1 Trap (Cards.CardPurpose.Trap)1 BaitfishCard (Cards.Fish.BaitfishCard)1 SkeletonMinion (Minions.Undead.SkeletonMinion)1 Trap (Traps.Trap)1