v3.1.0: fixed errors in landmark functionality with returning beacon
This commit is contained in:
+5
-5
@@ -90,17 +90,17 @@ public class BeaconOfReturning extends Spell {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onThrow(int cell) {
|
protected void onThrow(int cell) {
|
||||||
returnDepth = -1;
|
|
||||||
if (Dungeon.hero.belongings.getItem(getClass()) == null){
|
if (Dungeon.hero.belongings.getItem(getClass()) == null){
|
||||||
Notes.remove(Notes.Landmark.BEACON_LOCATION);
|
Notes.remove(Notes.Landmark.BEACON_LOCATION, returnDepth);
|
||||||
}
|
}
|
||||||
|
returnDepth = -1;
|
||||||
super.onThrow(cell);
|
super.onThrow(cell);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doDrop(Hero hero) {
|
public void doDrop(Hero hero) {
|
||||||
|
Notes.remove(Notes.Landmark.BEACON_LOCATION, returnDepth);
|
||||||
returnDepth = -1;
|
returnDepth = -1;
|
||||||
Notes.remove(Notes.Landmark.BEACON_LOCATION);
|
|
||||||
super.doDrop(hero);
|
super.doDrop(hero);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,7 +109,7 @@ public class BeaconOfReturning extends Spell {
|
|||||||
returnBranch = Dungeon.branch;
|
returnBranch = Dungeon.branch;
|
||||||
returnPos = hero.pos;
|
returnPos = hero.pos;
|
||||||
|
|
||||||
Notes.add(Notes.Landmark.BEACON_LOCATION);
|
Notes.add(Notes.Landmark.BEACON_LOCATION, returnDepth);
|
||||||
|
|
||||||
hero.spend( 1f );
|
hero.spend( 1f );
|
||||||
hero.busy();
|
hero.busy();
|
||||||
@@ -181,7 +181,7 @@ public class BeaconOfReturning extends Spell {
|
|||||||
Game.switchScene( InterlevelScene.class );
|
Game.switchScene( InterlevelScene.class );
|
||||||
}
|
}
|
||||||
if (quantity == 1){
|
if (quantity == 1){
|
||||||
Notes.remove(Notes.Landmark.BEACON_LOCATION);
|
Notes.remove(Notes.Landmark.BEACON_LOCATION, returnDepth);
|
||||||
}
|
}
|
||||||
detach(hero.belongings.backpack);
|
detach(hero.belongings.backpack);
|
||||||
Catalog.countUse(getClass());
|
Catalog.countUse(getClass());
|
||||||
|
|||||||
@@ -563,11 +563,15 @@ public class Notes {
|
|||||||
records.add( (Record) rec );
|
records.add( (Record) rec );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean add( Landmark landmark ) {
|
public static boolean add( Landmark landmark ) {
|
||||||
LandmarkRecord l = new LandmarkRecord( landmark, Dungeon.depth );
|
return add( landmark, Dungeon.depth );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean add( Landmark landmark, int depth ) {
|
||||||
|
LandmarkRecord l = new LandmarkRecord( landmark, depth );
|
||||||
if (!records.contains(l)) {
|
if (!records.contains(l)) {
|
||||||
boolean result = records.add(new LandmarkRecord(landmark, Dungeon.depth));
|
boolean result = records.add(l);
|
||||||
Collections.sort(records, comparator);
|
Collections.sort(records, comparator);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -575,11 +579,19 @@ public class Notes {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean contains( Landmark landmark ){
|
public static boolean contains( Landmark landmark ){
|
||||||
return records.contains(new LandmarkRecord( landmark, Dungeon.depth));
|
return contains( landmark, Dungeon.depth );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean contains( Landmark landmark, int depth ){
|
||||||
|
return records.contains(new LandmarkRecord( landmark, depth));
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean remove( Landmark landmark ) {
|
public static boolean remove( Landmark landmark ) {
|
||||||
return records.remove( new LandmarkRecord(landmark, Dungeon.depth) );
|
return remove( landmark, Dungeon.depth );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean remove( Landmark landmark, int depth ) {
|
||||||
|
return records.remove( new LandmarkRecord(landmark, depth) );
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean add( Key key ){
|
public static boolean add( Key key ){
|
||||||
|
|||||||
Reference in New Issue
Block a user