-
Notifications
You must be signed in to change notification settings - Fork 40
Hailstorm Zone #199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Hailstorm Zone #199
Changes from all commits
dd63e62
715d80e
62931ce
eb179c3
c026166
1a4378b
908609a
d6389c4
19ea3a8
c665bd5
ebceb1b
459334a
fedb3d9
83ff998
f0e79f2
03a1e29
44dfee8
40306d8
5f7fe17
bd0ec06
4a49df0
5448e15
f132e15
49df764
a6269d4
9c2f849
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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<ZoneEncounter> 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<AbstractCampfireOption> buttons) { | ||
| for (AbstractCampfireOption c : buttons) { | ||
| if (c instanceof RestOption && c.usable) { | ||
| c.usable = false; | ||
| ((RestOption) c).updateUsability(false); | ||
| break; | ||
| } | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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()); | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have you tested how this works with DreamCatcher? |
||
|
|
||
| //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; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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() { | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Upgradeable curse?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a way to handle Ascension, taht i find more interesting than adding an extra line in the event to deal free damage to the player |
||
| cardsToPreview.upgrade(); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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); | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why si this status upgradeable?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Along with the curse being upgradable, it generates upgraded version of iceburn. "Ascension Icon Ascension 15 - Unfavorable [events]. Many [events] have less positive outcomes and more severe consequences. For example: More HP loss. Less gold or card as rewards. Guaranteed [Curse]."
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gotcha, maybe make sure it's not upgradeable normally though. Otherwise some cards like Apotheosis will make people quite mad. Same as with the curse |
||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.