From 0f95a4984618fa278229d8347a65a82858fa6336 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 10 Aug 2022 12:10:10 -0400 Subject: [PATCH] v1.4.0: added sac fire and demon spawners to the landmarks page --- .../messages/journal/journal.properties | 5 +- .../actors/blobs/SacrificialFire.java | 16 ++-- .../actors/blobs/WaterOfTransmutation.java | 85 ------------------- .../actors/blobs/WellWater.java | 2 +- .../actors/mobs/DemonSpawner.java | 6 ++ .../shatteredpixeldungeon/journal/Notes.java | 6 +- 6 files changed, 25 insertions(+), 95 deletions(-) delete mode 100644 core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/WaterOfTransmutation.java diff --git a/core/src/main/assets/messages/journal/journal.properties b/core/src/main/assets/messages/journal/journal.properties index 353b42703..40ecb20e5 100644 --- a/core/src/main/assets/messages/journal/journal.properties +++ b/core/src/main/assets/messages/journal/journal.properties @@ -50,12 +50,13 @@ journal.document.alchemy_guide.spells.body=Spells are contained in crystals and journal.notes$landmark.well_of_health=well of health journal.notes$landmark.well_of_awareness=well of awareness -journal.notes$landmark.well_of_transmutation=well of transmutation journal.notes$landmark.alchemy=alchemy pot journal.notes$landmark.garden=garden journal.notes$landmark.statue=animated statue +journal.notes$landmark.sacrificial_fire=sacrificial fire journal.notes$landmark.shop=shop journal.notes$landmark.ghost=sad ghost journal.notes$landmark.wandmaker=old wandmaker journal.notes$landmark.troll=troll blacksmith -journal.notes$landmark.imp=ambitious imp \ No newline at end of file +journal.notes$landmark.imp=ambitious imp +journal.notes$landmark.demon_spawner=demon spawner \ No newline at end of file diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/SacrificialFire.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/SacrificialFire.java index 5fb29d9fa..c5ee65f51 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/SacrificialFire.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/SacrificialFire.java @@ -39,6 +39,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Wraith; import com.shatteredpixel.shatteredpixeldungeon.effects.BlobEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.SacrificialParticle; +import com.shatteredpixel.shatteredpixeldungeon.journal.Notes; import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.special.SacrificeRoom; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; @@ -81,11 +82,15 @@ public class SacrificialFire extends Blob { } } - if (Dungeon.level.heroFOV[cell] - && Dungeon.level.mobCount() == 0 - && bonusSpawns > 0) { - if (Dungeon.level.spawnMob(4)) { - bonusSpawns--; + if (off[cell] > 0 && Dungeon.level.heroFOV[cell]) { + + Notes.add( Notes.Landmark.SACRIFICIAL_FIRE); + + if (Dungeon.level.mobCount() == 0 + && bonusSpawns > 0) { + if (Dungeon.level.spawnMob(4)) { + bonusSpawns--; + } } } } @@ -173,6 +178,7 @@ public class SacrificialFire extends Blob { GLog.w( Messages.get(SacrificialFire.class, "worthy")); } else { fire.clear(firePos); + Notes.remove(Notes.Landmark.SACRIFICIAL_FIRE); for (int i : PathFinder.NEIGHBOURS9){ CellEmitter.get(firePos+i).burst( SacrificialParticle.FACTORY, 20 ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/WaterOfTransmutation.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/WaterOfTransmutation.java deleted file mode 100644 index 2acc03ff3..000000000 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/WaterOfTransmutation.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2022 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.actors.blobs; - -import com.shatteredpixel.shatteredpixeldungeon.Challenges; -import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; -import com.shatteredpixel.shatteredpixeldungeon.effects.BlobEmitter; -import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; -import com.shatteredpixel.shatteredpixeldungeon.items.Generator; -import com.shatteredpixel.shatteredpixeldungeon.items.Generator.Category; -import com.shatteredpixel.shatteredpixeldungeon.items.Item; -import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact; -import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion; -import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength; -import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring; -import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll; -import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTransmutation; -import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade; -import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand; -import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon; -import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff; -import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon; -import com.shatteredpixel.shatteredpixeldungeon.journal.Catalog; -import com.shatteredpixel.shatteredpixeldungeon.journal.Notes.Landmark; -import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; -import com.shatteredpixel.shatteredpixeldungeon.plants.Plant; -import com.watabou.utils.Random; -import com.watabou.utils.Reflection; - -public class WaterOfTransmutation extends WellWater { - - @Override - protected Item affectItem( Item item, int pos ) { - - item = ScrollOfTransmutation.changeItem(item); - - //incase a never-seen item pops out - if (item != null&& item.isIdentified()){ - Catalog.setSeen(item.getClass()); - } - - return item; - - } - - @Override - protected boolean affectHero(Hero hero) { - return false; - } - - @Override - public void use( BlobEmitter emitter ) { - super.use( emitter ); - emitter.start( Speck.factory( Speck.CHANGE ), 0.2f, 0 ); - } - - @Override - protected Landmark record() { - return Landmark.WELL_OF_TRANSMUTATION; - } - - @Override - public String tileDesc() { - return Messages.get(this, "desc"); - } -} diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/WellWater.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/WellWater.java index 9f883f9f5..e15336e84 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/WellWater.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/WellWater.java @@ -116,7 +116,7 @@ public abstract class WellWater extends Blob { public static void affectCell( int cell ) { - Class[] waters = {WaterOfHealth.class, WaterOfAwareness.class, WaterOfTransmutation.class}; + Class[] waters = {WaterOfHealth.class, WaterOfAwareness.class}; for (ClasswaterClass : waters) { WellWater water = (WellWater)Dungeon.level.blobs.get( waterClass ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DemonSpawner.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DemonSpawner.java index 946f05f3a..ead9db82e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DemonSpawner.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DemonSpawner.java @@ -32,6 +32,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Terror; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vertigo; import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing; +import com.shatteredpixel.shatteredpixeldungeon.journal.Notes; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.SpawnerSprite; @@ -89,6 +90,10 @@ public class DemonSpawner extends Mob { spawnRecorded = true; } + if (Dungeon.level.heroFOV[pos]){ + Notes.add( Notes.Landmark.DEMON_SPAWNER ); + } + spawnCooldown--; if (spawnCooldown <= 0){ ArrayList candidates = new ArrayList<>(); @@ -137,6 +142,7 @@ public class DemonSpawner extends Mob { public void die(Object cause) { if (spawnRecorded){ Statistics.spawnersAlive--; + Notes.remove(Notes.Landmark.DEMON_SPAWNER); } GLog.h(Messages.get(this, "on_death")); super.die(cause); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Notes.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Notes.java index c6bd416c9..fc7b1f0fe 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Notes.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Notes.java @@ -66,16 +66,18 @@ public class Notes { public enum Landmark { WELL_OF_HEALTH, WELL_OF_AWARENESS, - WELL_OF_TRANSMUTATION, ALCHEMY, GARDEN, STATUE, + SACRIFICIAL_FIRE, SHOP, GHOST, WANDMAKER, TROLL, - IMP; + IMP, + + DEMON_SPAWNER; public String desc() { return Messages.get(this, name());