Skip to content

Commit

Permalink
0.9.8 Update
Browse files Browse the repository at this point in the history
0.9.8

	Feature: Analog now has an icon preview to show the effect of using the card on mouseover.
	Feature: Card Tags converted to the new week 44 vanilla system, including healing cards
	Balance: Misterioso now only plays unique cards.
	Balance: Echonomics plus now makes a single copy that is free all combat, instead of two copies free for the turn.
	Balance: Echonomics now only works on cards with discounted costs.
	Balance: Sospirando is now "Apply Stun (all enemies). Gain Stun.".
	Balance: Stacking Orcale Form now gives 2(3) card draw increase.
	Balance: Wards now safely duplicate when doubled in hand via something like Burst.
	Balance: Recurrance now decrements the turn counter for Bite and Rage Command.
	Text: Escort Command now correctly shows in green when next turn's block is modified.
	Text: Fibonacci damage was capitalized.
	Text: Short Sighted's Delayed Attack Power now specifies that you lose health instead of dealing damage to you.
	Text: Echonomics text was cleaned up.
	Bug: Equilibrium now discounts retained cards.
	Bug: Echonomics no longer copies other Echonomics.
	Bug: Switch cards no longer cost 0 on draft.
	Bug: Analog now stacks its retain with other sources of retain.
	Bug: Ice Cream Replica now correctly removes conserve on shattering.
	Bug: Prime Time now doubles damage once again after being retained.
	Bug: Whetstone and War Paint replicas now work with Diverse and Prismatic Shard.
	Bug: Whetstone and War Paint replicas no longer reset the discounted cost of retained cards when upgraded.
	Bug: Runic Pyramid no longer keeps card cost discounts from non-retain sources after discarding.
	Bug: Flame, Lightning, and Tornado replicas no longer occasionally shatter from Fast Forward.
	Bug: Descriptions on all multi-target cards now correctly update with vuln/slow if there is a single target remaining.
	Bug: Fast Forward no longer mistakenly self-retains.
	Bug: Escort Command's next turn now correctly accounts for powers.
	Bug: Presto should now give the correct amount of gold following the week 43 Greed card vanilla fix.
	Bug: Cards retained over multiple turns decrease their cost once again.
	Bug: Self-retaining cards now retain the first turn when spawned mid-turn, such as via Nilry's Codex.
	Bug: Removed conflicts with the Mad Scientist mod.
	Bug: Removed path conflicts with the Witch Mod.
	Bug: Pattern Shift preview will no longer scale the Maw's damage continuously.
	Bug: Maw, Giant Head, and Book of Stabbing no long continue to scale damage while sleeping.
	Bug: Gremlin Wizard now functions correctly for Pattern Shift on all ascensions.
	Bug: Fixed Hexaghost on Pattern Shift, once again.
	Bug: Time Dilate no longer takes away Bite and Rage Command.
	Bug: Oracle Form no longer allows you to draw past 10 cards, sending extra cards to the discard.
  • Loading branch information
Tempus committed Oct 10, 2018
1 parent 8dac084 commit c12530c
Show file tree
Hide file tree
Showing 15 changed files with 371 additions and 161 deletions.
120 changes: 57 additions & 63 deletions src/main/java/actions/PatternShiftAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -194,24 +194,29 @@ public static boolean nextIntent(AbstractMonster m) {
// Gremlin Wizard charges more or goes back to no charge
case "GremlinWizard":
int currentCharge = (int)ReflectionHacks.getPrivate(m, m.getClass(), "currentCharge");
ReflectionHacks.setPrivate(m, m.getClass(), "currentCharge", currentCharge + 1);

if (currentCharge+1 >= 3) {
if (currentCharge >= 3) {
m.setMove((byte)1, AbstractMonster.Intent.ATTACK, ((DamageInfo)m.damage.get(0)).base);
m.createIntent();
return true;
}
}

if ((m.intent == AbstractMonster.Intent.ATTACK)) {
ReflectionHacks.setPrivate(m, m.getClass(), "currentCharge", 0);
m.rollMove();
else if ((m.intent == AbstractMonster.Intent.ATTACK)) {
if (AbstractDungeon.ascensionLevel >= 17) {
m.setMove((byte)1, AbstractMonster.Intent.ATTACK, ((DamageInfo)m.damage.get(0)).base);
} else {
m.setMove((byte)2, AbstractMonster.Intent.UNKNOWN);
ReflectionHacks.setPrivate(m, m.getClass(), "currentCharge", 0);
}
} else {
m.setMove((byte)2, AbstractMonster.Intent.UNKNOWN);
ReflectionHacks.setPrivate(m, m.getClass(), "currentCharge", currentCharge+1);
}
break;
m.createIntent();
return true;

// Hexaghost, ouch
case "Hexaghost":
ChronoMod.log("Move byte: " + Integer.toString(m.nextMove));
Hexaghost hexa;
Hexaghost hexa = (Hexaghost)m;

// If you skip the first turn, you need to activate him anyway
if (m.intent == AbstractMonster.Intent.UNKNOWN) {
Expand All @@ -225,24 +230,14 @@ public static boolean nextIntent(AbstractMonster m) {
m.createIntent();
return true;
} else {
switch (m.nextMove) {
case 1:
hexa = (Hexaghost)m;
hexa.changeState("Deactivate");

// AbstractDungeon.actionManager.addToBottom(new RollMoveAction(m));
hexa.setMove((byte)4, AbstractMonster.Intent.ATTACK_DEBUFF, ((DamageInfo)hexa.damage.get(1)).base);
hexa.createIntent();
return true;
case 6:
hexa = (Hexaghost)m;
hexa.changeState("Deactivate");
break;
default:
AbstractDungeon.actionManager.addToTop(new ChangeStateAction(m, "Activate Orb"));
// AbstractDungeon.actionManager.addToBottom(new RollMoveAction(m));
break;
}
hexa = (Hexaghost)m;

int orbActiveCount = (int)ReflectionHacks.getPrivate(hexa, Hexaghost.class, "orbActiveCount");
if (orbActiveCount == 6) {
hexa.changeState("Deactivate");
} else {
hexa.changeState("Activate Orb");
}
}
break;

Expand Down Expand Up @@ -407,15 +402,6 @@ public static boolean restorePreviewedSpecialCases(AbstractMonster m) {
ReflectionHacks.setPrivate(m, m.getClass(), "turnsTaken", turnsTaken - 1);
break;

case "GremlinWizard":
int currentCharge = (int)ReflectionHacks.getPrivate(m, m.getClass(), "currentCharge");
ReflectionHacks.setPrivate(m, m.getClass(), "currentCharge", currentCharge - 1);

if (currentCharge == 0) {
ReflectionHacks.setPrivate(m, m.getClass(), "currentCharge", 3);
}
break;

case "Lagavulin":
switch (m.nextMove) {
case 5: // sleep
Expand All @@ -432,6 +418,19 @@ public static boolean restorePreviewedSpecialCases(AbstractMonster m) {
if (m.nextMove == 4) {
ReflectionHacks.setPrivate(m, m.getClass(), "secondMove", true); }
break;
case "Maw":
turnCount = (int)ReflectionHacks.getPrivate(m, m.getClass(), "turnCount");
ReflectionHacks.setPrivate(m, m.getClass(), "turnCount", turnCount - 1);
break;
case "Hexaghost":
Hexaghost hexa = (Hexaghost)m;
int orbActiveCount = (int)ReflectionHacks.getPrivate(hexa, Hexaghost.class, "orbActiveCount");
if (orbActiveCount == 0) {
ReflectionHacks.setPrivate(hexa, Hexaghost.class, "orbActiveCount", 6);
} else {
ReflectionHacks.setPrivate(hexa, Hexaghost.class, "orbActiveCount", orbActiveCount-1);
}
break;
}

return true;
Expand Down Expand Up @@ -567,24 +566,27 @@ public static boolean previewNextIntent(AbstractMonster m) {
// Gremlin Wizard charges more or goes back to no charge
case "GremlinWizard":
int currentCharge = (int)ReflectionHacks.getPrivate(m, m.getClass(), "currentCharge");
ReflectionHacks.setPrivate(m, m.getClass(), "currentCharge", currentCharge + 1);

if (currentCharge+1 == 3) {
if (currentCharge >= 3) {
m.setMove((byte)1, AbstractMonster.Intent.ATTACK, ((DamageInfo)m.damage.get(0)).base);
m.createIntent();
return true;
}
}

if ((m.intent == AbstractMonster.Intent.ATTACK)) {
ReflectionHacks.setPrivate(m, m.getClass(), "currentCharge", 0);
m.rollMove();
else if ((m.intent == AbstractMonster.Intent.ATTACK)) {
if (AbstractDungeon.ascensionLevel >= 17) {
m.setMove((byte)1, AbstractMonster.Intent.ATTACK, ((DamageInfo)m.damage.get(0)).base);
} else {
m.setMove((byte)2, AbstractMonster.Intent.UNKNOWN);
}
} else {
m.setMove((byte)2, AbstractMonster.Intent.UNKNOWN);
}
break;
m.createIntent();
return true;

// Hexaghost, ouch
case "Hexaghost":
ChronoMod.log("Move byte: " + Integer.toString(m.nextMove));
Hexaghost hexa;
Hexaghost hexa = (Hexaghost)m;

// If you skip the first turn, you need to activate him anyway
if (m.intent == AbstractMonster.Intent.UNKNOWN) {
Expand All @@ -597,20 +599,12 @@ public static boolean previewNextIntent(AbstractMonster m) {
m.createIntent();
return true;
} else {
switch (m.nextMove) {
case 1:
hexa = (Hexaghost)m;
hexa.setMove((byte)4, AbstractMonster.Intent.ATTACK_DEBUFF, ((DamageInfo)hexa.damage.get(1)).base);
hexa.createIntent();
return true;
case 6:
hexa = (Hexaghost)m;
break;
// default:
// m.rollMove();
// m.createIntent();
// break;
}
int orbActiveCount = (int)ReflectionHacks.getPrivate(hexa, Hexaghost.class, "orbActiveCount");
if (orbActiveCount == 6) {
ReflectionHacks.setPrivate(hexa, Hexaghost.class, "orbActiveCount", 0);
} else {
ReflectionHacks.setPrivate(hexa, Hexaghost.class, "orbActiveCount", orbActiveCount+1);
}
}
break;

Expand Down Expand Up @@ -696,8 +690,8 @@ public static boolean previewNextIntent(AbstractMonster m) {
// method.invoke(m, seed);
// }
// catch (Throwable e) {
// ChronoMod.log(e.toString());
// }
// ChronoMod.log(e.toString());
// }
m.rollMove();
m.createIntent();

Expand Down
121 changes: 121 additions & 0 deletions src/main/java/cards/Analog.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,27 @@
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.core.Settings;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.localization.CardStrings;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import com.megacrit.cardcrawl.rooms.AbstractRoom;
import com.megacrit.cardcrawl.powers.StrengthPower;
import com.megacrit.cardcrawl.powers.DexterityPower;
import com.megacrit.cardcrawl.powers.ArtifactPower;
import com.megacrit.cardcrawl.powers.RetainCardPower;
import com.megacrit.cardcrawl.actions.AbstractGameAction;
import com.megacrit.cardcrawl.helpers.FontHelper;
import com.megacrit.cardcrawl.helpers.ImageMaster;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.graphics.g2d.TextureAtlas.AtlasRegion;

import java.util.HashMap;
import java.util.ArrayList;

import chronomuncher.cards.MetricsCard;
import chronomuncher.ChronoMod;
Expand All @@ -31,6 +44,21 @@ public class Analog extends MetricsCard {
private static final int COST = 2;
private static final int POWER = 1;

private static final float PADDING = 12.0F;
private boolean bullshit = false;

public class texTip {
public int count = 0;
public TextureAtlas.AtlasRegion tex;

texTip(TextureAtlas.AtlasRegion tex) {
this.tex = tex;
}
}

public HashMap<String, texTip> icons = new HashMap();
private ArrayList<texTip> renderQueue = new ArrayList();

public Analog() {
super(ID, NAME, "chrono_images/cards/Analog.png", COST, DESCRIPTION, AbstractCard.CardType.SKILL,
Enum.CHRONO_GOLD, AbstractCard.CardRarity.UNCOMMON, AbstractCard.CardTarget.ALL_ENEMY);
Expand All @@ -39,6 +67,12 @@ public Analog() {
this.magicNumber = this.baseMagicNumber;

this.retain = true;

TextureAtlas atlas = new TextureAtlas(Gdx.files.internal("powers/powers.atlas"));
this.icons.put("strength", new texTip(atlas.findRegion("128/strength")));
this.icons.put("dexterity", new texTip(atlas.findRegion("128/dexterity")));
this.icons.put("artifact", new texTip(atlas.findRegion("128/artifact")));
this.icons.put("retain", new texTip(new TextureAtlas.AtlasRegion(ImageMaster.loadImage("chrono_images/powers/RetainOnce.png"), 0, 0, 84, 84)));
}

@Override
Expand Down Expand Up @@ -108,4 +142,91 @@ public void upgrade() {
upgradeMagicNumber(1);
}
}

@Override
public void hover() {
super.hover();
this.bullshit = true;
}

@Override
public void unhover() {
super.unhover();
this.bullshit = false;
}

@Override
public void renderCardTip(SpriteBatch sb) {
super.renderCardTip(sb);

if (AbstractDungeon.player == null) { return; }
if ((Settings.hideCards) || (!this.bullshit)) { return; }
if (AbstractDungeon.getCurrRoom().phase != AbstractRoom.RoomPhase.COMBAT) { return; }

float current_y = this.current_y + ((AbstractCard.IMG_HEIGHT / 2.0F) + PADDING * Settings.scale) * this.drawScale;
float current_x = this.current_x;

// Determine the countto add for each buff
for (AbstractMonster mo : AbstractDungeon.getCurrRoom().monsters.monsters) {
if (!mo.isDead && !mo.escaped) {
// Strength
if ((mo.intent == AbstractMonster.Intent.ATTACK_BUFF) ||
(mo.intent == AbstractMonster.Intent.ATTACK_DEBUFF) ||
(mo.intent == AbstractMonster.Intent.ATTACK_DEFEND) ||
(mo.intent == AbstractMonster.Intent.ATTACK)) {
this.icons.get("strength").count += this.magicNumber;
}

// Dexterity
if ((mo.intent == AbstractMonster.Intent.DEFEND) ||
(mo.intent == AbstractMonster.Intent.DEFEND_DEBUFF) ||
(mo.intent == AbstractMonster.Intent.ATTACK_DEFEND) ||
(mo.intent == AbstractMonster.Intent.DEFEND_BUFF)) {
this.icons.get("dexterity").count += this.magicNumber;
}

// Artifact
if ((mo.intent == AbstractMonster.Intent.ATTACK_BUFF) ||
(mo.intent == AbstractMonster.Intent.ATTACK_DEBUFF) ||
(mo.intent == AbstractMonster.Intent.BUFF) ||
(mo.intent == AbstractMonster.Intent.STRONG_DEBUFF) ||
(mo.intent == AbstractMonster.Intent.DEFEND_BUFF) ||
(mo.intent == AbstractMonster.Intent.DEFEND_DEBUFF) ||
(mo.intent == AbstractMonster.Intent.DEBUFF)) {
this.icons.get("artifact").count += this.magicNumber;
}

// Retain Card
if ((mo.intent == AbstractMonster.Intent.ESCAPE) ||
(mo.intent == AbstractMonster.Intent.MAGIC) ||
(mo.intent == AbstractMonster.Intent.SLEEP) ||
(mo.intent == AbstractMonster.Intent.STUN) ||
(mo.intent == AbstractMonster.Intent.UNKNOWN)) {
this.icons.get("retain").count += this.magicNumber;
}
}
}

// Grab the ones that are in use
this.renderQueue.clear();
for (texTip icon : this.icons.values()) {
if (icon.count > 0) {
this.renderQueue.add(icon);
}
}

// Render
int size = this.renderQueue.size();
float offset;
float cardOffset = AbstractCard.IMG_WIDTH * this.drawScale / 1.5F;
for (int i=size; i > 0; i--) {
// tex, x, y, originx, originy, scalex, scaley, rot
offset = (size-i+2)*42.0F*this.drawScale;

sb.draw(this.renderQueue.get(i-1).tex, current_x + cardOffset - offset, current_y, 0, 0, 84, 84, 0.5F * this.drawScale, 0.5F * this.drawScale, 0.0F);
FontHelper.renderFontRightTopAligned(sb, FontHelper.powerAmountFont, Integer.toString(this.renderQueue.get(i-1).count), current_x + cardOffset - offset + (42.0F*this.drawScale), current_y, 1.0F, new Color(1.0F, 1.0F, 1.0F, 1.0F));

this.renderQueue.get(i-1).count = 0;
}
}
}
Loading

0 comments on commit c12530c

Please sign in to comment.