diff --git a/core/src/main/assets/messages/items/items.properties b/core/src/main/assets/messages/items/items.properties index 6fb92a8cc..d9be335bf 100644 --- a/core/src/main/assets/messages/items/items.properties +++ b/core/src/main/assets/messages/items/items.properties @@ -919,6 +919,11 @@ items.quest.embers.name=elemental embers items.quest.embers.desc=Special embers which can only be harvested from young fire elementals. They radiate thermal energy. items.quest.embers.discover_hint=You can find this item during a specific quest. +items.quest.escapecrystal.name=escape crystal +items.quest.escapecrystal.ac_use=USE +items.quest.escapecrystal.desc=A thin magical spell crystal that seems to contain teleportation magic. You can use the crystal at any time to leave the dwarven vault, but you won't be able to take anything out with you! +items.quest.escapecrystal.discover_hint=You can find this item during a specific quest. + items.quest.gooblob.name=blob of goo items.quest.gooblob.desc=A jiggly blob of goop, split off from Goo as it died. It's almost like a big ball of jelly, though you wouldn't dare eat it.\n\nIt does nothing on its own, but it might be useful when combined with certain potions, or a bomb. At the very least it should convert into a decent amount of energy. items.quest.gooblob.discover_hint=You can get this item as a drop from certain enemies. diff --git a/core/src/main/assets/sprites/items.png b/core/src/main/assets/sprites/items.png index b6f2954b0..be6627846 100644 Binary files a/core/src/main/assets/sprites/items.png and b/core/src/main/assets/sprites/items.png differ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Actor.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Actor.java index f311d46cd..d7af5e333 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Actor.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Actor.java @@ -26,6 +26,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Statistics; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; +import com.shatteredpixel.shatteredpixeldungeon.levels.VaultLevel; import com.watabou.noosa.Game; import com.watabou.utils.Bundlable; import com.watabou.utils.Bundle; @@ -184,7 +185,7 @@ public abstract class Actor implements Bundlable { a.time -= min; } - if (Dungeon.hero != null && all.contains( Dungeon.hero )) { + if (Dungeon.hero != null && all.contains( Dungeon.hero ) && !(Dungeon.level instanceof VaultLevel)) { Statistics.duration += min; } now -= min; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java index 10153a89d..a4490814d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java @@ -28,6 +28,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ScrollOfChallenge; import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.SaltCube; import com.shatteredpixel.shatteredpixeldungeon.journal.Document; +import com.shatteredpixel.shatteredpixeldungeon.levels.VaultLevel; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; @@ -65,7 +66,8 @@ public class Hunger extends Buff implements Hero.Doom { if (Dungeon.level.locked || target.buff(WellFed.class) != null || SPDSettings.intro() - || target.buff(ScrollOfChallenge.ChallengeArena.class) != null){ + || target.buff(ScrollOfChallenge.ChallengeArena.class) != null + || Dungeon.level instanceof VaultLevel){ spend(TICK); return true; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Regeneration.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Regeneration.java index 0efa6592f..71823236b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Regeneration.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Regeneration.java @@ -28,6 +28,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.ChaliceOfBlood; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy; import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.ChaoticCenser; import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.SaltCube; +import com.shatteredpixel.shatteredpixeldungeon.levels.VaultLevel; import com.watabou.utils.Bundle; public class Regeneration extends Buff { @@ -114,6 +115,9 @@ public class Regeneration extends Buff { if (lock != null && !lock.regenOn()){ return false; } + if (Dungeon.level instanceof VaultLevel){ + return false; + } return true; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/quest/EscapeCrystal.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/quest/EscapeCrystal.java new file mode 100644 index 000000000..6eacc20f2 --- /dev/null +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/quest/EscapeCrystal.java @@ -0,0 +1,95 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2015 Oleg Dolya + * + * Shattered Pixel Dungeon + * Copyright (C) 2014-2025 Evan Debenham + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ + +package com.shatteredpixel.shatteredpixeldungeon.items.quest; + +import com.shatteredpixel.shatteredpixeldungeon.Assets; +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.items.Item; +import com.shatteredpixel.shatteredpixeldungeon.levels.Level; +import com.shatteredpixel.shatteredpixeldungeon.levels.VaultLevel; +import com.shatteredpixel.shatteredpixeldungeon.levels.features.LevelTransition; +import com.shatteredpixel.shatteredpixeldungeon.scenes.InterlevelScene; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; +import com.watabou.noosa.Game; +import com.watabou.noosa.audio.Sample; + +import java.util.ArrayList; + +public class EscapeCrystal extends Item { + + { + image = ItemSpriteSheet.ESCAPE; + + unique = true; + + defaultAction = AC_USE; + } + + public static final String AC_USE = "USE"; + + @Override + public ArrayList actions(Hero hero) { + ArrayList actions = super.actions( hero ); + actions.add(AC_USE); + return actions; + } + + @Override + public void execute( final Hero hero, String action ) { + + super.execute(hero, action); + + if (action.equals( AC_USE )) { + + if (Dungeon.depth > 15 && Dungeon.depth < 20 && Dungeon.branch == 1 && Dungeon.level instanceof VaultLevel){ + + Sample.INSTANCE.play(Assets.Sounds.TELEPORT); + + Level.beforeTransition(); + InterlevelScene.curTransition = new LevelTransition(Dungeon.level, + hero.pos, + LevelTransition.Type.BRANCH_ENTRANCE, + Dungeon.depth, + 0, + LevelTransition.Type.BRANCH_EXIT); + InterlevelScene.mode = InterlevelScene.Mode.ASCEND; + Game.switchScene( InterlevelScene.class ); + + } + detach(hero.belongings.backpack); + + } + + } + + @Override + public boolean isUpgradable() { + return false; + } + + @Override + public boolean isIdentified() { + return true; + } + +} diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/VaultLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/VaultLevel.java new file mode 100644 index 000000000..946e33734 --- /dev/null +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/VaultLevel.java @@ -0,0 +1,62 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2015 Oleg Dolya + * + * Shattered Pixel Dungeon + * Copyright (C) 2014-2025 Evan Debenham + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ + +package com.shatteredpixel.shatteredpixeldungeon.levels; + +import com.shatteredpixel.shatteredpixeldungeon.Assets; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.items.quest.EscapeCrystal; +import com.shatteredpixel.shatteredpixeldungeon.levels.features.LevelTransition; + +public class VaultLevel extends DeadEndLevel { //for now + + { + color1 = 0x4b6636; + color2 = 0xf2f2f2; + } + + @Override + public String tilesTex() { + return Assets.Environment.TILES_CITY; + } + + @Override + public String waterTex() { + return Assets.Environment.WATER_CITY; + } + + @Override + protected boolean build() { + super.build(); + + int entrance = 5 * width() + 5 / 2 + 1; + map[entrance] = Terrain.WATER; //override entrance tile + + drop(new EscapeCrystal(), entrance - 2*width); + return true; + } + + @Override + public boolean activateTransition(Hero hero, LevelTransition transition) { + //walking onto transitions does nothing, need to use crystal + return false; + } +} diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java index 349fc94a9..c6d2c416b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java @@ -756,6 +756,7 @@ public class ItemSpriteSheet { public static final int TOKEN = QUEST+6; public static final int BLOB = QUEST+7; public static final int SHARD = QUEST+8; + public static final int ESCAPE = QUEST+9; static{ assignItemRect(DUST, 12, 11); assignItemRect(CANDLE, 12, 12); @@ -765,6 +766,7 @@ public class ItemSpriteSheet { assignItemRect(TOKEN, 12, 12); assignItemRect(BLOB, 10, 9); assignItemRect(SHARD, 8, 10); + assignItemRect(ESCAPE, 8, 16); } private static final int BAGS = xy(1, 31); //16 slots