diff --git a/src/main/java/spireMapOverhaul/zones/hailstorm/HailstormZone.java b/src/main/java/spireMapOverhaul/zones/hailstorm/HailstormZone.java new file mode 100644 index 000000000..0c8cde156 --- /dev/null +++ b/src/main/java/spireMapOverhaul/zones/hailstorm/HailstormZone.java @@ -0,0 +1,142 @@ +package spireMapOverhaul.zones.hailstorm; + +import basemod.BaseMod; +import com.badlogic.gdx.graphics.Color; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.badlogic.gdx.math.MathUtils; +import com.megacrit.cardcrawl.actions.AbstractGameAction; +import com.megacrit.cardcrawl.actions.GameActionManager; +import com.megacrit.cardcrawl.actions.common.DamageAction; +import com.megacrit.cardcrawl.actions.common.DamageAllEnemiesAction; +import com.megacrit.cardcrawl.actions.common.GainBlockAction; +import com.megacrit.cardcrawl.cards.DamageInfo; +import com.megacrit.cardcrawl.core.AbstractCreature; +import com.megacrit.cardcrawl.core.CardCrawlGame; +import com.megacrit.cardcrawl.dungeons.AbstractDungeon; +import com.megacrit.cardcrawl.monsters.AbstractMonster; +import com.megacrit.cardcrawl.monsters.MonsterGroup; +import com.megacrit.cardcrawl.monsters.exordium.Looter; +import com.megacrit.cardcrawl.random.Random; +import com.megacrit.cardcrawl.rooms.AbstractRoom; +import com.megacrit.cardcrawl.ui.campfire.AbstractCampfireOption; +import com.megacrit.cardcrawl.ui.campfire.RestOption; +import spireMapOverhaul.BetterMapGenerator; +import spireMapOverhaul.SpireAnniversary6Mod; +import spireMapOverhaul.abstracts.AbstractZone; +import spireMapOverhaul.zoneInterfaces.*; +import spireMapOverhaul.zones.hailstorm.campfire.FlintOption; +import spireMapOverhaul.zones.hailstorm.events.AbandonedCamp; +import spireMapOverhaul.zones.hailstorm.monsters.FrostSlimeL; +import spireMapOverhaul.zones.hailstorm.monsters.FrostSlimeM; +import spireMapOverhaul.zones.hailstorm.vfx.HailEffect; +import spireMapOverhaul.zones.hailstorm.vfx.HailstormEffect; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import static spireMapOverhaul.SpireAnniversary6Mod.makeID; +import static spireMapOverhaul.util.Wiz.adp; + +public class HailstormZone extends AbstractZone implements CombatModifyingZone, ModifiedEventRateZone, RenderableZone, EncounterModifyingZone, CampfireModifyingZone { + public static final String ID = "Hailstorm"; + public static final String Frost_Slime_L = SpireAnniversary6Mod.makeID("Frost_Slime_L"); + public static final String Frost_Slime_M = SpireAnniversary6Mod.makeID("Frost_Slime_M"); + public static final String Exordium_Thugs_FrostSlime = SpireAnniversary6Mod.makeID("Exordium_Thugs_FrostSlime"); + + public static final int blockFromSnow = 4; + public static final int turnSwitchBetweenSnowBlockAndHailDamage = 4; + + public void atTurnStart() { + if (GameActionManager.turn < turnSwitchBetweenSnowBlockAndHailDamage) { + AbstractDungeon.actionManager.addToBottom(new GainBlockAction(adp(), blockFromSnow)); + for (AbstractMonster q : AbstractDungeon.getCurrRoom().monsters.monsters) { + AbstractDungeon.actionManager.addToBottom(new GainBlockAction(q, blockFromSnow)); + } + } + } + public void atTurnEnd() { + if (GameActionManager.turn > turnSwitchBetweenSnowBlockAndHailDamage) { + AbstractDungeon.actionManager.addToBottom(new DamageAction(adp(), new DamageInfo((AbstractCreature) null, GameActionManager.turn, DamageInfo.DamageType.THORNS), AbstractGameAction.AttackEffect.BLUNT_LIGHT)); + AbstractDungeon.actionManager.addToBottom(new DamageAllEnemiesAction((AbstractCreature) null, DamageInfo.createDamageMatrix(GameActionManager.turn, true), DamageInfo.DamageType.THORNS, AbstractGameAction.AttackEffect.BLUNT_LIGHT)); + } + } + + public String getCombatText() { + return CardCrawlGame.languagePack.getUIString(makeID("HailEffect")).TEXT[0]; + //I'd like to update text during combat so the player doesn't have to remind himself every single turn + } + + @Override + public String forceEvent() { + return ModifiedEventRateZone.returnIfUnseen(AbandonedCamp.ID); + } + + public HailstormZone() { + super(ID, Icons.MONSTER, Icons.EVENT, Icons.REST); + this.width = 2; + this.maxWidth = 4; + this.height = 3; + this.maxHeight = 4; + } + + + @Override + public void update() { + if (GameActionManager.turn <= turnSwitchBetweenSnowBlockAndHailDamage) + for (int i = 0; i < 7; i++) { + AbstractDungeon.effectsQueue.add(new HailEffect()); + } + else + for (int i = 0; i < 20; i++) { + AbstractDungeon.effectsQueue.add(new HailstormEffect()); + } + } + + @Override + public AbstractZone copy() { + return new HailstormZone(); + } + + @Override + public Color getColor() { + return Color.CYAN.cpy(); + } + + @Override + public boolean canSpawn() { + return this.isAct(1); + } + + @Override + protected boolean canIncludeEarlyRows() { + return false; + } + + @Override + public List getNormalEncounters() { + return Arrays.asList( + new ZoneEncounter(Frost_Slime_L, 1, () -> new MonsterGroup( + new AbstractMonster[]{ + new FrostSlimeL(0.0f, 0.0f), + })), + new ZoneEncounter(Exordium_Thugs_FrostSlime, 1, () -> new MonsterGroup( + new AbstractMonster[]{ + new Looter(200.0f, 0.0f), + new FrostSlimeM(-100.0f, 0.0f), + })) + + ); + } + + public void postAddButtons(ArrayList buttons) { + for (AbstractCampfireOption c : buttons) { + if (c instanceof RestOption && c.usable) { + c.usable = false; + ((RestOption) c).updateUsability(false); + break; + } + } + } +} diff --git a/src/main/java/spireMapOverhaul/zones/hailstorm/campfire/FlintOption.java b/src/main/java/spireMapOverhaul/zones/hailstorm/campfire/FlintOption.java new file mode 100644 index 000000000..dcb298778 --- /dev/null +++ b/src/main/java/spireMapOverhaul/zones/hailstorm/campfire/FlintOption.java @@ -0,0 +1,64 @@ +package spireMapOverhaul.zones.hailstorm.campfire; + +import com.badlogic.gdx.graphics.Texture; +import com.megacrit.cardcrawl.cards.AbstractCard; +import com.megacrit.cardcrawl.core.CardCrawlGame; +import com.megacrit.cardcrawl.dungeons.AbstractDungeon; +import com.megacrit.cardcrawl.helpers.ImageMaster; +import com.megacrit.cardcrawl.localization.UIStrings; +import com.megacrit.cardcrawl.relics.AbstractRelic; +import com.megacrit.cardcrawl.relics.DreamCatcher; +import com.megacrit.cardcrawl.rewards.RewardItem; +import com.megacrit.cardcrawl.ui.campfire.AbstractCampfireOption; +import com.megacrit.cardcrawl.vfx.campfire.CampfireSleepEffect; +import com.megacrit.cardcrawl.vfx.campfire.CampfireSleepScreenCoverEffect; +import com.megacrit.cardcrawl.vfx.campfire.CampfireTokeEffect; +import spireMapOverhaul.util.TexLoader; +import spireMapOverhaul.zones.hailstorm.HailstormZone; +import spireMapOverhaul.zones.hailstorm.patches.CardRewardScreenFlintDreamCatcherInteractionPatch; +import spireMapOverhaul.zones.hailstorm.relics.Flint; + +import java.util.ArrayList; + +import static spireMapOverhaul.SpireAnniversary6Mod.makeID; +import static spireMapOverhaul.SpireAnniversary6Mod.makeUIPath; +import static spireMapOverhaul.util.Wiz.adp; + +public class FlintOption extends AbstractCampfireOption { + private static final UIStrings uiStrings; + public static final String[] TEXT; + + private static final Texture IMG = TexLoader.getTexture(makeUIPath("Hailstorm/FlintOption.png")); + + public FlintOption() { + this.label = TEXT[0]; + this.description = TEXT[1]; + this.img = IMG; + int healAmt = (int)((float)AbstractDungeon.player.maxHealth * 0.6F); + } + + public void useOption() { + CardCrawlGame.sound.play("SLEEP_BLANKET"); + //First time + AbstractDungeon.effectList.add(new CampfireSleepEffect()); + + //Second time + handling Dream Catcher + if (AbstractDungeon.player.hasRelic(DreamCatcher.ID)) { + CardRewardScreenFlintDreamCatcherInteractionPatch.trigger = true; + } + AbstractDungeon.effectList.add(new CampfireSleepEffect()); + + // + for(int i = 0; i < 30; ++i) { + AbstractDungeon.topLevelEffects.add(new CampfireSleepScreenCoverEffect()); + } + + if (adp().hasRelic(Flint.ID)) + adp().getRelic(Flint.ID).onTrigger(); + } + + static { + uiStrings = CardCrawlGame.languagePack.getUIString(makeID(FlintOption.class.getSimpleName())); + TEXT = uiStrings.TEXT; + } +} diff --git a/src/main/java/spireMapOverhaul/zones/hailstorm/cards/Freeze.java b/src/main/java/spireMapOverhaul/zones/hailstorm/cards/Freeze.java new file mode 100644 index 000000000..d9689154f --- /dev/null +++ b/src/main/java/spireMapOverhaul/zones/hailstorm/cards/Freeze.java @@ -0,0 +1,30 @@ +package spireMapOverhaul.zones.hailstorm.cards; + +import com.megacrit.cardcrawl.actions.common.MakeTempCardInDiscardAction; +import com.megacrit.cardcrawl.characters.AbstractPlayer; +import com.megacrit.cardcrawl.monsters.AbstractMonster; +import spireMapOverhaul.SpireAnniversary6Mod; +import spireMapOverhaul.abstracts.AbstractSMOCard; +import spireMapOverhaul.zones.hailstorm.HailstormZone; + +//Can be renamed Freezing if needed +public class Freeze extends AbstractSMOCard { + public static final String ID = SpireAnniversary6Mod.makeID("Freeze"); + private static final int COST = -2; + + public Freeze() { + super(ID, HailstormZone.ID, COST, CardType.CURSE, CardRarity.CURSE, CardTarget.NONE, CardColor.CURSE); + this.selfRetain = true; + cardsToPreview = new IceBurn(); + } + + public void use(AbstractPlayer p, AbstractMonster m) { + } + + public void triggerOnEndOfTurnForPlayingCard() { + this.addToTop((new MakeTempCardInDiscardAction(new IceBurn(upgraded), 1))); + } + public void upp() { + cardsToPreview.upgrade(); + } +} diff --git a/src/main/java/spireMapOverhaul/zones/hailstorm/cards/IceBurn.java b/src/main/java/spireMapOverhaul/zones/hailstorm/cards/IceBurn.java new file mode 100644 index 000000000..e1ff844ee --- /dev/null +++ b/src/main/java/spireMapOverhaul/zones/hailstorm/cards/IceBurn.java @@ -0,0 +1,48 @@ +package spireMapOverhaul.zones.hailstorm.cards; + +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.CardQueueItem; +import com.megacrit.cardcrawl.cards.DamageInfo; +import com.megacrit.cardcrawl.characters.AbstractPlayer; +import com.megacrit.cardcrawl.dungeons.AbstractDungeon; +import com.megacrit.cardcrawl.monsters.AbstractMonster; +import com.megacrit.cardcrawl.powers.FrailPower; +import spireMapOverhaul.SpireAnniversary6Mod; +import spireMapOverhaul.abstracts.AbstractSMOCard; +import spireMapOverhaul.zones.hailstorm.HailstormZone; + +public class IceBurn extends AbstractSMOCard { + public static final String ID = SpireAnniversary6Mod.makeID(IceBurn.class.getSimpleName()); + private static final int COST = -2; + + public IceBurn() { + super(ID, HailstormZone.ID, COST, CardType.STATUS, CardRarity.SPECIAL, CardTarget.NONE, CardColor.COLORLESS); + this.selfRetain = false; + this.magicNumber = 2; + this.baseMagicNumber = 2; + } + + public IceBurn(boolean upgraded) { + this(); + if (upgraded) + this.upgrade(); + } + + public void use(AbstractPlayer p, AbstractMonster m) { + if (this.dontTriggerOnUseCard) { + this.addToBot(new DamageAction(AbstractDungeon.player, new DamageInfo(AbstractDungeon.player, this.magicNumber, DamageInfo.DamageType.THORNS), AbstractGameAction.AttackEffect.FIRE)); + } + + } + + public void triggerOnEndOfTurnForPlayingCard() { + this.dontTriggerOnUseCard = true; + AbstractDungeon.actionManager.cardQueue.add(new CardQueueItem(this, true)); + } + + public void upp() { + upgradeMagicNumber(2); + } +} diff --git a/src/main/java/spireMapOverhaul/zones/hailstorm/events/AbandonedCamp.java b/src/main/java/spireMapOverhaul/zones/hailstorm/events/AbandonedCamp.java new file mode 100644 index 000000000..bb065eee2 --- /dev/null +++ b/src/main/java/spireMapOverhaul/zones/hailstorm/events/AbandonedCamp.java @@ -0,0 +1,174 @@ +package spireMapOverhaul.zones.hailstorm.events; + +import com.badlogic.gdx.math.MathUtils; +import com.megacrit.cardcrawl.actions.common.HealAction; +import com.megacrit.cardcrawl.cards.AbstractCard; +import com.megacrit.cardcrawl.cards.DamageInfo; +import com.megacrit.cardcrawl.core.AbstractCreature; +import com.megacrit.cardcrawl.core.CardCrawlGame; +import com.megacrit.cardcrawl.core.Settings; +import com.megacrit.cardcrawl.dungeons.AbstractDungeon; +import com.megacrit.cardcrawl.events.AbstractEvent; +import com.megacrit.cardcrawl.events.AbstractImageEvent; +import com.megacrit.cardcrawl.helpers.*; +import com.megacrit.cardcrawl.localization.EventStrings; +import com.megacrit.cardcrawl.relics.AbstractRelic; +import com.megacrit.cardcrawl.relics.DeadBranch; +import com.megacrit.cardcrawl.rewards.RewardItem; +import com.megacrit.cardcrawl.rooms.AbstractRoom; +import com.megacrit.cardcrawl.vfx.cardManip.ShowCardAndObtainEffect; +import spireMapOverhaul.SpireAnniversary6Mod; +import spireMapOverhaul.zones.hailstorm.cards.Freeze; +import spireMapOverhaul.zones.hailstorm.relics.Flint; + +import static spireMapOverhaul.util.Wiz.adp; + +public class AbandonedCamp extends AbstractImageEvent { + public static final String ID = SpireAnniversary6Mod.makeID(AbandonedCamp.class.getSimpleName()); + private static final EventStrings eventStrings = CardCrawlGame.languagePack.getEventString(ID); + private static final String NAME = eventStrings.NAME; + private static final String[] DESCRIPTIONS = eventStrings.DESCRIPTIONS; + private static final String[] OPTIONS = eventStrings.OPTIONS; + + public static final String IMG = SpireAnniversary6Mod.makeImagePath("events/Hailstorm/AbandonedCamp.png"); + + private static final float FLINT_HP_LOSS = (float) 1 /24; + private static final float A_15_FLINT_HP_LOSS = (float) 1 /16; + private static final int GOLD = 90; + private static final int A_15_GOLD = 60; + private static final float HEALING = (float) 1/6; + private static final float A_15_HEALING = (float) 1/9; + + private final boolean T_DEADBRANCH_F_FLINT; + private final boolean T_GOLD_F_HEALING; + + private final AbstractCard curse = new Freeze(); + private int hpLoss; + private int goldGain; + private int healing; + + private int screenNum = 0; + + + public AbandonedCamp() { + super(ID, NAME ,IMG ); + this.noCardsInRewards = true; + this.title = NAME; + this.body = DESCRIPTIONS[0] + " NL " + DESCRIPTIONS[1] + " NL " + DESCRIPTIONS[2] + " NL " + DESCRIPTIONS[3]; + + //Event randomly chooses one big reward between two, and one light reward between two + T_DEADBRANCH_F_FLINT = AbstractDungeon.miscRng.randomBoolean() && !adp().hasRelic(DeadBranch.ID); + T_GOLD_F_HEALING = AbstractDungeon.miscRng.randomBoolean(); + + //Rewards + if (AbstractDungeon.ascensionLevel >= 15) {//Asc 15 + + //First impactful reward + if (T_DEADBRANCH_F_FLINT) { + curse.upgrade(); + } else { + hpLoss = (int)(AbstractDungeon.player.maxHealth * A_15_FLINT_HP_LOSS); + } + + //Second light reward + if (T_GOLD_F_HEALING) { + goldGain = A_15_GOLD; + } else { + healing = (int)(A_15_HEALING * AbstractDungeon.player.maxHealth); + } + + } else {//Non-Asc 15 + + //First impactful reward + if (!T_DEADBRANCH_F_FLINT) { + hpLoss = (int)(AbstractDungeon.player.maxHealth * FLINT_HP_LOSS); + } + + //Second light reward + if (T_GOLD_F_HEALING) { + goldGain = GOLD; + } else { + healing = (int)(HEALING * AbstractDungeon.player.maxHealth); + } + + } + + //Text + //First impactful choice + if (T_DEADBRANCH_F_FLINT) { + this.imageEventText.setDialogOption(OPTIONS[0], curse); + } else { + this.imageEventText.setDialogOption(OPTIONS[1] + hpLoss + OPTIONS[2], new Flint()); + } + + //Second light choice + if (T_GOLD_F_HEALING) { + this.imageEventText.setDialogOption(OPTIONS[3] + goldGain + OPTIONS[4]); + } else { + this.imageEventText.setDialogOption(OPTIONS[5] + healing + OPTIONS[6]); + } + + this.imageEventText.setDialogOption(OPTIONS[7]); + } + + protected void buttonEffect(int buttonPressed) { + switch (screenNum) { + case 0: + switch (buttonPressed) { + case 0: + if (T_DEADBRANCH_F_FLINT) + AbstractDungeon.effectList.add(new ShowCardAndObtainEffect(curse, (float) Settings.WIDTH / 2.0F, (float) Settings.HEIGHT / 2.0F)); + else { + AbstractDungeon.player.damage(new DamageInfo((AbstractCreature) null, hpLoss)); + } + + AbstractDungeon.getCurrRoom().rewards.clear(); + + String targetRelicId = T_DEADBRANCH_F_FLINT ? DeadBranch.ID : Flint.ID; + AbstractRelic relic = RelicLibrary.getRelic(targetRelicId).makeCopy(); + AbstractDungeon.getCurrRoom().spawnRelicAndObtain((float) (Settings.WIDTH / 2), (float) (Settings.HEIGHT / 2), relic); + + this.screenNum = 1; + this.imageEventText.updateDialogOption(0, OPTIONS[8]); + this.imageEventText.clearRemainingOptions(); + this.imageEventText.updateBodyText(DESCRIPTIONS[4]); + + return; + case 1: + if (T_GOLD_F_HEALING) + AbstractDungeon.player.gainGold(goldGain); + else { + AbstractDungeon.player.heal(healing, true); + } + + this.screenNum = 1; + this.imageEventText.updateDialogOption(0, OPTIONS[8]); + this.imageEventText.clearRemainingOptions(); + this.imageEventText.updateBodyText(DESCRIPTIONS[4]); + + return; + case 2: + AbstractDungeon.getCurrRoom().phase = AbstractRoom.RoomPhase.COMPLETE; + + this.screenNum = 1; + this.imageEventText.updateDialogOption(0, OPTIONS[8]); + this.imageEventText.clearRemainingOptions(); + this.imageEventText.updateBodyText(DESCRIPTIONS[4]); + + return; + default: + return; + } + case 1: + if (buttonPressed == 0) { + this.openMap(); + } + break; + + default: + this.openMap(); + } + } + + +} diff --git a/src/main/java/spireMapOverhaul/zones/hailstorm/monsters/FrostSlimeL.java b/src/main/java/spireMapOverhaul/zones/hailstorm/monsters/FrostSlimeL.java new file mode 100644 index 000000000..0a6e8eabb --- /dev/null +++ b/src/main/java/spireMapOverhaul/zones/hailstorm/monsters/FrostSlimeL.java @@ -0,0 +1,203 @@ +package spireMapOverhaul.zones.hailstorm.monsters; + +import basemod.abstracts.CustomMonster; +import com.badlogic.gdx.math.MathUtils; +import com.megacrit.cardcrawl.actions.AbstractGameAction; +import com.megacrit.cardcrawl.actions.animations.AnimateShakeAction; +import com.megacrit.cardcrawl.actions.animations.AnimateSlowAttackAction; +import com.megacrit.cardcrawl.actions.common.*; +import com.megacrit.cardcrawl.actions.unique.CanLoseAction; +import com.megacrit.cardcrawl.actions.unique.CannotLoseAction; +import com.megacrit.cardcrawl.actions.utility.HideHealthBarAction; +import com.megacrit.cardcrawl.actions.utility.SFXAction; +import com.megacrit.cardcrawl.actions.utility.TextAboveCreatureAction; +import com.megacrit.cardcrawl.actions.utility.WaitAction; +import com.megacrit.cardcrawl.cards.DamageInfo; +import com.megacrit.cardcrawl.cards.status.Slimed; +import com.megacrit.cardcrawl.core.CardCrawlGame; +import com.megacrit.cardcrawl.dungeons.AbstractDungeon; +import com.megacrit.cardcrawl.localization.MonsterStrings; +import com.megacrit.cardcrawl.powers.*; +import spireMapOverhaul.SpireAnniversary6Mod; +public class FrostSlimeL extends CustomMonster { + public static final String ID = SpireAnniversary6Mod.makeID(FrostSlimeL.class.getSimpleName()); + private static final MonsterStrings monsterStrings = CardCrawlGame.languagePack.getMonsterStrings(ID); + public static final String NAME = monsterStrings.NAME; + public static final String[] MOVES = monsterStrings.MOVES; + private static final String IMG = SpireAnniversary6Mod.makeImagePath("monsters/Hailstorm/FrostSlimeL.png"); + + private static final String WOUND_NAME; + private static final String SPLIT_NAME; + private static final String BP_NAME; + + private boolean firstMove = true; + public static final int HP_MIN = 65; + public static final int HP_MAX = 69; + public static final int A_7_HP_MIN = 68; + public static final int A_7_HP_MAX = 72; + public static final int W_TACKLE_DMG = 11; + public static final int N_TACKLE_DMG = 16; + public static final int A_2_W_TACKLE_DMG = 12; + public static final int A_2_N_TACKLE_DMG = 18; + public static final int BP_TURNS = 2; + public static final int WOUND_COUNT = 2; + private static final byte SLIME_TACKLE = 1; + private static final byte NORMAL_TACKLE = 2; + private static final byte SPLIT = 3; + private static final byte BP_LICK = 4; + private float saveX; + private float saveY; + private boolean splitTriggered; + private int slimeTackleDamage; + private int slimeTackleSlimed; + private int lickBlockPreventionTurns; + private int normalTackleDamage; + + public FrostSlimeL() { + this(0.0f, 0.0f); + } + + public FrostSlimeL(final float x, final float y) { + super(NAME, ID, HP_MAX, -5.0F, -4.0F, 280.0F, 195.0F, IMG, x, y); + this.type = EnemyType.NORMAL; + if (AbstractDungeon.ascensionLevel >= 7) { + this.setHp(A_7_HP_MIN, A_7_HP_MAX); + } else { + this.setHp(HP_MIN, HP_MAX); + } + + if (AbstractDungeon.ascensionLevel >= 2) { + this.slimeTackleDamage = A_2_W_TACKLE_DMG; + this.normalTackleDamage = A_2_N_TACKLE_DMG; + } else { + this.slimeTackleDamage = W_TACKLE_DMG; + this.normalTackleDamage = N_TACKLE_DMG; + } + this.damage.add(new DamageInfo(this, this.slimeTackleDamage)); + this.damage.add(new DamageInfo(this, this.normalTackleDamage)); + + this.slimeTackleSlimed = WOUND_COUNT; + this.lickBlockPreventionTurns = BP_TURNS; + + this.powers.add(new SplitPower(this)); + this.powers.add(new BarricadePower(this)); + } + + @Override + public void takeTurn() { + switch (this.nextMove) { + case SLIME_TACKLE: + AbstractDungeon.actionManager.addToBottom(new AnimateSlowAttackAction(this)); + AbstractDungeon.actionManager.addToBottom(new SFXAction("MONSTER_SLIME_ATTACK")); + AbstractDungeon.actionManager.addToBottom(new DamageAction(AbstractDungeon.player, (DamageInfo)this.damage.get(0), AbstractGameAction.AttackEffect.BLUNT_HEAVY)); + AbstractDungeon.actionManager.addToBottom(new MakeTempCardInDiscardAction(new Slimed(), this.slimeTackleSlimed)); + AbstractDungeon.actionManager.addToBottom(new RollMoveAction(this)); + break; + case NORMAL_TACKLE: + AbstractDungeon.actionManager.addToBottom(new AnimateSlowAttackAction(this)); + AbstractDungeon.actionManager.addToBottom(new DamageAction(AbstractDungeon.player, (DamageInfo)this.damage.get(1), AbstractGameAction.AttackEffect.BLUNT_HEAVY)); + AbstractDungeon.actionManager.addToBottom(new RollMoveAction(this)); + break; + case SPLIT: + AbstractDungeon.actionManager.addToBottom(new CannotLoseAction()); + AbstractDungeon.actionManager.addToBottom(new AnimateShakeAction(this, 1.0F, 0.1F)); + AbstractDungeon.actionManager.addToBottom(new HideHealthBarAction(this)); + AbstractDungeon.actionManager.addToBottom(new SuicideAction(this, false)); + AbstractDungeon.actionManager.addToBottom(new WaitAction(1.0F)); + AbstractDungeon.actionManager.addToBottom(new SFXAction("SLIME_SPLIT")); + AbstractDungeon.actionManager.addToBottom(new SpawnMonsterAction(new FrostSlimeM(this.saveX - 134.0F, this.saveY + MathUtils.random(-4.0F, 4.0F), this.currentHealth), false)); + AbstractDungeon.actionManager.addToBottom(new SpawnMonsterAction(new FrostSlimeM(this.saveX + 134.0F, this.saveY + MathUtils.random(-4.0F, 4.0F), this.currentHealth), false)); + AbstractDungeon.actionManager.addToBottom(new CanLoseAction()); + this.setMove(SPLIT_NAME, (byte)3, Intent.UNKNOWN); + break; + case BP_LICK: + AbstractDungeon.actionManager.addToBottom(new AnimateSlowAttackAction(this)); + AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(AbstractDungeon.player, this, new NoBlockPower(AbstractDungeon.player, this.lickBlockPreventionTurns, true), this.lickBlockPreventionTurns)); + AbstractDungeon.actionManager.addToBottom(new RollMoveAction(this)); + } + + } + + public void damage(DamageInfo info) { + super.damage(info); + if (!this.isDying && (float)this.currentHealth <= (float)this.maxHealth / 2.0F && this.nextMove != 3 && !this.splitTriggered) { + this.setMove(SPLIT_NAME, (byte)3, Intent.UNKNOWN); + this.createIntent(); + AbstractDungeon.actionManager.addToBottom(new TextAboveCreatureAction(this, TextAboveCreatureAction.TextType.INTERRUPTED)); + AbstractDungeon.actionManager.addToBottom(new SetMoveAction(this, SPLIT_NAME, (byte)3, Intent.UNKNOWN)); + this.splitTriggered = true; + } + + } + + //Dirty Cc/Cv from base game, i didn't read through it :X + protected void getMove(int num) { + if (AbstractDungeon.ascensionLevel >= 17) { + if (num < 40) { + if (this.lastTwoMoves((byte)1)) { + if (AbstractDungeon.aiRng.randomBoolean(0.6F)) { + this.setMove((byte)2, Intent.ATTACK, ((DamageInfo)this.damage.get(1)).base); + } else { + this.setMove(BP_NAME, (byte)4, Intent.DEBUFF); + } + } else { + this.setMove(WOUND_NAME, (byte)1, Intent.ATTACK_DEBUFF, ((DamageInfo)this.damage.get(0)).base); + } + } else if (num < 70) { + if (this.lastTwoMoves((byte)2)) { + if (AbstractDungeon.aiRng.randomBoolean(0.6F)) { + this.setMove(WOUND_NAME, (byte)1, Intent.ATTACK_DEBUFF, ((DamageInfo)this.damage.get(0)).base); + } else { + this.setMove(BP_NAME, (byte)4, Intent.DEBUFF); + } + } else { + this.setMove((byte)2, Intent.ATTACK, ((DamageInfo)this.damage.get(1)).base); + } + } else if (this.lastMove((byte)4)) { + if (AbstractDungeon.aiRng.randomBoolean(0.4F)) { + this.setMove(WOUND_NAME, (byte)1, Intent.ATTACK_DEBUFF, ((DamageInfo)this.damage.get(0)).base); + } else { + this.setMove((byte)2, Intent.ATTACK, ((DamageInfo)this.damage.get(1)).base); + } + } else { + this.setMove(BP_NAME, (byte)4, Intent.DEBUFF); + } + } else if (num < 30) { + if (this.lastTwoMoves((byte)1)) { + if (AbstractDungeon.aiRng.randomBoolean()) { + this.setMove((byte)2, Intent.ATTACK, ((DamageInfo)this.damage.get(1)).base); + } else { + this.setMove(BP_NAME, (byte)4, Intent.DEBUFF); + } + } else { + this.setMove(WOUND_NAME, (byte)1, Intent.ATTACK_DEBUFF, ((DamageInfo)this.damage.get(0)).base); + } + } else if (num < 70) { + if (this.lastMove((byte)2)) { + if (AbstractDungeon.aiRng.randomBoolean(0.4F)) { + this.setMove(WOUND_NAME, (byte)1, Intent.ATTACK_DEBUFF, ((DamageInfo)this.damage.get(0)).base); + } else { + this.setMove(BP_NAME, (byte)4, Intent.DEBUFF); + } + } else { + this.setMove((byte)2, Intent.ATTACK, ((DamageInfo)this.damage.get(1)).base); + } + } else if (this.lastTwoMoves((byte)4)) { + if (AbstractDungeon.aiRng.randomBoolean(0.4F)) { + this.setMove(WOUND_NAME, (byte)1, Intent.ATTACK_DEBUFF, ((DamageInfo)this.damage.get(0)).base); + } else { + this.setMove((byte)2, Intent.ATTACK, ((DamageInfo)this.damage.get(1)).base); + } + } else { + this.setMove(BP_NAME, (byte)4, Intent.DEBUFF); + } + + } + + static { + WOUND_NAME = MOVES[0]; + SPLIT_NAME = MOVES[1]; + BP_NAME = MOVES[2]; + } + +} diff --git a/src/main/java/spireMapOverhaul/zones/hailstorm/monsters/FrostSlimeM.java b/src/main/java/spireMapOverhaul/zones/hailstorm/monsters/FrostSlimeM.java new file mode 100644 index 000000000..36202979f --- /dev/null +++ b/src/main/java/spireMapOverhaul/zones/hailstorm/monsters/FrostSlimeM.java @@ -0,0 +1,206 @@ +package spireMapOverhaul.zones.hailstorm.monsters; + +import basemod.abstracts.CustomMonster; +import com.badlogic.gdx.math.MathUtils; +import com.esotericsoftware.spine.AnimationState; +import com.megacrit.cardcrawl.actions.AbstractGameAction; +import com.megacrit.cardcrawl.actions.animations.AnimateShakeAction; +import com.megacrit.cardcrawl.actions.animations.AnimateSlowAttackAction; +import com.megacrit.cardcrawl.actions.common.*; +import com.megacrit.cardcrawl.actions.unique.CanLoseAction; +import com.megacrit.cardcrawl.actions.unique.CannotLoseAction; +import com.megacrit.cardcrawl.actions.utility.HideHealthBarAction; +import com.megacrit.cardcrawl.actions.utility.SFXAction; +import com.megacrit.cardcrawl.actions.utility.TextAboveCreatureAction; +import com.megacrit.cardcrawl.actions.utility.WaitAction; +import com.megacrit.cardcrawl.cards.DamageInfo; +import com.megacrit.cardcrawl.cards.status.Slimed; +import com.megacrit.cardcrawl.core.CardCrawlGame; +import com.megacrit.cardcrawl.dungeons.AbstractDungeon; +import com.megacrit.cardcrawl.helpers.ImageMaster; +import com.megacrit.cardcrawl.helpers.SlimeAnimListener; +import com.megacrit.cardcrawl.localization.MonsterStrings; +import com.megacrit.cardcrawl.monsters.exordium.AcidSlime_M; +import com.megacrit.cardcrawl.powers.BarricadePower; +import com.megacrit.cardcrawl.powers.NoBlockPower; +import com.megacrit.cardcrawl.powers.PoisonPower; +import com.megacrit.cardcrawl.powers.SplitPower; +import spireMapOverhaul.SpireAnniversary6Mod; + +public class FrostSlimeM extends CustomMonster { + public static final String ID = SpireAnniversary6Mod.makeID(FrostSlimeM.class.getSimpleName()); + private static final MonsterStrings monsterStrings = CardCrawlGame.languagePack.getMonsterStrings(ID); + public static final String NAME = monsterStrings.NAME; + public static final String[] MOVES = monsterStrings.MOVES; + private static final String IMG = SpireAnniversary6Mod.makeImagePath("monsters/Hailstorm/FrostSlimeM.png"); + + private static final String WOUND_NAME; + private static final String SPLIT_NAME; + private static final String BP_NAME; + private boolean firstMove = true; + public static final int HP_MIN = 28; + public static final int HP_MAX = 32; + public static final int A_7_HP_MIN = 29; + public static final int A_7_HP_MAX = 34; + public static final int W_TACKLE_DMG = 7; + public static final int N_TACKLE_DMG = 10; + public static final int A_2_W_TACKLE_DMG = 8; + public static final int A_2_N_TACKLE_DMG = 12; + public static final int BP_TURNS = 1; + public static final int WOUND_COUNT = 1; + private static final byte SLIME_TACKLE = 1; + private static final byte NORMAL_TACKLE = 2; + private static final byte SPLIT = 3; + private static final byte BP_LICK = 4; + private float saveX; + private float saveY; + private boolean splitTriggered; + private int slimeTackleDamage; + private int slimeTackleSlimed; + private int lickBlockPreventionTurns; + private int normalTackleDamage; + + public FrostSlimeM() { + this(0.0f, 0.0f); + } + + public FrostSlimeM(final float x, final float y) { + super(NAME, ID, HP_MAX, -5.0F, -4.0F, 90.0F, 80.0F, IMG, x, y); + this.type = EnemyType.NORMAL; + if (AbstractDungeon.ascensionLevel >= 7) { + this.setHp(A_7_HP_MIN, A_7_HP_MAX); + } else { + this.setHp(HP_MIN, HP_MAX); + } + + if (AbstractDungeon.ascensionLevel >= 2) { + this.slimeTackleDamage = A_2_W_TACKLE_DMG; + this.normalTackleDamage = A_2_N_TACKLE_DMG; + } else { + this.slimeTackleDamage = W_TACKLE_DMG; + this.normalTackleDamage = N_TACKLE_DMG; + } + this.damage.add(new DamageInfo(this, this.slimeTackleDamage)); + this.damage.add(new DamageInfo(this, this.normalTackleDamage)); + + this.slimeTackleSlimed = WOUND_COUNT; + this.lickBlockPreventionTurns = BP_TURNS; + + this.powers.add(new BarricadePower(this)); + } + + public FrostSlimeM(float x, float y, int newHealth) { + super(NAME, ID, newHealth, 0.0F, 0.0F, 170.0F, 130.0F, (String)null, x, y, true); + if (AbstractDungeon.ascensionLevel >= 2) { + this.damage.add(new DamageInfo(this, A_2_W_TACKLE_DMG)); + this.damage.add(new DamageInfo(this, A_2_N_TACKLE_DMG)); + } else { + this.damage.add(new DamageInfo(this, W_TACKLE_DMG)); + this.damage.add(new DamageInfo(this, N_TACKLE_DMG)); + } + + this.slimeTackleSlimed = WOUND_COUNT; + this.lickBlockPreventionTurns = BP_TURNS; + + this.powers.add(new BarricadePower(this)); + + this.img = ImageMaster.loadImage(IMG); + + } + + @Override + public void takeTurn() { + switch (this.nextMove) { + case SLIME_TACKLE: + AbstractDungeon.actionManager.addToBottom(new AnimateSlowAttackAction(this)); + AbstractDungeon.actionManager.addToBottom(new DamageAction(AbstractDungeon.player, (DamageInfo)this.damage.get(0), AbstractGameAction.AttackEffect.BLUNT_HEAVY)); + AbstractDungeon.actionManager.addToBottom(new MakeTempCardInDiscardAction(new Slimed(), this.slimeTackleSlimed)); + AbstractDungeon.actionManager.addToBottom(new RollMoveAction(this)); + break; + case NORMAL_TACKLE: + AbstractDungeon.actionManager.addToBottom(new AnimateSlowAttackAction(this)); + AbstractDungeon.actionManager.addToBottom(new DamageAction(AbstractDungeon.player, (DamageInfo)this.damage.get(1), AbstractGameAction.AttackEffect.BLUNT_HEAVY)); + AbstractDungeon.actionManager.addToBottom(new RollMoveAction(this)); + break; + case SPLIT: + default: + break; + case BP_LICK: + AbstractDungeon.actionManager.addToBottom(new AnimateSlowAttackAction(this)); + AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(AbstractDungeon.player, this, new NoBlockPower(AbstractDungeon.player, this.lickBlockPreventionTurns, true), this.lickBlockPreventionTurns)); + AbstractDungeon.actionManager.addToBottom(new RollMoveAction(this)); + } + + } + + //Dirty Cc/Cv from base game, i didn't read through it :X + protected void getMove(int num) { + if (AbstractDungeon.ascensionLevel >= 17) { + if (num < 40) { + if (this.lastTwoMoves((byte)1)) { + if (AbstractDungeon.aiRng.randomBoolean(0.6F)) { + this.setMove((byte)2, Intent.ATTACK, ((DamageInfo)this.damage.get(1)).base); + } else { + this.setMove(BP_NAME, (byte)4, Intent.DEBUFF); + } + } else { + this.setMove(WOUND_NAME, (byte)1, Intent.ATTACK_DEBUFF, ((DamageInfo)this.damage.get(0)).base); + } + } else if (num < 70) { + if (this.lastTwoMoves((byte)2)) { + if (AbstractDungeon.aiRng.randomBoolean(0.6F)) { + this.setMove(WOUND_NAME, (byte)1, Intent.ATTACK_DEBUFF, ((DamageInfo)this.damage.get(0)).base); + } else { + this.setMove(BP_NAME, (byte)4, Intent.DEBUFF); + } + } else { + this.setMove((byte)2, Intent.ATTACK, ((DamageInfo)this.damage.get(1)).base); + } + } else if (this.lastMove((byte)4)) { + if (AbstractDungeon.aiRng.randomBoolean(0.4F)) { + this.setMove(WOUND_NAME, (byte)1, Intent.ATTACK_DEBUFF, ((DamageInfo)this.damage.get(0)).base); + } else { + this.setMove((byte)2, Intent.ATTACK, ((DamageInfo)this.damage.get(1)).base); + } + } else { + this.setMove(BP_NAME, (byte)4, Intent.DEBUFF); + } + } else if (num < 30) { + if (this.lastTwoMoves((byte)1)) { + if (AbstractDungeon.aiRng.randomBoolean()) { + this.setMove((byte)2, Intent.ATTACK, ((DamageInfo)this.damage.get(1)).base); + } else { + this.setMove(BP_NAME, (byte)4, Intent.DEBUFF); + } + } else { + this.setMove(WOUND_NAME, (byte)1, Intent.ATTACK_DEBUFF, ((DamageInfo)this.damage.get(0)).base); + } + } else if (num < 70) { + if (this.lastMove((byte)2)) { + if (AbstractDungeon.aiRng.randomBoolean(0.4F)) { + this.setMove(WOUND_NAME, (byte)1, Intent.ATTACK_DEBUFF, ((DamageInfo)this.damage.get(0)).base); + } else { + this.setMove(BP_NAME, (byte)4, Intent.DEBUFF); + } + } else { + this.setMove((byte)2, Intent.ATTACK, ((DamageInfo)this.damage.get(1)).base); + } + } else if (this.lastTwoMoves((byte)4)) { + if (AbstractDungeon.aiRng.randomBoolean(0.4F)) { + this.setMove(WOUND_NAME, (byte)1, Intent.ATTACK_DEBUFF, ((DamageInfo)this.damage.get(0)).base); + } else { + this.setMove((byte)2, Intent.ATTACK, ((DamageInfo)this.damage.get(1)).base); + } + } else { + this.setMove(BP_NAME, (byte)4, Intent.DEBUFF); + } + + } + + static { + WOUND_NAME = MOVES[0]; + SPLIT_NAME = MOVES[1]; + BP_NAME = MOVES[2]; + } + +} diff --git a/src/main/java/spireMapOverhaul/zones/hailstorm/patches/CardRewardScreenFlintDreamCatcherInteractionPatch.java b/src/main/java/spireMapOverhaul/zones/hailstorm/patches/CardRewardScreenFlintDreamCatcherInteractionPatch.java new file mode 100644 index 000000000..991252e6e --- /dev/null +++ b/src/main/java/spireMapOverhaul/zones/hailstorm/patches/CardRewardScreenFlintDreamCatcherInteractionPatch.java @@ -0,0 +1,43 @@ +package spireMapOverhaul.zones.hailstorm.patches; + +import com.evacipated.cardcrawl.modthespire.lib.SpirePatch; +import com.evacipated.cardcrawl.modthespire.lib.SpirePostfixPatch; +import com.megacrit.cardcrawl.actions.AbstractGameAction; +import com.megacrit.cardcrawl.cards.AbstractCard; +import com.megacrit.cardcrawl.characters.AbstractPlayer; +import com.megacrit.cardcrawl.dungeons.AbstractDungeon; +import com.megacrit.cardcrawl.relics.AbstractRelic; +import com.megacrit.cardcrawl.rewards.RewardItem; +import com.megacrit.cardcrawl.screens.CardRewardScreen; +import spireMapOverhaul.zones.hailstorm.relics.Flint; + +import java.util.ArrayList; + +import static spireMapOverhaul.util.Wiz.atb; + +@SpirePatch(clz = CardRewardScreen.class, method = "onClose") + + +public class CardRewardScreenFlintDreamCatcherInteractionPatch { + + public static boolean trigger = false; + @SpirePostfixPatch + public static void postfix(CardRewardScreen __instance) { + if (trigger) { + atb(new AbstractGameAction() { + @Override + public void update() { + ArrayList rewardCards = AbstractDungeon.getRewardCards(); + if (rewardCards != null && !rewardCards.isEmpty()) { + AbstractDungeon.cardRewardScreen.open(rewardCards, (RewardItem)null, "TEXT[0]"); + } + trigger = false; + + isDone=true; + } + }); + + } + } + +} diff --git a/src/main/java/spireMapOverhaul/zones/hailstorm/relics/Flint.java b/src/main/java/spireMapOverhaul/zones/hailstorm/relics/Flint.java new file mode 100644 index 000000000..899319caf --- /dev/null +++ b/src/main/java/spireMapOverhaul/zones/hailstorm/relics/Flint.java @@ -0,0 +1,41 @@ +package spireMapOverhaul.zones.hailstorm.relics; + +import com.megacrit.cardcrawl.relics.AbstractRelic; +import com.megacrit.cardcrawl.ui.campfire.AbstractCampfireOption; +import spireMapOverhaul.abstracts.AbstractSMORelic; +import spireMapOverhaul.zones.frostlands.relics.SpruceCharm; +import spireMapOverhaul.zones.hailstorm.HailstormZone; +import spireMapOverhaul.zones.hailstorm.campfire.FlintOption; + +import java.util.ArrayList; + +import static spireMapOverhaul.SpireAnniversary6Mod.*; + +public class Flint extends AbstractSMORelic { + public static final String ID = makeID("Flint"); + + public Flint() { + super(ID, HailstormZone.ID, RelicTier.SPECIAL, LandingSound.HEAVY); + } + + public void addCampfireOption(ArrayList options) { + if (!this.usedUp) + options.add(new FlintOption()); + } + + @Override + public void onTrigger() { + this.usedUp(); + this.grayscale = true; + } + + @Override + public String getUpdatedDescription() { + return DESCRIPTIONS[0]; + } + + @Override + public AbstractRelic makeCopy() { + return new Flint(); + } +} \ No newline at end of file diff --git a/src/main/java/spireMapOverhaul/zones/hailstorm/vfx/HailEffect.java b/src/main/java/spireMapOverhaul/zones/hailstorm/vfx/HailEffect.java new file mode 100644 index 000000000..bc8707704 --- /dev/null +++ b/src/main/java/spireMapOverhaul/zones/hailstorm/vfx/HailEffect.java @@ -0,0 +1,89 @@ +package spireMapOverhaul.zones.hailstorm.vfx; + +import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.graphics.Color; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.badlogic.gdx.math.MathUtils; +import com.megacrit.cardcrawl.core.Settings; +import com.megacrit.cardcrawl.helpers.CardHelper; +import com.megacrit.cardcrawl.helpers.ImageMaster; +import com.megacrit.cardcrawl.vfx.AbstractGameEffect; + +public class HailEffect extends AbstractGameEffect { + private float x; + private float y; + private float vY; + private float vX; + private float scaleY; + private int frame = 0; + private float animTimer = 0.05F; + private static final int W = 32; + + public HailEffect() { + this.x = MathUtils.random(100.0F * Settings.scale, 2420.0F * Settings.scale); + this.y = (float) Settings.HEIGHT + MathUtils.random(20.0F, 300.0F) * Settings.scale; + this.frame = MathUtils.random(3); + this.rotation = MathUtils.random(05.0F, 10.0F); + this.scale = MathUtils.random(.05F, .25F); + this.scaleY = MathUtils.random(1.20F, 1.25F); + if (this.scale < 1.5F) { + this.renderBehind = true; + } + + this.vY = MathUtils.random(600.0F, 900.0F) * this.scale * Settings.scale; + this.vX = MathUtils.random(-300.0F, -50.0F) * this.scale * Settings.scale; + this.scale *= Settings.scale; + if (MathUtils.randomBoolean()) { + this.rotation += 180.0F; + } + this.renderBehind = MathUtils.randomBoolean(); + + this.color = Color.WHITE.cpy();; + this.duration = 4.0F; + } + + public void update() { + this.y -= this.vY * Gdx.graphics.getDeltaTime() * 2F; + this.x += this.vX * Gdx.graphics.getDeltaTime() * 2F; + this.animTimer -= Gdx.graphics.getDeltaTime() / this.scale; + if (this.animTimer < 0.0F) { + this.animTimer += 0.05F; + ++this.frame; + if (this.frame > 3) { + this.frame = 0; + } + } + + this.duration -= Gdx.graphics.getDeltaTime(); + if (this.duration < 0.0F) { + this.isDone = true; + } + } + + public void render(SpriteBatch sb) { + switch (this.frame) { + case 0: + this.renderImg(sb, ImageMaster.PETAL_VFX[0], false, false); + break; + case 1: + this.renderImg(sb, ImageMaster.PETAL_VFX[1], false, false); + break; + case 2: + this.renderImg(sb, ImageMaster.PETAL_VFX[0], true, true); + break; + case 3: + this.renderImg(sb, ImageMaster.PETAL_VFX[1], true, true); + } + + } + + public void dispose() { + } + + private void renderImg(SpriteBatch sb, Texture img, boolean flipH, boolean flipV) { + sb.setColor(this.color); + sb.draw(img, this.x, this.y, 16.0F, 16.0F, 32.0F, 32.0F, this.scale, this.scale * this.scaleY, this.rotation, 0, 0, 32, 32, flipH, flipV); + this.color.a = MathUtils.random(0.4F, 0.6F); + } +} \ No newline at end of file diff --git a/src/main/java/spireMapOverhaul/zones/hailstorm/vfx/HailstormEffect.java b/src/main/java/spireMapOverhaul/zones/hailstorm/vfx/HailstormEffect.java new file mode 100644 index 000000000..4214a4557 --- /dev/null +++ b/src/main/java/spireMapOverhaul/zones/hailstorm/vfx/HailstormEffect.java @@ -0,0 +1,88 @@ +package spireMapOverhaul.zones.hailstorm.vfx; + +import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.graphics.Color; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.badlogic.gdx.math.MathUtils; +import com.megacrit.cardcrawl.core.Settings; +import com.megacrit.cardcrawl.helpers.ImageMaster; +import com.megacrit.cardcrawl.vfx.AbstractGameEffect; + +public class HailstormEffect extends AbstractGameEffect { + private float x; + private float y; + private float vY; + private float vX; + private float scaleY; + private int frame = 0; + private float animTimer = 0.05F; + private static final int W = 32; + + public HailstormEffect() { + this.x = MathUtils.random(100.0F * Settings.scale, 2920.0F * Settings.scale); + this.y = (float) Settings.HEIGHT + MathUtils.random(20.0F, 300.0F) * Settings.scale; + this.frame = MathUtils.random(3); + this.rotation = MathUtils.random(35.0F, 50.0F); + this.scale = MathUtils.random(.05F, .25F); + this.scaleY = MathUtils.random(1.20F, 1.25F); + if (this.scale < 1.5F) { + this.renderBehind = true; + } + + this.vY = MathUtils.random(1300.0F, 1600.0F) * this.scale * Settings.scale; + this.vX = MathUtils.random(-2500.0F, -1500.0F) * this.scale * Settings.scale; + this.scale *= Settings.scale; + if (MathUtils.randomBoolean()) { + this.rotation += 180.0F; + } + this.renderBehind = MathUtils.randomBoolean(); + + this.color = Color.WHITE.cpy();; + this.duration = 4.0F; + } + + public void update() { + this.y -= this.vY * Gdx.graphics.getDeltaTime() * 2F; + this.x += this.vX * Gdx.graphics.getDeltaTime() * 2F; + this.animTimer -= Gdx.graphics.getDeltaTime() / this.scale; + if (this.animTimer < 0.0F) { + this.animTimer += 0.05F; + ++this.frame; + if (this.frame > 3) { + this.frame = 0; + } + } + + this.duration -= Gdx.graphics.getDeltaTime(); + if (this.duration < 0.0F) { + this.isDone = true; + } + } + + public void render(SpriteBatch sb) { + switch (this.frame) { + case 0: + this.renderImg(sb, ImageMaster.PETAL_VFX[0], false, false); + break; + case 1: + this.renderImg(sb, ImageMaster.PETAL_VFX[1], false, false); + break; + case 2: + this.renderImg(sb, ImageMaster.PETAL_VFX[0], true, true); + break; + case 3: + this.renderImg(sb, ImageMaster.PETAL_VFX[1], true, true); + } + + } + + public void dispose() { + } + + private void renderImg(SpriteBatch sb, Texture img, boolean flipH, boolean flipV) { + sb.setColor(this.color); + sb.draw(img, this.x, this.y, 16.0F, 16.0F, 32.0F, 32.0F, this.scale, this.scale * this.scaleY, this.rotation, 0, 0, 32, 32, flipH, flipV); + this.color.a = MathUtils.random(0.6F, 0.8F); + } +} \ No newline at end of file diff --git a/src/main/resources/anniv6Resources/images/cards/Hailstorm/Freeze.png b/src/main/resources/anniv6Resources/images/cards/Hailstorm/Freeze.png new file mode 100644 index 000000000..54ec2182e Binary files /dev/null and b/src/main/resources/anniv6Resources/images/cards/Hailstorm/Freeze.png differ diff --git a/src/main/resources/anniv6Resources/images/cards/Hailstorm/Freeze_p.png b/src/main/resources/anniv6Resources/images/cards/Hailstorm/Freeze_p.png new file mode 100644 index 000000000..653f34da3 Binary files /dev/null and b/src/main/resources/anniv6Resources/images/cards/Hailstorm/Freeze_p.png differ diff --git a/src/main/resources/anniv6Resources/images/cards/Hailstorm/IceBurn.png b/src/main/resources/anniv6Resources/images/cards/Hailstorm/IceBurn.png new file mode 100644 index 000000000..385520040 Binary files /dev/null and b/src/main/resources/anniv6Resources/images/cards/Hailstorm/IceBurn.png differ diff --git a/src/main/resources/anniv6Resources/images/cards/Hailstorm/IceBurn_p.png b/src/main/resources/anniv6Resources/images/cards/Hailstorm/IceBurn_p.png new file mode 100644 index 000000000..7a6193052 Binary files /dev/null and b/src/main/resources/anniv6Resources/images/cards/Hailstorm/IceBurn_p.png differ diff --git a/src/main/resources/anniv6Resources/images/events/Hailstorm/AbandonedCamp.png b/src/main/resources/anniv6Resources/images/events/Hailstorm/AbandonedCamp.png new file mode 100644 index 000000000..fec760f61 Binary files /dev/null and b/src/main/resources/anniv6Resources/images/events/Hailstorm/AbandonedCamp.png differ diff --git a/src/main/resources/anniv6Resources/images/monsters/Hailstorm/FrostSlimeL.png b/src/main/resources/anniv6Resources/images/monsters/Hailstorm/FrostSlimeL.png new file mode 100644 index 000000000..14f5f0b32 Binary files /dev/null and b/src/main/resources/anniv6Resources/images/monsters/Hailstorm/FrostSlimeL.png differ diff --git a/src/main/resources/anniv6Resources/images/monsters/Hailstorm/FrostSlimeM.png b/src/main/resources/anniv6Resources/images/monsters/Hailstorm/FrostSlimeM.png new file mode 100644 index 000000000..c306a755e Binary files /dev/null and b/src/main/resources/anniv6Resources/images/monsters/Hailstorm/FrostSlimeM.png differ diff --git a/src/main/resources/anniv6Resources/images/relics/Hailstorm/Flint.png b/src/main/resources/anniv6Resources/images/relics/Hailstorm/Flint.png new file mode 100644 index 000000000..ed0ce3334 Binary files /dev/null and b/src/main/resources/anniv6Resources/images/relics/Hailstorm/Flint.png differ diff --git a/src/main/resources/anniv6Resources/images/relics/Hailstorm/FlintOutline.png b/src/main/resources/anniv6Resources/images/relics/Hailstorm/FlintOutline.png new file mode 100644 index 000000000..6846ba8d8 Binary files /dev/null and b/src/main/resources/anniv6Resources/images/relics/Hailstorm/FlintOutline.png differ diff --git a/src/main/resources/anniv6Resources/images/ui/Hailstorm/FlintOption.png b/src/main/resources/anniv6Resources/images/ui/Hailstorm/FlintOption.png new file mode 100644 index 000000000..f307396be Binary files /dev/null and b/src/main/resources/anniv6Resources/images/ui/Hailstorm/FlintOption.png differ diff --git a/src/main/resources/anniv6Resources/images/ui/zoneIcons/Hailstorm.png b/src/main/resources/anniv6Resources/images/ui/zoneIcons/Hailstorm.png new file mode 100644 index 000000000..01bcfec01 Binary files /dev/null and b/src/main/resources/anniv6Resources/images/ui/zoneIcons/Hailstorm.png differ diff --git a/src/main/resources/anniv6Resources/localization/eng/Hailstorm/Cardstrings.json b/src/main/resources/anniv6Resources/localization/eng/Hailstorm/Cardstrings.json new file mode 100644 index 000000000..74df33648 --- /dev/null +++ b/src/main/resources/anniv6Resources/localization/eng/Hailstorm/Cardstrings.json @@ -0,0 +1,11 @@ +{ + "${ModID}:Freeze": { + "NAME": "Freeze", + "DESCRIPTION": "Retain. NL At the end of your turn, add an *Ice *Burn into your discard pile.", + "UPGRADE_DESCRIPTION": "Retain. NL At the end of your turn, add an *Ice *Burn+ into your discard pile." + }, + "${ModID}:IceBurn": { + "NAME": "Ice Burn", + "DESCRIPTION": "Unplayable. NL At the end of your turn, take !M! damage." + } +} \ No newline at end of file diff --git a/src/main/resources/anniv6Resources/localization/eng/Hailstorm/Eventstrings.json b/src/main/resources/anniv6Resources/localization/eng/Hailstorm/Eventstrings.json new file mode 100644 index 000000000..bfa8676f9 --- /dev/null +++ b/src/main/resources/anniv6Resources/localization/eng/Hailstorm/Eventstrings.json @@ -0,0 +1,20 @@ +{ + "${ModID}:AbandonedCamp": { + "NAME": "Abandoned Camp", + "DESCRIPTIONS": [ + "You arrive at an abandoned camp. Looks like an adventurer has been there before you.", + "The #bfreezing #bcold is getting worse, you won't be able to stand it for long.", + "You look around the camp quickly and notice few things you could bring with you.", + "Perhaps there is more to grab in this camp but the #btemperature is unbearable, pick one up and move !", + "The #b@Hailstorm@ keeps growing behind you, your better move quick !" + ], + "OPTIONS": [ + "[Campfire] Obtain #gDead #gBranch and a #rSpecial #rCurse", + "[Tools] Obtain #gFlint and #rlose #r"," #rhp", + "[Valuables] #gGain #g"," #gGold.", + "[Leftovers] #gHeal #g"," #gHP.", + "[Leave] Nothing happens.", + "[Leave]" + ] + } +} \ No newline at end of file diff --git a/src/main/resources/anniv6Resources/localization/eng/Hailstorm/Monsterstrings.json b/src/main/resources/anniv6Resources/localization/eng/Hailstorm/Monsterstrings.json new file mode 100644 index 000000000..61f1a7521 --- /dev/null +++ b/src/main/resources/anniv6Resources/localization/eng/Hailstorm/Monsterstrings.json @@ -0,0 +1,18 @@ +{ + "${ModID}:FrostSlimeM": { + "MOVES": [ + "Frost Clench", + "Split", + "Lick" + ], + "NAME": "Frost Slime (M)" + }, + "${ModID}:FrostSlimeL": { + "MOVES": [ + "Frost Clench", + "Split", + "Lick" + ], + "NAME": "Frost Slime (L)" + } +} \ No newline at end of file diff --git a/src/main/resources/anniv6Resources/localization/eng/Hailstorm/Relicstrings.json b/src/main/resources/anniv6Resources/localization/eng/Hailstorm/Relicstrings.json new file mode 100644 index 000000000..710adad22 --- /dev/null +++ b/src/main/resources/anniv6Resources/localization/eng/Hailstorm/Relicstrings.json @@ -0,0 +1,9 @@ +{ + "${ModID}:Flint": { + "NAME": "Flint", + "FLAVOR": "Sharp and pointy.", + "DESCRIPTIONS": [ + "You can now light a greater fire to Rest twice at Rest Sites. NL Usable once." + ] + } +} \ No newline at end of file diff --git a/src/main/resources/anniv6Resources/localization/eng/Hailstorm/UIstrings.json b/src/main/resources/anniv6Resources/localization/eng/Hailstorm/UIstrings.json new file mode 100644 index 000000000..3eff96aae --- /dev/null +++ b/src/main/resources/anniv6Resources/localization/eng/Hailstorm/UIstrings.json @@ -0,0 +1,20 @@ +{ + "${ModID}:Hailstorm": { + "TEXT": [ + "Hailstorm", + "A #bnever #bending #bHail is taking over the spire. NL NL The Hailstorm caused campfires to die out, making it unable to rest. NL NL During combat, snow gives #yBlock to EVERYONE for the first #b3 turns, then hail deals damage to EVERYONE every turn. NL NL Encounter a new monster and a new event.", + "Diamsword" + ] + }, + "${ModID}:FlintOption": { + "TEXT": [ + "Rest twice", + "use the Flint to light a greater fire and rest twice." + ] + }, + "${ModID}:HailEffect": { + "TEXT": [ + "At the start of the first #b3 turns, EVERYONE gains #b4 #yBlock. NL After these #b3 turns, at the end of each turn EVERYONE takes #b4 damage, increased by #b1 every turn." + ] + } +} \ No newline at end of file