Search in sources :

Example 11 with Sticker

use of cardgame1.Sticker in project cardgame1 by joey101937.

the class VolcanoCard method cast.

/**
 * deals damage to target minion.
 * @param target
 * @return 1 if success, 0 if too expensive, -1 if opponent has no minions
 */
@Override
public int cast(Minion t) {
    if (owner.opponent.minions.numOccupants() == 0)
        return -1;
    // reutrn 0 if unaffordable
    if (!canAfford())
        return 0;
    for (Minion target : owner.opponent.minions.getOccupants()) {
        Sticker impactEffect = new Sticker(SpriteHandler.blastEffectSmall, target, AI.AI.speed / 3);
    }
    // first put the fire sticker on all targets, then apply damage. easier to follow this way.
    Main.wait(AI.AI.speed / 3);
    for (Minion target : owner.opponent.minions.getOccupants()) {
        target.takeDamage(spellDamage);
    }
    owner.resource -= cost;
    owner.hand.remove(this);
    TrapListener.onPlay(this);
    return 1;
}
Also used : Sticker(cardgame1.Sticker) Minion(Minions.Minion)

Example 12 with Sticker

use of cardgame1.Sticker in project cardgame1 by joey101937.

the class FrostDragonMinion method onSummon.

@Override
public void onSummon() {
    Sticker s = new Sticker(SpriteHandler.snowflakeLarge, this.getXCordinate() + Minion.WIDTH / 2, this.getYcoordinate() + Minion.HEIGHT / 2, AI.AI.speed);
    Main.wait(AI.AI.speed);
    for (Minion m : owner.opponent.minions.getOccupants()) {
        m.freeze();
    }
}
Also used : Sticker(cardgame1.Sticker) Minion(Minions.Minion)

Example 13 with Sticker

use of cardgame1.Sticker in project cardgame1 by joey101937.

the class PirranahMinion method onTurnEnd.

@Override
public void onTurnEnd() {
    if (isSilenced)
        return;
    if (isFrozen || owner.opponent.minions.numOccupants() == 0) {
        // do not attack if frozen
        isFrozen = false;
        return;
    }
    Sticker s = new Sticker(SpriteHandler.bloodMedium, this, AI.AI.speed / 2);
    Main.wait(AI.AI.speed / 2);
    int roll = (int) (Math.random() * (owner.opponent.minions.numOccupants()));
    Minion target = owner.opponent.minions.getOccupants().get(roll);
    this.refresh();
    this.attack(target);
    Main.wait(AI.AI.speed / 2);
}
Also used : Sticker(cardgame1.Sticker) Minion(Minions.Minion)

Example 14 with Sticker

use of cardgame1.Sticker in project cardgame1 by joey101937.

the class BaitfishMinion method onDeath.

@Override
public void onDeath() {
    Sticker s = new Sticker(SpriteHandler.skullMedium, this, 600);
    if (isSilenced)
        return;
    ArrayList<Minion> targets = new ArrayList<>();
    for (Minion m : owner.minions.getOccupants()) {
        if (m.tribe == Tribe.Fish && m != this)
            targets.add(m);
    }
    if (targets.isEmpty()) {
        System.out.println("no targets for baitfish death effect");
        owner.draw(new BaitfishCard());
        return;
    }
    Minion target = targets.get(Main.generateRandom(0, targets.size()));
    target.attack += 1;
    target.health += 1;
    target.proc();
    owner.draw(new BaitfishCard());
}
Also used : Sticker(cardgame1.Sticker) BaitfishCard(Cards.Fish.BaitfishCard) Minion(Minions.Minion) ArrayList(java.util.ArrayList)

Example 15 with Sticker

use of cardgame1.Sticker in project cardgame1 by joey101937.

the class PredationCard method cast.

@Override
public int cast(Minion target) {
    if (target == null || spellDamage < 1)
        return -1;
    // reutrn 0 if unaffordable
    if (!canAfford())
        return 0;
    target.takeDamage(spellDamage);
    Sticker impactEffect = new Sticker(SpriteHandler.bloodMedium, target, 300);
    owner.resource -= cost;
    owner.hand.remove(this);
    TrapListener.onPlay(this);
    return 1;
}
Also used : Sticker(cardgame1.Sticker)

Aggregations

Sticker (cardgame1.Sticker)20 Minion (Minions.Minion)7 ArrayList (java.util.ArrayList)2 Card (Cards.Card)1 BaitfishCard (Cards.Fish.BaitfishCard)1 SeaSerpentCard (Cards.Fish.SeaSerpentCard)1 ZombieMinion (Minions.Undead.ZombieMinion)1