v0.2.3f: corrected issues with the dried rose
This commit is contained in:
parent
31bd42152e
commit
49bab26d7b
|
@ -153,12 +153,17 @@ public class DriedRose extends Artifact {
|
||||||
image = ItemSpriteSheet.ARTIFACT_ROSE3;
|
image = ItemSpriteSheet.ARTIFACT_ROSE3;
|
||||||
else if (level >= 4)
|
else if (level >= 4)
|
||||||
image = ItemSpriteSheet.ARTIFACT_ROSE2;
|
image = ItemSpriteSheet.ARTIFACT_ROSE2;
|
||||||
|
|
||||||
|
//For upgrade transferring via well of transmutation
|
||||||
|
droppedPetals = Math.max( level, droppedPetals );
|
||||||
|
|
||||||
return super.upgrade();
|
return super.upgrade();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final String TALKEDTO = "talkedto";
|
private static final String TALKEDTO = "talkedto";
|
||||||
private static final String FIRSTSUMMON = "firstsummon";
|
private static final String FIRSTSUMMON = "firstsummon";
|
||||||
private static final String SPAWNED = "spawned";
|
private static final String SPAWNED = "spawned";
|
||||||
|
private static final String PETALS = "petals";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void storeInBundle( Bundle bundle ) {
|
public void storeInBundle( Bundle bundle ) {
|
||||||
|
@ -167,6 +172,7 @@ public class DriedRose extends Artifact {
|
||||||
bundle.put( TALKEDTO, talkedTo );
|
bundle.put( TALKEDTO, talkedTo );
|
||||||
bundle.put( FIRSTSUMMON, firstSummon );
|
bundle.put( FIRSTSUMMON, firstSummon );
|
||||||
bundle.put( SPAWNED, spawned );
|
bundle.put( SPAWNED, spawned );
|
||||||
|
bundle.put( PETALS, droppedPetals );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -176,6 +182,7 @@ public class DriedRose extends Artifact {
|
||||||
talkedTo = bundle.getBoolean( TALKEDTO );
|
talkedTo = bundle.getBoolean( TALKEDTO );
|
||||||
firstSummon = bundle.getBoolean( FIRSTSUMMON );
|
firstSummon = bundle.getBoolean( FIRSTSUMMON );
|
||||||
spawned = bundle.getBoolean( SPAWNED );
|
spawned = bundle.getBoolean( SPAWNED );
|
||||||
|
droppedPetals = bundle.getInt( PETALS );
|
||||||
}
|
}
|
||||||
|
|
||||||
public class roseRecharge extends ArtifactBuff {
|
public class roseRecharge extends ArtifactBuff {
|
||||||
|
@ -232,7 +239,13 @@ public class DriedRose extends Artifact {
|
||||||
public boolean doPickUp( Hero hero ) {
|
public boolean doPickUp( Hero hero ) {
|
||||||
DriedRose rose = hero.belongings.getItem( DriedRose.class );
|
DriedRose rose = hero.belongings.getItem( DriedRose.class );
|
||||||
|
|
||||||
if (rose != null && rose.level < rose.levelCap){
|
if (rose == null){
|
||||||
|
GLog.w("You have no rose to add this petal to.");
|
||||||
|
return false;
|
||||||
|
} if ( rose.level >= rose.levelCap ){
|
||||||
|
GLog.i("There is no room left for this petal, so you discard it.");
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
|
||||||
rose.upgrade();
|
rose.upgrade();
|
||||||
if (rose.level == rose.levelCap) {
|
if (rose.level == rose.levelCap) {
|
||||||
|
@ -246,11 +259,6 @@ public class DriedRose extends Artifact {
|
||||||
hero.spendAndNext(TIME_TO_PICK_UP);
|
hero.spendAndNext(TIME_TO_PICK_UP);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
GLog.w("You have no rose to add this petal to.");
|
|
||||||
return false;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -223,7 +223,8 @@ public abstract class Level implements Bundlable {
|
||||||
int petalsNeeded = (int) Math.ceil((float)((Dungeon.depth / 2) - rose.droppedPetals) / 3);
|
int petalsNeeded = (int) Math.ceil((float)((Dungeon.depth / 2) - rose.droppedPetals) / 3);
|
||||||
|
|
||||||
for (int i=1; i <= petalsNeeded; i++) {
|
for (int i=1; i <= petalsNeeded; i++) {
|
||||||
if (rose.droppedPetals < 10) {
|
//the player may miss a single petal and still max their rose.
|
||||||
|
if (rose.droppedPetals < 11) {
|
||||||
addItemToSpawn(new DriedRose.Petal());
|
addItemToSpawn(new DriedRose.Petal());
|
||||||
rose.droppedPetals++;
|
rose.droppedPetals++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user