com.megacrit.cardcrawl.core.AbstractCreature Java Examples

The following examples show how to use com.megacrit.cardcrawl.core.AbstractCreature. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EntombedGrimoirePower.java    From jorbs-spire-mod with MIT License 6 votes vote down vote up
public EntombedGrimoirePower(final AbstractCreature owner, final AbstractCard cardToExhume, final int turnToExhume) {
    super(STATIC);

    // This prevents the power from stacking with other instances of itself for different card instances.
    // This is the same strategy used by TheBombPower.
    //
    // StSLib provides a NonStackablePower interface with similar functionality, but we're intentionally not using
    // it because it is hackier than the ID thing.
    ID = POWER_ID + "__" + (++instanceCounter);

    this.owner = owner;
    this.source = owner;
    this.amount = turnToExhume;

    this.cardToExhume = cardToExhume;
    this.turnToExhume = turnToExhume;

    isFirstTurn = true;
    type = EnumsPatch.SPECIAL;
    isTurnBased = false;

    updateDescription();
}
 
Example #2
Source File: RarePower.java    From StS-DefaultModBase with MIT License 6 votes vote down vote up
public RarePower(final AbstractCreature owner, final AbstractCreature source, final int amount) {
    name = NAME;
    ID = POWER_ID;

    this.owner = owner;
    this.amount = amount;
    this.source = source;

    type = PowerType.DEBUFF;
    isTurnBased = false;

    // We load those textures here.
    this.region128 = new TextureAtlas.AtlasRegion(tex84, 0, 0, 84, 84);
    this.region48 = new TextureAtlas.AtlasRegion(tex32, 0, 0, 32, 32);

    updateDescription();
}
 
Example #3
Source File: ArcaneWeaponPower.java    From jorbs-spire-mod with MIT License 6 votes vote down vote up
public ArcaneWeaponPower(final AbstractCreature owner, final AbstractCard backingCard) {
    super(STATIC);

    // This prevents the power from stacking with other instances of itself for different card instances.
    // This is the same strategy used by TheBombPower.
    //
    // StSLib provides a NonStackablePower interface with similar functionality, but we're intentionally not using
    // it because it is hackier than the ID thing.
    ID = POWER_ID + "__" + (++instanceCounter);

    this.type = PowerType.BUFF;
    this.owner = owner;
    this.backingCard = backingCard.makeStatEquivalentCopy();

    updateDescription();
}
 
Example #4
Source File: RenderHealthBar.java    From StSLib with MIT License 6 votes vote down vote up
@SpireInsertPatch(
        locator=Locator.class,
        localvars={"x", "y"}
)
public static void Insert(AbstractCreature __instance, SpriteBatch sb, float x, float y)
{
    if (HEALTH_BAR_HEIGHT == -1) {
        HEALTH_BAR_HEIGHT = 20.0f * Settings.scale;
        HEALTH_BAR_OFFSET_Y = -28.0f * Settings.scale;
    }

    if (!Gdx.input.isKeyPressed(Input.Keys.H)) {
        if (TempHPField.tempHp.get(__instance) > 0 && __instance.hbAlpha > 0) {
            renderTempHPIconAndValue(__instance, sb, x, y);
        }
    }
}
 
Example #5
Source File: Starburst.java    From FruityMod-StS with MIT License 6 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    AbstractDungeon.actionManager.addToBottom(new DamageAction((AbstractCreature) m,
            new DamageInfo(p, this.damage, DamageInfo.DamageType.NORMAL), AbstractGameAction.AttackEffect.BLUNT_HEAVY));

    AbstractRoom room = AbstractDungeon.currMapNode.room;
    int numMonsters = room.monsters.monsters.size();

    this.multiDamage = new int[numMonsters];
    for (int i = 0; i < multiDamage.length; i++) {
        this.multiDamage[i] = this.damage;
    }

    AbstractDungeon.actionManager.addToBottom(new VFXAction(AbstractDungeon.player, new CleaveEffect(), 0.0F));
    AbstractDungeon.actionManager.addToBottom(new DamageAllEnemiesAction(p, this.multiDamage, this.damageTypeForTurn,
            AbstractGameAction.AttackEffect.NONE));
}
 
Example #6
Source File: BurningPower.java    From jorbs-spire-mod with MIT License 6 votes vote down vote up
public BurningPower(AbstractCreature owner, AbstractCreature source, int burningAmt, boolean generatedByPyromancy) {
    super(STATIC);

    this.type = PowerType.DEBUFF;
    this.isTurnBased = true;

    this.owner = owner;
    this.source = source;
    this.amount = burningAmt;
    this.generatedByPyromancy = generatedByPyromancy;
    if (this.amount >= 9999) {
        this.amount = 9999;
    }
    if (!source.isPlayer) {
        this.justApplied = true;
    }

    this.loadRegion("attackBurn"); // TODO remove this once we have a unique icon

    this.updateDescription();
}
 
Example #7
Source File: DecreaseMaxHpAction.java    From jorbs-spire-mod with MIT License 6 votes vote down vote up
public DecreaseMaxHpAction(AbstractCreature target, AbstractCreature source, int amount, AttackEffect effect) {
    this.effect = effect;
    this.amount = amount;
    this.target = target;
    this.source = source;

    // This has the side effect of making the decrease still happen if an associated effect just recently ended combat.
    this.actionType = ActionType.DAMAGE;

    if (Settings.FAST_MODE) {
        this.startDuration = Settings.ACTION_DUR_XFAST;
    } else {
        this.startDuration = Settings.ACTION_DUR_FAST;
    }
    this.duration = this.startDuration;
}
 
Example #8
Source File: RenderTempHPOutline.java    From StSLib with MIT License 6 votes vote down vote up
@SpireInsertPatch(
        locator=Locator.class,
        localvars={"x", "y"}
)
public static void Insert(AbstractCreature __instance, SpriteBatch sb, float x, float y)
{
    if (HEALTH_BAR_HEIGHT == -1) {
        HEALTH_BAR_HEIGHT = 20.0f * Settings.scale;
        HEALTH_BAR_OFFSET_Y = -28.0f * Settings.scale;
    }

    if (!Gdx.input.isKeyPressed(Input.Keys.H)) {
        if (TempHPField.tempHp.get(__instance) > 0 && __instance.hbAlpha > 0) {
            renderTempHPOutline(__instance, sb, x, y);
        }
    }
}
 
Example #9
Source File: Surge.java    From FruityMod-StS with MIT License 5 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    AbstractDungeon.actionManager.addToBottom(new DamageAction((AbstractCreature) m, new DamageInfo(p, this.damage, this.damageTypeForTurn), AbstractGameAction.AttackEffect.SLASH_VERTICAL));
    if (AbstractDungeon.player.hasPower("Frail") || AbstractDungeon.player.hasPower("Vulnerable") || AbstractDungeon.player.hasPower("Weakened")) {
        AbstractDungeon.actionManager.addToBottom(new DamageAction((AbstractCreature) m, new DamageInfo(p, this.damage, this.damageTypeForTurn), AbstractGameAction.AttackEffect.SLASH_VERTICAL));
    }
}
 
Example #10
Source File: PlayerDamage.java    From StSLib with MIT License 5 votes vote down vote up
@SpireInsertPatch(
        locator=StrikeEffectLocator.class
)
public static SpireReturn<Void> Insert(AbstractCreature __instance, DamageInfo info)
{
    if (hadTempHP) {
        return SpireReturn.Return(null);
    } else {
        return SpireReturn.Continue();
    }
}
 
Example #11
Source File: PyromancyPower.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@Override
public void onApplyPower(AbstractPower power, AbstractCreature target, AbstractCreature source) {
    if (source == owner && power.ID.equals(BurningPower.POWER_ID) && !((BurningPower)power).generatedByPyromancy) {
        for (int i = 0; i < amount; ++i) {
            AbstractDungeon.actionManager.addToTop(new ApplyPowerAction(target, source, new BurningPower(target, source, power.amount, true)));
        }
    }
}
 
Example #12
Source File: PyromancyPower.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
public PyromancyPower(final AbstractCreature owner, final int numExtraTimesToBurn) {
    super(STATIC);

    this.owner = owner;
    this.amount = numExtraTimesToBurn;

    updateDescription();
}
 
Example #13
Source File: WastingFormPower.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
public WastingFormPower(AbstractCreature owner, int damagePerCurse, int numberOfCurses) {
    super(STATIC);

    this.owner = owner;
    this.amount = damagePerCurse;
    this.numberOfCurses = numberOfCurses;

    this.updateDescription();
}
 
Example #14
Source File: PhantasmPower.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@Override
public boolean onReceivePowerToCancel(AbstractPower power, AbstractCreature source) {
    if (power.ID.equals(IntangiblePlayerPower.POWER_ID) && power.owner == this.owner) {
        this.flash();
        AbstractDungeon.actionManager.addToBottom(new DamageAllEnemiesAction(this.owner, DamageInfo.createDamageMatrix(this.amount, true), DamageInfo.DamageType.THORNS, AbstractGameAction.AttackEffect.POISON, true));
    }
    return false;
}
 
Example #15
Source File: MirrorImagePower.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
public MirrorImagePower(AbstractCreature owner, int amountOfImages) {
    super(STATIC);

    this.owner = owner;
    this.amount = amountOfImages;

    this.updateDescription();
}
 
Example #16
Source File: MirrorPower.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
public MirrorPower(final AbstractCreature owner, final int numberTurns) {
    super(STATIC);

    this.owner = owner;
    this.amount = numberTurns;
    this.isTurnBased = true;

    updateDescription();
}
 
Example #17
Source File: AbstractMemory.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
public AbstractMemory(final StaticMemoryInfo staticInfo, final MemoryType memoryType, final AbstractCreature owner) {
    this.ID = staticInfo.ID;
    this.name = staticInfo.NAME;
    this.baseDescription = staticInfo.DESCRIPTIONS[0];
    this.staticInfo = staticInfo;

    this.owner = owner;
    this.memoryType = memoryType;
    this.isClarified = false;
    this.isRemembered = false;

    this.hb = new Hitbox(HB_WIDTH, HB_HEIGHT);
    updateDescription();
}
 
Example #18
Source File: TroublePower.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
public TroublePower(AbstractCreature owner, int drawPerCurse) {
    super(STATIC);

    this.owner = owner;
    this.amount = drawPerCurse;

    this.updateDescription();
}
 
Example #19
Source File: RenderTempHPOutline.java    From StSLib with MIT License 5 votes vote down vote up
private static void renderTempHPOutline(AbstractCreature creature, SpriteBatch sb, float x, float y)
{
    sb.setColor(Settings.GOLD_COLOR);
    sb.setBlendFunction(GL20.GL_SRC_ALPHA, GL20.GL_ONE);

    sb.draw(ImageMaster.BLOCK_BAR_L, x - HEALTH_BAR_HEIGHT, y + HEALTH_BAR_OFFSET_Y, HEALTH_BAR_HEIGHT, HEALTH_BAR_HEIGHT);

    sb.draw(ImageMaster.BLOCK_BAR_B, x, y + HEALTH_BAR_OFFSET_Y, creature.hb.width, HEALTH_BAR_HEIGHT);

    sb.draw(ImageMaster.BLOCK_BAR_R, x + creature.hb.width, y + HEALTH_BAR_OFFSET_Y, HEALTH_BAR_HEIGHT, HEALTH_BAR_HEIGHT);
    sb.setBlendFunction(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
}
 
Example #20
Source File: MirroredTechniquePower.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
public MirroredTechniquePower(final AbstractCreature owner, final int extraPlays) {
    super(STATIC);

    this.owner = owner;
    this.amount = -1;
    this.isTurnBased = false;
    this.extraPlays = extraPlays;

    updateDescription();
}
 
Example #21
Source File: PlayNextAttackThisTurnAdditionalTimesPower.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
public PlayNextAttackThisTurnAdditionalTimesPower(final AbstractCreature owner, final int additionalTimes) {
    super(STATIC);

    this.owner = owner;
    this.amount = additionalTimes;

    updateDescription();
}
 
Example #22
Source File: RetrogradeUpgradedPower.java    From FruityMod-StS with MIT License 5 votes vote down vote up
public RetrogradeUpgradedPower(AbstractCreature owner, int amount) {
    this.name = NAME;
    this.ID = POWER_ID;
    this.owner = owner;
    this.amount = amount;
    this.updateDescription();
    this.img = new Texture(SeekerMod.makePowerImagePath(POWER_ID));
}
 
Example #23
Source File: ShrapnelBloomPower.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
public ShrapnelBloomPower(final AbstractCreature owner, final int additionalPlays) {
    super(STATIC);

    this.owner = owner;
    this.amount = additionalPlays;

    updateDescription();
}
 
Example #24
Source File: PrismaticSphere.java    From FruityMod-StS with MIT License 5 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    AbstractDungeon.actionManager.addToBottom(new DamageAction((AbstractCreature) m, new DamageInfo(p, this.damage, this.damageTypeForTurn), AbstractGameAction.AttackEffect.SLASH_VERTICAL));
    if (AbstractDungeon.player.drawPile.isEmpty()) {
        AbstractDungeon.actionManager.addToBottom(new EmptyDeckShuffleAction());
    }
    AbstractDungeon.actionManager.addToBottom(new DrawCardAction(p, this.magicNumber));
}
 
Example #25
Source File: PremonitionsPower.java    From FruityMod-StS with MIT License 5 votes vote down vote up
public PremonitionsPower(AbstractCreature owner, int amount) {
    this.name = NAME;
    this.ID = POWER_ID;
    this.owner = owner;
    this.amount = amount;
    this.type = PowerType.BUFF;
    this.isTurnBased = false;
    this.priority = 90;
    updateDescription();
    this.img = new Texture(SeekerMod.makePowerImagePath(PowerOverwhelmingPower.POWER_ID));
}
 
Example #26
Source File: BlackTentaclesPower.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
public BlackTentaclesPower(final AbstractCreature owner, final AbstractCreature source) {
    super(STATIC);

    this.type = PowerType.DEBUFF;

    this.owner = owner;
    this.source = source;
    this.amount = -1; // non-stackable

    this.isTurnBased = true;
}
 
Example #27
Source File: ConsoleTargeting.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
private ConsoleTargeting(Consumer<AbstractCreature> callback)
{
    this.callback = callback;
    BaseMod.subscribe(this);
    this.isHidden = false;
    com.megacrit.cardcrawl.core.GameCursor.hidden = true;
    for (int i = 0; i < this.points.length; i++) {
        this.points[i] = new Vector2();
    }
}
 
Example #28
Source File: ArcanospherePower.java    From FruityMod-StS with MIT License 5 votes vote down vote up
public ArcanospherePower(AbstractCreature owner, int amount) {
    this.name = NAME;
    this.ID = POWER_ID;
    this.owner = owner;
    this.amount = amount;
    this.updateDescription();
    this.img = new Texture(SeekerMod.makePowerImagePath(POWER_ID));
}
 
Example #29
Source File: MemoryHooksPatch.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
private static void forEachMemory(AbstractCreature owner, Consumer<AbstractMemory> callback) {
    MemoryManager memoryManager = MemoryManager.forPlayer(owner);
    if (memoryManager != null) {
        for (AbstractMemory memory : memoryManager.allMemoriesIncludingInactive()) {
            callback.accept(memory);
        }
    }
}
 
Example #30
Source File: EventHorizonPower.java    From FruityMod-StS with MIT License 5 votes vote down vote up
public EventHorizonPower(AbstractCreature owner, int amount) {
    this.name = NAME;
    this.ID = POWER_ID;
    this.owner = owner;
    this.amount = amount;
    this.description = DESCRIPTION;
    this.img = new Texture(SeekerMod.makePowerImagePath(POWER_ID));
}