Skip to content

Commit

Permalink
Merge pull request #70 from GraysonnG/develop
Browse files Browse the repository at this point in the history
Merge Develop into Master 12/10/18
  • Loading branch information
GraysonnG committed Dec 10, 2018
2 parents 6c6f8e8 + 4ed2177 commit 6e5dfe3
Show file tree
Hide file tree
Showing 11 changed files with 156 additions and 33 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>InfiniteSpire</groupId>
<artifactId>InfiniteSpire</artifactId>
<version>0.7.0</version>
<version>0.9.0</version>
<dependencies>
<dependency>
<groupId>com.megacrit.cardcrawl</groupId>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/infinitespire/InfiniteSpire.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
@SpireInitializer
public class InfiniteSpire implements PostInitializeSubscriber, PostBattleSubscriber, EditRelicsSubscriber,
EditCardsSubscriber, EditKeywordsSubscriber, EditStringsSubscriber, PreDungeonUpdateSubscriber {
public static final String VERSION = "0.7.0";
public static final String VERSION = "0.9.0";
public static final Logger logger = LogManager.getLogger(InfiniteSpire.class.getName());

private static ArrayList<OnQuestRemovedSubscriber> onQuestRemovedSubscribers = new ArrayList<>();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/infinitespire/helpers/CardHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static BlackCard getRandomBlackCard() {
keys.add(c.getKey());
}
}
return (BlackCard) CardLibrary.cards.get(keys.get(AbstractDungeon.cardRng.random(0, keys.size() - 1)));
return (BlackCard) CardLibrary.cards.get(keys.get(AbstractDungeon.cardRng.random(0, keys.size() - 1))).makeStatEquivalentCopy();
}

public static void addCard(AbstractCard card) {
Expand Down
22 changes: 14 additions & 8 deletions src/main/java/infinitespire/monsters/LordOfAnnihilation.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@
import com.megacrit.cardcrawl.helpers.ScreenShake;
import com.megacrit.cardcrawl.localization.MonsterStrings;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import com.megacrit.cardcrawl.powers.ArtifactPower;
import com.megacrit.cardcrawl.powers.FrailPower;
import com.megacrit.cardcrawl.powers.VulnerablePower;
import com.megacrit.cardcrawl.powers.WeakPower;
import com.megacrit.cardcrawl.powers.*;
import com.megacrit.cardcrawl.relics.AbstractRelic;
import com.megacrit.cardcrawl.vfx.ObtainKeyEffect;
import com.megacrit.cardcrawl.vfx.cardManip.ExhaustCardEffect;
import infinitespire.InfiniteSpire;
import infinitespire.actions.FastHealAction;
Expand Down Expand Up @@ -102,7 +100,7 @@ public void usePreBattleAction() {
AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(this, this,
new LordOfAnnihilationIntangiblePower(this, 1),1));
AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(this, this,
new BossArmorPower(1000, 2, 0.1f, this)));
new InvinciblePower(this, this.maxHealth / 10)));
CardCrawlGame.screenShake.shake(ScreenShake.ShakeIntensity.HIGH, ScreenShake.ShakeDur.MED, false);
}

Expand Down Expand Up @@ -147,13 +145,18 @@ public void die() {
MainMenuPatch.setMainMenuBG(null);
InfiniteSpire.saveData();
InfiniteSpire.lordBackgroundEffect.stopEffect();
AbstractDungeon.topLevelEffects.add(new ObtainKeyEffect(ObtainKeyEffect.KeyColor.BLUE));
AbstractDungeon.topLevelEffects.add(new ObtainKeyEffect(ObtainKeyEffect.KeyColor.GREEN));
AbstractDungeon.topLevelEffects.add(new ObtainKeyEffect(ObtainKeyEffect.KeyColor.RED));
Settings.isEndless = false;
AbstractDungeon.topPanel.setPlayerName();
super.die();
this.onBossVictoryLogic();
this.onFinalBossVictoryLogic();
}

public void changeIntentToNuke(){
this.setMove(MOVES[3],(byte) 4, Intent.ATTACK_BUFF, this.damage.get(4).base);
this.setMove(MOVES[3], (byte) 4, Intent.ATTACK_BUFF, AbstractDungeon.player.maxHealth / 5);
this.createIntent();
}

Expand Down Expand Up @@ -196,7 +199,8 @@ public void takeTurn() {
break;
case 4: //nuke
manager.addToBottom(new LoseBlockAction(player, this, player.currentBlock));
manager.addToBottom(new LoseHPAction(player, this, player.maxHealth / 3));
manager.addToBottom(new DamageAction(player, new DamageInfo(this, player.maxHealth / 5), AbstractGameAction.AttackEffect.SMASH));
manager.addToBottom(new RemoveAllPowersAction(this, true));
manager.addToBottom(new ApplyPowerAction(this, this, new ArtifactPower(this, 2),2));
break;
//----------------------Defends--------------------------
Expand All @@ -219,7 +223,7 @@ public void takeTurn() {
manager.addToBottom(new ApplyPowerAction(this, this, new LordOfAnnihilationRetaliatePower(this)));
manager.addToBottom(new ApplyPowerAction(this, this, new ArtifactPower(this, 3),3));
manager.addToBottom(new ApplyPowerAction(this, this,
new BossArmorPower(1000, 2, 0.1f, this)));
new InvinciblePower(this, this.maxHealth / 10)));
break;
case 9: //buff wipe himself and spawn pylons

Expand Down Expand Up @@ -323,6 +327,7 @@ private void phase1(int i){
}
}

//TODO: Rework
private void phase2(int i){
if(this.turn % 3 == 0 && this.turn > 0){
this.setMove(MOVES[1], (byte) 3, Intent.ATTACK, this.damage.get(4).base);
Expand All @@ -335,6 +340,7 @@ private void phase2(int i){
}
}

@SuppressWarnings("unused")
private void phase3(int i){
this.setMove((byte) 7, Intent.DEFEND);
}
Expand Down
78 changes: 64 additions & 14 deletions src/main/java/infinitespire/monsters/Nightmare.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
import com.megacrit.cardcrawl.localization.MonsterStrings;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import com.megacrit.cardcrawl.powers.AbstractPower;
import com.megacrit.cardcrawl.powers.InvinciblePower;
import com.megacrit.cardcrawl.powers.MetallicizePower;
import com.megacrit.cardcrawl.powers.StrengthPower;
import com.megacrit.cardcrawl.vfx.cardManip.ExhaustCardEffect;
import com.megacrit.cardcrawl.vfx.combat.PowerBuffEffect;
import infinitespire.InfiniteSpire;
import infinitespire.effects.BlackCardEffect;
import infinitespire.powers.KeyMirrorPower;
import infinitespire.powers.RealityShiftPower;
import infinitespire.powers.SpireBlightPower;

Expand All @@ -47,6 +49,7 @@ public class Nightmare extends AbstractMonster {
private boolean isAlpha;
private int attackDmg;
private int slamDmg;
private int debuffDmg;
private int blockCount;
private int effectCount;
private boolean isStrong;
Expand All @@ -66,7 +69,11 @@ public Nightmare(boolean isAlpha) {
hpAmount += 100;
}

if(CardCrawlGame.playerName.equals("fiiiiilth")){
this.name = "Niiiiightmare";
}

this.debuffDmg = 10;

if(AbstractDungeon.bossCount > 1 || timesDefeated > 0) {
isStrong = true;
Expand All @@ -82,11 +89,15 @@ public Nightmare(boolean isAlpha) {
this.effectCount = 2; //effectively 3
}

if(Settings.hasSapphireKey) {
hpAmount += 50;
}

this.setHp(hpAmount);

this.damage.add(new DamageInfo(this, this.attackDmg));
this.damage.add(new DamageInfo(this, this.slamDmg));
this.damage.add(new DamageInfo(this, this.debuffDmg));
}

public static void save(SpireConfig config) {
Expand Down Expand Up @@ -165,8 +176,28 @@ public void update() {
public void usePreBattleAction() {
GameActionManager manager = AbstractDungeon.actionManager;

if(Settings.hasRubyKey) {
manager.addToBottom(new ApplyPowerAction(this, this, new KeyMirrorPower(this, KeyMirrorPower.KeyColor.RUBY)));
}

if(Settings.hasSapphireKey) {
manager.addToBottom(new ApplyPowerAction(this, this, new KeyMirrorPower(this, KeyMirrorPower.KeyColor.SAPPHIRE)));
}

if(Settings.hasEmeraldKey) {
manager.addToBottom(new ApplyPowerAction(this, this, new KeyMirrorPower(this, KeyMirrorPower.KeyColor.EMERALD)));
}

if(this.isAlpha){
manager.addToBottom(new ApplyPowerAction(this, this, new RealityShiftPower(this), 50));

if(Settings.hasEmeraldKey) {
manager.addToBottom(new ApplyPowerAction(this, this, new InvinciblePower(this, this.maxHealth / 3)));
}
}

if(Settings.hasEmeraldKey) {
manager.addToBottom(new ApplyPowerAction(this, this, new StrengthPower(this, 2), 2));
}

if(isStrong) {
Expand All @@ -191,7 +222,6 @@ public void takeTurn() {
if(!this.hasPower("is_Reality_Shift")) {
AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(this, this, new RealityShiftPower(this), 50));
}
this.firstTurn = false;
break;
case 2:
AbstractDungeon.actionManager.addToBottom(new AnimateFastAttackAction(this));
Expand All @@ -207,11 +237,17 @@ public void takeTurn() {
AbstractDungeon.actionManager.addToBottom(new GainBlockAction(this, this, this.blockCount));
break;
case 5:
AbstractCard voidCard = CardLibrary.getCard(VoidCard.ID);

AbstractDungeon.actionManager.addToTop(new MakeTempCardInDrawPileAction(voidCard, effectCount - 2, true, true));
AbstractDungeon.actionManager.addToTop(new MakeTempCardInDiscardAction(voidCard, effectCount - 2));
AbstractDungeon.actionManager.addToBottom(new AnimateFastAttackAction(this));
for(int i = 0; i < this.effectCount; i++) {
AbstractDungeon.actionManager.addToBottom(new DamageAction(AbstractDungeon.player, this.damage.get(0), AbstractGameAction.AttackEffect.SLASH_HORIZONTAL, true));
}
AbstractDungeon.actionManager.addToBottom(new HealAction(this, this, 25));
break;
case 6:
AbstractDungeon.actionManager.addToBottom(new DamageAction(AbstractDungeon.player, this.damage.get(2), AbstractGameAction.AttackEffect.SLASH_VERTICAL));
AbstractCard voidCard = CardLibrary.getCopy(VoidCard.ID).makeCopy();

AbstractDungeon.actionManager.addToBottom(new MakeTempCardInDrawPileAction(voidCard, 2, true, true));
break;
}
AbstractDungeon.actionManager.addToBottom(new RollMoveAction(this));
Expand All @@ -229,14 +265,23 @@ protected void getMove(int num) {
public void getMoveAlpha(int num) {
this.hasActivated = false;
if(firstTurn) {
this.setMove(Nightmare.MOVES[0], (byte)1, Intent.MAGIC);
if(Settings.hasSapphireKey) {
this.setMove(Nightmare.MOVES[1], (byte) 2, Intent.ATTACK, this.damage.get(0).base, this.effectCount, true);
} else {
this.setMove(Nightmare.MOVES[3], (byte) 4, Intent.DEFEND);
}
firstTurn = false;
return;
}
if(num < 50) {
this.setMove(Nightmare.MOVES[2], (byte) 3, Intent.ATTACK_BUFF, this.damage.get(1).base);
}else if (num < 60) {
this.setMove(Nightmare.MOVES[1], (byte) 2, Intent.ATTACK, this.damage.get(0).base, this.effectCount, true);
}else {
if(num > 20) {
if(num % 3 == 0){
this.setMove(Nightmare.MOVES[1], (byte) 2, Intent.ATTACK, this.damage.get(0).base, this.effectCount, true);
} else if(Settings.hasRubyKey && num % 3 == 1) {
this.setMove((byte) 6, Intent.ATTACK_DEBUFF, this.damage.get(2).base);
} else {
this.setMove(Nightmare.MOVES[2], (byte) 3, Intent.ATTACK_BUFF, this.damage.get(1).base);
}
} else {
this.setMove(Nightmare.MOVES[3], (byte) 4, Intent.DEFEND);
}
}
Expand All @@ -245,11 +290,16 @@ public void getMoveBeta(int num) {
this.hasActivated = false;
if(firstTurn) {
this.setMove(Nightmare.MOVES[0], (byte) 1, Intent.MAGIC);
firstTurn = false;
return;
}
if (num > 20) {
this.setMove(Nightmare.MOVES[2], (byte) 3, Intent.ATTACK_BUFF, this.damage.get(1).base);
}else {
if(Settings.hasRubyKey && num % 3 == 0){
this.setMove(Nightmare.MOVES[1], (byte) 2, Intent.ATTACK, this.damage.get(0).base, this.effectCount, true);
} else {
this.setMove(Nightmare.MOVES[2], (byte) 3, Intent.ATTACK_BUFF, this.damage.get(1).base);
}
} else {
this.setMove(Nightmare.MOVES[3], (byte) 4, Intent.DEFEND);
}
}
Expand All @@ -271,7 +321,7 @@ public void onEnoughDamageTakenAlpha() {
AbstractDungeon.actionManager.addToTop(new GainBlockAction(this, this, this.blockCount));
AbstractDungeon.effectList.add(new BlackCardEffect());

this.setMove((byte) 5, Intent.STRONG_DEBUFF);
this.setMove((byte) 5, Intent.ATTACK_BUFF, this.damage.get(0).base, this.effectCount, true);
this.createIntent();

AbstractDungeon.actionManager.cardQueue.clear();
Expand Down
57 changes: 57 additions & 0 deletions src/main/java/infinitespire/powers/KeyMirrorPower.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package infinitespire.powers;

import com.megacrit.cardcrawl.core.AbstractCreature;
import com.megacrit.cardcrawl.powers.AbstractPower;
import infinitespire.InfiniteSpire;

public class KeyMirrorPower extends AbstractPower {

public enum KeyColor {
RUBY,
SAPPHIRE,
EMERALD
}

private KeyColor keyColor;

public KeyMirrorPower(AbstractCreature owner, KeyColor keyColor){
this.keyColor = keyColor;
this.owner = owner;
this.amount = -1;
this.ID = "is_KeyMirrorPower_" + keyColor.toString().toLowerCase();
this.type = PowerType.BUFF;
this.priority = -99999;

switch(keyColor){
case RUBY:
this.name = "Ruby Mirror";
this.img = InfiniteSpire.getTexture("img/infinitespire/powers/rubyKey.png");
break;
case SAPPHIRE:
this.name = "Sapphire Mirror";
this.img = InfiniteSpire.getTexture("img/infinitespire/powers/sapphireKey.png");
break;
case EMERALD:
this.name = "Emerald Mirror";
this.img = InfiniteSpire.getTexture("img/infinitespire/powers/emeraldKey.png");
break;
}

this.updateDescription();
}

@Override
public void updateDescription() {
switch (this.keyColor) {
case RUBY:
this.description = owner.name + " will be more intelligent.";
break;
case SAPPHIRE:
this.description = owner.name + " will be more aggressive.";
break;
case EMERALD:
this.description = owner.name + " will be more powerful.";
break;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package infinitespire.powers;

import com.megacrit.cardcrawl.core.AbstractCreature;
import com.megacrit.cardcrawl.powers.AbstractPower;
import infinitespire.InfiniteSpire;
import infinitespire.monsters.LordOfAnnihilation;

public class LordOfAnnihilationRetaliatePower extends AbstractPower {

LordOfAnnihilation gOwner;
private boolean intentChanged = false;

public LordOfAnnihilationRetaliatePower(LordOfAnnihilation owner){
this.owner = owner;
this.gOwner = owner;
this.amount = 0;
this.amount = -1;
this.name = "Divine Shield";
this.ID = "is_DivineShield";
this.img = InfiniteSpire.getTexture("img/infinitespire/powers/retaliate.png");
Expand All @@ -22,9 +22,19 @@ public LordOfAnnihilationRetaliatePower(LordOfAnnihilation owner){
}

@Override
public void onApplyPower(AbstractPower power, AbstractCreature target, AbstractCreature source) {
if(power.type == PowerType.DEBUFF){
gOwner.changeIntentToNuke();
public void atEndOfRound() {
intentChanged = false;
}

@Override
public void update(int slot) {
super.update(slot);
for(AbstractPower p : owner.powers){
if(!intentChanged && p.type == PowerType.DEBUFF) {
gOwner.changeIntentToNuke();
intentChanged = true;
return;
}
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/ModTheSpire.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"name": "Infinite Spire",
"author_list": ["Blank The Evil"],
"description": "Adds a new way to climb the spire forever, complete quests along the way, but be careful, the spire will not be kind to those who do not give up.",
"credits" : "Contributors: The_Evil_Pickle",
"credits" : "Contributors: The_Evil_Pickle, RedDyeNo5",
"dependencies" : ["basemod","stslib"],
"version": "0.7.0",
"sts_version": "11-15-2018",
"version": "0.9.0",
"sts_version": "12-06-2018",
"mts_version": "3.6.2",
"update_json": "https://api.github.com/repos/GraysonnG/InfiniteSpire/releases/latest"
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6e5dfe3

Please sign in to comment.