Skip to content

Commit

Permalink
next stop
Browse files Browse the repository at this point in the history
  • Loading branch information
The-Evil-Pickle committed Mar 7, 2019
1 parent da16099 commit 9b44841
Show file tree
Hide file tree
Showing 18 changed files with 256 additions and 108 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -223,5 +223,5 @@
</plugins>
<finalName>${project.artifactId}</finalName>
</build>
<version>1.3.25</version>
<version>1.3.26</version>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package com.megacrit.cardcrawl.mod.replay.actions.unique;

import com.megacrit.cardcrawl.actions.AbstractGameAction;
import com.megacrit.cardcrawl.actions.common.ApplyPowerAction;
import com.megacrit.cardcrawl.actions.common.DamageAction;
import com.megacrit.cardcrawl.cards.DamageInfo;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.core.*;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.mod.replay.cards.*;
import com.megacrit.cardcrawl.mod.replay.powers.LanguidPower;
import com.megacrit.cardcrawl.mod.replay.powers.MightPower;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import com.megacrit.cardcrawl.powers.PoisonPower;
import com.megacrit.cardcrawl.powers.WeakPower;
import com.megacrit.cardcrawl.ui.panels.EnergyPanel;

public class MightXAction extends AbstractGameAction
{
private boolean freeToPlayOnce;
private AbstractPlayer p;
private int energyOnUse;

public MightXAction(final AbstractPlayer p, final boolean freeToPlayOnce, final int energyOnUse) {
this.freeToPlayOnce = false;
this.energyOnUse = -1;
this.p = p;
this.freeToPlayOnce = freeToPlayOnce;
this.duration = Settings.ACTION_DUR_XFAST;
this.actionType = ActionType.SPECIAL;
this.energyOnUse = energyOnUse;
}

@Override
public void update() {
int effect = EnergyPanel.totalCount;
if (this.energyOnUse != -1) {
effect = this.energyOnUse;
}
if (this.p.hasRelic("Chemical X")) {
effect += 2;
this.p.getRelic("Chemical X").flash();
}
if (effect > 0) {
AbstractDungeon.actionManager.addToTop(new ApplyPowerAction(this.p, this.p, new MightPower(this.p, effect, false), effect));
if (!this.freeToPlayOnce) {
this.p.energy.use(EnergyPanel.totalCount);
}
}
this.isDone = true;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package com.megacrit.cardcrawl.mod.replay.cards.colorless;

import com.evacipated.cardcrawl.mod.stslib.variables.RefundVariable;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.localization.CardStrings;
import com.megacrit.cardcrawl.mod.replay.actions.unique.MightXAction;
import com.megacrit.cardcrawl.monsters.AbstractMonster;

import basemod.abstracts.CustomCard;

public class BasicMightCard
extends CustomCard
{
public static final String ID = "Replay:BasicMightCard";
private static final CardStrings cardStrings = CardCrawlGame.languagePack.getCardStrings(ID);
public static final String NAME = cardStrings.NAME;
public static final String DESCRIPTION = cardStrings.DESCRIPTION;
private static final int COST = -1;

public BasicMightCard()
{
super(ID, NAME, "cards/replay/replayBetaPower.png", BasicMightCard.COST, DESCRIPTION, AbstractCard.CardType.POWER, AbstractCard.CardColor.COLORLESS, AbstractCard.CardRarity.RARE, AbstractCard.CardTarget.NONE);
RefundVariable.setBaseValue(this, 1);
}

public void use(AbstractPlayer p, AbstractMonster m)
{
AbstractDungeon.actionManager.addToBottom(new MightXAction(AbstractDungeon.player, this.freeToPlayOnce, this.energyOnUse));
}

public AbstractCard makeCopy()
{
return new BasicMightCard();
}

public void upgrade()
{
if (!this.upgraded)
{
upgradeName();
RefundVariable.upgrade(this, 1);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package com.megacrit.cardcrawl.mod.replay.monsters.replay.hec;

import java.util.ArrayList;

import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.megacrit.cardcrawl.actions.AbstractGameAction;
import com.megacrit.cardcrawl.actions.common.ApplyPowerAction;
import com.megacrit.cardcrawl.actions.common.DamageAction;
Expand All @@ -10,7 +14,11 @@
import com.megacrit.cardcrawl.cards.DamageInfo;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.helpers.ImageMaster;
import com.megacrit.cardcrawl.helpers.PowerTip;
import com.megacrit.cardcrawl.helpers.TipHelper;
import com.megacrit.cardcrawl.localization.MonsterStrings;
import com.megacrit.cardcrawl.localization.UIStrings;
import com.megacrit.cardcrawl.mod.replay.actions.unique.SpawnForestMonsterAction;
import com.megacrit.cardcrawl.mod.replay.monsters.replay.PondfishBoss;
import com.megacrit.cardcrawl.mod.replay.powers.EnemyLifeBindPower;
Expand Down Expand Up @@ -39,6 +47,8 @@ public class Conductor extends AbstractMonster {
public static final String[] DIALOG = monsterStrings.DIALOG;
private HellsEngine engine;
public AbstractMonster dynamite;
private static final UIStrings bombStrings = CardCrawlGame.languagePack.getUIString("Replay:BombIntent");
private static final Texture BOMB_INTENT_TEXTURE = ImageMaster.loadImage("images/ui/replay/intent/attack_intent_bomb.png");

public static final int GUN_DMG = 12;
public static final int GUN_DMG_A = 14;
Expand All @@ -50,13 +60,16 @@ public class Conductor extends AbstractMonster {
public static final int STOKE_AMT_A = 2;
public static final int STOKE_BLK = 10;
public static final int STOKE_BLK_A = 15;
public static final int HOLD_AMT = 2;
public static final int HOLD_AMT_A = 3;



private int railgunnerDmg;
private int dynamiteDmg;
private int stokeAmt;
private int stokeBlk;
private int holdAmt;



Expand Down Expand Up @@ -94,8 +107,10 @@ public Conductor() {
}
if (AbstractDungeon.ascensionLevel >= 19) {
this.stokeAmt = STOKE_AMT_A;
this.holdAmt = HOLD_AMT_A;
} else {
this.stokeAmt = STOKE_AMT;
this.holdAmt = HOLD_AMT;
}
this.damage.add(new DamageInfo(this, this.railgunnerDmg));
this.damage.add(new DamageInfo(this, this.dynamiteDmg));
Expand Down Expand Up @@ -124,7 +139,7 @@ private void setMoveNow(byte nextTurn) {
break;
}
case DYNAMITE: {
this.setMove(nextTurn, Intent.UNKNOWN, this.damage.get(1).base);
this.setMove(nextTurn, Intent.ATTACK, this.damage.get(1).base);
break;
}
case CARGO_HOLD: {
Expand Down Expand Up @@ -181,6 +196,12 @@ public void takeTurn() {
AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(this.engine, this, new MightPower(this.engine, this.stokeAmt, true), this.stokeAmt));
if (this.hasPower(BackAttackPower.POWER_ID)) {
AbstractDungeon.actionManager.addToBottom(new GainBlockAction(this.engine, this, this.stokeBlk));
int armor = 5;
if (!this.hasPower(PlatedArmorPower.POWER_ID)) {
armor = 10;
} else {
armor = Math.max(armor, 10 - this.getPower(PlatedArmorPower.POWER_ID).amount);
}
AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(this, this, new PlatedArmorPower(this, 5), 5));
}
AbstractDungeon.actionManager.addToBottom(new RollMoveAction(this));
Expand Down Expand Up @@ -268,4 +289,38 @@ public boolean isDynamiteOut() {
return (!this.dynamite.isDeadOrEscaped());
}
}

//////////render stuff//////////////////

@Override
public Texture getAttackIntent() {
if (this.nextMove == DYNAMITE) {
return BOMB_INTENT_TEXTURE;
}
return super.getAttackIntent();
}
@Override
public Texture getAttackIntent(int dmg) {
if (this.nextMove == DYNAMITE) {
return BOMB_INTENT_TEXTURE;
}
return super.getAttackIntent(dmg);
}
@Override
public void renderTip(final SpriteBatch sb) {
super.renderTip(sb);
if (this.nextMove == DYNAMITE && this.intentAlphaTarget == 1.0f && !AbstractDungeon.player.hasRelic("Runic Dome")) {
final ArrayList<PowerTip> tips = (ArrayList<PowerTip>)ReflectionHacks.getPrivateStatic(TipHelper.class, "POWER_TIPS");
tips.get(0).header = bombStrings.TEXT[0];
tips.get(0).body = bombStrings.TEXT[1] + (int)ReflectionHacks.getPrivate(this, AbstractMonster.class, "intentDmg") + bombStrings.TEXT[2];
tips.get(0).img = BOMB_INTENT_TEXTURE;
final float offsetY = (tips.size() - 1) * AbstractMonster.MULTI_TIP_Y_OFFSET + AbstractMonster.TIP_OFFSET_Y;
if (this.hb.cX + this.hb.width / 2.0f < AbstractMonster.TIP_X_THRESHOLD) {
TipHelper.queuePowerTips(this.hb.cX + this.hb.width / 2.0f + AbstractMonster.TIP_OFFSET_R_X, this.hb.cY + offsetY, tips);
}
else {
TipHelper.queuePowerTips(this.hb.cX - this.hb.width / 2.0f + AbstractMonster.TIP_OFFSET_L_X, this.hb.cY + offsetY, tips);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class Dynamite extends AbstractMonster
private int attackDmg;

public Dynamite(final float x, final float y, final int dmg) {
super(Dynamite.NAME, ID, 30, -8.0f, -10.0f, 150.0f, 150.0f, null, x, y + 10.0f);
super(Dynamite.NAME, ID, A_HP, -8.0f, -10.0f, 150.0f, 150.0f, null, x, y + 10.0f);
this.turnCount = 0;
this.loadAnimation("images/monsters/theForest/exploder/skeleton.atlas", "images/monsters/theForest/exploder/skeleton.json", 1.0f);
final AnimationState.TrackEntry e = this.state.setAnimation(0, "idle", true);
Expand All @@ -44,6 +44,7 @@ public Dynamite(final float x, final float y, final int dmg) {
@Override
public void usePreBattleAction() {
AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(this, this, new ReplayExplosivePower(this, 3, this.attackDmg), this.attackDmg));
AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(this, this, new ArtifactPower(this, 1), 1));
}

@Override
Expand All @@ -57,11 +58,11 @@ public void takeTurn() {

@Override
protected void getMove(final int num) {
if (!this.hasPower(ReplayExplosivePower.POWER_ID)) {
if (this.turnCount > 0 && !this.hasPower(ReplayExplosivePower.POWER_ID)) {
this.setMove((byte)3, Intent.BUFF);
return;
}
if (this.getPower(ReplayExplosivePower.POWER_ID).amount > 1) {
if (!this.hasPower(ReplayExplosivePower.POWER_ID) || this.getPower(ReplayExplosivePower.POWER_ID).amount > 1) {
this.setMove((byte)1, Intent.SLEEP);
}
else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@
import com.megacrit.cardcrawl.core.Settings;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.helpers.ImageMaster;
import com.megacrit.cardcrawl.helpers.MathHelper;
import com.megacrit.cardcrawl.helpers.PowerTip;
import com.megacrit.cardcrawl.helpers.ScreenShake.ShakeDur;
import com.megacrit.cardcrawl.helpers.ScreenShake.ShakeIntensity;
import com.megacrit.cardcrawl.helpers.TipHelper;
import com.megacrit.cardcrawl.localization.MonsterStrings;
import com.megacrit.cardcrawl.localization.UIStrings;
import com.megacrit.cardcrawl.mod.replay.actions.common.ReplayGainShieldingAction;
import com.megacrit.cardcrawl.mod.replay.actions.utility.MoveCreaturesAction;
import com.megacrit.cardcrawl.mod.replay.actions.utility.MoveMonsterAction;
import com.megacrit.cardcrawl.mod.replay.actions.utility.StartParalaxAction;
Expand Down Expand Up @@ -61,6 +63,7 @@ public class HellsEngine extends AbstractMonster {
private static final AbstractCard STATUS_CARD_1;
private static final AbstractCard STATUS_CARD_2;
private static final UIStrings plannedStrings = CardCrawlGame.languagePack.getUIString("PlannedCardIntent");
private static final Texture TRAIN_INTENT_TEXTURE = ImageMaster.loadImage("images/ui/replay/intent/attack_intent_train.png");
static {
STATUS_CARD_1 = new Burn();
(STATUS_CARD_2 = new Burn()).upgrade();
Expand Down Expand Up @@ -194,9 +197,9 @@ public void usePreBattleAction() {
private void setMoveNow(byte nextTurn) {
this.plannedCard = null;
STATUS_CARD_1.target_x = this.intentHb.cX - (128.0f * Settings.scale);
STATUS_CARD_1.target_y = this.intentHb.cY - 0.0f;
STATUS_CARD_1.target_y = this.intentHb.cY - (60.0f * Settings.scale);
STATUS_CARD_1.current_x = this.intentHb.cX - (128.0f * Settings.scale);
STATUS_CARD_1.current_y = this.intentHb.cY - 0.0f;
STATUS_CARD_1.current_y = this.intentHb.cY - (60.0f * Settings.scale);
STATUS_CARD_2.current_x = STATUS_CARD_1.current_x;
STATUS_CARD_2.current_y = STATUS_CARD_1.current_y;
STATUS_CARD_2.target_x = STATUS_CARD_1.target_x;
Expand All @@ -208,7 +211,7 @@ private void setMoveNow(byte nextTurn) {
}
case HOT_COALS: {
this.plannedCard = STATUS_CARD_1;
this.setMove(MOVES[1], nextTurn, Intent.ATTACK, this.damage.get(1).base, this.coalsAmt, true);
this.setMove(MOVES[1], nextTurn, Intent.ATTACK_DEBUFF, this.damage.get(1).base, this.coalsAmt, true);
break;
}
case RUNAWAY_TRAIN: {
Expand All @@ -219,6 +222,10 @@ private void setMoveNow(byte nextTurn) {
this.setMove(MOVES[4], nextTurn, Intent.DEFEND);
break;
}
case HEARTBEAT: {
this.setMove(nextTurn, this.hasPower(BackAttackPower.POWER_ID) ? Intent.STRONG_DEBUFF : Intent.DEBUFF);
break;
}
default: {
this.setMove(nextTurn, Intent.NONE);
break;
Expand Down Expand Up @@ -259,7 +266,7 @@ public void takeTurn() {
for (int i=0; i<this.coalsAmt; i++) {
AbstractDungeon.actionManager.addToBottom(new DamageAction(AbstractDungeon.player, this.damage.get(1), AbstractGameAction.AttackEffect.FIRE));
}
AbstractDungeon.actionManager.addToBottom(new MakeTempCardInDrawPileAction(this.plannedCard != null ? this.plannedCard.makeStatEquivalentCopy() : new Burn(), this.coalsAmt, true, true));//this.plannedCard != null ? this.plannedCard.makeStatEquivalentCopy() : new Burn()
AbstractDungeon.actionManager.addToBottom(new MakeTempCardInDrawPileAction(this.plannedCard, this.coalsAmt, true, true));//this.plannedCard != null ? this.plannedCard.makeStatEquivalentCopy() : new Burn()
AbstractDungeon.actionManager.addToBottom(new RollMoveAction(this));
break;
}
Expand Down Expand Up @@ -339,14 +346,14 @@ public Texture getAttackIntent() {
dmg *= (int)ReflectionHacks.getPrivate(this, AbstractMonster.class, "intentMultiAmt");
}
if (dmg > 35 || this.isFirstTurn && dmg >= 20) {
return ImageMaster.loadImage("images/ui/replay/intent/attack_intent_train.png");
return TRAIN_INTENT_TEXTURE;
}
return super.getAttackIntent();
}
@Override
public Texture getAttackIntent(int dmg) {
if (dmg > 35 || this.isFirstTurn && dmg >= 20) {
return ImageMaster.loadImage("images/ui/replay/intent/attack_intent_train.png");
return TRAIN_INTENT_TEXTURE;
}
return super.getAttackIntent(dmg);
}
Expand All @@ -368,11 +375,12 @@ public void render(final SpriteBatch sb) {
if (this.plannedCard != null && !AbstractDungeon.player.hasRelic("Runic Dome") && !Settings.hideCombatElements) {
if (!this.hb.hovered) {
this.plannedCard.targetDrawScale = 0.4f;
this.plannedCard.current_y = this.intentHb.cY + this.cardBob.y;
this.plannedCard.current_y = this.intentHb.cY + this.cardBob.y - (25.0f * Settings.scale);
this.plannedCard.target_y = this.plannedCard.current_y;
} else {
this.plannedCard.targetDrawScale = 0.75f;
this.plannedCard.target_y = this.intentHb.cY + (30.0f * Settings.scale);
this.plannedCard.target_y = this.intentHb.cY - (100.0f * Settings.scale);
this.plannedCard.current_y = MathHelper.cardLerpSnap(this.plannedCard.current_y, this.plannedCard.target_y);
}
this.plannedCard.render(sb);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class RubberDucky extends ReplayAbstractRelic
{
public static final String ID = "Replay:Rubber Ducky";

public static final ReplayIntSliderSetting SETTING_BLOCK = new ReplayIntSliderSetting("Ducky_Block", "Block", 3, 1, 5);
public static final ReplayIntSliderSetting SETTING_BLOCK = new ReplayIntSliderSetting("Ducky_Block", "Shielding", 3, 1, 5);

public ArrayList<ReplayRelicSetting> BuildRelicSettings() {
ArrayList<ReplayRelicSetting> settings = new ArrayList<ReplayRelicSetting>();
Expand All @@ -45,7 +45,7 @@ public String getUpdatedDescription() {
public void onUseCard(final AbstractCard card, final UseCardAction action) {
if (card.type == AbstractCard.CardType.POWER && !card.freeToPlayOnce && card.costForTurn > 0) {
this.flash();
AbstractDungeon.actionManager.addToTop(new GainBlockAction(AbstractDungeon.player, AbstractDungeon.player, SETTING_BLOCK.value * card.costForTurn));
AbstractDungeon.actionManager.addToTop(new ReplayGainShieldingAction(AbstractDungeon.player, AbstractDungeon.player, SETTING_BLOCK.value * card.costForTurn));
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.megacrit.cardcrawl.mod.replay.vfx.combat;

import com.megacrit.cardcrawl.vfx.combat.*;
import com.badlogic.gdx.graphics.*;
import com.megacrit.cardcrawl.core.*;

public class ShieldingNumberEffect extends DamageNumberEffect
{
private Color originalColor;

public ShieldingNumberEffect(final AbstractCreature target, final float x, final float y, final int amt) {
super(target, x, y, amt);
this.color = Settings.BLUE_TEXT_COLOR.cpy();
this.originalColor = this.color.cpy();
}

public void update() {
super.update();
this.color = this.originalColor.cpy();
}
}
Loading

0 comments on commit 9b44841

Please sign in to comment.