Skip to content

Commit

Permalink
v0.4.3 - Bug Fix
Browse files Browse the repository at this point in the history
Drug Power, Scent of Rosmari, Grow Book, Mind Search
  • Loading branch information
Celicath committed Dec 10, 2018
1 parent 11d603e commit d482780
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 46 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>gatherermod</groupId>
<artifactId>gatherermod</artifactId>
<version>v0.4.1</version>
<version>v0.4.3</version>
<packaging>jar</packaging>

<name>GathererMod</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ else if (c instanceof BalancedGrowth)
if (c.type == AbstractCard.CardType.SKILL) skillCount++;
else if (c.type == AbstractCard.CardType.ATTACK) attackCount++;

totalCost += c.costForTurn;
if (c instanceof PoisonMastery)
poisonMastery = true;
else if (c instanceof FeelingFine)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@
public class IncreaseGrowBookMiscAction extends AbstractGameAction {
private int miscIncrease;
private UUID uuid;
private boolean upgraded;

public IncreaseGrowBookMiscAction(UUID targetUUID, int miscValue, int miscIncrease, boolean upgraded) {
public IncreaseGrowBookMiscAction(UUID targetUUID, int miscIncrease) {
this.miscIncrease = miscIncrease;
this.uuid = targetUUID;
this.upgraded = upgraded;
}

public void update() {
Expand All @@ -31,7 +29,7 @@ public void update() {
c.misc += this.miscIncrease;
if (c.misc % TRANSFORM_PLAYS == 0) {
c.misc--;
AbstractDungeon.actionManager.addToTop(new ReplaceGrowBookAction(c, c.misc / TRANSFORM_PLAYS, upgraded));
AbstractDungeon.actionManager.addToTop(new ReplaceGrowBookAction(c, c.misc / TRANSFORM_PLAYS, c.upgraded));
} else {
((GrowBook) c).setTag(c.misc);
c.applyPowers();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void update() {
this.p.hand.refreshHandLayout();
this.p.hand.applyPowers();
}
if (!(pow instanceof ScentOfRosmariPower)) {
if (!(pow instanceof ScentOfRosmariPower) && !cards.isEmpty()) {
AbstractDungeon.actionManager.addToTop(new ApplyPowerAction(p, p, new ScentOfRosmariPower(cards)));
}
this.returnCards();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,25 @@ public UsePotionOnRandomTargetAction(AbstractPotion p) {
}

public void update() {
if (this.duration == Settings.ACTION_DUR_FAST) {
if (AbstractDungeon.getMonsters().areMonstersBasicallyDead()) {
this.isDone = true;
return;
}
AbstractCreature target = null;
ArrayList<AbstractMonster> tmp = new ArrayList<>();
for (AbstractMonster m : AbstractDungeon.getMonsters().monsters) {
if (!m.halfDead && !m.isDying && !m.isEscaping) {
tmp.add(m);
}
}
if (tmp.size() > 0) {
target = tmp.get(MathUtils.random(0, tmp.size() - 1));
if (AbstractDungeon.getMonsters().areMonstersBasicallyDead()) {
this.isDone = true;
return;
}
AbstractCreature target = null;
ArrayList<AbstractMonster> tmp = new ArrayList<>();
for (AbstractMonster m : AbstractDungeon.getMonsters().monsters) {
if (!m.halfDead && !m.isDying && !m.isEscaping) {
tmp.add(m);
}
}
if (tmp.size() > 0) {
target = tmp.get(MathUtils.random(0, tmp.size() - 1));
}

this.target = target;
this.target = target;

p.use(target);
}
p.use(target);
this.isDone = true;
this.tickDuration();
}
}
43 changes: 24 additions & 19 deletions src/main/java/the_gatherer/cards/DrugPower.java
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
package the_gatherer.cards;

import basemod.abstracts.CustomCard;
import com.megacrit.cardcrawl.actions.AbstractGameAction;
import com.megacrit.cardcrawl.actions.animations.VFXAction;
import com.megacrit.cardcrawl.actions.common.DamageAction;
import com.megacrit.cardcrawl.actions.common.HealAction;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.cards.DamageInfo;
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.potions.AttackPotion;
import com.megacrit.cardcrawl.potions.FruitJuice;
import com.megacrit.cardcrawl.potions.PowerPotion;
import com.megacrit.cardcrawl.potions.SkillPotion;
import com.megacrit.cardcrawl.vfx.SpeechBubble;
import com.megacrit.cardcrawl.vfx.combat.BiteEffect;
import com.megacrit.cardcrawl.vfx.combat.FlashAtkImgEffect;
import the_gatherer.GathererMod;
import the_gatherer.actions.UsePotionOnRandomTargetAction;
import the_gatherer.patches.CardColorEnum;
Expand Down Expand Up @@ -58,25 +55,33 @@ public void applyPowers() {

public void use(AbstractPlayer p, AbstractMonster m) {

if (GathererMod.lastPotionUsedThisTurn != null && !GathererMod.lastPotionUsedThisTurn.isThrown) {
boolean notUsing = false;
if (GathererMod.lastPotionUsedThisTurn instanceof FruitJuice) {
if (GathererMod.drugPowerHPGain >= 100) {
AbstractDungeon.effectList.add(new SpeechBubble(AbstractDungeon.player.dialogX, AbstractDungeon.player.dialogY, 2.0f,
EXTENDED_DESCRIPTION[3], true));
notUsing = true;
} else {
GathererMod.drugPowerHPGain += GathererMod.lastPotionUsedThisTurn.getPotency();
boolean useLater = false;
if (GathererMod.lastPotionUsedThisTurn != null) {
if (!GathererMod.lastPotionUsedThisTurn.isThrown &&
!(GathererMod.lastPotionUsedThisTurn instanceof PowerPotion) &&
!(GathererMod.lastPotionUsedThisTurn instanceof SkillPotion) &&
!(GathererMod.lastPotionUsedThisTurn instanceof AttackPotion)) {
boolean notUsing = false;
if (GathererMod.lastPotionUsedThisTurn instanceof FruitJuice) {
if (GathererMod.drugPowerHPGain >= 100) {
AbstractDungeon.effectList.add(new SpeechBubble(AbstractDungeon.player.dialogX, AbstractDungeon.player.dialogY, 2.0f,
EXTENDED_DESCRIPTION[3], true));
notUsing = true;
} else {
GathererMod.drugPowerHPGain += GathererMod.lastPotionUsedThisTurn.getPotency();
}
}
}
if (!notUsing) {
GathererMod.lastPotionUsedThisTurn.use(null);
if (!notUsing) {
GathererMod.lastPotionUsedThisTurn.use(null);
}
} else {
useLater = true;
}
}

AbstractDungeon.actionManager.addToBottom(new DamageAction(m, new DamageInfo(p, this.damage, this.damageTypeForTurn), BLUNT_HEAVY));

if (GathererMod.lastPotionUsedThisTurn != null && GathererMod.lastPotionUsedThisTurn.isThrown) {
if (useLater) {
AbstractDungeon.actionManager.addToBottom(new UsePotionOnRandomTargetAction(GathererMod.lastPotionUsedThisTurn));
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/the_gatherer/cards/GrowBook.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void initializeDescription() {
}

public void use(AbstractPlayer p, AbstractMonster m) {
AbstractDungeon.actionManager.addToBottom(new IncreaseGrowBookMiscAction(this.uuid, this.misc, 1, upgraded));
AbstractDungeon.actionManager.addToBottom(new IncreaseGrowBookMiscAction(this.uuid, 1));
AbstractDungeon.actionManager.addToBottom(new GainBlockAction(p, p, this.block));
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/ModTheSpire.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"Celicath"
],
"credits" : "MappyTheKat - Character art",
"description": "Adds The Gatherer as a new playable character with 75 cards, 8 relics.\r\n- Requires Basemod, StSLib to run.\r\n\r\nv0.4.0 - v0.4.1\r\n- 2 new relics: FlyingFruit, Leftovers\r\n- HP changed to 72 (was 64)\r\n- Various text changes.\r\n- Changes to list of Lesser Potions\r\n- Buff: Centralize, Flower Falling, Flower Shield, Gather Material, Herbalism, Polymorphism, Scent of Rosmari, Smart Maneuver, Grow Book, Mind Search, Scroll of Purity, Lucky Clover\r\n- Nerf: Heart to Fruit\r\n- Changed: Photoscythe, Upgrade Bag\r\n- Rework: Save Valuables\r\n\r\nv0.4.2\r\n- New relic: Explorer's Path\n- Changes: Star Fruit, Misfortune, Enchant, Recipe Change, Solidify, Scroll of Purity, Poison Mastery\n- Bug fix: Collector's Shot, Drug Power, Smart Maneuver, Stone Fence\r\n\r\n- For more information, visit\r\nhttps://github.com/Celicath/GathererMod/releases",
"version": "0.4.2",
"description": "Adds The Gatherer as a new playable character with 75 cards, 8 relics.\r\n- Requires Basemod, StSLib to run.\r\n\r\nv0.4.0 - v0.4.2\r\n- 3 new relics: FlyingFruit, Leftovers, Explorer's Path\r\n- HP changed to 72 (was 64)\r\n- Various text changes.\r\n- Changes to list of Lesser Potions\r\n- Buff: Centralize, Star Fruit, Flower Falling, Flower Shield, Gather Material, Herbalism, Polymorphism, Scent of Rosmari, Smart Maneuver, Solidify, Grow Book, Mind Search, Scroll of Purity, Lucky Clover\r\n- Nerf: Enchant, Heart to Fruit\r\n- Changed: Photoscythe, Upgrade Bag\r\n- Rework: Misfortune, Recipe Change, Save Valuables, Poison Mastery\r\n\r\nv0.4.3\n- Bug fix: Drug Power, Scent of Rosmari, Grow Book, Mind Search\r\n\r\n- For more information, visit\r\nhttps://github.com/Celicath/GathererMod/releases",
"version": "0.4.3",
"sts_version": "12-06-2018",
"mts_version": "3.6.2",
"dependencies": [
Expand Down

0 comments on commit d482780

Please sign in to comment.