Java Code Examples for com.megacrit.cardcrawl.core.AbstractCreature#getPower()
The following examples show how to use
com.megacrit.cardcrawl.core.AbstractCreature#getPower() .
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: BurningPatch.java From jorbs-spire-mod with MIT License | 5 votes |
public static Color renderBurningBlock(AbstractCreature creature, Color blockColor) { if (creature != null && creature.hasPower(BurningPower.POWER_ID)) { float lerpCoefficient = ((float) creature.getPower(BurningPower.POWER_ID).amount) / creature.currentBlock * 0.3F + 0.1F; return blockColor.cpy().lerp(Color.RED.cpy(), lerpCoefficient); } else { return blockColor; } }
Example 2
Source File: HealthBarRenderPowerPatch.java From StSLib with MIT License | 4 votes |
@SpireInsertPatch( locator=Locator.class, localvars={"x", "y", "targetHealthBarWidth", "HEALTH_BAR_HEIGHT", "HEALTH_BAR_OFFSET_Y"} ) public static void Insert(AbstractCreature __instance, SpriteBatch sb, float x, float y, float targetHealthBarWidth, float HEALTH_BAR_HEIGHT, float HEALTH_BAR_OFFSET_Y) { int poisonAmt = 0; if (__instance.hasPower(PoisonPower.POWER_ID)) { poisonAmt = __instance.getPower(PoisonPower.POWER_ID).amount; if (poisonAmt > 0 && __instance.hasPower(IntangiblePower.POWER_ID)) { poisonAmt = 1; } } int prevPowerAmtSum = poisonAmt; for (AbstractPower power : __instance.powers) { if (power instanceof HealthBarRenderPower) { sb.setColor(((HealthBarRenderPower) power).getColor()); int amt = ((HealthBarRenderPower) power).getHealthBarAmount(); if (amt > 0 && __instance.hasPower(IntangiblePower.POWER_ID)) { amt = 1; } if (__instance.currentHealth > prevPowerAmtSum) { float w = 1.0f - (__instance.currentHealth - prevPowerAmtSum) / (float) __instance.currentHealth; w *= targetHealthBarWidth; if (__instance.currentHealth > 0) { sb.draw(ImageMaster.HEALTH_BAR_L, x - HEALTH_BAR_HEIGHT, y + HEALTH_BAR_OFFSET_Y, HEALTH_BAR_HEIGHT, HEALTH_BAR_HEIGHT); } sb.draw(ImageMaster.HEALTH_BAR_B, x, y + HEALTH_BAR_OFFSET_Y, targetHealthBarWidth - w, HEALTH_BAR_HEIGHT); sb.draw(ImageMaster.HEALTH_BAR_R, x + targetHealthBarWidth - w, y + HEALTH_BAR_OFFSET_Y, HEALTH_BAR_HEIGHT, HEALTH_BAR_HEIGHT); } prevPowerAmtSum += amt; } } allAmtSum = prevPowerAmtSum; prevPowerAmtSum -= poisonAmt; nonPoisonWidthSum = 1.0f - (__instance.currentHealth - prevPowerAmtSum) / (float) __instance.currentHealth; nonPoisonWidthSum *= targetHealthBarWidth; }
Example 3
Source File: Convergence.java From FruityMod-StS with MIT License | 4 votes |
private int GetPowerCount(AbstractCreature c, String powerId) { AbstractPower power = c.getPower(powerId); return power != null ? power.amount : 0; }
Example 4
Source File: Transference.java From FruityMod-StS with MIT License | 4 votes |
private int GetPowerCount(AbstractCreature c, String powerId) { AbstractPower power = c.getPower(powerId); return power != null ? power.amount : 0; }
Example 5
Source File: Feedback.java From FruityMod-StS with MIT License | 4 votes |
private int GetPowerCount(AbstractCreature c, String powerId) { AbstractPower power = c.getPower(powerId); return power != null ? power.amount : 0; }
Example 6
Source File: MindOverMatter.java From FruityMod-StS with MIT License | 4 votes |
private int GetPowerCount(AbstractCreature c, String powerId) { AbstractPower power = c.getPower(powerId); return power != null ? power.amount : 0; }
Example 7
Source File: CoalescencePower.java From FruityMod-StS with MIT License | 4 votes |
private int GetPowerCount(AbstractCreature c, String powerId) { AbstractPower power = c.getPower(powerId); return power != null ? power.amount : 0; }