v0.6.1: moved notes class to journal package, renamed features to landmarks
This commit is contained in:
parent
1a22c5334e
commit
2ccda1d1e7
|
@ -40,6 +40,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.DriedRose;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Notes;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.CavesBossLevel;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.CavesLevel;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.CityBossLevel;
|
||||
|
|
|
@ -1,125 +0,0 @@
|
|||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2017 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 <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package com.shatteredpixel.shatteredpixeldungeon;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.watabou.utils.Bundlable;
|
||||
import com.watabou.utils.Bundle;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Journal {
|
||||
|
||||
public enum Feature {
|
||||
WELL_OF_HEALTH,
|
||||
WELL_OF_AWARENESS,
|
||||
WELL_OF_TRANSMUTATION,
|
||||
ALCHEMY,
|
||||
GARDEN,
|
||||
STATUE,
|
||||
|
||||
GHOST,
|
||||
WANDMAKER,
|
||||
TROLL,
|
||||
IMP;
|
||||
|
||||
public String desc() {
|
||||
return Messages.get(this, name());
|
||||
}
|
||||
};
|
||||
|
||||
public static class Record implements Comparable<Record>, Bundlable {
|
||||
|
||||
private static final String FEATURE = "feature";
|
||||
private static final String DEPTH = "depth";
|
||||
|
||||
public Feature feature;
|
||||
public int depth;
|
||||
|
||||
public Record() {
|
||||
}
|
||||
|
||||
public Record( Feature feature, int depth ) {
|
||||
this.feature = feature;
|
||||
this.depth = depth;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo( Record another ) {
|
||||
return another.depth - depth;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restoreFromBundle( Bundle bundle ) {
|
||||
feature = Feature.valueOf( bundle.getString( FEATURE ) );
|
||||
depth = bundle.getInt( DEPTH );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void storeInBundle( Bundle bundle ) {
|
||||
bundle.put( FEATURE, feature.toString() );
|
||||
bundle.put( DEPTH, depth );
|
||||
}
|
||||
}
|
||||
|
||||
public static ArrayList<Record> records;
|
||||
|
||||
public static void reset() {
|
||||
records = new ArrayList<Journal.Record>();
|
||||
}
|
||||
|
||||
private static final String JOURNAL = "journal";
|
||||
|
||||
public static void storeInBundle( Bundle bundle ) {
|
||||
bundle.put( JOURNAL, records );
|
||||
}
|
||||
|
||||
public static void restoreFromBundle( Bundle bundle ) {
|
||||
records = new ArrayList<Record>();
|
||||
for (Bundlable rec : bundle.getCollection( JOURNAL ) ) {
|
||||
records.add( (Record) rec );
|
||||
}
|
||||
}
|
||||
|
||||
public static void add( Feature feature ) {
|
||||
int size = records.size();
|
||||
for (int i=0; i < size; i++) {
|
||||
Record rec = records.get( i );
|
||||
if (rec.feature == feature && rec.depth == Dungeon.depth) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
records.add( new Record( feature, Dungeon.depth ) );
|
||||
}
|
||||
|
||||
public static void remove( Feature feature ) {
|
||||
int size = records.size();
|
||||
for (int i=0; i < size; i++) {
|
||||
Record rec = records.get( i );
|
||||
if (rec.feature == feature && rec.depth == Dungeon.depth) {
|
||||
records.remove( i );
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -22,11 +22,11 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.actors.blobs;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Notes;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.BlobEmitter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Notes;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.watabou.utils.Bundle;
|
||||
|
||||
|
@ -53,7 +53,7 @@ public class Alchemy extends Blob {
|
|||
area.union(pos%Dungeon.level.width(), pos/Dungeon.level.width());
|
||||
|
||||
if (Dungeon.visible[pos]) {
|
||||
Notes.add( Notes.Feature.ALCHEMY );
|
||||
Notes.add( Notes.Landmark.ALCHEMY );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,12 +22,12 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.actors.blobs;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Notes;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Shadows;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.BlobEmitter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShaftParticle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Notes;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
|
@ -69,7 +69,7 @@ public class Foliage extends Blob {
|
|||
}
|
||||
|
||||
if (visible) {
|
||||
Notes.add( Notes.Feature.GARDEN );
|
||||
Notes.add( Notes.Landmark.GARDEN );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -24,8 +24,6 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.blobs;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Notes;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Notes.Feature;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Awareness;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
|
@ -33,6 +31,8 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.BlobEmitter;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.effects.Identification;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Notes;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Notes.Landmark;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
|
@ -70,7 +70,7 @@ public class WaterOfAwareness extends WellWater {
|
|||
|
||||
GLog.p( Messages.get(this, "procced") );
|
||||
|
||||
Notes.remove( Feature.WELL_OF_AWARENESS );
|
||||
Notes.remove( Landmark.WELL_OF_AWARENESS );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ public class WaterOfAwareness extends WellWater {
|
|||
|
||||
emitter.parent.add( new Identification( DungeonTilemap.tileCenterToWorld( pos ) ) );
|
||||
|
||||
Notes.remove( Feature.WELL_OF_AWARENESS );
|
||||
Notes.remove( Landmark.WELL_OF_AWARENESS );
|
||||
|
||||
return item;
|
||||
}
|
||||
|
|
|
@ -23,8 +23,6 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.blobs;
|
|||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Notes;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Notes.Feature;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hunger;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.BlobEmitter;
|
||||
|
@ -34,6 +32,8 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShaftParticle;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.DewVial;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Notes;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Notes.Landmark;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
|
@ -55,7 +55,7 @@ public class WaterOfHealth extends WellWater {
|
|||
|
||||
GLog.p( Messages.get(this, "procced") );
|
||||
|
||||
Notes.remove( Feature.WELL_OF_HEALTH );
|
||||
Notes.remove( Landmark.WELL_OF_HEALTH );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ public class WaterOfHealth extends WellWater {
|
|||
protected Item affectItem( Item item ) {
|
||||
if (item instanceof DewVial && !((DewVial)item).isFull()) {
|
||||
((DewVial)item).fill();
|
||||
Notes.remove( Feature.WELL_OF_HEALTH );
|
||||
Notes.remove( Landmark.WELL_OF_HEALTH );
|
||||
return item;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,8 +21,6 @@
|
|||
|
||||
package com.shatteredpixel.shatteredpixeldungeon.actors.blobs;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Notes;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Notes.Feature;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.BlobEmitter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
|
@ -41,6 +39,8 @@ 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.Notes;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Notes.Landmark;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.Plant;
|
||||
import com.watabou.utils.Random;
|
||||
|
@ -71,7 +71,7 @@ public class WaterOfTransmutation extends WellWater {
|
|||
}
|
||||
|
||||
if (item != null) {
|
||||
Notes.remove( Feature.WELL_OF_TRANSMUTATION );
|
||||
Notes.remove( Landmark.WELL_OF_TRANSMUTATION );
|
||||
}
|
||||
|
||||
return item;
|
||||
|
|
|
@ -22,11 +22,11 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.actors.blobs;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Notes;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Notes.Feature;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Notes;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Notes.Landmark;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
|
@ -58,11 +58,11 @@ public class WellWater extends Blob {
|
|||
|
||||
if (Dungeon.visible[pos]) {
|
||||
if (this instanceof WaterOfAwareness) {
|
||||
Notes.add( Feature.WELL_OF_AWARENESS );
|
||||
Notes.add( Landmark.WELL_OF_AWARENESS );
|
||||
} else if (this instanceof WaterOfHealth) {
|
||||
Notes.add( Feature.WELL_OF_HEALTH );
|
||||
Notes.add( Notes.Landmark.WELL_OF_HEALTH );
|
||||
} else if (this instanceof WaterOfTransmutation) {
|
||||
Notes.add( Feature.WELL_OF_TRANSMUTATION );
|
||||
Notes.add( Landmark.WELL_OF_TRANSMUTATION );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Notes;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Poison;
|
||||
|
@ -32,6 +31,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon.Enchantment;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Grim;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Vampiric;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Notes;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.StatueSprite;
|
||||
import com.watabou.utils.Bundle;
|
||||
|
@ -80,7 +80,7 @@ public class Statue extends Mob {
|
|||
@Override
|
||||
protected boolean act() {
|
||||
if (Dungeon.visible[pos]) {
|
||||
Notes.add( Notes.Feature.STATUE );
|
||||
Notes.add( Notes.Landmark.STATUE );
|
||||
}
|
||||
return super.act();
|
||||
}
|
||||
|
@ -139,7 +139,7 @@ public class Statue extends Mob {
|
|||
|
||||
@Override
|
||||
public void destroy() {
|
||||
Notes.remove( Notes.Feature.STATUE );
|
||||
Notes.remove( Notes.Landmark.STATUE );
|
||||
super.destroy();
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,6 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Notes;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.EquipableItem;
|
||||
|
@ -32,6 +31,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.quest.DarkGold;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.quest.Pickaxe;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Notes;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.BlacksmithRoom;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
|
@ -86,7 +86,7 @@ public class Blacksmith extends NPC {
|
|||
}
|
||||
} );
|
||||
|
||||
Notes.add( Notes.Feature.TROLL );
|
||||
Notes.add( Notes.Landmark.TROLL );
|
||||
|
||||
} else if (!Quest.completed) {
|
||||
if (Quest.alternative) {
|
||||
|
@ -203,7 +203,7 @@ public class Blacksmith extends NPC {
|
|||
|
||||
Quest.reforged = true;
|
||||
|
||||
Notes.remove( Notes.Feature.TROLL );
|
||||
Notes.remove( Notes.Landmark.TROLL );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -23,7 +23,6 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs;
|
|||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Notes;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
|
@ -44,6 +43,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.armor.ScaleArmor;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Shortsword;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Notes;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.SewerLevel;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
|
@ -170,7 +170,7 @@ public class Ghost extends NPC {
|
|||
GameScene.add(questBoss);
|
||||
GameScene.show( new WndQuest( this, txt_quest ) );
|
||||
Quest.given = true;
|
||||
Notes.add( Notes.Feature.GHOST );
|
||||
Notes.add( Notes.Landmark.GHOST );
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -342,7 +342,7 @@ public class Ghost extends NPC {
|
|||
weapon = null;
|
||||
armor = null;
|
||||
|
||||
Notes.remove( Notes.Feature.GHOST );
|
||||
Notes.remove( Notes.Landmark.GHOST );
|
||||
}
|
||||
|
||||
public static boolean completed(){
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Notes;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Golem;
|
||||
|
@ -31,6 +30,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Monk;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.quest.DwarfToken;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Notes;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.CityLevel;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
|
@ -105,7 +105,7 @@ public class Imp extends NPC {
|
|||
Quest.given = true;
|
||||
Quest.completed = false;
|
||||
|
||||
Notes.add( Notes.Feature.IMP );
|
||||
Notes.add( Notes.Landmark.IMP );
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -214,7 +214,7 @@ public class Imp extends NPC {
|
|||
reward = null;
|
||||
completed = true;
|
||||
|
||||
Notes.remove( Notes.Feature.IMP );
|
||||
Notes.remove( Notes.Landmark.IMP );
|
||||
}
|
||||
|
||||
public static boolean isCompleted() {
|
||||
|
|
|
@ -23,7 +23,6 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs;
|
|||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Notes;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
||||
|
@ -32,6 +31,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.quest.CeremonialCandle;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.quest.CorpseDust;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.quest.Embers;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Notes;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.special.MassGraveRoom;
|
||||
|
@ -163,7 +163,7 @@ public class Wandmaker extends NPC {
|
|||
}
|
||||
});
|
||||
|
||||
Notes.add( Notes.Feature.WANDMAKER );
|
||||
Notes.add( Notes.Landmark.WANDMAKER );
|
||||
Quest.given = true;
|
||||
}
|
||||
|
||||
|
@ -307,7 +307,7 @@ public class Wandmaker extends NPC {
|
|||
wand1 = null;
|
||||
wand2 = null;
|
||||
|
||||
Notes.remove( Notes.Feature.WANDMAKER );
|
||||
Notes.remove( Notes.Landmark.WANDMAKER );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,8 +19,9 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package com.shatteredpixel.shatteredpixeldungeon;
|
||||
package com.shatteredpixel.shatteredpixeldungeon.journal;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.watabou.utils.Bundlable;
|
||||
import com.watabou.utils.Bundle;
|
||||
|
@ -29,7 +30,7 @@ import java.util.ArrayList;
|
|||
|
||||
public class Notes {
|
||||
|
||||
public enum Feature {
|
||||
public enum Landmark {
|
||||
WELL_OF_HEALTH,
|
||||
WELL_OF_AWARENESS,
|
||||
WELL_OF_TRANSMUTATION,
|
||||
|
@ -49,17 +50,22 @@ public class Notes {
|
|||
|
||||
public static class Record implements Comparable<Record>, Bundlable {
|
||||
|
||||
//compatibility with pre-0.6.1 saves
|
||||
private static final String FEATURE = "feature";
|
||||
|
||||
private static final String LANDMARK = "landmark";
|
||||
|
||||
private static final String DEPTH = "depth";
|
||||
|
||||
public Feature feature;
|
||||
public Landmark landmark;
|
||||
|
||||
public int depth;
|
||||
|
||||
public Record() {
|
||||
}
|
||||
|
||||
public Record( Feature feature, int depth ) {
|
||||
this.feature = feature;
|
||||
public Record(Landmark landmark, int depth ) {
|
||||
this.landmark = landmark;
|
||||
this.depth = depth;
|
||||
}
|
||||
|
||||
|
@ -70,13 +76,17 @@ public class Notes {
|
|||
|
||||
@Override
|
||||
public void restoreFromBundle( Bundle bundle ) {
|
||||
feature = Feature.valueOf( bundle.getString( FEATURE ) );
|
||||
if (bundle.contains(FEATURE)) {
|
||||
landmark = Landmark.valueOf(bundle.getString(FEATURE));
|
||||
} else {
|
||||
landmark = Landmark.valueOf(bundle.getString(LANDMARK));
|
||||
}
|
||||
depth = bundle.getInt( DEPTH );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void storeInBundle( Bundle bundle ) {
|
||||
bundle.put( FEATURE, feature.toString() );
|
||||
bundle.put( LANDMARK, landmark.toString() );
|
||||
bundle.put( DEPTH, depth );
|
||||
}
|
||||
}
|
||||
|
@ -84,7 +94,7 @@ public class Notes {
|
|||
public static ArrayList<Record> records;
|
||||
|
||||
public static void reset() {
|
||||
records = new ArrayList<Notes.Record>();
|
||||
records = new ArrayList<>();
|
||||
}
|
||||
|
||||
private static final String JOURNAL = "journal";
|
||||
|
@ -94,29 +104,29 @@ public class Notes {
|
|||
}
|
||||
|
||||
public static void restoreFromBundle( Bundle bundle ) {
|
||||
records = new ArrayList<Record>();
|
||||
records = new ArrayList<>();
|
||||
for (Bundlable rec : bundle.getCollection( JOURNAL ) ) {
|
||||
records.add( (Record) rec );
|
||||
}
|
||||
}
|
||||
|
||||
public static void add( Feature feature ) {
|
||||
public static void add( Landmark landmark ) {
|
||||
int size = records.size();
|
||||
for (int i=0; i < size; i++) {
|
||||
Record rec = records.get( i );
|
||||
if (rec.feature == feature && rec.depth == Dungeon.depth) {
|
||||
if (rec.landmark == landmark && rec.depth == Dungeon.depth) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
records.add( new Record( feature, Dungeon.depth ) );
|
||||
records.add( new Record(landmark, Dungeon.depth ) );
|
||||
}
|
||||
|
||||
public static void remove( Feature feature ) {
|
||||
public static void remove( Landmark landmark ) {
|
||||
int size = records.size();
|
||||
for (int i=0; i < size; i++) {
|
||||
Record rec = records.get( i );
|
||||
if (rec.feature == feature && rec.depth == Dungeon.depth) {
|
||||
if (rec.landmark == landmark && rec.depth == Dungeon.depth) {
|
||||
records.remove( i );
|
||||
return;
|
||||
}
|
|
@ -22,7 +22,6 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Notes;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.keys.GoldenKey;
|
||||
|
@ -32,6 +31,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Catalogs;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Notes;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
|
@ -239,7 +239,7 @@ public class WndJournal extends WndTabbed {
|
|||
|
||||
//Notes entries
|
||||
for (Notes.Record rec : Notes.records) {
|
||||
ListItem item = new ListItem( Icons.get(Icons.DEPTH), rec.feature.desc(), rec.depth );
|
||||
ListItem item = new ListItem( Icons.get(Icons.DEPTH), rec.landmark.desc(), rec.depth );
|
||||
item.setRect( 0, pos, width(), ITEM_HEIGHT );
|
||||
content.add( item );
|
||||
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
notes$landmark.well_of_health=Well of Health
|
||||
notes$landmark.well_of_awareness=Well of Awareness
|
||||
notes$landmark.well_of_transmutation=Well of Transmutation
|
||||
notes$landmark.alchemy=Alchemy pot
|
||||
notes$landmark.garden=Garden
|
||||
notes$landmark.statue=Animated statue
|
||||
notes$landmark.ghost=Sad ghost
|
||||
notes$landmark.wandmaker=Old wandmaker
|
||||
notes$landmark.troll=Troll blacksmith
|
||||
notes$landmark.imp=Ambitious imp
|
|
@ -73,15 +73,4 @@ challenges.swarm_intelligence=Swarm intelligence
|
|||
challenges.darkness=Into darkness
|
||||
challenges.no_scrolls=Forbidden runes
|
||||
|
||||
journal$feature.well_of_health=Well of Health
|
||||
journal$feature.well_of_awareness=Well of Awareness
|
||||
journal$feature.well_of_transmutation=Well of Transmutation
|
||||
journal$feature.alchemy=Alchemy pot
|
||||
journal$feature.garden=Garden
|
||||
journal$feature.statue=Animated statue
|
||||
journal$feature.ghost=Sad ghost
|
||||
journal$feature.wandmaker=Old wandmaker
|
||||
journal$feature.troll=Troll blacksmith
|
||||
journal$feature.imp=Ambitious imp
|
||||
|
||||
rankings$record.something=Killed by Something
|
||||
|
|
Loading…
Reference in New Issue
Block a user