jwoolley / simpleton-mod

A custom character mod for Slay the Spire.
https://steamcommunity.com/sharedfiles/filedetails/?id=1717515299
1 stars 0 forks source link

Crash - Turnip harvesting with The Florist crashed the game #4

Closed Clauvin closed 5 years ago

Clauvin commented 5 years ago

What happened: using Hayseed cards with the Florist to have a Turnip at an Orb space ended crashing the game when the Turnip was going to be harvested.

What really happened: Custom Game, same configuration as (#3). I got Root Down, and until the combat where the crash happened, only managed to use it once/room, without moving any Orbs around.

Then, enough time at the combat passed for the Turnip that had been planted be harvested and...

15:19:00.793 INFO thesimpleton.TheSimpletonMod> AbstractCropOrb::getCropOrb : returning orb Turnips with 1 passive stacks 15:19:00.794 INFO thesimpleton.TheSimpletonMod> AbstractCrop: Checking for auto-harvest triggers 15:19:00.796 INFO thesimpleton.TheSimpletonMod> Not triggered 15:19:00.796 INFO basemod.BaseMod> publish on Player Lose Block 15:19:00.797 INFO basemod.BaseMod> publishPostEnergyRecharge 15:19:00.799 DEBUG the_gatherer.GathererMod> receivePostEnergyRecharge 15:19:01.110 INFO basemod.BaseMod> powers modified 15:19:01.525 INFO basemod.BaseMod> powers modified 15:19:01.758 INFO basemod.BaseMod> publishPostDraw 15:19:01.876 INFO basemod.BaseMod> publishPostDraw 15:19:02.765 INFO basemod.BaseMod> publishPostDraw 15:19:02.875 INFO basemod.BaseMod> publishPostDraw 15:19:02.976 INFO basemod.BaseMod> publishPostDraw 15:19:03.109 INFO thesimpleton.TheSimpletonMod> AbstractCropOrb::getCropOrb : returning orb Turnips with 1 passive stacks 15:19:03.109 INFO thesimpleton.TheSimpletonMod> AbstractCropOrb::getCropOrb : returning orb Turnips with 1 passive stacks 15:19:03.111 INFO thesimpleton.TheSimpletonMod> ============> AbstractCrop::onHarvest ===== 15:19:03.112 INFO thesimpleton.TheSimpletonMod> AbstractCropOrb::getCropOrb : returning orb Turnips with 1 passive stacks 15:19:03.114 INFO thesimpleton.TheSimpletonMod> AbstractCrop::TheSimpletonMod:TurnipCropOrb: onHarvestCalled. amount: 1. Set hasHarvestedThisTurn (EXCEPTION HERE) (EXCEPTION HERE) (EXCEPTION HERE) 15:19:03.115 ERROR core.CardCrawlGame> Exception caught java.lang.ClassCastException: Agrypnos.characters.TheFlorist cannot be cast to thesimpleton.characters.TheSimpletonCharacter at thesimpleton.crops.AbstractCrop.getPlayer(AbstractCrop.java:231) ~[TheHayseed.jar:?] at thesimpleton.crops.AbstractCrop.onHarvest(AbstractCrop.java:83) ~[TheHayseed.jar:?] at thesimpleton.crops.AbstractCrop.harvest(AbstractCrop.java:169) ~[TheHayseed.jar:?] at thesimpleton.crops.AbstractCrop.harvest(AbstractCrop.java:155) ~[TheHayseed.jar:?] at thesimpleton.crops.AbstractCrop.harvestAll(AbstractCrop.java:148) ~[TheHayseed.jar:?] at thesimpleton.orbs.AbstractCropOrb.onEvoke(AbstractCropOrb.java:78) ~[TheHayseed.jar:?] at com.megacrit.cardcrawl.characters.AbstractPlayer.evokeOrb(AbstractPlayer.java:2696) ~[?:?] at com.megacrit.cardcrawl.actions.defect.EvokeOrbAction.update(EvokeOrbAction.java:25) ~[desktop-1.0.jar:?] at com.megacrit.cardcrawl.actions.GameActionManager.update(GameActionManager.java:155) ~[?:?] at com.megacrit.cardcrawl.rooms.AbstractRoom.update(AbstractRoom.java:326) ~[?:?] at com.megacrit.cardcrawl.dungeons.AbstractDungeon.update(AbstractDungeon.java:2494) ~[?:?] at com.megacrit.cardcrawl.core.CardCrawlGame.update(CardCrawlGame.java:871) ~[?:?] at com.megacrit.cardcrawl.core.CardCrawlGame.render(CardCrawlGame.java:422) [?:?] at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:225) [?:?] at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:126) [desktop-1.0.jar:?] Why this was a problem: besides the crash, that call at at thesimpleton.crops.AbstractCrop.getPlayer crashing the game means that at least the Turnip only works if it's the Hayseed playing with it...

...which hinders the use of some Hayseed cards and mechanics with other characters, and going multi-class is one of my favorite playstyles while playing modded Slay The Spire (when I heard about the character, first thing I thought was into multi-classing it with the Florist, since both have plant-related themes) :/

Can this be fixed? Also, this problem happens with Hayseed cards and features beyond those involved with the Turnip?

jwoolley commented 5 years ago

This should be fixed with https://github.com/jwoolley/simpleton-mod/commit/80809e2fba5153354cfcc374a0040794dbaef72b.

jwoolley commented 5 years ago

Fixed with the referenced commit.